tycho-components 0.0.1

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 (67) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.cjs +28 -0
  3. package/.eslintrc.json +31 -0
  4. package/.gitlab-ci.yml +14 -0
  5. package/.storybook/main.ts +32 -0
  6. package/.storybook/preview-head.html +4 -0
  7. package/.storybook/preview.css +6 -0
  8. package/.storybook/preview.tsx +29 -0
  9. package/README.md +93 -0
  10. package/package.json +66 -0
  11. package/src/AppColorpicker/AppColorpicker.tsx +69 -0
  12. package/src/AppColorpicker/index.tsx +3 -0
  13. package/src/AppColorpicker/style.scss +38 -0
  14. package/src/AppEditable/AppEditable.tsx +280 -0
  15. package/src/AppEditable/AppEditableField.ts +7 -0
  16. package/src/AppEditable/FormField.ts +26 -0
  17. package/src/AppEditable/FormFieldOption.ts +38 -0
  18. package/src/AppEditable/index.tsx +3 -0
  19. package/src/AppEditable/style.scss +94 -0
  20. package/src/AppModal/AppModal.tsx +93 -0
  21. package/src/AppModal/AppModalConfirm.tsx +62 -0
  22. package/src/AppModal/AppModalRemove.tsx +51 -0
  23. package/src/AppModal/index.tsx +3 -0
  24. package/src/AppModal/style.scss +65 -0
  25. package/src/AppToast/AppToast.tsx +94 -0
  26. package/src/AppToast/ToastMessage.ts +9 -0
  27. package/src/AppToast/index.tsx +3 -0
  28. package/src/AppToast/style.scss +0 -0
  29. package/src/Dummy/Dummy.stories.tsx +21 -0
  30. package/src/Dummy/Dummy.tsx +16 -0
  31. package/src/Dummy/index.tsx +3 -0
  32. package/src/Dummy/styles.scss +6 -0
  33. package/src/Participants/ParticipantCreate/ParticipantCreate.tsx +86 -0
  34. package/src/Participants/ParticipantCreate/index.tsx +3 -0
  35. package/src/Participants/ParticipantCreate/style.scss +32 -0
  36. package/src/Participants/ParticipantRemove/ParticipantRemove.tsx +51 -0
  37. package/src/Participants/ParticipantRemove/index.tsx +3 -0
  38. package/src/Participants/ParticipantRemove/style.scss +32 -0
  39. package/src/Participants/Participants.stories.tsx +45 -0
  40. package/src/Participants/Participants.tsx +145 -0
  41. package/src/Participants/index.tsx +3 -0
  42. package/src/Participants/style.scss +44 -0
  43. package/src/Participants/types/Participant.ts +43 -0
  44. package/src/Participants/types/ParticipantService.ts +18 -0
  45. package/src/configs/CommonContext.tsx +23 -0
  46. package/src/configs/CookieStorage.ts +36 -0
  47. package/src/configs/Localization.ts +28 -0
  48. package/src/configs/MessageUtils.ts +60 -0
  49. package/src/configs/Storage.ts +21 -0
  50. package/src/configs/api.ts +49 -0
  51. package/src/configs/localization/CommonTexts.ts +26 -0
  52. package/src/configs/localization/ParticipantsTexts.ts +40 -0
  53. package/src/configs/store/actions.ts +12 -0
  54. package/src/configs/store/reducer.ts +22 -0
  55. package/src/configs/store/store.ts +9 -0
  56. package/src/configs/store/types.ts +16 -0
  57. package/src/index.ts +4 -0
  58. package/src/react-app-env.d.ts +5 -0
  59. package/src/styles/_variables.scss +67 -0
  60. package/src/styles/bootstrap.min.css +9871 -0
  61. package/src/styles/main.scss +57 -0
  62. package/src/vite-env.d.ts +13 -0
  63. package/stories/Configure.mdx +171 -0
  64. package/stories/StorybookUtils.tsx +40 -0
  65. package/tsconfig.json +31 -0
  66. package/tsconfig.node.json +10 -0
  67. package/vite.config.ts +30 -0
