@clickhouse/click-ui 0.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/.eslintrc.cjs +32 -0
- package/.github/workflows/deployment.yml +34 -0
- package/.storybook/main.ts +18 -0
- package/.storybook/preview-head.html +4 -0
- package/.storybook/preview.tsx +67 -0
- package/README.md +11 -0
- package/app/.babelrc +27 -0
- package/app/.eslintrc.json +6 -0
- package/app/.storybook/main.ts +17 -0
- package/app/.storybook/preview.tsx +26 -0
- package/app/README.md +38 -0
- package/app/next.config.js +6 -0
- package/app/package-lock.json +28711 -0
- package/app/package.json +44 -0
- package/app/public/favicon.ico +0 -0
- package/app/public/next.svg +1 -0
- package/app/public/vercel.svg +1 -0
- package/app/src/assets/RightArrow/right-arrow.tsx +17 -0
- package/app/src/assets/S3Logo/s3-logo.tsx +31 -0
- package/app/src/assets/amazon_s3.svg +9 -0
- package/app/src/assets/arrow.svg +3 -0
- package/app/src/globals.d.ts +4 -0
- package/app/src/pages/_app.tsx +8 -0
- package/app/src/pages/_document.tsx +17 -0
- package/app/src/pages/api/hello.ts +13 -0
- package/app/src/pages/index.tsx +141 -0
- package/app/src/pages/label.tsx +27 -0
- package/app/src/stories/assets/code-brackets.svg +1 -0
- package/app/src/stories/assets/colors.svg +1 -0
- package/app/src/stories/assets/comments.svg +1 -0
- package/app/src/stories/assets/direction.svg +1 -0
- package/app/src/stories/assets/flow.svg +1 -0
- package/app/src/stories/assets/plugin.svg +1 -0
- package/app/src/stories/assets/repo.svg +1 -0
- package/app/src/stories/assets/stackalt.svg +1 -0
- package/app/src/styles/Home.module.css +235 -0
- package/app/src/styles/globals.css +111 -0
- package/app/src/styles/types.ts +1031 -0
- package/app/src/styles/variables.classic.css +16 -0
- package/app/src/styles/variables.classic.json +31 -0
- package/app/src/styles/variables.css +763 -0
- package/app/src/styles/variables.dark.css +135 -0
- package/app/src/styles/variables.dark.json +339 -0
- package/app/src/styles/variables.json +1029 -0
- package/app/src/styles/variables.light.css +203 -0
- package/app/src/styles/variables.light.json +478 -0
- package/app/tokens/themes/$metadata.json +9 -0
- package/app/tokens/themes/$themes.json +1 -0
- package/app/tokens/themes/classic.json +58 -0
- package/app/tokens/themes/component.json +868 -0
- package/app/tokens/themes/dark.json +937 -0
- package/app/tokens/themes/light.json +1380 -0
- package/app/tokens/themes/primitives.json +859 -0
- package/app/tsconfig.json +23 -0
- package/build-tokens.js +131 -0
- package/index.html +17 -0
- package/jest.config.ts +11 -0
- package/package.json +77 -0
- package/public/vite.svg +1 -0
- package/src/App.css +1 -0
- package/src/App.module.css +235 -0
- package/src/App.tsx +154 -0
- package/src/assets/RightArrow/RightArrow.tsx +17 -0
- package/src/assets/S3Logo/S3Logo.tsx +31 -0
- package/src/assets/react.svg +1 -0
- package/src/components/Accordion/Accordion.stories.tsx +78 -0
- package/src/components/Accordion/Accordion.test.tsx +46 -0
- package/src/components/Accordion/Accordion.tsx +118 -0
- package/src/components/Badge/Badge.stories.ts +14 -0
- package/src/components/Badge/Badge.test.tsx +11 -0
- package/src/components/Badge/Badge.tsx +24 -0
- package/src/components/BigStat/BigStat.stories.ts +15 -0
- package/src/components/BigStat/BigStat.tsx +37 -0
- package/src/components/Button/Button.stories.ts +82 -0
- package/src/components/Button/Button.test.tsx +32 -0
- package/src/components/Button/Button.tsx +97 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.ts +14 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +78 -0
- package/src/components/Card/Card.stories.ts +19 -0
- package/src/components/Card/Card.tsx +107 -0
- package/src/components/FormField/FormField.stories.ts +14 -0
- package/src/components/FormField/FormField.tsx +22 -0
- package/src/components/Icon/Icon.stories.ts +46 -0
- package/src/components/Icon/Icon.tsx +90 -0
- package/src/components/Icon/types.ts +18 -0
- package/src/components/IconButton/IconButton.stories.ts +16 -0
- package/src/components/IconButton/IconButton.tsx +94 -0
- package/src/components/SidebarNavigationItem/SidebarNavigationItem.stories.tsx +28 -0
- package/src/components/SidebarNavigationItem/SidebarNavigationItem.tsx +112 -0
- package/src/components/Switch/Switch.stories.ts +14 -0
- package/src/components/Switch/Switch.tsx +106 -0
- package/src/components/Tabs/Tabs.stories.tsx +71 -0
- package/src/components/Tabs/Tabs.test.tsx +86 -0
- package/src/components/Tabs/Tabs.tsx +82 -0
- package/src/components/icons/ChatIcon.tsx +22 -0
- package/src/components/icons/ChevronDown.tsx +6 -0
- package/src/components/icons/ChevronRight.tsx +20 -0
- package/src/components/icons/DatabaseIcon.tsx +33 -0
- package/src/components/icons/FilterIcon.tsx +24 -0
- package/src/components/icons/Flags/EuropeanUnion.tsx +174 -0
- package/src/components/icons/Flags/Germany.tsx +25 -0
- package/src/components/icons/Flags/India.tsx +48 -0
- package/src/components/icons/Flags/Ireland.tsx +32 -0
- package/src/components/icons/Flags/Netherlands.tsx +29 -0
- package/src/components/icons/Flags/Singapore.tsx +43 -0
- package/src/components/icons/Flags/UnitedKingdom.tsx +32 -0
- package/src/components/icons/Flags/UnitedStates.tsx +26 -0
- package/src/components/icons/Flags/index.tsx +46 -0
- package/src/components/icons/HistoryIcon.tsx +28 -0
- package/src/components/icons/Icons.mdx +36 -0
- package/src/components/icons/InsertRowIcon.tsx +36 -0
- package/src/components/icons/SortAltIcon.tsx +24 -0
- package/src/components/icons/UserIcon.tsx +17 -0
- package/src/components/icons/UsersIcon.tsx +43 -0
- package/src/components/index.ts +14 -0
- package/src/components/types.ts +1 -0
- package/src/index.css +9 -0
- package/src/index.ts +2 -0
- package/src/main.tsx +11 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/styles/Home.module.css +235 -0
- package/src/styles/globals.css +111 -0
- package/src/styles/types.ts +1669 -0
- package/src/styles/variables.classic.css +16 -0
- package/src/styles/variables.classic.json +31 -0
- package/src/styles/variables.css +763 -0
- package/src/styles/variables.dark.css +135 -0
- package/src/styles/variables.dark.json +576 -0
- package/src/styles/variables.json +1667 -0
- package/src/styles/variables.light.css +203 -0
- package/src/styles/variables.light.json +789 -0
- package/src/theme/index.ts +22 -0
- package/src/theme/theme.tsx +28 -0
- package/src/vite-env.d.ts +1 -0
- package/tokens/themes/$metadata.json +9 -0
- package/tokens/themes/$themes.json +1 -0
- package/tokens/themes/classic.json +58 -0
- package/tokens/themes/component.json +1567 -0
- package/tokens/themes/dark.json +1450 -0
- package/tokens/themes/light.json +2059 -0
- package/tokens/themes/primitives.json +863 -0
- package/tsconfig.json +27 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
"incremental": true,
|
|
17
|
+
"paths": {
|
|
18
|
+
"@/*": ["./src/*"]
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
|
22
|
+
"exclude": ["node_modules"]
|
|
23
|
+
}
|
package/build-tokens.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import {registerTransforms,transforms} from"@tokens-studio/sd-transforms";
|
|
3
|
+
import StyleDictionary from "style-dictionary";
|
|
4
|
+
|
|
5
|
+
registerTransforms(StyleDictionary);
|
|
6
|
+
const themes = ["classic", "dark", "light"];
|
|
7
|
+
|
|
8
|
+
function generateThemeFromDictionary (dictionary, valueFunc = (value) => value) {
|
|
9
|
+
const theme = {};
|
|
10
|
+
dictionary.allTokens.forEach((token) => {
|
|
11
|
+
_.setWith(theme, token.name, valueFunc(token.value), Object)
|
|
12
|
+
});
|
|
13
|
+
return theme;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
StyleDictionary.registerTransform({
|
|
17
|
+
type: "name",
|
|
18
|
+
name: "name/cti/dot",
|
|
19
|
+
transformer: (token, options) => {
|
|
20
|
+
if (options.prefix && options.prefix.length) {
|
|
21
|
+
return [options.prefix].concat(token.path).join(".");
|
|
22
|
+
} else {
|
|
23
|
+
return token.path.join(".");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
StyleDictionary.registerFormat({
|
|
29
|
+
name: "ThemeFormat",
|
|
30
|
+
formatter: function({ dictionary, platform, options, file }) {
|
|
31
|
+
const theme = generateThemeFromDictionary(dictionary);
|
|
32
|
+
return JSON.stringify(theme, null, 2);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
StyleDictionary.registerFormat({
|
|
37
|
+
name: "TypescriptFormat",
|
|
38
|
+
formatter: function({ dictionary, platform, options, file }) {
|
|
39
|
+
const theme = generateThemeFromDictionary(dictionary, (value) => typeof value);
|
|
40
|
+
|
|
41
|
+
return `
|
|
42
|
+
export interface Theme ${JSON.stringify(theme, null, 2).replaceAll("\"string\"", "string")}
|
|
43
|
+
`
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
StyleDictionary.extend({
|
|
48
|
+
source: [`./tokens/**/!(${themes.join("|*.")}).json`],
|
|
49
|
+
platforms: {
|
|
50
|
+
css: {
|
|
51
|
+
transforms: [...transforms, "name/cti/kebab"],
|
|
52
|
+
buildPath: "build/css/",
|
|
53
|
+
files: [
|
|
54
|
+
{
|
|
55
|
+
destination: "variables.css",
|
|
56
|
+
format: "css/variables",
|
|
57
|
+
options: {
|
|
58
|
+
outputReferences: true,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
js: {
|
|
64
|
+
transforms: [...transforms, "name/cti/dot"],
|
|
65
|
+
buildPath: "src/styles/",
|
|
66
|
+
files: [
|
|
67
|
+
{
|
|
68
|
+
destination: "variables.json",
|
|
69
|
+
format: "ThemeFormat",
|
|
70
|
+
options: {
|
|
71
|
+
outputReferences: true,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
ts: {
|
|
77
|
+
transforms: [...transforms, "name/cti/dot"],
|
|
78
|
+
buildPath: "src/styles/",
|
|
79
|
+
files: [
|
|
80
|
+
{
|
|
81
|
+
destination: "types.ts",
|
|
82
|
+
format: "TypescriptFormat",
|
|
83
|
+
options: {
|
|
84
|
+
outputReferences: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
})
|
|
91
|
+
.cleanAllPlatforms()
|
|
92
|
+
.buildAllPlatforms();
|
|
93
|
+
|
|
94
|
+
themes.forEach(theme =>
|
|
95
|
+
StyleDictionary.extend({
|
|
96
|
+
include: [`./tokens/**/!(${themes.join("|*.")}).json`],
|
|
97
|
+
source: [`./tokens/**/${theme}.json`],
|
|
98
|
+
platforms: {
|
|
99
|
+
css: {
|
|
100
|
+
transforms: [...transforms, "name/cti/kebab"],
|
|
101
|
+
buildPath: "build/css/",
|
|
102
|
+
files: [
|
|
103
|
+
{
|
|
104
|
+
destination: `variables.${theme}.css`,
|
|
105
|
+
format: "css/variables",
|
|
106
|
+
filter: token => token.filePath.indexOf(`${theme}`) > -1,
|
|
107
|
+
options: {
|
|
108
|
+
outputReferences: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
js: {
|
|
114
|
+
transforms: [...transforms, "name/cti/dot"],
|
|
115
|
+
buildPath: "src/styles/",
|
|
116
|
+
files: [
|
|
117
|
+
{
|
|
118
|
+
destination: `variables.${theme}.json`,
|
|
119
|
+
format: "ThemeFormat",
|
|
120
|
+
filter: token => token.filePath.indexOf(`${theme}`) > -1,
|
|
121
|
+
options: {
|
|
122
|
+
outputReferences: true,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
.cleanAllPlatforms()
|
|
130
|
+
.buildAllPlatforms()
|
|
131
|
+
);
|
package/index.html
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
<link
|
|
8
|
+
href="https://fonts.googleapis.com/css?family=Inter&display=swap"
|
|
9
|
+
rel="stylesheet"
|
|
10
|
+
/>
|
|
11
|
+
<title>Vite + React + TS</title>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
package/jest.config.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@clickhouse/click-ui",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Official ClickHouse design system react library",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"clickhouse",
|
|
8
|
+
"design system"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/ClickHouse/click-ui.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://clickhouse.com",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"watch": "jest --watch",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"dev": "vite",
|
|
19
|
+
"generate-tokens": "node build-tokens.js",
|
|
20
|
+
"build": "tsc && vite build",
|
|
21
|
+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"build-storybook": "storybook build",
|
|
25
|
+
"chromatic": "npx chromatic"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@radix-ui/react-accordion": "^1.1.2",
|
|
29
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
30
|
+
"lodash": "^4.17.21"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@radix-ui/react-switch": "^1.0.2",
|
|
34
|
+
"@storybook/addon-essentials": "^7.0.18",
|
|
35
|
+
"@storybook/addon-interactions": "^7.0.18",
|
|
36
|
+
"@storybook/addon-links": "^7.0.18",
|
|
37
|
+
"@storybook/blocks": "^7.0.18",
|
|
38
|
+
"@storybook/manager-api": "^7.0.23",
|
|
39
|
+
"@storybook/react": "^7.0.18",
|
|
40
|
+
"@storybook/react-vite": "^7.0.18",
|
|
41
|
+
"@storybook/testing-library": "^0.1.0",
|
|
42
|
+
"@storybook/theming": "^7.0.23",
|
|
43
|
+
"@testing-library/dom": "^9.3.1",
|
|
44
|
+
"@testing-library/react": "^14.0.0",
|
|
45
|
+
"@testing-library/user-event": "^14.4.3",
|
|
46
|
+
"@types/jest": "^29.5.2",
|
|
47
|
+
"@types/lodash-es": "^4.17.7",
|
|
48
|
+
"@types/react": "^18.0.28",
|
|
49
|
+
"@types/react-dom": "^18.0.11",
|
|
50
|
+
"@types/styled-components": "^5.1.26",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^5.57.1",
|
|
52
|
+
"@typescript-eslint/parser": "^5.57.1",
|
|
53
|
+
"@vitejs/plugin-react": "^4.0.1",
|
|
54
|
+
"babel-jest": "^29.5.0",
|
|
55
|
+
"babel-plugin-styled-components": "^2.1.4",
|
|
56
|
+
"chromatic": "^6.18.2",
|
|
57
|
+
"eslint": "^8.43.0",
|
|
58
|
+
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
|
|
59
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
60
|
+
"eslint-plugin-react-refresh": "^0.3.4",
|
|
61
|
+
"eslint-plugin-storybook": "^0.6.12",
|
|
62
|
+
"jest": "^29.5.0",
|
|
63
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
64
|
+
"prop-types": "^15.8.1",
|
|
65
|
+
"storybook": "^7.0.18",
|
|
66
|
+
"storybook-addon-pseudo-states": "^2.0.1",
|
|
67
|
+
"ts-jest": "^29.1.0",
|
|
68
|
+
"ts-node": "^10.9.1",
|
|
69
|
+
"typescript": "^5.0.2",
|
|
70
|
+
"vite": "^4.3.9"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"styled-components": "^5.3.10",
|
|
74
|
+
"react": "^18.2.0",
|
|
75
|
+
"react-dom": "^18.2.0"
|
|
76
|
+
}
|
|
77
|
+
}
|
package/public/vite.svg
ADDED
|
@@ -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>
|
package/src/App.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
.main {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 6rem;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.description {
|
|
11
|
+
display: inherit;
|
|
12
|
+
justify-content: inherit;
|
|
13
|
+
align-items: inherit;
|
|
14
|
+
font-size: 0.85rem;
|
|
15
|
+
max-width: var(--max-width);
|
|
16
|
+
width: 100%;
|
|
17
|
+
z-index: 2;
|
|
18
|
+
font-family: var(--font-mono);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.description a {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.description p {
|
|
29
|
+
position: relative;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 1rem;
|
|
32
|
+
background-color: rgba(var(--callout-rgb), 0.5);
|
|
33
|
+
border: 1px solid rgba(var(--callout-border-rgb), 0.3);
|
|
34
|
+
border-radius: var(--border-radius);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.code {
|
|
38
|
+
font-weight: 700;
|
|
39
|
+
font-family: var(--font-mono);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.grid {
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-columns: repeat(4, minmax(25%, auto));
|
|
45
|
+
width: var(--max-width);
|
|
46
|
+
max-width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.card {
|
|
50
|
+
padding: 1rem 1.2rem;
|
|
51
|
+
border-radius: var(--border-radius);
|
|
52
|
+
background: rgba(var(--card-rgb), 0);
|
|
53
|
+
border: 1px solid rgba(var(--card-border-rgb), 0);
|
|
54
|
+
transition: background 200ms, border 200ms;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.card span {
|
|
58
|
+
display: inline-block;
|
|
59
|
+
transition: transform 200ms;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.card h2 {
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
margin-bottom: 0.7rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.card p {
|
|
68
|
+
margin: 0;
|
|
69
|
+
opacity: 0.6;
|
|
70
|
+
font-size: 0.9rem;
|
|
71
|
+
line-height: 1.5;
|
|
72
|
+
max-width: 30ch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.center {
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
position: relative;
|
|
80
|
+
padding: 4rem 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.center::before {
|
|
84
|
+
background: var(--secondary-glow);
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
width: 480px;
|
|
87
|
+
height: 360px;
|
|
88
|
+
margin-left: -400px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.center::after {
|
|
92
|
+
background: var(--primary-glow);
|
|
93
|
+
width: 240px;
|
|
94
|
+
height: 180px;
|
|
95
|
+
z-index: -1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.center::before,
|
|
99
|
+
.center::after {
|
|
100
|
+
content: '';
|
|
101
|
+
left: 50%;
|
|
102
|
+
position: absolute;
|
|
103
|
+
filter: blur(45px);
|
|
104
|
+
transform: translateZ(0);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.logo {
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
/* Enable hover only on non-touch devices */
|
|
111
|
+
@media (hover: hover) and (pointer: fine) {
|
|
112
|
+
.card:hover {
|
|
113
|
+
background: rgba(var(--card-rgb), 0.1);
|
|
114
|
+
border: 1px solid rgba(var(--card-border-rgb), 0.15);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.card:hover span {
|
|
118
|
+
transform: translateX(4px);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (prefers-reduced-motion) {
|
|
123
|
+
.card:hover span {
|
|
124
|
+
transform: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Mobile */
|
|
129
|
+
@media (max-width: 700px) {
|
|
130
|
+
.content {
|
|
131
|
+
padding: 4rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.grid {
|
|
135
|
+
grid-template-columns: 1fr;
|
|
136
|
+
margin-bottom: 120px;
|
|
137
|
+
max-width: 320px;
|
|
138
|
+
text-align: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.card {
|
|
142
|
+
padding: 1rem 2.5rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.card h2 {
|
|
146
|
+
margin-bottom: 0.5rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.center {
|
|
150
|
+
padding: 8rem 0 6rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.center::before {
|
|
154
|
+
transform: none;
|
|
155
|
+
height: 300px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.description {
|
|
159
|
+
font-size: 0.8rem;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.description a {
|
|
163
|
+
padding: 1rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.description p,
|
|
167
|
+
.description div {
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
position: fixed;
|
|
171
|
+
width: 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.description p {
|
|
175
|
+
align-items: center;
|
|
176
|
+
inset: 0 0 auto;
|
|
177
|
+
padding: 2rem 1rem 1.4rem;
|
|
178
|
+
border-radius: 0;
|
|
179
|
+
border: none;
|
|
180
|
+
border-bottom: 1px solid rgba(var(--callout-border-rgb), 0.25);
|
|
181
|
+
background: linear-gradient(
|
|
182
|
+
to bottom,
|
|
183
|
+
rgba(var(--background-start-rgb), 1),
|
|
184
|
+
rgba(var(--callout-rgb), 0.5)
|
|
185
|
+
);
|
|
186
|
+
background-clip: padding-box;
|
|
187
|
+
backdrop-filter: blur(24px);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.description div {
|
|
191
|
+
align-items: flex-end;
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
inset: auto 0 0;
|
|
194
|
+
padding: 2rem;
|
|
195
|
+
height: 200px;
|
|
196
|
+
background: linear-gradient(
|
|
197
|
+
to bottom,
|
|
198
|
+
transparent 0%,
|
|
199
|
+
rgb(var(--background-end-rgb)) 40%
|
|
200
|
+
);
|
|
201
|
+
z-index: 1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Tablet and Smaller Desktop */
|
|
206
|
+
@media (min-width: 701px) and (max-width: 1120px) {
|
|
207
|
+
.grid {
|
|
208
|
+
grid-template-columns: repeat(2, 50%);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@media (prefers-color-scheme: dark) {
|
|
213
|
+
.vercelLogo {
|
|
214
|
+
filter: invert(1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.logo {
|
|
218
|
+
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
@keyframes rotate {
|
|
223
|
+
from {
|
|
224
|
+
transform: rotate(360deg);
|
|
225
|
+
}
|
|
226
|
+
to {
|
|
227
|
+
transform: rotate(0deg);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.flexWrap {
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-flow: row wrap;
|
|
234
|
+
gap: 10px;
|
|
235
|
+
}
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import "@/styles/globals.css";
|
|
4
|
+
import "./styles/variables.css";
|
|
5
|
+
import "./styles/variables.dark.css";
|
|
6
|
+
|
|
7
|
+
import styles from "./App.module.css";
|
|
8
|
+
import { ThemeName, ThemeProvider } from "./theme";
|
|
9
|
+
import {
|
|
10
|
+
Accordion,
|
|
11
|
+
Badge,
|
|
12
|
+
Button,
|
|
13
|
+
ButtonGroup,
|
|
14
|
+
Card,
|
|
15
|
+
Icon,
|
|
16
|
+
IconButton,
|
|
17
|
+
ProfileIcon,
|
|
18
|
+
SidebarNavigationItem,
|
|
19
|
+
Switch,
|
|
20
|
+
Tabs,
|
|
21
|
+
TextFieldLabel,
|
|
22
|
+
} from "@/components";
|
|
23
|
+
|
|
24
|
+
const App = () => {
|
|
25
|
+
const [currentTheme, setCurrentTheme] = useState<ThemeName>("dark");
|
|
26
|
+
const [selectedButton, setSelectedButton] = useState(0);
|
|
27
|
+
const [checked, setChecked] = useState(false);
|
|
28
|
+
const [disabled] = useState(false);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<ThemeProvider theme={currentTheme}>
|
|
32
|
+
<TextFieldLabel state="default" text="my label" />
|
|
33
|
+
<TextFieldLabel state="active" text="my label" />
|
|
34
|
+
<TextFieldLabel state="disabled" text="my label" />
|
|
35
|
+
<TextFieldLabel state="error" text="my label" />
|
|
36
|
+
<div className={styles.flexWrap}>
|
|
37
|
+
<IconButton size="small">
|
|
38
|
+
<ProfileIcon />
|
|
39
|
+
</IconButton>
|
|
40
|
+
<IconButton size="small" state="active">
|
|
41
|
+
<ProfileIcon />
|
|
42
|
+
</IconButton>
|
|
43
|
+
<IconButton size="small" disabled>
|
|
44
|
+
<ProfileIcon />
|
|
45
|
+
</IconButton>
|
|
46
|
+
</div>
|
|
47
|
+
<div className={styles.flexWrap}>
|
|
48
|
+
<IconButton>
|
|
49
|
+
<ProfileIcon />
|
|
50
|
+
</IconButton>
|
|
51
|
+
<IconButton state="active">
|
|
52
|
+
<ProfileIcon />
|
|
53
|
+
</IconButton>
|
|
54
|
+
<IconButton disabled>
|
|
55
|
+
<ProfileIcon />
|
|
56
|
+
</IconButton>
|
|
57
|
+
</div>
|
|
58
|
+
<div className={styles.flexWrap}>
|
|
59
|
+
<IconButton display="empty">
|
|
60
|
+
<ProfileIcon />
|
|
61
|
+
</IconButton>
|
|
62
|
+
<IconButton display="empty" state="active">
|
|
63
|
+
<ProfileIcon />
|
|
64
|
+
</IconButton>
|
|
65
|
+
<IconButton display="empty" disabled>
|
|
66
|
+
<ProfileIcon />
|
|
67
|
+
</IconButton>
|
|
68
|
+
</div>
|
|
69
|
+
<div className={styles.flexWrap}>
|
|
70
|
+
<Badge text={"default"}></Badge>
|
|
71
|
+
<Badge text={"success"} state={"success"}></Badge>
|
|
72
|
+
<Badge text={"neutral"} state={"neutral"}></Badge>
|
|
73
|
+
<Badge text={"danger"} state={"danger"}></Badge>
|
|
74
|
+
<Badge text={"disabled"} state={"disabled"}></Badge>
|
|
75
|
+
</div>
|
|
76
|
+
<Card
|
|
77
|
+
title="Card title"
|
|
78
|
+
description="This is a card description"
|
|
79
|
+
badgeText="experiment"
|
|
80
|
+
infoText="Read More"
|
|
81
|
+
infoUrl="#"
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
<ButtonGroup
|
|
85
|
+
labels={["Left center", "Center", "Center", "Center", "Right end"]}
|
|
86
|
+
activeIndex={selectedButton}
|
|
87
|
+
onClick={(index: number) => setSelectedButton(index)}
|
|
88
|
+
/>
|
|
89
|
+
<Switch
|
|
90
|
+
checked={checked}
|
|
91
|
+
disabled={disabled}
|
|
92
|
+
onCheckedChange={setChecked}
|
|
93
|
+
/>
|
|
94
|
+
<div style={{ color: "white" }}>disabled: {`${disabled}`}</div>
|
|
95
|
+
<button
|
|
96
|
+
onClick={() => {
|
|
97
|
+
document.body.style.backgroundColor = "black";
|
|
98
|
+
setCurrentTheme("dark");
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
Dark
|
|
102
|
+
</button>
|
|
103
|
+
<button
|
|
104
|
+
onClick={() => {
|
|
105
|
+
document.body.style.backgroundColor = "white";
|
|
106
|
+
setCurrentTheme("light");
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
Light
|
|
110
|
+
</button>
|
|
111
|
+
<button
|
|
112
|
+
onClick={() => {
|
|
113
|
+
document.body.style.backgroundColor = "white";
|
|
114
|
+
setCurrentTheme("classic");
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
Classic
|
|
118
|
+
</button>
|
|
119
|
+
|
|
120
|
+
<Button
|
|
121
|
+
type="primary"
|
|
122
|
+
onClick={() => alert("you clicked on the primary button")}
|
|
123
|
+
>
|
|
124
|
+
Primary
|
|
125
|
+
</Button>
|
|
126
|
+
<Button
|
|
127
|
+
type="secondary"
|
|
128
|
+
onClick={() => alert("you clicked on the secondary button")}
|
|
129
|
+
>
|
|
130
|
+
Secondary
|
|
131
|
+
</Button>
|
|
132
|
+
<Icon name="users" />
|
|
133
|
+
<Accordion title="Accordion">I'm some content </Accordion>
|
|
134
|
+
<SidebarNavigationItem icon="user">
|
|
135
|
+
<a href="/color"> link to color</a>
|
|
136
|
+
</SidebarNavigationItem>
|
|
137
|
+
<SidebarNavigationItem icon="user" collapsible label="collapsible item">
|
|
138
|
+
<a href="/color"> link to color</a>
|
|
139
|
+
</SidebarNavigationItem>
|
|
140
|
+
<Tabs defaultValue="tab1" onValueChange={e => console.log(e)}>
|
|
141
|
+
<Tabs.TriggersList>
|
|
142
|
+
<Tabs.Trigger value="tab1">tab1 </Tabs.Trigger>
|
|
143
|
+
<Tabs.Trigger value="tab2">tab2 </Tabs.Trigger>
|
|
144
|
+
<Tabs.Trigger value="tab3">tab3 </Tabs.Trigger>
|
|
145
|
+
</Tabs.TriggersList>
|
|
146
|
+
<Tabs.Content value="tab1">Tab 1 content</Tabs.Content>
|
|
147
|
+
<Tabs.Content value="tab2">Tab 2 content</Tabs.Content>
|
|
148
|
+
<Tabs.Content value="tab3">Tab 3 content</Tabs.Content>
|
|
149
|
+
</Tabs>
|
|
150
|
+
</ThemeProvider>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default App;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const RightArrow = () => (
|
|
2
|
+
<svg
|
|
3
|
+
width="20"
|
|
4
|
+
height="20"
|
|
5
|
+
viewBox="0 0 20 20"
|
|
6
|
+
fill="none"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
9
|
+
<path
|
|
10
|
+
d="M8.33334 13.3333L11.6667 10L8.33334 6.66667"
|
|
11
|
+
stroke="#161517"
|
|
12
|
+
strokeWidth="1.5"
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|