plume-ui-react 0.7.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 (56) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-3JUN2GK7.mjs +1 -0
  3. package/dist/chunk-4RTWLIQ6.mjs +1 -0
  4. package/dist/chunk-H4KFRPQR.mjs +1 -0
  5. package/dist/chunk-OQEOAZF3.mjs +1 -0
  6. package/dist/chunk-SMKRX752.mjs +1 -0
  7. package/dist/chunk-TLZRYQKI.mjs +1 -0
  8. package/dist/chunk-YXXQZOHK.mjs +1 -0
  9. package/dist/components/form/datepicker/calendar.mjs +1 -1
  10. package/dist/components/form/datepicker/datepicker-input.mjs +1 -1
  11. package/dist/components/form/datepicker/datepicker.mjs +2 -2
  12. package/dist/components/form/input/input-reveal.mjs +1 -0
  13. package/dist/components/form/input/input.mjs +2 -2
  14. package/dist/components/form/numberinput/index.mjs +1 -0
  15. package/dist/components/form/numberinput/number-format.mjs +1 -0
  16. package/dist/components/form/numberinput/numberinput-stepper.mjs +1 -0
  17. package/dist/components/form/numberinput/numberinput.mjs +1 -0
  18. package/dist/components/form/numberinput/use-hold-repeat.mjs +1 -0
  19. package/dist/components/form/numberinput/use-number-input.mjs +1 -0
  20. package/dist/components/form/pininput/index.mjs +1 -0
  21. package/dist/components/form/pininput/pin-utils.mjs +1 -0
  22. package/dist/components/form/pininput/pininput.mjs +1 -0
  23. package/dist/components/form/pininput/use-pin-input.mjs +1 -0
  24. package/dist/components/form/rating/index.mjs +1 -0
  25. package/dist/components/form/rating/rating-icons.mjs +1 -0
  26. package/dist/components/form/rating/rating-item.mjs +1 -0
  27. package/dist/components/form/rating/rating.mjs +1 -0
  28. package/dist/components/form/rating/use-rating.mjs +1 -0
  29. package/dist/components/form/select/select-content.mjs +1 -1
  30. package/dist/components/form/select/select-group.mjs +1 -1
  31. package/dist/components/form/select/select-option.mjs +1 -1
  32. package/dist/components/form/select/select-trigger.mjs +1 -1
  33. package/dist/components/form/select/select-value.mjs +1 -1
  34. package/dist/components/form/textarea/textarea-counter.mjs +1 -0
  35. package/dist/components/form/textarea/textarea.mjs +1 -1
  36. package/dist/components/interaction/dropdown/dropdown-item.mjs +1 -1
  37. package/dist/components/interaction/dropdown/dropdown-label.mjs +1 -1
  38. package/dist/components/interaction/dropdown/dropdown-menu.mjs +1 -1
  39. package/dist/components/interaction/dropdown/dropdown-separator.mjs +1 -1
  40. package/dist/components/overlay/popover/popover-close.mjs +1 -1
  41. package/dist/components/overlay/popover/popover-content.mjs +1 -1
  42. package/dist/components/presentation/chip/chip.mjs +1 -1
  43. package/dist/index.d.mts +90 -3
  44. package/dist/index.d.ts +90 -3
  45. package/dist/index.js +5 -5
  46. package/dist/index.mjs +1 -1
  47. package/dist/overlay/icons.mjs +1 -1
  48. package/dist/overlay/position.mjs +1 -1
  49. package/dist/overlay/use-controllable-state.mjs +1 -0
  50. package/dist/overlay/use-position.mjs +1 -1
  51. package/dist/styles.css +1 -1
  52. package/package.json +1 -1
  53. package/dist/chunk-JMACSFO3.mjs +0 -1
  54. package/dist/chunk-LFT6MZ6P.mjs +0 -1
  55. package/dist/chunk-MREJ5C76.mjs +0 -1
  56. package/dist/chunk-V7QXMR67.mjs +0 -1
