@strapi/design-system 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/Button/Button.cjs +2 -2
  2. package/dist/Button/Button.js +4 -4
  3. package/dist/Combobox/Combobox.cjs +3 -3
  4. package/dist/Combobox/Combobox.js +16 -16
  5. package/dist/DatePicker/DatePicker.cjs +14 -14
  6. package/dist/DatePicker/DatePicker.js +257 -223
  7. package/dist/DateTimePicker/DateTimePicker.cjs +3 -3
  8. package/dist/DateTimePicker/DateTimePicker.js +69 -63
  9. package/dist/Grid/Grid.cjs +3 -3
  10. package/dist/Grid/Grid.js +6 -3
  11. package/dist/MainNav/MainNav.cjs +2 -2
  12. package/dist/MainNav/MainNav.js +9 -31
  13. package/dist/MainNav/MainNavContext.cjs +1 -1
  14. package/dist/MainNav/MainNavContext.js +1 -1
  15. package/dist/MainNav/NavBrand.cjs +3 -3
  16. package/dist/MainNav/NavBrand.js +12 -38
  17. package/dist/MainNav/NavCondense.cjs +2 -2
  18. package/dist/MainNav/NavCondense.js +15 -23
  19. package/dist/MainNav/NavFooter.cjs +1 -1
  20. package/dist/MainNav/NavFooter.js +4 -10
  21. package/dist/MainNav/NavLink.cjs +9 -9
  22. package/dist/MainNav/NavLink.js +13 -35
  23. package/dist/MainNav/NavSection.cjs +1 -1
  24. package/dist/MainNav/NavSection.js +9 -43
  25. package/dist/MainNav/NavSections.cjs +2 -2
  26. package/dist/MainNav/NavSections.js +7 -21
  27. package/dist/MainNav/NavUser.cjs +2 -2
  28. package/dist/MainNav/NavUser.js +13 -27
  29. package/dist/Popover/Popover.cjs +3 -3
  30. package/dist/Popover/Popover.js +52 -51
  31. package/dist/Select/MultiSelect.cjs +5 -5
  32. package/dist/Select/MultiSelect.js +41 -41
  33. package/dist/Select/SingleSelect.cjs +1 -1
  34. package/dist/Select/SingleSelect.js +32 -32
  35. package/dist/SimpleMenu/SimpleMenu.cjs +9 -9
  36. package/dist/SimpleMenu/SimpleMenu.js +62 -151
  37. package/dist/SubNav/SubNav.cjs +5 -5
  38. package/dist/SubNav/SubNav.js +8 -13
  39. package/dist/SubNav/SubNavHeader.cjs +3 -3
  40. package/dist/SubNav/SubNavHeader.js +29 -76
  41. package/dist/SubNav/SubNavLink.cjs +13 -13
  42. package/dist/SubNav/SubNavLink.js +20 -52
  43. package/dist/SubNav/SubNavLinkSection.cjs +4 -4
  44. package/dist/SubNav/SubNavLinkSection.js +19 -35
  45. package/dist/SubNav/SubNavSection.cjs +2 -2
  46. package/dist/SubNav/SubNavSection.js +15 -55
  47. package/dist/SubNav/SubNavSectionLabel.cjs +3 -3
  48. package/dist/SubNav/SubNavSectionLabel.js +10 -38
  49. package/dist/SubNav/SubNavSections.cjs +1 -1
  50. package/dist/SubNav/SubNavSections.js +4 -18
  51. package/dist/ToggleInput/ToggleInput.cjs +20 -4
  52. package/dist/ToggleInput/ToggleInput.js +43 -18
  53. package/dist/Typography/Typography.cjs +1 -1
  54. package/dist/Typography/Typography.js +6 -6
  55. package/dist/Typography/utils.cjs +1 -1
  56. package/dist/Typography/utils.js +4 -5
  57. package/dist/v2/Breadcrumbs/Breadcrumbs.cjs +2 -2
  58. package/dist/v2/Breadcrumbs/Breadcrumbs.js +15 -23
  59. package/dist/v2/Breadcrumbs/Crumb.cjs +1 -1
  60. package/dist/v2/Breadcrumbs/Crumb.js +6 -25
  61. package/dist/v2/Breadcrumbs/CrumbLink.cjs +2 -2
  62. package/dist/v2/Breadcrumbs/CrumbLink.js +6 -15
  63. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.cjs +4 -3
  64. package/dist/v2/Breadcrumbs/CrumbSimpleMenu.js +8 -14
  65. package/dist/v2/Breadcrumbs/Divider.cjs +1 -1
  66. package/dist/v2/Breadcrumbs/Divider.js +3 -4
  67. package/dist/v2/SimpleMenu/Menu.cjs +10 -10
  68. package/dist/v2/SimpleMenu/Menu.js +11 -11
  69. package/package.json +15 -15
@@ -1,44 +1,44 @@
1
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
- import { Item as j, ItemText as q, Root as W, Trigger as _, Value as H, Portal as M, Content as P, Viewport as z } from "./SelectParts.js";
4
- import { stripReactIdOfColon as A } from "../helpers/strings.js";
3
+ import { Item as q, ItemText as W, Root as _, Trigger as H, Value as M, Portal as P, Content as z, Viewport as A } from "./SelectParts.js";
4
+ import { stripReactIdOfColon as D } from "../helpers/strings.js";
5
5
  import { useId as R } from "../hooks/useId.js";
6
- import { useIntersection as D } from "../hooks/useIntersection.js";
6
+ import { useIntersection as G } from "../hooks/useIntersection.js";
7
7
  import { Box as x } from "../Box/Box.js";
