@n1kname/components 0.6.0 → 0.7.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/package.json +2 -2
- package/src/Legend.astro +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n1kname/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./dotrows.js": "./src/dotrows.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@n1kname/charts": "0.
|
|
14
|
+
"@n1kname/charts": "0.3.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"astro": "^7.4.4"
|
package/src/Legend.astro
CHANGED
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
* hollow a ring, for a second kind of dot
|
|
10
10
|
* stripes diagonal stripes, for something known and set aside
|
|
11
11
|
* empty an outline only, for "nothing here"
|
|
12
|
+
* faint a paler swatch, for an estimate: no invoice or reading yet
|
|
13
|
+
* dashed paler still with a dashed edge, for a projection of something still running
|
|
12
14
|
*/
|
|
13
15
|
interface Key {
|
|
14
16
|
label: string;
|
|
15
17
|
/** Any CSS colour, best a chart token such as var(--c-chart-1). Not needed for `empty`. */
|
|
16
18
|
color?: string;
|
|
17
|
-
mark?: 'fill' | 'line' | 'dot' | 'hollow' | 'stripes' | 'empty';
|
|
19
|
+
mark?: 'fill' | 'line' | 'dot' | 'hollow' | 'stripes' | 'empty' | 'faint' | 'dashed';
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
interface Props {
|
|
@@ -97,4 +99,15 @@ const { keys, label = 'Legend', class: className, ...rest } = Astro.props;
|
|
|
97
99
|
.empty {
|
|
98
100
|
box-shadow: inset 0 0 0 1px var(--c-border-strong);
|
|
99
101
|
}
|
|
102
|
+
|
|
103
|
+
/* The same fades as a bar chart's unsettled rows, a little stronger so a small swatch still shows. */
|
|
104
|
+
.faint {
|
|
105
|
+
background: color-mix(in oklab, var(--mark) 65%, transparent);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.dashed {
|
|
109
|
+
background: color-mix(in oklab, var(--mark) 37%, transparent);
|
|
110
|
+
outline: 1px dashed var(--mark);
|
|
111
|
+
outline-offset: -1px;
|
|
112
|
+
}
|
|
100
113
|
</style>
|