@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.
- package/README.md +113 -3
- package/package.json +3 -3
- package/s/components/button/component.ts +30 -0
- package/s/components/button/style.css.ts +64 -0
- package/s/{ui → components}/copy/component.ts +11 -6
- package/s/{ui → components}/copy/style.css.ts +6 -6
- package/s/components/drawer/component.ts +92 -0
- package/s/components/drawer/control.ts +31 -0
- package/s/components/drawer/style.css.ts +120 -0
- package/s/{ui → components}/example/component.ts +7 -5
- package/s/{ui → components}/example/style.css.ts +2 -2
- package/s/components/foundation.css.ts +15 -0
- package/s/components/framework.ts +10 -0
- package/s/components/raw-components.ts +15 -0
- package/s/components/tabs/component.ts +70 -0
- package/s/components/tabs/control.ts +31 -0
- package/s/components/tabs/style.css.ts +43 -0
- package/s/demo/aura-views.ts +6 -0
- package/s/demo/demo.bundle.ts +287 -14
- package/s/demo/demo.css +3 -1
- package/s/demo/utils/lipsum.ts +19 -0
- package/s/demo/views/demonstration/style.css.ts +18 -2
- package/s/demo/views/demonstration/view.ts +24 -16
- package/s/icons/tabler/menu-2.svg.ts +4 -0
- package/s/icons/tabler/x.svg.ts +4 -0
- package/s/index.html.ts +2 -2
- package/s/index.ts +16 -4
- package/s/install/aura.bundle.ts +9 -0
- package/s/install/plain.bundle.ts +9 -0
- package/s/shiny.ts +15 -0
- package/s/themes/aura.css.ts +86 -0
- package/s/themes/index.barrel.ts +2 -1
- package/s/themes/index.ts +1 -0
- package/s/themes/infra/css-vars.ts +41 -0
- package/s/themes/plain.css.ts +11 -0
- package/s/utils/states.ts +15 -0
- package/x/components/button/component.d.ts +5 -0
- package/x/components/button/component.js +25 -0
- package/x/components/button/component.js.map +1 -0
- package/x/components/button/style.css.js +63 -0
- package/x/components/button/style.css.js.map +1 -0
- package/x/{ui → components}/copy/component.d.ts +8 -4
- package/x/{ui → components}/copy/component.js +10 -5
- package/x/components/copy/component.js.map +1 -0
- package/x/{ui → components}/copy/style.css.js +6 -6
- package/x/components/copy/style.css.js.map +1 -0
- package/x/components/drawer/component.d.ts +387 -0
- package/x/components/drawer/component.js +76 -0
- package/x/components/drawer/component.js.map +1 -0
- package/x/components/drawer/control.d.ts +9 -0
- package/x/components/drawer/control.js +24 -0
- package/x/components/drawer/control.js.map +1 -0
- package/x/components/drawer/style.css.d.ts +2 -0
- package/x/components/drawer/style.css.js +119 -0
- package/x/components/drawer/style.css.js.map +1 -0
- package/x/{ui → components}/example/component.d.ts +3 -3
- package/x/{ui → components}/example/component.js +6 -4
- package/x/components/example/component.js.map +1 -0
- package/x/components/example/style.css.d.ts +2 -0
- package/x/components/example/style.css.js +10 -0
- package/x/components/example/style.css.js.map +1 -0
- package/x/components/foundation.css.d.ts +1 -0
- package/x/components/foundation.css.js +14 -0
- package/x/components/foundation.css.js.map +1 -0
- package/x/components/framework.d.ts +8 -0
- package/x/components/framework.js +5 -0
- package/x/components/framework.js.map +1 -0
- package/x/components/raw-components.d.ts +12 -0
- package/x/components/raw-components.js +13 -0
- package/x/components/raw-components.js.map +1 -0
- package/x/components/tabs/component.d.ts +374 -0
- package/x/components/tabs/component.js +60 -0
- package/x/components/tabs/component.js.map +1 -0
- package/x/components/tabs/control.d.ts +9 -0
- package/x/components/tabs/control.js +24 -0
- package/x/components/tabs/control.js.map +1 -0
- package/x/components/tabs/style.css.d.ts +2 -0
- package/x/components/tabs/style.css.js +42 -0
- package/x/components/tabs/style.css.js.map +1 -0
- package/x/demo/aura-views.d.ts +15 -0
- package/x/demo/aura-views.js +4 -0
- package/x/demo/aura-views.js.map +1 -0
- package/x/demo/demo.bundle.js +280 -14
- package/x/demo/demo.bundle.js.map +1 -1
- package/x/demo/demo.bundle.min.js +561 -45
- package/x/demo/demo.bundle.min.js.map +4 -4
- package/x/demo/demo.css +3 -1
- package/x/demo/utils/lipsum.d.ts +2 -0
- package/x/demo/utils/lipsum.js +11 -0
- package/x/demo/utils/lipsum.js.map +1 -0
- package/x/demo/views/demonstration/style.css.js +18 -2
- package/x/demo/views/demonstration/style.css.js.map +1 -1
- package/x/demo/views/demonstration/view.d.ts +6 -4
- package/x/demo/views/demonstration/view.js +20 -12
- package/x/demo/views/demonstration/view.js.map +1 -1
- package/x/icons/tabler/menu-2.svg.d.ts +2 -0
- package/x/icons/tabler/menu-2.svg.js +3 -0
- package/x/icons/tabler/menu-2.svg.js.map +1 -0
- package/x/icons/tabler/x.svg.d.ts +2 -0
- package/x/icons/tabler/x.svg.js +3 -0
- package/x/icons/tabler/x.svg.js.map +1 -0
- package/x/index.d.ts +10 -4
- package/x/index.html +7 -5
- package/x/index.html.js +2 -2
- package/x/index.js +10 -4
- package/x/index.js.map +1 -1
- package/x/install/aura.bundle.d.ts +1 -0
- package/x/install/aura.bundle.js +5 -0
- package/x/install/aura.bundle.js.map +1 -0
- package/x/install/aura.bundle.min.js +463 -0
- package/x/install/aura.bundle.min.js.map +7 -0
- package/x/install/plain.bundle.d.ts +1 -0
- package/x/install/plain.bundle.js +5 -0
- package/x/install/plain.bundle.js.map +1 -0
- package/x/install/plain.bundle.min.js +390 -0
- package/x/install/plain.bundle.min.js.map +7 -0
- package/x/shiny.d.ts +47 -0
- package/x/shiny.js +8 -0
- package/x/shiny.js.map +1 -0
- package/x/themes/aura.css.d.ts +1 -0
- package/x/themes/aura.css.js +85 -0
- package/x/themes/aura.css.js.map +1 -0
- package/x/themes/index.barrel.d.ts +2 -1
- package/x/themes/index.barrel.js +2 -1
- package/x/themes/index.barrel.js.map +1 -1
- package/x/themes/index.d.ts +1 -0
- package/x/themes/infra/css-vars.d.ts +14 -0
- package/x/themes/infra/css-vars.js +21 -0
- package/x/themes/infra/css-vars.js.map +1 -0
- package/x/themes/plain.css.d.ts +1 -0
- package/x/themes/plain.css.js +10 -0
- package/x/themes/plain.css.js.map +1 -0
- package/x/utils/states.d.ts +5 -0
- package/x/utils/states.js +13 -0
- package/x/utils/states.js.map +1 -0
- package/s/themes/basic.css.ts +0 -18
- package/s/tools/untab.ts +0 -30
- package/s/ui/components.ts +0 -9
- package/s/ui/framework.ts +0 -8
- package/s/ui/themers.ts +0 -28
- package/x/themes/basic.css.d.ts +0 -1
- package/x/themes/basic.css.js +0 -17
- package/x/themes/basic.css.js.map +0 -1
- package/x/tools/untab.d.ts +0 -1
- package/x/tools/untab.js +0 -26
- package/x/tools/untab.js.map +0 -1
- package/x/ui/components.d.ts +0 -6
- package/x/ui/components.js +0 -7
- package/x/ui/components.js.map +0 -1
- package/x/ui/copy/component.js.map +0 -1
- package/x/ui/copy/style.css.js.map +0 -1
- package/x/ui/example/component.js.map +0 -1
- package/x/ui/example/style.css.js +0 -10
- package/x/ui/example/style.css.js.map +0 -1
- package/x/ui/framework.d.ts +0 -4
- package/x/ui/framework.js +0 -6
- package/x/ui/framework.js.map +0 -1
- package/x/ui/themers.d.ts +0 -8
- package/x/ui/themers.js +0 -12
- package/x/ui/themers.js.map +0 -1
- /package/x/{ui/copy → components/button}/style.css.d.ts +0 -0
- /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
|
-
|
|
4
|
-
export * from "./
|
|
5
|
-
|
|
6
|
-
export * from "./
|
|
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
|
|
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
|
+
|
package/s/themes/index.barrel.ts
CHANGED
package/s/themes/index.ts
CHANGED
|
@@ -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,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,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 {
|
|
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
|
-
|
|
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
|
-
}, [
|
|
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 => (
|
|
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.
|
|
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":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AAEnC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAe,YAAY,EAAC,MAAM,iBAAiB,CAAA;AAC1D,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,OAAqB,EAAE,IAAwB,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE;IAC1E,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACtB,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAIlD,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,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC7B,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,MAAM;KACV,CAAC,CAAA;IACF,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA,CAAC,CAAC;IACpC,IAAI,EAAE,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAA,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA,CAAC,CAAC;CAChC,CAAC;KACD,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAC1C;CAAG"}
|
|
@@ -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:
|
|
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(--
|
|
24
|
+
color: var(--lame);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
[data-status="good"] {
|
|
28
28
|
opacity: 1;
|
|
29
|
-
color: var(--
|
|
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(--
|
|
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"}
|