@strapi/design-system 1.7.2 → 1.7.3

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),re=require("react"),V=require("@strapi/icons"),n=require("@strapi/ui-primitives"),te=require("styled-components"),ne=require("../hooks/useControllableState.cjs"),se=require("../hooks/useId.cjs"),le=require("../hooks/useIntersection.cjs"),ie=require("../themes/utils.cjs"),ae=require("../Loader/Loader.cjs"),k=require("../Box/Box.cjs"),b=require("../Typography/Typography.cjs"),ce=require("../Field/Field.cjs"),m=require("../Flex/Flex.cjs"),de=require("../Field/FieldLabel.cjs"),ue=require("../Field/FieldHint.cjs"),he=require("../Field/FieldError.cjs"),be=e=>e&&e.__esModule?e:{default:e};function xe(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,i.get?i:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const c=xe(re),l=be(te),O=({children:e,clearLabel:r="clear",creatable:s=!1,createMessage:i=g=>`Create "${g}"`,disabled:d=!1,error:u,hasMoreItems:S=!1,hint:_,id:B,label:P,labelAction:E,loading:p=!1,loadingMessage:z="Loading content...",noOptionsMessage:D=()=>"No results found",onChange:C,onClear:f,onCreateOption:$,onInputChange:j,onLoadMore:y,placeholder:H="Select or enter a value",required:I=!1,defaultTextValue:L,textValue:M,value:N})=>{const[g,W]=c.useState(!1),[a,w]=ne.useControllableState({prop:M,defaultProp:L}),[U,T]=c.useState(""),q=c.useRef(null),v=c.useRef(null),A=c.useRef(null),h=se.useId(B),G=t=>{f&&!d&&(w(""),T(""),f(t),v.current.focus())},J=t=>{W(t)},K=t=>{w(t)},Q=t=>{T(t)},X=t=>{j&&j(t)},Y=t=>{C&&C(t)},F=`intersection-${CSS.escape(h)}`,Z=t=>{y&&S&&!p&&y(t)},R=()=>{$&&a&&$(a)};le.useIntersection(q,Z,{selectorToWatch:`#${F}`,skipWhen:!g});const ee=`${h}-hint`,oe=`${h}-error`;return o.jsx(ce.Field,{hint:_,error:u,id:h,required:I,children:o.jsxs(m.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[o.jsx(de.FieldLabel,{action:E,children:P}),o.jsxs(n.Combobox.Root,{autocomplete:s?"list":"both",onOpenChange:J,onTextValueChange:K,textValue:a,allowCustomValue:!0,disabled:d,required:I,value:N,onValueChange:Y,filterValue:U,onFilterValueChange:Q,children:[o.jsxs(ge,{$hasError:!!u,children:[o.jsx(me,{placeholder:H,id:h,"aria-invalid":!!u,"aria-labelledby":`${ee} ${oe}`,onChange:X,ref:v}),o.jsxs(m.Flex,{as:"span",gap:3,children:[a&&f?o.jsx(fe,{as:"button",hasRadius:!0,background:"transparent",type:"button",onClick:G,"aria-disabled":d,"aria-label":r,title:r,ref:A,children:o.jsx(V.Cross,{})}):null,o.jsx(Ce,{children:o.jsx(V.CarretDown,{})})]})]}),o.jsx(n.Combobox.Portal,{children:o.jsx($e,{sideOffset:4,children:o.jsxs(je,{ref:q,children:[e,s?o.jsx(n.Combobox.CreateItem,{onPointerUp:R,onClick:R,asChild:!0,children:o.jsx(x,{children:o.jsx(b.Typography,{children:i(a??"")})})}):null,!s&&!p?o.jsx(n.Combobox.NoValueFound,{asChild:!0,children:o.jsx(x,{$hasHover:!1,children:o.jsx(b.Typography,{children:D(a??"")})})}):null,p?o.jsx(m.Flex,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:o.jsx(ae.Loader,{small:!0,children:z})}):null,o.jsx(k.Box,{id:F,width:"100%",height:"1px"})]})})})]}),o.jsx(ue.FieldHint,{}),o.jsx(he.FieldError,{})]})})},pe=e=>o.jsx(O,{...e,creatable:!0}),fe=l.default(k.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),te=require("react"),S=require("@strapi/icons"),n=require("@strapi/ui-primitives"),ne=require("styled-components"),se=require("../hooks/useControllableState.cjs"),le=require("../hooks/useId.cjs"),ae=require("../hooks/useIntersection.cjs"),ie=require("../themes/utils.cjs"),ce=require("../Loader/Loader.cjs"),$=require("../Box/Box.cjs"),h=require("../Typography/Typography.cjs"),de=require("../Field/Field.cjs"),b=require("../Flex/Flex.cjs"),ue=require("../Field/FieldLabel.cjs"),he=require("../Field/FieldHint.cjs"),be=require("../Field/FieldError.cjs"),xe=e=>e&&e.__esModule?e:{default:e};function pe(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return r.default=e,Object.freeze(r)}const c=pe(te),l=xe(ne),B=({children:e,clearLabel:r="clear",creatable:s=!1,createMessage:a=C=>`Create "${C}"`,defaultTextValue:p,disabled:d=!1,error:f,hasMoreItems:_=!1,hint:P,id:E,label:z,labelAction:D,loading:g=!1,loadingMessage:H="Loading content...",noOptionsMessage:L=()=>"No results found",onChange:j,onClear:m,onCreateOption:y,onInputChange:w,onLoadMore:I,placeholder:M="Select or enter a value",required:F=!1,startIcon:T,textValue:N,value:W})=>{const[C,U]=c.useState(!1),[i,q]=se.useControllableState({prop:N,defaultProp:p}),[A,v]=c.useState(""),R=c.useRef(null),V=c.useRef(null),G=c.useRef(null),u=le.useId(E),J=t=>{m&&!d&&(q(""),v(""),m(t),V.current.focus())},K=t=>{U(t)},Q=t=>{q(t)},X=t=>{v(t)},Y=t=>{w&&w(t)},Z=t=>{j&&j(t)},k=`intersection-${CSS.escape(u)}`,ee=t=>{I&&_&&!g&&I(t)},O=()=>{y&&i&&y(i)};ae.useIntersection(R,ee,{selectorToWatch:`#${k}`,skipWhen:!C});const oe=`${u}-hint`,re=`${u}-error`;return o.jsx(de.Field,{hint:P,error:f,id:u,required:F,children:o.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[o.jsx(ue.FieldLabel,{action:D,children:z}),o.jsxs(n.Combobox.Root,{autocomplete:s?"list":"both",onOpenChange:K,onTextValueChange:Q,textValue:i,allowCustomValue:!0,disabled:d,required:F,value:W,onValueChange:Z,filterValue:A,onFilterValueChange:X,children:[o.jsxs(me,{$hasError:!!f,children:[o.jsxs(b.Flex,{flex:"1",as:"span",gap:3,children:[T?o.jsx($.Box,{as:"span","aria-hidden":!0,children:T}):null,o.jsx(Ce,{placeholder:M,id:u,"aria-invalid":!!f,"aria-labelledby":`${oe} ${re}`,onChange:Y,ref:V})]}),o.jsxs(b.Flex,{as:"span",gap:3,children:[i&&m?o.jsx(ge,{as:"button",hasRadius:!0,background:"transparent",type:"button",onClick:J,"aria-disabled":d,"aria-label":r,title:r,ref:G,children:o.jsx(S.Cross,{})}):null,o.jsx($e,{children:o.jsx(S.CarretDown,{})})]})]}),o.jsx(n.Combobox.Portal,{children:o.jsx(je,{sideOffset:4,children:o.jsxs(ye,{ref:R,children:[e,s?o.jsx(n.Combobox.CreateItem,{onPointerUp:O,onClick:O,asChild:!0,children:o.jsx(x,{children:o.jsx(h.Typography,{children:a(i??"")})})}):null,!s&&!g?o.jsx(n.Combobox.NoValueFound,{asChild:!0,children:o.jsx(x,{$hasHover:!1,children:o.jsx(h.Typography,{children:L(i??"")})})}):null,g?o.jsx(b.Flex,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:o.jsx(ce.Loader,{small:!0,children:H})}):null,o.jsx($.Box,{id:k,width:"100%",height:"1px"})]})})})]}),o.jsx(he.FieldHint,{}),o.jsx(be.FieldError,{})]})})},fe=e=>o.jsx(B,{...e,creatable:!0}),ge=l.default($.Box)`
2
2
  border: none;
3
3
 
4
4
  svg {
@@ -9,7 +9,7 @@
9
9
  svg path {
10
10
  fill: ${({theme:e})=>e.colors.neutral600};
11
11
  }
12
- `,ge=l.default(n.Combobox.Trigger)`
12
+ `,me=l.default(n.Combobox.Trigger)`
13
13
  position: relative;
14
14
  border: 1px solid ${({theme:e,$hasError:r})=>r?e.colors.danger600:e.colors.neutral200};
15
15
  padding-right: ${({theme:e})=>e.spaces[3]};
@@ -34,7 +34,7 @@
34
34
  }
35
35
 
36
36
  ${({theme:e,$hasError:r})=>ie.inputFocusStyle()({theme:e,hasError:r})};
37
- `,me=l.default(n.Combobox.TextInput)`
37
+ `,Ce=l.default(n.Combobox.TextInput)`
38
38
  width: 100%;
39
39
  font-size: ${14/16}rem;
40
40
  color: ${({theme:e})=>e.colors.neutral800};
@@ -49,7 +49,7 @@
49
49
  &[aria-disabled='true'] {
50
50
  cursor: inherit;
51
51
  }
52
- `,Ce=l.default(n.Combobox.Icon)`
52
+ `,$e=l.default(n.Combobox.Icon)`
53
53
  & > svg {
54
54
  width: ${6/16}rem;
55
55
 
@@ -61,7 +61,7 @@
61
61
  &[aria-disabled='true'] {
62
62
  cursor: inherit;
63
63
  }
64
- `,$e=l.default(n.Combobox.Content)`
64
+ `,je=l.default(n.Combobox.Content)`
65
65
  background: ${({theme:e})=>e.colors.neutral0};
66
66
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
67
67
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
@@ -70,9 +70,9 @@
70
70
  /* This is from the design-system figma file. */
71
71
  max-height: 15rem;
72
72
  z-index: ${({theme:e})=>e.zIndices[1]};
73
- `,je=l.default(n.Combobox.Viewport)`
73
+ `,ye=l.default(n.Combobox.Viewport)`
74
74
  padding: ${({theme:e})=>e.spaces[1]};
75
- `,ye=c.forwardRef(({children:e,value:r,disabled:s,textValue:i,...d},u)=>o.jsx(n.Combobox.ComboboxItem,{asChild:!0,value:r,disabled:s,textValue:i,children:o.jsx(x,{ref:u,...d,children:o.jsx(n.Combobox.ItemText,{asChild:!0,children:o.jsx(b.Typography,{children:e})})})})),x=l.default.div`
75
+ `,we=c.forwardRef(({children:e,value:r,disabled:s,textValue:a,...p},d)=>o.jsx(n.Combobox.ComboboxItem,{asChild:!0,value:r,disabled:s,textValue:a,children:o.jsx(x,{ref:d,...p,children:o.jsx(n.Combobox.ItemText,{asChild:!0,children:o.jsx(h.Typography,{children:e})})})})),x=l.default.div`
76
76
  width: 100%;
77
77
  border: none;
78
78
  text-align: left;
@@ -85,7 +85,7 @@
85
85
  &[data-selected] {
86
86
  background-color: ${({theme:e})=>e.colors.primary100};
87
87
 
88
- ${b.Typography} {
88
+ ${h.Typography} {
89
89
  color: ${({theme:e})=>e.colors.primary600};
90
90
  font-weight: bold;
91
91
  }
@@ -98,9 +98,9 @@
98
98
  }
99
99
 
100
100
  &[data-highlighted] {
101
- ${b.Typography} {
101
+ ${h.Typography} {
102
102
  color: ${({theme:e})=>e.colors.primary600};
103
103
  font-weight: bold;
104
104
  }
105
105
  }
106
- `;exports.Combobox=O;exports.CreatableCombobox=pe;exports.Option=ye;exports.OptionBox=x;
106
+ `;exports.Combobox=B;exports.CreatableCombobox=fe;exports.Option=we;exports.OptionBox=x;
@@ -1,52 +1,52 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { Cross as re, CarretDown as oe } from "@strapi/icons";
1
+ import { jsx as r, jsxs as a } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { Cross as oe, CarretDown as te } from "@strapi/icons";
4
4
  import { Combobox as t } from "@strapi/ui-primitives";
5
5
  import l from "styled-components";
6
- import { useControllableState as te } from "../hooks/useControllableState.js";
7
- import { useId as ne } from "../hooks/useId.js";
8
- import { useIntersection as le } from "../hooks/useIntersection.js";
9
- import { inputFocusStyle as ie } from "../themes/utils.js";
10
- import { Loader as ae } from "../Loader/Loader.js";
11
- import { Box as B } from "../Box/Box.js";
12
- import { Typography as p } from "../Typography/Typography.js";
13
- import { Field as se } from "../Field/Field.js";
14
- import { Flex as $ } from "../Flex/Flex.js";
15
- import { FieldLabel as de } from "../Field/FieldLabel.js";
16
- import { FieldHint as ce } from "../Field/FieldHint.js";
17
- import { FieldError as ue } from "../Field/FieldError.js";
18
- const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMessage: f = (b) => `Create "${b}"`, disabled: d = !1, error: c, hasMoreItems: O = !1, hint: j, id: E, label: z, labelAction: P, loading: m = !1, loadingMessage: q = "Loading content...", noOptionsMessage: D = () => "No results found", onChange: C, onClear: g, onCreateOption: w, onInputChange: I, onLoadMore: v, placeholder: H = "Select or enter a value", required: V = !1, defaultTextValue: N, textValue: W, value: L }) => {
19
- const [b, U] = a.useState(!1), [i, y] = te({
20
- prop: W,
21
- defaultProp: N
22
- }), [A, R] = a.useState(""), k = a.useRef(null), T = a.useRef(null), G = a.useRef(null), u = ne(E), J = (o) => {
23
- g && !d && (y(""), R(""), g(o), T.current.focus());
24
- }, K = (o) => {
25
- U(o);
6
+ import { useControllableState as ne } from "../hooks/useControllableState.js";
7
+ import { useId as le } from "../hooks/useId.js";
8
+ import { useIntersection as ie } from "../hooks/useIntersection.js";
9
+ import { inputFocusStyle as ae } from "../themes/utils.js";
10
+ import { Loader as se } from "../Loader/Loader.js";
11
+ import { Box as C } from "../Box/Box.js";
12
+ import { Typography as h } from "../Typography/Typography.js";
13
+ import { Field as de } from "../Field/Field.js";
14
+ import { Flex as p } from "../Flex/Flex.js";
15
+ import { FieldLabel as ce } from "../Field/FieldLabel.js";
16
+ import { FieldHint as ue } from "../Field/FieldHint.js";
17
+ import { FieldError as he } from "../Field/FieldError.js";
18
+ const pe = ({ children: e, clearLabel: n = "clear", creatable: d = !1, createMessage: f = (x) => `Create "${x}"`, defaultTextValue: m, disabled: c = !1, error: g, hasMoreItems: E = !1, hint: z, id: P, label: q, labelAction: D, loading: b = !1, loadingMessage: H = "Loading content...", noOptionsMessage: N = () => "No results found", onChange: I, onClear: $, onCreateOption: v, onInputChange: V, onLoadMore: y, placeholder: W = "Select or enter a value", required: R = !1, startIcon: k, textValue: L, value: U }) => {
19
+ const [x, A] = s.useState(!1), [i, T] = ne({
20
+ prop: L,
21
+ defaultProp: m
22
+ }), [G, F] = s.useState(""), S = s.useRef(null), B = s.useRef(null), J = s.useRef(null), u = le(P), K = (o) => {
23
+ $ && !c && (T(""), F(""), $(o), B.current.focus());
26
24
  }, Q = (o) => {
27
- y(o);
25
+ A(o);
28
26
  }, X = (o) => {
29
- R(o);
27
+ T(o);
30
28
  }, Y = (o) => {
31
- I && I(o);
29
+ F(o);
32
30
  }, Z = (o) => {
33
- C && C(o);
34
- }, F = `intersection-${CSS.escape(u)}`, _ = (o) => {
35
- v && O && !m && v(o);
36
- }, S = () => {
37
- w && i && w(i);
31
+ V && V(o);
32
+ }, _ = (o) => {
33
+ I && I(o);
34
+ }, O = `intersection-${CSS.escape(u)}`, M = (o) => {
35
+ y && E && !b && y(o);
36
+ }, j = () => {
37
+ v && i && v(i);
38
38
  };
39
- le(k, _, {
40
- selectorToWatch: `#${F}`,
39
+ ie(S, M, {
40
+ selectorToWatch: `#${O}`,
41
41
  /**
42
42
  * We need to know when the select is open because only then will viewportRef
43
43
  * not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
44
44
  */
45
- skipWhen: !b
45
+ skipWhen: !x
46
46
  });
