@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.
- package/dist/card/card-legacy.d.ts +1 -1
- package/dist/card/card-legacy.js +12 -12
- package/dist/card/card-next.d.ts +2 -3
- package/dist/card/card-next.js +226 -61
- package/dist/card/card.js +17 -16
- package/dist/card/types.d.ts +20 -30
- package/dist/forms/form-field/form-field.js +58 -60
- package/dist/header/components/header-menu.d.ts +1 -2
- package/dist/header/header-legacy.d.ts +2 -0
- package/dist/header/header-legacy.js +223 -0
- package/dist/header/header-next/components/header-logo.d.ts +2 -0
- package/dist/header/header-next/components/header-logo.js +19 -0
- package/dist/header/header-next/components/header-title.d.ts +2 -0
- package/dist/header/header-next/components/header-title.js +29 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-button.d.ts +2 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-button.js +42 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-link.d.ts +8 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-link.js +72 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-separator.d.ts +3 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +34 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-slot.d.ts +5 -0
- package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +42 -0
- package/dist/header/header-next/components/menu/header-menu-context.d.ts +7 -0
- package/dist/header/header-next/components/menu/header-menu-context.js +23 -0
- package/dist/header/header-next/components/menu/header-primary-menu.d.ts +3 -0
- package/dist/header/header-next/components/menu/header-primary-menu.js +63 -0
- package/dist/header/header-next/components/menu/header-secondary-menu.d.ts +3 -0
- package/dist/header/header-next/components/menu/header-secondary-menu.js +52 -0
- package/dist/header/header-next/header-context.d.ts +13 -0
- package/dist/header/header-next/header-context.js +31 -0
- package/dist/header/header-next/header-next.d.ts +7 -0
- package/dist/header/header-next/header-next.js +75 -0
- package/dist/header/header-next/index.d.ts +11 -0
- package/dist/header/header-next/index.js +27 -0
- package/dist/header/header.d.ts +2 -2
- package/dist/header/header.js +17 -219
- package/dist/header/types.d.ts +84 -4
- package/dist/header/variants.d.ts +2 -2
- package/dist/header/variants.js +1 -1
- package/dist/hooks/use-toggle-map.d.ts +15 -0
- package/dist/hooks/use-toggle-map.js +45 -0
- package/dist/icon/icons.d.ts +2 -2
- package/dist/icon/icons.js +2 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +210 -178
- package/dist/input-checkbox/input-checkbox.d.ts +1 -1
- package/dist/input-checkbox/input-checkbox.js +65 -48
- package/dist/input-radio/input-radio.d.ts +1 -1
- package/dist/input-radio/input-radio.js +50 -44
- package/dist/input-radio/types.d.ts +0 -1
- package/dist/input-radio/types.js +0 -1
- package/dist/list-item/list-item.d.ts +3 -2
- package/dist/list-item/list-item.js +15 -6
- package/dist/modal/types.d.ts +5 -3
- package/dist/radio/types.d.ts +0 -1
- package/dist/styles.css +2 -2
- package/dist/summary-list/index.d.ts +6 -0
- package/dist/summary-list/index.js +12 -0
- package/dist/summary-list/summary-list-action.d.ts +5 -0
- package/dist/summary-list/summary-list-action.js +18 -0
- package/dist/summary-list/summary-list-context.d.ts +2 -0
- package/dist/summary-list/summary-list-context.js +20 -0
- package/dist/summary-list/summary-list-header.d.ts +5 -0
- package/dist/summary-list/summary-list-header.js +68 -0
- package/dist/summary-list/summary-list-row.d.ts +6 -0
- package/dist/summary-list/summary-list-row.js +63 -0
- package/dist/summary-list/summary-list-value.d.ts +5 -0
- package/dist/summary-list/summary-list-value.js +17 -0
- package/dist/summary-list/summary-list.d.ts +2 -11
- package/dist/summary-list/summary-list.js +37 -43
- package/dist/summary-list/types.d.ts +15 -11
- package/dist/utilities.d.ts +3 -0
- package/dist/utilities.js +17 -7
- package/dist/utils/utilities.d.ts +3 -0
- package/dist/utils/utilities.js +34 -25
- package/package.json +4 -4
|
@@ -1,69 +1,75 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "@ogcio/design-system-react/browser-check";
|
|
3
|
-
import {
|
|
4
|
-
import { useId as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { HintText as
|
|
7
|
-
import { InputText as
|
|
8
|
-
import { Label as
|
|
9
|
-
import { Input as
|
|
10
|
-
import { InputRadioSizeEnum as
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
23
|
-
checked:
|
|
24
|
-
...
|
|
17
|
+
conditionalInput: d,
|
|
18
|
+
checked: o,
|
|
19
|
+
...m
|
|
25
20
|
}) => {
|
|
26
|
-
const l =
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
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:
|
|
33
|
-
...
|
|
34
|
-
className:
|
|
35
|
-
"aria-describedby":
|
|
36
|
-
"aria-required":
|
|
37
|
-
|
|
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:
|
|
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__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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:
|
|
55
|
-
"gi-hidden": !
|
|
60
|
+
className: s("gi-mt-3", {
|
|
61
|
+
"gi-hidden": !o
|
|
56
62
|
}),
|
|
57
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
68
|
-
|
|
73
|
+
E as InputRadio,
|
|
74
|
+
q as getRadioWidth
|
|
69
75
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
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
|
|
3
|
-
import
|
|
4
|
-
function
|
|
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
|
-
|
|
14
|
+
c,
|
|
7
15
|
{
|
|
8
16
|
"aria-label": i,
|
|
9
17
|
href: t,
|
|
10
|
-
className: n
|
|
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
|
-
|
|
27
|
+
d as ListItem
|
|
19
28
|
};
|
package/dist/modal/types.d.ts
CHANGED
|
@@ -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
|
-
|
|
8
|
+
type ModalWrapperOwnProps = {
|
|
9
9
|
closeOnEscape?: boolean;
|
|
10
10
|
isOpen: boolean;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
position?: ModalPositions;
|
|
13
13
|
closeButtonSize?: ButtonSize;
|
|
14
|
-
}
|
|
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 {};
|
package/dist/radio/types.d.ts
CHANGED