package/README.md CHANGED
@@ -38,7 +38,7 @@ export function App() {
38
38
 
39
39
  ## Components
40
40
 
41
- `Accordion` (with `AccordionContent`, `AccordionItem` and `AccordionTrigger`), `Badge`, `Button`, `Card` (with `CardHeader`, `CardBody` and `CardFooter`), `Checkbox`, `Chip`, `DatePicker`, `Dropdown` (with `DropdownItem`, `DropdownLabel`, `DropdownMenu`, `DropdownSeparator` and `DropdownTrigger`), `Field`, `Icon`, `Input`, `List` (with `ListDivider`, `ListItem`, `ListItemButton`, `ListItemIcon`, `ListItemText` and `ListSubheader`), `Modal` (with `ModalBody`, `ModalClose`, `ModalContent`, `ModalFooter`, `ModalHeader` and `ModalTrigger`), `Popover` (with `PopoverClose`, `PopoverContent` and `PopoverTrigger`), `ProgressBar`, `Radio`, `RadioGroup`, `Select` (with `SelectContent`, `SelectGroup`, `SelectOption`, `SelectTrigger` and `SelectValue`), `Skeleton`, `Spinner`, `Tabs` (with `TabList`, `Tab`, `TabPanels` and `TabPanel`), `Textarea`, `ToastProvider` (with the `useToast` hook), `Toggle` and `Tooltip`.
41
+ `Accordion` (with `AccordionContent`, `AccordionItem` and `AccordionTrigger`), `Badge`, `Button`, `Card` (with `CardHeader`, `CardBody` and `CardFooter`), `Checkbox`, `Chip`, `DatePicker`, `Dropdown` (with `DropdownItem`, `DropdownLabel`, `DropdownMenu`, `DropdownSeparator` and `DropdownTrigger`), `Field`, `Icon`, `Input`, `List` (with `ListDivider`, `ListItem`, `ListItemButton`, `ListItemIcon`, `ListItemText` and `ListSubheader`), `Modal` (with `ModalBody`, `ModalClose`, `ModalContent`, `ModalFooter`, `ModalHeader` and `ModalTrigger`), `NumberInput`, `PinInput`, `Popover` (with `PopoverClose`, `PopoverContent` and `PopoverTrigger`), `ProgressBar`, `Radio`, `RadioGroup`, `Rating`, `Select` (with `SelectContent`, `SelectGroup`, `SelectOption`, `SelectTrigger` and `SelectValue`), `Skeleton`, `Spinner`, `Tabs` (with `TabList`, `Tab`, `TabPanels` and `TabPanel`), `Textarea`, `ToastProvider` (with the `useToast` hook), `Toggle` and `Tooltip`.
42
42
 
43
43
  The [documentation site](https://darioegb.github.io/plume-ui-react/) has a live playground, props and examples for each one, plus the color palette, design tokens and framework integration guides.
44
44
 
@@ -0,0 +1 @@
1
+ var _={"input-padding":"var(--plume-space-4)","input-border-radius":"var(--plume-radius-4)","input-color":"var(--plume-foreground)","input-border-color":"var(--plume-border-strong)","input-background-color":"var(--plume-surface-muted)",base:"_base_1gj16_9",input:"_input_1gj16_16",sm:"_sm_1gj16_32",md:"_md_1gj16_38",lg:"_lg_1gj16_43",rounded:"_rounded_1gj16_49",outline:"_outline_1gj16_53 _input_1gj16_16",pill:"_pill_1gj16_53",filled:"_filled_1gj16_62 _input_1gj16_16",underline:"_underline_1gj16_70 _input_1gj16_16",invalid:"_invalid_1gj16_80",inputGroup:"_inputGroup_1gj16_89",disabled:"_disabled_1gj16_101",control:"_control_1gj16_116",addOn:"_addOn_1gj16_128",element:"_element_1gj16_129",addOnBefore:"_addOnBefore_1gj16_156",addOnAfter:"_addOnAfter_1gj16_161",elementBefore:"_elementBefore_1gj16_212",elementAfter:"_elementAfter_1gj16_216",revealButton:"_revealButton_1gj16_259",beforeReveal:"_beforeReveal_1gj16_279"};export{_ as a};
@@ -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 _={rating:"_rating_moha0_53",sm:"_sm_moha0_59",md:"_md_moha0_63",lg:"_lg_moha0_67",empty:"_empty_moha0_71",filled:"_filled_moha0_76",interactive:"_interactive_moha0_84",item:"_item_moha0_88",disabled:"_disabled_moha0_94"};export{_ 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};
@@ -0,0 +1 @@
1
+ "use client";import{a as t}from"../../../chunk-3JUN2GK7.mjs";import{useState as p}from"react";import{joinClasses as i}from"../../../overlay/class-names.mjs";import{EyeIcon as u,EyeOffIcon as b}from"../../../overlay/icons.mjs";import{jsx as r}from"react/jsx-runtime";function v({className:o,disabled:a,isStyled:e,label:s,onToggle:n,visible:l}){return r("span",{className:e?`${t.element} ${t.elementAfter}`:void 0,children:r("button",{"aria-label":s,"aria-pressed":l,className:i(e&&t.revealButton,o),"data-plume-input-reveal":"",disabled:a,onClick:n,type:"button",children:l?r(b,{}):r(u,{})})})}function R(o,a){let[e,s]=p(!1),n=a&&o==="password";return{canReveal:n,inputType:n&&e?"text":o,revealed:e,toggle:()=>s(l=>!l)}}var y=(o,a)=>{if(!o)return"";let e=`${t.element} ${t.elementAfter}`;return a?`${e} ${t.beforeReveal}`:e};export{v as InputReveal,y as afterElementClass,R as usePasswordReveal};
@@ -1,2 +1,2 @@
1
- "use client";import{forwardRef as $}from"react";import{useMask as L}from"../../../hooks/use-mask.mjs";var e={"input-padding":"var(--plume-space-4)","input-border-radius":"var(--plume-radius-4)","input-color":"var(--plume-foreground)","input-border-color":"var(--plume-border-strong)","input-background-color":"var(--plume-surface-muted)",base:"_base_162n4_9",input:"_input_162n4_16",sm:"_sm_162n4_32",md:"_md_162n4_38",lg:"_lg_162n4_43",rounded:"_rounded_162n4_49",outline:"_outline_162n4_53 _input_162n4_16",pill:"_pill_162n4_53",filled:"_filled_162n4_62 _input_162n4_16",underline:"_underline_162n4_70 _input_162n4_16",invalid:"_invalid_162n4_80",inputGroup:"_inputGroup_162n4_89",disabled:"_disabled_162n4_101",addOn:"_addOn_162n4_120",element:"_element_162n4_176"};import{jsx as r,jsxs as H}from"react/jsx-runtime";var M=(t,o,s,n,d,_,m)=>{let p=o?e.disabled:"",i=s&&n?e.invalid:"",c=n?e[d]:"",f=n?e[_]:"",l=n?e[m]:"";return`${e.base} ${f} ${c} ${l}
2
- ${p} ${i} ${t}`.trim()},w=t=>({"--input-color":`var(--plume-color-${t}-text)`}),z=$(({addonBefore:t,addonAfter:o,elementBefore:s,elementAfter:n,style:d,className:_="",colorScheme:m="secondary",disabled:p=!1,readOnly:i=!1,shape:c="rounded",size:f="md",type:l="text",variant:g="outline",mask:b,value:v,defaultValue:C,onChange:P,...u},I)=>{let a=g!=="unstyled",h=u["aria-invalid"]===!0||u["aria-invalid"]==="true",y=M(_,p,h,a,c,f,g),S={...w(h?"error":m),...d},R=t||o||s||n,{value:O,onChange:x}=L({mask:b,value:typeof v=="string"?v:void 0,defaultValue:typeof C=="string"?C:void 0,onChange:P}),N={onChange:x,value:b?O:v,defaultValue:b?void 0:C};return R?H("div",{className:a?e.inputGroup:"",style:S,children:[t?r("span",{className:a?e.addOn:"",children:t}):null,s?r("span",{className:a?e.element:"",children:s}):null,r("input",{className:y,disabled:p,readOnly:i,ref:I,type:l,...N,...u}),o?r("span",{className:a?e.addOn:"",children:o}):null,n?r("span",{className:a?e.element:"",children:n}):null]}):r("input",{className:y,disabled:p,readOnly:i,ref:I,style:S,type:l,...N,...u})});z.displayName="Input";export{z as Input};
1
+ "use client";import{a as e}from"../../../chunk-3JUN2GK7.mjs";import{forwardRef as k}from"react";import{useMask as A}from"../../../hooks/use-mask.mjs";import{afterElementClass as F,InputReveal as G,usePasswordReveal as q}from"./input-reveal.mjs";import{jsx as s,jsxs as O}from"react/jsx-runtime";var B=(a,l,r,n,u,d,c)=>{let o=l?e.disabled:"",p=r&&n?e.invalid:"",m=n?e[u]:"",f=n?e[d]:"",v=n?e[c]:"";return`${e.base} ${f} ${m} ${v}
2
+ ${o} ${p} ${a}`.trim()},D=a=>({"--input-color":`var(--plume-color-${a}-text)`}),J=k(({addonBefore:a,addonAfter:l,elementBefore:r,elementAfter:n,style:u,className:d="",colorScheme:c="secondary",disabled:o=!1,readOnly:p=!1,revealClassName:m,revealLabel:f="Show password",revealable:v=!1,shape:w="rounded",size:L="md",type:x="text",variant:h="outline",mask:C,value:y,defaultValue:g,onChange:M,...i},b)=>{let t=h!=="unstyled",{canReveal:I,inputType:S,revealed:T,toggle:z}=q(x,v),N=i["aria-invalid"]===!0||i["aria-invalid"]==="true",$=B(d,o,N,t,w,L,h),P={...D(N?"error":c),...u},H=a||l||r||n||I,{value:V,onChange:E}=A({mask:C,value:typeof y=="string"?y:void 0,defaultValue:typeof g=="string"?g:void 0,onChange:M}),R={onChange:E,value:C?V:y,defaultValue:C?void 0:g};return H?O("div",{className:t?e.inputGroup:void 0,"data-plume-input-group":"",style:P,children:[a?s("span",{className:t?`${e.addOn} ${e.addOnBefore}`:void 0,children:a}):null,O("div",{className:t?e.control:void 0,"data-plume-input-control":"",children:[r?s("span",{className:t?`${e.element} ${e.elementBefore}`:void 0,children:r}):null,s("input",{className:$,disabled:o,readOnly:p,ref:b,type:S,...R,...i}),n?s("span",{className:F(t,I),children:n}):null,I?s(G,{className:m,disabled:o,isStyled:t,label:f,onToggle:z,visible:T}):null]}),l?s("span",{className:t?`${e.addOn} ${e.addOnAfter}`:void 0,children:l}):null]}):s("input",{className:$,disabled:o,readOnly:p,ref:b,style:P,type:S,...R,...i})});J.displayName="Input";export{J as Input};
@@ -0,0 +1 @@
1
+ import{NumberInput as r}from"./numberinput.mjs";export{r as NumberInput};
@@ -0,0 +1 @@
1
+ var u=e=>{if(!Number.isFinite(e))return 0;let[n,t]=e.toString().split("e"),r=n.split(".")[1]?.length??0;return Math.max(0,r-Number(t??0))},m=(e,n)=>Number(e.toFixed(Math.min(Math.max(n,0),100))),o=(e,n,t)=>Math.min(Math.max(e,n),t),s=e=>{let n=e.trim().replace(",",".");if(n===""||n==="-"||n==="+"||n===".")return null;let t=Number(n);return Number.isFinite(t)?t:null},a=(e,n)=>(n===0?/^[+-]?\d*$/:/^[+-]?\d*(?:[.,]\d*)?$/).test(e),i=(e,n)=>Object.is(e,n);export{o as clamp,u as decimalsOf,s as defaultParse,a as isPartialNumber,m as roundTo,i as sameNumber};
@@ -0,0 +1 @@
1
+ "use client";import{MinusIcon as l,PlusIcon as s}from"../../../overlay/icons.mjs";import{useHoldRepeat as i}from"./use-hold-repeat.mjs";import{jsx as e}from"react/jsx-runtime";function b({className:o,direction:t,disabled:n,label:r,onStep:p}){let u=i(p,!n);return e("button",{"aria-label":r,className:o,"data-plume-numberinput-stepper":t===1?"increment":"decrement",disabled:n,onMouseDown:a=>a.preventDefault(),tabIndex:-1,type:"button",...u,children:t===1?e(s,{}):e(l,{})})}export{b as NumberInputStepper};
@@ -0,0 +1 @@
1
+ "use client";import{forwardRef as B,useRef as D}from"react";import{joinClasses as l}from"../../../overlay/class-names.mjs";import{mergeRefs as F}from"../../../overlay/trigger.mjs";import{NumberInputStepper as x}from"./numberinput-stepper.mjs";var t={"numberinput-border-color":"var(--plume-border-strong)","numberinput-background-color":"var(--plume-surface-muted)",control:"_control_82obi_31",sm:"_sm_82obi_43",lg:"_lg_82obi_48",outline:"_outline_82obi_53",filled:"_filled_82obi_57",underline:"_underline_82obi_64",pill:"_pill_82obi_69",disabled:"_disabled_82obi_73",invalid:"_invalid_82obi_88",input:"_input_82obi_97",stepper:"_stepper_82obi_111"};import{useNumberInput as j}from"./use-number-input.mjs";import{jsx as o,jsxs as q}from"react/jsx-runtime";var k=(i,u,a,p,m,r)=>{let n=r!=="unstyled";return l(n&&t.control,n&&t[r],n&&t[m],n&&t[p],n&&a&&t.invalid,n&&u&&t.disabled,i)},K=B(({className:i,classNames:u,colorScheme:a="secondary",decrementLabel:p="Decrease",defaultValue:m,disabled:r=!1,format:n,incrementLabel:P="Increase",largeStep:C,max:f,min:_,name:v,onBlur:R,onValueChange:L,parse:T,precision:I,readOnly:y=!1,shape:w="rounded",size:M="md",step:H=1,steppers:s=!0,style:O,value:V,variant:N="outline",...d},E)=>{let S=D(null),e=j({defaultValue:m,format:n,largeStep:C,max:f,min:_,onValueChange:L,parse:T,precision:I,readOnly:y,step:H,value:V}),b=N!=="unstyled",z=d["aria-invalid"]===!0||d["aria-invalid"]==="true",g=s&&!r,A={"--numberinput-color":`var(--plume-color-${a}-text)`,...O},h=()=>S.current?.focus();return q("div",{className:k(i,r,z,w,M,N),"data-plume-numberinput-control":"",style:A,children:[s?o(x,{className:l(b&&t.stepper,u?.decrement),direction:-1,disabled:!g||!e.canDecrement,label:p,onStep:()=>{h(),e.stepBy(-1)}}):null,o("input",{"aria-valuemax":f,"aria-valuemin":_,"aria-valuenow":e.value??void 0,"aria-valuetext":e.valueText,autoComplete:"off",className:l(b&&t.input,u?.input),"data-plume-numberinput-input":"",disabled:r,inputMode:I===0?"numeric":"decimal",onBlur:c=>{e.commit(),R?.(c)},onChange:c=>e.onTextChange(c.target.value),onKeyDown:e.onKeyDown,readOnly:y,ref:F(S,E),role:"spinbutton",type:"text",value:e.display,...d}),s?o(x,{className:l(b&&t.stepper,u?.increment),direction:1,disabled:!g||!e.canIncrement,label:P,onStep:()=>{h(),e.stepBy(1)}}):null,v?o("input",{name:v,type:"hidden",value:e.value??""}):null]})});K.displayName="NumberInput";export{K as NumberInput};
@@ -0,0 +1 @@
1
+ "use client";import{useCallback as u,useEffect as c,useRef as v}from"react";var l=400,s=60;function m(r,i){let t=v(r);t.current=r;let n=v({}),e=u(()=>{window.clearTimeout(n.current.timeout),window.clearInterval(n.current.interval),window.removeEventListener("pointerup",e)},[]),a=u(()=>{t.current(),window.addEventListener("pointerup",e),n.current.timeout=window.setTimeout(()=>{n.current.interval=window.setInterval(()=>t.current(),s)},l)},[e]);return c(()=>{i||e()},[i,e]),c(()=>e,[e]),{onClick:o=>{o.detail===0&&t.current()},onPointerCancel:e,onPointerDown:o=>{o.button===0&&a()},onPointerLeave:e,onPointerUp:e}}export{m as useHoldRepeat};
@@ -0,0 +1 @@
1
+ "use client";import{useState as A}from"react";import{useControllableState as F}from"../../../overlay/use-controllable-state.mjs";import{clamp as U,decimalsOf as E,defaultParse as k,isPartialNumber as H,roundTo as M,sameNumber as B}from"./number-format.mjs";function j({defaultValue:y=null,format:s,largeStep:D,max:b=Number.POSITIVE_INFINITY,min:c=Number.NEGATIVE_INFINITY,onValueChange:w,parse:f,precision:u,readOnly:r,step:p=1,value:S}){let[n,i]=F({defaultValue:y,onChange:w,value:S}),[o,m]=A(null),d=f??k,h=e=>s?s(e):u===void 0?String(e):e.toFixed(u),v=(e,t)=>{let a=U(e,c,b);return t===void 0?a:M(a,t)},l=(e,t=!1)=>{if(r)return;let a=t?D??p*10:p,T=n??0,P=u??Math.max(E(a),E(T));m(null),i(v(T+e*a,P))},x=e=>{r||!f&&!H(e,u)||(m(e),i(d(e)))},I=()=>{if(o===null)return;let e=d(o);m(null),i(e===null?null:v(e,u))},g=e=>{r||!Number.isFinite(e)||(m(null),i(e))},V={ArrowDown:()=>l(-1),ArrowUp:()=>l(1),End:()=>g(b),Enter:I,Home:()=>g(c),PageDown:()=>l(-1,!0),PageUp:()=>l(1,!0)},C=e=>{let t=V[e.key];t&&(e.key!=="Enter"&&e.preventDefault(),t())},K=o!==null&&B(d(o),n),N=n===null?"":h(n);return{canDecrement:!r&&(n===null||n>c),canIncrement:!r&&(n===null||n<b),commit:I,display:K?o:N,onKeyDown:C,onTextChange:x,stepBy:l,value:n,valueText:s&&n!==null?N:void 0}}export{j as useNumberInput};
@@ -0,0 +1 @@
1
+ import{PinInput as n}from"./pininput.mjs";export{n as PinInput};
@@ -0,0 +1 @@
1
+ var g={alphanumeric:/[^a-z0-9]/gi,numeric:/\D/g,text:/\s/g},c=(t,n)=>t.replace(g[n],""),l=(t,n)=>t===""||n.length!==t.length+1?n:n.startsWith(t)?n.slice(t.length):n.slice(0,n.length-t.length),p=(t,n,r,i)=>{let e=Math.min(n,t.length),s=r.length===1?t.slice(e+1):"";return`${t.slice(0,e)}${r}${s}`.slice(0,i)},o=(t,n)=>n<0||n>=t.length?t:`${t.slice(0,n)}${t.slice(n+1)}`;export{l as extractTyped,p as insertAt,o as removeAt,c as sanitize};
@@ -0,0 +1 @@
1
+ "use client";import{forwardRef as K}from"react";import{joinClasses as g}from"../../../overlay/class-names.mjs";import{useFieldContext as B}from"../field/field-context.mjs";var i={"pininput-border-color":"var(--plume-border-strong)","pininput-background-color":"var(--plume-surface-muted)",pin:"_pin_ygqih_21",cell:"_cell_ygqih_26",sm:"_sm_ygqih_37",lg:"_lg_ygqih_43",outline:"_outline_ygqih_53",filled:"_filled_ygqih_57",underline:"_underline_ygqih_65",pill:"_pill_ygqih_71",invalid:"_invalid_ygqih_84"};import{usePinInput as j}from"./use-pin-input.mjs";import{jsx as P,jsxs as Q}from"react/jsx-runtime";var G=o=>(r,a)=>`${o==="numeric"?"Digit":"Character"} ${r} of ${a}`,J=K(({"aria-describedby":o,"aria-invalid":r,"aria-label":a,"aria-labelledby":_,autoComplete:h="one-time-code",focusOnMount:v=!1,className:I,colorScheme:C="secondary",defaultValue:S,disabled:d=!1,getInputLabel:q,id:m,inputClassName:w,length:u=6,mask:T=!1,name:c,onComplete:F,onValueChange:L,placeholder:M,readOnly:b=!1,required:R=!1,shape:N="rounded",size:k="md",style:A,type:p="numeric",value:H,variant:f="outline",...O},V)=>{let y=B(),n=j({focusOnMount:v,defaultValue:S,length:u,onComplete:F,onValueChange:L,readOnly:b,type:p,value:H}),l=f!=="unstyled",s=r===!0||r==="true",$=y?.controlId===m?y?.labelId:void 0,z=_??(a?void 0:$),D=q??G(p),E={"--pininput-color":`var(--plume-color-${s?"error":C}-text)`,...A},x=g(l&&i.pin,l&&i[f],l&&i[k],l&&i[N],l&&s&&i.invalid,I);return Q("fieldset",{"aria-describedby":o,"aria-label":a,"aria-labelledby":z,className:x,"data-plume-pininput":"",disabled:d,ref:V,style:E,...O,children:[[...new Array(u).keys()].map(e=>P("input",{"aria-invalid":s||void 0,"aria-label":D(e+1,u),"aria-required":R||void 0,autoComplete:h,className:g(l&&i.cell,w),"data-filled":n.value[e]?"":void 0,"data-plume-pininput-cell":"",disabled:d,id:e===0?m:void 0,inputMode:p==="numeric"?"numeric":"text",onChange:t=>n.onChange(e,t.target.value),onFocus:t=>t.target.select(),onKeyDown:t=>n.onKeyDown(e,t),onPaste:t=>n.onPaste(e,t),placeholder:M,readOnly:b,ref:t=>{n.cells.current[e]=t},tabIndex:e===n.tabbable?0:-1,type:T?"password":"text",value:n.value[e]??""},e)),c?P("input",{name:c,type:"hidden",value:n.value}):null]})});J.displayName="PinInput";export{J as PinInput};
@@ -0,0 +1 @@
1
+ "use client";import{useEffect as C,useRef as D}from"react";import{useControllableState as M}from"../../../overlay/use-controllable-state.mjs";import{extractTyped as h,insertAt as P,removeAt as l,sanitize as T}from"./pin-utils.mjs";function R({focusOnMount:p=!1,defaultValue:c="",length:o,onComplete:f,onValueChange:b,readOnly:i,type:v,value:d}){let a=D([]),[n,g]=M({defaultValue:c.slice(0,o),onChange:b,value:d});C(()=>{p&&a.current[0]?.focus()},[p]);let s=e=>{let t=Math.min(Math.max(e,0),o-1);a.current[t]?.focus()},u=e=>{e!==n&&(g(e),e.length===o&&f?.(e))},m=(e,t)=>{let r=T(t,v).slice(0,o);r&&(u(P(n,e,r,o)),s(Math.min(e,n.length)+r.length))},E=(e,t)=>{if(!i){if(t===""){u(l(n,e));return}m(e,h(n[e]??"",t))}},y=(e,t)=>{t.preventDefault(),i||m(e,t.clipboardData.getData("text"))},I={ArrowLeft:e=>e-1,ArrowRight:e=>e+1,End:()=>o-1,Home:()=>0};return{cells:a,onChange:E,onKeyDown:(e,t)=>{let r=I[t.key];r?(t.preventDefault(),s(r(e))):t.key==="Backspace"&&!i&&!n[e]?(t.preventDefault(),u(l(n,e-1)),s(e-1)):t.key==="Delete"&&!i&&(t.preventDefault(),u(l(n,e)))},onPaste:y,tabbable:Math.min(n.length,o-1),value:n}}export{R as usePinInput};
@@ -0,0 +1 @@
1
+ import{Rating as i}from"./rating.mjs";export{i as Rating};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";var t="m12 2.5 2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.4l-5.9 3.1 1.2-6.5L2.5 9.4l6.6-.9z";function r({filled:o}){return e("svg",{"aria-hidden":"true",fill:o?"currentColor":"none",focusable:"false",height:"1em",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",viewBox:"0 0 24 24",width:"1em",children:e("path",{d:t})})}export{r as StarIcon};
@@ -0,0 +1 @@
1
+ import{a}from"../../../chunk-SMKRX752.mjs";import{joinClasses as r}from"../../../overlay/class-names.mjs";import{jsx as i,jsxs as l}from"react/jsx-runtime";var R=(e,t)=>t>=e?"full":t>=e-.5?"half":"empty";function c({children:e,classNames:t,emptyIcon:m,icon:p,isStyled:n,state:o}){return l("span",{className:r(n&&a.item,t?.item),"data-plume-rating-item":"","data-state":o,children:[i("span",{"aria-hidden":"true",className:r(n&&a.empty,t?.empty),children:m}),i("span",{"aria-hidden":"true",className:r(n&&a.filled,t?.filled),"data-plume-rating-filled":"",children:p}),e]})}export{c as RatingItem,R as itemState};
@@ -0,0 +1 @@
1
+ "use client";import{a as l}from"../../../chunk-SMKRX752.mjs";import{forwardRef as B,useId as K}from"react";import{joinClasses as j}from"../../../overlay/class-names.mjs";import{useFieldContext as G}from"../field/field-context.mjs";import{StarIcon as I}from"./rating-icons.mjs";import{itemState as w,RatingItem as C}from"./rating-item.mjs";import{useRating as J}from"./use-rating.mjs";import{jsx as i,jsxs as Z}from"react/jsx-runtime";var Q=(e,o,d)=>{if(e)return o===d?"end":"start"},U=e=>`${e} ${e===1?"star":"stars"}`,W=(e,o)=>`${e} out of ${o}`,X={border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1},Y=B(({allowHalf:e=!1,className:o,classNames:d,clearable:p=!1,colorScheme:L="warning",defaultValue:N,disabled:u=!1,emptyIcon:k,getItemLabel:V=U,icon:f,max:m=5,name:O,onValueChange:x,readOnly:b=!1,readOnlyLabel:H=W,required:M=!1,size:T="md",style:A,value:E,variant:F="solid",...s},g)=>{let y=G(),$=K(),t=J({allowHalf:e,defaultValue:N,max:m,onValueChange:x,value:E}),n=F!=="unstyled",z=y?.controlId===s.id?y?.labelId:void 0,D=s["aria-labelledby"]??(s["aria-label"]?void 0:z),R=f??i(I,{filled:!0}),v=k??f??i(I,{filled:!1}),q=e?.5:1,S=[...new Array(m).keys()].map(a=>a+1),P=j(n&&l.rating,n&&l[T],n&&!b&&!u&&l.interactive,n&&u&&l.disabled,o),h={"--rating-solid":`var(--plume-color-${L}-solid)`,"--rating-empty":"var(--plume-border-strong)",...A};return b?Z("span",{className:P,"data-plume-rating":"",ref:g,style:h,...s,"aria-invalid":void 0,"aria-label":void 0,"aria-labelledby":void 0,children:[i("span",{style:X,children:H(t.value,m)}),S.map(a=>i(C,{classNames:d,emptyIcon:v,icon:R,isStyled:n,state:w(a,t.value)},a))]}):i("fieldset",{...s,"aria-labelledby":D,"aria-required":M||void 0,className:P,"data-plume-rating":"",disabled:u,onPointerLeave:()=>t.setHover(void 0),ref:g,role:"radiogroup",style:h,children:S.map(a=>i(C,{classNames:d,emptyIcon:v,icon:R,isStyled:n,state:w(a,t.preview),children:(e?[a-q,a]:[a]).map(r=>i("input",{"aria-label":V(r,m),checked:t.value===r,className:n?l.radio:void 0,"data-half":Q(e,r,a),"data-plume-rating-radio":"",name:O??$,onChange:()=>t.setValue(r),onClick:()=>{p&&t.value===r&&t.setValue(0)},onKeyDown:c=>{p&&(c.key==="Backspace"||c.key==="Delete")&&(c.preventDefault(),t.setValue(0))},onPointerEnter:()=>t.setHover(r),type:"radio",value:r},r))},a))})});Y.displayName="Rating";export{Y as Rating};
@@ -0,0 +1 @@
1
+ "use client";import{useState as d}from"react";import{useControllableState as v}from"../../../overlay/use-controllable-state.mjs";var a=(e,u,n)=>{let t=n?.5:1,r=Math.min(Math.max(Number.isFinite(e)?e:0,0),u);return Math.round(r/t)*t};function f({allowHalf:e,defaultValue:u=0,max:n,onValueChange:t,value:r}){let[s,m]=v({defaultValue:a(u,n,e),onChange:t,value:r}),[o,b]=d(void 0),i=a(s,n,e);return{hover:o,preview:o??i,setHover:b,setValue:l=>m(a(l,n,e)),value:i}}export{a as snap,f as useRating};
@@ -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
@@ -495,11 +495,14 @@ interface InputOwnProps {
495
495
  elementAfter?: ReactNode;
496
496
  colorScheme?: ColorScheme;
497
497
  mask?: string;
498
+ revealClassName?: string;
499
+ revealLabel?: string;
500
+ revealable?: boolean;
498
501
  shape?: Shape;
499
502
  size?: Size;
500
503
  variant?: InputVariant;
501
504
  }