47
- const M = `${u}-hint`, ee = `${u}-error`;
48
- return r(se, { hint: j, error: c, id: u, required: V, children: h($, { direction: "column", alignItems: "stretch", gap: 1, children: [r(de, { action: P, children: z }), h(t.Root, { autocomplete: s ? "list" : "both", onOpenChange: K, onTextValueChange: Q, textValue: i, allowCustomValue: !0, disabled: d, required: V, value: L, onValueChange: Z, filterValue: A, onFilterValueChange: X, children: [h(fe, { $hasError: !!c, children: [r(me, { placeholder: H, id: u, "aria-invalid": !!c, "aria-labelledby": `${M} ${ee}`, onChange: Y, ref: T }), h($, { as: "span", gap: 3, children: [i && g ? r(pe, { as: "button", hasRadius: !0, background: "transparent", type: "button", onClick: J, "aria-disabled": d, "aria-label": n, title: n, ref: G, children: r(re, {}) }) : null, r(ge, { children: r(oe, {}) })] })] }), r(t.Portal, { children: r(be, { sideOffset: 4, children: h($e, { ref: k, children: [e, s ? r(t.CreateItem, { onPointerUp: S, onClick: S, asChild: !0, children: r(x, { children: r(p, { children: f(i ?? "") }) }) }) : null, !s && !m ? r(t.NoValueFound, { asChild: !0, children: r(x, { $hasHover: !1, children: r(p, { children: D(i ?? "") }) }) }) : null, m ? r($, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2, children: r(ae, { small: !0, children: q }) }) : null, r(B, { id: F, width: "100%", height: "1px" })] }) }) })] }), r(ce, {}), r(ue, {})] }) });
49
- }, ze = (e) => r(he, { ...e, creatable: !0 }), pe = l(B)`
47
+ const ee = `${u}-hint`, re = `${u}-error`;
48
+ return r(de, { hint: z, error: g, id: u, required: R, children: a(p, { direction: "column", alignItems: "stretch", gap: 1, children: [r(ce, { action: D, children: q }), a(t.Root, { autocomplete: d ? "list" : "both", onOpenChange: Q, onTextValueChange: X, textValue: i, allowCustomValue: !0, disabled: c, required: R, value: U, onValueChange: _, filterValue: G, onFilterValueChange: Y, children: [a(me, { $hasError: !!g, children: [a(p, { flex: "1", as: "span", gap: 3, children: [k ? r(C, { as: "span", "aria-hidden": !0, children: k }) : null, r(ge, { placeholder: W, id: u, "aria-invalid": !!g, "aria-labelledby": `${ee} ${re}`, onChange: Z, ref: B })] }), a(p, { as: "span", gap: 3, children: [i && $ ? r(fe, { as: "button", hasRadius: !0, background: "transparent", type: "button", onClick: K, "aria-disabled": c, "aria-label": n, title: n, ref: J, children: r(oe, {}) }) : null, r(be, { children: r(te, {}) })] })] }), r(t.Portal, { children: r($e, { sideOffset: 4, children: a(xe, { ref: S, children: [e, d ? r(t.CreateItem, { onPointerUp: j, onClick: j, asChild: !0, children: r(w, { children: r(h, { children: f(i ?? "") }) }) }) : null, !d && !b ? r(t.NoValueFound, { asChild: !0, children: r(w, { $hasHover: !1, children: r(h, { children: N(i ?? "") }) }) }) : null, b ? r(p, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2, children: r(se, { small: !0, children: H }) }) : null, r(C, { id: O, width: "100%", height: "1px" })] }) }) })] }), r(ue, {}), r(he, {})] }) });
49
+ }, Pe = (e) => r(pe, { ...e, creatable: !0 }), fe = l(C)`
50
50
  border: none;
