@e280/shiny 0.1.0-1 → 0.1.0-10

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 (154) hide show
  1. package/README.md +110 -3
  2. package/package.json +3 -3
  3. package/s/{ui → components}/copy/component.ts +11 -6
  4. package/s/{ui → components}/copy/style.css.ts +6 -6
  5. package/s/components/drawer/component.ts +92 -0
  6. package/s/components/drawer/control.ts +31 -0
  7. package/s/components/drawer/style.css.ts +120 -0
  8. package/s/{ui → components}/example/component.ts +7 -5
  9. package/s/{ui → components}/example/style.css.ts +2 -2
  10. package/s/components/foundation.css.ts +15 -0
  11. package/s/components/framework.ts +10 -0
  12. package/s/components/raw-components.ts +13 -0
  13. package/s/components/tabs/component.ts +59 -0
  14. package/s/components/tabs/control.ts +31 -0
  15. package/s/components/tabs/style.css.ts +6 -0
  16. package/s/demo/aura-views.ts +6 -0
  17. package/s/demo/demo.bundle.ts +204 -14
  18. package/s/demo/demo.css +3 -1
  19. package/s/demo/utils/lipsum.ts +19 -0
  20. package/s/demo/views/demonstration/style.css.ts +10 -2
  21. package/s/demo/views/demonstration/view.ts +18 -14
  22. package/s/icons/tabler/menu-2.svg.ts +4 -0
  23. package/s/icons/tabler/x.svg.ts +4 -0
  24. package/s/index.html.ts +2 -2
  25. package/s/index.ts +16 -4
  26. package/s/install/aura.bundle.ts +9 -0
  27. package/s/install/plain.bundle.ts +9 -0
  28. package/s/shiny.ts +15 -0
  29. package/s/themes/aura.css.ts +48 -0
  30. package/s/themes/index.barrel.ts +2 -1
  31. package/s/themes/index.ts +1 -0
  32. package/s/themes/infra/css-vars.ts +33 -0
  33. package/s/themes/plain.css.ts +12 -0
  34. package/s/utils/states.ts +15 -0
  35. package/x/{ui → components}/copy/component.d.ts +8 -4
  36. package/x/{ui → components}/copy/component.js +10 -5
  37. package/x/components/copy/component.js.map +1 -0
  38. package/x/{ui → components}/copy/style.css.js +6 -6
  39. package/x/components/copy/style.css.js.map +1 -0
  40. package/x/components/drawer/component.d.ts +387 -0
  41. package/x/components/drawer/component.js +76 -0
  42. package/x/components/drawer/component.js.map +1 -0
  43. package/x/components/drawer/control.d.ts +9 -0
  44. package/x/components/drawer/control.js +24 -0
  45. package/x/components/drawer/control.js.map +1 -0
  46. package/x/components/drawer/style.css.js +119 -0
  47. package/x/components/drawer/style.css.js.map +1 -0
  48. package/x/{ui → components}/example/component.d.ts +3 -3
  49. package/x/{ui → components}/example/component.js +6 -4
  50. package/x/components/example/component.js.map +1 -0
  51. package/x/components/example/style.css.d.ts +2 -0
  52. package/x/components/example/style.css.js +10 -0
  53. package/x/components/example/style.css.js.map +1 -0
  54. package/x/components/foundation.css.d.ts +1 -0
  55. package/x/components/foundation.css.js +14 -0
  56. package/x/components/foundation.css.js.map +1 -0
  57. package/x/components/framework.d.ts +8 -0
  58. package/x/components/framework.js +5 -0
  59. package/x/components/framework.js.map +1 -0
  60. package/x/components/raw-components.d.ts +10 -0
  61. package/x/components/raw-components.js +11 -0
  62. package/x/components/raw-components.js.map +1 -0
  63. package/x/components/tabs/component.d.ts +374 -0
  64. package/x/components/tabs/component.js +49 -0
  65. package/x/components/tabs/component.js.map +1 -0
  66. package/x/components/tabs/control.d.ts +9 -0
  67. package/x/components/tabs/control.js +24 -0
  68. package/x/components/tabs/control.js.map +1 -0
  69. package/x/components/tabs/style.css.d.ts +2 -0
  70. package/x/components/tabs/style.css.js +5 -0
  71. package/x/components/tabs/style.css.js.map +1 -0
  72. package/x/demo/aura-views.d.ts +14 -0
  73. package/x/demo/aura-views.js +4 -0
  74. package/x/demo/aura-views.js.map +1 -0
  75. package/x/demo/demo.bundle.js +198 -14
  76. package/x/demo/demo.bundle.js.map +1 -1
  77. package/x/demo/demo.bundle.min.js +383 -48
  78. package/x/demo/demo.bundle.min.js.map +4 -4
  79. package/x/demo/demo.css +3 -1
  80. package/x/demo/utils/lipsum.d.ts +2 -0
  81. package/x/demo/utils/lipsum.js +11 -0
  82. package/x/demo/utils/lipsum.js.map +1 -0
  83. package/x/demo/views/demonstration/style.css.js +10 -2
  84. package/x/demo/views/demonstration/style.css.js.map +1 -1
  85. package/x/demo/views/demonstration/view.d.ts +6 -4
  86. package/x/demo/views/demonstration/view.js +16 -10
  87. package/x/demo/views/demonstration/view.js.map +1 -1
  88. package/x/icons/tabler/menu-2.svg.d.ts +2 -0
  89. package/x/icons/tabler/menu-2.svg.js +3 -0
  90. package/x/icons/tabler/menu-2.svg.js.map +1 -0
  91. package/x/icons/tabler/x.svg.d.ts +2 -0
  92. package/x/icons/tabler/x.svg.js +3 -0
  93. package/x/icons/tabler/x.svg.js.map +1 -0
  94. package/x/index.d.ts +10 -4
  95. package/x/index.html +7 -5
  96. package/x/index.html.js +2 -2
  97. package/x/index.js +10 -4
  98. package/x/index.js.map +1 -1
  99. package/x/install/aura.bundle.d.ts +1 -0
  100. package/x/install/aura.bundle.js +5 -0
  101. package/x/install/aura.bundle.js.map +1 -0
  102. package/x/install/aura.bundle.min.js +321 -0
  103. package/x/install/aura.bundle.min.js.map +7 -0
  104. package/x/install/plain.bundle.d.ts +1 -0
  105. package/x/install/plain.bundle.js +5 -0
  106. package/x/install/plain.bundle.js.map +1 -0
  107. package/x/install/plain.bundle.min.js +287 -0
  108. package/x/install/plain.bundle.min.js.map +7 -0
  109. package/x/shiny.d.ts +42 -0
  110. package/x/shiny.js +8 -0
  111. package/x/shiny.js.map +1 -0
  112. package/x/themes/aura.css.d.ts +1 -0
  113. package/x/themes/aura.css.js +47 -0
  114. package/x/themes/aura.css.js.map +1 -0
  115. package/x/themes/index.barrel.d.ts +2 -1
  116. package/x/themes/index.barrel.js +2 -1
  117. package/x/themes/index.barrel.js.map +1 -1
  118. package/x/themes/index.d.ts +1 -0
  119. package/x/themes/infra/css-vars.d.ts +11 -0
  120. package/x/themes/infra/css-vars.js +18 -0
  121. package/x/themes/infra/css-vars.js.map +1 -0
  122. package/x/themes/plain.css.d.ts +1 -0
  123. package/x/themes/plain.css.js +11 -0
  124. package/x/themes/plain.css.js.map +1 -0
  125. package/x/utils/states.d.ts +5 -0
  126. package/x/utils/states.js +13 -0
  127. package/x/utils/states.js.map +1 -0
  128. package/s/themes/basic.css.ts +0 -18
  129. package/s/tools/untab.ts +0 -30
  130. package/s/ui/components.ts +0 -9
  131. package/s/ui/framework.ts +0 -8
  132. package/s/ui/themers.ts +0 -28
  133. package/x/themes/basic.css.d.ts +0 -1
  134. package/x/themes/basic.css.js +0 -17
  135. package/x/themes/basic.css.js.map +0 -1
  136. package/x/tools/untab.d.ts +0 -1
  137. package/x/tools/untab.js +0 -26
  138. package/x/tools/untab.js.map +0 -1
  139. package/x/ui/components.d.ts +0 -6
  140. package/x/ui/components.js +0 -7
  141. package/x/ui/components.js.map +0 -1
  142. package/x/ui/copy/component.js.map +0 -1
  143. package/x/ui/copy/style.css.js.map +0 -1
  144. package/x/ui/example/component.js.map +0 -1
  145. package/x/ui/example/style.css.js +0 -10
  146. package/x/ui/example/style.css.js.map +0 -1
  147. package/x/ui/framework.d.ts +0 -4
  148. package/x/ui/framework.js +0 -6
  149. package/x/ui/framework.js.map +0 -1
  150. package/x/ui/themers.d.ts +0 -8
  151. package/x/ui/themers.js +0 -12
  152. package/x/ui/themers.js.map +0 -1
  153. /package/x/{ui → components}/copy/style.css.d.ts +0 -0
  154. /package/x/{ui/example → components/drawer}/style.css.d.ts +0 -0
