@vygruppen/spor-react 13.4.1 → 13.4.3

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.1 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.3 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.07 KB
14
15
  CJS dist/icons/index.cjs 381.00 B
15
- CJS dist/index.cjs 375.20 KB
16
+ CJS dist/index.cjs.map 747.62 KB
16
17
  CJS dist/icons/index.cjs.map 157.00 B
17
- CJS dist/index.cjs.map 745.37 KB
18
- CJS ⚡️ Build success in 3155ms
18
+ CJS ⚡️ Build success in 2665ms
19
+ ESM dist/index.mjs 351.48 KB
19
20
  ESM dist/icons/index.mjs 110.00 B
20
- ESM dist/index.mjs 350.63 KB
21
+ ESM dist/index.mjs.map 747.62 KB
21
22
  ESM dist/icons/index.mjs.map 157.00 B
22
- ESM dist/index.mjs.map 745.37 KB
23
- ESM ⚡️ Build success in 3156ms
24
- DTS ⚡️ Build success in 22936ms
23
+ ESM ⚡️ Build success in 2666ms
24
+ DTS ⚡️ Build success in 22585ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 151.03 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 151.03 KB
28
+ DTS dist/index.d.cts 154.14 KB
@@ -1,8 +1,8 @@
1
1
 
2
- > @vygruppen/spor-react@13.4.1 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.3 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: ⌘ enable debugging { debug: true }
5
+ ◇ injected env (0) from .env // tip: ⌘ multiple files { path: ['.env.local', '.env'] }
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
8
  ◒ Generating conditions types...
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - dea15ec: Solve accessibility problems: 1) adjust width of calendar-view in DatePicker to not overflow the screens view. 2) add asterisk to TimePicker when set to required. 3) Remove aria-assertive on errormessage in TimePicker.
8
+ - 3426845: Add aria-labels to dateTime segments in TimePicker
9
+ - dc7f5af: Add paddingleft to textarea and change the color of surface.ghost.hover in Vy-Digital theme
10
+ - Updated dependencies [3b905c8]
11
+ - Updated dependencies [5aabe19]
12
+ - Updated dependencies [dc7f5af]
13
+ - @vygruppen/spor-design-tokens@5.0.5
14
+
15
+ ## 13.4.2
16
+
17
+ ### Patch Changes
18
+
19
+ - 5e1ff50: Dialog: add possibility to send positioner-props to Chakra's positioner
20
+ - b395020: Add brightRed colorPalette to Badge
21
+ - c976a77: Breadcrumb: change styling of links to have an underline
22
+ - 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.
23
+
3
24
  ## 13.4.1
4
25
 
5
26
  ### Patch 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
+ });