@sentropic/design-system-svelte 0.34.72 → 0.34.75

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.
Files changed (49) hide show
  1. package/README.md +31 -1
  2. package/dist/PanelSection.svelte +243 -0
  3. package/dist/PanelSection.svelte.d.ts +13 -0
  4. package/dist/PanelSection.svelte.d.ts.map +1 -0
  5. package/dist/PanelStack.svelte +509 -0
  6. package/dist/PanelStack.svelte.d.ts +89 -0
  7. package/dist/PanelStack.svelte.d.ts.map +1 -0
  8. package/dist/PanelStackFixture.svelte.d.ts +23 -0
  9. package/dist/PanelStackFixture.svelte.d.ts.map +1 -0
  10. package/dist/index.d.ts +4 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +2 -0
  13. package/package.json +7 -2
  14. package/dist/AppChrome.test.d.ts +0 -2
  15. package/dist/AppChrome.test.d.ts.map +0 -1
  16. package/dist/AppChrome.test.js +0 -146
  17. package/dist/AppShell.panelCollapse.test.d.ts +0 -2
  18. package/dist/AppShell.panelCollapse.test.d.ts.map +0 -1
  19. package/dist/AppShell.panelCollapse.test.js +0 -129
  20. package/dist/AppShell.panelResize.test.d.ts +0 -2
  21. package/dist/AppShell.panelResize.test.d.ts.map +0 -1
  22. package/dist/AppShell.panelResize.test.js +0 -338
  23. package/dist/Collapsible.test.d.ts +0 -2
  24. package/dist/Collapsible.test.d.ts.map +0 -1
  25. package/dist/Collapsible.test.js +0 -76
  26. package/dist/ContourChart.test.d.ts +0 -2
  27. package/dist/ContourChart.test.d.ts.map +0 -1
  28. package/dist/ContourChart.test.js +0 -59
  29. package/dist/EventFeedPanel.test.d.ts +0 -2
  30. package/dist/EventFeedPanel.test.d.ts.map +0 -1
  31. package/dist/EventFeedPanel.test.js +0 -66
  32. package/dist/Icon.test.d.ts +0 -2
  33. package/dist/Icon.test.d.ts.map +0 -1
  34. package/dist/Icon.test.js +0 -38
  35. package/dist/PointAndFigureChart.test.d.ts +0 -2
  36. package/dist/PointAndFigureChart.test.d.ts.map +0 -1
  37. package/dist/PointAndFigureChart.test.js +0 -73
  38. package/dist/RenkoChart.test.d.ts +0 -2
  39. package/dist/RenkoChart.test.d.ts.map +0 -1
  40. package/dist/RenkoChart.test.js +0 -66
  41. package/dist/TimeRangePicker.test.d.ts +0 -2
  42. package/dist/TimeRangePicker.test.d.ts.map +0 -1
  43. package/dist/TimeRangePicker.test.js +0 -482
  44. package/dist/VectorFieldChart.test.d.ts +0 -2
  45. package/dist/VectorFieldChart.test.d.ts.map +0 -1
  46. package/dist/VectorFieldChart.test.js +0 -59
  47. package/dist/WindBarbChart.test.d.ts +0 -2
  48. package/dist/WindBarbChart.test.d.ts.map +0 -1
  49. package/dist/WindBarbChart.test.js +0 -65
