@e280/shiny 0.1.0-3 → 0.1.0-5

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 (88) hide show
  1. package/README.md +26 -7
  2. package/package.json +1 -1
  3. package/s/{ui → components}/copy/style.css.ts +1 -1
  4. package/s/components/drawer/component.ts +82 -0
  5. package/s/components/drawer/drawer.ts +31 -0
  6. package/s/components/drawer/style.css.ts +118 -0
  7. package/s/{ui → components}/example/component.ts +1 -0
  8. package/s/{ui → components}/raw-components.ts +2 -0
  9. package/s/demo/demo.bundle.ts +116 -9
  10. package/s/demo/utils/lipsum.ts +19 -0
  11. package/s/demo/views/demonstration/style.css.ts +1 -0
  12. package/s/demo/views/demonstration/view.ts +5 -6
  13. package/s/icons/tabler/menu-2.svg.ts +4 -0
  14. package/s/icons/tabler/x.svg.ts +4 -0
  15. package/s/index.ts +3 -3
  16. package/s/{install.bundle.ts → install/basic.bundle.ts} +2 -2
  17. package/s/shiny.ts +2 -2
  18. package/s/themes/basic.css.ts +3 -0
  19. package/x/components/copy/component.js.map +1 -0
  20. package/x/{ui → components}/copy/style.css.js +1 -1
  21. package/x/components/copy/style.css.js.map +1 -0
  22. package/x/components/drawer/component.d.ts +383 -0
  23. package/x/components/drawer/component.js +69 -0
  24. package/x/components/drawer/component.js.map +1 -0
  25. package/x/components/drawer/drawer.d.ts +9 -0
  26. package/x/components/drawer/drawer.js +24 -0
  27. package/x/components/drawer/drawer.js.map +1 -0
  28. package/x/components/drawer/style.css.js +117 -0
  29. package/x/components/drawer/style.css.js.map +1 -0
  30. package/x/{ui → components}/example/component.js +1 -0
  31. package/x/components/example/component.js.map +1 -0
  32. package/x/components/example/style.css.d.ts +2 -0
  33. package/x/components/example/style.css.js.map +1 -0
  34. package/x/components/framework.js.map +1 -0
  35. package/x/{ui → components}/raw-components.d.ts +2 -0
  36. package/x/{ui → components}/raw-components.js +2 -0
  37. package/x/components/raw-components.js.map +1 -0
  38. package/x/demo/demo.bundle.js +112 -9
  39. package/x/demo/demo.bundle.js.map +1 -1
  40. package/x/demo/demo.bundle.min.js +247 -30
  41. package/x/demo/demo.bundle.min.js.map +4 -4
  42. package/x/demo/utils/lipsum.d.ts +2 -0
  43. package/x/demo/utils/lipsum.js +11 -0
  44. package/x/demo/utils/lipsum.js.map +1 -0
  45. package/x/demo/views/demonstration/style.css.js +1 -0
  46. package/x/demo/views/demonstration/style.css.js.map +1 -1
  47. package/x/demo/views/demonstration/view.d.ts +3 -2
  48. package/x/demo/views/demonstration/view.js +2 -3
  49. package/x/demo/views/demonstration/view.js.map +1 -1
  50. package/x/icons/tabler/menu-2.svg.d.ts +2 -0
  51. package/x/icons/tabler/menu-2.svg.js +3 -0
  52. package/x/icons/tabler/menu-2.svg.js.map +1 -0
  53. package/x/icons/tabler/x.svg.d.ts +2 -0
  54. package/x/icons/tabler/x.svg.js +3 -0
  55. package/x/icons/tabler/x.svg.js.map +1 -0
  56. package/x/index.d.ts +3 -3
  57. package/x/index.html +2 -2
  58. package/x/index.js +3 -3
  59. package/x/index.js.map +1 -1
  60. package/x/install/basic.bundle.js +5 -0
  61. package/x/install/basic.bundle.js.map +1 -0
  62. package/x/{install.bundle.min.js → install/basic.bundle.min.js} +158 -15
  63. package/x/{install.bundle.min.js.map → install/basic.bundle.min.js.map} +4 -4
  64. package/x/shiny.d.ts +14 -1
  65. package/x/shiny.js +1 -1
  66. package/x/shiny.js.map +1 -1
  67. package/x/themes/basic.css.js +3 -0
  68. package/x/themes/basic.css.js.map +1 -1
  69. package/x/install.bundle.js +0 -5
  70. package/x/install.bundle.js.map +0 -1
  71. package/x/ui/copy/component.js.map +0 -1
  72. package/x/ui/copy/style.css.js.map +0 -1
  73. package/x/ui/example/component.js.map +0 -1
  74. package/x/ui/example/style.css.js.map +0 -1
  75. package/x/ui/framework.js.map +0 -1
  76. package/x/ui/raw-components.js.map +0 -1
  77. /package/s/{ui → components}/copy/component.ts +0 -0
  78. /package/s/{ui → components}/example/style.css.ts +0 -0
  79. /package/s/{ui → components}/framework.ts +0 -0
  80. /package/x/{ui → components}/copy/component.d.ts +0 -0
  81. /package/x/{ui → components}/copy/component.js +0 -0
  82. /package/x/{ui → components}/copy/style.css.d.ts +0 -0
  83. /package/x/{ui/example → components/drawer}/style.css.d.ts +0 -0
  84. /package/x/{ui → components}/example/component.d.ts +0 -0
  85. /package/x/{ui → components}/example/style.css.js +0 -0
  86. /package/x/{ui → components}/framework.d.ts +0 -0
  87. /package/x/{ui → components}/framework.js +0 -0
  88. /package/x/{install.bundle.d.ts → install/basic.bundle.d.ts} +0 -0