package/x/shiny.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ import { ShinyContext } from "./components/framework.js";
2
+ export declare function shiny(context: ShinyContext): {
3
+ components: {
4
+ ShinyCopy: {
5
+ new (): import("./index.js").ShinyCopy;
6
+ view: import("@e280/sly").View<[text: string | undefined, ms?: any]>;
7
+ } & typeof import("./index.js").ShinyCopy;
8
+ ShinyDrawer: {
9
+ new (): import("./index.js").ShinyDrawer;
10
+ view: import("@e280/sly").View<[options: {
11
+ button: boolean;
12
+ side?: "left" | "right";
13
+ control?: import("./index.js").DrawerControl;
14
+ }]>;
15
+ } & typeof import("./index.js").ShinyDrawer;
16
+ ShinyExample: {
17
+ new (): import("./index.js").ShinyExample;
18
+ view: import("@e280/sly").View<[start: number]>;
19
+ } & typeof import("./index.js").ShinyExample;
20
+ ShinyTabs: {
21
+ new (): import("./index.js").ShinyTabs;
22
+ view: import("@e280/sly").View<[controlOption?: import("./index.js").TabControl | undefined]>;
23
+ } & typeof import("./index.js").ShinyTabs;
24
+ };
25
+ views: {
26
+ ShinyCopy: import("@e280/sly").View<[text: string | undefined, ms?: any]> & import("@e280/sly").View<[context: ShinyContext, text: string | undefined, ms?: any]>;
27
+ ShinyDrawer: import("@e280/sly").View<[options: {
28
+ button: boolean;
29
+ side?: "left" | "right";
30
+ control?: import("./index.js").DrawerControl;
31
+ }]> & import("@e280/sly").View<[context: ShinyContext, options: {
32
+ button: boolean;
33
+ side?: "left" | "right";
34
+ control?: import("./index.js").DrawerControl;
35
+ }]>;
36
+ ShinyExample: import("@e280/sly").View<[start: number]> & import("@e280/sly").View<[context: ShinyContext, start: number]>;
37
+ ShinyTabs: import("@e280/sly").View<[controlOption?: import("./index.js").TabControl | undefined]> & import("@e280/sly").View<[context: ShinyContext, controlOption?: import("./index.js").TabControl | undefined]>;
38
+ };
39
+ };
40
+ export type Shiny = ReturnType<typeof shiny>;
41
+ export type ShinyViews = Shiny["views"];
42
+ export type ShinyComponents = Shiny["components"];
package/x/shiny.js ADDED
@@ -0,0 +1,8 @@
1
+ import { contextualizeComponents, getViews } from "@e280/sly";
2
+ import { rawComponents } from "./components/raw-components.js";
3
+ export function shiny(context) {
4
+ const components = contextualizeComponents(context, rawComponents);
5
+ const views = getViews(components);
6
+ return { components, views };
7
+ }
8
+ //# sourceMappingURL=shiny.js.map
package/x/shiny.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shiny.js","sourceRoot":"","sources":["../s/shiny.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,uBAAuB,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAA;AAE3D,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAA;AAE5D,MAAM,UAAU,KAAK,CAAC,OAAqB;IAC1C,MAAM,UAAU,GAAG,uBAAuB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;IAClE,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAA;IAClC,OAAO,EAAC,UAAU,EAAE,KAAK,EAAC,CAAA;AAC3B,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const aura: import("lit").CSSResult;
@@ -0,0 +1,47 @@
1
+ import { css } from "lit";
2
+ import { defaultCssVars, renderCssVars } from "./infra/css-vars.js";
3
+ export const aura = css `@layer overlay {
4
+
5
+ :host {
6
+ display: block;
7
+
8
+ ${renderCssVars({
9
+ ...defaultCssVars(),
10
+ })}
11
+ }
12
+
13
+ :host([view="shiny-drawer"]) {
14
+ display: block;
15
+
16
+ &::part(tray) {
17
+ padding: 1em;
18
+ background: linear-gradient(
19
+ to top right,
20
+ #00a9dd69,
21
+ #70ffd77a
22
+ );
23
+ }
24
+ }
25
+
26
+ :host([view="shiny-drawer"]:state(left)) {
27
+ &::part(tray) {
28
+ border-bottom-right-radius: 0.5em;
29
+ }
30
+ }
31
+
32
+ :host([view="shiny-drawer"]:state(right)) {
33
+ &::part(tray) {
34
+ border-bottom-left-radius: 0.5em;
35
+ }
36
+ }
37
+
38
+ :host([view="shiny-tabs"]) {
39
+ display: block;
40
+
41
+ &::part(tabs) {
42
+ display: flex;
43
+ }
44
+ }
45
+
46
+ }`;
47
+ //# sourceMappingURL=aura.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aura.css.js","sourceRoot":"","sources":["../../s/themes/aura.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AACjE,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAA;;;;;GAKpB,aAAa,CAAC;IACf,GAAG,cAAc,EAAE;CACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoCD,CAAA"}
@@ -1 +1,2 @@
1
- export * from "./basic.css.js";
1
+ export * from "./plain.css.js";
2
+ export * from "./aura.css.js";
@@ -1,2 +1,3 @@
1
- export * from "./basic.css.js";
1
+ export * from "./plain.css.js";
2
+ export * from "./aura.css.js";
2
3
  //# sourceMappingURL=index.barrel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.barrel.js","sourceRoot":"","sources":["../../s/themes/index.barrel.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.barrel.js","sourceRoot":"","sources":["../../s/themes/index.barrel.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA"}