8
- import { Typography as G } from "../Typography/Typography.js";
9
- import { Field as J } from "../Field/Field.js";
10
- import { Flex as K } from "../Flex/Flex.js";
11
- import { FieldLabel as Q } from "../Field/FieldLabel.js";
12
- import { FieldHint as U } from "../Field/FieldHint.js";
13
- import { FieldError as X } from "../Field/FieldError.js";
14
- const pe = ({ error: r, hint: i, id: c, label: n, labelAction: o, required: f, selectButtonTitle: m, ...d }) => {
15
- const l = R(c), a = u.useRef(null);
16
- return e(J, { hint: i, error: r, id: l, required: f, children: p(K, { direction: "column", alignItems: "stretch", gap: 1, children: [e(Q, { onClick: () => {
17
- a.current.focus();
18
- }, action: o, children: n }), e(Y, { label: n, id: l, triggerRef: a, required: f, ...d }), e(U, {}), e(X, {})] }) });
19
- }, Y = ({ id: r, children: i, clearLabel: c = "Clear", customizeContent: n, disabled: o, error: f, label: m, onChange: d, onClear: l, onReachEnd: a, placeholder: g, required: C, selectButtonTitle: Z, startIcon: B, size: O = "M", value: h, triggerRef: T, ...F }) => {
20
- const [$, I] = u.useState(), [y, k] = u.useState(!1), w = (t) => {
21
- k(t);
22
- }, L = (t) => {
23
- l && l(t), d || I("");
24
- }, v = `${r}-hint`, E = `${r}-error`, N = (t) => {
25
- d ? d(typeof h == "number" ? Number(t) : t) : I(t);
26
- }, b = u.useRef(null), V = R(), S = `intersection-${A(V)}`;
27
- D(b, (t) => {
28
- a && a(t);
8
+ import { Typography as J } from "../Typography/Typography.js";
9
+ import { Field as K } from "../Field/Field.js";
10
+ import { Flex as Q } from "../Flex/Flex.js";
11
+ import { FieldLabel as U } from "../Field/FieldLabel.js";
12
+ import { FieldHint as X } from "../Field/FieldHint.js";
13
+ import { FieldError as Y } from "../Field/FieldError.js";
14
+ const me = ({ error: c, hint: t, id: d, label: n, labelAction: i, required: a, selectButtonTitle: g, ...p }) => {
15
+ const o = R(d), l = u.useRef(null);
16
+ return e(K, { hint: t, error: c, id: o, required: a, children: h(Q, { direction: "column", alignItems: "stretch", gap: 1, children: [n ? e(U, { onClick: () => {
17
+ l.current.focus();
18
+ }, action: i, children: n }) : null, e(Z, { label: n, id: o, triggerRef: l, required: a, ...p }), e(X, {}), e(Y, {})] }) });
19
+ }, Z = ({ "aria-label": c, id: t, children: d, clearLabel: n = "Clear", customizeContent: i, disabled: a, error: g, label: p, onChange: o, onClear: l, onReachEnd: m, placeholder: C, required: B, selectButtonTitle: ee, startIcon: O, size: T = "M", value: f, triggerRef: F, ...$ }) => {
20
+ const [y, I] = u.useState(), [k, w] = u.useState(!1), L = (r) => {
21
+ w(r);
22
+ }, v = (r) => {
23
+ l && l(r), o || I("");
24
+ }, E = `${t}-hint`, N = `${t}-error`, V = (r) => {
25
+ o ? o(typeof f == "number" ? Number(r) : r) : I(r);
26
+ }, b = u.useRef(null), j = R(), S = `intersection-${D(j)}`;
27
+ G(b, (r) => {
28
+ m && m(r);
29
29
  }, {
30
30
  selectorToWatch: `#${S}`,
31
31
  /**
32
32
  * We need to know when the select is open because only then will viewportRef
33
33
  * not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
34
34
  */
35
- skipWhen: !y
35
+ skipWhen: !k
36
36
  });
37
- const s = (typeof h < "u" && h !== null ? h.toString() : $) ?? "";
38
- return p(W, { onOpenChange: w, disabled: o, required: C, onValueChange: N, value: s, ...F, children: [e(_, { ref: T, "aria-label": m, "aria-describedby": r ? `${v} ${E}` : void 0, id: r, startIcon: B, size: O, hasError: !!f, disabled: o, clearLabel: c, onClear: s && l ? L : void 0, children: e(H, { placeholder: g, textColor: s ? "neutral800" : "neutral600", children: s && n ? n(s) : void 0 }) }), e(M, { children: e(P, { position: "popper", sideOffset: 4, children: p(z, { ref: b, children: [i, e(x, { id: S, width: "100%", height: "1px" })] }) }) })] });
39
- }, me = u.forwardRef(({ value: r, startIcon: i, children: c, ...n }, o) => p(j, { ref: o, value: r.toString(), ...n, children: [i && e(x, { as: "span", "aria-hidden": !0, children: i }), e(G, { textColor: "neutral800", children: e(q, { children: c }) })] }));
37
+ const s = (typeof f < "u" && f !== null ? f.toString() : y) ?? "";
38
+ return h(_, { onOpenChange: L, disabled: a, required: B, onValueChange: V, value: s, ...$, children: [e(H, { ref: F, "aria-label": p ?? c, "aria-describedby": t ? `${E} ${N}` : void 0, id: t, startIcon: O, size: T, hasError: !!g, disabled: a, clearLabel: n, onClear: s && l ? v : void 0, children: e(M, { placeholder: C, textColor: s ? "neutral800" : "neutral600", children: s && i ? i(s) : void 0 }) }), e(P, { children: e(z, { position: "popper", sideOffset: 4, children: h(A, { ref: b, children: [d, e(x, { id: S, width: "100%", height: "1px" })] }) }) })] });
39
+ }, ge = u.forwardRef(({ value: c, startIcon: t, children: d, ...n }, i) => h(q, { ref: i, value: c.toString(), ...n, children: [t && e(x, { as: "span", "aria-hidden": !0, children: t }), e(J, { textColor: "neutral800", children: e(W, { children: d }) })] }));
40
40
  export {
41
- pe as SingleSelect,
42
- Y as SingleSelectInput,
43
- me as SingleSelectOption
41
+ me as SingleSelect,
42
+ Z as SingleSelectInput,
43
+ ge as SingleSelectOption
44
44
  };
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),H=require("@strapi/icons"),M=require("@strapi/ui-primitives"),U=require("prop-types"),G=require("react-router-dom"),J=require("styled-components"),C=require("./utils.cjs"),i=require("../helpers/keyboardKeys.cjs"),Q=require("../hooks/useId.cjs"),X=require("../Link/Link.cjs"),w=require("../Button/Button.cjs"),_=require("../Popover/Popover.cjs"),b=require("../Box/Box.cjs"),q=require("../Typography/Typography.cjs"),Y=require("../Flex/Flex.cjs"),O=e=>e&&e.__esModule?e:{default:e},B=O(r),n=O(U),h=O(J),Z=h.default.button`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),r=require("react"),N=require("@strapi/icons"),C=require("@strapi/ui-primitives"),F=require("react-router-dom"),W=require("styled-components"),R=require("./utils.cjs"),s=require("../helpers/keyboardKeys.cjs"),H=require("../hooks/useId.cjs"),U=require("../Link/Link.cjs"),M=require("../Button/Button.cjs"),z=require("../Popover/Popover.cjs"),E=require("../Box/Box.cjs"),D=require("../Typography/Typography.cjs"),G=require("../Flex/Flex.cjs"),w=e=>e&&e.__esModule?e:{default:e},K=w(r),m=w(W),J=m.default.button`
2
2
  border: none;
3
3
  padding: 0;
4
4
  background: transparent;
5
5
  cursor: pointer;
6
- ${C.getOptionStyle}
7
- `,ee=h.default(G.NavLink)`
6
+ ${R.getOptionStyle}
7
+ `,Q=m.default(F.NavLink)`
8
8
  text-decoration: none;
9
- ${C.getOptionStyle}
10
- `,ne=h.default(X.Link)`
9
+ ${R.getOptionStyle}
10
+ `,X=m.default(U.Link)`
11
11
  /* Removing Link hover effect */
12
12
  &:hover {
13
13
  color: currentColor;
@@ -22,14 +22,14 @@
22
22
  }
23
23
  }