502
- type InputRootAttributes = Pick<InputHTMLAttributes<HTMLInputElement>, 'aria-describedby' | 'aria-invalid' | 'defaultValue' | 'disabled' | 'id' | 'inputMode' | 'max' | 'maxLength' | 'min' | 'minLength' | 'name' | 'onBlur' | 'onChange' | 'pattern' | 'placeholder' | 'readOnly' | 'required' | 'type' | 'value'>;
505
+ type InputRootAttributes = Pick<InputHTMLAttributes<HTMLInputElement>, 'aria-describedby' | 'aria-invalid' | 'autoComplete' | 'defaultValue' | 'disabled' | 'id' | 'inputMode' | 'max' | 'maxLength' | 'min' | 'minLength' | 'name' | 'onBlur' | 'onChange' | 'pattern' | 'placeholder' | 'readOnly' | 'required' | 'type' | 'value'>;
503
506
  type InputVariant = 'outline' | 'filled' | 'underline' | 'unstyled';
504
507
  type InputProps = ComponentProps & InputRootAttributes & InputOwnProps;
505
508
  declare const Input: react.ForwardRefExoticComponent<ComponentProps & InputRootAttributes & InputOwnProps & react.RefAttributes<HTMLInputElement>>;
@@ -604,6 +607,59 @@ interface ModalTriggerProps {
604
607
  }
