@e280/shiny 0.1.0-13 → 0.1.0-14

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 (35) hide show
  1. package/README.md +12 -8
  2. package/package.json +1 -1
  3. package/s/components/button/showcase.ts +1 -1
  4. package/s/components/copy/showcase.ts +1 -1
  5. package/s/components/drawer/showcase.ts +6 -1
  6. package/s/components/drawer/style.css.ts +2 -0
  7. package/s/components/example/component.ts +2 -2
  8. package/s/components/example/showcase.ts +32 -0
  9. package/s/components/tabs/showcase.ts +7 -2
  10. package/s/themes/aura.css.ts +5 -5
  11. package/x/components/button/showcase.js +1 -1
  12. package/x/components/copy/showcase.js +1 -1
  13. package/x/components/drawer/showcase.js +6 -1
  14. package/x/components/drawer/showcase.js.map +1 -1
  15. package/x/components/drawer/style.css.js +2 -0
  16. package/x/components/drawer/style.css.js.map +1 -1
  17. package/x/components/example/component.d.ts +1 -1
  18. package/x/components/example/component.js +2 -2
  19. package/x/components/example/component.js.map +1 -1
  20. package/x/components/example/showcase.d.ts +1 -0
  21. package/x/components/example/showcase.js +30 -0
  22. package/x/components/example/showcase.js.map +1 -0
  23. package/x/components/tabs/showcase.js +7 -2
  24. package/x/components/tabs/showcase.js.map +1 -1
  25. package/x/demo/demo.bundle.min.js +24 -12
  26. package/x/demo/demo.bundle.min.js.map +2 -2
  27. package/x/demo/views/exhibit/view.d.ts +1 -1
  28. package/x/demo/viewsets.d.ts +1 -1
  29. package/x/index.html +2 -2
  30. package/x/install/aura.bundle.min.js +9 -7
  31. package/x/install/aura.bundle.min.js.map +2 -2
  32. package/x/install/plain.bundle.min.js +4 -2
  33. package/x/install/plain.bundle.min.js.map +2 -2
  34. package/x/shiny.d.ts +2 -2
  35. package/x/themes/aura.css.js +5 -5
package/README.md CHANGED
@@ -45,29 +45,33 @@
45
45
  ```ts
46
46
  const {components, views} = shiny({theme: themes.aura})
47
47
  ```
48
- - `aura` — (default) cosmic dreamy seaside nebula vibes
49
- - `plain` — bare-bones spartan theme, buttons look lame
50
48
  - (optional) register the components
51
49
  ```ts
52
50
  dom.register(components)
53
51
  ```
54
52
  - or use views instead of components
55
- - time to go shopping at https://shiny.e280.org/
53
+ - go shopping at https://shiny.e280.org/
54
+
55
+
56
+
57
+ <br/><br/>
58
+
59
+ ## 🎨 themes
60
+
61
+ - **`aura`** — cosmic dreamy seaside nebula vibes
62
+ - `plain` — bare-bones spartan theme, for diy, buttons look lame
56
63
 
57
64
 
58
65
 
59
66
  <br/><br/>
60
67
 
61
68
  ## 😎 views are for the cool kids
62
- - hey, remember those `views` you got from the install snippet?
63
- ```ts
64
- const {components, views} = shiny({theme: themes.aura})
65
- ```
69
+ - hey, remember those `views` you got from the web app install snippet?
66
70
  - well you can yoink out a view you wanna use
67
71
  ```ts
68
72
  const {ShinyCopy} = views
69
73
  ```
70
- - then you can render it directly in your lit templates
74
+ - then you can use 'em directly in your lit templates
71
75
  ```ts
72
76
  import {html} from "lit"
73
77
  import {dom, view} from "@e280/sly"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e280/shiny",
3
- "version": "0.1.0-13",
3
+ "version": "0.1.0-14",
4
4
  "description": "✨ web ui components",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -3,7 +3,7 @@ import {css, html} from "lit"
3
3
  import {Showcase} from "../../demo/views/showcase/view.js"
4
4
 
5
5
  const cssSnippet = `