24
24
 
25
- ${C.getOptionStyle}
26
- `,te=h.default.span`
25
+ ${R.getOptionStyle}
26
+ `,Y=m.default.span`
27
27
  display: flex;
28
28
  align-items: center;
29
29
  svg {
30
30
  height: 4px;
31
31
  width: 6px;
32
32
  }
33
- `,oe=h.default(w.Button)`
33
+ `,Z=m.default(M.Button)`
34
34
  padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
35
- `,S=({children:e,onClick:g,to:u,isFocused:a,href:d,...R})=>{const l=r.useRef();r.useEffect(()=>{a&&l.current&&l.current.focus()},[a]);const c={tabIndex:a?0:-1,ref:l,role:"menuitem",...R},f=v=>{(v.key===i.KeyboardKeys.SPACE||v.key===i.KeyboardKeys.ENTER)&&g()};return u&&!d?o.jsx(ee,{to:u,...c,children:o.jsx(b.Box,{padding:2,children:o.jsx(q.Typography,{children:e})})}):d&&!u?o.jsx(ne,{isExternal:!0,href:d,...c,children:o.jsx(b.Box,{padding:2,children:o.jsx(q.Typography,{children:e})})}):o.jsx(Z,{onKeyDown:f,onMouseDown:g,type:"button",...c,children:o.jsx(b.Box,{padding:2,children:o.jsx(q.Typography,{children:e})})})};S.defaultProps={as:void 0,href:void 0,isFocused:!1,onClick(){},to:void 0};S.propTypes={as:n.default.elementType,children:n.default.node.isRequired,href:n.default.string,isFocused:n.default.bool,onClick:n.default.func,to:n.default.string};const x=({label:e,children:g,id:u,as:a,onOpen:d=()=>{},onClose:R=()=>{},size:l,popoverPlacement:c,onReachEnd:f,...v})=>{const p=r.useRef(),k=Q.useId(u),K=r.useRef(!1),[y,m]=r.useState(!1),[P,j]=r.useState(0),E=r.Children.toArray(g),L=l==="S"?oe:w.Button,$=a||L,T=!!f&&typeof f=="function";r.useEffect(()=>{if(["string","number"].includes(typeof e)){const t=E.findIndex(s=>s.props.children===e);t!==-1&&j(t)}},[e]);const I=M.useCallbackRef(d),D=M.useCallbackRef(R);r.useEffect(()=>{K?.current?y?I():D():K.current=!0},[K,D,I,y]),r.useEffect(()=>{B.default.isValidElement(e)&&P===-1&&p.current.focus()},[e,P]);const A=t=>{y&&(t.key===i.KeyboardKeys.ESCAPE&&(t.stopPropagation(),m(!1),p.current.focus()),t.key===i.KeyboardKeys.DOWN&&j(s=>s===E.length-1?0:s+1),t.key===i.KeyboardKeys.UP&&j(s=>s===0?E.length-1:s-1))},N=t=>{(t.key===i.KeyboardKeys.ENTER||t.key===i.KeyboardKeys.SPACE)&&m(s=>!s)},F=t=>{t.preventDefault(),t.currentTarget.contains(t.relatedTarget)||m(!1)},V=t=>{t.preventDefault(),m(s=>!s)},W=()=>{T&&f()},z=E.map((t,s)=>o.jsx(Y.Flex,{as:"li",justifyContent:"center",role:"menuitem",children:r.cloneElement(t,{onClick(){t.props.onClick(),m(!1),p.current.focus()},isFocused:P===s})},s));return o.jsxs("div",{onKeyDown:A,children:[o.jsx($,{label:B.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":y,"aria-controls":k,onKeyDown:N,onMouseDown:V,ref:p,type:"button",variant:"ghost",endIcon:o.jsx(te,{children:o.jsx(H.CarretDown,{"aria-hidden":!0})}),...v,children:e}),y&&o.jsx(_.Popover,{onBlur:F,placement:c,source:p,onReachEnd:W,intersectionId:T?`popover-${k}`:void 0,spacing:4,children:o.jsx(b.Box,{role:"menu",as:"ul",padding:1,id:k,children:z})})]})};x.defaultProps={as:void 0};x.displayName="SimpleMenu";x.defaultProps={id:void 0,onOpen:void 0,onClose:void 0,onReachEnd:void 0,popoverPlacement:"bottom-start",size:"M"};x.propTypes={as:n.default.any,children:n.default.oneOfType([n.default.arrayOf(n.default.node),n.default.node]).isRequired,id:n.default.string,label:n.default.oneOfType([n.default.string,n.default.number,n.default.element]).isRequired,onClose:n.default.func,onOpen:n.default.func,onReachEnd:n.default.func,popoverPlacement:n.default.oneOf(_.POPOVER_PLACEMENTS),size:n.default.oneOf(["S","M"])};exports.MenuItem=S;exports.SimpleMenu=x;
35
+ `,ee=({children:e,onClick:h=()=>{},to:i,isFocused:u=!1,href:c,...j})=>{const a=r.useRef();r.useEffect(()=>{u&&a.current&&a.current.focus()},[u]);const l={tabIndex:u?0:-1,ref:a,role:"menuitem",...j},d=x=>{(x.key===s.KeyboardKeys.SPACE||x.key===s.KeyboardKeys.ENTER)&&h()};return i&&!c?o.jsx(Q,{to:i,...l,children:o.jsx(E.Box,{padding:2,children:o.jsx(D.Typography,{children:e})})}):c&&!i?o.jsx(X,{isExternal:!0,href:c,...l,children:o.jsx(E.Box,{padding:2,children:o.jsx(D.Typography,{children:e})})}):o.jsx(J,{onKeyDown:d,onMouseDown:h,type:"button",...l,children:o.jsx(E.Box,{padding:2,children:o.jsx(D.Typography,{children:e})})})},ne=({label:e,children:h,id:i,as:u,onOpen:c=()=>{},onClose:j=()=>{},size:a="M",popoverPlacement:l="bottom-start",onReachEnd:d,...x})=>{const f=r.useRef(void 0),k=H.useId(i),b=r.useRef(!1),[p,y]=r.useState(!1),[I,v]=r.useState(0),g=r.Children.toArray(h),P=a==="S"?Z:M.Button,T=u||P,q=!!d&&typeof d=="function";r.useEffect(()=>{if(["string","number"].includes(typeof e)){const n=g.findIndex(t=>K.default.isValidElement(t)&&t.props.children===e||t===e);n!==-1&&v(n)}},[e]);const S=C.useCallbackRef(c),B=C.useCallbackRef(j);r.useEffect(()=>{b?.current?p?S():B():b.current=!0},[b,B,S,p]),r.useEffect(()=>{K.default.isValidElement(e)&&I===-1&&f.current.focus()},[e,I]);const O=n=>{p&&(n.key===s.KeyboardKeys.ESCAPE&&(n.stopPropagation(),y(!1),f.current.focus()),n.key===s.KeyboardKeys.DOWN&&v(t=>t===g.length-1?0:t+1),n.key===s.KeyboardKeys.UP&&v(t=>t===0?g.length-1:t-1))},$=n=>{(n.key===s.KeyboardKeys.ENTER||n.key===s.KeyboardKeys.SPACE)&&y(t=>!t)},L=n=>{n.preventDefault(),n.currentTarget.contains(n.relatedTarget)||y(!1)},_=n=>{n.preventDefault(),y(t=>!t)},A=()=>{q&&d()},V=g.map((n,t)=>o.jsx(G.Flex,{as:"li",justifyContent:"center",role:"menuitem",children:K.default.isValidElement(n)?r.cloneElement(n,{onClick(){n.props.onClick(),y(!1),f.current.focus()},isFocused:I===t}):n},t));return o.jsxs("div",{onKeyDown:O,children:[o.jsx(T,{label:K.default.isValidElement(e)?null:e,"aria-haspopup":!0,"aria-expanded":p,"aria-controls":k,onKeyDown:$,onMouseDown:_,ref:f,type:"button",variant:"ghost",endIcon:o.jsx(Y,{children:o.jsx(N.CarretDown,{"aria-hidden":!0})}),...x,children:e}),p&&o.jsx(z.Popover,{onBlur:L,placement:l,source:f,onReachEnd:A,intersectionId:q?`popover-${k}`:void 0,spacing:4,children:o.jsx(E.Box,{role:"menu",as:"ul",padding:1,id:k,children:V})})]})};exports.MenuItem=ee;exports.SimpleMenu=ne;
@@ -1,29 +1,28 @@
1
- import { jsx as t, jsxs as z } from "react/jsx-runtime";
2
- import B, { useRef as T, useEffect as E, useState as K, Children as H, cloneElement as U } from "react";
3
- import { CarretDown as G } from "@strapi/icons";
4
- import { useCallbackRef as $ } from "@strapi/ui-primitives";
5
- import e from "prop-types";
6
- import { NavLink as J } from "react-router-dom";
7
- import y from "styled-components";
1
+ import { jsx as t, jsxs as F } from "react/jsx-runtime";
2
+ import x, { useRef as S, useEffect as E, useState as $, Children as _, cloneElement as H } from "react";
3
+ import { CarretDown as U } from "@strapi/icons";
4
+ import { useCallbackRef as P } from "@strapi/ui-primitives";
5
+ import { NavLink as q } from "react-router-dom";
6
+ import m from "styled-components";
8
7
  import { getOptionStyle as b } from "./utils.js";
