@inera/ids-react 8.0.0 → 8.2.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.
Files changed (125) hide show
  1. package/components/accordion/accordion.d.ts +1 -0
  2. package/components/accordion/accordion.js +5 -43
  3. package/components/action-link/action-link.d.ts +6 -0
  4. package/components/action-link/action-link.js +9 -0
  5. package/components/badge/badge.d.ts +3 -5
  6. package/components/badge/badge.js +2 -2
  7. package/components/box-link/box-link.d.ts +3 -5
  8. package/components/box-link/box-link.js +3 -4
  9. package/components/breadcrumbs/breadcrumbs.d.ts +2 -3
  10. package/components/breadcrumbs/breadcrumbs.js +2 -3
  11. package/components/button/button.d.ts +1 -2
  12. package/components/button-group/button-group.d.ts +2 -3
  13. package/components/button-group/button-group.js +2 -2
  14. package/components/card/card.d.ts +3 -4
  15. package/components/card/card.js +12 -7
  16. package/components/date-label/date-label.d.ts +2 -2
  17. package/components/date-label/date-label.js +9 -31
  18. package/components/dialog/dialog.d.ts +1 -1
  19. package/components/dialog/dialog.js +5 -6
  20. package/components/dropdown/dropdown-content-link.d.ts +1 -1
  21. package/components/dropdown/dropdown-content-link.js +2 -2
  22. package/components/dropdown/dropdown.d.ts +1 -1
  23. package/components/dropdown/dropdown.js +2 -2
  24. package/components/footer-1177/footer-1177.d.ts +3 -4
  25. package/components/footer-1177/footer-1177.js +7 -44
  26. package/components/footer-1177-admin/footer-1177-admin.d.ts +1 -1
  27. package/components/footer-1177-admin/footer-1177-admin.js +4 -41
  28. package/components/footer-1177-pro/footer-1177-pro.d.ts +1 -1
  29. package/components/footer-1177-pro/footer-1177-pro.js +4 -41
  30. package/components/footer-inera/footer-inera.d.ts +1 -1
  31. package/components/footer-inera/footer-inera.js +4 -41
  32. package/components/footer-inera-admin/footer-inera-admin.d.ts +1 -1
  33. package/components/footer-inera-admin/footer-inera-admin.js +4 -41
  34. package/components/form/checkbox/checkbox.js +3 -2
  35. package/components/form/datepicker/datepicker.d.ts +29 -0
  36. package/components/form/datepicker/datepicker.js +179 -0
  37. package/components/form/input/input.js +1 -1
  38. package/components/form/radio/radio.js +2 -1
  39. package/components/global-alert/global-alert.js +2 -2
  40. package/components/grid/column.d.ts +3 -4
  41. package/components/grid/column.js +2 -3
  42. package/components/grid/container.d.ts +5 -3
  43. package/components/grid/container.js +11 -18
  44. package/components/grid/row.d.ts +4 -4
  45. package/components/grid/row.js +6 -11
  46. package/components/header-1177/header-1177-item.d.ts +2 -2
  47. package/components/header-1177/header-1177-item.js +19 -14
  48. package/components/header-1177/header-1177-nav-item-mobile.js +5 -10
  49. package/components/header-1177/header-1177-nav-item.d.ts +4 -4
  50. package/components/header-1177/header-1177-nav-item.js +23 -17
  51. package/components/header-1177/header-1177-nav.d.ts +2 -2
  52. package/components/header-1177/header-1177-nav.js +4 -5
  53. package/components/header-1177/header-1177.d.ts +1 -1
  54. package/components/header-1177/header-1177.js +3 -16
  55. package/components/header-1177-admin/header-1177-admin-item.d.ts +2 -2
  56. package/components/header-1177-admin/header-1177-admin-item.js +21 -17
  57. package/components/header-1177-admin/header-1177-admin-nav-item.d.ts +4 -4
  58. package/components/header-1177-admin/header-1177-admin-nav-item.js +20 -14
  59. package/components/header-1177-admin/header-1177-admin-nav.d.ts +2 -2
  60. package/components/header-1177-admin/header-1177-admin-nav.js +5 -6
  61. package/components/header-1177-admin/header-1177-admin.d.ts +2 -2
  62. package/components/header-1177-admin/header-1177-admin.js +3 -4
  63. package/components/header-1177-pro/header-1177-pro-item.d.ts +2 -2
  64. package/components/header-1177-pro/header-1177-pro-item.js +21 -14
  65. package/components/header-1177-pro/header-1177-pro-nav-item.d.ts +5 -5
  66. package/components/header-1177-pro/header-1177-pro-nav-item.js +15 -19
  67. package/components/header-1177-pro/header-1177-pro-nav.d.ts +2 -3
  68. package/components/header-1177-pro/header-1177-pro-nav.js +5 -7
  69. package/components/header-1177-pro/header-1177-pro.d.ts +2 -2
  70. package/components/header-1177-pro/header-1177-pro.js +4 -8
  71. package/components/header-inera/header-inera-item.d.ts +3 -4
  72. package/components/header-inera/header-inera-item.js +30 -14
  73. package/components/header-inera/header-inera-nav-item.js +7 -20
  74. package/components/header-inera/header-inera-nav.d.ts +1 -1
  75. package/components/header-inera/header-inera-nav.js +5 -6
  76. package/components/header-inera/header-inera.d.ts +2 -2
  77. package/components/header-inera/header-inera.js +4 -8
  78. package/components/header-inera-admin/header-inera-admin-item.d.ts +3 -4
  79. package/components/header-inera-admin/header-inera-admin-item.js +17 -13
  80. package/components/header-inera-admin/header-inera-admin-nav-item.d.ts +1 -3
  81. package/components/header-inera-admin/header-inera-admin-nav-item.js +14 -27
  82. package/components/header-inera-admin/header-inera-admin-nav.d.ts +2 -3
  83. package/components/header-inera-admin/header-inera-admin-nav.js +3 -4
  84. package/components/header-inera-admin/header-inera-admin.d.ts +1 -1
  85. package/components/header-inera-admin/header-inera-admin.js +3 -4
  86. package/components/link/link.d.ts +1 -1
  87. package/components/link/link.js +15 -13
  88. package/components/navigation/content/navigation-content.d.ts +2 -3
  89. package/components/navigation/content/navigation-content.js +5 -12
  90. package/components/navigation/local/navigation-local.d.ts +2 -3
  91. package/components/navigation/local/navigation-local.js +2 -2
  92. package/components/notification/badge/notification-badge.d.ts +2 -3
  93. package/components/notification/badge/notification-badge.js +3 -3
  94. package/components/pagination/data-pagination/data-pagination.d.ts +1 -2
  95. package/components/pagination/data-pagination/data-pagination.js +0 -1
  96. package/components/pagination/list-pagination/list-pagination.d.ts +1 -1
  97. package/components/pagination/list-pagination/list-pagination.js +2 -3
  98. package/components/popover/popover.js +1 -1
  99. package/components/progressbar/progressbar.d.ts +5 -3
  100. package/components/progressbar/progressbar.js +4 -4
  101. package/components/puff-list/puff-list-item/puff-list-item-date.d.ts +13 -0
  102. package/components/puff-list/puff-list-item/puff-list-item-date.js +23 -0
  103. package/components/puff-list/puff-list-item/puff-list-item-header.d.ts +10 -0
  104. package/components/puff-list/puff-list-item/puff-list-item-header.js +11 -0
  105. package/components/puff-list/puff-list-item/puff-list-item-info.d.ts +3 -5
  106. package/components/puff-list/puff-list-item/puff-list-item-info.js +4 -5
  107. package/components/puff-list/puff-list-item/puff-list-item.d.ts +9 -20
  108. package/components/puff-list/puff-list-item/puff-list-item.js +8 -78
  109. package/components/puff-list/puff-list.d.ts +1 -1
  110. package/components/puff-list/puff-list.js +4 -3
  111. package/components/region-icon/region-icon.d.ts +2 -2
  112. package/components/region-icon/region-icon.js +5 -4
  113. package/components/side-menu/side-menu.js +1 -1
  114. package/components/stepper/step.js +1 -1
  115. package/components/stepper/stepper.d.ts +1 -1
  116. package/components/stepper/stepper.js +2 -2
  117. package/components/tabs/tab.js +1 -1
  118. package/components/tag/tag.d.ts +11 -4
  119. package/components/tag/tag.js +7 -7
  120. package/components/tooltip/tooltip.d.ts +1 -0
  121. package/components/tooltip/tooltip.js +8 -7
  122. package/components/utils/hooks/useFocusTrap.js +3 -2
  123. package/index.d.ts +4 -0
  124. package/index.js +4 -0
  125. package/package.json +2 -2
