@navikt/ds-react 2.8.16 → 2.9.1

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/_docs.json CHANGED
@@ -1641,12 +1641,12 @@
1641
1641
  "name": "onToggle",
1642
1642
  "parent": {
1643
1643
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1644
- "name": "ExpansionCardProps"
1644
+ "name": "ExpansionCardCommonProps"
1645
1645
  },
1646
1646
  "declarations": [
1647
1647
  {
1648
1648
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1649
- "name": "ExpansionCardProps"
1649
+ "name": "ExpansionCardCommonProps"
1650
1650
  }
1651
1651
  ],
1652
1652
  "required": false,
@@ -1660,12 +1660,12 @@
1660
1660
  "name": "open",
1661
1661
  "parent": {
1662
1662
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1663
- "name": "ExpansionCardProps"
1663
+ "name": "ExpansionCardCommonProps"
1664
1664
  },
1665
1665
  "declarations": [
1666
1666
  {
1667
1667
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1668
- "name": "ExpansionCardProps"
1668
+ "name": "ExpansionCardCommonProps"
1669
1669
  }
1670
1670
  ],
1671
1671
  "required": false,
@@ -1681,12 +1681,12 @@
1681
1681
  "name": "defaultOpen",
1682
1682
  "parent": {
1683
1683
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1684
- "name": "ExpansionCardProps"
1684
+ "name": "ExpansionCardCommonProps"
1685
1685
  },
1686
1686
  "declarations": [
1687
1687
  {
1688
1688
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1689
- "name": "ExpansionCardProps"
1689
+ "name": "ExpansionCardCommonProps"
1690
1690
  }
1691
1691
  ],
1692
1692
  "required": false,
@@ -1702,12 +1702,12 @@
1702
1702
  "name": "size",
1703
1703
  "parent": {
1704
1704
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1705
- "name": "ExpansionCardProps"
1705
+ "name": "ExpansionCardCommonProps"
1706
1706
  },
1707
1707
  "declarations": [
1708
1708
  {
1709
1709
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1710
- "name": "ExpansionCardProps"
1710
+ "name": "ExpansionCardCommonProps"
1711
1711
  }
1712
1712
  ],
1713
1713
  "required": false,
@@ -1715,37 +1715,72 @@
1715
1715
  "name": "\"medium\" | \"small\""
1716
1716
  }
1717
1717
  },
1718
+ "className": {
1719
+ "defaultValue": null,
1720
+ "description": "",
1721
+ "name": "className",
1722
+ "parent": {
1723
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1724
+ "name": "HTMLAttributes"
1725
+ },
1726
+ "declarations": [
1727
+ {
1728
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1729
+ "name": "HTMLAttributes"
1730
+ }
1731
+ ],
1732
+ "required": false,
1733
+ "type": {
1734
+ "name": "string"
1735
+ }
1736
+ },
1718
1737
  "aria-label": {
1719
1738
  "defaultValue": null,
1720
- "description": "Since ExpansionCard is a section-element, accessible name is required.",
1739
+ "description": "Defines a string value that labels the current element.\n@see aria-labelledby.",
1721
1740
  "name": "aria-label",
1722
1741
  "parent": {
1723
- "fileName": "src/expansion-card/ExpansionCard.tsx",
1724
- "name": "ExpansionCardProps"
1742
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1743
+ "name": "AriaAttributes"
1725
1744
  },
1726
1745
  "declarations": [
1746
+ {
1747
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1748
+ "name": "AriaAttributes"
1749
+ },
1727
1750
  {
1728
1751
  "fileName": "src/expansion-card/ExpansionCard.tsx",
1729
- "name": "ExpansionCardProps"
1752
+ "name": "TypeLiteral"
1753
+ },
1754
+ {
1755
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1756
+ "name": "AriaAttributes"
1730
1757
  }
1731
1758
  ],
1732
- "required": true,
1759
+ "required": false,
1733
1760
  "type": {
1734
1761
  "name": "string"
1735
1762
  }
1736
1763
  },
