@stokelp/ui 4.0.3 → 4.1.1

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 (40) hide show
  1. package/dist/components/alert/Alert.cjs +1 -1
  2. package/dist/components/alert/Alert.cjs.map +1 -1
  3. package/dist/components/alert/Alert.js +57 -53
  4. package/dist/components/alert/Alert.js.map +1 -1
  5. package/dist/components/combobox/Combobox.cjs +2 -2
  6. package/dist/components/combobox/Combobox.cjs.map +1 -1
  7. package/dist/components/combobox/Combobox.js +17 -17
  8. package/dist/components/date-picker/DatePicker.cjs +1 -1
  9. package/dist/components/date-picker/DatePicker.cjs.map +1 -1
  10. package/dist/components/date-picker/DatePicker.js +68 -53
  11. package/dist/components/date-picker/DatePicker.js.map +1 -1
  12. package/dist/components/dialog/styled.cjs +1 -1
  13. package/dist/components/dialog/styled.cjs.map +1 -1
  14. package/dist/components/dialog/styled.js +58 -54
  15. package/dist/components/dialog/styled.js.map +1 -1
  16. package/dist/components/drawer/Drawer.cjs +1 -1
  17. package/dist/components/drawer/Drawer.cjs.map +1 -1
  18. package/dist/components/drawer/Drawer.js +46 -42
  19. package/dist/components/drawer/Drawer.js.map +1 -1
  20. package/dist/components/pagination/Pagination.cjs +1 -1
  21. package/dist/components/pagination/Pagination.cjs.map +1 -1
  22. package/dist/components/pagination/Pagination.js +37 -36
  23. package/dist/components/pagination/Pagination.js.map +1 -1
  24. package/dist/components/select/Select.cjs +1 -1
  25. package/dist/components/select/Select.cjs.map +1 -1
  26. package/dist/components/select/Select.js +15 -15
  27. package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs +1 -1
  28. package/dist/components/supplier-rating-badge/SupplierRatingBadge.cjs.map +1 -1
  29. package/dist/components/supplier-rating-badge/SupplierRatingBadge.js +4 -4
  30. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
  31. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
  32. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +33 -33
  33. package/dist/components/ui-labels/UiLabelsProvider.cjs +1 -1
  34. package/dist/components/ui-labels/UiLabelsProvider.cjs.map +1 -1
  35. package/dist/components/ui-labels/UiLabelsProvider.d.ts +34 -2
  36. package/dist/components/ui-labels/UiLabelsProvider.js +32 -7
  37. package/dist/components/ui-labels/UiLabelsProvider.js.map +1 -1
  38. package/dist/index.cjs +1 -1
  39. package/dist/index.js +69 -69
  40. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../utils/slots.cjs"),t=require("../icon-button/IconButton.cjs"),n=require("../icon/Icon.cjs");let r=require("@ark-ui/react"),i=require("@stokelp/styled-system/jsx"),a=require("@stokelp/styled-system/recipes"),o=require("react"),s=require("react/jsx-runtime");var{withProvider:c,withContext:l}=e.createStyleContext(a.alert),u=c((0,i.styled)(r.ark.div),`root`),d=l((0,i.styled)(r.ark.svg),`icon`),f=l((0,i.styled)(r.ark.h3),`title`),p=l((0,i.styled)(r.ark.div),`description`),m=e=>{switch(e){default:case`neutral`:return(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z`,fill:`currentColor`})});case`info`:return(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z`,fill:`currentColor`})});case`success`:return(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z`,fill:`currentColor`})});case`warning`:return(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z`,fill:`currentColor`})});case`error`:return(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z`,fill:`currentColor`})})}},h=(0,o.forwardRef)(({title:e,description:r,showDismissTrigger:i,onDismiss:a,severity:o,showIcon:c=!0,icon:l,iconProps:h,...g},_)=>(0,s.jsxs)(u,{ref:_,severity:o,...g,children:[(0,s.jsxs)(f,{children:[c?(0,s.jsx)(d,{asChild:!0,children:(0,s.jsx)(n.Icon,{...h,children:l||m(o)})}):null,e,i?(0,s.jsx)(t.IconButton,{ml:`auto`,onClick:a,size:`sm`,variant:`tertiary`,"aria-label":`dismiss`,children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,s.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})}):null]}),r?(0,s.jsx)(p,{children:r}):null]}));exports.Alert=h;
1
+ "use client";const e=require("../../utils/slots.cjs"),t=require("../ui-labels/UiLabelsProvider.cjs"),n=require("../icon-button/IconButton.cjs"),r=require("../icon/Icon.cjs");let i=require("@ark-ui/react"),a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react"),c=require("react/jsx-runtime");var{withProvider:l,withContext:u}=e.createStyleContext(o.alert),d=l((0,a.styled)(i.ark.div),`root`),f=u((0,a.styled)(i.ark.svg),`icon`),p=u((0,a.styled)(i.ark.h3),`title`),m=u((0,a.styled)(i.ark.div),`description`),h=e=>{switch(e){default:case`neutral`:return(0,c.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z`,fill:`currentColor`})});case`info`:return(0,c.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z`,fill:`currentColor`})});case`success`:return(0,c.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z`,fill:`currentColor`})});case`warning`:return(0,c.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z`,fill:`currentColor`})});case`error`:return(0,c.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z`,fill:`currentColor`})})}},g=(0,s.forwardRef)(({title:e,description:i,showDismissTrigger:a,onDismiss:o,severity:s,showIcon:l=!0,icon:u,iconProps:g,..._},v)=>{let y=t.useUiLabels();return(0,c.jsxs)(d,{ref:v,severity:s,..._,children:[(0,c.jsxs)(p,{children:[l?(0,c.jsx)(f,{asChild:!0,children:(0,c.jsx)(r.Icon,{...g,children:u||h(s)})}):null,e,a?(0,c.jsx)(n.IconButton,{ml:`auto`,onClick:o,size:`sm`,variant:`tertiary`,"aria-label":y.dismiss,children:(0,c.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,c.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z`,fill:`currentColor`})})}):null]}),i?(0,c.jsx)(m,{children:i}):null]})});exports.Alert=g;
2
2
  //# sourceMappingURL=Alert.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.cjs","names":["createStyleContext","alert","styled","ark","forwardRef","Icon","IconButton","require_slots","require_IconButton","require_Icon","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","StyledAlert","withProvider","StyledAlertIcon","withContext","StyledAlertTitle","StyledAlertDescription","getIcon","severity","Alert","props","showIcon","iconProps","icon","title","showDismissTrigger","onDismiss","description"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { alert } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { type ComponentProps, forwardRef, ReactNode } from 'react'\nimport { IconButton, type IconButtonProps } from '~/components/icon-button/IconButton'\nimport { Icon, IconProps } from '~/components/icon/Icon'\n\nconst { withProvider, withContext } = createStyleContext(alert)\n\nconst StyledAlert = withProvider(styled(ark.div), 'root')\nconst StyledAlertIcon = withContext(styled(ark.svg), 'icon')\nconst StyledAlertTitle = withContext(styled(ark.h3), 'title')\nconst StyledAlertDescription = withContext(styled(ark.div), 'description')\n\nexport interface AlertProps extends Omit<ComponentProps<typeof StyledAlert>, 'children' | 'title'> {\n title: ReactNode\n description?: ReactNode\n onDismiss?: IconButtonProps['onClick']\n showDismissTrigger?: boolean\n showIcon?: boolean\n icon?: ReactNode\n iconProps?: IconProps\n}\n\nconst getIcon = (severity: AlertProps['severity']) => {\n switch (severity) {\n default:\n case 'neutral':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'info':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'success':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'warning':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'error':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n { title, description, showDismissTrigger, onDismiss, severity, showIcon = true, icon, iconProps, ...props },\n ref,\n ) => {\n return (\n <StyledAlert ref={ref} severity={severity} {...props}>\n <StyledAlertTitle>\n {showIcon ? (\n <StyledAlertIcon asChild>\n <Icon {...iconProps}>{icon ? icon : getIcon(severity)}</Icon>\n </StyledAlertIcon>\n ) : null}\n {title}\n {showDismissTrigger ? (\n <IconButton ml=\"auto\" onClick={onDismiss} size=\"sm\" variant=\"tertiary\" aria-label=\"dismiss\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n ) : null}\n </StyledAlertTitle>\n {description ? <StyledAlertDescription>{description}</StyledAlertDescription> : null}\n </StyledAlert>\n )\n },\n)\n"],"mappings":"A,oSAQA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,KAAK,EAExDc,EAAcC,GAAA,EAAad,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,MAAM,EAClDc,EAAkBC,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,MAAM,EACrDgB,EAAmBD,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,EAAE,EAAG,OAAO,EACtDiB,EAAyBF,GAAA,EAAYhB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,aAAa,EAYnEkB,EAAW,GAAqC,CACpD,OAAQC,EAAR,CACE,QACA,IAAK,UACH,OACE,EAAAR,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,UAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,8oCACF,KAAK,cACN,CAAA,CACE,CAAA,EAET,IAAK,OACH,OACE,EAAAA,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,KAAK,OAA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Q,CAAQ,CAAA,CAC7C,CAAA,EACf,KACHM,EACAC,GACC,EAAAf,EAAA,IAAA,CAACR,EAAAA,WAAD,CAAY,GAAG,OAAO,QAASwB,EAAW,KAAK,KAAK,QAAQ,WAAW,aAAW,UAChF,UAAA,EAAAhB,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,UAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,4fACF,KAAK,cACN,CAAA,CACE,CAAA,CACK,CAAA,EACV,IACY,CAAA,CAAA,EACjBiB,GAAc,EAAAjB,EAAA,IAAA,CAACM,EAAD,CAAA,SAAyBW,CAAoC,CAAA,EAAI,IACrE,C,EAGnB,E"}
