@ogcio/design-system-react 1.19.0 → 1.21.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 (76) hide show
  1. package/dist/card/card-legacy.d.ts +1 -1
  2. package/dist/card/card-legacy.js +12 -12
  3. package/dist/card/card-next.d.ts +2 -3
  4. package/dist/card/card-next.js +226 -61
  5. package/dist/card/card.js +17 -16
  6. package/dist/card/types.d.ts +20 -30
  7. package/dist/forms/form-field/form-field.js +58 -60
  8. package/dist/header/components/header-menu.d.ts +1 -2
  9. package/dist/header/header-legacy.d.ts +2 -0
  10. package/dist/header/header-legacy.js +223 -0
  11. package/dist/header/header-next/components/header-logo.d.ts +2 -0
  12. package/dist/header/header-next/components/header-logo.js +19 -0
  13. package/dist/header/header-next/components/header-title.d.ts +2 -0
  14. package/dist/header/header-next/components/header-title.js +29 -0
  15. package/dist/header/header-next/components/menu/components/header-menu-item-button.d.ts +2 -0
  16. package/dist/header/header-next/components/menu/components/header-menu-item-button.js +42 -0
  17. package/dist/header/header-next/components/menu/components/header-menu-item-link.d.ts +8 -0
  18. package/dist/header/header-next/components/menu/components/header-menu-item-link.js +72 -0
  19. package/dist/header/header-next/components/menu/components/header-menu-item-separator.d.ts +3 -0
  20. package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +34 -0
  21. package/dist/header/header-next/components/menu/components/header-menu-item-slot.d.ts +5 -0
  22. package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +42 -0
  23. package/dist/header/header-next/components/menu/header-menu-context.d.ts +7 -0
  24. package/dist/header/header-next/components/menu/header-menu-context.js +23 -0
  25. package/dist/header/header-next/components/menu/header-primary-menu.d.ts +3 -0
  26. package/dist/header/header-next/components/menu/header-primary-menu.js +63 -0
  27. package/dist/header/header-next/components/menu/header-secondary-menu.d.ts +3 -0
  28. package/dist/header/header-next/components/menu/header-secondary-menu.js +52 -0
  29. package/dist/header/header-next/header-context.d.ts +13 -0
  30. package/dist/header/header-next/header-context.js +31 -0
  31. package/dist/header/header-next/header-next.d.ts +7 -0
  32. package/dist/header/header-next/header-next.js +75 -0
  33. package/dist/header/header-next/index.d.ts +11 -0
  34. package/dist/header/header-next/index.js +27 -0
  35. package/dist/header/header.d.ts +2 -2
  36. package/dist/header/header.js +17 -219
  37. package/dist/header/types.d.ts +84 -4
  38. package/dist/header/variants.d.ts +2 -2
  39. package/dist/header/variants.js +1 -1
  40. package/dist/hooks/use-toggle-map.d.ts +15 -0
  41. package/dist/hooks/use-toggle-map.js +45 -0
  42. package/dist/icon/icons.d.ts +2 -2
  43. package/dist/icon/icons.js +2 -0
  44. package/dist/index.d.ts +3 -2
  45. package/dist/index.js +210 -178
  46. package/dist/input-checkbox/input-checkbox.d.ts +1 -1
  47. package/dist/input-checkbox/input-checkbox.js +65 -48
  48. package/dist/input-radio/input-radio.d.ts +1 -1
  49. package/dist/input-radio/input-radio.js +50 -44
  50. package/dist/input-radio/types.d.ts +0 -1
  51. package/dist/input-radio/types.js +0 -1
  52. package/dist/list-item/list-item.d.ts +3 -2
  53. package/dist/list-item/list-item.js +15 -6
  54. package/dist/modal/types.d.ts +5 -3
  55. package/dist/radio/types.d.ts +0 -1
  56. package/dist/styles.css +2 -2
  57. package/dist/summary-list/index.d.ts +6 -0
  58. package/dist/summary-list/index.js +12 -0
  59. package/dist/summary-list/summary-list-action.d.ts +5 -0
  60. package/dist/summary-list/summary-list-action.js +18 -0
  61. package/dist/summary-list/summary-list-context.d.ts +2 -0
  62. package/dist/summary-list/summary-list-context.js +20 -0
  63. package/dist/summary-list/summary-list-header.d.ts +5 -0
  64. package/dist/summary-list/summary-list-header.js +68 -0
  65. package/dist/summary-list/summary-list-row.d.ts +6 -0
  66. package/dist/summary-list/summary-list-row.js +63 -0
  67. package/dist/summary-list/summary-list-value.d.ts +5 -0
  68. package/dist/summary-list/summary-list-value.js +17 -0
  69. package/dist/summary-list/summary-list.d.ts +2 -11
  70. package/dist/summary-list/summary-list.js +37 -43
  71. package/dist/summary-list/types.d.ts +15 -11
  72. package/dist/utilities.d.ts +3 -0
  73. package/dist/utilities.js +17 -7
  74. package/dist/utils/utilities.d.ts +3 -0
  75. package/dist/utils/utilities.js +34 -25
  76. package/package.json +4 -4