@@ -0,0 +1,57 @@
1
+ @use '_variables.scss';
2
+
3
+ html,
4
+ body,
5
+ #root {
6
+ min-height: 100%;
7
+ background-color: var(--color-background);
8
+ font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
9
+ 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
10
+ 'Segoe UI Symbol', 'Noto Color Emoji';
11
+ }
12
+
13
+ .pointer {
14
+ cursor: pointer;
15
+ }
16
+
17
+ .app-button {
18
+ display: flex;
19
+ align-items: center;
20
+ border: none;
21
+ font-size: var(--font-size-button);
22
+ padding: 0px var(--spacing-small);
23
+ color: var(--color-dark);
24
+ background-color: transparent;
25
+ border-radius: 0;
26
+ cursor: pointer;
27
+
28
+ &.action {
29
+ border: 1px solid var(--color-disabled);
30
+ }
31
+
32
+ &:hover,
33
+ &.selected {
34
+ color: var(--color-dark);
35
+ background-color: var(--color-button-hover);
36
+ }
37
+
38
+ &:disabled {
39
+ color: var(--opacity-black-32);
40
+ background-color: var(--opacity-black-08);
41
+ cursor: not-allowed;
42
+ }
43
+ }
44
+
45
+ .icon-button {
46
+ border: none;
47
+ background-color: transparent;
48
+ padding: 4px 8px;
49
+ cursor: pointer;
50
+ }
51
+
52
+ .avatar {
53
+ width: inherit;
54
+ border-radius: 50%;
55
+ width: 32px;
56
+ height: 32px;
57
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="vite-plugin-svgr/client" />
2
+ /// <reference types="vitest" />
3
+ /// <reference types="vite/client" />
4
+
5
+ interface ImportMetaEnv {
6
+ readonly VITE_APP_TITLE: string;
7
+ readonly VITE_APP_URL_API: string;
8
+ readonly VITE_APP_PUBLIC_URL: string;
9
+ }
10
+
11
+ interface ImportMeta {
12
+ readonly env: ImportMetaEnv;
13
+ }
@@ -0,0 +1,171 @@
1
+ import { Meta } from '@storybook/blocks';
2
+
3
+ <Meta title="Component Library" />
4
+
5
+ <div className="sb-container">
6
+ <div className="sb-section-title"># Component Library</div>
7
+ </div>
8
+ <div className="sb-container">
9
+ <div className="sb-section-title">
10
+ ## TODO: Ajustar texto e estilo dessa tela
11
+ <a href="/?path=/docs/components-button--docs">Link de acesso ao Button</a>
12
+ </div>
13
+ </div>
14
+
15
+ <style>
16
+ {`
17
+ .sb-container {
18
+ margin-bottom: 48px;
19
+ }
20
+
21
+ .sb-section {
22
+ width: 100%;
23
+ display: flex;
24
+ flex-direction: row;
25
+ gap: 20px;
26
+ }
27
+
28
+ img {
29
+ object-fit: cover;
30
+ }
31
+
32
+ .sb-section-title {
33
+ margin-bottom: 32px;
34
+ }
35
+
36
+ .sb-section a:not(h1 a, h2 a, h3 a) {
37
+ font-size: 14px;
38
+ }
39
+
40
+ .sb-section-item, .sb-grid-item {
41
+ flex: 1;
42
+ display: flex;
43
+ flex-direction: column;
44
+ }
45
+
46
+ .sb-section-item-heading {
47
+ padding-top: 20px !important;
48
+ padding-bottom: 5px !important;
49
+ margin: 0 !important;
50
+ }
51
+ .sb-section-item-paragraph {
52
+ margin: 0;
53
+ padding-bottom: 10px;
54
+ }
55
+
56
+ .sb-chevron {
57
+ margin-left: 5px;
58
+ }
59
+
60
+ .sb-features-grid {
61
+ display: grid;
62
+ grid-template-columns: repeat(2, 1fr);
63
+ grid-gap: 32px 20px;
64
+ }
65
+
66
+ .sb-socials {
67
+ display: grid;
68
+ grid-template-columns: repeat(4, 1fr);
69
+ }
70
+
71
+ .sb-socials p {
72
+ margin-bottom: 10px;
73
+ }
74
+
75
+ .sb-explore-image {
76
+ max-height: 32px;
77
+ align-self: flex-start;
78
+ }
79
+
80
+ .sb-addon {
81
+ width: 100%;
82
+ display: flex;
83
+ align-items: center;
84
+ position: relative;
85
+ background-color: #EEF3F8;
86
+ border-radius: 5px;
87
+ border: 1px solid rgba(0, 0, 0, 0.05);
88
+ background: #EEF3F8;
89
+ height: 180px;
90
+ margin-bottom: 48px;
91
+ overflow: hidden;
92
+ }
93
+
94
+ .sb-addon-text {
95
+ padding-left: 48px;
96
+ max-width: 240px;
97
+ }
98
+
99
+ .sb-addon-text h4 {
100
+ padding-top: 0px;
101
+ }
102
+
103
+ .sb-addon-img {
104
+ position: absolute;
105
+ left: 345px;
106
+ top: 0;
107
+ height: 100%;
108
+ width: 200%;
109
+ overflow: hidden;
110
+ }
111
+
112
+ .sb-addon-img img {
113
+ width: 650px;
114
+ transform: rotate(-15deg);
115
+ margin-left: 40px;
116
+ margin-top: -72px;
117
+ box-shadow: 0 0 1px rgba(255, 255, 255, 0);
118
+ backface-visibility: hidden;
119
+ }
120
+
121
+ @media screen and (max-width: 800px) {
122
+ .sb-addon-img {
123
+ left: 300px;
124
+ }
125
+ }
126
+
127
+ @media screen and (max-width: 600px) {
128
+ .sb-section {
129
+ flex-direction: column;
130
+ }
131
+
132
+ .sb-features-grid {
133
+ grid-template-columns: repeat(1, 1fr);
134
+ }
135
+
136
+ .sb-socials {
137
+ grid-template-columns: repeat(2, 1fr);
138
+ }
139
+
140
+ .sb-addon {
141
+ height: 280px;
142
+ align-items: flex-start;
143
+ padding-top: 32px;
144
+ overflow: hidden;
145
+ }
146
+
147
+ .sb-addon-text {
148
+ padding-left: 24px;
149
+ }
150
+
151
+ .sb-addon-img {
152
+ right: 0;
153
+ left: 0;
154
+ top: 130px;
155
+ bottom: 0;
156
+ overflow: hidden;
157
+ height: auto;
158
+ width: 124%;
159
+ }
160
+
161
+ .sb-addon-img img {
162
+ width: 1200px;
163
+ transform: rotate(-12deg);
164
+ margin-left: 0;
165
+ margin-top: 48px;
166
+ margin-bottom: -40px;
167
+ margin-left: -24px;
168
+ }
169
+ }
170
+ `}
171
+ </style>
@@ -0,0 +1,40 @@
1
+ import { useArgs } from '@storybook/preview-api';
2
+ import type { StoryFn } from '@storybook/react';
3
+
4
+ const secondaryBackgroundColor = '#185ABD';
5
+
6
+ const withDynamicDocsBackground = (Story: StoryFn) => {
7
+ const [{ color }] = useArgs();
8
+
9
+ const backgroundColor = color === 'white' ? '#185ABD' : '#FFFFFF';
10
+ const docsStoryElement = document.querySelector('.docs-story');
11
+ if (docsStoryElement) {
12
+ docsStoryElement.setAttribute(
13
+ 'style',
14
+ `background-color: ${backgroundColor || 'defaultBackgroundColor'}`
15
+ );
16
+ }
17
+
18
+ return <Story />;
19
+ };
20
+
21
+ const withSecondaryDocsBackground = (Story: StoryFn) => {
22
+ const docsStoryElement = document.querySelector('.docs-story');
23
+ if (docsStoryElement) {
24
+ docsStoryElement.setAttribute(
25
+ 'style',
26
+ `background-color: ${
27
+ secondaryBackgroundColor || 'defaultBackgroundColor'
28
+ }`
29
+ );
30
+ }
31
+
32
+ return <Story />;
33
+ };
34
+
35
+ const StorybookUtils = {
36
+ withDynamicDocsBackground,
37
+ withSecondaryDocsBackground,
38
+ };
39
+
40
+ export default StorybookUtils;
package/tsconfig.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "allowSyntheticDefaultImports": true,
6
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "skipLibCheck": true,
9
+ "baseUrl": ".",
10
+ "paths": {
11
+ "@/*": ["src/*"]
12
+ },
13
+
14
+ /* Bundler mode */
15
+ "moduleResolution": "node",
16
+ "allowImportingTsExtensions": true,
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "noEmit": true,
20
+ "jsx": "react-jsx",
21
+
22
+ /* Linting */
23
+ "strict": true,
24
+ "noUnusedLocals": false,
25
+ "noUnusedParameters": false,
26
+ "noFallthroughCasesInSwitch": true
27
+ },
28
+ "include": ["**/*.ts", "**/*.tsx"],
29
+ "exclude": ["node_modules"],
30
+ "references": [{ "path": "./tsconfig.node.json" }]
31
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
8
+ },
9
+ "include": ["vite.config.ts"]
10
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ import pluginChecker from 'vite-plugin-checker';
2
+ import { defineConfig } from 'vitest/config';
3
+ import react from '@vitejs/plugin-react';
4
+ import svgr from 'vite-plugin-svgr';
5
+ import path from 'path';
6
+ import { loadEnv } from 'vite';
7
+
8
+ const envDir = './environment';
9
+
10
+ export default ({ mode }: { mode: any }) => {
11
+ const env = loadEnv(mode, envDir);
12
+
13
+ return defineConfig({
14
+ base: env.VITE_APP_PUBLIC_URL,
15
+ plugins: [react(), svgr(), pluginChecker({ typescript: true })],
16
+ envDir: envDir,
17
+ server: {
18
+ port: 3000,
19
+ },
20
+ resolve: {
21
+ alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
22
+ },
23
+ test: {
24
+ globals: true,
25
+ environment: 'jsdom',
26
+ setupFiles: './src/setupTest.ts',
27
+ css: false,
28
+ },
29
+ });
30
+ };