51
51
 
52
52
  svg {
@@ -57,7 +57,7 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
57
57
  svg path {
58
58
  fill: ${({ theme: e }) => e.colors.neutral600};
59
59
  }
60
- `, fe = l(t.Trigger)`
60
+ `, me = l(t.Trigger)`
61
61
  position: relative;
62
62
  border: 1px solid ${({ theme: e, $hasError: n }) => n ? e.colors.danger600 : e.colors.neutral200};
63
63
  padding-right: ${({ theme: e }) => e.spaces[3]};
@@ -81,8 +81,8 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
81
81
  outline: none;
82
82
  }
83
83
 
84
- ${({ theme: e, $hasError: n }) => ie()({ theme: e, hasError: n })};
85
- `, me = l(t.TextInput)`
84
+ ${({ theme: e, $hasError: n }) => ae()({ theme: e, hasError: n })};
85
+ `, ge = l(t.TextInput)`
86
86
  width: 100%;
87
87
  font-size: ${14 / 16}rem;
88
88
  color: ${({ theme: e }) => e.colors.neutral800};
@@ -97,7 +97,7 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
97
97
  &[aria-disabled='true'] {
98
98
  cursor: inherit;
99
99
  }
100
- `, ge = l(t.Icon)`
100
+ `, be = l(t.Icon)`
101
101
  & > svg {
102
102
  width: ${6 / 16}rem;
103
103
 
@@ -109,7 +109,7 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
109
109
  &[aria-disabled='true'] {
110
110
  cursor: inherit;
111
111
  }
112
- `, be = l(t.Content)`
112
+ `, $e = l(t.Content)`
113
113
  background: ${({ theme: e }) => e.colors.neutral0};
114
114
  box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
115
115
  border: 1px solid ${({ theme: e }) => e.colors.neutral150};
@@ -118,9 +118,9 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
118
118
  /* This is from the design-system figma file. */
119
119
  max-height: 15rem;
120
120
  z-index: ${({ theme: e }) => e.zIndices[1]};
121
- `, $e = l(t.Viewport)`
121
+ `, xe = l(t.Viewport)`
122
122
  padding: ${({ theme: e }) => e.spaces[1]};
123
- `, Pe = a.forwardRef(({ children: e, value: n, disabled: s, textValue: f, ...d }, c) => r(t.ComboboxItem, { asChild: !0, value: n, disabled: s, textValue: f, children: r(x, { ref: c, ...d, children: r(t.ItemText, { asChild: !0, children: r(p, { children: e }) }) }) })), x = l.div`
123
+ `, qe = s.forwardRef(({ children: e, value: n, disabled: d, textValue: f, ...m }, c) => r(t.ComboboxItem, { asChild: !0, value: n, disabled: d, textValue: f, children: r(w, { ref: c, ...m, children: r(t.ItemText, { asChild: !0, children: r(h, { children: e }) }) }) })), w = l.div`
124
124
  width: 100%;
125
125
  border: none;
126
126
  text-align: left;
@@ -133,7 +133,7 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
133
133
  &[data-selected] {
134
134
  background-color: ${({ theme: e }) => e.colors.primary100};
135
135
 
136
- ${p} {
136
+ ${h} {
137
137
  color: ${({ theme: e }) => e.colors.primary600};
138
138
  font-weight: bold;
139
139
  }
@@ -146,15 +146,15 @@ const he = ({ children: e, clearLabel: n = "clear", creatable: s = !1, createMes
146
146
  }
147
147
 
148
148
  &[data-highlighted] {
149
- ${p} {
149
+ ${h} {
150
150
  color: ${({ theme: e }) => e.colors.primary600};
151
151
  font-weight: bold;
152
152
  }
153
153
  }
154
154
  `;
155
155
  export {
156
- he as Combobox,
157
- ze as CreatableCombobox,
158
- Pe as Option,
159
- x as OptionBox
156
+ pe as Combobox,
157
+ Pe as CreatableCombobox,
158
+ qe as Option,
159
+ w as OptionBox
160
160
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),d=require("@strapi/icons"),o=require("@strapi/ui-primitives"),p=require("styled-components"),j=require("../hooks/useComposeRefs.cjs"),u=require("../themes/utils.cjs"),c=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),g=require("../Typography/Typography.cjs"),I=e=>e&&e.__esModule?e:{default:e};function T(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const a=T(R),l=I(p),v=a.forwardRef(({onClear:e,clearLabel:t="Clear",startIcon:s,disabled:n,hasError:h,size:m="M",children:x,...b},$)=>{const i=a.useRef(null),S=y=>{e&&!n&&(e(y),i.current.focus())},w=j.useComposedRefs(i,$);return r.jsx(o.Select.Trigger,{asChild:!0,children:r.jsxs(q,{"aria-disabled":n,$hasError:h,$size:m,ref:w,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:n?"neutral150":"neutral0",paddingLeft:3,paddingRight:3,gap:4,cursor:"default",...b,children:[r.jsxs(c.Flex,{as:"span",gap:4,children:[s&&r.jsx(f.Box,{as:"span","aria-hidden":!0,children:s}),x]}),r.jsxs(c.Flex,{as:"span",gap:3,children:[e?r.jsx(C,{as:"button",hasRadius:!0,background:"transparent",role:"button",tabIndex:0,onClick:S,"aria-disabled":n,"aria-label":t,title:t,cursor:"pointer",children:r.jsx(d.Cross,{})}):null,r.jsx(k,{children:r.jsx(d.CarretDown,{})})]})]})})}),C=l.default(f.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),R=require("react"),d=require("@strapi/icons"),o=require("@strapi/ui-primitives"),p=require("styled-components"),j=require("../hooks/useComposeRefs.cjs"),u=require("../themes/utils.cjs"),c=require("../Flex/Flex.cjs"),f=require("../Box/Box.cjs"),g=require("../Typography/Typography.cjs"),I=e=>e&&e.__esModule?e:{default:e};function T(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const a=T(R),l=I(p),v=a.forwardRef(({onClear:e,clearLabel:t="Clear",startIcon:s,disabled:n,hasError:h,size:m="M",children:x,...b},$)=>{const i=a.useRef(null),S=y=>{e&&!n&&(e(y),i.current.focus())},w=j.useComposedRefs(i,$);return r.jsx(o.Select.Trigger,{asChild:!0,children:r.jsxs(q,{"aria-disabled":n,$hasError:h,$size:m,ref:w,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:n?"neutral150":"neutral0",paddingLeft:3,paddingRight:3,gap:4,cursor:"default",width:"100%",...b,children:[r.jsxs(c.Flex,{flex:"1",as:"span",gap:3,children:[s&&r.jsx(f.Box,{as:"span","aria-hidden":!0,children:s}),x]}),r.jsxs(c.Flex,{as:"span",gap:3,children:[e?r.jsx(C,{as:"button",hasRadius:!0,background:"transparent",role:"button",tabIndex:0,onClick:S,"aria-disabled":n,"aria-label":t,title:t,cursor:"pointer",children:r.jsx(d.Cross,{})}):null,r.jsx(k,{children:r.jsx(d.CarretDown,{})})]})]})})}),C=l.default(f.Box)`
2
2
  border: none;
3
3
 
4
4
  svg {
@@ -31,11 +31,13 @@
31
31
  fill: ${({theme:e})=>e.colors.neutral600};
32
32
  }
33
33
  }
34
- `,_=a.forwardRef(({children:e,placeholder:t,...s},n)=>r.jsx(g.Typography,{ref:n,ellipsis:!0,...s,children:r.jsx(V,{placeholder:t,children:e})})),V=l.default(o.Select.Value)`
34
+ `,V=a.forwardRef(({children:e,placeholder:t,...s},n)=>r.jsx(_,{ref:n,ellipsis:!0,...s,children:r.jsx(P,{placeholder:t,children:e})})),_=l.default(g.Typography)`
35
+ flex: 1;
36
+ `,P=l.default(o.Select.Value)`
35
37
  display: flex;
36
38
  gap: ${({theme:e})=>e.spaces[1]};
37
39
  flex-wrap: wrap;
38
- `,P=l.default(o.Select.Content)`
40
+ `,z=l.default(o.Select.Content)`
39
41
  background: ${({theme:e})=>e.colors.neutral0};
40
42
  box-shadow: ${({theme:e})=>e.shadows.filterShadow};
41
43
  border: 1px solid ${({theme:e})=>e.colors.neutral150};
@@ -44,9 +46,9 @@
44
46
  /* This is from the design-system figma file. */
45
47
  max-height: 15rem;
46
48
  z-index: ${({theme:e})=>e.zIndices[1]};
47
- `,z=l.default(o.Select.Viewport)`
49
+ `,F=l.default(o.Select.Viewport)`
48
50
  padding: ${({theme:e})=>e.spaces[1]};
49
- `,F=a.forwardRef((e,t)=>r.jsx(M,{ref:t,...e})),O=p.css`
51
+ `,O=a.forwardRef((e,t)=>r.jsx(B,{ref:t,...e})),M=p.css`
50
52
  width: 100%;
51
53
  border: none;
52
54
  text-align: left;
@@ -65,8 +67,8 @@
65
67
  outline: none;
66
68
  background-color: ${({theme:e})=>e.colors.primary100};
67
69
  }
68
- `,M=l.default(o.Select.Item)`
69
- ${O}
70
+ `,B=l.default(o.Select.Item)`
71
+ ${M}
70
72
 
71
73
  &:hover {
72
74
  background-color: ${({theme:e})=>e.colors.primary100};
@@ -78,4 +80,4 @@
78
80
  color: ${({theme:e})=>e.colors.primary600};
79
81
  }
80
82
  }
81
- `,B=o.Select.Root,D=v,G=_,E=o.Select.Portal,N=P,A=z,H=F,J=o.Select.ItemIndicator,K=o.Select.ItemText,L=o.Select.Group;exports.Content=N;exports.Group=L;exports.Item=H;exports.ItemIndicator=J;exports.ItemText=K;exports.Portal=E;exports.Root=B;exports.Trigger=D;exports.Value=G;exports.Viewport=A;
83
+ `,D=o.Select.Root,G=v,E=V,N=o.Select.Portal,A=z,H=F,J=O,K=o.Select.ItemIndicator,L=o.Select.ItemText,Q=o.Select.Group;exports.Content=A;exports.Group=Q;exports.Item=J;exports.ItemIndicator=K;exports.ItemText=L;exports.Portal=N;exports.Root=D;exports.Trigger=G;exports.Value=E;exports.Viewport=H;
@@ -4,16 +4,16 @@ import { Cross as y, CarretDown as R } from "@strapi/icons";
4
4
  import { Select as o } from "@strapi/ui-primitives";
5
5
  import s, { css as I } from "styled-components";
6
6
  import { useComposedRefs as S } from "../hooks/useComposeRefs.js";
7
- import { getThemeSize as C, inputFocusStyle as k } from "../themes/utils.js";
7
+ import { getThemeSize as C, inputFocusStyle as T } from "../themes/utils.js";
8
8
  import { Flex as c } from "../Flex/Flex.js";
9
9
  import { Box as p } from "../Box/Box.js";
10
10
  import { Typography as u } from "../Typography/Typography.js";
11
- const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, disabled: n, hasError: m, size: h = "M", children: f, ...g }, $) => {
11
+ const k = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, disabled: n, hasError: m, size: h = "M", children: f, ...g }, $) => {
12
12
  const d = a.useRef(null), w = (x) => {
13
13
  e && !n && (e(x), d.current.focus());
14
14
  }, b = S(d, $);
15
- return t(o.Trigger, { asChild: !0, children: l(V, { "aria-disabled": n, $hasError: m, $size: h, ref: b, alignItems: "center", justifyContent: "space-between", position: "relative", overflow: "hidden", hasRadius: !0, background: n ? "neutral150" : "neutral0", paddingLeft: 3, paddingRight: 3, gap: 4, cursor: "default", ...g, children: [l(c, { as: "span", gap: 4, children: [i && t(p, { as: "span", "aria-hidden": !0, children: i }), f] }), l(c, { as: "span", gap: 3, children: [e ? t(T, { as: "button", hasRadius: !0, background: "transparent", role: "button", tabIndex: 0, onClick: w, "aria-disabled": n, "aria-label": r, title: r, cursor: "pointer", children: t(y, {}) }) : null, t(z, { children: t(R, {}) })] })] }) });
16
- }), T = s(p)`
15
+ return t(o.Trigger, { asChild: !0, children: l(V, { "aria-disabled": n, $hasError: m, $size: h, ref: b, alignItems: "center", justifyContent: "space-between", position: "relative", overflow: "hidden", hasRadius: !0, background: n ? "neutral150" : "neutral0", paddingLeft: 3, paddingRight: 3, gap: 4, cursor: "default", width: "100%", ...g, children: [l(c, { flex: "1", as: "span", gap: 3, children: [i && t(p, { as: "span", "aria-hidden": !0, children: i }), f] }), l(c, { as: "span", gap: 3, children: [e ? t(v, { as: "button", hasRadius: !0, background: "transparent", role: "button", tabIndex: 0, onClick: w, "aria-disabled": n, "aria-label": r, title: r, cursor: "pointer", children: t(y, {}) }) : null, t(z, { children: t(R, {}) })] })] }) });
16
+ }), v = s(p)`
17
17
  border: none;
