@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/s/index.ts CHANGED
@@ -1,7 +1,19 @@
1
1
 
2
2
  export * from "./themes/index.js"
3
- export * from "./ui/example/component.js"
4
- export * from "./ui/copy/component.js"
5
- export * from "./ui/themers.js"
6
- export * from "./ui/components.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"
7
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
+
package/s/shiny.ts ADDED
@@ -0,0 +1,15 @@
1
+
2
+ import {contextualizeComponents, getViews} from "@e280/sly"
3
+ import {ShinyContext} from "./components/framework.js"
4
+ import {rawComponents} from "./components/raw-components.js"
5
+
6
+ export function shiny(context: ShinyContext) {
7
+ const components = contextualizeComponents(context, rawComponents)
8
+ const views = getViews(components)
9
+ return {components, views}
10
+ }
11
+
12
+ export type Shiny = ReturnType<typeof shiny>
13
+ export type ShinyViews = Shiny["views"]
14
+ export type ShinyComponents = Shiny["components"]
15
+
@@ -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"]) {
61
+ display: block;
62
+
63
+ &::part(tray) {
64
+ padding: 1em;
65
+ background: linear-gradient(
66
+ to top right,
67
+ #00a9dd69,
68
+ #70ffd77a
69
+ );
70
+ }
71
+ }
72
+
73
+ :host([view="shiny-drawer"]:state(left)) {
74
+ &::part(tray) {
75
+ border-bottom-right-radius: 0.5em;
76
+ }
77
+ }
78
+
79
+ :host([view="shiny-drawer"]:state(right)) {
80
+ &::part(tray) {
81
+ border-bottom-left-radius: 0.5em;
82
+ }
83
+ }
84
+
85
+ }`
86
+
@@ -1,3 +1,4 @@
1
1
 
2
- export * from "./basic.css.js"
2
+ export * from "./plain.css.js"
3
+ export * from "./aura.css.js"
3
4
 
package/s/themes/index.ts CHANGED
@@ -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,41 @@
1
+
2
+ import {unsafeCSS} from "lit"
3
+
4
+ export type CssVars = {
5
+ "bg": string
6
+ "alpha": string
7
+ "lame": string
8
+ "inactive-opacity": string
9
+
10
+ // normative color vibes
11
+ "angry": string // red
12
+ "zesty": string // yellow
13
+ "happy": string // green
14
+ "calm": string // cyan
15
+ "sad": string // blue
16
+ "quirky": string // magenta
17
+ }
18
+
19
+ export function defaultCssVars(): CssVars {
20
+ return {
21
+ "bg": "#111",
22
+ "alpha": "#def",
23
+ "inactive-opacity": "0.5",
24
+ "lame": "#8888",
25
+ "angry": "#f50",
26
+ "zesty": "#cf0",
27
+ "happy": "#0fa",
28
+ "calm": "#0af",
29
+ "sad": "#74f",
30
+ "quirky": "#f49",
31
+ }
32
+ }
33
+
34
+ export function renderCssVars(vars: CssVars) {
35
+ return unsafeCSS(
36
+ Object.entries(vars)
37
+ .map(([key, value]) => `--${key}: var(--shiny-${key}, ${value});`)
38
+ .join("\n")
39
+ )
40
+ }
41
+
@@ -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,5 @@
1
+ import { ShinyContext, ShinyElement } from "../framework.js";
2
+ declare const ShinyButton_base: import("@e280/sly").ComponentClass<typeof ShinyElement, [context: ShinyContext]>;
3
+ export declare class ShinyButton extends ShinyButton_base {
4
+ }
5
+ export {};
@@ -0,0 +1,25 @@
1
+ import { html } from "lit";
2
+ import { view } from "@e280/sly";
3
+ import styleCss from "./style.css.js";
4
+ import { foundationCss } from "../foundation.css.js";
5
+ import { ShinyElement } from "../framework.js";
6
+ export class ShinyButton extends (view(use => (context) => {
7
+ use.name("shiny-button");
8
+ use.styles(foundationCss, context.theme, styleCss);
9
+ const attrs = use.attrs.spec({
10
+ disabled: Boolean,
11
+ hidden: Boolean,
12
+ });
13
+ return html `
14
+ <button
15
+ part=button
16
+ ?disabled="${attrs.disabled}"
17
+ ?hidden="${attrs.hidden}">
18
+ <slot></slot>
19
+ </button>
20
+ `;
21
+ })
22
+ .component(ShinyElement)
23
+ .props(el => [el.context])) {
24
+ }
25
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/button/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAE1D,MAAM,OAAO,WAAY,SAAQ,CAChC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAqB,EAAE,EAAE;IACrC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACxB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAElD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5B,QAAQ,EAAE,OAAO;QACjB,MAAM,EAAE,OAAO;KACf,CAAC,CAAA;IAEF,OAAO,IAAI,CAAA;;;iBAGI,KAAK,CAAC,QAAQ;eAChB,KAAK,CAAC,MAAM;;;GAGxB,CAAA;AACF,CAAC,CAAC;KACD,SAAS,CAAC,YAAY,CAAC;KACvB,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAU,CAAC,CACnC;CAAG"}
@@ -0,0 +1,63 @@
1
+ import { css } from "lit";
2
+ export default css `@layer view {
3
+
4
+ :host {
5
+ opacity: 0.8;
6
+ display: inline-flex;
7
+ width: max-content;
8
+ height: max-content;
9
+
10
+ --padding: 0.3em;
11
+ border-radius: 0.2em;
12
+ border: 0.1em solid currentColor;
13
+
14
+ cursor: pointer;
15
+ background: transparent;
16
+ user-select: none;
17
+ }
18
+
19
+ :host(:not([disabled]):is(:hover, :focus-visible)) { opacity: 1; }
20
+ :host(:not([disabled]):active) { opacity: 0.6; }
21
+
22
+ :host([disabled]) {
23
+ cursor: default;
24
+ color: var(--lame);
25
+ }
26
+
27
+ :host([hidden]) {
28
+ display: none !important;
29
+ }
30
+
31
+ :host([lame]) { color: var(--lame); }
32
+ :host([angry]) { color: var(--angry); }
33
+ :host([zesty]) { color: var(--zesty); }
34
+ :host([happy]) { color: var(--happy); }
35
+ :host([calm]) { color: var(--calm); }
36
+ :host([sad]) { color: var(--sad); }
37
+ :host([quirky]) { color: var(--quirky); }
38
+
39
+ button {
40
+ background: transparent;
41
+ border: none;
42
+
43
+ font: inherit;
44
+ color: inherit;
45
+ cursor: inherit;
46
+ outline: inherit;
47
+ text-shadow: inherit;
48
+
49
+ display: inline-flex;
50
+ justify-content: center;
51
+ align-items: center;
52
+
53
+ width: 100%;
54
+ height: 100%;
55
+ padding: var(--padding);
56
+ }
57
+
58
+ slot {
59
+ display: contents;
60
+ }
61
+
62
+ }`;
63
+ //# sourceMappingURL=style.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/button/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DhB,CAAA"}
@@ -1,11 +1,15 @@
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
- attrs: import("@e280/sly").AttrTypes<{
4
+ #attrs: import("@e280/sly").AttrTypes<{
5
5
  text: StringConstructor;
6
6
  ms: NumberConstructor;
7
7
  }>;
8
- theme: CSSResult;
8
+ get text(): string | undefined;
9
+ set text(v: string | undefined);
10
+ get ms(): number | undefined;
11
+ set ms(v: number | undefined);
12
+ context: ShinyContext;
9
13
  #private: any;
10
14
  readonly shadow: ShadowRoot;
11
15
  createShadow(): ShadowRoot;
@@ -366,7 +370,7 @@ declare const ShinyCopy_base: import("@e280/sly").ComponentClass<{
366
370
  focus(options?: FocusOptions): void;
367
371
  };
368
372
  styles: import("lit").CSSResultGroup | undefined;
369
- }, [theme: CSSResult, text: string | undefined, ms?: any]>;
373
+ }, [context: ShinyContext, text: string | undefined, ms?: any]>;
370
374
  export declare class ShinyCopy extends ShinyCopy_base {
371
375
  }
372
376
  export {};
@@ -1,14 +1,15 @@
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
+ import { foundationCss } from "../foundation.css.js";
5
6
  import { ShinyElement } from "../framework.js";
6
7
  import clipboardSvg from "../../icons/tabler/clipboard.svg.js";
7
8
  import clipboardXFilledSvg from "../../icons/tabler/clipboard-x-filled.svg.js";
8
9
  import clipboardCheckFilledSvg from "../../icons/tabler/clipboard-check-filled.svg.js";
9
- export class ShinyCopy extends (view(use => (theme, text, ms = 1000) => {
10
+ export class ShinyCopy extends (view(use => (context, text, ms = 1000) => {
10
11
  use.name("shiny-copy");
11
- use.styles(theme, styleCss);
12
+ use.styles(foundationCss, context.theme, styleCss);
12
13
  const baseStatus = () => (text === undefined
13
14
  ? "invalid"
14
15
  : "neutral");
@@ -46,11 +47,15 @@ export class ShinyCopy extends (view(use => (theme, text, ms = 1000) => {
46
47
  `;
