plume-ui-react 0.8.0 → 0.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.
Files changed (33) hide show
  1. package/dist/chunk-4RTWLIQ6.mjs +1 -0
  2. package/dist/chunk-H4KFRPQR.mjs +1 -0
  3. package/dist/chunk-OQEOAZF3.mjs +1 -0
  4. package/dist/chunk-TLZRYQKI.mjs +1 -0
  5. package/dist/chunk-YXXQZOHK.mjs +1 -0
  6. package/dist/components/form/datepicker/calendar.mjs +1 -1
  7. package/dist/components/form/datepicker/datepicker-input.mjs +1 -1
  8. package/dist/components/form/datepicker/datepicker.mjs +2 -2
  9. package/dist/components/form/select/select-content.mjs +1 -1
  10. package/dist/components/form/select/select-group.mjs +1 -1
  11. package/dist/components/form/select/select-option.mjs +1 -1
  12. package/dist/components/form/select/select-trigger.mjs +1 -1
  13. package/dist/components/form/select/select-value.mjs +1 -1
  14. package/dist/components/form/textarea/textarea-counter.mjs +1 -0
  15. package/dist/components/form/textarea/textarea.mjs +1 -1
  16. package/dist/components/interaction/dropdown/dropdown-item.mjs +1 -1
  17. package/dist/components/interaction/dropdown/dropdown-label.mjs +1 -1
  18. package/dist/components/interaction/dropdown/dropdown-menu.mjs +1 -1
  19. package/dist/components/interaction/dropdown/dropdown-separator.mjs +1 -1
  20. package/dist/components/overlay/popover/popover-close.mjs +1 -1
  21. package/dist/components/overlay/popover/popover-content.mjs +1 -1
  22. package/dist/components/presentation/chip/chip.mjs +1 -1
  23. package/dist/index.d.mts +5 -1
  24. package/dist/index.d.ts +5 -1
  25. package/dist/index.js +6 -6
  26. package/dist/overlay/position.mjs +1 -1
  27. package/dist/overlay/use-position.mjs +1 -1
  28. package/dist/styles.css +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunk-JMACSFO3.mjs +0 -1
  31. package/dist/chunk-LFT6MZ6P.mjs +0 -1
  32. package/dist/chunk-MREJ5C76.mjs +0 -1
  33. package/dist/chunk-V7QXMR67.mjs +0 -1