9
- import { KeyboardKeys as i } from "../helpers/keyboardKeys.js";
10
- import { useId as Q } from "../hooks/useId.js";
11
- import { Link as X } from "../Link/Link.js";
8
+ import { KeyboardKeys as r } from "../helpers/keyboardKeys.js";
9
+ import { useId as z } from "../hooks/useId.js";
10
+ import { Link as G } from "../Link/Link.js";
12
11
  import { Button as L } from "../Button/Button.js";
13
- import { POPOVER_PLACEMENTS as Y, Popover as Z } from "../Popover/Popover.js";
14
- import { Box as C } from "../Box/Box.js";
15
- import { Typography as O } from "../Typography/Typography.js";
16
- import { Flex as ee } from "../Flex/Flex.js";
17
- const ne = y.button`
12
+ import { Popover as J } from "../Popover/Popover.js";
13
+ import { Box as k } from "../Box/Box.js";
14
+ import { Typography as R } from "../Typography/Typography.js";
15
+ import { Flex as Q } from "../Flex/Flex.js";
16
+ const X = m.button`
18
17
  border: none;
19
18
  padding: 0;
20
19
  background: transparent;
21
20
  cursor: pointer;
22
21
  ${b}
23
- `, oe = y(J)`
22
+ `, Y = m(q)`
24
23
  text-decoration: none;
