revotech-ui-kit 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +29 -0
- package/.eslintrc +10 -0
- package/.storybook/main.ts +17 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.ts +17 -0
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/assets/fonts/Geist/Geist-Black.otf +0 -0
- package/assets/fonts/Geist/Geist-Black.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Bold.otf +0 -0
- package/assets/fonts/Geist/Geist-Bold.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Light.otf +0 -0
- package/assets/fonts/Geist/Geist-Light.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Medium.otf +0 -0
- package/assets/fonts/Geist/Geist-Medium.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Regular.otf +0 -0
- package/assets/fonts/Geist/Geist-Regular.woff2 +0 -0
- package/assets/fonts/Geist/Geist-SemiBold.otf +0 -0
- package/assets/fonts/Geist/Geist-SemiBold.woff2 +0 -0
- package/assets/fonts/Geist/Geist-Thin.otf +0 -0
- package/assets/fonts/Geist/Geist-Thin.woff2 +0 -0
- package/assets/fonts/Geist/Geist-UltraBlack.otf +0 -0
- package/assets/fonts/Geist/Geist-UltraBlack.woff2 +0 -0
- package/assets/fonts/Geist/Geist-UltraLight.otf +0 -0
- package/assets/fonts/Geist/Geist-UltraLight.woff2 +0 -0
- package/assets/fonts/Geist/GeistVariableVF.ttf +0 -0
- package/assets/fonts/Geist/GeistVariableVF.woff2 +0 -0
- package/assets/fonts/Geist/LICENSE.TXT +92 -0
- package/assets/open-wc-logo.svg +29 -0
- package/index.html +362 -0
- package/package.json +117 -0
- package/rollup.config.js +71 -0
- package/src/components/atoms/button/button.atom.ts +39 -0
- package/src/components/atoms/button/button.stories.ts +186 -0
- package/src/components/atoms/button/button.style.ts +31 -0
- package/src/components/atoms/button/button.type.ts +10 -0
- package/src/components/atoms/checkbox/checkbox.atom.ts +62 -0
- package/src/components/atoms/checkbox/checkbox.stories.ts +42 -0
- package/src/components/atoms/command-empty/command-empty.atom.ts +44 -0
- package/src/components/atoms/command-group/command-group.atom.ts +60 -0
- package/src/components/atoms/command-item/command-item.atom.ts +74 -0
- package/src/components/atoms/command-list/command-list.atom.ts +37 -0
- package/src/components/atoms/command-separator/command-separator.atom.ts +42 -0
- package/src/components/atoms/dialog/dialog.atom.ts +301 -0
- package/src/components/atoms/dialog/dialog.stories.ts +86 -0
- package/src/components/atoms/index.ts +10 -0
- package/src/components/atoms/input/input.atom.ts +34 -0
- package/src/components/atoms/input/input.stories.ts +89 -0
- package/src/components/atoms/input/input.type.ts +24 -0
- package/src/components/atoms/label/label.atom.ts +40 -0
- package/src/components/atoms/label/label.stories.ts +18 -0
- package/src/components/atoms/label/label.style.ts +5 -0
- package/src/components/command/command.stories.ts +154 -0
- package/src/components/command/command.ts +391 -0
- package/src/components/index.ts +2 -0
- package/src/components/molecules/command/command.molecules.ts +31 -0
- package/src/components/molecules/command-input/command-input.atom.ts +130 -0
- package/src/components/molecules/index.ts +1 -0
- package/src/components/popover.ts +247 -0
- package/src/globals.css +1806 -0
- package/src/helpers/index.ts +2 -0
- package/src/helpers/mouse-conroller.helper.ts +42 -0
- package/src/helpers/style.helpers.ts +6 -0
- package/src/interfaces/actionable.interface.ts +6 -0
- package/src/interfaces/atomic.interface.ts +6 -0
- package/src/interfaces/changeable.interface.ts +14 -0
- package/src/interfaces/child-support-atomic.interface.ts +5 -0
- package/src/interfaces/index.ts +6 -0
- package/src/interfaces/intractable.interface.ts +6 -0
- package/src/interfaces/variant.interface.ts +3 -0
- package/src/lib/index.ts +0 -0
- package/src/lib/next/next.lib.ts +0 -0
- package/src/lib/react/react.lib.ts +0 -0
- package/src/styles/index.ts +1 -0
- package/src/styles/tw.styles.ts +1867 -0
- package/src/tailwind-lib.css +95 -0
- package/src/wc-ui-app.ts +81 -0
- package/tailwind.config.js +81 -0
- package/test/wc-ui-app.test.ts +22 -0
- package/tsconfig.json +25 -0
- package/web-dev-server.config.mjs +26 -0
- package/web-test-runner.config.mjs +41 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
@font-face {
|
2
|
+
font-family: "GeistSans";
|
3
|
+
src: url('assets/fonts/Geist/Geist-Regular.woff2') format('woff2');
|
4
|
+
}
|
5
|
+
|
6
|
+
@tailwind base;
|
7
|
+
@tailwind components;
|
8
|
+
@tailwind utilities;
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
@layer base {
|
13
|
+
:root {
|
14
|
+
--background: 0 0% 100%;
|
15
|
+
--foreground: 240 10% 3.9%;
|
16
|
+
--card: 0 0% 100%;
|
17
|
+
--card-foreground: 240 10% 3.9%;
|
18
|
+
--popover: 0 0% 100%;
|
19
|
+
--popover-foreground: 240 10% 3.9%;
|
20
|
+
--primary: 240 5.9% 10%;
|
21
|
+
--primary-foreground: 0 0% 98%;
|
22
|
+
--secondary: 240 4.8% 95.9%;
|
23
|
+
--secondary-foreground: 240 5.9% 10%;
|
24
|
+
--muted: 240 4.8% 95.9%;
|
25
|
+
--muted-foreground: 240 3.8% 46.1%;
|
26
|
+
--accent: 240 4.8% 95.9%;
|
27
|
+
--accent-foreground: 240 5.9% 10%;
|
28
|
+
--destructive: 0 84.2% 60.2%;
|
29
|
+
--destructive-foreground: 0 0% 98%;
|
30
|
+
--border: 240 5.9% 90%;
|
31
|
+
--input: 240 5.9% 90%;
|
32
|
+
--ring: 240 5.9% 10%;
|
33
|
+
--radius: 0.5rem;
|
34
|
+
}
|
35
|
+
|
36
|
+
.dark {
|
37
|
+
--background: 240 10% 3.9%;
|
38
|
+
--foreground: 0 0% 98%;
|
39
|
+
--card: 240 10% 3.9%;
|
40
|
+
--card-foreground: 0 0% 98%;
|
41
|
+
--popover: 240 10% 3.9%;
|
42
|
+
--popover-foreground: 0 0% 98%;
|
43
|
+
--primary: 0 0% 98%;
|
44
|
+
--primary-foreground: 240 5.9% 10%;
|
45
|
+
--secondary: 240 3.7% 15.9%;
|
46
|
+
--secondary-foreground: 0 0% 98%;
|
47
|
+
--muted: 240 3.7% 15.9%;
|
48
|
+
--muted-foreground: 240 5% 64.9%;
|
49
|
+
--accent: 240 3.7% 15.9%;
|
50
|
+
--accent-foreground: 0 0% 98%;
|
51
|
+
--destructive: 0 62.8% 30.6%;
|
52
|
+
--destructive-foreground: 0 0% 98%;
|
53
|
+
--border: 240 3.7% 15.9%;
|
54
|
+
--input: 240 3.7% 15.9%;
|
55
|
+
--ring: 240 4.9% 83.9%;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
@layer base {
|
61
|
+
* {
|
62
|
+
@apply border-border;
|
63
|
+
@apply font-geist;
|
64
|
+
}
|
65
|
+
|
66
|
+
body {
|
67
|
+
@apply bg-background text-foreground;
|
68
|
+
font-synthesis-weight: none;
|
69
|
+
text-rendering: optimizeLegibility;
|
70
|
+
}
|
71
|
+
|
72
|
+
/* p {
|
73
|
+
margin-top: 6px;
|
74
|
+
margin-block-start: 6px;
|
75
|
+
} */
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
@layer utilities {
|
80
|
+
.step {
|
81
|
+
counter-increment: step;
|
82
|
+
}
|
83
|
+
|
84
|
+
.step:before {
|
85
|
+
@apply absolute w-9 h-9 bg-muted rounded-full font-mono font-medium text-center text-base inline-flex items-center justify-center -indent-px border-4 border-background;
|
86
|
+
@apply ml-[-50px] mt-[-4px];
|
87
|
+
content: counter(step);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
@media (max-width: 640px) {
|
92
|
+
.container {
|
93
|
+
@apply px-4;
|
94
|
+
}
|
95
|
+
}
|
package/src/wc-ui-app.ts
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
2
|
+
import { property, customElement } from 'lit/decorators.js';
|
3
|
+
|
4
|
+
const logo = new URL('../../assets/open-wc-logo.svg', import.meta.url).href;
|
5
|
+
|
6
|
+
@customElement('wc-ui-app')
|
7
|
+
export class WcUiApp extends LitElement {
|
8
|
+
@property({ type: String }) header = 'My app';
|
9
|
+
|
10
|
+
static styles = css`
|
11
|
+
:host {
|
12
|
+
min-height: 100vh;
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
align-items: center;
|
16
|
+
justify-content: flex-start;
|
17
|
+
font-size: calc(10px + 2vmin);
|
18
|
+
color: #1a2b42;
|
19
|
+
max-width: 960px;
|
20
|
+
margin: 0 auto;
|
21
|
+
text-align: center;
|
22
|
+
background-color: var(--wc-ui-app-background-color);
|
23
|
+
}
|
24
|
+
|
25
|
+
main {
|
26
|
+
flex-grow: 1;
|
27
|
+
}
|
28
|
+
|
29
|
+
.logo {
|
30
|
+
margin-top: 36px;
|
31
|
+
animation: app-logo-spin infinite 20s linear;
|
32
|
+
}
|
33
|
+
|
34
|
+
@keyframes app-logo-spin {
|
35
|
+
from {
|
36
|
+
transform: rotate(0deg);
|
37
|
+
}
|
38
|
+
to {
|
39
|
+
transform: rotate(360deg);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
.app-footer {
|
44
|
+
font-size: calc(12px + 0.5vmin);
|
45
|
+
align-items: center;
|
46
|
+
}
|
47
|
+
|
48
|
+
.app-footer a {
|
49
|
+
margin-left: 5px;
|
50
|
+
}
|
51
|
+
`;
|
52
|
+
|
53
|
+
render() {
|
54
|
+
return html`
|
55
|
+
<main>
|
56
|
+
<div class="logo"><img alt="open-wc logo" src=${logo} /></div>
|
57
|
+
<h1>${this.header}</h1>
|
58
|
+
|
59
|
+
<p>Edit <code>src/WcUiApp.ts</code> and save to reload.</p>
|
60
|
+
<a
|
61
|
+
class="app-link"
|
62
|
+
href="https://open-wc.org/guides/developing-components/code-examples"
|
63
|
+
target="_blank"
|
64
|
+
rel="noopener noreferrer"
|
65
|
+
>
|
66
|
+
Code examples
|
67
|
+
</a>
|
68
|
+
</main>
|
69
|
+
|
70
|
+
<p class="app-footer">
|
71
|
+
🚽 Made with love by
|
72
|
+
<a
|
73
|
+
target="_blank"
|
74
|
+
rel="noopener noreferrer"
|
75
|
+
href="https://github.com/open-wc"
|
76
|
+
>open-wc</a
|
77
|
+
>.
|
78
|
+
</p>
|
79
|
+
`;
|
80
|
+
}
|
81
|
+
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/* eslint-disable global-require */
|
2
|
+
const { fontFamily } = require("tailwindcss/defaultTheme")
|
3
|
+
|
4
|
+
|
5
|
+
/** @type {import('tailwindcss').Config} */
|
6
|
+
module.exports = {
|
7
|
+
darkMode: ["class"],
|
8
|
+
content: ["src/**/*.{ts,tsx}", "index.html"],
|
9
|
+
theme: {
|
10
|
+
container: {
|
11
|
+
center: true,
|
12
|
+
padding: "2rem",
|
13
|
+
screens: {
|
14
|
+
"2xl": "1400px",
|
15
|
+
},
|
16
|
+
},
|
17
|
+
extend: {
|
18
|
+
colors: {
|
19
|
+
border: "hsl(var(--border))",
|
20
|
+
input: "hsl(var(--input))",
|
21
|
+
ring: "hsl(var(--ring))",
|
22
|
+
background: "hsl(var(--background))",
|
23
|
+
foreground: "hsl(var(--foreground))",
|
24
|
+
primary: {
|
25
|
+
DEFAULT: "hsl(var(--primary))",
|
26
|
+
foreground: "hsl(var(--primary-foreground))",
|
27
|
+
},
|
28
|
+
secondary: {
|
29
|
+
DEFAULT: "hsl(var(--secondary))",
|
30
|
+
foreground: "hsl(var(--secondary-foreground))",
|
31
|
+
},
|
32
|
+
destructive: {
|
33
|
+
DEFAULT: "hsl(var(--destructive))",
|
34
|
+
foreground: "hsl(var(--destructive-foreground))",
|
35
|
+
},
|
36
|
+
muted: {
|
37
|
+
DEFAULT: "hsl(var(--muted))",
|
38
|
+
foreground: "hsl(var(--muted-foreground))",
|
39
|
+
},
|
40
|
+
accent: {
|
41
|
+
DEFAULT: "hsl(var(--accent))",
|
42
|
+
foreground: "hsl(var(--accent-foreground))",
|
43
|
+
},
|
44
|
+
popover: {
|
45
|
+
DEFAULT: "hsl(var(--popover))",
|
46
|
+
foreground: "hsl(var(--popover-foreground))",
|
47
|
+
},
|
48
|
+
card: {
|
49
|
+
DEFAULT: "hsl(var(--card))",
|
50
|
+
foreground: "hsl(var(--card-foreground))",
|
51
|
+
},
|
52
|
+
},
|
53
|
+
borderRadius: {
|
54
|
+
lg: `var(--radius)`,
|
55
|
+
md: `calc(var(--radius) - 2px)`,
|
56
|
+
sm: "calc(var(--radius) - 4px)",
|
57
|
+
},
|
58
|
+
fontFamily: {
|
59
|
+
sans: ["var(--font-sans)", ...fontFamily.sans],
|
60
|
+
geist: ["GeistSans", ...fontFamily.sans],
|
61
|
+
// serif: ["var(--font-serif)", ...fontFamily.serif],
|
62
|
+
// mono: ["var(--font-mono)", ...fontFamily.mono],
|
63
|
+
},
|
64
|
+
keyframes: {
|
65
|
+
"accordion-down": {
|
66
|
+
from: { height: "0" },
|
67
|
+
to: { height: "var(--radix-accordion-content-height)" },
|
68
|
+
},
|
69
|
+
"accordion-up": {
|
70
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
71
|
+
to: { height: "0" },
|
72
|
+
},
|
73
|
+
},
|
74
|
+
animation: {
|
75
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
76
|
+
"accordion-up": "accordion-up 0.2s ease-out",
|
77
|
+
},
|
78
|
+
},
|
79
|
+
},
|
80
|
+
plugins: [require("tailwindcss-animate")],
|
81
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { html } from 'lit';
|
2
|
+
import { fixture, expect } from '@open-wc/testing';
|
3
|
+
|
4
|
+
import type { WcUiApp } from '../src/wc-ui-app.js';
|
5
|
+
import '../src/wc-ui-app.js';
|
6
|
+
|
7
|
+
describe('WcUiApp', () => {
|
8
|
+
let element: WcUiApp;
|
9
|
+
beforeEach(async () => {
|
10
|
+
element = await fixture(html`<wc-ui-app></wc-ui-app>`);
|
11
|
+
});
|
12
|
+
|
13
|
+
it('renders a h1', () => {
|
14
|
+
const h1 = element.shadowRoot!.querySelector('h1')!;
|
15
|
+
expect(h1).to.exist;
|
16
|
+
expect(h1.textContent).to.equal('My app');
|
17
|
+
});
|
18
|
+
|
19
|
+
it('passes the a11y audit', async () => {
|
20
|
+
await expect(element).shadowDom.to.be.accessible();
|
21
|
+
});
|
22
|
+
});
|
package/tsconfig.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "es2018",
|
4
|
+
"module": "esnext",
|
5
|
+
"moduleResolution": "node",
|
6
|
+
"noEmitOnError": true,
|
7
|
+
"lib": ["es2017", "dom"],
|
8
|
+
"strict": true,
|
9
|
+
"allowArbitraryExtensions": false,
|
10
|
+
"esModuleInterop": false,
|
11
|
+
"allowSyntheticDefaultImports": true,
|
12
|
+
"experimentalDecorators": true,
|
13
|
+
"importHelpers": true,
|
14
|
+
"outDir": "dist",
|
15
|
+
"sourceMap": true,
|
16
|
+
"inlineSources": true,
|
17
|
+
"rootDir": "./",
|
18
|
+
"incremental": true,
|
19
|
+
"baseUrl": ".",
|
20
|
+
"paths": {
|
21
|
+
"@/*": ["./src/*"]
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"include": ["**/*.ts", "tailwind.config.js"]
|
25
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
2
|
+
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
5
|
+
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
7
|
+
open: '/',
|
8
|
+
watch: !hmr,
|
9
|
+
/** Resolve bare module imports */
|
10
|
+
nodeResolve: {
|
11
|
+
exportConditions: ['browser', 'development'],
|
12
|
+
},
|
13
|
+
|
14
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
15
|
+
// esbuildTarget: 'auto'
|
16
|
+
|
17
|
+
/** Set appIndex to enable SPA routing */
|
18
|
+
appIndex: './index.html',
|
19
|
+
|
20
|
+
plugins: [
|
21
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
22
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
23
|
+
],
|
24
|
+
|
25
|
+
// See documentation for all available options
|
26
|
+
});
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
2
|
+
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
4
|
+
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
6
|
+
/** Test files to run */
|
7
|
+
files: 'dist/test/**/*.test.js',
|
8
|
+
|
9
|
+
/** Resolve bare module imports */
|
10
|
+
nodeResolve: {
|
11
|
+
exportConditions: ['browser', 'development'],
|
12
|
+
},
|
13
|
+
|
14
|
+
/** Filter out lit dev mode logs */
|
15
|
+
filterBrowserLogs(log) {
|
16
|
+
for (const arg of log.args) {
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
return true;
|
22
|
+
},
|
23
|
+
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
25
|
+
// esbuildTarget: 'auto',
|
26
|
+
|
27
|
+
/** Amount of browsers to run concurrently */
|
28
|
+
// concurrentBrowsers: 2,
|
29
|
+
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
31
|
+
// concurrency: 1,
|
32
|
+
|
33
|
+
/** Browsers to run tests on */
|
34
|
+
// browsers: [
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
38
|
+
// ],
|
39
|
+
|
40
|
+
// See documentation for all available options
|
41
|
+
});
|