18
18
 
19
19
  svg {
@@ -37,7 +37,7 @@ const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, dis
37
37
  outline: none;
38
38
  }
39
39
 
40
- ${({ theme: e, $hasError: r }) => k()({ theme: e, hasError: r })};
40
+ ${({ theme: e, $hasError: r }) => T()({ theme: e, hasError: r })};
41
41
  `, z = s(o.Icon)`
42
42
  & > svg {
43
43
  width: ${6 / 16}rem;
@@ -46,11 +46,13 @@ const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, dis
46
46
  fill: ${({ theme: e }) => e.colors.neutral600};
47
47
  }
48
48
  }
49
- `, j = a.forwardRef(({ children: e, placeholder: r, ...i }, n) => t(u, { ref: n, ellipsis: !0, ...i, children: t(F, { placeholder: r, children: e }) })), F = s(o.Value)`
49
+ `, j = a.forwardRef(({ children: e, placeholder: r, ...i }, n) => t(F, { ref: n, ellipsis: !0, ...i, children: t(B, { placeholder: r, children: e }) })), F = s(u)`
50
+ flex: 1;
51
+ `, B = s(o.Value)`
50
52
  display: flex;
51
53
  gap: ${({ theme: e }) => e.spaces[1]};
52
54
  flex-wrap: wrap;