@@ -5,5 +5,5 @@ interface IDSStepperProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  children: ReactElement<IDSStepProps>[] | ReactElement<IDSStepProps>;
6
6
  onToggleExpansion?: (step: number, expanded: boolean) => void;
7
7
  }
8
- export declare const IDSStepper: React.FC<IDSStepperProps>;
8
+ export declare function IDSStepper({ children, onToggleExpansion, className, ...props }: IDSStepperProps): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -4,7 +4,7 @@ import React, { isValidElement, cloneElement } from 'react';
4
4
  import '@inera/ids-design/components/stepper/stepper.css';
5
5
  import clsx from 'clsx';
6
6
 
7
- const IDSStepper = ({ children, onToggleExpansion, className, ...props }) => {
7
+ function IDSStepper({ children, onToggleExpansion, className, ...props }) {
8
8
  const stepsArray = React.Children.toArray(children).filter(isValidElement);
9
9
  const handleExpansion = (step, expanded) => {
10
10
  onToggleExpansion?.(step, expanded);
@@ -18,6 +18,6 @@ const IDSStepper = ({ children, onToggleExpansion, className, ...props }) => {
18
18
  });
19
19
  });
20
20
  return (jsx("div", { className: clsx("ids-stepper", className), ...props, children: enhancedSteps }));
