astryx-dracula 0.5.0 → 0.6.2
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/BRAND.md +3 -3
- package/README.md +7 -4
- package/USAGE.md +49 -49
- package/astryx-dracula.d.ts +2 -2
- package/astryx-dracula.js +25 -9
- package/astryx-dracula.variants.d.ts +2 -2
- package/astryx.integration.mjs +1 -1
- package/icons.mjs +21 -17
- package/icons.tsx +69 -62
- package/package.json +125 -120
- package/shared/auth-chrome-config.ts +6 -6
- package/shared/auth-chrome.tsx +143 -144
- package/shared/auth-copy.ts +14 -14
- package/shared/chaptered-doc-config.ts +48 -51
- package/shared/chaptered-doc.tsx +267 -289
- package/shared/chart-hues.ts +25 -10
- package/shared/chart-labels.tsx +31 -30
- package/shared/chart-legend.tsx +55 -56
- package/shared/chart-panel-style.ts +3 -3
- package/shared/data-bar.tsx +97 -102
- package/shared/format-money.ts +1 -1
- package/shared/gallery-image.ts +6 -6
- package/shared/login-demo.ts +1 -1
- package/shared/metric-card.tsx +101 -105
- package/shared/metric-delta.tsx +28 -27
- package/shared/order-desk.tsx +205 -216
- package/shared/revenue-chart.tsx +145 -165
- package/shared/scene-castle.tsx +206 -291
- package/shared/scene-frame.tsx +33 -32
- package/shared/scene-hues.ts +17 -17
- package/shared/scene-tile.tsx +88 -92
- package/shared/settings-data.ts +119 -125
- package/shared/settings-rows.tsx +122 -159
- package/shared/sparkline.tsx +75 -88
- package/shared/sso-icons.tsx +10 -22
- package/shared/stars.tsx +16 -25
- package/templates/ai-chat-landing.template.mjs +5 -4
- package/templates/ai-chat-landing.tsx +473 -460
- package/templates/ai-chat.template.mjs +5 -4
- package/templates/ai-chat.tsx +543 -612
- package/templates/blank.template.mjs +5 -4
- package/templates/blank.tsx +18 -14
- package/templates/centered-hero.template.mjs +5 -4
- package/templates/centered-hero.tsx +55 -68
- package/templates/classic-gallery.template.mjs +5 -4
- package/templates/classic-gallery.tsx +97 -104
- package/templates/contact-form.template.mjs +5 -4
- package/templates/contact-form.tsx +247 -282
- package/templates/dashboard-portfolio.template.mjs +5 -4
- package/templates/dashboard-portfolio.tsx +717 -548
- package/templates/dashboard.template.mjs +5 -4
- package/templates/dashboard.tsx +596 -567
- package/templates/detail-page.template.mjs +5 -4
- package/templates/detail-page.tsx +546 -603
- package/templates/documentation-design.template.mjs +5 -4
- package/templates/documentation-design.tsx +231 -243
- package/templates/documentation-technical.template.mjs +5 -4
- package/templates/documentation-technical.tsx +236 -239
- package/templates/documentation.template.mjs +5 -4
- package/templates/documentation.tsx +267 -279
- package/templates/editor.template.mjs +5 -4
- package/templates/editor.tsx +844 -877
- package/templates/file-explorer.template.mjs +5 -4
- package/templates/file-explorer.tsx +566 -590
- package/templates/form-two-column.template.mjs +5 -4
- package/templates/form-two-column.tsx +195 -210
- package/templates/gallery-hero.template.mjs +5 -4
- package/templates/gallery-hero.tsx +93 -114
- package/templates/ide.template.mjs +5 -4
- package/templates/ide.tsx +407 -453
- package/templates/incident-console.template.mjs +5 -4
- package/templates/incident-console.tsx +593 -575
- package/templates/kanban-board.template.mjs +5 -4
- package/templates/kanban-board.tsx +665 -683
- package/templates/library.template.mjs +5 -4
- package/templates/library.tsx +409 -430
- package/templates/login-card.template.mjs +5 -4
- package/templates/login-card.tsx +63 -72
- package/templates/login-split.template.mjs +5 -4
- package/templates/login-split.tsx +192 -193
- package/templates/login-sso.template.mjs +5 -4
- package/templates/login-sso.tsx +257 -258
- package/templates/login.template.mjs +5 -4
- package/templates/login.tsx +53 -49
- package/templates/messaging-shell.template.mjs +5 -4
- package/templates/messaging-shell.tsx +556 -574
- package/templates/mixed-gallery.template.mjs +5 -4
- package/templates/mixed-gallery.tsx +60 -58
- package/templates/payment-form.template.mjs +5 -4
- package/templates/payment-form.tsx +882 -991
- package/templates/product-detail.template.mjs +5 -4
- package/templates/product-detail.tsx +261 -272
- package/templates/product-gallery.template.mjs +5 -4
- package/templates/product-gallery.tsx +126 -137
- package/templates/product-tour.template.mjs +5 -4
- package/templates/product-tour.tsx +741 -773
- package/templates/settings-dialog.template.mjs +5 -4
- package/templates/settings-dialog.tsx +688 -717
- package/templates/settings-sidebar.template.mjs +5 -4
- package/templates/settings-sidebar.tsx +762 -807
- package/templates/settings.template.mjs +5 -4
- package/templates/settings.tsx +289 -304
- package/templates/shell-nav.template.mjs +5 -4
- package/templates/shell-nav.tsx +212 -219
- package/templates/shell-side-nav.template.mjs +5 -4
- package/templates/shell-side-nav.tsx +135 -157
- package/templates/shell-top-nav.template.mjs +5 -4
- package/templates/shell-top-nav.tsx +182 -203
- package/templates/side-gallery.template.mjs +5 -4
- package/templates/side-gallery.tsx +85 -90
- package/templates/table-grouped.template.mjs +5 -4
- package/templates/table-grouped.tsx +1000 -1053
- package/templates/table-page-chart.template.mjs +5 -4
- package/templates/table-page-chart.tsx +400 -398
- package/templates/table-page-heatmap-status.template.mjs +5 -4
- package/templates/table-page-heatmap-status.tsx +483 -512
- package/templates/table-page-shoe-store-heatmap.template.mjs +5 -4
- package/templates/table-page-shoe-store-heatmap.tsx +748 -746
- package/templates/table-page.template.mjs +5 -4
- package/templates/table-page.tsx +396 -405
- package/templates/table.template.mjs +5 -4
- package/templates/table.tsx +92 -93
- package/templates/tech-report.template.mjs +5 -4
- package/templates/tech-report.tsx +1316 -1304
- package/templates/theme-showcase.template.mjs +5 -4
- package/templates/theme-showcase.tsx +871 -951
- package/theme.css +35 -77
- package/theme.css.d.ts +9 -0
- package/tokens.css +373 -380
package/shared/metric-card.tsx
CHANGED
|
@@ -4,124 +4,120 @@
|
|
|
4
4
|
// count). One home so the analytics and portfolio templates can't drift into
|
|
5
5
|
// a second KPI/table vocabulary.
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {Table} from
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
7
|
+
import { Card } from "@astryxdesign/core/Card";
|
|
8
|
+
import { Link } from "@astryxdesign/core/Link";
|
|
9
|
+
import { ProgressBar } from "@astryxdesign/core/ProgressBar";
|
|
10
|
+
import { HStack, VStack } from "@astryxdesign/core/Stack";
|
|
11
|
+
import type { TableColumn } from "@astryxdesign/core/Table";
|
|
12
|
+
import { Table } from "@astryxdesign/core/Table";
|
|
13
|
+
import { Heading, Text } from "@astryxdesign/core/Text";
|
|
14
|
+
import { MetricDelta } from "astryx-dracula/shared/metric-delta";
|
|
15
|
+
import { Sparkline, type SparkPoint } from "astryx-dracula/shared/sparkline";
|
|
16
|
+
import type { ReactNode } from "react";
|
|
17
17
|
|
|
18
18
|
export function MetricCard({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
label,
|
|
20
|
+
value,
|
|
21
|
+
change,
|
|
22
|
+
positive,
|
|
23
|
+
caption = "Last 30 days vs. Previous",
|
|
24
|
+
sparkline,
|
|
25
25
|
}: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
label: string;
|
|
27
|
+
value: string;
|
|
28
|
+
change: string;
|
|
29
|
+
/** Defaults to "no leading minus means positive". */
|
|
30
|
+
positive?: boolean;
|
|
31
|
+
caption?: string;
|
|
32
|
+
/** Rendered as a thirty-day trend sparkline when provided. */
|
|
33
|
+
sparkline?: SparkPoint[];
|
|
34
34
|
}) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
)}
|
|
58
|
-
</VStack>
|
|
59
|
-
</Card>
|
|
60
|
-
);
|
|
35
|
+
const isPositive = positive ?? !change.startsWith("-");
|
|
36
|
+
return (
|
|
37
|
+
<Card>
|
|
38
|
+
<VStack gap={2}>
|
|
39
|
+
<Text type="supporting" color="secondary">
|
|
40
|
+
{label}
|
|
41
|
+
</Text>
|
|
42
|
+
<HStack gap={2} vAlign="center">
|
|
43
|
+
<Text type="display-3" weight="semibold" hasTabularNumbers>
|
|
44
|
+
{value}
|
|
45
|
+
</Text>
|
|
46
|
+
<MetricDelta value={change} positive={isPositive} />
|
|
47
|
+
</HStack>
|
|
48
|
+
<Text type="supporting" color="secondary">
|
|
49
|
+
{caption}
|
|
50
|
+
</Text>
|
|
51
|
+
{sparkline && (
|
|
52
|
+
<Sparkline data={sparkline} label={`${label} thirty-day trend`} positive={isPositive} />
|
|
53
|
+
)}
|
|
54
|
+
</VStack>
|
|
55
|
+
</Card>
|
|
56
|
+
);
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
export function TableCard<T extends {id: string}>({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
export function TableCard<T extends { id: string }>({
|
|
60
|
+
title,
|
|
61
|
+
linkLabel,
|
|
62
|
+
linkHref,
|
|
63
|
+
data,
|
|
64
|
+
columns,
|
|
69
65
|
}: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
title: string;
|
|
67
|
+
/** Omit both for a linkless panel (e.g. portfolio trending stocks). */
|
|
68
|
+
linkLabel?: string;
|
|
69
|
+
linkHref?: string;
|
|
70
|
+
data: T[];
|
|
71
|
+
columns: TableColumn<T>[];
|
|
76
72
|
}) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
73
|
+
return (
|
|
74
|
+
<Card>
|
|
75
|
+
<VStack gap={6}>
|
|
76
|
+
<HStack hAlign="between" vAlign="center">
|
|
77
|
+
<Heading level={3}>{title}</Heading>
|
|
78
|
+
{linkLabel && linkHref && <Link href={linkHref}>{linkLabel}</Link>}
|
|
79
|
+
</HStack>
|
|
80
|
+
<Table<T>
|
|
81
|
+
data={data}
|
|
82
|
+
columns={columns}
|
|
83
|
+
idKey="id"
|
|
84
|
+
density="compact"
|
|
85
|
+
dividers="rows"
|
|
86
|
+
textOverflow="truncate"
|
|
87
|
+
hasHover
|
|
88
|
+
/>
|
|
89
|
+
</VStack>
|
|
90
|
+
</Card>
|
|
91
|
+
);
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
export function BarCell({
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
label,
|
|
96
|
+
value,
|
|
97
|
+
max,
|
|
98
|
+
children,
|
|
103
99
|
}: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
/** Accessible bar label, e.g. "/home views". */
|
|
101
|
+
label: string;
|
|
102
|
+
value: number;
|
|
103
|
+
max: number;
|
|
104
|
+
/** Formatted count rendered under the bar. */
|
|
105
|
+
children: ReactNode;
|
|
110
106
|
}) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
107
|
+
return (
|
|
108
|
+
<VStack gap={1}>
|
|
109
|
+
<ProgressBar value={value} max={max} label={label} isLabelHidden />
|
|
110
|
+
<Text type="body" hasTabularNumbers maxLines={1}>
|
|
111
|
+
{children}
|
|
112
|
+
</Text>
|
|
113
|
+
</VStack>
|
|
114
|
+
);
|
|
119
115
|
}
|
|
120
116
|
|
|
121
|
-
export function CountCell({children}: {children: ReactNode}) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
117
|
+
export function CountCell({ children }: { children: ReactNode }) {
|
|
118
|
+
return (
|
|
119
|
+
<Text hasTabularNumbers maxLines={1}>
|
|
120
|
+
{children}
|
|
121
|
+
</Text>
|
|
122
|
+
);
|
|
127
123
|
}
|
package/shared/metric-delta.tsx
CHANGED
|
@@ -2,35 +2,36 @@
|
|
|
2
2
|
// the direction arrow carrying the same tone. The sign and the arrow carry the
|
|
3
3
|
// direction; the tone only reinforces it — never rely on color alone.
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { Icon } from "@astryxdesign/core/Icon";
|
|
6
|
+
import { HStack } from "@astryxdesign/core/Stack";
|
|
7
|
+
import { Text } from "@astryxdesign/core/Text";
|
|
8
|
+
import { ArrowDown, ArrowUp } from "lucide-react";
|
|
9
9
|
|
|
10
10
|
export function MetricDelta({
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
value,
|
|
12
|
+
positive,
|
|
13
13
|
}: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
/** Signed figure, e.g. "+12.4%" or "-3.1%". */
|
|
15
|
+
value: string;
|
|
16
|
+
positive: boolean;
|
|
17
17
|
}) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
return (
|
|
19
|
+
<HStack gap={1} vAlign="center">
|
|
20
|
+
<Icon
|
|
21
|
+
icon={positive ? ArrowUp : ArrowDown}
|
|
22
|
+
size="xsm"
|
|
23
|
+
color={positive ? "success" : "error"}
|
|
24
|
+
/>
|
|
25
|
+
<Text
|
|
26
|
+
type="body"
|
|
27
|
+
weight="semibold"
|
|
28
|
+
hasTabularNumbers
|
|
29
|
+
style={{
|
|
30
|
+
color: positive ? "var(--color-positive)" : "var(--color-negative)",
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{value}
|
|
34
|
+
</Text>
|
|
35
|
+
</HStack>
|
|
36
|
+
);
|
|
36
37
|
}
|