@vygruppen/spor-react 13.3.1 → 13.4.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@13.3.1 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.0 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 374.36 KB
14
+ CJS dist/index.cjs 376.01 KB
15
15
  CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/index.cjs.map 743.53 KB
16
+ CJS dist/index.cjs.map 746.70 KB
17
17
  CJS dist/icons/index.cjs.map 157.00 B
18
- CJS ⚡️ Build success in 2739ms
19
- ESM dist/index.mjs 349.83 KB
18
+ CJS ⚡️ Build success in 2712ms
19
+ ESM dist/index.mjs 351.44 KB
20
20
  ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 743.53 KB
21
+ ESM dist/index.mjs.map 746.70 KB
22
22
  ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 2740ms
24
- DTS ⚡️ Build success in 22700ms
23
+ ESM ⚡️ Build success in 2713ms
24
+ DTS ⚡️ Build success in 22345ms
25
25
  DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 150.54 KB
26
+ DTS dist/index.d.ts 152.00 KB
27
27
  DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 150.54 KB
28
+ DTS dist/index.d.cts 152.00 KB
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@13.3.1 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.4.0 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
5
  ◇ injected env (0) from .env // tip: ⌁ auth for agents [www.vestauth.com]
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6412d40: Add size variant with options between small and medium for form elements, including Input, PasswordInput, PhonenumberInput, SearchInput, and Select
8
+
9
+ ### Patch Changes
10
+
11
+ - e864f09: Phonenumber input: remove red border from countrycode select when invalid
12
+ - 17a00b7: Remove padding around link in breadcrumb to prevent text from moving 3px when navigating between elements
13
+ - @vygruppen/spor-icon-react@5.0.0
14
+
15
+ ## 13.3.2
16
+
17
+ ### Patch Changes
18
+
19
+ - b1e5186: Add disabled colorPalette to badge
20
+ - d6eddea: Add Chakra's AccordionItem-props to the ExpandableItem
21
+ - Updated dependencies [0a35c66]
22
+ - @vygruppen/spor-design-tokens@5.0.4
23
+
3
24
  ## 13.3.1
4
25
 
5
26
  ### Patch Changes
@@ -0,0 +1,69 @@
1
+ import { RadioGroupRootProps } from "@chakra-ui/react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import userEvent from "@testing-library/user-event";
4
+ import { Radio, RadioGroup, SporProvider } from "@vygruppen/spor-react";
5
+ import { Ref } from "react";
6
+ import { JSX } from "react/jsx-runtime";
7
+ import { describe, expect, test } from "vitest";
8
+
9
+ const value1 = "My first value";
10
+ const label1 = "World's best radio label";
11
+ const value2 = "Life changing value";
12
+ const label2 = "Radio label of the year";
13
+
14
+ const RadioGroupTest = (
15
+ props: JSX.IntrinsicAttributes &
16
+ Omit<RadioGroupRootProps, "colorPalette" | "size" | "variant"> & {
17
+ ref?: Ref<HTMLDivElement>;
18
+ },
19
+ ) => (
20
+ <SporProvider>
21
+ <RadioGroup {...props}>
22
+ <Radio value={value1}>{label1}</Radio>
23
+ <Radio value={value2}>{label2}</Radio>
24
+ </RadioGroup>
25
+ </SporProvider>
26
+ );
27
+
28
+ describe("Uncontrolled RadioGroup", () => {
29
+ test("handles state correctly", async () => {
30
+ const user = userEvent.setup();
31
+
32
+ render(<RadioGroupTest />);
33
+
34
+ const input1 = screen.getByRole("radio", {
35
+ name: label1,
36
+ }) as HTMLInputElement;
37
+ const input2 = screen.getByRole("radio", {
38
+ name: label2,
39
+ }) as HTMLInputElement;
40
+
41
+ expect(input1.checked).toBe(false);
42
+ expect(input2.checked).toBe(false);
43
+
44
+ await user.click(screen.getByRole("radio", { name: label2 }));
45
+
46
+ expect(input1.checked).toBe(false);
47
+ expect(input2.checked).toBe(true);
48
+ });
49
+
50
+ test("handles defaultValue correctly", async () => {
51
+ const user = userEvent.setup();
52
+ render(<RadioGroupTest defaultValue={value1} />);
53
+
54
+ const input1 = screen.getByRole("radio", {
55
+ name: label1,
56
+ }) as HTMLInputElement;
57
+ const input2 = screen.getByRole("radio", {
58
+ name: label2,
59
+ }) as HTMLInputElement;
60
+
61
+ expect(input1.checked).toBe(true);
62
+ expect(input2.checked).toBe(false);
63
+
64
+ await user.click(screen.getByRole("radio", { name: label2 }));
65
+
66
+ expect(input1.checked).toBe(false);
67
+ expect(input2.checked).toBe(true);
68
+ });
69
+ });