@diegopluna/narvi 0.3.8 → 0.3.9
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/shimmer/Shimmer.svelte +34 -8
- package/dist/components/shimmer/Shimmer.svelte.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/skills/building-ui/SKILL.md +1 -1
- package/skills/building-ui/references/components.md +1 -1
- package/skills/markdown/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/styling/SKILL.md +1 -1
- package/skills/theming/SKILL.md +1 -1
|
@@ -7,9 +7,17 @@
|
|
|
7
7
|
import { colors, play } from '../../tokens.stylex.js';
|
|
8
8
|
import { media } from '../../media.stylex.js';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* The colour of the band. `neutral`, the default, is the text's own colour passing over
|
|
12
|
+
* quieter letters; `accent` is a band of the accent, for the one thing that is live.
|
|
13
|
+
*/
|
|
14
|
+
export type ShimmerTone = 'neutral' | 'accent';
|
|
15
|
+
|
|
10
16
|
export type ShimmerProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
11
17
|
/** Turn it off to show the text plainly, for example once the work is done. */
|
|
12
18
|
active?: boolean | undefined;
|
|
19
|
+
/** The colour of the band that passes over the letters. */
|
|
20
|
+
tone?: ShimmerTone | undefined;
|
|
13
21
|
sx?: Sx | undefined;
|
|
14
22
|
children?: Snippet | undefined;
|
|
15
23
|
};
|
|
@@ -35,18 +43,13 @@
|
|
|
35
43
|
base: {
|
|
36
44
|
display: 'inline'
|
|
37
45
|
},
|
|
38
|
-
// The letters are only half there until a band of
|
|
46
|
+
// The letters are only half there until a band of light passes over them
|
|
39
47
|
active: {
|
|
40
48
|
color: {
|
|
41
49
|
default: 'transparent',
|
|
42
50
|
[media.reducedMotion]: colors.textMuted,
|
|
43
51
|
[media.forcedColors]: 'CanvasText'
|
|
44
52
|
},
|
|
45
|
-
backgroundImage: {
|
|
46
|
-
default: `linear-gradient(90deg, ${colors.textSubtle} 0%, ${colors.textSubtle} 40%, ${colors.accent} 50%, ${colors.textSubtle} 60%, ${colors.textSubtle} 100%)`,
|
|
47
|
-
[media.reducedMotion]: 'none',
|
|
48
|
-
[media.forcedColors]: 'none'
|
|
49
|
-
},
|
|
50
53
|
backgroundSize: '300% 100%',
|
|
51
54
|
backgroundClip: 'text',
|
|
52
55
|
WebkitBackgroundClip: 'text',
|
|
@@ -62,19 +65,42 @@
|
|
|
62
65
|
animationTimingFunction: { default: 'steps(30)', [media.reducedMotion]: 'steps(12)' },
|
|
63
66
|
animationIterationCount: 'infinite',
|
|
64
67
|
animationPlayState: play.whileVisible
|
|
68
|
+
},
|
|
69
|
+
// The band: the text's own colour over its quieter one, or the accent
|
|
70
|
+
neutral: {
|
|
71
|
+
backgroundImage: {
|
|
72
|
+
default: `linear-gradient(90deg, ${colors.textSubtle} 0%, ${colors.textSubtle} 40%, ${colors.text} 50%, ${colors.textSubtle} 60%, ${colors.textSubtle} 100%)`,
|
|
73
|
+
[media.reducedMotion]: 'none',
|
|
74
|
+
[media.forcedColors]: 'none'
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
accent: {
|
|
78
|
+
backgroundImage: {
|
|
79
|
+
default: `linear-gradient(90deg, ${colors.textSubtle} 0%, ${colors.textSubtle} 40%, ${colors.accent} 50%, ${colors.textSubtle} 60%, ${colors.textSubtle} 100%)`,
|
|
80
|
+
[media.reducedMotion]: 'none',
|
|
81
|
+
[media.forcedColors]: 'none'
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
84
|
});
|
|
67
85
|
</script>
|
|
68
86
|
|
|
69
87
|
<script lang="ts">
|
|
70
|
-
let {
|
|
88
|
+
let {
|
|
89
|
+
active = true,
|
|
90
|
+
tone = 'neutral',
|
|
91
|
+
sx,
|
|
92
|
+
class: className,
|
|
93
|
+
children,
|
|
94
|
+
...rest
|
|
95
|
+
}: ShimmerProps = $props();
|
|
71
96
|
</script>
|
|
72
97
|
|
|
73
98
|
<span
|
|
74
99
|
data-slot="shimmer"
|
|
75
100
|
data-active={active || undefined}
|
|
101
|
+
data-tone={tone}
|
|
76
102
|
{...rest}
|
|
77
|
-
{...attrs([styles.base, active && styles.active, sx], className)}
|
|
103
|
+
{...attrs([styles.base, active && styles.active, active && styles[tone], sx], className)}
|
|
78
104
|
{@attach active && whileVisible}
|
|
79
105
|
>
|
|
80
106
|
{@render children?.()}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import { type Sx } from '../../internal/sx.js';
|
|
4
|
+
/**
|
|
5
|
+
* The colour of the band. `neutral`, the default, is the text's own colour passing over
|
|
6
|
+
* quieter letters; `accent` is a band of the accent, for the one thing that is live.
|
|
7
|
+
*/
|
|
8
|
+
export type ShimmerTone = 'neutral' | 'accent';
|
|
4
9
|
export type ShimmerProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & {
|
|
5
10
|
/** Turn it off to show the text plainly, for example once the work is done. */
|
|
6
11
|
active?: boolean | undefined;
|
|
12
|
+
/** The colour of the band that passes over the letters. */
|
|
13
|
+
tone?: ShimmerTone | undefined;
|
|
7
14
|
sx?: Sx | undefined;
|
|
8
15
|
children?: Snippet | undefined;
|
|
9
16
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export type { SettingsGroupProps } from './components/settings-group/SettingsGro
|
|
|
111
111
|
export { default as SettingsRow } from './components/settings-row/SettingsRow.svelte';
|
|
112
112
|
export type { SettingsRowControl, SettingsRowProps } from './components/settings-row/SettingsRow.svelte';
|
|
113
113
|
export { default as Shimmer } from './components/shimmer/Shimmer.svelte';
|
|
114
|
-
export type { ShimmerProps } from './components/shimmer/Shimmer.svelte';
|
|
114
|
+
export type { ShimmerProps, ShimmerTone } from './components/shimmer/Shimmer.svelte';
|
|
115
115
|
export * as Sheet from './components/sheet/index.js';
|
|
116
116
|
export type { SheetContentProps, SheetSide, SheetSize } from './components/sheet/index.js';
|
|
117
117
|
export * as Sidebar from './components/sidebar/index.js';
|
package/package.json
CHANGED
|
@@ -106,7 +106,7 @@ errors with an `Announcer` too.
|
|
|
106
106
|
| `Progress` | How far along a task is | `progress` |
|
|
107
107
|
| `Spinner` | Something in progress | `spinner` |
|
|
108
108
|
| `Skeleton` | A stand-in for content on its way | `skeleton` |
|
|
109
|
-
| `Shimmer` | Text that says work is under way
|
|
109
|
+
| `Shimmer` | Text that says work is under way (`tone` `neutral` by default, or `accent` for the one live thing) | `shimmer` |
|
|
110
110
|
| `RollingText` | A phrase that rolls to its next value ("Reading…", "Running…") | none |
|
|
111
111
|
| `Announcer` | Says a short message to screen readers without showing anything | `announcer` |
|
|
112
112
|
| `Avatar.Root`, `.Image`, `.Fallback` | A person: a picture, or initials (`size` `xs` is 20px; `label={null}` beside a written name) | `avatar` |
|
package/skills/markdown/SKILL.md
CHANGED
package/skills/setup/SKILL.md
CHANGED
package/skills/styling/SKILL.md
CHANGED
package/skills/theming/SKILL.md
CHANGED