astryx-dracula 0.5.1 → 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/BRAND.md +57 -6
- package/README.md +16 -6
- package/USAGE.md +50 -50
- package/astryx-dracula.d.ts +2 -2
- package/astryx-dracula.js +49 -11
- package/astryx-dracula.variants.d.ts +2 -2
- package/icons.mjs +4 -0
- package/icons.tsx +8 -0
- package/package.json +23 -18
- package/shared/auth-chrome-config.ts +0 -4
- package/shared/auth-chrome.tsx +2 -3
- package/shared/chaptered-doc-config.ts +3 -2
- package/shared/chaptered-doc.tsx +1 -2
- package/shared/chart-hues.ts +21 -6
- package/shared/chart-legend.tsx +2 -2
- package/shared/data-bar.tsx +2 -2
- package/shared/order-desk.tsx +52 -54
- package/shared/revenue-chart.tsx +1 -1
- package/shared/scene-castle.tsx +21 -13
- package/shared/settings-data.ts +0 -6
- package/shared/settings-rows.tsx +1 -23
- package/templates/ai-chat-landing.template.mjs +1 -0
- package/templates/ai-chat-landing.tsx +30 -11
- package/templates/ai-chat.template.mjs +1 -0
- package/templates/ai-chat.tsx +9 -3
- package/templates/blank.template.mjs +1 -0
- package/templates/blank.tsx +4 -2
- package/templates/centered-hero.template.mjs +1 -0
- package/templates/centered-hero.tsx +5 -3
- package/templates/classic-gallery.template.mjs +1 -0
- package/templates/classic-gallery.tsx +9 -2
- package/templates/contact-form.template.mjs +1 -0
- package/templates/contact-form.tsx +13 -2
- package/templates/dashboard-portfolio.template.mjs +1 -0
- package/templates/dashboard-portfolio.tsx +21 -6
- package/templates/dashboard.template.mjs +1 -0
- package/templates/dashboard.tsx +9 -7
- package/templates/detail-page.template.mjs +1 -0
- package/templates/detail-page.tsx +28 -36
- package/templates/documentation-design.template.mjs +1 -0
- package/templates/documentation-design.tsx +8 -3
- package/templates/documentation-technical.template.mjs +1 -0
- package/templates/documentation-technical.tsx +11 -6
- package/templates/documentation.template.mjs +1 -0
- package/templates/documentation.tsx +16 -7
- package/templates/editor.template.mjs +1 -0
- package/templates/editor.tsx +4 -2
- package/templates/file-explorer.template.mjs +1 -0
- package/templates/file-explorer.tsx +4 -2
- package/templates/form-two-column.template.mjs +1 -0
- package/templates/form-two-column.tsx +19 -4
- package/templates/form-wizard.template.mjs +15 -0
- package/templates/form-wizard.tsx +878 -0
- package/templates/gallery-hero.template.mjs +1 -0
- package/templates/gallery-hero.tsx +14 -6
- package/templates/ide.template.mjs +1 -0
- package/templates/ide.tsx +187 -101
- package/templates/incident-console.template.mjs +1 -0
- package/templates/incident-console.tsx +137 -85
- package/templates/kanban-board.template.mjs +1 -0
- package/templates/kanban-board.tsx +51 -7
- package/templates/library.template.mjs +1 -0
- package/templates/library.tsx +15 -4
- package/templates/login-card.template.mjs +1 -0
- package/templates/login-card.tsx +4 -2
- package/templates/login-split.template.mjs +1 -0
- package/templates/login-split.tsx +8 -5
- package/templates/login-sso.template.mjs +1 -0
- package/templates/login-sso.tsx +13 -19
- package/templates/login.template.mjs +1 -0
- package/templates/login.tsx +4 -2
- package/templates/messaging-shell.template.mjs +1 -0
- package/templates/messaging-shell.tsx +114 -47
- package/templates/mixed-gallery.template.mjs +1 -0
- package/templates/mixed-gallery.tsx +10 -2
- package/templates/payment-form.template.mjs +1 -0
- package/templates/payment-form.tsx +34 -31
- package/templates/product-detail.template.mjs +1 -0
- package/templates/product-detail.tsx +21 -5
- package/templates/product-gallery.template.mjs +1 -0
- package/templates/product-gallery.tsx +12 -5
- package/templates/product-tour.template.mjs +1 -0
- package/templates/product-tour.tsx +21 -14
- package/templates/settings-dialog.template.mjs +1 -0
- package/templates/settings-dialog.tsx +10 -3
- package/templates/settings-sidebar.template.mjs +1 -0
- package/templates/settings-sidebar.tsx +609 -588
- package/templates/settings.template.mjs +1 -0
- package/templates/settings.tsx +11 -12
- package/templates/shell-nav.template.mjs +1 -0
- package/templates/shell-nav.tsx +47 -29
- package/templates/shell-side-nav.template.mjs +1 -0
- package/templates/shell-side-nav.tsx +88 -70
- package/templates/shell-top-nav.template.mjs +1 -0
- package/templates/shell-top-nav.tsx +102 -88
- package/templates/side-gallery.template.mjs +1 -0
- package/templates/side-gallery.tsx +4 -2
- package/templates/table-grouped.template.mjs +1 -0
- package/templates/table-grouped.tsx +150 -134
- package/templates/table-page-chart.template.mjs +1 -0
- package/templates/table-page-chart.tsx +4 -2
- package/templates/table-page-heatmap-status.template.mjs +1 -0
- package/templates/table-page-heatmap-status.tsx +4 -2
- package/templates/{table-page-shoe-store-heatmap.template.mjs → table-page-shoe-store.template.mjs} +1 -0
- package/templates/{table-page-shoe-store-heatmap.tsx → table-page-shoe-store.tsx} +5 -3
- package/templates/table-page.template.mjs +1 -0
- package/templates/table-page.tsx +12 -2
- package/templates/table-tree.template.mjs +16 -0
- package/templates/table-tree.tsx +707 -0
- package/templates/table.template.mjs +1 -0
- package/templates/table.tsx +4 -2
- package/templates/tech-report.template.mjs +1 -0
- package/templates/tech-report.tsx +18 -13
- package/templates/theme-showcase.template.mjs +1 -0
- package/templates/theme-showcase.tsx +41 -28
- package/templates/work-item-detail.template.mjs +8 -0
- package/templates/work-item-detail.tsx +1049 -0
- package/theme.css +71 -78
- package/theme.css.d.ts +9 -0
- package/tokens.css +79 -46
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
3
5
|
// NOTE on `t=display-2`: the h1 asked for display-2 from the start, but
|
|
4
6
|
// core 0.3.0's Heading emitted no `data-type`, and the 0.3.0 CLI emitted no
|
|
5
7
|
// `.astryx-heading[data-type]` rule, so --text-display-2-size never reached a
|
|
@@ -8,7 +10,7 @@
|
|
|
8
10
|
// pixel-diffing the pre-upgrade build against this one at 1440 and 390: the
|
|
9
11
|
// only regression was this header detaching at 390, fixed by stacking the
|
|
10
12
|
// title group under `isNarrow`.
|
|
11
|
-
// L > (LH > H[
|
|
13
|
+
// L[h=fill] > (LH[divider p=6] > (H[g=3 a=center] > (SI[fill] > H[g=2 a=center wrap] > Hd"Night watch"[level=1 t=display-2] + Tx"3 investigating"[t=supporting]) + SG"Filter by status" + B"Declare incident")) + (LC[p=0 !scroll] > V[g=0] > (H > (SI[fill] > PS"Search the night watch…")) + (SI[fill] > (V[g=0] > (V[g=0] > (H[g=2 a=center] > Tx"Investigating"[t=label] + Tx"3"[t=supporting]) + (UL[density=compact hasDividers] > (LI > SB)*3)) + (V[g=0] > (H[g=2 a=center] > Tx"Mitigated"[t=label] + Tx"2"[t=supporting]) + (UL[density=compact hasDividers] > (LI > SB)*2)) + (V[g=0] > (H[g=2 a=center] > Tx"Resolved"[t=label] + Tx"2"[t=supporting]) + (UL[density=compact hasDividers] > (LI > SB)*2))))) + (LP[w=380 p=0] > V[g=4] > (V[g=2] > (H[g=1 a=center] > SB + Tx"INC-2417"[t=supporting] + Tk"Investigating") + Hd"Checkout API elevated 5xx rate"[level=2]) + (H[g=2 wrap] > B.primary"Mark mitigated" + B.secondary"Escalate") + D + ML + D + (V[g=2] > Hd"Timeline"[level=3] + (UL[density=compact] > LI*3)))) ;; Drawer"Incident details"[side=end w=380] > (DrawerHeader"Incident details" + (V[g=4] > (V[g2] > (H[g=1 a=center] > SB + Tx"INC-2417"[t=supporting] + Tk"Investigating") + Hd"Checkout API elevated 5xx rate"[level=2]) + (H[g=2 wrap] > B.primary"Mark mitigated" + B.secondary"Escalate") + D + ML + D + (V[g=2] > Hd"Timeline"[level=3] + (UL[density=compact] > LI*3))))
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Incident Console — an on-call incident response tool for the night watch. Frame-first layout (see `bunx astryx docs layout`), distilled fro (Frame/responsive/container: see XLE header above.)
|
|
@@ -16,6 +18,7 @@
|
|
|
16
18
|
|
|
17
19
|
import { Button } from "@astryxdesign/core/Button";
|
|
18
20
|
import { Divider } from "@astryxdesign/core/Divider";
|
|
21
|
+
import { Drawer, DrawerHeader } from "@astryxdesign/core/Drawer";
|
|
19
22
|
import { EmptyState } from "@astryxdesign/core/EmptyState";
|
|
20
23
|
import { useMediaQuery } from "@astryxdesign/core/hooks";
|
|
21
24
|
import { Icon } from "@astryxdesign/core/Icon";
|
|
@@ -44,6 +47,12 @@ import { BellRing, Plus } from "lucide-react";
|
|
|
44
47
|
import { type CSSProperties, useMemo, useState } from "react";
|
|
45
48
|
|
|
46
49
|
const styles: Record<string, CSSProperties> = {
|
|
50
|
+
// The page's definite height. `Layout height="fill"` is height:100%, which
|
|
51
|
+
// resolves to auto against a content-sized host and hands the scroll to the
|
|
52
|
+
// document; 100dvh is absolute and needs no ancestor.
|
|
53
|
+
page: {
|
|
54
|
+
height: "100dvh",
|
|
55
|
+
},
|
|
47
56
|
contentFill: {
|
|
48
57
|
height: "100%",
|
|
49
58
|
minHeight: 0,
|
|
@@ -53,7 +62,12 @@ const styles: Record<string, CSSProperties> = {
|
|
|
53
62
|
},
|
|
54
63
|
groupHeader: {
|
|
55
64
|
padding: "var(--spacing-2) var(--spacing-3)",
|
|
56
|
-
|
|
65
|
+
// A band sitting over its own rows, so it lifts off the page surface.
|
|
66
|
+
// It used to lean on --color-background-muted, which held Selection
|
|
67
|
+
// #44475A; that token is Background Dark #21222C now, a RECESS, and a
|
|
68
|
+
// header painted in it reads as a trough between the rows instead of a
|
|
69
|
+
// band above them.
|
|
70
|
+
backgroundColor: "var(--color-background-surface)",
|
|
57
71
|
},
|
|
58
72
|
// All FOUR edges, not block-only. With `overflowY: auto` and no `overflowX`,
|
|
59
73
|
// the inline axis computes to `auto` too, so this box clips horizontally as
|
|
@@ -357,10 +371,8 @@ function IncidentRows({
|
|
|
357
371
|
{groups.map((group) => (
|
|
358
372
|
<VStack gap={0} key={group.status}>
|
|
359
373
|
<HStack gap={2} vAlign="center" style={styles.groupHeader}>
|
|
360
|
-
{/*
|
|
361
|
-
|
|
362
|
-
floor. The group heading is the string this sidebar is scanned
|
|
363
|
-
for. Hierarchy comes from the two type roles (principle 6),
|
|
374
|
+
{/* The group heading is the string this sidebar is scanned
|
|
375
|
+
for, so hierarchy comes from the two type roles (principle 6),
|
|
364
376
|
not from dimming the count. */}
|
|
365
377
|
<Text type="label">{STATUS[group.status].label}</Text>
|
|
366
378
|
<Text type="supporting" hasTabularNumbers>
|
|
@@ -373,6 +385,10 @@ function IncidentRows({
|
|
|
373
385
|
key={incident.id}
|
|
374
386
|
label={incident.title}
|
|
375
387
|
description={`${incident.id} · ${incident.service} · ${incident.impact}`}
|
|
388
|
+
// Incident titles wrap to two lines. The severity badge
|
|
389
|
+
// and the status token belong on the TITLE's first
|
|
390
|
+
// line, not floating at the middle of the block.
|
|
391
|
+
align="first-line"
|
|
376
392
|
startContent={
|
|
377
393
|
<SeverityBadge
|
|
378
394
|
severity={incident.severity}
|
|
@@ -476,6 +492,10 @@ export default function IncidentConsole() {
|
|
|
476
492
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
477
493
|
const [filters, setFilters] = useState<PowerSearchFilter[]>([]);
|
|
478
494
|
const [selectedId, setSelectedId] = useState<string | null>(INCIDENTS[0].id);
|
|
495
|
+
// Mobile inspector drawer. The inspector is a separate surface at <= 1024px
|
|
496
|
+
// (it is the `end` slot of the layout there), so it is a Drawer: a panel
|
|
497
|
+
// that slides in over the row list instead of a column that compresses it.
|
|
498
|
+
const [isInspectorOpen, setInspectorOpen] = useState(false);
|
|
479
499
|
const { config, applyFilters } = usePowerSearchConfig(fieldDefs, "Incidents");
|
|
480
500
|
|
|
481
501
|
// Responsive contract: the inspector is hidden at <= 1024px so the row
|
|
@@ -533,89 +553,121 @@ export default function IncidentConsole() {
|
|
|
533
553
|
);
|
|
534
554
|
|
|
535
555
|
return (
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
<
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
556
|
+
<>
|
|
557
|
+
<Layout
|
|
558
|
+
height="fill"
|
|
559
|
+
style={styles.page}
|
|
560
|
+
header={
|
|
561
|
+
<LayoutHeader hasDivider padding={6}>
|
|
562
|
+
{isNarrow ? (
|
|
563
|
+
<VStack gap={2}>
|
|
564
|
+
{titleGroup}
|
|
565
|
+
<HStack
|
|
566
|
+
gap={2}
|
|
567
|
+
vAlign="center"
|
|
568
|
+
style={styles.controlsRow}
|
|
569
|
+
tabIndex={0}
|
|
570
|
+
role="region"
|
|
571
|
+
aria-label="Incident filter actions"
|
|
572
|
+
>
|
|
573
|
+
{statusFilterControl}
|
|
574
|
+
{declareButton}
|
|
575
|
+
</HStack>
|
|
576
|
+
</VStack>
|
|
577
|
+
) : (
|
|
578
|
+
<HStack gap={3} vAlign="center">
|
|
579
|
+
<StackItem size="fill">{titleGroup}</StackItem>
|
|
551
580
|
{statusFilterControl}
|
|
552
581
|
{declareButton}
|
|
553
582
|
</HStack>
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
583
|
+
)}
|
|
584
|
+
</LayoutHeader>
|
|
585
|
+
}
|
|
586
|
+
content={
|
|
587
|
+
<LayoutContent padding={0} isScrollable={false}>
|
|
588
|
+
<VStack gap={0} style={styles.contentFill}>
|
|
589
|
+
<HStack style={styles.searchRow}>
|
|
590
|
+
<StackItem size="fill">
|
|
591
|
+
<PowerSearch
|
|
592
|
+
config={config}
|
|
593
|
+
filters={filters}
|
|
594
|
+
onChange={(newFilters) => setFilters([...newFilters])}
|
|
595
|
+
placeholder="Search the night watch…"
|
|
596
|
+
resultCount={visible.length}
|
|
597
|
+
/>
|
|
598
|
+
</StackItem>
|
|
599
|
+
</HStack>
|
|
600
|
+
<StackItem
|
|
601
|
+
size="fill"
|
|
602
|
+
style={styles.rows}
|
|
603
|
+
tabIndex={0}
|
|
604
|
+
role="region"
|
|
605
|
+
aria-label="Incident rows"
|
|
606
|
+
>
|
|
607
|
+
<IncidentRows
|
|
608
|
+
incidents={visible}
|
|
609
|
+
selectedId={selected?.id ?? null}
|
|
610
|
+
onSelect={(id) => {
|
|
611
|
+
setSelectedId(id);
|
|
612
|
+
// On a narrow viewport the inspector is the Drawer, so
|
|
613
|
+
// picking a row is what opens it.
|
|
614
|
+
if (isNarrow) setInspectorOpen(true);
|
|
615
|
+
}}
|
|
575
616
|
/>
|
|
576
617
|
</StackItem>
|
|
577
|
-
</
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
618
|
+
</VStack>
|
|
619
|
+
</LayoutContent>
|
|
620
|
+
}
|
|
621
|
+
end={
|
|
622
|
+
isNarrow ? undefined : (
|
|
623
|
+
<>
|
|
624
|
+
<ResizeHandle
|
|
625
|
+
direction="horizontal"
|
|
626
|
+
hasDivider
|
|
627
|
+
isAlwaysVisible={false}
|
|
628
|
+
resizable={inspectorPanel.props}
|
|
629
|
+
label="Resize inspector"
|
|
589
630
|
/>
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
631
|
+
<LayoutPanel width={inspectorPanel.size} padding={0} label="Incident details">
|
|
632
|
+
{selected ? (
|
|
633
|
+
<IncidentInspector incident={selected} />
|
|
634
|
+
) : (
|
|
635
|
+
<EmptyState
|
|
636
|
+
title="No incident under the lens"
|
|
637
|
+
description="Select an incident from the rows to inspect its timeline."
|
|
638
|
+
icon={<Icon icon={BellRing} size="lg" color="secondary" />}
|
|
639
|
+
isCompact
|
|
640
|
+
/>
|
|
641
|
+
)}
|
|
642
|
+
</LayoutPanel>
|
|
643
|
+
</>
|
|
644
|
+
)
|
|
645
|
+
}
|
|
646
|
+
/>
|
|
647
|
+
{/* Narrow viewport: the inspector is a Drawer, not a column. It is
|
|
648
|
+
non-modal (hasScrim={false}) so the row list stays visible behind it —
|
|
649
|
+
the point of a peek-at-the-detail surface. The close button comes from
|
|
650
|
+
DrawerHeader, which only renders it when it is given onOpenChange. */}
|
|
651
|
+
<Drawer
|
|
652
|
+
side="end"
|
|
653
|
+
label="Incident details"
|
|
654
|
+
isOpen={isNarrow && isInspectorOpen}
|
|
655
|
+
onOpenChange={setInspectorOpen}
|
|
656
|
+
hasScrim={false}
|
|
657
|
+
width={inspectorPanel.size}
|
|
658
|
+
>
|
|
659
|
+
<DrawerHeader title="Incident details" onOpenChange={setInspectorOpen} />
|
|
660
|
+
{selected ? (
|
|
661
|
+
<IncidentInspector incident={selected} />
|
|
662
|
+
) : (
|
|
663
|
+
<EmptyState
|
|
664
|
+
title="No incident under the lens"
|
|
665
|
+
description="Select an incident from the rows to inspect its timeline."
|
|
666
|
+
icon={<Icon icon={BellRing} size="lg" color="secondary" />}
|
|
667
|
+
isCompact
|
|
668
|
+
/>
|
|
669
|
+
)}
|
|
670
|
+
</Drawer>
|
|
671
|
+
</>
|
|
620
672
|
);
|
|
621
673
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
3
|
-
//
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
5
|
+
// S[h=100dvh] > VH + (L[h=fill] > (LH[divider p=6] > Tbar[g=2] > (Hd"Sprint Board"[level=1 t=display-2] + Bd.neutral"8") + (H[g=2 wrap] > SE"Sprint" + D.strong + (H[g=1 a=center wrap] > IB"Sort" + IB"Filter" + IB"Search") + B.primary"Add task")) + (LC[p=0 !scroll] > G[c={min:280,max:4} g=4] > (C.muted[p=0] > L[h=fill] > (LH[divider p=3] > H[j=between a=center] > (H[g=1 a=center] > SD + Hd"To-do"[level=2] + (Po > IB)) + Tx"2") + (LC[p=3] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx)*2)) + (C.muted[p=0] > L[h=fill] > (LH[divider p=3] > H[j=between a=center] > (H[g=1 a=center] > SD + Hd"In progress"[level=2] + (Po > IB)) + Tx"2") + (LC[p=3] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx)*2)) + (C.muted[p=0] > L[h=fill] > (LH[divider p=3] > H[j=between a=center] > (H[g=1 a=center] > SD + Hd"In review"[level=2] + (Po > IB)) + Tx"1") + (LC[p=3] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx))) + (C.muted[p=0] > L[h=fill] > (LH[divider p=3] > H[j=between a=center] > (H[g=1 a=center] > SD + Hd"Done"[level=2] + (Po > IB)) + Tx"3") + (LC[p=3] > V[g=2] > (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx)*3))) + (C[p=3] > V[g=2] > (H[j=between] > (H[g=2] > Tk + Bd) + MM) + (V[g=1] > Hd[level=3] + Tx) + Tx)
|
|
4
6
|
|
|
5
7
|
import { Badge } from "@astryxdesign/core/Badge";
|
|
6
8
|
import { Button } from "@astryxdesign/core/Button";
|
|
@@ -19,6 +21,7 @@ import { StatusDot } from "@astryxdesign/core/StatusDot";
|
|
|
19
21
|
import { Heading, Text } from "@astryxdesign/core/Text";
|
|
20
22
|
import { Token } from "@astryxdesign/core/Token";
|
|
21
23
|
import { Toolbar } from "@astryxdesign/core/Toolbar";
|
|
24
|
+
import { VisuallyHidden } from "@astryxdesign/core/VisuallyHidden";
|
|
22
25
|
import {
|
|
23
26
|
ArrowUpDown,
|
|
24
27
|
CircleCheck,
|
|
@@ -310,6 +313,10 @@ function BoardCard({
|
|
|
310
313
|
// focused card across columns. The pointer DnD below stays quarantined and
|
|
311
314
|
// untouched; this only reuses its moveItem commit.
|
|
312
315
|
const onKeyDown = (e: ReactKeyboardEvent) => {
|
|
316
|
+
// Let the card's own controls (the actions menu) keep arrow keys.
|
|
317
|
+
if ((e.target as HTMLElement).closest('button, [role="menuitem"], [role="menu"]')) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
313
320
|
const at = COLUMNS.findIndex((c) => c.id === item.column);
|
|
314
321
|
const to =
|
|
315
322
|
e.key === "ArrowRight"
|
|
@@ -331,7 +338,11 @@ function BoardCard({
|
|
|
331
338
|
// drag clone floats above the board with the high shadow token instead.
|
|
332
339
|
style={{ cursor: "grab", userSelect: "none", touchAction: "none" }}
|
|
333
340
|
tabIndex={0}
|
|
334
|
-
|
|
341
|
+
// Not `button`: the card contains its own actions menu and a heading,
|
|
342
|
+
// and `button` makes every descendant presentational (ARIA
|
|
343
|
+
// "children presentational"), hiding both from assistive tech. The
|
|
344
|
+
// card is a member of the column list that happens to be focusable.
|
|
345
|
+
role="listitem"
|
|
335
346
|
aria-label={`${item.title}. In ${COLUMNS.find((c) => c.id === item.column)?.title}. Press left or right arrow to move across columns.`}
|
|
336
347
|
onPointerDown={(e) => onPointerDown(e, item.id)}
|
|
337
348
|
onKeyDown={onKeyDown}
|
|
@@ -355,7 +366,15 @@ function BoardColumn({
|
|
|
355
366
|
children: ReactNode;
|
|
356
367
|
}) {
|
|
357
368
|
return (
|
|
358
|
-
<Card
|
|
369
|
+
<Card
|
|
370
|
+
variant="muted"
|
|
371
|
+
padding={0}
|
|
372
|
+
style={{ minWidth: 0, height: "100%" }}
|
|
373
|
+
// Each column is a landmark: the board region alone announces four
|
|
374
|
+
// undifferentiated lists of cards.
|
|
375
|
+
role="region"
|
|
376
|
+
aria-label={`${meta.title} column`}
|
|
377
|
+
>
|
|
359
378
|
<Layout
|
|
360
379
|
height="fill"
|
|
361
380
|
header={
|
|
@@ -419,6 +438,9 @@ export default function KanbanBoard() {
|
|
|
419
438
|
const [items, setItems] = useState<WorkItem[]>(INITIAL_ITEMS);
|
|
420
439
|
const [sprint, setSprint] = useState("003");
|
|
421
440
|
const [drag, setDrag] = useState<DragState | null>(null);
|
|
441
|
+
// Polite announcement for moves that have no visual follow (keyboard arrows,
|
|
442
|
+
// menu "Move to …"). Pointer drags show their own landing ghost.
|
|
443
|
+
const [announcement, setAnnouncement] = useState("");
|
|
422
444
|
|
|
423
445
|
// Live element registries for pointer hit-testing (kept out of render state).
|
|
424
446
|
const columnEls = useRef(new Map<ColumnId, HTMLElement>());
|
|
@@ -451,7 +473,18 @@ export default function KanbanBoard() {
|
|
|
451
473
|
const itemsByColumn = groupByColumn(items);
|
|
452
474
|
|
|
453
475
|
const moveItem = (id: string, to: ColumnId) => {
|
|
476
|
+
// A cross-column move remounts the card inside the destination list, so
|
|
477
|
+
// focus would fall to <body> and the next arrow press would be lost.
|
|
478
|
+
const hadFocus = cardEls.current.get(id)?.contains(document.activeElement) ?? false;
|
|
479
|
+
const moved = items.find((item) => item.id === id);
|
|
480
|
+
const column = COLUMNS.find((meta) => meta.id === to);
|
|
454
481
|
setItems((prev) => prev.map((item) => (item.id === id ? { ...item, column: to } : item)));
|
|
482
|
+
if (moved && column) {
|
|
483
|
+
setAnnouncement(`Moved ${moved.title} to ${column.title}`);
|
|
484
|
+
}
|
|
485
|
+
if (hadFocus) {
|
|
486
|
+
requestAnimationFrame(() => cardEls.current.get(id)?.focus());
|
|
487
|
+
}
|
|
455
488
|
};
|
|
456
489
|
|
|
457
490
|
// Resolve the pointer position to a column + insertion index, ignoring the
|
|
@@ -595,7 +628,7 @@ export default function KanbanBoard() {
|
|
|
595
628
|
const renderColumnCards = (colId: ColumnId): ReactNode => {
|
|
596
629
|
const colItems = itemsByColumn[colId];
|
|
597
630
|
const visible = drag ? colItems.filter((it) => it.id !== drag.id) : colItems;
|
|
598
|
-
const ghostTarget = drag
|
|
631
|
+
const ghostTarget = drag?.target && drag.target.column === colId ? drag : null;
|
|
599
632
|
|
|
600
633
|
if (visible.length === 0 && !ghostTarget) {
|
|
601
634
|
return null;
|
|
@@ -611,7 +644,7 @@ export default function KanbanBoard() {
|
|
|
611
644
|
/>
|
|
612
645
|
));
|
|
613
646
|
|
|
614
|
-
if (ghostTarget
|
|
647
|
+
if (ghostTarget?.target) {
|
|
615
648
|
const index = Math.min(ghostTarget.target.index, nodes.length);
|
|
616
649
|
nodes.splice(
|
|
617
650
|
index,
|
|
@@ -619,6 +652,8 @@ export default function KanbanBoard() {
|
|
|
619
652
|
<VStack
|
|
620
653
|
key="drag-ghost"
|
|
621
654
|
// Placeholder marking the landing slot; matches the dragged card's height.
|
|
655
|
+
// Hidden from assistive tech: it is a visual target, not a list member.
|
|
656
|
+
aria-hidden="true"
|
|
622
657
|
style={{
|
|
623
658
|
height: ghostTarget.height,
|
|
624
659
|
borderRadius: "var(--radius-element)",
|
|
@@ -628,11 +663,16 @@ export default function KanbanBoard() {
|
|
|
628
663
|
);
|
|
629
664
|
}
|
|
630
665
|
|
|
631
|
-
return
|
|
666
|
+
return (
|
|
667
|
+
<VStack gap={2} role="list">
|
|
668
|
+
{nodes}
|
|
669
|
+
</VStack>
|
|
670
|
+
);
|
|
632
671
|
};
|
|
633
672
|
|
|
634
673
|
return (
|
|
635
674
|
<Section height="100dvh">
|
|
675
|
+
<VisuallyHidden role="status">{announcement}</VisuallyHidden>
|
|
636
676
|
<Layout
|
|
637
677
|
height="fill"
|
|
638
678
|
header={
|
|
@@ -716,6 +756,10 @@ export default function KanbanBoard() {
|
|
|
716
756
|
<Card
|
|
717
757
|
padding={3}
|
|
718
758
|
elevation="none"
|
|
759
|
+
// Visual proxy for the pointer drag: its contents duplicate the
|
|
760
|
+
// real card (including an actions menu), so keep it out of the
|
|
761
|
+
// accessibility tree and the tab order.
|
|
762
|
+
inert
|
|
719
763
|
style={{
|
|
720
764
|
position: "fixed",
|
|
721
765
|
insetBlockStart: 0,
|
package/templates/library.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
3
|
-
//
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
5
|
+
// L[h=fill] > (LH[divider p=6] > (V[g=1] > Hd"Library"[level=1 t=display-2] + Tx"{ITEMS.length} components across {CATEGORIES.length - 1} categories"[t=body])) + (LC[p=6] > V[g=8] > (V[g=4] > TI"Search" + (H[g=3 a=center] > (SI[fill] > V > TgG"Filter" > OFL > Tg"All"! + Tg"Layout" + Tg"Forms" + Tg"Navigation" + Tg"Feedback" + Tg"Data") + DD"A-Z")) + (V[g=8] > (D + (V[g=8] > (H[j=between a=center] > Hd"Layout"[level=2] + Tx"{section.items.length} items"[t=body]) + (G[c={min:280} g=4] > (C[p=0] > AR[ratio=16/9] > Scene{SceneTile}) + (S.transparent[p=4] > V[g=1] > Hd"Card"[level=3] + Tx"Description"[t=body]))*{section.items.length}))*{CATEGORIES.length - 1}))
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Library — a browsable grid of design-system entries grouped by category. Frame: page header (title) | content column (search, filter row, s (Frame/responsive/container: see XLE header above.)
|
|
@@ -24,6 +26,7 @@ import { ToggleButton, ToggleButtonGroup } from "@astryxdesign/core/ToggleButton
|
|
|
24
26
|
import type { SceneHue } from "astryx-dracula/shared/scene-hues";
|
|
25
27
|
import { SceneTile } from "astryx-dracula/shared/scene-tile";
|
|
26
28
|
import { Search } from "lucide-react";
|
|
29
|
+
import type { CSSProperties } from "react";
|
|
27
30
|
import { useState } from "react";
|
|
28
31
|
|
|
29
32
|
interface LibraryItem {
|
|
@@ -283,6 +286,11 @@ function LibraryCard({ item }: { item: LibraryItem }) {
|
|
|
283
286
|
);
|
|
284
287
|
}
|
|
285
288
|
|
|
289
|
+
// Definite ancestor for `height="fill"`: 100dvh, not minHeight: '100%' (a
|
|
290
|
+
// percentage min-height against an indefinite block computes to 0 — CSS 2.1
|
|
291
|
+
// 10.5). Templates ship standalone, so the page owns this, not the host.
|
|
292
|
+
const pageStyle: CSSProperties = { height: "100dvh" };
|
|
293
|
+
|
|
286
294
|
export default function LibraryGrid() {
|
|
287
295
|
const [activeTab, setActiveTab] = useState("All");
|
|
288
296
|
const [search, setSearch] = useState("");
|
|
@@ -327,12 +335,15 @@ export default function LibraryGrid() {
|
|
|
327
335
|
return (
|
|
328
336
|
<Layout
|
|
329
337
|
height="fill"
|
|
338
|
+
style={pageStyle}
|
|
330
339
|
header={
|
|
331
340
|
<LayoutHeader hasDivider padding={6}>
|
|
332
341
|
<VStack gap={1}>
|
|
333
|
-
<Heading level={1}>
|
|
342
|
+
<Heading level={1} type="display-2">
|
|
343
|
+
Library
|
|
344
|
+
</Heading>
|
|
334
345
|
<Text type="body" color="secondary">
|
|
335
|
-
|
|
346
|
+
{ITEMS.length} components across {CATEGORIES.length - 1} categories
|
|
336
347
|
</Text>
|
|
337
348
|
</VStack>
|
|
338
349
|
</LayoutHeader>
|
package/templates/login-card.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
3
|
-
//
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
5
|
+
// Ctr > V[g=4 a=center] > (V[g=2 a=center] > Ic + Tx"Castle Dracula"[t=body]) + (C[p=4] > V[g=4] > (V[g=1 a=center] > Hd"Welcome back to the night"[level=1 t=display-2] + Tx"Sign in to your crypt"[t=body]) + (V[g=2] > TI"Email"[t=email] + (V[g=1] > TI"Password"[t=password] + Lk"Forgot password?")) + B.primary"Sign in" + D"Or continue with" + (V[g=3] > B.secondary"Login with Apple" + B.secondary"Login with Google") + (V[a=center] > Tx"New to the castle?"[t=supporting] + Lk"Sign up")) + (V[a=center] > Tx"By clicking continue, you agree to our Terms of service and Privacy policy"[t=supporting])
|
|
4
6
|
|
|
5
7
|
import { Button } from "@astryxdesign/core/Button";
|
|
6
8
|
import { Center } from "@astryxdesign/core/Center";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
// XLE (canonical structure
|
|
3
|
-
//
|
|
2
|
+
// XLE (canonical structure of the tree below; the CLI had no XLE validator
|
|
3
|
+
// after `astryx layout` was removed in 0.7.0, so this is a reading aid and a
|
|
4
|
+
// human drift check — update it with the file, never alone):
|
|
5
|
+
// Ctr > V[g=4] > (Ctr.horizontal > C[p=0] > G[c={min:240} g=8 a=stretch] > (S.transparent[p=0] > V[g=4] > (H[g=2 a=center] > Ic + Tx"Castle Dracula"[t=body]) + (V[g=4] > (V[g=1] > Hd"Welcome back to the night"[level=1 t=display-2] + Tx"Sign in to your crypt"[t=body]) + (V[g=2] > TI"Email"[t=email] + (V[g=1] > TI"Password"[t=password] + Lk"Forgot password?")) + B.primary"Sign in" + D"Or continue with" + (G[c={min:200} g=3] > B.secondary"Login with Apple" + B.secondary"Login with Google")) + (V[a=center] > Tx"New to the castle?"[t=supporting] + Lk"Sign up")) + (C.transparent[p=0] > Scene{SceneCastle})) + (V[a=center] > Tx"By clicking continue, you agree to our Terms of service and Privacy policy"[t=supporting])
|
|
4
6
|
|
|
5
7
|
import { Button } from "@astryxdesign/core/Button";
|
|
6
8
|
import { Card } from "@astryxdesign/core/Card";
|
|
@@ -13,7 +15,7 @@ import { Link } from "@astryxdesign/core/Link";
|
|
|
13
15
|
import { Section } from "@astryxdesign/core/Section";
|
|
14
16
|
import { Heading, Text } from "@astryxdesign/core/Text";
|
|
15
17
|
import { TextInput } from "@astryxdesign/core/TextInput";
|
|
16
|
-
import { authPageStyle
|
|
18
|
+
import { authPageStyle } from "astryx-dracula/shared/auth-chrome-config";
|
|
17
19
|
import {
|
|
18
20
|
AUTH_BRAND_NAME,
|
|
19
21
|
AUTH_EMAIL_PLACEHOLDER,
|
|
@@ -30,6 +32,7 @@ import {
|
|
|
30
32
|
AUTH_TERMS_PRIVACY,
|
|
31
33
|
AUTH_TERMS_SERVICE,
|
|
32
34
|
} from "astryx-dracula/shared/auth-copy";
|
|
35
|
+
|
|
33
36
|
import { demoLogin } from "astryx-dracula/shared/login-demo";
|
|
34
37
|
import { SceneCastle } from "astryx-dracula/shared/scene-castle";
|
|
35
38
|
import { AppleIcon, GoogleIcon } from "astryx-dracula/shared/sso-icons";
|
|
@@ -133,7 +136,7 @@ export default function LoginSplit() {
|
|
|
133
136
|
label="Email"
|
|
134
137
|
isLabelHidden
|
|
135
138
|
type="email"
|
|
136
|
-
|
|
139
|
+
autoComplete="email"
|
|
137
140
|
placeholder={AUTH_EMAIL_PLACEHOLDER}
|
|
138
141
|
value={email}
|
|
139
142
|
onChange={(v: string) => {
|
|
@@ -150,7 +153,7 @@ export default function LoginSplit() {
|
|
|
150
153
|
isLabelHidden
|
|
151
154
|
placeholder={AUTH_PASSWORD_PLACEHOLDER}
|
|
152
155
|
type="password"
|
|
153
|
-
|
|
156
|
+
autoComplete="current-password"
|
|
154
157
|
value={password}
|
|
155
158
|
onChange={(v: string) => {
|
|
156
159
|
setPassword(v);
|