6
- shiny-button {
6
+ [view="shiny-button"] {
7
7
  --padding: 0.3em;
8
8
  font-size: 1em;
9
9
  color: currentColor;
@@ -3,7 +3,7 @@ import {css, html} from "lit"
3
3
  import {Showcase} from "../../demo/views/showcase/view.js"
4
4
 
5
5
  const cssSnippet = `
6
- shiny-copy {
6
+ [view="shiny-copy"] {
7
7
  font-size: 1em;
8
8
  --happy: #0fa;
9
9
  --angry: #f50;
@@ -9,7 +9,7 @@ const lip2 = lipsum()
9
9
  const lip3 = lipsum()
10
10
 
11
11
  const cssSnippet = `
12
- shiny-drawer {
12
+ [view="shiny-drawer"] {
13
13
  --button-size: 2em;
14
14
  --anim-duration: 200ms;
15
15
  --slate-hidden-opacity: 1;
@@ -19,6 +19,11 @@ const cssSnippet = `
19
19
  transparent,
20
20
  var(--bg)
21
21
  );
22
+ --slate-bg: linear-gradient(
23
+ to top right,
24
+ color-mix(in oklab, var(--calm), #222 50%),
25
+ color-mix(in oklab, var(--calm), #888 50%)
26
+ );
22
27
  }
23
28
  `
24
29
 
@@ -6,6 +6,7 @@ export default css`@layer view {
6
6
  display: block;
7
7
  width: 100%;
8
8
  height: 100%;
9
+ --slate-bg: transparent;
9
10
  --button-size: 2em;
10
11
  --blanket-backdrop-filter: blur(0.5em);
11
12
  --slate-hidden-opacity: 1;
@@ -64,6 +65,7 @@ export default css`@layer view {
64
65
  display: block;
65
66
  height: 100%;
66
67
  overflow-y: auto;
68
+ background: var(--slate-bg);
67
69
  }
68
70
 
69
71
  > button {
@@ -6,7 +6,7 @@ import {foundationCss} from "../foundation.css.js"
6
6
  import {ShinyContext, ShinyElement} from "../framework.js"
7
7
 
8
8
  export class ShinyExample extends (
9
- view(use => (context: ShinyContext, start: number) => {
9
+ view(use => (context: ShinyContext, start = 1) => {
10
10
  use.name("shiny-example")
11
11
  use.styles(foundationCss, context.theme, styleCss)
12
12
 
@@ -22,6 +22,6 @@ export class ShinyExample extends (
22
22
  .component(class extends ShinyElement {
23
23
  attrs = dom.attrs(this).spec({start: Number})
24
24
  })
25
- .props(el => [el.context, el.attrs.start ?? 1] as const)
25
+ .props(el => [el.context, el.attrs.start] as const)
26
26
  ) {}
27
27
 
@@ -0,0 +1,32 @@
1
+
2
+ import {css, html} from "lit"
3
+ import {Showcase} from "../../demo/views/showcase/view.js"
4
+
5
+ export const drawerShowcase = () => Showcase({
6
+ name: "drawer",
7
+ style: css`
8
+ .box {}
9
+ `,
10
+ exhibits: [
11
+ {
12
+ label: "example",
13
+ explain: html`<p>example component.</p>`,
14
+ snippets: [
15
+ {label: "html", code: `
16
+ <shiny-example></shiny-example>
17
+ `},
18
+ {label: "view", code: `
19
+ ShinyExample()
20
+ `},
21
+ {label: "css", code: `
22
+ [view="shiny-example"] {}
23
+ `},
24
+ ],
25
+ style: css``,
26
+ presentation: views => html`
27
+ ${views.ShinyExample()}
28
+ `,
29
+ },
30
+ ],
31
+ })
32
+
@@ -8,10 +8,15 @@ const lip2 = lipsum()
8
8
  const lip3 = lipsum()
9
9
 
10
10
  const cssSnippet = `
11
- shiny-tabs {
11
+ [view="shiny-tabs"] {
12
12
  &::part(tabs) {}
13
13
  &::part(panels) {}
14
- > shiny-button {}
14
+
15
+ /* buttons */
16
+ > :not([slot="panel"]) {}
17
+
18
+ /* panels */
19
+ > [slot="panel"] {}
15
20
  }
16
21
  `
17
22
 
@@ -59,14 +59,14 @@ export const aura = css`@layer overlay {
59
59
 
60
60
  :host([view="shiny-drawer"]:not([plain])) {
61
61
  display: block;
62
+ --slate-bg: linear-gradient(
63
+ to top right,
64
+ color-mix(in oklab, var(--calm), #222 50%),
65
+ color-mix(in oklab, var(--calm), #888 50%)
66
+ );
62
67
 
63
68
  &::part(slate) {
64
69
  padding: 1em;
65
- background: linear-gradient(
66
- to top right,
67
- #00a9dd69,
68
- #70ffd77a
69
- );
70
70
  }
71
71
  }
72
72
 
@@ -1,7 +1,7 @@
1
1
  import { css, html } from "lit";
2
2
  import { Showcase } from "../../demo/views/showcase/view.js";
3
3
  const cssSnippet = `
4
- shiny-button {
4
+ [view="shiny-button"] {
5
5
  --padding: 0.3em;
6
6
  font-size: 1em;
7
7
  color: currentColor;
@@ -1,7 +1,7 @@
1
1
  import { css, html } from "lit";
2
2
  import { Showcase } from "../../demo/views/showcase/view.js";
3
3
  const cssSnippet = `
4
- shiny-copy {
4
+ [view="shiny-copy"] {
5
5
  font-size: 1em;
6
6
  --happy: #0fa;
7
7
  --angry: #f50;
@@ -5,7 +5,7 @@ const lip1 = lipsum();
5
5
  const lip2 = lipsum();
6
6
  const lip3 = lipsum();
7
7
  const cssSnippet = `
8
- shiny-drawer {
8
+ [view="shiny-drawer"] {
9
9
  --button-size: 2em;
10
10
  --anim-duration: 200ms;
11
11
  --slate-hidden-opacity: 1;
@@ -15,6 +15,11 @@ const cssSnippet = `
15
15
  transparent,
16
16
  var(--bg)
17
17
  );
18
+ --slate-bg: linear-gradient(
19
+ to top right,
20
+ color-mix(in oklab, var(--calm), #222 50%),
21
+ color-mix(in oklab, var(--calm), #888 50%)
22
+ );
18
23
  }
19
24
  `;
20
25
  const makeExhibit = (side) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/drawer/showcase.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAG1D,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AAErB,MAAM,UAAU,GAAG;;;;;;;;;;;;CAYlB,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,IAAsB,EAAiB,EAAE,CAAC,CAAC;IAC/D,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI,CAAA,0CAA0C;IACvD,QAAQ,EAAE;QACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;+BACO,IAAI;;;;GAIhC,EAAC;QACF,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;;mCAEW,IAAI;;;;;;GAMpC,EAAC;QACF,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC;KAChC;IACD,KAAK,EAAE,GAAG,CAAA,EAAE;IACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;IACxB,KAAK,CAAC,W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AU,EAAC;KAChC;IACD,KAAK,EAAE,GAAG,CAAA,EAAE;IACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;IACxB,KAAK,CAAC,WAAW;SACjB,KAAK,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;SAC3B,QAAQ,CAAC,IAAI,CAAA;;;;uBAIM,IAAI;;;uBAGJ,IAAI;uBACJ,IAAI;;IAEvB,CAAC;SACD,MAAM,EAAE;EACV;CACD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;EAoBT;IACD,QAAQ,EAAE;QACT,WAAW,CAAC,MAAM,CAAC;QACnB,WAAW,CAAC,OAAO,CAAC;KACpB;CACD,CAAC,CAAA"}
@@ -5,6 +5,7 @@ export default css `@layer view {
5
5
  display: block;
6
6
  width: 100%;
7
7
  height: 100%;
8
+ --slate-bg: transparent;
8
9
  --button-size: 2em;
9
10
  --blanket-backdrop-filter: blur(0.5em);
10
11
  --slate-hidden-opacity: 1;
@@ -63,6 +64,7 @@ export default css `@layer view {
63
64
  display: block;
64
65
  height: 100%;
65
66
  overflow-y: auto;
67
+ background: var(--slate-bg);
66
68
  }
67
69
 
68
70
  > button {
@@ -1 +1 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/drawer/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHhB,CAAA"}
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/drawer/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HhB,CAAA"}
@@ -365,7 +365,7 @@ declare const ShinyExample_base: import("@e280/sly").ComponentClass<{
365
365
  focus(options?: FocusOptions): void;
366
366
  };
367
367
  styles: import("lit").CSSResultGroup | undefined;
368
- }, [context: ShinyContext, start: number]>;
368
+ }, [context: ShinyContext, start?: any]>;
369
369
  export declare class ShinyExample extends ShinyExample_base {
370
370
  }
371
371
  export {};
@@ -3,7 +3,7 @@ import { dom, view } from "@e280/sly";
3
3
  import styleCss from "./style.css.js";
4
4
  import { foundationCss } from "../foundation.css.js";
5
5
  import { ShinyElement } from "../framework.js";
6
- export class ShinyExample extends (view(use => (context, start) => {
6
+ export class ShinyExample extends (view(use => (context, start = 1) => {
7
7
  use.name("shiny-example");
8
8
  use.styles(foundationCss, context.theme, styleCss);
9
9
  const $count = use.signal(start);
@@ -17,6 +17,6 @@ export class ShinyExample extends (view(use => (context, start) => {
17
17
  .component(class extends ShinyElement {
18
18
  attrs = dom.attrs(this).spec({ start: Number });
19
19
  })
20
- .props(el => [el.context, el.attrs.start ?? 1])) {
20
+ .props(el => [el.context, el.attrs.start])) {
21
21
  }
22
22
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/example/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,M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G,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE;IAChD,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IACzB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAElD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,SAAS,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAA;IAE1C,OAAO,IAAI,CAAA;qBACQ,SAAS;MACxB,MAAM,EAAE;;GAEX,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,KAAM,SAAQ,YAAY;IACpC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,CAAA;CAC7C,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAU,CAAC,CACnD;CAAG"}
@@ -0,0 +1 @@
1
+ export declare const drawerShowcase: () => import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -0,0 +1,30 @@
1
+ import { css, html } from "lit";
2
+ import { Showcase } from "../../demo/views/showcase/view.js";
3
+ export const drawerShowcase = () => Showcase({
4
+ name: "drawer",
5
+ style: css `
6
+ .box {}
7
+ `,
8
+ exhibits: [
9
+ {
10
+ label: "example",
11
+ explain: html `<p>example component.</p>`,
12
+ snippets: [
13
+ { label: "html", code: `
14
+ <shiny-example></shiny-example>
15
+ ` },
16
+ { label: "view", code: `
17
+ ShinyExample()
18
+ ` },
19
+ { label: "css", code: `
20
+ [view="shiny-example"] {}
21
+ ` },
22
+ ],
23
+ style: css ``,
24
+ presentation: views => html `
25
+ ${views.ShinyExample()}
26
+ `,
27
+ },
28
+ ],
29
+ });
30
+ //# sourceMappingURL=showcase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/example/showcase.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAE1D,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG,CAAA;;EAET;IACD,QAAQ,EAAE;QACT;YACC,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,IAAI,CAAA,2BAA2B;YACxC,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;;KAErB,EAAC;gBACF,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;;KAErB,EAAC;gBACF,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;;KAEpB,EAAC;aACF;YACD,KAAK,EAAE,GAAG,CAAA,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;MACxB,KAAK,CAAC,YAAY,EAAE;IACtB;SACD;KACD;CACD,CAAC,CAAA"}
@@ -5,10 +5,15 @@ const lip1 = lipsum();
5
5
  const lip2 = lipsum();
6
6
  const lip3 = lipsum();
7
7
  const cssSnippet = `
8
- shiny-tabs {
8
+ [view="shiny-tabs"] {
9
9
  &::part(tabs) {}
10
10
  &::part(panels) {}
11
- > shiny-button {}
11
+
12
+ /* buttons */
13
+ > :not([slot="panel"]) {}
14
+
15
+ /* panels */
16
+ > [slot="panel"] {}
12
17
  }
13
18
  `;
14
19
  export const tabsShowcase = () => Showcase({
@@ -1 +1 @@
1
- {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/tabs/showcase.ts"],"names":[],"mappings":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I;mCACJ,IAAI;mCACJ,IAAI;MACjC,CAAC;iBACD,MAAM,EAAE;IACV;SACD;KACD;CACD,CAAC,CAAA"}
@@ -134,14 +134,14 @@ header {
134
134
 
135
135
  :host([view="shiny-drawer"]:not([plain])) {
136
136
  display: block;
137
+ --slate-bg: linear-gradient(
138
+ to top right,
139
+ color-mix(in oklab, var(--calm), #222 50%),
140
+ color-mix(in oklab, var(--calm), #888 50%)
141
+ );
137
142
 
138
143
  &::part(slate) {
139
144
  padding: 1em;
140
- background: linear-gradient(
141
- to top right,
142
- #00a9dd69,
143
- #70ffd77a
144
- );
145
145
  }
146
146
  }
147
147
 
@@ -291,6 +291,7 @@ svg {
291
291
  display: block;
292
292
  width: 100%;
293
293
  height: 100%;
294
+ --slate-bg: transparent;
294
295
  --button-size: 2em;
295
296
  --blanket-backdrop-filter: blur(0.5em);
296
297
  --slate-hidden-opacity: 1;
@@ -349,6 +350,7 @@ svg {
349
350
  display: block;
350
351
  height: 100%;
351
352
  overflow-y: auto;
353
+ background: var(--slate-bg);
352
354
  }
353
355
 
354
356
  > button {
@@ -438,11 +440,11 @@ button {
438
440
  min-width: 4em;
439
441
  }
440
442
 
441
- }`;var re=class extends f(t=>(e,s)=>{t.name("shiny-example"),t.styles(A,e.theme,xr);let o=t.signal(s);return h`
443
+ }`;var re=class extends f(t=>(e,s=1)=>{t.name("shiny-example"),t.styles(A,e.theme,xr);let o=t.signal(s);return h`
442
444
  <button @click="${()=>{o.value++}}">
443
445
  ${o()}
444
446
  </button>
445
- `}).component(class extends S{attrs=d.attrs(this).spec({start:Number})}).props(t=>[t.context,t.attrs.start??1]){};var vr=c`@layer view {
447
+ `}).component(class extends S{attrs=d.attrs(this).spec({start:Number})}).props(t=>[t.context,t.attrs.start]){};var vr=c`@layer view {
446
448
 
447
449
  :host {
448
450
  display: inline-flex;
@@ -590,7 +592,7 @@ slot[part="tabs"] {
590
592
 
591
593
  ${_r(n,o,t.style)}
592
594
  `});var Ar=`
593
- shiny-copy {
595
+ [view="shiny-copy"] {
594
596
  font-size: 1em;
595
597
  --happy: #0fa;
596
598
  --angry: #f50;
@@ -606,10 +608,15 @@ slot[part="tabs"] {
606
608
  `},{label:"fail",explain:h`<p>copy text button, deliberately fails so you can see.</p>`,snippets:[{label:"html",code:"<shiny-copy fail></shiny-button>"},{label:"view",code:'ShinyCopy.props("").attr("fail").render()'},{label:"css",code:Ar}],style:c``,presentation:r=>h`
607
609
  ${r.ShinyCopy.props("").attr("fail").render()}
608
610
  `}]});var we=N(),$e=N(),_e=N(),Ae=`
609
- shiny-tabs {
611
+ [view="shiny-tabs"] {
610
612
  &::part(tabs) {}
611
613
  &::part(panels) {}
612
- > shiny-button {}
614
+
615
+ /* buttons */
616
+ > :not([slot="panel"]) {}
617
+
618
+ /* panels */
619
+ > [slot="panel"] {}
613
620
  }
614
621
  `,kr=()=>H({name:"tabs",style:c`
615
622
  .box {
@@ -710,7 +717,7 @@ slot[part="tabs"] {
710
717
  <p slot=panel class=lipsum>${_e}</p>
711
718
  `).render()}
712
719
  `}]});var Se=`
713
- shiny-button {
720
+ [view="shiny-button"] {
714
721
  --padding: 0.3em;
715
722
  font-size: 1em;
716
723
  color: currentColor;
@@ -748,7 +755,7 @@ slot[part="tabs"] {
748
755
  ShinyButton.props().attr("plain").children("plain").render(),
749
756
  ]
750
757
  `},{label:"css",code:Se}],style:c``,presentation:r=>[r.ShinyButton.props().attr("calm").attr("gradient").children("calm").render(),r.ShinyButton.props().attr("angry").attr("gradient").children("angry").render(),r.ShinyButton.props().attr("happy").attr("gradient").children("happy").render(),r.ShinyButton.props().attr("zesty").attr("gradient").children("zesty").render(),r.ShinyButton.props().attr("sad").attr("gradient").children("sad").render(),r.ShinyButton.props().attr("quirky").attr("gradient").children("quirky").render(),r.ShinyButton.props().attr("plain").children("plain").render()]}]});var ns=N(),is=N(),as=N(),ls=`
751
- shiny-drawer {
758
+ [view="shiny-drawer"] {
752
759
  --button-size: 2em;
753
760
  --anim-duration: 200ms;
754
761
  --slate-hidden-opacity: 1;
@@ -758,6 +765,11 @@ slot[part="tabs"] {
758
765
  transparent,
759
766
  var(--bg)
760
767
  );
768
+ --slate-bg: linear-gradient(
769
+ to top right,
770
+ color-mix(in oklab, var(--calm), #222 50%),
771
+ color-mix(in oklab, var(--calm), #888 50%)
772
+ );
761
773
  }
762
774
  `,Er=r=>({label:r,explain:h`<p>slide-out panel. button optional.</p>`,snippets:[{label:"html",code:`
763
775
  <shiny-drawer button side=${r}>