53
- `, B = s(o.Content)`
55
+ `, D = s(o.Content)`
54
56
  background: ${({ theme: e }) => e.colors.neutral0};
55
57
  box-shadow: ${({ theme: e }) => e.shadows.filterShadow};
56
58
  border: 1px solid ${({ theme: e }) => e.colors.neutral150};
@@ -59,9 +61,9 @@ const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, dis
59
61
  /* This is from the design-system figma file. */
60
62
  max-height: 15rem;
61
63
  z-index: ${({ theme: e }) => e.zIndices[1]};
62
- `, D = s(o.Viewport)`
64
+ `, E = s(o.Viewport)`
63
65
  padding: ${({ theme: e }) => e.spaces[1]};
64
- `, E = a.forwardRef((e, r) => t(P, { ref: r, ...e })), G = I`
66
+ `, G = a.forwardRef((e, r) => t(q, { ref: r, ...e })), P = I`
65
67
  width: 100%;
66
68
  border: none;
67
69
  text-align: left;
@@ -80,8 +82,8 @@ const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, dis
80
82
  outline: none;
81
83
  background-color: ${({ theme: e }) => e.colors.primary100};
82
84
  }
83
- `, P = s(o.Item)`
84
- ${G}
85
+ `, q = s(o.Item)`
86
+ ${P}
85
87
 
