@e280/shiny 0.1.0-2 → 0.1.0-21

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 (247) hide show
  1. package/README.md +51 -63
  2. package/package.json +19 -26
  3. package/s/_archive/components/button/component.ts +30 -0
  4. package/s/_archive/components/button/showcase.ts +119 -0
  5. package/s/_archive/components/button/style.css.ts +63 -0
  6. package/s/{ui → _archive/components}/copy/component.ts +12 -5
  7. package/s/_archive/components/copy/showcase.ts +51 -0
  8. package/s/{ui → _archive/components}/copy/style.css.ts +6 -6
  9. package/s/_archive/components/drawer/component.ts +90 -0
  10. package/s/_archive/components/drawer/control.ts +31 -0
  11. package/s/_archive/components/drawer/showcase.ts +111 -0
  12. package/s/_archive/components/drawer/style.css.ts +127 -0
  13. package/s/{ui → _archive/components}/example/component.ts +6 -4
  14. package/s/_archive/components/example/showcase.ts +32 -0
  15. package/s/{ui → _archive/components}/example/style.css.ts +2 -2
  16. package/s/_archive/components/foundation.css.ts +15 -0
  17. package/s/{ui → _archive/components}/framework.ts +1 -2
  18. package/s/_archive/components/raw-components.ts +15 -0
  19. package/s/_archive/components/tabs/component.ts +70 -0
  20. package/s/_archive/components/tabs/control.ts +31 -0
  21. package/s/_archive/components/tabs/showcase.ts +171 -0
  22. package/s/_archive/components/tabs/style.css.ts +46 -0
  23. package/s/_archive/demo/demo.bundle.ts +47 -0
  24. package/s/{demo → _archive/demo}/demo.css +1 -0
  25. package/s/_archive/demo/lipsum.ts +6 -0
  26. package/s/_archive/demo/utils/lipsum.ts +19 -0
  27. package/s/_archive/demo/views/exhibit/style.css.ts +85 -0
  28. package/s/_archive/demo/views/exhibit/view.ts +61 -0
  29. package/s/_archive/demo/views/showcase/style.css.ts +53 -0
  30. package/s/_archive/demo/views/showcase/view.ts +54 -0
  31. package/s/_archive/demo/viewsets.ts +12 -0
  32. package/s/_archive/index.html.ts +34 -0
  33. package/s/_archive/index.ts +19 -0
  34. package/s/_archive/install/aura.bundle.ts +9 -0
  35. package/s/_archive/install/plain.bundle.ts +9 -0
  36. package/s/{shiny.ts → _archive/shiny.ts} +2 -2
  37. package/s/_archive/themes/aura.css.ts +86 -0
  38. package/s/_archive/themes/index.barrel.ts +4 -0
  39. package/s/{themes → _archive/themes}/index.ts +1 -0
  40. package/s/_archive/themes/infra/css-vars.ts +46 -0
  41. package/s/_archive/themes/plain.css.ts +11 -0
  42. package/s/_archive/utils/states.ts +15 -0
  43. package/s/demo/globals.d.ts +3 -0
  44. package/s/demo/main.bundle.ts +16 -0
  45. package/s/demo/main.css +71 -0
  46. package/s/demo/parts/exhibit.ts +15 -0
  47. package/s/demo/utils/lipsum.ts +19 -0
  48. package/s/demo/views/codebox/style.css.ts +45 -0
  49. package/s/demo/views/codebox/use-prism-styles.ts +13 -0
  50. package/s/demo/views/codebox/view.ts +39 -0
  51. package/s/demo/views/showcase/style.css.ts +80 -0
  52. package/s/demo/views/showcase/view.ts +50 -0
  53. package/s/demo/views/stylebox/view.ts +21 -0
  54. package/s/icons/tabler/menu-2.svg.ts +4 -0
  55. package/s/icons/tabler/x.svg.ts +4 -0
  56. package/s/index.html.ts +42 -32
  57. package/s/index.ts +6 -7
  58. package/s/test.ts +5 -0
  59. package/s/theme/parts/core.ts +34 -0
  60. package/s/theme/parts/reset.ts +20 -0
  61. package/s/theme/parts/vars.ts +41 -0
  62. package/s/theme/theme-string.ts +15 -0
  63. package/s/theme/theme.css.ts +7 -0
  64. package/s/utils/states.ts +15 -0
  65. package/s/views/button/showcase.ts +43 -0
  66. package/s/views/button/style.css.ts +110 -0
  67. package/s/views/button/view.ts +32 -0
  68. package/s/views/copy/parts/copy-status.ts +3 -0
  69. package/s/views/copy/parts/determine-base-status.ts +7 -0
  70. package/s/views/copy/parts/use-copier.ts +20 -0
  71. package/s/views/copy/showcase.ts +54 -0
  72. package/s/views/copy/style.css.ts +51 -0
  73. package/s/views/copy/view.ts +60 -0
  74. package/s/views/drawer/control.ts +31 -0
  75. package/s/views/drawer/showcase.ts +83 -0
  76. package/s/views/drawer/style.css.ts +128 -0
  77. package/s/views/drawer/view.ts +76 -0
  78. package/s/views/tabs/control.ts +31 -0
  79. package/s/views/tabs/showcase.ts +89 -0
  80. package/s/views/tabs/style.css.ts +46 -0
  81. package/s/views/tabs/view.ts +66 -0
  82. package/x/{demo → _archive/demo}/demo.css +1 -0
  83. package/x/demo/main.bundle.js +13 -0
  84. package/x/demo/main.bundle.js.map +1 -0
  85. package/x/demo/main.bundle.min.js +811 -0
  86. package/x/demo/main.bundle.min.js.map +7 -0
  87. package/x/demo/main.css +71 -0
  88. package/x/demo/parts/exhibit.d.ts +11 -0
  89. package/x/demo/parts/exhibit.js +2 -0
  90. package/x/demo/parts/exhibit.js.map +1 -0
  91. package/x/demo/utils/lipsum.d.ts +2 -0
  92. package/x/demo/utils/lipsum.js +11 -0
  93. package/x/demo/utils/lipsum.js.map +1 -0
  94. package/x/demo/views/codebox/style.css.js +44 -0
  95. package/x/demo/views/codebox/style.css.js.map +1 -0
  96. package/x/demo/views/codebox/use-prism-styles.d.ts +1 -0
  97. package/x/demo/views/codebox/use-prism-styles.js +12 -0
  98. package/x/demo/views/codebox/use-prism-styles.js.map +1 -0
  99. package/x/demo/views/codebox/view.d.ts +2 -0
  100. package/x/demo/views/codebox/view.js +29 -0
  101. package/x/demo/views/codebox/view.js.map +1 -0
  102. package/x/demo/views/showcase/style.css.js +79 -0
  103. package/x/demo/views/showcase/style.css.js.map +1 -0
  104. package/x/demo/views/showcase/view.d.ts +2 -0
  105. package/x/demo/views/showcase/view.js +44 -0
  106. package/x/demo/views/showcase/view.js.map +1 -0
  107. package/x/demo/views/stylebox/view.d.ts +3 -0
  108. package/x/demo/views/stylebox/view.js +13 -0
  109. package/x/demo/views/stylebox/view.js.map +1 -0
  110. package/x/icons/tabler/menu-2.svg.d.ts +2 -0
  111. package/x/icons/tabler/menu-2.svg.js +3 -0
  112. package/x/icons/tabler/menu-2.svg.js.map +1 -0
  113. package/x/icons/tabler/x.svg.d.ts +2 -0
  114. package/x/icons/tabler/x.svg.js +3 -0
  115. package/x/icons/tabler/x.svg.js.map +1 -0
  116. package/x/index.d.ts +6 -5
  117. package/x/index.html +212 -61
  118. package/x/index.html.js +40 -29
  119. package/x/index.html.js.map +1 -1
  120. package/x/index.js +6 -5
  121. package/x/index.js.map +1 -1
  122. package/x/test.js +3 -0
  123. package/x/test.js.map +1 -0
  124. package/x/theme/parts/core.d.ts +1 -0
  125. package/x/theme/parts/core.js +33 -0
  126. package/x/theme/parts/core.js.map +1 -0
  127. package/x/theme/parts/reset.d.ts +1 -0
  128. package/x/theme/parts/reset.js +19 -0
  129. package/x/theme/parts/reset.js.map +1 -0
  130. package/x/theme/parts/vars.d.ts +1 -0
  131. package/x/theme/parts/vars.js +34 -0
  132. package/x/theme/parts/vars.js.map +1 -0
  133. package/x/theme/theme-string.d.ts +1 -0
  134. package/x/theme/theme-string.js +14 -0
  135. package/x/theme/theme-string.js.map +1 -0
  136. package/x/theme/theme.css.d.ts +1 -0
  137. package/x/theme/theme.css.js +4 -0
  138. package/x/theme/theme.css.js.map +1 -0
  139. package/x/utils/states.d.ts +5 -0
  140. package/x/utils/states.js +13 -0
  141. package/x/utils/states.js.map +1 -0
  142. package/x/views/button/showcase.d.ts +1 -0
  143. package/x/views/button/showcase.js +41 -0
  144. package/x/views/button/showcase.js.map +1 -0
  145. package/x/views/button/style.css.js +109 -0
  146. package/x/views/button/style.css.js.map +1 -0
  147. package/x/views/button/view.d.ts +5 -0
  148. package/x/views/button/view.js +23 -0
  149. package/x/views/button/view.js.map +1 -0
  150. package/x/views/copy/parts/copy-status.d.ts +1 -0
  151. package/x/views/copy/parts/copy-status.js +2 -0
  152. package/x/views/copy/parts/copy-status.js.map +1 -0
  153. package/x/views/copy/parts/determine-base-status.d.ts +1 -0
  154. package/x/views/copy/parts/determine-base-status.js +6 -0
  155. package/x/views/copy/parts/determine-base-status.js.map +1 -0
  156. package/x/views/copy/parts/use-copier.d.ts +6 -0
  157. package/x/views/copy/parts/use-copier.js +13 -0
  158. package/x/views/copy/parts/use-copier.js.map +1 -0
  159. package/x/views/copy/showcase.d.ts +1 -0
  160. package/x/views/copy/showcase.js +51 -0
  161. package/x/views/copy/showcase.js.map +1 -0
  162. package/x/views/copy/style.css.d.ts +2 -0
  163. package/x/{ui → views}/copy/style.css.js +14 -9
  164. package/x/views/copy/style.css.js.map +1 -0
  165. package/x/views/copy/view.d.ts +4 -0
  166. package/x/views/copy/view.js +49 -0
  167. package/x/views/copy/view.js.map +1 -0
  168. package/x/views/drawer/control.d.ts +9 -0
  169. package/x/views/drawer/control.js +24 -0
  170. package/x/views/drawer/control.js.map +1 -0
  171. package/x/views/drawer/showcase.d.ts +1 -0
  172. package/x/views/drawer/showcase.js +75 -0
  173. package/x/views/drawer/showcase.js.map +1 -0
  174. package/x/views/drawer/style.css.d.ts +2 -0
  175. package/x/views/drawer/style.css.js +127 -0
  176. package/x/views/drawer/style.css.js.map +1 -0
  177. package/x/views/drawer/view.d.ts +6 -0
  178. package/x/views/drawer/view.js +60 -0
  179. package/x/views/drawer/view.js.map +1 -0
  180. package/x/views/tabs/control.d.ts +9 -0
  181. package/x/views/tabs/control.js +24 -0
  182. package/x/views/tabs/control.js.map +1 -0
  183. package/x/views/tabs/showcase.d.ts +1 -0
  184. package/x/views/tabs/showcase.js +86 -0
  185. package/x/views/tabs/showcase.js.map +1 -0
  186. package/x/views/tabs/style.css.d.ts +2 -0
  187. package/x/views/tabs/style.css.js +45 -0
  188. package/x/views/tabs/style.css.js.map +1 -0
  189. package/x/views/tabs/view.d.ts +5 -0
  190. package/x/views/tabs/view.js +52 -0
  191. package/x/views/tabs/view.js.map +1 -0
  192. package/s/demo/demo.bundle.ts +0 -42
  193. package/s/demo/views/demonstration/style.css.ts +0 -108
  194. package/s/demo/views/demonstration/view.ts +0 -49
  195. package/s/install.bundle.ts +0 -9
  196. package/s/themes/basic.css.ts +0 -18
  197. package/s/themes/index.barrel.ts +0 -3
  198. package/s/ui/raw-components.ts +0 -9
  199. package/x/demo/demo.bundle.js +0 -37
  200. package/x/demo/demo.bundle.js.map +0 -1
  201. package/x/demo/demo.bundle.min.js +0 -277
  202. package/x/demo/demo.bundle.min.js.map +0 -7
  203. package/x/demo/views/demonstration/style.css.js +0 -107
  204. package/x/demo/views/demonstration/style.css.js.map +0 -1
  205. package/x/demo/views/demonstration/view.d.ts +0 -10
  206. package/x/demo/views/demonstration/view.js +0 -36
  207. package/x/demo/views/demonstration/view.js.map +0 -1
  208. package/x/install.bundle.js +0 -5
  209. package/x/install.bundle.js.map +0 -1
  210. package/x/install.bundle.min.js +0 -135
  211. package/x/install.bundle.min.js.map +0 -7
  212. package/x/shiny.d.ts +0 -14
  213. package/x/shiny.js +0 -8
  214. package/x/shiny.js.map +0 -1
  215. package/x/tests.test.d.ts +0 -1
  216. package/x/tests.test.js +0 -3
  217. package/x/tests.test.js.map +0 -1
  218. package/x/themes/basic.css.d.ts +0 -1
  219. package/x/themes/basic.css.js +0 -17
  220. package/x/themes/basic.css.js.map +0 -1
  221. package/x/themes/index.barrel.d.ts +0 -1
  222. package/x/themes/index.barrel.js +0 -2
  223. package/x/themes/index.barrel.js.map +0 -1
  224. package/x/themes/index.d.ts +0 -1
  225. package/x/themes/index.js +0 -2
  226. package/x/themes/index.js.map +0 -1
  227. package/x/ui/copy/component.d.ts +0 -372
  228. package/x/ui/copy/component.js +0 -56
  229. package/x/ui/copy/component.js.map +0 -1
  230. package/x/ui/copy/style.css.js.map +0 -1
  231. package/x/ui/example/component.d.ts +0 -371
  232. package/x/ui/example/component.js +0 -20
  233. package/x/ui/example/component.js.map +0 -1
  234. package/x/ui/example/style.css.js +0 -10
  235. package/x/ui/example/style.css.js.map +0 -1
  236. package/x/ui/framework.d.ts +0 -8
  237. package/x/ui/framework.js +0 -6
  238. package/x/ui/framework.js.map +0 -1
  239. package/x/ui/raw-components.d.ts +0 -6
  240. package/x/ui/raw-components.js +0 -7
  241. package/x/ui/raw-components.js.map +0 -1
  242. /package/s/{tests.test.ts → _archive/tests.test.ts} +0 -0
  243. /package/x/demo/{demo.bundle.d.ts → main.bundle.d.ts} +0 -0
  244. /package/x/demo/views/{demonstration → codebox}/style.css.d.ts +0 -0
  245. /package/x/{ui/copy → demo/views/showcase}/style.css.d.ts +0 -0
  246. /package/x/{install.bundle.d.ts → test.d.ts} +0 -0
  247. /package/x/{ui/example → views/button}/style.css.d.ts +0 -0
