@e280/shiny 0.1.0-11 → 0.1.0-12

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.
Files changed (92) hide show
  1. package/README.md +3 -1
  2. package/package.json +3 -3
  3. package/s/components/button/component.ts +3 -3
  4. package/s/components/button/showcase.ts +119 -0
  5. package/s/components/button/style.css.ts +0 -1
  6. package/s/components/copy/component.ts +3 -1
  7. package/s/components/copy/showcase.ts +51 -0
  8. package/s/components/drawer/component.ts +30 -32
  9. package/s/components/drawer/showcase.ts +93 -0
  10. package/s/components/drawer/style.css.ts +9 -4
  11. package/s/components/tabs/showcase.ts +73 -0
  12. package/s/demo/demo.bundle.ts +13 -281
  13. package/s/demo/demo.css +1 -0
  14. package/s/demo/lipsum.ts +6 -0
  15. package/s/demo/utils/lipsum.ts +1 -1
  16. package/s/demo/views/demonstration/view.ts +2 -2
  17. package/s/demo/views/exhibit/style.css.ts +82 -0
  18. package/s/demo/views/exhibit/view.ts +59 -0
  19. package/s/demo/views/showcase/style.css.ts +50 -0
  20. package/s/demo/views/showcase/view.ts +54 -0
  21. package/s/demo/viewsets.ts +12 -0
  22. package/s/index.html.ts +4 -7
  23. package/s/themes/aura.css.ts +4 -4
  24. package/s/themes/infra/css-vars.ts +7 -2
  25. package/x/components/button/component.d.ts +2 -1
  26. package/x/components/button/component.js +2 -2
  27. package/x/components/button/component.js.map +1 -1
  28. package/x/components/button/showcase.d.ts +1 -0
  29. package/x/components/button/showcase.js +116 -0
  30. package/x/components/button/showcase.js.map +1 -0
  31. package/x/components/button/style.css.js +0 -1
  32. package/x/components/button/style.css.js.map +1 -1
  33. package/x/components/copy/component.d.ts +2 -2
  34. package/x/components/copy/component.js +3 -1
  35. package/x/components/copy/component.js.map +1 -1
  36. package/x/components/copy/showcase.d.ts +1 -0
  37. package/x/components/copy/showcase.js +48 -0
  38. package/x/components/copy/showcase.js.map +1 -0
  39. package/x/components/drawer/component.d.ts +3 -3
  40. package/x/components/drawer/component.js +28 -31
  41. package/x/components/drawer/component.js.map +1 -1
  42. package/x/components/drawer/showcase.d.ts +1 -0
  43. package/x/components/drawer/showcase.js +87 -0
  44. package/x/components/drawer/showcase.js.map +1 -0
  45. package/x/components/drawer/style.css.js +9 -4
  46. package/x/components/drawer/style.css.js.map +1 -1
  47. package/x/components/example/component.d.ts +1 -1
  48. package/x/components/tabs/component.d.ts +1 -1
  49. package/x/components/tabs/showcase.d.ts +1 -0
  50. package/x/components/tabs/showcase.js +69 -0
  51. package/x/components/tabs/showcase.js.map +1 -0
  52. package/x/demo/demo.bundle.js +13 -274
  53. package/x/demo/demo.bundle.js.map +1 -1
  54. package/x/demo/demo.bundle.min.js +404 -399
  55. package/x/demo/demo.bundle.min.js.map +4 -4
  56. package/x/demo/demo.css +1 -0
  57. package/x/demo/lipsum.d.ts +2 -0
  58. package/x/demo/lipsum.js +4 -0
  59. package/x/demo/lipsum.js.map +1 -0
  60. package/x/demo/utils/lipsum.js +1 -1
  61. package/x/demo/views/demonstration/view.js +2 -2
  62. package/x/demo/views/demonstration/view.js.map +1 -1
  63. package/x/demo/views/exhibit/style.css.d.ts +2 -0
  64. package/x/demo/views/exhibit/style.css.js +81 -0
  65. package/x/demo/views/exhibit/style.css.js.map +1 -0
  66. package/x/demo/views/exhibit/view.d.ts +29 -0
  67. package/x/demo/views/exhibit/view.js +38 -0
  68. package/x/demo/views/exhibit/view.js.map +1 -0
  69. package/x/demo/views/showcase/style.css.d.ts +2 -0
  70. package/x/demo/views/showcase/style.css.js +49 -0
  71. package/x/demo/views/showcase/style.css.js.map +1 -0
  72. package/x/demo/views/showcase/view.d.ts +7 -0
  73. package/x/demo/views/showcase/view.js +40 -0
  74. package/x/demo/views/showcase/view.js.map +1 -0
  75. package/x/demo/{aura-views.d.ts → viewsets.d.ts} +5 -3
  76. package/x/demo/viewsets.js +9 -0
  77. package/x/demo/viewsets.js.map +1 -0
  78. package/x/index.html +5 -4
  79. package/x/index.html.js +4 -7
  80. package/x/index.html.js.map +1 -1
  81. package/x/install/aura.bundle.min.js +48 -45
  82. package/x/install/aura.bundle.min.js.map +3 -3
  83. package/x/install/plain.bundle.min.js +44 -41
  84. package/x/install/plain.bundle.min.js.map +3 -3
  85. package/x/shiny.d.ts +5 -5
  86. package/x/themes/aura.css.js +4 -4
  87. package/x/themes/infra/css-vars.d.ts +2 -1
  88. package/x/themes/infra/css-vars.js +2 -1
  89. package/x/themes/infra/css-vars.js.map +1 -1
  90. package/s/demo/aura-views.ts +0 -6
  91. package/x/demo/aura-views.js +0 -4
  92. package/x/demo/aura-views.js.map +0 -1
