@e280/shiny 0.1.0-1 → 0.1.0-3

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 (55) hide show
  1. package/README.md +85 -3
  2. package/package.json +3 -3
  3. package/s/demo/demo.bundle.ts +7 -7
  4. package/s/demo/demo.css +3 -1
  5. package/s/demo/views/demonstration/view.ts +4 -4
  6. package/s/index.html.ts +1 -1
  7. package/s/index.ts +4 -2
  8. package/s/install.bundle.ts +9 -0
  9. package/s/shiny.ts +15 -0
  10. package/s/ui/copy/component.ts +5 -5
  11. package/s/ui/example/component.ts +5 -5
  12. package/s/ui/framework.ts +4 -1
  13. package/s/ui/{components.ts → raw-components.ts} +1 -1
  14. package/x/demo/demo.bundle.js +7 -7
  15. package/x/demo/demo.bundle.js.map +1 -1
  16. package/x/demo/demo.bundle.min.js +31 -31
  17. package/x/demo/demo.bundle.min.js.map +4 -4
  18. package/x/demo/demo.css +3 -1
  19. package/x/demo/views/demonstration/view.d.ts +2 -2
  20. package/x/demo/views/demonstration/view.js +2 -2
  21. package/x/demo/views/demonstration/view.js.map +1 -1
  22. package/x/index.d.ts +2 -2
  23. package/x/index.html +6 -4
  24. package/x/index.html.js +1 -1
  25. package/x/index.js +2 -2
  26. package/x/index.js.map +1 -1
  27. package/x/install.bundle.d.ts +1 -0
  28. package/x/install.bundle.js +5 -0
  29. package/x/install.bundle.js.map +1 -0
  30. package/x/install.bundle.min.js +135 -0
  31. package/x/install.bundle.min.js.map +7 -0
  32. package/x/shiny.d.ts +20 -0
  33. package/x/shiny.js +8 -0
  34. package/x/shiny.js.map +1 -0
  35. package/x/ui/copy/component.d.ts +3 -3
  36. package/x/ui/copy/component.js +4 -4
  37. package/x/ui/copy/component.js.map +1 -1
  38. package/x/ui/example/component.d.ts +3 -3
  39. package/x/ui/example/component.js +4 -4
  40. package/x/ui/example/component.js.map +1 -1
  41. package/x/ui/framework.d.ts +5 -1
  42. package/x/ui/framework.js +1 -1
  43. package/x/ui/framework.js.map +1 -1
  44. package/x/ui/{components.d.ts → raw-components.d.ts} +1 -1
  45. package/x/ui/{components.js → raw-components.js} +2 -2
  46. package/x/ui/raw-components.js.map +1 -0
  47. package/s/tools/untab.ts +0 -30
  48. package/s/ui/themers.ts +0 -28
  49. package/x/tools/untab.d.ts +0 -1
  50. package/x/tools/untab.js +0 -26
  51. package/x/tools/untab.js.map +0 -1
  52. package/x/ui/components.js.map +0 -1
  53. package/x/ui/themers.d.ts +0 -8
  54. package/x/ui/themers.js +0 -12
  55. package/x/ui/themers.js.map +0 -1
package/x/shiny.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import { ShinyContext } from "./ui/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
+ ShinyExample: {
9
+ new (): import("./index.js").ShinyExample;
10
+ view: import("@e280/sly").View<[start: number]>;
11
+ } & typeof import("./index.js").ShinyExample;
12
+ };
13
+ views: {
14
+ ShinyCopy: import("@e280/sly").View<[text: string | undefined, ms?: any]>;
15
+ ShinyExample: import("@e280/sly").View<[start: number]>;
16
+ };
17
+ };
18
+ export type Shiny = ReturnType<typeof shiny>;
19
+ export type ShinyViews = Shiny["views"];
20
+ 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 "./ui/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,wBAAwB,CAAA;AAEpD,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"}
@@ -1,11 +1,11 @@
1
- import { CSSResult } from "lit";
1
+ import { ShinyContext } from "../framework.js";
2
2
  declare const ShinyCopy_base: import("@e280/sly").ComponentClass<{
3
3
  new (): {
4
4
  attrs: import("@e280/sly").AttrTypes<{
5
5
  text: StringConstructor;
6
6
  ms: NumberConstructor;
7
7
  }>;
8
- theme: CSSResult;
8
+ context: ShinyContext;
9
9
  #private: any;
10
10
  readonly shadow: ShadowRoot;
11
11
  createShadow(): ShadowRoot;
@@ -366,7 +366,7 @@ declare const ShinyCopy_base: import("@e280/sly").ComponentClass<{
366
366
  focus(options?: FocusOptions): void;
367
367
  };
368
368
  styles: import("lit").CSSResultGroup | undefined;
369
- }, [theme: CSSResult, text: string | undefined, ms?: any]>;
369
+ }, [context: ShinyContext, text: string | undefined, ms?: any]>;
370
370
  export declare class ShinyCopy extends ShinyCopy_base {
371
371
  }
372
372
  export {};
@@ -1,14 +1,14 @@
1
+ import { html } from "lit";
1
2
  import { debounce } from "@e280/stz";
2
3
  import { dom, view } from "@e280/sly";
3
- import { html } from "lit";
4
4
  import styleCss from "./style.css.js";
5
5
  import { ShinyElement } from "../framework.js";
6
6
  import clipboardSvg from "../../icons/tabler/clipboard.svg.js";
