`) for navigation bar
10 |
11 |
12 |
13 | GitHub
14 |
15 |
16 |
17 | ```jsx
18 | import '@wevisdemo/ui/styles/nav-button-link.css';
19 | import WvNavButtonLink from '@wevisdemo/ui/{react,vue,svelte}/nav-button-link';
20 | ```
21 |
22 | ```jsx
23 |
24 | GitHub
25 |
26 | ```
27 |
28 | ## Props
29 |
30 | | Name | Type | Default |
31 | | ------ | ------- | -------------------------------- |
32 | | href | string | |
33 | | target | string | `'_blank'` |
34 | | rel | string | `'nofollow noopener noreferrer'` |
35 | | dark | boolean | `false` |
36 |
37 | ## Slot / Children
38 |
39 | Button content
40 |
41 | ## Examples
42 |
43 | **With dark theme**
44 |
45 |
46 |
47 | GitHub
48 |
49 |
50 |
51 | ```jsx
52 |
53 | GitHub
54 |
55 | ```
56 |
57 | **Internal link**
58 |
59 | Normally, the button link has a default props for `target` and `rel` suitable
60 | for making an external link. You can set them both to `undefined` to make an
61 | internal link.
62 |
63 |
64 |
65 | WeVis
66 |
67 |
68 |
69 | ```jsx
70 |
71 | WeVis
72 |
73 | ```
74 |
--------------------------------------------------------------------------------
/docs/src/pages/components/nav-button.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Nav Button
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvNavButton from '@wevisdemo/ui/react/nav-button';
7 | import '@wevisdemo/ui/styles/nav-button.css';
8 |
9 | A button for navigation bar
10 |
11 |
12 | About
13 |
14 |
15 | ```jsx
16 | import '@wevisdemo/ui/styles/nav-button.css';
17 | import WvNavButton from '@wevisdemo/ui/{react,vue,svelte}/nav-button';
18 | ```
19 |
20 | ```jsx
21 | About
22 | ```
23 |
24 | ## Props
25 |
26 | | Name | Type | Default |
27 | | ------- | ----------------------- | ----------- |
28 | | active | boolean | `false` |
29 | | dark | boolean | `false` |
30 | | onClick | () => void \| undefined | `undefined` |
31 |
32 | ## Slot / Children
33 |
34 | Button content
35 |
36 | ## Examples
37 |
38 | **Active button**
39 |
40 |
41 | About
42 |
43 |
44 | ```jsx
45 | About
46 | ```
47 |
48 | **With dark theme**
49 |
50 |
51 |
52 | About
53 |
54 | Report
55 |
56 |
57 | ```jsx
58 | About
59 | Report
60 | ```
61 |
--------------------------------------------------------------------------------
/docs/src/pages/components/nav-dropdown-item.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Nav Dropdown Item
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvNavDropdownItem from '@wevisdemo/ui/react/nav-dropdown-item';
7 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
8 |
9 | A dropdown for navigation bar. `WvNavDropdown` and `WvNavDropdownItem` must be used together.
10 |
11 |
12 | Topic 1
13 |
14 |
15 | ```jsx
16 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
17 | import WvNavDropdownItem from '@wevisdemo/ui/{react,vue,svelte}/nav-dropdown-item';
18 | ```
19 |
20 | ```jsx
21 | Topic 1
22 | ```
23 |
24 | ## Props
25 |
26 | | Name | Type | Default |
27 | | ---- | ------- | ------- |
28 | | dark | boolean | `false` |
29 |
30 | ## Slot / Children
31 |
32 | Item content
33 |
34 | ## Examples
35 |
36 | **Dark theme**
37 |
38 |
39 | Topic 1
40 |
41 |
42 | ```jsx
43 | Topic 1
44 | ```
45 |
--------------------------------------------------------------------------------
/docs/src/pages/components/nav-dropdown.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Nav Dropdown
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvNavDropdown from '@wevisdemo/ui/react/nav-dropdown';
7 | import WvNavDropdownItem from '@wevisdemo/ui/react/nav-dropdown-item';
8 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
9 | import '@wevisdemo/ui/styles/nav-dropdown.css';
10 |
11 | A dropdown for navigation bar. `WvNavDropdown` and `WvNavDropdownItem` must be used together.
12 |
13 |
14 |
15 | Topic 1
16 | Topic 2
17 | Topic 3
18 |
19 |
20 |
21 | ```jsx
22 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
23 | import '@wevisdemo/ui/styles/nav-dropdown.css';
24 | import WvNavDropdown from '@wevisdemo/ui/{react,vue,svelte}/nav-dropdown';
25 | import WvNavDropdownItem from '@wevisdemo/ui/{react,vue,svelte}/nav-dropdown-item';
26 | ```
27 |
28 | ```jsx
29 |
30 | Topic 1
31 | Topic 2
32 | Topic 3
33 |
34 | ```
35 |
36 | ## Props
37 |
38 | | Name | Type | Default |
39 | | ----- | ------- | ------- |
40 | | label | string | `''` |
41 | | dark | boolean | `false` |
42 |
43 | ## Slot / Children
44 |
45 | WvNavDropdownItem(s)
46 |
47 | ## Examples
48 |
49 | **Dark theme**
50 |
51 |
52 |
53 | Topic 1
54 | Topic 2
55 | Topic 3
56 |
57 |
58 |
59 | ```jsx
60 |
61 | Topic 1
62 | Topic 2
63 | Topic 3
64 |
65 | ```
66 |
--------------------------------------------------------------------------------
/docs/src/pages/components/navbar.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Navbar
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvNavButton from '@wevisdemo/ui/react/nav-button';
7 | import WvNavbar from '@wevisdemo/ui/react/navbar';
8 | import '@wevisdemo/ui/styles/nav-button.css';
9 | import '@wevisdemo/ui/styles/navbar.css';
10 |
11 | Main container for navigation bar group. Hamburger menu will be used to show slot items in mobile.
12 |
13 |
14 |
15 |
16 |
17 | ```jsx
18 | import '@wevisdemo/ui/styles/navbar.css';
19 | import WvNavbar from '@wevisdemo/ui/{react,vue,svelte}/navbar';
20 | ```
21 |
22 | ```jsx
23 |
24 | ```
25 |
26 | ## Props
27 |
28 | | Name | Type | Default |
29 | | --------------- | ---------------- | ------- |
30 | | homeHref | string | `'/'` |
31 | | title | string | `''` |
32 | | dark | boolean | `false` |
33 | | animated | boolean | `false` |
34 | | alwayShowSlot | boolean | `false` |
35 | | logoAddonSrc | string | `''` |
36 | | logoAddonAlt | string | `''` |
37 | | logoAddonWidth | string \| number | `0` |
38 | | logoAddonHeight | string \| number | `24` |
39 | | logoAddonPlus | boolean | `false` |
40 |
41 | ## Slot / Children
42 |
43 | Elements in the right column on desktop / hamburger menu dropdown on mobile
44 |
45 | ## Examples
46 |
47 | **With title and slot**
48 |
49 |
50 |
51 | About
52 | Report
53 |
54 |
55 |
56 | ```jsx
57 |
58 | About
59 | Report
60 |
61 | ```
62 |
63 | **With dark theme**
64 |
65 |
66 |
67 |
68 | About
69 |
70 | Report
71 |
72 |
73 |
74 | ```jsx
75 |
76 |
77 | About
78 |
79 | Report
80 |
81 | ```
82 |
83 | **With animated logo**
84 |
85 |
86 |
87 |
88 |
89 | ```jsx
90 |
91 | ```
92 |
93 | **With logo addon**
94 |
95 |
96 |
100 |
101 |
102 | ```jsx
103 |
104 | ```
105 |
106 | **With plus before logo addon**
107 |
108 |
109 |
114 |
115 |
116 | ```jsx
117 |
121 | ```
122 |
123 | **Alway show slot**
124 |
125 | Disable hamburger menu on mobile
126 |
127 |
128 |
129 | About
130 | Report
131 |
132 |
133 |
134 | ```jsx
135 |
136 | About
137 | Report
138 |
139 | ```
140 |
--------------------------------------------------------------------------------
/docs/src/pages/components/paragraph-group.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Paragraph Group
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvParagraphGroup from '@wevisdemo/ui/react/paragraph-group';
7 | import '@wevisdemo/ui/styles/paragraph-group.css';
8 |
9 | Paragraph group including heading and text, or other small children paragraph group
10 |
11 |
12 |
13 |
14 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
15 | Lorem Ipsum has been the industry's standard dummy text ever since the
16 | 1500s, when an unknown printer took a galley of type and scrambled it to
17 | make a type specimen book. It has survived not only five centuries, but
18 | also the leap into electronic typesetting, remaining essentially
19 | unchanged. It was popularised in the 1960s with the release of Letraset
20 | sheets containing Lorem Ipsum passages, and more recently with desktop
21 | publishing software like Aldus PageMaker including versions of Lorem
22 | Ipsum.
23 |
24 |
25 |
26 |
27 | ```jsx
28 | import '@wevisdemo/ui/styles/paragraph-group.css';
29 | import WvParagraphGroup from '@wevisdemo/ui/{react,vue,svelte}/paragraph-group';
30 | ```
31 |
32 | ```jsx
33 |
34 |
35 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
36 | Lorem Ipsum has been the industry's standard dummy text ever since the
37 | 1500s, when an unknown printer took a galley of type and scrambled it to
38 | make a type specimen book. It has survived not only five centuries, but also
39 | the leap into electronic typesetting, remaining essentially unchanged. It
40 | was popularised in the 1960s with the release of Letraset sheets containing
41 | Lorem Ipsum passages, and more recently with desktop publishing software
42 | like Aldus PageMaker including versions of Lorem Ipsum.
43 |
44 |
45 | ```
46 |
47 | ## Props
48 |
49 | | Name | Type | Default |
50 | | ------- | ------- | ------- |
51 | | heading | string | `''` |
52 | | small | boolean | `false` |
53 |
54 | ## Slot / Children
55 |
56 | Items apeended after heading
57 |
58 | ## Examples
59 |
60 | **Small size**
61 |
62 |
63 |
64 |
65 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
66 | It has survived not only five centuries, but also the leap into electronic
67 | typesetting, remaining essentially unchanged.
68 |
69 |
70 |
71 |
72 | ```jsx
73 |
74 |
75 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
76 | It has survived not only five centuries, but also the leap into electronic
77 | typesetting, remaining essentially unchanged.
78 |
79 |
80 | ```
81 |
--------------------------------------------------------------------------------
/docs/src/pages/components/sharer.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Sharer
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvSharer from '@wevisdemo/ui/react/sharer';
7 | import '@wevisdemo/ui/styles/sharer.css';
8 |
9 | Social media share buttons
10 |
11 |
12 |
13 |
14 |
15 | ```jsx
16 | import '@wevisdemo/ui/styles/sharer.css';
17 | import WvSharer from '@wevisdemo/ui/{react,vue,svelte}/sharer';
18 | ```
19 |
20 | ```jsx
21 |
22 | ```
23 |
24 | ## Props
25 |
26 | | Name | Type | Default |
27 | | ------------- | ------- | --------------------------------- |
28 | | url | string | `window.location.href` (on mount) |
29 | | label | string | `'Share'` |
30 | | hideLabel | boolean | `false` |
31 | | light | boolean | `false` |
32 | | outline | boolean | `false` |
33 | | center | boolean | `false` |
34 | | allowCopyLink | boolean | `false` |
35 |
36 | ## Examples
37 |
38 | **Custom or hide label**
39 |
40 |
41 |
42 |
43 |
44 |
45 | ```jsx
46 |
47 |
48 | ```
49 |
50 | **Light**
51 |
52 |
53 |
54 |
55 |
56 | ```jsx
57 |
58 | ```
59 |
60 | **Outline**
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | ```jsx
72 |
73 |
74 | ```
75 |
76 | **Center**
77 |
78 |
79 |
80 |
81 |
82 | ```jsx
83 |
84 | ```
85 |
86 | **Allow copy link to clipboard**
87 |
88 |
100 |
101 | ```jsx
102 |
103 |
104 |
105 |
106 | ```
107 |
--------------------------------------------------------------------------------
/docs/src/pages/cookbook/about-page.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: About Page
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvButton from '@wevisdemo/ui/react/button';
7 | import WvButtonGroup from '@wevisdemo/ui/react/button-group';
8 | import WvContainer from '@wevisdemo/ui/react/container';
9 | import WvParagraphGroup from '@wevisdemo/ui/react/paragraph-group';
10 | import WvSharer from '@wevisdemo/ui/react/sharer';
11 | import '@wevisdemo/ui/styles/button-group.css';
12 | import '@wevisdemo/ui/styles/button.css';
13 | import '@wevisdemo/ui/styles/container.css';
14 | import '@wevisdemo/ui/styles/paragraph-group.css';
15 | import '@wevisdemo/ui/styles/sharer.css';
16 |
17 | Standard about page using across multiple WeVis projects.
18 |
19 | **Please note** that you should add your project URL to the sharer.
20 |
21 |
22 |
23 |
24 |
25 | Lorem Ipsum is simply dummy text of the printing and typesetting
26 | industry. Lorem Ipsum has been the industry's standard dummy text ever
27 | since the 1500s, when an unknown printer took a galley of type and
28 | scrambled it to make a type specimen book. It has survived not only five
29 | centuries, but also the leap into electronic typesetting, remaining
30 | essentially unchanged. It was popularised in the 1960s with the release
31 | of Letraset sheets containing Lorem Ipsum passages, and more recently
32 | with desktop publishing software like Aldus PageMaker including versions
33 | of Lorem Ipsum.
34 |
35 |
36 |
37 |
38 |
39 | Lorem Ipsum is simply dummy text of the printing and typesetting
40 | industry.
41 |
42 |
43 | Lorem Ipsum has been the industry's standard dummy text ever since the
44 | 1500s.
45 |
46 |
47 | It has survived not only five centuries, but also the leap into
48 | electronic typesetting, remaining essentially unchanged.
49 |
50 |
51 |
52 |
53 |
54 | Lorem Ipsum is simply dummy text of the printing and typesetting
55 | industry. Lorem Ipsum has been the industry's standard dummy text ever
56 | since the 1500s, when an unknown printer took a galley of type and
57 | scrambled it to make a type specimen book. It has survived not only five
58 | centuries, but also the leap into electronic typesetting, remaining
59 | essentially unchanged. It was popularised in the 1960s with the release
60 | of Letraset sheets containing Lorem Ipsum passages, and more recently
61 | with desktop publishing software like Aldus PageMaker including versions
62 | of Lorem Ipsum.
63 |
64 |
65 |
66 |
67 | Lorem Ipsum
68 |
69 |
70 | Lorem Ipsum
71 |
72 |
73 | Lorem Ipsum, Dolor S. Amet
74 |
75 |
76 | Lorem Ipsum
77 |
78 |
79 |
80 |
86 | Punch Up
87 |
88 |
89 |
90 |
91 | Lorem Ipsum is simply dummy text of the printing and typesetting
92 | industry. Lorem Ipsum has been the industry's standard dummy text ever
93 | since the 1500s, when an unknown printer took a galley of type and
94 | scrambled it to make a type specimen book. It has survived not only five
95 | centuries, but also the leap into electronic typesetting, remaining
96 | essentially unchanged. It was popularised in the 1960s with the release
97 | of Letraset sheets containing Lorem Ipsum passages, and more recently
98 | with desktop publishing software like Aldus PageMaker including versions
99 | of Lorem Ipsum.
100 |
101 |
102 |
103 |
104 |
111 |
112 |
118 |
124 |
132 |
133 |
134 |
135 |
141 |
142 |
143 |
144 | ดาวน์โหลดข้อมูล
145 |
146 |
147 |
152 | Feedback
153 |
154 |
155 |
156 |
157 |
158 |
159 | ```jsx
160 | import WvButton from '@wevisdemo/ui/react/button';
161 | import WvButtonGroup from '@wevisdemo/ui/react/button-group';
162 | import WvContainer from '@wevisdemo/ui/react/container';
163 | import WvParagraphGroup from '@wevisdemo/ui/react/paragraph-group';
164 | import WvSharer from '@wevisdemo/ui/react/sharer';
165 | import '@wevisdemo/ui/styles/button-group.css';
166 | import '@wevisdemo/ui/styles/button.css';
167 | import '@wevisdemo/ui/styles/container.css';
168 | import '@wevisdemo/ui/styles/paragraph-group.css';
169 | import '@wevisdemo/ui/styles/sharer.css';
170 |
171 |
172 |
173 |
174 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
175 | Lorem Ipsum has been the industry's standard dummy text ever since the
176 | 1500s, when an unknown printer took a galley of type and scrambled it to
177 | make a type specimen book. It has survived not only five centuries, but
178 | also the leap into electronic typesetting, remaining essentially
179 | unchanged. It was popularised in the 1960s with the release of Letraset
180 | sheets containing Lorem Ipsum passages, and more recently with desktop
181 | publishing software like Aldus PageMaker including versions of Lorem
182 | Ipsum.
183 |
184 |
185 |
186 |
187 |
188 | Lorem Ipsum is simply dummy text of the printing and typesetting
189 | industry.
190 |
191 |
192 | Lorem Ipsum has been the industry's standard dummy text ever since the
193 | 1500s.
194 |
195 |
196 | It has survived not only five centuries, but also the leap into
197 | electronic typesetting, remaining essentially unchanged.
198 |
199 |
200 |
201 |
202 |
203 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
204 | Lorem Ipsum has been the industry's standard dummy text ever since the
205 | 1500s, when an unknown printer took a galley of type and scrambled it to
206 | make a type specimen book. It has survived not only five centuries, but
207 | also the leap into electronic typesetting, remaining essentially
208 | unchanged. It was popularised in the 1960s with the release of Letraset
209 | sheets containing Lorem Ipsum passages, and more recently with desktop
210 | publishing software like Aldus PageMaker including versions of Lorem
211 | Ipsum.
212 |
213 |
214 |
215 |
216 | Lorem Ipsum
217 |
218 |
219 | Lorem Ipsum
220 |
221 |
222 | Lorem Ipsum, Dolor S. Amet
223 |
224 |
225 | Lorem Ipsum
226 |
227 |
228 |
229 |
235 | Punch Up
236 |
237 |
238 |
239 |
240 | Lorem Ipsum is simply dummy text of the printing and typesetting industry.
241 | Lorem Ipsum has been the industry's standard dummy text ever since the
242 | 1500s, when an unknown printer took a galley of type and scrambled it to
243 | make a type specimen book. It has survived not only five centuries, but
244 | also the leap into electronic typesetting, remaining essentially
245 | unchanged. It was popularised in the 1960s with the release of Letraset
246 | sheets containing Lorem Ipsum passages, and more recently with desktop
247 | publishing software like Aldus PageMaker including versions of Lorem
248 | Ipsum.
249 |
250 |
251 |
252 |
253 |
260 |
261 |
267 |
273 |
281 |
282 |
283 |
284 |
290 |
291 |
292 |
293 | ดาวน์โหลดข้อมูล
294 |
295 |
296 |
301 | Feedback
302 |
303 |
304 |
305 | ;
306 | ```
307 |
--------------------------------------------------------------------------------
/docs/src/pages/cookbook/navigation-bar.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Navigation Bar
3 | layout: ../../layouts/MainLayout.astro
4 | ---
5 |
6 | import WvNavButton from '@wevisdemo/ui/react/nav-button';
7 | import WvNavDropdown from '@wevisdemo/ui/react/nav-dropdown';
8 | import WvNavDropdownItem from '@wevisdemo/ui/react/nav-dropdown-item';
9 | import WvNavbar from '@wevisdemo/ui/react/navbar';
10 | import '@wevisdemo/ui/styles/nav-button.css';
11 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
12 | import '@wevisdemo/ui/styles/nav-dropdown.css';
13 | import '@wevisdemo/ui/styles/navbar.css';
14 |
15 | ```jsx
16 | import '@wevisdemo/ui/styles/nav-button.css';
17 | import '@wevisdemo/ui/styles/nav-dropdown-item.css';
18 | import '@wevisdemo/ui/styles/nav-dropdown.css';
19 | import '@wevisdemo/ui/styles/navbar.css';
20 | ```
21 |
22 | ```jsx
23 | import WvNavButton from '@wevisdemo/ui/react/nav-button';
24 | import WvNavDropdown from '@wevisdemo/ui/react/nav-dropdown';
25 | import WvNavDropdownItem from '@wevisdemo/ui/react/nav-dropdown-item';
26 | import WvNavbar from '@wevisdemo/ui/react/navbar';
27 | ```
28 |
29 | ## Light
30 |
31 |
32 |
33 |
34 | Topic 1
35 | Topic 2
36 | Topic Something
37 |
38 | About
39 | Report
40 |
41 |
42 |
43 | ```jsx
44 |
45 |
46 | Topic 1
47 | Topic 2
48 | Topic Something
49 |
50 | About
51 | Report
52 |
53 | ```
54 |
55 | ## Dark
56 |
57 |
58 |
59 |
60 | Topic 1
61 | Topic 2
62 | Topic Something
63 |
64 |
65 | About
66 |
67 | Report
68 |
69 |
70 |
71 | ```jsx
72 |
73 |
74 | Topic 1
75 | Topic 2
76 | Topic Something
77 |
78 |
79 | About
80 |
81 | Report
82 |
83 | ```
84 |
--------------------------------------------------------------------------------
/docs/src/pages/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Getting Started
3 | description: Introduction and Getting Started
4 | layout: ../layouts/MainLayout.astro
5 | ---
6 |
7 | 
8 |
9 | This project aim to help any developer kick-start a new [WeVis](https://wevis.info) project with ease. The design system are co-developed with the designers, making consistancy between the library and Figma design.
10 |
11 | [View source code on GitHub](https://github.com/wevisdemo/design-systems)
12 |
13 | ## 1. Install the package
14 |
15 | with **NPM**
16 |
17 | ```shell
18 | npm i @wevisdemo/ui
19 | ```
20 |
21 | or with **Yarn**
22 |
23 | ```sh
24 | yarn add @wevisdemo/ui
25 | ```
26 |
27 | ## 2. Import the stylesheets
28 |
29 | ### 2.1 Single global stylesheet
30 |
31 | You can import all component style by importing `@wevisdemo/ui/styles/index.css` as a global according to your framework.
32 |
33 | For example, with **Nuxt.js**:
34 |
35 | ```js
36 | // nuxt.config.js
37 | {
38 | css: ['@wevisdemo/ui/styles/index.css'],
39 | }
40 | ```
41 |
42 | Most framework can be imported to main JavaScript or template file directly:
43 |
44 | ```js
45 | import '@wevisdemo/ui/styles/index.css';
46 | ```
47 |
48 | ### 2.2 Typography + per-component stylesheets
49 |
50 | To minimized build output, you can also import typography and individual component style:
51 |
52 | - Import `@wevisdemo/ui/styles/typography.css` instead of `index.css` as shown in step 2.1.
53 | - Import per component `@wevisdemo/ui/styles/.css` as shown in step 3.
54 |
55 | ## 3. Use the components
56 |
57 | Components are available for **Vue 3**, **React**, and **Svelte** which separated in package subdirectory. Recommends to import with `Wv` name prefix to avoid duplicated component name. For example:
58 |
59 | ```jsx
60 | import '@wevisdemo/ui/styles/button.css';
61 | import WvButton from '@wevisdemo/ui/{react,vue,svelte}/button';
62 |
63 | Hello ;
64 | ```
65 |
--------------------------------------------------------------------------------
/docs/src/pages/typography.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Typography
3 | layout: ../layouts/MainLayout.astro
4 | ---
5 |
6 | import FamilyTable from '../components/Typography/FamilyTable.tsx';
7 | import TypeScales from '../components/Typography/TypeScales.tsx';
8 |
9 | We provide CSS classes for font family, weight and size.
10 |
11 | In the latest release, if you are **not** importing the global stylesheet, you can import the typography style using the following:
12 |
13 | ```js
14 | import '@wevisdemo/ui/styles/typography.css';
15 | ```
16 |
17 | ## Family/Weight
18 |
19 |
20 |
21 | ## Type Scales
22 |
23 | Heading and body size will scale down on mobile. However, UI size will be the same on both mobile and desktop.
24 |
25 |
26 |
--------------------------------------------------------------------------------
/docs/src/styles/content.css:
--------------------------------------------------------------------------------
1 | .main-content {
2 | @apply prose text-black;
3 | @apply prose-headings:font-kondolar prose-headings:m-0 prose-headings:mb-2 prose-headings:mt-8 first:prose-headings:mt-0;
4 | @apply prose-p:m-0 prose-p:my-2;
5 | @apply prose-pre:m-0 prose-pre:my-2;
6 | @apply prose-ol:m-0 prose-ol:my-2 prose-ol:pl-[2ch] marker:prose-ol:text-black;
7 | @apply prose-ul:m-0 prose-ul:my-2 prose-ul:pl-[2ch] marker:prose-ul:text-black;
8 | @apply prose-li:p-0 prose-li:my-1;
9 | @apply before:prose-code:content-[''] after:prose-code:content-[''] prose-code:bg-[#0d1117] prose-code:text-white prose-code:font-normal prose-code:px-1 prose-code:py-0.5 prose-code:rounded;
10 | @apply prose-a:text-ultramarine prose-a:no-underline hover:prose-a:underline;
11 | }
12 |
13 | .main-content pre > code {
14 | @apply rounded-none bg-transparent p-0 text-inherit;
15 | }
16 |
17 | .component-preview {
18 | @apply my-2 rounded-md border border-dashed border-neutral-500 p-2;
19 | }
20 |
21 | .component-preview-dark {
22 | @apply my-2 rounded-md border border-dashed border-white bg-black p-2;
23 | }
24 |
--------------------------------------------------------------------------------
/docs/src/styles/index.css:
--------------------------------------------------------------------------------
1 | html {
2 | @apply overflow-x-hidden scroll-smooth;
3 | }
4 |
5 | .sidebar-li-a {
6 | @apply mb-1 inline-block w-full px-3 py-1.5;
7 | @apply hover:rounded-md hover:bg-neutral-200;
8 | @apply aria-[current=page]:rounded-md aria-[current=page]:bg-black aria-[current=page]:text-white;
9 | }
10 |
--------------------------------------------------------------------------------
/docs/tailwind.config.cjs:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | const defaultTheme = require('tailwindcss/defaultTheme');
3 |
4 | module.exports = {
5 | content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
6 | theme: {
7 | fontFamily: {
8 | sans: ['IBM Plex Sans Thai', ...defaultTheme.fontFamily.sans],
9 | serif: ['Kondolar Thai', ...defaultTheme.fontFamily.serif],
10 | mono: [
11 | 'Jetbrains Mono',
12 | ...defaultTheme.fontFamily.mono,
13 | 'IBM Plex Sans Thai',
14 | ],
15 | kondolar: ['Kondolar Thai', ...defaultTheme.fontFamily.mono],
16 | },
17 | extend: {
18 | gridTemplateColumns: {
19 | content: '1fr 4fr 1fr',
20 | },
21 | colors: {
22 | ultramarine: '#3904E9',
23 | },
24 | },
25 | },
26 | plugins: [require('@tailwindcss/typography')],
27 | };
28 |
--------------------------------------------------------------------------------
/docs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "astro/tsconfigs/strict",
3 | "compilerOptions": {
4 | "jsx": "preserve",
5 | "skipLibCheck": true
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "design-systems",
3 | "version": "1.0.0",
4 | "license": "MIT",
5 | "private": true,
6 | "type": "module",
7 | "scripts": {
8 | "dev": "turbo run dev",
9 | "build": "turbo run build",
10 | "format": "prettier --write --ignore-unknown .",
11 | "prepare": "husky"
12 | },
13 | "lint-staged": {
14 | "*": "prettier --write --ignore-unknown"
15 | },
16 | "devDependencies": {
17 | "@commitlint/cli": "^19.3.0",
18 | "@commitlint/config-conventional": "^19.2.2",
19 | "@trivago/prettier-plugin-sort-imports": "^4.3.0",
20 | "husky": "^9.0.11",
21 | "lint-staged": "^15.2.5",
22 | "prettier": "^3.3.1",
23 | "prettier-plugin-tailwindcss": "^0.6.1",
24 | "turbo": "^2.3.0"
25 | },
26 | "workspaces": {
27 | "packages": [
28 | "docs",
29 | "ui"
30 | ]
31 | },
32 | "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
33 | }
34 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "tasks": {
3 | "dev": {
4 | "cache": false
5 | },
6 | "build": {
7 | "dependsOn": ["^build"]
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ui/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parser: '@typescript-eslint/parser',
3 | plugins: ['@typescript-eslint', '@builder.io/mitosis'],
4 | extends: [
5 | 'eslint:recommended',
6 | 'plugin:@typescript-eslint/recommended',
7 | 'plugin:@builder.io/mitosis/recommended',
8 | ],
9 | };
10 |
--------------------------------------------------------------------------------
/ui/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | build
3 | /react
4 | /svelte
5 | /vue
6 | /styles
7 | .mitosis
8 | .svelte-kit
--------------------------------------------------------------------------------
/ui/README.md:
--------------------------------------------------------------------------------
1 | # @wevisdemo/ui
2 |
3 | A stylesheets and front-end components library to help any developer easily kick-start a new [WeVis](https://wevis.info) project. The design system are co-developed with the designers, making the library and Figma design consistent.
4 |
5 | 
6 |
7 | [View full documentation](https://wevisdemo.github.io/design-systems)
8 |
--------------------------------------------------------------------------------
/ui/mitosis.config.cjs:
--------------------------------------------------------------------------------
1 | /** @type {import('@builder.io/mitosis').MitosisConfig} */
2 | module.exports = {
3 | files: 'src/components/**',
4 | targets: ['vue', 'svelte', 'react'],
5 | dest: '.mitosis',
6 | getTargetPath: function (prop) {
7 | return prop.target;
8 | },
9 | options: {
10 | vue: {
11 | api: 'composition',
12 | typescript: true,
13 | },
14 | svelte: {
15 | typescript: true,
16 | },
17 | react: {
18 | typescript: true,
19 | },
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@wevisdemo/ui",
3 | "version": "8.1.0",
4 | "license": "MIT",
5 | "type": "module",
6 | "homepage": "https://wevisdemo.github.io/design-system/",
7 | "repository": {
8 | "type": "git",
9 | "url": "git+https://github.com/wevisdemo/design-system.git"
10 | },
11 | "scripts": {
12 | "dev": "concurrently --kill-others \"npm run dev:component\" \"npm run dev:stylesheet\"",
13 | "dev:component": "chokidar \"src/components/**/*.tsx\" --initial -c \"npm run build:mitosis && npm run build:react\"",
14 | "dev:stylesheet": "postcss src/styles/**/*.css --dir styles --watch",
15 | "build": "concurrently \"npm run build:component\" \"npm run build:stylesheet\"",
16 | "build:component": "npm run build:mitosis && concurrently \"npm run build:react\" \"npm run build:svelte\" \"npm run build:vue\"",
17 | "build:mitosis": "sh scripts/build-mitosis.sh",
18 | "build:react": "tsc -p tsconfig.react.json",
19 | "build:svelte": "svelte-kit sync && svelte-package -i .mitosis/svelte -o svelte --tsconfig tsconfig.svelte.json",
20 | "build:vue": "vite build --config vite.config.vue.ts",
21 | "build:stylesheet": "postcss src/styles/**/*.css --dir styles --env production",
22 | "lint": "eslint --fix ./src/**/*.tsx"
23 | },
24 | "devDependencies": {
25 | "@builder.io/eslint-plugin-mitosis": "^0.0.16",
26 | "@builder.io/mitosis": "^0.3.2",
27 | "@builder.io/mitosis-cli": "^0.3.2",
28 | "@sveltejs/adapter-auto": "^3.0.0",
29 | "@sveltejs/kit": "^2.0.0",
30 | "@sveltejs/package": "^2.0.0",
31 | "@sveltejs/vite-plugin-svelte": "^3.0.0",
32 | "@types/react": "^18.0.25",
33 | "@types/react-dom": "^18.0.8",
34 | "@typescript-eslint/eslint-plugin": "^7.12.0",
35 | "@typescript-eslint/parser": "^7.12.0",
36 | "@vitejs/plugin-vue": "^5.0.4",
37 | "autoprefixer": "^10.4.18",
38 | "chokidar-cli": "^3.0.0",
39 | "concurrently": "^8.2.2",
40 | "cssnano": "^6.1.0",
41 | "eslint": "^8.57.0",
42 | "postcss": "^8.4.37",
43 | "postcss-cli": "^11.0.0",
44 | "postcss-import": "^16.0.1",
45 | "svelte": "^4.2.12",
46 | "tailwindcss": "^3.4.1",
47 | "typescript": "^5.4.2",
48 | "vite": "^5.1.4",
49 | "vite-plugin-dts": "^3.7.3",
50 | "vue": "^3.4.21"
51 | },
52 | "files": [
53 | "/react",
54 | "/svelte",
55 | "/vue",
56 | "/styles"
57 | ]
58 | }
59 |
--------------------------------------------------------------------------------
/ui/postcss.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | require('postcss-import'),
4 | require('tailwindcss'),
5 | require('autoprefixer'),
6 | ...(process.env.NODE_ENV === 'production' ? [require('cssnano')] : []),
7 | ],
8 | };
9 |
--------------------------------------------------------------------------------
/ui/scripts/build-mitosis.sh:
--------------------------------------------------------------------------------
1 | # Mitosis build
2 | npx mitosis build --config=mitosis.config.cjs
3 |
4 | # Flatten build dir
5 | find .mitosis/react/src -wholename "*.tsx" -exec mv '{}' .mitosis/react \;
6 | find .mitosis/svelte/src -wholename "*.svelte" -exec mv '{}' .mitosis/svelte \;
7 | find .mitosis/vue/src -wholename "*.vue" -exec mv '{}' .mitosis/vue \;
8 | rm -r .mitosis/*/src
9 |
10 | # Remove JSX type from Vue and Svelte file
11 | find .mitosis/vue -type f -wholename "*.vue" -exec sed -i 's/JSX.Element/Element/g' {} \;
12 | find .mitosis/svelte -type f -wholename "*.svelte" -exec sed -i 's/JSX.Element/Element/g' {} \;
13 |
14 | # Fix React camelcase SVG property (fill-rule, clip-rule) https://github.com/BuilderIO/mitosis/issues/526
15 | find .mitosis/react -type f -wholename "*.tsx" -exec sed -i 's/-rule=/Rule=/g' {} \;
16 |
--------------------------------------------------------------------------------
/ui/src/components/button-group/button-group.css:
--------------------------------------------------------------------------------
1 | .wv_button-group {
2 | @apply flex flex-col space-y-2 md:flex-row md:space-x-2 md:space-y-0;
3 | }
4 |
5 | .wv_button-group--center {
6 | @apply justify-center;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/components/button-group/button-group.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvButtonGroupProps {
5 | center: boolean;
6 | children?: JSX.Element | JSX.Element[] | string | number;
7 | }
8 |
9 | export default function WvButtonGroup(props: WvButtonGroupProps) {
10 | useDefaultProps({
11 | center: false,
12 | });
13 |
14 | return (
15 |
18 | {props.children}
19 |
20 | );
21 | }
22 |
--------------------------------------------------------------------------------
/ui/src/components/button-link/button-link.css:
--------------------------------------------------------------------------------
1 | @import '../button/button.css';
2 |
3 | a.wv_button {
4 | @apply inline-flex !no-underline;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/components/button-link/button-link.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvButtonLinkProps {
5 | href: string;
6 | color: 'blue' | 'black' | 'white';
7 | small: boolean;
8 | target: string | undefined;
9 | rel: string | undefined;
10 | children?: JSX.Element | JSX.Element[] | string | number;
11 | }
12 |
13 | export default function WvButtonLink(props: WvButtonLinkProps) {
14 | useDefaultProps>({
15 | color: 'blue',
16 | small: false,
17 | target: '_blank',
18 | rel: 'nofollow noopener noreferrer',
19 | });
20 |
21 | return (
22 |
30 | {props.children}
31 |
32 | );
33 | }
34 |
--------------------------------------------------------------------------------
/ui/src/components/button/button.css:
--------------------------------------------------------------------------------
1 | .wv_button {
2 | @apply flex min-w-[190px] cursor-pointer flex-row items-center justify-center space-x-2 rounded-[2px] border-[2px] border-solid bg-transparent px-4 py-3;
3 | }
4 |
5 | .wv_button--blue {
6 | @apply text-ultramarine border-ultramarine hover:bg-ultramarine hover:text-white;
7 | }
8 |
9 | .wv_button--black {
10 | @apply border-black text-black hover:bg-black hover:text-white;
11 | }
12 |
13 | .wv_button--white {
14 | @apply border-white text-white hover:bg-white hover:text-black;
15 | }
16 |
17 | .wv_button--small {
18 | @apply min-w-0 py-1;
19 | }
20 |
--------------------------------------------------------------------------------
/ui/src/components/button/button.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvButtonProps {
5 | color: 'blue' | 'black' | 'white';
6 | small: boolean;
7 | onClick: () => void;
8 | children?: JSX.Element | JSX.Element[] | string | number;
9 | }
10 |
11 | export default function WvButton(props: WvButtonProps) {
12 | useDefaultProps({
13 | color: 'blue',
14 | small: false,
15 | onClick: () => {},
16 | });
17 |
18 | return (
19 | props.onClick()}
25 | >
26 | {props.children}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/ui/src/components/container/container.css:
--------------------------------------------------------------------------------
1 | .wv_container {
2 | @apply mx-auto max-w-2xl space-y-12 px-2 py-16;
3 | }
4 |
5 | .wv_container h1 {
6 | @apply m-0 text-center;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/components/container/container.lite.tsx:
--------------------------------------------------------------------------------
1 | import { Show, useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvContainerProps {
5 | heading: string;
6 | children?: JSX.Element | JSX.Element[] | string | number;
7 | }
8 |
9 | export default function WvContainer(props: WvContainerProps) {
10 | useDefaultProps({
11 | heading: undefined,
12 | });
13 |
14 | return (
15 |
16 |
17 | {props.heading}
18 |
19 |
20 | {props.children}
21 |
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/ui/src/components/cookie-consent/cookie-consent.css:
--------------------------------------------------------------------------------
1 | .wv_cookie-consent {
2 | @apply fixed z-50 bg-black bg-opacity-80 text-white;
3 | }
4 |
5 | .wv_cookie-consent button {
6 | @apply cursor-pointer border-none bg-transparent;
7 | }
8 |
9 | .wv_cookie-consent--banner {
10 | @apply inset-x-0 bottom-0;
11 | }
12 |
13 | .wv_cookie-consent--popup {
14 | @apply left-1/2 top-1/2 w-[600px] max-w-[100vw];
15 | transform: translate(-50%, -50%);
16 | }
17 |
18 | .wv_cookie-consent__container {
19 | @apply flex flex-col space-y-6 p-5 md:p-8;
20 | }
21 |
22 | .wv_cookie-consent--banner > .wv_cookie-consent__container {
23 | @apply mx-auto w-full max-w-screen-xl md:flex-row md:space-x-4 md:space-y-0;
24 | }
25 |
26 | .wv_cookie-consent__close {
27 | @apply absolute right-4 top-4 p-2;
28 | }
29 |
30 | .wv_cookie-consent__lang {
31 | @apply flex flex-row items-start;
32 | }
33 |
34 | .wv_cookie-consent__lang > button {
35 | @apply px-2 text-white;
36 | }
37 |
38 | .wv_cookie-consent__lang > button.inactive {
39 | @apply opacity-50 hover:opacity-70;
40 | }
41 |
42 | .wv_cookie-consent__lang > button:not(:last-child) {
43 | @apply border-0 border-r border-solid border-white border-opacity-50;
44 | }
45 |
46 | .wv_cookie-consent__options > label {
47 | @apply flex cursor-pointer flex-row items-center space-x-3 border-0 border-b border-solid border-white border-opacity-20 py-4 first-of-type:cursor-not-allowed;
48 | }
49 |
50 | .wv_cookie-consent__options > label > input {
51 | @apply cursor-[inherit];
52 | }
53 |
54 | .wv_cookie-consent__options > h2 {
55 | @apply m-0 text-white;
56 | }
57 |
58 | .wv_cookie-consent__body {
59 | @apply text-center md:text-left;
60 | }
61 |
62 | .wv_cookie-consent__body > a {
63 | @apply text-mint cursor-pointer;
64 | }
65 |
66 | .wv_cookie-consent__actions {
67 | @apply flex w-full max-w-xs flex-row items-center space-x-3;
68 | }
69 |
70 | .wv_cookie-consent__actions > button {
71 | @apply flex-1 rounded-[2px] border-[1px] border-solid border-white px-4 py-3;
72 | }
73 |
74 | .wv_cookie-consent__actions > button:first-child {
75 | @apply bg-transparent text-white hover:bg-white hover:bg-opacity-20;
76 | }
77 |
78 | .wv_cookie-consent__actions > button:last-child {
79 | @apply hover:bg-mint hover:border-mint bg-white text-black;
80 | }
81 |
--------------------------------------------------------------------------------
/ui/src/components/cookie-consent/cookie-consent.lite.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | For,
3 | onMount,
4 | Show,
5 | useDefaultProps,
6 | useStore,
7 | } from '@builder.io/mitosis';
8 |
9 | type CookieType =
10 | | 'Functionality'
11 | | 'Performance'
12 | | 'Advertising'
13 | | (string & Record);
14 | type CookieSetting = Partial>;
15 |
16 | interface WvCookieBannerProps {
17 | policyUrl: string;
18 | cookieOptions: CookieType[];
19 | daysToExpire: number;
20 | onAccept: (selectedCookies: CookieSetting) => void;
21 | }
22 |
23 | export default function WvCookieBanner(props: WvCookieBannerProps) {
24 | useDefaultProps>({
25 | onAccept: () => {},
26 | daysToExpire: 30,
27 | });
28 |
29 | const state = useStore({
30 | translation: {
31 | bannerBody: {
32 | ไทย: 'เว็บไซต์นี้ใช้คุกกี้เพื่อเพิ่มประสิทธิภาพและประสบการณ์ที่ดีในการใช้งานเว็บไซต์ โดยเราจะใช้คุกกี้เมื่อท่านเข้ามาหน้าเว็บไซต์ คุณสามารถอ่านรายละเอียดเพิ่มเติมได้ที่',
33 | EN: 'This website uses cookies to improve your online experience. They were placed on your browser when you launched this website. You can read more detail by clicking',
34 | },
35 | popupBody: {
36 | ไทย: 'คุกกี้เหล่านี้จำเป็นสำหรับการทำงานของเว็บไซต์และไม่สามารถปิดได้จากหน้าเว็บไซต์ อย่างไรก็ตาม ท่านสามารถบล็อคการใช้งานคุกกี้ได้จากบราวเซอร์ของท่านซึ่งอาจจะส่งผลกระทบกับการใช้งานเว็บไซต์ได้ คุณสามารถอ่านรายละเอียดเพิ่มเติมได้ที่',
37 | EN: 'These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information. You can read more detail by clicking Cookie Policy',
38 | },
39 | policyLink: {
40 | ไทย: 'นโยบายคุกกี้',
41 | EN: 'Cookie Policy',
42 | },
43 | acceptAll: {
44 | ไทย: 'ยอมรับทั้งหมด',
45 | EN: 'Accept all',
46 | },
47 | setting: {
48 | ไทย: 'การตั้งค่าคุกกี้',
49 | EN: 'Cookie settings',
50 | },
51 | save: {
52 | ไทย: 'บันทึกการตั้งค่า',
53 | EN: 'Save settings',
54 | },
55 | } as Record>,
56 | activeLang: 'ไทย',
57 | isShow: false,
58 | isSettingOpen: false,
59 | selectedCookies: {} as CookieSetting,
60 | createCookieSetting(value: boolean): CookieSetting {
61 | return props.cookieOptions
62 | ? props.cookieOptions.reduce(
63 | (obj, option) => ({ ...obj, [option]: value }),
64 | {} as CookieSetting,
65 | )
66 | : ({} as CookieSetting);
67 | },
68 | openSetting() {
69 | state.selectedCookies = state.createCookieSetting(false);
70 | state.isSettingOpen = true;
71 | },
72 | save(options: CookieSetting) {
73 | const expiredAtMs =
74 | new Date().getTime() +
75 | (props.daysToExpire as number) * 24 * 60 * 60 * 1000;
76 |
77 | localStorage.setItem('cookieSetting', JSON.stringify(options));
78 | localStorage.setItem('cookieSettingExpireAt', `${expiredAtMs}`);
79 |
80 | props.onAccept(options);
81 | state.isShow = false;
82 | },
83 | });
84 |
85 | onMount(() => {
86 | const localStorageCookieSetting = localStorage.getItem('cookieSetting');
87 |
88 | const localStorageCookieExpireAt = localStorage.getItem(
89 | 'cookieSettingExpireAt',
90 | );
91 |
92 | if (
93 | localStorageCookieSetting &&
94 | localStorageCookieExpireAt &&
95 | new Date().getTime() < new Date(+localStorageCookieExpireAt).getTime()
96 | ) {
97 | props.onAccept?.(JSON.parse(localStorageCookieSetting) as CookieSetting);
98 | } else {
99 | localStorage.removeItem('cookieSetting');
100 | localStorage.removeItem('cookieSettingExpireAt');
101 |
102 | state.isShow = true;
103 | }
104 | });
105 |
106 | return (
107 |
108 |
113 |
114 | (state.isSettingOpen = false)}
118 | >
119 |
120 |
128 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 | {(lang) => (
144 | (state.activeLang = lang)}
151 | >
152 | {lang}
153 |
154 | )}
155 |
156 |
157 |
158 |
159 |
160 |
161 | {state.translation.setting[state.activeLang]}
162 |
163 |
164 |
165 | Strictly Necessary Cookies
166 |
167 |
168 | {(option) => (
169 |
170 |
174 | (state.selectedCookies = {
175 | ...state.selectedCookies,
176 | [option]: event.target?.['checked'],
177 | })
178 | }
179 | />
180 | {`${option} Cookies`}
181 |
182 | )}
183 |
184 |
185 |
186 |
187 |
188 | {
189 | state.translation[
190 | state.isSettingOpen ? 'popupBody' : 'bannerBody'
191 | ][state.activeLang]
192 | }{' '}
193 |
194 | {state.translation.policyLink[state.activeLang]}
195 |
196 |
197 |
198 |
199 | state.openSetting()}
206 | >
207 | {state.translation.setting[state.activeLang]}
208 |
209 | }
210 | >
211 | state.save(state.createCookieSetting(true))}
215 | >
216 | {state.translation.acceptAll[state.activeLang]}
217 |
218 |
219 |
220 | state.save(state.createCookieSetting(true))}
227 | >
228 | {state.translation.acceptAll[state.activeLang]}
229 |
230 | }
231 | >
232 | state.save(state.selectedCookies)}
236 | >
237 | {state.translation.save[state.activeLang]}
238 |
239 |
240 |
241 |
242 |
243 |
244 | );
245 | }
246 |
--------------------------------------------------------------------------------
/ui/src/components/footer/footer.css:
--------------------------------------------------------------------------------
1 | .wv_footer {
2 | @apply flex flex-row space-x-3 px-4 py-3 md:space-x-5 md:px-6 md:py-5;
3 | }
4 |
5 | .wv_footer--black {
6 | @apply bg-black text-white;
7 | }
8 |
9 | .wv_footer--black svg {
10 | @apply fill-white;
11 | }
12 |
13 | .wv_footer--white {
14 | @apply bg-white text-black;
15 | }
16 |
17 | .wv_footer--white svg {
18 | @apply fill-black;
19 | }
20 |
21 | .wv_footer__logo {
22 | @apply mr-auto flex items-center;
23 | }
24 |
25 | .wv_footer__logo svg {
26 | @apply h-4 md:h-6;
27 | }
28 |
29 | .wv_footer__terms {
30 | @apply flex items-center justify-center;
31 | }
32 |
33 | .wv_footer--black .wv_footer__terms a {
34 | @apply text-white;
35 | }
36 |
37 | .wv_footer--white .wv_footer__terms a {
38 | @apply text-black;
39 | }
40 |
41 | .wv_footer__divider {
42 | @apply w-[1px] opacity-30;
43 | }
44 |
45 | .wv_footer--black .wv_footer__divider {
46 | @apply bg-white;
47 | }
48 |
49 | .wv_footer--white .wv_footer__divider {
50 | @apply bg-black;
51 | }
52 |
53 | .wv_footer__follow {
54 | @apply flex flex-row items-center md:space-x-2;
55 | }
56 |
57 | .wv_footer__follow span {
58 | @apply hidden md:inline-block;
59 | }
60 |
61 | .wv_footer__follow a {
62 | @apply flex items-center;
63 | }
64 |
--------------------------------------------------------------------------------
/ui/src/components/footer/footer.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 |
3 | interface WvFooterProps {
4 | dark: boolean;
5 | }
6 |
7 | export default function WvFooter(props: WvFooterProps) {
8 | useDefaultProps({ dark: false });
9 |
10 | return (
11 |
112 | );
113 | }
114 |
--------------------------------------------------------------------------------
/ui/src/components/nav-button-link/nav-button-link.css:
--------------------------------------------------------------------------------
1 | @import '../nav-button/nav-button.css';
2 |
3 | a.wv_nav-button {
4 | @apply inline-flex;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/components/nav-button-link/nav-button-link.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvNavButtonLinkProps {
5 | href: string;
6 | target: string | undefined;
7 | rel: string | undefined;
8 | dark: boolean;
9 | children?: JSX.Element | JSX.Element[] | string | number;
10 | }
11 |
12 | export default function WvNavButtonLink(props: WvNavButtonLinkProps) {
13 | useDefaultProps>({
14 | target: '_blank',
15 | rel: 'nofollow noopener noreferrer',
16 | dark: false,
17 | });
18 |
19 | return (
20 |
28 | {props.children}
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/ui/src/components/nav-button/nav-button.css:
--------------------------------------------------------------------------------
1 | .wv_nav-button {
2 | @apply flex h-full w-full cursor-pointer flex-row items-center justify-center space-x-1 rounded border-none bg-transparent px-2 py-3 underline-offset-2 hover:underline md:w-auto md:py-1;
3 | }
4 |
5 | .wv_nav-button--black {
6 | @apply text-black;
7 | }
8 |
9 | .wv_nav-button--white {
10 | @apply text-white;
11 | }
12 |
13 | .wv_nav-button--active {
14 | @apply underline;
15 | }
16 |
--------------------------------------------------------------------------------
/ui/src/components/nav-button/nav-button.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvNavButtonProps {
5 | dark: boolean;
6 | active: boolean;
7 | onClick: () => void;
8 | children?: JSX.Element | JSX.Element[] | string | number;
9 | }
10 |
11 | export default function WvNavButton(props: WvNavButtonProps) {
12 | useDefaultProps({
13 | dark: false,
14 | active: false,
15 | onClick: () => {},
16 | });
17 |
18 | return (
19 | props.onClick()}
25 | >
26 | {props.children}
27 |
28 | );
29 | }
30 |
--------------------------------------------------------------------------------
/ui/src/components/nav-dropdown-item/nav-dropdown-item.css:
--------------------------------------------------------------------------------
1 | .wv_nav-dropdown-item {
2 | @apply flex w-full cursor-pointer justify-center whitespace-nowrap border-none p-3 md:justify-start md:py-2;
3 | }
4 |
5 | .wv_nav-dropdown-item--white {
6 | @apply bg-black text-white hover:bg-opacity-75 md:bg-white md:text-black md:hover:bg-black md:hover:bg-opacity-10;
7 | }
8 |
9 | .wv_nav-dropdown-item--black {
10 | @apply bg-white text-black hover:bg-opacity-90 md:bg-black md:text-white md:hover:bg-white md:hover:bg-opacity-25;
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/components/nav-dropdown-item/nav-dropdown-item.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvNavDropdownItemProps {
5 | dark: boolean;
6 | children?: JSX.Element | JSX.Element[] | string | number;
7 | }
8 |
9 | export default function WvNavDropdownItem(props: WvNavDropdownItemProps) {
10 | useDefaultProps({
11 | dark: false,
12 | });
13 |
14 | return (
15 |
23 | {props.children}
24 |
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/ui/src/components/nav-dropdown/nav-dropdown.css:
--------------------------------------------------------------------------------
1 | @import '../nav-button/nav-button.css';
2 |
3 | .wv_nav-dropdown {
4 | @apply relative flex w-full flex-col md:w-fit;
5 | }
6 |
7 | .wv_nav-dropdown--white .wv_nav-button-chevron {
8 | @apply fill-black;
9 | }
10 |
11 | .wv_nav-dropdown--black .wv_nav-button-chevron {
12 | @apply fill-white;
13 | }
14 |
15 | .wv_nav-button-chevron--opened {
16 | transform: rotate(180deg);
17 | }
18 |
19 | .wv_nav-button {
20 | @apply self-center;
21 | }
22 |
23 | .wv_nav-dropdown--white .wv_nav-button {
24 | @apply bg-white text-black;
25 | }
26 |
27 | .wv_nav-dropdown--black .wv_nav-button {
28 | @apply bg-black text-white;
29 | }
30 |
31 | .wv_nav-dropdown-list {
32 | @apply right-0 top-full flex flex-col md:absolute md:z-20 md:mt-4 md:rounded md:border md:border-solid md:shadow;
33 | }
34 |
35 | .wv_nav-dropdown--white .wv_nav-dropdown-list {
36 | @apply border-black border-opacity-10 bg-white;
37 | }
38 |
39 | .wv_nav-dropdown--black .wv_nav-dropdown-list {
40 | @apply border-white border-opacity-20 bg-black;
41 | }
42 |
--------------------------------------------------------------------------------
/ui/src/components/nav-dropdown/nav-dropdown.lite.tsx:
--------------------------------------------------------------------------------
1 | import { Show, useDefaultProps, useStore } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvNavDropdownProps {
5 | dark: boolean;
6 | label: string;
7 | children?: JSX.Element | JSX.Element[] | string | number;
8 | }
9 |
10 | export default function WvNavDropdown(props: WvNavDropdownProps) {
11 | useDefaultProps({
12 | dark: false,
13 | label: '',
14 | });
15 |
16 | const state = useStore({
17 | isListOpened: false,
18 | toggleList(event: { stopPropagation: MouseEvent['stopPropagation'] }) {
19 | event.stopPropagation();
20 | state.isListOpened = !state.isListOpened;
21 | },
22 | });
23 |
24 | return (
25 |
30 |
state.toggleList(event)}
34 | >
35 | {props.label}
36 |
44 |
48 |
49 |
50 |
51 |
52 | (state.isListOpened = false)}
55 | >
56 | {props.children}
57 |
58 |
59 |
60 | );
61 | }
62 |
--------------------------------------------------------------------------------
/ui/src/components/navbar/navbar.css:
--------------------------------------------------------------------------------
1 | @keyframes showTittle {
2 | 0%,
3 | 11.11% {
4 | opacity: 1;
5 | }
6 | 11.12%,
7 | to {
8 | opacity: 0;
9 | }
10 | }
11 |
12 | .wv_navbar {
13 | @apply relative flex flex-row px-3 py-2 md:px-4 md:py-3;
14 | }
15 |
16 | .wv_navbar--black,
17 | .wv_navbar--black .wv_navbar__menu {
18 | @apply bg-black text-white;
19 | }
20 |
21 | .wv_navbar--black svg {
22 | @apply fill-white;
23 | }
24 |
25 | .wv_navbar--white,
26 | .wv_navbar--white .wv_navbar__menu {
27 | @apply bg-white text-black;
28 | }
29 |
30 | .wv_navbar--white svg {
31 | @apply fill-black;
32 | }
33 |
34 | .wv_navbar__logo {
35 | @apply flex flex-1 justify-start;
36 | }
37 |
38 | .wv_navbar__logo__link {
39 | @apply flex flex-row items-baseline space-x-1;
40 | }
41 |
42 | .wv_navbar__logo__wevis,
43 | .wv_navbar__logo__plus {
44 | @apply h-6 md:h-7;
45 | }
46 |
47 | .wv_navbar__logo__wevis--animated {
48 | --duration-per-one: 0.25s;
49 | }
50 |
51 | .wv_navbar__logo__wevis--animated > :not(:first-child):not(:nth-child(2)) {
52 | opacity: 0;
53 | }
54 |
55 | .wv_navbar__logo__wevis--animated > :nth-child(2) {
56 | animation: showTittle calc(var(--duration-per-one) * 9) linear 0s infinite;
57 | }
58 |
59 | .wv_navbar__logo__wevis--animated > :nth-child(3) {
60 | animation: showTittle calc(var(--duration-per-one) * 9) linear
61 | calc(var(--duration-per-one) * 1) infinite;
62 | }
63 |
64 | .wv_navbar__logo__wevis--animated > :nth-child(4) {
65 | animation: showTittle calc(var(--duration-per-one) * 9) linear
66 | calc(var(--duration-per-one) * 2) infinite;
67 | }
68 |
69 | .wv_navbar__logo__wevis--animated > :nth-child(5) {
70 | animation: showTittle calc(var(--duration-per-one) * 9) linear
71 | calc(var(--duration-per-one) * 3) infinite;
72 | }
73 |
74 | .wv_navbar__logo__wevis--animated > :nth-child(6) {
75 | animation: showTittle calc(var(--duration-per-one) * 9) linear
76 | calc(var(--duration-per-one) * 4) infinite;
77 | }
78 |
79 | .wv_navbar__logo__wevis--animated > :nth-child(7) {
80 | animation: showTittle calc(var(--duration-per-one) * 9) linear
81 | calc(var(--duration-per-one) * 5) infinite;
82 | }
83 |
84 | .wv_navbar__logo__wevis--animated > :nth-child(8) {
85 | animation: showTittle calc(var(--duration-per-one) * 9) linear
86 | calc(var(--duration-per-one) * 6) infinite;
87 | }
88 |
89 | .wv_navbar__logo__wevis--animated > :nth-child(9) {
90 | animation: showTittle calc(var(--duration-per-one) * 9) linear
91 | calc(var(--duration-per-one) * 7) infinite;
92 | }
93 |
94 | .wv_navbar__logo__wevis--animated > :nth-child(10) {
95 | animation: showTittle calc(var(--duration-per-one) * 9) linear
96 | calc(var(--duration-per-one) * 8) infinite;
97 | }
98 |
99 | .wv_navbar__logo__addon {
100 | @apply h-full max-h-6 w-auto object-contain object-left md:max-h-7;
101 | }
102 |
103 | .wv_navbar__title {
104 | @apply -mb-2 hidden items-center md:flex;
105 | }
106 |
107 | .wv_navbar__title--uppercase {
108 | @apply uppercase;
109 | }
110 |
111 | .wv_navbar__menu {
112 | @apply items-stretch md:flex-1;
113 | }
114 |
115 | .wv_navbar__menu--desktop {
116 | @apply flex flex-row justify-end space-x-2;
117 | }
118 |
119 | .wv_navbar__menu--hide-mobile {
120 | @apply hidden md:flex;
121 | }
122 |
123 | .wv_navbar__menu--always-show .wv_nav-button {
124 | @apply py-0;
125 | }
126 |
127 | .wv_navbar__menu--always-show .wv_nav-dropdown-list {
128 | @apply absolute z-20 mt-3 rounded border border-solid shadow md:mt-4;
129 | }
130 |
131 | .wv_navbar__menu--always-show .wv_nav-dropdown-item--white {
132 | @apply bg-white text-black hover:bg-black hover:bg-opacity-10;
133 | }
134 |
135 | .wv_navbar__menu--always-show .wv_nav-dropdown-item--black {
136 | @apply bg-black text-white hover:bg-white hover:bg-opacity-25;
137 | }
138 |
139 | .wv_navbar__menu--mobile {
140 | @apply absolute inset-x-0 top-full z-10 flex flex-col justify-end pb-2 md:hidden;
141 | }
142 |
143 | .wv_navbar__hamburger-button {
144 | @apply flex cursor-pointer items-center justify-center border-none bg-transparent px-2 md:hidden;
145 | }
146 |
--------------------------------------------------------------------------------
/ui/src/components/navbar/navbar.lite.tsx:
--------------------------------------------------------------------------------
1 | import { useStore, Show, useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvNavbarProps {
5 | homeHref: string;
6 | title: string;
7 | dark: boolean;
8 | animated: boolean;
9 | alwayShowSlot: boolean;
10 | logoAddonSrc: string;
11 | logoAddonAlt: string;
12 | logoAddonWidth: string | number;
13 | logoAddonHeight: string | number;
14 | logoAddonPlus: boolean;
15 | children?: JSX.Element | JSX.Element[] | string | number;
16 | }
17 |
18 | export default function WvNavbar(props: WvNavbarProps) {
19 | useDefaultProps({
20 | homeHref: 'https://wevis.info/',
21 | title: '',
22 | dark: false,
23 | animated: false,
24 | alwayShowSlot: false,
25 | logoAddonSrc: '',
26 | logoAddonAlt: '',
27 | logoAddonWidth: 0,
28 | logoAddonHeight: 24,
29 | logoAddonPlus: false,
30 | });
31 |
32 | const state = useStore({
33 | isMobileMenuOpened: false,
34 | });
35 |
36 | return (
37 |
42 |
105 |
106 |
107 | {props.title}
111 | }
112 | >
113 |
114 | {props.title?.toLocaleLowerCase()}
115 |
116 |
117 |
118 |
119 |
128 |
129 |
130 | (state.isMobileMenuOpened = !state.isMobileMenuOpened)}
134 | aria-label="Open Menu"
135 | >
136 | {state.isMobileMenuOpened && (
137 |
138 |
145 |
152 |
153 | )}
154 | {!state.isMobileMenuOpened && (
155 |
156 |
157 |
158 |
159 |
160 | )}
161 |
162 |
163 |
164 |
165 |
171 |
172 |
173 | );
174 | }
175 |
--------------------------------------------------------------------------------
/ui/src/components/paragraph-group/paragraph-group.css:
--------------------------------------------------------------------------------
1 | .wv_paragraph-group {
2 | @apply space-y-6;
3 | }
4 |
5 | .wv_paragraph-group--small {
6 | @apply space-y-2;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/components/paragraph-group/paragraph-group.lite.tsx:
--------------------------------------------------------------------------------
1 | import { Show, useDefaultProps } from '@builder.io/mitosis';
2 | import { JSX } from '@builder.io/mitosis/jsx-runtime';
3 |
4 | interface WvParagraphGroupProps {
5 | small: boolean;
6 | heading: string;
7 | children?: JSX.Element | JSX.Element[] | string | number;
8 | }
9 |
10 | export default function WvParagraphGroup(props: WvParagraphGroupProps) {
11 | useDefaultProps({
12 | small: false,
13 | heading: '',
14 | });
15 |
16 | return (
17 |
22 |
23 |
28 | {props.heading}
29 |
30 |
31 |
32 | {props.children}
33 |
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/ui/src/components/sharer/sharer.css:
--------------------------------------------------------------------------------
1 | .wv_sharer {
2 | @apply flex flex-row items-center space-x-3;
3 | }
4 |
5 | .wv_sharer a {
6 | @apply flex;
7 | }
8 |
9 | .wv_sharer svg {
10 | @apply h-[30px] w-[30px];
11 | }
12 |
13 | .wv_sharer__share-link svg.copy-outline .outline,
14 | .wv_sharer svg .outline {
15 | @apply fill-none stroke-1;
16 | }
17 |
18 | .wv_sharer__share-link {
19 | @apply flex cursor-pointer border-none bg-transparent p-0;
20 | }
21 |
22 | .wv_sharer__share-link svg.copy-outline path {
23 | @apply fill-none stroke-2;
24 | }
25 |
26 | .wv_sharer--center {
27 | @apply justify-center;
28 | }
29 |
30 | .wv_sharer--dark {
31 | @apply text-black;
32 | }
33 |
34 | .wv_sharer--dark svg {
35 | @apply fill-black;
36 | }
37 |
38 | .wv_sharer--dark .outline {
39 | @apply stroke-black;
40 | }
41 |
42 | .wv_sharer--dark .wv_sharer__share-link {
43 | @apply stroke-black;
44 | }
45 |
46 | .wv_sharer--light {
47 | @apply text-white;
48 | }
49 |
50 | .wv_sharer--light svg {
51 | @apply fill-white;
52 | }
53 |
54 | .wv_sharer--light .outline {
55 | @apply stroke-white;
56 | }
57 |
58 | .wv_sharer--light .wv_sharer__share-link {
59 | @apply stroke-white;
60 | }
61 |
--------------------------------------------------------------------------------
/ui/src/components/sharer/sharer.lite.tsx:
--------------------------------------------------------------------------------
1 | import { onMount, useStore, Show, useDefaultProps } from '@builder.io/mitosis';
2 |
3 | interface WvSharerProps {
4 | url: string;
5 | label: string;
6 | hideLabel: boolean;
7 | light: boolean;
8 | center: boolean;
9 | outline: boolean;
10 | allowCopyLink: boolean;
11 | }
12 |
13 | export default function WvSharer(props: WvSharerProps) {
14 | useDefaultProps({
15 | url: '',
16 | label: 'Share',
17 | hideLabel: false,
18 | light: false,
19 | center: false,
20 | outline: false,
21 | allowCopyLink: false,
22 | });
23 |
24 | const state = useStore({
25 | encodedURL: '',
26 | copyToClipboard: (value: string) => {
27 | window.navigator.clipboard.writeText(value);
28 | },
29 | });
30 |
31 | onMount(() => {
32 | state.encodedURL = encodeURIComponent(props.url || window.location.href);
33 | });
34 |
35 | return (
36 |
153 | );
154 | }
155 |
--------------------------------------------------------------------------------
/ui/src/styles/button-group.css:
--------------------------------------------------------------------------------
1 | @import '../components/button-group/button-group.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/button-link.css:
--------------------------------------------------------------------------------
1 | @import '../components/button-link/button-link.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/button.css:
--------------------------------------------------------------------------------
1 | @import '../components/button/button.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/components.css:
--------------------------------------------------------------------------------
1 | @import '../components/button/button.css';
2 | @import '../components/button-link/button-link.css';
3 | @import '../components/button-group/button-group.css';
4 | @import '../components/container/container.css';
5 | @import '../components/cookie-consent/cookie-consent.css';
6 | @import '../components/footer/footer.css';
7 | @import '../components/navbar/navbar.css';
8 | @import '../components/nav-button/nav-button.css';
9 | @import '../components/nav-button-link/nav-button-link.css';
10 | @import '../components/nav-dropdown/nav-dropdown.css';
11 | @import '../components/nav-dropdown-item/nav-dropdown-item.css';
12 | @import '../components/paragraph-group/paragraph-group.css';
13 | @import '../components/sharer/sharer.css';
14 |
--------------------------------------------------------------------------------
/ui/src/styles/container.css:
--------------------------------------------------------------------------------
1 | @import '../components/container/container.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/cookie-consent.css:
--------------------------------------------------------------------------------
1 | @import '../components/cookie-consent/cookie-consent.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/footer.css:
--------------------------------------------------------------------------------
1 | @import '../components/footer/footer.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/index.css:
--------------------------------------------------------------------------------
1 | @import './typography.css';
2 | @import './components.css';
3 |
--------------------------------------------------------------------------------
/ui/src/styles/nav-button-link.css:
--------------------------------------------------------------------------------
1 | @import '../components/nav-button-link/nav-button-link.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/nav-button.css:
--------------------------------------------------------------------------------
1 | @import '../components/nav-button/nav-button.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/nav-dropdown-item.css:
--------------------------------------------------------------------------------
1 | @import '../components/nav-dropdown-item/nav-dropdown-item.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/nav-dropdown.css:
--------------------------------------------------------------------------------
1 | @import '../components/nav-dropdown/nav-dropdown.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/navbar.css:
--------------------------------------------------------------------------------
1 | @import '../components/navbar/navbar.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/paragraph-group.css:
--------------------------------------------------------------------------------
1 | @import '../components/paragraph-group/paragraph-group.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/sharer.css:
--------------------------------------------------------------------------------
1 | @import '../components/sharer/sharer.css';
2 |
--------------------------------------------------------------------------------
/ui/src/styles/typography.css:
--------------------------------------------------------------------------------
1 | /* Import font face */
2 | @font-face {
3 | font-family: 'Kondolar Thai';
4 | font-display: swap;
5 | src: url(https://design-systems.wevis.info/KondolarThai-Regular.otf)
6 | format('opentype');
7 | }
8 | @font-face {
9 | font-family: 'Kondolar Thai';
10 | font-weight: 700;
11 | font-display: swap;
12 | src: url(https://design-systems.wevis.info/KondolarThai-Bold.otf)
13 | format('opentype');
14 | }
15 | @font-face {
16 | font-family: 'Kondolar Thai';
17 | font-weight: 900;
18 | font-display: swap;
19 | src: url(https://design-systems.wevis.info/KondolarThai-Black.otf)
20 | format('opentype');
21 | }
22 | @font-face {
23 | font-family: 'IBM Plex Sans Thai';
24 | font-display: swap;
25 | src: url(https://design-systems.wevis.info/IBMPlexSansThai-Regular.otf)
26 | format('opentype');
27 | }
28 | @font-face {
29 | font-family: 'IBM Plex Sans Thai';
30 | font-weight: 600;
31 | font-display: swap;
32 | src: url(https://design-systems.wevis.info/IBMPlexSansThai-SemiBold.otf)
33 | format('opentype');
34 | }
35 | @font-face {
36 | font-family: 'IBM Plex Sans Thai';
37 | font-weight: 700;
38 | font-display: swap;
39 | src: url(https://design-systems.wevis.info/IBMPlexSansThai-Bold.otf)
40 | format('opentype');
41 | }
42 | @font-face {
43 | font-family: 'IBM Plex Sans Thai Looped';
44 | font-display: swap;
45 | src: url(https://design-systems.wevis.info/IBMPlexSansThaiLooped-Regular.ttf)
46 | format('truetype');
47 | }
48 | @font-face {
49 | font-family: 'IBM Plex Sans Thai Looped';
50 | font-weight: 600;
51 | font-display: swap;
52 | src: url(https://design-systems.wevis.info/IBMPlexSansThaiLooped-SemiBold.ttf)
53 | format('truetype');
54 | }
55 | @font-face {
56 | font-family: 'IBM Plex Sans Thai Looped';
57 | font-weight: 700;
58 | font-display: swap;
59 | src: url(https://design-systems.wevis.info/IBMPlexSansThaiLooped-Bold.ttf)
60 | format('truetype');
61 | }
62 |
63 | /* Font family */
64 | .wv-kondolar {
65 | font-family: 'Kondolar Thai', ui-serif, Georgia, Cambria, 'Times New Roman',
66 | Times, serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
67 | 'Noto Color Emoji';
68 | }
69 | .wv-ibmplex {
70 | font-family:
71 | 'IBM Plex Sans Thai',
72 | ui-sans-serif,
73 | system-ui,
74 | -apple-system,
75 | BlinkMacSystemFont,
76 | 'Segoe UI',
77 | Roboto,
78 | 'Helvetica Neue',
79 | Arial,
80 | 'Noto Sans',
81 | sans-serif,
82 | 'Apple Color Emoji',
83 | 'Segoe UI Emoji',
84 | 'Segoe UI Symbol',
85 | 'Noto Color Emoji';
86 | }
87 | .wv-ibmplexlooped {
88 | font-family:
89 | 'IBM Plex Sans Thai Looped',
90 | ui-sans-serif,
91 | system-ui,
92 | -apple-system,
93 | BlinkMacSystemFont,
94 | 'Segoe UI',
95 | Roboto,
96 | 'Helvetica Neue',
97 | Arial,
98 | 'Noto Sans',
99 | sans-serif,
100 | 'Apple Color Emoji',
101 | 'Segoe UI Emoji',
102 | 'Segoe UI Symbol',
103 | 'Noto Color Emoji';
104 | }
105 |
106 | /* Font weight */
107 | .wv-bold {
108 | @apply font-bold;
109 | }
110 | .wv-semibold {
111 | @apply font-semibold;
112 | }
113 | .wv-black {
114 | @apply font-black;
115 | }
116 |
117 | /* Heading size */
118 | .wv-h1 {
119 | @apply text-[60px] leading-[1.25] md:text-[100px];
120 | }
121 |
122 | .wv-h2 {
123 | @apply text-[48px] leading-[1.25] md:text-[72px];
124 | }
125 |
126 | .wv-h3 {
127 | @apply text-[36px] leading-[1.25] md:text-[60px];
128 | }
129 |
130 | .wv-h4 {
131 | @apply text-[32px] leading-[1.25] md:text-[48px];
132 | }
133 |
134 | .wv-h5 {
135 | @apply text-[28px] leading-[1.25] md:text-[36px];
136 | }
137 |
138 | .wv-h6 {
139 | @apply text-[24px] leading-[1.25] md:text-[32px];
140 | }
141 |
142 | .wv-h7 {
143 | @apply text-[21px] leading-[1.25] md:text-[28px];
144 | }
145 |
146 | .wv-h8 {
147 | @apply text-[18px] leading-[1.25] md:text-[24px];
148 | }
149 |
150 | .wv-h9 {
151 | @apply text-[16px] leading-[1.25] md:text-[21px];
152 | }
153 |
154 | .wv-h10 {
155 | @apply text-[15px] leading-[1.25] md:text-[18px];
156 | }
157 |
158 | .wv-h11 {
159 | @apply text-[14px] leading-[1.25] md:text-[16px];
160 | }
161 |
162 | /* Body size */
163 | .wv-b1 {
164 | @apply text-[24px] leading-[1.5] md:text-[32px];
165 | }
166 |
167 | .wv-b2 {
168 | @apply text-[21px] leading-[1.5] md:text-[24px];
169 | }
170 |
171 | .wv-b3 {
172 | @apply text-[18px] leading-[1.5] md:text-[21px];
173 | }
174 |
175 | .wv-b4 {
176 | @apply text-[16px] leading-[1.5] md:text-[18px];
177 | }
178 |
179 | .wv-b5 {
180 | @apply text-[14px] leading-[1.5] md:text-[16px];
181 | }
182 |
183 | .wv-b6 {
184 | @apply text-[12px] leading-[1.5] md:text-[14px];
185 | }
186 |
187 | .wv-b7 {
188 | @apply text-[10px] leading-[1.5] md:text-[12px];
189 | }
190 |
191 | .wv-u1 {
192 | @apply text-[20px] leading-[1.25];
193 | }
194 |
195 | .wv-u2 {
196 | @apply text-[18px] leading-[1.25];
197 | }
198 |
199 | .wv-u3 {
200 | @apply text-[16px] leading-[1.25];
201 | }
202 |
203 | .wv-u4 {
204 | @apply text-[14px] leading-[1.25];
205 | }
206 |
207 | .wv-u5 {
208 | @apply text-[12px] leading-[1.25];
209 | }
210 |
211 | /* Body fixed size */
212 | .wv-fixed-b1 {
213 | @apply text-[21px] leading-[1.5];
214 | }
215 | .wv-fixed-b2 {
216 | @apply text-[18px] leading-[1.5];
217 | }
218 | .wv-fixed-b3 {
219 | @apply text-[16px] leading-[1.5];
220 | }
221 | .wv-fixed-b4 {
222 | @apply text-[14px] leading-[1.5];
223 | }
224 | .wv-fixed-b5 {
225 | @apply text-[12px] leading-[1.5];
226 | }
227 |
--------------------------------------------------------------------------------
/ui/svelte.config.js:
--------------------------------------------------------------------------------
1 | import adapter from '@sveltejs/adapter-auto';
2 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
3 |
4 | /** @type {import('@sveltejs/kit').Config} */
5 | const config = {
6 | preprocess: vitePreprocess({
7 | typescript: {
8 | tsconfigFile: 'tsconfig.svelte.json',
9 | },
10 | }),
11 | kit: {
12 | adapter: adapter(),
13 | },
14 | };
15 |
16 | export default config;
17 |
--------------------------------------------------------------------------------
/ui/tailwind.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | content: ['./src/components/**/*.jsx'],
3 | theme: {
4 | extend: {},
5 | colors: {
6 | transparent: 'transparent',
7 | white: '#ffffff',
8 | black: '#000000',
9 | ultramarine: '#3904E9',
10 | mint: '#A5EBD7',
11 | none: 'none',
12 | },
13 | },
14 | plugins: [],
15 | };
16 |
--------------------------------------------------------------------------------
/ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "strict": true,
4 | "target": "esnext",
5 | "jsx": "preserve",
6 | "esModuleInterop": true,
7 | "skipLibCheck": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "jsxImportSource": "@builder.io/mitosis",
10 | "moduleResolution": "node"
11 | },
12 | "include": ["src"]
13 | }
14 |
--------------------------------------------------------------------------------
/ui/tsconfig.react.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "react",
4 | "module": "esnext",
5 | "target": "es5",
6 | "lib": ["es6", "dom", "es2016", "es2017"],
7 | "jsx": "react",
8 | "moduleResolution": "node",
9 | "declaration": true
10 | },
11 | "include": [".mitosis/react"],
12 | "exclude": []
13 | }
14 |
--------------------------------------------------------------------------------
/ui/tsconfig.svelte.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./.svelte-kit/tsconfig.json",
3 | "compilerOptions": {
4 | "allowJs": true,
5 | "checkJs": true,
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "resolveJsonModule": true,
9 | "skipLibCheck": true,
10 | "sourceMap": true,
11 | "strict": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ui/tsconfig.vue.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "allowJs": true,
7 | "skipLibCheck": true,
8 | "esModuleInterop": true,
9 | "outDir": "vue",
10 | "declaration": true,
11 | "types": ["vite/client"],
12 | "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
13 | },
14 | "include": [".mitosis/vue"]
15 | }
16 |
--------------------------------------------------------------------------------
/ui/vite.config.vue.ts:
--------------------------------------------------------------------------------
1 | import vue from '@vitejs/plugin-vue';
2 | import { readdirSync } from 'fs';
3 | import { defineConfig } from 'vite';
4 | import dts from 'vite-plugin-dts';
5 |
6 | const SOURCE_PATH = '.mitosis/vue';
7 |
8 | export default defineConfig({
9 | plugins: [
10 | vue(),
11 | dts({
12 | tsconfigPath: 'tsconfig.vue.json',
13 | cleanVueFileName: true,
14 | }),
15 | ],
16 | build: {
17 | lib: {
18 | entry: readdirSync(SOURCE_PATH).map((file) => `${SOURCE_PATH}/${file}`),
19 | formats: ['es'],
20 | },
21 | rollupOptions: {
22 | external: ['vue'],
23 | output: {
24 | globals: {
25 | vue: 'Vue',
26 | },
27 | },
28 | },
29 | outDir: 'vue',
30 | minify: false,
31 | },
32 | });
33 |
--------------------------------------------------------------------------------