@@ -0,0 +1,47 @@
1
+
2
+ import {css} from "lit"
3
+ import {dom, view} from "@e280/sly"
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"
9
+
10
+ dom.register({ShinyDemo: view.component(use => {
11
+ use.styles(css`
12
+ :host {
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 1em;
16
+ }
17
+
18
+ .themes {
19
+ display: flex;
20
+ justify-content: end;
21
+ gap: 0.5em;
22
+
23
+ span {
24
+ font-size: 1.2em;
25
+ opacity: 0.5;
26
+ font-family: serif;
27
+ font-style: italic;
28
+ }
29
+
30
+ [view="demo-tabs"] {
31
+ display: flex;
32
+ }
33
+ }
34
+ `)
35
+
36
+ lipsumDispenser.takeAll()
37
+
38
+ return [
39
+ buttonShowcase(),
40
+ copyShowcase(),
41
+ drawerShowcase(),
42
+ tabsShowcase(),
43
+ ]
44
+ })})
45
+
46
+ console.log("✨shiny✨")
47
+
@@ -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
+
@@ -0,0 +1,19 @@
1
+
2
+ import {Dispenser} from "@e280/stz"
3
+
4
+ export const makeLipsumDispenser = () => new Dispenser(() => [
5
+ `lorem kettlebell dolor sit amet, mountain squats consectetur trail-running. adipiscing deadlift elit, sed do 45lb turkish get-up eiusmod tempor incididunt ut hike magna aliqua. ut enim ad minim clean & press, quis nostrud exercitation lunges ullamco kettlebell snatch trailhead nisi ut aliquip ex dolore summit irure dolor.`,
6
+
7
+ `lorem protein dolor sit amet, creatine scoop elit shaker bottle tempor. grilled steak magna keto-fasting culpa, carb-loading perspiciatis cheat day. whey isolate dolor sit macros elit, intermittent fasting tempor electrolyte magna; barefoot shoes culpa, liver perspiciatis ancestral squat rack gospel. lorem bulking dolor sit cut elit, tdee tracker tempor calorie deficit magna; chicken breast culpa gatorade perspiciatis meal prep.`,
8
+
9
+ `lorem caffeine dolor sit amet, double espresso elit cold brew tempor jitter. adderall magna focus culpa, lion’s mane perspiciatis nootropic. nicotine gum dolor sit vape elit, dopamine hit tempor buzz magna; lsd microdosing culpa, productivity perspiciatis agile sprint. lorem latte dolor sit drip elit, french press tempor aeropress magna; insomnia culpa, circadian rhythm perspiciatis blue light filter.`,
10
+
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
+
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
+
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
+
17
+ `lorem sedentary dolor sit amet, infinite scroll elit chair-bound tempor. commit marathon magna carpal tunnel culpa, caffeine perspiciatis heartbeat irregular. lorem backlog dolor sit ticket elit, jira sprint tempor sedentary slump magna; gym membership culpa expired, standing desk perspiciatis unused. lorem procrastination dolor sit youtube elit, keyboard crumbs tempor pizza box magna; cardio avoidant culpa, hike someday perspiciatis maybe.`,
18
+ ])
19
+
@@ -0,0 +1,85 @@
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 10em;
12
+ min-width: 0;
13
+ }
14
+ }
15
+
16
+ .meta {
17
+ display: flex;
18
+ flex-direction: column;
19
+ justify-content: space-between;
20
+ gap: 1em;
21
+ }
22
+
23
+ .snippet {
24
+ flex: 1 0 auto;
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 0.5em;
28
+ padding: 0.5em;
29
+ max-height: 20em;
30
+
31
+ background: #0002;
32
+ box-shadow: inset 0.2em 0.3em 2em #0004;
33
+ border-radius: 0.5em;
34
+
35
+ > header {
36
+ display: flex;
37
+ flex-wrap: wrap;
38
+ align-items: center;
39
+
40
+ [view="shiny-copy"] { font-size: 1.5em; }
41
+ [view="shiny-tabs"] {
42
+ flex: 1 1 auto;
43
+ font-size: 0.8em;
44
+ color: color-mix(in oklab, transparent, currentColor 50%);
45
+ }
46
+ }
47
+
48
+ > code {
49
+ flex: 1 1 auto;
50
+ display: block;
51
+
52
+ white-space: pre;
53
+ text-wrap: wrap;
54
+ tab-size: 2;
55
+ word-break: keep-all;
56
+ overflow: auto;
57
+
58
+ color: var(--code);
59
+ font-size: 0.8em;
60
+ font-family: monospace;
61
+ }
62
+ }
63
+
64
+ .box {
65
+ display: flex;
66
+ flex-wrap: wrap;
67
+ justify-content: center;
68
+ align-items: center;
69
+ align-content: center;
70
+
71
+ gap: 0.5em;
72
+ padding: 1em;
73
+
74
+ border-radius: 0.5rem;
75
+ border: 1px dashed color-mix(in oklab, transparent, currentColor 30%);
76
+
77
+ p.lipsum {
78
+ opacity: 0.7;
79
+ font-family: serif;
80
+ font-style: italic;
81
+ }
82
+ }
83
+
84
+ }`
85
+
@@ -0,0 +1,61 @@
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
40
+ .props(snippetControl)
41
+ .attr("snug")
42
+ .children(exhibit.snippets.map(s =>
43
+ auraViews.ShinyButton
44
+ .props()
45
+ .attr("plain")
46
+ .children(s.label)
47
+ .render()
48
+ ))
49
+ .render()}
50
+ ${auraViews.ShinyCopy(code)}
51
+ </header>
52
+ <code>${code}</code>
53
+ </div>
54
+ </div>
55
+
56
+ <div class=box>
57
+ ${exhibit.presentation(views)}
58
+ </div>
59
+ `
60
+ })
61
+
@@ -0,0 +1,53 @@
1
+
2
+ import {css} from "lit"
3
+ export default css`@layer view {
4
+
5
+ section.showcase {
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
+ flex-wrap: wrap;
43
+ place-content: center center;
44
+ gap: 0.5em;
45
+
46
+ h2 {
47
+ flex: 1 1 auto;
48
+ color: var(--prime);
49
+ }
50
+ }
51
+
52
+ }`
53
+
@@ -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
+ ${auraViews.ShinyTabs
29
+ .props(exhibitTabControl)
30
+ .attr("snug")
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
+ .attr("snug")
42
+ .children(viewsets.map(([theme]) =>
43
+ auraViews.ShinyButton
44
+ .props()
45
+ .children(theme)
46
+ .render()
47
+ ))
48
+ .render()}
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
+
@@ -0,0 +1,34 @@
1
+
2
+ import {ssg, html} from "@e280/scute"
3
+
4
+ const favicon = "/assets/favicon.png"
5
+
6
+ export default ssg.page(import.meta.url, async orb => ({
7
+ title: "shiny",
8
+ js: "demo/demo.bundle.min.js",
9
+ css: "demo/demo.css",
10
+ favicon,
11
+ dark: true,
12
+ socialCard: {
13
+ themeColor: "#d068ff",
14
+ siteName: "@e280/shiny",
15
+ title: "✨shiny✨",
16
+ description: "web ui components",
17
+ image: "https://shiny.e280.org" + favicon,
18
+ },
19
+
20
+ body: html`
21
+ <h1>
22
+ <strong>✨shiny✨</strong>
23
+ <small>v${orb.packageVersion()}</small>
24
+ </h1>
25
+
26
+ <section>
27
+ <p>web ui components</p>
28
+ <p><a href="https://github.com/e280/shiny#readme">readme for installation</a></p>
29
+ </section>
30
+
31
+ <shiny-demo></shiny-demo>
32
+ `,
33
+ }))
34
+
@@ -0,0 +1,19 @@
1
+
2
+ export * from "./themes/index.js"
3
+
4
+ export * from "./components/copy/component.js"
5
+
6
+ export * from "./components/drawer/component.js"
7
+ export * from "./components/drawer/control.js"
8
+
9
+ export * from "./components/example/component.js"
10
+
11
+ export * from "./components/tabs/component.js"
12
+ export * from "./components/tabs/control.js"
13
+
14
+ export * from "./components/foundation.css.js"
15
+ export * from "./components/framework.js"
16
+ export * from "./components/raw-components.js"
17
+
18
+ export * from "./shiny.js"
19
+
@@ -0,0 +1,9 @@
1
+
2
+ import {dom} from "@e280/sly"
3
+ import {shiny} from "../shiny.js"
4
+ import {aura} from "../themes/aura.css.js"
5
+
6
+ dom.register(
7
+ shiny({theme: aura}).components
8
+ )
9
+
@@ -0,0 +1,9 @@
1
+
2
+ import {dom} from "@e280/sly"
3
+ import {shiny} from "../shiny.js"
4
+ import {plain} from "../themes/plain.css.js"
5
+
6
+ dom.register(
7
+ shiny({theme: plain}).components
8
+ )
9
+
@@ -1,7 +1,7 @@
1
1
 
