@vygruppen/spor-react 13.4.0 → 13.4.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.0 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.2 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.tsx, src/icons/index.tsx
@@ -11,18 +11,18 @@ CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
13
  DTS Build start
14
- CJS dist/index.cjs 376.01 KB
15
- CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/index.cjs.map 746.70 KB
17
- CJS dist/icons/index.cjs.map 157.00 B
18
- CJS ⚡️ Build success in 2712ms
19
- ESM dist/index.mjs 351.44 KB
14
+ ESM dist/index.mjs 350.52 KB
20
15
  ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 746.70 KB
16
+ ESM dist/index.mjs.map 745.68 KB
22
17
  ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 2713ms
24
- DTS ⚡️ Build success in 22345ms
18
+ ESM ⚡️ Build success in 2121ms
19
+ CJS dist/index.cjs 375.08 KB
20
+ CJS dist/icons/index.cjs 381.00 B
21
+ CJS dist/index.cjs.map 745.68 KB
22
+ CJS dist/icons/index.cjs.map 157.00 B
23
+ CJS ⚡️ Build success in 2121ms
24
+ DTS ⚡️ Build success in 17019ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 152.00 KB
26
+ DTS dist/index.d.ts 154.14 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 152.00 KB
28
+ DTS dist/index.d.cts 154.14 KB
@@ -1,12 +1,11 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.0 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.2 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
- ◇ injected env (0) from .env // tip: auth for agents [www.vestauth.com]
5
+ ◇ injected env (0) from .env // tip: suppress logs { quiet: true }
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
- ◒ Generating conditions types...
9
- ◇ ✅ Generated conditions typings
8
+ ◇ Generated conditions typings
10
9
  [?25h[?25l│
11
10
  ◒ Generating recipe types...
12
11
  ◇ ✅ Generated recipe typings
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5e1ff50: Dialog: add possibility to send positioner-props to Chakra's positioner
8
+ - b395020: Add brightRed colorPalette to Badge
9
+ - c976a77: Breadcrumb: change styling of links to have an underline
10
+ - 5a65a8e: AttachedInputs: removed "!important"-tag on styling, and added "flipButtonProps" as a prop to the AttahcedInput component to make it possible to override the styling of the button.
11
+
12
+ ## 13.4.1
13
+
14
+ ### Patch Changes
15
+
16
+ - e5b9c5e: Added customization option for travel and info tags `descriptionProps` & `titleProps`
17
+ - b6495d6: Update TravelTag background colours and walk LineIcon dark mode colour
18
+
3
19
  ## 13.4.0
4
20
 
5
21
  ### Minor Changes
@@ -0,0 +1,110 @@
1
+ import { ConditionalValue } from "@chakra-ui/react";
2
+ import { AccordionRootProps as ChakraAccordionProps } from "@chakra-ui/react";
3
+ import { render, screen } from "@testing-library/react";
4
+ import userEvent from "@testing-library/user-event";
5
+ import {
6
+ Accordion,
7
+ AccordionItem,
8
+ AccordionItemContent,
9
+ AccordionItemTrigger,
10
+ SporProvider,
11
+ } from "@vygruppen/spor-react";
12
+ import { Ref } from "react";
13
+ import { JSX } from "react/jsx-runtime";
14
+ import { describe, expect, test, vi } from "vitest";
15
+
16
+ const AccordionTest = (
17
+ props: JSX.IntrinsicAttributes &
18
+ ChakraAccordionProps & {
19
+ variant?: ConditionalValue<
20
+ "core" | "ghost" | "underlined" | "floating" | undefined
21
+ >;
22
+ } & {
23
+ children?: React.ReactNode | undefined;
24
+ } & {
25
+ variant?: "ghost" | "core" | "floating" | "underlined";
26
+ gap?: string | number;
27
+ href?: string;
28
+ } & {
29
+ ref?: Ref<HTMLDivElement>;
30
+ },
31
+ ) => {
32
+ return (
33
+ <SporProvider>
34
+ <Accordion
35
+ collapsible
36
+ width="100%"
37
+ {...props}
38
+ data-testid="accordion-root"
39
+ >
40
+ <AccordionItem value="accordion-item-1">
41
+ <AccordionItemTrigger data-testid="accordion-item-1">
42
+ Item 1 trigger
43
+ </AccordionItemTrigger>
44
+ <AccordionItemContent>Item 1 content</AccordionItemContent>
45
+ </AccordionItem>
46
+ <AccordionItem value="accordion-item-2">
47
+ <AccordionItemTrigger data-testid="accordion-item-2">
48
+ Item 1 trigger
49
+ </AccordionItemTrigger>
50
+ <AccordionItemContent>Item 1 content</AccordionItemContent>
51
+ </AccordionItem>
52
+ </Accordion>
53
+ </SporProvider>
54
+ );
55
+ };
56
+
57
+ describe("Uncontrolled accordion", () => {
58
+ test("handles expandable-state correctly", async () => {
59
+ const user = userEvent.setup();
60
+
61
+ render(<AccordionTest />);
62
+
63
+ const item1 = screen.getByTestId("accordion-item-1") as HTMLInputElement;
64
+ const item2 = screen.getByTestId("accordion-item-2") as HTMLInputElement;
65
+
66
+ await user.click(item2);
67
+
68
+ expect(item1.ariaExpanded).toBe("false");
69
+ expect(item2.ariaExpanded).toBe("true");
70
+ });
71
+ });
72
+
73
+ describe("Controlled accordion", () => {
74
+ test("handles expandable-state correctly", async () => {
75
+ const expandedItems = ["accordion-item-1"];
76
+ render(<AccordionTest value={expandedItems} />);
77
+
78
+ const item1 = screen.getByTestId("accordion-item-1") as HTMLInputElement;
79
+ const item2 = screen.getByTestId("accordion-item-2") as HTMLInputElement;
80
+
81
+ expect(item1.ariaExpanded).toBe("true");
82
+ expect(item2.ariaExpanded).toBe("false");
83
+ });
84
+ });
85
+
86
+ describe("Default open accordion", () => {
87
+ test("handles expandable-state correctly", async () => {
88
+ render(<AccordionTest defaultValue={["accordion-item-1"]} />);
89
+
90
+ const item1 = screen.getByTestId("accordion-item-1") as HTMLInputElement;
91
+ const item2 = screen.getByTestId("accordion-item-2") as HTMLInputElement;
92
+
93
+ expect(item1.ariaExpanded).toBe("true");
94
+ expect(item2.ariaExpanded).toBe("false");
95
+ });
96
+ });
97
+
98
+ describe("OnValuechange accordion", () => {
99
+ test("handles onValueChange correctly", async () => {
100
+ const onValueChange = vi.fn();
101
+
102
+ const user = userEvent.setup();
103
+ render(<AccordionTest onValueChange={onValueChange} />);
104
+
105
+ const item1 = screen.getByTestId("accordion-item-1") as HTMLInputElement;
106
+ await user.click(item1);
107
+
108
+ expect(onValueChange).toHaveBeenCalled();
109
+ });
110
+ });