@transcodes/ui-components 0.4.3 → 0.4.4
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/CHANGELOG.md +6 -0
- package/dist/controllers/animation.controller.d.ts +48 -0
- package/dist/controllers/animation.controller.d.ts.map +1 -0
- package/dist/controllers/animation.controller.js +32 -0
- package/dist/controllers/base.controller.d.ts +14 -0
- package/dist/controllers/base.controller.d.ts.map +1 -0
- package/dist/controllers/base.controller.js +8 -0
- package/dist/controllers/history.controller.d.ts +34 -0
- package/dist/controllers/history.controller.d.ts.map +1 -0
- package/dist/controllers/history.controller.js +26 -0
- package/dist/controllers/index.d.ts +9 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +16 -0
- package/dist/controllers/loading.controller.d.ts +36 -0
- package/dist/controllers/loading.controller.d.ts.map +1 -0
- package/dist/controllers/loading.controller.js +27 -0
- package/dist/controllers/match-media.controller.d.ts +32 -0
- package/dist/controllers/match-media.controller.d.ts.map +1 -0
- package/dist/controllers/match-media.controller.js +20 -0
- package/dist/controllers/message-bus.controller.d.ts +45 -0
- package/dist/controllers/message-bus.controller.d.ts.map +1 -0
- package/dist/controllers/message-bus.controller.js +45 -0
- package/dist/controllers/storage.controller.d.ts +40 -0
- package/dist/controllers/storage.controller.d.ts.map +1 -0
- package/dist/controllers/storage.controller.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/primitives/index.d.ts +22 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +44 -0
- package/dist/primitives/tc-box.d.ts +20 -0
- package/dist/primitives/tc-box.d.ts.map +1 -0
- package/dist/primitives/tc-box.js +38 -0
- package/dist/primitives/tc-button.d.ts +26 -0
- package/dist/primitives/tc-button.d.ts.map +1 -0
- package/dist/primitives/tc-button.js +168 -0
- package/dist/primitives/tc-callout.d.ts +24 -0
- package/dist/primitives/tc-callout.d.ts.map +1 -0
- package/dist/primitives/tc-callout.js +91 -0
- package/dist/primitives/tc-card.d.ts +21 -0
- package/dist/primitives/tc-card.d.ts.map +1 -0
- package/dist/primitives/tc-card.js +77 -0
- package/dist/primitives/tc-chip.d.ts +21 -0
- package/dist/primitives/tc-chip.d.ts.map +1 -0
- package/dist/primitives/tc-chip.js +90 -0
- package/dist/primitives/tc-container.d.ts +21 -0
- package/dist/primitives/tc-container.d.ts.map +1 -0
- package/dist/primitives/tc-container.js +64 -0
- package/dist/primitives/tc-divider.d.ts +22 -0
- package/dist/primitives/tc-divider.d.ts.map +1 -0
- package/dist/primitives/tc-divider.js +78 -0
- package/dist/primitives/tc-error-message.d.ts +25 -0
- package/dist/primitives/tc-error-message.d.ts.map +1 -0
- package/dist/primitives/tc-error-message.js +81 -0
- package/dist/primitives/tc-form-header.d.ts +26 -0
- package/dist/primitives/tc-form-header.d.ts.map +1 -0
- package/dist/primitives/tc-form-header.js +122 -0
- package/dist/primitives/tc-icon.d.ts +20 -0
- package/dist/primitives/tc-icon.d.ts.map +1 -0
- package/dist/primitives/tc-icon.js +95 -0
- package/dist/primitives/tc-input-with-chip.d.ts +40 -0
- package/dist/primitives/tc-input-with-chip.d.ts.map +1 -0
- package/dist/primitives/tc-input-with-chip.js +250 -0
- package/dist/primitives/tc-input.d.ts +46 -0
- package/dist/primitives/tc-input.d.ts.map +1 -0
- package/dist/primitives/tc-input.js +264 -0
- package/dist/primitives/tc-item-button.d.ts +29 -0
- package/dist/primitives/tc-item-button.d.ts.map +1 -0
- package/dist/primitives/tc-item-button.js +163 -0
- package/dist/primitives/tc-item.d.ts +24 -0
- package/dist/primitives/tc-item.d.ts.map +1 -0
- package/dist/primitives/tc-item.js +88 -0
- package/dist/primitives/tc-otp-input.d.ts +40 -0
- package/dist/primitives/tc-otp-input.d.ts.map +1 -0
- package/dist/primitives/tc-otp-input.js +236 -0
- package/dist/primitives/tc-page-decoration.d.ts +21 -0
- package/dist/primitives/tc-page-decoration.d.ts.map +1 -0
- package/dist/primitives/tc-page-decoration.js +130 -0
- package/dist/primitives/tc-section.d.ts +19 -0
- package/dist/primitives/tc-section.d.ts.map +1 -0
- package/dist/primitives/tc-section.js +47 -0
- package/dist/primitives/tc-spinner.d.ts +21 -0
- package/dist/primitives/tc-spinner.d.ts.map +1 -0
- package/dist/primitives/tc-spinner.js +90 -0
- package/dist/primitives/tc-symbol.d.ts +19 -0
- package/dist/primitives/tc-symbol.d.ts.map +1 -0
- package/dist/primitives/tc-symbol.js +54 -0
- package/dist/primitives/tc-text.d.ts +32 -0
- package/dist/primitives/tc-text.d.ts.map +1 -0
- package/dist/primitives/tc-text.js +145 -0
- package/dist/primitives/tc-toast.d.ts +36 -0
- package/dist/primitives/tc-toast.d.ts.map +1 -0
- package/dist/primitives/tc-toast.js +199 -0
- package/dist/screens/index.d.ts +4 -0
- package/dist/screens/index.d.ts.map +1 -0
- package/dist/screens/index.js +8 -0
- package/dist/screens/tc-error-screen.d.ts +34 -0
- package/dist/screens/tc-error-screen.d.ts.map +1 -0
- package/dist/screens/tc-error-screen.js +177 -0
- package/dist/screens/tc-loading-screen.d.ts +25 -0
- package/dist/screens/tc-loading-screen.d.ts.map +1 -0
- package/dist/screens/tc-loading-screen.js +85 -0
- package/dist/screens/tc-success-screen.d.ts +33 -0
- package/dist/screens/tc-success-screen.d.ts.map +1 -0
- package/dist/screens/tc-success-screen.js +200 -0
- package/dist/styles/shared.d.ts +20 -0
- package/dist/styles/shared.d.ts.map +1 -0
- package/dist/styles/shared.js +7 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { css as c, LitElement as d, html as m } from "lit";
|
|
2
|
+
import { property as b, customElement as p } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as v } from "lit/directives/style-map.js";
|
|
4
|
+
import { sharedStyles as u } from "../styles/shared.js";
|
|
5
|
+
var f = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (l, t, o, a) => {
|
|
6
|
+
for (var r = a > 1 ? void 0 : a ? h(t, o) : t, i = l.length - 1, s; i >= 0; i--)
|
|
7
|
+
(s = l[i]) && (r = (a ? s(t, o, r) : s(r)) || r);
|
|
8
|
+
return a && r && f(t, o, r), r;
|
|
9
|
+
};
|
|
10
|
+
let e = class extends d {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.variant = "primary", this.sx = {};
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return m`
|
|
16
|
+
<div part="decoration" class="decoration" style=${v(this.sx)}>
|
|
17
|
+
<div part="blob" class="blob blob-1"></div>
|
|
18
|
+
<div part="blob" class="blob blob-2"></div>
|
|
19
|
+
<div part="blob" class="blob blob-3"></div>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
e.styles = [
|
|
25
|
+
u,
|
|
26
|
+
c`
|
|
27
|
+
:host {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset: 0;
|
|
30
|
+
z-index: 0;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.decoration {
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.blob {
|
|
41
|
+
position: absolute;
|
|
42
|
+
border-radius: var(--radius-full);
|
|
43
|
+
opacity: 0.35;
|
|
44
|
+
filter: blur(0.0625rem);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Primary (purple) variant */
|
|
48
|
+
:host([variant='primary']) .blob {
|
|
49
|
+
background: radial-gradient(
|
|
50
|
+
circle,
|
|
51
|
+
var(--accent-primary) 0%,
|
|
52
|
+
transparent 70%
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Success (green) variant */
|
|
57
|
+
:host([variant='success']) .blob {
|
|
58
|
+
background: radial-gradient(
|
|
59
|
+
circle,
|
|
60
|
+
var(--accent-success) 0%,
|
|
61
|
+
transparent 70%
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Error (red) variant */
|
|
66
|
+
:host([variant='error']) .blob {
|
|
67
|
+
background: radial-gradient(
|
|
68
|
+
circle,
|
|
69
|
+
var(--error-base) 0%,
|
|
70
|
+
transparent 70%
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.blob-1 {
|
|
75
|
+
width: 18rem;
|
|
76
|
+
height: 18rem;
|
|
77
|
+
top: -6rem;
|
|
78
|
+
left: -5rem;
|
|
79
|
+
animation: decorFloat 12s ease-in-out infinite;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.blob-2 {
|
|
83
|
+
width: 14rem;
|
|
84
|
+
height: 14rem;
|
|
85
|
+
top: 30%;
|
|
86
|
+
right: -6rem;
|
|
87
|
+
animation: decorFloat 10s ease-in-out infinite reverse;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.blob-3 {
|
|
91
|
+
width: var(--size-decoration-blob);
|
|
92
|
+
height: var(--size-decoration-blob);
|
|
93
|
+
bottom: -8rem;
|
|
94
|
+
left: 20%;
|
|
95
|
+
animation: decorFloat 14s ease-in-out infinite 2s;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes decorFloat {
|
|
99
|
+
0%,
|
|
100
|
+
100% {
|
|
101
|
+
transform: translate(0, 0) scale(1);
|
|
102
|
+
}
|
|
103
|
+
33% {
|
|
104
|
+
transform: translate(0.375rem, -0.5rem) scale(1.08);
|
|
105
|
+
}
|
|
106
|
+
66% {
|
|
107
|
+
transform: translate(-0.25rem, -0.25rem) scale(1.15);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Reduced motion */
|
|
112
|
+
@media (prefers-reduced-motion: reduce) {
|
|
113
|
+
.blob {
|
|
114
|
+
animation: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
`
|
|
118
|
+
];
|
|
119
|
+
n([
|
|
120
|
+
b({ type: String })
|
|
121
|
+
], e.prototype, "variant", 2);
|
|
122
|
+
n([
|
|
123
|
+
b({ type: Object })
|
|
124
|
+
], e.prototype, "sx", 2);
|
|
125
|
+
e = n([
|
|
126
|
+
p("tc-page-decoration")
|
|
127
|
+
], e);
|
|
128
|
+
export {
|
|
129
|
+
e as TcPageDecoration
|
|
130
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SxProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A section container with flex column layout.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Section content
|
|
7
|
+
* @csspart section - The section element
|
|
8
|
+
*/
|
|
9
|
+
export declare class TcSection extends LitElement {
|
|
10
|
+
sx: SxProps;
|
|
11
|
+
static styles: import('lit').CSSResult;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'tc-section': TcSection;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tc-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tc-section.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;GAKG;AACH,qBACa,SAAU,SAAQ,UAAU;IACX,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAgB,MAAM,0BAapB;IAEO,MAAM;CAYhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { css as p, LitElement as m, html as a } from "lit";
|
|
2
|
+
import { property as f, customElement as d } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as x } from "lit/directives/style-map.js";
|
|
4
|
+
var y = Object.defineProperty, h = Object.getOwnPropertyDescriptor, n = (e, s, c, r) => {
|
|
5
|
+
for (var t = r > 1 ? void 0 : r ? h(s, c) : s, i = e.length - 1, l; i >= 0; i--)
|
|
6
|
+
(l = e[i]) && (t = (r ? l(s, c, t) : l(t)) || t);
|
|
7
|
+
return r && t && y(s, c, t), t;
|
|
8
|
+
};
|
|
9
|
+
let o = class extends m {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.sx = {};
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
const e = {
|
|
15
|
+
gap: "var(--space-md)",
|
|
16
|
+
...this.sx
|
|
17
|
+
};
|
|
18
|
+
return a`
|
|
19
|
+
<section part="section" class="section" style=${x(e)}>
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</section>
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
o.styles = p`
|
|
26
|
+
:host {
|
|
27
|
+
display: block;
|
|
28
|
+
width: 100%;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.section {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
width: 100%;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
n([
|
|
40
|
+
f({ type: Object })
|
|
41
|
+
], o.prototype, "sx", 2);
|
|
42
|
+
o = n([
|
|
43
|
+
d("tc-section")
|
|
44
|
+
], o);
|
|
45
|
+
export {
|
|
46
|
+
o as TcSection
|
|
47
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SxProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A loading spinner with responsive sizing.
|
|
5
|
+
* Uses spin animation from design-tokens.
|
|
6
|
+
*
|
|
7
|
+
* @csspart spinner - The spinner element
|
|
8
|
+
*/
|
|
9
|
+
export declare class TcSpinner extends LitElement {
|
|
10
|
+
private mobile;
|
|
11
|
+
size: 'sm' | 'md' | 'lg' | 'auto';
|
|
12
|
+
sx: SxProps;
|
|
13
|
+
static styles: import('lit').CSSResult[];
|
|
14
|
+
render(): import('lit').TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'tc-spinner': TcSpinner;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tc-spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tc-spinner.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-spinner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;GAKG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,MAAM,CAAwD;IAE1C,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAU;IAC3C,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAgB,MAAM,4BAgDpB;IAEO,MAAM;CAwBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { css as d, LitElement as h, html as m } from "lit";
|
|
2
|
+
import { property as l, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as b } from "lit/directives/style-map.js";
|
|
4
|
+
import { MatchMediaController as c } from "../controllers/match-media.controller.js";
|
|
5
|
+
import { sharedStyles as w } from "../styles/shared.js";
|
|
6
|
+
var z = Object.defineProperty, y = Object.getOwnPropertyDescriptor, p = (r, i, s, n) => {
|
|
7
|
+
for (var e = n > 1 ? void 0 : n ? y(i, s) : i, o = r.length - 1, a; o >= 0; o--)
|
|
8
|
+
(a = r[o]) && (e = (n ? a(i, s, e) : a(e)) || e);
|
|
9
|
+
return n && e && z(i, s, e), e;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends h {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.mobile = new c(this, "(max-width: 768px)"), this.size = "auto", this.sx = {};
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
let r;
|
|
17
|
+
this.size === "auto" ? r = this.mobile.matches ? "spinner--auto-mobile" : "spinner--auto-desktop" : r = `spinner--${this.size}`;
|
|
18
|
+
const s = { ...{ "--spinner-color": "var(--accent-primary)" }, ...this.sx };
|
|
19
|
+
return m`
|
|
20
|
+
<div
|
|
21
|
+
part="spinner"
|
|
22
|
+
class="spinner ${r}"
|
|
23
|
+
style=${b(s)}
|
|
24
|
+
role="progressbar"
|
|
25
|
+
aria-label="Loading"
|
|
26
|
+
></div>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
t.styles = [
|
|
31
|
+
w,
|
|
32
|
+
d`
|
|
33
|
+
:host {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.spinner {
|
|
40
|
+
display: block;
|
|
41
|
+
border-radius: var(--radius-full);
|
|
42
|
+
border-style: solid;
|
|
43
|
+
border-color: var(--paper-cream);
|
|
44
|
+
border-top-color: var(--spinner-color);
|
|
45
|
+
animation: spin var(--duration-slow) linear infinite;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.spinner--sm {
|
|
49
|
+
width: var(--size-spinner-sm);
|
|
50
|
+
height: var(--size-spinner-sm);
|
|
51
|
+
border-width: var(--size-border-width-thick);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.spinner--md {
|
|
55
|
+
width: var(--size-spinner-md);
|
|
56
|
+
height: var(--size-spinner-md);
|
|
57
|
+
border-width: var(--size-border-width-heavy);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.spinner--lg {
|
|
61
|
+
width: var(--size-spinner-lg);
|
|
62
|
+
height: var(--size-spinner-lg);
|
|
63
|
+
border-width: var(--size-border-width-bold);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.spinner--auto-mobile {
|
|
67
|
+
width: var(--size-spinner-lg);
|
|
68
|
+
height: var(--size-spinner-lg);
|
|
69
|
+
border-width: var(--size-border-width-heavy);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.spinner--auto-desktop {
|
|
73
|
+
width: var(--size-spinner-xl);
|
|
74
|
+
height: var(--size-spinner-xl);
|
|
75
|
+
border-width: var(--size-border-width-bold);
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
];
|
|
79
|
+
p([
|
|
80
|
+
l({ type: String })
|
|
81
|
+
], t.prototype, "size", 2);
|
|
82
|
+
p([
|
|
83
|
+
l({ type: Object })
|
|
84
|
+
], t.prototype, "sx", 2);
|
|
85
|
+
t = p([
|
|
86
|
+
v("tc-spinner")
|
|
87
|
+
], t);
|
|
88
|
+
export {
|
|
89
|
+
t as TcSpinner
|
|
90
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SxProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A circular symbol/avatar component.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Symbol content (icon or text)
|
|
7
|
+
* @csspart symbol - The symbol container
|
|
8
|
+
*/
|
|
9
|
+
export declare class TcSymbol extends LitElement {
|
|
10
|
+
sx: SxProps;
|
|
11
|
+
static styles: import('lit').CSSResult;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'tc-symbol': TcSymbol;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tc-symbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tc-symbol.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;GAKG;AACH,qBACa,QAAS,SAAQ,UAAU;IACV,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAgB,MAAM,0BAmBpB;IAEO,MAAM;CAchB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { css as a, LitElement as y, html as c } from "lit";
|
|
2
|
+
import { property as b, customElement as p } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as f } from "lit/directives/style-map.js";
|
|
4
|
+
var v = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (o, s, l, t) => {
|
|
5
|
+
for (var e = t > 1 ? void 0 : t ? u(s, l) : s, m = o.length - 1, i; m >= 0; m--)
|
|
6
|
+
(i = o[m]) && (e = (t ? i(s, l, e) : i(e)) || e);
|
|
7
|
+
return t && e && v(s, l, e), e;
|
|
8
|
+
};
|
|
9
|
+
let r = class extends y {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.sx = {};
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
const s = { ...{
|
|
15
|
+
"--symbol-size": "3rem",
|
|
16
|
+
"--symbol-bg": "var(--paper-cream)",
|
|
17
|
+
"--symbol-color": "var(--ink-dark)"
|
|
18
|
+
}, ...this.sx };
|
|
19
|
+
return c`
|
|
20
|
+
<div part="symbol" class="symbol" style=${f(s)}>
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
r.styles = a`
|
|
27
|
+
:host {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.symbol {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
border-radius: var(--radius-full);
|
|
38
|
+
background: var(--symbol-bg);
|
|
39
|
+
color: var(--symbol-color);
|
|
40
|
+
width: var(--symbol-size);
|
|
41
|
+
height: var(--symbol-size);
|
|
42
|
+
font-family: var(--font-body);
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
n([
|
|
47
|
+
b({ type: Object })
|
|
48
|
+
], r.prototype, "sx", 2);
|
|
49
|
+
r = n([
|
|
50
|
+
p("tc-symbol")
|
|
51
|
+
], r);
|
|
52
|
+
export {
|
|
53
|
+
r as TcSymbol
|
|
54
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SxProps } from '../types.js';
|
|
3
|
+
type TextTag = 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label';
|
|
4
|
+
type TextSize = 'sm' | 'base' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
type TextWeight = '400' | '500' | '600' | '700';
|
|
6
|
+
type TextColor = 'primary' | 'secondary' | 'tertiary' | 'muted' | 'accent' | 'success' | 'error' | 'warning' | 'info';
|
|
7
|
+
/**
|
|
8
|
+
* A text component with dynamic tag rendering.
|
|
9
|
+
* Supports semantic HTML tags for accessibility.
|
|
10
|
+
* Uses design-tokens for consistent theming across light/dark modes.
|
|
11
|
+
*
|
|
12
|
+
* @slot - Text content
|
|
13
|
+
* @csspart text - The text element
|
|
14
|
+
*/
|
|
15
|
+
export declare class TcText extends LitElement {
|
|
16
|
+
tag: TextTag;
|
|
17
|
+
size?: TextSize;
|
|
18
|
+
weight?: TextWeight;
|
|
19
|
+
color?: TextColor | string;
|
|
20
|
+
sx: SxProps;
|
|
21
|
+
static styles: import('lit').CSSResult[];
|
|
22
|
+
private getColorClass;
|
|
23
|
+
private getColorStyle;
|
|
24
|
+
render(): import('lit').TemplateResult;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'tc-text': TcText;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=tc-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tc-text.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,UAAU,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,OAAO,GACR,GAAG,GACH,MAAM,GACN,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,OAAO,CAAC;AAEZ,KAAK,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AACpD,KAAK,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAChD,KAAK,SAAS,GACV,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX;;;;;;;GAOG;AACH,qBACa,MAAO,SAAQ,UAAU;IACR,GAAG,EAAE,OAAO,CAAO;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAgB,MAAM,4BA2EpB;IAEF,OAAO,CAAC,aAAa;IAmBrB,OAAO,CAAC,aAAa;IAgBZ,MAAM;CAwBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { css as x, LitElement as p } from "lit";
|
|
2
|
+
import { property as a, customElement as g } from "lit/decorators.js";
|
|
3
|
+
import { styleMap as h } from "lit/directives/style-map.js";
|
|
4
|
+
import { unsafeStatic as f, html as m } from "lit/static-html.js";
|
|
5
|
+
import { sharedStyles as y } from "../styles/shared.js";
|
|
6
|
+
var v = Object.defineProperty, u = Object.getOwnPropertyDescriptor, n = (r, o, s, i) => {
|
|
7
|
+
for (var e = i > 1 ? void 0 : i ? u(o, s) : o, c = r.length - 1, l; c >= 0; c--)
|
|
8
|
+
(l = r[c]) && (e = (i ? l(o, s, e) : l(e)) || e);
|
|
9
|
+
return i && e && v(o, s, e), e;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends p {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.tag = "p", this.sx = {};
|
|
14
|
+
}
|
|
15
|
+
getColorClass() {
|
|
16
|
+
return this.color && {
|
|
17
|
+
primary: "text--primary",
|
|
18
|
+
secondary: "text--secondary",
|
|
19
|
+
tertiary: "text--tertiary",
|
|
20
|
+
muted: "text--muted",
|
|
21
|
+
accent: "text--accent",
|
|
22
|
+
success: "text--success",
|
|
23
|
+
error: "text--error",
|
|
24
|
+
warning: "text--warning",
|
|
25
|
+
info: "text--info"
|
|
26
|
+
}[this.color] || "";
|
|
27
|
+
}
|
|
28
|
+
getColorStyle() {
|
|
29
|
+
if (this.color && (this.color.startsWith("var(") || this.color.startsWith("#") || this.color.startsWith("rgb")))
|
|
30
|
+
return this.color;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const r = f(this.tag), o = [
|
|
34
|
+
"text",
|
|
35
|
+
this.size ? `text--${this.size}` : "",
|
|
36
|
+
this.weight ? `text--w${this.weight}` : "",
|
|
37
|
+
this.getColorClass()
|
|
38
|
+
].filter(Boolean).join(" "), s = this.getColorStyle(), i = {
|
|
39
|
+
...s ? { color: s } : {},
|
|
40
|
+
...this.sx
|
|
41
|
+
};
|
|
42
|
+
return m`
|
|
43
|
+
<${r} part="text" class=${o} style=${h(i)}>
|
|
44
|
+
<slot></slot>
|
|
45
|
+
</${r}>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
t.styles = [
|
|
50
|
+
y,
|
|
51
|
+
x`
|
|
52
|
+
:host {
|
|
53
|
+
display: contents;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.text {
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding: 0;
|
|
59
|
+
font-family: var(--font-body);
|
|
60
|
+
line-height: 1.4;
|
|
61
|
+
color: var(--ink-black);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Size variants using design-tokens */
|
|
65
|
+
.text--sm {
|
|
66
|
+
font-size: var(--font-size-sm);
|
|
67
|
+
}
|
|
68
|
+
.text--base {
|
|
69
|
+
font-size: var(--font-size-base);
|
|
70
|
+
}
|
|
71
|
+
.text--lg {
|
|
72
|
+
font-size: var(--font-size-lg);
|
|
73
|
+
}
|
|
74
|
+
.text--xl {
|
|
75
|
+
font-size: var(--font-size-xl);
|
|
76
|
+
}
|
|
77
|
+
.text--2xl {
|
|
78
|
+
font-size: var(--font-size-2xl);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Weight variants */
|
|
82
|
+
.text--w400 {
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
}
|
|
85
|
+
.text--w500 {
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
}
|
|
88
|
+
.text--w600 {
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
}
|
|
91
|
+
.text--w700 {
|
|
92
|
+
font-weight: 700;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Color variants using design-tokens - these will respond to theme changes */
|
|
96
|
+
.text--primary {
|
|
97
|
+
color: var(--ink-black);
|
|
98
|
+
}
|
|
99
|
+
.text--secondary {
|
|
100
|
+
color: var(--ink-dark);
|
|
101
|
+
}
|
|
102
|
+
.text--tertiary {
|
|
103
|
+
color: var(--ink-medium);
|
|
104
|
+
}
|
|
105
|
+
.text--muted {
|
|
106
|
+
color: var(--ink-light);
|
|
107
|
+
}
|
|
108
|
+
.text--accent {
|
|
109
|
+
color: var(--accent-primary);
|
|
110
|
+
}
|
|
111
|
+
.text--success {
|
|
112
|
+
color: var(--accent-success);
|
|
113
|
+
}
|
|
114
|
+
.text--error {
|
|
115
|
+
color: var(--error-base);
|
|
116
|
+
}
|
|
117
|
+
.text--warning {
|
|
118
|
+
color: var(--semantic-warning);
|
|
119
|
+
}
|
|
120
|
+
.text--info {
|
|
121
|
+
color: var(--semantic-info);
|
|
122
|
+
}
|
|
123
|
+
`
|
|
124
|
+
];
|
|
125
|
+
n([
|
|
126
|
+
a({ type: String })
|
|
127
|
+
], t.prototype, "tag", 2);
|
|
128
|
+
n([
|
|
129
|
+
a({ type: String })
|
|
130
|
+
], t.prototype, "size", 2);
|
|
131
|
+
n([
|
|
132
|
+
a({ type: String })
|
|
133
|
+
], t.prototype, "weight", 2);
|
|
134
|
+
n([
|
|
135
|
+
a({ type: String })
|
|
136
|
+
], t.prototype, "color", 2);
|
|
137
|
+
n([
|
|
138
|
+
a({ type: Object })
|
|
139
|
+
], t.prototype, "sx", 2);
|
|
140
|
+
t = n([
|
|
141
|
+
g("tc-text")
|
|
142
|
+
], t);
|
|
143
|
+
export {
|
|
144
|
+
t as TcText
|
|
145
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SxProps } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A toast notification component with auto-dismiss and animation.
|
|
5
|
+
*
|
|
6
|
+
* @slot - Toast message content
|
|
7
|
+
* @fires tc-dismiss - Fired when the toast is dismissed
|
|
8
|
+
* @csspart toast - The toast container
|
|
9
|
+
* @csspart content - The content container
|
|
10
|
+
* @csspart close - The close button
|
|
11
|
+
*/
|
|
12
|
+
export declare class TcToast extends LitElement {
|
|
13
|
+
variant: 'info' | 'success' | 'warning' | 'error';
|
|
14
|
+
duration: number;
|
|
15
|
+
autoDismiss: boolean;
|
|
16
|
+
dismissible: boolean;
|
|
17
|
+
sx: SxProps;
|
|
18
|
+
private animation;
|
|
19
|
+
private dismissTimer?;
|
|
20
|
+
static styles: import('lit').CSSResult[];
|
|
21
|
+
connectedCallback(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
private updateDataState;
|
|
24
|
+
private clearDismissTimer;
|
|
25
|
+
private startDismissTimer;
|
|
26
|
+
show(): Promise<void>;
|
|
27
|
+
hide(): Promise<void>;
|
|
28
|
+
private handleClose;
|
|
29
|
+
render(): import('lit').TemplateResult<1>;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
'tc-toast': TcToast;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=tc-toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tc-toast.d.ts","sourceRoot":"","sources":["../../src/primitives/tc-toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAK5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,qBACa,OAAQ,SAAQ,UAAU;IACT,OAAO,EAC/B,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAU;IACO,QAAQ,SAAQ;IACY,WAAW,UAAQ;IAC9C,WAAW,UAAQ;IACpB,EAAE,EAAE,OAAO,CAAM;IAE7C,OAAO,CAAC,SAAS,CAGd;IAEH,OAAO,CAAC,YAAY,CAAC,CAAgC;IAErD,OAAgB,MAAM,4BA6FpB;IAEO,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,iBAAiB;IASnB,IAAI;IAOJ,IAAI;IAaV,OAAO,CAAC,WAAW;IAIV,MAAM;CAuChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|