@strapi/design-system 1.8.2 → 1.9.0

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.
@@ -29,7 +29,7 @@
29
29
  & > path {
30
30
  fill: ${({theme:e})=>e.colors.neutral500};
31
31
  }
32
- `,Be="DatePickerTextInput",Ue=c.forwardRef(({placeholder:e,...r},n)=>{const t=_(Be),{onTextValueChange:o,textValue:i,onTextInputChange:g,onOpenChange:d,disabled:l,locale:b}=t,k=J.useComposedRefs(n,u=>g(u)),h=()=>{l||d(!0)},x=R.useDateFormatter(b,{year:"numeric",month:"2-digit",day:"2-digit"}),[T,w,S]=c.useMemo(()=>{const u=x.formatToParts(new Date),p=u.filter(m=>m.type==="year"||m.type==="month"||m.type==="day"),s=p.map(m=>{switch(m.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),f=u.find(m=>m.type==="literal")?.value??"";return[s,f,p]},[x]),j=T.map(u=>`\\d${u.length}`).join(w);return a.jsx(He,{role:"combobox",type:"text",inputMode:"numeric",ref:k,"aria-autocomplete":"none","aria-controls":t.contentId,"aria-disabled":t.disabled,"aria-expanded":t.open,"aria-required":t.required,"aria-haspopup":"dialog","data-state":t.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,pattern:j,placeholder:e??T.join(w),...r,value:i??"",onBlur:q.composeEventHandlers(r.onBlur,()=>{if(!t.textValue){t.onValueChange(void 0);return}t.onTextValueChange(x.format(t.calendarDate.toDate(t.timeZone))),t.onValueChange(t.calendarDate)}),onChange:q.composeEventHandlers(r.onChange,u=>{if(ae(u.target.value)){const p=u.target.value.split(w),[s,f,m]=S.map((C,I)=>{const G=p[I];return{...C,value:G}}).sort((C,I)=>C.type==="year"?1:I.type==="year"?-1:C.type==="month"?1:I.type==="month"?-1:0).map(C=>C.value),P=t.calendarDate.year;let v=t.calendarDate.year;if(m){let C=m.length===1?`0${m}`:m;v=m.length<3?Number(`${P}`.slice(0,4-C.length)+C):Number(C)}m&&m.length<3&&v>t.maxDate.year&&(v-=100);const A=t.calendarDate.set({year:v}),M=A.calendar.getMonthsInYear(A),O=A.set({month:f&&Number(f)<=M?Number(f):void 0}),H=O.calendar.getDaysInMonth(O),Z=O.set({day:s&&Number(s)<=H?Number(s):void 0});t.onCalendarDateChange(We(Z,t.minDate,t.maxDate)),t.onTextValueChange(u.target.value)}}),onKeyDown:q.composeEventHandlers(r.onKeyDown,u=>{if(!t.open&&(ae(u.key)||["ArrowDown","Backspace"].includes(u.key)))h();else if(["Tab"].includes(u.key)&&t.open)u.preventDefault();else if(["Escape"].includes(u.key))t.open?t.onOpenChange(!1):(t.onValueChange(void 0),t.onTextValueChange("")),u.preventDefault();else if(t.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(u.key))switch(u.preventDefault(),u.key){case"ArrowDown":{const p=t.calendarDate.add({weeks:1});if(t.maxDate&&p.compare(t.maxDate)>0)return;t.onCalendarDateChange(p);return}case"ArrowRight":{const p=t.calendarDate.add({days:1});if(t.maxDate&&p.compare(t.maxDate)>0)return;t.onCalendarDateChange(p);return}case"ArrowUp":{const p=t.calendarDate.subtract({weeks:1});if(t.minDate&&p.compare(t.minDate)<0)return;t.onCalendarDateChange(p);return}case"ArrowLeft":{const p=t.calendarDate.subtract({days:1});if(t.minDate&&p.compare(t.minDate)<0)return;t.onCalendarDateChange(p)}}else t.open&&["Enter"].includes(u.key)&&(u.preventDefault(),o(x.format(t.calendarDate.toDate(t.timeZone))),t.onValueChange(t.calendarDate),t.onOpenChange(!1))})})});function We(e,r,n){return r&&(e=D.maxDate(e,r)),n&&(e=D.minDate(e,n)),e}const He=E.default.input`
32
+ `,Be="DatePickerTextInput",Ue=c.forwardRef(({placeholder:e,...r},n)=>{const t=_(Be),{onTextValueChange:o,textValue:i,onTextInputChange:g,onOpenChange:d,disabled:l,locale:b}=t,k=J.useComposedRefs(n,u=>g(u)),h=()=>{l||d(!0)},x=R.useDateFormatter(b,{year:"numeric",month:"2-digit",day:"2-digit"}),[T,w,S]=c.useMemo(()=>{const u=x.formatToParts(new Date),p=u.filter(m=>m.type==="year"||m.type==="month"||m.type==="day"),s=p.map(m=>{switch(m.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),f=u.find(m=>m.type==="literal")?.value??"";return[s,f,p]},[x]),j=T.map(u=>`\\d{${u.length}}`).join(`\\${w}`);return a.jsx(He,{role:"combobox",type:"text",inputMode:"numeric",ref:k,"aria-autocomplete":"none","aria-controls":t.contentId,"aria-disabled":t.disabled,"aria-expanded":t.open,"aria-required":t.required,"aria-haspopup":"dialog","data-state":t.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,pattern:j,placeholder:e??T.join(w),...r,value:i??"",onBlur:q.composeEventHandlers(r.onBlur,()=>{if(!t.textValue){t.onValueChange(void 0);return}t.onTextValueChange(x.format(t.calendarDate.toDate(t.timeZone))),t.onValueChange(t.calendarDate)}),onChange:q.composeEventHandlers(r.onChange,u=>{if(ae(u.target.value)){const p=u.target.value.split(w),[s,f,m]=S.map((C,I)=>{const G=p[I];return{...C,value:G}}).sort((C,I)=>C.type==="year"?1:I.type==="year"?-1:C.type==="month"?1:I.type==="month"?-1:0).map(C=>C.value),P=t.calendarDate.year;let v=t.calendarDate.year;if(m){let C=m.length===1?`0${m}`:m;v=m.length<3?Number(`${P}`.slice(0,4-C.length)+C):Number(C)}m&&m.length<3&&v>t.maxDate.year&&(v-=100);const A=t.calendarDate.set({year:v}),M=A.calendar.getMonthsInYear(A),O=A.set({month:f&&Number(f)<=M?Number(f):void 0}),H=O.calendar.getDaysInMonth(O),Z=O.set({day:s&&Number(s)<=H?Number(s):void 0});t.onCalendarDateChange(We(Z,t.minDate,t.maxDate)),t.onTextValueChange(u.target.value)}}),onKeyDown:q.composeEventHandlers(r.onKeyDown,u=>{if(!t.open&&(ae(u.key)||["ArrowDown","Backspace"].includes(u.key)))h();else if(["Tab"].includes(u.key)&&t.open)u.preventDefault();else if(["Escape"].includes(u.key))t.open?t.onOpenChange(!1):(t.onValueChange(void 0),t.onTextValueChange("")),u.preventDefault();else if(t.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(u.key))switch(u.preventDefault(),u.key){case"ArrowDown":{const p=t.calendarDate.add({weeks:1});if(t.maxDate&&p.compare(t.maxDate)>0)return;t.onCalendarDateChange(p);return}case"ArrowRight":{const p=t.calendarDate.add({days:1});if(t.maxDate&&p.compare(t.maxDate)>0)return;t.onCalendarDateChange(p);return}case"ArrowUp":{const p=t.calendarDate.subtract({weeks:1});if(t.minDate&&p.compare(t.minDate)<0)return;t.onCalendarDateChange(p);return}case"ArrowLeft":{const p=t.calendarDate.subtract({days:1});if(t.minDate&&p.compare(t.minDate)<0)return;t.onCalendarDateChange(p)}}else t.open&&["Enter"].includes(u.key)&&(u.preventDefault(),o(x.format(t.calendarDate.toDate(t.timeZone))),t.onValueChange(t.calendarDate),t.onOpenChange(!1))})})});function We(e,r,n){return r&&(e=D.maxDate(e,r)),n&&(e=D.minDate(e,n)),e}const He=E.default.input`
33
33
  width: 100%;
34
34
  font-size: ${14/16}rem;
35
35
  color: ${({theme:e})=>e.colors.neutral800};
@@ -85,4 +85,4 @@
85
85
  color: ${({theme:e})=>e.colors.primary600};
86
86
  }
87
87
  }
