@strapi/design-system 1.7.5 → 1.7.7

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 (77) hide show
  1. package/dist/BaseButton/BaseButton.cjs +3 -3
  2. package/dist/BaseButton/BaseButton.js +5 -5
  3. package/dist/CarouselInput/Carousel.cjs +6 -7
  4. package/dist/CarouselInput/Carousel.js +25 -79
  5. package/dist/CarouselInput/CarouselActions.cjs +1 -1
  6. package/dist/CarouselInput/CarouselActions.js +1 -14
  7. package/dist/CarouselInput/CarouselImage.cjs +3 -4
  8. package/dist/CarouselInput/CarouselImage.js +13 -23
  9. package/dist/CarouselInput/CarouselInput.cjs +1 -1
  10. package/dist/CarouselInput/CarouselInput.js +12 -75
  11. package/dist/CarouselInput/CarouselSlide.cjs +1 -3
  12. package/dist/CarouselInput/CarouselSlide.js +4 -29
  13. package/dist/Checkbox/Checkbox.cjs +3 -3
  14. package/dist/Checkbox/Checkbox.js +18 -40
  15. package/dist/Dialog/Dialog.cjs +5 -5
  16. package/dist/Dialog/Dialog.js +21 -49
  17. package/dist/Dialog/DialogBody.cjs +2 -2
  18. package/dist/Dialog/DialogBody.js +6 -19
  19. package/dist/Dialog/DialogFooter.cjs +2 -2
  20. package/dist/Dialog/DialogFooter.js +7 -21
  21. package/dist/EmptyStateLayout/story-assets/Illo.cjs +1 -1
  22. package/dist/EmptyStateLayout/story-assets/Illo.js +2 -70
  23. package/dist/ModalLayout/ModalBody.cjs +2 -2
  24. package/dist/ModalLayout/ModalBody.js +4 -5
  25. package/dist/ModalLayout/ModalContext.cjs +1 -1
  26. package/dist/ModalLayout/ModalContext.js +2 -1
  27. package/dist/ModalLayout/ModalFooter.cjs +2 -6
  28. package/dist/ModalLayout/ModalFooter.js +9 -26
  29. package/dist/ModalLayout/ModalHeader.cjs +2 -2
  30. package/dist/ModalLayout/ModalHeader.js +10 -22
  31. package/dist/ModalLayout/ModalLayout.cjs +3 -5
  32. package/dist/ModalLayout/ModalLayout.js +10 -30
  33. package/dist/NumberInput/NumberInput.cjs +2 -2
  34. package/dist/NumberInput/NumberInput.js +68 -168
  35. package/dist/Pagination/Pagination.cjs +1 -5
  36. package/dist/Pagination/Pagination.js +7 -21
  37. package/dist/Pagination/components.cjs +7 -10
  38. package/dist/Pagination/components.js +34 -81
  39. package/dist/Popover/Popover.cjs +3 -3
  40. package/dist/Popover/Popover.js +93 -48
  41. package/dist/ProgressBar/ProgressBar.cjs +5 -5
  42. package/dist/ProgressBar/ProgressBar.js +6 -37
  43. package/dist/Radio/Radio.cjs +1 -4
  44. package/dist/Radio/Radio.js +5 -18
  45. package/dist/Searchbar/SearchForm.cjs +1 -1
  46. package/dist/Searchbar/SearchForm.js +2 -3
  47. package/dist/Searchbar/Searchbar.cjs +10 -11
  48. package/dist/Searchbar/Searchbar.js +25 -54
  49. package/dist/Status/Status.cjs +6 -6
  50. package/dist/Status/Status.js +8 -46
  51. package/dist/Switch/Switch.cjs +5 -5
  52. package/dist/Switch/Switch.js +16 -52
  53. package/dist/Tabs/TabGroup.cjs +1 -1
  54. package/dist/Tabs/TabGroup.js +13 -37
  55. package/dist/Tabs/TabPanels.cjs +1 -1
  56. package/dist/Tabs/TabPanels.js +11 -22
  57. package/dist/Tabs/Tabs.cjs +2 -2
  58. package/dist/Tabs/Tabs.js +55 -110
  59. package/dist/Tabs/TabsContext.cjs +1 -1
  60. package/dist/Tabs/TabsContext.js +11 -4
  61. package/dist/Textarea/Textarea.cjs +14 -12
  62. package/dist/Textarea/Textarea.js +33 -55
  63. package/dist/ToggleCheckbox/ToggleCheckbox.cjs +8 -8
  64. package/dist/ToggleCheckbox/ToggleCheckbox.js +25 -121
  65. package/dist/ToggleInput/ToggleInput.cjs +3 -3
  66. package/dist/ToggleInput/ToggleInput.js +17 -70
  67. package/dist/Typography/Typography.cjs +1 -1
  68. package/dist/Typography/Typography.js +6 -6
  69. package/dist/hooks/useControllableState.cjs +1 -1
  70. package/dist/hooks/useControllableState.js +6 -6
  71. package/dist/themes/utils.cjs +2 -2
  72. package/dist/themes/utils.js +1 -1
  73. package/package.json +8 -5
  74. package/dist/Tabs/useTabsFocus.cjs +0 -1
  75. package/dist/Tabs/useTabsFocus.js +0 -17
  76. package/dist/Textarea/TextareaInput.cjs +0 -30
  77. package/dist/Textarea/TextareaInput.js +0 -65
