@strapi/design-system 1.7.6 → 1.7.8

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 (143) hide show
  1. package/dist/BaseButton/BaseButton.cjs +3 -3
  2. package/dist/BaseButton/BaseButton.js +5 -5
  3. package/dist/Box/Box.cjs +2 -2
  4. package/dist/Box/Box.js +1 -1
  5. package/dist/CarouselInput/Carousel.cjs +6 -7
  6. package/dist/CarouselInput/Carousel.js +25 -79
  7. package/dist/CarouselInput/CarouselActions.cjs +1 -1
  8. package/dist/CarouselInput/CarouselActions.js +1 -14
  9. package/dist/CarouselInput/CarouselImage.cjs +3 -4
  10. package/dist/CarouselInput/CarouselImage.js +13 -23
  11. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  12. package/dist/CarouselInput/CarouselInput.js +12 -75
  13. package/dist/CarouselInput/CarouselSlide.cjs +1 -3
  14. package/dist/CarouselInput/CarouselSlide.js +4 -29
  15. package/dist/Checkbox/Checkbox.cjs +3 -3
  16. package/dist/Checkbox/Checkbox.js +18 -40
  17. package/dist/Dialog/Dialog.cjs +5 -5
  18. package/dist/Dialog/Dialog.js +21 -49
  19. package/dist/Dialog/DialogBody.cjs +2 -2
  20. package/dist/Dialog/DialogBody.js +6 -19
  21. package/dist/Dialog/DialogFooter.cjs +2 -2
  22. package/dist/Dialog/DialogFooter.js +7 -21
  23. package/dist/Grid/Grid.cjs +3 -3
  24. package/dist/Grid/Grid.js +8 -22
  25. package/dist/Grid/GridItem.cjs +2 -2
  26. package/dist/Grid/GridItem.js +10 -27
  27. package/dist/Layout/ActionLayout.cjs +1 -9
  28. package/dist/Layout/ActionLayout.js +4 -27
  29. package/dist/Layout/ContentLayout.cjs +1 -1
  30. package/dist/Layout/ContentLayout.js +4 -9
  31. package/dist/Layout/GridLayout.cjs +3 -3
  32. package/dist/Layout/GridLayout.js +4 -8
  33. package/dist/Layout/HeaderLayout.cjs +4 -4
  34. package/dist/Layout/HeaderLayout.js +25 -120
  35. package/dist/Layout/Layout.cjs +4 -4
  36. package/dist/Layout/Layout.js +7 -19
  37. package/dist/Layout/TwoColsLayout.cjs +1 -1
  38. package/dist/Layout/TwoColsLayout.js +6 -15
  39. package/dist/ModalLayout/ModalBody.cjs +2 -2
  40. package/dist/ModalLayout/ModalBody.js +4 -5
  41. package/dist/ModalLayout/ModalContext.cjs +1 -1
  42. package/dist/ModalLayout/ModalContext.js +2 -1
  43. package/dist/ModalLayout/ModalFooter.cjs +2 -6
  44. package/dist/ModalLayout/ModalFooter.js +9 -26
  45. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  46. package/dist/ModalLayout/ModalHeader.js +10 -22
  47. package/dist/ModalLayout/ModalLayout.cjs +3 -5
  48. package/dist/ModalLayout/ModalLayout.js +10 -30
  49. package/dist/NumberInput/NumberInput.cjs +2 -2
  50. package/dist/NumberInput/NumberInput.js +68 -168
  51. package/dist/Pagination/Pagination.cjs +1 -5
  52. package/dist/Pagination/Pagination.js +7 -21
  53. package/dist/Pagination/components.cjs +7 -10
  54. package/dist/Pagination/components.js +34 -81
  55. package/dist/Popover/Popover.cjs +3 -3
  56. package/dist/Popover/Popover.js +67 -66
  57. package/dist/ProgressBar/ProgressBar.cjs +5 -5
  58. package/dist/ProgressBar/ProgressBar.js +6 -37
  59. package/dist/Radio/Radio.cjs +1 -4
  60. package/dist/Radio/Radio.js +5 -18
  61. package/dist/Searchbar/SearchForm.cjs +1 -1
  62. package/dist/Searchbar/SearchForm.js +2 -3
  63. package/dist/Searchbar/Searchbar.cjs +10 -11
  64. package/dist/Searchbar/Searchbar.js +25 -54
  65. package/dist/Status/Status.cjs +6 -6
  66. package/dist/Status/Status.js +8 -46
  67. package/dist/Switch/Switch.cjs +5 -5
  68. package/dist/Switch/Switch.js +16 -52
  69. package/dist/Table/Cell.cjs +3 -3
  70. package/dist/Table/Cell.js +10 -23
  71. package/dist/Table/TFooter.cjs +3 -3
  72. package/dist/Table/TFooter.js +8 -20
  73. package/dist/Table/Table.cjs +12 -12
  74. package/dist/Table/Table.js +19 -31
  75. package/dist/Table/Tbody.cjs +2 -2
  76. package/dist/Table/Tbody.js +4 -5
  77. package/dist/Table/Thead.cjs +2 -2
  78. package/dist/Table/Thead.js +6 -7
  79. package/dist/Table/Tr.cjs +1 -1
  80. package/dist/Table/Tr.js +3 -4
  81. package/dist/Tabs/TabGroup.cjs +1 -1
  82. package/dist/Tabs/TabGroup.js +13 -37
  83. package/dist/Tabs/TabPanels.cjs +1 -1
  84. package/dist/Tabs/TabPanels.js +11 -22
  85. package/dist/Tabs/Tabs.cjs +2 -2
  86. package/dist/Tabs/Tabs.js +55 -110
  87. package/dist/Tabs/TabsContext.cjs +1 -1
  88. package/dist/Tabs/TabsContext.js +11 -4
  89. package/dist/Textarea/Textarea.cjs +14 -12
  90. package/dist/Textarea/Textarea.js +33 -55
  91. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
  92. package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
  93. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  94. package/dist/ToggleInput/ToggleInput.js +17 -70
  95. package/dist/Typography/Typography.cjs +1 -1
  96. package/dist/Typography/Typography.js +6 -6
  97. package/dist/hooks/useControllableState.cjs +1 -1
  98. package/dist/hooks/useControllableState.js +6 -6
  99. package/dist/themes/utils.cjs +2 -2
  100. package/dist/themes/utils.js +1 -1
  101. package/dist/v2/MainNav/MainNav.cjs +2 -2
  102. package/dist/v2/MainNav/MainNav.js +9 -31
  103. package/dist/v2/MainNav/MainNavContext.cjs +1 -1
  104. package/dist/v2/MainNav/MainNavContext.js +1 -1
  105. package/dist/v2/MainNav/NavBrand.cjs +3 -3
  106. package/dist/v2/MainNav/NavBrand.js +13 -36
  107. package/dist/v2/MainNav/NavCondense.cjs +2 -5
  108. package/dist/v2/MainNav/NavCondense.js +15 -22
  109. package/dist/v2/MainNav/NavFooter.cjs +1 -1
  110. package/dist/v2/MainNav/NavFooter.js +4 -10
  111. package/dist/v2/MainNav/NavLink.cjs +10 -10
  112. package/dist/v2/MainNav/NavLink.js +18 -39
  113. package/dist/v2/MainNav/NavSection.cjs +1 -1
  114. package/dist/v2/MainNav/NavSection.js +8 -42
  115. package/dist/v2/MainNav/NavSections.cjs +2 -2
  116. package/dist/v2/MainNav/NavSections.js +8 -22
  117. package/dist/v2/MainNav/NavUser.cjs +2 -2
  118. package/dist/v2/MainNav/NavUser.js +13 -27
  119. package/dist/v2/Pagination/Pagination.cjs +1 -5
  120. package/dist/v2/Pagination/Pagination.js +7 -21
  121. package/dist/v2/Pagination/components.cjs +7 -10
  122. package/dist/v2/Pagination/components.js +32 -65
  123. package/dist/v2/SubNav/SubNav.cjs +5 -5
  124. package/dist/v2/SubNav/SubNav.js +8 -13
  125. package/dist/v2/SubNav/SubNavHeader.cjs +3 -3
  126. package/dist/v2/SubNav/SubNavHeader.js +30 -77
  127. package/dist/v2/SubNav/SubNavLink.cjs +5 -5
  128. package/dist/v2/SubNav/SubNavLink.js +13 -47
  129. package/dist/v2/SubNav/SubNavLinkSection.cjs +4 -4
  130. package/dist/v2/SubNav/SubNavLinkSection.js +19 -34
  131. package/dist/v2/SubNav/SubNavSection.cjs +2 -2
  132. package/dist/v2/SubNav/SubNavSection.js +16 -55
  133. package/dist/v2/SubNav/SubNavSectionLabel.cjs +3 -3
  134. package/dist/v2/SubNav/SubNavSectionLabel.js +10 -38
  135. package/dist/v2/SubNav/SubNavSections.cjs +1 -1
  136. package/dist/v2/SubNav/SubNavSections.js +4 -18
  137. package/package.json +4 -4
  138. package/dist/Grid/GridContext.cjs +0 -1
  139. package/dist/Grid/GridContext.js +0 -6
  140. package/dist/Tabs/useTabsFocus.cjs +0 -1
  141. package/dist/Tabs/useTabsFocus.js +0 -17
  142. package/dist/Textarea/TextareaInput.cjs +0 -30
  143. package/dist/Textarea/TextareaInput.js +0 -65
