@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,4 +1,4 @@
1
- import { SIGMA as e, PI as s, OMEGA as t, EPSILON as o, DELTA as l, BETA as f, ALPHA as r } from "./constants.js";
1
+ import { SIGMA as e, PI as s, OMEGA as t, EPSILON as o, DELTA as f, BETA as l, ALPHA as r } from "./constants.js";
2
2
  const $ = ({ ellipsis: n = !1 }) => n && `
3
3
  display: block;
4
4
  white-space: nowrap;
@@ -12,13 +12,13 @@ const $ = ({ ellipsis: n = !1 }) => n && `
12
12
  font-size: ${i.fontSizes[5]};
13
13
  line-height: ${i.lineHeights[2]};
14
14
  `;
15
- case f:
15
+ case l:
16
16
  return `
17
17
  font-weight: ${i.fontWeights.bold};
18
18
  font-size: ${i.fontSizes[4]};
19
19
  line-height: ${i.lineHeights[1]};
20
20
  `;
21
- case l:
21
+ case f:
22
22
  return `
23
23
  font-weight: ${i.fontWeights.semiBold};
24
24
  font-size: ${i.fontSizes[3]};
@@ -51,9 +51,8 @@ const $ = ({ ellipsis: n = !1 }) => n && `
51
51
  font-size: ${i.fontSizes[2]};
52
52
  `;
53
53
  }