21
- };
21
+ }
22
22
 
23
23
  export { IDSStepper };
@@ -13,7 +13,7 @@ const IDSTab = ({ label, index, id = "", panelId = "", selected = false, icon =
13
13
  };
14
14
  return (jsx("div", { id: id, ref: tabRef, role: "tab", tabIndex: 0, onClick: handleClick, onKeyDown: onKeyDown, className: clsx("ids-tab", {
15
15
  "ids-tab--selected": selected
16
- }, className), "aria-selected": selected, "aria-controls": panelId, ...props, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-icon-${icon} ids-icon--m`, "aria-hidden": "true" }), label, notification] }) }));
16
+ }, className), "aria-selected": selected, "aria-controls": panelId, ...props, children: jsxs("div", { className: "ids-tab__label", children: [icon && jsx("span", { className: `ids-tab-icon ids-icon-${icon} ids-icon--m`, "aria-hidden": "true" }), label, notification && jsx("span", { className: "ids-tab-extra", children: notification })] }) }));
17
17
  };
18
18
 
19
19
  export { IDSTab };
@@ -1,10 +1,17 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import "@inera/ids-design/components/tag/tag.css";
3
- interface IDSTagProps extends React.HTMLAttributes<HTMLButtonElement> {
3
+ type ButtonTagProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
4
+ onClick: () => void;
5
+ onClose?: () => void;
4
6
  srCloseLabel?: string;
7
+ children?: ReactNode;
8
+ };
9
+ type SpanTagProps = React.HTMLAttributes<HTMLSpanElement> & {
10
+ onClick?: undefined;
5
11
  onClose?: () => void;
6
- onClick?: () => void;
12
+ srCloseLabel?: string;
7
13
  children?: ReactNode;
8
- }
9
- export declare const IDSTag: React.FC<IDSTagProps>;
14
+ };
15
+ type IDSTagProps = ButtonTagProps | SpanTagProps;
16
+ export declare const IDSTag: React.ForwardRefExoticComponent<IDSTagProps & React.RefAttributes<HTMLButtonElement | HTMLSpanElement>>;
10
17
  export {};
@@ -1,16 +1,16 @@
1
- "use client";
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { forwardRef } from 'react';
3
3
  import '@inera/ids-design/components/tag/tag.css';
4
4
  import clsx from 'clsx';
5
5
 
6
- const IDSTag = ({ srCloseLabel = "", onClose, onClick, children, className, ...props }) => {
7
- const TagWrapper = !!onClick ? "button" : "span";
8
- return (jsx(TagWrapper, { className: clsx("ids-tag", {
9
- "ids-tag--clickable": !!onClick
10
- }, className), onClick: !!onClick ? onClick : undefined, ...props, children: jsxs("div", { className: "ids-tag__content", children: [children, !onClick && !!onClose && (jsx("button", { className: "ids-tag__close-btn", "aria-label": srCloseLabel, onClick: e => {
6
+ const IDSTag = forwardRef(({ srCloseLabel = "", onClose, onClick, className, children, ...props }, ref) => {
7
+ const isClickable = !!onClick;
8
+ const TagWrapper = isClickable ? "button" : "span";
9
+ return (jsx(TagWrapper, { ref: ref, ...props, className: clsx("ids-tag", { "ids-tag--clickable": isClickable }, className), onClick: isClickable ? onClick : undefined, children: jsxs("div", { className: "ids-tag__content", children: [children, !isClickable && !!onClose && (jsx("button", { type: "button", className: "ids-tag__close-btn", "aria-label": srCloseLabel, onClick: e => {
11
10
  e.stopPropagation();
12
11
  onClose?.();
13
12
  } }))] }) }));
14
- };
13
+ });
14
+ IDSTag.displayName = "IDSTag";
15
15
 
16
16
  export { IDSTag };
@@ -3,6 +3,7 @@ import "@inera/ids-design/components/tooltip/tooltip.css";
3
3
  export type TooltipPosition = "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right";
4
4
  interface IDSTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
5
5
  position?: TooltipPosition;
6
+ maxWidth?: string;
6
7
  trigger: ReactNode;
7
8
  children?: ReactNode;
8
9
  }
@@ -5,7 +5,7 @@ import '@inera/ids-design/components/tooltip/tooltip.css';
5
5
  import { useElementId } from '../utils/hooks/useElementId.js';
6
6
  import clsx from 'clsx';
7
7
 
8
- const IDSTooltip = ({ position = "top", trigger, children, className, ...props }) => {
8
+ const IDSTooltip = ({ position = "top", maxWidth = "20rem", trigger, children, className, ...props }) => {
9
9
  const [translateX, setTranslateX] = useState(position === "top" || position === "bottom" ? "-50%" : "0");
10
10
  const [translateY, setTranslateY] = useState(position.includes("top") ? "-100%" : "100%");
11
11
  const tooltipContentRef = useRef(null);
@@ -19,9 +19,11 @@ const IDSTooltip = ({ position = "top", trigger, children, className, ...props }
19
19
  };
20
20
  const handleOverflow = () => {
21
21
  const tooltipContent = tooltipContentRef.current;
22
- if (!tooltipContent)
22
+ const trigger = triggerRef.current;
23
+ if (!tooltipContent || !trigger)
23
24
  return;
24
25
  const rect = tooltipContent.getBoundingClientRect();
26
+ const triggerHeight = trigger.getBoundingClientRect().height;
25
27
  const vw = window.innerWidth;
26
28
  const vh = window.innerHeight;
27
29
  if (rect.right > vw) {
@@ -35,10 +37,10 @@ const IDSTooltip = ({ position = "top", trigger, children, className, ...props }
35
37
  setTranslateX("0");
36
38
  }
37
39
  if (rect.bottom > vh) {
38
- setTranslateY("-100%");
40
+ setTranslateY(`-${triggerHeight + 16}px`);
39
41
  }
40
42
  if (rect.top < 0) {
41
- setTranslateY("100%");
43
+ setTranslateY(`${triggerHeight + 16}px`);
42
44
  }
43
45
  };
44
46
  const checkKey = (e) => {
@@ -53,8 +55,7 @@ const IDSTooltip = ({ position = "top", trigger, children, className, ...props }
53
55
  tooltipContent.setAttribute("role", "tooltip");
54
56
  const focusable = getFirstFocusableContent();
55
57
  if (focusable) {
56
- if (triggerRef.current?.querySelector('[class^="ids-icon-"]') ||
57
- triggerRef.current?.querySelector("ids-icon")) {
58
+ if (triggerRef.current?.querySelector('[class^="ids-icon-"]') || triggerRef.current?.querySelector("ids-icon")) {
58
59
  focusable.setAttribute("role", "img");
59
60
  focusable.setAttribute("aria-labelledby", tooltipId);
60
61
  }
@@ -76,7 +77,7 @@ const IDSTooltip = ({ position = "top", trigger, children, className, ...props }
76
77
  triggerWrapper.removeEventListener("focusin", handleOverflow);
77
78
  };
78
79
  }, [triggerRef]);
79
- return (jsxs("span", { className: clsx("ids-tooltip", className), ...props, children: [jsx("span", { className: "ids-tooltip__trigger", ref: triggerRef, children: trigger }), jsx("span", { className: clsx("ids-tooltip__content", `ids-tooltip__content--${position}`), ref: tooltipContentRef, id: tooltipId, style: { transform: `translate(${translateX}, ${translateY})` }, children: children })] }));
80
+ return (jsxs("span", { className: clsx("ids-tooltip", className), ...props, children: [jsx("span", { className: "ids-tooltip__trigger", ref: triggerRef, children: trigger }), jsx("span", { className: clsx("ids-tooltip__content", `ids-tooltip__content--${position}`), ref: tooltipContentRef, id: tooltipId, style: { transform: `translate(${translateX}, ${translateY})`, maxWidth }, children: children })] }));
80
81
  };
81
82
 
82
83
  export { IDSTooltip };
@@ -6,9 +6,10 @@ function useFocusTrap(container, active) {
6
6
  return;
7
7
  const focusableSelectors = [
8
8
  "a[href]",
9
- "button:not([disabled])",
9
+ 'button:not([disabled]):not([tabindex="-1"])',
10
10
  "textarea:not([disabled])",
11
- "input:not([disabled])",
11
+ "input:not([disabled]):not([type='radio'])",
12
+ ".ids-focus-anchor",
12
13
  "select:not([disabled])",
13
14
  '[tabindex]:not([tabindex="-1"])'
14
15
  ];
package/index.d.ts CHANGED
@@ -19,6 +19,7 @@ export * from "./components/grid/container";
19
19
  export * from "./components/grid/row";
20
20
  export * from "./components/grid/column";
21
21
  export * from "./components/accordion/accordion";
22
+ export * from "./components/action-link/action-link";
22
23
  export * from "./components/alert/alert";
23
24
  export * from "./components/global-alert/global-alert";
24
25
  export * from "./components/mobile/menu/item/mobile-item";
@@ -30,9 +31,12 @@ export * from "./components/tabs/tab";
30
31
  export * from "./components/tabs/tab-panel";
31
32
  export * from "./components/puff-list/puff-list";
32
33
  export * from "./components/puff-list/puff-list-item/puff-list-item";
34
+ export * from "./components/puff-list/puff-list-item/puff-list-item-date";
35
+ export * from "./components/puff-list/puff-list-item/puff-list-item-header";
33
36
  export * from "./components/puff-list/puff-list-item/puff-list-item-info";
34
37
  export * from "./components/date-label/date-label";
35
38
  export * from "./components/breadcrumbs/breadcrumbs";
39
+ export * from "./components/form/datepicker/datepicker";
36
40
  export * from "./components/dialog/dialog";
37
41
  export * from "./components/dropdown/dropdown";
38
42
  export * from "./components/dropdown/dropdown-content-link";
package/index.js CHANGED
@@ -19,6 +19,7 @@ export { IDSContainer } from './components/grid/container.js';
19
19
  export { IDSRow } from './components/grid/row.js';
20
20
  export { IDSColumn } from './components/grid/column.js';
21
21
  export { IDSAccordion } from './components/accordion/accordion.js';
22
+ export { IDSActionLink } from './components/action-link/action-link.js';
22
23
  export { IDSAlert } from './components/alert/alert.js';
23
24
  export { IDSGlobalAlert } from './components/global-alert/global-alert.js';
24
25
  export { IDSMobileMenuItem } from './components/mobile/menu/item/mobile-item.js';
@@ -30,9 +31,12 @@ export { IDSTab } from './components/tabs/tab.js';
30
31
  export { IDSTabPanel } from './components/tabs/tab-panel.js';
31
32
  export { IDSPuffList } from './components/puff-list/puff-list.js';
32
33
  export { IDSPuffListItem } from './components/puff-list/puff-list-item/puff-list-item.js';
34
+ export { IDSPuffListItemDate } from './components/puff-list/puff-list-item/puff-list-item-date.js';
35
+ export { IDSPuffListItemHeader } from './components/puff-list/puff-list-item/puff-list-item-header.js';
33
36
  export { IDSPuffListItemInfo } from './components/puff-list/puff-list-item/puff-list-item-info.js';
34
37
  export { IDSDateLabel } from './components/date-label/date-label.js';
35
38
  export { IDSBreadcrumbs } from './components/breadcrumbs/breadcrumbs.js';
39
+ export { IDSDatePicker } from './components/form/datepicker/datepicker.js';
36
40
  export { IDSDialog } from './components/dialog/dialog.js';
37
41
  export { IDSDropdown } from './components/dropdown/dropdown.js';
38
42
  export { IDSDropdownContentLink } from './components/dropdown/dropdown-content-link.js';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@inera/ids-react",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "react": "*"
7
7
  },
8
8
  "dependencies": {
9
- "@inera/ids-design": "8.0.x",
9
+ "@inera/ids-design": "8.2.x",
10
10
  "clsx": "*"
11
11
  },
12
12
  "types": "index.d.ts",