@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,5 +1,6 @@
1
+ import { Content } from "@e280/sly";
1
2
  import { ShinyContext, ShinyElement } from "../framework.js";
2
- declare const ShinyButton_base: import("@e280/sly").ComponentClass<typeof ShinyElement, [context: ShinyContext]>;
3
+ declare const ShinyButton_base: import("@e280/sly").ComponentClass<typeof ShinyElement, [context: ShinyContext, content?: Content]>;
3
4
  export declare class ShinyButton extends ShinyButton_base {
4
5
  }
5
6
  export {};
@@ -3,7 +3,7 @@ import { 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 ShinyButton extends (view(use => (context) => {
6
+ export class ShinyButton extends (view(use => (context, content) => {
7
7
  use.name("shiny-button");
8
8
  use.styles(foundationCss, context.theme, styleCss);
9
9
  const attrs = use.attrs.spec({
@@ -15,7 +15,7 @@ export class ShinyButton extends (view(use => (context) => {
15
15
  part=button
16
16
  ?disabled="${attrs.disabled}"
17
17
  ?hidden="${attrs.hidden}">
18
- <slot></slot>
18
+ <slot>${content}</slot>
19
19
  </button>
20
20
  `;
21
21
  })
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/button/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,IAAI,EAAC,MAAM,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AM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAElD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5B,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,OAAO;KACf,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;;;iBAGI,KAAK,CAAC,QAAQ;eAChB,KAAK,CAAC,MAAM;aACd,OAAO;;GAEjB,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,YAAY,CAAC;KACvB,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAU,CAAC,CACnC;CAAG"}
@@ -0,0 +1 @@
1
+ export declare const buttonShowcase: () => import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -0,0 +1,116 @@
1
+ import { css, html } from "lit";
2
+ import { Showcase } from "../../demo/views/showcase/view.js";
3
+ const cssSnippet = `
4
+ shiny-button {
5
+ --padding: 0.3em;
6
+ font-size: 1em;
7
+ color: currentColor;
8
+ background: transparent;
9
+ }
10
+ `;
11
+ export const buttonShowcase = () => Showcase({
12
+ name: "button",
13
+ style: css `
14
+ .box {
15
+ > * { font-size: 1.5em; }
16
+ }
17
+ `,
18
+ exhibits: [
19
+ {
20
+ label: "basic",
21
+ explain: html `<p>clicky-clacky pressy button.</p>`,
22
+ snippets: [
23
+ { label: "html", code: `<shiny-button>button</shiny-button>` },
24
+ { label: "view", code: `ShinyButton("button")` },
25
+ { label: "css", code: cssSnippet },
26
+ ],
27
+ style: css ``,
28
+ presentation: views => html `
29
+ ${views.ShinyButton.props().children("button").render()}
30
+ `,
31
+ },
32
+ {
33
+ label: "gradient",
34
+ explain: html `<p>added <code>gradient</code> attribute.</p>`,
35
+ snippets: [
36
+ { label: "html", code: `<shiny-button gradient>button</shiny-button>` },
37
+ { label: "view", code: `
38
+ ShinyButton
39
+ .props("button")
40
+ .attr("gradient")
41
+ .render()
42
+ ` },
43
+ { label: "css", code: cssSnippet },
44
+ ],
45
+ style: css ``,
46
+ presentation: views => html `
47
+ ${views.ShinyButton.props().attr("gradient").children("button").render()}
48
+ `,
49
+ },
50
+ {
51
+ label: "catalog",
52
+ explain: html `<p>clicky-clacky pressy buttons.</p>`,
53
+ snippets: [
54
+ { label: "html", code: `
55
+ <shiny-button calm gradient>calm</shiny-button>
56
+ <shiny-button angry gradient>angry</shiny-button>
57
+ <shiny-button happy gradient>happy</shiny-button>
58
+ <shiny-button zesty gradient>zesty</shiny-button>
59
+ <shiny-button sad gradient>sad</shiny-button>
60
+ <shiny-button quirky gradient>quirky</shiny-button>
61
+ <shiny-button plain gradient>plain</shiny-button>
62
+ ` },
63
+ { label: "view", code: `
64
+ [
65
+ ShinyButton.props().attr("calm").attr("gradient").children("calm").render(),
66
+ ShinyButton.props().attr("angry").attr("gradient").children("angry").render(),
67
+ ShinyButton.props().attr("happy").attr("gradient").children("happy").render(),
68
+ ShinyButton.props().attr("zesty").attr("gradient").children("zesty").render(),
69
+ ShinyButton.props().attr("sad").attr("gradient").children("sad").render(),
70
+ ShinyButton.props().attr("quirky").attr("gradient").children("quirky").render(),
71
+ ShinyButton.props().attr("plain").children("plain").render(),
72
+ ]
73
+ ` },
74
+ { label: "css", code: cssSnippet },
75
+ ],
76
+ style: css ``,
77
+ presentation: views => [
78
+ views.ShinyButton.props()
79
+ .attr("calm")
80
+ .attr("gradient")
81
+ .children("calm")
82
+ .render(),
83
+ views.ShinyButton.props()
84
+ .attr("angry")
85
+ .attr("gradient")
86
+ .children("angry")
87
+ .render(),
88
+ views.ShinyButton.props()
89
+ .attr("happy")
90
+ .attr("gradient")
91
+ .children("happy")
92
+ .render(),
93
+ views.ShinyButton.props()
94
+ .attr("zesty")
95
+ .attr("gradient")
96
+ .children("zesty")
97
+ .render(),
98
+ views.ShinyButton.props()
99
+ .attr("sad")
100
+ .attr("gradient")
101
+ .children("sad")
102
+ .render(),
103
+ views.ShinyButton.props()
104
+ .attr("quirky")
105
+ .attr("gradient")
106
+ .children("quirky")
107
+ .render(),
108
+ views.ShinyButton.props()
109
+ .attr("plain")
110
+ .children("plain")
111
+ .render(),
112
+ ],
113
+ },
114
+ ],
115
+ });
116
+ //# sourceMappingURL=showcase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/button/showcase.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAE1D,MAAM,UAAU,GAAG;;;;;;;CAOlB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG,CAAA;;;;EAIT;IACD,QAAQ,EAAE;QACT;YACC,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,IAAI,CAAA,qCAAqC;YAClD,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,qCAAqC,EAAC;gBAC5D,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAC;gBAC9C,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC;aAChC;YACD,KAAK,EAAE,GAAG,CAAA,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;MACxB,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE;IACvD;SACD;QACD;YACC,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,IAAI,CAAA,+CAA+C;YAC5D,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,8CAA8C,EAAC;gBACrE,EAAC,KAAK,EAAE,MAAM,EAAE,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BACb,IAAI,CAAC,UAAU,CAAC;qBAChB,QAAQ,CAAC,OAAO,CAAC;qBACjB,MAAM,EAAE;gBACV,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;qBACvB,IAAI,CAAC,KAAK,CAAC;qBACX,IAAI,CAAC,UAAU,CAAC;qBAChB,QAAQ,CAAC,KAAK,CAAC;qBACf,MAAM,EAAE;gBACV,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;qBACvB,IAAI,CAAC,QAAQ,CAAC;qBACd,IAAI,CAAC,UAAU,CAAC;qBAChB,QAAQ,CAAC,QAAQ,CAAC;qBAClB,MAAM,EAAE;gBACV,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;qBACvB,IAAI,CAAC,OAAO,CAAC;qBACb,QAAQ,CAAC,OAAO,CAAC;qBACjB,MAAM,EAAE;aACV;SACD;KACD;CACD,CAAC,CAAA"}
@@ -43,7 +43,6 @@ button {
43
43
  font: inherit;
44
44
  color: inherit;
45
45
  cursor: inherit;
46
- outline: inherit;
47
46
  text-shadow: inherit;
48
47
 
49
48
  display: inline-flex;
@@ -1 +1 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/button/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DhB,CAAA"}
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/button/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DhB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { ShinyContext } from "../framework.js";
2
2
  declare const ShinyCopy_base: import("@e280/sly").ComponentClass<{
3
3
  new (): {
4
- #attrs: import("@e280/sly").AttrTypes<{
4
+ "__#private@#attrs": import("@e280/sly").AttrTypes<{
5
5
  text: StringConstructor;
6
6
  ms: NumberConstructor;
7
7
  }>;
@@ -10,7 +10,7 @@ declare const ShinyCopy_base: import("@e280/sly").ComponentClass<{
10
10
  get ms(): number | undefined;
11
11
  set ms(v: number | undefined);
12
12
  context: ShinyContext;
13
- #private: any;
13
+ "__#private@#private": any;
14
14
  readonly shadow: ShadowRoot;
15
15
  createShadow(): ShadowRoot;
16
16
  render(_use: import("@e280/sly").Use): import("@e280/sly").Content;
@@ -23,6 +23,8 @@ export class ShinyCopy extends (view(use => (context, text, ms = 1000) => {
23
23
  if (text === undefined)
24
24
  return;
25
25
  try {
26
+ if (use.attrs.booleans.fail)
27
+ throw new Error("copy failed on purpose for testing purposes");
26
28
  await navigator.clipboard.writeText(text);
27
29
  await statusFlash("good");
28
30
  }
@@ -37,7 +39,7 @@ export class ShinyCopy extends (view(use => (context, text, ms = 1000) => {
37
39
  case "invalid": return clipboardSvg;
38
40
  case "good": return clipboardCheckFilledSvg;
39
41
  case "bad": return clipboardXFilledSvg;
40
- default: throw new Error(`invalid copy status`);
42
+ default: throw new Error(`unknown copy status`);
41
43
  }
42
44
  })();
43
45
  return html `
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/copy/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAEnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC1D,OAAO,YAAY,MAAM,qCAAqC,CAAA;AAC9D,OAA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;IACF,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA,CAAC,CAAC;IACpC,IAAI,EAAE,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAA,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA,CAAC,CAAC;CAChC,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAC1C;CAAG"}
@@ -0,0 +1 @@
1
+ export declare const copyShowcase: () => import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -0,0 +1,48 @@
1
+ import { css, html } from "lit";
2
+ import { Showcase } from "../../demo/views/showcase/view.js";
3
+ const cssSnippet = `
4
+ shiny-copy {
5
+ font-size: 1em;
6
+ --happy: #0fa;
7
+ --angry: #f50;
8
+ --lame: #8888;
9
+ --inactive-opacity: 0.5;
10
+ }
11
+ `;
12
+ export const copyShowcase = () => Showcase({
13
+ name: "copy",
14
+ style: css `
15
+ .box {
16
+ > * { font-size: 4em; }
17
+ }
18
+ `,
19
+ exhibits: [
20
+ {
21
+ label: "succeed",
22
+ explain: html `<p>click-to-copy text button.</p>`,
23
+ snippets: [
24
+ { label: "html", code: `<shiny-copy text="hello world"></shiny-button>` },
25
+ { label: "view", code: `ShinyCopy("hello world")` },
26
+ { label: "css", code: cssSnippet },
27
+ ],
28
+ style: css ``,
29
+ presentation: views => html `
30
+ ${views.ShinyCopy("hello world")}
31
+ `,
32
+ },
33
+ {
34
+ label: "fail",
35
+ explain: html `<p>copy text button, deliberately fails so you can see.</p>`,
36
+ snippets: [
37
+ { label: "html", code: `<shiny-copy fail></shiny-button>` },
38
+ { label: "view", code: `ShinyCopy.props("").attr("fail").render()` },
39
+ { label: "css", code: cssSnippet },
40
+ ],
41
+ style: css ``,
42
+ presentation: views => html `
43
+ ${views.ShinyCopy.props("").attr("fail").render()}
44
+ `,
45
+ },
46
+ ],
47
+ });
48
+ //# sourceMappingURL=showcase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/copy/showcase.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAC,QAAQ,EAAC,MAAM,mCAAmC,CAAA;AAE1D,MAAM,UAAU,GAAG;;;;;;;;CAQlB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC1C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,GAAG,CAAA;;;;EAIT;IACD,QAAQ,EAAE;QACT;YACC,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,IAAI,CAAA,mCAAmC;YAChD,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gDAAgD,EAAC;gBACvE,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,EAAC;gBACjD,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC;aAChC;YACD,KAAK,EAAE,GAAG,CAAA,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;MACxB,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IAChC;SACD;QACD;YACC,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,IAAI,CAAA,6DAA6D;YAC1E,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,kCAAkC,EAAC;gBACzD,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,2CAA2C,EAAC;gBAClE,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC;aAChC;YACD,KAAK,EAAE,GAAG,CAAA,EAAE;YACZ,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA;MACxB,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;IACjD;SACD;KACD;CACD,CAAC,CAAA"}
@@ -2,7 +2,7 @@ import { DrawerControl } from "./control.js";
2
2
  import { ShinyContext } from "../framework.js";
3
3
  declare const ShinyDrawer_base: import("@e280/sly").ComponentClass<{
4
4
  new (): {
5
- #attrs: import("@e280/sly").AttrTypes<{
5
+ "__#private@#attrs": import("@e280/sly").AttrTypes<{
6
6
  open: BooleanConstructor;
7
7
  button: BooleanConstructor;
8
8
  side: StringConstructor;
@@ -17,7 +17,7 @@ declare const ShinyDrawer_base: import("@e280/sly").ComponentClass<{
17
17
  get open(): () => Promise<void>;
18
18
  get close(): () => Promise<void>;
19
19
  context: ShinyContext;
20
- #private: any;
20
+ "__#private@#private": any;
21
21
  readonly shadow: ShadowRoot;
22
22
  createShadow(): ShadowRoot;
23
23
  render(_use: import("@e280/sly").Use): import("@e280/sly").Content;
@@ -378,7 +378,7 @@ declare const ShinyDrawer_base: import("@e280/sly").ComponentClass<{
378
378
  };
379
379
  styles: import("lit").CSSResultGroup | undefined;
380
380
  }, [context: ShinyContext, options: {
381
- button: boolean;
381
+ button?: boolean;
382
382
  side?: "left" | "right";
383
383
  control?: DrawerControl;
384
384
  }]>;
@@ -11,41 +11,42 @@ export class ShinyDrawer extends (view(use => (context, options) => {
11
11
  use.name("shiny-drawer");
12
12
  use.styles(foundationCss, context.theme, styleCss);
13
13
  const states = use.once(() => new States(use.element));
14
- const side = options.side ?? "left";
15
- const drawer = use.once(() => (options.control ?? new DrawerControl()));
14
+ const button = options.button ?? use.attrs.booleans.button;
15
+ const side = options.side ?? (use.attrs.strings.side === "right" ? "right" : "left");
16
+ const control = use.once(() => (options.control ?? new DrawerControl()));
16
17
  states.assign(side);
17
18
  use.mount(() => dom.events(window, { keydown: (event) => {
18
19
  if (event.code === "Escape")
19
- drawer.close();
20
+ control.close();
20
21
  } }));
21
- dom.attrs(use.element).booleans.open = drawer.isOpen;
22
+ dom.attrs(use.element).booleans.open = control.isOpen;
23
+ function renderButton() {
24
+ return html `
25
+ <button @click="${control.toggle}">
26
+ ${control.isOpen
27
+ ? html `
28
+ <slot name=button-x>
29
+ ${xSvg}
30
+ </slot>
31
+ `
32
+ : html `
33
+ <slot name=button>
34
+ ${menu2Svg}
35
+ </slot>
36
+ `}
37
+ </button>
38
+ `;
39
+ }
22
40
  return html `
23
- <div class=shell ?data-open="${drawer.isOpen}" data-side="${side}">
24
- <slot name=plate ?inert="${drawer.isOpen}"></slot>
41
+ <div class=shell ?data-open="${control.isOpen}" data-side="${side}">
42
+ <slot name=plate ?inert="${control.isOpen}"></slot>
25
43
 
26
44
  <div class=clipper>
27
- <div part=blanket @click="${drawer.close}" ?inert="${!drawer.isOpen}"></div>
45
+ <div part=blanket @click="${control.close}" ?inert="${!control.isOpen}"></div>
28
46
 
29
47
  <div part=tray>
30
- <slot ?inert="${!drawer.isOpen}"></slot>
31
-
32
- ${options.button
33
- ? html `
34
- <button @click="${drawer.toggle}">
35
- ${drawer.isOpen
36
- ? html `
37
- <slot name=button-x>
38
- ${xSvg}
39
- </slot>
40
- `
41
- : html `
42
- <slot name=button>
43
- ${menu2Svg}
44
- </slot>
45
- `}
46
- </button>
47
- `
48
- : null}
48
+ <slot part=slate ?inert="${!control.isOpen}"></slot>
49
+ ${button ? renderButton() : null}
49
50
  </div>
50
51
  </div>
51
52
  </div>
@@ -67,10 +68,6 @@ export class ShinyDrawer extends (view(use => (context, options) => {
67
68
  get open() { return this.control.open; }
68
69
  get close() { return this.control.close; }
69
70
  })
70
- .props(el => [el.context, {
71
- control: el.control,
72
- button: el.button,
73
- side: el.side,
74
- }])) {
71
+ .props(el => [el.context, { control: el.control }])) {
75
72
  }
76
73
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/drawer/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAEnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAA;AAC5C,OAAO,IAAI,MAAM,6BAA6B,CAAA;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,QAAQ,MAAM,kCAAkC,CAAA;AACvD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,OAAO,WAAY,SAAQ,CAChC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,OAIlC,EAAE,EAAE;IAEL,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACxB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAClD,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAEtD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAA;IACnC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,aAAa,EAAE,CAAC,CAAC,CAAA;IACvE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAEnB,GA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AO,CAAC,MAAM,CAAA,CAAC,CAAC;IAC3C,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA,CAAC,CAAC;IAC3C,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA,CAAC,CAAC;CACzC,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAC,CAAU,CAAC,CAC1D;CAAG"}
@@ -0,0 +1 @@
1
+ export declare const drawerShowcase: () => import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -0,0 +1,87 @@
1
+ import { css, html } from "lit";
2
+ import { lipsum } from "../../demo/lipsum.js";
3
+ import { Showcase } from "../../demo/views/showcase/view.js";
4
+ const lip1 = lipsum();
5
+ const lip2 = lipsum();
6
+ const lip3 = lipsum();
7
+ const cssSnippet = `
8
+ shiny-drawer {
9
+ --button-size: 2em;
10
+ --anim-duration: 200ms;
11
+ --slate-hidden-opacity: 1;
12
+ --blanket-backdrop-filter: blur(0.5em);
13
+ --blanket-bg: color-mix(
14
+ in oklab,
15
+ transparent,
16
+ var(--bg)
17
+ );
18
+ }
19
+ `;
20
+ const makeExhibit = (side) => ({
21
+ label: side,
22
+ explain: html `<p>slide-out panel. button optional.</p>`,
23
+ snippets: [
24
+ { label: "html", code: `
25
+ <shiny-drawer button side=${side}>
26
+ <header>example</header>
27
+ <section slot=plate>lorem kettlebell..</section>
28
+ </shiny-drawer>
29
+ ` },
30
+ { label: "view", code: `
31
+ ShinyDrawer
32
+ .props({button: true, side: "${side}"})
33
+ .children(html\`
34
+ <header>example</header>
35
+ <section slot=plate>lorem kettlebell..</section>
36
+ \`)
37
+ .render()
38
+ ` },
39
+ { label: "css", code: cssSnippet },
40
+ ],
41
+ style: css ``,
42
+ presentation: views => html `
43
+ ${views.ShinyDrawer
44
+ .props({ button: true, side })
45
+ .children(html `
46
+ <header>
47
+ <h2>example drawer</h2>
48
+ <p>you can put any content in here.</p>
49
+ <p class=lipsum>${lip1}</p>
50
+ </header>
51
+ <section slot=plate>
52
+ <p class=lipsum>${lip2}</p>
53
+ <p class=lipsum>${lip3}</p>
54
+ </section>
55
+ `)
56
+ .render()}
57
+ `,
58
+ });
59
+ export const drawerShowcase = () => Showcase({
60
+ name: "drawer",
61
+ style: css `
62
+ .box sly-view {
63
+ border-radius: 0.5em;
64
+ overflow: hidden;
65
+ --button-size: 3em;
66
+
67
+ header {
68
+ > * + * { margin-top: 0.5em; }
69
+ }
70
+
71
+ section {
72
+ display: flex;
73
+ flex-direction: column;
74
+ justify-content: center;
75
+ min-height: 100%;
76
+ padding: 1em;
77
+ padding-top: 3em;
78
+ > * + * { margin-top: 0.5em; }
79
+ }
80
+ }
81
+ `,
82
+ exhibits: [
83
+ makeExhibit("left"),
84
+ makeExhibit("right"),
85
+ ],
86
+ });
87
+ //# sourceMappingURL=showcase.js.map
@@ -0,0 +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,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"}
@@ -6,8 +6,8 @@ export default css `@layer view {
6
6
  width: 100%;
7
7
  height: 100%;
8
8
  --button-size: 2em;
9
- --anim-duration: 200ms;
10
9
  --blanket-backdrop-filter: blur(0.5em);
10
+ --slate-hidden-opacity: 1;
11
11
  --blanket-bg: color-mix(in oklab, transparent, var(--bg));
12
12
  }
13
13
 
@@ -51,12 +51,15 @@ export default css `@layer view {
51
51
  height: auto;
52
52
  max-height: 100%;
53
53
 
54
- opacity: 1;
55
54
  transform: translateX(-100%);
56
55
  will-change: opacity, transform;
57
56
  transition: all var(--anim-duration) ease;
58
57
 
59
- > slot {
58
+ > [part="slate"] {
59
+ opacity: var(--slate-hidden-opacity);
60
+ will-change: opacity;
61
+ transition: opacity var(--anim-duration) ease;
62
+
60
63
  display: block;
61
64
  height: 100%;
62
65
  overflow-y: auto;
@@ -109,8 +112,10 @@ export default css `@layer view {
109
112
  opacity: 1;
110
113
  }
111
114
  [part="tray"] {
112
- opacity: 1;
113
115
  transform: translateX(0%);
116
+ > [part="slate"] {
117
+ opacity: 1;
118
+ }
114
119
  }
115
120
  }
116
121
  }
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoHhB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHhB,CAAA"}
@@ -5,7 +5,7 @@ declare const ShinyExample_base: import("@e280/sly").ComponentClass<{
5
5
  start: NumberConstructor;
6
6
  }>;
7
7
  context: ShinyContext;
8
- #private: any;
8
+ "__#private@#private": any;
9
9
  readonly shadow: ShadowRoot;
10
10
  createShadow(): ShadowRoot;
11
11
  render(_use: import("@e280/sly").Use): import("@e280/sly").Content;
@@ -8,7 +8,7 @@ declare const ShinyTabs_base: import("@e280/sly").ComponentClass<{
8
8
  setIndex: (index: number) => Promise<number>;
9
9
  shimmy: (delta: number) => Promise<number>;
10
10
  context: ShinyContext;
11
- #private: any;
11
+ "__#private@#private": any;
12
12
  readonly shadow: ShadowRoot;
13
13
  createShadow(): ShadowRoot;
14
14
  render(_use: import("@e280/sly").Use): import("@e280/sly").Content;
@@ -0,0 +1 @@
1
+ export declare const tabsShowcase: () => import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
@@ -0,0 +1,69 @@
1
+ import { css, html } from "lit";
2
+ import { lipsum } from "../../demo/lipsum.js";
3
+ import { Showcase } from "../../demo/views/showcase/view.js";
4
+ const lip1 = lipsum();
5
+ const lip2 = lipsum();
6
+ const lip3 = lipsum();
7
+ const cssSnippet = `
8
+ shiny-tabs {
9
+ &::part(tabs) {}
10
+ &::part(panels) {}
11
+ > shiny-button {}
12
+ }
13
+ `;
14
+ export const tabsShowcase = () => Showcase({
15
+ name: "tabs",
16
+ style: css `
17
+ .box {
18
+ place-content: start start;
19
+ p { margin-top: 0.5em; }
20
+ }
21
+ `,
22
+ exhibits: [
23
+ {
24
+ label: "tabs",
25
+ explain: html `<p>button bar. panels optional.</p>`,
26
+ snippets: [
27
+ { label: "html", code: `
28
+ <shiny-tabs>
29
+ <shiny-button>tab1</shiny-button>
30
+ <shiny-button>tab2</shiny-button>
31
+ <shiny-button>tab3</shiny-button>
32
+ <div slot=panel>panel1</div>
33
+ <div slot=panel>panel2</div>
34
+ <div slot=panel>panel3</div>
35
+ </shiny-tabs>
36
+ ` },
37
+ { label: "view", code: `
38
+ ShinyTabs
39
+ .props()
40
+ .children(html\`
41
+ \${ShinyButton.props().children("tab1").render()}
42
+ \${ShinyButton.props().children("tab2").render()}
43
+ \${ShinyButton.props().children("tab3").render()}
44
+ <div slot=panel>panel1</div>
45
+ <div slot=panel>panel2</div>
46
+ <div slot=panel>panel3</div>
47
+ \`)
48
+ .render()
49
+ ` },
50
+ { label: "css", code: cssSnippet },
51
+ ],
52
+ style: css ``,
53
+ presentation: views => html `
54
+ ${views.ShinyTabs
55
+ .props()
56
+ .children(html `
57
+ ${views.ShinyButton.props().children("tab1").render()}
58
+ ${views.ShinyButton.props().children("tab2").render()}
59
+ ${views.ShinyButton.props().children("tab3").render()}
60
+ <p slot=panel class=lipsum>${lip1}</p>
61
+ <p slot=panel class=lipsum>${lip2}</p>
62
+ <p slot=panel class=lipsum>${lip3}</p>
63
+ `)
64
+ .render()}
65
+ `,
66
+ },
67
+ ],
68
+ });
69
+ //# sourceMappingURL=showcase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"showcase.js","sourceRoot":"","sources":["../../../s/components/tabs/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;AAE1D,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AACrB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAA;AAErB,MAAM,UAAU,GAAG;;;;;;CAMlB,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;IAC1C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,GAAG,CAAA;;;;;EAKT;IACD,QAAQ,EAAE;QACT;YACC,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,IAAI,CAAA,qCAAqC;YAClD,QAAQ,EAAE;gBACT,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;;;;;;;;;KASrB,EAAC;gBACF,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;;;;;;;;;;;;KAYrB,EAAC;gBACF,EAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAC;aAChC;YACD,KAAK,EAAE,GAAG,CAAA,EAAE;YACZ,YAAY,EAAE,KAAK,CAA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