@spatika/react 1.0.0 → 1.2.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/AGENTS.md +71 -0
- package/README.md +4 -3
- package/dist/composites/AccentRule.d.ts +6 -0
- package/dist/composites/AccentRule.d.ts.map +1 -0
- package/dist/composites/AccentRule.js +6 -0
- package/dist/composites/AvailabilityBadge.d.ts +9 -0
- package/dist/composites/AvailabilityBadge.d.ts.map +1 -0
- package/dist/composites/AvailabilityBadge.js +9 -0
- package/dist/composites/Card.d.ts +7 -1
- package/dist/composites/Card.d.ts.map +1 -1
- package/dist/composites/Card.js +10 -0
- package/dist/composites/CareerCard.d.ts +20 -0
- package/dist/composites/CareerCard.d.ts.map +1 -0
- package/dist/composites/CareerCard.js +17 -0
- package/dist/composites/ChartDataGrid.d.ts +33 -0
- package/dist/composites/ChartDataGrid.d.ts.map +1 -0
- package/dist/composites/ChartDataGrid.js +77 -0
- package/dist/composites/ContactLink.d.ts +15 -0
- package/dist/composites/ContactLink.d.ts.map +1 -0
- package/dist/composites/ContactLink.js +8 -0
- package/dist/composites/CoverHero.d.ts +1 -1
- package/dist/composites/CoverHero.d.ts.map +1 -1
- package/dist/composites/CoverHero.js +2 -2
- package/dist/composites/DisplayHeading.d.ts +9 -0
- package/dist/composites/DisplayHeading.d.ts.map +1 -0
- package/dist/composites/DisplayHeading.js +6 -0
- package/dist/composites/EntityMediaCard.d.ts +1 -1
- package/dist/composites/EntityMediaCard.d.ts.map +1 -1
- package/dist/composites/EntityMediaCard.js +12 -4
- package/dist/composites/EventCalendar.d.ts +35 -0
- package/dist/composites/EventCalendar.d.ts.map +1 -0
- package/dist/composites/EventCalendar.js +339 -0
- package/dist/composites/EventEditor.d.ts +22 -0
- package/dist/composites/EventEditor.d.ts.map +1 -0
- package/dist/composites/EventEditor.js +86 -0
- package/dist/composites/EventTimeline.d.ts +24 -0
- package/dist/composites/EventTimeline.d.ts.map +1 -0
- package/dist/composites/EventTimeline.js +184 -0
- package/dist/composites/FloatChip.d.ts +15 -0
- package/dist/composites/FloatChip.d.ts.map +1 -0
- package/dist/composites/FloatChip.js +7 -0
- package/dist/composites/GradientText.d.ts +11 -0
- package/dist/composites/GradientText.d.ts.map +1 -0
- package/dist/composites/GradientText.js +6 -0
- package/dist/composites/IconTile.d.ts +10 -0
- package/dist/composites/IconTile.d.ts.map +1 -0
- package/dist/composites/IconTile.js +7 -0
- package/dist/composites/MapChart.d.ts +24 -0
- package/dist/composites/MapChart.d.ts.map +1 -0
- package/dist/composites/MapChart.js +58 -0
- package/dist/composites/MetaChip.d.ts +9 -0
- package/dist/composites/MetaChip.d.ts.map +1 -0
- package/dist/composites/MetaChip.js +6 -0
- package/dist/composites/PresenceDot.d.ts +10 -0
- package/dist/composites/PresenceDot.d.ts.map +1 -0
- package/dist/composites/PresenceDot.js +10 -0
- package/dist/composites/ProfileHero.d.ts +6 -4
- package/dist/composites/ProfileHero.d.ts.map +1 -1
- package/dist/composites/ProfileHero.js +8 -8
- package/dist/composites/ProjectCard.d.ts +12 -0
- package/dist/composites/ProjectCard.d.ts.map +1 -0
- package/dist/composites/ProjectCard.js +9 -0
- package/dist/composites/ScatterWebGL.d.ts +22 -0
- package/dist/composites/ScatterWebGL.d.ts.map +1 -0
- package/dist/composites/ScatterWebGL.js +45 -0
- package/dist/composites/SectionHeading.d.ts +16 -0
- package/dist/composites/SectionHeading.d.ts.map +1 -0
- package/dist/composites/SectionHeading.js +12 -0
- package/dist/composites/SiteFooter.d.ts +18 -0
- package/dist/composites/SiteFooter.d.ts.map +1 -0
- package/dist/composites/SiteFooter.js +15 -0
- package/dist/composites/SiteNav.d.ts +25 -0
- package/dist/composites/SiteNav.d.ts.map +1 -0
- package/dist/composites/SiteNav.js +44 -0
- package/dist/composites/StatCard.d.ts +7 -1
- package/dist/composites/StatCard.d.ts.map +1 -1
- package/dist/composites/StatCard.js +5 -2
- package/dist/composites/StatusDot.d.ts +1 -1
- package/dist/composites/Tag.d.ts +11 -0
- package/dist/composites/Tag.d.ts.map +1 -0
- package/dist/composites/Tag.js +33 -0
- package/dist/composites/Wordmark.d.ts +19 -0
- package/dist/composites/Wordmark.d.ts.map +1 -0
- package/dist/composites/Wordmark.js +15 -0
- package/dist/composites/cartesian-charts.d.ts +138 -0
- package/dist/composites/cartesian-charts.d.ts.map +1 -0
- package/dist/composites/cartesian-charts.js +401 -0
- package/dist/composites/chart-composition.d.ts +139 -0
- package/dist/composites/chart-composition.d.ts.map +1 -0
- package/dist/composites/chart-composition.js +486 -0
- package/dist/composites/chart-ui.d.ts +83 -0
- package/dist/composites/chart-ui.d.ts.map +1 -0
- package/dist/composites/chart-ui.js +108 -0
- package/dist/composites/charts-3d.d.ts +37 -0
- package/dist/composites/charts-3d.d.ts.map +1 -0
- package/dist/composites/charts-3d.js +121 -0
- package/dist/composites/flow-charts.d.ts +89 -0
- package/dist/composites/flow-charts.d.ts.map +1 -0
- package/dist/composites/flow-charts.js +186 -0
- package/dist/composites/radial-charts.d.ts +109 -0
- package/dist/composites/radial-charts.d.ts.map +1 -0
- package/dist/composites/radial-charts.js +176 -0
- package/dist/composites/scheduler-ui.d.ts +43 -0
- package/dist/composites/scheduler-ui.d.ts.map +1 -0
- package/dist/composites/scheduler-ui.js +71 -0
- package/dist/index.d.ts +83 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -7
- package/dist/lib/chart-export.d.ts +10 -0
- package/dist/lib/chart-export.d.ts.map +1 -0
- package/dist/lib/chart-export.js +102 -0
- package/dist/lib/charts.d.ts +235 -0
- package/dist/lib/charts.d.ts.map +1 -0
- package/dist/lib/charts.js +744 -0
- package/dist/lib/geo.d.ts +39 -0
- package/dist/lib/geo.d.ts.map +1 -0
- package/dist/lib/geo.js +101 -0
- package/dist/lib/iso.d.ts +21 -0
- package/dist/lib/iso.d.ts.map +1 -0
- package/dist/lib/iso.js +56 -0
- package/dist/lib/rrule.d.ts +20 -0
- package/dist/lib/rrule.d.ts.map +1 -0
- package/dist/lib/rrule.js +236 -0
- package/dist/lib/scheduler.d.ts +152 -0
- package/dist/lib/scheduler.d.ts.map +1 -0
- package/dist/lib/scheduler.js +501 -0
- package/dist/lib/webgl-scatter.d.ts +44 -0
- package/dist/lib/webgl-scatter.d.ts.map +1 -0
- package/dist/lib/webgl-scatter.js +185 -0
- package/dist/primitives/Accordion.d.ts +44 -20
- package/dist/primitives/Accordion.d.ts.map +1 -1
- package/dist/primitives/Accordion.js +82 -22
- package/dist/primitives/AppBar.d.ts +13 -0
- package/dist/primitives/AppBar.d.ts.map +1 -0
- package/dist/primitives/AppBar.js +27 -0
- package/dist/primitives/Autocomplete.d.ts +28 -0
- package/dist/primitives/Autocomplete.d.ts.map +1 -0
- package/dist/primitives/Autocomplete.js +118 -0
- package/dist/primitives/Avatar.d.ts +13 -1
- package/dist/primitives/Avatar.d.ts.map +1 -1
- package/dist/primitives/Avatar.js +17 -2
- package/dist/primitives/Backdrop.d.ts +17 -0
- package/dist/primitives/Backdrop.d.ts.map +1 -0
- package/dist/primitives/Backdrop.js +17 -0
- package/dist/primitives/BottomNavigation.d.ts +23 -0
- package/dist/primitives/BottomNavigation.d.ts.map +1 -0
- package/dist/primitives/BottomNavigation.js +30 -0
- package/dist/primitives/Button.d.ts +4 -4
- package/dist/primitives/Button.d.ts.map +1 -1
- package/dist/primitives/Button.js +2 -0
- package/dist/primitives/ButtonBase.d.ts +14 -0
- package/dist/primitives/ButtonBase.d.ts.map +1 -0
- package/dist/primitives/ButtonBase.js +13 -0
- package/dist/primitives/ButtonGroup.d.ts +25 -0
- package/dist/primitives/ButtonGroup.d.ts.map +1 -0
- package/dist/primitives/ButtonGroup.js +44 -0
- package/dist/primitives/CircularProgress.d.ts +16 -0
- package/dist/primitives/CircularProgress.d.ts.map +1 -0
- package/dist/primitives/CircularProgress.js +17 -0
- package/dist/primitives/ClickAwayListener.d.ts +16 -0
- package/dist/primitives/ClickAwayListener.d.ts.map +1 -0
- package/dist/primitives/ClickAwayListener.js +33 -0
- package/dist/primitives/Collapse.d.ts +19 -0
- package/dist/primitives/Collapse.d.ts.map +1 -0
- package/dist/primitives/Collapse.js +14 -0
- package/dist/primitives/Container.d.ts +13 -0
- package/dist/primitives/Container.d.ts.map +1 -0
- package/dist/primitives/Container.js +26 -0
- package/dist/primitives/Fab.d.ts +22 -0
- package/dist/primitives/Fab.d.ts.map +1 -0
- package/dist/primitives/Fab.js +42 -0
- package/dist/primitives/FormControl.d.ts +27 -0
- package/dist/primitives/FormControl.d.ts.map +1 -0
- package/dist/primitives/FormControl.js +24 -0
- package/dist/primitives/FormControlLabel.d.ts +18 -0
- package/dist/primitives/FormControlLabel.d.ts.map +1 -0
- package/dist/primitives/FormControlLabel.js +19 -0
- package/dist/primitives/Grid.d.ts +32 -0
- package/dist/primitives/Grid.d.ts.map +1 -0
- package/dist/primitives/Grid.js +50 -0
- package/dist/primitives/IconButton.d.ts +22 -0
- package/dist/primitives/IconButton.d.ts.map +1 -0
- package/dist/primitives/IconButton.js +39 -0
- package/dist/primitives/ImageList.d.ts +31 -0
- package/dist/primitives/ImageList.d.ts.map +1 -0
- package/dist/primitives/ImageList.js +33 -0
- package/dist/primitives/InputAdornment.d.ts +28 -0
- package/dist/primitives/InputAdornment.d.ts.map +1 -0
- package/dist/primitives/InputAdornment.js +13 -0
- package/dist/primitives/Link.d.ts +17 -0
- package/dist/primitives/Link.d.ts.map +1 -0
- package/dist/primitives/Link.js +29 -0
- package/dist/primitives/List.d.ts +41 -0
- package/dist/primitives/List.d.ts.map +1 -0
- package/dist/primitives/List.js +22 -0
- package/dist/primitives/Masonry.d.ts +14 -0
- package/dist/primitives/Masonry.d.ts.map +1 -0
- package/dist/primitives/Masonry.js +15 -0
- package/dist/primitives/Menu.d.ts +28 -0
- package/dist/primitives/Menu.d.ts.map +1 -0
- package/dist/primitives/Menu.js +54 -0
- package/dist/primitives/MobileStepper.d.ts +15 -0
- package/dist/primitives/MobileStepper.d.ts.map +1 -0
- package/dist/primitives/MobileStepper.js +8 -0
- package/dist/primitives/Modal.d.ts +18 -0
- package/dist/primitives/Modal.d.ts.map +1 -0
- package/dist/primitives/Modal.js +29 -0
- package/dist/primitives/NoSsr.d.ts +15 -0
- package/dist/primitives/NoSsr.d.ts.map +1 -0
- package/dist/primitives/NoSsr.js +19 -0
- package/dist/primitives/Paper.d.ts +22 -0
- package/dist/primitives/Paper.d.ts.map +1 -0
- package/dist/primitives/Paper.js +33 -0
- package/dist/primitives/Progress.d.ts +6 -2
- package/dist/primitives/Progress.d.ts.map +1 -1
- package/dist/primitives/Progress.js +8 -3
- package/dist/primitives/Snackbar.d.ts +23 -0
- package/dist/primitives/Snackbar.d.ts.map +1 -0
- package/dist/primitives/Snackbar.js +33 -0
- package/dist/primitives/SpeedDial.d.ts +26 -0
- package/dist/primitives/SpeedDial.d.ts.map +1 -0
- package/dist/primitives/SpeedDial.js +26 -0
- package/dist/primitives/Stack.d.ts +15 -0
- package/dist/primitives/Stack.d.ts.map +1 -0
- package/dist/primitives/Stack.js +45 -0
- package/dist/primitives/StarRating.d.ts +19 -1
- package/dist/primitives/StarRating.d.ts.map +1 -1
- package/dist/primitives/StarRating.js +36 -6
- package/dist/primitives/Stepper.d.ts +36 -0
- package/dist/primitives/Stepper.d.ts.map +1 -0
- package/dist/primitives/Stepper.js +53 -0
- package/dist/primitives/TablePagination.d.ts +16 -0
- package/dist/primitives/TablePagination.d.ts.map +1 -0
- package/dist/primitives/TablePagination.js +12 -0
- package/dist/primitives/TextField.d.ts +24 -0
- package/dist/primitives/TextField.d.ts.map +1 -0
- package/dist/primitives/TextField.js +19 -0
- package/dist/primitives/TextareaAutosize.d.ts +11 -0
- package/dist/primitives/TextareaAutosize.d.ts.map +1 -0
- package/dist/primitives/TextareaAutosize.js +26 -0
- package/dist/primitives/ToggleButton.d.ts +28 -0
- package/dist/primitives/ToggleButton.d.ts.map +1 -0
- package/dist/primitives/ToggleButton.js +56 -0
- package/dist/primitives/TransferList.d.ts +21 -0
- package/dist/primitives/TransferList.d.ts.map +1 -0
- package/dist/primitives/TransferList.js +40 -0
- package/dist/primitives/Typography.d.ts +23 -0
- package/dist/primitives/Typography.d.ts.map +1 -0
- package/dist/primitives/Typography.js +69 -0
- package/dist/primitives/transitions.d.ts +29 -0
- package/dist/primitives/transitions.d.ts.map +1 -0
- package/dist/primitives/transitions.js +52 -0
- package/package.json +30 -5
- package/skills/spatika-ui/SKILL.md +96 -0
- package/src/composites/AccentRule.tsx +12 -0
- package/src/composites/AvailabilityBadge.tsx +32 -0
- package/src/composites/Card.tsx +51 -1
- package/src/composites/CareerCard.tsx +111 -0
- package/src/composites/ChartDataGrid.test.tsx +57 -0
- package/src/composites/ChartDataGrid.tsx +196 -0
- package/src/composites/ContactLink.tsx +66 -0
- package/src/composites/CoverHero.test.tsx +38 -0
- package/src/composites/CoverHero.tsx +29 -22
- package/src/composites/DisplayHeading.tsx +27 -0
- package/src/composites/EntityMediaCard.test.tsx +58 -0
- package/src/composites/EntityMediaCard.tsx +31 -13
- package/src/composites/EventCalendar.tsx +928 -0
- package/src/composites/EventEditor.tsx +268 -0
- package/src/composites/EventTimeline.tsx +357 -0
- package/src/composites/FloatChip.tsx +63 -0
- package/src/composites/GradientText.tsx +31 -0
- package/src/composites/IconTile.tsx +33 -0
- package/src/composites/MapChart.test.tsx +39 -0
- package/src/composites/MapChart.tsx +130 -0
- package/src/composites/MetaChip.tsx +24 -0
- package/src/composites/PresenceDot.tsx +42 -0
- package/src/composites/ProfileHero.test.tsx +33 -0
- package/src/composites/ProfileHero.tsx +96 -79
- package/src/composites/ProjectCard.tsx +65 -0
- package/src/composites/ScatterWebGL.test.tsx +25 -0
- package/src/composites/ScatterWebGL.tsx +79 -0
- package/src/composites/SectionHeading.tsx +61 -0
- package/src/composites/SiteFooter.test.tsx +37 -0
- package/src/composites/SiteFooter.tsx +79 -0
- package/src/composites/SiteNav.test.tsx +46 -0
- package/src/composites/SiteNav.tsx +150 -0
- package/src/composites/StatCard.test.tsx +30 -0
- package/src/composites/StatCard.tsx +36 -1
- package/src/composites/Tag.tsx +50 -0
- package/src/composites/Wordmark.test.tsx +23 -0
- package/src/composites/Wordmark.tsx +46 -0
- package/src/composites/cartesian-charts.test.tsx +52 -0
- package/src/composites/cartesian-charts.tsx +1287 -0
- package/src/composites/chart-composition.test.tsx +53 -0
- package/src/composites/chart-composition.tsx +898 -0
- package/src/composites/chart-ui.tsx +328 -0
- package/src/composites/charts-3d.test.tsx +25 -0
- package/src/composites/charts-3d.tsx +318 -0
- package/src/composites/charts.test.tsx +254 -0
- package/src/composites/chrome.test.tsx +29 -0
- package/src/composites/flow-charts.test.tsx +79 -0
- package/src/composites/flow-charts.tsx +607 -0
- package/src/composites/marketing.test.tsx +192 -0
- package/src/composites/radial-charts.test.tsx +74 -0
- package/src/composites/radial-charts.tsx +617 -0
- package/src/composites/scheduler-ui.tsx +304 -0
- package/src/composites/scheduler.test.tsx +194 -0
- package/src/index.test.ts +22 -0
- package/src/index.ts +300 -5
- package/src/lib/chart-export.test.ts +20 -0
- package/src/lib/chart-export.ts +99 -0
- package/src/lib/charts-platform.test.ts +93 -0
- package/src/lib/charts.test.ts +132 -0
- package/src/lib/charts.ts +1021 -0
- package/src/lib/geo.test.ts +42 -0
- package/src/lib/geo.ts +138 -0
- package/src/lib/iso.test.ts +22 -0
- package/src/lib/iso.ts +102 -0
- package/src/lib/rrule.test.ts +53 -0
- package/src/lib/rrule.ts +281 -0
- package/src/lib/scheduler.test.ts +186 -0
- package/src/lib/scheduler.ts +688 -0
- package/src/lib/tokens.test.ts +2 -2
- package/src/lib/webgl-scatter.test.ts +36 -0
- package/src/lib/webgl-scatter.ts +230 -0
- package/src/primitives/Accordion.tsx +218 -63
- package/src/primitives/AppBar.tsx +39 -0
- package/src/primitives/Autocomplete.tsx +236 -0
- package/src/primitives/Avatar.tsx +52 -1
- package/src/primitives/Backdrop.tsx +48 -0
- package/src/primitives/BottomNavigation.tsx +102 -0
- package/src/primitives/Button.tsx +3 -0
- package/src/primitives/ButtonBase.tsx +34 -0
- package/src/primitives/ButtonGroup.tsx +90 -0
- package/src/primitives/CircularProgress.tsx +104 -0
- package/src/primitives/ClickAwayListener.tsx +46 -0
- package/src/primitives/Collapse.tsx +39 -0
- package/src/primitives/Container.tsx +40 -0
- package/src/primitives/Fab.tsx +62 -0
- package/src/primitives/FormControl.tsx +90 -0
- package/src/primitives/FormControlLabel.tsx +51 -0
- package/src/primitives/Grid.tsx +101 -0
- package/src/primitives/IconButton.tsx +59 -0
- package/src/primitives/ImageList.test.tsx +48 -0
- package/src/primitives/ImageList.tsx +112 -0
- package/src/primitives/InputAdornment.tsx +86 -0
- package/src/primitives/Link.tsx +48 -0
- package/src/primitives/List.tsx +121 -0
- package/src/primitives/Masonry.tsx +32 -0
- package/src/primitives/Menu.tsx +112 -0
- package/src/primitives/MobileStepper.tsx +64 -0
- package/src/primitives/Modal.tsx +70 -0
- package/src/primitives/NoSsr.tsx +28 -0
- package/src/primitives/Paper.tsx +55 -0
- package/src/primitives/Progress.tsx +25 -7
- package/src/primitives/Snackbar.tsx +83 -0
- package/src/primitives/SpeedDial.tsx +110 -0
- package/src/primitives/Stack.tsx +88 -0
- package/src/primitives/StarRating.tsx +87 -28
- package/src/primitives/Stepper.tsx +184 -0
- package/src/primitives/TablePagination.tsx +58 -0
- package/src/primitives/TextField.tsx +105 -0
- package/src/primitives/TextareaAutosize.tsx +49 -0
- package/src/primitives/ToggleButton.tsx +148 -0
- package/src/primitives/TransferList.tsx +110 -0
- package/src/primitives/Typography.tsx +90 -0
- package/src/primitives/mui-more.test.tsx +76 -0
- package/src/primitives/mui.test.tsx +134 -0
- package/src/primitives/transitions.tsx +120 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { Tag } from "./Tag";
|
|
5
|
+
import { SectionHeading } from "./SectionHeading";
|
|
6
|
+
import { SiteNav } from "./SiteNav";
|
|
7
|
+
import { SiteFooter } from "./SiteFooter";
|
|
8
|
+
import { GradientText } from "./GradientText";
|
|
9
|
+
import { Wordmark } from "./Wordmark";
|
|
10
|
+
import { AvailabilityBadge } from "./AvailabilityBadge";
|
|
11
|
+
import { FloatChip } from "./FloatChip";
|
|
12
|
+
import { MetaChip } from "./MetaChip";
|
|
13
|
+
import { IconTile } from "./IconTile";
|
|
14
|
+
import { ContactLink } from "./ContactLink";
|
|
15
|
+
import { CareerCard, CareerTimeline } from "./CareerCard";
|
|
16
|
+
import { ProjectCard } from "./ProjectCard";
|
|
17
|
+
import { PresenceDot } from "./PresenceDot";
|
|
18
|
+
import { AccentRule } from "./AccentRule";
|
|
19
|
+
|
|
20
|
+
describe("Tag", () => {
|
|
21
|
+
it("renders label text", () => {
|
|
22
|
+
render(<Tag>Java</Tag>);
|
|
23
|
+
expect(screen.getByText("Java")).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("supports color tones from the marketing site", () => {
|
|
27
|
+
render(<Tag variant="orange">AWS</Tag>);
|
|
28
|
+
expect(screen.getByText("AWS").className).toMatch(/orange/);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe("SectionHeading", () => {
|
|
33
|
+
it("renders eyebrow, title, and subtitle without a header element", () => {
|
|
34
|
+
const { container } = render(
|
|
35
|
+
<SectionHeading eyebrow="Product" title="What's shipping" subtitle="Glass composites." />,
|
|
36
|
+
);
|
|
37
|
+
expect(screen.getByText("Product")).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByRole("heading", { name: "What's shipping" })).toBeInTheDocument();
|
|
39
|
+
expect(screen.getByText("Glass composites.")).toBeInTheDocument();
|
|
40
|
+
expect(container.querySelector("header")).toBeNull();
|
|
41
|
+
expect(container.querySelector("[data-slot='section-heading']")).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe("SiteNav", () => {
|
|
46
|
+
it("renders brand and links", async () => {
|
|
47
|
+
const user = userEvent.setup();
|
|
48
|
+
render(
|
|
49
|
+
<SiteNav
|
|
50
|
+
brand={<a href="/">Brand</a>}
|
|
51
|
+
links={[
|
|
52
|
+
{ href: "#about", label: "About" },
|
|
53
|
+
{ href: "/blog", label: "Blog" },
|
|
54
|
+
]}
|
|
55
|
+
/>,
|
|
56
|
+
);
|
|
57
|
+
expect(screen.getByText("Brand")).toBeInTheDocument();
|
|
58
|
+
expect(screen.getAllByText("About").length).toBeGreaterThan(0);
|
|
59
|
+
expect(screen.getByRole("navigation").className).toContain("spk-site-nav");
|
|
60
|
+
await user.click(screen.getByRole("button", { name: "Toggle menu" }));
|
|
61
|
+
expect(screen.getByLabelText("Toggle menu")).toHaveAttribute("aria-expanded", "true");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("does not pin to the viewport when contained", () => {
|
|
65
|
+
render(
|
|
66
|
+
<SiteNav
|
|
67
|
+
contained
|
|
68
|
+
brand={<a href="/">Brand</a>}
|
|
69
|
+
links={[{ href: "#about", label: "About" }]}
|
|
70
|
+
/>,
|
|
71
|
+
);
|
|
72
|
+
const nav = screen.getByRole("navigation");
|
|
73
|
+
expect(nav.className).toContain("absolute");
|
|
74
|
+
expect(nav.className).not.toMatch(/\bfixed\b/);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe("SiteFooter", () => {
|
|
79
|
+
it("renders brand, copyright, and links", () => {
|
|
80
|
+
render(
|
|
81
|
+
<SiteFooter
|
|
82
|
+
brand={<span>Acme</span>}
|
|
83
|
+
copyright="© 2026"
|
|
84
|
+
links={[{ href: "#about", label: "About" }]}
|
|
85
|
+
meta={<MetaChip>Next.js</MetaChip>}
|
|
86
|
+
/>,
|
|
87
|
+
);
|
|
88
|
+
expect(screen.getByText("Acme")).toBeInTheDocument();
|
|
89
|
+
expect(screen.getByText("© 2026")).toBeInTheDocument();
|
|
90
|
+
expect(screen.getByText("About")).toBeInTheDocument();
|
|
91
|
+
expect(screen.getByText("Next.js")).toBeInTheDocument();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe("marketing chrome", () => {
|
|
96
|
+
it("renders a gradient wordmark", () => {
|
|
97
|
+
render(<Wordmark name="Acme" accent=".io" />);
|
|
98
|
+
expect(screen.getByText("Acme")).toBeInTheDocument();
|
|
99
|
+
expect(screen.getByText(".io")).toBeInTheDocument();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("renders gradient text", () => {
|
|
103
|
+
render(<GradientText>Spatika</GradientText>);
|
|
104
|
+
expect(screen.getByText("Spatika")).toBeInTheDocument();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("renders an availability badge with a live pip", () => {
|
|
108
|
+
render(<AvailabilityBadge>Live</AvailabilityBadge>);
|
|
109
|
+
expect(screen.getByText("Live")).toBeInTheDocument();
|
|
110
|
+
expect(document.querySelector("[data-slot='presence-dot']")).toBeTruthy();
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("renders a float chip", () => {
|
|
114
|
+
render(<FloatChip icon="✨" title="Glass" subtitle="UI" />);
|
|
115
|
+
expect(screen.getByText("Glass")).toBeInTheDocument();
|
|
116
|
+
expect(screen.getByText("UI")).toBeInTheDocument();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("renders a live float chip", () => {
|
|
120
|
+
render(<FloatChip live>In production</FloatChip>);
|
|
121
|
+
expect(screen.getByText("In production")).toBeInTheDocument();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("renders a presence dot", () => {
|
|
125
|
+
render(<PresenceDot label="Online" />);
|
|
126
|
+
expect(screen.getByLabelText("Online")).toBeInTheDocument();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("renders an accent rule", () => {
|
|
130
|
+
const { container } = render(<AccentRule />);
|
|
131
|
+
expect(container.querySelector("[data-slot='accent-rule']")).toBeTruthy();
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
describe("IconTile", () => {
|
|
136
|
+
it("renders title and description", () => {
|
|
137
|
+
render(<IconTile icon="🏦" title="Banking" description="Markets" />);
|
|
138
|
+
expect(screen.getByText("Banking")).toBeInTheDocument();
|
|
139
|
+
expect(screen.getByText("Markets")).toBeInTheDocument();
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
describe("ContactLink", () => {
|
|
144
|
+
it("renders name, label, and href", () => {
|
|
145
|
+
render(
|
|
146
|
+
<ContactLink href="mailto:hi@example.com" name="Email" label="hi@example.com" icon="@" />,
|
|
147
|
+
);
|
|
148
|
+
const link = screen.getByRole("link", { name: /Email/ });
|
|
149
|
+
expect(link).toHaveAttribute("href", "mailto:hi@example.com");
|
|
150
|
+
expect(screen.getByText("hi@example.com")).toBeInTheDocument();
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
describe("CareerCard", () => {
|
|
155
|
+
it("renders a current role with tags", () => {
|
|
156
|
+
render(
|
|
157
|
+
<CareerTimeline>
|
|
158
|
+
<CareerCard
|
|
159
|
+
role="Engineer"
|
|
160
|
+
company="Acme"
|
|
161
|
+
location="Remote"
|
|
162
|
+
period="2024 — Present"
|
|
163
|
+
current
|
|
164
|
+
bullets={["Shipped the thing."]}
|
|
165
|
+
tags={["Java"]}
|
|
166
|
+
/>
|
|
167
|
+
</CareerTimeline>
|
|
168
|
+
);
|
|
169
|
+
expect(screen.getByText("Engineer")).toBeInTheDocument();
|
|
170
|
+
expect(screen.getByText("Acme")).toBeInTheDocument();
|
|
171
|
+
expect(screen.getByText("Shipped the thing.")).toBeInTheDocument();
|
|
172
|
+
expect(screen.getByText("Java")).toBeInTheDocument();
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe("ProjectCard", () => {
|
|
177
|
+
it("renders title, company, outcome, and tags", () => {
|
|
178
|
+
render(
|
|
179
|
+
<ProjectCard
|
|
180
|
+
title="Spatika UI"
|
|
181
|
+
company="Open source"
|
|
182
|
+
outcome="Shipped"
|
|
183
|
+
description="Glass React design system."
|
|
184
|
+
tags={["React"]}
|
|
185
|
+
/>,
|
|
186
|
+
);
|
|
187
|
+
expect(screen.getByText("Spatika UI")).toBeInTheDocument();
|
|
188
|
+
expect(screen.getByText("Open source")).toBeInTheDocument();
|
|
189
|
+
expect(screen.getByText("Shipped")).toBeInTheDocument();
|
|
190
|
+
expect(screen.getByText("React")).toBeInTheDocument();
|
|
191
|
+
});
|
|
192
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { Gauge, LinearGauge, PieChart, RadarChart } from "./radial-charts";
|
|
4
|
+
|
|
5
|
+
describe("radial-charts", () => {
|
|
6
|
+
it("renders a pie chart from slice values", () => {
|
|
7
|
+
const { container } = render(
|
|
8
|
+
<PieChart
|
|
9
|
+
width={200}
|
|
10
|
+
height={200}
|
|
11
|
+
series={[{ data: [{ value: 10, label: "A" }, { value: 20, label: "B" }] }]}
|
|
12
|
+
/>,
|
|
13
|
+
);
|
|
14
|
+
expect(container.querySelector('[data-slot="pie-chart"]')).toBeTruthy();
|
|
15
|
+
expect(screen.getByRole("button", { name: "A" })).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("renders a single-value gauge with a percent label", () => {
|
|
19
|
+
render(<Gauge value={40} width={160} height={120} />);
|
|
20
|
+
expect(screen.getByRole("img", { name: "Gauge 40" })).toBeInTheDocument();
|
|
21
|
+
expect(screen.getByText("40%")).toBeInTheDocument();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("renders a segmented gauge with a section legend", () => {
|
|
25
|
+
const { container } = render(
|
|
26
|
+
<Gauge
|
|
27
|
+
width={160}
|
|
28
|
+
height={120}
|
|
29
|
+
startAngle={-90}
|
|
30
|
+
endAngle={90}
|
|
31
|
+
sections={[
|
|
32
|
+
{ value: 40, label: "v5" },
|
|
33
|
+
{ value: 35, label: "v6" },
|
|
34
|
+
{ value: 25, label: "v7" },
|
|
35
|
+
]}
|
|
36
|
+
/>,
|
|
37
|
+
);
|
|
38
|
+
expect(container.querySelector('[data-slot="gauge"]')).toBeTruthy();
|
|
39
|
+
expect(screen.getByRole("button", { name: "v5" })).toBeInTheDocument();
|
|
40
|
+
expect(container.querySelectorAll('[data-slot="gauge"] path').length).toBe(3);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("hides the section legend and accepts a text formatter", () => {
|
|
44
|
+
render(
|
|
45
|
+
<Gauge
|
|
46
|
+
value={72}
|
|
47
|
+
width={160}
|
|
48
|
+
height={120}
|
|
49
|
+
hideLegend
|
|
50
|
+
text={(value) => `${value} pts`}
|
|
51
|
+
sections={[{ value: 1, label: "hidden" }]}
|
|
52
|
+
/>,
|
|
53
|
+
);
|
|
54
|
+
expect(screen.queryByRole("button", { name: "hidden" })).not.toBeInTheDocument();
|
|
55
|
+
expect(screen.getByText("72 pts")).toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("renders a linear gauge and a radar polygon", () => {
|
|
59
|
+
const { container } = render(
|
|
60
|
+
<div>
|
|
61
|
+
<LinearGauge value={25} width={200} />
|
|
62
|
+
<RadarChart
|
|
63
|
+
width={220}
|
|
64
|
+
height={220}
|
|
65
|
+
radar={{ metrics: ["A", "B", "C"] }}
|
|
66
|
+
series={[{ label: "One", data: [3, 5, 4] }]}
|
|
67
|
+
/>
|
|
68
|
+
</div>,
|
|
69
|
+
);
|
|
70
|
+
expect(container.querySelector('[data-slot="linear-gauge"]')).toBeTruthy();
|
|
71
|
+
expect(container.querySelector('[data-slot="radar-chart"]')).toBeTruthy();
|
|
72
|
+
expect(screen.getByRole("button", { name: "One" })).toBeInTheDocument();
|
|
73
|
+
});
|
|
74
|
+
});
|