@e280/shiny 0.1.0-2 → 0.1.0-21
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/README.md +51 -63
- package/package.json +19 -26
- package/s/_archive/components/button/component.ts +30 -0
- package/s/_archive/components/button/showcase.ts +119 -0
- package/s/_archive/components/button/style.css.ts +63 -0
- package/s/{ui → _archive/components}/copy/component.ts +12 -5
- package/s/_archive/components/copy/showcase.ts +51 -0
- package/s/{ui → _archive/components}/copy/style.css.ts +6 -6
- package/s/_archive/components/drawer/component.ts +90 -0
- package/s/_archive/components/drawer/control.ts +31 -0
- package/s/_archive/components/drawer/showcase.ts +111 -0
- package/s/_archive/components/drawer/style.css.ts +127 -0
- package/s/{ui → _archive/components}/example/component.ts +6 -4
- package/s/_archive/components/example/showcase.ts +32 -0
- package/s/{ui → _archive/components}/example/style.css.ts +2 -2
- package/s/_archive/components/foundation.css.ts +15 -0
- package/s/{ui → _archive/components}/framework.ts +1 -2
- package/s/_archive/components/raw-components.ts +15 -0
- package/s/_archive/components/tabs/component.ts +70 -0
- package/s/_archive/components/tabs/control.ts +31 -0
- package/s/_archive/components/tabs/showcase.ts +171 -0
- package/s/_archive/components/tabs/style.css.ts +46 -0
- package/s/_archive/demo/demo.bundle.ts +47 -0
- package/s/{demo → _archive/demo}/demo.css +1 -0
- package/s/_archive/demo/lipsum.ts +6 -0
- package/s/_archive/demo/utils/lipsum.ts +19 -0
- package/s/_archive/demo/views/exhibit/style.css.ts +85 -0
- package/s/_archive/demo/views/exhibit/view.ts +61 -0
- package/s/_archive/demo/views/showcase/style.css.ts +53 -0
- package/s/_archive/demo/views/showcase/view.ts +54 -0
- package/s/_archive/demo/viewsets.ts +12 -0
- package/s/_archive/index.html.ts +34 -0
- package/s/_archive/index.ts +19 -0
- package/s/_archive/install/aura.bundle.ts +9 -0
- package/s/_archive/install/plain.bundle.ts +9 -0
- package/s/{shiny.ts → _archive/shiny.ts} +2 -2
- package/s/_archive/themes/aura.css.ts +86 -0
- package/s/_archive/themes/index.barrel.ts +4 -0
- package/s/{themes → _archive/themes}/index.ts +1 -0
- package/s/_archive/themes/infra/css-vars.ts +46 -0
- package/s/_archive/themes/plain.css.ts +11 -0
- package/s/_archive/utils/states.ts +15 -0
- package/s/demo/globals.d.ts +3 -0
- package/s/demo/main.bundle.ts +16 -0
- package/s/demo/main.css +71 -0
- package/s/demo/parts/exhibit.ts +15 -0
- package/s/demo/utils/lipsum.ts +19 -0
- package/s/demo/views/codebox/style.css.ts +45 -0
- package/s/demo/views/codebox/use-prism-styles.ts +13 -0
- package/s/demo/views/codebox/view.ts +39 -0
- package/s/demo/views/showcase/style.css.ts +80 -0
- package/s/demo/views/showcase/view.ts +50 -0
- package/s/demo/views/stylebox/view.ts +21 -0
- package/s/icons/tabler/menu-2.svg.ts +4 -0
- package/s/icons/tabler/x.svg.ts +4 -0
- package/s/index.html.ts +42 -32
- package/s/index.ts +6 -7
- package/s/test.ts +5 -0
- package/s/theme/parts/core.ts +34 -0
- package/s/theme/parts/reset.ts +20 -0
- package/s/theme/parts/vars.ts +41 -0
- package/s/theme/theme-string.ts +15 -0
- package/s/theme/theme.css.ts +7 -0
- package/s/utils/states.ts +15 -0
- package/s/views/button/showcase.ts +43 -0
- package/s/views/button/style.css.ts +110 -0
- package/s/views/button/view.ts +32 -0
- package/s/views/copy/parts/copy-status.ts +3 -0
- package/s/views/copy/parts/determine-base-status.ts +7 -0
- package/s/views/copy/parts/use-copier.ts +20 -0
- package/s/views/copy/showcase.ts +54 -0
- package/s/views/copy/style.css.ts +51 -0
- package/s/views/copy/view.ts +60 -0
- package/s/views/drawer/control.ts +31 -0
- package/s/views/drawer/showcase.ts +83 -0
- package/s/views/drawer/style.css.ts +128 -0
- package/s/views/drawer/view.ts +76 -0
- package/s/views/tabs/control.ts +31 -0
- package/s/views/tabs/showcase.ts +89 -0
- package/s/views/tabs/style.css.ts +46 -0
- package/s/views/tabs/view.ts +66 -0
- package/x/{demo → _archive/demo}/demo.css +1 -0
- package/x/demo/main.bundle.js +13 -0
- package/x/demo/main.bundle.js.map +1 -0
- package/x/demo/main.bundle.min.js +811 -0
- package/x/demo/main.bundle.min.js.map +7 -0
- package/x/demo/main.css +71 -0
- package/x/demo/parts/exhibit.d.ts +11 -0
- package/x/demo/parts/exhibit.js +2 -0
- package/x/demo/parts/exhibit.js.map +1 -0
- package/x/demo/utils/lipsum.d.ts +2 -0
- package/x/demo/utils/lipsum.js +11 -0
- package/x/demo/utils/lipsum.js.map +1 -0
- package/x/demo/views/codebox/style.css.js +44 -0
- package/x/demo/views/codebox/style.css.js.map +1 -0
- package/x/demo/views/codebox/use-prism-styles.d.ts +1 -0
- package/x/demo/views/codebox/use-prism-styles.js +12 -0
- package/x/demo/views/codebox/use-prism-styles.js.map +1 -0
- package/x/demo/views/codebox/view.d.ts +2 -0
- package/x/demo/views/codebox/view.js +29 -0
- package/x/demo/views/codebox/view.js.map +1 -0
- package/x/demo/views/showcase/style.css.js +79 -0
- package/x/demo/views/showcase/style.css.js.map +1 -0
- package/x/demo/views/showcase/view.d.ts +2 -0
- package/x/demo/views/showcase/view.js +44 -0
- package/x/demo/views/showcase/view.js.map +1 -0
- package/x/demo/views/stylebox/view.d.ts +3 -0
- package/x/demo/views/stylebox/view.js +13 -0
- package/x/demo/views/stylebox/view.js.map +1 -0
- package/x/icons/tabler/menu-2.svg.d.ts +2 -0
- package/x/icons/tabler/menu-2.svg.js +3 -0
- package/x/icons/tabler/menu-2.svg.js.map +1 -0
- package/x/icons/tabler/x.svg.d.ts +2 -0
- package/x/icons/tabler/x.svg.js +3 -0
- package/x/icons/tabler/x.svg.js.map +1 -0
- package/x/index.d.ts +6 -5
- package/x/index.html +212 -61
- package/x/index.html.js +40 -29
- package/x/index.html.js.map +1 -1
- package/x/index.js +6 -5
- package/x/index.js.map +1 -1
- package/x/test.js +3 -0
- package/x/test.js.map +1 -0
- package/x/theme/parts/core.d.ts +1 -0
- package/x/theme/parts/core.js +33 -0
- package/x/theme/parts/core.js.map +1 -0
- package/x/theme/parts/reset.d.ts +1 -0
- package/x/theme/parts/reset.js +19 -0
- package/x/theme/parts/reset.js.map +1 -0
- package/x/theme/parts/vars.d.ts +1 -0
- package/x/theme/parts/vars.js +34 -0
- package/x/theme/parts/vars.js.map +1 -0
- package/x/theme/theme-string.d.ts +1 -0
- package/x/theme/theme-string.js +14 -0
- package/x/theme/theme-string.js.map +1 -0
- package/x/theme/theme.css.d.ts +1 -0
- package/x/theme/theme.css.js +4 -0
- package/x/theme/theme.css.js.map +1 -0
- package/x/utils/states.d.ts +5 -0
- package/x/utils/states.js +13 -0
- package/x/utils/states.js.map +1 -0
- package/x/views/button/showcase.d.ts +1 -0
- package/x/views/button/showcase.js +41 -0
- package/x/views/button/showcase.js.map +1 -0
- package/x/views/button/style.css.js +109 -0
- package/x/views/button/style.css.js.map +1 -0
- package/x/views/button/view.d.ts +5 -0
- package/x/views/button/view.js +23 -0
- package/x/views/button/view.js.map +1 -0
- package/x/views/copy/parts/copy-status.d.ts +1 -0
- package/x/views/copy/parts/copy-status.js +2 -0
- package/x/views/copy/parts/copy-status.js.map +1 -0
- package/x/views/copy/parts/determine-base-status.d.ts +1 -0
- package/x/views/copy/parts/determine-base-status.js +6 -0
- package/x/views/copy/parts/determine-base-status.js.map +1 -0
- package/x/views/copy/parts/use-copier.d.ts +6 -0
- package/x/views/copy/parts/use-copier.js +13 -0
- package/x/views/copy/parts/use-copier.js.map +1 -0
- package/x/views/copy/showcase.d.ts +1 -0
- package/x/views/copy/showcase.js +51 -0
- package/x/views/copy/showcase.js.map +1 -0
- package/x/views/copy/style.css.d.ts +2 -0
- package/x/{ui → views}/copy/style.css.js +14 -9
- package/x/views/copy/style.css.js.map +1 -0
- package/x/views/copy/view.d.ts +4 -0
- package/x/views/copy/view.js +49 -0
- package/x/views/copy/view.js.map +1 -0
- package/x/views/drawer/control.d.ts +9 -0
- package/x/views/drawer/control.js +24 -0
- package/x/views/drawer/control.js.map +1 -0
- package/x/views/drawer/showcase.d.ts +1 -0
- package/x/views/drawer/showcase.js +75 -0
- package/x/views/drawer/showcase.js.map +1 -0
- package/x/views/drawer/style.css.d.ts +2 -0
- package/x/views/drawer/style.css.js +127 -0
- package/x/views/drawer/style.css.js.map +1 -0
- package/x/views/drawer/view.d.ts +6 -0
- package/x/views/drawer/view.js +60 -0
- package/x/views/drawer/view.js.map +1 -0
- package/x/views/tabs/control.d.ts +9 -0
- package/x/views/tabs/control.js +24 -0
- package/x/views/tabs/control.js.map +1 -0
- package/x/views/tabs/showcase.d.ts +1 -0
- package/x/views/tabs/showcase.js +86 -0
- package/x/views/tabs/showcase.js.map +1 -0
- package/x/views/tabs/style.css.d.ts +2 -0
- package/x/views/tabs/style.css.js +45 -0
- package/x/views/tabs/style.css.js.map +1 -0
- package/x/views/tabs/view.d.ts +5 -0
- package/x/views/tabs/view.js +52 -0
- package/x/views/tabs/view.js.map +1 -0
- package/s/demo/demo.bundle.ts +0 -42
- package/s/demo/views/demonstration/style.css.ts +0 -108
- package/s/demo/views/demonstration/view.ts +0 -49
- package/s/install.bundle.ts +0 -9
- package/s/themes/basic.css.ts +0 -18
- package/s/themes/index.barrel.ts +0 -3
- package/s/ui/raw-components.ts +0 -9
- package/x/demo/demo.bundle.js +0 -37
- package/x/demo/demo.bundle.js.map +0 -1
- package/x/demo/demo.bundle.min.js +0 -277
- package/x/demo/demo.bundle.min.js.map +0 -7
- package/x/demo/views/demonstration/style.css.js +0 -107
- package/x/demo/views/demonstration/style.css.js.map +0 -1
- package/x/demo/views/demonstration/view.d.ts +0 -10
- package/x/demo/views/demonstration/view.js +0 -36
- package/x/demo/views/demonstration/view.js.map +0 -1
- package/x/install.bundle.js +0 -5
- package/x/install.bundle.js.map +0 -1
- package/x/install.bundle.min.js +0 -135
- package/x/install.bundle.min.js.map +0 -7
- package/x/shiny.d.ts +0 -14
- package/x/shiny.js +0 -8
- package/x/shiny.js.map +0 -1
- package/x/tests.test.d.ts +0 -1
- package/x/tests.test.js +0 -3
- package/x/tests.test.js.map +0 -1
- package/x/themes/basic.css.d.ts +0 -1
- package/x/themes/basic.css.js +0 -17
- package/x/themes/basic.css.js.map +0 -1
- package/x/themes/index.barrel.d.ts +0 -1
- package/x/themes/index.barrel.js +0 -2
- package/x/themes/index.barrel.js.map +0 -1
- package/x/themes/index.d.ts +0 -1
- package/x/themes/index.js +0 -2
- package/x/themes/index.js.map +0 -1
- package/x/ui/copy/component.d.ts +0 -372
- package/x/ui/copy/component.js +0 -56
- package/x/ui/copy/component.js.map +0 -1
- package/x/ui/copy/style.css.js.map +0 -1
- package/x/ui/example/component.d.ts +0 -371
- package/x/ui/example/component.js +0 -20
- package/x/ui/example/component.js.map +0 -1
- package/x/ui/example/style.css.js +0 -10
- package/x/ui/example/style.css.js.map +0 -1
- package/x/ui/framework.d.ts +0 -8
- package/x/ui/framework.js +0 -6
- package/x/ui/framework.js.map +0 -1
- package/x/ui/raw-components.d.ts +0 -6
- package/x/ui/raw-components.js +0 -7
- package/x/ui/raw-components.js.map +0 -1
- /package/s/{tests.test.ts → _archive/tests.test.ts} +0 -0
- /package/x/demo/{demo.bundle.d.ts → main.bundle.d.ts} +0 -0
- /package/x/demo/views/{demonstration → codebox}/style.css.d.ts +0 -0
- /package/x/{ui/copy → demo/views/showcase}/style.css.d.ts +0 -0
- /package/x/{install.bundle.d.ts → test.d.ts} +0 -0
- /package/x/{ui/example → views/button}/style.css.d.ts +0 -0
package/s/demo/main.css
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
@layer view {
|
|
3
|
+
:root {
|
|
4
|
+
height: 100%;
|
|
5
|
+
font-size: 16px;
|
|
6
|
+
font-family: sans-serif;
|
|
7
|
+
|
|
8
|
+
color-scheme: dark;
|
|
9
|
+
scrollbar-gutter: stable;
|
|
10
|
+
|
|
11
|
+
color: var(--alpha);
|
|
12
|
+
background: var(--bg);
|
|
13
|
+
|
|
14
|
+
--tint: #070429aa;
|
|
15
|
+
background:
|
|
16
|
+
linear-gradient(0deg, var(--tint), var(--tint)),
|
|
17
|
+
#141519 url("/assets/bg.webp") center 80% / cover no-repeat;
|
|
18
|
+
|
|
19
|
+
background-attachment: fixed, fixed;
|
|
20
|
+
|
|
21
|
+
text-shadow: 0.1em 0.1em 0.2em #0008;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body {
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-height: 100%;
|
|
27
|
+
max-width: 60em;
|
|
28
|
+
margin: auto;
|
|
29
|
+
padding: 1em;
|
|
30
|
+
padding-bottom: 6em;
|
|
31
|
+
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 1em;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
h1 {
|
|
38
|
+
font-size: 1.5em;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
text-align: center;
|
|
42
|
+
|
|
43
|
+
strong {
|
|
44
|
+
font-size: 1.5em;
|
|
45
|
+
color: var(--prime);
|
|
46
|
+
color: color-mix(in oklab, white, var(--prime) 20%);
|
|
47
|
+
text-shadow: 0 0 0.8em color-mix(in oklab, white, var(--prime) 50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
small {
|
|
51
|
+
opacity: 0.6;
|
|
52
|
+
font-size: 0.7em;
|
|
53
|
+
font-weight: normal;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
body > section {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
margin-bottom: calc(var(--padding) * 2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.gallery {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: calc(var(--padding) * 2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import {Content} from "@e280/sly"
|
|
3
|
+
import {CSSResult} from "lit"
|
|
4
|
+
|
|
5
|
+
export type Exhibit = {
|
|
6
|
+
name: string
|
|
7
|
+
explain: Content
|
|
8
|
+
render: () => Content
|
|
9
|
+
js: string
|
|
10
|
+
css?: CSSResult
|
|
11
|
+
styleboxCss: CSSResult
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const exhibit = (e: Exhibit) => e
|
|
15
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import {Dispenser} from "@e280/stz"
|
|
3
|
+
|
|
4
|
+
export const lipsum = new Dispenser(() => [
|
|
5
|
+
`lorem kettlebell dolor sit amet, mountain squats consectetur trail-running. adipiscing deadlift elit, sed do 45lb turkish get-up eiusmod tempor incididunt ut hike magna aliqua. ut enim ad minim clean & press, quis nostrud exercitation lunges ullamco kettlebell snatch trailhead nisi ut aliquip ex dolore summit irure dolor.`,
|
|
6
|
+
|
|
7
|
+
`lorem protein dolor sit amet, creatine scoop elit shaker bottle tempor. grilled steak magna keto-fasting culpa, carb-loading perspiciatis cheat day. whey isolate dolor sit macros elit, intermittent fasting tempor electrolyte magna; barefoot shoes culpa, liver perspiciatis ancestral squat rack gospel. lorem bulking dolor sit cut elit, tdee tracker tempor calorie deficit magna; chicken breast culpa gatorade perspiciatis meal prep.`,
|
|
8
|
+
|
|
9
|
+
`lorem caffeine dolor sit amet, double espresso elit cold brew tempor jitter. adderall magna focus culpa, lion’s mane perspiciatis nootropic. nicotine gum dolor sit vape elit, dopamine hit tempor buzz magna; lsd microdosing culpa, productivity perspiciatis agile sprint. lorem latte dolor sit drip elit, french press tempor aeropress magna; insomnia culpa, circadian rhythm perspiciatis blue light filter.`,
|
|
10
|
+
|
|
11
|
+
`lorem arch dolor sit amet, pacman -Syu elit rolling release tempor breakage. i3-gaps commodo tiling, bspwm magna culpa xinitrc. alias neovim configs in .dotfiles forest, r/unixporn veniam rice showcase perspiciatis.`,
|
|
12
|
+
|
|
13
|
+
`lorem authlocal dolor sit amet, user-sovereign identity elit, cryptographic tempor signatures. ed25519 magna keypair culpa, elliptic perspiciatis handshake ut zero-knowledge proof. decentralized login elit mnemonic seed tempor recovery phrase. did magna alias culpa federation, lorem oauth2 perspiciatis antiquated.`,
|
|
14
|
+
|
|
15
|
+
`lorem webgpu dolor sit amet, fragment shader elit vertex buffer tempor pipeline; bindgroup magna sampler culpa, wgsl perspiciatis alignment bug. compute pass workgroup barrier magna, mipmap cascade culpa drawcall instancing overflow. spir-v dolor sit wasm elit, canvas context lost magna; fallback webgl2 perspiciatis, polyfill slowpath dolore, glsl antique culpa extension hell 144hz tearing. command encoder perspiciatis out-of-memory, chromium nightly.`,
|
|
16
|
+
|
|
17
|
+
`lorem sedentary dolor sit amet, infinite scroll elit chair-bound tempor. commit marathon magna carpal tunnel culpa, caffeine perspiciatis heartbeat irregular. lorem backlog dolor sit ticket elit, jira sprint tempor sedentary slump magna; gym membership culpa expired, standing desk perspiciatis unused. lorem procrastination dolor sit youtube elit, keyboard crumbs tempor pizza box magna; cardio avoidant culpa, hike someday perspiciatis maybe.`,
|
|
18
|
+
])
|
|
19
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
import {css} from "lit"
|
|
3
|
+
export default css`@layer view {
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.box {
|
|
11
|
+
flex: 1 1 auto;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
background: #0003;
|
|
15
|
+
border-radius: var(--rounded);
|
|
16
|
+
backdrop-filter: blur(0.5em);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
header {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
padding: calc(var(--padding) / 4) var(--padding);
|
|
23
|
+
|
|
24
|
+
.title {
|
|
25
|
+
opacity: 0.4;
|
|
26
|
+
font-size: 1em;
|
|
27
|
+
font-weight: normal;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.buttons {
|
|
31
|
+
display: flex;
|
|
32
|
+
font-size: 1.2em;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
code {
|
|
37
|
+
padding: calc(var(--padding) / 4) var(--padding);
|
|
38
|
+
color: var(--code);
|
|
39
|
+
white-space: pre;
|
|
40
|
+
tab-size: 2;
|
|
41
|
+
overflow-x: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}`
|
|
45
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import {useOnce} from "@e280/sly"
|
|
3
|
+
|
|
4
|
+
export function usePrismStyles() {
|
|
5
|
+
return useOnce(() => {
|
|
6
|
+
const tag = document.head.querySelector("[data-prism]")
|
|
7
|
+
if (!tag) throw new Error("failed to find [data-prism] stylesheet")
|
|
8
|
+
const style = new CSSStyleSheet()
|
|
9
|
+
style.replaceSync(tag.textContent)
|
|
10
|
+
return style
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
import Prism from "prismjs"
|
|
3
|
+
import "prismjs/components/prism-js-templates"
|
|
4
|
+
|
|
5
|
+
import {html} from "lit"
|
|
6
|
+
import {untab} from "@e280/stz"
|
|
7
|
+
import {shadow, useCss} from "@e280/sly"
|
|
8
|
+
|
|
9
|
+
import styleCss from "./style.css.js"
|
|
10
|
+
import {usePrismStyles} from "./use-prism-styles.js"
|
|
11
|
+
import {themeCss} from "../../../theme/theme.css.js"
|
|
12
|
+
import {ShinyCopy} from "../../../views/copy/view.js"
|
|
13
|
+
import {unsafeHTML} from "lit/directives/unsafe-html.js"
|
|
14
|
+
|
|
15
|
+
export const Codebox = shadow((title: string, lang: "js" | "css", code: string) => {
|
|
16
|
+
const prismStyles = usePrismStyles()
|
|
17
|
+
useCss(themeCss, prismStyles, styleCss)
|
|
18
|
+
|
|
19
|
+
code = untab(code).trim()
|
|
20
|
+
const higlighted = Prism.highlight(
|
|
21
|
+
code,
|
|
22
|
+
lang === "js"
|
|
23
|
+
? Prism.languages.javascript
|
|
24
|
+
: Prism.languages.css,
|
|
25
|
+
lang,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
return html`
|
|
29
|
+
<div class=box>
|
|
30
|
+
<header>
|
|
31
|
+
<h3 class=title>${title}</h3>
|
|
32
|
+
<div class=buttons>${ShinyCopy(code)}</div>
|
|
33
|
+
</header>
|
|
34
|
+
|
|
35
|
+
<code>${unsafeHTML(higlighted)}</code>
|
|
36
|
+
</div>
|
|
37
|
+
`
|
|
38
|
+
})
|
|
39
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
|
|
2
|
+
import {css} from "lit"
|
|
3
|
+
export default css`@layer view {
|
|
4
|
+
|
|
5
|
+
section.showcase {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
padding: 1em;
|
|
10
|
+
gap: var(--padding);
|
|
11
|
+
|
|
12
|
+
background: linear-gradient(to right top, #252dd985, #aa6affbd);
|
|
13
|
+
box-shadow: 0 0 5em #5d1fadaa;
|
|
14
|
+
border-top: 2px solid #fff4;
|
|
15
|
+
border-radius: var(--rounded);
|
|
16
|
+
|
|
17
|
+
&::before {
|
|
18
|
+
z-index: 0;
|
|
19
|
+
content: "";
|
|
20
|
+
display: block;
|
|
21
|
+
position: absolute;
|
|
22
|
+
inset: 0;
|
|
23
|
+
border-radius: var(--rounded);
|
|
24
|
+
background: #0006;
|
|
25
|
+
width: calc(100% - var(--padding));
|
|
26
|
+
height: calc(100% - var(--padding));
|
|
27
|
+
margin: auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
> * {
|
|
31
|
+
z-index: 1;
|
|
32
|
+
position: relative;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
header {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-wrap: wrap;
|
|
39
|
+
place-content: center;
|
|
40
|
+
gap: var(--padding);
|
|
41
|
+
|
|
42
|
+
h2 {
|
|
43
|
+
flex: 1 1 auto;
|
|
44
|
+
color: var(--prime);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.sides {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
gap: var(--padding);
|
|
52
|
+
|
|
53
|
+
> * {
|
|
54
|
+
flex: 1 1 0;
|
|
55
|
+
min-width: 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.codezone {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: var(--padding);
|
|
63
|
+
|
|
64
|
+
> * {
|
|
65
|
+
flex: 1 1 auto;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.stage {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
justify-content: start;
|
|
73
|
+
align-items: center;
|
|
74
|
+
padding: calc(var(--padding) * 2) var(--padding);
|
|
75
|
+
border: 1px dashed color-mix(in oklch, transparent, currentColor 50%);
|
|
76
|
+
border-radius: var(--rounded);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}`
|
|
80
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
import {css, html} from "lit"
|
|
3
|
+
import {shadow, useCss, useName, useOnce} from "@e280/sly"
|
|
4
|
+
|
|
5
|
+
import showcaseCss from "./style.css.js"
|
|
6
|
+
import {Codebox} from "../codebox/view.js"
|
|
7
|
+
import {Stylebox} from "../stylebox/view.js"
|
|
8
|
+
import {Exhibit} from "../../parts/exhibit.js"
|
|
9
|
+
import {themeCss} from "../../../theme/theme.css.js"
|
|
10
|
+
import {ShinyTabs} from "../../../views/tabs/view.js"
|
|
11
|
+
import {ShinyButton} from "../../../views/button/view.js"
|
|
12
|
+
import {TabsControl} from "../../../views/tabs/control.js"
|
|
13
|
+
|
|
14
|
+
export const Showcase = shadow((title: string, exhibits: Exhibit[]) => {
|
|
15
|
+
useName("showcase")
|
|
16
|
+
useCss(themeCss, showcaseCss)
|
|
17
|
+
|
|
18
|
+
const control = useOnce(() => new TabsControl())
|
|
19
|
+
const exhibit = exhibits.at(control.index)
|
|
20
|
+
|
|
21
|
+
return html`
|
|
22
|
+
<section class=showcase>
|
|
23
|
+
<header>
|
|
24
|
+
<h2>✨${title}✨</h2>
|
|
25
|
+
<nav>
|
|
26
|
+
${ShinyTabs.with({
|
|
27
|
+
props: [{control, snug: true}],
|
|
28
|
+
children: exhibits.map(exhibit => ShinyButton(exhibit.name)),
|
|
29
|
+
})}
|
|
30
|
+
</nav>
|
|
31
|
+
</header>
|
|
32
|
+
|
|
33
|
+
${exhibit && html`
|
|
34
|
+
<div class=explain>${exhibit.explain}</div>
|
|
35
|
+
|
|
36
|
+
<div class=sides>
|
|
37
|
+
<div class=codezone>
|
|
38
|
+
${Codebox("lit-html", "js", exhibit.js)}
|
|
39
|
+
${exhibit.css && Codebox("css", "css", exhibit.css.toString())}
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class=stage>
|
|
43
|
+
${Stylebox(exhibit.styleboxCss, exhibit.css ?? css``, exhibit.render())}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`}
|
|
47
|
+
</section>
|
|
48
|
+
`
|
|
49
|
+
})
|
|
50
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import {CSSResult, html, unsafeCSS} from "lit"
|
|
3
|
+
import {Content, shadow, useCss, useName} from "@e280/sly"
|
|
4
|
+
import {themeCss} from "../../../theme/theme.css.js"
|
|
5
|
+
|
|
6
|
+
export const Stylebox = shadow((
|
|
7
|
+
styleboxCss: CSSResult,
|
|
8
|
+
styles: CSSResult,
|
|
9
|
+
content: Content,
|
|
10
|
+
) => {
|
|
11
|
+
|
|
12
|
+
useName("stylebox")
|
|
13
|
+
useCss(themeCss, styleboxCss, styles)
|
|
14
|
+
|
|
15
|
+
return html`
|
|
16
|
+
<style>${unsafeCSS(styleboxCss)}</style>
|
|
17
|
+
<style>${unsafeCSS(styles)}</style>
|
|
18
|
+
${content}
|
|
19
|
+
`
|
|
20
|
+
})
|
|
21
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
import {svg} from "lit"
|
|
3
|
+
export default svg`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-menu-2"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 6l16 0" /><path d="M4 12l16 0" /><path d="M4 18l16 0" /></svg>`
|
|
4
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
import {svg} from "lit"
|
|
3
|
+
export default svg`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-x"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>`
|
|
4
|
+
|
package/s/index.html.ts
CHANGED
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import {template, html, socialCard} from "@e280/scute"
|
|
3
|
+
import {themeString} from "./theme/theme-string.js"
|
|
3
4
|
|
|
4
|
-
const title = "shiny"
|
|
5
|
-
const description = "✨ web ui components"
|
|
6
|
-
const domain = "shiny.e280.org"
|
|
7
5
|
const favicon = "/assets/favicon.png"
|
|
8
6
|
|
|
9
|
-
export default
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
7
|
+
export default template(import.meta.url, async orb => html`
|
|
8
|
+
<!doctype html>
|
|
9
|
+
<html>
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="utf-8"/>
|
|
12
|
+
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
13
|
+
<meta name="darkreader-lock"/>
|
|
14
|
+
<style>@layer base{html{background:#000;color:#aaa;}}</style>
|
|
15
|
+
|
|
16
|
+
<title>shiny</title>
|
|
17
|
+
<link rel="icon" href="${favicon}"/>
|
|
18
|
+
<script type="module" src="${orb.hashurl("demo/main.bundle.min.js")}"></script>
|
|
19
|
+
|
|
20
|
+
<style>${themeString}</style>
|
|
21
|
+
<style>${orb.inject("demo/main.css")}</style>
|
|
22
|
+
<style data-prism>${orb.inject("$/node_modules/prismjs/themes/prism-tomorrow.css")}</style>
|
|
23
|
+
|
|
24
|
+
${socialCard({
|
|
25
|
+
themeColor: "#d068ff",
|
|
26
|
+
siteName: "@e280/shiny",
|
|
27
|
+
title: "✨shiny✨",
|
|
28
|
+
description: "web ui library",
|
|
29
|
+
image: "https://shiny.e280.org" + favicon,
|
|
30
|
+
})}
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<h1>
|
|
34
|
+
<strong>✨shiny✨</strong>
|
|
35
|
+
<small>v${orb.packageVersion()}</small>
|
|
36
|
+
</h1>
|
|
37
|
+
|
|
38
|
+
<section>
|
|
39
|
+
<p>e280's web ui library</p>
|
|
40
|
+
<p><a href="https://github.com/e280/shiny#readme">readme for installation</a></p>
|
|
41
|
+
</section>
|
|
42
|
+
|
|
43
|
+
<div class="gallery"></div>
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|
|
46
|
+
`)
|
|
37
47
|
|
package/s/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
export * from "./
|
|
3
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
7
|
-
|
|
8
|
-
export * from "./shiny.js"
|
|
2
|
+
export * from "./views/button/view.js"
|
|
3
|
+
export * from "./views/copy/view.js"
|
|
4
|
+
export * from "./views/drawer/control.js"
|
|
5
|
+
export * from "./views/drawer/view.js"
|
|
6
|
+
export * from "./views/tabs/control.js"
|
|
7
|
+
export * from "./views/tabs/view.js"
|
|
9
8
|
|
package/s/test.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
import {templateString as css} from "@e280/stz"
|
|
3
|
+
export const coreString = css`@layer core {
|
|
4
|
+
|
|
5
|
+
::selection {
|
|
6
|
+
color: var(--selection);
|
|
7
|
+
background-color: var(--selection-bg);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
::-webkit-scrollbar { width: 8px; }
|
|
11
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
12
|
+
::-webkit-scrollbar-thumb { background: #444; border-radius: 1em; }
|
|
13
|
+
::-webkit-scrollbar-thumb:hover { background: #666; }
|
|
14
|
+
|
|
15
|
+
a {
|
|
16
|
+
color: var(--link);
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
|
|
19
|
+
&:visited {
|
|
20
|
+
color: color-mix(in srgb, purple, var(--link) 70%);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:hover {
|
|
24
|
+
color: color-mix(in srgb, white, var(--link) 90%);
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:active {
|
|
29
|
+
color: color-mix(in srgb, white, var(--link) 50%);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}`
|
|
34
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import {templateString as css} from "@e280/stz"
|
|
3
|
+
export const resetString = css`@layer reset {
|
|
4
|
+
|
|
5
|
+
* {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
|
|
10
|
+
scrollbar-width: thin;
|
|
11
|
+
scrollbar-color: #888 transparent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::-webkit-scrollbar { width: 8px; }
|
|
15
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
16
|
+
::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
|
|
17
|
+
::-webkit-scrollbar-thumb:hover { background: #999; }
|
|
18
|
+
|
|
19
|
+
}`
|
|
20
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
import {templateString as css} from "@e280/stz"
|
|
3
|
+
export const varsString = css`@layer vars {
|
|
4
|
+
|
|
5
|
+
:is(:root, :host) {
|
|
6
|
+
${renderVars({
|
|
7
|
+
"bg": "#111",
|
|
8
|
+
"alpha": "#def",
|
|
9
|
+
|
|
10
|
+
"rounded": "0.5em",
|
|
11
|
+
"padding": "0.5em",
|
|
12
|
+
|
|
13
|
+
"prime": "#d068ff",
|
|
14
|
+
"code": "#3f1",
|
|
15
|
+
"link": "cyan",
|
|
16
|
+
"selection": "white",
|
|
17
|
+
"selection-bg": "#f70",
|
|
18
|
+
|
|
19
|
+
"lame": "#8888",
|
|
20
|
+
"angry": "#f50",
|
|
21
|
+
"zesty": "#cf0",
|
|
22
|
+
"happy": "#0fa",
|
|
23
|
+
"calm": "#0af",
|
|
24
|
+
"sad": "#74f",
|
|
25
|
+
"quirky": "#f49",
|
|
26
|
+
|
|
27
|
+
"inactive-opacity": "0.5",
|
|
28
|
+
"anim-duration": "150ms",
|
|
29
|
+
})}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}`
|
|
33
|
+
|
|
34
|
+
function renderVar([name, value]: [string, string]) {
|
|
35
|
+
return `--${name}: var(--shiny-${name}, ${value});`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function renderVars(varsObject: Record<string, string>) {
|
|
39
|
+
return Object.entries(varsObject).map(renderVar).join("\n")
|
|
40
|
+
}
|
|
41
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
import {templateString as css} from "@e280/stz"
|
|
3
|
+
import {coreString} from "./parts/core.js"
|
|
4
|
+
import {varsString} from "./parts/vars.js"
|
|
5
|
+
import {resetString} from "./parts/reset.js"
|
|
6
|
+
export const themeString = css`
|
|
7
|
+
|
|
8
|
+
@layer vars, reset, core, underlay, view, overlay;
|
|
9
|
+
|
|
10
|
+
${varsString}
|
|
11
|
+
${resetString}
|
|
12
|
+
${coreString}
|
|
13
|
+
|
|
14
|
+
`
|
|
15
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
|
|
2
|
+
export class States {
|
|
3
|
+
#states: Set<string>
|
|
4
|
+
|
|
5
|
+
constructor(element: HTMLElement) {
|
|
6
|
+
this.#states = element.attachInternals().states as any
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
assign(...states: string[]) {
|
|
10
|
+
this.#states.forEach(s => this.#states.delete(s))
|
|
11
|
+
for (const s of states) this.#states.add(s)
|
|
12
|
+
return this
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import {css} from "lit"
|
|
3
|
+
import {ShinyButton} from "./view.js"
|
|
4
|
+
import {exhibit} from "../../demo/parts/exhibit.js"
|
|
5
|
+
import {Showcase} from "../../demo/views/showcase/view.js"
|
|
6
|
+
|
|
7
|
+
export const buttonShowcase = () => Showcase("ShinyButton", [
|
|
8
|
+
exhibit({
|
|
9
|
+
name: "catalog",
|
|
10
|
+
explain: "click-to-copy button.",
|
|
11
|
+
render: () => [
|
|
12
|
+
ShinyButton("e280"),
|
|
13
|
+
ShinyButton("e280", {vibe: "happy"}),
|
|
14
|
+
ShinyButton("e280", {vibe: "sad"}),
|
|
15
|
+
ShinyButton("e280", {vibe: "angry"}),
|
|
16
|
+
ShinyButton("e280", {vibe: "zesty"}),
|
|
17
|
+
ShinyButton("e280", {vibe: "quirky"}),
|
|
18
|
+
ShinyButton("e280", {vibe: "lame"}),
|
|
19
|
+
],
|
|
20
|
+
styleboxCss: css`
|
|
21
|
+
:host {
|
|
22
|
+
font-size: 1.5em;
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
gap: calc(var(--padding) / 2);
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
js: `
|
|
30
|
+
[
|
|
31
|
+
ShinyButton("e280"),
|
|
32
|
+
ShinyButton("e280", {vibe: "happy"}),
|
|
33
|
+
ShinyButton("e280", {vibe: "sad"}),
|
|
34
|
+
ShinyButton("e280", {vibe: "angry"}),
|
|
35
|
+
ShinyButton("e280", {vibe: "zesty"}),
|
|
36
|
+
ShinyButton("e280", {vibe: "quirky"}),
|
|
37
|
+
ShinyButton("e280", {vibe: "lame"}),
|
|
38
|
+
]
|
|
39
|
+
`,
|
|
40
|
+
css: undefined,
|
|
41
|
+
}),
|
|
42
|
+
])
|
|
43
|
+
|