88
- `,lt=c.forwardRef((e,r)=>{const{error:n,hint:t,id:o,required:i,label:g,...d}=e,l=se.useId(o);return a.jsx(Fe.Field,{error:n,hint:t,required:i,ref:r,id:l,children:a.jsxs(B.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[a.jsx(Re.FieldLabel,{children:g}),a.jsx(le,{id:l,error:n,required:i,...d}),a.jsx(ve.FieldHint,{}),a.jsx(Ae.FieldError,{})]})})}),it=je.once(console.warn),F=e=>{if(typeof e=="string"){it("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");const t=Date.parse(e);Number.isNaN(t)?e=new Date:e=new Date(t)}const r=e.toISOString(),n=D.parseAbsolute(r,"UTC");return D.toCalendarDate(n)},ct=lt;exports.DatePicker=ct;exports.DatePickerInput=le;
88
+ `,lt=c.forwardRef((e,r)=>{const{error:n,hint:t,id:o,required:i,label:g,...d}=e,l=se.useId(o);return a.jsx(Fe.Field,{error:n,hint:t,required:i,id:l,children:a.jsxs(B.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[a.jsx(Re.FieldLabel,{children:g}),a.jsx(le,{ref:r,id:l,error:n,required:i,...d}),a.jsx(ve.FieldHint,{}),a.jsx(Ae.FieldError,{})]})})}),it=je.once(console.warn),F=e=>{if(typeof e=="string"){it("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");const t=Date.parse(e);Number.isNaN(t)?e=new Date:e=new Date(t)}const r=e.toISOString(),n=D.parseAbsolute(r,"UTC");return D.toCalendarDate(n)},ct=lt;exports.DatePicker=ct;exports.DatePickerInput=le;
@@ -178,7 +178,7 @@ const je = 200, oe = 15, [He, L] = Ve("DatePicker"), Xe = c.forwardRef(({
178
178
  }
179
179
  }), m = d.find((p) => p.type === "literal")?.value ?? "";
180
180
  return [o, m, h];