54
- }, z = ({ theme: n, textColor: i }) => n.colors[i || "neutral800"];
54
+ };
55
55
  export {
56
56
  $ as ellipsisStyle,
57
- z as handleColor,
58
57
  a as variantStyle
59
58
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),f=require("prop-types"),m=require("styled-components"),p=require("./Divider.cjs"),a=require("../../Flex/Flex.cjs"),y=require("../../Box/Box.cjs"),l=e=>e&&e.__esModule?e:{default:e},r=l(f),b=l(m),g=b.default(a.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),u=require("styled-components"),h=require("./Divider.cjs"),s=require("../../Flex/Flex.cjs"),m=require("../../Box/Box.cjs"),b=e=>e&&e.__esModule?e:{default:e},f=b(u),x=f.default(s.Flex)`
2
2
  // CrumbLinks do have padding-x, because they need to have a
3
3
  // interaction effect, which mis-aligns the breadcrumbs on the left.
4
4
  // This normalizes the behavior by moving the first item to left by
@@ -6,4 +6,4 @@
6
6
  :first-child {
7
7
  margin-left: ${({theme:e})=>`calc(-1*${e.spaces[2]})`};
8
8
  }
9
- `,s=({label:e,children:d,...o})=>{const i=n.Children.toArray(d);return t.jsx(y.Box,{"aria-label":e,...o,children:t.jsx(g,{as:"ol",horizontal:!0,children:n.Children.map(i,(u,c)=>{const h=i.length>1&&c+1<i.length;return t.jsxs(a.Flex,{inline:!0,as:"li",children:[u,h&&t.jsx(p.Divider,{})]})})})})};s.displayName="Breadcrumbs";s.propTypes={children:r.default.oneOfType([r.default.arrayOf(r.default.node),r.default.node]).isRequired,label:r.default.string.isRequired};exports.Breadcrumbs=s;
9
+ `,n=({label:e,children:a,...l})=>{const r=i.Children.toArray(a);return t.jsx(m.Box,{"aria-label":e,...l,children:t.jsx(x,{as:"ol",children:i.Children.map(r,(o,c)=>{const d=r.length>1&&c+1<r.length;return t.jsxs(s.Flex,{inline:!0,as:"li",children:[o,d&&t.jsx(h.Divider,{})]})})})})};n.displayName="Breadcrumbs";exports.Breadcrumbs=n;
@@ -1,33 +1,25 @@
1
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { Children as o } from "react";
3
- import e from "prop-types";
4
- import p from "styled-components";
5
- import { Divider as f } from "./Divider.js";
6
- import { Flex as n } from "../../Flex/Flex.js";
7
- import { Box as u } from "../../Box/Box.js";
8
- const y = p(n)`
1
+ import { jsx as i, jsxs as h } from "react/jsx-runtime";
2
+ import { Children as t } from "react";
3
+ import d from "styled-components";
4
+ import { Divider as c } from "./Divider.js";
5
+ import { Flex as a } from "../../Flex/Flex.js";
6
+ import { Box as f } from "../../Box/Box.js";
7
+ const p = d(a)`
9
8
  // CrumbLinks do have padding-x, because they need to have a
10
9
  // interaction effect, which mis-aligns the breadcrumbs on the left.
11
10
  // This normalizes the behavior by moving the first item to left by
12
11
  // the same amount it has inner padding
13
12
  :first-child {
14
- margin-left: ${({ theme: r }) => `calc(-1*${r.spaces[2]})`};
13
+ margin-left: ${({ theme: e }) => `calc(-1*${e.spaces[2]})`};
15
14
  }
16
- `, a = ({ label: r, children: s, ...l }) => {
17
- const i = o.toArray(s);
18
- return /* @__PURE__ */ t(u, { "aria-label": r, ...l, children: /* @__PURE__ */ t(y, { as: "ol", horizontal: !0, children: o.map(i, (m, d) => {
19
- const h = i.length > 1 && d + 1 < i.length;
20
- return /* @__PURE__ */ c(n, { inline: !0, as: "li", children: [
21
- m,
22
- h && /* @__PURE__ */ t(f, {})
23
- ] });
15
+ `, b = ({ label: e, children: n, ...o }) => {
16
+ const r = t.toArray(n);
17
+ return i(f, { "aria-label": e, ...o, children: i(p, { as: "ol", children: t.map(r, (s, l) => {
18
+ const m = r.length > 1 && l + 1 < r.length;
19
+ return h(a, { inline: !0, as: "li", children: [s, m && i(c, {})] });
24
20
  }) }) });
25
21
  };
26
- a.displayName = "Breadcrumbs";
27
- a.propTypes = {
28
- children: e.oneOfType([e.arrayOf(e.node), e.node]).isRequired,
29
- label: e.string.isRequired
30
- };
22
+ b.displayName = "Breadcrumbs";
31
23
  export {
32
- a as Breadcrumbs
24
+ b as Breadcrumbs
33
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime");require("react");const a=require("prop-types"),u=require("../../Box/Box.cjs"),d=require("../../Typography/Typography.cjs"),p=e=>e&&e.__esModule?e:{default:e},i=p(a),r=({children:e,isCurrent:t,...n})=>o.jsx(u.Box,{paddingLeft:2,paddingRight:2,paddingTop:1,paddingBottom:1,children:o.jsx(d.Typography,{variant:"pi",textColor:"neutral800",fontWeight:t?"bold":"normal","aria-current":t,...n,children:e})});r.displayName="Crumb";r.defaultProps={isCurrent:!1};r.propTypes={children:i.default.node.isRequired,isCurrent:i.default.bool};exports.Crumb=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),a=require("../../Box/Box.cjs"),n=require("../../Typography/Typography.cjs"),t=({children:o,isCurrent:e=!1,...i})=>r.jsx(a.Box,{paddingLeft:2,paddingRight:2,paddingTop:1,paddingBottom:1,children:r.jsx(n.Typography,{variant:"pi",textColor:"neutral800",fontWeight:e?"bold":"normal","aria-current":e,...i,children:o})});t.displayName="Crumb";exports.Crumb=t;
@@ -1,27 +1,8 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import "react";
3
- import i from "prop-types";
4
- import { Box as a } from "../../Box/Box.js";
5
- import { Typography as d } from "../../Typography/Typography.js";
6
- const r = ({ children: t, isCurrent: o, ...e }) => /* @__PURE__ */ p(a, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ p(
7
- d,
8
- {
9
- variant: "pi",
10
- textColor: "neutral800",
11
- fontWeight: o ? "bold" : "normal",
12
- "aria-current": o,
13
- ...e,
14
- children: t
15
- }
16
- ) });
17
- r.displayName = "Crumb";
18
- r.defaultProps = {
19
- isCurrent: !1
20
- };
21
- r.propTypes = {
22
- children: i.node.isRequired,
23
- isCurrent: i.bool
24
- };
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Box as i } from "../../Box/Box.js";
3
+ import { Typography as p } from "../../Typography/Typography.js";
4
+ const d = ({ children: t, isCurrent: o = !1, ...a }) => r(i, { paddingLeft: 2, paddingRight: 2, paddingTop: 1, paddingBottom: 1, children: r(p, { variant: "pi", textColor: "neutral800", fontWeight: o ? "bold" : "normal", "aria-current": o, ...a, children: t }) });
5
+ d.displayName = "Crumb";
25
6
  export {
26
- r as Crumb
7
+ d as Crumb
27
8
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime");require("react");const i=require("prop-types"),u=require("styled-components"),l=require("../../BaseLink/BaseLink.cjs"),t=e=>e&&e.__esModule?e:{default:e},r=t(i),d=t(u),a=d.default(l.BaseLink)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("styled-components"),s=require("../../BaseLink/BaseLink.cjs"),i=e=>e&&e.__esModule?e:{default:e},l=i(n),u=l.default(s.BaseLink)`
2
2
  border-radius: ${({theme:e})=>e.borderRadius};
3
3
  color: ${({theme:e})=>e.colors.neutral600};
4
4
  font-size: ${({theme:e})=>e.fontSizes[1]};
@@ -11,4 +11,4 @@
11
11
  background-color: ${({theme:e})=>e.colors.neutral200};
12
12
  color: ${({theme:e})=>e.colors.neutral700};
13
13
  }
14
- `,o=({children:e,...s})=>n.jsx(a,{...s,children:e});o.displayName="CrumbLink";o.defaultProps={to:void 0};o.propTypes={children:r.default.node.isRequired,to:r.default.string};exports.CrumbLink=o;
14
+ `,o=({children:e,...r})=>t.jsx(u,{...r,children:e});o.displayName="CrumbLink";exports.CrumbLink=o;
@@ -1,9 +1,7 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import "react";
3
- import e from "prop-types";
4
- import t from "styled-components";
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import i from "styled-components";
5
3
  import { BaseLink as n } from "../../BaseLink/BaseLink.js";
6
- const d = t(n)`
4
+ const s = i(n)`
7
5
  border-radius: ${({ theme: o }) => o.borderRadius};
8
6
  color: ${({ theme: o }) => o.colors.neutral600};
9
7
  font-size: ${({ theme: o }) => o.fontSizes[1]};
@@ -16,15 +14,8 @@ const d = t(n)`
16
14
  background-color: ${({ theme: o }) => o.colors.neutral200};
17
15
  color: ${({ theme: o }) => o.colors.neutral700};
18
16
  }
19
- `, r = ({ children: o, ...i }) => /* @__PURE__ */ s(d, { ...i, children: o });
20
- r.displayName = "CrumbLink";
21
- r.defaultProps = {
22
- to: void 0
23
- };
24
- r.propTypes = {
25
- children: e.node.isRequired,
26
- to: e.string
27
- };
17
+ `, t = ({ children: o, ...r }) => e(s, { ...r, children: o });
18
+ t.displayName = "CrumbLink";
28
19
  export {
29
- r as CrumbLink
20
+ t as CrumbLink
30
21
  };
@@ -1,8 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime");require("react");const s=require("@strapi/icons"),i=require("prop-types"),l=require("styled-components"),a=require("../SimpleMenu/SimpleMenu.cjs"),d=require("../../Button/Button.cjs"),o=e=>e&&e.__esModule?e:{default:e},r=o(i),c=o(l),p=c.default(d.Button)`
2
- padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[3]}`};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("styled-components"),s=require("../SimpleMenu/SimpleMenu.cjs"),l=require("../../Button/Button.cjs"),r=e=>e&&e.__esModule?e:{default:e},i=r(o),c=i.default(l.Button)`
2
+ padding: ${({theme:e})=>`${e.spaces[1]} ${e.spaces[2]}`};
3
+ height: unset;
3
4
 
4
5
  :hover,
5
6
  :focus {
6
7
  background-color: ${({theme:e})=>e.colors.neutral200};
7
8
  }
8
- `,t=({children:e,...n})=>u.jsx(a.SimpleMenu,{noBorder:!0,icon:u.jsx(s.CarretDown,{}),as:p,size:"S",...n,children:e});t.displayName="CrumbSimpleMenu";t.propTypes={"aria-label":r.default.string.isRequired,children:r.default.oneOfType([r.default.arrayOf(r.default.node),r.default.node]).isRequired};exports.CrumbSimpleMenu=t;
9
+ `,t=({children:e,...u})=>n.jsx(s.SimpleMenu,{endIcon:null,as:c,size:"S",...u,children:e});t.displayName="CrumbSimpleMenu";exports.CrumbSimpleMenu=t;
@@ -1,23 +1,17 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import "react";
3
- import { CarretDown as t } from "@strapi/icons";
4
- import o from "prop-types";
5
- import m from "styled-components";
6
- import { SimpleMenu as n } from "../SimpleMenu/SimpleMenu.js";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import n from "styled-components";
3
+ import { SimpleMenu as t } from "../SimpleMenu/SimpleMenu.js";
7
4
  import { Button as s } from "../../Button/Button.js";
8
- const a = m(s)`
9
- padding: ${({ theme: r }) => `${r.spaces[1]} ${r.spaces[3]}`};
5
+ const m = n(s)`
6
+ padding: ${({ theme: o }) => `${o.spaces[1]} ${o.spaces[2]}`};
7
+ height: unset;
10
8
 
11
9
  :hover,
12
10
  :focus {
13
- background-color: ${({ theme: r }) => r.colors.neutral200};
11
+ background-color: ${({ theme: o }) => o.colors.neutral200};
14
12
  }
15
- `, i = ({ children: r, ...p }) => /* @__PURE__ */ e(n, { noBorder: !0, icon: /* @__PURE__ */ e(t, {}), as: a, size: "S", ...p, children: r });
13
+ `, i = ({ children: o, ...e }) => r(t, { endIcon: null, as: m, size: "S", ...e, children: o });
16
14
  i.displayName = "CrumbSimpleMenu";
17
- i.propTypes = {
18
- "aria-label": o.string.isRequired,
19
- children: o.oneOfType([o.arrayOf(o.node), o.node]).isRequired
20
- };
21
15
  export {
22
16
  i as CrumbSimpleMenu
23
17
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const i=require("../../Box/Box.cjs"),t=require("../../Typography/Typography.cjs"),r=()=>e.jsx(i.Box,{"aria-hidden":!0,paddingLeft:1,paddingRight:1,children:e.jsx(t.Typography,{variant:"pi",textColor:"neutral500",children:"/"})});r.displayName="Divider";exports.Divider=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../Box/Box.cjs"),t=require("../../Typography/Typography.cjs"),r=()=>e.jsx(i.Box,{"aria-hidden":!0,paddingLeft:1,paddingRight:1,children:e.jsx(t.Typography,{variant:"pi",textColor:"neutral500",children:"/"})});r.displayName="Divider";exports.Divider=r;
@@ -1,9 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import "react";
3
2
  import { Box as i } from "../../Box/Box.js";
4
3
  import { Typography as t } from "../../Typography/Typography.js";
5
- const o = () => /* @__PURE__ */ r(i, { "aria-hidden": !0, paddingLeft: 1, paddingRight: 1, children: /* @__PURE__ */ r(t, { variant: "pi", textColor: "neutral500", children: "/" }) });
6
- o.displayName = "Divider";
4
+ const e = () => r(i, { "aria-hidden": !0, paddingLeft: 1, paddingRight: 1, children: r(t, { variant: "pi", textColor: "neutral500", children: "/" }) });
5
+ e.displayName = "Divider";
7
6
  export {
8
- o as Divider
7
+ e as Divider
9
8
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),y=require("@radix-ui/react-dropdown-menu"),d=require("@strapi/icons"),c=require("styled-components"),S=require("../../helpers/theme.cjs"),w=require("../Link/Link.cjs"),j=require("../../Button/Button.cjs"),m=require("../../Box/Box.cjs"),u=require("../../Flex/Flex.cjs"),i=require("../../Typography/Typography.cjs"),T=e=>e&&e.__esModule?e:{default:e};function C(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const n=C(y),a=T(c),R=n.Root,$=l.forwardRef(({size:e,...r},o)=>t.jsx(n.Trigger,{asChild:!0,children:t.jsx(j.Button,{ref:o,type:"button",variant:"ghost",endIcon:t.jsx(d.CarretDown,{width:`${6/16}rem`,height:`${4/16}rem`,"aria-hidden":!0}),paddingTop:e==="S"?1:2,paddingBottom:e==="S"?1:2,paddingLeft:e==="S"?3:4,paddingRight:e==="S"?3:4,...r})})),v=l.forwardRef(({children:e,intersectionId:r,popoverPlacement:o="bottom-start",...s},p)=>{const[f,x]=o.split("-");return t.jsx(n.Portal,{children:t.jsx(n.Content,{align:x,side:f,loop:!0,asChild:!0,children:t.jsxs(h,{ref:p,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",position:"relative",overflow:"auto",...s,children:[e,t.jsx(m.Box,{id:r,width:"100%",height:"1px"})]})})})}),h=a.default(u.Flex)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),y=require("@radix-ui/react-dropdown-menu"),d=require("@strapi/icons"),c=require("styled-components"),S=require("../../helpers/theme.cjs"),w=require("../Link/Link.cjs"),j=require("../../Button/Button.cjs"),m=require("../../Box/Box.cjs"),u=require("../../Flex/Flex.cjs"),a=require("../../Typography/Typography.cjs"),T=e=>e&&e.__esModule?e:{default:e};function C(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const n=C(y),l=T(c),R=n.Root,v=s.forwardRef(({size:e,endIcon:r=t.jsx(d.CarretDown,{width:`${6/16}rem`,height:`${4/16}rem`,"aria-hidden":!0}),...o},i)=>t.jsx(n.Trigger,{asChild:!0,children:t.jsx(j.Button,{ref:i,type:"button",variant:"ghost",endIcon:r,paddingTop:e==="S"?1:2,paddingBottom:e==="S"?1:2,paddingLeft:e==="S"?3:4,paddingRight:e==="S"?3:4,...o})})),$=s.forwardRef(({children:e,intersectionId:r,popoverPlacement:o="bottom-start",...i},f)=>{const[p,x]=o.split("-");return t.jsx(n.Portal,{children:t.jsx(n.Content,{align:x,side:p,loop:!0,asChild:!0,children:t.jsxs(h,{ref:f,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",position:"relative",overflow:"auto",...i,children:[e,t.jsx(m.Box,{id:r,width:"100%",height:"1px"})]})})})}),h=l.default(u.Flex)`
2
2
  scrollbar-width: none;
3
3
  -ms-overflow-style: none;
4
4
  -webkit-overflow-scrolling: touch;
@@ -6,20 +6,20 @@
6
6
  &::-webkit-scrollbar {
7
7
  display: none;
8
8
  }
9
- `,k=({onSelect:e,disabled:r=!1,...o})=>t.jsx(n.Item,{asChild:!0,onSelect:e,disabled:r,children:o.isLink||o.isExternal?t.jsx(M,{color:"neutral800",...o,isExternal:o.isExternal??!1,children:t.jsx(i.Typography,{children:o.children})}):t.jsx(b,{cursor:"pointer",color:"neutral800",background:"transparent",borderStyle:"none",...o,children:t.jsx(i.Typography,{children:o.children})})}),g=({theme:e})=>c.css`
9
+ `,k=({onSelect:e,disabled:r=!1,...o})=>t.jsx(n.Item,{asChild:!0,onSelect:e,disabled:r,children:o.isLink||o.isExternal?t.jsx(M,{color:"neutral800",...o,isExternal:o.isExternal??!1,children:t.jsx(a.Typography,{children:o.children})}):t.jsx(b,{cursor:"pointer",color:"neutral800",background:"transparent",borderStyle:"none",...o,children:t.jsx(a.Typography,{children:o.children})})}),g=({theme:e})=>c.css`
10
10
  text-align: left;
11
11
  width: 100%;
12
12
  border-radius: ${e.borderRadius};
13
13
  padding: ${e.spaces[2]} ${e.spaces[4]};
14
14
 
15
- ${i.Typography} {
15
+ ${a.Typography} {
16
16
  color: inherit;
17
17
  }
18
18
 
19
19
  &[aria-disabled] {
20
20
  cursor: not-allowed;
21
21
 
22
- ${i.Typography} {
22
+ ${a.Typography} {
23
23
  color: ${e.colors.neutral500};
24
24
  }
25
25
  }
@@ -35,9 +35,9 @@
35
35
  content: none;
36
36
  }
37
37
  }
38
- `,b=a.default(u.Flex)`
38
+ `,b=l.default(u.Flex)`
39
39
  ${g}
40
- `,M=a.default(w.Link)`
40
+ `,M=l.default(w.Link)`
41
41
  /* We include this here again because typically when people use OptionLink they provide an as prop which cancels the Box props */
42
42
  color: ${({theme:e,color:r})=>S.extractStyleFromTheme(e.colors,r,void 0)};
43
43
  text-decoration: none;
@@ -52,14 +52,14 @@
52
52
  }
53
53
 
54
54
  ${g}
55
- `,q=l.forwardRef((e,r)=>t.jsx(n.Label,{asChild:!0,children:t.jsx(L,{ref:r,variant:"sigma",textColor:"neutral600",...e})})),L=a.default(i.Typography)`
55
+ `,q=s.forwardRef((e,r)=>t.jsx(n.Label,{asChild:!0,children:t.jsx(L,{ref:r,variant:"sigma",textColor:"neutral600",...e})})),L=l.default(a.Typography)`
56
56
  padding: ${({theme:e})=>e.spaces[2]} ${({theme:e})=>e.spaces[4]};
57
- `,O=n.Sub,_=l.forwardRef(({disabled:e=!1,...r},o)=>t.jsx(n.SubTrigger,{asChild:!0,disabled:e,children:t.jsxs(B,{ref:o,color:"neutral800",as:"button",type:"button",background:"transparent",borderStyle:"none",gap:5,...r,children:[t.jsx(i.Typography,{children:r.children}),t.jsx(I,{height:12,width:12})]})})),B=a.default(b)`
57
+ `,O=n.Sub,_=s.forwardRef(({disabled:e=!1,...r},o)=>t.jsx(n.SubTrigger,{asChild:!0,disabled:e,children:t.jsxs(B,{ref:o,color:"neutral800",as:"button",type:"button",background:"transparent",borderStyle:"none",gap:5,...r,children:[t.jsx(a.Typography,{children:r.children}),t.jsx(I,{height:12,width:12})]})})),B=l.default(b)`
58
58
  &[data-state='open'] {
59
59
  background-color: ${({theme:e})=>e.colors.primary100};
60
60
  }
61
- `,I=a.default(d.ChevronRight)`
61
+ `,I=l.default(d.ChevronRight)`
62
62
  path {
63
63
  fill: ${({theme:e})=>e.colors.neutral500};
64
64
  }
65
- `,D=l.forwardRef((e,r)=>t.jsx(n.Portal,{children:t.jsx(n.SubContent,{sideOffset:8,asChild:!0,children:t.jsx(h,{ref:r,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",...e})})})),P=R,F=$,E=v,W=k,H=q,A=O,N=_,V=D;exports.Content=E;exports.Item=W;exports.Label=H;exports.Root=P;exports.SubContent=V;exports.SubRoot=A;exports.SubTrigger=N;exports.Trigger=F;
65
+ `,D=s.forwardRef((e,r)=>t.jsx(n.Portal,{children:t.jsx(n.SubContent,{sideOffset:8,asChild:!0,children:t.jsx(h,{ref:r,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...e})})})),P=R,F=v,E=$,W=k,H=q,A=O,N=_,V=D;exports.Content=E;exports.Item=W;exports.Label=H;exports.Root=P;exports.SubContent=V;exports.SubRoot=A;exports.SubTrigger=N;exports.Trigger=F;
@@ -1,4 +1,4 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { forwardRef as a } from "react";
3
3
  import * as n from "@radix-ui/react-dropdown-menu";
4
4
  import { CarretDown as f, ChevronRight as S } from "@strapi/icons";
@@ -7,12 +7,12 @@ import { extractStyleFromTheme as x } from "../../helpers/theme.js";
7
7
  import { Link as y } from "../Link/Link.js";
8
8
  import { Button as C } from "../../Button/Button.js";
9
9
  import { Box as $ } from "../../Box/Box.js";
10
- import { Flex as s } from "../../Flex/Flex.js";
10
+ import { Flex as c } from "../../Flex/Flex.js";
11
11
  import { Typography as i } from "../../Typography/Typography.js";
12
- const v = n.Root, k = a(({ size: r, ...o }, t) => e(n.Trigger, { asChild: !0, children: e(C, { ref: t, type: "button", variant: "ghost", endIcon: e(f, { width: `${6 / 16}rem`, height: `${4 / 16}rem`, "aria-hidden": !0 }), paddingTop: r === "S" ? 1 : 2, paddingBottom: r === "S" ? 1 : 2, paddingLeft: r === "S" ? 3 : 4, paddingRight: r === "S" ? 3 : 4, ...o }) })), R = a(({ children: r, intersectionId: o, popoverPlacement: t = "bottom-start", ...g }, p) => {
12
+ const v = n.Root, k = a(({ size: r, endIcon: o = e(f, { width: `${6 / 16}rem`, height: `${4 / 16}rem`, "aria-hidden": !0 }), ...t }, d) => e(n.Trigger, { asChild: !0, children: e(C, { ref: d, type: "button", variant: "ghost", endIcon: o, paddingTop: r === "S" ? 1 : 2, paddingBottom: r === "S" ? 1 : 2, paddingLeft: r === "S" ? 3 : 4, paddingRight: r === "S" ? 3 : 4, ...t }) })), R = a(({ children: r, intersectionId: o, popoverPlacement: t = "bottom-start", ...d }, p) => {
13
13
  const [b, m] = t.split("-");
14
- return e(n.Portal, { children: e(n.Content, { align: m, side: b, loop: !0, asChild: !0, children: d(c, { ref: p, direction: "column", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral150", hasRadius: !0, background: "neutral0", shadow: "filterShadow", maxHeight: "15rem", padding: 1, alignItems: "flex-start", position: "relative", overflow: "auto", ...g, children: [r, e($, { id: o, width: "100%", height: "1px" })] }) }) });
15
- }), c = l(s)`
14
+ return e(n.Portal, { children: e(n.Content, { align: m, side: b, loop: !0, asChild: !0, children: s(u, { ref: p, direction: "column", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral150", hasRadius: !0, background: "neutral0", shadow: "filterShadow", maxHeight: "15rem", padding: 1, alignItems: "flex-start", position: "relative", overflow: "auto", ...d, children: [r, e($, { id: o, width: "100%", height: "1px" })] }) }) });
15
+ }), u = l(c)`
16
16
  scrollbar-width: none;
17
17
  -ms-overflow-style: none;
18
18
  -webkit-overflow-scrolling: touch;
@@ -20,7 +20,7 @@ const v = n.Root, k = a(({ size: r, ...o }, t) => e(n.Trigger, { asChild: !0, ch
20
20
  &::-webkit-scrollbar {
21
21
  display: none;
22
22
  }
23
- `, T = ({ onSelect: r, disabled: o = !1, ...t }) => e(n.Item, { asChild: !0, onSelect: r, disabled: o, children: t.isLink || t.isExternal ? e(L, { color: "neutral800", ...t, isExternal: t.isExternal ?? !1, children: e(i, { children: t.children }) }) : e(h, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...t, children: e(i, { children: t.children }) }) }), u = ({ theme: r }) => w`
23
+ `, T = ({ onSelect: r, disabled: o = !1, ...t }) => e(n.Item, { asChild: !0, onSelect: r, disabled: o, children: t.isLink || t.isExternal ? e(L, { color: "neutral800", ...t, isExternal: t.isExternal ?? !1, children: e(i, { children: t.children }) }) : e(g, { cursor: "pointer", color: "neutral800", background: "transparent", borderStyle: "none", ...t, children: e(i, { children: t.children }) }) }), h = ({ theme: r }) => w`
24
24
  text-align: left;
25
25
  width: 100%;
26
26
  border-radius: ${r.borderRadius};
@@ -49,8 +49,8 @@ const v = n.Root, k = a(({ size: r, ...o }, t) => e(n.Trigger, { asChild: !0, ch
49
49
  content: none;
50
50
  }
51
51
  }
52
- `, h = l(s)`
53
- ${u}
52
+ `, g = l(c)`
53
+ ${h}
54
54
  `, L = l(y)`
55
55
  /* We include this here again because typically when people use OptionLink they provide an as prop which cancels the Box props */
56
56
  color: ${({ theme: r, color: o }) => x(r.colors, o, void 0)};
@@ -65,10 +65,10 @@ const v = n.Root, k = a(({ size: r, ...o }, t) => e(n.Trigger, { asChild: !0, ch
65
65
  fill: currentColor;
66
66
  }
67
67
 
68
- ${u}
68
+ ${h}
69
69
  `, M = a((r, o) => e(n.Label, { asChild: !0, children: e(I, { ref: o, variant: "sigma", textColor: "neutral600", ...r }) })), I = l(i)`
70
70
  padding: ${({ theme: r }) => r.spaces[2]} ${({ theme: r }) => r.spaces[4]};
71
- `, B = n.Sub, O = a(({ disabled: r = !1, ...o }, t) => e(n.SubTrigger, { asChild: !0, disabled: r, children: d(E, { ref: t, color: "neutral800", as: "button", type: "button", background: "transparent", borderStyle: "none", gap: 5, ...o, children: [e(i, { children: o.children }), e(W, { height: 12, width: 12 })] }) })), E = l(h)`
71
+ `, B = n.Sub, O = a(({ disabled: r = !1, ...o }, t) => e(n.SubTrigger, { asChild: !0, disabled: r, children: s(E, { ref: t, color: "neutral800", as: "button", type: "button", background: "transparent", borderStyle: "none", gap: 5, ...o, children: [e(i, { children: o.children }), e(W, { height: 12, width: 12 })] }) })), E = l(g)`
72
72
  &[data-state='open'] {
73
73
  background-color: ${({ theme: r }) => r.colors.primary100};
74
74
  }
@@ -76,7 +76,7 @@ const v = n.Root, k = a(({ size: r, ...o }, t) => e(n.Trigger, { asChild: !0, ch
76
76
  path {
77
77
  fill: ${({ theme: r }) => r.colors.neutral500};
78
78
  }
79
- `, j = a((r, o) => e(n.Portal, { children: e(n.SubContent, { sideOffset: 8, asChild: !0, children: e(c, { ref: o, direction: "column", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral150", hasRadius: !0, background: "neutral0", shadow: "filterShadow", maxHeight: "15rem", padding: 1, alignItems: "flex-start", ...r }) }) })), N = v, Q = k, U = R, X = T, Y = M, Z = B, _ = O, z = j;
79
+ `, j = a((r, o) => e(n.Portal, { children: e(n.SubContent, { sideOffset: 8, asChild: !0, children: e(u, { ref: o, direction: "column", borderStyle: "solid", borderWidth: "1px", borderColor: "neutral150", hasRadius: !0, background: "neutral0", shadow: "filterShadow", maxHeight: "15rem", padding: 1, alignItems: "flex-start", overflow: "auto", ...r }) }) })), N = v, Q = k, U = R, X = T, Y = M, Z = B, _ = O, z = j;
80
80
  export {
81
81
  U as Content,
82
82
  X as Item,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/design-system",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -19,28 +19,28 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@codemirror/lang-json": "^6.0.1",
22
- "@floating-ui/react-dom": "^1.3.0",
23
- "@internationalized/date": "^3.2.0",
24
- "@internationalized/number": "^3.2.0",
25
- "@radix-ui/react-dismissable-layer": "^1.0.3",
26
- "@radix-ui/react-dropdown-menu": "^2.0.4",
27
- "@radix-ui/react-focus-scope": "1.0.2",
28
- "@strapi/ui-primitives": "^1.8.0",
29
- "@uiw/react-codemirror": "^4.20.4",
22
+ "@floating-ui/react-dom": "^2.0.1",
23
+ "@internationalized/date": "^3.3.0",
24
+ "@internationalized/number": "^3.2.1",
25
+ "@radix-ui/react-dismissable-layer": "^1.0.4",
26
+ "@radix-ui/react-dropdown-menu": "^2.0.5",
27
+ "@radix-ui/react-focus-scope": "1.0.3",
28
+ "@strapi/ui-primitives": "^1.8.2",
29
+ "@uiw/react-codemirror": "^4.21.7",
30
30
  "aria-hidden": "^1.2.3",
31
31
  "compute-scroll-into-view": "^3.0.3",
32
32
  "prop-types": "^15.8.1",
33
- "react-remove-scroll": "^2.5.5"
33
+ "react-remove-scroll": "^2.5.6"
34
34
  },
35
35
  "devDependencies": {
36
- "@playwright/test": "1.33.0",
37
- "@strapi/icons": "^1.8.0",
36
+ "@playwright/test": "1.35.1",
37
+ "@strapi/icons": "^1.8.2",
38
38
  "@types/react-router-dom": "^5.3.3",
39
39
  "@types/styled-components": "^5.1.26",
40
40
  "axe-playwright": "^1.2.3",
41
41
  "cross-env": "^7.0.3",
42
42
  "react-router-dom": "^5.3.4",
43
- "styled-components": "^5.3.10"
43
+ "styled-components": "^5.3.11"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@strapi/icons": "^1.5.0",
@@ -54,7 +54,7 @@
54
54
  "build": "yarn build:prod",
55
55
  "build:prod": "vite build",
56
56
  "clean": "rimraf dist node_modules",
57
- "generate:types": "tsc --noEmit false --emitDeclarationOnly --declarationDir dist",
57
+ "generate:types": "tsc --noEmit false --declaration --emitDeclarationOnly --declarationDir dist",
58
58
  "lint": "eslint . --ext .js,.jsx,.tsx,.ts",
59
59
  "format": "yarn lint --fix",
60
60
  "test": "jest -c jest.config.js",
@@ -65,5 +65,5 @@
65
65
  "test:e2e:watch": "chokidar '**/__tests__/*.e2e.js' -c 'npm run test:e2e -- --retries=0 {path}'",
66
66
  "test:e2e:debug": "cross-env PWDEBUG=1 playwright test"
67
67
  },
68
- "gitHead": "81283e7a5b2112d37be8e75caae5dbb883195349"
68
+ "gitHead": "770d9832b8a67d3dabd6ad3dec6408308cc35d99"
69
69
  }