@e280/shiny 0.1.0-1 → 0.1.0-11

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 (162) hide show
  1. package/README.md +113 -3
  2. package/package.json +3 -3
  3. package/s/components/button/component.ts +30 -0
  4. package/s/components/button/style.css.ts +64 -0
  5. package/s/{ui → components}/copy/component.ts +11 -6
  6. package/s/{ui → components}/copy/style.css.ts +6 -6
  7. package/s/components/drawer/component.ts +92 -0
  8. package/s/components/drawer/control.ts +31 -0
  9. package/s/components/drawer/style.css.ts +120 -0
  10. package/s/{ui → components}/example/component.ts +7 -5
  11. package/s/{ui → components}/example/style.css.ts +2 -2
  12. package/s/components/foundation.css.ts +15 -0
  13. package/s/components/framework.ts +10 -0
  14. package/s/components/raw-components.ts +15 -0
  15. package/s/components/tabs/component.ts +70 -0
  16. package/s/components/tabs/control.ts +31 -0
  17. package/s/components/tabs/style.css.ts +43 -0
  18. package/s/demo/aura-views.ts +6 -0
  19. package/s/demo/demo.bundle.ts +287 -14
  20. package/s/demo/demo.css +3 -1
  21. package/s/demo/utils/lipsum.ts +19 -0
  22. package/s/demo/views/demonstration/style.css.ts +18 -2
  23. package/s/demo/views/demonstration/view.ts +24 -16
  24. package/s/icons/tabler/menu-2.svg.ts +4 -0
  25. package/s/icons/tabler/x.svg.ts +4 -0
  26. package/s/index.html.ts +2 -2
  27. package/s/index.ts +16 -4
  28. package/s/install/aura.bundle.ts +9 -0
  29. package/s/install/plain.bundle.ts +9 -0
  30. package/s/shiny.ts +15 -0
  31. package/s/themes/aura.css.ts +86 -0
  32. package/s/themes/index.barrel.ts +2 -1
  33. package/s/themes/index.ts +1 -0
  34. package/s/themes/infra/css-vars.ts +41 -0
  35. package/s/themes/plain.css.ts +11 -0
  36. package/s/utils/states.ts +15 -0
  37. package/x/components/button/component.d.ts +5 -0
  38. package/x/components/button/component.js +25 -0
  39. package/x/components/button/component.js.map +1 -0
  40. package/x/components/button/style.css.js +63 -0
  41. package/x/components/button/style.css.js.map +1 -0
  42. package/x/{ui → components}/copy/component.d.ts +8 -4
  43. package/x/{ui → components}/copy/component.js +10 -5
  44. package/x/components/copy/component.js.map +1 -0
  45. package/x/{ui → components}/copy/style.css.js +6 -6
  46. package/x/components/copy/style.css.js.map +1 -0
  47. package/x/components/drawer/component.d.ts +387 -0
  48. package/x/components/drawer/component.js +76 -0
  49. package/x/components/drawer/component.js.map +1 -0
  50. package/x/components/drawer/control.d.ts +9 -0
  51. package/x/components/drawer/control.js +24 -0
  52. package/x/components/drawer/control.js.map +1 -0
  53. package/x/components/drawer/style.css.d.ts +2 -0
  54. package/x/components/drawer/style.css.js +119 -0
  55. package/x/components/drawer/style.css.js.map +1 -0
  56. package/x/{ui → components}/example/component.d.ts +3 -3
  57. package/x/{ui → components}/example/component.js +6 -4
  58. package/x/components/example/component.js.map +1 -0
  59. package/x/components/example/style.css.d.ts +2 -0
  60. package/x/components/example/style.css.js +10 -0
  61. package/x/components/example/style.css.js.map +1 -0
  62. package/x/components/foundation.css.d.ts +1 -0
  63. package/x/components/foundation.css.js +14 -0
  64. package/x/components/foundation.css.js.map +1 -0
  65. package/x/components/framework.d.ts +8 -0
  66. package/x/components/framework.js +5 -0
  67. package/x/components/framework.js.map +1 -0
  68. package/x/components/raw-components.d.ts +12 -0
  69. package/x/components/raw-components.js +13 -0
  70. package/x/components/raw-components.js.map +1 -0
  71. package/x/components/tabs/component.d.ts +374 -0
  72. package/x/components/tabs/component.js +60 -0
  73. package/x/components/tabs/component.js.map +1 -0
  74. package/x/components/tabs/control.d.ts +9 -0
  75. package/x/components/tabs/control.js +24 -0
  76. package/x/components/tabs/control.js.map +1 -0
  77. package/x/components/tabs/style.css.d.ts +2 -0
  78. package/x/components/tabs/style.css.js +42 -0
  79. package/x/components/tabs/style.css.js.map +1 -0
  80. package/x/demo/aura-views.d.ts +15 -0
  81. package/x/demo/aura-views.js +4 -0
  82. package/x/demo/aura-views.js.map +1 -0
  83. package/x/demo/demo.bundle.js +280 -14
  84. package/x/demo/demo.bundle.js.map +1 -1
  85. package/x/demo/demo.bundle.min.js +561 -45
  86. package/x/demo/demo.bundle.min.js.map +4 -4
  87. package/x/demo/demo.css +3 -1
  88. package/x/demo/utils/lipsum.d.ts +2 -0
  89. package/x/demo/utils/lipsum.js +11 -0
  90. package/x/demo/utils/lipsum.js.map +1 -0
  91. package/x/demo/views/demonstration/style.css.js +18 -2
  92. package/x/demo/views/demonstration/style.css.js.map +1 -1
  93. package/x/demo/views/demonstration/view.d.ts +6 -4
  94. package/x/demo/views/demonstration/view.js +20 -12
  95. package/x/demo/views/demonstration/view.js.map +1 -1
  96. package/x/icons/tabler/menu-2.svg.d.ts +2 -0
  97. package/x/icons/tabler/menu-2.svg.js +3 -0
  98. package/x/icons/tabler/menu-2.svg.js.map +1 -0
  99. package/x/icons/tabler/x.svg.d.ts +2 -0
  100. package/x/icons/tabler/x.svg.js +3 -0
  101. package/x/icons/tabler/x.svg.js.map +1 -0
  102. package/x/index.d.ts +10 -4
  103. package/x/index.html +7 -5
  104. package/x/index.html.js +2 -2
  105. package/x/index.js +10 -4
  106. package/x/index.js.map +1 -1
  107. package/x/install/aura.bundle.d.ts +1 -0
  108. package/x/install/aura.bundle.js +5 -0
  109. package/x/install/aura.bundle.js.map +1 -0
  110. package/x/install/aura.bundle.min.js +463 -0
  111. package/x/install/aura.bundle.min.js.map +7 -0
  112. package/x/install/plain.bundle.d.ts +1 -0
  113. package/x/install/plain.bundle.js +5 -0
  114. package/x/install/plain.bundle.js.map +1 -0
  115. package/x/install/plain.bundle.min.js +390 -0
  116. package/x/install/plain.bundle.min.js.map +7 -0
  117. package/x/shiny.d.ts +47 -0
  118. package/x/shiny.js +8 -0
  119. package/x/shiny.js.map +1 -0
  120. package/x/themes/aura.css.d.ts +1 -0
  121. package/x/themes/aura.css.js +85 -0
  122. package/x/themes/aura.css.js.map +1 -0
  123. package/x/themes/index.barrel.d.ts +2 -1
  124. package/x/themes/index.barrel.js +2 -1
  125. package/x/themes/index.barrel.js.map +1 -1
  126. package/x/themes/index.d.ts +1 -0
  127. package/x/themes/infra/css-vars.d.ts +14 -0
  128. package/x/themes/infra/css-vars.js +21 -0
  129. package/x/themes/infra/css-vars.js.map +1 -0
  130. package/x/themes/plain.css.d.ts +1 -0
  131. package/x/themes/plain.css.js +10 -0
  132. package/x/themes/plain.css.js.map +1 -0
  133. package/x/utils/states.d.ts +5 -0
  134. package/x/utils/states.js +13 -0
  135. package/x/utils/states.js.map +1 -0
  136. package/s/themes/basic.css.ts +0 -18
  137. package/s/tools/untab.ts +0 -30
  138. package/s/ui/components.ts +0 -9
  139. package/s/ui/framework.ts +0 -8
  140. package/s/ui/themers.ts +0 -28
  141. package/x/themes/basic.css.d.ts +0 -1
  142. package/x/themes/basic.css.js +0 -17
  143. package/x/themes/basic.css.js.map +0 -1
  144. package/x/tools/untab.d.ts +0 -1
  145. package/x/tools/untab.js +0 -26
  146. package/x/tools/untab.js.map +0 -1
  147. package/x/ui/components.d.ts +0 -6
  148. package/x/ui/components.js +0 -7
  149. package/x/ui/components.js.map +0 -1
  150. package/x/ui/copy/component.js.map +0 -1
  151. package/x/ui/copy/style.css.js.map +0 -1
  152. package/x/ui/example/component.js.map +0 -1
  153. package/x/ui/example/style.css.js +0 -10
  154. package/x/ui/example/style.css.js.map +0 -1
  155. package/x/ui/framework.d.ts +0 -4
  156. package/x/ui/framework.js +0 -6
  157. package/x/ui/framework.js.map +0 -1
  158. package/x/ui/themers.d.ts +0 -8
  159. package/x/ui/themers.js +0 -12
  160. package/x/ui/themers.js.map +0 -1
  161. /package/x/{ui/copy → components/button}/style.css.d.ts +0 -0
  162. /package/x/{ui/example → components/copy}/style.css.d.ts +0 -0
