@postenbring/hedwig-react 0.0.43 → 0.0.45
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.js +17 -3
- package/dist/card/card.mjs +1 -1
- package/dist/card/index.js +17 -3
- package/dist/card/index.mjs +2 -2
- package/dist/{chunk-PF6PZIZS.mjs → chunk-4RAMNETH.mjs} +1 -1
- package/dist/{chunk-DOJ2ZKNV.mjs → chunk-5NWYVPBZ.mjs} +1 -1
- package/dist/chunk-67OMX7FP.mjs +5 -0
- package/dist/{chunk-2QZF65FK.mjs → chunk-6IJTNHP4.mjs} +5 -1
- package/dist/{chunk-KOXEIUCU.mjs → chunk-E5575U2F.mjs} +1 -1
- package/dist/{chunk-K3BGDNWO.mjs → chunk-E55KF755.mjs} +2 -2
- package/dist/chunk-FDAXJJHU.mjs +53 -0
- package/dist/{chunk-6KVF3ELJ.mjs → chunk-HZMQWFYP.mjs} +2 -2
- package/dist/chunk-IAPRPJQO.mjs +30 -0
- package/dist/{chunk-QAYPCD5Z.mjs → chunk-JYEDLLKF.mjs} +21 -12
- package/dist/{chunk-4XHA3NGO.mjs → chunk-LICHSDMT.mjs} +17 -3
- package/dist/chunk-N5VPBR6T.mjs +129 -0
- package/dist/chunk-OKWNTFU5.mjs +5 -0
- package/dist/{chunk-SX37JSDS.mjs → chunk-OPW2JS5I.mjs} +1 -1
- package/dist/chunk-PPUNMHOX.mjs +0 -0
- package/dist/chunk-QMB26PCT.mjs +72 -0
- package/dist/{chunk-45BJGKVZ.mjs → chunk-S4F2KVFJ.mjs} +1 -1
- package/dist/{chunk-Y2KP4RF2.mjs → chunk-T4IRPRA6.mjs} +2 -2
- package/dist/{chunk-CP4CKVIA.mjs → chunk-T5W5SKZP.mjs} +5 -1
- package/dist/chunk-Y4KHO6LN.mjs +65 -0
- package/dist/form/error-message/error-message.d.mts +12 -0
- package/dist/form/error-message/error-message.d.ts +12 -0
- package/dist/form/error-message/error-message.js +66 -0
- package/dist/form/error-message/error-message.mjs +7 -0
- package/dist/form/error-message/index.d.mts +3 -0
- package/dist/form/error-message/index.d.ts +3 -0
- package/dist/form/error-message/index.js +72 -0
- package/dist/form/error-message/index.mjs +8 -0
- package/dist/form/fieldset/fieldset.d.mts +20 -0
- package/dist/form/fieldset/fieldset.d.ts +20 -0
- package/dist/{input-group/input-group.js → form/fieldset/fieldset.js} +65 -61
- package/dist/form/fieldset/fieldset.mjs +9 -0
- package/dist/form/fieldset/index.d.mts +2 -0
- package/dist/form/fieldset/index.d.ts +2 -0
- package/dist/form/fieldset/index.js +152 -0
- package/dist/form/fieldset/index.mjs +10 -0
- package/dist/form/index.d.mts +6 -0
- package/dist/form/index.d.ts +6 -0
- package/dist/form/index.js +375 -0
- package/dist/form/index.mjs +28 -0
- package/dist/{input/input.js → form/input/index.js} +70 -27
- package/dist/form/input/index.mjs +12 -0
- package/dist/{input/index.js → form/input/input.js} +60 -31
- package/dist/form/input/input.mjs +11 -0
- package/dist/form/input-group/index.d.mts +2 -0
- package/dist/form/input-group/index.d.ts +2 -0
- package/dist/{textarea/textarea.js → form/input-group/index.js} +60 -50
- package/dist/form/input-group/index.mjs +10 -0
- package/dist/{input-group → form/input-group}/input-group.d.mts +1 -7
- package/dist/{input-group → form/input-group}/input-group.d.ts +1 -7
- package/dist/{input-group/index.js → form/input-group/input-group.js} +51 -21
- package/dist/form/input-group/input-group.mjs +9 -0
- package/dist/{select/select.js → form/select/index.js} +70 -27
- package/dist/form/select/index.mjs +12 -0
- package/dist/{select/index.js → form/select/select.js} +60 -31
- package/dist/form/select/select.mjs +11 -0
- package/dist/form/textarea/index.js +217 -0
- package/dist/form/textarea/index.mjs +12 -0
- package/dist/{textarea/index.js → form/textarea/textarea.js} +60 -31
- package/dist/form/textarea/textarea.mjs +11 -0
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +429 -243
- package/dist/index.mjs +37 -29
- package/dist/list/description-list.d.mts +4 -4
- package/dist/list/description-list.d.ts +4 -4
- package/dist/list/index.mjs +3 -3
- package/dist/modal/index.d.mts +5 -2
- package/dist/modal/index.d.ts +5 -2
- package/dist/modal/index.js +71 -3
- package/dist/modal/index.mjs +2 -2
- package/dist/modal/modal.d.mts +20 -2
- package/dist/modal/modal.d.ts +20 -2
- package/dist/modal/modal.js +77 -5
- package/dist/modal/modal.mjs +9 -3
- package/dist/navbar/index.d.mts +4 -2
- package/dist/navbar/index.d.ts +4 -2
- package/dist/navbar/index.js +29 -1
- package/dist/navbar/index.mjs +7 -3
- package/dist/navbar/navbar-expandable-menu.js +5 -1
- package/dist/navbar/navbar-expandable-menu.mjs +1 -1
- package/dist/navbar/navbar.d.mts +10 -1
- package/dist/navbar/navbar.d.ts +10 -1
- package/dist/navbar/navbar.js +28 -2
- package/dist/navbar/navbar.mjs +7 -3
- package/dist/tabs/index.mjs +2 -2
- package/dist/typography/index.d.mts +69 -0
- package/dist/typography/index.d.ts +69 -0
- package/dist/typography/index.js +255 -0
- package/dist/typography/index.mjs +110 -0
- package/dist/typography/typography.d.mts +18 -0
- package/dist/typography/typography.d.ts +18 -0
- package/dist/typography/typography.js +112 -0
- package/dist/typography/typography.mjs +7 -0
- package/package.json +2 -2
- package/dist/chunk-FB5VUC62.mjs +0 -29
- package/dist/chunk-OB6UNSKV.mjs +0 -60
- package/dist/input/index.mjs +0 -10
- package/dist/input/input.mjs +0 -9
- package/dist/input-group/index.d.mts +0 -2
- package/dist/input-group/index.d.ts +0 -2
- package/dist/input-group/index.mjs +0 -8
- package/dist/input-group/input-group.mjs +0 -7
- package/dist/select/index.mjs +0 -10
- package/dist/select/select.mjs +0 -9
- package/dist/textarea/index.mjs +0 -10
- package/dist/textarea/textarea.mjs +0 -9
- package/dist/{chunk-WUMZCEIJ.mjs → chunk-BSX4IA3X.mjs} +3 -3
- /package/dist/{input → form/input}/index.d.mts +0 -0
- /package/dist/{input → form/input}/index.d.ts +0 -0
- /package/dist/{input → form/input}/input.d.mts +0 -0
- /package/dist/{input → form/input}/input.d.ts +0 -0
- /package/dist/{select → form/select}/index.d.mts +0 -0
- /package/dist/{select → form/select}/index.d.ts +0 -0
- /package/dist/{select → form/select}/select.d.mts +0 -0
- /package/dist/{select → form/select}/select.d.ts +0 -0
- /package/dist/{textarea → form/textarea}/index.d.mts +0 -0
- /package/dist/{textarea → form/textarea}/index.d.ts +0 -0
- /package/dist/{textarea → form/textarea}/textarea.d.mts +0 -0
- /package/dist/{textarea → form/textarea}/textarea.d.ts +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import "./chunk-DOJ2ZKNV.mjs";
|
|
2
|
-
import {
|
|
3
|
-
Textarea
|
|
4
|
-
} from "./chunk-Y2KP4RF2.mjs";
|
|
5
|
-
import "./chunk-K2HIKZ7F.mjs";
|
|
6
|
-
import {
|
|
7
|
-
WarningBanner
|
|
8
|
-
} from "./chunk-BHNQPMEB.mjs";
|
|
9
|
-
import "./chunk-SX37JSDS.mjs";
|
|
10
|
-
import {
|
|
11
|
-
Select
|
|
12
|
-
} from "./chunk-K3BGDNWO.mjs";
|
|
13
1
|
import {
|
|
14
2
|
TabsComponent
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-ZLCNSHLT.mjs";
|
|
3
|
+
} from "./chunk-BSX4IA3X.mjs";
|
|
17
4
|
import "./chunk-GRO36EUL.mjs";
|
|
18
5
|
import "./chunk-G3JPULGO.mjs";
|
|
6
|
+
import "./chunk-ZLCNSHLT.mjs";
|
|
19
7
|
import "./chunk-4ZM45P62.mjs";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
LinkList
|
|
23
|
-
} from "./chunk-BRBGRJ2I.mjs";
|
|
8
|
+
import "./chunk-K2HIKZ7F.mjs";
|
|
24
9
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "./chunk-RY53CJI7.mjs";
|
|
10
|
+
WarningBanner
|
|
11
|
+
} from "./chunk-BHNQPMEB.mjs";
|
|
28
12
|
import {
|
|
29
13
|
MessageComponent
|
|
30
14
|
} from "./chunk-MER2HJBC.mjs";
|
|
31
15
|
import "./chunk-WYPGZY5Q.mjs";
|
|
32
16
|
import {
|
|
33
17
|
ModalComponent
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-6IJTNHP4.mjs";
|
|
19
|
+
import "./chunk-N5VPBR6T.mjs";
|
|
36
20
|
import "./chunk-FSBY3NKV.mjs";
|
|
37
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-PPUNMHOX.mjs";
|
|
22
|
+
import "./chunk-OPW2JS5I.mjs";
|
|
23
|
+
import {
|
|
24
|
+
Select
|
|
25
|
+
} from "./chunk-E55KF755.mjs";
|
|
26
|
+
import "./chunk-5NWYVPBZ.mjs";
|
|
27
|
+
import {
|
|
28
|
+
Textarea
|
|
29
|
+
} from "./chunk-T4IRPRA6.mjs";
|
|
30
|
+
import "./chunk-OKWNTFU5.mjs";
|
|
31
|
+
import {
|
|
32
|
+
Fieldset
|
|
33
|
+
} from "./chunk-QMB26PCT.mjs";
|
|
34
|
+
import "./chunk-4RAMNETH.mjs";
|
|
38
35
|
import {
|
|
39
36
|
Input
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-HZMQWFYP.mjs";
|
|
38
|
+
import "./chunk-S4F2KVFJ.mjs";
|
|
39
|
+
import "./chunk-JYEDLLKF.mjs";
|
|
40
|
+
import "./chunk-67OMX7FP.mjs";
|
|
41
|
+
import "./chunk-IAPRPJQO.mjs";
|
|
43
42
|
import "./chunk-FJQCHTJZ.mjs";
|
|
44
43
|
import {
|
|
45
44
|
Container
|
|
@@ -48,9 +47,17 @@ import "./chunk-7SCOBRDZ.mjs";
|
|
|
48
47
|
import {
|
|
49
48
|
Link
|
|
50
49
|
} from "./chunk-TES7CVGU.mjs";
|
|
50
|
+
import "./chunk-5OAMKZDX.mjs";
|
|
51
51
|
import {
|
|
52
52
|
DescriptionList
|
|
53
53
|
} from "./chunk-3JNHAMRV.mjs";
|
|
54
|
+
import {
|
|
55
|
+
LinkList
|
|
56
|
+
} from "./chunk-BRBGRJ2I.mjs";
|
|
57
|
+
import {
|
|
58
|
+
OrderedList,
|
|
59
|
+
UnorderedList
|
|
60
|
+
} from "./chunk-RY53CJI7.mjs";
|
|
54
61
|
import {
|
|
55
62
|
BoxComponent
|
|
56
63
|
} from "./chunk-E2GAXTBX.mjs";
|
|
@@ -66,8 +73,8 @@ import {
|
|
|
66
73
|
} from "./chunk-ENRMC5K7.mjs";
|
|
67
74
|
import {
|
|
68
75
|
CardComponent
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import "./chunk-
|
|
76
|
+
} from "./chunk-E5575U2F.mjs";
|
|
77
|
+
import "./chunk-LICHSDMT.mjs";
|
|
71
78
|
import {
|
|
72
79
|
AccordionComponent
|
|
73
80
|
} from "./chunk-KYCCTJI6.mjs";
|
|
@@ -93,6 +100,7 @@ export {
|
|
|
93
100
|
Container,
|
|
94
101
|
DarkBadge,
|
|
95
102
|
DescriptionList,
|
|
103
|
+
Fieldset,
|
|
96
104
|
Input,
|
|
97
105
|
Link,
|
|
98
106
|
LinkList,
|
|
@@ -19,9 +19,9 @@ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
19
19
|
* ```tsx
|
|
20
20
|
* <DescriptionList>
|
|
21
21
|
* <dt>Vekt</dt>
|
|
22
|
-
* <
|
|
22
|
+
* <dd>12 kg</dd>
|
|
23
23
|
* <dt>Antall kolli</dt>
|
|
24
|
-
* <
|
|
24
|
+
* <dd>2</dd>
|
|
25
25
|
* </DescriptionList>
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
@@ -31,11 +31,11 @@ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
31
31
|
* <DescriptionList>
|
|
32
32
|
* <div>
|
|
33
33
|
* <dt>Vekt</dt>
|
|
34
|
-
* <
|
|
34
|
+
* <dd>12 kg</dd>
|
|
35
35
|
* </div>
|
|
36
36
|
* <div>
|
|
37
37
|
* <dt>Antall kolli</dt>
|
|
38
|
-
* <
|
|
38
|
+
* <dd>2</dd>
|
|
39
39
|
* </div>
|
|
40
40
|
* </DescriptionList>
|
|
41
41
|
* ```
|
|
@@ -19,9 +19,9 @@ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
19
19
|
* ```tsx
|
|
20
20
|
* <DescriptionList>
|
|
21
21
|
* <dt>Vekt</dt>
|
|
22
|
-
* <
|
|
22
|
+
* <dd>12 kg</dd>
|
|
23
23
|
* <dt>Antall kolli</dt>
|
|
24
|
-
* <
|
|
24
|
+
* <dd>2</dd>
|
|
25
25
|
* </DescriptionList>
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
@@ -31,11 +31,11 @@ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
|
31
31
|
* <DescriptionList>
|
|
32
32
|
* <div>
|
|
33
33
|
* <dt>Vekt</dt>
|
|
34
|
-
* <
|
|
34
|
+
* <dd>12 kg</dd>
|
|
35
35
|
* </div>
|
|
36
36
|
* <div>
|
|
37
37
|
* <dt>Antall kolli</dt>
|
|
38
|
-
* <
|
|
38
|
+
* <dd>2</dd>
|
|
39
39
|
* </div>
|
|
40
40
|
* </DescriptionList>
|
|
41
41
|
* ```
|
package/dist/list/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "../chunk-5OAMKZDX.mjs";
|
|
2
|
+
import {
|
|
3
|
+
DescriptionList
|
|
4
|
+
} from "../chunk-3JNHAMRV.mjs";
|
|
2
5
|
import {
|
|
3
6
|
LinkList
|
|
4
7
|
} from "../chunk-BRBGRJ2I.mjs";
|
|
@@ -6,9 +9,6 @@ import {
|
|
|
6
9
|
OrderedList,
|
|
7
10
|
UnorderedList
|
|
8
11
|
} from "../chunk-RY53CJI7.mjs";
|
|
9
|
-
import {
|
|
10
|
-
DescriptionList
|
|
11
|
-
} from "../chunk-3JNHAMRV.mjs";
|
|
12
12
|
import "../chunk-FUJQIYOF.mjs";
|
|
13
13
|
export {
|
|
14
14
|
DescriptionList,
|
package/dist/modal/index.d.mts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ModalProps, ModalHeader } from './modal.mjs';
|
|
2
|
+
import { ModalProps, ModalHeader, ModalContent, ModalFooter } from './modal.mjs';
|
|
3
|
+
export { useScrollLock } from './modal.mjs';
|
|
3
4
|
import '../utils-BfZsjuFH.mjs';
|
|
4
5
|
|
|
5
6
|
declare const ModalComponent: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDialogElement>> & {
|
|
6
7
|
Header: typeof ModalHeader;
|
|
8
|
+
Content: typeof ModalContent;
|
|
9
|
+
Footer: typeof ModalFooter;
|
|
7
10
|
};
|
|
8
11
|
|
|
9
|
-
export { ModalComponent as Modal, ModalHeader, ModalProps };
|
|
12
|
+
export { ModalComponent as Modal, ModalContent, ModalFooter, ModalHeader, ModalProps };
|
package/dist/modal/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ModalProps, ModalHeader } from './modal.js';
|
|
2
|
+
import { ModalProps, ModalHeader, ModalContent, ModalFooter } from './modal.js';
|
|
3
|
+
export { useScrollLock } from './modal.js';
|
|
3
4
|
import '../utils-BfZsjuFH.js';
|
|
4
5
|
|
|
5
6
|
declare const ModalComponent: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDialogElement>> & {
|
|
6
7
|
Header: typeof ModalHeader;
|
|
8
|
+
Content: typeof ModalContent;
|
|
9
|
+
Footer: typeof ModalFooter;
|
|
7
10
|
};
|
|
8
11
|
|
|
9
|
-
export { ModalComponent as Modal, ModalHeader, ModalProps };
|
|
12
|
+
export { ModalComponent as Modal, ModalContent, ModalFooter, ModalHeader, ModalProps };
|
package/dist/modal/index.js
CHANGED
|
@@ -168,21 +168,38 @@ function useMergeRefs(refs) {
|
|
|
168
168
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
169
169
|
var Modal = (0, import_react3.forwardRef)(
|
|
170
170
|
(_a, ref) => {
|
|
171
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
171
|
+
var _b = _a, { children, className, open, closeOnBackdropClick, onClick } = _b, rest = __objRest(_b, ["children", "className", "open", "closeOnBackdropClick", "onClick"]);
|
|
172
172
|
const modalRef = (0, import_react3.useRef)(null);
|
|
173
173
|
const mergedRef = useMergeRefs([modalRef, ref]);
|
|
174
|
-
function
|
|
174
|
+
function onCloseButtonClick() {
|
|
175
175
|
var _a2;
|
|
176
176
|
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
177
177
|
return false;
|
|
178
178
|
}
|
|
179
|
+
useScrollLock(modalRef, "hds-modal-scroll-lock");
|
|
180
|
+
(0, import_react3.useEffect)(() => {
|
|
181
|
+
if (modalRef.current && open !== void 0) {
|
|
182
|
+
if (open && !modalRef.current.open) {
|
|
183
|
+
modalRef.current.showModal();
|
|
184
|
+
} else if (!open && modalRef.current.open) {
|
|
185
|
+
modalRef.current.close();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, [modalRef, open]);
|
|
189
|
+
function onDialogClick(e) {
|
|
190
|
+
if (closeOnBackdropClick && e.target === modalRef.current) {
|
|
191
|
+
modalRef.current.close();
|
|
192
|
+
}
|
|
193
|
+
onClick == null ? void 0 : onClick(e);
|
|
194
|
+
}
|
|
179
195
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
180
196
|
Box,
|
|
181
197
|
__spreadProps(__spreadValues({
|
|
182
198
|
as: "dialog",
|
|
183
199
|
className: (0, import_typed_classname2.clsx)("hds-modal", className),
|
|
184
200
|
closeable: true,
|
|
185
|
-
|
|
201
|
+
onClick: onDialogClick,
|
|
202
|
+
onClose: onCloseButtonClick,
|
|
186
203
|
ref: mergedRef,
|
|
187
204
|
variant: "white"
|
|
188
205
|
}, rest), {
|
|
@@ -205,10 +222,61 @@ var ModalHeader = (0, import_react3.forwardRef)(
|
|
|
205
222
|
}
|
|
206
223
|
);
|
|
207
224
|
ModalHeader.displayName = "Modal.Header";
|
|
225
|
+
var ModalContent = (0, import_react3.forwardRef)(
|
|
226
|
+
(_a, ref) => {
|
|
227
|
+
var _b = _a, { as: Component = "div", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
229
|
+
Component,
|
|
230
|
+
__spreadValues({
|
|
231
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__content", className),
|
|
232
|
+
ref
|
|
233
|
+
}, rest)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
ModalContent.displayName = "Modal.Content";
|
|
238
|
+
var ModalFooter = (0, import_react3.forwardRef)(
|
|
239
|
+
(_a, ref) => {
|
|
240
|
+
var _b = _a, { as: Component = "footer", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
242
|
+
Component,
|
|
243
|
+
__spreadValues({
|
|
244
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__footer", className),
|
|
245
|
+
ref
|
|
246
|
+
}, rest)
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
ModalFooter.displayName = "Modal.Footer";
|
|
251
|
+
function useScrollLock(modalRef, bodyClass) {
|
|
252
|
+
(0, import_react3.useEffect)(() => {
|
|
253
|
+
if (!modalRef.current)
|
|
254
|
+
return;
|
|
255
|
+
if (modalRef.current.open)
|
|
256
|
+
document.body.classList.add(bodyClass);
|
|
257
|
+
const observer = new MutationObserver(() => {
|
|
258
|
+
var _a;
|
|
259
|
+
if ((_a = modalRef.current) == null ? void 0 : _a.open)
|
|
260
|
+
document.body.classList.add(bodyClass);
|
|
261
|
+
else
|
|
262
|
+
document.body.classList.remove(bodyClass);
|
|
263
|
+
});
|
|
264
|
+
observer.observe(modalRef.current, {
|
|
265
|
+
attributes: true,
|
|
266
|
+
attributeFilter: ["open"]
|
|
267
|
+
});
|
|
268
|
+
return () => {
|
|
269
|
+
observer.disconnect();
|
|
270
|
+
document.body.classList.remove(bodyClass);
|
|
271
|
+
};
|
|
272
|
+
}, [bodyClass, modalRef]);
|
|
273
|
+
}
|
|
208
274
|
|
|
209
275
|
// src/modal/index.tsx
|
|
210
276
|
var ModalComponent = Modal;
|
|
211
277
|
ModalComponent.Header = ModalHeader;
|
|
278
|
+
ModalComponent.Content = ModalContent;
|
|
279
|
+
ModalComponent.Footer = ModalFooter;
|
|
212
280
|
// Annotate the CommonJS export names for ESM import in node:
|
|
213
281
|
0 && (module.exports = {
|
|
214
282
|
Modal
|
package/dist/modal/index.mjs
CHANGED
package/dist/modal/modal.d.mts
CHANGED
|
@@ -3,11 +3,29 @@ import { O as OverridableComponent } from '../utils-BfZsjuFH.mjs';
|
|
|
3
3
|
|
|
4
4
|
interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Controls the open state of the modal
|
|
8
|
+
*/
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to close when clicking on the backdrop.
|
|
12
|
+
*/
|
|
13
|
+
closeOnBackdropClick?: boolean;
|
|
6
14
|
}
|
|
7
15
|
/**
|
|
8
16
|
* # 🚨 WORK IN PROGRESS 🚨
|
|
17
|
+
*
|
|
18
|
+
* ## TODO
|
|
19
|
+
*
|
|
20
|
+
* - [ ] polyfill the dialog element for the %0.2 users that don't have it yet.
|
|
21
|
+
* - [x] Open the modal where there user is, not top of the page
|
|
22
|
+
* - [x] Support the `open` prop
|
|
23
|
+
* - [x] Support click outside to close
|
|
9
24
|
*/
|
|
10
25
|
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDialogElement>>;
|
|
11
|
-
declare const ModalHeader: OverridableComponent<object,
|
|
26
|
+
declare const ModalHeader: OverridableComponent<object, HTMLHeadingElement>;
|
|
27
|
+
declare const ModalContent: OverridableComponent<object, HTMLDivElement>;
|
|
28
|
+
declare const ModalFooter: OverridableComponent<object, HTMLDivElement>;
|
|
29
|
+
declare function useScrollLock(modalRef: React.RefObject<HTMLDialogElement>, bodyClass: string): void;
|
|
12
30
|
|
|
13
|
-
export { Modal, ModalHeader, type ModalProps };
|
|
31
|
+
export { Modal, ModalContent, ModalFooter, ModalHeader, type ModalProps, useScrollLock };
|
package/dist/modal/modal.d.ts
CHANGED
|
@@ -3,11 +3,29 @@ import { O as OverridableComponent } from '../utils-BfZsjuFH.js';
|
|
|
3
3
|
|
|
4
4
|
interface ModalProps extends React.HTMLAttributes<HTMLDialogElement> {
|
|
5
5
|
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Controls the open state of the modal
|
|
8
|
+
*/
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to close when clicking on the backdrop.
|
|
12
|
+
*/
|
|
13
|
+
closeOnBackdropClick?: boolean;
|
|
6
14
|
}
|
|
7
15
|
/**
|
|
8
16
|
* # 🚨 WORK IN PROGRESS 🚨
|
|
17
|
+
*
|
|
18
|
+
* ## TODO
|
|
19
|
+
*
|
|
20
|
+
* - [ ] polyfill the dialog element for the %0.2 users that don't have it yet.
|
|
21
|
+
* - [x] Open the modal where there user is, not top of the page
|
|
22
|
+
* - [x] Support the `open` prop
|
|
23
|
+
* - [x] Support click outside to close
|
|
9
24
|
*/
|
|
10
25
|
declare const Modal: react.ForwardRefExoticComponent<ModalProps & react.RefAttributes<HTMLDialogElement>>;
|
|
11
|
-
declare const ModalHeader: OverridableComponent<object,
|
|
26
|
+
declare const ModalHeader: OverridableComponent<object, HTMLHeadingElement>;
|
|
27
|
+
declare const ModalContent: OverridableComponent<object, HTMLDivElement>;
|
|
28
|
+
declare const ModalFooter: OverridableComponent<object, HTMLDivElement>;
|
|
29
|
+
declare function useScrollLock(modalRef: React.RefObject<HTMLDialogElement>, bodyClass: string): void;
|
|
12
30
|
|
|
13
|
-
export { Modal, ModalHeader, type ModalProps };
|
|
31
|
+
export { Modal, ModalContent, ModalFooter, ModalHeader, type ModalProps, useScrollLock };
|
package/dist/modal/modal.js
CHANGED
|
@@ -60,7 +60,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
60
60
|
var modal_exports = {};
|
|
61
61
|
__export(modal_exports, {
|
|
62
62
|
Modal: () => Modal,
|
|
63
|
-
|
|
63
|
+
ModalContent: () => ModalContent,
|
|
64
|
+
ModalFooter: () => ModalFooter,
|
|
65
|
+
ModalHeader: () => ModalHeader,
|
|
66
|
+
useScrollLock: () => useScrollLock
|
|
64
67
|
});
|
|
65
68
|
module.exports = __toCommonJS(modal_exports);
|
|
66
69
|
var import_react3 = require("react");
|
|
@@ -162,21 +165,38 @@ function useMergeRefs(refs) {
|
|
|
162
165
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
163
166
|
var Modal = (0, import_react3.forwardRef)(
|
|
164
167
|
(_a, ref) => {
|
|
165
|
-
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
168
|
+
var _b = _a, { children, className, open, closeOnBackdropClick, onClick } = _b, rest = __objRest(_b, ["children", "className", "open", "closeOnBackdropClick", "onClick"]);
|
|
166
169
|
const modalRef = (0, import_react3.useRef)(null);
|
|
167
170
|
const mergedRef = useMergeRefs([modalRef, ref]);
|
|
168
|
-
function
|
|
171
|
+
function onCloseButtonClick() {
|
|
169
172
|
var _a2;
|
|
170
173
|
(_a2 = modalRef.current) == null ? void 0 : _a2.close();
|
|
171
174
|
return false;
|
|
172
175
|
}
|
|
176
|
+
useScrollLock(modalRef, "hds-modal-scroll-lock");
|
|
177
|
+
(0, import_react3.useEffect)(() => {
|
|
178
|
+
if (modalRef.current && open !== void 0) {
|
|
179
|
+
if (open && !modalRef.current.open) {
|
|
180
|
+
modalRef.current.showModal();
|
|
181
|
+
} else if (!open && modalRef.current.open) {
|
|
182
|
+
modalRef.current.close();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, [modalRef, open]);
|
|
186
|
+
function onDialogClick(e) {
|
|
187
|
+
if (closeOnBackdropClick && e.target === modalRef.current) {
|
|
188
|
+
modalRef.current.close();
|
|
189
|
+
}
|
|
190
|
+
onClick == null ? void 0 : onClick(e);
|
|
191
|
+
}
|
|
173
192
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
174
193
|
Box,
|
|
175
194
|
__spreadProps(__spreadValues({
|
|
176
195
|
as: "dialog",
|
|
177
196
|
className: (0, import_typed_classname2.clsx)("hds-modal", className),
|
|
178
197
|
closeable: true,
|
|
179
|
-
|
|
198
|
+
onClick: onDialogClick,
|
|
199
|
+
onClose: onCloseButtonClick,
|
|
180
200
|
ref: mergedRef,
|
|
181
201
|
variant: "white"
|
|
182
202
|
}, rest), {
|
|
@@ -199,8 +219,60 @@ var ModalHeader = (0, import_react3.forwardRef)(
|
|
|
199
219
|
}
|
|
200
220
|
);
|
|
201
221
|
ModalHeader.displayName = "Modal.Header";
|
|
222
|
+
var ModalContent = (0, import_react3.forwardRef)(
|
|
223
|
+
(_a, ref) => {
|
|
224
|
+
var _b = _a, { as: Component = "div", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
226
|
+
Component,
|
|
227
|
+
__spreadValues({
|
|
228
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__content", className),
|
|
229
|
+
ref
|
|
230
|
+
}, rest)
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
);
|
|
234
|
+
ModalContent.displayName = "Modal.Content";
|
|
235
|
+
var ModalFooter = (0, import_react3.forwardRef)(
|
|
236
|
+
(_a, ref) => {
|
|
237
|
+
var _b = _a, { as: Component = "footer", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
239
|
+
Component,
|
|
240
|
+
__spreadValues({
|
|
241
|
+
className: (0, import_typed_classname2.clsx)("hds-modal__footer", className),
|
|
242
|
+
ref
|
|
243
|
+
}, rest)
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
ModalFooter.displayName = "Modal.Footer";
|
|
248
|
+
function useScrollLock(modalRef, bodyClass) {
|
|
249
|
+
(0, import_react3.useEffect)(() => {
|
|
250
|
+
if (!modalRef.current)
|
|
251
|
+
return;
|
|
252
|
+
if (modalRef.current.open)
|
|
253
|
+
document.body.classList.add(bodyClass);
|
|
254
|
+
const observer = new MutationObserver(() => {
|
|
255
|
+
var _a;
|
|
256
|
+
if ((_a = modalRef.current) == null ? void 0 : _a.open)
|
|
257
|
+
document.body.classList.add(bodyClass);
|
|
258
|
+
else
|
|
259
|
+
document.body.classList.remove(bodyClass);
|
|
260
|
+
});
|
|
261
|
+
observer.observe(modalRef.current, {
|
|
262
|
+
attributes: true,
|
|
263
|
+
attributeFilter: ["open"]
|
|
264
|
+
});
|
|
265
|
+
return () => {
|
|
266
|
+
observer.disconnect();
|
|
267
|
+
document.body.classList.remove(bodyClass);
|
|
268
|
+
};
|
|
269
|
+
}, [bodyClass, modalRef]);
|
|
270
|
+
}
|
|
202
271
|
// Annotate the CommonJS export names for ESM import in node:
|
|
203
272
|
0 && (module.exports = {
|
|
204
273
|
Modal,
|
|
205
|
-
|
|
274
|
+
ModalContent,
|
|
275
|
+
ModalFooter,
|
|
276
|
+
ModalHeader,
|
|
277
|
+
useScrollLock
|
|
206
278
|
});
|
package/dist/modal/modal.mjs
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
ModalContent,
|
|
4
|
+
ModalFooter,
|
|
5
|
+
ModalHeader,
|
|
6
|
+
useScrollLock
|
|
7
|
+
} from "../chunk-N5VPBR6T.mjs";
|
|
5
8
|
import "../chunk-FSBY3NKV.mjs";
|
|
6
9
|
import "../chunk-WTMT5WCJ.mjs";
|
|
7
10
|
import "../chunk-FUJQIYOF.mjs";
|
|
8
11
|
export {
|
|
9
12
|
Modal,
|
|
10
|
-
|
|
13
|
+
ModalContent,
|
|
14
|
+
ModalFooter,
|
|
15
|
+
ModalHeader,
|
|
16
|
+
useScrollLock
|
|
11
17
|
};
|
package/dist/navbar/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { NavbarProps, NavbarLogo } from './navbar.mjs';
|
|
2
|
+
import { NavbarProps, NavbarLogo, NavbarButton, NavbarNavigation } from './navbar.mjs';
|
|
3
3
|
import { NavbarExpandableMenu, NavbarExpandableMenuTrigger, NavbarExpandableMenuContent } from './navbar-expandable-menu.mjs';
|
|
4
4
|
import '../utils-BfZsjuFH.mjs';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -11,6 +11,8 @@ declare const NavbarExpandableMenuComponent: typeof NavbarExpandableMenu & {
|
|
|
11
11
|
declare const NavbarComponent: react.ForwardRefExoticComponent<NavbarProps & react.RefAttributes<HTMLElement>> & {
|
|
12
12
|
Logo: typeof NavbarLogo;
|
|
13
13
|
ExpandableMenu: typeof NavbarExpandableMenuComponent;
|
|
14
|
+
Button: typeof NavbarButton;
|
|
15
|
+
Navigation: typeof NavbarNavigation;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export { NavbarComponent as Navbar, NavbarLogo, NavbarProps };
|
|
18
|
+
export { NavbarComponent as Navbar, NavbarButton, NavbarLogo, NavbarNavigation, NavbarProps };
|
package/dist/navbar/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { NavbarProps, NavbarLogo } from './navbar.js';
|
|
2
|
+
import { NavbarProps, NavbarLogo, NavbarButton, NavbarNavigation } from './navbar.js';
|
|
3
3
|
import { NavbarExpandableMenu, NavbarExpandableMenuTrigger, NavbarExpandableMenuContent } from './navbar-expandable-menu.js';
|
|
4
4
|
import '../utils-BfZsjuFH.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -11,6 +11,8 @@ declare const NavbarExpandableMenuComponent: typeof NavbarExpandableMenu & {
|
|
|
11
11
|
declare const NavbarComponent: react.ForwardRefExoticComponent<NavbarProps & react.RefAttributes<HTMLElement>> & {
|
|
12
12
|
Logo: typeof NavbarLogo;
|
|
13
13
|
ExpandableMenu: typeof NavbarExpandableMenuComponent;
|
|
14
|
+
Button: typeof NavbarButton;
|
|
15
|
+
Navigation: typeof NavbarNavigation;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
|
-
export { NavbarComponent as Navbar, NavbarLogo, NavbarProps };
|
|
18
|
+
export { NavbarComponent as Navbar, NavbarButton, NavbarLogo, NavbarNavigation, NavbarProps };
|
package/dist/navbar/index.js
CHANGED
|
@@ -75,6 +75,28 @@ var NavbarLogo = (0, import_react.forwardRef)(
|
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
77
|
NavbarLogo.displayName = "Navbar.Logo";
|
|
78
|
+
var NavbarButton = (0, import_react.forwardRef)(
|
|
79
|
+
(_a, ref) => {
|
|
80
|
+
var _b = _a, { as: Component = "button", children, icon, className } = _b, rest = __objRest(_b, ["as", "children", "icon", "className"]);
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Component, __spreadProps(__spreadValues({ className: (0, import_typed_classname.clsx)("hds-navbar__button", className), ref }, rest), { children: [
|
|
82
|
+
children,
|
|
83
|
+
" ",
|
|
84
|
+
icon
|
|
85
|
+
] }));
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
NavbarButton.displayName = "Navbar.Button";
|
|
89
|
+
var NavbarNavigation = (0, import_react.forwardRef)((_a, ref) => {
|
|
90
|
+
var _b = _a, { as: Component = "div", className } = _b, rest = __objRest(_b, ["as", "className"]);
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
Component,
|
|
93
|
+
__spreadValues({
|
|
94
|
+
className: (0, import_typed_classname.clsx)("hds-navbar__navigation", className),
|
|
95
|
+
ref
|
|
96
|
+
}, rest)
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
NavbarNavigation.displayName = "Navbar.Navigation";
|
|
78
100
|
|
|
79
101
|
// src/navbar/navbar-expandable-menu.tsx
|
|
80
102
|
var import_react2 = require("react");
|
|
@@ -114,7 +136,11 @@ var NavbarExpandableMenuTrigger = (0, import_react2.forwardRef)(
|
|
|
114
136
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
115
137
|
"button",
|
|
116
138
|
__spreadProps(__spreadValues({
|
|
117
|
-
className: (0, import_typed_classname2.clsx)(
|
|
139
|
+
className: (0, import_typed_classname2.clsx)(
|
|
140
|
+
"hds-navbar__expandable-menu-trigger",
|
|
141
|
+
"hds-navbar__button",
|
|
142
|
+
className
|
|
143
|
+
),
|
|
118
144
|
onClick: toggleOpen,
|
|
119
145
|
ref,
|
|
120
146
|
title,
|
|
@@ -148,6 +174,8 @@ NavbarExpandableMenuComponent.Content = NavbarExpandableMenuContent;
|
|
|
148
174
|
var NavbarComponent = Navbar;
|
|
149
175
|
NavbarComponent.Logo = NavbarLogo;
|
|
150
176
|
NavbarComponent.ExpandableMenu = NavbarExpandableMenuComponent;
|
|
177
|
+
NavbarComponent.Button = NavbarButton;
|
|
178
|
+
NavbarComponent.Navigation = NavbarNavigation;
|
|
151
179
|
// Annotate the CommonJS export names for ESM import in node:
|
|
152
180
|
0 && (module.exports = {
|
|
153
181
|
Navbar
|
package/dist/navbar/index.mjs
CHANGED
|
@@ -2,11 +2,13 @@ import {
|
|
|
2
2
|
NavbarExpandableMenu,
|
|
3
3
|
NavbarExpandableMenuContent,
|
|
4
4
|
NavbarExpandableMenuTrigger
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-T5W5SKZP.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Navbar,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
NavbarButton,
|
|
9
|
+
NavbarLogo,
|
|
10
|
+
NavbarNavigation
|
|
11
|
+
} from "../chunk-FDAXJJHU.mjs";
|
|
10
12
|
import "../chunk-FUJQIYOF.mjs";
|
|
11
13
|
|
|
12
14
|
// src/navbar/index.tsx
|
|
@@ -20,6 +22,8 @@ NavbarExpandableMenuComponent.Content = NavbarExpandableMenuContent;
|
|
|
20
22
|
var NavbarComponent = Navbar;
|
|
21
23
|
NavbarComponent.Logo = NavbarLogo;
|
|
22
24
|
NavbarComponent.ExpandableMenu = NavbarExpandableMenuComponent;
|
|
25
|
+
NavbarComponent.Button = NavbarButton;
|
|
26
|
+
NavbarComponent.Navigation = NavbarNavigation;
|
|
23
27
|
export {
|
|
24
28
|
NavbarComponent as Navbar
|
|
25
29
|
};
|
|
@@ -91,7 +91,11 @@ var NavbarExpandableMenuTrigger = (0, import_react.forwardRef)(
|
|
|
91
91
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
92
|
"button",
|
|
93
93
|
__spreadProps(__spreadValues({
|
|
94
|
-
className: (0, import_typed_classname.clsx)(
|
|
94
|
+
className: (0, import_typed_classname.clsx)(
|
|
95
|
+
"hds-navbar__expandable-menu-trigger",
|
|
96
|
+
"hds-navbar__button",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
95
99
|
onClick: toggleOpen,
|
|
96
100
|
ref,
|
|
97
101
|
title,
|