@@ -1,26 +1,11 @@
1
1
 
2
- import {css, html} from "lit"
2
+ import {css} from "lit"
3
3
  import {dom, view} from "@e280/sly"
4
- import {shiny} from "../shiny.js"
5
- import {auraViews} from "./aura-views.js"
6
- import {plain} from "../themes/plain.css.js"
7
- import {makeLipsumDispenser} from "./utils/lipsum.js"
8
- import {TabControl} from "../components/tabs/control.js"
9
- import {Demonstration} from "./views/demonstration/view.js"
10
-
11
- const viewsets = [
12
- {label: "aura", views: auraViews},
13
- {label: "plain", views: shiny({theme: plain}).views},
14
- ]
15
-
16
- const labels = {
17
- html: {button: "html", text: "html web component"},
18
- view: {button: "view", text: "sly view"},
19
- css: {button: "css", text: "custom css"},
20
- }
21
-
22
- const dispenser = makeLipsumDispenser()
23
- const lipsum = () => dispenser.takeFirst()
4
+ import {lipsumDispenser} from "./lipsum.js"
5
+ import {copyShowcase} from "../components/copy/showcase.js"
6
+ import {tabsShowcase} from "../components/tabs/showcase.js"
7
+ import {buttonShowcase} from "../components/button/showcase.js"
8
+ import {drawerShowcase} from "../components/drawer/showcase.js"
24
9
 