47
48
  })
48
49
  .component(class extends ShinyElement {
49
- attrs = dom.attrs(this).spec({
50
+ #attrs = dom.attrs(this).spec({
50
51
  text: String,
51
52
  ms: Number,
52
53
  });
54
+ get text() { return this.#attrs.text; }
55
+ set text(v) { this.#attrs.text = v; }
56
+ get ms() { return this.#attrs.ms; }
57
+ set ms(v) { this.#attrs.ms = v; }
53
58
  })
54
- .props(el => [el.theme, el.attrs.text, el.attrs.ms])) {
59
+ .props(el => [el.context, el.text, el.ms])) {
55
60
  }
56
61
  //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/components/copy/component.ts"],"names":[],"mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  import { css } from "lit";
2
- export default css `
2
+ export default css `@layer view {
3
3
 
4
4
  button {
5
5
  background: transparent;
@@ -8,7 +8,7 @@ button {
8
8
  }
9
9
 
10
10
  button {
11
- opacity: 0.5;
11
+ opacity: var(--inactive-opacity);
12
12
  cursor: pointer;
13
13
  cursor: copy;
14
14
 
@@ -21,18 +21,18 @@ button {
21
21
  }
22
22
 
23
23
  [data-status="invalid"] {
24
- color: var(--invalid);
24
+ color: var(--lame);
25
25
  }
26
26
 
27
27
  [data-status="good"] {
28
28
  opacity: 1;
29
- color: var(--good);
29
+ color: var(--happy);
30
30
  filter: drop-shadow(0 0 0.3em color-mix(in oklab, transparent, currentColor 50%));
31
31
  }
32
32
 
33
33
  [data-status="bad"] {
34
34
  opacity: 1;
35
- color: var(--bad);
35
+ color: var(--angry);
36
36
  filter: drop-shadow(0 0 0.3em color-mix(in oklab, transparent, currentColor 50%));
37
37
  }
38
38
 
@@ -41,5 +41,5 @@ svg {
41
41
  height: 1em;
42
42
  }
43
43
 
44
- `;
44
+ }`;
45
45
  //# sourceMappingURL=style.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../s/components/copy/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0ChB,CAAA"}