tapquest-ui-yeulamvietnam 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example/README.md +50 -0
- package/example/eslint.config.js +28 -0
- package/example/index.html +13 -0
- package/example/package.json +35 -0
- package/example/public/vite.svg +1 -0
- package/example/src/App.css +8 -0
- package/example/src/App.tsx +62 -0
- package/example/src/Card/index.tsx +15 -0
- package/example/src/Icons/CircleArrow.tsx +8 -0
- package/example/src/Icons/icon1.tsx +19 -0
- package/example/src/View/CoreComponentView/index.tsx +255 -0
- package/example/src/View/MapView/index.tsx +1325 -0
- package/example/src/View/MapView/map.html +14 -0
- package/example/src/assets/fonts/Kanit/Kanit-Black.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-BlackItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Bold.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-BoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-ExtraBold.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-ExtraBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-ExtraLight.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-ExtraLightItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Italic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Light.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-LightItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Medium.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-MediumItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Regular.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-SemiBold.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-SemiBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-Thin.ttf +0 -0
- package/example/src/assets/fonts/Kanit/Kanit-ThinItalic.ttf +0 -0
- package/example/src/assets/fonts/Kanit/OFL.txt +93 -0
- package/example/src/assets/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
- package/example/src/assets/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
- package/example/src/assets/fonts/iCielBCLodestone/iCielBCLodestone.ttf +0 -0
- package/example/src/assets/react.svg +1 -0
- package/example/src/fonts.css +66 -0
- package/example/src/index.css +70 -0
- package/example/src/main.tsx +10 -0
- package/example/src/vite-env.d.ts +1 -0
- package/example/tsconfig.app.json +26 -0
- package/example/tsconfig.json +7 -0
- package/example/tsconfig.node.json +24 -0
- package/example/vite.config.ts +7 -0
- package/index.css +20 -0
- package/index.ts +42 -0
- package/package.json +44 -0
- package/src/components/AppbarPrimaryButton/index.tsx +56 -0
- package/src/components/Avatar.styled/index.tsx +8 -0
- package/src/components/Button.styled/index.tsx +154 -0
- package/src/components/Card.styled/index.tsx +26 -0
- package/src/components/Compound/Appbar/index.tsx +88 -0
- package/src/components/Compound/Header/index.tsx +40 -0
- package/src/components/Compound/InteractiveMap/MapSvg.tsx +608 -0
- package/src/components/Compound/LocationOverviewCard/index.tsx +186 -0
- package/src/components/Compound/MemoryCard/index.tsx +267 -0
- package/src/components/Compound/ProgressStep/index.tsx +54 -0
- package/src/components/Compound/SponsorByContainer/index.tsx +31 -0
- package/src/components/FormItem.styled/index.tsx +23 -0
- package/src/components/Icons/AppbarBg.tsx +22 -0
- package/src/components/Icons/ArrowCircle.tsx +8 -0
- package/src/components/Icons/ArrowDown.tsx +15 -0
- package/src/components/Icons/Camera.tsx +17 -0
- package/src/components/Icons/Check.tsx +7 -0
- package/src/components/Icons/ChevronLeft.tsx +7 -0
- package/src/components/Icons/ChevronRight.tsx +16 -0
- package/src/components/Icons/CircleAlert.tsx +9 -0
- package/src/components/Icons/CircleArrow.tsx +8 -0
- package/src/components/Icons/CircleCheck.tsx +7 -0
- package/src/components/Icons/CornerUpRight.tsx +7 -0
- package/src/components/Icons/Dart.tsx +7 -0
- package/src/components/Icons/Discover.tsx +16 -0
- package/src/components/Icons/Edit.tsx +16 -0
- package/src/components/Icons/Email.tsx +16 -0
- package/src/components/Icons/Exclaimation.tsx +7 -0
- package/src/components/Icons/Facebook.tsx +7 -0
- package/src/components/Icons/Gear.tsx +15 -0
- package/src/components/Icons/Gift.tsx +18 -0
- package/src/components/Icons/Globe.tsx +14 -0
- package/src/components/Icons/Home.tsx +7 -0
- package/src/components/Icons/Icon1.tsx +19 -0
- package/src/components/Icons/Icon1sm.tsx +19 -0
- package/src/components/Icons/Instagram.tsx +9 -0
- package/src/components/Icons/Link.tsx +16 -0
- package/src/components/Icons/LocationPin.tsx +10 -0
- package/src/components/Icons/Logout.tsx +15 -0
- package/src/components/Icons/MapMarker.tsx +8 -0
- package/src/components/Icons/Marker/MarkerRed.tsx +17 -0
- package/src/components/Icons/Menu.tsx +11 -0
- package/src/components/Icons/Mission.tsx +17 -0
- package/src/components/Icons/Moment.tsx +18 -0
- package/src/components/Icons/Phone.tsx +15 -0
- package/src/components/Icons/Pin.tsx +8 -0
- package/src/components/Icons/PinCircle.tsx +17 -0
- package/src/components/Icons/PinOutlined.tsx +7 -0
- package/src/components/Icons/Profile.tsx +15 -0
- package/src/components/Icons/ProfileGift.tsx +23 -0
- package/src/components/Icons/ProgressBar.tsx +20 -0
- package/src/components/Icons/ProgressBarInner.tsx +44 -0
- package/src/components/Icons/SealCheckIcon.tsx +18 -0
- package/src/components/Icons/Search.tsx +7 -0
- package/src/components/Icons/SendMessage.tsx +7 -0
- package/src/components/Icons/Share.tsx +14 -0
- package/src/components/Icons/ShareMemoryBadge.tsx +11 -0
- package/src/components/Icons/ShieldWarningIcon.tsx +18 -0
- package/src/components/Icons/Spinner.tsx +18 -0
- package/src/components/Icons/Step.tsx +7 -0
- package/src/components/Icons/StepChecked.tsx +8 -0
- package/src/components/Icons/StepLine.tsx +7 -0
- package/src/components/Icons/Telegram.tsx +7 -0
- package/src/components/Icons/Trash.tsx +7 -0
- package/src/components/Icons/User.tsx +15 -0
- package/src/components/Icons/XIcon.tsx +8 -0
- package/src/components/Icons/Zalo.tsx +23 -0
- package/src/components/Icons/index.tsx +66 -0
- package/src/components/Image.styled/index.tsx +35 -0
- package/src/components/Input.styled/index.tsx +34 -0
- package/src/components/InputPassword/index.tsx +34 -0
- package/src/components/InputSearch.styled/index.tsx +18 -0
- package/src/components/Loader.styled/index.tsx +26 -0
- package/src/components/Modal.styled/index.tsx +63 -0
- package/src/components/ProcessBar.styled/index.tsx +26 -0
- package/src/components/ProgressCircular.styled/index.tsx +61 -0
- package/src/components/SVGs/NoResult.tsx +62 -0
- package/src/components/SVGs/index.tsx +3 -0
- package/src/components/Select.styled/index.tsx +32 -0
- package/src/components/Tabs.styled/index.tsx +22 -0
- package/src/components/TextArea.styled/index.tsx +34 -0
- package/src/components/Typography.styled/index.tsx +419 -0
- package/src/helpers/index.ts +175 -0
- package/src/hooks/useHTMLToCanvas.tsx +115 -0
- package/src/hooks/useInteractiveMap.tsx +659 -0
- package/src/types/type.d.ts +9 -0
- package/tsconfig.json +33 -0
- package/tsconfig.node.json +12 -0
- package/tsup.config.ts +24 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
13
|
+
|
|
14
|
+
- Configure the top-level `parserOptions` property like this:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
export default tseslint.config({
|
|
18
|
+
languageOptions: {
|
|
19
|
+
// other options...
|
|
20
|
+
parserOptions: {
|
|
21
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
22
|
+
tsconfigRootDir: import.meta.dirname,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
|
|
29
|
+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
30
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
// eslint.config.js
|
|
34
|
+
import react from 'eslint-plugin-react'
|
|
35
|
+
|
|
36
|
+
export default tseslint.config({
|
|
37
|
+
// Set the react version
|
|
38
|
+
settings: { react: { version: '18.3' } },
|
|
39
|
+
plugins: {
|
|
40
|
+
// Add the react plugin
|
|
41
|
+
react,
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
// other rules...
|
|
45
|
+
// Enable its recommended rules
|
|
46
|
+
...react.configs.recommended.rules,
|
|
47
|
+
...react.configs['jsx-runtime'].rules,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{ ignores: ['dist'] },
|
|
9
|
+
{
|
|
10
|
+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 2020,
|
|
14
|
+
globals: globals.browser,
|
|
15
|
+
},
|
|
16
|
+
plugins: {
|
|
17
|
+
'react-hooks': reactHooks,
|
|
18
|
+
'react-refresh': reactRefresh,
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
...reactHooks.configs.recommended.rules,
|
|
22
|
+
'react-refresh/only-export-components': [
|
|
23
|
+
'warn',
|
|
24
|
+
{ allowConstantExport: true },
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + React + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "example",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"canvg": "^4.0.3",
|
|
14
|
+
"react": "^19.0.0",
|
|
15
|
+
"react-dom": "^19.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@eslint/js": "^9.21.0",
|
|
19
|
+
"@types/react": "^19.0.10",
|
|
20
|
+
"@types/react-dom": "^19.0.4",
|
|
21
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
22
|
+
"eslint": "^9.21.0",
|
|
23
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
24
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
25
|
+
"globals": "^15.15.0",
|
|
26
|
+
"vite": "^6.2.0"
|
|
27
|
+
},
|
|
28
|
+
"pnpm": {
|
|
29
|
+
"packageExtensions": {
|
|
30
|
+
"example": {
|
|
31
|
+
"standalone": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import './App.css'
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import CoreView from './View/CoreComponentView'
|
|
6
|
+
import MapView from './View/MapView'
|
|
7
|
+
import Button from '../../src/components/Button.styled'
|
|
8
|
+
|
|
9
|
+
function App() {
|
|
10
|
+
const views = {
|
|
11
|
+
"core": <CoreView />,
|
|
12
|
+
"map": <MapView />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Set default selected view to the first one
|
|
16
|
+
const [selectedView, setSelectedView] = useState<string>(Object.keys(views)[0])
|
|
17
|
+
|
|
18
|
+
const handleViewChange = (viewKey: string) => {
|
|
19
|
+
setSelectedView(viewKey)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className="tab-container">
|
|
24
|
+
{/* Tab buttons */}
|
|
25
|
+
<div className="tab-buttons" style={{
|
|
26
|
+
display: "flex",
|
|
27
|
+
flexDirection: "row",
|
|
28
|
+
gap: "16px",
|
|
29
|
+
marginBottom: "20px",
|
|
30
|
+
borderBottom: "1px solid #e0e0e0",
|
|
31
|
+
padding: "10px 0"
|
|
32
|
+
}}>
|
|
33
|
+
{Object.keys(views).map((viewKey) => (
|
|
34
|
+
<Button
|
|
35
|
+
key={viewKey}
|
|
36
|
+
onClick={() => handleViewChange(viewKey)}
|
|
37
|
+
style={{
|
|
38
|
+
backgroundColor: selectedView === viewKey ? '#4a90e2' : '#f0f0f0',
|
|
39
|
+
color: selectedView === viewKey ? 'white' : 'black',
|
|
40
|
+
fontWeight: selectedView === viewKey ? 'bold' : 'normal',
|
|
41
|
+
borderRadius: '4px',
|
|
42
|
+
padding: '8px 16px',
|
|
43
|
+
cursor: 'pointer',
|
|
44
|
+
border: 'none',
|
|
45
|
+
transition: 'all 0.3s ease'
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{viewKey.charAt(0).toUpperCase() + viewKey.slice(1)}
|
|
49
|
+
</Button>
|
|
50
|
+
))}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
{/* Tab content */}
|
|
54
|
+
<div className="tab-content" style={{ padding: "10px" }}>
|
|
55
|
+
{/* Only render the selected view */}
|
|
56
|
+
{views[selectedView as keyof typeof views]}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default App
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function Card({title, backgroundColor, children}: {title: string, backgroundColor?: string, children: React.ReactNode}) {
|
|
2
|
+
return (
|
|
3
|
+
<div style={{
|
|
4
|
+
display: "flex",
|
|
5
|
+
flexDirection: "column",
|
|
6
|
+
alignItems: "flex-start",
|
|
7
|
+
gap: "16px",
|
|
8
|
+
backgroundColor: backgroundColor,
|
|
9
|
+
padding: "16px",
|
|
10
|
+
}}>
|
|
11
|
+
<h3>{title}</h3>
|
|
12
|
+
{children}
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default function CircleArrow() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<rect width="28" height="28" rx="14" fill="#A71A1A" />
|
|
5
|
+
<path d="M6 14H19.5M19.5 14L14.5 9M19.5 14L14.5 19" stroke="white" strokeWidth="1.5" />
|
|
6
|
+
</svg>
|
|
7
|
+
)
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function Icon1() {
|
|
2
|
+
return (
|
|
3
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<rect width="40" height="40" rx="20" fill="#A71A1A" />
|
|
5
|
+
<rect width="24" height="24" transform="translate(8 8)" fill="white" fillOpacity="0.01" style={{ mixBlendMode: "multiply" }} />
|
|
6
|
+
<path d="M20.75 14H19.25V18.5H20.75V14Z" fill="white" />
|
|
7
|
+
<path d="M20.75 21.5H19.25V26H20.75V21.5Z" fill="white" />
|
|
8
|
+
<path d="M26 19.25H21.5V20.75H26V19.25Z" fill="white" />
|
|
9
|
+
<path d="M18.5 19.25H14V20.75H18.5V19.25Z" fill="white" />
|
|
10
|
+
<g opacity="0.5">
|
|
11
|
+
<path d="M11 15.5H9.5V11C9.50042 10.6023 9.65859 10.221 9.9398 9.9398C10.221 9.65859 10.6023 9.50042 11 9.5H15.5V11H11V15.5Z" fill="white" />
|
|
12
|
+
<path d="M15.5 30.5H11C10.6023 30.4996 10.221 30.3414 9.9398 30.0602C9.65859 29.779 9.50042 29.3977 9.5 29V24.5H11V29H15.5V30.5Z" fill="white" />
|
|
13
|
+
<path d="M29 30.5H24.5V29H29V24.5H30.5V29C30.4996 29.3977 30.3414 29.779 30.0602 30.0602C29.779 30.3414 29.3977 30.4996 29 30.5Z" fill="white" />
|
|
14
|
+
<path d="M30.5 15.5H29V11H24.5V9.5H29C29.3977 9.50042 29.779 9.65859 30.0602 9.9398C30.3414 10.221 30.4996 10.6023 30.5 11V15.5Z" fill="white" />
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
17
|
+
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
|
|
2
|
+
import { Typography, Button, Loader, ProgressCircular, Tabs, Image, Modal, FormItem, Input, InputPassword, Avatar, InputSearch, Appbar, Header } from "../../../../../ui-yeulamvietnam"
|
|
3
|
+
import Card from "../../Card"
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
|
|
6
|
+
import Icon1 from "../../Icons/icon1"
|
|
7
|
+
import CircleArrow from "../../Icons/CircleArrow"
|
|
8
|
+
import { AppbarMenuItem } from "../../../../src/types/type"
|
|
9
|
+
import { Home } from "../../../../src/components/Icons"
|
|
10
|
+
import AppbarPrimaryButton from "../../../../src/components/AppbarPrimaryButton"
|
|
11
|
+
|
|
12
|
+
// mock data
|
|
13
|
+
const AppbarItems: AppbarMenuItem[] = [
|
|
14
|
+
{
|
|
15
|
+
title: "Trang chủ",
|
|
16
|
+
icon: <Home />,
|
|
17
|
+
path: "/",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: "Chia sẻ",
|
|
21
|
+
icon: <Home />,
|
|
22
|
+
path: "/",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "Nhiệm vụ",
|
|
26
|
+
icon:
|
|
27
|
+
<AppbarPrimaryButton/>,
|
|
28
|
+
path: "/",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
title: "Giải thưởng",
|
|
32
|
+
icon: <Home />,
|
|
33
|
+
path: "/",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
title: "Hồ sơ",
|
|
37
|
+
icon: <Home />,
|
|
38
|
+
path: "/",
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
function CoreView() {
|
|
43
|
+
const [modal1, setModal1] = useState(false);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div style={{ display: "flex", flexDirection: "column", gap: "24px" }}>
|
|
47
|
+
<Card title="Typography">
|
|
48
|
+
<Typography $type="h1">h1</Typography>
|
|
49
|
+
<Typography $type="h2">h2</Typography>
|
|
50
|
+
<Typography $type="h3">h3</Typography>
|
|
51
|
+
<Typography $type="h4">h4</Typography>
|
|
52
|
+
<Typography $type="h5">h5</Typography>
|
|
53
|
+
<Typography $type="subheading-1">Subheading 1</Typography>
|
|
54
|
+
<Typography $type="subheading-2">Subheading 2</Typography>
|
|
55
|
+
<Typography $type="subheading-3-bold">Subheading 3 bold</Typography>
|
|
56
|
+
<Typography $type="subheading-3-semibold">Subheading 3 semibold</Typography>
|
|
57
|
+
<Typography $type="subheading-4">Subheading 4</Typography>
|
|
58
|
+
<Typography $type="title-text">Title text</Typography>
|
|
59
|
+
<Typography $type="body-text">Body text</Typography>
|
|
60
|
+
</Card>
|
|
61
|
+
<Card title="Button">
|
|
62
|
+
<Button
|
|
63
|
+
$size="small"
|
|
64
|
+
icon={<Icon1 />}
|
|
65
|
+
iconPosition="start"
|
|
66
|
+
type="text"
|
|
67
|
+
$textColor="#A71A1A"
|
|
68
|
+
>Khám phá bản đồ
|
|
69
|
+
</Button>
|
|
70
|
+
<Button
|
|
71
|
+
$size="small"
|
|
72
|
+
type="link"
|
|
73
|
+
$textColor="#A71A1A"
|
|
74
|
+
>Khám phá bản đồ
|
|
75
|
+
</Button>
|
|
76
|
+
<Button
|
|
77
|
+
type="primary"
|
|
78
|
+
$size="middle"
|
|
79
|
+
icon={<CircleArrow />}
|
|
80
|
+
iconPosition="end"
|
|
81
|
+
$backgroundColor="#FFF"
|
|
82
|
+
$textColor="#A71A1A"
|
|
83
|
+
>khám phá bản đồ</Button>
|
|
84
|
+
</Card>
|
|
85
|
+
<Card title="ProgressCircular">
|
|
86
|
+
<ProgressCircular
|
|
87
|
+
percent={50}
|
|
88
|
+
children={
|
|
89
|
+
<div style={{
|
|
90
|
+
display: "flex",
|
|
91
|
+
flexDirection: "column",
|
|
92
|
+
}}>
|
|
93
|
+
<Typography $type="subheading-1" $color="#0A0101">1+2=3</Typography>
|
|
94
|
+
<Typography $type="body-text" $color="#8F8F8F">point</Typography>
|
|
95
|
+
</div>
|
|
96
|
+
}
|
|
97
|
+
/>
|
|
98
|
+
</Card>
|
|
99
|
+
<Card title="Loader">
|
|
100
|
+
<Loader />
|
|
101
|
+
</Card>
|
|
102
|
+
<Card title="Tabs">
|
|
103
|
+
<Tabs
|
|
104
|
+
items={[
|
|
105
|
+
{
|
|
106
|
+
key: "1",
|
|
107
|
+
label: "Tab 1",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: "2",
|
|
111
|
+
label: "Tab 2",
|
|
112
|
+
},
|
|
113
|
+
]}
|
|
114
|
+
/>
|
|
115
|
+
</Card>
|
|
116
|
+
<Card title="Image">
|
|
117
|
+
<div
|
|
118
|
+
style={{
|
|
119
|
+
width: "100%",
|
|
120
|
+
height: "200px",
|
|
121
|
+
display: "flex",
|
|
122
|
+
gap: "16px",
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
<Image src="https://placehold.co/300x400" />
|
|
126
|
+
<Image src="https://placehold.co/160x90" />
|
|
127
|
+
<Image src="https://placehold.co/100x100" />
|
|
128
|
+
</div>
|
|
129
|
+
</Card>
|
|
130
|
+
<Card title="Modal">
|
|
131
|
+
<>
|
|
132
|
+
<Button
|
|
133
|
+
type="primary"
|
|
134
|
+
$size="middle"
|
|
135
|
+
$backgroundColor="#FFF"
|
|
136
|
+
$textColor="#A71A1A"
|
|
137
|
+
onClick={() => {
|
|
138
|
+
setModal1(true)
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
Open Modal
|
|
142
|
+
</Button>
|
|
143
|
+
<Modal
|
|
144
|
+
open={modal1}
|
|
145
|
+
onCancel={() => {
|
|
146
|
+
setModal1(false)
|
|
147
|
+
}}
|
|
148
|
+
onOk={() => {
|
|
149
|
+
setModal1(false)
|
|
150
|
+
}}
|
|
151
|
+
title={
|
|
152
|
+
<Typography $type="subheading-2">
|
|
153
|
+
Modal title
|
|
154
|
+
</Typography>
|
|
155
|
+
}
|
|
156
|
+
footer={
|
|
157
|
+
<div
|
|
158
|
+
style={{
|
|
159
|
+
width: "100%",
|
|
160
|
+
display: "flex",
|
|
161
|
+
justifyContent: "center",
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<Button
|
|
165
|
+
type="primary"
|
|
166
|
+
$size="middle"
|
|
167
|
+
$backgroundColor="#A71A1A"
|
|
168
|
+
$textColor="#FFF"
|
|
169
|
+
>
|
|
170
|
+
OK
|
|
171
|
+
</Button>
|
|
172
|
+
</div>
|
|
173
|
+
}
|
|
174
|
+
>
|
|
175
|
+
Modal title
|
|
176
|
+
</Modal>
|
|
177
|
+
</>
|
|
178
|
+
</Card>
|
|
179
|
+
<Card title="Form" backgroundColor="#FFF">
|
|
180
|
+
<FormItem
|
|
181
|
+
label="label"
|
|
182
|
+
layout="vertical"
|
|
183
|
+
>
|
|
184
|
+
<Input
|
|
185
|
+
/>
|
|
186
|
+
</FormItem>
|
|
187
|
+
<FormItem
|
|
188
|
+
label="label"
|
|
189
|
+
layout="vertical"
|
|
190
|
+
help="I'm a mistake"
|
|
191
|
+
validateStatus='error'
|
|
192
|
+
>
|
|
193
|
+
<Input
|
|
194
|
+
status="error"
|
|
195
|
+
/>
|
|
196
|
+
</FormItem>
|
|
197
|
+
<FormItem
|
|
198
|
+
label="label"
|
|
199
|
+
layout="vertical"
|
|
200
|
+
>
|
|
201
|
+
<Input
|
|
202
|
+
disabled
|
|
203
|
+
value="I'm disabled"
|
|
204
|
+
/>
|
|
205
|
+
</FormItem>
|
|
206
|
+
<FormItem
|
|
207
|
+
label="label"
|
|
208
|
+
layout="vertical"
|
|
209
|
+
>
|
|
210
|
+
<InputPassword
|
|
211
|
+
visibilityToggle={true}
|
|
212
|
+
/>
|
|
213
|
+
</FormItem>
|
|
214
|
+
<InputSearch />
|
|
215
|
+
</Card>
|
|
216
|
+
<Card title="Avatar">
|
|
217
|
+
<Avatar
|
|
218
|
+
src="https://placehold.co/300x400"
|
|
219
|
+
size={120}
|
|
220
|
+
/>
|
|
221
|
+
</Card>
|
|
222
|
+
<Card title="Appbar">
|
|
223
|
+
<div
|
|
224
|
+
style={{
|
|
225
|
+
width: "100%",
|
|
226
|
+
maxWidth: "390px",
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<Appbar
|
|
230
|
+
items={AppbarItems}
|
|
231
|
+
currentItem={AppbarItems[0]}
|
|
232
|
+
onMenuItemClick={(item) => {
|
|
233
|
+
console.log("clicked", item.title)
|
|
234
|
+
}}
|
|
235
|
+
/>
|
|
236
|
+
</div>
|
|
237
|
+
</Card>
|
|
238
|
+
<Card
|
|
239
|
+
title="Header"
|
|
240
|
+
>
|
|
241
|
+
<div
|
|
242
|
+
style={{
|
|
243
|
+
width: "100%",
|
|
244
|
+
maxWidth: "390px",
|
|
245
|
+
backgroundColor: "#FFF7E2",
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
248
|
+
<Header />
|
|
249
|
+
</div>
|
|
250
|
+
</Card>
|
|
251
|
+
</div >
|
|
252
|
+
)
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export default CoreView
|