25
10
  dom.register({ShinyDemo: view.component(use => {
26
11
  use.styles(css`
@@ -48,268 +33,15 @@ dom.register({ShinyDemo: view.component(use => {
48
33
  }
49
34
  `)
50
35
 
51
- const tabControl = use.once(() => new TabControl(0))
52
- const $viewset = use.derived(() => viewsets.at(tabControl.$index())!)
53
- const views = $viewset().views
54
- dispenser.takeAll()
55
-
56
- const demonstrations = [
57
- Demonstration({
58
- name: "button",
59
- explain: html`
60
- <p>clicky-clacky pressy button.</p>
61
- `,
62
- snippets: [
63
- [labels.html, `
64
- <shiny-button>hello</shiny-button>
65
- `],
66
- [labels.view, `
67
- ShinyButton
68
- .props()
69
- .children("hello")
70
- .render()
71
- `],
72
- [labels.css, `
73
- shiny-button {
74
- font-size: 1em;
75
- --happy: #0fa;
76
- --angry: #f50;
77
- --lame: #8888;
78
- --inactive-opacity: 0.5;
79
- }
80
- `],
81
- ],
82
- content: [
83
- views.ShinyButton.props()
84
- .children("button")
85
- .render(),
86
- views.ShinyButton.props()
87
- .attr("gradient", true)
88
- .children("gradient")
89
- .render(),
90
- views.ShinyButton.props()
91
- .attr("angry", true)
92
- .attr("gradient", true)
93
- .children("angry")
94
- .render(),
95
- views.ShinyButton.props()
96
- .attr("happy", true)
97
- .attr("gradient", true)
98
- .children("happy")
99
- .render(),
100
- views.ShinyButton.props()
101
- .attr("zesty", true)
102
- .attr("gradient", true)
103
- .children("zesty")
104
- .render(),
105
- views.ShinyButton.props()
106
- .attr("sad", true)
107
- .attr("gradient", true)
108
- .children("sad")
109
- .render(),
110
- views.ShinyButton.props()
111
- .attr("quirky", true)
112
- .attr("gradient", true)
113
- .children("quirky")
114
- .render(),
115
- views.ShinyButton.props()
116
- .attr("plain", true)
117
- .children("plain")
118
- .render(),
119
- ],
120
- style: css`
121
- .content {
122
- flex-direction: row;
123
- flex-wrap: wrap;
124
- align-content: center;
125
- gap: 0.5em;
126
-
127
- sly-view {
128
- font-size: 1.2em;
129
- }
130
- }
131
- `,
132
- }),
133
-
134
- Demonstration({
135
- name: "tabs",
136
- explain: html`
137
- <p>button bar. panels optional.</p>
138
- `,
139
- snippets: [
140
- [labels.html, `
141
- <shiny-tabs>
142
- <shiny-button>tab1</shiny-button>
143
- <shiny-button>tab2</shiny-button>
144
- <shiny-button>tab3</shiny-button>
145
- <div slot=panel>panel1</div>
146
- <div slot=panel>panel2</div>
147
- <div slot=panel>panel3</div>
148
- </shiny-tabs>
149
- `],
150
- [labels.view, `
151
- ShinyTabs
152
- .props()
153
- .children(html\`
154
- \${ShinyButton.props()
155
- .children("tab1").render()}
156
- \${ShinyButton.props()
157
- .children("tab2").render()}
158
- \${ShinyButton.props()
159
- .children("tab3").render()}
160
- <div slot=panel>panel1</div>
161
- <div slot=panel>panel2</div>
162
- <div slot=panel>panel3</div>
163
- \`)
164
- .render()
165
- `],
166
- [labels.css, `
167
- shiny-tabs {
168
- &::part(tabs) {}
169
- &::part(panels) {}
170
- > shiny-button {}
171
- }
172
- `],
173
- ],
174
- content: views.ShinyTabs
175
- .props()
176
- .children(html`
177
- ${views.ShinyButton.props().children("tab1").render()}
178
- ${views.ShinyButton.props().children("tab2").render()}
179
- ${views.ShinyButton.props().children("tab3").render()}
180
- <p slot=panel class=lipsum>${lipsum()}</p>
181
- <p slot=panel class=lipsum>${lipsum()}</p>
182
- <p slot=panel class=lipsum>${lipsum()}</p>
183
- `)
184
- .render(),
185
- style: css`
186
- .content {
187
- justify-content: start;
188
- p { margin-top: 0.5em; }
189
- }
190
- `,
191
- }),
36
+ lipsumDispenser.takeAll()
192
37
 
193
- Demonstration({
194
- name: "copy",
195
- explain: html`
196
- <p>click-to-copy text button.</p>
197
- `,
198
- snippets: [
199
- [labels.html, `
200
- <shiny-copy text="hello world"></shiny-copy>
201
- `],
202
- [labels.view, `
203
- ShinyCopy("hello world")
204
- `],
205
- [labels.css, `
206
- shiny-copy {
207
- font-size: 1em;
208
- --happy: #0fa;
209
- --angry: #f50;
210
- --lame: #8888;
211
- --inactive-opacity: 0.5;
212
- }
213
- `],
214
- ],
215
- content: views.ShinyCopy("hello world"),
216
- style: css`
217
- .content sly-view {
218
- font-size: 4em;
219
- }
220
- `,
221
- }),
222
-
223
- Demonstration({
224
- name: "drawer",
225
- explain: html`
226
- <p>slide-out panel. button optional.</p>
227
- `,
228
- snippets: [
229
- [labels.html, `
230
- <shiny-drawer button side=left>
231
- <header>example</header>
232
- <section slot=plate>
233
- lorem kettlebell..
234
- </section>
235
- </shiny-drawer>
236
- `],
237
- [labels.view, `
238
- ShinyDrawer
239
- .props({button: true, side: "left"})
240
- .children(html\`
241
- <header>example</header>
242
- <section slot=plate>
243
- lorem kettlebell..
244
- </section>
245
- \`)
246
- .render()
247
- `],
248
- [labels.css, `
249
- shiny-drawer {
250
- --button-size: 2em;
251
- --anim-duration: 200ms;
252
- --blanket-backdrop-filter: blur(0.5em);
253
- --blanket-bg: color-mix(
254
- in oklab,
255
- transparent,
256
- var(--bg)
257
- );
258
- }
259
- `],
260
- ],
261
- content: views.ShinyDrawer
262
- .props({button: true})
263
- .children(html`
264
- <header>
265
- <h2>example drawer</h2>
266
- <p>you can put any content in here.</p>
267
- <p class=lipsum>${lipsum()}</p>
268
- </header>
269
- <section slot=plate>
270
- <p class=lipsum>${lipsum()}</p>
271
- <p class=lipsum>${lipsum()}</p>
272
- </section>
273
- `)
274
- .render(),
275
- style: css`
276
- .content sly-view {
277
- border-radius: 0.5em;
278
- overflow: hidden;
279
- --button-size: 3em;
280
-
281
- header {
282
- > * + * { margin-top: 0.5em; }
283
- }
284
-
285
- section {
286
- display: flex;
287
- flex-direction: column;
288
- justify-content: center;
289
- min-height: 100%;
290
- padding: 1em;
291
- padding-top: 3em;
292
- > * + * { margin-top: 0.5em; }
293
- }
294
- }
295
- `,
296
- }),
38
+ return [
39
+ buttonShowcase(),
40
+ copyShowcase(),
41
+ drawerShowcase(),
42
+ tabsShowcase(),
297
43
  ]
298
-
299
- return html`
300
- <div class=themes>
301
- <span>theme</span>
302
- ${auraViews.ShinyTabs
303
- .props(tabControl)
304
- .children(viewsets.map(viewset => html`
305
- ${auraViews.ShinyButton.props().children(viewset.label).render()}
306
- `))
307
- .render()}
308
- </div>
309
-
310
- ${demonstrations}
311
- `
312
44
  })})
313
45
 
314
- console.log("✨shiny")
46
+ console.log("✨shiny")
315
47
 
package/s/demo/demo.css CHANGED
@@ -6,6 +6,7 @@
6
6
  --bg: #333;
7
7
  --color: #fff;
8
8
  --prime: #d068ff;
9
+ --code: #3f1;
9
10
  --link: cyan;
10
11
 
11
12
  --selection: white;
@@ -0,0 +1,6 @@
1
+
2
+ import {makeLipsumDispenser} from "./utils/lipsum.js"
3
+
4
+ export const lipsumDispenser = makeLipsumDispenser()
5
+ export const lipsum = () => lipsumDispenser.takeFirst()
6
+
@@ -10,7 +10,7 @@ export const makeLipsumDispenser = () => new Dispenser(() => [
10
10
 
11
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
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.`,
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
14
 
15
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
16
 
@@ -3,7 +3,7 @@ import {untab} from "@e280/stz"
3
3
  import {Content, view} from "@e280/sly"
4
4
  import {CSSResultGroup, html} from "lit"
5
5
  import styleCss from "./style.css.js"
6
- import {auraViews} from "../../aura-views.js"
6
+ import {auraViews} from "../../viewsets.js"
7
7
  import {foundationCss} from "../../../components/foundation.css.js"
8
8
 
9
9
  export const Demonstration = view(use => (options: {
@@ -40,7 +40,7 @@ export const Demonstration = view(use => (options: {
40
40
  ${options.snippets.map(([label]) => (
41
41
  auraViews.ShinyButton
42
42
  .props()
43
- .attr("plain", true)
43
+ .attr("plain")
44
44
  .children(label.button)
45
45
  .render()
46
46
  ))}
@@ -0,0 +1,82 @@
1
+
2
+ import {css} from "lit"
3
+ export default css`@layer view {
4
+
5
+ :host {
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ gap: 0.5em;
9
+
10
+ > * {
11
+ flex: 1 1 0;
12
+ min-width: 0;
13
+ }
14
+ }
15
+
16
+ .meta {
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 1em;
20
+ }
21
+
22
+ .snippet {
23
+ flex: 1 0 auto;
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 0.5em;
27
+ padding: 0.5em;
28
+
29
+ background: #0002;
30
+ box-shadow: inset 0.2em 0.3em 2em #0004;
31
+ border-radius: 0.5em;
32
+
33
+ > header {
34
+ display: flex;
35
+ flex-wrap: wrap;
36
+ align-items: center;
37
+
38
+ [view="shiny-copy"] { font-size: 1.5em; }
39
+ [view="shiny-tabs"] {
40
+ flex: 1 1 auto;
41
+ font-size: 0.8em;
42
+ color: color-mix(in oklab, transparent, currentColor 50%);
43
+ }
44
+ }
45
+
46
+ > code {
47
+ display: block;
48
+
49
+ white-space: pre;
50
+ text-wrap: wrap;
51
+ tab-size: 2;
52
+ word-break: keep-all;
53
+ overflow: auto;
54
+
55
+ color: var(--code);
56
+ font-size: 0.8em;
57
+ font-family: monospace;
58
+ }
59
+ }
60
+
61
+ .box {
62
+ display: flex;
63
+ flex-wrap: wrap;
64
+ justify-content: center;
65
+ align-items: center;
66
+ align-content: center;
67
+
68
+ gap: 0.5em;
69
+ padding: 1em;
70
+
71
+ border-radius: 0.5rem;
72
+ border: 1px dashed color-mix(in oklab, transparent, currentColor 30%);
73
+
74
+ p.lipsum {
75
+ opacity: 0.7;
76
+ font-family: serif;
77
+ font-style: italic;
78
+ }
79
+ }
80
+
81
+ }`
82
+
@@ -0,0 +1,59 @@
1
+
2
+ import {untab} from "@e280/stz"
3
+ import {Content, view} from "@e280/sly"
4
+ import {CSSResultGroup, html} from "lit"
5
+
6
+ import styleCss from "./style.css.js"
7
+ import {auraViews} from "../../viewsets.js"
8
+ import {ShinyViews} from "../../../shiny.js"
9
+ import {TabControl} from "../../../components/tabs/control.js"
10
+ import {foundationCss} from "../../../components/foundation.css.js"
11
+
12
+ export type ExhibitParams = {
13
+ label: string
14
+ explain: Content
15
+ snippets: {label: string, code: string}[]
16
+ style: CSSResultGroup
17
+ presentation: (views: ShinyViews) => Content
18
+ }
19
+
20
+ export const Exhibit = view(use => (
21
+ exhibit: ExhibitParams,
22
+ views: ShinyViews,
23
+ showcaseStyle: CSSResultGroup,
24
+ ) => {
25
+
26
+ use.name(`exhibit-${exhibit.label}`)
27
+ use.styles(foundationCss, styleCss, showcaseStyle, exhibit.style)
28
+
29
+ const snippetControl = use.once(() => new TabControl())
30
+ const snippet = exhibit.snippets.at(snippetControl.index)
31
+ const code = snippet ? untab(snippet.code).trim() : ""
32
+
33
+ return html`
34
+ <div class=meta>
35
+ ${exhibit.explain}
36
+
37
+ <div class=snippet>
38
+ <header>
39
+ ${auraViews.ShinyTabs.props(snippetControl)
40
+ .children(exhibit.snippets.map(s =>
41
+ auraViews.ShinyButton
42
+ .props()
43
+ .attr("plain")
44
+ .children(s.label)
45
+ .render()
46
+ ))
47
+ .render()}
48
+ ${auraViews.ShinyCopy(code)}
49
+ </header>
50
+ <code>${code}</code>
51
+ </div>
52
+ </div>
53
+
54
+ <div class=box>
55
+ ${exhibit.presentation(views)}
56
+ </div>
57
+ `
58
+ })
59
+
@@ -0,0 +1,50 @@
1
+
2
+ import {css} from "lit"
3
+ export default css`@layer view {
4
+
5
+ :host {
6
+ position: relative;
7
+
8
+ display: flex;
9
+ flex-direction: column;
10
+
11
+ padding: 1em;
12
+ border-radius: 0.5em;
13
+ gap: 1em;
14
+
15
+ background: linear-gradient(to right top, #252dd985, #aa6affbd);
16
+ backdrop-filter: blur(0.5em);
17
+
18
+ box-shadow: 0 0 5em #5d1fadaa;
19
+ border-top: 2px solid #fff4;
20
+
21
+ &::before {
22
+ content: "";
23
+ display: block;
24
+ position: absolute;
25
+ inset: 0;
26
+ border-radius: 0.5em;
27
+ background: #0007;
28
+ width: calc(100% - 0.3em);
29
+ height: calc(100% - 0.3em);
30
+ margin: auto;
31
+ z-index: 0;
32
+ }
33
+
34
+ > * {
35
+ position: relative;
36
+ z-index: 1;
37
+ }
38
+ }
39
+
40
+ header {
41
+ display: flex;
42
+
43
+ h2 {
44
+ flex: 1 1 auto;
45
+ color: var(--prime);
46
+ }
47
+ }
48
+
49
+ }`
50
+
@@ -0,0 +1,54 @@
1
+
2
+ import {view} from "@e280/sly"
3
+ import {CSSResultGroup, html} from "lit"
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"
9
+
10
+ export const Showcase = view(use => (options: {
11
+ name: string
12
+ style: CSSResultGroup
13
+ exhibits: ExhibitParams[]
14
+ }) => {
15
+
16
+ use.name(`showcase-${options.name}`)
17
+ use.styles(foundationCss, styleCss)
18
+
19
+ const exhibitTabControl = use.once(() => new TabControl())
20
+ const themeTabControl = use.once(() => new TabControl())
21
+
22
+ const exhibitViews = viewsets.at(themeTabControl.index)![1]
23
+ const exhibit = options.exhibits.at(exhibitTabControl.index)!
24
+
25
+ return html`
26
+ <header>
27
+ <h2>✨shiny-${options.name}✨</h2>
28
+ <nav>
29
+ ${auraViews.ShinyTabs
30
+ .props(exhibitTabControl)
31
+ .children(options.exhibits.map(p =>
32
+ auraViews.ShinyButton
33
+ .props()
34
+ .attr("sad")
35
+ .children(p.label)
36
+ .render()
37
+ ))
38
+ .render()}
39
+ ${auraViews.ShinyTabs
40
+ .props(themeTabControl)
41
+ .children(viewsets.map(([theme]) =>
42
+ auraViews.ShinyButton
43
+ .props()
44
+ .children(theme)
45
+ .render()
46
+ ))
47
+ .render()}
48
+ </nav>
49
+ </header>
50
+
51
+ ${Exhibit(exhibit, exhibitViews, options.style)}
52
+ `
53
+ })
54
+
@@ -0,0 +1,12 @@
1
+
2
+ import {aura} from "../themes/aura.css.js"
3
+ import {plain} from "../themes/plain.css.js"
4
+ import {shiny, ShinyViews} from "../shiny.js"
5
+
6
+ export const auraViews = shiny({theme: aura}).views
7
+
8
+ export const viewsets: [label: string, ShinyViews][] = [
9
+ ["aura", auraViews],
10
+ ["plain", shiny({theme: plain}).views],
11
+ ]
12
+
package/s/index.html.ts CHANGED
@@ -1,23 +1,20 @@
1
1
 
2
2
  import {ssg, html} from "@e280/scute"
3
3
 
4
- const title = "shiny"
5
- const description = "✨ web ui components"
6
- const domain = "shiny.e280.org"
7
4
  const favicon = "/assets/favicon.png"
8
5
 
9
6
  export default ssg.page(import.meta.url, async orb => ({
10
- title,
7
+ title: "shiny",
11
8
  js: "demo/demo.bundle.min.js",
12
9
  css: "demo/demo.css",
13
10
  favicon,
14
11
  dark: true,
15
12
  socialCard: {
16
13
  themeColor: "#d068ff",
17
- title,
18
- description,
19
14
  siteName: "@e280/shiny",
20
- image: "https://" + domain + favicon,
15
+ title: "✨shiny✨",
16
+ description: "web ui components",
17
+ image: "https://shiny.e280.org" + favicon,
21
18
  },
22
19
 
23
20
  body: html`
@@ -57,10 +57,10 @@ export const aura = css`@layer overlay {
57
57
  }
58
58
  }
59
59
 
60
- :host([view="shiny-drawer"]) {
60
+ :host([view="shiny-drawer"]:not([plain])) {
61
61
  display: block;
62
62
 
63
- &::part(tray) {
63
+ &::part(slate) {
64
64
  padding: 1em;
65
65
  background: linear-gradient(
66
66
  to top right,
@@ -71,13 +71,13 @@ export const aura = css`@layer overlay {
71
71
  }
72
72
 
73
73
  :host([view="shiny-drawer"]:state(left)) {
74
- &::part(tray) {
74
+ &::part(slate) {
75
75
  border-bottom-right-radius: 0.5em;
76
76
  }
77
77
  }
78
78
 
79
79
  :host([view="shiny-drawer"]:state(right)) {
80
- &::part(tray) {
80
+ &::part(slate) {
81
81
  border-bottom-left-radius: 0.5em;
82
82
  }
83
83
  }
@@ -5,7 +5,6 @@ export type CssVars = {
5
5
  "bg": string
6
6
  "alpha": string
7
7
  "lame": string
8
- "inactive-opacity": string
9
8
 
10
9
  // normative color vibes
11
10
  "angry": string // red
@@ -14,13 +13,16 @@ export type CssVars = {
14
13
  "calm": string // cyan
15
14
  "sad": string // blue
16
15
  "quirky": string // magenta
16
+
17
+ "inactive-opacity": string
18
+ "anim-duration": string
17
19
  }
18
20
 
19
21
  export function defaultCssVars(): CssVars {
20
22
  return {
21
23
  "bg": "#111",
22
24
  "alpha": "#def",
23
- "inactive-opacity": "0.5",
25
+
24
26
  "lame": "#8888",
25
27
  "angry": "#f50",
26
28
  "zesty": "#cf0",
@@ -28,6 +30,9 @@ export function defaultCssVars(): CssVars {
28
30
  "calm": "#0af",
29
31
  "sad": "#74f",
30
32
  "quirky": "#f49",
33
+
34
+ "inactive-opacity": "0.5",
35
+ "anim-duration": "300ms",
31
36
  }
32
37
  }
33
38