@esic-lab/data-core-ui 0.0.2 → 0.0.4

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 (63) hide show
  1. package/dist/index.css +784 -0
  2. package/dist/index.d.mts +111 -0
  3. package/dist/index.d.ts +111 -0
  4. package/dist/index.js +2004 -0
  5. package/dist/index.mjs +1980 -0
  6. package/package.json +10 -3
  7. package/.storybook/main.ts +0 -12
  8. package/.storybook/preview.ts +0 -16
  9. package/.storybook/vitest.setup.ts +0 -7
  10. package/postcss.config.js +0 -5
  11. package/src/Button/GhostButton/GhostButton.stories.tsx +0 -20
  12. package/src/Button/GhostButton/GhostButton.tsx +0 -26
  13. package/src/Button/PrimaryButton/PrimaryButton.stories.tsx +0 -21
  14. package/src/Button/PrimaryButton/PrimaryButton.tsx +0 -35
  15. package/src/Button/SecondaryButton/SecondaryButton.stories.tsx +0 -16
  16. package/src/Button/SecondaryButton/SecondaryButton.tsx +0 -26
  17. package/src/Checkbox/Checkbox/Checkbox.stories.tsx +0 -17
  18. package/src/Checkbox/Checkbox/Checkbox.tsx +0 -27
  19. package/src/Checkbox/CheckboxGroup/CheckboxGroup.stories.tsx +0 -35
  20. package/src/Checkbox/CheckboxGroup/CheckboxGroup.tsx +0 -23
  21. package/src/Loader/Loader/Loader.stories.tsx +0 -16
  22. package/src/Loader/Loader/Loader.tsx +0 -12
  23. package/src/NavBar/MenuNavBar/MenuNavBar.stories.tsx +0 -85
  24. package/src/NavBar/MenuNavBar/MenuNavBar.tsx +0 -43
  25. package/src/NavBar/TopNavBar/TopNavBar.stories.tsx +0 -16
  26. package/src/NavBar/TopNavBar/TopNavBar.tsx +0 -24
  27. package/src/Radio/Radio/Radio.stories.tsx +0 -17
  28. package/src/Radio/Radio/Radio.tsx +0 -15
  29. package/src/Radio/RadioGroup/RadioGroup.stories.tsx +0 -23
  30. package/src/Radio/RadioGroup/RadioGroup.tsx +0 -27
  31. package/src/Switch/Switch/Switch.stories.tsx +0 -18
  32. package/src/Switch/Switch/Switch.tsx +0 -25
  33. package/src/index.css +0 -260
  34. package/src/index.ts +0 -24
  35. package/stories/Button.stories.ts +0 -49
  36. package/stories/Button.tsx +0 -33
  37. package/stories/Configure.mdx +0 -364
  38. package/stories/Header.stories.ts +0 -29
  39. package/stories/Header.tsx +0 -47
  40. package/stories/Page.stories.ts +0 -28
  41. package/stories/Page.tsx +0 -69
  42. package/stories/assets/accessibility.png +0 -0
  43. package/stories/assets/accessibility.svg +0 -1
  44. package/stories/assets/addon-library.png +0 -0
  45. package/stories/assets/assets.png +0 -0
  46. package/stories/assets/avif-test-image.avif +0 -0
  47. package/stories/assets/context.png +0 -0
  48. package/stories/assets/discord.svg +0 -1
  49. package/stories/assets/docs.png +0 -0
  50. package/stories/assets/figma-plugin.png +0 -0
  51. package/stories/assets/github.svg +0 -1
  52. package/stories/assets/share.png +0 -0
  53. package/stories/assets/styling.png +0 -0
  54. package/stories/assets/testing.png +0 -0
  55. package/stories/assets/theming.png +0 -0
  56. package/stories/assets/tutorials.svg +0 -1
  57. package/stories/assets/youtube.svg +0 -1
  58. package/stories/button.css +0 -30
  59. package/stories/header.css +0 -32
  60. package/stories/page.css +0 -68
  61. package/tsconfig.json +0 -16
  62. package/vitest.config.js +0 -35
  63. /package/{src/assets/STO-logo.svg → dist/STO-logo-ADYYAPS3.svg} +0 -0