@@ -0,0 +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;AAEnD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,SAAS;IACT,WAAW;IACX,YAAY;CACZ,CAAA"}
@@ -2,8 +2,18 @@ import { css, html } from "lit";
2
2
  import { dom, view } from "@e280/sly";
3
3
  import { shiny } from "../shiny.js";
4
4
  import { basic } from "../themes/basic.css.js";
5
+ import { makeLipsumDispenser } from "./utils/lipsum.js";
5
6
  import { Demonstration } from "./views/demonstration/view.js";
6
7
  const { views } = shiny({ theme: basic });
8
+ const labels = {
9
+ html: "html web component",
10
+ view: "sly view",
11
+ css: "custom css",
12
+ };
13
+ const lipsum = (() => {
14
+ const dispenser = makeLipsumDispenser();
15
+ return () => dispenser.takeRandom();
16
+ })();
7
17
  dom.register({ ShinyDemo: view.component(use => {
8
18
  use.styles(css `
9
19
  :host {
@@ -11,10 +21,6 @@ dom.register({ ShinyDemo: view.component(use => {
11
21
  flex-direction: column;
12
22
  gap: 1em;
13
23
  }
14
-
15
- [view="shiny-copy"]::part(content) {
16
- font-size: 4em;
17
- }
18
24
  `);
19
25
  return [
20
26
  Demonstration({
@@ -23,13 +29,110 @@ dom.register({ ShinyDemo: view.component(use => {
23
29
  explain: html `
24
30
  <p>button for click-to-copy text</p>
25
31
  `,
26
- exampleComponent: `
27
- <shiny-copy text="hello world"></shiny-copy>
32
+ snippets: [
33
+ [labels.html, `
34
+ <shiny-copy text="hello world"></shiny-copy>
35
+ `],
36
+ [labels.view, `
37
+ ShinyCopy("hello world")
38
+ `],
39
+ [labels.css, `
40
+ shiny-copy {
41
+ font-size: 1em;
42
+ --good: #0f4;
43
+ --bad: #f40;
44
+ --invalid: #8888;
45
+ --inactive-opacity: 0.5;
46
+ }
47
+ `],
48
+ ],
49
+ content: views.ShinyCopy("hello world"),
50
+ style: css `
51
+ .content sly-view {
52
+ font-size: 4em;
53
+ }
54
+ `,
55
+ }),
56
+ Demonstration({
57
+ views,
58
+ name: "shiny-drawer",
59
+ explain: html `
60
+ <p>slide-out panel with optional burger button</p>
28
61
  `,
29
- exampleView: `
30
- ShinyCopy("hello world")
62
+ snippets: [
63
+ [labels.html, `
64
+ <shiny-drawer button side=left>
65
+ <header>example</header>
66
+ <section slot=plate>lorem kettlebell..</section>
67
+ </shiny-drawer>
68
+ `],
69
+ [labels.view, `
70
+ ShinyDrawer
71
+ .props({button: true, side: "left"})
72
+ .children(html\`
73
+ <header>example</header>
74
+ <section slot=plate>lorem kettlebell..</section>
75
+ \`)
76
+ .render()
77
+ `],
78
+ [labels.css, `
79
+ shiny-drawer {
80
+ --button-size: 2em;
81
+ --drawer-height: auto;
82
+ --anim-duration: 200ms;
83
+ --blanket-bg: #1118;
84
+ --blanket-backdrop-filter: blur(0.5em);
85
+ --inactive-opacity: 0.5;
86
+ }
87
+ `],
88
+ ],
89
+ content: views.ShinyDrawer
90
+ .props({ button: true })
91
+ .children(html `
92
+ <header>
93
+ <h2>example drawer</h2>
94
+ <p>you can put any content in here.</p>
95
+ <p class=lipsum>${lipsum()}</p>
96
+ </header>
97
+ <section slot=plate>
98
+ <p class=lipsum>${lipsum()}</p>
99
+ </section>
100
+ `)
101
+ .render(),
102
+ style: css `
103
+ .content sly-view {
104
+ border-radius: 0.5em;
105
+ overflow: hidden;
106
+ --button-size: 3em;
107
+
108
+ p.lipsum {
109
+ opacity: 0.7;
110
+ font-family: serif;
111
+ font-style: italic;
112
+ }
113
+
114
+ header {
115
+ padding: 0.5em;
116
+ border-bottom-right-radius: 0.5em;
117
+ background: linear-gradient(
118
+ to top right,
119
+ #00a9dd69,
120
+ #70ffd77a
121
+ );
122
+ > * + * { margin-top: 0.5em; }
123
+ }
124
+
125
+ section {
126
+ display: flex;
127
+ flex-direction: column;
128
+ justify-content: center;
129
+ min-height: 100%;
130
+ padding: 1em;
131
+ padding-top: 3em;
132
+ > * + * { margin-top: 0.5em; }
133
+ }
134
+ }
31
135
  `,
32
- content: views.ShinyCopy("hello world"),
33
136
  }),
34
137
  ];
35
138
  }) });
@@ -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,KAAK,EAAC,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,+BAA+B,CAAA;AAE3D,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,EAAC,KAAK,EAAE,KAAK,EAAC,CAAC,CAAA;AAErC,GAAG,CAAC,QAAQ,CAAC,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;QAC7C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;EAUb,CAAC,CAAA;QAEF,OAAO;YACN,aAAa,CAAC;gBAC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