@santi020k/lumen-astro 2.1.0 → 3.0.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/README.md +7 -0
- package/components/LineChart.astro +9 -5
- package/components/Table.astro +3 -0
- package/package.json +8 -8
- package/styles/critical.css +57 -2
package/README.md
CHANGED
|
@@ -422,3 +422,10 @@ form a standalone item, or `as="section"` when it is a labeled region in a large
|
|
|
422
422
|
|
|
423
423
|
Use `variant="default"` for the original neutral surface, `variant="accent"` for a featured metric,
|
|
424
424
|
or `variant="glass"` for selective translucency.
|
|
425
|
+
|
|
426
|
+
## Consumer composition recipes
|
|
427
|
+
|
|
428
|
+
See [consumer UI recipes](../../docs/consumer-ui-recipes.md) for static React icons, responsive
|
|
429
|
+
record tables, keyboard-aware native sheets, whole-unit amount fields, adaptive editors, and
|
|
430
|
+
asynchronous action states. Each recipe identifies the public primitives and the behavior that
|
|
431
|
+
remains owned by the application.
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
alignLumenChartSeries,
|
|
6
6
|
createLumenLineGeometry,
|
|
7
7
|
formatLumenChartSummary,
|
|
8
|
+
getLumenChartAxisPadding,
|
|
8
9
|
getLumenChartCategories,
|
|
9
10
|
getLumenChartDomain,
|
|
10
11
|
getLumenChartTicks,
|
|
@@ -75,15 +76,18 @@ const domain = getLumenChartDomain([
|
|
|
75
76
|
referenceValue ?? null
|
|
76
77
|
], false)
|
|
77
78
|
|
|
79
|
+
const ticks = getLumenChartTicks(domain)
|
|
80
|
+
const paddingLeft = getLumenChartAxisPadding(ticks.map(tick => formatValue(tick)))
|
|
81
|
+
|
|
78
82
|
const geometries = alignedSeries.map(item => createLumenLineGeometry(item.data, {
|
|
79
83
|
domain,
|
|
80
84
|
height,
|
|
81
85
|
includeZero: false,
|
|
82
86
|
padding,
|
|
87
|
+
paddingLeft,
|
|
83
88
|
width
|
|
84
89
|
}))
|
|
85
90
|
|
|
86
|
-
const ticks = getLumenChartTicks(domain)
|
|
87
91
|
const labelStep = Math.max(1, Math.ceil(categories.length / 8))
|
|
88
92
|
let markerStep = 1
|
|
89
93
|
|
|
@@ -139,8 +143,8 @@ const referenceY =
|
|
|
139
143
|
|
|
140
144
|
return (
|
|
141
145
|
<>
|
|
142
|
-
<line x1={
|
|
143
|
-
<text x={
|
|
146
|
+
<line x1={paddingLeft} x2={width - padding} y1={y} y2={y} />
|
|
147
|
+
<text x={paddingLeft - 8} y={y}>
|
|
144
148
|
{formatValue(tick)}
|
|
145
149
|
</text>
|
|
146
150
|
</>
|
|
@@ -160,7 +164,7 @@ const referenceY =
|
|
|
160
164
|
const denominator = Math.max(1, categories.length - 1)
|
|
161
165
|
|
|
162
166
|
const x =
|
|
163
|
-
|
|
167
|
+
paddingLeft + (index / denominator) * (width - paddingLeft - padding)
|
|
164
168
|
|
|
165
169
|
return (
|
|
166
170
|
<text text-anchor="middle" x={x} y={height - 14}>
|
|
@@ -174,7 +178,7 @@ const referenceY =
|
|
|
174
178
|
referenceY !== undefined && (
|
|
175
179
|
<line
|
|
176
180
|
class="ui-chart__reference"
|
|
177
|
-
x1={
|
|
181
|
+
x1={paddingLeft}
|
|
178
182
|
x2={width - padding}
|
|
179
183
|
y1={referenceY}
|
|
180
184
|
y2={referenceY}
|
package/components/Table.astro
CHANGED
|
@@ -7,17 +7,20 @@ interface Props extends HTMLAttributes<'div'> {
|
|
|
7
7
|
class?: string | null
|
|
8
8
|
className?: string
|
|
9
9
|
glass?: boolean | 'subtle' | 'strong'
|
|
10
|
+
layout?: 'records' | 'scroll'
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const {
|
|
13
14
|
class: classProp = '',
|
|
14
15
|
className = '',
|
|
15
16
|
glass = false,
|
|
17
|
+
layout = 'scroll',
|
|
16
18
|
...rest
|
|
17
19
|
} = Astro.props
|
|
18
20
|
|
|
19
21
|
const { classList, passthrough } = resolveLumenAstroProps(rest, [
|
|
20
22
|
'ui-table-wrap',
|
|
23
|
+
layout === 'records' && 'ui-table-wrap--records',
|
|
21
24
|
glass && 'ui-table-wrap--glass',
|
|
22
25
|
glass === 'subtle' && 'ui-glass-subtle',
|
|
23
26
|
glass === 'strong' && 'ui-glass-strong'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/lumen-astro",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"lumen": "./bin/lumen.mjs"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"
|
|
46
|
-
"@santi020k/lumen": "^
|
|
47
|
-
"
|
|
45
|
+
"@santi020k/lumen": "^3.0.1",
|
|
46
|
+
"@santi020k/lumen-core": "^3.0.1",
|
|
47
|
+
"uqr": "^0.1.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@astrojs/ts-plugin": "^1.10.
|
|
51
|
-
"astro": "^7.
|
|
52
|
-
"typescript": "
|
|
53
|
-
"vitest": "^
|
|
50
|
+
"@astrojs/ts-plugin": "^1.10.12",
|
|
51
|
+
"astro": "^7.3.5",
|
|
52
|
+
"typescript": "~6.0.3",
|
|
53
|
+
"vitest": "^5.0.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"astro": ">=5"
|
package/styles/critical.css
CHANGED
|
@@ -698,7 +698,7 @@
|
|
|
698
698
|
.ui-badge--warning {
|
|
699
699
|
background: hsl(var(--warning) / 0.12);
|
|
700
700
|
border-color: hsl(var(--warning) / 0.36);
|
|
701
|
-
color: hsl(var(--
|
|
701
|
+
color: hsl(var(--ink));
|
|
702
702
|
}
|
|
703
703
|
|
|
704
704
|
.ui-input,
|
|
@@ -893,7 +893,7 @@
|
|
|
893
893
|
.ui-field > p,
|
|
894
894
|
.ui-field > small {
|
|
895
895
|
margin: 0;
|
|
896
|
-
color: hsl(var(--ink-
|
|
896
|
+
color: hsl(var(--ink-soft));
|
|
897
897
|
font-size: 0.8125rem;
|
|
898
898
|
line-height: 1.5;
|
|
899
899
|
}
|
|
@@ -1190,6 +1190,61 @@
|
|
|
1190
1190
|
font-size: 0.875rem;
|
|
1191
1191
|
}
|
|
1192
1192
|
|
|
1193
|
+
.ui-table__label {
|
|
1194
|
+
display: none;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
@media (max-width: 48rem) {
|
|
1198
|
+
.ui-table-wrap--records table,
|
|
1199
|
+
.ui-table-wrap--records tbody {
|
|
1200
|
+
display: block;
|
|
1201
|
+
min-width: 0;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.ui-table-wrap--records thead {
|
|
1205
|
+
position: absolute;
|
|
1206
|
+
width: 1px;
|
|
1207
|
+
height: 1px;
|
|
1208
|
+
padding: 0;
|
|
1209
|
+
overflow: hidden;
|
|
1210
|
+
clip-path: inset(50%);
|
|
1211
|
+
white-space: nowrap;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.ui-table-wrap--records tbody tr {
|
|
1215
|
+
display: grid;
|
|
1216
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
|
|
1217
|
+
gap: 1rem;
|
|
1218
|
+
padding: 1rem;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.ui-table-wrap--records tbody tr + tr {
|
|
1222
|
+
border-top: 1px solid hsl(var(--line));
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
.ui-table-wrap--records tbody td {
|
|
1226
|
+
display: block;
|
|
1227
|
+
min-width: 0;
|
|
1228
|
+
padding: 0;
|
|
1229
|
+
border: 0;
|
|
1230
|
+
overflow-wrap: anywhere;
|
|
1231
|
+
white-space: normal;
|
|
1232
|
+
text-align: start;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.ui-table-wrap--records .ui-table__label {
|
|
1236
|
+
display: block;
|
|
1237
|
+
margin-bottom: 0.25rem;
|
|
1238
|
+
color: hsl(var(--ink-soft));
|
|
1239
|
+
font-size: 0.75rem;
|
|
1240
|
+
font-weight: 600;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
.ui-table-wrap--records .ui-table__cell--wide {
|
|
1244
|
+
grid-column: 1 / -1;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1193
1248
|
.ui-table-wrap th,
|
|
1194
1249
|
.ui-data-table th {
|
|
1195
1250
|
border-bottom: 1px solid hsl(var(--line));
|