@@ -1 +1,2 @@
1
1
  export * as themes from "./index.barrel.js";
2
+ export type * from "./index.barrel.js";
@@ -0,0 +1,11 @@
1
+ export type CssVars = {
2
+ "bg": string;
3
+ "alpha": string;
4
+ "happy": string;
5
+ "sad": string;
6
+ "angry": string;
7
+ "lame": string;
8
+ "inactive-opacity": string;
9
+ };
10
+ export declare function defaultCssVars(): CssVars;
11
+ export declare function renderCssVars(vars: CssVars): import("lit").CSSResult;
@@ -0,0 +1,18 @@
1
+ import { unsafeCSS } from "lit";
2
+ export function defaultCssVars() {
3
+ return {
4
+ "bg": "#111",
5
+ "alpha": "#afa",
6
+ "happy": "#0fa",
7
+ "sad": "#74f",
8
+ "angry": "#f50",
9
+ "lame": "#8888",
10
+ "inactive-opacity": "0.5",
11
+ };
12
+ }
13
+ export function renderCssVars(vars) {
14
+ return unsafeCSS(Object.entries(vars)
15
+ .map(([key, value]) => `--${key}: var(--shiny-${key}, ${value});`)
16
+ .join("\n"));
17
+ }
18
+ //# sourceMappingURL=css-vars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-vars.js","sourceRoot":"","sources":["../../../s/themes/infra/css-vars.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,KAAK,CAAA;AAY7B,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,OAAO;QACf,kBAAkB,EAAE,KAAK;KACzB,CAAA;AACF,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAa;IAC1C,OAAO,SAAS,CACf,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;SAClB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,iBAAiB,GAAG,KAAK,KAAK,IAAI,CAAC;SACjE,IAAI,CAAC,IAAI,CAAC,CACZ,CAAA;AACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const plain: import("lit").CSSResult;
@@ -0,0 +1,11 @@
1
+ import { css } from "lit";
2
+ import { defaultCssVars, renderCssVars } from "./infra/css-vars.js";
3
+ export const plain = css `@layer overlay {
4
+
5
+ :host {
6
+ display: block;
7
+ ${renderCssVars(defaultCssVars())}
8
+ }
9
+
10
+ }`;
11
+ //# sourceMappingURL=plain.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plain.css.js","sourceRoot":"","sources":["../../s/themes/plain.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,qBAAqB,CAAA;AACjE,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;GAIrB,aAAa,CAAC,cAAc,EAAE,CAAC;;;EAGhC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare class States {
2
+ #private;
3
+ constructor(element: HTMLElement);
4
+ assign(...states: string[]): this;
5
+ }
@@ -0,0 +1,13 @@
1
+ export class States {
2
+ #states;
3
+ constructor(element) {
4
+ this.#states = element.attachInternals().states;
5
+ }
6
+ assign(...states) {
7
+ this.#states.forEach(s => this.#states.delete(s));
8
+ for (const s of states)
9
+ this.#states.add(s);
10
+ return this;
11
+ }
12
+ }
13
+ //# sourceMappingURL=states.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"states.js","sourceRoot":"","sources":["../../s/utils/states.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,MAAM;IAClB,OAAO,CAAa;IAEpB,YAAY,OAAoB;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,MAAa,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,GAAG,MAAgB;QACzB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QACjD,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
@@ -1,18 +0,0 @@
1
-
2
- import {css} from "lit"
3
- import {cssReset} from "@e280/sly"
4
- export const basic = css`
5
-
6
- ${cssReset}
7
-
8
- :host {
9
- display: block;
10
- --bg: var(--shiny-bg, #111);
11
- --alpha: var(--shiny-alpha, #afa);
12
- --good: var(--shiny-good, #0f4);
13
- --bad: var(--shiny-bad, #f40);
14
- --invalid: var(--shiny-invalid, #8888);
15
- }
16
-
17
- `
18
-
package/s/tools/untab.ts DELETED
@@ -1,30 +0,0 @@
1
-
2
- export function untab(code: string) {
3
- const lines = code.split(/\r|\n/)
4
- let baseTabLevel: number | undefined
5
-
6
- for (const line of lines) {
7
- const isOnlyWhitespace = /^\s+$/.test(line)
8
- if (!isOnlyWhitespace) {
9
- const tabMatch = line.match(/^(\t+).+/)
10
- if (tabMatch) {
11
- const tabCount = tabMatch[1].length
12
- baseTabLevel = baseTabLevel === undefined
13
- ? tabCount
14
- : tabCount < baseTabLevel
15
- ? tabCount
16
- : baseTabLevel
17
- if (baseTabLevel === 0)
18
- break
19
- }
20
- }
21
- }
22
-
23
- const rebaseTabRegex = new RegExp(`^\\t{${baseTabLevel}}`)
24
-
25
- return lines
26
- .map(line => /^\s+$/.test(line) ? "" : line)
27
- .map(line => line.replace(rebaseTabRegex, ""))
28
- .join("\n")
29
- }
30
-
@@ -1,9 +0,0 @@
1
-
2
- import {ShinyCopy} from "./copy/component.js"
3
- import {ShinyExample} from "./example/component.js"
4
-
5
- export const components = {
6
- ShinyCopy,
7
- ShinyExample,
8
- }
9
-
package/s/ui/framework.ts DELETED
@@ -1,8 +0,0 @@
1
-
2
- import {BaseElement} from "@e280/sly"
3
- import {basic} from "../themes/basic.css.js"
4
-
5
- export class ShinyElement extends BaseElement {
6
- theme = basic
7
- }
8
-
package/s/ui/themers.ts DELETED
@@ -1,28 +0,0 @@
1
-
2
- import {CSSResult} from "lit"
3
- import {DropFirst, ob} from "@e280/stz"
4
- import {ComponentClass, View, ViewProps} from "@e280/sly"
5
-
6
- import {components} from "./components.js"
7
- import {ShinyElement} from "./framework.js"
8
-
9
- export function themeComponents(theme: CSSResult) {
10
- return ob(components).map(C => class extends C {
11
- theme = theme
12
- static view = super.view.transmute((...props: any[]) => [theme, ...props] as any) as any
13
- }) as {
14
- [K in keyof typeof components]: ComponentClass<
15
- typeof ShinyElement,
16
- DropFirst<ViewProps<(typeof components)[K]["view"]>>
17
- >
18
- }
19
- }
20
-
21
- export function themeViews(theme: CSSResult) {
22
- return ob(themeComponents(theme)).map(C => C.view) as {
23
- [K in keyof typeof components]: View<DropFirst<ViewProps<(typeof components)[K]["view"]>>>
24
- }
25
- }
26
-
27
- export type ShinyViews = ReturnType<typeof themeViews>
28
-
@@ -1 +0,0 @@
1
- export declare const basic: import("lit").CSSResult;
@@ -1,17 +0,0 @@
1
- import { css } from "lit";
2
- import { cssReset } from "@e280/sly";
3
- export const basic = css `
4
-
5
- ${cssReset}
6
-
7
- :host {
8
- display: block;
9
- --bg: var(--shiny-bg, #111);
10
- --alpha: var(--shiny-alpha, #afa);
11
- --good: var(--shiny-good, #0f4);
12
- --bad: var(--shiny-bad, #f40);
13
- --invalid: var(--shiny-invalid, #8888);
14
- }
15
-
16
- `;
17
- //# sourceMappingURL=basic.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basic.css.js","sourceRoot":"","sources":["../../s/themes/basic.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;EAEtB,QAAQ;;;;;;;;;;;CAWT,CAAA"}
@@ -1 +0,0 @@
1
- export declare function untab(code: string): string;
package/x/tools/untab.js DELETED
@@ -1,26 +0,0 @@
1
- export function untab(code) {
2
- const lines = code.split(/\r|\n/);
3
- let baseTabLevel;
4
- for (const line of lines) {
5
- const isOnlyWhitespace = /^\s+$/.test(line);
6
- if (!isOnlyWhitespace) {
7
- const tabMatch = line.match(/^(\t+).+/);
8
- if (tabMatch) {
9
- const tabCount = tabMatch[1].length;
10
- baseTabLevel = baseTabLevel === undefined
11
- ? tabCount
12
- : tabCount < baseTabLevel
13
- ? tabCount
14
- : baseTabLevel;
15
- if (baseTabLevel === 0)
16
- break;
17
- }
18
- }
19
- }
20
- const rebaseTabRegex = new RegExp(`^\\t{${baseTabLevel}}`);
21
- return lines
22
- .map(line => /^\s+$/.test(line) ? "" : line)
23
- .map(line => line.replace(rebaseTabRegex, ""))
24
- .join("\n");
25
- }
26
- //# sourceMappingURL=untab.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"untab.js","sourceRoot":"","sources":["../../s/tools/untab.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,KAAK,CAAC,IAAY;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACjC,IAAI,YAAgC,CAAA;IAEpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3C,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YACvC,IAAI,QAAQ,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;gBACnC,YAAY,GAAG,YAAY,KAAK,SAAS;oBACxC,CAAC,CAAC,QAAQ;oBACV,CAAC,CAAC,QAAQ,GAAG,YAAY;wBACxB,CAAC,CAAC,QAAQ;wBACV,CAAC,CAAC,YAAY,CAAA;gBAChB,IAAI,YAAY,KAAK,CAAC;oBACrB,MAAK;YACP,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,QAAQ,YAAY,GAAG,CAAC,CAAA;IAE1D,OAAO,KAAK;SACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAC3C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;SAC7C,IAAI,CAAC,IAAI,CAAC,CAAA;AACb,CAAC"}
@@ -1,6 +0,0 @@
1
- import { ShinyCopy } from "./copy/component.js";
2
- import { ShinyExample } from "./example/component.js";
3
- export declare const components: {
4
- ShinyCopy: typeof ShinyCopy;
5
- ShinyExample: typeof ShinyExample;
6
- };
@@ -1,7 +0,0 @@
1
- import { ShinyCopy } from "./copy/component.js";
2
- import { ShinyExample } from "./example/component.js";
3
- export const components = {
4
- ShinyCopy,
5
- ShinyExample,
6
- };
7
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../s/ui/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAA;AAEnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,SAAS;IACT,YAAY;CACZ,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/ui/copy/component.ts"],"names":[],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/ui/copy/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CjB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/ui/example/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAY,IAAI,EAAC,MAAM,KAAK,CAAA;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE5C,MAAM,OAAO,YAAa,SAAQ,CACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAgB,EAAE,KAAa,EAAE,EAAE;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAE3B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAChC,MAAM,SAAS,GAAG,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAA,CAAC,CAAC,CAAA;IAE1C,OAAO,IAAI,CAAA;qBACQ,SAAS;MACxB,MAAM,EAAE;;GAEX,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,KAAM,SAAQ,YAAY;IACpC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC,CAAA;CAC7C,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAU,CAAC,CACtD;CAAG"}
@@ -1,10 +0,0 @@
1
- import { css } from "lit";
2
- export default css `
3
-
4
- button {
5
- padding: 1em;
6
- min-width: 4em;
7
- }
8
-
9
- `;
10
- //# sourceMappingURL=style.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/ui/example/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;CAOjB,CAAA"}
@@ -1,4 +0,0 @@
1
- import { BaseElement } from "@e280/sly";
2
- export declare class ShinyElement extends BaseElement {
3
- theme: import("lit").CSSResult;
4
- }
package/x/ui/framework.js DELETED
@@ -1,6 +0,0 @@
1
- import { BaseElement } from "@e280/sly";
2
- import { basic } from "../themes/basic.css.js";
3
- export class ShinyElement extends BaseElement {
4
- theme = basic;
5
- }
6
- //# sourceMappingURL=framework.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework.js","sourceRoot":"","sources":["../../s/ui/framework.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AACrC,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAA;AAE5C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC5C,KAAK,GAAG,KAAK,CAAA;CACb"}
package/x/ui/themers.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { CSSResult } from "lit";
2
- import { DropFirst } from "@e280/stz";
3
- import { ComponentClass, View, ViewProps } from "@e280/sly";
4
- import { components } from "./components.js";
5
- import { ShinyElement } from "./framework.js";
6
- export declare function themeComponents(theme: CSSResult): { [K in keyof typeof components]: ComponentClass<typeof ShinyElement, DropFirst<ViewProps<(typeof components)[K]["view"]>>>; };
7
- export declare function themeViews(theme: CSSResult): { [K in keyof typeof components]: View<DropFirst<ViewProps<(typeof components)[K]["view"]>>>; };
8
- export type ShinyViews = ReturnType<typeof themeViews>;
package/x/ui/themers.js DELETED
@@ -1,12 +0,0 @@
1
- import { ob } from "@e280/stz";
2
- import { components } from "./components.js";
3
- export function themeComponents(theme) {
4
- return ob(components).map(C => class extends C {
5
- theme = theme;
6
- static view = super.view.transmute((...props) => [theme, ...props]);
7
- });
8
- }
9
- export function themeViews(theme) {
10
- return ob(themeComponents(theme)).map(C => C.view);
11
- }
12
- //# sourceMappingURL=themers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"themers.js","sourceRoot":"","sources":["../../s/ui/themers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,EAAE,EAAC,MAAM,WAAW,CAAA;AAGvC,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAA;AAG1C,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC/C,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAM,SAAQ,CAAC;QAC7C,KAAK,GAAG,KAAK,CAAA;QACb,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,KAAY,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,CAAQ,CAAQ,CAAA;KACxF,CAKA,CAAA;AACF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAgB;IAC1C,OAAO,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAEhD,CAAA;AACF,CAAC"}
File without changes