@@ -0,0 +1 @@
1
+ var _={content:"_content_9g2wy_21",sm:"_sm_9g2wy_35",md:"_md_9g2wy_39",lg:"_lg_9g2wy_43",elevated:"_elevated_9g2wy_47",outline:"_outline_9g2wy_51",close:"_close_9g2wy_55","content-in":"_content-in_9g2wy_1"};export{_ as a};
@@ -0,0 +1 @@
1
+ var _={"textarea-padding":"var(--plume-space-4)","textarea-border-radius":"var(--plume-radius-4)","textarea-border-color":"var(--plume-border-strong)","textarea-background-color":"var(--plume-surface-muted)",base:"_base_650is_6",textarea:"_textarea_650is_13",sm:"_sm_650is_28",md:"_md_650is_33",lg:"_lg_650is_37",rounded:"_rounded_650is_42",outline:"_outline_650is_46 _textarea_650is_13",pill:"_pill_650is_46",filled:"_filled_650is_55 _textarea_650is_13",underline:"_underline_650is_63 _textarea_650is_13",none:"_none_650is_69",vertical:"_vertical_650is_73",horizontal:"_horizontal_650is_77",both:"_both_650is_81",invalid:"_invalid_650is_89",disabled:"_disabled_650is_109",count:"_count_650is_124"};export{_ as a};
@@ -0,0 +1 @@
1
+ var e={"date-picker-padding":"var(--plume-space-4)","date-picker-border-radius":"var(--plume-radius-4)","date-picker-color":"var(--plume-muted)","date-picker-border-color":"var(--plume-border)","date-picker-control-border-color":"var(--plume-border-strong)",datePicker:"_datePicker_922qz_9",datePickerInputText:"_datePickerInputText_922qz_13",inputButton:"_inputButton_922qz_29",inputButtonIcon:"_inputButtonIcon_922qz_45",sm:"_sm_922qz_51",md:"_md_922qz_57",lg:"_lg_922qz_62",rounded:"_rounded_922qz_86",outline:"_outline_922qz_90 _datePickerInputText_922qz_13",pill:"_pill_922qz_90",filled:"_filled_922qz_99 _datePickerInputText_922qz_13",underline:"_underline_922qz_107 _datePickerInputText_922qz_13",invalid:"_invalid_922qz_117",datePickerModal:"_datePickerModal_922qz_141",calendarContainer:"_calendarContainer_922qz_160",calendarContainerDouble:"_calendarContainerDouble_922qz_165",calendar:"_calendar_922qz_160",calendarHeader:"_calendarHeader_922qz_182",day:"_day_922qz_189",year:"_year_922qz_190",month:"_month_922qz_191",monthYearSelectors:"_monthYearSelectors_922qz_192",monthSelector:"_monthSelector_922qz_229",yearSelector:"_yearSelector_922qz_230",yearSelectorGrid:"_yearSelectorGrid_922qz_234",selected:"_selected_922qz_248",monthSelectorGrid:"_monthSelectorGrid_922qz_258",daysOfWeek:"_daysOfWeek_922qz_264",dayOfWeek:"_dayOfWeek_922qz_271",calendarGrid:"_calendarGrid_922qz_280",today:"_today_922qz_297",rangeItem:"_rangeItem_922qz_301",selectedHover:"_selectedHover_922qz_311",hovered:"_hovered_922qz_316",disabledDay:"_disabledDay_922qz_320",outOfRangeDay:"_outOfRangeDay_922qz_325",footerActions:"_footerActions_922qz_329",footerButton:"_footerButton_922qz_336",footerButtonApply:"_footerButtonApply_922qz_340",disabled:"_disabled_922qz_320"};export{e as a};
@@ -0,0 +1 @@
1
+ var _={menu:"_menu_47da1_28",sm:"_sm_47da1_44",md:"_md_47da1_48",lg:"_lg_47da1_52",elevated:"_elevated_47da1_56",outline:"_outline_47da1_60",item:"_item_47da1_64",icon:"_icon_47da1_111",label:"_label_47da1_116",shortcut:"_shortcut_47da1_121",separator:"_separator_47da1_128",groupLabel:"_groupLabel_47da1_136","menu-in":"_menu-in_47da1_1"};export{_ as a};
@@ -0,0 +1 @@
1
+ var l={"select-border-color":"var(--plume-border-strong)","select-background-color":"var(--plume-surface-muted)",control:"_control_lfo2l_76",sm:"_sm_lfo2l_88",lg:"_lg_lfo2l_93",outline:"_outline_lfo2l_98",filled:"_filled_lfo2l_102",underline:"_underline_lfo2l_109",pill:"_pill_lfo2l_114",disabled:"_disabled_lfo2l_118",invalid:"_invalid_lfo2l_133",field:"_field_lfo2l_142",trigger:"_trigger_lfo2l_157",chevron:"_chevron_lfo2l_167",clear:"_clear_lfo2l_181",placeholder:"_placeholder_lfo2l_201",value:"_value_lfo2l_208",valueIcon:"_valueIcon_lfo2l_215",optionIcon:"_optionIcon_lfo2l_216",valueText:"_valueText_lfo2l_231",panel:"_panel_lfo2l_237",search:"_search_lfo2l_259",searchInput:"_searchInput_lfo2l_264",list:"_list_lfo2l_284",option:"_option_lfo2l_216",optionBody:"_optionBody_lfo2l_315",description:"_description_lfo2l_322",check:"_check_lfo2l_328",group:"_group_lfo2l_335",groupLabel:"_groupLabel_lfo2l_339",empty:"_empty_lfo2l_346","panel-in":"_panel-in_lfo2l_1"};export{l as a};
@@ -1 +1 @@
1
- "use client";import{a as t}from"../../../chunk-JMACSFO3.mjs";import{useEffect as le,useRef as _,useState as P}from"react";import{formatDate as q,getDateFromDateString as ce,getDaysOfWeekByLanguage as de,getMonthsByLanguage as ie}from"../../../utils/dates.mjs";import{Button as f}from"../../interaction/button/index.mjs";import{useDatePicker as ue}from"./use-datepicker.mjs";import{Fragment as ve,jsx as a,jsxs as H}from"react/jsx-runtime";var C="yyyy-mm-dd",M=(e,d)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+d),G=(e,d)=>{let l=new Date(e.getFullYear(),e.getMonth()+d+1,0).getDate();return new Date(e.getFullYear(),e.getMonth()+d,Math.min(e.getDate(),l))},I=e=>(e.getDay()+6)%7,me={ArrowLeft:e=>M(e,-1),ArrowRight:e=>M(e,1),ArrowUp:e=>M(e,-7),ArrowDown:e=>M(e,7),Home:e=>M(e,-I(e)),End:e=>M(e,6-I(e)),PageUp:e=>G(e,-1),PageDown:e=>G(e,1)},T=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();function ge({day:e}){return a("span",{className:t.dayOfWeek,children:e})}function ye({selectedMonth:e,months:d,onChange:l}){let D=i=>{l(i)};return a("div",{className:t.monthSelectorGrid,children:d.map((i,c)=>a(f,{"aria-pressed":c===e,className:`${c===e?t.selected:""} ${t.month}`,label:i,onClick:()=>{D(c)},variant:"unstyled"},i))})}function he({selectedYear:e,startYear:d,onChange:l}){let D=c=>{l(c)},i=()=>{let c=[];for(let y=d;y<d+20;y++)c.push(a(f,{"aria-pressed":e===y,className:`${e===y?t.selected:""} ${t.year}`,onClick:()=>{D(y)},variant:"unstyled",children:y},y));return c};return a("div",{className:t.yearSelectorGrid,children:i()})}function ke({language:e,isRange:d,isSecondCalendar:l,minDate:D,maxDate:i,onMonthChange:c,onSelectDate:y,onYearChange:U}){let{state:n}=ue(),[k,B]=P("day"),[L,O]=P(l?n.secondYear:n.year),[A,z]=P(null),R=_(!1),E=_(null),x=l?n.secondYear:n.year,N=l?n.secondMonth:n.month,J=ae(),W=ie(e);le(()=>{!R.current||!A||(R.current=!1,E.current?.querySelector(`[data-date="${q(A,C)}"]:enabled`)?.focus())});let V=s=>{let w=E.current?.closest('[role="dialog"]')??document,p=w.querySelectorAll(`.${t.day}:enabled`),u=Array.from(p).findIndex(g=>g.dataset.date===s),b=w.querySelector(`.${t.day}.${t.selected}`),m=d&&n.tempValue.startDate&&!n.tempValue.endDate&&b;p.forEach((g,S)=>{let Y=g.classList.contains(t.selected),o=S===u;if(m){let r=Array.from(p).indexOf(b),[h,v]=[Math.min(r,u),Math.max(r,u)];g.classList.toggle(t.rangeItem,S>=h&&S<=v),g.classList.toggle(t.selectedHover,o)}else g.classList.toggle(t.selectedHover,Y&&o),g.classList.toggle(t.hovered,!Y&&o)})},Q=()=>k==="month"?a(ye,{months:W,onChange:X,selectedMonth:l?n.secondMonth:n.month}):k==="year"?a(he,{onChange:j,selectedYear:l?n.secondYear:n.year,startYear:L}):H(ve,{children:[a("div",{className:t.daysOfWeek,children:de(e).map(s=>a(ge,{day:s},s))}),a("div",{className:t.calendarGrid,children:J})]}),X=s=>{c(s),B("day")},j=s=>{U(s),B("day")},Z=s=>{B(k!=="day"&&k===s?"day":s)},ee=()=>{O(L-20)},te=()=>{O(L+20)};function ae(){let s=I(new Date(x,N,1)),w=D?T(D):-1/0,p=i?T(i):1/0,u=new Date().toDateString(),b=new Intl.DateTimeFormat(e,{dateStyle:"full"}),m=(o,r)=>o?.toDateString()===r.toDateString(),g=Array.from({length:42},(o,r)=>{let h=new Date(x,N,r-s+1),v=h.getMonth()===N,$=!v||h.getTime()<w||h.getTime()>p;return{date:h,isCurrentMonth:v,isDisabled:$}}),S=g.filter(({isDisabled:o})=>!o).map(({date:o})=>o),Y=[A,n.tempValue.startDate,new Date].map(o=>S.find(r=>m(o,r))).find(Boolean)??S[0];return g.map(({date:o,isCurrentMonth:r,isDisabled:h})=>{let v=q(o,C),$=r&&m(n.tempValue.startDate,o),oe=r&&m(n.tempValue.endDate,o),F=$||oe,re=n.rangeDays.some(se=>m(se,o)),K=r&&o.toDateString()===u;return a(f,{"aria-current":K?"date":void 0,"aria-hidden":r?void 0:!0,"aria-label":b.format(o),"aria-pressed":r?F:void 0,className:`${t.day} ${r?"":t.disabledDay} ${F?t.selected:""} ${re&&!F&&r?t.rangeItem:""} ${r&&h?t.outOfRangeDay:""} ${K?t.today:""}`,"data-date":v,disabled:h,onClick:()=>{r&&y(o.getDate(),l)},onFocus:()=>{r&&V(v)},onKeyDown:ne,onMouseEnter:()=>{r&&V(v)},tabIndex:Y&&m(Y,o)?0:-1,variant:"unstyled",children:a("span",{className:t.dayText,children:o.getDate()})},v)})}function ne(s){let w=s.currentTarget.dataset.date,p=me[s.key];if(!w||!p)return;s.preventDefault();let u=p(ce(w,C)),b=u.getTime();if(D&&b<T(D)||i&&b>T(i))return;let m=(u.getFullYear()-x)*12+u.getMonth()-N;m!==0&&c(N+m),R.current=!0,z(u)}return H("div",{className:t.calendar,ref:E,children:[a("div",{className:t.calendarHeader,children:H("div",{className:t.monthYearSelectors,children:[k!=="year"?a(f,{"aria-label":"Previous month",onClick:()=>{c((l?n.secondMonth:n.month)-1)},variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"})})}):a(f,{"aria-label":"Previous years",onClick:ee,variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M205.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L131.31,128ZM51.31,128l74.35-74.34a8,8,0,0,0-11.32-11.32l-80,80a8,8,0,0,0,0,11.32l80,80a8,8,0,0,0,11.32-11.32Z"})})}),a(f,{className:t.monthSelector,label:W[l?n.secondMonth:n.month],onClick:()=>{Z("month")},variant:"unstyled"}),a("strong",{children:"/"}),a(f,{className:t.yearSelector,label:`${l?n.secondYear:n.year}`,onClick:()=>{Z("year")},variant:"unstyled"}),k!=="year"?a(f,{"aria-label":"Next month",onClick:()=>{c((l?n.secondMonth:n.month)+1)},variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"})})}):a(f,{"aria-label":"Next years",onClick:te,variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M141.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L124.69,128,50.34,53.66A8,8,0,0,1,61.66,42.34l80,80A8,8,0,0,1,141.66,133.66Zm80-11.32-80-80a8,8,0,0,0-11.32,11.32L204.69,128l-74.35,74.34a8,8,0,0,0,11.32,11.32l80-80A8,8,0,0,0,221.66,122.34Z"})})})]})}),Q()]})}export{ke as Calendar};
1
+ "use client";import{a as t}from"../../../chunk-OQEOAZF3.mjs";import{useEffect as le,useRef as _,useState as P}from"react";import{formatDate as q,getDateFromDateString as ce,getDaysOfWeekByLanguage as de,getMonthsByLanguage as ie}from"../../../utils/dates.mjs";import{Button as f}from"../../interaction/button/index.mjs";import{useDatePicker as ue}from"./use-datepicker.mjs";import{Fragment as ve,jsx as a,jsxs as H}from"react/jsx-runtime";var C="yyyy-mm-dd",M=(e,d)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+d),G=(e,d)=>{let l=new Date(e.getFullYear(),e.getMonth()+d+1,0).getDate();return new Date(e.getFullYear(),e.getMonth()+d,Math.min(e.getDate(),l))},I=e=>(e.getDay()+6)%7,me={ArrowLeft:e=>M(e,-1),ArrowRight:e=>M(e,1),ArrowUp:e=>M(e,-7),ArrowDown:e=>M(e,7),Home:e=>M(e,-I(e)),End:e=>M(e,6-I(e)),PageUp:e=>G(e,-1),PageDown:e=>G(e,1)},T=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();function ge({day:e}){return a("span",{className:t.dayOfWeek,children:e})}function ye({selectedMonth:e,months:d,onChange:l}){let D=i=>{l(i)};return a("div",{className:t.monthSelectorGrid,children:d.map((i,c)=>a(f,{"aria-pressed":c===e,className:`${c===e?t.selected:""} ${t.month}`,label:i,onClick:()=>{D(c)},variant:"unstyled"},i))})}function he({selectedYear:e,startYear:d,onChange:l}){let D=c=>{l(c)},i=()=>{let c=[];for(let y=d;y<d+20;y++)c.push(a(f,{"aria-pressed":e===y,className:`${e===y?t.selected:""} ${t.year}`,onClick:()=>{D(y)},variant:"unstyled",children:y},y));return c};return a("div",{className:t.yearSelectorGrid,children:i()})}function ke({language:e,isRange:d,isSecondCalendar:l,minDate:D,maxDate:i,onMonthChange:c,onSelectDate:y,onYearChange:U}){let{state:n}=ue(),[k,B]=P("day"),[L,O]=P(l?n.secondYear:n.year),[A,z]=P(null),R=_(!1),E=_(null),x=l?n.secondYear:n.year,N=l?n.secondMonth:n.month,J=ae(),W=ie(e);le(()=>{!R.current||!A||(R.current=!1,E.current?.querySelector(`[data-date="${q(A,C)}"]:enabled`)?.focus())});let V=s=>{let w=E.current?.closest('[role="dialog"]')??document,p=w.querySelectorAll(`.${t.day}:enabled`),u=Array.from(p).findIndex(g=>g.dataset.date===s),b=w.querySelector(`.${t.day}.${t.selected}`),m=d&&n.tempValue.startDate&&!n.tempValue.endDate&&b;p.forEach((g,S)=>{let Y=g.classList.contains(t.selected),o=S===u;if(m){let r=Array.from(p).indexOf(b),[h,v]=[Math.min(r,u),Math.max(r,u)];g.classList.toggle(t.rangeItem,S>=h&&S<=v),g.classList.toggle(t.selectedHover,o)}else g.classList.toggle(t.selectedHover,Y&&o),g.classList.toggle(t.hovered,!Y&&o)})},Q=()=>k==="month"?a(ye,{months:W,onChange:X,selectedMonth:l?n.secondMonth:n.month}):k==="year"?a(he,{onChange:j,selectedYear:l?n.secondYear:n.year,startYear:L}):H(ve,{children:[a("div",{className:t.daysOfWeek,children:de(e).map(s=>a(ge,{day:s},s))}),a("div",{className:t.calendarGrid,children:J})]}),X=s=>{c(s),B("day")},j=s=>{U(s),B("day")},Z=s=>{B(k!=="day"&&k===s?"day":s)},ee=()=>{O(L-20)},te=()=>{O(L+20)};function ae(){let s=I(new Date(x,N,1)),w=D?T(D):-1/0,p=i?T(i):1/0,u=new Date().toDateString(),b=new Intl.DateTimeFormat(e,{dateStyle:"full"}),m=(o,r)=>o?.toDateString()===r.toDateString(),g=Array.from({length:42},(o,r)=>{let h=new Date(x,N,r-s+1),v=h.getMonth()===N,$=!v||h.getTime()<w||h.getTime()>p;return{date:h,isCurrentMonth:v,isDisabled:$}}),S=g.filter(({isDisabled:o})=>!o).map(({date:o})=>o),Y=[A,n.tempValue.startDate,new Date].map(o=>S.find(r=>m(o,r))).find(Boolean)??S[0];return g.map(({date:o,isCurrentMonth:r,isDisabled:h})=>{let v=q(o,C),$=r&&m(n.tempValue.startDate,o),oe=r&&m(n.tempValue.endDate,o),F=$||oe,re=n.rangeDays.some(se=>m(se,o)),K=r&&o.toDateString()===u;return a(f,{"aria-current":K?"date":void 0,"aria-hidden":r?void 0:!0,"aria-label":b.format(o),"aria-pressed":r?F:void 0,className:`${t.day} ${r?"":t.disabledDay} ${F?t.selected:""} ${re&&!F&&r?t.rangeItem:""} ${r&&h?t.outOfRangeDay:""} ${K?t.today:""}`,"data-date":v,disabled:h,onClick:()=>{r&&y(o.getDate(),l)},onFocus:()=>{r&&V(v)},onKeyDown:ne,onMouseEnter:()=>{r&&V(v)},tabIndex:Y&&m(Y,o)?0:-1,variant:"unstyled",children:a("span",{className:t.dayText,children:o.getDate()})},v)})}function ne(s){let w=s.currentTarget.dataset.date,p=me[s.key];if(!w||!p)return;s.preventDefault();let u=p(ce(w,C)),b=u.getTime();if(D&&b<T(D)||i&&b>T(i))return;let m=(u.getFullYear()-x)*12+u.getMonth()-N;m!==0&&c(N+m),R.current=!0,z(u)}return H("div",{className:t.calendar,ref:E,children:[a("div",{className:t.calendarHeader,children:H("div",{className:t.monthYearSelectors,children:[k!=="year"?a(f,{"aria-label":"Previous month",onClick:()=>{c((l?n.secondMonth:n.month)-1)},variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"})})}):a(f,{"aria-label":"Previous years",onClick:ee,variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M205.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L131.31,128ZM51.31,128l74.35-74.34a8,8,0,0,0-11.32-11.32l-80,80a8,8,0,0,0,0,11.32l80,80a8,8,0,0,0,11.32-11.32Z"})})}),a(f,{className:t.monthSelector,label:W[l?n.secondMonth:n.month],onClick:()=>{Z("month")},variant:"unstyled"}),a("strong",{children:"/"}),a(f,{className:t.yearSelector,label:`${l?n.secondYear:n.year}`,onClick:()=>{Z("year")},variant:"unstyled"}),k!=="year"?a(f,{"aria-label":"Next month",onClick:()=>{c((l?n.secondMonth:n.month)+1)},variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"})})}):a(f,{"aria-label":"Next years",onClick:te,variant:"icon",children:a("svg",{"aria-hidden":"true",fill:"currentColor",height:"16",stroke:"currentColor",strokeWidth:"10",viewBox:"0 0 256 256",width:"16",xmlns:"http://www.w3.org/2000/svg",children:a("path",{d:"M141.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L124.69,128,50.34,53.66A8,8,0,0,1,61.66,42.34l80,80A8,8,0,0,1,141.66,133.66Zm80-11.32-80-80a8,8,0,0,0-11.32,11.32L204.69,128l-74.35,74.34a8,8,0,0,0,11.32,11.32l80-80A8,8,0,0,0,221.66,122.34Z"})})})]})}),Q()]})}export{ke as Calendar};
@@ -1 +1 @@
1
- "use client";import{a as m}from"../../../chunk-JMACSFO3.mjs";import{useCallback as Z,useEffect as B,useRef as q,useState as C}from"react";import{Button as x}from"../../interaction/button/index.mjs";import{Input as N}from"../input/index.mjs";import{getDateFormatByLanguage as E,getDateFromDateString as v,getDateStringByLanguage as T,validateFormatDate as f}from"../../../utils/dates.mjs";import{useDebounce as O}from"../../../hooks/use-debounce.mjs";import{useDatePicker as R}from"./use-datepicker.mjs";import{Fragment as U,jsx as c,jsxs as _}from"react/jsx-runtime";function X({disabled:D,displayFormat:t,inputRef:i,isRange:r,language:e,onClick:b,onBlur:w,readOnly:d,...y}){let{state:{modalOpen:L,value:{startDate:a,endDate:s}},dispatch:u}=R(),[h,k]=C(T({displayFormat:t,isRange:r,...a&&{startDate:a},...s&&{endDate:s},language:e})),[P,I]=C(!0),n=O({value:h,delay:500}),g=q(null),S=Z(o=>{g.current=o,typeof i=="function"?i(o):i&&(i.current=o)},[i]);B(()=>{if(![10,23].includes(n.length)||P)return;let o=t??E(e);if(n.length===10&&!r&&f(n,e,t)){let l=v(n,o);u({type:"SET_VALUE",payload:{startDate:l,endDate:null}})}else if(n.length===23&&f(n.split(" - ")[0],e,t)&&f(n.split(" - ")[1],e,t)){let[l,V]=n.split(" - ");u({type:"SET_VALUE",payload:{startDate:v(l,o),endDate:v(V,o)}})}},[n,u,t,P,r,e]),B(()=>{k(T({displayFormat:t,isRange:r,...a&&{startDate:a},...s&&{endDate:s},language:e}))},[a,s,t,r,e]);let H=()=>{I(!0),g.current?.focus(),b()},M=o=>{I(!1),k(o.target.value)},p=(t??E(e)).replace(/[a-zA-Z]/g,"#"),A=r?`${p} - ${p}`:p;return _(U,{children:[c(N,{disabled:D,inputMode:"numeric",mask:A,onBlur:()=>{w?.({startDate:a,endDate:s})},onChange:M,readOnly:d,ref:S,type:"text",value:h,variant:"unstyled",...y}),c(x,{"aria-expanded":L,"aria-haspopup":"dialog","aria-label":"Open calendar",className:m.inputButton,disabled:D||d,onClick:H,shape:"pill",variant:"icon",children:c("svg",{className:m.inputButtonIcon,viewBox:"0 -960 960 960",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z"})})})]})}export{X as DatePickerInput};
1
+ "use client";import{a as m}from"../../../chunk-OQEOAZF3.mjs";import{useCallback as Z,useEffect as B,useRef as q,useState as C}from"react";import{Button as x}from"../../interaction/button/index.mjs";import{Input as N}from"../input/index.mjs";import{getDateFormatByLanguage as E,getDateFromDateString as v,getDateStringByLanguage as T,validateFormatDate as f}from"../../../utils/dates.mjs";import{useDebounce as O}from"../../../hooks/use-debounce.mjs";import{useDatePicker as R}from"./use-datepicker.mjs";import{Fragment as U,jsx as c,jsxs as _}from"react/jsx-runtime";function X({disabled:D,displayFormat:t,inputRef:i,isRange:r,language:e,onClick:b,onBlur:w,readOnly:d,...y}){let{state:{modalOpen:L,value:{startDate:a,endDate:s}},dispatch:u}=R(),[h,k]=C(T({displayFormat:t,isRange:r,...a&&{startDate:a},...s&&{endDate:s},language:e})),[P,I]=C(!0),n=O({value:h,delay:500}),g=q(null),S=Z(o=>{g.current=o,typeof i=="function"?i(o):i&&(i.current=o)},[i]);B(()=>{if(![10,23].includes(n.length)||P)return;let o=t??E(e);if(n.length===10&&!r&&f(n,e,t)){let l=v(n,o);u({type:"SET_VALUE",payload:{startDate:l,endDate:null}})}else if(n.length===23&&f(n.split(" - ")[0],e,t)&&f(n.split(" - ")[1],e,t)){let[l,V]=n.split(" - ");u({type:"SET_VALUE",payload:{startDate:v(l,o),endDate:v(V,o)}})}},[n,u,t,P,r,e]),B(()=>{k(T({displayFormat:t,isRange:r,...a&&{startDate:a},...s&&{endDate:s},language:e}))},[a,s,t,r,e]);let H=()=>{I(!0),g.current?.focus(),b()},M=o=>{I(!1),k(o.target.value)},p=(t??E(e)).replace(/[a-zA-Z]/g,"#"),A=r?`${p} - ${p}`:p;return _(U,{children:[c(N,{disabled:D,inputMode:"numeric",mask:A,onBlur:()=>{w?.({startDate:a,endDate:s})},onChange:M,readOnly:d,ref:S,type:"text",value:h,variant:"unstyled",...y}),c(x,{"aria-expanded":L,"aria-haspopup":"dialog","aria-label":"Open calendar",className:m.inputButton,disabled:D||d,onClick:H,shape:"pill",variant:"icon",children:c("svg",{className:m.inputButtonIcon,viewBox:"0 -960 960 960",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z"})})})]})}export{X as DatePickerInput};
@@ -1,2 +1,2 @@
1
- "use client";import{a as l}from"../../../chunk-JMACSFO3.mjs";import{forwardRef as ae,useEffect as A,useRef as oe,useReducer as ne}from"react";import{getDateFormatByLanguage as re}from"../../../utils/dates.mjs";import{Button as $}from"../../interaction/button/index.mjs";import{useClickOutside as le}from"../../../hooks/use-click-outside.mjs";import{DatePickerContext as se}from"./use-datepicker.mjs";import{DEFAULT_DATE_PICKER_VALUE as ie,DATE_PICKER_INITIAL_STATE as w,datePickerReducer as I}from"./datepicker-reducer.mjs";import{Calendar as H}from"./calendar.mjs";import{DatePickerInput as ce}from"./datepicker-input.mjs";import{jsx as D,jsxs as L}from"react/jsx-runtime";var de="en",Y={apply:"Apply",cancel:"Cancel"},pe=(n,d)=>({"--datepicker-scheme":`var(--plume-color-${n}-text)`,"--datepicker-solid":`var(--plume-color-${n}-solid)`,"--datepicker-contrast":`var(--plume-color-${n}-solid-contrast)`,"--datepicker-range-item-color":`var(--plume-color-${n}-200)`,"--datepicker-range-item-text":`var(--plume-color-${n}-900)`,"--datepicker-hover-color":`var(--plume-color-${n}-100)`,"--datepicker-selected-hover-color":`var(--plume-color-${n}-solid-hover)`,...d??{}});function ue({colorScheme:n,labels:{cancel:d,apply:y},onApply:s,onCancel:p}){return L("div",{className:l.footerActions,children:[D($,{className:l.footerButton,label:d,onClick:p,variant:"ghost"}),D($,{className:l.footerButtonApply,colorScheme:n,label:y,onClick:s})]})}var me=(n,d,y,s,p,u)=>{let h=u&&(u!=="md"||s==="unstyled")?l[u]:"",v=p&&(p!=="rounded"||s==="unstyled")?l[p]:"",k=s!=="unstyled"?l[s]:"",f=d?l.disabled:"",g=y&&s!=="unstyled"?l.invalid:"";return`${h} ${v} ${k}
2
- ${f} ${g} ${n}`.trim()},De=ae(({onChange:n,onBlur:d,inputRef:y,displayFormat:s,style:p,showFooter:u,minDate:h,maxDate:v,placeholder:k,value:f,disabled:g=!1,className:B="",colorScheme:R="secondary",variant:T="outline",config:M,isCalendar:E=!1,isRange:i=!1,...C},b)=>{let S=M?.language??de,U={apply:M?.footer?.apply??Y.apply,cancel:M?.footer?.cancel??Y.cancel},[t,o]=ne(I,f,e=>e?I(w,{type:"SET_VALUE",payload:e}):w),O=oe(!0),m=le({callback:()=>{o({type:"CLOSE_MODAL"})}}),G=e=>{m.current=e,typeof b=="function"?b(e):b&&(b.current=e)},{size:q=T!=="unstyled"?"md":void 0,shape:z=T!=="unstyled"?"rounded":void 0}=C,K=me(B,g,C["aria-invalid"]===!0||C["aria-invalid"]==="true",T,z,q);A(()=>{if(t.modalOpen)if(i&&t.tempValue.startDate&&t.tempValue.endDate){let e=[],a=new Date(t.tempValue.startDate);for(;a<=t.tempValue.endDate;)e.push(new Date(a)),a.setDate(a.getDate()+1);o({type:"SET_RANGE_DAYS",payload:e})}else o({type:"SET_RANGE_DAYS",payload:[]})},[i,t.tempValue,t.modalOpen]),A(()=>{if(O.current){O.current=!1;return}o({type:"SET_VALUE",payload:f??ie})},[f]),A(()=>{t.modalOpen&&m.current?.querySelector('[role="dialog"] [data-date][tabindex="0"]')?.focus()},[t.modalOpen,m]);let J=()=>{o({type:"TOGGLE_MODAL"})},_=()=>{E||(o({type:"CLOSE_MODAL"}),m.current?.querySelector("input")?.focus())};A(()=>{if(!t.modalOpen||E)return;let e=a=>{a.key!=="Escape"||!m.current?.contains(a.target)||(o({type:"CLOSE_MODAL"}),m.current.querySelector("input")?.focus())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t.modalOpen,E,m]);let Q=e=>{let a=e.relatedTarget;a&&!e.currentTarget.contains(a)&&o({type:"CLOSE_MODAL"})},P=(e,a)=>e*12+a,F=(e,a)=>{o({type:"SET_YEAR",payload:Math.floor(e/12)}),o({type:"SET_MONTH",payload:e%12}),o({type:"SET_SECOND_YEAR",payload:Math.floor(a/12)}),o({type:"SET_SECOND_MONTH",payload:a%12})},N=(e,a)=>{let c=P(e,a);F(c,Math.max(P(t.secondYear,t.secondMonth),c+1))},V=(e,a)=>{let c=P(e,a);F(Math.min(P(t.year,t.month),c-1),c)},W=e=>{N(e,t.month)},X=e=>{N(t.year,e)},Z=e=>{V(e,t.secondMonth)},j=e=>{V(t.secondYear,e)},ee=()=>{o({type:"SET_VALUE",payload:t.tempValue}),t.tempValue.startDate&&n({startDate:t.tempValue.startDate,endDate:t.tempValue.endDate}),_()},x=(e,a)=>{let c=new Date(a?t.secondYear:t.year,a?t.secondMonth:t.month,e),r={...t.tempValue};u||!i||!r.startDate||r.endDate?(r.startDate=c,r.endDate=null):c<r.startDate?(r.endDate=r.startDate,r.startDate=c):r.endDate=c,o({type:"SET_TEMP_VALUE",payload:r}),!u&&(!i||r.endDate)&&(n({startDate:r.startDate,endDate:r.endDate}),o({type:"SET_VALUE",payload:r}),_())},te=()=>{let e=s??re(S);return i?`${e} - ${e}`:e};return D(se.Provider,{value:{state:t,dispatch:o},children:L("div",{className:l.datePicker,onBlur:Q,ref:G,style:pe(R,p),children:[!E&&D(ce,{className:K,disabled:g,displayFormat:s,inputRef:y,isRange:i,language:S,onBlur:d,onClick:J,placeholder:k??te(),...C}),E||t.modalOpen?L("div",{"aria-label":"Calendar",className:l.datePickerModal,role:"dialog",children:[L("div",{className:i?l.calendarContainerDouble:l.calendarContainer,children:[D(H,{isRange:i,language:S,maxDate:v,minDate:h,onMonthChange:X,onSelectDate:x,onYearChange:W}),i?D(H,{isRange:i,isSecondCalendar:!0,language:S,maxDate:v,minDate:h,onMonthChange:j,onSelectDate:x,onYearChange:Z}):null]}),u?D(ue,{colorScheme:R,labels:U,onApply:ee,onCancel:_}):null]}):null]})})});De.displayName="DatePicker";export{De as DatePicker};
1
+ "use client";import{a as l}from"../../../chunk-OQEOAZF3.mjs";import{forwardRef as ie,useCallback as ce,useEffect as L,useRef as de,useReducer as pe,useState as w}from"react";import{getDateFormatByLanguage as ue}from"../../../utils/dates.mjs";import{Button as I}from"../../interaction/button/index.mjs";import{useClickOutside as me}from"../../../hooks/use-click-outside.mjs";import{usePosition as De}from"../../../overlay/use-position.mjs";import{DatePickerContext as ye}from"./use-datepicker.mjs";import{DEFAULT_DATE_PICKER_VALUE as fe,DATE_PICKER_INITIAL_STATE as H,datePickerReducer as Y}from"./datepicker-reducer.mjs";import{Calendar as B}from"./calendar.mjs";import{DatePickerInput as Ee}from"./datepicker-input.mjs";import{jsx as y,jsxs as A}from"react/jsx-runtime";var he="en",U={apply:"Apply",cancel:"Cancel"},ve=(n,p)=>({"--datepicker-scheme":`var(--plume-color-${n}-text)`,"--datepicker-solid":`var(--plume-color-${n}-solid)`,"--datepicker-contrast":`var(--plume-color-${n}-solid-contrast)`,"--datepicker-range-item-color":`var(--plume-color-${n}-200)`,"--datepicker-range-item-text":`var(--plume-color-${n}-900)`,"--datepicker-hover-color":`var(--plume-color-${n}-100)`,"--datepicker-selected-hover-color":`var(--plume-color-${n}-solid-hover)`,...p??{}});function ge({colorScheme:n,labels:{cancel:p,apply:f},onApply:s,onCancel:u}){return A("div",{className:l.footerActions,children:[y(I,{className:l.footerButton,label:p,onClick:u,variant:"ghost"}),y(I,{className:l.footerButtonApply,colorScheme:n,label:f,onClick:s})]})}var be=(n,p,f,s,u,m)=>{let v=m&&(m!=="md"||s==="unstyled")?l[m]:"",g=u&&(u!=="rounded"||s==="unstyled")?l[u]:"",k=s!=="unstyled"?l[s]:"",E=p?l.disabled:"",b=f&&s!=="unstyled"?l.invalid:"";return`${v} ${g} ${k}
2
+ ${E} ${b} ${n}`.trim()},Pe=ie(({onChange:n,onBlur:p,inputRef:f,displayFormat:s,style:u,showFooter:m,minDate:v,maxDate:g,placeholder:k,value:E,disabled:b=!1,className:G="",colorScheme:O="secondary",variant:T="outline",config:M,isCalendar:D=!1,isRange:i=!1,...P},h)=>{let S=M?.language??he,q={apply:M?.footer?.apply??U.apply,cancel:M?.footer?.cancel??U.cancel},[t,o]=pe(Y,E,e=>e?Y(H,{type:"SET_VALUE",payload:e}):H),R=de(!0),d=me({callback:()=>{o({type:"CLOSE_MODAL"})}}),[z,K]=w(null),[J,Q]=w(null),W=ce(e=>{d.current=e,K(e),typeof h=="function"?h(e):h&&(h.current=e)},[h,d]),F=De({anchor:z,enabled:!D&&t.modalOpen,floating:J,offset:8,placement:"bottom-start"}),{size:X=T!=="unstyled"?"md":void 0,shape:Z=T!=="unstyled"?"rounded":void 0}=P,j=be(G,b,P["aria-invalid"]===!0||P["aria-invalid"]==="true",T,Z,X);L(()=>{if(t.modalOpen)if(i&&t.tempValue.startDate&&t.tempValue.endDate){let e=[],a=new Date(t.tempValue.startDate);for(;a<=t.tempValue.endDate;)e.push(new Date(a)),a.setDate(a.getDate()+1);o({type:"SET_RANGE_DAYS",payload:e})}else o({type:"SET_RANGE_DAYS",payload:[]})},[i,t.tempValue,t.modalOpen]),L(()=>{if(R.current){R.current=!1;return}o({type:"SET_VALUE",payload:E??fe})},[E]),L(()=>{t.modalOpen&&d.current?.querySelector('[role="dialog"] [data-date][tabindex="0"]')?.focus()},[t.modalOpen,d]);let ee=()=>{o({type:"TOGGLE_MODAL"})},_=()=>{D||(o({type:"CLOSE_MODAL"}),d.current?.querySelector("input")?.focus())};L(()=>{if(!t.modalOpen||D)return;let e=a=>{a.key!=="Escape"||!d.current?.contains(a.target)||(o({type:"CLOSE_MODAL"}),d.current.querySelector("input")?.focus())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t.modalOpen,D,d]);let te=e=>{let a=e.relatedTarget;a&&!e.currentTarget.contains(a)&&o({type:"CLOSE_MODAL"})},C=(e,a)=>e*12+a,N=(e,a)=>{o({type:"SET_YEAR",payload:Math.floor(e/12)}),o({type:"SET_MONTH",payload:e%12}),o({type:"SET_SECOND_YEAR",payload:Math.floor(a/12)}),o({type:"SET_SECOND_MONTH",payload:a%12})},V=(e,a)=>{let c=C(e,a);N(c,Math.max(C(t.secondYear,t.secondMonth),c+1))},x=(e,a)=>{let c=C(e,a);N(Math.min(C(t.year,t.month),c-1),c)},ae=e=>{V(e,t.month)},oe=e=>{V(t.year,e)},ne=e=>{x(e,t.secondMonth)},re=e=>{x(t.secondYear,e)},le=()=>{o({type:"SET_VALUE",payload:t.tempValue}),t.tempValue.startDate&&n({startDate:t.tempValue.startDate,endDate:t.tempValue.endDate}),_()},$=(e,a)=>{let c=new Date(a?t.secondYear:t.year,a?t.secondMonth:t.month,e),r={...t.tempValue};m||!i||!r.startDate||r.endDate?(r.startDate=c,r.endDate=null):c<r.startDate?(r.endDate=r.startDate,r.startDate=c):r.endDate=c,o({type:"SET_TEMP_VALUE",payload:r}),!m&&(!i||r.endDate)&&(n({startDate:r.startDate,endDate:r.endDate}),o({type:"SET_VALUE",payload:r}),_())},se=()=>{let e=s??ue(S);return i?`${e} - ${e}`:e};return y(ye.Provider,{value:{state:t,dispatch:o},children:A("div",{className:l.datePicker,onBlur:te,ref:W,style:ve(O,u),children:[!D&&y(Ee,{className:j,disabled:b,displayFormat:s,inputRef:f,isRange:i,language:S,onBlur:p,onClick:ee,placeholder:k??se(),...P}),D||t.modalOpen?A("div",{"aria-label":"Calendar",className:l.datePickerModal,ref:Q,role:"dialog",style:D?void 0:{...F.style,margin:0,opacity:F.isPositioned?void 0:0},children:[A("div",{className:i?l.calendarContainerDouble:l.calendarContainer,children:[y(B,{isRange:i,language:S,maxDate:g,minDate:v,onMonthChange:oe,onSelectDate:$,onYearChange:ae}),i?y(B,{isRange:i,isSecondCalendar:!0,language:S,maxDate:g,minDate:v,onMonthChange:re,onSelectDate:$,onYearChange:ne}):null]}),m?y(ge,{colorScheme:O,labels:q,onApply:le,onCancel:_}):null]}):null]})})});Pe.displayName="DatePicker";export{Pe as DatePicker};
@@ -1 +1 @@
1
- "use client";import{a as n}from"../../../chunk-V7QXMR67.mjs";import{forwardRef as B,useEffect as f,useState as h}from"react";import{Portal as F}from"../../../overlay/index.mjs";import{useFloatingPanel as O}from"../../../overlay/use-floating-panel.mjs";import{joinClasses as c}from"../../../overlay/class-names.mjs";import{mergeRefs as k}from"../../../overlay/trigger.mjs";import{useSelectContext as K}from"./select-context.mjs";import{jsx as a,jsxs as j}from"react/jsx-runtime";var W=B(({"aria-label":m,children:b,className:C="",classNames:r,emptyText:y="No results",searchLabel:v="Search",searchPlaceholder:S,style:P},g)=>{let e=K("SelectContent"),{close:x,flip:L,isStyled:l,labelling:u,multiple:w,offset:R,open:t,placement:E,query:i,shift:M,trigger:s}=e,[p,T]=h(null),[H,I]=h(void 0),{position:d,setPanel:N}=O({anchor:s,enabled:t,flip:L,offset:R,onDismiss:o=>x(o==="escape"),placement:E,shift:M});f(()=>{t&&s&&I(s.getBoundingClientRect().width)},[t,s]),f(()=>{t&&p&&p.focus({preventScroll:!0})},[t,p]);let D=[l&&n.panel,C].filter(Boolean).join(" "),A=e.options.some(o=>!i||o.label.toLowerCase().includes(i.toLowerCase()));return a(F,{children:j("div",{className:D||void 0,"data-placement":d.placement,"data-plume-select-panel":"",hidden:!t,ref:k(N,g),style:{...d.style,minWidth:H,opacity:d.isPositioned?void 0:0,...P},children:[e.searchable?a("div",{className:c(l&&n.search,r?.search),children:a("input",{"aria-activedescendant":e.activeId,"aria-autocomplete":"list","aria-controls":e.listboxId,"aria-expanded":t,"aria-label":v,autoComplete:"off",className:c(l&&n.searchInput,r?.searchInput),onChange:o=>e.setQuery(o.target.value),onKeyDown:o=>e.onListKeyDown(o,!0),placeholder:S,ref:T,role:"combobox",spellCheck:!1,type:"text",value:i})}):null,a("div",{"aria-label":m??u.label,"aria-labelledby":m?void 0:u.labelledBy,"aria-multiselectable":w||void 0,className:c(l&&n.list,r?.list),"data-plume-select-list":"",id:e.listboxId,ref:e.setListbox,role:"listbox",children:b}),i&&!A?a("div",{className:c(l&&n.empty,r?.empty),children:y}):null]})})});W.displayName="SelectContent";export{W as SelectContent};
1
+ "use client";import{a as n}from"../../../chunk-YXXQZOHK.mjs";import{forwardRef as B,useEffect as f,useState as h}from"react";import{Portal as F}from"../../../overlay/index.mjs";import{useFloatingPanel as O}from"../../../overlay/use-floating-panel.mjs";import{joinClasses as c}from"../../../overlay/class-names.mjs";import{mergeRefs as k}from"../../../overlay/trigger.mjs";import{useSelectContext as K}from"./select-context.mjs";import{jsx as a,jsxs as j}from"react/jsx-runtime";var W=B(({"aria-label":m,children:b,className:C="",classNames:r,emptyText:y="No results",searchLabel:v="Search",searchPlaceholder:S,style:P},g)=>{let e=K("SelectContent"),{close:x,flip:L,isStyled:l,labelling:u,multiple:w,offset:R,open:t,placement:E,query:i,shift:M,trigger:s}=e,[p,T]=h(null),[H,I]=h(void 0),{position:d,setPanel:N}=O({anchor:s,enabled:t,flip:L,offset:R,onDismiss:o=>x(o==="escape"),placement:E,shift:M});f(()=>{t&&s&&I(s.getBoundingClientRect().width)},[t,s]),f(()=>{t&&p&&p.focus({preventScroll:!0})},[t,p]);let D=[l&&n.panel,C].filter(Boolean).join(" "),A=e.options.some(o=>!i||o.label.toLowerCase().includes(i.toLowerCase()));return a(F,{children:j("div",{className:D||void 0,"data-placement":d.placement,"data-plume-select-panel":"",hidden:!t,ref:k(N,g),style:{...d.style,minWidth:H,opacity:d.isPositioned?void 0:0,...P},children:[e.searchable?a("div",{className:c(l&&n.search,r?.search),children:a("input",{"aria-activedescendant":e.activeId,"aria-autocomplete":"list","aria-controls":e.listboxId,"aria-expanded":t,"aria-label":v,autoComplete:"off",className:c(l&&n.searchInput,r?.searchInput),onChange:o=>e.setQuery(o.target.value),onKeyDown:o=>e.onListKeyDown(o,!0),placeholder:S,ref:T,role:"combobox",spellCheck:!1,type:"text",value:i})}):null,a("div",{"aria-label":m??u.label,"aria-labelledby":m?void 0:u.labelledBy,"aria-multiselectable":w||void 0,className:c(l&&n.list,r?.list),"data-plume-select-list":"",id:e.listboxId,ref:e.setListbox,role:"listbox",children:b}),i&&!A?a("div",{className:c(l&&n.empty,r?.empty),children:y}):null]})})});W.displayName="SelectContent";export{W as SelectContent};
@@ -1 +1 @@
1
- "use client";import{a as e}from"../../../chunk-V7QXMR67.mjs";import{forwardRef as d,useId as c}from"react";import{useSelectContext as m}from"./select-context.mjs";import{jsx as f,jsxs as S}from"react/jsx-runtime";var u=d(({children:t,className:l="",label:p,labelClassName:s="",style:a},i)=>{let{isStyled:o}=m("SelectGroup"),r=c(),n=[o&&e.group,l].filter(Boolean).join(" ");return S("div",{"aria-labelledby":r,className:n||void 0,ref:i,role:"group",style:a,children:[f("div",{className:[o&&e.groupLabel,s].filter(Boolean).join(" ")||void 0,id:r,children:p}),t]})});u.displayName="SelectGroup";export{u as SelectGroup};
1
+ "use client";import{a as e}from"../../../chunk-YXXQZOHK.mjs";import{forwardRef as d,useId as c}from"react";import{useSelectContext as m}from"./select-context.mjs";import{jsx as f,jsxs as S}from"react/jsx-runtime";var u=d(({children:t,className:l="",label:p,labelClassName:s="",style:a},i)=>{let{isStyled:o}=m("SelectGroup"),r=c(),n=[o&&e.group,l].filter(Boolean).join(" ");return S("div",{"aria-labelledby":r,className:n||void 0,ref:i,role:"group",style:a,children:[f("div",{className:[o&&e.groupLabel,s].filter(Boolean).join(" ")||void 0,id:r,children:p}),t]})});u.displayName="SelectGroup";export{u as SelectGroup};
@@ -1 +1 @@
1
- "use client";import{a}from"../../../chunk-V7QXMR67.mjs";import{forwardRef as j,useEffect as w,useId as h,useRef as P,useState as A}from"react";import{joinClasses as O}from"../../../overlay/class-names.mjs";import{CheckIcon as D}from"../../../overlay/icons.mjs";import{useSelectContext as F}from"./select-context.mjs";import{Fragment as J,jsx as n,jsxs as S}from"react/jsx-runtime";var $=(e,o)=>e.toLowerCase().includes(o.toLowerCase()),q=e=>e==="Enter"||e===" ";function y({children:e,className:o,show:t}){return t?n("span",{"aria-hidden":"true",className:o,children:e}):null}function Q({children:e,className:o,id:t}){return e?S(J,{children:[" ",n("span",{className:o,id:t,children:e})]}):null}function z({children:e,disabled:o,icon:t,label:r,value:i},d){let f=P(null),m=P(t),[s,R]=A(r??""),c=r??s;return m.current=t,w(()=>{r===void 0&&R(f.current?.textContent??"")},[e,r]),w(()=>d({disabled:!!o,get icon(){return m.current},label:c,value:i}),[o,d,c,i]),{resolved:c,textRef:f}}var G=j(({children:e,className:o="",classNames:t,description:r,disabled:i=!1,icon:d,label:f,style:m,value:s},R)=>{let c=F("SelectOption"),u=h(),N=h(),x=h(),{isStyled:l,multiple:M,query:E,register:g,select:b,setActiveId:C}=c,{resolved:k,textRef:I}=z({children:e,disabled:i,icon:d,label:f,value:s},g),v=c.isSelected(s),L=$(k,E),T=[l&&a.option,o].filter(Boolean).join(" "),H=()=>{!i&&c.activeId!==u&&C(u)},K=p=>{p.preventDefault(),i||b(s)},B=p=>{q(p.key)&&(p.preventDefault(),i||b(s))};return S("div",{"aria-disabled":i||void 0,"aria-labelledby":r?`${x} ${N}`:void 0,"aria-selected":v,className:T||void 0,"data-active":c.activeId===u?"":void 0,"data-label":k,"data-plume-select-option":"","data-value":s,hidden:!L,id:u,onClick:K,onKeyDown:B,onMouseDown:p=>p.preventDefault(),onPointerMove:H,ref:R,role:"option",style:m,tabIndex:-1,children:[n(y,{className:O(l&&a.checkbox,t?.checkbox),show:M,children:v?n(D,{}):null}),n(y,{className:O(l&&a.optionIcon,t?.icon),show:!!d,children:d}),S("span",{className:l?a.optionBody:void 0,"data-plume-select-option-body":"",children:[n("span",{id:x,ref:I,children:e??f}),n(Q,{className:O(l&&a.description,t?.description),id:N,children:r})]}),n(y,{className:O(l&&a.check,t?.check),show:!M&&v,children:n(D,{})})]})});G.displayName="SelectOption";export{G as SelectOption};
1
+ "use client";import{a as l}from"../../../chunk-YXXQZOHK.mjs";import{forwardRef as K,useEffect as P,useId as O,useRef as w,useState as B}from"react";import{joinClasses as v}from"../../../overlay/class-names.mjs";import{CheckIcon as j}from"../../../overlay/icons.mjs";import{useSelectContext as A}from"./select-context.mjs";import{Fragment as G,jsx as s,jsxs as y}from"react/jsx-runtime";var F=(e,t)=>e.toLowerCase().includes(t.toLowerCase()),$=e=>e==="Enter"||e===" ";function D({children:e,className:t,show:o}){return o?s("span",{"aria-hidden":"true",className:t,children:e}):null}function q({children:e,className:t,id:o}){return e?y(G,{children:[" ",s("span",{className:t,id:o,children:e})]}):null}function Q({children:e,disabled:t,icon:o,label:r,value:n},a){let p=w(null),m=w(o),[c,R]=B(r??""),i=r??c;return m.current=o,P(()=>{r===void 0&&R(p.current?.textContent??"")},[e,r]),P(()=>a({disabled:!!t,get icon(){return m.current},label:i,value:n}),[t,a,i,n]),{resolved:i,textRef:p}}var z=K(({children:e,className:t="",classNames:o,description:r,disabled:n=!1,icon:a,label:p,style:m,value:c},R)=>{let i=A("SelectOption"),f=O(),S=O(),N=O(),{isStyled:u,query:E,register:b,select:h,setActiveId:g}=i,{resolved:x,textRef:k}=Q({children:e,disabled:n,icon:a,label:p,value:c},b),M=i.isSelected(c),C=F(x,E),I=[u&&l.option,t].filter(Boolean).join(" "),L=()=>{!n&&i.activeId!==f&&g(f)},T=d=>{d.preventDefault(),n||h(c)},H=d=>{$(d.key)&&(d.preventDefault(),n||h(c))};return y("div",{"aria-disabled":n||void 0,"aria-labelledby":r?`${N} ${S}`:void 0,"aria-selected":M,className:I||void 0,"data-active":i.activeId===f?"":void 0,"data-label":x,"data-plume-select-option":"","data-value":c,hidden:!C,id:f,onClick:T,onKeyDown:H,onMouseDown:d=>d.preventDefault(),onPointerMove:L,ref:R,role:"option",style:m,tabIndex:-1,children:[s(D,{className:v(u&&l.optionIcon,o?.icon),show:!!a,children:a}),y("span",{className:u?l.optionBody:void 0,"data-plume-select-option-body":"",children:[s("span",{id:N,ref:k,children:e??p}),s(q,{className:v(u&&l.description,o?.description),id:S,children:r})]}),s(D,{className:v(u&&l.check,o?.check),show:M,children:s(j,{})})]})});z.displayName="SelectOption";export{z as SelectOption};
@@ -1 +1 @@
1
- "use client";import{a as i}from"../../../chunk-V7QXMR67.mjs";import{forwardRef as N,useEffect as O,useRef as V}from"react";import{ChevronDownIcon as D,CloseIcon as E}from"../../../overlay/icons.mjs";import{joinClasses as g}from"../../../overlay/class-names.mjs";import{mergeRefs as H}from"../../../overlay/trigger.mjs";import{Chip as S}from"../../presentation/chip/index.mjs";import{useFieldContext as M}from"../field/field-context.mjs";import{useSelectContext as R}from"./select-context.mjs";import{SelectValue as x}from"./select-value.mjs";import{Fragment as P,jsx as a,jsxs as b}from"react/jsx-runtime";var k={border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1};function z({classNames:l,context:t,maxDisplay:n,removeLabel:e}){let{isStyled:o,selectedOptions:c}=t,d=c.slice(0,n),p=c.length-d.length,m=!t.disabled&&!t.readOnly,u=o?"subtle":"unstyled";return b(P,{children:[d.map(s=>a(S,{className:l?.chip,classNames:{remove:l?.chipRemove},icon:s.icon,onRemove:m?()=>t.remove(s.value):void 0,removeLabel:e(s.label),size:t.size,variant:u,children:a("span",{"aria-hidden":"true",children:s.label})},s.value)),p>0?b(S,{className:l?.chip,size:t.size,variant:u,children:["+",p]}):null]})}function F(l,t){let{isStyled:n}=l;return[n&&i.control,n&&i[l.variant],n&&i[l.size],n&&i[l.shape],n&&l.invalid&&i.invalid,n&&l.disabled&&i.disabled,t].filter(Boolean).join(" ")||void 0}var T=N(({ariaLabel:l,children:t,classNames:n,context:e,labelledBy:o,placeholder:c,showChips:d},p)=>{let{isStyled:m,open:u}=e,s=e.selected.length>0,f=e.selectedOptions.map(r=>r.label).join(", ");return a("button",{"aria-activedescendant":u&&!e.searchable?e.activeId:void 0,"aria-controls":e.listboxId,"aria-describedby":e.describedBy,"aria-expanded":u,"aria-invalid":e.invalid||void 0,"aria-label":l,"aria-labelledby":o,"aria-readonly":e.readOnly||void 0,"aria-required":e.required||void 0,className:g(m&&i.trigger,n?.trigger),"data-placeholder":s?void 0:"","data-plume-select-trigger":"",disabled:e.disabled,id:e.controlId,onClick:()=>u?e.close(!1):e.setOpen(!0),onKeyDown:r=>e.onListKeyDown(r,!1),ref:p,role:"combobox",type:"button",children:d?b(P,{children:[s?null:a("span",{className:m?i.placeholder:void 0,children:c}),s?a("span",{style:k,children:f}):null]}):t??a(x,{placeholder:c})})});T.displayName="ComboboxButton";function j({classNames:l,clearLabel:t,context:n}){return a("button",{"aria-label":t,className:g(n.isStyled&&i.clear,l?.clear),"data-plume-select-clear":"",onClick:n.clear,type:"button",children:a(E,{})})}function q({classNames:l,context:t,onToggle:n}){return a("button",{"aria-hidden":"true",className:g(t.isStyled&&i.chevron,l?.chevron),"data-plume-select-chevron":"",disabled:t.disabled,onClick:n,onMouseDown:e=>e.preventDefault(),tabIndex:-1,type:"button",children:a(D,{})})}function K(l,t,n){let e=M(),{setLabelling:o}=l,c=e?.controlId===l.controlId?e.labelId:void 0,d=n??(t?void 0:c);return O(()=>{o({label:t,labelledBy:d})},[t,d,o]),d}var $=N(({"aria-label":l,"aria-labelledby":t,children:n,className:e="",classNames:o,clearLabel:c="Clear",display:d="chips",maxDisplay:p=Number.POSITIVE_INFINITY,placeholder:m,removeLabel:u=r=>`Remove ${r}`,style:s},f)=>{let r=R("SelectTrigger"),h=V(null),B=K(r,l,t),{isStyled:w,name:y,open:v}=r,C=r.multiple&&d==="chips"&&n===void 0,L={"--select-color":`var(--plume-color-${r.colorScheme}-text)`,...s},I=()=>{h.current?.focus(),v?r.close(!1):r.setOpen(!0)};return b("div",{className:F(r,e),"data-open":v?"":void 0,"data-plume-select-control":"",ref:r.setTrigger,style:L,children:[b("div",{className:g(w&&i.field,o?.field),"data-plume-select-field":"",children:[C?a(z,{classNames:o,context:r,maxDisplay:p,removeLabel:u}):null,a(T,{ariaLabel:l,classNames:o,context:r,labelledBy:B,placeholder:m,ref:H(h,f),showChips:C,children:n})]}),r.canClear&&r.selected.length>0?a(j,{classNames:o,clearLabel:c,context:r}):null,a(q,{classNames:o,context:r,onToggle:I}),y?a(Y,{name:y}):null]})});function Y({name:l}){let{multiple:t,selected:n}=R("SelectTrigger");return t?n.map(e=>a("input",{name:l,type:"hidden",value:e},e)):a("input",{name:l,type:"hidden",value:n[0]??""})}$.displayName="SelectTrigger";export{$ as SelectTrigger};
1
+ "use client";import{a as i}from"../../../chunk-YXXQZOHK.mjs";import{forwardRef as N,useEffect as O,useRef as V}from"react";import{ChevronDownIcon as D,CloseIcon as E}from"../../../overlay/icons.mjs";import{joinClasses as g}from"../../../overlay/class-names.mjs";import{mergeRefs as H}from"../../../overlay/trigger.mjs";import{Chip as S}from"../../presentation/chip/index.mjs";import{useFieldContext as M}from"../field/field-context.mjs";import{useSelectContext as R}from"./select-context.mjs";import{SelectValue as x}from"./select-value.mjs";import{Fragment as P,jsx as a,jsxs as b}from"react/jsx-runtime";var k={border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1};function z({classNames:l,context:t,maxDisplay:n,removeLabel:e}){let{isStyled:o,selectedOptions:c}=t,d=c.slice(0,n),p=c.length-d.length,m=!t.disabled&&!t.readOnly,u=o?"subtle":"unstyled";return b(P,{children:[d.map(s=>a(S,{className:l?.chip,classNames:{remove:l?.chipRemove},icon:s.icon,onRemove:m?()=>t.remove(s.value):void 0,removeLabel:e(s.label),size:t.size,variant:u,children:a("span",{"aria-hidden":"true",children:s.label})},s.value)),p>0?b(S,{className:l?.chip,size:t.size,variant:u,children:["+",p]}):null]})}function F(l,t){let{isStyled:n}=l;return[n&&i.control,n&&i[l.variant],n&&i[l.size],n&&i[l.shape],n&&l.invalid&&i.invalid,n&&l.disabled&&i.disabled,t].filter(Boolean).join(" ")||void 0}var T=N(({ariaLabel:l,children:t,classNames:n,context:e,labelledBy:o,placeholder:c,showChips:d},p)=>{let{isStyled:m,open:u}=e,s=e.selected.length>0,f=e.selectedOptions.map(r=>r.label).join(", ");return a("button",{"aria-activedescendant":u&&!e.searchable?e.activeId:void 0,"aria-controls":e.listboxId,"aria-describedby":e.describedBy,"aria-expanded":u,"aria-invalid":e.invalid||void 0,"aria-label":l,"aria-labelledby":o,"aria-readonly":e.readOnly||void 0,"aria-required":e.required||void 0,className:g(m&&i.trigger,n?.trigger),"data-placeholder":s?void 0:"","data-plume-select-trigger":"",disabled:e.disabled,id:e.controlId,onClick:()=>u?e.close(!1):e.setOpen(!0),onKeyDown:r=>e.onListKeyDown(r,!1),ref:p,role:"combobox",type:"button",children:d?b(P,{children:[s?null:a("span",{className:m?i.placeholder:void 0,children:c}),s?a("span",{style:k,children:f}):null]}):t??a(x,{placeholder:c})})});T.displayName="ComboboxButton";function j({classNames:l,clearLabel:t,context:n}){return a("button",{"aria-label":t,className:g(n.isStyled&&i.clear,l?.clear),"data-plume-select-clear":"",onClick:n.clear,type:"button",children:a(E,{})})}function q({classNames:l,context:t,onToggle:n}){return a("button",{"aria-hidden":"true",className:g(t.isStyled&&i.chevron,l?.chevron),"data-plume-select-chevron":"",disabled:t.disabled,onClick:n,onMouseDown:e=>e.preventDefault(),tabIndex:-1,type:"button",children:a(D,{})})}function K(l,t,n){let e=M(),{setLabelling:o}=l,c=e?.controlId===l.controlId?e.labelId:void 0,d=n??(t?void 0:c);return O(()=>{o({label:t,labelledBy:d})},[t,d,o]),d}var $=N(({"aria-label":l,"aria-labelledby":t,children:n,className:e="",classNames:o,clearLabel:c="Clear",display:d="chips",maxDisplay:p=Number.POSITIVE_INFINITY,placeholder:m,removeLabel:u=r=>`Remove ${r}`,style:s},f)=>{let r=R("SelectTrigger"),h=V(null),B=K(r,l,t),{isStyled:w,name:y,open:v}=r,C=r.multiple&&d==="chips"&&n===void 0,L={"--select-color":`var(--plume-color-${r.colorScheme}-text)`,...s},I=()=>{h.current?.focus(),v?r.close(!1):r.setOpen(!0)};return b("div",{className:F(r,e),"data-open":v?"":void 0,"data-plume-select-control":"",ref:r.setTrigger,style:L,children:[b("div",{className:g(w&&i.field,o?.field),"data-plume-select-field":"",children:[C?a(z,{classNames:o,context:r,maxDisplay:p,removeLabel:u}):null,a(T,{ariaLabel:l,classNames:o,context:r,labelledBy:B,placeholder:m,ref:H(h,f),showChips:C,children:n})]}),r.canClear&&r.selected.length>0?a(j,{classNames:o,clearLabel:c,context:r}):null,a(q,{classNames:o,context:r,onToggle:I}),y?a(Y,{name:y}):null]})});function Y({name:l}){let{multiple:t,selected:n}=R("SelectTrigger");return t?n.map(e=>a("input",{name:l,type:"hidden",value:e},e)):a("input",{name:l,type:"hidden",value:n[0]??""})}$.displayName="SelectTrigger";export{$ as SelectTrigger};
@@ -1 +1 @@
1
- "use client";import{a as n}from"../../../chunk-V7QXMR67.mjs";import{useSelectContext as s}from"./select-context.mjs";import{Fragment as u,jsx as t,jsxs as r}from"react/jsx-runtime";function i({option:e}){let{isStyled:l}=s("SelectValue");return r(u,{children:[e.icon?t("span",{"aria-hidden":"true",className:l?n.valueIcon:void 0,children:e.icon}):null,t("span",{className:l?n.valueText:void 0,children:e.label})]})}function S({children:e,placeholder:l}){let{isStyled:o,multiple:c,selected:d,selectedOptions:a}=s("SelectValue");return d.length===0?l?t("span",{className:o?n.placeholder:void 0,children:l}):null:e?e(a):c?t("span",{className:o?n.valueText:void 0,children:a.map(p=>p.label).join(", ")}):a[0]?t("span",{className:o?n.value:void 0,children:t(i,{option:a[0]})}):null}export{i as OptionContent,S as SelectValue};
1
+ "use client";import{a as n}from"../../../chunk-YXXQZOHK.mjs";import{useSelectContext as s}from"./select-context.mjs";import{Fragment as u,jsx as t,jsxs as r}from"react/jsx-runtime";function i({option:e}){let{isStyled:l}=s("SelectValue");return r(u,{children:[e.icon?t("span",{"aria-hidden":"true",className:l?n.valueIcon:void 0,children:e.icon}):null,t("span",{className:l?n.valueText:void 0,children:e.label})]})}function S({children:e,placeholder:l}){let{isStyled:o,multiple:c,selected:d,selectedOptions:a}=s("SelectValue");return d.length===0?l?t("span",{className:o?n.placeholder:void 0,children:l}):null:e?e(a):c?t("span",{className:o?n.valueText:void 0,children:a.map(p=>p.label).join(", ")}):a[0]?t("span",{className:o?n.value:void 0,children:t(i,{option:a[0]})}):null}export{i as OptionContent,S as SelectValue};
@@ -0,0 +1 @@
1
+ "use client";import{a as m}from"../../../chunk-H4KFRPQR.mjs";import{forwardRef as C,useId as y,useState as S}from"react";import{joinClasses as M}from"../../../overlay/class-names.mjs";import{jsx as o,jsxs as H}from"react/jsx-runtime";var w=(e,t)=>t===void 0?String(e):`${e} / ${t}`,L=e=>`${e} ${e===1?"character":"characters"} left`,R={border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1},N=(e,t)=>e<=Math.max(10,Math.ceil(t/10)),A=C(({countClassName:e,formatCount:t=w,formatRemaining:c=L,isStyled:l,textareaProps:a},f)=>{let{defaultValue:p,maxLength:n,onChange:g,value:i}=a,d=y(),[b,h]=S(String(p??"").length),u=i===void 0?b:String(i).length,r=n===void 0?void 0:n-u,T=n!==void 0&&r!==void 0&&N(r,n)?c(Math.max(r,0)):"",x=[a["aria-describedby"],d].filter(Boolean).join(" ");return H("div",{"data-plume-textarea-group":"",children:[o("textarea",{...a,"aria-describedby":x,onChange:s=>{h(s.target.value.length),g?.(s)},ref:f}),o("span",{className:M(l&&m.count,e),"data-limit":r!==void 0&&r<=0?"":void 0,"data-plume-textarea-count":"",id:d,children:t(u,n)}),o("output",{style:R,children:T})]})});A.displayName="TextareaCounter";export{A as TextareaCounter};
@@ -1 +1 @@
1
- import{forwardRef as u}from"react";var e={"textarea-padding":"var(--plume-space-4)","textarea-border-radius":"var(--plume-radius-4)","textarea-border-color":"var(--plume-border-strong)","textarea-background-color":"var(--plume-surface-muted)",base:"_base_1qiho_6",textarea:"_textarea_1qiho_13",sm:"_sm_1qiho_28",md:"_md_1qiho_33",lg:"_lg_1qiho_37",rounded:"_rounded_1qiho_42",outline:"_outline_1qiho_46 _textarea_1qiho_13",pill:"_pill_1qiho_46",filled:"_filled_1qiho_55 _textarea_1qiho_13",underline:"_underline_1qiho_63 _textarea_1qiho_13",none:"_none_1qiho_69",vertical:"_vertical_1qiho_73",horizontal:"_horizontal_1qiho_77",both:"_both_1qiho_81",invalid:"_invalid_1qiho_89",disabled:"_disabled_1qiho_109"};import{jsx as T}from"react/jsx-runtime";var c=(r,a)=>({"--textarea-color":`var(--plume-color-${r}-text)`,...a}),b=u(({className:r="",colorScheme:a="secondary",disabled:o=!1,resize:d="vertical",rows:s=3,shape:_="rounded",size:p="md",style:x,variant:i="outline",...t},h)=>{let l=i!=="unstyled",n=t["aria-invalid"]===!0||t["aria-invalid"]==="true",m=`${l?`${e.base} ${e[i]} ${e[p]} ${e[_]} ${e[d]}`:""} ${n&&l?e.invalid:""} ${o?e.disabled:""} ${r}`.replace(/\s+/g," ").trim();return T("textarea",{className:m,disabled:o,ref:h,rows:s,style:c(n?"error":a,x),...t})});b.displayName="Textarea";export{b as Textarea};
1
+ import{a as e}from"../../../chunk-H4KFRPQR.mjs";import{forwardRef as b}from"react";import{TextareaCounter as h}from"./textarea-counter.mjs";import{jsx as p}from"react/jsx-runtime";var P=(r,a)=>({"--textarea-color":`var(--plume-color-${r}-text)`,...a}),g=b(({className:r="",colorScheme:a="secondary",countClassName:d,disabled:i=!1,formatCount:x,formatRemaining:u,resize:c="vertical",rows:T=3,shape:f="rounded",showCount:S=!1,size:y="md",style:C,variant:n="outline",...t},s)=>{let o=n!=="unstyled",l=t["aria-invalid"]===!0||t["aria-invalid"]==="true",m={className:`${o?`${e.base} ${e[n]} ${e[y]} ${e[f]} ${e[c]}`:""} ${l&&o?e.invalid:""} ${i?e.disabled:""} ${r}`.replace(/\s+/g," ").trim(),disabled:i,rows:T,style:P(l?"error":a,C),...t};return S?p(h,{countClassName:d,formatCount:x,formatRemaining:u,isStyled:o,ref:s,textareaProps:m}):p("textarea",{ref:s,...m})});g.displayName="Textarea";export{g as Textarea};
@@ -1 +1 @@
1
- "use client";import{a as o}from"../../../chunk-MREJ5C76.mjs";import{forwardRef as P}from"react";import{useDropdownContext as T}from"./dropdown-context.mjs";import{Fragment as I,jsx as r,jsxs as R}from"react/jsx-runtime";var h=P(({children:y,className:E="",closeOnSelect:M,disabled:n=!1,href:l,icon:d,onSelect:D,rel:b,shortcut:i,style:s,target:v,...m},c)=>{let t=T("DropdownItem"),p=[t.isStyled&&o.item,E].filter(Boolean).join(" "),u=e=>{if(n){e.preventDefault();return}D?.(e),!e.defaultPrevented&&(M??t.closeOnSelect)&&t.setOpen(!1)},f=e=>{!n&&document.activeElement!==e.currentTarget&&e.currentTarget.focus({preventScroll:!0})},w=R(I,{children:[d?r("span",{"aria-hidden":"true",className:t.isStyled?o.icon:void 0,children:d}):null,r("span",{className:t.isStyled?o.label:void 0,"data-plume-menu-item-label":"",children:y}),i?r("span",{className:t.isStyled?o.shortcut:void 0,children:i}):null]});return l!==void 0?r("a",{...m,"aria-disabled":n||void 0,className:p,"data-plume-menu-item":"",href:n?void 0:l,onClick:u,onKeyDown:a=>{a.key===" "&&(a.preventDefault(),a.currentTarget.click())},onPointerMove:f,ref:c,rel:b,role:"menuitem",style:s,tabIndex:-1,target:v,children:w}):r("button",{...m,className:p,"data-plume-menu-item":"",disabled:n,onClick:u,onPointerMove:f,ref:c,role:"menuitem",style:s,tabIndex:-1,type:"button",children:w})});h.displayName="DropdownItem";export{h as DropdownItem};
1
+ "use client";import{a as o}from"../../../chunk-TLZRYQKI.mjs";import{forwardRef as P}from"react";import{useDropdownContext as T}from"./dropdown-context.mjs";import{Fragment as I,jsx as r,jsxs as R}from"react/jsx-runtime";var h=P(({children:y,className:E="",closeOnSelect:M,disabled:n=!1,href:l,icon:d,onSelect:D,rel:b,shortcut:i,style:s,target:v,...m},c)=>{let t=T("DropdownItem"),p=[t.isStyled&&o.item,E].filter(Boolean).join(" "),u=e=>{if(n){e.preventDefault();return}D?.(e),!e.defaultPrevented&&(M??t.closeOnSelect)&&t.setOpen(!1)},f=e=>{!n&&document.activeElement!==e.currentTarget&&e.currentTarget.focus({preventScroll:!0})},w=R(I,{children:[d?r("span",{"aria-hidden":"true",className:t.isStyled?o.icon:void 0,children:d}):null,r("span",{className:t.isStyled?o.label:void 0,"data-plume-menu-item-label":"",children:y}),i?r("span",{className:t.isStyled?o.shortcut:void 0,children:i}):null]});return l!==void 0?r("a",{...m,"aria-disabled":n||void 0,className:p,"data-plume-menu-item":"",href:n?void 0:l,onClick:u,onKeyDown:a=>{a.key===" "&&(a.preventDefault(),a.currentTarget.click())},onPointerMove:f,ref:c,rel:b,role:"menuitem",style:s,tabIndex:-1,target:v,children:w}):r("button",{...m,className:p,"data-plume-menu-item":"",disabled:n,onClick:u,onPointerMove:f,ref:c,role:"menuitem",style:s,tabIndex:-1,type:"button",children:w})});h.displayName="DropdownItem";export{h as DropdownItem};
@@ -1 +1 @@
1
- "use client";import{a as o}from"../../../chunk-MREJ5C76.mjs";import{forwardRef as i}from"react";import{useDropdownContext as s}from"./dropdown-context.mjs";import{jsx as a}from"react/jsx-runtime";var l=i(({children:e,className:t="",style:r},p)=>{let{isStyled:n}=s("DropdownLabel"),d=[n&&o.groupLabel,t].filter(Boolean).join(" ");return a("div",{className:d||void 0,ref:p,style:r,children:e})});l.displayName="DropdownLabel";export{l as DropdownLabel};
1
+ "use client";import{a as o}from"../../../chunk-TLZRYQKI.mjs";import{forwardRef as i}from"react";import{useDropdownContext as s}from"./dropdown-context.mjs";import{jsx as a}from"react/jsx-runtime";var l=i(({children:e,className:t="",style:r},p)=>{let{isStyled:n}=s("DropdownLabel"),d=[n&&o.groupLabel,t].filter(Boolean).join(" ");return a("div",{className:d||void 0,ref:p,style:r,children:e})});l.displayName="DropdownLabel";export{l as DropdownLabel};
@@ -1 +1 @@
1
- "use client";import{a as s}from"../../../chunk-MREJ5C76.mjs";import{forwardRef as K,useEffect as C}from"react";import{Portal as N,useFocusTrap as O}from"../../../overlay/index.mjs";import{useFloatingPanel as S}from"../../../overlay/use-floating-panel.mjs";import{mergeRefs as B}from"../../../overlay/trigger.mjs";import{isTypeaheadKey as q,matchTypeahead as z,useTypeahead as U}from"../../../overlay/use-typeahead.mjs";import{useDropdownContext as j}from"./dropdown-context.mjs";import{jsx as T}from"react/jsx-runtime";var D=n=>Array.from(n.querySelectorAll('[role="menuitem"]')).filter(i=>i.getAttribute("aria-disabled")!=="true"&&!i.disabled),d=n=>n?.focus({preventScroll:!0}),G=K(({children:n,className:i="",style:w,...m},E)=>{let p=j("DropdownMenu"),{flip:h,initialItem:u,isStyled:f,menuId:H,offset:L,open:r,placement:g,setOpen:b,shift:P,trigger:c}=p,A=U(),{isTopmost:v,panel:l,position:y,setPanel:x}=S({anchor:c,enabled:r,flip:h,offset:L,onDismiss:()=>b(!1),placement:g,shift:P});if(O(l,{active:r,isTopmost:v,returnFocus:c}),C(()=>{if(!r||!l)return;let e=D(l);u.current==="first"?d(e[0]):u.current==="last"&&d(e[e.length-1])},[u,r,l]),!r)return null;let R=e=>{let t=D(e.currentTarget),a=t.indexOf(document.activeElement),o;if(e.key==="ArrowDown")o=(a+1)%t.length;else if(e.key==="ArrowUp")o=a<=0?t.length-1:a-1;else if(e.key==="Home")o=0;else if(e.key==="End")o=t.length-1;else if(e.key==="Tab"){e.preventDefault(),b(!1);return}else if(q(e)){let F=t.map(I=>I.textContent??""),M=z(F,A(e.key),a);M>=0&&d(t[M]);return}o!==void 0&&(e.preventDefault(),d(t[o]))},k=[f&&s.menu,f&&s[p.size],f&&s[p.variant],i].filter(Boolean).join(" ");return T(N,{children:T("div",{"aria-labelledby":m["aria-label"]?void 0:m["aria-labelledby"]??c?.id,...m,className:k,"data-placement":y.placement,id:H,onKeyDown:R,ref:B(x,E),role:"menu",style:{...y.style,opacity:y.isPositioned?void 0:0,...w},tabIndex:-1,children:n})})});G.displayName="DropdownMenu";export{G as DropdownMenu};
1
+ "use client";import{a as s}from"../../../chunk-TLZRYQKI.mjs";import{forwardRef as K,useEffect as C}from"react";import{Portal as N,useFocusTrap as O}from"../../../overlay/index.mjs";import{useFloatingPanel as S}from"../../../overlay/use-floating-panel.mjs";import{mergeRefs as B}from"../../../overlay/trigger.mjs";import{isTypeaheadKey as q,matchTypeahead as z,useTypeahead as U}from"../../../overlay/use-typeahead.mjs";import{useDropdownContext as j}from"./dropdown-context.mjs";import{jsx as T}from"react/jsx-runtime";var D=n=>Array.from(n.querySelectorAll('[role="menuitem"]')).filter(i=>i.getAttribute("aria-disabled")!=="true"&&!i.disabled),m=n=>n?.focus({preventScroll:!0}),G=K(({children:n,className:i="",style:w,...d},E)=>{let p=j("DropdownMenu"),{flip:h,initialItem:u,isStyled:f,menuId:H,offset:L,open:r,placement:g,setOpen:b,shift:P,trigger:c}=p,A=U(),{isTopmost:v,panel:l,position:y,setPanel:x}=S({anchor:c,enabled:r,flip:h,offset:L,onDismiss:()=>b(!1),placement:g,shift:P});if(O(l,{active:r,isTopmost:v,returnFocus:c}),C(()=>{if(!r||!l)return;let e=D(l);u.current==="first"?m(e[0]):u.current==="last"&&m(e[e.length-1])},[u,r,l]),!r)return null;let R=e=>{let t=D(e.currentTarget),a=t.indexOf(document.activeElement),o;if(e.key==="ArrowDown")o=(a+1)%t.length;else if(e.key==="ArrowUp")o=a<=0?t.length-1:a-1;else if(e.key==="Home")o=0;else if(e.key==="End")o=t.length-1;else if(e.key==="Tab"){e.preventDefault(),b(!1);return}else if(q(e)){let F=t.map(I=>I.textContent??""),M=z(F,A(e.key),a);M>=0&&m(t[M]);return}o!==void 0&&(e.preventDefault(),m(t[o]))},k=[f&&s.menu,f&&s[p.size],f&&s[p.variant],i].filter(Boolean).join(" ");return T(N,{children:T("div",{"aria-labelledby":d["aria-label"]?void 0:d["aria-labelledby"]??c?.id,...d,className:k,"data-placement":y.placement,"data-plume-menu":"",id:H,onKeyDown:R,ref:B(x,E),role:"menu",style:{...y.style,opacity:y.isPositioned?void 0:0,...w},tabIndex:-1,children:n})})});G.displayName="DropdownMenu";export{G as DropdownMenu};
@@ -1 +1 @@
1
- "use client";import{a as o}from"../../../chunk-MREJ5C76.mjs";import{forwardRef as n}from"react";import{useDropdownContext as s}from"./dropdown-context.mjs";import{jsx as m}from"react/jsx-runtime";var d=n(({className:r="",style:e},t)=>{let{isStyled:p}=s("DropdownSeparator"),a=[p&&o.separator,r].filter(Boolean).join(" ");return m("hr",{className:a||void 0,ref:t,style:e})});d.displayName="DropdownSeparator";export{d as DropdownSeparator};
1
+ "use client";import{a as o}from"../../../chunk-TLZRYQKI.mjs";import{forwardRef as n}from"react";import{useDropdownContext as s}from"./dropdown-context.mjs";import{jsx as m}from"react/jsx-runtime";var d=n(({className:r="",style:e},t)=>{let{isStyled:p}=s("DropdownSeparator"),a=[p&&o.separator,r].filter(Boolean).join(" ");return m("hr",{className:a||void 0,ref:t,style:e})});d.displayName="DropdownSeparator";export{d as DropdownSeparator};
@@ -1 +1 @@
1
- "use client";import{a as e}from"../../../chunk-LFT6MZ6P.mjs";import{forwardRef as p}from"react";import{OverlayClose as t}from"../../../overlay/overlay-close.mjs";import{usePopoverContext as m}from"./popover-context.mjs";import{jsx as f}from"react/jsx-runtime";var a=p((o,r)=>{let{isStyled:s,setOpen:l}=m("PopoverClose");return f(t,{...o,closeClassName:s?e.close:void 0,onClose:()=>l(!1),ref:r})});a.displayName="PopoverClose";export{a as PopoverClose};
1
+ "use client";import{a as e}from"../../../chunk-4RTWLIQ6.mjs";import{forwardRef as p}from"react";import{OverlayClose as t}from"../../../overlay/overlay-close.mjs";import{usePopoverContext as m}from"./popover-context.mjs";import{jsx as f}from"react/jsx-runtime";var a=p((o,r)=>{let{isStyled:s,setOpen:l}=m("PopoverClose");return f(t,{...o,closeClassName:s?e.close:void 0,onClose:()=>l(!1),ref:r})});a.displayName="PopoverClose";export{a as PopoverClose};
@@ -1 +1 @@
1
- "use client";import{a as e}from"../../../chunk-LFT6MZ6P.mjs";import{forwardRef as T}from"react";import{Portal as H,useFocusTrap as L}from"../../../overlay/index.mjs";import{useFloatingPanel as M}from"../../../overlay/use-floating-panel.mjs";import{mergeRefs as D}from"../../../overlay/trigger.mjs";import{usePopoverContext as F}from"./popover-context.mjs";import{jsx as a}from"react/jsx-runtime";var h=T(({children:s,className:p="",style:l,...m},d)=>{let o=F("PopoverContent"),{contentId:c,flip:f,isStyled:t,offset:P,open:r,placement:u,setOpen:y,shift:g,trigger:i}=o,{isTopmost:v,panel:C,position:n,setPanel:b}=M({anchor:i,enabled:r,flip:f,offset:P,onDismiss:()=>y(!1),placement:u,shift:g});if(L(C,{active:r,isTopmost:v,returnFocus:i}),!r)return null;let R=[t&&e.content,t&&e[o.size],t&&e[o.variant],p].filter(Boolean).join(" ");return a(H,{children:a("dialog",{...m,className:R,"data-placement":n.placement,"data-plume-dialog":"",id:c,open:!0,ref:D(b,d),style:{...n.style,opacity:n.isPositioned?void 0:0,...l},children:s})})});h.displayName="PopoverContent";export{h as PopoverContent};
1
+ "use client";import{a as e}from"../../../chunk-4RTWLIQ6.mjs";import{forwardRef as T}from"react";import{Portal as H,useFocusTrap as L}from"../../../overlay/index.mjs";import{useFloatingPanel as M}from"../../../overlay/use-floating-panel.mjs";import{mergeRefs as D}from"../../../overlay/trigger.mjs";import{usePopoverContext as F}from"./popover-context.mjs";import{jsx as a}from"react/jsx-runtime";var h=T(({children:s,className:p="",style:l,...m},d)=>{let o=F("PopoverContent"),{contentId:c,flip:f,isStyled:t,offset:P,open:r,placement:u,setOpen:y,shift:g,trigger:i}=o,{isTopmost:v,panel:C,position:n,setPanel:b}=M({anchor:i,enabled:r,flip:f,offset:P,onDismiss:()=>y(!1),placement:u,shift:g});if(L(C,{active:r,isTopmost:v,returnFocus:i}),!r)return null;let R=[t&&e.content,t&&e[o.size],t&&e[o.variant],p].filter(Boolean).join(" ");return a(H,{children:a("dialog",{...m,className:R,"data-placement":n.placement,"data-plume-dialog":"",id:c,open:!0,ref:D(b,d),style:{...n.style,opacity:n.isPositioned?void 0:0,...l},children:s})})});h.displayName="PopoverContent";export{h as PopoverContent};
@@ -1 +1 @@
1
- "use client";import{a as o}from"../../../chunk-LWLHCHAV.mjs";import{forwardRef as R,useId as h}from"react";import{joinClasses as i}from"../../../overlay/class-names.mjs";import{CloseIcon as M}from"../../../overlay/icons.mjs";import{tagColorVars as x}from"../shared/tag-vars.mjs";var t={chip:"_chip_plt30_19",disabled:"_disabled_plt30_27",icon:"_icon_plt30_32",label:"_label_plt30_46",remove:"_remove_plt30_53"};import{jsx as a,jsxs as H}from"react/jsx-runtime";var E=R(({children:b,className:u="",classNames:l,colorScheme:C="secondary",disabled:p=!1,icon:r,onRemove:n,removeLabel:s,shape:f="pill",size:y="md",style:_,variant:d="subtle",...v},P)=>{let e=d!=="unstyled",m=h(),c=h(),S=i(e&&t.chip,e&&o[y],e&&o[f],e&&o[d],e&&p&&t.disabled,u);return H("span",{className:S,"data-plume-chip":"",ref:P,style:x("chip",C,_),...v,children:[r?a("span",{"aria-hidden":"true",className:i(e&&t.icon,l?.icon),children:r}):null,a("span",{className:i(e&&t.label,l?.label),id:m,children:b}),n?a("button",{"aria-label":s??"Remove","aria-labelledby":s?void 0:`${c} ${m}`,className:i(e&&t.remove,l?.remove),"data-plume-chip-remove":"",disabled:p,id:c,onClick:n,type:"button",children:a(M,{})}):null]})});E.displayName="Chip";export{E as Chip};
1
+ "use client";import{a as o}from"../../../chunk-LWLHCHAV.mjs";import{forwardRef as w,useId as h}from"react";import{joinClasses as i}from"../../../overlay/class-names.mjs";import{CloseIcon as R}from"../../../overlay/icons.mjs";import{tagColorVars as z}from"../shared/tag-vars.mjs";var t={chip:"_chip_zflwj_19",disabled:"_disabled_zflwj_27",icon:"_icon_zflwj_32",label:"_label_zflwj_46",remove:"_remove_zflwj_53"};import{jsx as a,jsxs as x}from"react/jsx-runtime";var M=w(({children:b,className:u="",classNames:l,colorScheme:f="secondary",disabled:r=!1,icon:p,onRemove:n,removeLabel:s,shape:C="pill",size:y="md",style:_,variant:d="subtle",...v},P)=>{let e=d!=="unstyled",m=h(),c=h(),S=i(e&&t.chip,e&&o[y],e&&o[C],e&&o[d],e&&r&&t.disabled,u);return x("span",{className:S,"data-plume-chip":"",ref:P,style:z("chip",f,_),...v,children:[p?a("span",{"aria-hidden":"true",className:i(e&&t.icon,l?.icon),children:p}):null,a("span",{className:i(e&&t.label,l?.label),id:m,children:b}),n?a("button",{"aria-label":s??"Remove","aria-labelledby":s?void 0:`${c} ${m}`,className:i(e&&t.remove,l?.remove),"data-plume-chip-remove":"",disabled:r,id:c,onClick:n,type:"button",children:a(R,{})}):null]})});M.displayName="Chip";export{M as Chip};
package/dist/index.d.mts CHANGED
@@ -831,7 +831,7 @@ interface SelectGroupOwnProps {
831
831
  type SelectGroupProps = Omit<ComponentProps, 'index'> & SelectGroupOwnProps;
832
832
  declare const SelectGroup: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & SelectGroupOwnProps & react.RefAttributes<HTMLDivElement>>;
833
833
 
834
- type SelectOptionPart = 'check' | 'checkbox' | 'description' | 'icon';
834
+ type SelectOptionPart = 'check' | 'description' | 'icon';
835
835
  interface SelectOptionOwnProps {
836
836
  children?: ReactNode;
837
837
  classNames?: Partial<Record<SelectOptionPart, string>>;
@@ -929,8 +929,12 @@ declare const TabPanel: react.ForwardRefExoticComponent<Pick<HTMLAttributes<HTML
929
929
 
930
930
  interface TextareaOwnProps {
931
931
  colorScheme?: ColorScheme;
932
+ countClassName?: string;
933
+ formatCount?: (count: number, max: number | undefined) => string;
934
+ formatRemaining?: (remaining: number) => string;
932
935
  resize?: TextareaResize;
933
936
  shape?: Shape;
937
+ showCount?: boolean;
934
938
  size?: Size;
935
939
  variant?: TextareaVariant;
936
940
  }
package/dist/index.d.ts CHANGED
@@ -831,7 +831,7 @@ interface SelectGroupOwnProps {
831
831
  type SelectGroupProps = Omit<ComponentProps, 'index'> & SelectGroupOwnProps;
832
832
  declare const SelectGroup: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & SelectGroupOwnProps & react.RefAttributes<HTMLDivElement>>;
833
833
 
834
- type SelectOptionPart = 'check' | 'checkbox' | 'description' | 'icon';
834
+ type SelectOptionPart = 'check' | 'description' | 'icon';
835
835
  interface SelectOptionOwnProps {
836
836
  children?: ReactNode;
837
837
  classNames?: Partial<Record<SelectOptionPart, string>>;
@@ -929,8 +929,12 @@ declare const TabPanel: react.ForwardRefExoticComponent<Pick<HTMLAttributes<HTML
929
929
 
930
930
  interface TextareaOwnProps {
931
931
  colorScheme?: ColorScheme;
932
+ countClassName?: string;
933
+ formatCount?: (count: number, max: number | undefined) => string;
934
+ formatRemaining?: (remaining: number) => string;
932
935
  resize?: TextareaResize;
933
936
  shape?: Shape;
937
+ showCount?: boolean;
934
938
  size?: Size;
935
939
  variant?: TextareaVariant;
936
940
  }