@strapi/design-system 1.6.4 → 1.6.6
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/Accordion/Accordion.cjs +1 -1
- package/dist/Accordion/Accordion.js +1 -1
- package/dist/Accordion/AccordionToggle.cjs +6 -6
- package/dist/Accordion/AccordionToggle.js +48 -51
- package/dist/BaseButton/BaseButton.cjs +3 -3
- package/dist/BaseButton/BaseButton.js +17 -16
- package/dist/BaseRadio/BaseRadio.cjs +1 -1
- package/dist/BaseRadio/BaseRadio.js +1 -1
- package/dist/Box/Box.cjs +3 -3
- package/dist/Box/Box.js +26 -26
- package/dist/Card/Card.cjs +1 -1
- package/dist/Card/Card.js +1 -1
- package/dist/CarouselInput/CarouselActions.cjs +1 -1
- package/dist/CarouselInput/CarouselActions.js +16 -4
- package/dist/CarouselInput/CarouselInput.cjs +1 -1
- package/dist/CarouselInput/CarouselInput.js +13 -13
- package/dist/Checkbox/Checkbox.cjs +2 -2
- package/dist/Checkbox/Checkbox.js +13 -13
- package/dist/Combobox/Combobox.cjs +1 -1
- package/dist/Combobox/Combobox.js +62 -63
- package/dist/DatePicker/DatePicker.cjs +8 -1
- package/dist/DatePicker/DatePicker.js +71 -98
- package/dist/DatePicker/DatePickerCalendar.cjs +1 -1
- package/dist/DatePicker/DatePickerCalendar.js +125 -57
- package/dist/DatePicker/DatePickerTd.cjs +4 -4
- package/dist/DatePicker/DatePickerTd.js +43 -26
- package/dist/DatePicker/DatePickerTh.cjs +3 -3
- package/dist/DatePicker/DatePickerTh.js +31 -15
- package/dist/DatePicker/components.cjs +8 -6
- package/dist/DatePicker/components.js +15 -13
- package/dist/DatePicker/utils/getDayOfWeek.js +8 -8
- package/dist/DatePicker/utils/getMonths.cjs +1 -1
- package/dist/DatePicker/utils/getMonths.js +3 -3
- package/dist/DatePicker/utils/getYears.cjs +1 -1
- package/dist/DatePicker/utils/getYears.js +1 -1
- package/dist/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/DateTimePicker/DateTimePicker.js +97 -104
- package/dist/Dialog/Dialog.cjs +4 -4
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Dialog/DialogFooter.cjs +3 -3
- package/dist/Dialog/DialogFooter.js +2 -2
- package/dist/Field/Field.cjs +1 -1
- package/dist/Field/Field.js +31 -27
- package/dist/Field/FieldAction.cjs +2 -8
- package/dist/Field/FieldAction.js +27 -16
- package/dist/Field/FieldContext.cjs +1 -1
- package/dist/Field/FieldContext.js +2 -2
- package/dist/Field/FieldError.cjs +1 -1
- package/dist/Field/FieldError.js +14 -4
- package/dist/Field/FieldHint.cjs +1 -1
- package/dist/Field/FieldHint.js +17 -7
- package/dist/Field/FieldInput.cjs +14 -16
- package/dist/Field/FieldInput.js +104 -72
- package/dist/Field/FieldLabel.cjs +6 -3
- package/dist/Field/FieldLabel.js +43 -25
- package/dist/FocusTrap/FocusTrap.cjs +1 -1
- package/dist/FocusTrap/FocusTrap.js +34 -38
- package/dist/IconButton/IconButton.cjs +4 -4
- package/dist/IconButton/IconButton.js +32 -30
- package/dist/JSONInput/JSONInput.cjs +1 -1
- package/dist/JSONInput/JSONInput.js +29 -27
- package/dist/Layout/HeaderLayout.cjs +2 -2
- package/dist/Layout/HeaderLayout.js +3 -3
- package/dist/MainNav/NavSection.cjs +1 -1
- package/dist/MainNav/NavSection.js +33 -13
- package/dist/MainNav/NavSections.cjs +2 -2
- package/dist/MainNav/NavSections.js +20 -10
- package/dist/ModalLayout/ModalLayout.cjs +1 -1
- package/dist/ModalLayout/ModalLayout.js +1 -1
- package/dist/NumberInput/NumberInput.cjs +2 -2
- package/dist/NumberInput/NumberInput.js +32 -32
- package/dist/Popover/Popover.cjs +3 -3
- package/dist/Popover/Popover.js +1 -1
- package/dist/RawTable/RawCell.cjs +1 -1
- package/dist/RawTable/RawCell.js +64 -67
- package/dist/RawTable/RawTable.cjs +1 -1
- package/dist/RawTable/RawTable.js +39 -37
- package/dist/RawTable/RawTbody.cjs +1 -1
- package/dist/RawTable/RawTbody.js +14 -11
- package/dist/RawTable/RawThead.cjs +1 -1
- package/dist/RawTable/RawThead.js +13 -8
- package/dist/RawTable/RawTr.cjs +1 -1
- package/dist/RawTable/RawTr.js +20 -13
- package/dist/Searchbar/Searchbar.cjs +2 -2
- package/dist/Searchbar/Searchbar.js +7 -6
- package/dist/Select/Select.cjs +2 -2
- package/dist/Select/Select.js +66 -65
- package/dist/Select/SelectButton.cjs +3 -3
- package/dist/Select/SelectButton.js +17 -15
- package/dist/Select/SelectList.cjs +1 -1
- package/dist/Select/SelectList.js +10 -8
- package/dist/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/SubNav/SubNavHeader.cjs +2 -2
- package/dist/SubNav/SubNavHeader.js +2 -2
- package/dist/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/SubNav/SubNavLinkSection.js +1 -1
- package/dist/SubNav/SubNavSection.cjs +2 -2
- package/dist/SubNav/SubNavSection.js +7 -7
- package/dist/SubNav/SubNavSections.cjs +1 -1
- package/dist/SubNav/SubNavSections.js +17 -7
- package/dist/Tabs/TabGroup.cjs +1 -1
- package/dist/Tabs/TabGroup.js +1 -1
- package/dist/Tag/Tag.cjs +8 -8
- package/dist/Tag/Tag.js +52 -49
- package/dist/TextButton/TextButton.cjs +6 -12
- package/dist/TextButton/TextButton.js +32 -46
- package/dist/TextInput/TextInput.cjs +1 -1
- package/dist/TextInput/TextInput.js +48 -47
- package/dist/Textarea/Textarea.cjs +2 -2
- package/dist/Textarea/Textarea.js +12 -13
- package/dist/Textarea/TextareaInput.cjs +4 -4
- package/dist/Textarea/TextareaInput.js +13 -12
- package/dist/TimePicker/TimePicker.cjs +5 -7
- package/dist/TimePicker/TimePicker.js +48 -100
- package/dist/ToggleCheckbox/ToggleCheckbox.cjs +2 -2
- package/dist/ToggleCheckbox/ToggleCheckbox.js +1 -0
- package/dist/ToggleInput/ToggleInput.cjs +3 -3
- package/dist/ToggleInput/ToggleInput.js +28 -29
- package/dist/Tooltip/Tooltip.cjs +1 -1
- package/dist/Tooltip/Tooltip.js +1 -1
- package/dist/helpers/deprecations.cjs +1 -1
- package/dist/helpers/deprecations.js +7 -7
- package/dist/helpers/useElementOnScreen.cjs +1 -1
- package/dist/helpers/useElementOnScreen.js +4 -13
- package/dist/helpers/useId.cjs +1 -1
- package/dist/helpers/useId.js +4 -11
- package/dist/helpers/useIntersection.cjs +1 -1
- package/dist/helpers/useIntersection.js +4 -21
- package/dist/helpers/useLockScroll.cjs +1 -1
- package/dist/helpers/useLockScroll.js +4 -7
- package/dist/helpers/usePrevious.cjs +1 -1
- package/dist/helpers/usePrevious.js +4 -8
- package/dist/helpers/useResizeObserver.cjs +1 -1
- package/dist/helpers/useResizeObserver.js +4 -14
- package/dist/hooks/useElementOnScreen.cjs +1 -0
- package/dist/hooks/useElementOnScreen.js +15 -0
- package/dist/hooks/useIntersection.cjs +1 -1
- package/dist/hooks/useIntersection.js +3 -3
- package/dist/hooks/useLockScroll.cjs +1 -0
- package/dist/hooks/useLockScroll.js +9 -0
- package/dist/hooks/usePrevious.cjs +1 -0
- package/dist/hooks/usePrevious.js +10 -0
- package/dist/hooks/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/v2/MainNav/NavSection.cjs +1 -1
- package/dist/v2/MainNav/NavSection.js +33 -13
- package/dist/v2/MainNav/NavSections.cjs +2 -2
- package/dist/v2/MainNav/NavSections.js +20 -10
- package/dist/v2/SimpleMenu/SimpleMenu.cjs +1 -1
- package/dist/v2/SimpleMenu/SimpleMenu.js +1 -1
- package/dist/v2/SubNav/SubNavHeader.cjs +2 -2
- package/dist/v2/SubNav/SubNavHeader.js +2 -2
- package/dist/v2/SubNav/SubNavLinkSection.cjs +3 -3
- package/dist/v2/SubNav/SubNavLinkSection.js +1 -1
- package/dist/v2/SubNav/SubNavSection.cjs +2 -2
- package/dist/v2/SubNav/SubNavSection.js +10 -10
- package/dist/v2/SubNav/SubNavSections.cjs +1 -1
- package/dist/v2/SubNav/SubNavSections.js +17 -7
- package/package.json +5 -3
- package/dist/DateTimePicker/DateTimePickerProps.cjs +0 -1
- package/dist/DateTimePicker/DateTimePickerProps.js +0 -40
- package/dist/DateTimePicker/__tests__/parseDate.test.cjs +0 -1
- package/dist/DateTimePicker/__tests__/parseDate.test.js +0 -8
- package/dist/DateTimePicker/parseDate.cjs +0 -1
- package/dist/DateTimePicker/parseDate.js +0 -7
- package/dist/Select/SingleSelect.cjs +0 -82
- package/dist/Select/SingleSelect.js +0 -285
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const o = "[@strapi/design-system]:", c = (
|
|
2
|
-
const e =
|
|
3
|
-
let
|
|
1
|
+
const o = "[@strapi/design-system]:", c = (n) => {
|
|
2
|
+
const e = n;
|
|
3
|
+
let t = !1;
|
|
4
4
|
if (typeof e != "function")
|
|
5
5
|
throw new TypeError(`${o} once requires a function parameter`);
|
|
6
|
-
return (...
|
|
7
|
-
|
|
6
|
+
return (...r) => {
|
|
7
|
+
t || (e(...r), t = !0);
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
o as PREFIX,
|
|
12
|
+
c as once
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./deprecations.cjs"),s=require("../hooks/useElementOnScreen.cjs"),r=e.once(console.warn),t=(...n)=>(r(`${e.PREFIX} useElementOnScreen has moved. Please import it from "@strapi/design-system/hooks/useElementOnScreen"`),s.useElementOnScreen(...n));exports.useElementOnScreen=t;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
c(n.isIntersecting);
|
|
5
|
-
};
|
|
6
|
-
return l(() => {
|
|
7
|
-
const n = e.current, r = new IntersectionObserver(i, t);
|
|
8
|
-
return n && r.observe(e.current), () => {
|
|
9
|
-
n && r.disconnect();
|
|
10
|
-
};
|
|
11
|
-
}, [e, t]), [e, s];
|
|
12
|
-
};
|
|
1
|
+
import { once as n, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import { useElementOnScreen as s } from "../hooks/useElementOnScreen.js";
|
|
3
|
+
const t = n(console.warn), c = (...e) => (t(`${r} useElementOnScreen has moved. Please import it from "@strapi/design-system/hooks/useElementOnScreen"`), s(...e));
|
|
13
4
|
export {
|
|
14
|
-
|
|
5
|
+
c as useElementOnScreen
|
|
15
6
|
};
|
package/dist/helpers/useId.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./deprecations.cjs"),o=require("../hooks/useId.cjs"),r=e.once(console.warn),t=(...s)=>(r(`${e.PREFIX} useId has moved. Please import it from "@strapi/design-system/hooks/useId"`),o.useId(...s));exports.useId=t;
|
package/dist/helpers/useId.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
});
|
|
4
|
-
let d = 0;
|
|
5
|
-
const S = (t) => {
|
|
6
|
-
const [e, o] = n(c());
|
|
7
|
-
return r(() => {
|
|
8
|
-
t || o((u) => u ?? String(d++));
|
|
9
|
-
}, [t]), t?.toString() ?? (e || "");
|
|
10
|
-
};
|
|
1
|
+
import { once as s, PREFIX as o } from "./deprecations.js";
|
|
2
|
+
import { useId as r } from "../hooks/useId.js";
|
|
3
|
+
const t = s(console.warn), n = (...e) => (t(`${o} useId has moved. Please import it from "@strapi/design-system/hooks/useId"`), r(...e));
|
|
11
4
|
export {
|
|
12
|
-
|
|
5
|
+
n as useId
|
|
13
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./deprecations.cjs"),t=require("../hooks/useIntersection.cjs"),n=e.once(console.warn),o=(...s)=>(n(`${e.PREFIX} useIntersection has moved. Please import it from "@strapi/design-system/hooks/useIntersection"`),t.useIntersection(...s));exports.useIntersection=o;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const e = p(s);
|
|
5
|
-
m(() => {
|
|
6
|
-
if (r)
|
|
7
|
-
return;
|
|
8
|
-
const u = {
|
|
9
|
-
root: t.current,
|
|
10
|
-
rootMargin: "0px"
|
|
11
|
-
}, f = (g) => {
|
|
12
|
-
g.forEach((i) => {
|
|
13
|
-
i.isIntersecting && t.current.scrollHeight > t.current.clientHeight && e(i);
|
|
14
|
-
});
|
|
15
|
-
}, o = new IntersectionObserver(f, u), c = t.current.querySelector(n);
|
|
16
|
-
return c && o.observe(c), () => {
|
|
17
|
-
o.disconnect();
|
|
18
|
-
};
|
|
19
|
-
}, [r, e, n, t]);
|
|
20
|
-
};
|
|
1
|
+
import { once as s, PREFIX as t } from "./deprecations.js";
|
|
2
|
+
import { useIntersection as o } from "../hooks/useIntersection.js";
|
|
3
|
+
const n = s(console.warn), c = (...e) => (n(`${t} useIntersection has moved. Please import it from "@strapi/design-system/hooks/useIntersection"`), o(...e));
|
|
21
4
|
export {
|
|
22
|
-
|
|
5
|
+
c as useIntersection
|
|
23
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("./deprecations.cjs"),s=require("../hooks/useLockScroll.cjs"),c=o.once(console.warn),r=(...e)=>(c(`${o.PREFIX} useLockScroll has moved. Please import it from "@strapi/design-system/hooks/useLockScroll"`),s(...e));module.exports=r;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
document.body.classList.remove("lock-body-scroll");
|
|
5
|
-
}), [o]);
|
|
6
|
-
};
|
|
1
|
+
import { once as e, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import s from "../hooks/useLockScroll.js";
|
|
3
|
+
const c = e(console.warn), a = (...o) => (c(`${r} useLockScroll has moved. Please import it from "@strapi/design-system/hooks/useLockScroll"`), s(...o));
|
|
7
4
|
export {
|
|
8
|
-
|
|
5
|
+
a as default
|
|
9
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./deprecations.cjs"),o=require("../hooks/usePrevious.cjs"),r=e.once(console.warn),u=(...s)=>(r(`${e.PREFIX} usePrevious has moved. Please import it from "@strapi/design-system/hooks/usePrevious"`),o.usePrevious(...s));exports.usePrevious=u;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return u(() => {
|
|
5
|
-
e.current = r;
|
|
6
|
-
}), e.current;
|
|
7
|
-
};
|
|
1
|
+
import { once as s, PREFIX as o } from "./deprecations.js";
|
|
2
|
+
import { usePrevious as r } from "../hooks/usePrevious.js";
|
|
3
|
+
const i = s(console.warn), m = (...e) => (i(`${o} usePrevious has moved. Please import it from "@strapi/design-system/hooks/usePrevious"`), r(...e));
|
|
8
4
|
export {
|
|
9
|
-
|
|
5
|
+
m as usePrevious
|
|
10
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./deprecations.cjs"),r=require("../hooks/useResizeObserver.cjs"),o=e.once(console.warn),i=(...s)=>(o(`${e.PREFIX} useResizeObserver has moved. Please import it from "@strapi/design-system/hooks/useResizeObserver"`),r.useResizeObserver(...s));exports.useResizeObserver=i;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const t = s(i);
|
|
5
|
-
f(() => {
|
|
6
|
-
const r = new ResizeObserver(t);
|
|
7
|
-
return Array.isArray(e) ? e.forEach((n) => {
|
|
8
|
-
n.current && r.observe(n.current);
|
|
9
|
-
}) : e.current && r.observe(e.current), () => {
|
|
10
|
-
r.disconnect();
|
|
11
|
-
};
|
|
12
|
-
}, [e, t]);
|
|
13
|
-
};
|
|
1
|
+
import { once as s, PREFIX as r } from "./deprecations.js";
|
|
2
|
+
import { useResizeObserver as o } from "../hooks/useResizeObserver.js";
|
|
3
|
+
const i = s(console.warn), n = (...e) => (i(`${r} useResizeObserver has moved. Please import it from "@strapi/design-system/hooks/useResizeObserver"`), o(...e));
|
|
14
4
|
export {
|
|
15
|
-
|
|
5
|
+
n as useResizeObserver
|
|
16
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),o=r=>{const e=n.useRef(null),[c,u]=n.useState(!0),i=([t])=>{u(t.isIntersecting)};return n.useEffect(()=>{const t=e.current,s=new IntersectionObserver(i,r);return t&&s.observe(e.current),()=>{t&&s.disconnect()}},[e,r]),[e,c]};exports.useElementOnScreen=o;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRef as o, useState as u, useEffect as l } from "react";
|
|
2
|
+
const b = (t) => {
|
|
3
|
+
const e = o(null), [s, c] = u(!0), i = ([n]) => {
|
|
4
|
+
c(n.isIntersecting);
|
|
5
|
+
};
|
|
6
|
+
return l(() => {
|
|
7
|
+
const n = e.current, r = new IntersectionObserver(i, t);
|
|
8
|
+
return n && r.observe(e.current), () => {
|
|
9
|
+
n && r.disconnect();
|
|
10
|
+
};
|
|
11
|
+
}, [e, t]), [e, s];
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
b as useElementOnScreen
|
|
15
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),d=require("@radix-ui/react-use-callback-ref"),v=(e,i,{selectorToWatch:t,skipWhen:r=!1})=>{const n=d.useCallbackRef(i);g.useEffect(()=>{if(r
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),d=require("@radix-ui/react-use-callback-ref"),v=(e,i,{selectorToWatch:t,skipWhen:r=!1})=>{const n=d.useCallbackRef(i);g.useEffect(()=>{if(r)return;const u={root:e.current,rootMargin:"0px"},a=f=>{f.forEach(s=>{s.isIntersecting&&e.current.scrollHeight>e.current.clientHeight&&n(s)})},c=new IntersectionObserver(a,u),o=e.current.querySelector(t);return o&&c.observe(o),()=>{c.disconnect()}},[r,n,t,e])};exports.useIntersection=v;
|
|
@@ -3,20 +3,20 @@ import { useCallbackRef as p } from "@radix-ui/react-use-callback-ref";
|
|
|
3
3
|
const E = (t, s, { selectorToWatch: n, skipWhen: r = !1 }) => {
|
|
4
4
|
const e = p(s);
|
|
5
5
|
m(() => {
|
|
6
|
-
if (r
|
|
6
|
+
if (r)
|
|
7
7
|
return;
|
|
8
8
|
const u = {
|
|
9
9
|
root: t.current,
|
|
10
10
|
rootMargin: "0px"
|
|
11
11
|
}, f = (g) => {
|
|
12
12
|
g.forEach((i) => {
|
|
13
|
-
i.isIntersecting && t.current
|
|
13
|
+
i.isIntersecting && t.current.scrollHeight > t.current.clientHeight && e(i);
|
|
14
14
|
});
|
|
15
15
|
}, o = new IntersectionObserver(f, u), c = t.current.querySelector(n);
|
|
16
16
|
return c && o.observe(c), () => {
|
|
17
17
|
o.disconnect();
|
|
18
18
|
};
|
|
19
|
-
}, [r, e, n]);
|
|
19
|
+
}, [r, e, n, t]);
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
22
|
E as useIntersection
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("react"),e=s=>{c.useEffect(()=>(s&&document.body.classList.add("lock-body-scroll"),()=>{document.body.classList.remove("lock-body-scroll")}),[s])};module.exports=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),u=t=>{const e=r.useRef();return r.useEffect(()=>{e.current=t}),e.current};exports.usePrevious=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),i=require("@radix-ui/react-use-callback-ref"),n=(e,a)=>{const t=i.useCallbackRef(a);c.useLayoutEffect(()=>{const r=new ResizeObserver(t);return Array.isArray(e)?e.forEach(s=>{s.current&&r.observe(s.current)}):e.current&&r.observe(e.current),()=>{r.disconnect()}},[e,t])};exports.useResizeObserver=n;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useLayoutEffect as f } from "react";
|
|
2
|
+
import { useCallbackRef as s } from "@radix-ui/react-use-callback-ref";
|
|
3
|
+
const c = (e, i) => {
|
|
4
|
+
const t = s(i);
|
|
5
|
+
f(() => {
|
|
6
|
+
const r = new ResizeObserver(t);
|
|
7
|
+
return Array.isArray(e) ? e.forEach((n) => {
|
|
8
|
+
n.current && r.observe(n.current);
|
|
9
|
+
}) : e.current && r.observe(e.current), () => {
|
|
10
|
+
r.disconnect();
|
|
11
|
+
};
|
|
12
|
+
}, [e, t]);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
c as useResizeObserver
|
|
16
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react"),g=require("prop-types"),f=require("./MainNavContext.cjs"),s=require("../../Box/Box.cjs"),y=require("../../Divider/Divider.cjs"),n=require("../../Flex/Flex.cjs"),x=require("../../Typography/Typography.cjs"),v=require("../../VisuallyHidden/VisuallyHidden.cjs"),p=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=p(i),o=p(g),m=({label:t,children:d,horizontal:a=!1,spacing:u=2,...c})=>f.useMainNav()?e.default.createElement(n.Flex,{direction:"column",alignItems:"stretch",gap:2},e.default.createElement(s.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",hasRadius:!0,as:"span"},e.default.createElement(y.Divider,null),e.default.createElement(v.VisuallyHidden,null,e.default.createElement("span",null,t))),e.default.createElement(n.Flex,{as:"ul",gap:u,direction:a?"row":"column",alignItems:a?"center":"stretch",...c},i.Children.map(d,(r,l)=>e.default.createElement("li",{key:l},r)))):e.default.createElement(n.Flex,{direction:"column",alignItems:"stretch",gap:2},e.default.createElement(s.Box,{paddingTop:1,paddingBottom:1,background:"neutral0",paddingRight:3,paddingLeft:3,hasRadius:!0,as:"span"},e.default.createElement(x.Typography,{variant:"sigma",textColor:"neutral600"},t)),e.default.createElement(n.Flex,{as:"ul",gap:u,direction:a?"row":"column",alignItems:a?"center":"stretch",...c},i.Children.map(d,(r,l)=>e.default.createElement("li",{key:l},r))));m.propTypes={children:o.default.node.isRequired,label:o.default.string.isRequired};exports.NavSection=m;
|
|
@@ -1,16 +1,36 @@
|
|
|
1
|
-
import e, { Children as
|
|
2
|
-
import
|
|
3
|
-
import { useMainNav as
|
|
4
|
-
import { Box as
|
|
5
|
-
import { Divider as
|
|
6
|
-
import {
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { VisuallyHidden as
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import e, { Children as c } from "react";
|
|
2
|
+
import d from "prop-types";
|
|
3
|
+
import { useMainNav as s } from "./MainNavContext.js";
|
|
4
|
+
import { Box as p } from "../../Box/Box.js";
|
|
5
|
+
import { Divider as u } from "../../Divider/Divider.js";
|
|
6
|
+
import { Flex as r } from "../../Flex/Flex.js";
|
|
7
|
+
import { Typography as g } from "../../Typography/Typography.js";
|
|
8
|
+
import { VisuallyHidden as f } from "../../VisuallyHidden/VisuallyHidden.js";
|
|
9
|
+
const E = ({ label: i, children: m, horizontal: t = !1, spacing: o = 2, ...l }) => s() ? /* @__PURE__ */ e.createElement(r, { direction: "column", alignItems: "stretch", gap: 2 }, /* @__PURE__ */ e.createElement(p, { paddingTop: 1, paddingBottom: 1, background: "neutral0", hasRadius: !0, as: "span" }, /* @__PURE__ */ e.createElement(u, null), /* @__PURE__ */ e.createElement(f, null, /* @__PURE__ */ e.createElement("span", null, i))), /* @__PURE__ */ e.createElement(
|
|
10
|
+
r,
|
|
11
|
+
{
|
|
12
|
+
as: "ul",
|
|
13
|
+
gap: o,
|
|
14
|
+
direction: t ? "row" : "column",
|
|
15
|
+
alignItems: t ? "center" : "stretch",
|
|
16
|
+
...l
|
|
17
|
+
},
|
|
18
|
+
c.map(m, (n, a) => /* @__PURE__ */ e.createElement("li", { key: a }, n))
|
|
19
|
+
)) : /* @__PURE__ */ e.createElement(r, { direction: "column", alignItems: "stretch", gap: 2 }, /* @__PURE__ */ e.createElement(p, { paddingTop: 1, paddingBottom: 1, background: "neutral0", paddingRight: 3, paddingLeft: 3, hasRadius: !0, as: "span" }, /* @__PURE__ */ e.createElement(g, { variant: "sigma", textColor: "neutral600" }, i)), /* @__PURE__ */ e.createElement(
|
|
20
|
+
r,
|
|
21
|
+
{
|
|
22
|
+
as: "ul",
|
|
23
|
+
gap: o,
|
|
24
|
+
direction: t ? "row" : "column",
|
|
25
|
+
alignItems: t ? "center" : "stretch",
|
|
26
|
+
...l
|
|
27
|
+
},
|
|
28
|
+
c.map(m, (n, a) => /* @__PURE__ */ e.createElement("li", { key: a }, n))
|
|
29
|
+
));
|
|
30
|
+
E.propTypes = {
|
|
31
|
+
children: d.node.isRequired,
|
|
32
|
+
label: d.string.isRequired
|
|
13
33
|
};
|
|
14
34
|
export {
|
|
15
|
-
|
|
35
|
+
E as NavSection
|
|
16
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),u=require("prop-types"),i=require("styled-components"),p=require("../../Box/Box.cjs"),f=require("../../Flex/Flex.cjs"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=o(l),y=o(u),g=o(i),x=g.default(p.Box)`
|
|
2
2
|
flex-grow: 1;
|
|
3
3
|
overflow-y: auto;
|
|
4
|
-
`,
|
|
4
|
+
`,n=({children:e,spacing:a=4,horizontal:r=!1,...s})=>t.default.createElement(x,{paddingLeft:3,paddingRight:2,paddingTop:3,paddingBottom:8},t.default.createElement(f.Flex,{as:"ul",gap:a,direction:r?"row":"column",alignItems:r?"center":"stretch",...s},l.Children.map(e,(c,d)=>t.default.createElement("li",{key:d},c))));n.propTypes={children:y.default.node.isRequired};exports.NavSections=n;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import e, { Children as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Box as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
1
|
+
import e, { Children as m } from "react";
|
|
2
|
+
import a from "prop-types";
|
|
3
|
+
import d from "styled-components";
|
|
4
|
+
import { Box as l } from "../../Box/Box.js";
|
|
5
|
+
import { Flex as c } from "../../Flex/Flex.js";
|
|
6
|
+
const s = d(l)`
|
|
7
7
|
flex-grow: 1;
|
|
8
8
|
overflow-y: auto;
|
|
9
|
-
`,
|
|
10
|
-
c
|
|
11
|
-
|
|
9
|
+
`, f = ({ children: t, spacing: o = 4, horizontal: r = !1, ...i }) => /* @__PURE__ */ e.createElement(s, { paddingLeft: 3, paddingRight: 2, paddingTop: 3, paddingBottom: 8 }, /* @__PURE__ */ e.createElement(
|
|
10
|
+
c,
|
|
11
|
+
{
|
|
12
|
+
as: "ul",
|
|
13
|
+
gap: o,
|
|
14
|
+
direction: r ? "row" : "column",
|
|
15
|
+
alignItems: r ? "center" : "stretch",
|
|
16
|
+
...i
|
|
17
|
+
},
|
|
18
|
+
m.map(t, (n, p) => /* @__PURE__ */ e.createElement("li", { key: p }, n))
|
|
19
|
+
));
|
|
20
|
+
f.propTypes = {
|
|
21
|
+
children: a.node.isRequired
|
|
12
22
|
};
|
|
13
23
|
export {
|
|
14
|
-
|
|
24
|
+
f as NavSections
|
|
15
25
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),D=require("@radix-ui/react-use-callback-ref"),z=require("@strapi/icons"),U=require("prop-types"),H=require("styled-components"),T=require("./utils.cjs"),G=require("../../BaseLink/BaseLink.cjs"),k=require("../../Box/Box.cjs"),M=require("../../Button/Button.cjs"),J=require("../../Flex/Flex.cjs"),u=require("../../helpers/keyboardKeys.cjs"),Q=require("../../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react"),D=require("@radix-ui/react-use-callback-ref"),z=require("@strapi/icons"),U=require("prop-types"),H=require("styled-components"),T=require("./utils.cjs"),G=require("../../BaseLink/BaseLink.cjs"),k=require("../../Box/Box.cjs"),M=require("../../Button/Button.cjs"),J=require("../../Flex/Flex.cjs"),u=require("../../helpers/keyboardKeys.cjs"),Q=require("../../hooks/useId.cjs"),j=require("../../Popover/Popover.cjs"),C=require("../../Typography/Typography.cjs"),X=require("../Link/Link.cjs"),q=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},o=q(a),t=q(U),y=q(H),Y=y.default.button`
|
|
2
2
|
border: none;
|
|
3
3
|
padding: 0;
|
|
4
4
|
background: transparent;
|
|
@@ -9,7 +9,7 @@ import { Box as g } from "../../Box/Box.js";
|
|
|
9
9
|
import { Button as K } from "../../Button/Button.js";
|
|
10
10
|
import { Flex as G } from "../../Flex/Flex.js";
|
|
11
11
|
import { KeyboardKeys as a } from "../../helpers/keyboardKeys.js";
|
|
12
|
-
import { useId as J } from "../../
|
|
12
|
+
import { useId as J } from "../../hooks/useId.js";
|
|
13
13
|
import { POPOVER_PLACEMENTS as Q, Popover as X } from "../../Popover/Popover.js";
|
|
14
14
|
import { Typography as O } from "../../Typography/Typography.js";
|
|
15
15
|
import { Link as Y } from "../Link/Link.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("@strapi/icons"),I=require("prop-types"),R=require("styled-components"),s=require("../../Box/Box.cjs"),_=require("../../Divider/Divider.cjs"),D=require("../../Flex/Flex.cjs"),P=require("../../helpers/keyboardKeys.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),C=require("@strapi/icons"),I=require("prop-types"),R=require("styled-components"),s=require("../../Box/Box.cjs"),_=require("../../Divider/Divider.cjs"),D=require("../../Flex/Flex.cjs"),P=require("../../helpers/keyboardKeys.cjs"),k=require("../../hooks/useId.cjs"),F=require("../../hooks/usePrevious.cjs"),K=require("../../IconButton/IconButton.cjs"),L=require("../../Searchbar/Searchbar.cjs"),w=require("../../Searchbar/SearchForm.cjs"),O=require("../../Typography/Typography.cjs"),d=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},e=d(o),r=d(I),H=d(R),h=H.default(_.Divider)`
|
|
2
2
|
width: ${24/16}rem;
|
|
3
3
|
background-color: ${({theme:t})=>t.colors.neutral200};
|
|
4
|
-
`,i=({as:t,label:g,searchLabel:f,searchable:y,onChange:b,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,l]=o.useState(!1),p=
|
|
4
|
+
`,i=({as:t,label:g,searchLabel:f,searchable:y,onChange:b,value:m,onClear:S,onSubmit:v,id:B})=>{const[n,l]=o.useState(!1),p=F.usePrevious(n),q=k.useId(B),c=o.useRef(),u=o.useRef();o.useEffect(()=>{n&&c.current&&c.current.focus(),p&&!n&&u.current&&u.current.focus()},[n,p]);const E=()=>{l(a=>!a)},j=a=>{S(a),c.current.focus()},T=a=>{a.relatedTarget?.id!==q&&l(!1)},x=a=>{a.key===P.KeyboardKeys.ESCAPE&&l(!1)};return n?e.default.createElement(s.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4},e.default.createElement(w.SearchForm,null,e.default.createElement(L.Searchbar,{name:"searchbar",value:m,onChange:b,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:x,ref:c,onBlur:T,onClear:j,onSubmit:v,clearLabel:"Clear",size:"S"},f)),e.default.createElement(s.Box,{paddingLeft:2,paddingTop:4},e.default.createElement(h,null))):e.default.createElement(s.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4},e.default.createElement(D.Flex,{justifyContent:"space-between",alignItems:"flex-start"},e.default.createElement(O.Typography,{variant:"beta",as:t},g),y&&e.default.createElement(K.IconButton,{ref:u,onClick:E,label:f,icon:e.default.createElement(C.Search,null)})),e.default.createElement(s.Box,{paddingTop:4},e.default.createElement(h,null)))};i.defaultProps={as:"h2",searchable:!1,onChange(){},onClear(){},onSubmit(){},value:"",searchLabel:"",id:void 0};i.propTypes={as:r.default.string,id:r.default.string,label:r.default.string.isRequired,onChange:r.default.func,onClear:r.default.func,onSubmit:r.default.func,searchLabel:r.default.string,searchable:r.default.bool,value:r.default.string};exports.SubNavHeader=i;
|
|
@@ -6,8 +6,8 @@ import { Box as n } from "../../Box/Box.js";
|
|
|
6
6
|
import { Divider as I } from "../../Divider/Divider.js";
|
|
7
7
|
import { Flex as K } from "../../Flex/Flex.js";
|
|
8
8
|
import { KeyboardKeys as P } from "../../helpers/keyboardKeys.js";
|
|
9
|
-
import { useId as k } from "../../
|
|
10
|
-
import { usePrevious as O } from "../../
|
|
9
|
+
import { useId as k } from "../../hooks/useId.js";
|
|
10
|
+
import { usePrevious as O } from "../../hooks/usePrevious.js";
|
|
11
11
|
import { IconButton as F } from "../../IconButton/IconButton.js";
|
|
12
12
|
import { Searchbar as _ } from "../../Searchbar/Searchbar.js";
|
|
13
13
|
import { SearchForm as $ } from "../../Searchbar/SearchForm.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),m=require("@strapi/icons"),h=require("prop-types"),x=require("styled-components"),l=require("../../Box/Box.cjs"),b=require("../../Flex/Flex.cjs"),S=require("../../
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),m=require("@strapi/icons"),h=require("prop-types"),x=require("styled-components"),l=require("../../Box/Box.cjs"),b=require("../../Flex/Flex.cjs"),S=require("../../hooks/useId.cjs"),k=require("../../Typography/Typography.cjs"),d=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=d(o),r=d(h),i=d(x),q=i.default(l.Box)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${4/16}rem;
|
|
4
4
|
path {
|
|
5
5
|
fill: ${({theme:e})=>e.colors.neutral700};
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,
|
|
8
|
+
`,E=i.default.button`
|
|
9
9
|
border: none;
|
|
10
10
|
padding: 0;
|
|
11
11
|
background: transparent;
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
align-items: center;
|
|
17
17
|
width: ${12/16}rem;
|
|
18
18
|
transform: rotateX(${({rotated:e})=>e?"0deg":"180deg"});
|
|
19
|
-
`,s=({label:e,children:c,id:p})=>{const[n,f]=o.useState(!0),u=S.useId(p),g=()=>{f(a=>!a)};return t.default.createElement(l.Box,null,t.default.createElement(
|
|
19
|
+
`,s=({label:e,children:c,id:p})=>{const[n,f]=o.useState(!0),u=S.useId(p),g=()=>{f(a=>!a)};return t.default.createElement(l.Box,null,t.default.createElement(q,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4},t.default.createElement(b.Flex,{justifyContent:"space-between"},t.default.createElement(E,{onClick:g,"aria-expanded":n,"aria-controls":u},t.default.createElement(v,{rotated:n},t.default.createElement(m.CarretDown,{"aria-hidden":!0})),t.default.createElement(l.Box,{paddingLeft:2},t.default.createElement(k.Typography,{as:"span",fontWeight:"semiBold",textColor:"neutral800"},e))))),n&&t.default.createElement("ul",{id:u},o.Children.map(c,(a,y)=>t.default.createElement("li",{key:y},a))))};s.defaultProps={id:void 0};s.propTypes={children:r.default.node.isRequired,id:r.default.string,label:r.default.string.isRequired};exports.SubNavLinkSection=s;
|
|
@@ -4,7 +4,7 @@ import o from "prop-types";
|
|
|
4
4
|
import a from "styled-components";
|
|
5
5
|
import { Box as i } from "../../Box/Box.js";
|
|
6
6
|
import { Flex as E } from "../../Flex/Flex.js";
|
|
7
|
-
import { useId as y } from "../../
|
|
7
|
+
import { useId as y } from "../../hooks/useId.js";
|
|
8
8
|
import { Typography as b } from "../../Typography/Typography.js";
|
|
9
9
|
const k = a(i)`
|
|
10
10
|
svg {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),S=require("prop-types"),h=require("styled-components"),v=require("./SubNavSectionLabel.cjs"),x=require("../../Badge/Badge.cjs"),u=require("../../Box/Box.cjs"),y=require("../../Flex/Flex.cjs"),q=require("../../hooks/useId.cjs"),r=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=r(n),a=r(S),B=r(h),_=B.default(u.Box)`
|
|
2
2
|
svg {
|
|
3
3
|
height: ${4/16}rem;
|
|
4
4
|
path {
|
|
5
5
|
fill: ${({theme:e})=>e.colors.neutral500};
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
`,s=({collapsable:e,label:c,badgeLabel:
|
|
8
|
+
`,s=({collapsable:e,label:c,badgeLabel:l,children:p,id:f})=>{const[i,g]=n.useState(!0),d=q.useId(f),b=()=>{g(o=>!o)};return t.default.createElement(y.Flex,{direction:"column",alignItems:"stretch",gap:1},t.default.createElement(_,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4},t.default.createElement(u.Box,{position:"relative",paddingRight:l?6:0},t.default.createElement(v.SubNavSectionLabel,{onClick:b,ariaExpanded:i,ariaControls:d,collapsable:e,label:c}),l&&t.default.createElement(x.Badge,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)"},l))),(!e||i)&&t.default.createElement("ol",{id:d},n.Children.map(p,(o,m)=>t.default.createElement("li",{key:m},o))))};s.defaultProps={badgeLabel:null,collapsable:!1,id:void 0};s.propTypes={badgeLabel:a.default.string,children:a.default.node.isRequired,collapsable:a.default.bool,id:a.default.string,label:a.default.string.isRequired};exports.SubNavSection=s;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import e, { useState as f, Children as
|
|
1
|
+
import e, { useState as f, Children as h } from "react";
|
|
2
2
|
import t from "prop-types";
|
|
3
|
-
import
|
|
3
|
+
import b from "styled-components";
|
|
4
4
|
import { SubNavSectionLabel as E } from "./SubNavSectionLabel.js";
|
|
5
5
|
import { Badge as S } from "../../Badge/Badge.js";
|
|
6
6
|
import { Box as l } from "../../Box/Box.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
const
|
|
7
|
+
import { Flex as v } from "../../Flex/Flex.js";
|
|
8
|
+
import { useId as C } from "../../hooks/useId.js";
|
|
9
|
+
const k = b(l)`
|
|
10
10
|
svg {
|
|
11
11
|
height: ${4 / 16}rem;
|
|
12
12
|
path {
|
|
@@ -14,15 +14,15 @@ const C = h(l)`
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
`, p = ({ collapsable: r, label: s, badgeLabel: o, children: d, id: m }) => {
|
|
17
|
-
const [
|
|
17
|
+
const [n, c] = f(!0), a = C(m), u = () => {
|
|
18
18
|
c((i) => !i);
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */ e.createElement(v, {
|
|
20
|
+
return /* @__PURE__ */ e.createElement(v, { direction: "column", alignItems: "stretch", gap: 1 }, /* @__PURE__ */ e.createElement(k, { paddingLeft: 6, paddingTop: 2, paddingBottom: 2, paddingRight: 4 }, /* @__PURE__ */ e.createElement(l, { position: "relative", paddingRight: o ? 6 : 0 }, /* @__PURE__ */ e.createElement(
|
|
21
21
|
E,
|
|
22
22
|
{
|
|
23
23
|
onClick: u,
|
|
24
|
-
ariaExpanded:
|
|
25
|
-
ariaControls:
|
|
24
|
+
ariaExpanded: n,
|
|
25
|
+
ariaControls: a,
|
|
26
26
|
collapsable: r,
|
|
27
27
|
label: s
|
|
28
28
|
}
|
|
@@ -37,7 +37,7 @@ const C = h(l)`
|
|
|
37
37
|
transform: "translateY(-50%)"
|
|
38
38
|
},
|
|
39
39
|
o
|
|
40
|
-
))), (!r ||
|
|
40
|
+
))), (!r || n) && /* @__PURE__ */ e.createElement("ol", { id: a }, h.map(d, (i, g) => /* @__PURE__ */ e.createElement("li", { key: g }, i))));
|
|
41
41
|
};
|
|
42
42
|
p.defaultProps = {
|
|
43
43
|
badgeLabel: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react"),i=require("prop-types"),d=require("../../Box/Box.cjs"),p=require("../../Flex/Flex.cjs"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},t=a(r),f=a(i),c=({children:e,spacing:l=2,horizontal:o=!1,...n})=>t.default.createElement(d.Box,{paddingTop:2,paddingBottom:4},t.default.createElement(p.Flex,{as:"ol",gap:l,direction:o?"row":"column",alignItems:o?"center":"stretch",...n},r.Children.map(e,(s,u)=>t.default.createElement("li",{key:u},s))));c.propTypes={children:f.default.node.isRequired};exports.SubNavSections=c;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import e, { Children as i } from "react";
|
|
2
|
-
import
|
|
3
|
-
import { Box as
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import a from "prop-types";
|
|
3
|
+
import { Box as c } from "../../Box/Box.js";
|
|
4
|
+
import { Flex as l } from "../../Flex/Flex.js";
|
|
5
|
+
const d = ({ children: t, spacing: o = 2, horizontal: r = !1, ...m }) => /* @__PURE__ */ e.createElement(c, { paddingTop: 2, paddingBottom: 4 }, /* @__PURE__ */ e.createElement(
|
|
6
|
+
l,
|
|
7
|
+
{
|
|
8
|
+
as: "ol",
|
|
9
|
+
gap: o,
|
|
10
|
+
direction: r ? "row" : "column",
|
|
11
|
+
alignItems: r ? "center" : "stretch",
|
|
12
|
+
...m
|
|
13
|
+
},
|
|
14
|
+
i.map(t, (n, p) => /* @__PURE__ */ e.createElement("li", { key: p }, n))
|
|
15
|
+
));
|
|
16
|
+
d.propTypes = {
|
|
17
|
+
children: a.node.isRequired
|
|
8
18
|
};
|
|
9
19
|
export {
|
|
10
|
-
|
|
20
|
+
d as SubNavSections
|
|
11
21
|
};
|