package/x/shiny.d.ts ADDED
@@ -0,0 +1,47 @@
1
+ import { ShinyContext } from "./components/framework.js";
2
+ export declare function shiny(context: ShinyContext): {
3
+ components: {
4
+ ShinyButton: {
5
+ new (): import("./components/button/component.js").ShinyButton;
6
+ view: import("@e280/sly").View<[]>;
7
+ } & typeof import("./components/button/component.js").ShinyButton;
8
+ ShinyCopy: {
9
+ new (): import("./index.js").ShinyCopy;
10
+ view: import("@e280/sly").View<[text: string | undefined, ms?: any]>;
11
+ } & typeof import("./index.js").ShinyCopy;
12
+ ShinyDrawer: {
13
+ new (): import("./index.js").ShinyDrawer;
14
+ view: import("@e280/sly").View<[options: {
15
+ button: boolean;
16
+ side?: "left" | "right";
17
+ control?: import("./index.js").DrawerControl;
18
+ }]>;
19
+ } & typeof import("./index.js").ShinyDrawer;
20
+ ShinyExample: {
21
+ new (): import("./index.js").ShinyExample;
22
+ view: import("@e280/sly").View<[start: number]>;
23
+ } & typeof import("./index.js").ShinyExample;
24
+ ShinyTabs: {
25
+ new (): import("./index.js").ShinyTabs;
26
+ view: import("@e280/sly").View<[controlOption?: import("./index.js").TabControl | undefined]>;
27
+ } & typeof import("./index.js").ShinyTabs;
28
+ };
29
+ views: {
30
+ ShinyButton: import("@e280/sly").View<[]> & import("@e280/sly").View<[context: ShinyContext]>;
31
+ ShinyCopy: import("@e280/sly").View<[text: string | undefined, ms?: any]> & import("@e280/sly").View<[context: ShinyContext, text: string | undefined, ms?: any]>;
32
+ ShinyDrawer: import("@e280/sly").View<[options: {
33
+ button: boolean;
34
+ side?: "left" | "right";
35
+ control?: import("./index.js").DrawerControl;
36
+ }]> & import("@e280/sly").View<[context: ShinyContext, options: {
37
+ button: boolean;
38
+ side?: "left" | "right";
39
+ control?: import("./index.js").DrawerControl;
40
+ }]>;
41
+ ShinyExample: import("@e280/sly").View<[start: number]> & import("@e280/sly").View<[context: ShinyContext, start: number]>;
42
+ ShinyTabs: import("@e280/sly").View<[controlOption?: import("./index.js").TabControl | undefined]> & import("@e280/sly").View<[context: ShinyContext, controlOption?: import("./index.js").TabControl | undefined]>;
43
+ };
44
+ };
45
+ export type Shiny = ReturnType<typeof shiny>;
46
+ export type ShinyViews = Shiny["views"];
47
+ 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,85 @@
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
+ ${renderCssVars({
7
+ ...defaultCssVars(),
8
+ })}
9
+ }
10
+
11
+ :host([view="shiny-button"]:not([plain])) {
12
+ position: relative;
13
+
14
+ --buttoncolor: var(--calm);
15
+ --padding: 0.3em 0.7em;
16
+
17
+ color: white;
18
+ border-radius: 2em;
19
+ background: var(--buttoncolor);
20
+ border: none;
21
+
22
+ font-weight: medium;
23
+ text-shadow: 0.1em 0.1em 0.1em #0004;
24
+ box-shadow: 0.1em 0.2em 0.3em #0002;
25
+ }
26
+
27
+ :host([view="shiny-button"][lame]) { --buttoncolor: var(--lame); }
28
+ :host([view="shiny-button"][angry]) { --buttoncolor: var(--angry); }
29
+ :host([view="shiny-button"][zesty]) { --buttoncolor: var(--zesty); }
30
+ :host([view="shiny-button"][happy]) { --buttoncolor: var(--happy); }
31
+ :host([view="shiny-button"][calm]) { --buttoncolor: var(--calm); }
32
+ :host([view="shiny-button"][sad]) { --buttoncolor: var(--sad); }
33
+ :host([view="shiny-button"][quirky]) { --buttoncolor: var(--quirky); }
34
+
35
+ :host([view="shiny-button"][gradient]:not([plain])) {
36
+ border: none;
37
+ background: linear-gradient(
38
+ to bottom right,
39
+ color-mix(in oklab, var(--buttoncolor), white 40%),
40
+ color-mix(in oklab, var(--buttoncolor), black 20%)
41
+ );
42
+
43
+ &::before {
44
+ content: "";
45
+ display: block;
46
+ position: absolute;
47
+ z-index: 0;
48
+ inset: 0.15em;
49
+ border-radius: inherit;
50
+ background: color-mix(in oklab, var(--buttoncolor), #0004 50%);
51
+ }
52
+
53
+ > * {
54
+ position: relative;
55
+ z-index: 1;
56
+ }
57
+ }
58
+
59
+ :host([view="shiny-drawer"]) {
60
+ display: block;
61
+
62
+ &::part(tray) {
63
+ padding: 1em;
64
+ background: linear-gradient(
65
+ to top right,
66
+ #00a9dd69,
67
+ #70ffd77a
68
+ );
69
+ }
70
+ }
71
+
72
+ :host([view="shiny-drawer"]:state(left)) {
73
+ &::part(tray) {
74
+ border-bottom-right-radius: 0.5em;
75
+ }
76
+ }
77
+
78
+ :host([view="shiny-drawer"]:state(right)) {
79
+ &::part(tray) {
80
+ border-bottom-left-radius: 0.5em;
81
+ }
82
+ }
83
+
84
+ }`;
85
+ //# 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;;;GAGpB,aAAa,CAAC;IACf,GAAG,cAAc,EAAE;CACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4ED,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,14 @@
1
+ export type CssVars = {
2
+ "bg": string;
3
+ "alpha": string;
4
+ "lame": string;
5
+ "inactive-opacity": string;
6
+ "angry": string;
7
+ "zesty": string;
8
+ "happy": string;
9
+ "calm": string;
10
+ "sad": string;
11
+ "quirky": string;
12
+ };
13
+ export declare function defaultCssVars(): CssVars;
14
+ export declare function renderCssVars(vars: CssVars): import("lit").CSSResult;
@@ -0,0 +1,21 @@
1
+ import { unsafeCSS } from "lit";
2
+ export function defaultCssVars() {
3
+ return {
4
+ "bg": "#111",
5
+ "alpha": "#def",
6
+ "inactive-opacity": "0.5",
7
+ "lame": "#8888",
8
+ "angry": "#f50",
9
+ "zesty": "#cf0",
10
+ "happy": "#0fa",
11
+ "calm": "#0af",
12
+ "sad": "#74f",
13
+ "quirky": "#f49",
14
+ };
15
+ }
16
+ export function renderCssVars(vars) {
17
+ return unsafeCSS(Object.entries(vars)
18
+ .map(([key, value]) => `--${key}: var(--shiny-${key}, ${value});`)
19
+ .join("\n"));
20
+ }
21
+ //# 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;AAiB7B,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;QACf,kBAAkB,EAAE,KAAK;QACzB,MAAM,EAAE,OAAO;QACf,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KAChB,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,10 @@
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
+ ${renderCssVars(defaultCssVars())}
7
+ }
8
+
9
+ }`;
10
+ //# 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;;;GAGrB,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":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAY,IAAI,EAAC,MAAM,KAAK,CAAA;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC5C,OAAO,YAAY,MAAM,qCAAqC,CAAA;AAC9D,OAAO,mBAAmB,MAAM,8CAA8C,CAAA;AAC9E,OAAO,uBAAuB,MAAM,kDAAkD,CAAA;AAEtF,MAAM,OAAO,SAAU,SAAQ,CAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAgB,EAAE,IAAwB,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE;IACrE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACtB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAI3B,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CACxB,IAAI,KAAK,SAAS;QACjB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,SAAS,CACZ,CAAA;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAS,UAAU,EAAE,CAAC,CAAA;IAChD,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAA;IACjF,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAC,MAAc,EAAE,EAAE;QAC1D,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACzB,MAAM,WAAW,EAAE,CAAA;IACpB,CAAC,CAAC,CAAA;IAEF,KAAK,UAAU,KAAK;QACnB,IAAI,IAAI,KAAK,SAAS;YAAE,OAAM;QAC9B,IAAI,CAAC;YACJ,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACzC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAA;QAC1B,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACpB,MAAM,WAAW,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC;IACF,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE;QAAE,QAAQ,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;YAC5C,KAAK,SAAS,CAAC,CAAC,OAAO,YAAY,CAAA;YACnC,KAAK,SAAS,CAAC,CAAC,OAAO,YAAY,CAAA;YACnC,KAAK,MAAM,CAAC,CAAC,OAAO,uBAAuB,CAAA;YAC3C,KAAK,KAAK,CAAC,CAAC,OAAO,mBAAmB,CAAA;YACtC,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAChD,CAAC;IAAA,CAAC,CAAC,EAAE,CAAA;IAEL,OAAO,IAAI,CAAA;0BACa,OAAO,CAAC,GAAG,EAAE,aAAa,KAAK;MACnD,IAAI;;GAEP,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,KAAM,SAAQ,YAAY;IACpC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC5B,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,MAAM;KACV,CAAC,CAAA;CACF,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CACpD;CAAG"}
@@ -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