2
2
  import {contextualizeComponents, getViews} from "@e280/sly"
3
- import {ShinyContext} from "./ui/framework.js"
4
- import {rawComponents} from "./ui/raw-components.js"
3
+ import {ShinyContext} from "./components/framework.js"
4
+ import {rawComponents} from "./components/raw-components.js"
5
5
 
6
6
  export function shiny(context: ShinyContext) {
7
7
  const components = contextualizeComponents(context, rawComponents)
@@ -0,0 +1,86 @@
1
+
2
+ import {css} from "lit"
3
+ import {defaultCssVars, renderCssVars} from "./infra/css-vars.js"
4
+ export const aura = css`@layer overlay {
5
+
6
+ :host {
7
+ ${renderCssVars({
8
+ ...defaultCssVars(),
9
+ })}
10
+ }
11
+
12
+ :host([view="shiny-button"]:not([plain])) {
13
+ position: relative;
14
+
15
+ --buttoncolor: var(--calm);
16
+ --padding: 0.3em 0.7em;
17
+
18
+ color: white;
19
+ border-radius: 2em;
20
+ background: var(--buttoncolor);
21
+ border: none;
22
+
23
+ font-weight: medium;
24
+ text-shadow: 0.1em 0.1em 0.1em #0004;
25
+ box-shadow: 0.1em 0.2em 0.3em #0002;
26
+ }
27
+
28
+ :host([view="shiny-button"][lame]) { --buttoncolor: var(--lame); }
29
+ :host([view="shiny-button"][angry]) { --buttoncolor: var(--angry); }
30
+ :host([view="shiny-button"][zesty]) { --buttoncolor: var(--zesty); }
31
+ :host([view="shiny-button"][happy]) { --buttoncolor: var(--happy); }
32
+ :host([view="shiny-button"][calm]) { --buttoncolor: var(--calm); }
33
+ :host([view="shiny-button"][sad]) { --buttoncolor: var(--sad); }
34
+ :host([view="shiny-button"][quirky]) { --buttoncolor: var(--quirky); }
35
+
36
+ :host([view="shiny-button"][gradient]:not([plain])) {
37
+ border: none;
38
+ background: linear-gradient(
39
+ to bottom right,
40
+ color-mix(in oklab, var(--buttoncolor), white 40%),
41
+ color-mix(in oklab, var(--buttoncolor), black 20%)
42
+ );
43
+
44
+ &::before {
45
+ content: "";
46
+ display: block;
47
+ position: absolute;
48
+ z-index: 0;
49
+ inset: 0.15em;
50
+ border-radius: inherit;
51
+ background: color-mix(in oklab, var(--buttoncolor), #0004 50%);
52
+ }
53
+
54
+ > * {
55
+ position: relative;
56
+ z-index: 1;
57
+ }
58
+ }
59
+
60
+ :host([view="shiny-drawer"]:not([plain])) {
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
+ );
67
+
68
+ &::part(slate) {
69
+ padding: 1em;
70
+ }
71
+ }
72
+
73
+ :host([view="shiny-drawer"]:state(left)) {
74
+ &::part(slate) {
75
+ border-bottom-right-radius: 0.5em;
76
+ }
77
+ }
78
+
79
+ :host([view="shiny-drawer"]:state(right)) {
80
+ &::part(slate) {
81
+ border-bottom-left-radius: 0.5em;
82
+ }
83
+ }
84
+
85
+ }`
86
+
@@ -0,0 +1,4 @@
1
+
2
+ export * from "./plain.css.js"
3
+ export * from "./aura.css.js"
4
+
@@ -1,3 +1,4 @@
1
1
 
2
2
  export * as themes from "./index.barrel.js"
3
+ export type * from "./index.barrel.js"
3
4
 
@@ -0,0 +1,46 @@
1
+
2
+ import {unsafeCSS} from "lit"
3
+
4
+ export type CssVars = {
5
+ "bg": string
6
+ "alpha": string
7
+ "lame": string
8
+
9
+ // normative color vibes
10
+ "angry": string // red
11
+ "zesty": string // yellow
12
+ "happy": string // green
13
+ "calm": string // cyan
14
+ "sad": string // blue
15
+ "quirky": string // magenta
16
+
17
+ "inactive-opacity": string
18
+ "anim-duration": string
19
+ }
20
+
21
+ export function defaultCssVars(): CssVars {
22
+ return {
23
+ "bg": "#111",
24
+ "alpha": "#def",
25
+
26
+ "lame": "#8888",
27
+ "angry": "#f50",
28
+ "zesty": "#cf0",
29
+ "happy": "#0fa",
30
+ "calm": "#0af",
31
+ "sad": "#74f",
32
+ "quirky": "#f49",
33
+
34
+ "inactive-opacity": "0.5",
35
+ "anim-duration": "300ms",
36
+ }
37
+ }
38
+
39
+ export function renderCssVars(vars: CssVars) {
40
+ return unsafeCSS(
41
+ Object.entries(vars)
42
+ .map(([key, value]) => `--${key}: var(--shiny-${key}, ${value});`)
43
+ .join("\n")
44
+ )
45
+ }
46
+
@@ -0,0 +1,11 @@
1
+
2
+ import {css} from "lit"
3
+ import {defaultCssVars, renderCssVars} from "./infra/css-vars.js"
4
+ export const plain = css`@layer overlay {
5
+
6
+ :host {
7
+ ${renderCssVars(defaultCssVars())}
8
+ }
9
+
10
+ }`
11
+
@@ -0,0 +1,15 @@
1
+
2
+ export class States {
3
+ #states: Set<string>
4
+
5
+ constructor(element: HTMLElement) {
6
+ this.#states = element.attachInternals().states as any
7
+ }
8
+
9
+ assign(...states: string[]) {
10
+ this.#states.forEach(s => this.#states.delete(s))
11
+ for (const s of states) this.#states.add(s)
12
+ return this
13
+ }
14
+ }
15
+
@@ -0,0 +1,3 @@
1
+
2
+ declare module "prismjs/components/prism-js-templates"
3
+
@@ -0,0 +1,16 @@
1
+
2
+ import {dom} from "@e280/sly"
3
+ import {copyShowcase} from "../views/copy/showcase.js"
4
+ import {tabsShowcase} from "../views/tabs/showcase.js"
5
+ import {buttonShowcase} from "../views/button/showcase.js"
6
+ import {drawerShowcase} from "../views/drawer/showcase.js"
7
+
8
+ dom.render(dom(".gallery"), [
9
+ buttonShowcase(),
10
+ copyShowcase(),
11
+ tabsShowcase(),
12
+ drawerShowcase(),
13
+ ])
14
+
15
+ console.log("✨shiny✨")
16
+