@reliability-design/web 1.2.0 → 1.3.1
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/dist/components/rel-accordion/rel-accordion.ts +289 -135
- package/dist/components/rel-alert/rel-alert.ts +8 -1
- package/dist/components/rel-avatar/README.md +15 -4
- package/dist/components/rel-avatar/rel-avatar.ts +138 -96
- package/dist/components/rel-badge/README.md +7 -0
- package/dist/components/rel-badge/rel-badge.ts +61 -8
- package/dist/components/rel-button/rel-button.ts +64 -7
- package/dist/components/rel-chip/README.md +7 -0
- package/dist/components/rel-chip/rel-chip.ts +250 -130
- package/dist/components/rel-date-picker/rel-date-picker.ts +116 -14
- package/dist/components/rel-drawer/rel-drawer.ts +5 -2
- package/dist/components/rel-menubar/rel-menubar.ts +1 -0
- package/dist/components/rel-pagination/rel-pagination.ts +442 -425
- package/dist/components/rel-radio/rel-radio.ts +16 -16
- package/dist/components/rel-range-picker/rel-range-picker.css +349 -349
- package/dist/components/rel-range-picker/rel-range-picker.ts +1080 -1079
- package/dist/components/rel-select/README.md +34 -28
- package/dist/components/rel-select/rel-select.ts +1015 -346
- package/dist/components/rel-sheet/rel-sheet.ts +6 -3
- package/dist/components/rel-skeleton/rel-skeleton.ts +139 -0
- package/dist/components/rel-tab/rel-tab.ts +10 -4
- package/dist/components/rel-textfield/rel-textfield.ts +637 -349
- package/dist/components/rel-toast/rel-toast.ts +1 -6
- package/dist/components/rel-topbar/rel-topbar-actions.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-brand.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown-item.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-dropdown.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-item.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-mobile-panel.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar-profile.ts +3 -0
- package/dist/components/rel-topbar/rel-topbar-utilities.ts +4 -0
- package/dist/components/rel-topbar/rel-topbar.ts +6 -0
- package/dist/index.d.mts +239 -22
- package/dist/index.d.ts +239 -22
- package/dist/index.js +2609 -981
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2621 -994
- package/dist/index.mjs.map +1 -1
- package/dist/styles/vars.css +17 -0
- package/dist/{vars-I2PC74XD.css → vars-F54UGCHM.css} +17 -0
- package/package.json +1 -1
|
@@ -70,7 +70,8 @@ export class RelModal extends LitElement {
|
|
|
70
70
|
font-family: var(--rel-fontFamilies-primary);
|
|
71
71
|
width: clamp(360px, 49vw, 708px);
|
|
72
72
|
left: 50%;
|
|
73
|
-
transition: transform var(--modal-transition-duration) var(--modal-transition-timing)
|
|
73
|
+
transition: transform var(--modal-transition-duration) var(--modal-transition-timing),
|
|
74
|
+
opacity var(--modal-transition-duration) var(--modal-transition-timing);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
.panel[data-side="bottom"] {
|
|
@@ -105,11 +106,13 @@ export class RelModal extends LitElement {
|
|
|
105
106
|
width: clamp(360px, 49vw, 708px);
|
|
106
107
|
max-height: calc(100vh - 96px);
|
|
107
108
|
border-radius: var(--rel-borders-radius-border-radius-200);
|
|
108
|
-
transform: translate(-50%, -50%);
|
|
109
|
+
transform: translate(-50%, -50%) scale(0.96);
|
|
110
|
+
opacity: 0;
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
.modal-container.open .panel[data-side="center"] {
|
|
112
|
-
transform: translate(-50%, -50%);
|
|
114
|
+
transform: translate(-50%, -50%) scale(1);
|
|
115
|
+
opacity: 1;
|
|
113
116
|
}
|
|
114
117
|
|
|
115
118
|
.header {
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { LitElement, html, css } from "lit";
|
|
2
|
+
import { customElement, property } from "lit/decorators.js";
|
|
3
|
+
|
|
4
|
+
export type SkeletonShape = "line" | "circle" | "block";
|
|
5
|
+
export type SkeletonAnimation = "pulse" | "shimmer" | "none";
|
|
6
|
+
|
|
7
|
+
@customElement("rel-skeleton")
|
|
8
|
+
export class RelSkeleton extends LitElement {
|
|
9
|
+
@property({ type: String, reflect: true }) shape: SkeletonShape = "block";
|
|
10
|
+
@property({ type: Number }) lines = 1;
|
|
11
|
+
@property({ type: String }) width = "";
|
|
12
|
+
@property({ type: String }) height = "";
|
|
13
|
+
@property({ type: String, reflect: true }) animation: SkeletonAnimation = "pulse";
|
|
14
|
+
@property({ type: Boolean, reflect: true }) loaded = false;
|
|
15
|
+
|
|
16
|
+
protected override updated(changed: Map<string, unknown>) {
|
|
17
|
+
if (changed.has("width") && this.width) this.style.width = this.width;
|
|
18
|
+
if (changed.has("height") && this.height) this.style.height = this.height;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static styles = css`
|
|
22
|
+
:host {
|
|
23
|
+
display: block;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([loaded]) {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ── Circle: aspect-ratio keeps it square without requiring explicit height ── */
|
|
31
|
+
:host([shape="circle"]) {
|
|
32
|
+
aspect-ratio: 1 / 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* ── Base skeleton surface ── */
|
|
36
|
+
.skeleton-shape,
|
|
37
|
+
.skeleton-bar {
|
|
38
|
+
background: var(--rel-skeleton-color, #c8c8c8);
|
|
39
|
+
border-radius: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ── Lines layout ── */
|
|
43
|
+
.skeleton-lines {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.skeleton-bar {
|
|
51
|
+
height: 14px;
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Last line shortens to 65% — mimics real paragraph text that doesn't reach the edge */
|
|
56
|
+
.skeleton-bar.is-last {
|
|
57
|
+
width: 65%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ── Shape (circle / block) ── */
|
|
61
|
+
.skeleton-shape {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
min-height: 16px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([shape="circle"]) .skeleton-shape {
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
/* No min-height — circle is sized entirely by host width + aspect-ratio */
|
|
70
|
+
min-height: unset;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* ── Pulse animation ── */
|
|
74
|
+
@keyframes rel-skeleton-pulse {
|
|
75
|
+
0%, 100% { opacity: 1; }
|
|
76
|
+
50% { opacity: 0.4; }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([animation="pulse"]) .skeleton-shape,
|
|
80
|
+
:host([animation="pulse"]) .skeleton-bar {
|
|
81
|
+
animation: rel-skeleton-pulse 1.5s ease-in-out infinite;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* ── Shimmer animation ── */
|
|
85
|
+
@keyframes rel-skeleton-shimmer {
|
|
86
|
+
0% { background-position: 200% center; }
|
|
87
|
+
100% { background-position: -200% center; }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([animation="shimmer"]) .skeleton-shape,
|
|
91
|
+
:host([animation="shimmer"]) .skeleton-bar {
|
|
92
|
+
background: linear-gradient(
|
|
93
|
+
90deg,
|
|
94
|
+
var(--rel-skeleton-color, #c8c8c8) 25%,
|
|
95
|
+
var(--rel-skeleton-highlight, #e2e2e2) 50%,
|
|
96
|
+
var(--rel-skeleton-color, #c8c8c8) 75%
|
|
97
|
+
);
|
|
98
|
+
background-size: 200% 100%;
|
|
99
|
+
animation: rel-skeleton-shimmer 1.5s linear infinite;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* ── Dark mode ── */
|
|
103
|
+
:host-context([data-theme="dark"]) {
|
|
104
|
+
--rel-skeleton-color: #2a2a2a;
|
|
105
|
+
--rel-skeleton-highlight: #3d3d3d;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* ── Respect reduced-motion preference ── */
|
|
109
|
+
@media (prefers-reduced-motion: reduce) {
|
|
110
|
+
.skeleton-shape,
|
|
111
|
+
.skeleton-bar {
|
|
112
|
+
animation: none !important;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
render() {
|
|
118
|
+
if (this.loaded) return html``;
|
|
119
|
+
|
|
120
|
+
if (this.shape === "line") {
|
|
121
|
+
const count = Math.max(1, this.lines);
|
|
122
|
+
return html`
|
|
123
|
+
<div class="skeleton-lines">
|
|
124
|
+
${Array.from({ length: count }, (_, i) => html`
|
|
125
|
+
<div class="skeleton-bar ${i === count - 1 && count > 1 ? "is-last" : ""}"></div>
|
|
126
|
+
`)}
|
|
127
|
+
</div>
|
|
128
|
+
`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return html`<div class="skeleton-shape"></div>`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare global {
|
|
136
|
+
interface HTMLElementTagNameMap {
|
|
137
|
+
"rel-skeleton": RelSkeleton;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -6,6 +6,7 @@ import "../rel-badge/rel-badge";
|
|
|
6
6
|
export interface TabItem {
|
|
7
7
|
label: string;
|
|
8
8
|
badge?: number;
|
|
9
|
+
badgeDot?: boolean;
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
@@ -14,6 +15,8 @@ export class RelTabItem extends LitElement {
|
|
|
14
15
|
@property({ type: String }) label: string = "";
|
|
15
16
|
@property({ type: String }) value: string = "";
|
|
16
17
|
@property({ type: Number }) badge: number = 0;
|
|
18
|
+
/** Shows a small dot instead of a numbered badge — takes precedence over `badge`. */
|
|
19
|
+
@property({ type: Boolean, attribute: "badge-dot" }) badgeDot: boolean = false;
|
|
17
20
|
@property({ type: Boolean }) disabled: boolean = false;
|
|
18
21
|
|
|
19
22
|
render() {
|
|
@@ -106,11 +109,12 @@ export class RelTab extends LitElement {
|
|
|
106
109
|
.filter((el): el is RelTabItem => el instanceof RelTabItem);
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
private get _effectiveTabs(): Array<{ label: string; badge?: number; disabled?: boolean }> {
|
|
112
|
+
private get _effectiveTabs(): Array<{ label: string; badge?: number; badgeDot?: boolean; disabled?: boolean }> {
|
|
110
113
|
if (this._tabItems.length > 0) {
|
|
111
114
|
return this._tabItems.map((item) => ({
|
|
112
115
|
label: item.label,
|
|
113
116
|
badge: item.badge || 0,
|
|
117
|
+
badgeDot: item.badgeDot,
|
|
114
118
|
disabled: item.disabled,
|
|
115
119
|
}));
|
|
116
120
|
}
|
|
@@ -173,9 +177,11 @@ export class RelTab extends LitElement {
|
|
|
173
177
|
@keydown="${(e: KeyboardEvent) => this.onKeyDown(e, i)}"
|
|
174
178
|
>
|
|
175
179
|
<span class="tab-label">${tab.label}</span>
|
|
176
|
-
${tab.
|
|
177
|
-
? html`<rel-badge
|
|
178
|
-
:
|
|
180
|
+
${tab.badgeDot
|
|
181
|
+
? html`<rel-badge variant="dot" size="sm"></rel-badge>`
|
|
182
|
+
: tab.badge
|
|
183
|
+
? html`<rel-badge number="${tab.badge}" variant="number" size="sm"></rel-badge>`
|
|
184
|
+
: ""}
|
|
179
185
|
<span class="tab-underline"></span>
|
|
180
186
|
</div>
|
|
181
187
|
`
|