@e280/shiny 0.1.0-10 → 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 (114) hide show
  1. package/README.md +13 -8
  2. package/package.json +3 -3
  3. package/s/components/button/component.ts +30 -0
  4. package/s/components/button/showcase.ts +119 -0
  5. package/s/components/button/style.css.ts +63 -0
  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/raw-components.ts +2 -0
  12. package/s/components/tabs/component.ts +13 -2
  13. package/s/components/tabs/control.ts +3 -3
  14. package/s/components/tabs/showcase.ts +73 -0
  15. package/s/components/tabs/style.css.ts +38 -1
  16. package/s/demo/demo.bundle.ts +14 -199
  17. package/s/demo/demo.css +1 -0
  18. package/s/demo/lipsum.ts +6 -0
  19. package/s/demo/utils/lipsum.ts +1 -1
  20. package/s/demo/views/demonstration/style.css.ts +8 -0
  21. package/s/demo/views/demonstration/view.ts +10 -6
  22. package/s/demo/views/exhibit/style.css.ts +82 -0
  23. package/s/demo/views/exhibit/view.ts +59 -0
  24. package/s/demo/views/showcase/style.css.ts +50 -0
  25. package/s/demo/views/showcase/view.ts +54 -0
  26. package/s/demo/viewsets.ts +12 -0
  27. package/s/index.html.ts +4 -7
  28. package/s/themes/aura.css.ts +52 -14
  29. package/s/themes/infra/css-vars.ts +19 -6
  30. package/s/themes/plain.css.ts +0 -1
  31. package/x/components/button/component.d.ts +6 -0
  32. package/x/components/button/component.js +25 -0
  33. package/x/components/button/component.js.map +1 -0
  34. package/x/components/button/showcase.d.ts +1 -0
  35. package/x/components/button/showcase.js +116 -0
  36. package/x/components/button/showcase.js.map +1 -0
  37. package/x/components/button/style.css.d.ts +2 -0
  38. package/x/components/button/style.css.js +62 -0
  39. package/x/components/button/style.css.js.map +1 -0
  40. package/x/components/copy/component.d.ts +2 -2
  41. package/x/components/copy/component.js +3 -1
  42. package/x/components/copy/component.js.map +1 -1
  43. package/x/components/copy/showcase.d.ts +1 -0
  44. package/x/components/copy/showcase.js +48 -0
  45. package/x/components/copy/showcase.js.map +1 -0
  46. package/x/components/drawer/component.d.ts +3 -3
  47. package/x/components/drawer/component.js +28 -31
  48. package/x/components/drawer/component.js.map +1 -1
  49. package/x/components/drawer/showcase.d.ts +1 -0
  50. package/x/components/drawer/showcase.js +87 -0
  51. package/x/components/drawer/showcase.js.map +1 -0
  52. package/x/components/drawer/style.css.js +9 -4
  53. package/x/components/drawer/style.css.js.map +1 -1
  54. package/x/components/example/component.d.ts +1 -1
  55. package/x/components/raw-components.d.ts +2 -0
  56. package/x/components/raw-components.js +2 -0
  57. package/x/components/raw-components.js.map +1 -1
  58. package/x/components/tabs/component.d.ts +1 -1
  59. package/x/components/tabs/component.js +13 -2
  60. package/x/components/tabs/component.js.map +1 -1
  61. package/x/components/tabs/control.d.ts +1 -1
  62. package/x/components/tabs/control.js +3 -3
  63. package/x/components/tabs/control.js.map +1 -1
  64. package/x/components/tabs/showcase.d.ts +1 -0
  65. package/x/components/tabs/showcase.js +69 -0
  66. package/x/components/tabs/showcase.js.map +1 -0
  67. package/x/components/tabs/style.css.js +38 -1
  68. package/x/components/tabs/style.css.js.map +1 -1
  69. package/x/demo/demo.bundle.js +14 -193
  70. package/x/demo/demo.bundle.js.map +1 -1
  71. package/x/demo/demo.bundle.min.js +497 -311
  72. package/x/demo/demo.bundle.min.js.map +4 -4
  73. package/x/demo/demo.css +1 -0
  74. package/x/demo/lipsum.d.ts +2 -0
  75. package/x/demo/lipsum.js +4 -0
  76. package/x/demo/lipsum.js.map +1 -0
  77. package/x/demo/utils/lipsum.js +1 -1
  78. package/x/demo/views/demonstration/style.css.js +8 -0
  79. package/x/demo/views/demonstration/style.css.js.map +1 -1
  80. package/x/demo/views/demonstration/view.js +8 -6
  81. package/x/demo/views/demonstration/view.js.map +1 -1
  82. package/x/demo/views/exhibit/style.css.d.ts +2 -0
  83. package/x/demo/views/exhibit/style.css.js +81 -0
  84. package/x/demo/views/exhibit/style.css.js.map +1 -0
  85. package/x/demo/views/exhibit/view.d.ts +29 -0
  86. package/x/demo/views/exhibit/view.js +38 -0
  87. package/x/demo/views/exhibit/view.js.map +1 -0
  88. package/x/demo/views/showcase/style.css.d.ts +2 -0
  89. package/x/demo/views/showcase/style.css.js +49 -0
  90. package/x/demo/views/showcase/style.css.js.map +1 -0
  91. package/x/demo/views/showcase/view.d.ts +7 -0
  92. package/x/demo/views/showcase/view.js +40 -0
  93. package/x/demo/views/showcase/view.js.map +1 -0
  94. package/x/demo/{aura-views.d.ts → viewsets.d.ts} +5 -2
  95. package/x/demo/viewsets.js +9 -0
  96. package/x/demo/viewsets.js.map +1 -0
  97. package/x/index.html +5 -4
  98. package/x/index.html.js +4 -7
  99. package/x/index.html.js.map +1 -1
  100. package/x/install/aura.bundle.min.js +210 -65
  101. package/x/install/aura.bundle.min.js.map +4 -4
  102. package/x/install/plain.bundle.min.js +159 -53
  103. package/x/install/plain.bundle.min.js.map +4 -4
  104. package/x/shiny.d.ts +8 -3
  105. package/x/themes/aura.css.js +52 -14
  106. package/x/themes/aura.css.js.map +1 -1
  107. package/x/themes/infra/css-vars.d.ts +6 -2
  108. package/x/themes/infra/css-vars.js +7 -3
  109. package/x/themes/infra/css-vars.js.map +1 -1
  110. package/x/themes/plain.css.js +0 -1
  111. package/x/themes/plain.css.js.map +1 -1
  112. package/s/demo/aura-views.ts +0 -6
  113. package/x/demo/aura-views.js +0 -4
  114. package/x/demo/aura-views.js.map +0 -1