@@ -1,59 +0,0 @@
1
- import { render } from "@testing-library/svelte";
2
- import { describe, expect, it } from "vitest";
3
- import VectorFieldChart from "./VectorFieldChart.svelte";
4
- const field = [
5
- { x: 0, y: 0, length: 1, direction: 0 },
6
- { x: 1, y: 0, length: 2, direction: 90 },
7
- { x: 0, y: 1, length: 3, direction: 180 },
8
- { x: 1, y: 1, length: 4, direction: 270 }
9
- ];
10
- const arrows = (container) => Array.from(container.querySelectorAll(".st-vectorFieldChart__arrow"));
11
- const listItems = (container) => Array.from(container.querySelectorAll(".st-chartDataList li")).map((n) => n.textContent?.trim());
12
- const structuralClass = (el) => el.className.split(/\s+/)[0];
13
- describe("VectorFieldChart", () => {
14
- it("renders an img role and one arrow per datum", () => {
15
- const { container } = render(VectorFieldChart, { props: { data: field, label: "Vent" } });
16
- expect(container.querySelector('[role="img"]')).toBeTruthy();
17
- expect(arrows(container).length).toBe(4);
18
- });
19
- it("draws a shaft and two head segments per arrow", () => {
20
- const { container } = render(VectorFieldChart, { props: { data: field, label: "V" } });
21
- expect(container.querySelectorAll(".st-vectorFieldChart__shaft").length).toBe(4);
22
- expect(container.querySelectorAll(".st-vectorFieldChart__head").length).toBe(8);
23
- });
24
- it("colours arrows by magnitude bin (largest magnitude → category8)", () => {
25
- const { container } = render(VectorFieldChart, { props: { data: field, label: "V" } });
26
- const last = arrows(container).at(-1);
27
- expect(last.classList.contains("st-vectorFieldChart__arrow--category8")).toBe(true);
28
- });
29
- it("renders graduated X/Y axes with nice ticks", () => {
30
- const { container } = render(VectorFieldChart, { props: { data: field, label: "V" } });
31
- expect(container.querySelectorAll(".st-vectorFieldChart__axis").length).toBe(2);
32
- expect(container.querySelectorAll(".st-vectorFieldChart__tick").length).toBeGreaterThan(0);
33
- });
34
- it("lists every datum in the accessible data list", () => {
35
- const { container } = render(VectorFieldChart, {
36
- props: { data: [{ x: 2, y: 3, length: 5, direction: 45 }], label: "V" }
37
- });
38
- expect(listItems(container)[0]).toBe("x 2, y 3 · |v| 5 @ 45°");
39
- });
40
- it("drops non-finite or negative-magnitude points before rendering", () => {
41
- const { container } = render(VectorFieldChart, {
42
- props: {
43
- data: [
44
- { x: Number.NaN, y: 0, length: 1, direction: 0 },
45
- { x: 0, y: 0, length: -1, direction: 0 },
46
- { x: 1, y: 1, length: 2, direction: 0 }
47
- ],
48
- label: "V"
49
- }
50
- });
51
- expect(arrows(container).length).toBe(1);
52
- });
53
- it("merges a custom class onto the root", () => {
54
- const { container } = render(VectorFieldChart, { props: { data: field, class: "mine" } });
55
- const root = container.querySelector(".st-vectorFieldChart");
56
- expect(structuralClass(root)).toBe("st-vectorFieldChart");
57
- expect(root.classList.contains("mine")).toBe(true);
58
- });
59
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=WindBarbChart.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WindBarbChart.test.d.ts","sourceRoot":"","sources":["../src/lib/WindBarbChart.test.ts"],"names":[],"mappings":""}
@@ -1,65 +0,0 @@
1
- import { render } from "@testing-library/svelte";
2
- import { describe, expect, it } from "vitest";
3
- import WindBarbChart from "./WindBarbChart.svelte";
4
- const series = [
5
- { at: 0, speed: 5, direction: 0 },
6
- { at: 1, speed: 15, direction: 90 },
7
- { at: 2, speed: 30, direction: 180 },
8
- { at: 3, speed: 65, direction: 270 }
9
- ];
10
- const barbs = (container) => Array.from(container.querySelectorAll(".st-windBarbChart__barb"));
11
- const listItems = (container) => Array.from(container.querySelectorAll(".st-chartDataList li")).map((n) => n.textContent?.trim());
12
- const structuralClass = (el) => el.className.split(/\s+/)[0];
13
- describe("WindBarbChart", () => {
14
- it("renders an img role and one barb per datum", () => {
15
- const { container } = render(WindBarbChart, { props: { data: series, label: "Vent" } });
16
- expect(container.querySelector('[role="img"]')).toBeTruthy();
17
- expect(barbs(container).length).toBe(4);
18
- });
19
- it("draws a shaft per barb", () => {
20
- const { container } = render(WindBarbChart, { props: { data: series, label: "W" } });
21
- expect(container.querySelectorAll(".st-windBarbChart__shaft").length).toBe(4);
22
- });
23
- it("draws feather symbols encoding the speed (half / full / flag)", () => {
24
- // 65 kt = 1 fanion (50) + 1 barbule pleine (10) + 1 demi (5) = 2 + 1 + 1 = 4 traits.
25
- const { container } = render(WindBarbChart, {
26
- props: { data: [{ at: 0, speed: 65, direction: 0 }], label: "W" }
27
- });
28
- expect(container.querySelectorAll(".st-windBarbChart__feather").length).toBe(4);
29
- });
30
- it("colours barbs by speed bin (largest speed → category8)", () => {
31
- const { container } = render(WindBarbChart, { props: { data: series, label: "W" } });
32
- const last = barbs(container).at(-1);
33
- expect(last.classList.contains("st-windBarbChart__barb--category8")).toBe(true);
34
- });
35
- it("renders a graduated time axis with nice ticks", () => {
36
- const { container } = render(WindBarbChart, { props: { data: series, label: "W" } });
37
- expect(container.querySelectorAll(".st-windBarbChart__axis").length).toBe(1);
38
- expect(container.querySelectorAll(".st-windBarbChart__tick").length).toBeGreaterThan(0);
39
- });
40
- it("lists every datum in the accessible data list", () => {
41
- const { container } = render(WindBarbChart, {
42
- props: { data: [{ at: 2, speed: 10, direction: 45 }], label: "W" }
43
- });
44
- expect(listItems(container)[0]).toBe("2 · 10 kt @ 45°");
45
- });
46
- it("drops non-finite or negative-speed points before rendering", () => {
47
- const { container } = render(WindBarbChart, {
48
- props: {
49
- data: [
50
- { at: Number.NaN, speed: 5, direction: 0 },
51
- { at: 0, speed: -1, direction: 0 },
52
- { at: 1, speed: 10, direction: 0 }
53
- ],
54
- label: "W"
55
- }
56
- });
57
- expect(barbs(container).length).toBe(1);
58
- });
59
- it("merges a custom class onto the root", () => {
60
- const { container } = render(WindBarbChart, { props: { data: series, class: "mine" } });
61
- const root = container.querySelector(".st-windBarbChart");
62
- expect(structuralClass(root)).toBe("st-windBarbChart");
63
- expect(root.classList.contains("mine")).toBe(true);
64
- });
65
- });