25
24
  ${b}
26
- `, te = y(X)`
25
+ `, Z = m(G)`
27
26
  /* Removing Link hover effect */
28
27
  &:hover {
29
28
  color: currentColor;
@@ -31,7 +30,7 @@ const ne = y.button`
31
30
 
32
31
  &:focus-visible {
33
32
  /* Removing Link focus-visible after properties and reset to global outline */
34
- outline: 2px solid ${({ theme: o }) => o.colors.primary600};
33
+ outline: 2px solid ${({ theme: n }) => n.colors.primary600};
35
34
  outline-offset: 2px;
36
35
  &:after {
37
36
  content: none;
@@ -39,160 +38,72 @@ const ne = y.button`
39
38
  }
40
39
 
41
40
  ${b}
42
- `, re = y.span`
41
+ `, ee = m.span`
43
42
  display: flex;
44
43
  align-items: center;
45
44
  svg {
46
45
  height: 4px;
47
46
  width: 6px;
48
47
  }
49
- `, ie = y(L)`
50
- padding: ${({ theme: o }) => `${o.spaces[1]} ${o.spaces[3]}`};
51
- `, A = ({ children: o, onClick: h, to: s, isFocused: c, href: a, ...x }) => {
52
- const d = T();
48
+ `, ne = m(L)`
49
+ padding: ${({ theme: n }) => `${n.spaces[1]} ${n.spaces[3]}`};
50
+ `, xe = ({ children: n, onClick: h = () => {
51
+ }, to: i, isFocused: s = !1, href: c, ...D }) => {
52
+ const a = S();
53
53
  E(() => {
54
- c && d.current && d.current.focus();
55
- }, [c]);
54
+ s && a.current && a.current.focus();
55
+ }, [s]);
56
56
  const l = {
57
- tabIndex: c ? 0 : -1,
58
- ref: d,
57
+ tabIndex: s ? 0 : -1,
58
+ ref: a,
59
59
  role: "menuitem",
60
- ...x
61
- }, p = (g) => {
62
- (g.key === i.SPACE || g.key === i.ENTER) && h();
60
+ ...D
61
+ }, u = (y) => {
62
+ (y.key === r.SPACE || y.key === r.ENTER) && h();
63
63
  };
64
- return s && !a ? /* @__PURE__ */ t(oe, { to: s, ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) }) : a && !s ? /* @__PURE__ */ t(te, { isExternal: !0, href: a, ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) }) : /* @__PURE__ */ t(ne, { onKeyDown: p, onMouseDown: h, type: "button", ...l, children: /* @__PURE__ */ t(C, { padding: 2, children: /* @__PURE__ */ t(O, { children: o }) }) });
65
- };
66
- A.defaultProps = {
67
- as: void 0,
68
- href: void 0,
69
- isFocused: !1,
70
- onClick() {
71
- },
72
- to: void 0
73
- };
74
- A.propTypes = {
75
- as: e.elementType,
76
- children: e.node.isRequired,
77
- href: e.string,
78
- isFocused: e.bool,
79
- onClick: e.func,
80
- to: e.string
81
- };
82
- const k = ({
83
- label: o,
84
- children: h,
85
- id: s,
86
- as: c,
87
- onOpen: a = () => {
88
- },
89
- onClose: x = () => {
90
- },
91
- size: d,
92
- popoverPlacement: l,
93
- onReachEnd: p,
94
- ...g
95
- }) => {
96
- const u = T(), P = Q(s), R = T(!1), [f, m] = K(!1), [D, I] = K(0), v = H.toArray(h), N = c || (d === "S" ? ie : L), S = !!p && typeof p == "function";
64
+ return i && !c ? t(Y, { to: i, ...l, children: t(k, { padding: 2, children: t(R, { children: n }) }) }) : c && !i ? t(Z, { isExternal: !0, href: c, ...l, children: t(k, { padding: 2, children: t(R, { children: n }) }) }) : t(X, { onKeyDown: u, onMouseDown: h, type: "button", ...l, children: t(k, { padding: 2, children: t(R, { children: n }) }) });
65
+ }, Ee = ({ label: n, children: h, id: i, as: s, onOpen: c = () => {
66
+ }, onClose: D = () => {
67
+ }, size: a = "M", popoverPlacement: l = "bottom-start", onReachEnd: u, ...y }) => {
68
+ const d = S(void 0), I = z(i), C = S(!1), [f, p] = $(!1), [v, w] = $(0), g = _.toArray(h), O = s || (a === "S" ? ne : L), B = !!u && typeof u == "function";
97
69
  E(() => {
98
- if (["string", "number"].includes(typeof o)) {
99
- const n = v.findIndex((r) => r.props.children === o);
100
- n !== -1 && I(n);
70
+ if (["string", "number"].includes(typeof n)) {
71
+ const e = g.findIndex((o) => x.isValidElement(o) && o.props.children === n || o === n);
72
+ e !== -1 && w(e);
101
73
  }
102
- }, [o]);
103
- const w = $(a), M = $(x);
74
+ }, [n]);
75
+ const K = P(c), M = P(D);
104
76
  E(() => {
105
- R?.current ? f ? w() : M() : R.current = !0;
106
- }, [R, M, w, f]), E(() => {
107
- B.isValidElement(o) && D === -1 && u.current.focus();
108
- }, [o, D]);
109
- const F = (n) => {
110
- f && (n.key === i.ESCAPE && (n.stopPropagation(), m(!1), u.current.focus()), n.key === i.DOWN && I((r) => r === v.length - 1 ? 0 : r + 1), n.key === i.UP && I((r) => r === 0 ? v.length - 1 : r - 1));
111
- }, V = (n) => {
112
- (n.key === i.ENTER || n.key === i.SPACE) && m((r) => !r);
113
- }, j = (n) => {
114
- n.preventDefault(), n.currentTarget.contains(n.relatedTarget) || m(!1);
115
- }, q = (n) => {
116
- n.preventDefault(), m((r) => !r);
117
- }, W = () => {
118
- S && p();
119
- }, _ = v.map((n, r) => (
77
+ C?.current ? f ? K() : M() : C.current = !0;
78
+ }, [C, M, K, f]), E(() => {
79
+ x.isValidElement(n) && v === -1 && d.current.focus();
80
+ }, [n, v]);
81
+ const T = (e) => {
82
+ f && (e.key === r.ESCAPE && (e.stopPropagation(), p(!1), d.current.focus()), e.key === r.DOWN && w((o) => o === g.length - 1 ? 0 : o + 1), e.key === r.UP && w((o) => o === 0 ? g.length - 1 : o - 1));
83
+ }, A = (e) => {
84
+ (e.key === r.ENTER || e.key === r.SPACE) && p((o) => !o);
85
+ }, V = (e) => {
86
+ e.preventDefault(), e.currentTarget.contains(e.relatedTarget) || p(!1);
87
+ }, N = (e) => {
88
+ e.preventDefault(), p((o) => !o);
89
+ }, j = () => {
90
+ B && u();
91
+ }, W = g.map((e, o) => (
120
92
  // eslint-disable-next-line react/no-array-index-key
121
- /* @__PURE__ */ t(ee, { as: "li", justifyContent: "center", role: "menuitem", children: U(n, {
93
+ t(Q, { as: "li", justifyContent: "center", role: "menuitem", children: x.isValidElement(e) ? H(e, {
122
94
  onClick() {
123
- n.props.onClick(), m(!1), u.current.focus();
95
+ e.props.onClick(), p(!1), d.current.focus();
124
96
  },
125
- isFocused: D === r
126
- }) }, r)
97
+ isFocused: v === o
98
+ }) : e }, o)
127
99
  ));
