@ctrliq/quantic-components 1.65.0 → 1.67.0
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/meta/index.js +2 -0
- package/dist/meta/index.js.map +1 -1
- package/dist/quantic-components.js +69 -0
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +41 -1
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/index.stories.d.ts +41 -0
- package/dist/skeleton/index.stories.js +35 -0
- package/dist/skeleton/skeleton.component.d.ts +10 -0
- package/dist/skeleton/skeleton.component.js +79 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/skeleton/index.d.ts +1 -0
- package/dist/types/skeleton/index.stories.d.ts +41 -0
- package/dist/types/skeleton/skeleton.component.d.ts +10 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './skeleton.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './skeleton.component';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface Args {
|
|
2
|
+
cols?: number;
|
|
3
|
+
rows?: number;
|
|
4
|
+
delay?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
cols: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
rows: {
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
min: number;
|
|
23
|
+
};
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
delay: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
min: number;
|
|
30
|
+
step: number;
|
|
31
|
+
};
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
export declare const Default: import("../shared/story").StoryObject<Args>;
|
|
38
|
+
export declare const HalfWidth: import("../shared/story").StoryObject<Args>;
|
|
39
|
+
export declare const Tall: import("../shared/story").StoryObject<Args>;
|
|
40
|
+
export declare const Narrow: import("../shared/story").StoryObject<Args>;
|
|
41
|
+
export declare const Staggered: import("../shared/story").StoryObject<{}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { story } from '../shared/story';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/Feedback/Skeleton',
|
|
4
|
+
component: 'quantic-skeleton',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {
|
|
7
|
+
cols: {
|
|
8
|
+
control: { type: 'number', min: 1, max: 12 },
|
|
9
|
+
description: 'Width as a fraction of 12 columns (1–12)',
|
|
10
|
+
},
|
|
11
|
+
rows: {
|
|
12
|
+
control: { type: 'number', min: 1 },
|
|
13
|
+
description: 'Height as a multiple of 1em',
|
|
14
|
+
},
|
|
15
|
+
delay: {
|
|
16
|
+
control: { type: 'number', min: 0, step: 0.1 },
|
|
17
|
+
description: 'Animation delay in seconds',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const base = story({ args: {} }).render(({ html, cols, rows, delay }) => html `
|
|
22
|
+
<quantic-skeleton cols=${cols} rows=${rows} delay=${delay}></quantic-skeleton>
|
|
23
|
+
`);
|
|
24
|
+
export const Default = base;
|
|
25
|
+
export const HalfWidth = base.override({ cols: 6 });
|
|
26
|
+
export const Tall = base.override({ rows: 7 });
|
|
27
|
+
export const Narrow = base.override({ cols: 4, rows: 2 });
|
|
28
|
+
export const Staggered = story({ args: {} }).render(({ html }) => html `
|
|
29
|
+
<div style="display: flex; flex-direction: column; gap: 8px;">
|
|
30
|
+
<quantic-skeleton></quantic-skeleton>
|
|
31
|
+
<quantic-skeleton cols="10" delay="0.2"></quantic-skeleton>
|
|
32
|
+
<quantic-skeleton cols="8" delay="0.4"></quantic-skeleton>
|
|
33
|
+
<quantic-skeleton cols="6" delay="0.6"></quantic-skeleton>
|
|
34
|
+
</div>
|
|
35
|
+
`);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QuanticElement } from '../shared/quantic-element';
|
|
2
|
+
import type { ComponentMeta } from '../shared/meta.types';
|
|
3
|
+
export declare class Skeleton extends QuanticElement {
|
|
4
|
+
static meta: ComponentMeta;
|
|
5
|
+
cols?: number;
|
|
6
|
+
rows?: number;
|
|
7
|
+
delay?: number;
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, html } from 'lit';
|
|
8
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
9
|
+
import { quanticElement, QuanticElement } from '../shared/quantic-element';
|
|
10
|
+
import { prop } from '../shared/component-meta.decorators';
|
|
11
|
+
let Skeleton = class Skeleton extends QuanticElement {
|
|
12
|
+
render() {
|
|
13
|
+
return html `
|
|
14
|
+
<span
|
|
15
|
+
class="skeleton"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
style=${styleMap({
|
|
18
|
+
'--cols': this.cols != null ? String(this.cols) : undefined,
|
|
19
|
+
'--rows': this.rows != null ? String(this.rows) : undefined,
|
|
20
|
+
'animation-delay': this.delay != null ? `${this.delay}s` : undefined,
|
|
21
|
+
})}
|
|
22
|
+
></span>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
Skeleton.meta = {
|
|
27
|
+
tag: 'quantic-skeleton',
|
|
28
|
+
description: 'Animated placeholder used while content is loading. ' +
|
|
29
|
+
'Renders a shimmering block sized by column span and line-height units.',
|
|
30
|
+
category: 'feedback',
|
|
31
|
+
};
|
|
32
|
+
Skeleton.styles = css `
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.skeleton {
|
|
38
|
+
display: block;
|
|
39
|
+
border-radius: var(--quantic-radius-sm);
|
|
40
|
+
width: calc(var(--cols, 12) / 12 * 100%);
|
|
41
|
+
height: calc(var(--rows, 1) * 1em);
|
|
42
|
+
background: linear-gradient(
|
|
43
|
+
120deg,
|
|
44
|
+
rgb(var(--quantic-bg-tertiary-rgb) / 0.5) 25%,
|
|
45
|
+
var(--quantic-bg-tertiary) 50%,
|
|
46
|
+
rgb(var(--quantic-bg-tertiary-rgb) / 0.5) 75%
|
|
47
|
+
);
|
|
48
|
+
background-size: 200% 100%;
|
|
49
|
+
animation: shimmer var(--quantic-component-skeleton-duration, 2.5s) ease-in-out infinite;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes shimmer {
|
|
53
|
+
from {
|
|
54
|
+
background-position: 200% 0;
|
|
55
|
+
}
|
|
56
|
+
to {
|
|
57
|
+
background-position: -200% 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@media (prefers-reduced-motion: reduce) {
|
|
62
|
+
.skeleton {
|
|
63
|
+
animation: none;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
__decorate([
|
|
68
|
+
prop({ type: 'number', description: 'Width as a fraction of 12 columns (1–12). Defaults to 12 (full width).' })
|
|
69
|
+
], Skeleton.prototype, "cols", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
prop({ type: 'number', description: 'Height as a multiple of 1em. Defaults to 1.' })
|
|
72
|
+
], Skeleton.prototype, "rows", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
prop({ type: 'number', description: 'Animation delay in seconds. Useful for staggering multiple skeletons.' })
|
|
75
|
+
], Skeleton.prototype, "delay", void 0);
|
|
76
|
+
Skeleton = __decorate([
|
|
77
|
+
quanticElement('quantic-skeleton')
|
|
78
|
+
], Skeleton);
|
|
79
|
+
export { Skeleton };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './skeleton.component';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface Args {
|
|
2
|
+
cols?: number;
|
|
3
|
+
rows?: number;
|
|
4
|
+
delay?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: string;
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
cols: {
|
|
12
|
+
control: {
|
|
13
|
+
type: string;
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
};
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
rows: {
|
|
20
|
+
control: {
|
|
21
|
+
type: string;
|
|
22
|
+
min: number;
|
|
23
|
+
};
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
delay: {
|
|
27
|
+
control: {
|
|
28
|
+
type: string;
|
|
29
|
+
min: number;
|
|
30
|
+
step: number;
|
|
31
|
+
};
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
37
|
+
export declare const Default: import("../shared/story").StoryObject<Args>;
|
|
38
|
+
export declare const HalfWidth: import("../shared/story").StoryObject<Args>;
|
|
39
|
+
export declare const Tall: import("../shared/story").StoryObject<Args>;
|
|
40
|
+
export declare const Narrow: import("../shared/story").StoryObject<Args>;
|
|
41
|
+
export declare const Staggered: import("../shared/story").StoryObject<{}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QuanticElement } from '../shared/quantic-element';
|
|
2
|
+
import type { ComponentMeta } from '../shared/meta.types';
|
|
3
|
+
export declare class Skeleton extends QuanticElement {
|
|
4
|
+
static meta: ComponentMeta;
|
|
5
|
+
cols?: number;
|
|
6
|
+
rows?: number;
|
|
7
|
+
delay?: number;
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctrliq/quantic-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.67.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/types/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"focus-trap": "^7.6.6",
|
|
31
31
|
"lit": "^3.3.0",
|
|
32
32
|
"lucide-static": "^0.511.0",
|
|
33
|
-
"@ctrliq/quantic-tokens": "
|
|
34
|
-
"@ctrliq/quantic-fonts": "
|
|
33
|
+
"@ctrliq/quantic-tokens": "0.0.0",
|
|
34
|
+
"@ctrliq/quantic-fonts": "0.0.0"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"devDependencies": {
|