1737
- "className": {
1764
+ "aria-labelledby": {
1738
1765
  "defaultValue": null,
1739
- "description": "",
1740
- "name": "className",
1766
+ "description": "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",
1767
+ "name": "aria-labelledby",
1741
1768
  "parent": {
1742
1769
  "fileName": "aksel/node_modules/@types/react/index.d.ts",
1743
- "name": "HTMLAttributes"
1770
+ "name": "AriaAttributes"
1744
1771
  },
1745
1772
  "declarations": [
1746
1773
  {
1747
1774
  "fileName": "aksel/node_modules/@types/react/index.d.ts",
1748
- "name": "HTMLAttributes"
1775
+ "name": "AriaAttributes"
1776
+ },
1777
+ {
1778
+ "fileName": "aksel/node_modules/@types/react/index.d.ts",
1779
+ "name": "AriaAttributes"
1780
+ },
1781
+ {
1782
+ "fileName": "src/expansion-card/ExpansionCard.tsx",
1783
+ "name": "TypeLiteral"
1749
1784
  }
1750
1785
  ],
1751
1786
  "required": false,
@@ -2917,7 +2952,7 @@
2917
2952
  "props": {
2918
2953
  "maxLength": {
2919
2954
  "defaultValue": null,
2920
- "description": "Allowed character-count for content\n@note This is just a visual validator, you need to set actual character-limits if needed",
2955
+ "description": "Allowed character-count for content\n@note This is just a visual indicator! You will need to handle actual character-limits/validation if needed",
2921
2956
  "name": "maxLength",
2922
2957
  "parent": {
2923
2958
  "fileName": "src/form/Textarea.tsx",
@@ -9,7 +9,7 @@ interface ExpansionCardComponent extends React.ForwardRefExoticComponent<Expansi
9
9
  Description: ExpansionCardDescriptionType;
10
10
  Content: ExpansionCardContentType;
11
11
  }
12
- export interface ExpansionCardProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ interface ExpansionCardCommonProps extends React.HTMLAttributes<HTMLDivElement> {
13
13
  children: React.ReactNode;
14
14
  /**
15
15
  * Callback for when Card is toggled open/closed
@@ -29,16 +29,18 @@ export interface ExpansionCardProps extends React.HTMLAttributes<HTMLDivElement>
29
29
  * @default "medium"
30
30
  */
31
31
  size?: "medium" | "small";
32
- /**
33
- * Since ExpansionCard is a section-element, accessible name is required.
34
- */
35
- ["aria-label"]: string;
36
32
  }
33
+ type ExpansionCardConditionalProps = {
34
+ ["aria-label"]: string;
35
+ } | {
36
+ ["aria-labelledby"]: string;
37
+ };
37
38
  export type ExpansionCardContextProps = {
38
39
  open: boolean;
39
40
  toggleOpen: () => void;
40
41
  size: "medium" | "small";
41
42
  };
42
43
  export declare const ExpansionCardContext: React.Context<ExpansionCardContextProps>;
44
+ export type ExpansionCardProps = ExpansionCardCommonProps & ExpansionCardConditionalProps;
43
45
  export declare const ExpansionCard: ExpansionCardComponent;
44
46
  export default ExpansionCard;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpansionCard.js","sourceRoot":"","sources":["../../src/expansion-card/ExpansionCard.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,oBAEN,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,GAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,mBAEN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AA6C9B,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA4B;IAC3E,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,GAAG,EAAE,GAAE,CAAC;IACpB,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CACrC,CACE,EAOC,EACD,GAAG,EACH,EAAE;QATF,EACE,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,WAAW,GAAG,KAAK,EACnB,IAAI,GAAG,QAAQ,OAEhB,EADI,IAAI,cANT,wDAOC,CADQ;IAIT,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEhD,MAAM,UAAU,GA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O,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE;QAE5D,iDACM,IAAI,IACR,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,SAAS,EACT,wBAAwB,IAAI,EAAE,EAC9B;gBACE,2BAA2B,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,KAAK;gBAC1C,8BAA8B,EAAE,CAAC,UAAU,CAAC,OAAO;aACpD,CACF,EACD,GAAG,EAAE,GAAG,IACR,CAC4B,CACjC,CAAC;AACJ,CAAC,CACwB,CAAC;AAE5B,aAAa,CAAC,MAAM,GAAG,mBAAmB,CAAC;AAC3C,aAAa,CAAC,OAAO,GAAG,oBAAoB,CAAC;AAC7C,aAAa,CAAC,KAAK,GAAG,kBAAkB,CAAC;AACzC,aAAa,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAErD,eAAe,aAAa,CAAC"}
@@ -6,7 +6,7 @@ import { FormFieldProps } from "./useFormField";
6
6
  export interface TextareaProps extends FormFieldProps, React.TextareaHTMLAttributes<HTMLTextAreaElement> {
7
7
  /**
8
8
  * Allowed character-count for content
9
- * @note This is just a visual validator, you need to set actual character-limits if needed
9
+ * @note This is just a visual indicator! You will need to handle actual character-limits/validation if needed
10
10
  */
11
11
  maxLength?: number;
12
12
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@navikt/ds-react",
3
- "version": "2.8.16",
3
+ "version": "2.9.1",
4
4
  "description": "Aksel react-components for NAV designsystem",
5
5
  "author": "Aksel | NAV designsystem team",
6
6
  "license": "MIT",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@floating-ui/react": "0.17.0",
41
- "@navikt/aksel-icons": "^2.8.16",
42
- "@navikt/ds-icons": "^2.8.16",
41
+ "@navikt/aksel-icons": "^2.9.1",
42
+ "@navikt/ds-icons": "^2.9.1",
43
43
  "@radix-ui/react-tabs": "1.0.0",
44
44
  "@radix-ui/react-toggle-group": "1.0.0",
45
45
  "clsx": "^1.2.1",
@@ -25,7 +25,7 @@ interface ExpansionCardComponent
25
25
  Content: ExpansionCardContentType;
26
26
  }
27
27
 
28
- export interface ExpansionCardProps
28
+ interface ExpansionCardCommonProps
29
29
  extends React.HTMLAttributes<HTMLDivElement> {
30
30
  children: React.ReactNode;
31
31
  /**
@@ -49,9 +49,16 @@ export interface ExpansionCardProps
49
49
  /**
50
50
  * Since ExpansionCard is a section-element, accessible name is required.
51
51
  */
52
- ["aria-label"]: string;
53
52
  }
54
53
 
54
+ type ExpansionCardConditionalProps =
55
+ | {
56
+ ["aria-label"]: string;
57
+ }
58
+ | {
59
+ ["aria-labelledby"]: string;
60
+ };
61
+
55
62
  export type ExpansionCardContextProps = {
56
63
  open: boolean;
57
64
  toggleOpen: () => void;
@@ -64,6 +71,9 @@ export const ExpansionCardContext = createContext<ExpansionCardContextProps>({
64
71
  size: "medium",
65
72
  });
66
73
 
74
+ export type ExpansionCardProps = ExpansionCardCommonProps &
75
+ ExpansionCardConditionalProps;
76
+
67
77
  export const ExpansionCard = forwardRef<HTMLDivElement, ExpansionCardProps>(
68
78
  (
69
79
  {
@@ -13,7 +13,7 @@ export interface TextareaProps
13
13
  React.TextareaHTMLAttributes<HTMLTextAreaElement> {
14
14
  /**
15
15
  * Allowed character-count for content
16
- * @note This is just a visual validator, you need to set actual character-limits if needed
16
+ * @note This is just a visual indicator! You will need to handle actual character-limits/validation if needed
17
17
  */
18
18
  maxLength?: number;
19
19
  /**