1
+ {"version":3,"file":"Alert.cjs","names":["createStyleContext","alert","styled","ark","forwardRef","useUiLabels","Icon","IconButton","require_slots","require_UiLabelsProvider","require_IconButton","require_Icon","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","StyledAlert","withProvider","StyledAlertIcon","withContext","StyledAlertTitle","StyledAlertDescription","getIcon","severity","Alert","props","labels","showIcon","iconProps","icon","title","showDismissTrigger","onDismiss","description"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { alert } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { type ComponentProps, forwardRef, ReactNode } from 'react'\nimport { IconButton, type IconButtonProps } from '~/components/icon-button/IconButton'\nimport { Icon, IconProps } from '~/components/icon/Icon'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nconst { withProvider, withContext } = createStyleContext(alert)\n\nconst StyledAlert = withProvider(styled(ark.div), 'root')\nconst StyledAlertIcon = withContext(styled(ark.svg), 'icon')\nconst StyledAlertTitle = withContext(styled(ark.h3), 'title')\nconst StyledAlertDescription = withContext(styled(ark.div), 'description')\n\nexport interface AlertProps extends Omit<ComponentProps<typeof StyledAlert>, 'children' | 'title'> {\n title: ReactNode\n description?: ReactNode\n onDismiss?: IconButtonProps['onClick']\n showDismissTrigger?: boolean\n showIcon?: boolean\n icon?: ReactNode\n iconProps?: IconProps\n}\n\nconst getIcon = (severity: AlertProps['severity']) => {\n switch (severity) {\n default:\n case 'neutral':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'info':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'success':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'warning':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'error':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n { title, description, showDismissTrigger, onDismiss, severity, showIcon = true, icon, iconProps, ...props },\n ref,\n ) => {\n const labels = useUiLabels()\n return (\n <StyledAlert ref={ref} severity={severity} {...props}>\n <StyledAlertTitle>\n {showIcon ? (\n <StyledAlertIcon asChild>\n <Icon {...iconProps}>{icon ? icon : getIcon(severity)}</Icon>\n </StyledAlertIcon>\n ) : null}\n {title}\n {showDismissTrigger ? (\n <IconButton ml=\"auto\" onClick={onDismiss} size=\"sm\" variant=\"tertiary\" aria-label={labels.dismiss}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n ) : null}\n </StyledAlertTitle>\n {description ? <StyledAlertDescription>{description}</StyledAlertDescription> : null}\n </StyledAlert>\n )\n },\n)\n"],"mappings":"A,mVASA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,KAAK,EAExDgB,EAAcC,GAAA,EAAahB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,MAAM,EAClDgB,EAAkBC,GAAA,EAAYlB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,MAAM,EACrDkB,EAAmBD,GAAA,EAAYlB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,EAAE,EAAG,OAAO,EACtDmB,EAAyBF,GAAA,EAAYlB,EAAAA,OAAAA,CAAOC,EAAAA,IAAI,GAAG,EAAG,aAAa,EAYnEoB,EAAW,GAAqC,CACpD,OAAQC,EAAR,CACE,QACA,IAAK,UACH,OACE,EAAAR,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK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AAA,KAAA,CAACC,EAAD,CAAkB,MAAe,WAAU,GAAIS,EAA/C,SAAA,EACE,EAAAV,EAAA,KAAA,CAACK,EAAD,CAAA,SAAA,CACGO,GACC,EAAAZ,EAAA,IAAA,CAACG,EAAD,CAAiB,QAAA,GACf,UAAA,EAAAH,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,GAAIuB,EAAY,SAAAC,GAAcP,EAAQC,CAAQ,CAAQ,CAAA,CAC7C,CAAA,EACf,KACHO,EACAC,GACC,EAAAhB,EAAA,IAAA,CAACT,EAAAA,WAAD,CAAY,GAAG,OAAO,QAAS0B,EAAW,KAAK,KAAK,QAAQ,WAAW,aAAYN,EAAO,QACxF,UAAA,EAAAX,EAAA,IAAA,CAAC,MAAD,CAAK,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,UAAA,EAAAA,EAAA,IAAA,CAAC,OAAD,CACE,SAAS,UACT,SAAS,UACT,EAAE,4fACF,KAAK,cACN,CAAA,CACE,CAAA,CACK,CAAA,EACV,IACY,CAAA,CAAA,EACjBkB,GAAc,EAAAlB,EAAA,IAAA,CAACM,EAAD,CAAA,SAAyBY,CAAoC,CAAA,EAAI,IACrE,C,EAEjB,CACF,E"}
@@ -1,75 +1,76 @@
1
1
  "use client";
2
2
  import { createStyleContext as e } from "../../utils/slots.js";
3
- import { IconButton as t } from "../icon-button/IconButton.js";
4
- import { Icon as n } from "../icon/Icon.js";
5
- import { ark as r } from "@ark-ui/react";
6
- import { styled as i } from "@stokelp/styled-system/jsx";
7
- import { alert as a } from "@stokelp/styled-system/recipes";
8
- import { forwardRef as o } from "react";
9
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
3
+ import { useUiLabels as t } from "../ui-labels/UiLabelsProvider.js";
4
+ import { IconButton as n } from "../icon-button/IconButton.js";
5
+ import { Icon as r } from "../icon/Icon.js";
6
+ import { ark as i } from "@ark-ui/react";
7
+ import { styled as a } from "@stokelp/styled-system/jsx";
8
+ import { alert as o } from "@stokelp/styled-system/recipes";
9
+ import { forwardRef as s } from "react";
10
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
11
  // src/components/alert/Alert.tsx
11
- var { withProvider: l, withContext: u } = e(a), d = l(i(r.div), "root"), f = u(i(r.svg), "icon"), p = u(i(r.h3), "title"), m = u(i(r.div), "description"), h = (e) => {
12
+ var { withProvider: u, withContext: d } = e(o), f = u(a(i.div), "root"), p = d(a(i.svg), "icon"), m = d(a(i.h3), "title"), h = d(a(i.div), "description"), g = (e) => {
12
13
  switch (e) {
13
14
  default:
14
- case "neutral": return /* @__PURE__ */ s("svg", {
15
+ case "neutral": return /* @__PURE__ */ c("svg", {
15
16
  width: "18",
16
17
  height: "18",
17
18
  viewBox: "0 0 18 18",
18
19
  fill: "none",
19
20
  xmlns: "http://www.w3.org/2000/svg",
20
- children: /* @__PURE__ */ s("path", {
21
+ children: /* @__PURE__ */ c("path", {
21
22
  fillRule: "evenodd",
22
23
  clipRule: "evenodd",
23
24
  d: "M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z",
24
25
  fill: "currentColor"
25
26
  })
26
27
  });
27
- case "info": return /* @__PURE__ */ s("svg", {
28
+ case "info": return /* @__PURE__ */ c("svg", {
28
29
  width: "18",
29
30
  height: "18",
30
31
  viewBox: "0 0 18 18",
31
32
  fill: "none",
32
33
  xmlns: "http://www.w3.org/2000/svg",
33
- children: /* @__PURE__ */ s("path", {
34
+ children: /* @__PURE__ */ c("path", {
34
35
  fillRule: "evenodd",
35
36
  clipRule: "evenodd",
36
37
  d: "M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z",
37
38
  fill: "currentColor"
38
39
  })
39
40
  });
40
- case "success": return /* @__PURE__ */ s("svg", {
41
+ case "success": return /* @__PURE__ */ c("svg", {
41
42
  width: "18",
42
43
  height: "18",
43
44
  viewBox: "0 0 18 18",
44
45
  fill: "none",
45
46
  xmlns: "http://www.w3.org/2000/svg",
46
- children: /* @__PURE__ */ s("path", {
47
+ children: /* @__PURE__ */ c("path", {
47
48
  fillRule: "evenodd",
48
49
  clipRule: "evenodd",
49
50
  d: "M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z",
50
51
  fill: "currentColor"
51
52
  })
52
53
  });
53
- case "warning": return /* @__PURE__ */ s("svg", {
54
+ case "warning": return /* @__PURE__ */ c("svg", {
54
55
  width: "18",
55
56
  height: "18",
56
57
  viewBox: "0 0 18 18",
57
58
  fill: "none",
58
59
  xmlns: "http://www.w3.org/2000/svg",
59
- children: /* @__PURE__ */ s("path", {
60
+ children: /* @__PURE__ */ c("path", {
60
61
  fillRule: "evenodd",
61
62
  clipRule: "evenodd",
62
63
  d: "M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z",
63
64
  fill: "currentColor"
64
65
  })
65
66
  });
66
- case "error": return /* @__PURE__ */ s("svg", {
67
+ case "error": return /* @__PURE__ */ c("svg", {
67
68
  width: "18",
68
69
  height: "18",
69
70
  viewBox: "0 0 18 18",
70
71
  fill: "none",
71
72
  xmlns: "http://www.w3.org/2000/svg",
72
- children: /* @__PURE__ */ s("path", {
73
+ children: /* @__PURE__ */ c("path", {
73
74
  fillRule: "evenodd",
74
75
  clipRule: "evenodd",
75
76
  d: "M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z",
@@ -77,41 +78,44 @@ var { withProvider: l, withContext: u } = e(a), d = l(i(r.div), "root"), f = u(i
77
78
  })
78
79
  });
79
80
  }
80
- }, g = o(({ title: e, description: r, showDismissTrigger: i, onDismiss: a, severity: o, showIcon: l = !0, icon: u, iconProps: g, ..._ }, v) => /* @__PURE__ */ c(d, {
81
- ref: v,
82
- severity: o,
83
- ..._,
84
- children: [/* @__PURE__ */ c(p, { children: [
85
- l ? /* @__PURE__ */ s(f, {
86
- asChild: !0,
87
- children: /* @__PURE__ */ s(n, {
88
- ...g,
89
- children: u || h(o)
90
- })
91
- }) : null,
92
- e,
93
- i ? /* @__PURE__ */ s(t, {
94
- ml: "auto",
95
- onClick: a,
96
- size: "sm",
97
- variant: "tertiary",
98
- "aria-label": "dismiss",
99
- children: /* @__PURE__ */ s("svg", {
100
- width: "16",
101
- height: "16",
102
- viewBox: "0 0 16 16",
103
- fill: "none",
104
- xmlns: "http://www.w3.org/2000/svg",
105
- children: /* @__PURE__ */ s("path", {
106
- fillRule: "evenodd",
107
- clipRule: "evenodd",
108
- d: "M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z",
109
- fill: "currentColor"
81
+ }, _ = s(({ title: e, description: i, showDismissTrigger: a, onDismiss: o, severity: s, showIcon: u = !0, icon: d, iconProps: _, ...v }, y) => {
82
+ let b = t();
83
+ return /* @__PURE__ */ l(f, {
84
+ ref: y,
85
+ severity: s,
86
+ ...v,
87
+ children: [/* @__PURE__ */ l(m, { children: [
88
+ u ? /* @__PURE__ */ c(p, {
89
+ asChild: !0,
90
+ children: /* @__PURE__ */ c(r, {
91
+ ..._,
92
+ children: d || g(s)
110
93
  })
111
- })
112
- }) : null
113
- ] }), r ? /* @__PURE__ */ s(m, { children: r }) : null]
114
- }));
115
- export { g as Alert };
94
+ }) : null,
95
+ e,
96
+ a ? /* @__PURE__ */ c(n, {
97
+ ml: "auto",
98
+ onClick: o,
99
+ size: "sm",
100
+ variant: "tertiary",
101
+ "aria-label": b.dismiss,
102
+ children: /* @__PURE__ */ c("svg", {
103
+ width: "16",
104
+ height: "16",
105
+ viewBox: "0 0 16 16",
106
+ fill: "none",
107
+ xmlns: "http://www.w3.org/2000/svg",
108
+ children: /* @__PURE__ */ c("path", {
109
+ fillRule: "evenodd",
110
+ clipRule: "evenodd",
111
+ d: "M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z",
112
+ fill: "currentColor"
113
+ })
114
+ })
115
+ }) : null
116
+ ] }), i ? /* @__PURE__ */ c(h, { children: i }) : null]
117
+ });
118
+ });
119
+ export { _ as Alert };
116
120
 
117
121
  //# sourceMappingURL=Alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","names":["createStyleContext","alert","StyledAlert","withProvider","styled","ark","StyledAlertIcon","withContext","StyledAlertTitle","StyledAlertDescription","getIcon","severity","Alert","forwardRef","props","showIcon","Icon","iconProps","icon","title","showDismissTrigger","IconButton","onDismiss","description"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { alert } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { type ComponentProps, forwardRef, ReactNode } from 'react'\nimport { IconButton, type IconButtonProps } from '~/components/icon-button/IconButton'\nimport { Icon, IconProps } from '~/components/icon/Icon'\n\nconst { withProvider, withContext } = createStyleContext(alert)\n\nconst StyledAlert = withProvider(styled(ark.div), 'root')\nconst StyledAlertIcon = withContext(styled(ark.svg), 'icon')\nconst StyledAlertTitle = withContext(styled(ark.h3), 'title')\nconst StyledAlertDescription = withContext(styled(ark.div), 'description')\n\nexport interface AlertProps extends Omit<ComponentProps<typeof StyledAlert>, 'children' | 'title'> {\n title: ReactNode\n description?: ReactNode\n onDismiss?: IconButtonProps['onClick']\n showDismissTrigger?: boolean\n showIcon?: boolean\n icon?: ReactNode\n iconProps?: IconProps\n}\n\nconst getIcon = (severity: AlertProps['severity']) => {\n switch (severity) {\n default:\n case 'neutral':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'info':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'success':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'warning':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'error':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n { title, description, showDismissTrigger, onDismiss, severity, showIcon = true, icon, iconProps, ...props },\n ref,\n ) => {\n return (\n <StyledAlert ref={ref} severity={severity} {...props}>\n <StyledAlertTitle>\n {showIcon ? (\n <StyledAlertIcon asChild>\n <Icon {...iconProps}>{icon ? icon : getIcon(severity)}</Icon>\n </StyledAlertIcon>\n ) : null}\n {title}\n {showDismissTrigger ? (\n <IconButton ml=\"auto\" onClick={onDismiss} size=\"sm\" variant=\"tertiary\" aria-label=\"dismiss\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n ) : null}\n </StyledAlertTitle>\n {description ? <StyledAlertDescription>{description}</StyledAlertDescription> : null}\n </StyledAlert>\n )\n },\n)\n"],"mappings":";;;;;;;;;;AAQA,IAAM,EAAE,iBAAc,mBAAgBA,EAAmBC,CAAK,GAExDC,IAAcC,EAAaC,EAAOC,EAAI,GAAG,GAAG,MAAM,GAClDC,IAAkBC,EAAYH,EAAOC,EAAI,GAAG,GAAG,MAAM,GACrDG,IAAmBD,EAAYH,EAAOC,EAAI,EAAE,GAAG,OAAO,GACtDI,IAAyBF,EAAYH,EAAOC,EAAI,GAAG,GAAG,aAAa,GAYnEK,KAAW,MAAqC;CACpD,QAAQC,GAAR;EACE;EACA,KAAK,WACH,OACE,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,OAAM;GAChE,UAAA,kBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IACF,MAAK;GACN,CAAA;EACE,CAAA;EAET,KAAK,QACH,OACE,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,OAAM;GAChE,UAAA,kBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IACF,MAAK;GACN,CAAA;EACE,CAAA;EAET,KAAK,WACH,OACE,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,OAAM;GAChE,UAAA,kBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IACF,MAAK;GACN,CAAA;EACE,CAAA;EAET,KAAK,WACH,OACE,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,OAAM;GAChE,UAAA,kBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IACF,MAAK;GACN,CAAA;EACE,CAAA;EAET,KAAK,SACH,OACE,kBAAC,OAAD;GAAK,OAAM;GAAK,QAAO;GAAK,SAAQ;GAAY,MAAK;GAAO,OAAM;GAChE,UAAA,kBAAC,QAAD;IACE,UAAS;IACT,UAAS;IACT,GAAE;IACF,MAAK;GACN,CAAA;EACE,CAAA;CAEX;AACF,GAEaC,IAAQC,GAEjB,EAAE,UAAO,gBAAa,uBAAoB,cAAW,aAAU,cAAW,IAAM,SAAM,cAAW,GAAGC,KACpG,MAGE,kBAACZ,GAAD;CAAkB;CAAe;CAAU,GAAIY;CAA/C,UAAA,CACE,kBAACN,GAAD,EAAA,UAAA;EACGO,IACC,kBAACT,GAAD;GAAiB,SAAA;GACf,UAAA,kBAACU,GAAD;IAAM,GAAIC;IAAY,UAAAC,KAAcR,EAAQC,CAAQ;GAAQ,CAAA;EAC7C,CAAA,IACf;EACHQ;EACAC,IACC,kBAACC,GAAD;GAAY,IAAG;GAAO,SAASC;GAAW,MAAK;GAAK,SAAQ;GAAW,cAAW;GAChF,UAAA,kBAAC,OAAD;IAAK,OAAM;IAAK,QAAO;IAAK,SAAQ;IAAY,MAAK;IAAO,OAAM;IAChE,UAAA,kBAAC,QAAD;KACE,UAAS;KACT,UAAS;KACT,GAAE;KACF,MAAK;IACN,CAAA;GACE,CAAA;EACK,CAAA,IACV;CACY,EAAA,CAAA,GACjBC,IAAc,kBAACd,GAAD,EAAA,UAAyBc,EAAoC,CAAA,IAAI,IACrE;A,EAGnB"}
1
+ {"version":3,"file":"Alert.js","names":["createStyleContext","alert","StyledAlert","withProvider","styled","ark","StyledAlertIcon","withContext","StyledAlertTitle","StyledAlertDescription","getIcon","severity","Alert","forwardRef","props","labels","useUiLabels","showIcon","Icon","iconProps","icon","title","showDismissTrigger","IconButton","onDismiss","description"],"sources":["../../../src/components/alert/Alert.tsx"],"sourcesContent":["import { ark } from '@ark-ui/react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { alert } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { type ComponentProps, forwardRef, ReactNode } from 'react'\nimport { IconButton, type IconButtonProps } from '~/components/icon-button/IconButton'\nimport { Icon, IconProps } from '~/components/icon/Icon'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\n\nconst { withProvider, withContext } = createStyleContext(alert)\n\nconst StyledAlert = withProvider(styled(ark.div), 'root')\nconst StyledAlertIcon = withContext(styled(ark.svg), 'icon')\nconst StyledAlertTitle = withContext(styled(ark.h3), 'title')\nconst StyledAlertDescription = withContext(styled(ark.div), 'description')\n\nexport interface AlertProps extends Omit<ComponentProps<typeof StyledAlert>, 'children' | 'title'> {\n title: ReactNode\n description?: ReactNode\n onDismiss?: IconButtonProps['onClick']\n showDismissTrigger?: boolean\n showIcon?: boolean\n icon?: ReactNode\n iconProps?: IconProps\n}\n\nconst getIcon = (severity: AlertProps['severity']) => {\n switch (severity) {\n default:\n case 'neutral':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM10.2208 6.06246C9.55415 5.47918 8.44619 5.47918 7.77959 6.06246C7.54579 6.26703 7.19043 6.24334 6.98586 6.00954C6.78128 5.77575 6.80498 5.42038 7.03877 5.21581C8.12953 4.2614 9.87081 4.2614 10.9616 5.21581C12.0964 6.20876 12.0964 7.85374 10.9616 8.84669C10.7691 9.01512 10.5571 9.15309 10.3335 9.26127C9.82633 9.50673 9.56267 9.84163 9.56267 10.125V10.6875C9.56267 10.9982 9.31083 11.25 9.00017 11.25C8.68951 11.25 8.43767 10.9982 8.43767 10.6875V10.125C8.43767 9.16573 9.23213 8.54448 9.84346 8.24862C9.98044 8.18233 10.1074 8.09925 10.2208 8.00004C10.8433 7.4553 10.8433 6.6072 10.2208 6.06246ZM8.4375 12.9375C8.4375 12.6268 8.68934 12.375 9 12.375H9.00562C9.31629 12.375 9.56812 12.6268 9.56812 12.9375V12.9431C9.56812 13.2538 9.31629 13.5056 9.00562 13.5056H9C8.68934 13.5056 8.4375 13.2538 8.4375 12.9431V12.9375Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'info':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM8.4375 6.1875C8.4375 5.87684 8.68934 5.625 9 5.625H9.00562C9.31629 5.625 9.56812 5.87684 9.56812 6.1875V6.19313C9.56812 6.50379 9.31629 6.75563 9.00562 6.75563H9C8.68934 6.75563 8.4375 6.50379 8.4375 6.19313V6.1875ZM8.21706 7.91883C9.07674 7.48899 10.0447 8.26546 9.81158 9.19791L9.27983 11.3249L9.31094 11.3094C9.5888 11.1705 9.92668 11.2831 10.0656 11.5609C10.2045 11.8388 10.0919 12.1767 9.81406 12.3156L9.78295 12.3312C8.92327 12.761 7.9553 11.9845 8.18842 11.0521L8.72017 8.92506L8.68906 8.94062C8.41119 9.07955 8.07332 8.96692 7.93438 8.68906C7.79545 8.41119 7.90808 8.07332 8.18594 7.93438L8.21706 7.91883Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'success':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM11.5769 6.85477C11.8297 7.03534 11.8883 7.38665 11.7077 7.63945L8.89523 11.5769C8.79912 11.7115 8.64868 11.7969 8.4839 11.8106C8.31911 11.8242 8.15667 11.7647 8.03975 11.6477L6.35225 9.96025C6.13258 9.74058 6.13258 9.38442 6.35225 9.16475C6.57192 8.94508 6.92808 8.94508 7.14775 9.16475L8.36572 10.3827L10.7923 6.98555C10.9728 6.73276 11.3242 6.67421 11.5769 6.85477Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'warning':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.97427 2.81473C9.54134 2.06432 8.45829 2.06432 8.02535 2.81473L2.50961 12.3754C2.07692 13.1254 2.6182 14.0625 3.48407 14.0625H14.5156C15.3814 14.0625 15.9227 13.1254 15.49 12.3754L9.97427 2.81473ZM7.0509 2.25255C7.91676 0.751715 10.0829 0.751714 10.9487 2.25255L16.4645 11.8132C17.3299 13.3132 16.2473 15.1875 14.5156 15.1875H3.48407C1.75234 15.1875 0.669765 13.3132 1.53515 11.8132L7.0509 2.25255ZM8.99981 6.18755C9.31047 6.18755 9.56231 6.43939 9.56231 6.75005V9.56255C9.56231 9.87321 9.31047 10.125 8.99981 10.125C8.68915 10.125 8.43731 9.87321 8.43731 9.56255V6.75005C8.43731 6.43939 8.68915 6.18755 8.99981 6.18755ZM8.43731 11.8125C8.43731 11.5019 8.68915 11.25 8.99981 11.25H9.00544C9.3161 11.25 9.56794 11.5019 9.56794 11.8125V11.8182C9.56794 12.1288 9.3161 12.3807 9.00544 12.3807H8.99981C8.68915 12.3807 8.43731 12.1288 8.43731 11.8182V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n case 'error':\n return (\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 2.8125C5.58274 2.8125 2.8125 5.58274 2.8125 9C2.8125 12.4173 5.58274 15.1875 9 15.1875C12.4173 15.1875 15.1875 12.4173 15.1875 9C15.1875 5.58274 12.4173 2.8125 9 2.8125ZM1.6875 9C1.6875 4.96142 4.96142 1.6875 9 1.6875C13.0386 1.6875 16.3125 4.96142 16.3125 9C16.3125 13.0386 13.0386 16.3125 9 16.3125C4.96142 16.3125 1.6875 13.0386 1.6875 9ZM9 6.1875C9.31066 6.1875 9.5625 6.43934 9.5625 6.75V9.5625C9.5625 9.87316 9.31066 10.125 9 10.125C8.68934 10.125 8.4375 9.87316 8.4375 9.5625V6.75C8.4375 6.43934 8.68934 6.1875 9 6.1875ZM8.4375 11.8125C8.4375 11.5018 8.68934 11.25 9 11.25H9.00562C9.31629 11.25 9.56812 11.5018 9.56812 11.8125V11.8181C9.56812 12.1288 9.31629 12.3806 9.00562 12.3806H9C8.68934 12.3806 8.4375 12.1288 8.4375 11.8181V11.8125Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n }\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(\n (\n { title, description, showDismissTrigger, onDismiss, severity, showIcon = true, icon, iconProps, ...props },\n ref,\n ) => {\n const labels = useUiLabels()\n return (\n <StyledAlert ref={ref} severity={severity} {...props}>\n <StyledAlertTitle>\n {showIcon ? (\n <StyledAlertIcon asChild>\n <Icon {...iconProps}>{icon ? icon : getIcon(severity)}</Icon>\n </StyledAlertIcon>\n ) : null}\n {title}\n {showDismissTrigger ? (\n <IconButton ml=\"auto\" onClick={onDismiss} size=\"sm\" variant=\"tertiary\" aria-label={labels.dismiss}>\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.64645 3.64645C3.84171 3.45118 4.15829 3.45118 4.35355 3.64645L8 7.29289L11.6464 3.64645C11.8417 3.45118 12.1583 3.45118 12.3536 3.64645C12.5488 3.84171 12.5488 4.15829 12.3536 4.35355L8.70711 8L12.3536 11.6464C12.5488 11.8417 12.5488 12.1583 12.3536 12.3536C12.1583 12.5488 11.8417 12.5488 11.6464 12.3536L8 8.70711L4.35355 12.3536C4.15829 12.5488 3.84171 12.5488 3.64645 12.3536C3.45118 12.1583 3.45118 11.8417 3.64645 11.6464L7.29289 8L3.64645 4.35355C3.45118 4.15829 3.45118 3.84171 3.64645 3.64645Z\"\n fill=\"currentColor\"\n />\n </svg>\n </IconButton>\n ) : null}\n </StyledAlertTitle>\n {description ? <StyledAlertDescription>{description}</StyledAlertDescription> : null}\n </StyledAlert>\n )\n },\n)\n"],"mappings":";;;;;;;;;;;AASA,IAAM,EAAE,iBAAc,mBAAgBA,EAAmBC,CAAK,GAExDC,IAAcC,EAAaC,EAAOC,EAA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,IAAM,SAAM,cAAW,GAAGC,KACpG,MACG;CACH,IAAMC,IAASC,EAAY;CAC3B,OACE,kBAACd,GAAD;EAAkB;EAAe;EAAU,GAAIY;EAA/C,UAAA,CACE,kBAACN,GAAD,EAAA,UAAA;GACGS,IACC,kBAACX,GAAD;IAAiB,SAAA;IACf,UAAA,kBAACY,GAAD;KAAM,GAAIC;KAAY,UAAAC,KAAcV,EAAQC,CAAQ;IAAQ,CAAA;GAC7C,CAAA,IACf;GACHU;GACAC,IACC,kBAACC,GAAD;IAAY,IAAG;IAAO,SAASC;IAAW,MAAK;IAAK,SAAQ;IAAW,cAAYT,EAAO;IACxF,UAAA,kBAAC,OAAD;KAAK,OAAM;KAAK,QAAO;KAAK,SAAQ;KAAY,MAAK;KAAO,OAAM;KAChE,UAAA,kBAAC,QAAD;MACE,UAAS;MACT,UAAS;MACT,GAAE;MACF,MAAK;KACN,CAAA;IACE,CAAA;GACK,CAAA,IACV;EACY,EAAA,CAAA,GACjBU,IAAc,kBAAChB,GAAD,EAAA,UAAyBgB,EAAoC,CAAA,IAAI,IACrE;;AAEjB,CACF"}
@@ -1,3 +1,3 @@
1
- "use client";const e=require("../../utils/slots.cjs"),t=require("../tooltip/Tooltip.cjs"),n=require("../text/Text.cjs"),r=require("../../shared/ConditionalWrapper.cjs"),i=require("../ui-labels/UiLabelsProvider.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),ee=require("react-window"),p=require("@zag-js/utils");var{withProvider:m,withContext:h}=e.createStyleContext(l.combobox),g=m((0,c.styled)(s.Combobox.Root),`root`,{defaultProps:{loopFocus:!0}}),te=h((0,c.styled)(s.Combobox.ClearTrigger),`clearTrigger`),ne=h((0,c.styled)(s.Combobox.Content),`content`),_=h((0,c.styled)(s.Combobox.Input),`input`),v=h((0,c.styled)(s.Combobox.Control),`control`),y=h((0,c.styled)(s.Combobox.Item),`item`),b=h((0,c.styled)(s.Combobox.ItemText),`itemText`),re=h((0,c.styled)(s.Combobox.Positioner),`positioner`),x=h((0,c.styled)(s.Combobox.Trigger),`trigger`),S=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,fill:`white`}),(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,className:(0,f.css)({stroke:`grey.100`})})]}),C=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{y:`0.5`,width:`16`,height:`16`,rx:`4`,className:(0,f.css)({fill:`primary.500`})}),(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z`,fill:`white`})]});function w({item:e,isMultiple:t,renderItem:n}){let r=(0,s.useComboboxItemContext)();return(0,d.jsxs)(d.Fragment,{children:[t?r.selected?(0,d.jsx)(C,{}):(0,d.jsx)(S,{}):null,n?n(e):(0,d.jsx)(b,{truncate:!0,children:e.label})]})}function ie({index:e,style:n,ariaAttributes:i,items:a,isMultiple:o,renderItem:s}){let c=a[e];return(0,d.jsx)(r.ConditionalWrapper,{when:!!c.tooltip,wrapper:e=>(0,d.jsx)(t.Tooltip,{label:c.tooltip,children:e}),children:(0,d.jsx)(y,{item:c,style:n,"aria-posinset":i[`aria-posinset`],"aria-setsize":i[`aria-setsize`],children:(0,d.jsx)(w,{renderItem:s,item:c,isMultiple:o})})})}var T=({items:e=[],initialItems:c,debounceMs:l=0,placeholder:f,emptyLabel:m,loadingLabel:h,usePortal:b=!0,withAutoFilter:S=!0,positioning:C,loadItems:T,renderItem:E,renderValue:D,onResetInitialItems:O,isLoading:k,value:A,defaultValue:j,openDropdownOnFocus:M=!0,clearValueWhenEmpty:ae=!0,virtualized:oe,rowHeight:N=34,returnItemsOnEmpty:P,multiple:F=!1,onInputValueChange:se,...I})=>{let L=i.useUiLabels(),[R,z]=(0,u.useState)(()=>e),[B,V]=(0,u.useState)(!1),[H,U]=(0,u.useState)(!1),[W,G]=(0,u.useState)(``),K=typeof T==`function`,q=(0,u.useMemo)(()=>T?(0,p.debounce)(async e=>{try{U(!0),V(!0);let t=await T(e);z(t)}catch(e){console.error(e),z([])}finally{V(!1)}},l):null,[T,l]),ce=(0,u.useMemo)(()=>{if(!S||W===``)return e;let t=W.toLowerCase(),n=e.filter(e=>e.label.toLowerCase().includes(t));return n.length===0&&P?e:n},[e,S,W,P]),J=K?R:ce,Y=(0,u.useMemo)(()=>[...J,...c??[]],[J,c]),X=A?.map(String).join(`
2
- `),[Z,le]=(0,u.useState)(X);if(X!==Z){le(X);let e=new Set(Y.map(e=>String(e.value)));!K&&W!==``&&A?.some(t=>!e.has(String(t)))&&G(``)}let ue=e=>{c&&c.length>0&&!c.find(t=>t.label===e.inputValue)&&O?.(),q?q(e.inputValue):S&&G(e.inputValue),se?.(e)},de=(0,u.useMemo)(()=>(0,s.createListCollection)({items:Y}),[Y]),fe=k??B,Q=h??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:L.loading}),$=m??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:L.noResults});return(0,d.jsxs)(g,{lazyMount:!0,unmountOnExit:!0,collection:de,positioning:{sameWidth:!0,gutter:0,...C},"data-recipe":`combobox`,onInputValueChange:ue,value:A,defaultValue:j,...I,multiple:F,children:[F?(0,d.jsx)(s.Combobox.Context,{children:t=>(0,d.jsxs)(v,{"data-multiple":`true`,"data-open":t.open||void 0,children:[t.value.map(n=>{let r=e.find(e=>String(e.value)===String(n));return r?(0,d.jsxs)(o.Chip,{size:`sm`,children:[D?D(r):(0,d.jsx)(o.ChipLabel,{children:r.label}),!I.readOnly&&!I.disabled&&(0,d.jsx)(o.ChipClearTrigger,{"aria-label":`Retirer ${r.label}`,onClick:()=>t.setValue(t.value.filter(e=>String(e)!==String(n)))})]},n):null}),(0,d.jsx)(_,{asChild:!0,"data-multiple":`true`,placeholder:t.hasSelectedItems?void 0:f,onFocus:()=>{M&&!K&&t.setOpen(!0)},children:(0,d.jsx)(a.Input,{})}),(0,d.jsx)(x,{asChild:!0,hidden:K&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})})]})}):(0,d.jsxs)(v,{children:[(0,d.jsx)(s.Combobox.Context,{children:e=>(0,d.jsx)(_,{asChild:!0,placeholder:f,onInput:t=>{let n=t.currentTarget.value;ae&&n===``&&e.clearValue()},onFocus:()=>{M&&!K&&e.setOpen(!0)},children:(0,d.jsx)(a.Input,{})})}),(0,d.jsx)(x,{asChild:!0,hidden:K&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})}),(0,d.jsx)(te,{disabled:I.readOnly,onClick:O,asChild:!0,children:(0,d.jsx)(`button`,{children:(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z`,fill:`currentColor`})})})})]}),(0,d.jsx)(r.ConditionalWrapper,{when:b,wrapper:e=>(0,d.jsx)(s.Portal,{children:e}),children:(0,d.jsx)(re,{children:(0,d.jsx)(ne,{children:fe?Q:Y.length===0?(0,d.jsx)(d.Fragment,{children:K?H?$:Q:$}):oe?(0,d.jsx)(ee.List,{role:`presentation`,rowComponent:ie,rowProps:{items:Y,isMultiple:F,renderItem:E},rowCount:Y.length,rowHeight:N,style:{height:Math.min(N*Y.length,180)}}):Y.map(e=>(0,d.jsx)(r.ConditionalWrapper,{when:!!e.tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:e.tooltip,children:n}),children:(0,d.jsx)(y,{item:e,children:(0,d.jsx)(w,{renderItem:E,item:e,isMultiple:F})},e.value)},e.value))})})})]})};exports.Combobox=T;
1
+ "use client";const e=require("../../utils/slots.cjs"),t=require("../ui-labels/UiLabelsProvider.cjs"),n=require("../tooltip/Tooltip.cjs"),r=require("../text/Text.cjs"),i=require("../../shared/ConditionalWrapper.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),ee=require("react-window"),p=require("@zag-js/utils");var{withProvider:m,withContext:h}=e.createStyleContext(l.combobox),g=m((0,c.styled)(s.Combobox.Root),`root`,{defaultProps:{loopFocus:!0}}),te=h((0,c.styled)(s.Combobox.ClearTrigger),`clearTrigger`),ne=h((0,c.styled)(s.Combobox.Content),`content`),_=h((0,c.styled)(s.Combobox.Input),`input`),v=h((0,c.styled)(s.Combobox.Control),`control`),y=h((0,c.styled)(s.Combobox.Item),`item`),b=h((0,c.styled)(s.Combobox.ItemText),`itemText`),re=h((0,c.styled)(s.Combobox.Positioner),`positioner`),x=h((0,c.styled)(s.Combobox.Trigger),`trigger`),S=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,fill:`white`}),(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,className:(0,f.css)({stroke:`grey.100`})})]}),C=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{y:`0.5`,width:`16`,height:`16`,rx:`4`,className:(0,f.css)({fill:`primary.500`})}),(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z`,fill:`white`})]});function w({item:e,isMultiple:t,renderItem:n}){let r=(0,s.useComboboxItemContext)();return(0,d.jsxs)(d.Fragment,{children:[t?r.selected?(0,d.jsx)(C,{}):(0,d.jsx)(S,{}):null,n?n(e):(0,d.jsx)(b,{truncate:!0,children:e.label})]})}function ie({index:e,style:t,ariaAttributes:r,items:a,isMultiple:o,renderItem:s}){let c=a[e];return(0,d.jsx)(i.ConditionalWrapper,{when:!!c.tooltip,wrapper:e=>(0,d.jsx)(n.Tooltip,{label:c.tooltip,children:e}),children:(0,d.jsx)(y,{item:c,style:t,"aria-posinset":r[`aria-posinset`],"aria-setsize":r[`aria-setsize`],children:(0,d.jsx)(w,{renderItem:s,item:c,isMultiple:o})})})}var T=({items:e=[],initialItems:c,debounceMs:l=0,placeholder:f,emptyLabel:m,loadingLabel:h,usePortal:b=!0,withAutoFilter:S=!0,positioning:C,loadItems:T,renderItem:E,renderValue:D,onResetInitialItems:O,isLoading:k,value:A,defaultValue:j,openDropdownOnFocus:M=!0,clearValueWhenEmpty:ae=!0,virtualized:oe,rowHeight:N=34,returnItemsOnEmpty:P,multiple:F=!1,onInputValueChange:se,...I})=>{let L=t.useUiLabels(),[R,z]=(0,u.useState)(()=>e),[B,V]=(0,u.useState)(!1),[H,U]=(0,u.useState)(!1),[W,G]=(0,u.useState)(``),K=typeof T==`function`,q=(0,u.useMemo)(()=>T?(0,p.debounce)(async e=>{try{U(!0),V(!0);let t=await T(e);z(t)}catch(e){console.error(e),z([])}finally{V(!1)}},l):null,[T,l]),ce=(0,u.useMemo)(()=>{if(!S||W===``)return e;let t=W.toLowerCase(),n=e.filter(e=>e.label.toLowerCase().includes(t));return n.length===0&&P?e:n},[e,S,W,P]),J=K?R:ce,Y=(0,u.useMemo)(()=>[...J,...c??[]],[J,c]),X=A?.map(String).join(`
2
+ `),[Z,le]=(0,u.useState)(X);if(X!==Z){le(X);let e=new Set(Y.map(e=>String(e.value)));!K&&W!==``&&A?.some(t=>!e.has(String(t)))&&G(``)}let ue=e=>{c&&c.length>0&&!c.find(t=>t.label===e.inputValue)&&O?.(),q?q(e.inputValue):S&&G(e.inputValue),se?.(e)},de=(0,u.useMemo)(()=>(0,s.createListCollection)({items:Y}),[Y]),fe=k??B,Q=h??(0,d.jsx)(r.Text,{p:`space-8`,textAlign:`center`,children:L.loading}),$=m??(0,d.jsx)(r.Text,{p:`space-8`,textAlign:`center`,children:L.noResults});return(0,d.jsxs)(g,{lazyMount:!0,unmountOnExit:!0,collection:de,positioning:{sameWidth:!0,gutter:0,...C},"data-recipe":`combobox`,onInputValueChange:ue,value:A,defaultValue:j,...I,multiple:F,children:[F?(0,d.jsx)(s.Combobox.Context,{children:t=>(0,d.jsxs)(v,{"data-multiple":`true`,"data-open":t.open||void 0,children:[t.value.map(n=>{let r=e.find(e=>String(e.value)===String(n));return r?(0,d.jsxs)(o.Chip,{size:`sm`,children:[D?D(r):(0,d.jsx)(o.ChipLabel,{children:r.label}),!I.readOnly&&!I.disabled&&(0,d.jsx)(o.ChipClearTrigger,{"aria-label":`Retirer ${r.label}`,onClick:()=>t.setValue(t.value.filter(e=>String(e)!==String(n)))})]},n):null}),(0,d.jsx)(_,{asChild:!0,"data-multiple":`true`,placeholder:t.hasSelectedItems?void 0:f,onFocus:()=>{M&&!K&&t.setOpen(!0)},children:(0,d.jsx)(a.Input,{})}),(0,d.jsx)(x,{asChild:!0,hidden:K&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})})]})}):(0,d.jsxs)(v,{children:[(0,d.jsx)(s.Combobox.Context,{children:e=>(0,d.jsx)(_,{asChild:!0,placeholder:f,onInput:t=>{let n=t.currentTarget.value;ae&&n===``&&e.clearValue()},onFocus:()=>{M&&!K&&e.setOpen(!0)},children:(0,d.jsx)(a.Input,{})})}),(0,d.jsx)(x,{asChild:!0,hidden:K&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})}),(0,d.jsx)(te,{disabled:I.readOnly,onClick:O,asChild:!0,children:(0,d.jsx)(`button`,{children:(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z`,fill:`currentColor`})})})})]}),(0,d.jsx)(i.ConditionalWrapper,{when:b,wrapper:e=>(0,d.jsx)(s.Portal,{children:e}),children:(0,d.jsx)(re,{children:(0,d.jsx)(ne,{children:fe?Q:Y.length===0?(0,d.jsx)(d.Fragment,{children:K?H?$:Q:$}):oe?(0,d.jsx)(ee.List,{role:`presentation`,rowComponent:ie,rowProps:{items:Y,isMultiple:F,renderItem:E},rowCount:Y.length,rowHeight:N,style:{height:Math.min(N*Y.length,180)}}):Y.map(e=>(0,d.jsx)(i.ConditionalWrapper,{when:!!e.tooltip,wrapper:t=>(0,d.jsx)(n.Tooltip,{label:e.tooltip,children:t}),children:(0,d.jsx)(y,{item:e,children:(0,d.jsx)(w,{renderItem:E,item:e,isMultiple:F})},e.value)},e.value))})})})]})};exports.Combobox=T;
3
3
  //# sourceMappingURL=Combobox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","ConditionalWrapper","Tooltip","useUiLabels","useState","useMemo","debounce","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","Portal","List","require_slots","require_Tooltip","require_Text","require_ConditionalWrapper","require_UiLabelsProvider","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","_zag_js_utils","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","VirtualRow","items","index","ariaAttributes","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","loadedItems","setLoadedItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","filterText","setFilterText","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","filteredItems","withAutoFilter","text","matching","returnItemsOnEmpty","sourceItems","allItems","initialItems","valueKey","valueKeyOfFilter","setValueKeyOfFilter","listed","v","handleInputChange","details","onResetInitialItems","onInputValueChange","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from '@zag-js/utils'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { List, type RowComponentProps } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<\n ComboboxRootProps<T>,\n 'collection' | 'value' | 'defaultValue'\n> & {\n // Item values may be numbers: the chips compare them as strings.\n value?: Array<string | number>\n defaultValue?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\ninterface VirtualRowProps<Item extends ComboboxItem> {\n items: Item[]\n isMultiple: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\n// Declared at module level: react-window memoizes the row component by identity, so a\n// component created during render would remount every visible row on each render.\nfunction VirtualRow<Item extends ComboboxItem>({\n index,\n style,\n ariaAttributes,\n items,\n isMultiple,\n renderItem,\n}: RowComponentProps<VirtualRowProps<Item>>) {\n const item = items[index]\n\n return (\n <ConditionalWrapper when={!!item.tooltip} wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}>\n {/* Only the position attributes: the option keeps its role from Ark, not react-window's listitem. */}\n <Item\n item={item}\n style={style}\n aria-posinset={ariaAttributes['aria-posinset']}\n aria-setsize={ariaAttributes['aria-setsize']}\n >\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={isMultiple} />\n </Item>\n </ConditionalWrapper>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n defaultValue,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n onInputValueChange,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n // With `loadItems`, the list is what it returned last; the `items` prop only seeds it.\n const [loadedItems, setLoadedItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n // Without `loadItems`, the text the list is filtered on: the input's, as zag reports it.\n const [filterText, setFilterText] = useState('')\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setLoadedItems(newItems)\n } catch (error) {\n console.error(error)\n setLoadedItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // The list is derived from the `items` of this very render, never mirrored into state: zag\n // re-derives the input text from the collection as soon as `value` changes, so a value set in\n // the same render as the item that carries it must find that item in the collection already.\n // A mirror caught up one render late, and the input went blank.\n const filteredItems = useMemo(() => {\n if (!withAutoFilter || filterText === '') return itemsFromUsers\n const text = filterText.toLowerCase()\n const matching = itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(text))\n return matching.length === 0 && returnItemsOnEmpty ? itemsFromUsers : matching\n }, [itemsFromUsers, withAutoFilter, filterText, returnItemsOnEmpty])\n\n const sourceItems = asyncMode ? loadedItems : filteredItems\n const allItems = useMemo(() => [...sourceItems, ...(initialItems ?? [])], [sourceItems, initialItems])\n\n // A new `value` the typed text filters out (an item created from the empty state under\n // another name, a value the app sets) would still be stringified to nothing: drop the\n // filter for that render. zag then writes the label in the input, and the filter follows it.\n const valueKey = value?.map(String).join('\\n')\n const [valueKeyOfFilter, setValueKeyOfFilter] = useState(valueKey)\n if (valueKey !== valueKeyOfFilter) {\n setValueKeyOfFilter(valueKey)\n const listed = new Set(allItems.map(item => String(item.value)))\n if (!asyncMode && filterText !== '' && value?.some(v => !listed.has(String(v)))) {\n setFilterText('')\n }\n }\n\n // A caller's onInputValueChange runs as well: it no longer replaces the filter.\n const handleInputChange = (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n\n if (debouncedLoadItems) {\n debouncedLoadItems(details.inputValue)\n } else if (withAutoFilter) {\n setFilterText(details.inputValue)\n }\n onInputValueChange?.(details)\n }\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n defaultValue={defaultValue as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n // role=\"presentation\" overrides the list's own role=\"list\": the options must stay\n // owned by the listbox.\n <List\n role=\"presentation\"\n rowComponent={VirtualRow<T>}\n rowProps={{ items: allItems, isMultiple: multiple, renderItem }}\n rowCount={allItems.length}\n rowHeight={rowHeight}\n style={{ height: Math.min(rowHeight * allItems.length, 180) }}\n />\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":"A,yhBAwBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DmC,EAAOC,GAAA,EAAanC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKmC,GAAeC,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EqC,GAAUD,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DsC,EAAQF,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDuC,EAAUH,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DwC,EAAOJ,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAI,EAAG,MAAM,EACnDyC,EAAWL,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D0C,GAAaN,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,UAAU,EAAG,YAAY,EACrE2C,EAAUP,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EA0C5D4C,OACJ,EAAAf,EAAA,KAAA,CAAC,MAAD,CAA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EAAAA,mBAAD,CAEE,KAAM,CAAC,CAAC8C,EAAK,QACb,QAAS,IAAY,EAAArB,EAAA,IAAA,CAACxB,EAAAA,QAAD,CAAS,MAAO6C,EAAK,QAAU,UAAkB,CAAA,EAEtE,UAAA,EAAArB,EAAA,IAAA,CAACW,EAAD,CAA6B,OAC3B,UAAA,EAAAX,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAkB,OAAM,WAAYqD,CAAW,CAAA,CACxE,EAFKjD,EAAK,KAEV,CACY,EAPbA,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,C,EAEV,E"}