@@ -1,69 +1,75 @@
1
1
  "use client";
2
2
  import "@ogcio/design-system-react/browser-check";
3
- import { jsx as e, Fragment as c, jsxs as n } from "react/jsx-runtime";
4
- import { useId as u } from "react";
5
- import { cn as g } from "../cn.js";
6
- import { HintText as f } from "../hint-text/hint-text.js";
7
- import { InputText as p } from "../input-text/input-text.js";
8
- import { Label as h } from "../label/label.js";
9
- import { Input as v } from "../primitives/input.js";
10
- import { InputRadioSizeEnum as d } from "./types.js";
11
- const x = (r) => {
12
- let i = "gi-input-radio-medium";
13
- return r === d.Large && (i = "gi-input-radio-large"), r === d.Small && (i = "gi-input-radio-small"), i;
14
- }, y = (r) => {
15
- let i = "gi-w-8";
16
- return r === d.Large && (i = "gi-w-11"), r === d.Small && (i = "gi-w-6"), i;
17
- }, F = ({
18
- label: r,
19
- hint: i,
20
- id: s,
3
+ import { jsxs as n, jsx as i } from "react/jsx-runtime";
4
+ import { useId as h } from "react";
5
+ import { cn as s } from "../cn.js";
6
+ import { HintText as p } from "../hint-text/hint-text.js";
7
+ import { InputText as v } from "../input-text/input-text.js";
8
+ import { Label as b } from "../label/label.js";
9
+ import { Input as x } from "../primitives/input.js";
10
+ import { InputRadioSizeEnum as g } from "./types.js";
11
+ const C = (e) => e === g.Small ? "gi-input-radio-small" : "gi-input-radio-medium", q = (e) => e === g.Small ? "gi-w-6" : "gi-w-8", E = ({
12
+ label: e,
13
+ children: c,
14
+ hint: a,
15
+ id: f,
21
16
  size: t = "md",
22
- conditionalInput: a,
23
- checked: m,
24
- ...o
17
+ conditionalInput: d,
18
+ checked: o,
19
+ ...m
25
20
  }) => {
26
- const l = s ?? u();
27
- return /* @__PURE__ */ e(c, { children: /* @__PURE__ */ n("div", { className: "gi-input-radio-container", children: [
28
- /* @__PURE__ */ e(
29
- v,
21
+ const r = f ?? h(), l = c ?? e, u = !!c;
22
+ return /* @__PURE__ */ n("div", { className: "gi-input-radio-container", children: [
23
+ /* @__PURE__ */ i(
24
+ x,
30
25
  {
31
26
  type: "radio",
32
- id: l,
33
- ...m === void 0 ? { defaultChecked: o.defaultChecked } : { checked: m, onChange: o.onChange },
34
- className: x(t),
35
- "aria-describedby": i ? `${l}-hint` : void 0,
36
- "aria-required": a ? "true" : "false",
37
- ...o
27
+ id: r,
28
+ ...o === void 0 ? { defaultChecked: m.defaultChecked } : { checked: o, onChange: m.onChange },
29
+ className: C(t),
30
+ "aria-describedby": a ? `${r}-hint` : void 0,
31
+ "aria-required": d ? "true" : "false",
32
+ "aria-labelledby": l ? `${r}-label` : void 0,
33
+ ...m
38
34
  }
39
35
  ),
40
36
  /* @__PURE__ */ n(
41
37
  "div",
42
38
  {
43
- className: g({
44
- "gi-mt-1": t === "md",
45
- "gi-mt-2": t === "lg"
39
+ className: s({
40
+ "gi-mt-1": t === "md"
46
41
  }),
47
42
  children: [
48
- /* @__PURE__ */ e(h, { htmlFor: l, text: r || "", size: t }),
49
- (i || a) && /* @__PURE__ */ e("div", { className: "gi-radio-conditional-divider-container", children: /* @__PURE__ */ n("div", { children: [
50
- i && /* @__PURE__ */ e(f, { text: i, size: t }),
51
- a && /* @__PURE__ */ e(
43
+ l && /* @__PURE__ */ i(
44
+ b,
45
+ {
46
+ id: `${r}-label`,
47
+ htmlFor: u ? void 0 : r,
48
+ size: t,
49
+ className: s({
50
+ "gi-rich-label": u
51
+ }),
52
+ children: l
53
+ }
54
+ ),
55
+ (a || d) && /* @__PURE__ */ i("div", { className: "gi-radio-conditional-divider-container", children: /* @__PURE__ */ n("div", { children: [
56
+ a && /* @__PURE__ */ i(p, { text: a, size: t }),
57
+ d && /* @__PURE__ */ i(
52
58
  "div",
53
59
  {
54
- className: g("gi-mt-3", {
55
- "gi-hidden": !m
60
+ className: s("gi-mt-3", {
61
+ "gi-hidden": !o
56
62
  }),
57
- children: /* @__PURE__ */ e(p, { ...a })
63
+ children: /* @__PURE__ */ i(v, { ...d })
58
64
  }
59
65
  )
60
66
  ] }) })
61
67
  ]
62
68
  }
63
69
  )
64
- ] }) });
70
+ ] });
65
71
  };
66
72
  export {
67
- F as InputRadio,
68
- y as getRadioWidth
73
+ E as InputRadio,
74
+ q as getRadioWidth
69
75
  };
@@ -1,7 +1,6 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
2
  import { InputTextProps } from '../input-text/type.js';
3
3
  export declare const InputRadioSizeEnum: {
4
- readonly Large: "lg";
5
4
  readonly Medium: "md";
6
5
  readonly Small: "sm";
7
6
  };
@@ -1,5 +1,4 @@
1
1
  const m = {
2
- Large: "lg",
3
2
  Medium: "md",
4
3
  Small: "sm"
5
4
  };
@@ -1,4 +1,5 @@
1
- export type ListItemProps = {
1
+ import { AnchorHTMLAttributes } from 'react';
2
+ export type ListItemProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
2
3
  label?: string;
3
4
  action?: () => void;
4
5
  href?: string;
@@ -6,4 +7,4 @@ export type ListItemProps = {
6
7
  bold?: boolean;
7
8
  slot?: React.ReactNode;
8
9
  };
9
- export declare function ListItem({ label, href, external, bold, slot }: ListItemProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ListItem({ label, href, external, bold, slot, className, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +1,28 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { cn as n } from "../cn.js";
3
- import s from "../primitives/anchor.js";
4
- function f({ label: i, href: t, external: o, bold: e, slot: r }) {
2
+ import { cn as a } from "../cn.js";
3
+ import c from "../primitives/anchor.js";
4
+ function d({
5
+ label: i,
6
+ href: t,
7
+ external: o,
8
+ bold: e,
9
+ slot: r,
10
+ className: n,
11
+ ...s
12
+ }) {
5
13
  return /* @__PURE__ */ m(
6
- s,
14
+ c,
7
15
  {
8
16
  "aria-label": i,
9
17
  href: t,
10
- className: n("gi-list-item", { "gi-font-bold": e }),
18
+ className: a(n, "gi-list-item", { "gi-font-bold": e }),
11
19
  external: o,
12
20
  asChild: !!r,
21
+ ...s,
13
22
  children: r || /* @__PURE__ */ m("span", { className: "gi-text-sm gi-ml-1", children: i })
14
23
  }
15
24
  );
16
25
  }
17
26
  export {
18
- f as ListItem
27
+ d as ListItem
19
28
  };
@@ -1,17 +1,18 @@
1
- import { ReactElement } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactElement } from 'react';
2
2
  import { ButtonProps, ButtonSize, ButtonVariant } from '../button/types.js';
3
3
  import { IconButtonProps } from '../icon-button/icon-button.js';
4
4
  import { ModalBody, ModalFooter, ModalTitle } from './modal.js';
5
5
  export type ModalPositions = 'center' | 'left' | 'right' | 'bottom';
6
6
  export type ModalFooterOrientation = 'vertical' | 'horizontal';
7
7
  export type ModalChildren = Array<ReactElement<typeof ModalTitle | typeof ModalBody | typeof ModalFooter>> | ReactElement<typeof ModalTitle | typeof ModalBody | typeof ModalFooter>;
8
- export type ModalWrapperProps = {
8
+ type ModalWrapperOwnProps = {
9
9
  closeOnEscape?: boolean;
10
10
  isOpen: boolean;
11
11
  onClose: () => void;
12
12
  position?: ModalPositions;
13
13
  closeButtonSize?: ButtonSize;
14
- } & Omit<ModalProps, 'triggerButton'>;
14
+ };
15
+ export type ModalWrapperProps = ModalWrapperOwnProps & Omit<ComponentPropsWithoutRef<'div'>, 'role'> & Omit<ModalProps, 'triggerButton'>;
15
16
  export type ModalSize = 'sm' | 'md' | 'lg';
16
17
  export type ModalProps = React.AriaAttributes & {
17
18
  className?: string;
@@ -42,3 +43,4 @@ export type ModalFooterProps = {
42
43
  export type ModalHeaderProps = Pick<ModalWrapperProps, 'closeButtonLabel' | 'closeOnClick' | 'onClose' | 'closeButtonSize' | 'size'> & {
43
44
  modalTitle: React.ReactNode;
44
45
  };
46
+ export {};
@@ -6,7 +6,6 @@ export type RadioSizeType = InputRadioSizeType;
6
6
  export type RadioProps = InputRadioProps;
7
7
  /** @deprecated Use InputRadioSizeEnum instead */
8
8
  export declare const RadioSizeEnum: {
9
- readonly Large: "lg";
10
9
  readonly Medium: "md";
11
10
  readonly Small: "sm";
12
11
  };