181
- }, [y]), E = k.map((d) => `\\d${d.length}`).join(w);
181
+ }, [y]), E = k.map((d) => `\\d{${d.length}}`).join(`\\${w}`);
182
182
  return i(lt, { role: "combobox", type: "text", inputMode: "numeric", ref: x, "aria-autocomplete": "none", "aria-controls": t.contentId, "aria-disabled": t.disabled, "aria-expanded": t.open, "aria-required": t.required, "aria-haspopup": "dialog", "data-state": t.open ? "open" : "closed", disabled: l, "data-disabled": l ? "" : void 0, pattern: E, placeholder: e ?? k.join(w), ...r, value: s ?? "", onBlur: N(r.onBlur, () => {
183
183
  if (!t.textValue) {
184
184
  t.onValueChange(void 0);
@@ -415,7 +415,7 @@ const lt = I.input`
415
415
  }
416
416
  `, wt = c.forwardRef((e, r) => {
417
417
  const { error: n, hint: t, id: a, required: s, label: g, ...u } = e, l = ce(a);
418
- return i(Ze, { error: n, hint: t, required: s, ref: r, id: l, children: F(U, { direction: "column", alignItems: "stretch", gap: 1, children: [i(qe, { children: g }), i(Xe, { id: l, error: n, required: s, ...u }), i(Ke, {}), i(Ge, {})] }) });
418
+ return i(Ze, { error: n, hint: t, required: s, id: l, children: F(U, { direction: "column", alignItems: "stretch", gap: 1, children: [i(qe, { children: g }), i(Xe, { ref: r, id: l, error: n, required: s, ...u }), i(Ke, {}), i(Ge, {})] }) });
419
419
  }), xt = Ye(console.warn), R = (e) => {
420
420
  if (typeof e == "string") {
421
421
  xt("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),E=require("react"),d=require("@internationalized/date"),U=require("styled-components"),A=require("../DatePicker/DatePicker.cjs"),G=require("../DesignSystemProvider.cjs"),J=require("../helpers/deprecations.cjs"),K=require("../hooks/useControllableState.cjs"),Q=require("../hooks/useDateFormatter.cjs"),x=require("../hooks/useId.cjs"),W=require("../TimePicker/TimePicker.cjs"),X=require("../Field/Field.cjs"),P=require("../Flex/Flex.cjs"),Y=require("../Field/FieldLabel.cjs"),j=require("../VisuallyHidden/VisuallyHidden.cjs"),ee=require("../Field/FieldHint.cjs"),te=require("../Field/FieldError.cjs"),w=e=>e&&e.__esModule?e:{default:e},ne=w(E),S=w(U),re=({ariaLabel:e,clearLabel:u="clear",dateLabel:D="Choose date",timeLabel:o="Choose time",disabled:l=!1,error:p,hint:L,id:_,label:V,labelAction:H,onChange:q,onClear:m,name:R,required:g=!1,selectButtonTitle:oe,size:I="M",step:$,value:T,initialDate:y,...v})=>{const F=ne.default.useRef(null),[r,f]=K.useControllableState({defaultProp:y?a(y,!1):void 0,prop:T?a(T,!1):T??void 0,onChange(t){q&&q(t?.toDate(d.getLocalTimeZone()))}}),M=G.useDesignSystem("DateTimePicker"),N=Q.useDateFormatter(M.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),c=r?N.format(r.toDate(d.getLocalTimeZone())):"",O=t=>{let i=t?a(t):void 0;if(!(i&&r&&i.compare(r)===0)){if(c&&i){const[h,b]=c.split(":");i=i.set({hour:parseInt(h,10),minute:parseInt(b,10)})}f(i)}},Z=t=>{if(!t)return;const[i,h]=t.split(":"),b=r?r.set({hour:parseInt(i,10),minute:parseInt(h,10)}):a(new Date).set({hour:parseInt(i,10),minute:parseInt(h,10)});f(b)},z=t=>{f(void 0),m&&m(t)},B=()=>{const t=r?r.set({hour:0,minute:0}):a(new Date);f(t)},s=x.useId(_),k=x.useId(),C=x.useId();return n.jsx(X.Field,{name:R,as:"fieldset",id:s,"aria-labelledby":s,hint:L,error:p,required:g,children:n.jsxs(P.Flex,{as:"span",direction:"column",alignItems:"stretch",gap:1,children:[n.jsx(Y.FieldLabel,{onClick:()=>{F.current.focus()},as:"legend",id:s,action:H,children:V}),n.jsxs(P.Flex,{flex:"1",gap:1,children:[n.jsx(j.VisuallyHidden,{as:"label",htmlFor:C,children:D}),n.jsx(se,{...v,selectedDate:r?.toDate(d.getLocalTimeZone()),onChange:O,error:typeof p=="string",required:g,size:I,onClear:m?z:void 0,clearLabel:`${u} date`,disabled:l,id:C,ref:F,"aria-describedby":`${s}-hint ${s}-error`}),n.jsx(j.VisuallyHidden,{as:"label",htmlFor:k,children:o}),n.jsx(ae,{size:I,error:typeof p=="string",value:c,onChange:Z,onClear:m&&c!==void 0&&c!=="00:00"?B:void 0,clearLabel:`${u} time`,required:g,disabled:l,step:$,id:k,"aria-describedby":`${s}-hint ${s}-error`})]}),n.jsx(ee.FieldHint,{}),n.jsx(te.FieldError,{})]})})},ie=J.once(console.warn),a=(e,u=!0)=>{if(typeof e=="string"){ie("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");const l=Date.parse(e);Number.isNaN(l)?e=new Date:e=new Date(l)}const D=e.toISOString();let o=d.parseAbsoluteToLocal(D);return u&&(o=o.set({hour:0,minute:0})),d.toCalendarDateTime(o)},se=S.default(A.DatePickerInput)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),w=require("react"),p=require("@internationalized/date"),G=require("styled-components"),J=require("../DatePicker/DatePicker.cjs"),K=require("../DesignSystemProvider.cjs"),Q=require("../helpers/deprecations.cjs"),W=require("../hooks/useComposeRefs.cjs"),X=require("../hooks/useControllableState.cjs"),Y=require("../hooks/useDateFormatter.cjs"),x=require("../hooks/useId.cjs"),ee=require("../TimePicker/TimePicker.cjs"),te=require("../Field/Field.cjs"),P=require("../Flex/Flex.cjs"),ne=require("../Field/FieldLabel.cjs"),j=require("../VisuallyHidden/VisuallyHidden.cjs"),re=require("../Field/FieldHint.cjs"),se=require("../Field/FieldError.cjs"),S=e=>e&&e.__esModule?e:{default:e},ie=S(w),_=S(G),ae=w.forwardRef(({ariaLabel:e,clearLabel:d="clear",dateLabel:h="Choose date",timeLabel:o="Choose time",disabled:l=!1,error:D,hint:L,id:R,label:V,labelAction:H,onChange:q,onClear:u,name:$,required:g=!1,selectButtonTitle:de,size:C="M",step:v,value:T,initialDate:I,...E},M)=>{const y=ie.default.useRef(null),[r,m]=X.useControllableState({defaultProp:I?a(I,!1):void 0,prop:T?a(T,!1):T??void 0,onChange(t){q&&q(t?.toDate(p.getLocalTimeZone()))}}),N=K.useDesignSystem("DateTimePicker"),O=Y.useDateFormatter(N.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),c=r?O.format(r.toDate(p.getLocalTimeZone())):"",U=t=>{let s=t?a(t):void 0;if(!(s&&r&&s.compare(r)===0)){if(c&&s){const[f,b]=c.split(":");s=s.set({hour:parseInt(f,10),minute:parseInt(b,10)})}m(s)}},z=t=>{if(!t)return;const[s,f]=t.split(":"),b=r?r.set({hour:parseInt(s,10),minute:parseInt(f,10)}):a(new Date).set({hour:parseInt(s,10),minute:parseInt(f,10)});m(b)},B=t=>{m(void 0),u&&u(t)},Z=()=>{const t=r?r.set({hour:0,minute:0}):a(new Date);m(t)},i=x.useId(R),F=x.useId(),k=x.useId(),A=W.useComposedRefs(y,M);return n.jsx(te.Field,{name:$,as:"fieldset",id:i,"aria-labelledby":i,hint:L,error:D,required:g,children:n.jsxs(P.Flex,{as:"span",direction:"column",alignItems:"stretch",gap:1,children:[n.jsx(ne.FieldLabel,{onClick:()=>{y.current.focus()},as:"legend",id:i,action:H,children:V}),n.jsxs(P.Flex,{flex:"1",gap:1,children:[n.jsx(j.VisuallyHidden,{as:"label",htmlFor:k,children:h}),n.jsx(le,{...E,selectedDate:r?.toDate("UTC"),onChange:U,error:typeof D=="string",required:g,size:C,onClear:u?B:void 0,clearLabel:`${d} date`,disabled:l,id:k,ref:A,"aria-describedby":`${i}-hint ${i}-error`}),n.jsx(j.VisuallyHidden,{as:"label",htmlFor:F,children:o}),n.jsx(ce,{size:C,error:typeof D=="string",value:c,onChange:z,onClear:u&&c!==void 0&&c!=="00:00"?Z:void 0,clearLabel:`${d} time`,required:g,disabled:l,step:v,id:F,"aria-describedby":`${i}-hint ${i}-error`})]}),n.jsx(re.FieldHint,{}),n.jsx(se.FieldError,{})]})})}),oe=Q.once(console.warn),a=(e,d=!0)=>{if(typeof e=="string"){oe("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");const l=Date.parse(e);Number.isNaN(l)?e=new Date:e=new Date(l)}const h=e.toISOString();let o=p.parseAbsoluteToLocal(h);return d&&(o=o.set({hour:0,minute:0})),p.toCalendarDateTime(o)},le=_.default(J.DatePickerInput)`
2
2
  flex: 1 1 70%;
3
3
  min-width: 120px;
4
- `,ae=S.default(W.TimePickerInput)`
4
+ `,ce=_.default(ee.TimePickerInput)`
5
5
  flex: 1 1 30%;
6
6
  min-width: 120px;
7
- `;exports.DateTimePicker=re;exports.convertUTCDateToCalendarDateTime=a;
7
+ `;exports.DateTimePicker=ae;exports.convertUTCDateToCalendarDateTime=a;
@@ -1,21 +1,22 @@
1
- import { jsx as o, jsxs as P } from "react/jsx-runtime";
2
- import U from "react";
3
- import { getLocalTimeZone as b, parseAbsoluteToLocal as Z, toCalendarDateTime as v } from "@internationalized/date";
1
+ import { jsx as o, jsxs as F } from "react/jsx-runtime";
2
+ import v, { forwardRef as G } from "react";
3
+ import { getLocalTimeZone as P, parseAbsoluteToLocal as J, toCalendarDateTime as K } from "@internationalized/date";
4
4
  import $ from "styled-components";
5
- import { DatePickerInput as G } from "../DatePicker/DatePicker.js";
6
- import { useDesignSystem as J } from "../DesignSystemProvider.js";
7
- import { once as K } from "../helpers/deprecations.js";
8
- import { useControllableState as Q } from "../hooks/useControllableState.js";
9
- import { useDateFormatter as W } from "../hooks/useDateFormatter.js";
10
- import { useId as I } from "../hooks/useId.js";
11
- import { TimePickerInput as X } from "../TimePicker/TimePicker.js";
12
- import { Field as Y } from "../Field/Field.js";
5
+ import { DatePickerInput as Q } from "../DatePicker/DatePicker.js";
6
+ import { useDesignSystem as W } from "../DesignSystemProvider.js";
7
+ import { once as X } from "../helpers/deprecations.js";
8
+ import { useComposedRefs as Y } from "../hooks/useComposeRefs.js";
9
+ import { useControllableState as ee } from "../hooks/useControllableState.js";
10
+ import { useDateFormatter as te } from "../hooks/useDateFormatter.js";
11
+ import { useId as b } from "../hooks/useId.js";
12
+ import { TimePickerInput as re } from "../TimePicker/TimePicker.js";
13
+ import { Field as oe } from "../Field/Field.js";
13
14
  import { Flex as L } from "../Flex/Flex.js";
14
- import { FieldLabel as ee } from "../Field/FieldLabel.js";
15
+ import { FieldLabel as ie } from "../Field/FieldLabel.js";
15
16
  import { VisuallyHidden as S } from "../VisuallyHidden/VisuallyHidden.js";
16
- import { FieldHint as te } from "../Field/FieldHint.js";
17
- import { FieldError as re } from "../Field/FieldError.js";
18
- const xe = ({
17
+ import { FieldHint as ne } from "../Field/FieldHint.js";
18
+ import { FieldError as ae } from "../Field/FieldError.js";
19
+ const Se = G(({
19
20
  /**
20
21
  * @preserve
21
22
  * @deprecated This is no longer used.
@@ -26,11 +27,11 @@ const xe = ({
26
27
  timeLabel: a = "Choose time",
27
28
  disabled: s = !1,
28
29
  error: h,
29
- hint: V,
30
- id: _,
31
- label: N,
32
- labelAction: R,
33
- onChange: k,
30
+ hint: R,
31
+ id: V,
32
+ label: _,
33
+ labelAction: N,
34
+ onChange: I,
34
35
  onClear: c,
35
36
  name: j,
36
37
  required: D = !1,
@@ -38,24 +39,24 @@ const xe = ({
38
39
  * @preserve
39
40
  * @deprecated This is no longer used.
40
41
  */
41
- selectButtonTitle: ae,
42
+ selectButtonTitle: de,
42
43
  size: C = "M",
43
44
  step: z,
44
45
  value: g,
45
- initialDate: w,
46
+ initialDate: k,
46
47
  ...B
47
- }) => {
48
- const x = U.useRef(null), [t, f] = Q({
49
- defaultProp: w ? m(w, !1) : void 0,
48
+ }, E) => {
49
+ const w = v.useRef(null), [t, f] = ee({
50
+ defaultProp: k ? m(k, !1) : void 0,
50
51
  prop: g ? m(g, !1) : g ?? void 0,
51
52
  onChange(e) {
52
- k && k(e?.toDate(b()));
53
+ I && I(e?.toDate(P()));
53
54
  }
54
- }), H = J("DateTimePicker"), O = W(H.locale, {
55
+ }), H = W("DateTimePicker"), O = te(H.locale, {
55
56
  hour: "2-digit",
56
57
  minute: "2-digit",
57
58
  hour12: !1
58
- }), l = t ? O.format(t.toDate(b())) : "", q = (e) => {
59
+ }), l = t ? O.format(t.toDate(P())) : "", U = (e) => {
59
60
  let r = e ? m(e) : void 0;
60
61
  if (!(r && t && r.compare(t) === 0)) {
61
62
  if (l && r) {
@@ -64,37 +65,40 @@ const xe = ({
64
65
  }
65
66
  f(r);
66
67
  }
67
- }, A = (e) => {
68
+ }, q = (e) => {
68
69
  if (!e)
69
70
  return;
70
- const [r, u] = e.split(":"), T = t ? t.set({ hour: parseInt(r, 10), minute: parseInt(u, 10) }) : m(/* @__PURE__ */ new Date()).set({ hour: parseInt(r, 10), minute: parseInt(u, 10) });
71
+ const [r, u] = e.split(":"), T = t ? t.set({ hour: parseInt(r, 10), minute: parseInt(u, 10) }) : m(/* @__PURE__ */ new Date()).set({
72
+ hour: parseInt(r, 10),
73
+ minute: parseInt(u, 10)
74
+ });
71
75
  f(T);
72
- }, E = (e) => {
76
+ }, A = (e) => {
73
77
  f(void 0), c && c(e);
74
78
  }, M = () => {
75
79
  const e = t ? t.set({ hour: 0, minute: 0 }) : m(/* @__PURE__ */ new Date());
76
80
  f(e);
77
- }, i = I(_), y = I(), F = I();
78
- return o(Y, { name: j, as: "fieldset", id: i, "aria-labelledby": i, hint: V, error: h, required: D, children: P(L, { as: "span", direction: "column", alignItems: "stretch", gap: 1, children: [o(ee, { onClick: () => {
79
- x.current.focus();
80
- }, as: "legend", id: i, action: R, children: N }), P(L, { flex: "1", gap: 1, children: [o(S, { as: "label", htmlFor: F, children: p }), o(ie, { ...B, selectedDate: t?.toDate(b()), onChange: q, error: typeof h == "string", required: D, size: C, onClear: c ? E : void 0, clearLabel: `${d} date`, disabled: s, id: F, ref: x, "aria-describedby": `${i}-hint ${i}-error` }), o(S, { as: "label", htmlFor: y, children: a }), o(ne, { size: C, error: typeof h == "string", value: l, onChange: A, onClear: c && l !== void 0 && l !== "00:00" ? M : void 0, clearLabel: `${d} time`, required: D, disabled: s, step: z, id: y, "aria-describedby": `${i}-hint ${i}-error` })] }), o(te, {}), o(re, {})] }) });
81
- }, oe = K(console.warn), m = (n, d = !0) => {
81
+ }, i = b(V), x = b(), y = b(), Z = Y(w, E);
82
+ return o(oe, { name: j, as: "fieldset", id: i, "aria-labelledby": i, hint: R, error: h, required: D, children: F(L, { as: "span", direction: "column", alignItems: "stretch", gap: 1, children: [o(ie, { onClick: () => {
83
+ w.current.focus();
84
+ }, as: "legend", id: i, action: N, children: _ }), F(L, { flex: "1", gap: 1, children: [o(S, { as: "label", htmlFor: y, children: p }), o(le, { ...B, selectedDate: t?.toDate("UTC"), onChange: U, error: typeof h == "string", required: D, size: C, onClear: c ? A : void 0, clearLabel: `${d} date`, disabled: s, id: y, ref: Z, "aria-describedby": `${i}-hint ${i}-error` }), o(S, { as: "label", htmlFor: x, children: a }), o(me, { size: C, error: typeof h == "string", value: l, onChange: q, onClear: c && l !== void 0 && l !== "00:00" ? M : void 0, clearLabel: `${d} time`, required: D, disabled: s, step: z, id: x, "aria-describedby": `${i}-hint ${i}-error` })] }), o(ne, {}), o(ae, {})] }) });
85
+ }), se = X(console.warn), m = (n, d = !0) => {
82
86
  if (typeof n == "string") {
83
- oe("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");
87
+ se("It looks like you're passing a string as representation of a Date to the DatePicker. This is deprecated, look to passing a Date instead.");
84
88
  const s = Date.parse(n);
85
89
  Number.isNaN(s) ? n = /* @__PURE__ */ new Date() : n = new Date(s);
86
90
  }
87
91
  const p = n.toISOString();
88
- let a = Z(p);
89
- return d && (a = a.set({ hour: 0, minute: 0 })), v(a);
90
- }, ie = $(G)`
92
+ let a = J(p);
93
+ return d && (a = a.set({ hour: 0, minute: 0 })), K(a);
94
+ }, le = $(Q)`
91
95
  flex: 1 1 70%;
92
96
  min-width: 120px;
93
- `, ne = $(X)`
97
+ `, me = $(re)`
94
98
  flex: 1 1 30%;
95
99
  min-width: 120px;
96
100
  `;
97
101
  export {
98
- xe as DateTimePicker,
102
+ Se as DateTimePicker,
99
103
  m as convertUTCDateToCalendarDateTime
100
104
  };
@@ -1 +1,33 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("react"),S=require("@codemirror/lang-json"),M=require("@uiw/react-codemirror"),N=require("./JSONInputContainer.cjs"),l=require("./utils/decorationExtension.cjs"),R=require("../Field/Field.cjs"),H=require("../Flex/Flex.cjs"),L=require("../Field/FieldLabel.cjs"),y=require("../Field/FieldError.cjs"),z=require("../Field/FieldHint.cjs"),A=({label:a,error:d,hint:x,labelAction:F,value:m="",required:q=!1,disabled:h=!1,onChange:p=()=>null,...b})=>{const i=u.useRef(),o=u.useRef(),c=u.useRef(),j=!!d,C=e=>{const r=o.current?.doc;if(r){const{text:s,to:t}=r.line(e),E=t-s.trimStart().length;t>E&&c.current?.dispatch({effects:l.addMarks.of([l.lineHighlightMark.range(E,t)])})}},O=()=>{const e=o.current?.doc;if(e){const r=e.length||0;c.current?.dispatch({effects:l.filterMarks.of((s,t)=>t<=0||s>=r)})}},f=({state:e,view:r})=>{c.current=r,o.current=e,O();const t=S.jsonParseLinter()(r);t.length&&C(e.doc.lineAt(t[0].from).number)},k=(e,r)=>{f(r),p(e)},I=(e,r)=>{c.current=e,o.current=r,f({view:e,state:r})},{setContainer:g}=M.useCodeMirror({value:m,onCreateEditor:I,container:i.current,editable:!h,extensions:[S.json(),l.markField],onChange:k,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),J=()=>{h||i.current?.children[0].children[1].children[1]?.focus()};return u.useEffect(()=>{const e=i.current;e&&g(e)},[g]),n.jsx(R.Field,{error:d,hint:x,required:q,children:n.jsxs(H.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[a&&n.jsx(L.FieldLabel,{onClick:J,action:F,children:a}),n.jsx(N.JSONInputContainer,{ref:i,hasError:j,alignItems:"stretch",fontSize:2,hasRadius:!0,...b}),n.jsx(y.FieldError,{}),n.jsx(z.FieldHint,{})]})})};exports.JSONInput=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),p=require("@codemirror/lang-json"),J=require("@uiw/react-codemirror"),N=require("styled-components"),d=require("./utils/decorationExtension.cjs"),L=require("../hooks/useComposeRefs.cjs"),_=require("../Field/Field.cjs"),b=require("../Flex/Flex.cjs"),$=require("../Field/FieldLabel.cjs"),v=require("../Field/FieldError.cjs"),V=require("../Field/FieldHint.cjs"),z=require("../themes/utils.cjs"),A=e=>e&&e.__esModule?e:{default:e},B=A(N),P=i.forwardRef(({label:e,error:c,hint:S,labelAction:F,value:x="",required:q=!1,disabled:h=!1,onChange:E=()=>null,...C},R)=>{const f=i.useRef(),l=i.useRef(),u=i.useRef(),j=!!c,k=r=>{const t=l.current?.doc;if(t){const{text:a,to:n}=t.line(r),m=n-a.trimStart().length;n>m&&u.current?.dispatch({effects:d.addMarks.of([d.lineHighlightMark.range(m,n)])})}},I=()=>{const r=l.current?.doc;if(r){const t=r.length||0;u.current?.dispatch({effects:d.filterMarks.of((a,n)=>n<=0||a>=t)})}},g=({state:r,view:t})=>{u.current=t,l.current=r,I();const n=p.jsonParseLinter()(t);n.length&&k(r.doc.lineAt(n[0].from).number)},w=(r,t)=>{g(t),E(r)},H=(r,t)=>{u.current=r,l.current=t,g({view:r,state:t})},{setContainer:M,view:o}=J.useCodeMirror({value:x,onCreateEditor:H,container:f.current,editable:!h,extensions:[p.json(),d.markField],onChange:w,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),O=()=>{!h&&o&&o.focus()},y=L.useComposedRefs(f,M);return i.useImperativeHandle(R,()=>({...o?.dom,focus(){o&&o.focus()},scrollIntoView(r){o&&o.dom.scrollIntoView(r)}}),[o]),s.jsx(_.Field,{error:c,hint:S,required:q,children:s.jsxs(b.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[e&&s.jsx($.FieldLabel,{onClick:O,action:F,children:e}),s.jsx(D,{ref:y,hasError:j,alignItems:"stretch",fontSize:2,hasRadius:!0,...C}),s.jsx(v.FieldError,{}),s.jsx(V.FieldHint,{})]})})}),D=B.default(b.Flex)`
2
+ line-height: ${({theme:e})=>e.lineHeights[2]};
3
+
4
+ .cm-editor {
5
+ /**
6
+ * Hard coded since the color is the same between themes,
7
+ * theme.colors.neutral800 changes between themes
8
+ */
9
+ background-color: #32324d;
10
+ width: 100%;
11
+ outline: none;
12
+ }
13
+
14
+ .cm-scroller {
15
+ border: 1px solid ${({theme:e,hasError:c})=>c?e.colors.danger600:e.colors.neutral200};
16
+ /* inputFocusStyle will receive hasError prop */
17
+ ${z.inputFocusStyle()}
18
+ }
19
+
20
+ .cm-editor,
21
+ .cm-scroller {
22
+ border-radius: ${({theme:e})=>e.borderRadius};
23
+ }
24
+
25
+ .cm-gutters,
26
+ .cm-activeLineGutter {
27
+ /**
28
+ * Hard coded since the color is the same between themes,
29
+ * theme.colors.neutral700 changes between themes
30
+ */
31
+ background-color: #4a4a6a;
32
+ }
33
+ `;exports.JSONInput=P;
@@ -1,46 +1,48 @@
1
- import { jsx as n, jsxs as O } from "react/jsx-runtime";
2
- import { useRef as l, useEffect as J } from "react";
3
- import { json as j, jsonParseLinter as H } from "@codemirror/lang-json";
4
- import { useCodeMirror as L } from "@uiw/react-codemirror";
5
- import { JSONInputContainer as z } from "./JSONInputContainer.js";
6
- import { markField as A, addMarks as B, lineHighlightMark as R, filterMarks as q } from "./utils/decorationExtension.js";
7
- import { Field as y } from "../Field/Field.js";
8
- import { Flex as P } from "../Flex/Flex.js";
9
- import { FieldLabel as V } from "../Field/FieldLabel.js";
10
- import { FieldError as D } from "../Field/FieldError.js";
11
- import { FieldHint as G } from "../Field/FieldHint.js";
12
- const v = ({ label: a, error: d, hint: g, labelAction: p, value: E = "", required: S = !1, disabled: u = !1, onChange: k = () => null, ...C }) => {
13
- const o = l(), i = l(), c = l(), F = !!d, b = (r) => {
14
- const t = i.current?.doc;
15
- if (t) {
16
- const { text: s, to: e } = t.line(r), m = e - s.trimStart().length;
17
- e > m && c.current?.dispatch({
18
- effects: B.of([R.range(m, e)])
1
+ import { jsx as i, jsxs as J } from "react/jsx-runtime";
2
+ import { forwardRef as j, useRef as d, useImperativeHandle as y } from "react";
3
+ import { json as L, jsonParseLinter as $ } from "@codemirror/lang-json";
4
+ import { useCodeMirror as V } from "@uiw/react-codemirror";
5
+ import v from "styled-components";
6
+ import { markField as z, addMarks as A, lineHighlightMark as B, filterMarks as q } from "./utils/decorationExtension.js";
7
+ import { useComposedRefs as G } from "../hooks/useComposeRefs.js";
8
+ import { Field as P } from "../Field/Field.js";
9
+ import { Flex as g } from "../Flex/Flex.js";
10
+ import { FieldLabel as D } from "../Field/FieldLabel.js";
11
+ import { FieldError as K } from "../Field/FieldError.js";
12
+ import { FieldHint as Q } from "../Field/FieldHint.js";
13
+ import { inputFocusStyle as T } from "../themes/utils.js";
14
+ const lr = j(({ label: t, error: c, hint: p, labelAction: b, value: S = "", required: E = !1, disabled: m = !1, onChange: k = () => null, ...F }, w) => {
15
+ const u = d(), s = d(), l = d(), C = !!c, I = (r) => {
16
+ const e = s.current?.doc;
17
+ if (e) {
18
+ const { text: a, to: n } = e.line(r), f = n - a.trimStart().length;
19
+ n > f && l.current?.dispatch({
20
+ effects: A.of([B.range(f, n)])
19
21
  });
20
22
  }
21
23
  }, x = () => {
22
- const r = i.current?.doc;
24
+ const r = s.current?.doc;
23
25
  if (r) {
24
- const t = r.length || 0;
25
- c.current?.dispatch({
26
- effects: q.of((s, e) => e <= 0 || s >= t)
26
+ const e = r.length || 0;
27
+ l.current?.dispatch({
28
+ effects: q.of((a, n) => n <= 0 || a >= e)
27
29
  });
28
30
  }
29
- }, f = ({ state: r, view: t }) => {
30
- c.current = t, i.current = r, x();
31
- const e = H()(t);
32
- e.length && b(r.doc.lineAt(e[0].from).number);
33
- }, M = (r, t) => {
34
- f(t), k(r);
35
- }, I = (r, t) => {
36
- c.current = r, i.current = t, f({ view: r, state: t });
37
- }, { setContainer: h } = L({
38
- value: E,
39
- onCreateEditor: I,
40
- container: o.current,
41
- editable: !u,
42
- extensions: [j(), A],
43
- onChange: M,
31
+ }, h = ({ state: r, view: e }) => {
32
+ l.current = e, s.current = r, x();
33
+ const n = $()(e);
34
+ n.length && I(r.doc.lineAt(n[0].from).number);
35
+ }, H = (r, e) => {
36
+ h(e), k(r);
37
+ }, M = (r, e) => {
38
+ l.current = r, s.current = e, h({ view: r, state: e });
39
+ }, { setContainer: N, view: o } = V({
40
+ value: S,
41
+ onCreateEditor: M,
42
+ container: u.current,
43
+ editable: !m,
44
+ extensions: [L(), z],
45
+ onChange: H,
44
46
  theme: "dark",
45
47
  basicSetup: {
46
48
  lineNumbers: !0,
@@ -51,14 +53,51 @@ const v = ({ label: a, error: d, hint: g, labelAction: p, value: E = "", require
51
53
  highlightSelectionMatches: !0,
52
54
  tabSize: 2
53
55
  }
54
- }), N = () => {
55
- u || o.current?.children[0].children[1].children[1]?.focus();
56
- };
57
- return J(() => {
58
- const r = o.current;
59
- r && h(r);
60
- }, [h]), n(y, { error: d, hint: g, required: S, children: O(P, { direction: "column", alignItems: "stretch", gap: 1, children: [a && n(V, { onClick: N, action: p, children: a }), n(z, { ref: o, hasError: F, alignItems: "stretch", fontSize: 2, hasRadius: !0, ...C }), n(D, {}), n(G, {})] }) });
61
- };
56
+ }), O = () => {
57
+ !m && o && o.focus();
58
+ }, R = G(u, N);
59
+ return y(w, () => ({
60
+ ...o?.dom,
61
+ focus() {
62
+ o && o.focus();
63
+ },
64
+ scrollIntoView(r) {
65
+ o && o.dom.scrollIntoView(r);
66
+ }
67
+ }), [o]), i(P, { error: c, hint: p, required: E, children: J(g, { direction: "column", alignItems: "stretch", gap: 1, children: [t && i(D, { onClick: O, action: b, children: t }), i(U, { ref: R, hasError: C, alignItems: "stretch", fontSize: 2, hasRadius: !0, ...F }), i(K, {}), i(Q, {})] }) });
68
+ }), U = v(g)`
69
+ line-height: ${({ theme: t }) => t.lineHeights[2]};
70
+
71
+ .cm-editor {
72
+ /**
73
+ * Hard coded since the color is the same between themes,
74
+ * theme.colors.neutral800 changes between themes
75
+ */
76
+ background-color: #32324d;
77
+ width: 100%;
78
+ outline: none;
79
+ }
80
+
81
+ .cm-scroller {
82
+ border: 1px solid ${({ theme: t, hasError: c }) => c ? t.colors.danger600 : t.colors.neutral200};
83
+ /* inputFocusStyle will receive hasError prop */
84
+ ${T()}
85
+ }
86
+
87
+ .cm-editor,
88
+ .cm-scroller {
89
+ border-radius: ${({ theme: t }) => t.borderRadius};
90
+ }
91
+
92
+ .cm-gutters,
93
+ .cm-activeLineGutter {
94
+ /**
95
+ * Hard coded since the color is the same between themes,
96
+ * theme.colors.neutral700 changes between themes
97
+ */
98
+ background-color: #4a4a6a;
99
+ }
100
+ `;
62
101
  export {
63
- v as JSONInput
102
+ lr as JSONInput
64
103
  };
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),J=require("react"),K=require("@strapi/icons"),b=require("styled-components"),o=require("./SelectParts.cjs"),Q=require("../BaseCheckbox/assets/checkmark.svg.cjs"),U=require("../helpers/strings.cjs"),C=require("../hooks/useId.cjs"),Z=require("../hooks/useIntersection.cjs"),ee=require("../Tag/Tag.cjs"),x=require("../Box/Box.cjs"),R=require("../Typography/Typography.cjs"),te=require("../Field/Field.cjs"),re=require("../Flex/Flex.cjs"),ne=require("../Field/FieldLabel.cjs"),ie=require("../Field/FieldHint.cjs"),oe=require("../Field/FieldError.cjs"),le=e=>e&&e.__esModule?e:{default:e};function se(e){if(e&&e.__esModule)return e;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(i,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return i.default=e,Object.freeze(i)}const d=se(J),ce=le(b),ae=({"aria-label":e,children:i,clearLabel:r="Clear",customizeContent:l,disabled:s,error:c,hint:u,id:j,label:g,labelAction:M,onChange:p,onClear:F,onReachEnd:y,placeholder:_,required:q,selectButtonTitle:he,startIcon:B,size:L="M",value:h,withTags:m,...P})=>{const $=d.useRef(null),[S,k]=d.useState(),[V,z]=d.useState(!1),f=C.useId(j),E=`${f}-hint`,G=`${f}-error`,A=n=>{p?p(n):k(n)},D=n=>()=>{const w=Array.isArray(h)?h.filter(I=>I!==n):(S??[]).filter(I=>I!==n);p?p(w):k(w)},H=n=>{z(n)},v=d.useRef(null),W=()=>{v.current.focus()},N=C.useId(),O=`intersection-${U.stripReactIdOfColon(N)}`,X=n=>{y&&y(n)};Z.useIntersection($,X,{selectorToWatch:`#${O}`,skipWhen:!V});const a=typeof h<"u"&&h!==null?h:S,Y=n=>n&&typeof n=="object"&&n.value?t.jsx(ee.Tag,{tabIndex:-1,disabled:s,icon:t.jsx(K.Cross,{}),onClick:D(n.value),children:n.textValue},n.value):null;return t.jsx(te.Field,{hint:u,error:c,id:f,required:q,children:t.jsxs(re.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[g?t.jsx(ne.FieldLabel,{onClick:W,action:M,children:g}):null,t.jsxs(o.Root,{onOpenChange:H,disabled:s,required:q,onValueChange:A,value:a,...P,multi:!0,children:[t.jsx(o.Trigger,{ref:v,"aria-label":g??e,"aria-describedby":`${E} ${G}`,id:f,startIcon:B,size:L,hasError:!!c,disabled:s,clearLabel:r,onClear:a?.length?F:void 0,paddingLeft:m&&a?.length?1:3,children:t.jsx(o.Value,{placeholder:_,textColor:a?.length?"neutral800":"neutral600",children:a?.length?m?Y:l?l(a):void 0:void 0})}),t.jsx(o.Portal,{children:t.jsx(o.Content,{position:"popper",sideOffset:4,children:t.jsxs(o.Viewport,{ref:$,children:[i,t.jsx(x.Box,{id:O,width:"100%",height:"1px"})]})})})]}),t.jsx(ie.FieldHint,{}),t.jsx(oe.FieldError,{})]})})},de=d.forwardRef(({value:e,children:i,startIcon:r,...l},s)=>t.jsxs(o.Item,{ref:s,value:e.toString(),...l,children:[r&&t.jsx(x.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(o.ItemIndicator,{children:({isSelected:c,isIntermediate:u})=>t.jsx(T,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:u,$selected:c,zIndex:1,height:"18px",width:"18px"})}),t.jsx(R.Typography,{textColor:"neutral800",children:t.jsx(o.ItemText,{children:i})})]})),T=ce.default(x.Box)`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Q=require("react"),U=require("@strapi/icons"),b=require("styled-components"),i=require("./SelectParts.cjs"),Z=require("../BaseCheckbox/assets/checkmark.svg.cjs"),ee=require("../helpers/strings.cjs"),te=require("../hooks/useComposeRefs.cjs"),w=require("../hooks/useId.cjs"),re=require("../hooks/useIntersection.cjs"),ne=require("../Tag/Tag.cjs"),oe=require("../Field/Field.cjs"),ie=require("../Flex/Flex.cjs"),le=require("../Field/FieldLabel.cjs"),x=require("../Box/Box.cjs"),se=require("../Field/FieldHint.cjs"),ce=require("../Field/FieldError.cjs"),O=require("../Typography/Typography.cjs"),ae=e=>e&&e.__esModule?e:{default:e};function de(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const c=de(Q),ue=ae(b),he=c.forwardRef(({"aria-label":e,children:o,clearLabel:r="Clear",customizeContent:l,disabled:s,error:a,hint:u,id:g,label:j,labelAction:M,onChange:p,onClear:F,onReachEnd:y,placeholder:_,required:m,selectButtonTitle:xe,startIcon:B,size:L="M",value:h,withTags:q,...P},V)=>{const R=c.useRef(null),[$,C]=c.useState(),[z,E]=c.useState(!1),f=w.useId(g),G=`${f}-hint`,A=`${f}-error`,D=n=>{p?p(n):C(n)},H=n=>()=>{const v=Array.isArray(h)?h.filter(I=>I!==n):($??[]).filter(I=>I!==n);p?p(v):C(v)},W=n=>{E(n)},S=c.useRef(null),N=()=>{S.current.focus()},X=w.useId(),k=`intersection-${ee.stripReactIdOfColon(X)}`,Y=n=>{y&&y(n)};re.useIntersection(R,Y,{selectorToWatch:`#${k}`,skipWhen:!z});const d=typeof h<"u"&&h!==null?h:$,J=n=>n&&typeof n=="object"&&n.value?t.jsx(ne.Tag,{tabIndex:-1,disabled:s,icon:t.jsx(U.Cross,{}),onClick:H(n.value),children:n.textValue},n.value):null,K=te.useComposedRefs(S,V);return t.jsx(oe.Field,{hint:u,error:a,id:f,required:m,children:t.jsxs(ie.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[j?t.jsx(le.FieldLabel,{onClick:N,action:M,children:j}):null,t.jsxs(i.Root,{onOpenChange:W,disabled:s,required:m,onValueChange:D,value:d,...P,multi:!0,children:[t.jsx(i.Trigger,{ref:K,"aria-label":j??e,"aria-describedby":`${G} ${A}`,id:f,startIcon:B,size:L,hasError:!!a,disabled:s,clearLabel:r,onClear:d?.length?F:void 0,paddingLeft:q&&d?.length?1:3,children:t.jsx(i.Value,{placeholder:_,textColor:d?.length?"neutral800":"neutral600",children:d?.length?q?J:l?l(d):void 0:void 0})}),t.jsx(i.Portal,{children:t.jsx(i.Content,{position:"popper",sideOffset:4,children:t.jsxs(i.Viewport,{ref:R,children:[o,t.jsx(x.Box,{id:k,width:"100%",height:"1px"})]})})})]}),t.jsx(se.FieldHint,{}),t.jsx(ce.FieldError,{})]})})}),pe=c.forwardRef(({value:e,children:o,startIcon:r,...l},s)=>t.jsxs(i.Item,{ref:s,value:e.toString(),...l,children:[r&&t.jsx(x.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(i.ItemIndicator,{children:({isSelected:a,isIntermediate:u})=>t.jsx(T,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:u,$selected:a,zIndex:1,height:"18px",width:"18px"})}),t.jsx(O.Typography,{textColor:"neutral800",children:t.jsx(i.ItemText,{children:o})})]})),T=ue.default(x.Box)`
2
2
  border: 1px solid
3
- ${({theme:e,$selected:i,$indeterminate:r})=>i||r?e.colors.primary600:e.colors.neutral300};
4
- background-color: ${({theme:e,$selected:i,$indeterminate:r})=>i||r?e.colors.primary600:e.colors.neutral0};
3
+ ${({theme:e,$selected:o,$indeterminate:r})=>o||r?e.colors.primary600:e.colors.neutral300};
4
+ background-color: ${({theme:e,$selected:o,$indeterminate:r})=>o||r?e.colors.primary600:e.colors.neutral0};
5
5
 
6
- ${({theme:e,$indeterminate:i})=>i&&b.css`
6
+ ${({theme:e,$indeterminate:o})=>o&&b.css`
7
7
  &::after {
8
8
  content: '';
9
9
  display: block;
@@ -21,10 +21,10 @@
21
21
  ${({$selected:e})=>e&&b.css`
22
22
  &::after {
23
23
  content: '';
24
- background: url(${Q}) no-repeat no-repeat center center;
24
+ background: url(${Z}) no-repeat no-repeat center center;
25
25
  width: 100%;
26
26
  height: 100%;
27
27
  position: absolute;
28
28
  }
29
29
  `}
30
- `,ue=d.forwardRef(({children:e,label:i,startIcon:r,values:l=[],...s},c)=>t.jsxs(o.Group,{ref:c,children:[t.jsxs(o.Item,{value:l,...s,children:[r&&t.jsx(x.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(o.ItemIndicator,{children:({isSelected:u,isIntermediate:j})=>t.jsx(T,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:j,$selected:u,zIndex:1,height:"18px",width:"18px"})}),t.jsx(R.Typography,{textColor:"neutral800",children:i})]}),e]}));exports.MultiSelect=ae;exports.MultiSelectGroup=ue;exports.MultiSelectOption=de;
30
+ `,fe=c.forwardRef(({children:e,label:o,startIcon:r,values:l=[],...s},a)=>t.jsxs(i.Group,{ref:a,children:[t.jsxs(i.Item,{value:l,...s,children:[r&&t.jsx(x.Box,{as:"span","aria-hidden":!0,children:r}),t.jsx(i.ItemIndicator,{children:({isSelected:u,isIntermediate:g})=>t.jsx(T,{hasRadius:!0,overflow:"hidden",position:"relative",$indeterminate:g,$selected:u,zIndex:1,height:"18px",width:"18px"})}),t.jsx(O.Typography,{textColor:"neutral800",children:o})]}),e]}));exports.MultiSelect=he;exports.MultiSelectGroup=fe;exports.MultiSelectOption=pe;
@@ -1,32 +1,33 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { Cross as N } from "@strapi/icons";
4
- import Q, { css as O } from "styled-components";
5
- import { Item as F, ItemIndicator as M, ItemText as U, Group as Z, Root as ee, Trigger as re, Value as te, Portal as ne, Content as oe, Viewport as ie } from "./SelectParts.js";
6
- import le from "../BaseCheckbox/assets/checkmark.svg.js";
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { Cross as U } from "@strapi/icons";
4
+ import Z, { css as O } from "styled-components";
5
+ import { Root as ee, Trigger as re, Value as te, Portal as ne, Content as oe, Viewport as ie, Item as F, ItemIndicator as M, ItemText as le, Group as de } from "./SelectParts.js";
6
+ import ce from "../BaseCheckbox/assets/checkmark.svg.js";
7
7
  import { stripReactIdOfColon as ae } from "../helpers/strings.js";
8
+ import { useComposedRefs as se } from "../hooks/useComposeRefs.js";
8
9
  import { useId as S } from "../hooks/useId.js";
9
- import { useIntersection as ce } from "../hooks/useIntersection.js";
10
- import { Tag as de } from "../Tag/Tag.js";
10
+ import { useIntersection as he } from "../hooks/useIntersection.js";
11
+ import { Tag as pe } from "../Tag/Tag.js";
12
+ import { Field as ue } from "../Field/Field.js";
13
+ import { Flex as fe } from "../Flex/Flex.js";
14
+ import { FieldLabel as me } from "../Field/FieldLabel.js";
11
15
  import { Box as m } from "../Box/Box.js";
16
+ import { FieldHint as ge } from "../Field/FieldHint.js";
17
+ import { FieldError as xe } from "../Field/FieldError.js";
12
18
  import { Typography as B } from "../Typography/Typography.js";
13
- import { Field as se } from "../Field/Field.js";
14
- import { Flex as he } from "../Flex/Flex.js";
15
- import { FieldLabel as ue } from "../Field/FieldLabel.js";
16
- import { FieldHint as pe } from "../Field/FieldHint.js";
17
- import { FieldError as fe } from "../Field/FieldError.js";
18
- const Le = ({ "aria-label": t, children: n, clearLabel: o = "Clear", customizeContent: l, disabled: i, error: a, hint: h, id: g, label: x, labelAction: V, onChange: p, onClear: j, onReachEnd: $, placeholder: E, required: b, selectButtonTitle: me, startIcon: z, size: A = "M", value: u, withTags: k, ...G }) => {
19
- const C = d.useRef(null), [v, w] = d.useState(), [W, q] = d.useState(!1), f = S(g), H = `${f}-hint`, P = `${f}-error`, X = (r) => {
20
- p ? p(r) : w(r);
21
- }, Y = (r) => () => {
22
- const T = Array.isArray(u) ? u.filter((I) => I !== r) : (v ?? []).filter((I) => I !== r);
23
- p ? p(T) : w(T);
24
- }, _ = (r) => {
25
- q(r);
26
- }, R = d.useRef(null), D = () => {
27
- R.current.focus();
28
- }, J = S(), y = `intersection-${ae(J)}`;
29
- ce(C, (r) => {
19
+ const ze = l.forwardRef(({ "aria-label": t, children: n, clearLabel: o = "Clear", customizeContent: d, disabled: i, error: c, hint: h, id: g, label: x, labelAction: V, onChange: u, onClear: j, onReachEnd: $, placeholder: E, required: R, selectButtonTitle: Ie, startIcon: z, size: A = "M", value: p, withTags: b, ...G }, W) => {
20
+ const C = l.useRef(null), [k, w] = l.useState(), [q, H] = l.useState(!1), f = S(g), P = `${f}-hint`, X = `${f}-error`, Y = (r) => {
21
+ u ? u(r) : w(r);
22
+ }, _ = (r) => () => {
23
+ const T = Array.isArray(p) ? p.filter((I) => I !== r) : (k ?? []).filter((I) => I !== r);
24
+ u ? u(T) : w(T);
25
+ }, D = (r) => {
26
+ H(r);
27
+ }, v = l.useRef(null), J = () => {
28
+ v.current.focus();
29
+ }, K = S(), y = `intersection-${ae(K)}`;
30
+ he(C, (r) => {
30
31
  $ && $(r);
31
32
  }, {
32
33
  selectorToWatch: `#${y}`,
@@ -34,11 +35,11 @@ const Le = ({ "aria-label": t, children: n, clearLabel: o = "Clear", customizeCo
34
35
  * We need to know when the select is open because only then will viewportRef
35
36
  * not be null. Because it uses a portal that (sensibly) is not mounted 24/7.
36
37
  */
37
- skipWhen: !W
38
+ skipWhen: !q
38
39
  });
39
- const c = typeof u < "u" && u !== null ? u : v, K = (r) => r && typeof r == "object" && r.value ? e(de, { tabIndex: -1, disabled: i, icon: e(N, {}), onClick: Y(r.value), children: r.textValue }, r.value) : null;
40
- return e(se, { hint: h, error: a, id: f, required: b, children: s(he, { direction: "column", alignItems: "stretch", gap: 1, children: [x ? e(ue, { onClick: D, action: V, children: x }) : null, s(ee, { onOpenChange: _, disabled: i, required: b, onValueChange: X, value: c, ...G, multi: !0, children: [e(re, { ref: R, "aria-label": x ?? t, "aria-describedby": `${H} ${P}`, id: f, startIcon: z, size: A, hasError: !!a, disabled: i, clearLabel: o, onClear: c?.length ? j : void 0, paddingLeft: k && c?.length ? 1 : 3, children: e(te, { placeholder: E, textColor: c?.length ? "neutral800" : "neutral600", children: c?.length ? k ? K : l ? l(c) : void 0 : void 0 }) }), e(ne, { children: e(oe, { position: "popper", sideOffset: 4, children: s(ie, { ref: C, children: [n, e(m, { id: y, width: "100%", height: "1px" })] }) }) })] }), e(pe, {}), e(fe, {})] }) });
41
- }, Ve = d.forwardRef(({ value: t, children: n, startIcon: o, ...l }, i) => s(F, { ref: i, value: t.toString(), ...l, children: [o && e(m, { as: "span", "aria-hidden": !0, children: o }), e(M, { children: ({ isSelected: a, isIntermediate: h }) => e(L, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: h, $selected: a, zIndex: 1, height: "18px", width: "18px" }) }), e(B, { textColor: "neutral800", children: e(U, { children: n }) })] })), L = Q(m)`
40
+ const a = typeof p < "u" && p !== null ? p : k, N = (r) => r && typeof r == "object" && r.value ? e(pe, { tabIndex: -1, disabled: i, icon: e(U, {}), onClick: _(r.value), children: r.textValue }, r.value) : null, Q = se(v, W);
41
+ return e(ue, { hint: h, error: c, id: f, required: R, children: s(fe, { direction: "column", alignItems: "stretch", gap: 1, children: [x ? e(me, { onClick: J, action: V, children: x }) : null, s(ee, { onOpenChange: D, disabled: i, required: R, onValueChange: Y, value: a, ...G, multi: !0, children: [e(re, { ref: Q, "aria-label": x ?? t, "aria-describedby": `${P} ${X}`, id: f, startIcon: z, size: A, hasError: !!c, disabled: i, clearLabel: o, onClear: a?.length ? j : void 0, paddingLeft: b && a?.length ? 1 : 3, children: e(te, { placeholder: E, textColor: a?.length ? "neutral800" : "neutral600", children: a?.length ? b ? N : d ? d(a) : void 0 : void 0 }) }), e(ne, { children: e(oe, { position: "popper", sideOffset: 4, children: s(ie, { ref: C, children: [n, e(m, { id: y, width: "100%", height: "1px" })] }) }) })] }), e(ge, {}), e(xe, {})] }) });
42
+ }), Ae = l.forwardRef(({ value: t, children: n, startIcon: o, ...d }, i) => s(F, { ref: i, value: t.toString(), ...d, children: [o && e(m, { as: "span", "aria-hidden": !0, children: o }), e(M, { children: ({ isSelected: c, isIntermediate: h }) => e(L, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: h, $selected: c, zIndex: 1, height: "18px", width: "18px" }) }), e(B, { textColor: "neutral800", children: e(le, { children: n }) })] })), L = Z(m)`
42
43
  border: 1px solid
43
44
  ${({ theme: t, $selected: n, $indeterminate: o }) => n || o ? t.colors.primary600 : t.colors.neutral300};
44
45
  background-color: ${({ theme: t, $selected: n, $indeterminate: o }) => n || o ? t.colors.primary600 : t.colors.neutral0};
@@ -61,15 +62,15 @@ const Le = ({ "aria-label": t, children: n, clearLabel: o = "Clear", customizeCo
61
62
  ${({ $selected: t }) => t && O`
62
63
  &::after {
63
64
  content: '';
64
- background: url(${le}) no-repeat no-repeat center center;
65
+ background: url(${ce}) no-repeat no-repeat center center;
65
66
  width: 100%;
66
67
  height: 100%;
67
68
  position: absolute;
68
69
  }
69
70
  `}
70
- `, je = d.forwardRef(({ children: t, label: n, startIcon: o, values: l = [], ...i }, a) => s(Z, { ref: a, children: [s(F, { value: l, ...i, children: [o && e(m, { as: "span", "aria-hidden": !0, children: o }), e(M, { children: ({ isSelected: h, isIntermediate: g }) => e(L, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: g, $selected: h, zIndex: 1, height: "18px", width: "18px" }) }), e(B, { textColor: "neutral800", children: n })] }), t] }));
71
+ `, Ge = l.forwardRef(({ children: t, label: n, startIcon: o, values: d = [], ...i }, c) => s(de, { ref: c, children: [s(F, { value: d, ...i, children: [o && e(m, { as: "span", "aria-hidden": !0, children: o }), e(M, { children: ({ isSelected: h, isIntermediate: g }) => e(L, { hasRadius: !0, overflow: "hidden", position: "relative", $indeterminate: g, $selected: h, zIndex: 1, height: "18px", width: "18px" }) }), e(B, { textColor: "neutral800", children: n })] }), t] }));
71
72
  export {
72
- Le as MultiSelect,
73
- je as MultiSelectGroup,
74
- Ve as MultiSelectOption
73
+ ze as MultiSelect,
74
+ Ge as MultiSelectGroup,
75
+ Ae as MultiSelectOption
75
76
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),o=require("./SelectParts.cjs"),V=require("../helpers/strings.cjs"),b=require("../hooks/useId.cjs"),H=require("../hooks/useIntersection.cjs"),q=require("../Box/Box.cjs"),W=require("../Typography/Typography.cjs"),z=require("../Field/Field.cjs"),D=require("../Flex/Flex.cjs"),A=require("../Field/FieldLabel.cjs"),G=require("../Field/FieldHint.cjs"),J=require("../Field/FieldError.cjs");function K(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>t[r]})}}return n.default=t,Object.freeze(n)}const h=K(E),Q=({error:t,hint:n,id:r,label:i,labelAction:s,required:d,selectButtonTitle:x,...g})=>{const c=b.useId(r),u=h.useRef(null),f=()=>{u.current.focus()};return e.jsx(z.Field,{hint:n,error:t,id:c,required:d,children:e.jsxs(D.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[i?e.jsx(A.FieldLabel,{onClick:f,action:s,children:i}):null,e.jsx(O,{label:i,id:c,triggerRef:u,required:d,...g}),e.jsx(G.FieldHint,{}),e.jsx(J.FieldError,{})]})})},O=({"aria-label":t,id:n,children:r,clearLabel:i="Clear",customizeContent:s,disabled:d,error:x,label:g,onChange:c,onClear:u,onReachEnd:f,placeholder:m,required:y,selectButtonTitle:X,startIcon:F,size:R="M",value:p,triggerRef:T,...B})=>{const[C,j]=h.useState(),[_,$]=h.useState(!1),v=l=>{$(l)},w=l=>{u&&u(l),c||j("")},P=`${n}-hint`,k=`${n}-error`,L=l=>{c?c(typeof p=="number"?Number(l):l):j(l)},S=h.useRef(null),M=b.useId(),I=`intersection-${V.stripReactIdOfColon(M)}`,N=l=>{f&&f(l)};H.useIntersection(S,N,{selectorToWatch:`#${I}`,skipWhen:!_});const a=(typeof p<"u"&&p!==null?p.toString():C)??"";return e.jsxs(o.Root,{onOpenChange:v,disabled:d,required:y,onValueChange:L,value:a,...B,children:[e.jsx(o.Trigger,{ref:T,"aria-label":g??t,"aria-describedby":n?`${P} ${k}`:void 0,id:n,startIcon:F,size:R,hasError:!!x,disabled:d,clearLabel:i,onClear:a&&u?w:void 0,children:e.jsx(o.Value,{placeholder:m,textColor:a?"neutral800":"neutral600",children:a&&s?s(a):void 0})}),e.jsx(o.Portal,{children:e.jsx(o.Content,{position:"popper",sideOffset:4,children:e.jsxs(o.Viewport,{ref:S,children:[r,e.jsx(q.Box,{id:I,width:"100%",height:"1px"})]})})})]})},U=h.forwardRef(({value:t,startIcon:n,children:r,...i},s)=>e.jsxs(o.Item,{ref:s,value:t.toString(),...i,children:[n&&e.jsx(q.Box,{as:"span","aria-hidden":!0,children:n}),e.jsx(W.Typography,{textColor:"neutral800",children:e.jsx(o.ItemText,{children:r})})]}));exports.SingleSelect=Q;exports.SingleSelectInput=O;exports.SingleSelectOption=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),E=require("react"),s=require("./SelectParts.cjs"),V=require("../helpers/strings.cjs"),H=require("../hooks/useComposeRefs.cjs"),q=require("../hooks/useId.cjs"),W=require("../hooks/useIntersection.cjs"),z=require("../Field/Field.cjs"),D=require("../Flex/Flex.cjs"),A=require("../Field/FieldLabel.cjs"),G=require("../Field/FieldHint.cjs"),J=require("../Field/FieldError.cjs"),O=require("../Box/Box.cjs"),K=require("../Typography/Typography.cjs");function Q(t){if(t&&t.__esModule)return t;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const l=Q(E),U=l.forwardRef(({error:t,hint:r,id:n,label:i,labelAction:c,required:u,selectButtonTitle:S,...g},a)=>{const d=q.useId(n),f=l.useRef(null),x=()=>{f.current.focus()},j=H.useComposedRefs(a,f);return e.jsx(z.Field,{hint:r,error:t,id:d,required:u,children:e.jsxs(D.Flex,{direction:"column",alignItems:"stretch",gap:1,children:[i?e.jsx(A.FieldLabel,{onClick:x,action:c,children:i}):null,e.jsx(R,{label:i,id:d,ref:j,required:u,...g}),e.jsx(G.FieldHint,{}),e.jsx(J.FieldError,{})]})})}),R=l.forwardRef(({"aria-label":t,id:r,children:n,clearLabel:i="Clear",customizeContent:c,disabled:u,error:S,label:g,onChange:a,onClear:d,onReachEnd:f,placeholder:x,required:j,selectButtonTitle:Y,startIcon:y,size:T="M",value:p,...F},B)=>{const[C,I]=l.useState(),[w,_]=l.useState(!1),$=o=>{_(o)},v=o=>{d&&d(o),a||I("")},P=`${r}-hint`,k=`${r}-error`,L=o=>{a?a(typeof p=="number"?Number(o):o):I(o)},b=l.useRef(null),M=q.useId(),m=`intersection-${V.stripReactIdOfColon(M)}`,N=o=>{f&&f(o)};W.useIntersection(b,N,{selectorToWatch:`#${m}`,skipWhen:!w});const h=(typeof p<"u"&&p!==null?p.toString():C)??"";return e.jsxs(s.Root,{onOpenChange:$,disabled:u,required:j,onValueChange:L,value:h,...F,children:[e.jsx(s.Trigger,{ref:B,"aria-label":g??t,"aria-describedby":r?`${P} ${k}`:void 0,id:r,startIcon:y,size:T,hasError:!!S,disabled:u,clearLabel:i,onClear:h&&d?v:void 0,children:e.jsx(s.Value,{placeholder:x,textColor:h?"neutral800":"neutral600",children:h&&c?c(h):void 0})}),e.jsx(s.Portal,{children:e.jsx(s.Content,{position:"popper",sideOffset:4,children:e.jsxs(s.Viewport,{ref:b,children:[n,e.jsx(O.Box,{id:m,width:"100%",height:"1px"})]})})})]})}),X=l.forwardRef(({value:t,startIcon:r,children:n,...i},c)=>e.jsxs(s.Item,{ref:c,value:t.toString(),...i,children:[r&&e.jsx(O.Box,{as:"span","aria-hidden":!0,children:r}),e.jsx(K.Typography,{textColor:"neutral800",children:e.jsx(s.ItemText,{children:n})})]}));exports.SingleSelect=U;exports.SingleSelectInput=R;exports.SingleSelectOption=X;