1
+ {"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","ConditionalWrapper","Tooltip","useUiLabels","useState","useMemo","debounce","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","Portal","List","require_slots","require_UiLabelsProvider","require_Tooltip","require_Text","require_ConditionalWrapper","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","_zag_js_utils","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","VirtualRow","items","index","ariaAttributes","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","loadedItems","setLoadedItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","filterText","setFilterText","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","filteredItems","withAutoFilter","text","matching","returnItemsOnEmpty","sourceItems","allItems","initialItems","valueKey","valueKeyOfFilter","setValueKeyOfFilter","listed","v","handleInputChange","details","onResetInitialItems","onInputValueChange","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from '@zag-js/utils'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { List, type RowComponentProps } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<\n ComboboxRootProps<T>,\n 'collection' | 'value' | 'defaultValue'\n> & {\n // Item values may be numbers: the chips compare them as strings.\n value?: Array<string | number>\n defaultValue?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\ninterface VirtualRowProps<Item extends ComboboxItem> {\n items: Item[]\n isMultiple: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\n// Declared at module level: react-window memoizes the row component by identity, so a\n// component created during render would remount every visible row on each render.\nfunction VirtualRow<Item extends ComboboxItem>({\n index,\n style,\n ariaAttributes,\n items,\n isMultiple,\n renderItem,\n}: RowComponentProps<VirtualRowProps<Item>>) {\n const item = items[index]\n\n return (\n <ConditionalWrapper when={!!item.tooltip} wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}>\n {/* Only the position attributes: the option keeps its role from Ark, not react-window's listitem. */}\n <Item\n item={item}\n style={style}\n aria-posinset={ariaAttributes['aria-posinset']}\n aria-setsize={ariaAttributes['aria-setsize']}\n >\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={isMultiple} />\n </Item>\n </ConditionalWrapper>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n defaultValue,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n onInputValueChange,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n // With `loadItems`, the list is what it returned last; the `items` prop only seeds it.\n const [loadedItems, setLoadedItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n // Without `loadItems`, the text the list is filtered on: the input's, as zag reports it.\n const [filterText, setFilterText] = useState('')\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setLoadedItems(newItems)\n } catch (error) {\n console.error(error)\n setLoadedItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // The list is derived from the `items` of this very render, never mirrored into state: zag\n // re-derives the input text from the collection as soon as `value` changes, so a value set in\n // the same render as the item that carries it must find that item in the collection already.\n // A mirror caught up one render late, and the input went blank.\n const filteredItems = useMemo(() => {\n if (!withAutoFilter || filterText === '') return itemsFromUsers\n const text = filterText.toLowerCase()\n const matching = itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(text))\n return matching.length === 0 && returnItemsOnEmpty ? itemsFromUsers : matching\n }, [itemsFromUsers, withAutoFilter, filterText, returnItemsOnEmpty])\n\n const sourceItems = asyncMode ? loadedItems : filteredItems\n const allItems = useMemo(() => [...sourceItems, ...(initialItems ?? [])], [sourceItems, initialItems])\n\n // A new `value` the typed text filters out (an item created from the empty state under\n // another name, a value the app sets) would still be stringified to nothing: drop the\n // filter for that render. zag then writes the label in the input, and the filter follows it.\n const valueKey = value?.map(String).join('\\n')\n const [valueKeyOfFilter, setValueKeyOfFilter] = useState(valueKey)\n if (valueKey !== valueKeyOfFilter) {\n setValueKeyOfFilter(valueKey)\n const listed = new Set(allItems.map(item => String(item.value)))\n if (!asyncMode && filterText !== '' && value?.some(v => !listed.has(String(v)))) {\n setFilterText('')\n }\n }\n\n // A caller's onInputValueChange runs as well: it no longer replaces the filter.\n const handleInputChange = (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n\n if (debouncedLoadItems) {\n debouncedLoadItems(details.inputValue)\n } else if (withAutoFilter) {\n setFilterText(details.inputValue)\n }\n onInputValueChange?.(details)\n }\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n defaultValue={defaultValue as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n // role=\"presentation\" overrides the list's own role=\"list\": the options must stay\n // owned by the listbox.\n <List\n role=\"presentation\"\n rowComponent={VirtualRow<T>}\n rowProps={{ items: allItems, isMultiple: multiple, renderItem }}\n rowCount={allItems.length}\n rowHeight={rowHeight}\n style={{ height: Math.min(rowHeight * allItems.length, 180) }}\n />\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":"A,yhBAwBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DmC,EAAOC,GAAA,EAAanC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKmC,GAAeC,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EqC,GAAUD,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DsC,EAAQF,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDuC,EAAUH,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DwC,EAAOJ,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAI,EAAG,MAAM,EACnDyC,EAAWL,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D0C,GAAaN,GAAA,EAAYrC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,UAAU,EAAG,YAAY,EACrE2C,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