@ogcio/design-system-react 1.31.1 → 1.33.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/Heading.d.ts +5 -0
- package/dist/Heading.js +22 -0
- package/dist/accordion/accordion-item.js +62 -57
- package/dist/alert/alert.d.ts +3 -0
- package/dist/alert/alert.js +40 -57
- package/dist/alert/variants.d.ts +49 -52
- package/dist/alert/variants.js +17 -18
- package/dist/atoms/{DsButton.d.ts → Button.d.ts} +5 -5
- package/dist/atoms/{DsButton.js → Button.js} +22 -36
- package/dist/atoms/heading/H1.d.ts +3 -0
- package/dist/atoms/heading/H1.js +20 -0
- package/dist/atoms/heading/H2.d.ts +3 -0
- package/dist/atoms/heading/H2.js +20 -0
- package/dist/atoms/heading/H3.d.ts +3 -0
- package/dist/atoms/heading/H3.js +20 -0
- package/dist/atoms/heading/H4.d.ts +3 -0
- package/dist/atoms/heading/H4.js +20 -0
- package/dist/atoms/heading/H5.d.ts +3 -0
- package/dist/atoms/heading/H5.js +20 -0
- package/dist/atoms/heading/H6.d.ts +3 -0
- package/dist/atoms/heading/H6.js +20 -0
- package/dist/atoms/heading/index.d.ts +9 -0
- package/dist/atoms/heading/index.js +18 -0
- package/dist/atoms/heading/styles.d.ts +65 -0
- package/dist/atoms/heading/styles.js +17 -0
- package/dist/atoms/heading/types.d.ts +15 -0
- package/dist/atoms/heading/types.js +11 -0
- package/dist/atoms/heading/utils.d.ts +2 -0
- package/dist/atoms/heading/utils.js +5 -0
- package/dist/atoms/icons/ArrowLeft.d.ts +3 -0
- package/dist/atoms/icons/ArrowLeft.js +23 -0
- package/dist/atoms/icons/ArrowRight.d.ts +3 -0
- package/dist/atoms/icons/ArrowRight.js +23 -0
- package/dist/atoms/icons/CheckCircle.d.ts +3 -0
- package/dist/atoms/icons/CheckCircle.js +23 -0
- package/dist/atoms/icons/Error.d.ts +3 -0
- package/dist/atoms/icons/Error.js +23 -0
- package/dist/atoms/icons/FirstPage.d.ts +3 -0
- package/dist/atoms/icons/FirstPage.js +23 -0
- package/dist/atoms/icons/Info.d.ts +3 -0
- package/dist/atoms/icons/Info.js +23 -0
- package/dist/atoms/icons/KeyboardArrowLeft.d.ts +3 -0
- package/dist/atoms/icons/KeyboardArrowLeft.js +23 -0
- package/dist/atoms/icons/KeyboardArrowRight.d.ts +3 -0
- package/dist/atoms/icons/KeyboardArrowRight.js +23 -0
- package/dist/atoms/icons/LastPage.d.ts +3 -0
- package/dist/atoms/icons/LastPage.js +23 -0
- package/dist/atoms/icons/Warning.d.ts +3 -0
- package/dist/atoms/icons/Warning.js +23 -0
- package/dist/atoms/icons/index.d.ts +12 -2
- package/dist/atoms/icons/index.js +30 -10
- package/dist/atoms/index.d.ts +2 -1
- package/dist/atoms/index.js +48 -12
- package/dist/atoms/storybook/Heading.meta.d.ts +60 -0
- package/dist/atoms/storybook/Heading.meta.js +70 -0
- package/dist/atoms/storybook/Icons.meta.d.ts +51 -0
- package/dist/atoms/storybook/Icons.meta.js +130 -0
- package/dist/atoms/storybook/InsetText.meta.d.ts +52 -0
- package/dist/atoms/storybook/InsetText.meta.js +64 -0
- package/dist/atoms/storybook/Logos.meta.d.ts +35 -0
- package/dist/atoms/storybook/Logos.meta.js +54 -0
- package/dist/breadcrumbs/breadcrumbs.js +20 -19
- package/dist/button/button.d.ts +2 -9
- package/dist/button/button.js +65 -32
- package/dist/button/helpers.d.ts +2 -1
- package/dist/button/types.d.ts +25 -8
- package/dist/button-group/button-group.js +43 -45
- package/dist/button-group/types.d.ts +5 -5
- package/dist/card/card-legacy.js +1 -1
- package/dist/card/types.d.ts +1 -1
- package/dist/combo-box/dropdown-item.js +1 -1
- package/dist/cookie-banner/cookie-banner.d.ts +1 -1
- package/dist/data-table/data-table-header.js +1 -1
- package/dist/drawer/drawer.d.ts +1 -1
- package/dist/drawer/drawer.js +17 -17
- package/dist/error-text/error-text.js +28 -27
- package/dist/forms/form-field/form-field.js +24 -25
- package/dist/header/components/header-menu.js +21 -21
- package/dist/header/components/header-search.js +5 -5
- package/dist/hint-text/hint-text.js +26 -20
- package/dist/icon/icon.js +85 -63
- package/dist/icon/icons.d.ts +1 -1
- package/dist/icon-button/icon-button.d.ts +3 -5
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +19 -10
- package/dist/index-Bh2cTIps.js +33899 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/input-text/input-text.js +1 -1
- package/dist/input-text/type.d.ts +1 -1
- package/dist/label/label.d.ts +78 -30
- package/dist/label/label.js +29 -14
- package/dist/modal/modal.content.js +1 -1
- package/dist/modal/modal.d.ts +1 -1
- package/dist/modal/modal.js +39 -39
- package/dist/modal/types.d.ts +5 -4
- package/dist/pagination/pagination.js +137 -134
- package/dist/paragraph/paragraph.d.ts +1 -1
- package/dist/paragraph/paragraph.js +13 -11
- package/dist/score-select/type.d.ts +2 -2
- package/dist/select/select-next.js +87 -87
- package/dist/side-nav/side-nav.js +4 -4
- package/dist/side-nav/types.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/dist/table/table-pagination.js +17 -13
- package/dist/tabs/tab-item.js +53 -71
- package/dist/tabs/variants.d.ts +269 -0
- package/dist/tabs/variants.js +87 -0
- package/dist/tooltip/tooltip.js +27 -35
- package/dist/tooltip/variants.d.ts +115 -0
- package/dist/tooltip/variants.js +59 -0
- package/package.json +7 -6
- package/dist/heading/heading.d.ts +0 -150
- package/dist/heading/heading.js +0 -50
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { type BreadcrumbLinkProps, type BreadcrumbProps, } from './breadcrumbs/t
|
|
|
11
11
|
export { ButtonGroup, ButtonGroupItem } from './button-group/button-group.js';
|
|
12
12
|
export * from './button-group/types.js';
|
|
13
13
|
export { Button } from './button/button.js';
|
|
14
|
-
export {
|
|
14
|
+
export type { ButtonProps } from './button/types';
|
|
15
15
|
export { CardAction, CardContainer, CardDescription, CardHeader, CardMedia, CardSubtitle, CardTag, CardTitle, } from './card/card-next.js';
|
|
16
16
|
export { Card } from './card/card.js';
|
|
17
17
|
export type { CardActionProps, CardContainerProps, CardDescriptionProps, CardHeaderProps, CardMediaProps, CardProps, } from './card/types.js';
|
|
@@ -40,7 +40,7 @@ export { HeaderSearch, type HeaderSearchProps, } from './header/components/heade
|
|
|
40
40
|
export { Header } from './header/header.js';
|
|
41
41
|
export * from './header/header-next/index.js';
|
|
42
42
|
export type { HeaderItem, HeaderProps } from './header/types.js';
|
|
43
|
-
export { Heading, type HeadingProps } from './
|
|
43
|
+
export { default as Heading, type Props as HeadingProps } from './Heading.js';
|
|
44
44
|
export type { HintTextProps } from './hint-text/types.js';
|
|
45
45
|
export * from './i18n/config.js';
|
|
46
46
|
export { IconButton, type IconButtonProps } from './icon-button/icon-button.js';
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import { HeaderMenuItemButton as We } from "./header/header-next/components/menu
|
|
|
37
37
|
import { HeaderMenuItemLink as Ue } from "./header/header-next/components/menu/components/header-menu-item-link.js";
|
|
38
38
|
import { HeaderMenuItemSeparator as qe } from "./header/header-next/components/menu/components/header-menu-item-separator.js";
|
|
39
39
|
import { HeaderMenuItemSlot as Je } from "./header/header-next/components/menu/components/header-menu-item-slot.js";
|
|
40
|
-
import {
|
|
40
|
+
import { default as Oe } from "./Heading.js";
|
|
41
41
|
import { initI18n as Xe } from "./i18n/config.js";
|
|
42
42
|
import { IconButton as Ze } from "./icon-button/icon-button.js";
|
|
43
43
|
import { Icon as $e } from "./icon/icon.js";
|
package/dist/label/label.d.ts
CHANGED
|
@@ -3,52 +3,100 @@ export declare const LabelSize: {
|
|
|
3
3
|
readonly Medium: "md";
|
|
4
4
|
readonly Large: "lg";
|
|
5
5
|
};
|
|
6
|
+
export declare const Label: import('react').ForwardRefExoticComponent<import('react').LabelHTMLAttributes<HTMLLabelElement> & {
|
|
7
|
+
text?: string | React.ReactElement;
|
|
8
|
+
size?: import('./types.js').LabelSizeType;
|
|
9
|
+
} & {
|
|
10
|
+
children?: import('react').ReactNode | undefined;
|
|
11
|
+
} & import('react').RefAttributes<HTMLLabelElement>>;
|
|
6
12
|
export declare const styles: import('tailwind-variants').TVReturnType<{
|
|
7
13
|
size: {
|
|
8
|
-
sm:
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
sm: {
|
|
15
|
+
base: string;
|
|
16
|
+
};
|
|
17
|
+
md: {
|
|
18
|
+
base: string;
|
|
19
|
+
};
|
|
20
|
+
lg: {
|
|
21
|
+
base: string;
|
|
22
|
+
};
|
|
11
23
|
};
|
|
12
|
-
},
|
|
24
|
+
}, {
|
|
25
|
+
base: string;
|
|
26
|
+
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
13
27
|
size: {
|
|
14
|
-
sm:
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
sm: {
|
|
29
|
+
base: string;
|
|
30
|
+
};
|
|
31
|
+
md: {
|
|
32
|
+
base: string;
|
|
33
|
+
};
|
|
34
|
+
lg: {
|
|
35
|
+
base: string;
|
|
36
|
+
};
|
|
17
37
|
};
|
|
18
38
|
}, {
|
|
19
39
|
size: {
|
|
20
|
-
sm:
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
sm: {
|
|
41
|
+
base: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
base: string;
|
|
45
|
+
};
|
|
46
|
+
lg: {
|
|
47
|
+
base: string;
|
|
48
|
+
};
|
|
23
49
|
};
|
|
24
50
|
}>, {
|
|
25
51
|
size: {
|
|
26
|
-
sm:
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
sm: {
|
|
53
|
+
base: string;
|
|
54
|
+
};
|
|
55
|
+
md: {
|
|
56
|
+
base: string;
|
|
57
|
+
};
|
|
58
|
+
lg: {
|
|
59
|
+
base: string;
|
|
60
|
+
};
|
|
29
61
|
};
|
|
30
|
-
},
|
|
62
|
+
}, {
|
|
63
|
+
base: string;
|
|
64
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
31
65
|
size: {
|
|
32
|
-
sm:
|
|
33
|
-
|
|
34
|
-
|
|
66
|
+
sm: {
|
|
67
|
+
base: string;
|
|
68
|
+
};
|
|
69
|
+
md: {
|
|
70
|
+
base: string;
|
|
71
|
+
};
|
|
72
|
+
lg: {
|
|
73
|
+
base: string;
|
|
74
|
+
};
|
|
35
75
|
};
|
|
36
|
-
},
|
|
76
|
+
}, {
|
|
77
|
+
base: string;
|
|
78
|
+
}, undefined, import('tailwind-variants/dist/config.js').TVConfig<{
|
|
37
79
|
size: {
|
|
38
|
-
sm:
|
|
39
|
-
|
|
40
|
-
|
|
80
|
+
sm: {
|
|
81
|
+
base: string;
|
|
82
|
+
};
|
|
83
|
+
md: {
|
|
84
|
+
base: string;
|
|
85
|
+
};
|
|
86
|
+
lg: {
|
|
87
|
+
base: string;
|
|
88
|
+
};
|
|
41
89
|
};
|
|
42
90
|
}, {
|
|
43
91
|
size: {
|
|
44
|
-
sm:
|
|
45
|
-
|
|
46
|
-
|
|
92
|
+
sm: {
|
|
93
|
+
base: string;
|
|
94
|
+
};
|
|
95
|
+
md: {
|
|
96
|
+
base: string;
|
|
97
|
+
};
|
|
98
|
+
lg: {
|
|
99
|
+
base: string;
|
|
100
|
+
};
|
|
47
101
|
};
|
|
48
102
|
}>, unknown, unknown, undefined>>;
|
|
49
|
-
export declare const Label: import('react').ForwardRefExoticComponent<import('react').LabelHTMLAttributes<HTMLLabelElement> & {
|
|
50
|
-
text?: string | React.ReactElement;
|
|
51
|
-
size?: import('./types.js').LabelSizeType;
|
|
52
|
-
} & {
|
|
53
|
-
children?: import('react').ReactNode | undefined;
|
|
54
|
-
} & import('react').RefAttributes<HTMLLabelElement>>;
|
package/dist/label/label.js
CHANGED
|
@@ -1,28 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as o } from "react";
|
|
3
|
+
import { c as d } from "../index-CB-zPpNk.js";
|
|
4
|
+
const b = {
|
|
5
5
|
Small: "sm",
|
|
6
6
|
Medium: "md",
|
|
7
7
|
Large: "lg"
|
|
8
|
-
},
|
|
9
|
-
|
|
8
|
+
}, c = o(
|
|
9
|
+
({ text: e, size: t = b.Medium, className: s, children: a, ...l }, m) => {
|
|
10
|
+
const { base: i } = g({ size: t });
|
|
11
|
+
return /* @__PURE__ */ r(
|
|
12
|
+
"label",
|
|
13
|
+
{
|
|
14
|
+
className: i({ className: s }),
|
|
15
|
+
"data-testid": "label",
|
|
16
|
+
ref: m,
|
|
17
|
+
...l,
|
|
18
|
+
children: a ?? e
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
c.displayName = "Label";
|
|
24
|
+
const g = d({
|
|
25
|
+
slots: {
|
|
26
|
+
base: "gi-block gi-text-color-text-system-neutral-default"
|
|
27
|
+
},
|
|
10
28
|
variants: {
|
|
11
29
|
size: {
|
|
12
|
-
sm: "gi-text-sm",
|
|
13
|
-
md: "gi-text-md",
|
|
14
|
-
lg: "gi-text-lg"
|
|
30
|
+
sm: { base: "gi-text-sm" },
|
|
31
|
+
md: { base: "gi-text-md" },
|
|
32
|
+
lg: { base: "gi-text-lg" }
|
|
15
33
|
}
|
|
16
34
|
},
|
|
17
35
|
defaultVariants: {
|
|
18
36
|
size: "md"
|
|
19
37
|
}
|
|
20
|
-
})
|
|
21
|
-
({ text: e, size: a = d.Medium, className: m, children: s, ...t }, l) => /* @__PURE__ */ i("label", { className: g({ size: a, className: m }), ref: l, ...t, children: s ?? e })
|
|
22
|
-
);
|
|
23
|
-
c.displayName = "Label";
|
|
38
|
+
});
|
|
24
39
|
export {
|
|
25
40
|
c as Label,
|
|
26
|
-
|
|
41
|
+
b as LabelSize,
|
|
27
42
|
g as styles
|
|
28
43
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t, Fragment as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import o from "../atoms/Button.js";
|
|
3
3
|
import { ModalTitle as e, ModalBody as a, ModalFooter as n } from "./modal.js";
|
|
4
4
|
const c = /* @__PURE__ */ i(r, { children: [
|
|
5
5
|
/* @__PURE__ */ t(e, { children: "Modal Title" }),
|
package/dist/modal/modal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { HeadingProps } from '../
|
|
2
|
+
import { Props as HeadingProps } from '../Heading.js';
|
|
3
3
|
import { ModalFooterProps, ModalProps, ModalWrapperProps } from './types.js';
|
|
4
4
|
export declare const ModalWrapper: ({ position, size, closeOnClick, closeOnOverlayClick, isOpen, onClose, closeButtonLabel, className, children, closeButtonSize, closeOnEscape, dataTestId, ...props }: ModalWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare const ModalTitle: {
|
package/dist/modal/modal.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as l, jsxs as y, Fragment as
|
|
3
|
-
import { isValidElement as K, cloneElement as T, useState as
|
|
2
|
+
import { jsx as l, jsxs as y, Fragment as P } from "react/jsx-runtime";
|
|
3
|
+
import { isValidElement as K, cloneElement as T, useState as j, useRef as U, useMemo as W, Children as _, useId as z, useEffect as C } from "react";
|
|
4
4
|
import { createPortal as G } from "react-dom";
|
|
5
|
-
import
|
|
5
|
+
import J from "../Heading.js";
|
|
6
|
+
import A from "../atoms/Button.js";
|
|
6
7
|
import { cn as u } from "../cn.js";
|
|
7
|
-
import { Heading as J } from "../heading/heading.js";
|
|
8
8
|
import { useAriaHider as Q } from "../hooks/use-aria-hider.js";
|
|
9
9
|
import { useFocusTrap as X } from "../hooks/use-focus-trap.js";
|
|
10
10
|
import { Icon as Y } from "../icon/icon.js";
|
|
11
11
|
import { IconButton as Z } from "../icon-button/icon-button.js";
|
|
12
12
|
import { splitAriaProps as O, isSpecialComponent as ee, getSpecialComponentType as te } from "../utils/utilities.js";
|
|
13
|
-
const
|
|
13
|
+
const B = {
|
|
14
14
|
flat: 0,
|
|
15
15
|
secondary: 1,
|
|
16
16
|
primary: 2
|
|
@@ -21,16 +21,16 @@ const I = {
|
|
|
21
21
|
}) => {
|
|
22
22
|
let n = "sm";
|
|
23
23
|
return (o === "large" || o === "medium") && (n = "md"), e ? /* @__PURE__ */ l(
|
|
24
|
-
|
|
24
|
+
A,
|
|
25
25
|
{
|
|
26
26
|
onClick: t.onClick,
|
|
27
27
|
variant: "flat",
|
|
28
28
|
size: o,
|
|
29
29
|
appearance: "dark",
|
|
30
30
|
className: "gi-modal-icon",
|
|
31
|
-
|
|
31
|
+
ariaLabel: e,
|
|
32
32
|
...t,
|
|
33
|
-
children: /* @__PURE__ */ y(
|
|
33
|
+
children: /* @__PURE__ */ y(P, { children: [
|
|
34
34
|
e,
|
|
35
35
|
/* @__PURE__ */ l(Y, { icon: "close", size: n })
|
|
36
36
|
] })
|
|
@@ -72,25 +72,25 @@ const I = {
|
|
|
72
72
|
closeOnOverlayClick: n = !0,
|
|
73
73
|
isOpen: a,
|
|
74
74
|
onClose: d,
|
|
75
|
-
closeButtonLabel:
|
|
75
|
+
closeButtonLabel: v,
|
|
76
76
|
className: s,
|
|
77
77
|
children: f,
|
|
78
78
|
closeButtonSize: r,
|
|
79
79
|
closeOnEscape: i,
|
|
80
80
|
dataTestId: c,
|
|
81
|
-
...
|
|
81
|
+
...h
|
|
82
82
|
}) => {
|
|
83
|
-
var
|
|
83
|
+
var I;
|
|
84
84
|
const M = U(null);
|
|
85
85
|
Q(M, a);
|
|
86
|
-
const [D,
|
|
87
|
-
() => O(
|
|
88
|
-
[
|
|
86
|
+
const [D, L] = W(
|
|
87
|
+
() => O(h),
|
|
88
|
+
[h]
|
|
89
89
|
), F = _.toArray(f), N = (m) => F.find(
|
|
90
90
|
(p) => te(p) === m
|
|
91
|
-
), g = N("ModalTitle"), b = N("ModalFooter") || N("DrawerFooter"),
|
|
91
|
+
), g = N("ModalTitle"), b = N("ModalFooter") || N("DrawerFooter"), R = z(), S = ((I = g == null ? void 0 : g.props) == null ? void 0 : I.id) || `gi-modal-title-${R}`, H = g ? T(g, {
|
|
92
92
|
as: o === "sm" ? "h5" : "h4",
|
|
93
|
-
id:
|
|
93
|
+
id: S
|
|
94
94
|
}) : null, $ = b ? T(b, {
|
|
95
95
|
dataModalSize: o
|
|
96
96
|
}) : null, V = F.filter(
|
|
@@ -109,18 +109,18 @@ const I = {
|
|
|
109
109
|
if (!a || !t || !n)
|
|
110
110
|
return;
|
|
111
111
|
const m = (p) => {
|
|
112
|
-
var
|
|
113
|
-
const
|
|
112
|
+
var k;
|
|
113
|
+
const w = (k = M.current) == null ? void 0 : k.querySelector(
|
|
114
114
|
".gi-modal-container-control"
|
|
115
115
|
);
|
|
116
|
-
|
|
116
|
+
w && (w.contains(p.target) || d());
|
|
117
117
|
};
|
|
118
118
|
return document.addEventListener("pointerdown", m, !0), () => document.removeEventListener("pointerdown", m, !0);
|
|
119
119
|
}, [a, t, n, d]);
|
|
120
120
|
const q = /* @__PURE__ */ l(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
|
-
...
|
|
123
|
+
...L,
|
|
124
124
|
ref: M,
|
|
125
125
|
className: u("gi-modal", {
|
|
126
126
|
"gi-modal-open": a,
|
|
@@ -153,7 +153,7 @@ const I = {
|
|
|
153
153
|
/* @__PURE__ */ l(
|
|
154
154
|
ae,
|
|
155
155
|
{
|
|
156
|
-
closeButtonLabel:
|
|
156
|
+
closeButtonLabel: v,
|
|
157
157
|
modalTitle: H,
|
|
158
158
|
closeOnClick: t,
|
|
159
159
|
onClose: d,
|
|
@@ -170,14 +170,14 @@ const I = {
|
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
172
|
return /* @__PURE__ */ l(ne, { modalRef: M, isOpen: a, children: q });
|
|
173
|
-
},
|
|
174
|
-
Object.defineProperty(
|
|
173
|
+
}, E = ({ children: e, as: o = "h4", ...t }) => /* @__PURE__ */ l("div", { className: "gi-flex-1", id: t.id, "aria-label": e == null ? void 0 : e.toString(), children: /* @__PURE__ */ l(J, { as: o, ...t, children: e }) });
|
|
174
|
+
Object.defineProperty(E, "componentType", {
|
|
175
175
|
value: "ModalTitle",
|
|
176
176
|
writable: !1,
|
|
177
177
|
enumerable: !1
|
|
178
178
|
});
|
|
179
|
-
|
|
180
|
-
const
|
|
179
|
+
E.displayName = "ModalTitle";
|
|
180
|
+
const ve = ({
|
|
181
181
|
children: e,
|
|
182
182
|
className: o,
|
|
183
183
|
includeModalClass: t = !0
|
|
@@ -199,10 +199,10 @@ const he = ({
|
|
|
199
199
|
}) => {
|
|
200
200
|
const s = (Array.isArray(o) ? o : [o]).filter((r) => {
|
|
201
201
|
var i, c;
|
|
202
|
-
return K(r) && (r.type ===
|
|
202
|
+
return K(r) && (r.type === A || ((i = r.type) == null ? void 0 : i.displayName) === "Button" || ((c = r.props) == null ? void 0 : c["data-button"]));
|
|
203
203
|
}).sort((r, i) => {
|
|
204
|
-
const c = r.props.variant ?? "primary",
|
|
205
|
-
return (
|
|
204
|
+
const c = r.props.variant ?? "primary", h = i.props.variant ?? "primary";
|
|
205
|
+
return (B[c] || 0) - (B[h] || 0);
|
|
206
206
|
}), f = u({
|
|
207
207
|
"gi-justify-center sm:gi-justify-start": !t && n !== "sm" && !a,
|
|
208
208
|
"gi-justify-center": t === "vertical" || n === "sm" || a,
|
|
@@ -225,7 +225,7 @@ const he = ({
|
|
|
225
225
|
(r, i) => {
|
|
226
226
|
var c;
|
|
227
227
|
return T(r, {
|
|
228
|
-
key: r.key || r.props.id || r.props.
|
|
228
|
+
key: r.key || r.props.id || r.props.dataTestId || `modal-footer-button-${i}`,
|
|
229
229
|
id: r.props.id || `modal-footer-button-${i}`,
|
|
230
230
|
className: u((c = r == null ? void 0 : r.props) == null ? void 0 : c.className, f)
|
|
231
231
|
});
|
|
@@ -247,22 +247,22 @@ const ne = ({
|
|
|
247
247
|
modalRef: o,
|
|
248
248
|
isOpen: t
|
|
249
249
|
}) => {
|
|
250
|
-
const [n, a] =
|
|
250
|
+
const [n, a] = j(!1);
|
|
251
251
|
return C(() => {
|
|
252
252
|
a(!0);
|
|
253
253
|
}, []), X(o, t && n), n ? G(e, document.body) : null;
|
|
254
|
-
},
|
|
254
|
+
}, he = ({
|
|
255
255
|
children: e,
|
|
256
256
|
triggerButton: o,
|
|
257
257
|
startsOpen: t,
|
|
258
258
|
...n
|
|
259
259
|
}) => {
|
|
260
|
-
const [a, d] =
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
onClick:
|
|
260
|
+
const [a, d] = j(!!t), v = () => d(!0), s = () => d(!1), f = T(o, {
|
|
261
|
+
dataTestId: "modal-trigger-button-container",
|
|
262
|
+
ariaHasPopup: "dialog",
|
|
263
|
+
onClick: v
|
|
264
264
|
});
|
|
265
|
-
return /* @__PURE__ */ y(
|
|
265
|
+
return /* @__PURE__ */ y(P, { children: [
|
|
266
266
|
f,
|
|
267
267
|
/* @__PURE__ */ l(
|
|
268
268
|
re,
|
|
@@ -277,9 +277,9 @@ const ne = ({
|
|
|
277
277
|
] });
|
|
278
278
|
};
|
|
279
279
|
export {
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
he as Modal,
|
|
281
|
+
ve as ModalBody,
|
|
282
282
|
x as ModalFooter,
|
|
283
|
-
|
|
283
|
+
E as ModalTitle,
|
|
284
284
|
re as ModalWrapper
|
|
285
285
|
};
|
package/dist/modal/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Props as ButtonProps } from '../atoms/Button';
|
|
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';
|
|
@@ -10,7 +10,7 @@ type ModalWrapperOwnProps = {
|
|
|
10
10
|
isOpen: boolean;
|
|
11
11
|
onClose: () => void;
|
|
12
12
|
position?: ModalPositions;
|
|
13
|
-
closeButtonSize?:
|
|
13
|
+
closeButtonSize?: ButtonProps['size'];
|
|
14
14
|
};
|
|
15
15
|
export type ModalWrapperProps = ModalWrapperOwnProps & Omit<ComponentPropsWithoutRef<'div'>, 'role'> & Omit<ModalProps, 'triggerButton'>;
|
|
16
16
|
export type ModalSize = 'sm' | 'md' | 'lg';
|
|
@@ -27,10 +27,11 @@ export type ModalProps = React.AriaAttributes & {
|
|
|
27
27
|
};
|
|
28
28
|
export type ModalCloseButtonProps = {
|
|
29
29
|
label?: string;
|
|
30
|
-
|
|
30
|
+
size?: ButtonProps['size'];
|
|
31
|
+
} & Omit<IconButtonProps, 'className' | 'icon' | 'variant' | 'appearance' | 'size'>;
|
|
31
32
|
export type ModalFooterButton = {
|
|
32
33
|
label: string;
|
|
33
|
-
variant:
|
|
34
|
+
variant: ButtonProps['variant'];
|
|
34
35
|
} & ButtonProps;
|
|
35
36
|
export type ModalFooterProps = {
|
|
36
37
|
className?: string;
|