86
88
  &:hover {
87
89
  background-color: ${({ theme: e }) => e.colors.primary100};
@@ -93,16 +95,16 @@ const v = a.forwardRef(({ onClear: e, clearLabel: r = "Clear", startIcon: i, dis
93
95
  color: ${({ theme: e }) => e.colors.primary600};
94
96
  }
95
97
  }
96
- `, Q = o.Root, U = v, W = j, X = o.Portal, Y = B, Z = D, _ = E, ee = o.ItemIndicator, re = o.ItemText, oe = o.Group;
98
+ `, U = o.Root, W = k, X = j, Y = o.Portal, Z = D, _ = E, ee = G, re = o.ItemIndicator, oe = o.ItemText, te = o.Group;
97
99
  export {
98
- Y as Content,
99
- oe as Group,
100
- _ as Item,
101
- ee as ItemIndicator,
102
- re as ItemText,
103
- X as Portal,
104
- Q as Root,
105
- U as Trigger,
106
- W as Value,
107
- Z as Viewport
100
+ Z as Content,
101
+ te as Group,
102
+ ee as Item,
103
+ re as ItemIndicator,
104
+ oe as ItemText,
105
+ Y as Portal,
106
+ U as Root,
107
+ W as Trigger,
108
+ X as Value,
109
+ _ as Viewport
108
110
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/design-system",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -24,14 +24,14 @@
24
24
  "@radix-ui/react-dismissable-layer": "^1.0.3",
25
25
  "@radix-ui/react-dropdown-menu": "^2.0.4",
26
26
  "@radix-ui/react-use-callback-ref": "^1.0.0",
27
- "@strapi/ui-primitives": "^1.7.2",
27
+ "@strapi/ui-primitives": "^1.7.3",
28
28
  "@uiw/react-codemirror": "^4.19.16",
29
29
  "compute-scroll-into-view": "^3.0.3",
30
30
  "prop-types": "^15.8.1"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@playwright/test": "1.33.0",
34
- "@strapi/icons": "^1.7.2",
34
+ "@strapi/icons": "^1.7.3",
35
35
  "@types/react-router-dom": "^5.3.3",
36
36
  "@types/styled-components": "^5.1.26",
37
37
  "axe-playwright": "^1.2.3",
@@ -62,5 +62,5 @@
62
62
  "test:e2e:watch": "chokidar '**/__tests__/*.e2e.js' -c 'npm run test:e2e -- --retries=0 {path}'",
63
63
  "test:e2e:debug": "cross-env PWDEBUG=1 playwright test"
64
64
  },
65
- "gitHead": "dce8b3260830bceaa7e98b25c1b77a37b36b50d8"
65
+ "gitHead": "5c0de191ef278ea93a0cddadbd9b5ffbda83054f"
66
66
  }