7
7
  import clipboardXFilledSvg from "../../icons/tabler/clipboard-x-filled.svg.js";
8
8
  import clipboardCheckFilledSvg from "../../icons/tabler/clipboard-check-filled.svg.js";
9
- export class ShinyCopy extends (view(use => (theme, text, ms = 1000) => {
9
+ export class ShinyCopy extends (view(use => (context, text, ms = 1000) => {
10
10
  use.name("shiny-copy");
11
- use.styles(theme, styleCss);
11
+ use.styles(context.theme, styleCss);
12
12
  const baseStatus = () => (text === undefined
13
13
  ? "invalid"
14
14
  : "neutral");
@@ -51,6 +51,6 @@ export class ShinyCopy extends (view(use => (theme, text, ms = 1000) => {
51
51
  ms: Number,
52
52
  });
53
53
  })
54
- .props(el => [el.theme, el.attrs.text, el.attrs.ms])) {
54
+ .props(el => [el.context, el.attrs.text, el.attrs.ms])) {
55
55
  }
56
56
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
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,UA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D,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,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CACtD;CAAG"}
@@ -1,10 +1,10 @@
1
- import { CSSResult } from "lit";
1
+ import { ShinyContext } from "../framework.js";
2
2
  declare const ShinyExample_base: import("@e280/sly").ComponentClass<{
3
3
  new (): {
4
4
  attrs: import("@e280/sly").AttrTypes<{
5
5
  start: NumberConstructor;
6
6
  }>;
7
- theme: CSSResult;
7
+ context: ShinyContext;
8
8
  #private: any;
9
9
  readonly shadow: ShadowRoot;
10
10
  createShadow(): ShadowRoot;
@@ -365,7 +365,7 @@ declare const ShinyExample_base: import("@e280/sly").ComponentClass<{
365
365
  focus(options?: FocusOptions): void;
366
366
  };
367
367
  styles: import("lit").CSSResultGroup | undefined;
368
- }, [theme: CSSResult, start: number]>;
368
+ }, [context: ShinyContext, start: number]>;
369
369
  export declare class ShinyExample extends ShinyExample_base {
370
370
  }
371
371
  export {};
@@ -1,9 +1,9 @@
1
- import { dom, view } from "@e280/sly";
2
1
  import { html } from "lit";
2
+ import { dom, view } from "@e280/sly";
3
3
  import styleCss from "./style.css.js";
4
4
  import { ShinyElement } from "../framework.js";
5
- export class ShinyExample extends (view(use => (theme, start) => {
6
- use.styles(theme, styleCss);
5
+ export class ShinyExample extends (view(use => (context, start) => {
6
+ use.styles(context.theme, styleCss);
7
7
  const $count = use.signal(start);
8
8
  const increment = () => { $count.value++; };
9
9
  return html `
@@ -15,6 +15,6 @@ export class ShinyExample extends (view(use => (theme, start) => {
15
15
  .component(class extends ShinyElement {
16
16
  attrs = dom.attrs(this).spec({ start: Number });
17
17
  })
18
- .props(el => [el.theme, el.attrs.start ?? 1])) {
18
+ .props(el => [el.context, el.attrs.start ?? 1])) {
19
19
  }
20
20
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
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
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/ui/example/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,OAAO,YAAa,SAAQ,CACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,KAAa,EAAE,EAAE;IACpD,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAEnC,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,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAU,CAAC,CACxD;CAAG"}
@@ -1,4 +1,8 @@
1
+ import { CSSResultGroup } from "lit";
1
2
  import { BaseElement } from "@e280/sly";
3
+ export type ShinyContext = {
4
+ theme: CSSResultGroup;
5
+ };
2
6
  export declare class ShinyElement extends BaseElement {
3
- theme: import("lit").CSSResult;
7
+ context: ShinyContext;
4
8
  }
package/x/ui/framework.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BaseElement } from "@e280/sly";
2
2
  import { basic } from "../themes/basic.css.js";
3
3
  export class ShinyElement extends BaseElement {
4
- theme = basic;
4
+ context = { theme: basic };
5
5
  }
6
6
  //# sourceMappingURL=framework.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"framework.js","sourceRoot":"","sources":["../../s/ui/framework.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AACrC,OAAO,EAAC,KAAK,EAAC,MAAM,wBAAwB,CAAA;AAI5C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC5C,OAAO,GAAiB,EAAC,KAAK,EAAE,KAAK,EAAC,CAAA;CACtC"}
@@ -1,6 +1,6 @@
1
1
  import { ShinyCopy } from "./copy/component.js";
2
2
  import { ShinyExample } from "./example/component.js";
3
- export declare const components: {
3
+ export declare const rawComponents: {
4
4
  ShinyCopy: typeof ShinyCopy;
5
5
  ShinyExample: typeof ShinyExample;
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import { ShinyCopy } from "./copy/component.js";
2
2
  import { ShinyExample } from "./example/component.js";
3
- export const components = {
3
+ export const rawComponents = {
4
4
  ShinyCopy,
5
5
  ShinyExample,
6
6
  };
7
- //# sourceMappingURL=components.js.map
7
+ //# sourceMappingURL=raw-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-components.js","sourceRoot":"","sources":["../../s/ui/raw-components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAA;AAEnD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,SAAS;IACT,YAAY;CACZ,CAAA"}
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
-
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 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 +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"}
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"}