@e280/shiny 0.1.0-15 → 0.1.0-17
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 +34 -80
- package/package.json +18 -25
- package/s/_archive/demo/utils/lipsum.ts +19 -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/index.html.ts +34 -0
- package/s/_archive/index.ts +19 -0
- package/s/_archive/utils/states.ts +15 -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 +1 -1
- package/s/demo/views/codebox/style.css.ts +43 -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 +42 -11
- package/s/demo/views/showcase/view.ts +41 -45
- package/s/demo/views/stylebox/view.ts +21 -0
- package/s/index.html.ts +42 -29
- package/s/index.ts +1 -17
- 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/views/button/showcase.ts +43 -0
- package/s/views/button/style.css.ts +110 -0
- package/s/views/button/view.ts +30 -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 +46 -0
- package/s/views/copy/view.ts +58 -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/main.bundle.js +13 -0
- package/x/demo/main.bundle.js.map +1 -0
- package/x/demo/main.bundle.min.js +794 -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 +1 -1
- package/x/demo/utils/lipsum.js +1 -1
- package/x/demo/utils/lipsum.js.map +1 -1
- package/x/demo/views/codebox/style.css.js +42 -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 +42 -11
- package/x/demo/views/showcase/style.css.js.map +1 -1
- package/x/demo/views/showcase/view.d.ts +2 -7
- package/x/demo/views/showcase/view.js +39 -35
- package/x/demo/views/showcase/view.js.map +1 -1
- 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/index.d.ts +1 -11
- package/x/index.html +212 -62
- package/x/index.html.js +40 -26
- package/x/index.html.js.map +1 -1
- package/x/index.js +1 -11
- 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/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 +4 -0
- package/x/views/button/view.js +22 -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.js.map +1 -0
- package/x/views/copy/view.d.ts +4 -0
- package/x/views/copy/view.js +47 -0
- package/x/views/copy/view.js.map +1 -0
- package/x/{components → views}/drawer/control.d.ts +1 -1
- 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/{components → views}/drawer/style.css.js +1 -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/{components → views}/tabs/control.d.ts +2 -2
- package/x/{components → views}/tabs/control.js +3 -3
- 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/{components → views}/tabs/style.css.js +5 -5
- 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/x/components/button/component.d.ts +0 -6
- package/x/components/button/component.js +0 -25
- package/x/components/button/component.js.map +0 -1
- package/x/components/button/showcase.d.ts +0 -1
- package/x/components/button/showcase.js +0 -116
- package/x/components/button/showcase.js.map +0 -1
- package/x/components/button/style.css.js +0 -62
- package/x/components/button/style.css.js.map +0 -1
- package/x/components/copy/component.d.ts +0 -376
- package/x/components/copy/component.js +0 -63
- package/x/components/copy/component.js.map +0 -1
- package/x/components/copy/showcase.d.ts +0 -1
- package/x/components/copy/showcase.js +0 -48
- package/x/components/copy/showcase.js.map +0 -1
- package/x/components/copy/style.css.js.map +0 -1
- package/x/components/drawer/component.d.ts +0 -387
- package/x/components/drawer/component.js +0 -73
- package/x/components/drawer/component.js.map +0 -1
- package/x/components/drawer/control.js.map +0 -1
- package/x/components/drawer/showcase.d.ts +0 -1
- package/x/components/drawer/showcase.js +0 -105
- package/x/components/drawer/showcase.js.map +0 -1
- package/x/components/drawer/style.css.js.map +0 -1
- package/x/components/example/component.d.ts +0 -371
- package/x/components/example/component.js +0 -22
- package/x/components/example/component.js.map +0 -1
- package/x/components/example/showcase.d.ts +0 -1
- package/x/components/example/showcase.js +0 -30
- package/x/components/example/showcase.js.map +0 -1
- package/x/components/example/style.css.js +0 -10
- package/x/components/example/style.css.js.map +0 -1
- package/x/components/foundation.css.d.ts +0 -1
- package/x/components/foundation.css.js +0 -14
- package/x/components/foundation.css.js.map +0 -1
- package/x/components/framework.d.ts +0 -8
- package/x/components/framework.js +0 -5
- package/x/components/framework.js.map +0 -1
- package/x/components/raw-components.d.ts +0 -12
- package/x/components/raw-components.js +0 -13
- package/x/components/raw-components.js.map +0 -1
- package/x/components/tabs/component.d.ts +0 -374
- package/x/components/tabs/component.js +0 -60
- package/x/components/tabs/component.js.map +0 -1
- package/x/components/tabs/control.js.map +0 -1
- package/x/components/tabs/showcase.d.ts +0 -1
- package/x/components/tabs/showcase.js +0 -167
- package/x/components/tabs/showcase.js.map +0 -1
- package/x/components/tabs/style.css.js.map +0 -1
- package/x/demo/demo.bundle.js +0 -42
- package/x/demo/demo.bundle.js.map +0 -1
- package/x/demo/demo.bundle.min.js +0 -893
- package/x/demo/demo.bundle.min.js.map +0 -7
- package/x/demo/lipsum.d.ts +0 -2
- package/x/demo/lipsum.js +0 -4
- package/x/demo/lipsum.js.map +0 -1
- package/x/demo/views/exhibit/style.css.d.ts +0 -2
- package/x/demo/views/exhibit/style.css.js +0 -84
- package/x/demo/views/exhibit/style.css.js.map +0 -1
- package/x/demo/views/exhibit/view.d.ts +0 -29
- package/x/demo/views/exhibit/view.js +0 -40
- package/x/demo/views/exhibit/view.js.map +0 -1
- package/x/demo/viewsets.d.ts +0 -17
- package/x/demo/viewsets.js +0 -9
- package/x/demo/viewsets.js.map +0 -1
- package/x/install/aura.bundle.js +0 -5
- package/x/install/aura.bundle.js.map +0 -1
- package/x/install/aura.bundle.min.js +0 -471
- package/x/install/aura.bundle.min.js.map +0 -7
- package/x/install/plain.bundle.d.ts +0 -1
- package/x/install/plain.bundle.js +0 -5
- package/x/install/plain.bundle.js.map +0 -1
- package/x/install/plain.bundle.min.js +0 -398
- package/x/install/plain.bundle.min.js.map +0 -7
- package/x/shiny.d.ts +0 -47
- 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/aura.css.d.ts +0 -1
- package/x/themes/aura.css.js +0 -85
- package/x/themes/aura.css.js.map +0 -1
- package/x/themes/index.barrel.d.ts +0 -2
- package/x/themes/index.barrel.js +0 -3
- package/x/themes/index.barrel.js.map +0 -1
- package/x/themes/index.d.ts +0 -2
- package/x/themes/index.js +0 -2
- package/x/themes/index.js.map +0 -1
- package/x/themes/infra/css-vars.d.ts +0 -15
- package/x/themes/infra/css-vars.js +0 -22
- package/x/themes/infra/css-vars.js.map +0 -1
- package/x/themes/plain.css.d.ts +0 -1
- package/x/themes/plain.css.js +0 -10
- package/x/themes/plain.css.js.map +0 -1
- /package/s/{components → _archive/components}/button/component.ts +0 -0
- /package/s/{components → _archive/components}/button/showcase.ts +0 -0
- /package/s/{components → _archive/components}/button/style.css.ts +0 -0
- /package/s/{components → _archive/components}/copy/component.ts +0 -0
- /package/s/{components → _archive/components}/copy/showcase.ts +0 -0
- /package/s/{components → _archive/components}/copy/style.css.ts +0 -0
- /package/s/{components → _archive/components}/drawer/component.ts +0 -0
- /package/s/{components → _archive/components}/drawer/control.ts +0 -0
- /package/s/{components → _archive/components}/drawer/showcase.ts +0 -0
- /package/s/{components → _archive/components}/drawer/style.css.ts +0 -0
- /package/s/{components → _archive/components}/example/component.ts +0 -0
- /package/s/{components → _archive/components}/example/showcase.ts +0 -0
- /package/s/{components → _archive/components}/example/style.css.ts +0 -0
- /package/s/{components → _archive/components}/foundation.css.ts +0 -0
- /package/s/{components → _archive/components}/framework.ts +0 -0
- /package/s/{components → _archive/components}/raw-components.ts +0 -0
- /package/s/{components → _archive/components}/tabs/component.ts +0 -0
- /package/s/{components → _archive/components}/tabs/control.ts +0 -0
- /package/s/{components → _archive/components}/tabs/showcase.ts +0 -0
- /package/s/{components → _archive/components}/tabs/style.css.ts +0 -0
- /package/s/{demo → _archive/demo}/demo.bundle.ts +0 -0
- /package/s/{demo → _archive/demo}/demo.css +0 -0
- /package/s/{demo → _archive/demo}/lipsum.ts +0 -0
- /package/s/{demo → _archive/demo}/views/exhibit/style.css.ts +0 -0
- /package/s/{demo → _archive/demo}/views/exhibit/view.ts +0 -0
- /package/s/{demo → _archive/demo}/viewsets.ts +0 -0
- /package/s/{install → _archive/install}/aura.bundle.ts +0 -0
- /package/s/{install → _archive/install}/plain.bundle.ts +0 -0
- /package/s/{shiny.ts → _archive/shiny.ts} +0 -0
- /package/s/{tests.test.ts → _archive/tests.test.ts} +0 -0
- /package/s/{themes → _archive/themes}/aura.css.ts +0 -0
- /package/s/{themes → _archive/themes}/index.barrel.ts +0 -0
- /package/s/{themes → _archive/themes}/index.ts +0 -0
- /package/s/{themes → _archive/themes}/infra/css-vars.ts +0 -0
- /package/s/{themes → _archive/themes}/plain.css.ts +0 -0
- /package/x/{demo → _archive/demo}/demo.css +0 -0
- /package/x/demo/{demo.bundle.d.ts → main.bundle.d.ts} +0 -0
- /package/x/{components/button → demo/views/codebox}/style.css.d.ts +0 -0
- /package/x/{install/aura.bundle.d.ts → test.d.ts} +0 -0
- /package/x/{components/copy → views/button}/style.css.d.ts +0 -0
- /package/x/{components/drawer → views/copy}/style.css.d.ts +0 -0
- /package/x/{components → views}/copy/style.css.js +0 -0
- /package/x/{components → views}/drawer/control.js +0 -0
- /package/x/{components/example → views/drawer}/style.css.d.ts +0 -0
- /package/x/{components → views}/tabs/style.css.d.ts +0 -0
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {css} from "lit"
|
|
3
3
|
export default css`@layer view {
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
section.showcase {
|
|
6
6
|
position: relative;
|
|
7
7
|
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
|
|
11
11
|
padding: 1em;
|
|
12
|
-
border-radius:
|
|
13
|
-
gap:
|
|
12
|
+
border-radius: var(--rounded);
|
|
13
|
+
gap: var(--padding);
|
|
14
14
|
|
|
15
15
|
background: linear-gradient(to right top, #252dd985, #aa6affbd);
|
|
16
16
|
backdrop-filter: blur(0.5em);
|
|
@@ -19,29 +19,29 @@ export default css`@layer view {
|
|
|
19
19
|
border-top: 2px solid #fff4;
|
|
20
20
|
|
|
21
21
|
&::before {
|
|
22
|
+
z-index: 0;
|
|
22
23
|
content: "";
|
|
23
24
|
display: block;
|
|
24
25
|
position: absolute;
|
|
25
26
|
inset: 0;
|
|
26
|
-
border-radius:
|
|
27
|
-
background: #
|
|
28
|
-
width: calc(100% -
|
|
29
|
-
height: calc(100% -
|
|
27
|
+
border-radius: var(--rounded);
|
|
28
|
+
background: #0006;
|
|
29
|
+
width: calc(100% - var(--padding));
|
|
30
|
+
height: calc(100% - var(--padding));
|
|
30
31
|
margin: auto;
|
|
31
|
-
z-index: 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
> * {
|
|
35
|
-
position: relative;
|
|
36
35
|
z-index: 1;
|
|
36
|
+
position: relative;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
header {
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-wrap: wrap;
|
|
43
|
-
place-content: center
|
|
44
|
-
gap:
|
|
43
|
+
place-content: center;
|
|
44
|
+
gap: var(--padding);
|
|
45
45
|
|
|
46
46
|
h2 {
|
|
47
47
|
flex: 1 1 auto;
|
|
@@ -49,5 +49,36 @@ header {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
.sides {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-wrap: wrap;
|
|
55
|
+
gap: var(--padding);
|
|
56
|
+
|
|
57
|
+
> * {
|
|
58
|
+
flex: 1 1 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.codezone {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: var(--padding);
|
|
67
|
+
|
|
68
|
+
> * {
|
|
69
|
+
flex: 1 1 auto;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.stage {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
justify-content: start;
|
|
77
|
+
align-items: center;
|
|
78
|
+
padding: calc(var(--padding) * 2) var(--padding);
|
|
79
|
+
border: 1px dashed color-mix(in oklch, transparent, currentColor 50%);
|
|
80
|
+
border-radius: var(--rounded);
|
|
81
|
+
}
|
|
82
|
+
|
|
52
83
|
}`
|
|
53
84
|
|
|
@@ -1,54 +1,50 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import styleCss from "./style.css.js"
|
|
5
|
-
import {auraViews, viewsets} from "../../viewsets.js"
|
|
6
|
-
import {Exhibit, ExhibitParams} from "../exhibit/view.js"
|
|
7
|
-
import {TabControl} from "../../../components/tabs/control.js"
|
|
8
|
-
import {foundationCss} from "../../../components/foundation.css.js"
|
|
2
|
+
import {css, html} from "lit"
|
|
3
|
+
import {shadow, useCss, useName, useOnce} from "@e280/sly"
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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"
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export const Showcase = shadow((title: string, exhibits: Exhibit[]) => {
|
|
15
|
+
useName("showcase")
|
|
16
|
+
useCss(themeCss, showcaseCss)
|
|
18
17
|
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const exhibitViews = viewsets.at(themeTabControl.index)![1]
|
|
23
|
-
const exhibit = options.exhibits.at(exhibitTabControl.index)!
|
|
18
|
+
const control = useOnce(() => new TabsControl())
|
|
19
|
+
const exhibit = exhibits.at(control.index)
|
|
24
20
|
|
|
25
21
|
return html`
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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>
|
|
52
48
|
`
|
|
53
49
|
})
|
|
54
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
|
+
|
package/s/index.html.ts
CHANGED
|
@@ -1,34 +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
5
|
const favicon = "/assets/favicon.png"
|
|
5
6
|
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
`)
|
|
34
47
|
|
package/s/index.ts
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
|
|
2
|
-
export * from "./
|
|
3
|
-
|
|
4
|
-
export * from "./components/copy/component.js"
|
|
5
|
-
|
|
6
|
-
export * from "./components/drawer/component.js"
|
|
7
|
-
export * from "./components/drawer/control.js"
|
|
8
|
-
|
|
9
|
-
export * from "./components/example/component.js"
|
|
10
|
-
|
|
11
|
-
export * from "./components/tabs/component.js"
|
|
12
|
-
export * from "./components/tabs/control.js"
|
|
13
|
-
|
|
14
|
-
export * from "./components/foundation.css.js"
|
|
15
|
-
export * from "./components/framework.js"
|
|
16
|
-
export * from "./components/raw-components.js"
|
|
17
|
-
|
|
18
|
-
export * from "./shiny.js"
|
|
2
|
+
export * from "./views/copy/view.js"
|
|
19
3
|
|
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": "300ms",
|
|
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,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
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
|
|
2
|
+
import {css} from "lit"
|
|
3
|
+
export default css`@layer view {
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
width: max-content;
|
|
8
|
+
height: max-content;
|
|
9
|
+
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
background: transparent;
|
|
12
|
+
user-select: none;
|
|
13
|
+
|
|
14
|
+
--button-padding: 0.3em 0.7em;
|
|
15
|
+
--button-color: var(--calm);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
slot {
|
|
19
|
+
z-index: 1;
|
|
20
|
+
position: relative;
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
button {
|
|
25
|
+
opacity: 0.8;
|
|
26
|
+
position: relative;
|
|
27
|
+
|
|
28
|
+
font: inherit;
|
|
29
|
+
cursor: inherit;
|
|
30
|
+
text-shadow: inherit;
|
|
31
|
+
font-weight: medium;
|
|
32
|
+
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
padding: var(--button-padding);
|
|
40
|
+
|
|
41
|
+
border-radius: 2em;
|
|
42
|
+
background: var(--button-color);
|
|
43
|
+
text-shadow: 0.1em 0.1em 0.1em #0004;
|
|
44
|
+
box-shadow: 0.1em 0.2em 0.3em #0002;
|
|
45
|
+
|
|
46
|
+
color: white;
|
|
47
|
+
border: none;
|
|
48
|
+
background: linear-gradient(
|
|
49
|
+
to bottom right,
|
|
50
|
+
color-mix(in oklab, var(--button-color), white 40%),
|
|
51
|
+
color-mix(in oklab, var(--button-color), black 20%)
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
content: "";
|
|
56
|
+
display: block;
|
|
57
|
+
position: absolute;
|
|
58
|
+
z-index: 0;
|
|
59
|
+
inset: 0.15em;
|
|
60
|
+
border-radius: inherit;
|
|
61
|
+
background: color-mix(in oklab, var(--button-color), #0004 50%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:not([disabled]):is(:hover, :focus-visible) { opacity: 1; }
|
|
65
|
+
&:not([disabled]):active { opacity: 0.6; }
|
|
66
|
+
|
|
67
|
+
&[data-vibe="lame"] { --button-color: var(--lame); }
|
|
68
|
+
&[data-vibe="angry"] { --button-color: var(--angry); }
|
|
69
|
+
&[data-vibe="zesty"] { --button-color: var(--zesty); }
|
|
70
|
+
&[data-vibe="happy"] { --button-color: var(--happy); }
|
|
71
|
+
&[data-vibe="calm"] { --button-color: var(--calm); }
|
|
72
|
+
&[data-vibe="sad"] { --button-color: var(--sad); }
|
|
73
|
+
&[data-vibe="quirky"] { --button-color: var(--quirky); }
|
|
74
|
+
&[data-vibe="tabbed"] { --button-color: var(--tabbed); }
|
|
75
|
+
|
|
76
|
+
> * {
|
|
77
|
+
position: relative;
|
|
78
|
+
z-index: 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&[disabled] {
|
|
82
|
+
cursor: default;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&[hidden] {
|
|
86
|
+
display: none !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([data-tabbed]) > button {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
filter: brightness(120%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host(:not([data-tabbed])) > button[disabled] {
|
|
96
|
+
--button-color: var(--lame);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([data-snug]:not([data-last])) > button {
|
|
100
|
+
border-top-right-radius: 0;
|
|
101
|
+
border-bottom-right-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([data-snug]:not([data-first])) > button {
|
|
105
|
+
border-top-left-radius: 0;
|
|
106
|
+
border-bottom-left-radius: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
}`
|
|
110
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import {html} from "lit"
|
|
3
|
+
import {Content, shadow, useCss, useName, useAttrs} from "@e280/sly"
|
|
4
|
+
|
|
5
|
+
import styleCss from "./style.css.js"
|
|
6
|
+
import {themeCss} from "../../theme/theme.css.js"
|
|
7
|
+
|
|
8
|
+
export const ShinyButton = shadow((content?: Content, options: {
|
|
9
|
+
vibe?: "calm" | "lame" | "happy" | "sad" | "angry" | "zesty" | "quirky"
|
|
10
|
+
} = {}) => {
|
|
11
|
+
|
|
12
|
+
useName("shiny-button")
|
|
13
|
+
useCss(themeCss, styleCss)
|
|
14
|
+
|
|
15
|
+
const attrs = useAttrs({
|
|
16
|
+
hidden: Boolean,
|
|
17
|
+
disabled: Boolean,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
return html`
|
|
21
|
+
<button
|
|
22
|
+
part=button
|
|
23
|
+
data-vibe="${options.vibe ?? "calm"}"
|
|
24
|
+
?disabled="${attrs.disabled}"
|
|
25
|
+
?hidden="${attrs.hidden}">
|
|
26
|
+
<slot>${content}</slot>
|
|
27
|
+
</button>
|
|
28
|
+
`
|
|
29
|
+
})
|
|
30
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import {debounce} from "@e280/stz"
|
|
3
|
+
import {useOnce, useSignal} from "@e280/sly"
|
|
4
|
+
|
|
5
|
+
import {CopyStatus} from "./copy-status.js"
|
|
6
|
+
import {determineBaseStatus} from "./determine-base-status.js"
|
|
7
|
+
|
|
8
|
+
export function useCopier(text: string | undefined, ms: number) {
|
|
9
|
+
const $status = useSignal<CopyStatus>(determineBaseStatus(text))
|
|
10
|
+
|
|
11
|
+
const reset = useOnce(() => debounce(ms, () => $status.set(determineBaseStatus(text))))
|
|
12
|
+
|
|
13
|
+
const flash = useOnce(() => async(status: CopyStatus) => {
|
|
14
|
+
await $status.set(status)
|
|
15
|
+
await reset()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
return {reset, flash, status: $status()}
|
|
19
|
+
}
|
|
20
|
+
|