@@ -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
+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;;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;
@@ -1,8 +1,10 @@
1
+ import { ShinyButton } from "./button/component.js";
1
2
  import { ShinyCopy } from "./copy/component.js";
2
3
  import { ShinyDrawer } from "./drawer/component.js";
3
4
  import { ShinyExample } from "./example/component.js";
4
5
  import { ShinyTabs } from "./tabs/component.js";
5
6
  export declare const rawComponents: {
7
+ ShinyButton: typeof ShinyButton;
6
8
  ShinyCopy: typeof ShinyCopy;
7
9
  ShinyDrawer: typeof ShinyDrawer;
8
10
  ShinyExample: typeof ShinyExample;
@@ -1,8 +1,10 @@
1
+ import { ShinyButton } from "./button/component.js";
1
2
  import { ShinyCopy } from "./copy/component.js";
2
3
  import { ShinyDrawer } from "./drawer/component.js";
3
4
  import { ShinyExample } from "./example/component.js";
4
5
  import { ShinyTabs } from "./tabs/component.js";
5
6
  export const rawComponents = {
7
+ ShinyButton,
6
8
  ShinyCopy,
7
9
  ShinyDrawer,
8
10
  ShinyExample,
@@ -1 +1 @@
1
- {"version":3,"file":"raw-components.js","sourceRoot":"","sources":["../../s/components/raw-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,SAAS;IACT,WAAW;IACX,YAAY;IACZ,SAAS;CACT,CAAA"}
1
+ {"version":3,"file":"raw-components.js","sourceRoot":"","sources":["../../s/components/raw-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,WAAW;IACX,SAAS;IACT,WAAW;IACX,YAAY;IACZ,SAAS;CACT,CAAA"}
@@ -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;
@@ -21,10 +21,21 @@ export class ShinyTabs extends (view(use => (context, controlOption) => {
21
21
  }
22
22
  attrs.index = control.$index();
23
23
  control.length = $tabs().length;
24
+ function isNeighborActive(index, delta) {
25
+ const nextIndex = control.clamp(index + delta);
26
+ if (nextIndex === index)
27
+ return false;
28
+ return (nextIndex === control.index);
29
+ }
24
30
  for (const [index, tab] of $tabs().entries()) {
25
31
  const active = (index === control.index);
26
- dom.attrs(tab).booleans.active = active;
27
- dom.attrs(tab).booleans.disabled = active;
32
+ const tabAttrs = dom.attrs(tab);
33
+ tabAttrs.booleans.disabled = active;
34
+ tabAttrs.booleans["data-active"] = active;
35
+ tabAttrs.booleans["data-first"] = (index === 0);
36
+ tabAttrs.booleans["data-last"] = (index === (control.length - 1));
37
+ tabAttrs.booleans["data-next-is-active"] = isNeighborActive(index, 1);
38
+ tabAttrs.booleans["data-previous-is-active"] = isNeighborActive(index, -1);
28
39
  tab.onclick = () => control.setIndex(index);
29
40
  }
30
41
  for (const [index, tab] of $panels().entries()) {
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/tabs/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,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,OAAO,SAAU,SAAQ,CAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,aAA0B,EAAE,EAAE;IACjE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACtB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAElD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAA;IACjF,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAgB,EAAE,CAAC,CAAA;IAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAgB,EAAE,CAAC,CAAA;IAE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,CAAC;KACD,SAAS,CAAC,KAAM,SAAQ,YAAY;IACpC,OAAO,GAAG,IAAI,UAAU,EAAE,CAAA;IAC1B,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAA,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAA,CAAC,CAAC;IAC3C,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACnD,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;CAC/C,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAU,CAAC,CAC/C;CAAG"}
@@ -1,8 +1,8 @@
1
1
  export declare class TabControl {
2
- #private;
3
2
  length: number;
4
3
  $index: import("@e280/strata").SignalFn<number>;
5
4
  constructor(start?: number);
5
+ clamp(index: number): number;
6
6
  get index(): number;
7
7
  setIndex(index: number): Promise<number>;
8
8
  shimmy(delta: number): Promise<number>;
@@ -5,19 +5,19 @@ export class TabControl {
5
5
  constructor(start = 0) {
6
6
  this.$index.value = start;
7
7
  }
8
- #clamp(index) {
8
+ clamp(index) {
9
9
  index = Math.min(index, this.length - 1);
10
10
  index = Math.max(index, 0);
11
11
  return index;
12
12
  }
13
13
  get index() {
14
- return this.#clamp(this.$index.get());
14
+ return this.clamp(this.$index.get());
15
15
  }
16
16
  async setIndex(index) {
17
17
  return this.$index.set(index);
18
18
  }
19
19
  async shimmy(delta) {
20
- const index = this.#clamp(this.index + delta);
20
+ const index = this.clamp(this.index + delta);
21
21
  return this.setIndex(index);
22
22
  }
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control.js","sourceRoot":"","sources":["../../../s/components/tabs/control.ts"],"names":[],"m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KAAK,CAAC,KAAa;QAClB,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;QACxC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAC1B,OAAO,KAAK,CAAA;IACb,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAa;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAa;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;QAC5C,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC;CACD"}
@@ -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,CAAC,EAAE,CAAC,IAAI,CAAA;MACxB,KAAK,CAAC,SAAS;iBACf,KAAK,EAAE;iBACP,QAAQ,CAAC,IAAI,CAAA;QACX,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;QACnD,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;QACnD,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE;mCACxB,IAAI;mCACJ,IAAI;mCACJ,IAAI;MACjC,CAAC;iBACD,MAAM,EAAE;IACV;SACD;KACD;CACD,CAAC,CAAA"}
@@ -1,5 +1,42 @@
1
1
  import { css } from "lit";
2
2
  export default css `@layer view {
3
3
 
4
- }`;
4
+ :host {
5
+ display: inline-flex;
6
+ flex-direction: column;
7
+ }
8
+
9
+ slot[part="tabs"] {
10
+ display: flex;
11
+
12
+ &::slotted(*) {
13
+ border-radius: 0.3em;
14
+ }
15
+
16
+ &::slotted([data-active]) {
17
+ opacity: 1;
18
+ color: currentColor;
19
+ text-decoration: underline;
20
+ }
21
+
22
+ &::slotted(:not([data-last], [data-next-is-active])) {
23
+ border-right: none;
24
+ }
25
+
26
+ &::slotted([data-active]:not([data-first])) {
27
+ border-left: none;
28
+ }
29
+
30
+ &::slotted(:not([data-last])) {
31
+ border-top-right-radius: 0;
32
+ border-bottom-right-radius: 0;
33
+ }
34
+
35
+ &::slotted(:not([data-first])) {
36
+ border-top-left-radius: 0;
37
+ border-bottom-left-radius: 0;
38
+ }
39
+ }
40
+
41
+ } `;
5
42
  //# sourceMappingURL=style.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/tabs/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;EAEhB,CAAA"}
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/tabs/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCf,CAAA"}
@@ -1,22 +1,10 @@
1
- import { css, html } from "lit";
1
+ import { css } from "lit";
2
2
  import { dom, view } from "@e280/sly";
3
- import { shiny } from "../shiny.js";
4
- import { auraViews } from "./aura-views.js";
5
- import { plain } from "../themes/plain.css.js";
6
- import { makeLipsumDispenser } from "./utils/lipsum.js";
7
- import { TabControl } from "../components/tabs/control.js";
8
- import { Demonstration } from "./views/demonstration/view.js";
9
- const viewsets = [
10
- { label: "aura", views: auraViews },
11
- { label: "plain", views: shiny({ theme: plain }).views },
12
- ];
13
- const labels = {
14
- html: { button: "html", text: "html web component" },
15
- view: { button: "view", text: "sly view" },
16
- css: { button: "css", text: "custom css" },
17
- };
18
- const dispenser = makeLipsumDispenser();
19
- const lipsum = () => dispenser.takeFirst();
3
+ import { lipsumDispenser } from "./lipsum.js";
4
+ import { copyShowcase } from "../components/copy/showcase.js";
5
+ import { tabsShowcase } from "../components/tabs/showcase.js";
6
+ import { buttonShowcase } from "../components/button/showcase.js";
7
+ import { drawerShowcase } from "../components/drawer/showcase.js";
20
8
  dom.register({ ShinyDemo: view.component(use => {
21
9
  use.styles(css `
22
10
  :host {
@@ -37,185 +25,18 @@ dom.register({ ShinyDemo: view.component(use => {
37
25
  font-style: italic;
38
26
  }
39
27
 
40
- [view="shiny-tabs"] {
28
+ [view="demo-tabs"] {
41
29
  display: flex;
42
30
  }
43
31
  }
44
32
  `);
45
- const tabControl = use.once(() => new TabControl(0));
46
- const $viewset = use.derived(() => viewsets.at(tabControl.$index()));
47
- const views = $viewset().views;
48
- dispenser.takeAll();
49
- const demonstrations = [
50
- Demonstration({
51
- name: "shiny-copy",
52
- explain: html `
53
- <p>click-to-copy text button.</p>
54
- `,
55
- snippets: [
56
- [labels.html, `
57
- <shiny-copy text="hello world"></shiny-copy>
58
- `],
59
- [labels.view, `
60
- ShinyCopy("hello world")
61
- `],
62
- [labels.css, `
63
- shiny-copy {
64
- font-size: 1em;
65
- --happy: #0fa;
66
- --angry: #f50;
67
- --lame: #8888;
68
- --inactive-opacity: 0.5;
69
- }
70
- `],
71
- ],
72
- content: views.ShinyCopy("hello world"),
73
- style: css `
74
- .content sly-view {
75
- font-size: 4em;
76
- }
77
- `,
78
- }),
79
- Demonstration({
80
- name: "shiny-drawer",
81
- explain: html `
82
- <p>slide-out panel. button optional.</p>
83
- `,
84
- snippets: [
85
- [labels.html, `
86
- <shiny-drawer button side=left>
87
- <header>example</header>
88
- <section slot=plate>
89
- lorem kettlebell..
90
- </section>
91
- </shiny-drawer>
92
- `],
93
- [labels.view, `
94
- ShinyDrawer
95
- .props({button: true, side: "left"})
96
- .children(html\`
97
- <header>example</header>
98
- <section slot=plate>
99
- lorem kettlebell..
100
- </section>
101
- \`)
102
- .render()
103
- `],
104
- [labels.css, `
105
- shiny-drawer {
106
- --button-size: 2em;
107
- --anim-duration: 200ms;
108
- --blanket-backdrop-filter: blur(0.5em);
109
- --blanket-bg: color-mix(
110
- in oklab,
111
- transparent,
112
- var(--bg)
113
- );
114
- }
115
- `],
116
- ],
117
- content: views.ShinyDrawer
118
- .props({ button: true })
119
- .children(html `
120
- <header>
121
- <h2>example drawer</h2>
122
- <p>you can put any content in here.</p>
123
- <p class=lipsum>${lipsum()}</p>
124
- </header>
125
- <section slot=plate>
126
- <p class=lipsum>${lipsum()}</p>
127
- <p class=lipsum>${lipsum()}</p>
128
- </section>
129
- `)
130
- .render(),
131
- style: css `
132
- .content sly-view {
133
- border-radius: 0.5em;
134
- overflow: hidden;
135
- --button-size: 3em;
136
-
137
- header {
138
- > * + * { margin-top: 0.5em; }
139
- }
140
-
141
- section {
142
- display: flex;
143
- flex-direction: column;
144
- justify-content: center;
145
- min-height: 100%;
146
- padding: 1em;
147
- padding-top: 3em;
148
- > * + * { margin-top: 0.5em; }
149
- }
150
- }
151
- `,
152
- }),
153
- Demonstration({
154
- name: "shiny-tabs",
155
- explain: html `
156
- <p>button bar. panels optional.</p>
157
- `,
158
- snippets: [
159
- [labels.html, `
160
- <shiny-tabs>
161
- <button>tab1</button>
162
- <button>tab2</button>
163
- <button>tab3</button>
164
- <div slot=panel>panel1</div>
165
- <div slot=panel>panel2</div>
166
- <div slot=panel>panel3</div>
167
- </shiny-tabs>
168
- `],
169
- [labels.view, `
170
- ShinyTabs
171
- .props()
172
- .children(html\`
173
- <button>tab1</button>
174
- <button>tab2</button>
175
- <button>tab3</button>
176
- <div slot=panel>panel1</div>
177
- <div slot=panel>panel2</div>
178
- <div slot=panel>panel3</div>
179
- \`)
180
- .render()
181
- `],
182
- [labels.css, `
183
- shiny-tabs::part(tabs) {}
184
- shiny-tabs::part(panels) {}
185
- `],
186
- ],
187
- content: views.ShinyTabs
188
- .props()
189
- .children(html `
190
- <button>tab1</button>
191
- <button>tab2</button>
192
- <button>tab3</button>
193
- <p slot=panel class=lipsum>${lipsum()}</p>
194
- <p slot=panel class=lipsum>${lipsum()}</p>
195
- <p slot=panel class=lipsum>${lipsum()}</p>
196
- `)
197
- .render(),
198
- style: css `
199
- .content {
200
- justify-content: start;
201
- p { margin-top: 0.5em; }
202
- }
203
- `,
204
- }),
33
+ lipsumDispenser.takeAll();
34
+ return [
35
+ buttonShowcase(),
36
+ copyShowcase(),
37
+ drawerShowcase(),
38
+ tabsShowcase(),
205
39
  ];
206
- return html `
207
- <div class=themes>
208
- <span>theme</span>
209
- ${auraViews.ShinyTabs
210
- .props(tabControl)
211
- .children(viewsets.map(viewset => html `
212
- <button>${viewset.label}</button>
213
- `))
214
- .render()}
215
- </div>
216
-
217
- ${demonstrations}
218
- `;
219
40
  }) });
220
- console.log("✨shiny");
41
+ console.log("✨shiny");
221
42
  //# sourceMappingURL=demo.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"demo.bundle.js","sourceRoot":"","sources":["../../s/demo/demo.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAA;AAC7B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AACjC,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAA;AAE3D,MAAM,QAAQ,GAAG;IAChB,EAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAC;IACjC,EAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAC,KAAK,EAAC;CACpD,CAAA;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