128
100
  return (
129
101
  // TODO: review why we need to eslint it and how to solve this issue.
130
102
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
131
- /* @__PURE__ */ z("div", { onKeyDown: F, children: [
132
- /* @__PURE__ */ t(
133
- N,
134
- {
135
- label: B.isValidElement(o) ? null : o,
136
- "aria-haspopup": !0,
137
- "aria-expanded": f,
138
- "aria-controls": P,
139
- onKeyDown: V,
140
- onMouseDown: q,
141
- ref: u,
142
- type: "button",
143
- variant: "ghost",
144
- endIcon: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(G, { "aria-hidden": !0 }) }),
145
- ...g,
146
- children: o
147
- }
148
- ),
149
- f && /* @__PURE__ */ t(
150
- Z,
151
- {
152
- onBlur: j,
153
- placement: l,
154
- source: u,
155
- onReachEnd: W,
156
- intersectionId: S ? `popover-${P}` : void 0,
157
- spacing: 4,
158
- children: /* @__PURE__ */ t(C, { role: "menu", as: "ul", padding: 1, id: P, children: _ })
159
- }
160
- )
161
- ] })
103
+ F("div", { onKeyDown: T, children: [t(O, { label: x.isValidElement(n) ? null : n, "aria-haspopup": !0, "aria-expanded": f, "aria-controls": I, onKeyDown: A, onMouseDown: N, ref: d, type: "button", variant: "ghost", endIcon: t(ee, { children: t(U, { "aria-hidden": !0 }) }), ...y, children: n }), f && t(J, { onBlur: V, placement: l, source: d, onReachEnd: j, intersectionId: B ? `popover-${I}` : void 0, spacing: 4, children: t(k, { role: "menu", as: "ul", padding: 1, id: I, children: W }) })] })
162
104
  );
163
105
  };
164
- k.defaultProps = {
165
- as: void 0
166
- };
167
- k.displayName = "SimpleMenu";
168
- k.defaultProps = {
169
- id: void 0,
170
- onOpen: void 0,
171
- onClose: void 0,
172
- onReachEnd: void 0,
173
- popoverPlacement: "bottom-start",
174
- size: "M"
175
- };
176
- k.propTypes = {
177
- as: e.any,
178
- children: e.oneOfType([e.arrayOf(e.node), e.node]).isRequired,
179
- id: e.string,
180
- label: e.oneOfType([e.string, e.number, e.element]).isRequired,
181
- onClose: e.func,
182
- onOpen: e.func,
183
- /**
184
- * Callback function to be called when the popover reaches the end of the scrollable content
185
- */
186
- onReachEnd: e.func,
187
- popoverPlacement: e.oneOf(Y),
188
- /**
189
- * Size of the trigger button.
190
- * Note: in case a custom component is passed through the "as"
191
- * prop, the size prop is passed along too, but needs to be handled there
192
- */
193
- size: e.oneOf(["S", "M"])
194
- };
195
106
  export {
196
- A as MenuItem,
197
- k as SimpleMenu
107
+ xe as MenuItem,
108
+ Ee as SimpleMenu
198
109
  };
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("react");const u=require("prop-types"),a=require("styled-components"),n=require("../Grid/Grid.cjs"),t=e=>e&&e.__esModule?e:{default:e},l=t(u),d=t(a),r=`${232/16}rem`,c=d.default(n.Grid)`
2
- width: ${r};
3
- background: ${({theme:e})=>e.colors.neutral100};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("styled-components"),u=require("../Grid/Grid.cjs"),a=t=>t&&t.__esModule?t:{default:t},i=a(s),e=`${232/16}rem`,n=i.default(u.Grid)`
2
+ width: ${e};
3
+ background: ${({theme:t})=>t.colors.neutral100};
4
4
  position: sticky;
5
5
  top: 0;
6
6
  height: 100vh;
7
7
  overflow-y: auto;
8
- border-right: 1px solid ${({theme:e})=>e.colors.neutral200};
8
+ border-right: 1px solid ${({theme:t})=>t.colors.neutral200};
9
9
  z-index: 1;
10
- `,o=({ariaLabel:e,...s})=>i.jsx(c,{"aria-label":e,as:"nav",...s});o.propTypes={ariaLabel:l.default.string.isRequired};exports.SubNav=o;exports.subNavWidth=r;
10
+ `,l=({ariaLabel:t,...r})=>o.jsx(n,{"aria-label":t,as:"nav",...r});exports.SubNav=l;exports.subNavWidth=e;
@@ -1,22 +1,17 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import "react";
3
- import i from "prop-types";
4
- import e from "styled-components";
2
+ import i from "styled-components";
5
3
  import { Grid as a } from "../Grid/Grid.js";