@@ -1,25 +0,0 @@
1
- interface SwitchProps {
2
- label?: string;
3
- checked: boolean;
4
- onChange: (checked: boolean) => void;
5
- }
6
-
7
- //TODO: CONFIRM DESIGN
8
- export function Switch({ label, checked, onChange }: SwitchProps) {
9
- return (
10
- <div className="flex items-center gap-[10px]">
11
- {label && <p>{label}</p>}
12
- <button
13
- type="button"
14
- onClick={() => onChange(!checked)}
15
- className={`w-13 h-7 flex items-center rounded-full p-1 transition-colors duration-300 cursor-pointer
16
- ${checked ? "bg-blue-500" : "bg-gray-300"}`}
17
- >
18
- <div
19
- className={`bg-white w-5 h-5 rounded-full shadow-md transform transition-transform duration-300
20
- ${checked ? "translate-x-6" : "translate-x-0"}`}
21
- />
22
- </button>
23
- </div>
24
- );
25
- }
package/src/index.css DELETED
@@ -1,260 +0,0 @@
1
- @import "tailwindcss";
2
-
3
- @import url("https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
4
-
5
- /*
6
- The default border color has changed to `currentcolor` in Tailwind CSS v4,
7
- so we've added these compatibility styles to make sure everything still
8
- looks the same as it did with Tailwind CSS v3.
9
-
10
- If we ever want to remove these styles, we need to add an explicit border
11
- color utility to any element that depends on these defaults.
12
- */
13
-
14
- @layer base {
15
- *,
16
- ::after,
17
- ::before,
18
- ::backdrop,
19
- ::file-selector-button {
20
- border-color: var(--color-gray-200, currentcolor);
21
- }
22
- }
23
-
24
- @theme {
25
- --spacing: 0.25rem;
26
-
27
- /* Primary */
28
- --color-primary-900: #212967;
29
- --color-primary-800: #2b3587;
30
- --color-primary-700: #3745af;
31
- --color-primary-600: #4758e0;
32
- --color-primary-500: #4e61f6;
33
- --color-primary-400: #7181f8;
34
- --color-primary-300: #8895f9;
35
- --color-primary-200: #aeb6fb;
36
- --color-primary-100: #c8cefc;
37
- --color-primary-50: #edeffe;
38
-
39
- /* Grey */
40
- --color-gray-900: #131927;
41
- --color-gray-800: #212936;
42
- --color-gray-700: #394050;
43
- --color-gray-600: #4d5461;
44
- --color-gray-500: #6d717f;
45
- --color-gray-400: #9ea2ae;
46
- --color-gray-300: #d2d5db;
47
- --color-gray-200: #e5e7ea;
48
- --color-gray-100: #f3f4f6;
49
- --color-gray-50: #f9fafb;
50
-
51
- /* Green / Success */
52
- --color-green-900: #1c4d27;
53
- --color-green-800: #256533;
54
- --color-green-700: #308242;
55
- --color-green-600: #3da755;
56
- --color-green-500: #43b75d;
57
- --color-green-400: #69c57d;
58
- --color-green-300: #81cf92;
59
- --color-green-200: #a9deb4;
60
- --color-green-100: #c5e9cd;
61
- --color-green-50: #ecf8ef;
62
-
63
- /* Red / Danger */
64
- --color-red-900: #641d1a;
65
- --color-red-800: #832523;
66
- --color-red-700: #a9302d;
67
- --color-red-600: #d93e39;
68
- --color-red-500: #ee443f;
69
- --color-red-400: #f16965;
70
- --color-red-300: #f4827e;
71
- --color-red-200: #f7a9a7;
72
- --color-red-100: #fac5c3;
73
- --color-red-50: #fdecec;
74
-
75
- /* Yellow / Warning */
76
- --color-yellow-900: #6b4700;
77
- --color-yellow-800: #8c5e00;
78
- --color-yellow-700: #b57900;
79
- --color-yellow-600: #e89b00;
80
- --color-yellow-500: #ffaa00;
81
- --color-yellow-400: #ffbb33;
82
- --color-yellow-300: #ffc654;
83
- --color-yellow-200: #ffd88a;
84
- --color-yellow-100: #ffe5b0;
85
- --color-yellow-50: #fff7e6;
86
-
87
- /* Blue / Info */
88
- --color-blue-900: #003f6b;
89
- --color-blue-800: #00528c;
90
- --color-blue-700: #006ab5;
91
- --color-blue-600: #0088e8;
92
- --color-blue-500: #0095ff;
93
- --color-blue-400: #33aaff;
94
- --color-blue-300: #54b8ff;
95
- --color-blue-200: #8aceff;
96
- --color-blue-100: #b0deff;
97
- --color-blue-50: #e6f4ff;
98
- }
99
-
100
- /* SYSTEM FONTS */
101
-
102
- .headline-1 {
103
- font-family: "Kanit";
104
- font-size: 48px;
105
- font-style: normal;
106
- font-weight: 600;
107
- line-height: 58px;
108
- }
109
-
110
- .headline-2 {
111
- font-family: "Kanit";
112
- font-size: 40px;
113
- font-style: normal;
114
- font-weight: 600;
115
- line-height: 48px;
116
- }
117
-
118
- .headline-3 {
119
- font-family: "Kanit";
120
- font-size: 32px;
121
- font-style: normal;
122
- font-weight: 600;
123
- line-height: 38px;
124
- }
125
-
126
- .headline-4 {
127
- font-family: "Kanit";
128
- font-size: 28px;
129
- font-style: normal;
130
- font-weight: 600;
131
- line-height: 34px;
132
- }
133
-
134
- .headline-5 {
135
- font-family: "Kanit";
136
- font-size: 24px;
137
- font-style: normal;
138
- font-weight: 600;
139
- line-height: 28px;
140
- }
141
-
142
- .subtitle-1 {
143
- font-family: "Kanit";
144
- font-size: 18px;
145
- font-style: normal;
146
- font-weight: 600;
147
- line-height: 28px;
148
- }
149
-
150
- .subtitle-2 {
151
- font-family: "Kanit";
152
- font-size: 16px;
153
- font-style: normal;
154
- font-weight: 600;
155
- line-height: 24px;
156
- }
157
-
158
- .body-1 {
159
- font-family: "Kanit";
160
- font-size: 16px;
161
- font-style: normal;
162
- font-weight: 400;
163
- line-height: 24px;
164
- }
165
-
166
- .body-2 {
167
- font-family: "Kanit";
168
- font-size: 16px;
169
- font-style: normal;
170
- font-weight: 500;
171
- line-height: 24px;
172
- }
173
-
174
- .body-3 {
175
- font-family: "Kanit";
176
- font-size: 14px;
177
- font-style: normal;
178
- font-weight: 400;
179
- line-height: 20px;
180
- }
181
-
182
- .body-4 {
183
- font-family: "Kanit";
184
- font-size: 14px;
185
- font-style: normal;
186
- font-weight: 500;
187
- line-height: 20px;
188
- }
189
-
190
- .caption-1 {
191
- font-family: "Kanit";
192
- font-size: 12px;
193
- font-style: normal;
194
- font-weight: 400;
195
- line-height: 16px;
196
- }
197
-
198
- .caption-2 {
199
- font-family: "Kanit";
200
- font-size: 12px;
201
- font-style: normal;
202
- font-weight: 500;
203
- line-height: 16px;
204
- }
205
-
206
- .caption-3 {
207
- font-family: "Kanit";
208
- font-size: 10px;
209
- font-style: normal;
210
- font-weight: 500;
211
- line-height: 14px;
212
- }
213
-
214
- .label {
215
- font-family: "Kanit";
216
- font-size: 12px;
217
- font-style: normal;
218
- font-weight: 500;
219
- line-height: 16px;
220
- }
221
-
222
- .btn-giant {
223
- font-family: "Kanit";
224
- font-size: 18px;
225
- font-style: normal;
226
- font-weight: 600;
227
- line-height: 24px;
228
- }
229
-
230
- .btn-large {
231
- font-family: "Kanit";
232
- font-size: 16px;
233
- font-style: normal;
234
- font-weight: 600;
235
- line-height: 20px;
236
- }
237
-
238
- .btn-medium {
239
- font-family: "Kanit";
240
- font-size: 12px;
241
- font-style: normal;
242
- font-weight: 600;
243
- line-height: 16px;
244
- }
245
-
246
- .btn-small {
247
- font-family: "Kanit";
248
- font-size: 12px;
249
- font-style: normal;
250
- font-weight: 600;
251
- line-height: 16px;
252
- }
253
-
254
- .btn-tiny {
255
- font-family: "Kanit";
256
- font-size: 10px;
257
- font-style: normal;
258
- font-weight: 600;
259
- line-height: 12px;
260
- }
package/src/index.ts DELETED
@@ -1,24 +0,0 @@
1
- import "./index.css";
2
-
3
- /* BUTTON */
4
- export { PrimaryButton } from "./Button/PrimaryButton/PrimaryButton";
5
- export { SecondaryButton } from "./Button/SecondaryButton/SecondaryButton";
6
- export { GhostButton } from "./Button/GhostButton/GhostButton";
7
-
8
- /* LOADER */
9
- export { Loader } from "./Loader/Loader/Loader";
10
-
11
- /* CHECKBOX */
12
- export { Checkbox } from "./Checkbox/Checkbox/Checkbox";
13
- export { CheckboxGroup } from "./Checkbox/CheckboxGroup/CheckboxGroup";
14
-
15
- /* RADIO */
16
- export { Radio } from "./Radio/Radio/Radio";
17
- export { RadioGroup } from "./Radio/RadioGroup/RadioGroup";
18
-
19
- /* SWITCH */
20
- export { Switch } from "./Switch/Switch/Switch";
21
-
22
- /* NAV */
23
- export { MenuNavBar } from "./NavBar/MenuNavBar/MenuNavBar";
24
- export { TopNavBar } from "./NavBar/TopNavBar/TopNavBar";
@@ -1,49 +0,0 @@
1
- import { fn } from 'storybook/test';
2
-
3
- import { Button } from './Button';
4
-
5
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
6
- export default {
7
- title: 'Example/Button',
8
- component: Button,
9
- parameters: {
10
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
- layout: 'centered',
12
- },
13
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
14
- tags: ['autodocs'],
15
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
- argTypes: {
17
- backgroundColor: { control: 'color' },
18
- },
19
- // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
20
- args: { onClick: fn() },
21
- };
22
-
23
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
24
- export const Primary = {
25
- args: {
26
- primary: true,
27
- label: 'Button',
28
- },
29
- };
30
-
31
- export const Secondary = {
32
- args: {
33
- label: 'Button',
34
- },
35
- };
36
-
37
- export const Large = {
38
- args: {
39
- size: 'large',
40
- label: 'Button',
41
- },
42
- };
43
-
44
- export const Small = {
45
- args: {
46
- size: 'small',
47
- label: 'Button',
48
- },
49
- };
@@ -1,33 +0,0 @@
1
- import React from "react";
2
-
3
- import PropTypes from "prop-types";
4
-
5
- import "./button.css";
6
-
7
- /** Primary UI component for user interaction */
8
- export const Button = ({ primary = false, backgroundColor = null, size = "medium", label, ...props }) => {
9
- const mode = primary ? "storybook-button--primary" : "storybook-button--secondary";
10
- return (
11
- <button
12
- type="button"
13
- className={["storybook-button", `storybook-button--${size}`, mode].join(" ")}
14
- style={backgroundColor && { backgroundColor }}
15
- {...props}
16
- >
17
- {label}
18
- </button>
19
- );
20
- };
21
-
22
- Button.propTypes = {
23
- /** Is this the principal call to action on the page? */
24
- primary: PropTypes.bool,
25
- /** What background color to use */
26
- backgroundColor: PropTypes.string,
27
- /** How large should the button be? */
28
- size: PropTypes.oneOf(["small", "medium", "large"]),
29
- /** Button contents */
30
- label: PropTypes.string.isRequired,
31
- /** Optional click handler */
32
- onClick: PropTypes.func,
33
- };