@@ -1,179 +1,79 @@
1
- import { jsx as n, jsxs as h, Fragment as L } from "react/jsx-runtime";
2
- import S, { useRef as y } from "react";
3
- import { NumberParser as T, NumberFormatter as j } from "@internationalized/number";
1
+ import { jsx as n, jsxs as h, Fragment as U } from "react/jsx-runtime";
2
+ import _, { useRef as b } from "react";
3
+ import { NumberParser as j, NumberFormatter as E } from "@internationalized/number";
4
4
  import { CarretDown as N } from "@strapi/icons";
5
- import r from "prop-types";
6
- import z from "styled-components";
7
- import { getDefaultLocale as U } from "../helpers/getDefaultLocale.js";
8
- import { KeyboardKeys as v } from "../helpers/keyboardKeys.js";
9
- import { useControllableState as _ } from "../hooks/useControllableState.js";
10
- import { useId as E } from "../hooks/useId.js";
11
- import { sizes as H } from "../themes/sizes.js";
12
- import { Field as M } from "../Field/Field.js";
13
- import { Flex as W } from "../Flex/Flex.js";
14
- import { FieldLabel as X } from "../Field/FieldLabel.js";
15
- import { FieldInput as Y } from "../Field/FieldInput.js";
5
+ import M from "styled-components";
6
+ import { getDefaultLocale as q } from "../helpers/getDefaultLocale.js";
7
+ import { KeyboardKeys as g } from "../helpers/keyboardKeys.js";
8
+ import { useControllableState as z } from "../hooks/useControllableState.js";
9
+ import { useId as H } from "../hooks/useId.js";
10
+ import { Field as O } from "../Field/Field.js";
11
+ import { Flex as T } from "../Flex/Flex.js";
12
+ import { FieldLabel as W } from "../Field/FieldLabel.js";
13
+ import { FieldInput as X } from "../Field/FieldInput.js";
16
14
  import { Icon as w } from "../Icon/Icon.js";
17
- import { FieldHint as G } from "../Field/FieldHint.js";
18
- import { FieldError as J } from "../Field/FieldError.js";
19
- const x = z.button`
15
+ import { FieldHint as Y } from "../Field/FieldHint.js";
16
+ import { FieldError as G } from "../Field/FieldError.js";
17
+ const x = M.button`
20
18
  display: flex;
21
19
  height: 1rem;