605
608
  declare const ModalTrigger: react.ForwardRefExoticComponent<ModalTriggerProps & react.RefAttributes<HTMLElement>>;
606
609
 
610
+ type NumberInputPart = 'decrement' | 'increment' | 'input';
611
+ type NumberInputVariant = 'outline' | 'filled' | 'underline' | 'unstyled';
612
+ interface NumberInputOwnProps {
613
+ classNames?: Partial<Record<NumberInputPart, string>>;
614
+ colorScheme?: ColorScheme;
615
+ decrementLabel?: string;
616
+ defaultValue?: number | null;
617
+ format?: (value: number) => string;
618
+ incrementLabel?: string;
619
+ largeStep?: number;
620
+ max?: number;
621
+ min?: number;
622
+ name?: string;
623
+ onValueChange?: (value: number | null) => void;
624
+ parse?: (text: string) => number | null;
625
+ precision?: number;
626
+ shape?: Shape;
627
+ size?: Size;
628
+ step?: number;
629
+ steppers?: boolean;
630
+ value?: number | null;
631
+ variant?: NumberInputVariant;
632
+ }
633
+ type NumberInputRootAttributes = Pick<InputHTMLAttributes<HTMLInputElement>, 'aria-describedby' | 'aria-invalid' | 'aria-label' | 'aria-labelledby' | 'disabled' | 'id' | 'onBlur' | 'onFocus' | 'placeholder' | 'readOnly' | 'required' | 'title'>;
634
+ type NumberInputProps = Omit<ComponentProps, 'index'> & NumberInputRootAttributes & NumberInputOwnProps;
635
+ declare const NumberInput: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & NumberInputRootAttributes & NumberInputOwnProps & react.RefAttributes<HTMLInputElement>>;
636
+
637
+ type PinInputType = 'numeric' | 'alphanumeric' | 'text';
638
+
639
+ type PinInputVariant = 'outline' | 'filled' | 'underline' | 'unstyled';
640
+ interface PinInputOwnProps {
641
+ autoComplete?: string;
642
+ focusOnMount?: boolean;
643
+ colorScheme?: ColorScheme;
644
+ defaultValue?: string;
645
+ getInputLabel?: (index: number, length: number) => string;
646
+ inputClassName?: string;
647
+ length?: number;
648
+ mask?: boolean;
649
+ name?: string;
650
+ onComplete?: (value: string) => void;
651
+ onValueChange?: (value: string) => void;
652
+ placeholder?: string;
653
+ shape?: Shape;
654
+ size?: Size;
655
+ type?: PinInputType;
656
+ value?: string;
657
+ variant?: PinInputVariant;
658
+ }
659
+ type PinInputRootAttributes = Pick<InputHTMLAttributes<HTMLFieldSetElement>, 'aria-describedby' | 'aria-invalid' | 'aria-label' | 'aria-labelledby' | 'disabled' | 'hidden' | 'id' | 'readOnly' | 'required' | 'title'>;
660
+ type PinInputProps = Omit<ComponentProps, 'index'> & PinInputRootAttributes & PinInputOwnProps;
661
+ declare const PinInput: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & PinInputRootAttributes & PinInputOwnProps & react.RefAttributes<HTMLFieldSetElement>>;
662
+
607
663
  type PopoverVariant = 'elevated' | 'outline' | 'unstyled';