@@ -1,19 +1,16 @@
1
- import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
- import "react";
3
- import { ChevronLeft as y, ChevronRight as P } from "@strapi/icons";
4
- import n from "prop-types";
5
- import { NavLink as x } from "react-router-dom";
6
- import s from "styled-components";
7
- import { usePagination as p } from "./PaginationContext.js";
8
- import { buttonFocusStyle as k } from "../themes/utils.js";
9
- import { Typography as L } from "../Typography/Typography.js";
10
- import { VisuallyHidden as l } from "../VisuallyHidden/VisuallyHidden.js";
11
- const u = s(L)`
12
- line-height: revert;
13
- `, $ = {
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
+ import { ChevronLeft as f, ChevronRight as m } from "@strapi/icons";
3
+ import { NavLink as v } from "react-router-dom";
4
+ import l from "styled-components";
5
+ import { usePagination as c } from "./PaginationContext.js";
6
+ import { buttonFocusStyle as g } from "../themes/utils.js";
7
+ import { VisuallyHidden as d } from "../VisuallyHidden/VisuallyHidden.js";
8
+ import { Typography as h } from "../Typography/Typography.js";
9
+ import { Box as b } from "../Box/Box.js";
10
+ const x = {
14
11
  active: !0
15
- }, h = s(x).withConfig({
16
- shouldForwardProp: (e, r) => !$[e] && r(e)
12
+ }, u = l(v).withConfig({
13
+ shouldForwardProp: (e, r) => !x[e] && r(e)
17
14
  })`
18
15
  padding: ${({ theme: e }) => e.spaces[3]};
19
16
  border-radius: ${({ theme: e }) => e.borderRadius};
@@ -21,16 +18,17 @@ const u = s(L)`
21
18
  text-decoration: none;
22
19
  display: flex;
23
20
 
24
- ${k}
25
- `, w = s(h)`
21
+ ${g}
22
+ `, k = l(u)`
26
23
  color: ${({ theme: e, active: r }) => r ? e.colors.primary700 : e.colors.neutral800};
27
24
  background: ${({ theme: e, active: r }) => r ? e.colors.neutral0 : void 0};
28
25
 
29
26
  &:hover {
30
27
  box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
31
28
  }
32
- `, m = s(h)`
33
- font-size: 0.7rem;
29
+ `, p = l(u)`
30
+ font-size: ${11 / 16}rem;
31
+
34
32
  svg path {
35
33
  fill: ${(e) => e["aria-disabled"] ? e.theme.colors.neutral300 : e.theme.colors.neutral600};
36
34
  }
@@ -45,70 +43,25 @@ const u = s(L)`
45
43
  ${(e) => e["aria-disabled"] ? `
46
44
  pointer-events: none;
47
45
  ` : void 0}
48
- `, T = s(h)`
49
- color: ${({ theme: e }) => e.colors.neutral800};
50
- `, v = ({ children: e, to: r, ...t }) => {
51
- const { activePage: a } = p(), o = a === 1;
52
- return /* @__PURE__ */ d(
53
- m,
54
- {
55
- to: o ? "#" : r,
56
- "aria-disabled": o,
57
- tabIndex: o ? -1 : void 0,
58
- ...t,
59
- children: [
60
- /* @__PURE__ */ i(l, { children: e }),
61
- /* @__PURE__ */ i(y, { "aria-hidden": !0 })
62
- ]
63
- }
64
- );
65
- };
66
- v.displayName = "PreviousLink";
67
- const f = ({ children: e, to: r, ...t }) => {
68
- const { activePage: a, pageCount: o } = p(), c = a === o;
69
- return /* @__PURE__ */ d(
70
- m,
71
- {
72
- to: c ? "#" : r,
73
- "aria-disabled": c,
74
- tabIndex: c ? -1 : void 0,
75
- ...t,
76
- children: [
77
- /* @__PURE__ */ i(l, { children: e }),
78
- /* @__PURE__ */ i(P, { "aria-hidden": !0 })
79
- ]
80
- }
81
- );
82
- };
83
- f.displayName = "NextLink";
84
- const g = ({ number: e, children: r, ...t }) => {
85
- const { activePage: a } = p(), o = a === e;
86
- return /* @__PURE__ */ d(w, { ...t, active: o, children: [
87
- /* @__PURE__ */ i(l, { children: r }),
88
- /* @__PURE__ */ i(u, { "aria-hidden": !0, variant: "pi", fontWeight: o ? "bold" : null, children: e })
89
- ] });
90
- };
91
- g.displayName = "PageLink";
92
- const R = ({ children: e, ...r }) => /* @__PURE__ */ d(T, { ...r, as: "div", children: [
93
- /* @__PURE__ */ i(l, { children: e }),
94
- /* @__PURE__ */ i(u, { "aria-hidden": !0, variant: "pi", children: "…" })
95
- ] });
96
- g.propTypes = {
97
- children: n.node.isRequired,
98
- number: n.number.isRequired
46
+ `, L = ({ children: e, to: r, ...n }) => {
47
+ const { activePage: t } = c(), i = t === 1;
48
+ return a(p, { to: i ? "#" : r, "aria-disabled": i, tabIndex: i ? -1 : void 0, ...n, children: [o(d, { children: e }), o(f, { "aria-hidden": !0 })] });
99
49
  };
100
- const b = {
101
- children: n.node.isRequired,
102
- to: n.string.isRequired
50
+ L.displayName = "PreviousLink";
51
+ const P = ({ children: e, to: r, ...n }) => {
52
+ const { activePage: t, pageCount: i } = c(), s = t === i;
53
+ return a(p, { to: s ? "#" : r, "aria-disabled": s, tabIndex: s ? -1 : void 0, ...n, children: [o(d, { children: e }), o(m, { "aria-hidden": !0 })] });
103
54
  };
104
- f.propTypes = b;
105
- v.propTypes = b;
106
- R.propTypes = {
107
- children: n.node.isRequired
55
+ P.displayName = "NextLink";
56
+ const $ = ({ number: e, children: r, ...n }) => {
57
+ const { activePage: t } = c(), i = t === e;
58
+ return a(k, { ...n, active: i, children: [o(d, { children: r }), o(h, { "aria-hidden": !0, fontWeight: i ? "bold" : void 0, lineHeight: "revert", variant: "pi", children: e })] });
108
59
  };
60
+ $.displayName = "PageLink";
61
+ const F = ({ children: e, ...r }) => a(b, { ...r, children: [o(d, { children: e }), o(h, { "aria-hidden": !0, lineHeight: "revert", textColor: "neutral800", variant: "pi", children: "…" })] });
109
62
  export {
110
- R as Dots,
111
- f as NextLink,
112
- g as PageLink,
113
- v as PreviousLink
63
+ F as Dots,
64
+ P as NextLink,
65
+ $ as PageLink,
66
+ L as PreviousLink
114
67
  };
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),l=require("@floating-ui/react-dom"),C=require("@radix-ui/react-focus-scope"),_=require("@strapi/ui-primitives"),L=require("aria-hidden"),$=require("react-remove-scroll"),I=require("styled-components"),M=require("../DismissibleLayer/index.cjs"),w=require("../helpers/strings.cjs"),z=require("../hooks/useComposeRefs.cjs"),F=require("../hooks/useId.cjs"),A=require("../hooks/useIntersection.cjs"),h=require("../Box/Box.cjs"),T=require("../Portal/Portal.cjs"),W=e=>e&&e.__esModule?e:{default:e};function B(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=B(k),x=W(I),N=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],K=x.default(h.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),F=require("react"),u=require("@floating-ui/react-dom"),M=require("@radix-ui/react-focus-scope"),m=require("@strapi/ui-primitives"),z=require("aria-hidden"),T=require("react-remove-scroll"),W=require("styled-components"),A=require("../DismissibleLayer/index.cjs"),P=require("../helpers/strings.cjs"),B=require("../hooks/useComposeRefs.cjs"),H=require("../hooks/useId.cjs"),K=require("../hooks/useIntersection.cjs"),g=require("../Box/Box.cjs"),N=require("../Portal/Portal.cjs"),U=e=>e&&e.__esModule?e:{default:e};function V(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const i=V(F),E=U(W),Z=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],G=E.default(g.Box)`
2
2
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
3
3
  z-index: ${({theme:e})=>e.zIndices[0]};
4
4
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
5
5
  background: ${({theme:e})=>e.colors.neutral0};
6
- `,v=({source:e,children:r,spacing:t=0,fullWidth:n=!1,placement:c="bottom-start",centered:u=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,...p})=>{const[b,y]=i.useState(null),[O,S]=i.useState(void 0),{x:E,y:j,reference:m,floating:q,strategy:R}=l.useFloating({strategy:"fixed",placement:u?"bottom":c,middleware:[l.offset({mainAxis:t}),l.shift(),l.flip()],whileElementsMounted:l.autoUpdate});i.useLayoutEffect(()=>{m(e.current)},[e,m]),i.useLayoutEffect(()=>{n&&S(e.current.offsetWidth)},[n,e]),i.useEffect(()=>{if(b)return L.hideOthers(b)},[b]);const g=_.useCallbackRef(a);i.useEffect(()=>{const o=()=>{g()};return window.addEventListener("blur",o),window.addEventListener("resize",o),()=>{window.removeEventListener("blur",o),window.removeEventListener("resize",o)}},[g]);const D=z.useComposedRefs(o=>y(o),q);return s.jsx($.RemoveScroll,{allowPinchZoom:!0,children:s.jsx(C.FocusScope,{asChild:!0,trapped:!0,onMountAutoFocus:o=>{o.preventDefault()},onUnmountAutoFocus:o=>{e.current?.focus({preventScroll:!0}),o.preventDefault()},children:s.jsx(M.DismissibleLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:o=>{o.preventDefault()},onDismiss:a,children:s.jsx(K,{ref:D,style:{left:E,top:j,position:R,width:O||void 0},hasRadius:!0,background:"neutral0",padding:1,...p,children:r})})})})},P=({children:e,intersectionId:r,onReachEnd:t,...n})=>{const c=i.useRef(null),u=F.useId();return A.useIntersection(c,t??(()=>{}),{selectorToWatch:`#${w.stripReactIdOfColon(u)}`,skipWhen:!r||!t}),s.jsxs(U,{ref:c,...n,children:[e,r&&t&&s.jsx(h.Box,{id:w.stripReactIdOfColon(u),width:"100%",height:"1px"})]})},U=x.default(h.Box)`
6
+ `,R=({source:e,children:r,spacing:t=0,fullWidth:n=!1,placement:c="bottom-start",centered:l=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,onFocusOutside:p,...O})=>{const[h,k]=i.useState(null),v=i.useRef(!1),[S,j]=i.useState(void 0),{x:q,y:C,reference:w,floating:D,strategy:_}=u.useFloating({strategy:"fixed",placement:l?"bottom":c,middleware:[u.offset({mainAxis:t}),u.shift(),u.flip()],whileElementsMounted:u.autoUpdate});i.useLayoutEffect(()=>{w(e.current)},[e,w]),i.useLayoutEffect(()=>{n&&j(e.current.offsetWidth)},[n,e]),i.useEffect(()=>{if(h)return z.hideOthers(h)},[h]);const x=m.useCallbackRef(a);i.useEffect(()=>{const o=()=>{x()};return window.addEventListener("blur",o),window.addEventListener("resize",o),()=>{window.removeEventListener("blur",o),window.removeEventListener("resize",o)}},[x]);const L=B.useComposedRefs(o=>k(o),D);return s.jsx(T.RemoveScroll,{allowPinchZoom:!0,children:s.jsx(M.FocusScope,{asChild:!0,loop:!0,trapped:!0,onUnmountAutoFocus:o=>{o.preventDefault(),v.current||e.current?.focus({preventScroll:!0})},children:s.jsx(A.DismissibleLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m.composeEventHandlers(f,o=>{const b=o.detail.originalEvent,$=b.button===0&&b.ctrlKey===!0,I=b.button===2||$;v.current=I},{checkForDefaultPrevented:!1}),onFocusOutside:m.composeEventHandlers(p,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:a,children:s.jsx(G,{ref:L,style:{left:q,top:C,position:_,width:S||void 0},hasRadius:!0,background:"neutral0",padding:1,...O,children:r})})})})},y=({children:e,intersectionId:r,onReachEnd:t,...n})=>{const c=i.useRef(null),l=H.useId();return K.useIntersection(c,t??(()=>{}),{selectorToWatch:`#${P.stripReactIdOfColon(l)}`,skipWhen:!r||!t}),s.jsxs(J,{ref:c,...n,children:[e,r&&t&&s.jsx(g.Box,{id:P.stripReactIdOfColon(l),width:"100%",height:"1px"})]})},J=E.default(g.Box)`
7
7
  // 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
8
8
  max-height: ${3*5}rem;
9
9
  overflow-y: auto;
@@ -23,4 +23,4 @@
23
23
  border-radius: ${({theme:e})=>e.borderRadius};
24
24
  margin-right: 10px;
25
25
  }
26
- `,V=({children:e,source:r,spacing:t,fullWidth:n,placement:c,centered:u,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,...p})=>s.jsx(T.Portal,{children:s.jsx(v,{source:r,spacing:t,fullWidth:n,placement:c,centered:u,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,children:s.jsx(P,{...p,children:e})})});exports.Content=v;exports.POPOVER_PLACEMENTS=N;exports.Popover=V;exports.Scrolling=P;
26
+ `,Q=({children:e,source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,...p})=>s.jsx(N.Portal,{children:s.jsx(R,{source:r,spacing:t,fullWidth:n,placement:c,centered:l,onEscapeKeyDown:d,onPointerDownOutside:f,onDismiss:a,children:s.jsx(y,{...p,children:e})})});exports.Content=R;exports.POPOVER_PLACEMENTS=Z;exports.Popover=Q;exports.Scrolling=y;
@@ -1,19 +1,19 @@
1
- import { jsx as o, jsxs as S } from "react/jsx-runtime";
2
- import * as n from "react";
3
- import { useFloating as $, offset as C, shift as L, flip as O, autoUpdate as z } from "@floating-ui/react-dom";
4
- import { FocusScope as F } from "@radix-ui/react-focus-scope";
5
- import { useCallbackRef as I } from "@strapi/ui-primitives";
6
- import { hideOthers as W } from "aria-hidden";
7
- import { RemoveScroll as A } from "react-remove-scroll";
8
- import g from "styled-components";
9
- import { DismissibleLayer as M } from "../DismissibleLayer/index.js";
10
- import { stripReactIdOfColon as w } from "../helpers/strings.js";
11
- import { useComposedRefs as j } from "../hooks/useComposeRefs.js";
12
- import { useId as K } from "../hooks/useId.js";
13
- import { useIntersection as T } from "../hooks/useIntersection.js";
14
- import { Box as p } from "../Box/Box.js";
15
- import { Portal as U } from "../Portal/Portal.js";
16
- const ie = [
1
+ import { jsx as r, jsxs as z } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { useFloating as I, offset as W, shift as A, flip as K, autoUpdate as j } from "@floating-ui/react-dom";
4
+ import { FocusScope as M } from "@radix-ui/react-focus-scope";
5
+ import { useCallbackRef as T, composeEventHandlers as v } from "@strapi/ui-primitives";
6
+ import { hideOthers as U } from "aria-hidden";
7
+ import { RemoveScroll as B } from "react-remove-scroll";
8
+ import x from "styled-components";
9
+ import { DismissibleLayer as H } from "../DismissibleLayer/index.js";
10
+ import { stripReactIdOfColon as k } from "../helpers/strings.js";
11
+ import { useComposedRefs as N } from "../hooks/useComposeRefs.js";
12
+ import { useId as V } from "../hooks/useId.js";
13
+ import { useIntersection as Z } from "../hooks/useIntersection.js";
14
+ import { Box as h } from "../Box/Box.js";
15
+ import { Portal as _ } from "../Portal/Portal.js";
16
+ const fe = [
17
17
  "top",
18
18
  "top-start",
19
19
  "top-end",
@@ -26,80 +26,81 @@ const ie = [
26
26
  "left",
27
27
  "left-start",
28
28
  "left-end"
29
- ], B = g(p)`
29
+ ], q = x(h)`
30
30
  box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
31
31
  z-index: ${({ theme: e }) => e.zIndices[0]};
32
32
  border: 1px solid ${({ theme: e }) => e.colors.neutral150};
33
33
  background: ${({ theme: e }) => e.colors.neutral0};
34
- `, N = ({ source: e, children: s, spacing: r = 0, fullWidth: i = !1, placement: l = "bottom-start", centered: a = !1, onEscapeKeyDown: c, onPointerDownOutside: u, onDismiss: d, ...f }) => {
35
- const [m, v] = n.useState(null), [x, E] = n.useState(void 0), { x: k, y, reference: h, floating: P, strategy: D } = $({
34
+ `, G = ({ source: e, children: s, spacing: n = 0, fullWidth: i = !1, placement: l = "bottom-start", centered: a = !1, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, onFocusOutside: f, ...E }) => {
35
+ const [m, P] = o.useState(null), b = o.useRef(!1), [R, y] = o.useState(void 0), { x: C, y: D, reference: w, floating: L, strategy: O } = I({
36
36
  strategy: "fixed",
37
37
  placement: a ? "bottom" : l,
38
38
  middleware: [
39
- C({
40
- mainAxis: r
39
+ W({
40
+ mainAxis: n
41
41
  }),
42
- L(),
43
- O()
42
+ A(),
43
+ K()
44
44
  ],
45
- whileElementsMounted: z
45
+ whileElementsMounted: j
46
46
  });
47
- n.useLayoutEffect(() => {
48
- h(e.current);
49
- }, [e, h]), n.useLayoutEffect(() => {
50
- i && E(e.current.offsetWidth);
51
- }, [i, e]), n.useEffect(() => {
47
+ o.useLayoutEffect(() => {
48
+ w(e.current);
49
+ }, [e, w]), o.useLayoutEffect(() => {
50
+ i && y(e.current.offsetWidth);
51
+ }, [i, e]), o.useEffect(() => {
52
52
  if (m)
53
- return W(m);
53
+ return U(m);
54
54
  }, [m]);
55
- const b = I(d);
56
- n.useEffect(() => {
55
+ const g = T(c);
56
+ o.useEffect(() => {
57
57
  const t = () => {
58
- b();
58
+ g();
59
59
  };
60
60
  return window.addEventListener("blur", t), window.addEventListener("resize", t), () => {
61
61
  window.removeEventListener("blur", t), window.removeEventListener("resize", t);
62
62
  };
63
- }, [b]);
64
- const R = j((t) => v(t), P);
65
- return o(A, { allowPinchZoom: !0, children: o(F, {
63
+ }, [g]);
64
+ const S = N((t) => P(t), L);
65
+ return r(B, { allowPinchZoom: !0, children: r(M, {
66
66
  asChild: !0,
67
+ loop: !0,
67
68
  // we make sure we're not trapping once it's been closed
68
69
  // (closed !== unmounted when animating out)
69
70
  trapped: !0,
70
- onMountAutoFocus: (t) => {
71
- t.preventDefault();
72
- },
73
71
  onUnmountAutoFocus: (t) => {
74
- e.current?.focus({ preventScroll: !0 }), t.preventDefault();
72
+ t.preventDefault(), b.current || e.current?.focus({ preventScroll: !0 });
75
73
  },
76
- children: o(M, {
74
+ children: r(H, {
77
75
  asChild: !0,
78
76
  disableOutsidePointerEvents: !0,
79
- onEscapeKeyDown: c,
80
- onPointerDownOutside: u,
81
- // When focus is trapped, a focusout event may still happen.
77
+ onEscapeKeyDown: d,
78
+ onPointerDownOutside: v(u, (t) => {
79
+ const p = t.detail.originalEvent, $ = p.button === 0 && p.ctrlKey === !0, F = p.button === 2 || $;
80
+ b.current = F;
81
+ }, { checkForDefaultPrevented: !1 }),
82
+ // When focus is trapped, a `focusout` event may still happen.
82
83
  // We make sure we don't trigger our `onDismiss` in such case.
83
- onFocusOutside: (t) => {
84
- t.preventDefault();
85
- },
86
- onDismiss: d,
87
- children: o(B, { ref: R, style: {
88
- left: k,
89
- top: y,
90
- position: D,
91
- width: x || void 0
92
- }, hasRadius: !0, background: "neutral0", padding: 1, ...f, children: s })
84
+ onFocusOutside: v(f, (t) => t.preventDefault(), {
85
+ checkForDefaultPrevented: !1
86
+ }),
87
+ onDismiss: c,
88
+ children: r(q, { ref: S, style: {
89
+ left: C,
90
+ top: D,
91
+ position: O,
92
+ width: R || void 0
93
+ }, hasRadius: !0, background: "neutral0", padding: 1, ...E, children: s })
93
94
  })
94
95
  }) });
95
- }, V = ({ children: e, intersectionId: s, onReachEnd: r, ...i }) => {
96
- const l = n.useRef(null), a = K();
97
- return T(l, r ?? (() => {
96
+ }, J = ({ children: e, intersectionId: s, onReachEnd: n, ...i }) => {
97
+ const l = o.useRef(null), a = V();
98
+ return Z(l, n ?? (() => {
98
99
  }), {
99
- selectorToWatch: `#${w(a)}`,
100
- skipWhen: !s || !r
101
- }), S(Z, { ref: l, ...i, children: [e, s && r && o(p, { id: w(a), width: "100%", height: "1px" })] });
102
- }, Z = g(p)`
100
+ selectorToWatch: `#${k(a)}`,
101
+ skipWhen: !s || !n
102
+ }), z(Q, { ref: l, ...i, children: [e, s && n && r(h, { id: k(a), width: "100%", height: "1px" })] });
103
+ }, Q = x(h)`
103
104
  // 16 is base base size, 3 is the factor to get closer to 40px and 5 is the number of elements visible in the list
104
105
  max-height: ${3 * 5}rem;
105
106
  overflow-y: auto;
@@ -119,10 +120,10 @@ const ie = [
119
120
  border-radius: ${({ theme: e }) => e.borderRadius};
120
121
  margin-right: 10px;
121
122
  }
122
- `, le = ({ children: e, source: s, spacing: r, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: c, onPointerDownOutside: u, onDismiss: d, ...f }) => o(U, { children: o(N, { source: s, spacing: r, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: c, onPointerDownOutside: u, onDismiss: d, children: o(V, { ...f, children: e }) }) });
123
+ `, me = ({ children: e, source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, ...f }) => r(_, { children: r(G, { source: s, spacing: n, fullWidth: i, placement: l, centered: a, onEscapeKeyDown: d, onPointerDownOutside: u, onDismiss: c, children: r(J, { ...f, children: e }) }) });
123
124
  export {
124
- N as Content,
125
- ie as POPOVER_PLACEMENTS,
126
- le as Popover,
127
- V as Scrolling
125
+ G as Content,
126
+ fe as POPOVER_PLACEMENTS,
127
+ me as Popover,
128
+ J as Scrolling
128
129
  };
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime");require("react");const d=require("prop-types"),c=require("styled-components"),p=require("../Box/Box.cjs"),s=e=>e&&e.__esModule?e:{default:e},r=s(d),b=s(c),f=b.default(p.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("styled-components"),l=require("../Box/Box.cjs"),n=r=>r&&r.__esModule?r:{default:r},d=n(i),c=d.default(l.Box)`
2
2
  &:before {
3
- background-color: ${({theme:e})=>e.colors.neutral0};
4
- border-radius: ${({theme:e})=>e.borderRadius};
3
+ background-color: ${({theme:r})=>r.colors.neutral0};
4
+ border-radius: ${({theme:r})=>r.borderRadius};
5
5
  bottom: 0;
6
6
  content: '';
7
7
  position: absolute;
8
8
  top: 0;
9
- width: ${({value:e})=>`${e}%`};
9
+ width: ${({value:r})=>`${r}%`};
10
10
  }
11
- `,o=({min:e,max:u,value:t,children:i,size:a,...n})=>l.jsx(f,{background:"neutral600",hasRadius:!0,"aria-label":i,"aria-valuemax":u,"aria-valuemin":e,"aria-valuenow":t,height:a==="S"?1:2,position:"relative",role:"progressbar",value:t,width:a==="S"?"78px":"102px",...n});o.defaultProps={min:0,max:100,value:0,size:"M"};o.propTypes={children:r.default.node.isRequired,max:r.default.number,min:r.default.number,size:r.default.oneOf(["S","M"]),value:r.default.number};exports.ProgressBar=o;
11
+ `,b=({min:r=0,max:t=100,value:e=0,children:a,size:o="M",...s})=>u.jsx(c,{background:"neutral600",hasRadius:!0,"aria-label":a,"aria-valuemax":t,"aria-valuemin":r,"aria-valuenow":e,height:o==="S"?1:2,position:"relative",role:"progressbar",value:e,width:o==="S"?"78px":"102px",...s});exports.ProgressBar=b;
@@ -1,9 +1,7 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import "react";
3
- import o from "prop-types";
4
- import u from "styled-components";
5
- import { Box as p } from "../Box/Box.js";
6
- const l = u(p)`
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import l from "styled-components";
3
+ import { Box as n } from "../Box/Box.js";
4
+ const u = l(n)`
7
5
  &:before {
8
6
  background-color: ${({ theme: r }) => r.colors.neutral0};
9
7
  border-radius: ${({ theme: r }) => r.borderRadius};
@@ -13,36 +11,7 @@ const l = u(p)`
13
11
  top: 0;
14
12
  width: ${({ value: r }) => `${r}%`};
15
13
  }
16
- `, i = ({ min: r, max: t, value: e, children: s, size: a, ...n }) => /* @__PURE__ */ m(
17
- l,
18
- {
19
- background: "neutral600",
20
- hasRadius: !0,
21
- "aria-label": s,
22
- "aria-valuemax": t,
23
- "aria-valuemin": r,
24
- "aria-valuenow": e,
25
- height: a === "S" ? 1 : 2,
26
- position: "relative",
27
- role: "progressbar",
28
- value: e,
29
- width: a === "S" ? "78px" : "102px",
30
- ...n
31
- }
32
- );
33
- i.defaultProps = {
34
- min: 0,
35
- max: 100,
36
- value: 0,
37
- size: "M"
38
- };
39
- i.propTypes = {
40
- children: o.node.isRequired,
41
- max: o.number,
42
- min: o.number,
43
- size: o.oneOf(["S", "M"]),
44
- value: o.number
45
- };
14
+ `, m = ({ min: r = 0, max: e = 100, value: o = 0, children: t, size: a = "M", ...i }) => s(u, { background: "neutral600", hasRadius: !0, "aria-label": t, "aria-valuemax": e, "aria-valuemin": r, "aria-valuenow": o, height: a === "S" ? 1 : 2, position: "relative", role: "progressbar", value: o, width: a === "S" ? "78px" : "102px", ...i });
46
15
  export {
47
- i as ProgressBar
16
+ m as ProgressBar
48
17
  };
@@ -1,4 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("react");const i=require("prop-types"),l=require("styled-components"),n=require("../BaseRadio/BaseRadio.cjs"),u=require("../Typography/Typography.cjs"),d=require("../Box/Box.cjs"),o=e=>e&&e.__esModule?e:{default:e},r=o(i),c=o(l),p=c.default(u.Typography)`
2
- display: flex;
3
- align-items: center;
4
- `,s=({children:e,...a})=>t.jsxs(p,{as:"label",textColor:"neutral800",children:[t.jsx(n.BaseRadio,{...a}),t.jsx(d.Box,{paddingLeft:2,children:e})]});s.propTypes={children:r.default.node.isRequired,value:r.default.any.isRequired};exports.Radio=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../BaseRadio/BaseRadio.cjs"),s=require("../Flex/Flex.cjs"),a=require("../Typography/Typography.cjs"),i=({children:r,...t})=>e.jsxs(s.Flex,{alignItems:"center",as:"label",gap:2,children:[e.jsx(o.BaseRadio,{...t}),e.jsx(a.Typography,{textColor:"neutral800",children:r})]});exports.Radio=i;
@@ -1,21 +1,8 @@
1
1
  import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
- import "react";
3
- import o from "prop-types";
4
- import p from "styled-components";
5
- import { BaseRadio as m } from "../BaseRadio/BaseRadio.js";
6
- import { Typography as s } from "../Typography/Typography.js";
7
- import { Box as a } from "../Box/Box.js";
8
- const l = p(s)`
9
- display: flex;
10
- align-items: center;
11
- `, d = ({ children: e, ...i }) => /* @__PURE__ */ t(l, { as: "label", textColor: "neutral800", children: [
12
- /* @__PURE__ */ r(m, { ...i }),
13
- /* @__PURE__ */ r(a, { paddingLeft: 2, children: e })
14
- ] });
15
- d.propTypes = {
16
- children: o.node.isRequired,
17
- value: o.any.isRequired
18
- };
2
+ import { BaseRadio as a } from "../BaseRadio/BaseRadio.js";
3
+ import { Flex as i } from "../Flex/Flex.js";
4
+ import { Typography as m } from "../Typography/Typography.js";
5
+ const x = ({ children: o, ...e }) => t(i, { alignItems: "center", as: "label", gap: 2, children: [r(a, { ...e }), r(m, { textColor: "neutral800", children: o })] });
19
6
  export {
20
- d as Radio
7
+ x as Radio
21
8
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const o=e=>r.jsx("form",{...e,role:"search"});exports.SearchForm=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=e=>r.jsx("form",{...e,role:"search"});exports.SearchForm=o;
@@ -1,6 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import "react";
3
- const t = (r) => /* @__PURE__ */ o("form", { ...r, role: "search" });
2
+ const m = (r) => o("form", { ...r, role: "search" });
4
3
  export {
5
- t as SearchForm
4
+ m as SearchForm
6
5
  };
@@ -1,29 +1,28 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("react"),u=require("@strapi/icons"),S=require("prop-types"),m=require("styled-components"),$=require("../themes/sizes.cjs"),v=require("../themes/utils.cjs"),i=require("../Field/FieldInput.cjs"),c=require("../Flex/Flex.cjs"),_=require("../Field/Field.cjs"),z=require("../VisuallyHidden/VisuallyHidden.cjs"),C=require("../Field/FieldLabel.cjs"),I=require("../Field/FieldAction.cjs"),d=e=>e&&e.__esModule?e:{default:e},s=d(S),l=d(m),w=l.default(c.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),l=require("@strapi/icons"),m=require("styled-components"),F=require("../hooks/useComposeRefs.cjs"),R=require("../themes/utils.cjs"),t=require("../Field/FieldInput.cjs"),S=require("../Field/Field.cjs"),y=require("../VisuallyHidden/VisuallyHidden.cjs"),$=require("../Field/FieldLabel.cjs"),C=require("../Field/FieldAction.cjs"),I=e=>e&&e.__esModule?e:{default:e},s=I(m),w=s.default(l.Cross)`
2
2
  font-size: 0.5rem;
3
- svg path {
3
+ path {
4
4
  fill: ${({theme:e})=>e.colors.neutral400};
5
5
  }
6
- `,p=l.default(c.Flex)`
6
+ `,c=s.default(l.Search)`
7
7
  font-size: 0.8rem;
8
-
9
- svg path {
8
+ path {
10
9
  fill: ${({theme:e})=>e.colors.neutral800};
11
10
  }
12
- `,W=l.default.div`
11
+ `,_=s.default.div`
13
12
  border-radius: ${({theme:e})=>e.borderRadius};
14
13
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
15
14
 
16
15
  &:focus-within {
17
- ${p} {
18
- svg path {
16
+ ${c} {
17
+ path {
19
18
  fill: ${({theme:e})=>e.colors.primary600};
20
19
  }
21
20
  }
22
21
  }
23
22
 
24
- ${i.InputWrapper} {
23
+ ${t.InputWrapper} {
25
24
  border: 1px solid transparent;
26
25
  }
27
26
 
28
- ${v.inputFocusStyle(i.InputWrapper)}
29
- `,t=a.forwardRef(({name:e,size:f,children:h,value:n,onClear:q,clearLabel:x,...b},j)=>{const o=a.useRef(null),y=n.length>0,F=g=>{q(g),o.current.focus()},R=j||o;return r.jsx(W,{children:r.jsxs(_.Field,{name:e,children:[r.jsx(z.VisuallyHidden,{children:r.jsx(C.FieldLabel,{children:h})}),r.jsx(i.FieldInput,{ref:R,value:n,startAction:r.jsx(p,{children:r.jsx(u.Search,{"aria-hidden":!0})}),size:f,endAction:y?r.jsx(I.FieldAction,{label:x,onClick:F,children:r.jsx(w,{children:r.jsx(u.Cross,{})})}):void 0,...b})]})})});t.displayName="Searchbar";t.defaultProps={value:"",size:"M"};t.propTypes={children:s.default.node.isRequired,clearLabel:s.default.string.isRequired,name:s.default.string.isRequired,onClear:s.default.func.isRequired,size:s.default.oneOf(Object.keys($.sizes.input)),value:s.default.string};exports.Searchbar=t;
27
+ ${R.inputFocusStyle(t.InputWrapper)}
28
+ `,g=i.forwardRef(({name:e,size:a="M",children:u,value:n="",onClear:d,clearLabel:f,...p},h)=>{const o=i.useRef(null),b=n.length>0,q=j=>{d(j),o.current.focus()},x=F.composeRefs(h,o);return r.jsx(_,{children:r.jsxs(S.Field,{name:e,children:[r.jsx(y.VisuallyHidden,{children:r.jsx($.FieldLabel,{children:u})}),r.jsx(t.FieldInput,{ref:x,value:n,startAction:r.jsx(c,{"aria-hidden":!0}),size:a,endAction:b?r.jsx(C.FieldAction,{label:f,onClick:q,children:r.jsx(w,{})}):void 0,...p})]})})});exports.Searchbar=g;
@@ -1,76 +1,47 @@
1
- import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
- import { forwardRef as y, useRef as $ } from "react";
3
- import { Search as C, Cross as S } from "@strapi/icons";
4
- import o from "prop-types";
5
- import i from "styled-components";
6
- import { sizes as v } from "../themes/sizes.js";
7
- import { inputFocusStyle as x } from "../themes/utils.js";
8
- import { InputWrapper as l, FieldInput as F } from "../Field/FieldInput.js";
9
- import { Flex as a } from "../Flex/Flex.js";
10
- import { Field as w } from "../Field/Field.js";
1
+ import { jsx as o, jsxs as $ } from "react/jsx-runtime";
2
+ import { forwardRef as R, useRef as S } from "react";
3
+ import { Cross as w, Search as x } from "@strapi/icons";
4
+ import e from "styled-components";
5
+ import { composeRefs as C } from "../hooks/useComposeRefs.js";
6
+ import { inputFocusStyle as F } from "../themes/utils.js";
7
+ import { InputWrapper as n, FieldInput as y } from "../Field/FieldInput.js";
8
+ import { Field as I } from "../Field/Field.js";
11
9
  import { VisuallyHidden as z } from "../VisuallyHidden/VisuallyHidden.js";
12
- import { FieldLabel as q } from "../Field/FieldLabel.js";
13
- import { FieldAction as I } from "../Field/FieldAction.js";
14
- const W = i(a)`
10
+ import { FieldLabel as A } from "../Field/FieldLabel.js";
11
+ import { FieldAction as g } from "../Field/FieldAction.js";
12
+ const j = e(w)`
15
13
  font-size: 0.5rem;
16
- svg path {
14
+ path {
17
15
  fill: ${({ theme: r }) => r.colors.neutral400};
18
16
  }
19
- `, p = i(a)`
17
+ `, l = e(x)`
20
18
  font-size: 0.8rem;
21
-
22
- svg path {
19
+ path {
23
20
  fill: ${({ theme: r }) => r.colors.neutral800};
24
21
  }
25
- `, j = i.div`
22
+ `, W = e.div`
26
23
  border-radius: ${({ theme: r }) => r.borderRadius};
27
24
  box-shadow: ${({ theme: r }) => r.shadows.filterShadow};
28
25
 
29
26
  &:focus-within {
30
- ${p} {
31
- svg path {
27
+ ${l} {
28
+ path {
32
29
  fill: ${({ theme: r }) => r.colors.primary600};
33
30
  }
34
31
  }
35
32
  }
36
33
 
37
- ${l} {
34
+ ${n} {
38
35
  border: 1px solid transparent;
39
36
  }
40
37
 
41
- ${x(l)}
42
- `, t = y(({ name: r, size: c, children: d, value: s, onClear: m, clearLabel: f, ...u }, h) => {
43
- const n = $(null), b = s.length > 0;
44
- return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ g(w, { name: r, children: [
45
- /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(q, { children: d }) }),
46
- /* @__PURE__ */ e(
47
- F,
48
- {
49
- ref: h || n,
50
- value: s,
51
- startAction: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(C, { "aria-hidden": !0 }) }),
52
- size: c,
53
- endAction: b ? /* @__PURE__ */ e(I, { label: f, onClick: (R) => {
54
- m(R), n.current.focus();
55
- }, children: /* @__PURE__ */ e(W, { children: /* @__PURE__ */ e(S, {}) }) }) : void 0,
56
- ...u
57
- }
58
- )
59
- ] }) });
38
+ ${F(n)}
39
+ `, J = R(({ name: r, size: s = "M", children: a, value: t = "", onClear: c, clearLabel: d, ...m }, p) => {
40
+ const i = S(null), f = t.length > 0, h = (b) => {
41
+ c(b), i.current.focus();
42
+ }, u = C(p, i);
43
+ return o(W, { children: $(I, { name: r, children: [o(z, { children: o(A, { children: a }) }), o(y, { ref: u, value: t, startAction: o(l, { "aria-hidden": !0 }), size: s, endAction: f ? o(g, { label: d, onClick: h, children: o(j, {}) }) : void 0, ...m })] }) });
60
44
  });
61
- t.displayName = "Searchbar";
62
- t.defaultProps = {
63
- value: "",
64
- size: "M"
65
- };
66
- t.propTypes = {
67
- children: o.node.isRequired,
68
- clearLabel: o.string.isRequired,
69
- name: o.string.isRequired,
70
- onClear: o.func.isRequired,
71
- size: o.oneOf(Object.keys(v.input)),
72
- value: o.string
73
- };
74
45
  export {
75
- t as Searchbar
46
+ J as Searchbar
76
47
  };