22
- align-items: ${({ reverse: o }) => o ? "flex-end" : "flex-start"};
23
- transform: translateY(${({ reverse: o }) => o ? "-2px" : "2px"});
24
- cursor: ${({ disabled: o }) => o ? "not-allowed" : void 0};
20
+ align-items: ${({ reverse: t }) => t ? "flex-end" : "flex-start"};
21
+ transform: translateY(${({ reverse: t }) => t ? "-2px" : "2px"});
22
+ cursor: ${({ disabled: t }) => t ? "not-allowed" : void 0};
25
23
  svg {
26
24
  display: block;
27
25
  height: ${4 / 16}rem;
28
- transform: ${({ reverse: o }) => o ? "rotateX(180deg)" : void 0};
26
+ transform: ${({ reverse: t }) => t ? "rotateX(180deg)" : void 0};
29
27
  }
30
- `, Q = "", u = S.forwardRef(
31
- ({
32
- size: o,
33
- startAction: I,
34
- name: A,
35
- hint: V,
36
- error: D,
37
- label: c,
38
- labelAction: F,
39
- locale: C,
40
- id: k,
41
- onValueChange: P,
42
- value: p,
43
- step: i,
44
- required: R,
45
- disabled: d,
46
- ...K
47
- }, O) => {
48
- const $ = E(k), f = C || U(), s = y(new T(f, { style: "decimal" })), m = y(new j(f, { maximumFractionDigits: 20 })), [a, q] = _({
49
- prop(e) {
50
- const t = String(p);
51
- return isNaN(t) || t !== e && e !== "" ? e : m.current.format(p);
52
- },
53
- defaultProp: Q,
54
- onChange(e) {
55
- const t = s.current.parse(e);
56
- P(isNaN(t) ? void 0 : t);
57
- }
58
- }), l = (e) => {
59
- q(String(e));
60
- }, B = ({ target: { value: e } }) => {
61
- s.current.isValidPartialNumber(e) && l(e);
62
- }, b = () => {
63
- if (!a) {
64
- l(i);
65
- return;
66
- }
67
- const e = s.current.parse(a), t = isNaN(e) ? i : e + i;
68
- l(m.current.format(t));
69
- }, g = () => {
70
- if (!a) {
71
- l(-i);
72
- return;
73
- }
74
- const e = s.current.parse(a), t = isNaN(e) ? -i : e - i;
75
- l(m.current.format(t));
76
- };
77
- return /* @__PURE__ */ n(M, { name: A, hint: V, error: D, id: $, required: R, children: /* @__PURE__ */ h(W, { direction: "column", alignItems: "stretch", gap: 1, children: [
78
- c && /* @__PURE__ */ n(X, { action: F, children: c }),
79
- /* @__PURE__ */ n(
80
- Y,
81
- {
82
- ref: O,
83
- startAction: I,
84
- disabled: d,
85
- type: "text",
86
- inputmode: "decimal",
87
- onChange: B,
88
- onKeyDown: (e) => {
89
- if (!d)
90
- switch (e.key) {
91
- case v.DOWN: {
92
- e.preventDefault(), g();
93
- break;
94
- }
95
- case v.UP: {
96
- e.preventDefault(), b();
97
- break;
98
- }
99
- }
100
- },
101
- onBlur: () => {
102
- if (a) {
103
- const e = s.current.parse(a), t = isNaN(e) ? "" : m.current.format(e);
104
- l(t);
105
- }
106
- },
107
- value: a,
108
- size: o,
109
- endAction: /* @__PURE__ */ h(L, { children: [
110
- /* @__PURE__ */ n(
111
- x,
112
- {
113
- disabled: d,
114
- "aria-hidden": !0,
115
- reverse: !0,
116
- onClick: b,
117
- tabIndex: -1,
118
- type: "button",
119
- "data-testid": "ArrowUp",
120
- children: /* @__PURE__ */ n(w, { as: N, color: "neutral500" })
121
- }
122
- ),
123
- /* @__PURE__ */ n(
124
- x,
125
- {
126
- disabled: d,
127
- "aria-hidden": !0,
128
- onClick: g,
129
- tabIndex: -1,
130
- type: "button",
131
- "data-testid": "ArrowDown",
132
- children: /* @__PURE__ */ n(w, { as: N, color: "neutral500" })
133
- }
134
- )
135
- ] }),
136
- ...K
28
+ `, J = "", pr = _.forwardRef(({ size: t = "M", startAction: y, name: I, hint: F, error: V, label: c, labelAction: D, locale: A, id: C, onValueChange: k, value: d, step: a = 1, required: P = !1, disabled: m = !1, ...R }, $) => {
29
+ const K = H(C), u = A || q(), s = b(new j(u, { style: "decimal" })), l = b(new E(u, { maximumFractionDigits: 20 })), [o, L] = z({
30
+ prop(r) {
31
+ const e = String(d);
32
+ return isNaN(Number(e)) || e !== r && r !== "" ? r : l.current.format(Number(d));
33
+ },
34
+ defaultProp: J,
35
+ onChange(r) {
36
+ const e = s.current.parse(r ?? "");
37
+ k(isNaN(e) ? void 0 : e);
38
+ }
39
+ }), i = (r) => {
40
+ L(String(r));
41
+ }, S = ({ target: { value: r } }) => {
42
+ s.current.isValidPartialNumber(r) && i(r);
43
+ }, f = () => {
44
+ if (!o) {
45
+ i(a);
46
+ return;
47
+ }
48
+ const r = s.current.parse(o), e = isNaN(r) ? a : r + a;
49
+ i(l.current.format(e));
50
+ }, p = () => {
51
+ if (!o) {
52
+ i(-a);
53
+ return;
54
+ }
55
+ const r = s.current.parse(o), e = isNaN(r) ? -a : r - a;
56
+ i(l.current.format(e));
57
+ }, v = (r) => {
58
+ if (!m)
59
+ switch (r.key) {
60
+ case g.DOWN: {
61
+ r.preventDefault(), p();
62
+ break;
137
63
  }
138
- ),
139
- /* @__PURE__ */ n(G, {}),
140
- /* @__PURE__ */ n(J, {})
141
- ] }) });
142
- }
143
- );
144
- u.displayName = "NumberInput";
145
- u.defaultProps = {
146
- "aria-label": void 0,
147
- disabled: !1,
148
- error: void 0,
149
- hint: void 0,
150
- id: void 0,
151
- label: void 0,
152
- labelAction: void 0,
153
- locale: void 0,
154
- required: !1,
155
- size: "M",
156
- startAction: void 0,
157
- step: 1,
158
- value: void 0
159
- };
160
- u.propTypes = {
161
- "aria-label": r.string,
162
- disabled: r.bool,
163
- error: r.string,
164
- hint: r.oneOfType([r.string, r.node, r.arrayOf(r.node)]),
165
- id: r.string,
166
- label: r.string,
167
- labelAction: r.element,
168
- locale: r.string,
169
- name: r.string.isRequired,
170
- onValueChange: r.func.isRequired,
171
- required: r.bool,
172
- size: r.oneOf(Object.keys(H.input)),
173
- startAction: r.element,
174
- step: r.number,
175
- value: r.number
176
- };
64
+ case g.UP: {
65
+ r.preventDefault(), f();
66
+ break;
67
+ }
68
+ }
69
+ }, B = () => {
70
+ if (o) {
71
+ const r = s.current.parse(o), e = isNaN(r) ? "" : l.current.format(r);
72
+ i(e);
73
+ }
74
+ };
75
+ return n(O, { name: I, hint: F, error: V, id: K, required: P, children: h(T, { direction: "column", alignItems: "stretch", gap: 1, children: [c && n(W, { action: D, children: c }), n(X, { ref: $, startAction: y, disabled: m, type: "text", inputMode: "decimal", onChange: S, onKeyDown: v, onBlur: B, value: o, size: t, endAction: h(U, { children: [n(x, { disabled: m, "aria-hidden": !0, reverse: !0, onClick: f, tabIndex: -1, type: "button", "data-testid": "ArrowUp", children: n(w, { as: N, color: "neutral500" }) }), n(x, { disabled: m, "aria-hidden": !0, onClick: p, tabIndex: -1, type: "button", "data-testid": "ArrowDown", children: n(w, { as: N, color: "neutral500" }) })] }), ...R }), n(Y, {}), n(G, {})] }) });
76
+ });
177
77
  export {
178
- u as NumberInput
78
+ pr as NumberInput
179
79
  };