6
- const p = `${232 / 16}rem`, s = e(a)`
7
- width: ${p};
8
- background: ${({ theme: r }) => r.colors.neutral100};
4
+ const e = `${232 / 16}rem`, s = i(a)`
5
+ width: ${e};
6
+ background: ${({ theme: o }) => o.colors.neutral100};
9
7
  position: sticky;
10
8
  top: 0;
11
9
  height: 100vh;
12
10
  overflow-y: auto;
13
- border-right: 1px solid ${({ theme: r }) => r.colors.neutral200};
11
+ border-right: 1px solid ${({ theme: o }) => o.colors.neutral200};
14
12
  z-index: 1;
15
- `, n = ({ ariaLabel: r, ...o }) => /* @__PURE__ */ t(s, { "aria-label": r, as: "nav", ...o });
16
- n.propTypes = {
17
- ariaLabel: i.string.isRequired
18
- };
13
+ `, d = ({ ariaLabel: o, ...r }) => t(s, { "aria-label": o, as: "nav", ...r });
19
14
  export {
20
- n as SubNav,
21
- p as subNavWidth
15
+ d as SubNav,
16
+ e as subNavWidth
22
17
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("react"),R=require("@strapi/icons"),P=require("prop-types"),_=require("styled-components"),D=require("../helpers/keyboardKeys.cjs"),I=require("../hooks/useId.cjs"),K=require("../hooks/usePrevious.cjs"),L=require("../Searchbar/SearchForm.cjs"),k=require("../Searchbar/Searchbar.cjs"),w=require("../Divider/Divider.cjs"),c=require("../Box/Box.cjs"),F=require("../Flex/Flex.cjs"),O=require("../Typography/Typography.cjs"),E=require("../IconButton/IconButton.cjs"),h=t=>t&&t.__esModule?t:{default:t},r=h(P),H=h(_),p=H.default(w.Divider)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),v=require("@strapi/icons"),C=require("styled-components"),R=require("../helpers/keyboardKeys.cjs"),T=require("../hooks/useId.cjs"),D=require("../hooks/usePrevious.cjs"),I=require("../Searchbar/SearchForm.cjs"),K=require("../Searchbar/Searchbar.cjs"),_=require("../Divider/Divider.cjs"),c=require("../Box/Box.cjs"),k=require("../Flex/Flex.cjs"),w=require("../Typography/Typography.cjs"),F=require("../IconButton/IconButton.cjs"),O=r=>r&&r.__esModule?r:{default:r},P=O(C),l=P.default(_.Divider)`
2
2
  width: ${24/16}rem;
3
- background-color: ${({theme:t})=>t.colors.neutral200};
4
- `,d=({as:t,label:g,searchLabel:l,searchable:b,onChange:x,value:y,onClear:S,onSubmit:q,id:j})=>{const[s,i]=o.useState(!1),f=K.usePrevious(s),v=I.useId(j),a=o.useRef(),u=o.useRef();o.useEffect(()=>{s&&a.current&&a.current.focus(),f&&!s&&u.current&&u.current.focus()},[s,f]);const B=()=>{i(n=>!n)},m=n=>{S(n),a.current.focus()},C=n=>{n.relatedTarget?.id!==v&&i(!1)},T=n=>{n.key===D.KeyboardKeys.ESCAPE&&i(!1)};return s?e.jsxs(c.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[e.jsx(L.SearchForm,{children:e.jsx(k.Searchbar,{name:"searchbar",value:y,onChange:x,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:T,ref:a,onBlur:C,onClear:m,onSubmit:q,clearLabel:"Clear",size:"S",children:l})}),e.jsx(c.Box,{paddingLeft:2,paddingTop:4,children:e.jsx(p,{})})]}):e.jsxs(c.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[e.jsxs(F.Flex,{justifyContent:"space-between",alignItems:"flex-start",children:[e.jsx(O.Typography,{variant:"beta",as:t,children:g}),b&&e.jsx(E.IconButton,{ref:u,onClick:B,label:l,icon:e.jsx(R.Search,{})})]}),e.jsx(c.Box,{paddingTop:4,children:e.jsx(p,{})})]})};d.defaultProps={as:"h2",searchable:!1,onChange(){},onClear(){},onSubmit(){},value:"",searchLabel:"",id:void 0};d.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=d;
3
+ background-color: ${({theme:r})=>r.colors.neutral200};
4
+ `,E=({as:r="h2",label:f,searchLabel:u="",searchable:h,onChange:p=()=>{},value:g="",onClear:x=()=>{},onSubmit:S=()=>{},id:y})=>{const[t,a]=s.useState(!1),d=D.usePrevious(t),b=T.useId(y),o=s.useRef(null),i=s.useRef(null);s.useEffect(()=>{t&&o.current&&o.current.focus(),d&&!t&&i.current&&i.current.focus()},[t,d]);const j=()=>{a(n=>!n)},q=n=>{x(n),o?.current&&o.current.focus()},B=n=>{n.relatedTarget?.id!==b&&a(!1)},m=n=>{n.key===R.KeyboardKeys.ESCAPE&&a(!1)};return t?e.jsxs(c.Box,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[e.jsx(I.SearchForm,{children:e.jsx(K.Searchbar,{name:"searchbar",value:g,onChange:p,placeholder:"e.g: strapi-plugin-abcd",onKeyDown:m,ref:o,onBlur:B,onClear:q,onSubmit:S,clearLabel:"Clear",size:"S",children:u})}),e.jsx(c.Box,{paddingLeft:2,paddingTop:4,children:e.jsx(l,{})})]}):e.jsxs(c.Box,{paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[e.jsxs(k.Flex,{justifyContent:"space-between",alignItems:"flex-start",children:[e.jsx(w.Typography,{variant:"beta",as:r,children:f}),h&&e.jsx(F.IconButton,{ref:i,onClick:j,label:u,icon:e.jsx(v.Search,{})})]}),e.jsx(c.Box,{paddingTop:4,children:e.jsx(l,{})})]})};exports.SubNavHeader=E;
@@ -1,86 +1,39 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { useState as w, useRef as f, useEffect as D } from "react";
3
- import { Search as I } from "@strapi/icons";
4
- import r from "prop-types";
5
- import K from "styled-components";
6
- import { KeyboardKeys as P } from "../helpers/keyboardKeys.js";
2
+ import { useState as R, useRef as p, useEffect as w } from "react";
3
+ import { Search as D } from "@strapi/icons";
4
+ import I from "styled-components";
5
+ import { KeyboardKeys as K } from "../helpers/keyboardKeys.js";
7
6
  import { useId as j } from "../hooks/useId.js";
8
7
  import { usePrevious as k } from "../hooks/usePrevious.js";
9
8
  import { SearchForm as E } from "../Searchbar/SearchForm.js";
10
- import { Searchbar as O } from "../Searchbar/Searchbar.js";
11
- import { Divider as F } from "../Divider/Divider.js";
12
- import { Box as a } from "../Box/Box.js";
13
- import { Flex as $ } from "../Flex/Flex.js";
14
- import { Typography as q } from "../Typography/Typography.js";
15
- import { IconButton as z } from "../IconButton/IconButton.js";
16
- const m = K(F)`
9
+ import { Searchbar as L } from "../Searchbar/Searchbar.js";
10
+ import { Divider as O } from "../Divider/Divider.js";
11
+ import { Box as n } from "../Box/Box.js";
12
+ import { Flex as F } from "../Flex/Flex.js";
13
+ import { Typography as P } from "../Typography/Typography.js";
14
+ import { IconButton as $ } from "../IconButton/IconButton.js";
15
+ const f = I(O)`
17
16
  width: ${24 / 16}rem;
18
17
  background-color: ${({ theme: i }) => i.colors.neutral200};
19
- `, u = ({ as: i, label: h, searchLabel: l, searchable: g, onChange: b, value: S, onClear: y, onSubmit: C, id: v }) => {
20
- const [n, s] = w(!1), p = k(n), B = j(v), t = f(), c = f();
21
- D(() => {
22
- n && t.current && t.current.focus(), p && !n && c.current && c.current.focus();
23
- }, [n, p]);
24
- const T = () => {
25
- s((o) => !o);
26
- }, x = (o) => {
27
- y(o), t.current.focus();
28
- }, R = (o) => {
29
- o.relatedTarget?.id !== B && s(!1);
30
- }, L = (o) => {
31
- o.key === P.ESCAPE && s(!1);
18
+ `, Z = ({ as: i = "h2", label: m, searchLabel: l = "", searchable: u, onChange: h = () => {
19
+ }, value: g = "", onClear: S = () => {
20
+ }, onSubmit: b = () => {
21
+ }, id: y }) => {
22
+ const [o, a] = R(!1), s = k(o), B = j(y), t = p(null), c = p(null);
23
+ w(() => {
24
+ o && t.current && t.current.focus(), s && !o && c.current && c.current.focus();
25
+ }, [o, s]);
26
+ const C = () => {
27
+ a((r) => !r);
28
+ }, v = (r) => {
29
+ S(r), t?.current && t.current.focus();
30
+ }, x = (r) => {
31
+ r.relatedTarget?.id !== B && a(!1);
32
+ }, T = (r) => {
33
+ r.key === K.ESCAPE && a(!1);
32
34
  };
33
- return n ? /* @__PURE__ */ d(a, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4, children: [
34
- /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
35
- O,
36
- {
37
- name: "searchbar",
38
- value: S,
39
- onChange: b,
40
- placeholder: "e.g: strapi-plugin-abcd",
41
- onKeyDown: L,
42
- ref: t,
43
- onBlur: R,
44
- onClear: x,
45
- onSubmit: C,
46
- clearLabel: "Clear",
47
- size: "S",
48
- children: l
49
- }
50
- ) }),
51
- /* @__PURE__ */ e(a, { paddingLeft: 2, paddingTop: 4, children: /* @__PURE__ */ e(m, {}) })
52
- ] }) : /* @__PURE__ */ d(a, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [
53
- /* @__PURE__ */ d($, { justifyContent: "space-between", alignItems: "flex-start", children: [
54
- /* @__PURE__ */ e(q, { variant: "beta", as: i, children: h }),
55
- g && /* @__PURE__ */ e(z, { ref: c, onClick: T, label: l, icon: /* @__PURE__ */ e(I, {}) })
56
- ] }),
57
- /* @__PURE__ */ e(a, { paddingTop: 4, children: /* @__PURE__ */ e(m, {}) })
58
- ] });
59
- };
60
- u.defaultProps = {
61
- as: "h2",
62
- searchable: !1,
63
- onChange() {
64
- },
65
- onClear() {
66
- },
67
- onSubmit() {
68
- },
69
- value: "",
70
- searchLabel: "",
71
- id: void 0
72
- };
73
- u.propTypes = {
74
- as: r.string,
75
- id: r.string,
76
- label: r.string.isRequired,
77
- onChange: r.func,
78
- onClear: r.func,
79
- onSubmit: r.func,
80
- searchLabel: r.string,
81
- searchable: r.bool,
82
- value: r.string
35
+ return o ? d(n, { paddingLeft: 4, paddingTop: 5, paddingBottom: 2, paddingRight: 4, children: [e(E, { children: e(L, { name: "searchbar", value: g, onChange: h, placeholder: "e.g: strapi-plugin-abcd", onKeyDown: T, ref: t, onBlur: x, onClear: v, onSubmit: b, clearLabel: "Clear", size: "S", children: l }) }), e(n, { paddingLeft: 2, paddingTop: 4, children: e(f, {}) })] }) : d(n, { paddingLeft: 6, paddingTop: 6, paddingBottom: 2, paddingRight: 4, children: [d(F, { justifyContent: "space-between", alignItems: "flex-start", children: [e(P, { variant: "beta", as: i, children: m }), u && e($, { ref: c, onClick: C, label: l, icon: e(D, {}) })] }), e(n, { paddingTop: 4, children: e(f, {}) })] });
83
36
  };
84
37
  export {
85
- u as SubNavHeader
38
+ Z as SubNavHeader
86
39
  };