608
664
 
609
665
  interface PopoverProps {
@@ -683,6 +739,33 @@ type RadioGroupRootAttributes = Pick<HTMLAttributes<HTMLDivElement>, 'aria-descr
683
739
  type RadioGroupProps = Omit<ComponentProps, 'index'> & RadioGroupRootAttributes & RadioGroupOwnProps;
684
740
  declare const RadioGroup: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & RadioGroupRootAttributes & RadioGroupOwnProps & react.RefAttributes<HTMLDivElement>>;
685
741
 
742
+ type RatingPart = 'empty' | 'filled' | 'item';
743
+
744
+ type RatingVariant = 'solid' | 'unstyled';
745
+ interface RatingOwnProps {
746
+ allowHalf?: boolean;
747
+ classNames?: Partial<Record<RatingPart, string>>;
748
+ clearable?: boolean;
749
+ colorScheme?: ColorScheme;
750
+ defaultValue?: number;
751
+ disabled?: boolean;
752
+ emptyIcon?: ReactNode;
753
+ getItemLabel?: (value: number, max: number) => string;
754
+ icon?: ReactNode;
755
+ max?: number;
756
+ name?: string;
757
+ onValueChange?: (value: number) => void;
758
+ readOnly?: boolean;
759
+ readOnlyLabel?: (value: number, max: number) => string;
760
+ required?: boolean;
761
+ size?: Size;
762
+ value?: number;
763
+ variant?: RatingVariant;
764
+ }
765
+ type RatingRootAttributes = Pick<HTMLAttributes<HTMLElement>, 'aria-describedby' | 'aria-invalid' | 'aria-label' | 'aria-labelledby' | 'hidden' | 'id' | 'title'>;
766
+ type RatingProps = Omit<ComponentProps, 'index'> & RatingRootAttributes & RatingOwnProps;
767
+ declare const Rating: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & RatingRootAttributes & RatingOwnProps & react.RefAttributes<HTMLElement>>;
768
+
686
769
  type SelectVariant = 'outline' | 'filled' | 'underline' | 'unstyled';
687
770
  interface SelectedOption {
688
771
  icon?: ReactNode;
@@ -748,7 +831,7 @@ interface SelectGroupOwnProps {
748
831
  type SelectGroupProps = Omit<ComponentProps, 'index'> & SelectGroupOwnProps;
749
832
  declare const SelectGroup: react.ForwardRefExoticComponent<Omit<ComponentProps, "index"> & SelectGroupOwnProps & react.RefAttributes<HTMLDivElement>>;
750
833
 
751
- type SelectOptionPart = 'check' | 'checkbox' | 'description' | 'icon';
834
+ type SelectOptionPart = 'check' | 'description' | 'icon';
752
835
  interface SelectOptionOwnProps {
753
836
  children?: ReactNode;
754
837
  classNames?: Partial<Record<SelectOptionPart, string>>;
@@ -846,8 +929,12 @@ declare const TabPanel: react.ForwardRefExoticComponent<Pick<HTMLAttributes<HTML
846
929
 
847
930
  interface TextareaOwnProps {
848
931
  colorScheme?: ColorScheme;
932
+ countClassName?: string;
933
+ formatCount?: (count: number, max: number | undefined) => string;
934
+ formatRemaining?: (remaining: number) => string;
849
935
  resize?: TextareaResize;
850
936
  shape?: Shape;
937
+ showCount?: boolean;
851
938
  size?: Size;
852
939
  variant?: TextareaVariant;
853
940
  }
@@ -938,4 +1025,4 @@ interface TooltipProps {
938
1025
  type TooltipVariant = 'solid' | 'outline' | 'unstyled';
939
1026
  declare function Tooltip({ children, className, closeDelay, content, defaultOpen, disabled, offset, onOpenChange, open: openProp, openDelay, placement, size, style, variant, }: Readonly<TooltipProps>): ReactNode;
940
1027
 
941
- export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionOwnProps, type AccordionProps, AccordionTrigger, type AccordionTriggerPart, type AccordionTriggerProps, type AccordionVariant, Badge, type BadgeProps, type Breakpoints, Button, type ButtonProps, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipPart, type ChipProps, type ChipVariant, type ColorMode, type ColorModeSetting, type ColorPalette, type ColorScheme, type ColorShade, type ComponentProps, DatePicker, type DatePickerConfig, type DatePickerProps, type DateRange, type DeepPartial, Dropdown, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownLabelProps, DropdownMenu, type DropdownMenuProps, type DropdownProps, DropdownSeparator, type DropdownSeparatorProps, DropdownTrigger, type DropdownTriggerProps, Field, type FieldControlProps, type FieldOrientation, type FieldProps, type FontSizes, type FontWeights, Icon, type IconProps, Input, type InputProps, type LazyLoadedComponent, type LineHeights, List, ListDivider, type ListDividerProps, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, type MaskChangeHandler, Modal, ModalBody, type ModalBodyProps, ModalClose, type ModalCloseProps, ModalContent, type ModalContentProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, ModalTrigger, type ModalTriggerProps, Popover, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, type Radii, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, SelectContent, type SelectContentPart, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectOption, type SelectOptionPart, type SelectOptionProps, type SelectProps, SelectTrigger, type SelectTriggerPart, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, type SelectedOption, type SemanticColors, type Shade, type ShadeLevel, type Shadows, type Shape, type Size, type Sizes, Skeleton, type SkeletonProps, type SkeletonShape, type SkeletonVariant, type Spaces, Spinner, type SpinnerProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, Tabs, type TabsProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, type ToastAction, type ToastApi, type ToastContent, type ToastIcons, type ToastOptions, type ToastPart, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastStatus, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipProps, type Typography, type UseClickOutsideProps, type UseDebounceProps, type UseMaskProps, type UseMaskResult, type ZIndeces, applyMask, colorVar, deepMerge, defaultDarkTheme, defaultTheme, formatDate, getContrastColor, getContrastRatio, getDarkenColor, getDateFormatByLanguage, getDateFromDateString, getDateStringByLanguage, getDaysOfWeekByLanguage, getLightenColor, getMonthsByLanguage, lazyLoadContent, themeToCssVars, useClickOutside, useDebounce, useMask, useTheme, useToast, validateFormatDate };
1028
+ export { Accordion, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionItemProps, type AccordionOwnProps, type AccordionProps, AccordionTrigger, type AccordionTriggerPart, type AccordionTriggerProps, type AccordionVariant, Badge, type BadgeProps, type Breakpoints, Button, type ButtonProps, Card, CardBody, type CardBodyProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipPart, type ChipProps, type ChipVariant, type ColorMode, type ColorModeSetting, type ColorPalette, type ColorScheme, type ColorShade, type ComponentProps, DatePicker, type DatePickerConfig, type DatePickerProps, type DateRange, type DeepPartial, Dropdown, DropdownItem, type DropdownItemProps, DropdownLabel, type DropdownLabelProps, DropdownMenu, type DropdownMenuProps, type DropdownProps, DropdownSeparator, type DropdownSeparatorProps, DropdownTrigger, type DropdownTriggerProps, Field, type FieldControlProps, type FieldOrientation, type FieldProps, type FontSizes, type FontWeights, Icon, type IconProps, Input, type InputProps, type LazyLoadedComponent, type LineHeights, List, ListDivider, type ListDividerProps, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, type MaskChangeHandler, Modal, ModalBody, type ModalBodyProps, ModalClose, type ModalCloseProps, ModalContent, type ModalContentProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, type ModalProps, ModalTrigger, type ModalTriggerProps, NumberInput, type NumberInputPart, type NumberInputProps, type NumberInputVariant, PinInput, type PinInputProps, type PinInputType, type PinInputVariant, Popover, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps, ProgressBar, type ProgressBarProps, type ProgressBarVariant, type Radii, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingPart, type RatingProps, type RatingVariant, Select, SelectContent, type SelectContentPart, type SelectContentProps, SelectGroup, type SelectGroupProps, SelectOption, type SelectOptionPart, type SelectOptionProps, type SelectProps, SelectTrigger, type SelectTriggerPart, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, type SelectedOption, type SemanticColors, type Shade, type ShadeLevel, type Shadows, type Shape, type Size, type Sizes, Skeleton, type SkeletonProps, type SkeletonShape, type SkeletonVariant, type Spaces, Spinner, type SpinnerProps, Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, TabPanels, type TabPanelsProps, type TabProps, Tabs, type TabsProps, Textarea, type TextareaProps, type Theme, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, type ToastAction, type ToastApi, type ToastContent, type ToastIcons, type ToastOptions, type ToastPart, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastStatus, type ToastVariant, Toggle, type ToggleProps, Tooltip, type TooltipProps, type Typography, type UseClickOutsideProps, type UseDebounceProps, type UseMaskProps, type UseMaskResult, type ZIndeces, applyMask, colorVar, deepMerge, defaultDarkTheme, defaultTheme, formatDate, getContrastColor, getContrastRatio, getDarkenColor, getDateFormatByLanguage, getDateFromDateString, getDateStringByLanguage, getDaysOfWeekByLanguage, getLightenColor, getMonthsByLanguage, lazyLoadContent, themeToCssVars, useClickOutside, useDebounce, useMask, useTheme, useToast, validateFormatDate };