@@ -1,5 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),p=require("react"),g=require("prop-types"),b=require("styled-components"),P=require("./PaginationContext.cjs"),_=require("../Flex/Flex.cjs"),s=e=>e&&e.__esModule?e:{default:e};function m(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const l=m(p),a=s(g),u=s(b),j=u.default.nav``,x=u.default(_.Flex)`
2
- & > * + * {
3
- margin-left: ${({theme:e})=>e.spaces[1]};
4
- }
5
- `,o=({children:e,label:n,activePage:t,pageCount:r})=>{const c=l.useMemo(()=>({activePage:t,pageCount:r}),[t,r]);return i.jsx(P.PaginationContext.Provider,{value:c,children:i.jsx(j,{"aria-label":n,children:i.jsx(x,{as:"ul",children:l.Children.map(e,(d,f)=>i.jsx("li",{children:d},f))})})})};o.defaultProps={label:"pagination"};o.propTypes={activePage:a.default.number.isRequired,children:a.default.node.isRequired,label:a.default.string,pageCount:a.default.number.isRequired};exports.Pagination=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("react"),u=require("./PaginationContext.cjs"),d=require("../Box/Box.cjs"),x=require("../Flex/Flex.cjs");function g(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=g(l),f=({children:e,label:n="Pagination",activePage:t,pageCount:r})=>{const a=i.useMemo(()=>({activePage:t,pageCount:r}),[t,r]);return o.jsx(u.PaginationContext.Provider,{value:a,children:o.jsx(d.Box,{"aria-label":n,as:"nav",children:o.jsx(x.Flex,{as:"ol",gap:1,children:i.Children.map(e,(c,s)=>o.jsx("li",{children:c},s))})})})};exports.Pagination=f;
@@ -1,26 +1,12 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import * as t from "react";
3
- import e from "prop-types";
4
- import a from "styled-components";
2
+ import * as n from "react";
5
3
  import { PaginationContext as c } from "./PaginationContext.js";
6
- import { Flex as u } from "../Flex/Flex.js";
7
- const f = a.nav``, g = a(u)`
8
- & > * + * {
9
- margin-left: ${({ theme: i }) => i.spaces[1]};
10
- }
11
- `, l = ({ children: i, label: s, activePage: n, pageCount: o }) => {
12
- const p = t.useMemo(() => ({ activePage: n, pageCount: o }), [n, o]);
13
- return /* @__PURE__ */ r(c.Provider, { value: p, children: /* @__PURE__ */ r(f, { "aria-label": s, children: /* @__PURE__ */ r(g, { as: "ul", children: t.Children.map(i, (m, d) => /* @__PURE__ */ r("li", { children: m }, d)) }) }) });
14
- };
15
- l.defaultProps = {
16
- label: "pagination"
17
- };
18
- l.propTypes = {
19
- activePage: e.number.isRequired,
20
- children: e.node.isRequired,
21
- label: e.string,
22
- pageCount: e.number.isRequired
4
+ import { Box as p } from "../Box/Box.js";
5
+ import { Flex as s } from "../Flex/Flex.js";
6
+ const u = ({ children: t, label: a = "Pagination", activePage: o, pageCount: i }) => {
7
+ const e = n.useMemo(() => ({ activePage: o, pageCount: i }), [o, i]);
8
+ return r(c.Provider, { value: e, children: r(p, { "aria-label": a, as: "nav", children: r(s, { as: "ol", gap: 1, children: n.Children.map(t, (m, l) => r("li", { children: m }, l)) }) }) });
23
9
  };
24
10
  export {
25
- l as Pagination
11
+ u as Pagination
26
12
  };
@@ -1,22 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime");require("react");const g=require("@strapi/icons"),q=require("prop-types"),j=require("react-router-dom"),k=require("styled-components"),u=require("./PaginationContext.cjs"),L=require("../themes/utils.cjs"),m=require("../Typography/Typography.cjs"),d=require("../VisuallyHidden/VisuallyHidden.cjs"),y=e=>e&&e.__esModule?e:{default:e},a=y(q),n=y(k),f=n.default(m.Typography)`
2
- line-height: revert;
3
- `,T={active:!0},c=n.default(j.NavLink).withConfig({shouldForwardProp:(e,i)=>!T[e]&&i(e)})`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("@strapi/icons"),v=require("react-router-dom"),y=require("styled-components"),d=require("./PaginationContext.cjs"),b=require("../themes/utils.cjs"),o=require("../VisuallyHidden/VisuallyHidden.cjs"),c=require("../Typography/Typography.cjs"),P=require("../Box/Box.cjs"),j=e=>e&&e.__esModule?e:{default:e},l=j(y),k={active:!0},h=l.default(v.NavLink).withConfig({shouldForwardProp:(e,i)=>!k[e]&&i(e)})`
4
2
  padding: ${({theme:e})=>e.spaces[3]};
5
3
  border-radius: ${({theme:e})=>e.borderRadius};
6
4
  box-shadow: ${({active:e,theme:i})=>e?i.shadows.filterShadow:void 0};
7
5
  text-decoration: none;
8
6
  display: flex;
9
7
 
10
- ${L.buttonFocusStyle}
11
- `,$=n.default(c)`
8
+ ${b.buttonFocusStyle}
9
+ `,L=l.default(h)`
12
10
  color: ${({theme:e,active:i})=>i?e.colors.primary700:e.colors.neutral800};
13
11
  background: ${({theme:e,active:i})=>i?e.colors.neutral0:void 0};
14
12
 
15
13
  &:hover {
16
14
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
17
15
  }
18
- `,x=n.default(c)`
19
- font-size: 0.7rem;
16
+ `,g=l.default(h)`
17
+ font-size: ${11/16}rem;
18
+
20
19
  svg path {
21
20
  fill: ${e=>e["aria-disabled"]?e.theme.colors.neutral300:e.theme.colors.neutral600};
22
21
  }
@@ -31,6 +30,4 @@
31
30
  ${e=>e["aria-disabled"]?`
32
31
  pointer-events: none;
33
32
  `:void 0}
34
- `,R=n.default(c)`
35
- color: ${({theme:e})=>e.colors.neutral800};
36
- `,p=({children:e,to:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===1;return r.jsxs(x,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronLeft,{"aria-hidden":!0})]})};p.displayName="PreviousLink";const h=({children:e,to:i,...o})=>{const{activePage:s,pageCount:t}=u.usePagination(),l=s===t;return r.jsxs(x,{to:l?"#":i,"aria-disabled":l,tabIndex:l?-1:void 0,...o,children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(g.ChevronRight,{"aria-hidden":!0})]})};h.displayName="NextLink";const v=({number:e,children:i,...o})=>{const{activePage:s}=u.usePagination(),t=s===e;return r.jsxs($,{...o,active:t,children:[r.jsx(d.VisuallyHidden,{children:i}),r.jsx(f,{"aria-hidden":!0,variant:"pi",fontWeight:t?"bold":null,children:e})]})};v.displayName="PageLink";const P=({children:e,...i})=>r.jsxs(R,{...i,as:"div",children:[r.jsx(d.VisuallyHidden,{children:e}),r.jsx(f,{"aria-hidden":!0,variant:"pi",children:"…"})]});v.propTypes={children:a.default.node.isRequired,number:a.default.number.isRequired};const b={children:a.default.node.isRequired,to:a.default.string.isRequired};h.propTypes=b;p.propTypes=b;P.propTypes={children:a.default.node.isRequired};exports.Dots=P;exports.NextLink=h;exports.PageLink=v;exports.PreviousLink=p;
33
+ `,x=({children:e,to:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===1;return n.jsxs(g,{to:t?"#":i,"aria-disabled":t,tabIndex:t?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronLeft,{"aria-hidden":!0})]})};x.displayName="PreviousLink";const f=({children:e,to:i,...r})=>{const{activePage:a,pageCount:t}=d.usePagination(),s=a===t;return n.jsxs(g,{to:s?"#":i,"aria-disabled":s,tabIndex:s?-1:void 0,...r,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(u.ChevronRight,{"aria-hidden":!0})]})};f.displayName="NextLink";const p=({number:e,children:i,...r})=>{const{activePage:a}=d.usePagination(),t=a===e;return n.jsxs(L,{...r,active:t,children:[n.jsx(o.VisuallyHidden,{children:i}),n.jsx(c.Typography,{"aria-hidden":!0,fontWeight:t?"bold":void 0,lineHeight:"revert",variant:"pi",children:e})]})};p.displayName="PageLink";const $=({children:e,...i})=>n.jsxs(P.Box,{...i,children:[n.jsx(o.VisuallyHidden,{children:e}),n.jsx(c.Typography,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]});exports.Dots=$;exports.NextLink=f;exports.PageLink=p;exports.PreviousLink=x;
@@ -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 i=require("react/jsx-runtime"),j=require("react"),a=require("@floating-ui/react-dom"),O=require("styled-components"),f=require("../helpers/strings.cjs"),_=require("../hooks/useId.cjs"),k=require("../hooks/useIntersection.cjs"),d=require("../Box/Box.cjs"),S=require("../Portal/Portal.cjs"),v=e=>e&&e.__esModule?e:{default:e};function q(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 o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=q(j),p=v(O),R=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"],$=p.default(d.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
- `,b=({source:e,children:r,spacing:t=0,fullWidth:o=!1,placement:n="bottom-start",centered:s=!1,...c})=>{const[g,m]=l.useState(void 0),{x,y:w,reference:u,floating:P,strategy:y}=a.useFloating({strategy:"fixed",placement:s?"bottom":n,middleware:[a.offset({mainAxis:t}),a.shift(),a.flip()],whileElementsMounted:a.autoUpdate});return l.useLayoutEffect(()=>{u(e.current)},[e,u]),l.useLayoutEffect(()=>{o&&m(e.current.offsetWidth)},[o,e]),i.jsx($,{ref:P,style:{left:x,top:w,position:y,width:g||void 0},hasRadius:!0,background:"neutral0",padding:1,...c,children:r})},h=({children:e,intersectionId:r,onReachEnd:t,...o})=>{const n=l.useRef(null),s=_.useId();return k.useIntersection(n,t??(()=>{}),{selectorToWatch:`#${f.stripReactIdOfColon(s)}`,skipWhen:!r||!t}),i.jsxs(I,{ref:n,...o,children:[e,r&&t&&i.jsx(d.Box,{id:f.stripReactIdOfColon(s),width:"100%",height:"1px"})]})},I=p.default(d.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
- `,E=({children:e,source:r,spacing:t,fullWidth:o,placement:n,centered:s,...c})=>i.jsx(S.Portal,{children:i.jsx(b,{source:r,spacing:t,fullWidth:o,placement:n,centered:s,children:i.jsx(h,{...c,children:e})})});exports.Content=b;exports.POPOVER_PLACEMENTS=R;exports.Popover=E;exports.Scrolling=h;
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;