@synertech/ui 0.46.1 → 0.46.2

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 (64) hide show
  1. package/dist/components/badge/Badge.cjs +1 -1
  2. package/dist/components/badge/Badge.js +1 -1
  3. package/dist/components/banner/Banner.cjs +1 -1
  4. package/dist/components/banner/Banner.js +1 -1
  5. package/dist/components/calendar/Calendar.cjs +1 -1
  6. package/dist/components/calendar/Calendar.js +1 -1
  7. package/dist/components/checkbox/Checkbox.cjs +1 -1
  8. package/dist/components/checkbox/Checkbox.js +1 -1
  9. package/dist/components/checkbox/CheckboxGroup.cjs +1 -1
  10. package/dist/components/checkbox/CheckboxGroup.js +1 -1
  11. package/dist/components/chip/Chip.cjs +1 -1
  12. package/dist/components/chip/Chip.js +1 -1
  13. package/dist/components/circular-progress/CircularProgress.cjs +1 -1
  14. package/dist/components/circular-progress/CircularProgress.js +1 -1
  15. package/dist/components/device-mockup/DeviceMockup.cjs +1 -1
  16. package/dist/components/device-mockup/DeviceMockup.js +1 -1
  17. package/dist/components/dropdown/DropdownItem.cjs +1 -1
  18. package/dist/components/dropdown/DropdownItem.js +1 -1
  19. package/dist/components/dropdown/DropdownRadio.cjs +1 -1
  20. package/dist/components/dropdown/DropdownRadio.js +1 -1
  21. package/dist/components/file-selector/FileSelector.cjs +1 -1
  22. package/dist/components/file-selector/FileSelector.js +1 -1
  23. package/dist/components/form/shared/inputStyles.cjs +1 -1
  24. package/dist/components/form/shared/inputStyles.js +1 -1
  25. package/dist/components/header/Header.cjs +1 -1
  26. package/dist/components/header/Header.js +1 -1
  27. package/dist/components/help-button/HelpButton.cjs +1 -1
  28. package/dist/components/help-button/HelpButton.js +1 -1
  29. package/dist/components/image-uploader/ImageUploader.cjs +1 -1
  30. package/dist/components/image-uploader/ImageUploader.js +1 -1
  31. package/dist/components/indicator/Indicator.cjs +1 -1
  32. package/dist/components/indicator/Indicator.js +1 -1
  33. package/dist/components/label/Label.cjs +1 -1
  34. package/dist/components/label/Label.js +1 -1
  35. package/dist/components/modal/Modal.cjs +1 -1
  36. package/dist/components/modal/Modal.js +1 -1
  37. package/dist/components/pagination/Pagination.cjs +1 -1
  38. package/dist/components/pagination/Pagination.js +1 -1
  39. package/dist/components/progress-bar/ProgressBar.cjs +1 -1
  40. package/dist/components/progress-bar/ProgressBar.js +1 -1
  41. package/dist/components/radio-button/RadioButton.cjs +1 -1
  42. package/dist/components/radio-button/RadioButton.js +1 -1
  43. package/dist/components/schema-editor/legend/SchemaLegend.cjs +1 -1
  44. package/dist/components/schema-editor/legend/SchemaLegend.js +1 -1
  45. package/dist/components/schema-editor/tables/SchemaTableRenderer.cjs +1 -1
  46. package/dist/components/schema-editor/tables/SchemaTableRenderer.js +1 -1
  47. package/dist/components/select/Select.cjs +1 -1
  48. package/dist/components/select/Select.js +1 -1
  49. package/dist/components/slider/Slider.cjs +1 -1
  50. package/dist/components/slider/Slider.js +1 -1
  51. package/dist/components/stat-card/StatCard.cjs +1 -1
  52. package/dist/components/stat-card/StatCard.js +1 -1
  53. package/dist/components/table/TableHeader.cjs +1 -1
  54. package/dist/components/table/TableHeader.js +1 -1
  55. package/dist/components/tabs/TabsTrigger.cjs +1 -1
  56. package/dist/components/tabs/TabsTrigger.js +1 -1
  57. package/dist/components/toast/Toast.cjs +1 -1
  58. package/dist/components/toast/Toast.js +1 -1
  59. package/dist/components/tooltip/Tooltip.cjs +1 -1
  60. package/dist/components/tooltip/Tooltip.js +1 -1
  61. package/dist/components/wizard/Wizard.cjs +1 -1
  62. package/dist/components/wizard/Wizard.js +1 -1
  63. package/dist/styles.css +56 -117
  64. package/package.json +2 -2
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of u(e))!k.call(t,d)&&d!==r&&g(t,d,{get:()=>e[d],enumerable:!(o=p(e,d))||o.enumerable});return t};var w=t=>c(g({},"__esModule",{value:!0}),t);var C={};y(C,{Badge:()=>b});module.exports=w(C);var l=require("../../lib/cn.cjs"),a=require("react/jsx-runtime"),f={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},m={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},h={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},B={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},R={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function b({children:t,color:e="default",size:r="md",variant:o="soft",dot:d=!1,icon:n,pill:i=!0,className:s,...x}){return(0,a.jsxs)("span",{className:(0,l.cn)("inline-flex items-center font-medium",h[r],i?"rounded-full":"rounded",f[e][o],s),...x,children:[d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0 rounded-full",B[r],m[e]),"aria-hidden":"true"}),n&&!d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0",R[r]),"aria-hidden":"true",children:n}),t]})}b.displayName="Badge";0&&(module.exports={Badge});
1
+ "use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var y=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of u(e))!k.call(t,d)&&d!==r&&g(t,d,{get:()=>e[d],enumerable:!(o=p(e,d))||o.enumerable});return t};var w=t=>c(g({},"__esModule",{value:!0}),t);var C={};y(C,{Badge:()=>b});module.exports=w(C);var l=require("../../lib/cn.cjs"),a=require("react/jsx-runtime"),f={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-700 text-white",soft:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-700 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-700 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-700 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-700 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-300"},teal:{solid:"bg-teal-700 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-700 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400"}},m={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},h={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},B={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},R={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function b({children:t,color:e="default",size:r="md",variant:o="soft",dot:d=!1,icon:n,pill:i=!0,className:s,...x}){return(0,a.jsxs)("span",{className:(0,l.cn)("inline-flex items-center font-medium",h[r],i?"rounded-full":"rounded",f[e][o],s),...x,children:[d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0 rounded-full",B[r],m[e]),"aria-hidden":"true"}),n&&!d&&(0,a.jsx)("span",{className:(0,l.cn)("shrink-0",R[r]),"aria-hidden":"true",children:n}),t]})}b.displayName="Badge";0&&(module.exports={Badge});
@@ -1 +1 @@
1
- import{cn as t}from"../../lib/cn.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var s={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-600 text-white",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-600 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-600 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-600 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-600 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-600 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-600 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-400"},teal:{solid:"bg-teal-600 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-600 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-600 dark:bg-teal-900/30 dark:text-teal-400"}},x={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},p={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},u={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},k={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function y({children:l,color:r="default",size:e="md",variant:g="soft",dot:d=!1,icon:a,pill:n=!0,className:b,...i}){return c("span",{className:t("inline-flex items-center font-medium",p[e],n?"rounded-full":"rounded",s[r][g],b),...i,children:[d&&o("span",{className:t("shrink-0 rounded-full",u[e],x[r]),"aria-hidden":"true"}),a&&!d&&o("span",{className:t("shrink-0",k[e]),"aria-hidden":"true",children:a}),l]})}y.displayName="Badge";export{y as Badge};
1
+ import{cn as t}from"../../lib/cn.js";import{jsx as o,jsxs as c}from"react/jsx-runtime";var s={default:{solid:"bg-gray-500 text-white",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",outlined:"border border-gray-300 text-gray-600 dark:border-gray-600 dark:text-gray-400",subtle:"bg-gray-50 text-gray-600 dark:bg-gray-800 dark:text-gray-400"},primary:{solid:"bg-blue-600 text-white",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",outlined:"border border-blue-500 text-blue-600 dark:border-blue-400 dark:text-blue-400",subtle:"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"},success:{solid:"bg-green-700 text-white",soft:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-300",outlined:"border border-green-500 text-green-700 dark:border-green-400 dark:text-green-400",subtle:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-400"},warning:{solid:"bg-yellow-500 text-gray-900",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",outlined:"border border-yellow-400 text-yellow-700 dark:border-yellow-400 dark:text-yellow-400",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400"},error:{solid:"bg-red-600 text-white",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",outlined:"border border-red-500 text-red-600 dark:border-red-400 dark:text-red-400",subtle:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-400"},info:{solid:"bg-cyan-700 text-white",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",outlined:"border border-cyan-500 text-cyan-700 dark:border-cyan-400 dark:text-cyan-400",subtle:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400"},purple:{solid:"bg-purple-600 text-white",soft:"bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300",outlined:"border border-purple-500 text-purple-600 dark:border-purple-400 dark:text-purple-400",subtle:"bg-purple-50 text-purple-600 dark:bg-purple-900/30 dark:text-purple-400"},indigo:{solid:"bg-indigo-600 text-white",soft:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/50 dark:text-indigo-300",outlined:"border border-indigo-500 text-indigo-600 dark:border-indigo-400 dark:text-indigo-400",subtle:"bg-indigo-50 text-indigo-600 dark:bg-indigo-900/30 dark:text-indigo-300"},teal:{solid:"bg-teal-700 text-white",soft:"bg-teal-100 text-teal-700 dark:bg-teal-900/50 dark:text-teal-300",outlined:"border border-teal-500 text-teal-700 dark:border-teal-400 dark:text-teal-400",subtle:"bg-teal-50 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400"}},x={default:"bg-gray-500",primary:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-400",error:"bg-red-500",info:"bg-cyan-500",purple:"bg-purple-500",indigo:"bg-indigo-500",teal:"bg-teal-500"},p={sm:"text-[10px] px-1.5 py-0.5 gap-1",md:"text-xs px-2 py-0.5 gap-1",lg:"text-sm px-2.5 py-1 gap-1.5"},u={sm:"w-1.5 h-1.5",md:"w-1.5 h-1.5",lg:"w-2 h-2"},k={sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5"};function y({children:l,color:r="default",size:e="md",variant:g="soft",dot:d=!1,icon:a,pill:n=!0,className:b,...i}){return c("span",{className:t("inline-flex items-center font-medium",p[e],n?"rounded-full":"rounded",s[r][g],b),...i,children:[d&&o("span",{className:t("shrink-0 rounded-full",u[e],x[r]),"aria-hidden":"true"}),a&&!d&&o("span",{className:t("shrink-0",k[e]),"aria-hidden":"true",children:a}),l]})}y.displayName="Badge";export{y as Badge};
@@ -1 +1 @@
1
- "use strict";"use client";var k=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var R=(t,r)=>{for(var o in r)k(t,o,{get:r[o],enumerable:!0})},P=(t,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of M(r))!I.call(t,n)&&n!==o&&k(t,n,{get:()=>r[n],enumerable:!(s=L(r,n))||s.enumerable});return t};var W=t=>P(k({},"__esModule",{value:!0}),t);var U={};R(U,{Banner:()=>B});module.exports=W(U);var h=require("react"),a=require("../../lib/cn.cjs"),w=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function y({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function V({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function H({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function T({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var j={info:y,success:V,warning:H,error:T,default:y},O={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},Z={info:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function z({type:t="default",title:r,description:o,children:s,icon:n,action:i,closable:d=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=(0,h.useState)(!0),v=(0,w.useUILabels)();if(!f)return null;let l=()=>{p(!1),u?.()},x=j[t],N=s??o;return(0,e.jsxs)("div",{role:"alert",className:(0,a.cn)("flex items-start gap-3 border px-4 py-3",g?"w-full":"rounded-lg",O[t],b),...m,children:[(0,e.jsx)("div",{className:(0,a.cn)("shrink-0 mt-0.5",Z[t]),children:n??(0,e.jsx)(x,{className:"w-5 h-5"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[r&&(0,e.jsx)("div",{className:"font-semibold text-sm",children:r}),N&&(0,e.jsx)("div",{className:(0,a.cn)("text-sm",r?"mt-1 opacity-90":!1),children:N}),i&&(0,e.jsx)("div",{className:"mt-3",children:i})]}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":c??v.bannerClose,children:(0,e.jsx)(C,{className:"w-4 h-4"})})]})}function S({title:t,description:r,children:o,action:s,backgroundImage:n,closable:i=!1,closeLabel:d,onClose:c,fullWidth:u=!1,className:g,...b}){let[m,f]=(0,h.useState)(!0),p=(0,w.useUILabels)();if(!m)return null;let v=()=>{f(!1),c?.()},l=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative overflow-hidden bg-gray-900 text-white",u?"w-full":"rounded-xl","py-12 px-6 sm:px-12",g),style:n?{backgroundImage:`url(${n})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...b,children:[n&&(0,e.jsx)("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&(0,e.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),l&&(0,e.jsx)("div",{className:(0,a.cn)("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:l}),s&&(0,e.jsx)("div",{className:"mt-6",children:s})]}),i&&(0,e.jsx)("button",{type:"button",onClick:v,className:(0,a.cn)("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":d??p.bannerClose,children:(0,e.jsx)(C,{className:"w-5 h-5"})})]})}function E({title:t,description:r,children:o,icon:s,action:n,badge:i,closable:d=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=(0,h.useState)(!0),v=(0,w.useUILabels)();if(!f)return null;let l=()=>{p(!1),u?.()},x=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",g?"w-full":"rounded-lg",b),...m,children:[s&&(0,e.jsx)("div",{className:"shrink-0",children:s}),i&&(0,e.jsx)("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:i}),(0,e.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&(0,e.jsx)("span",{className:"font-semibold text-sm",children:t}),x&&(0,e.jsx)("span",{className:"text-sm opacity-90",children:x})]}),n&&(0,e.jsx)("div",{className:"shrink-0",children:n}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":c??v.bannerClose,children:(0,e.jsx)(C,{className:"w-4 h-4"})})]})}function B({variant:t="notification",...r}){switch(t){case"hero":return(0,e.jsx)(S,{...r});case"promotion":return(0,e.jsx)(E,{...r});default:return(0,e.jsx)(z,{...r})}}B.displayName="Banner";0&&(module.exports={Banner});
1
+ "use strict";"use client";var k=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var R=(t,r)=>{for(var o in r)k(t,o,{get:r[o],enumerable:!0})},P=(t,r,o,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of M(r))!I.call(t,n)&&n!==o&&k(t,n,{get:()=>r[n],enumerable:!(s=L(r,n))||s.enumerable});return t};var W=t=>P(k({},"__esModule",{value:!0}),t);var U={};R(U,{Banner:()=>B});module.exports=W(U);var h=require("react"),a=require("../../lib/cn.cjs"),w=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function y({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function V({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function H({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function T({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var j={info:y,success:V,warning:H,error:T,default:y},O={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},Z={info:"text-blue-600 dark:text-blue-400",success:"text-green-700 dark:text-green-400",warning:"text-yellow-700 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function z({type:t="default",title:r,description:o,children:s,icon:n,action:i,closable:d=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=(0,h.useState)(!0),v=(0,w.useUILabels)();if(!f)return null;let l=()=>{p(!1),u?.()},x=j[t],N=s??o;return(0,e.jsxs)("div",{role:"alert",className:(0,a.cn)("flex items-start gap-3 border px-4 py-3",g?"w-full":"rounded-lg",O[t],b),...m,children:[(0,e.jsx)("div",{className:(0,a.cn)("shrink-0 mt-0.5",Z[t]),children:n??(0,e.jsx)(x,{className:"w-5 h-5"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[r&&(0,e.jsx)("div",{className:"font-semibold text-sm",children:r}),N&&(0,e.jsx)("div",{className:(0,a.cn)("text-sm",r?"mt-1 opacity-90":!1),children:N}),i&&(0,e.jsx)("div",{className:"mt-3",children:i})]}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":c??v.bannerClose,children:(0,e.jsx)(C,{className:"w-4 h-4"})})]})}function S({title:t,description:r,children:o,action:s,backgroundImage:n,closable:i=!1,closeLabel:d,onClose:c,fullWidth:u=!1,className:g,...b}){let[m,f]=(0,h.useState)(!0),p=(0,w.useUILabels)();if(!m)return null;let v=()=>{f(!1),c?.()},l=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative overflow-hidden bg-gray-900 text-white",u?"w-full":"rounded-xl","py-12 px-6 sm:px-12",g),style:n?{backgroundImage:`url(${n})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...b,children:[n&&(0,e.jsx)("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&(0,e.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),l&&(0,e.jsx)("div",{className:(0,a.cn)("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:l}),s&&(0,e.jsx)("div",{className:"mt-6",children:s})]}),i&&(0,e.jsx)("button",{type:"button",onClick:v,className:(0,a.cn)("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":d??p.bannerClose,children:(0,e.jsx)(C,{className:"w-5 h-5"})})]})}function E({title:t,description:r,children:o,icon:s,action:n,badge:i,closable:d=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=(0,h.useState)(!0),v=(0,w.useUILabels)();if(!f)return null;let l=()=>{p(!1),u?.()},x=o??r;return(0,e.jsxs)("div",{className:(0,a.cn)("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",g?"w-full":"rounded-lg",b),...m,children:[s&&(0,e.jsx)("div",{className:"shrink-0",children:s}),i&&(0,e.jsx)("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:i}),(0,e.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&(0,e.jsx)("span",{className:"font-semibold text-sm",children:t}),x&&(0,e.jsx)("span",{className:"text-sm opacity-90",children:x})]}),n&&(0,e.jsx)("div",{className:"shrink-0",children:n}),d&&(0,e.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":c??v.bannerClose,children:(0,e.jsx)(C,{className:"w-4 h-4"})})]})}function B({variant:t="notification",...r}){switch(t){case"hero":return(0,e.jsx)(S,{...r});case"promotion":return(0,e.jsx)(E,{...r});default:return(0,e.jsx)(z,{...r})}}B.displayName="Banner";0&&(module.exports={Banner});
@@ -1 +1 @@
1
- "use client";import{useState as w}from"react";import{cn as n}from"../../lib/cn.js";import{useUILabels as k}from"../../lib/i18n.js";import{jsx as e,jsxs as l}from"react/jsx-runtime";function y({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function B({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function L({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function M({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return e("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var I={info:y,success:B,warning:L,error:M,default:y},R={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},P={info:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function W({type:t="default",title:r,description:d,children:s,icon:o,action:a,closable:c=!1,closeLabel:u,onClose:g,fullWidth:b=!1,className:m,...f}){let[p,v]=w(!0),x=k();if(!p)return null;let i=()=>{v(!1),g?.()},h=I[t],N=s??d;return l("div",{role:"alert",className:n("flex items-start gap-3 border px-4 py-3",b?"w-full":"rounded-lg",R[t],m),...f,children:[e("div",{className:n("shrink-0 mt-0.5",P[t]),children:o??e(h,{className:"w-5 h-5"})}),l("div",{className:"flex-1 min-w-0",children:[r&&e("div",{className:"font-semibold text-sm",children:r}),N&&e("div",{className:n("text-sm",r?"mt-1 opacity-90":!1),children:N}),a&&e("div",{className:"mt-3",children:a})]}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":u??x.bannerClose,children:e(C,{className:"w-4 h-4"})})]})}function V({title:t,description:r,children:d,action:s,backgroundImage:o,closable:a=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=w(!0),v=k();if(!f)return null;let x=()=>{p(!1),u?.()},i=d??r;return l("div",{className:n("relative overflow-hidden bg-gray-900 text-white",g?"w-full":"rounded-xl","py-12 px-6 sm:px-12",b),style:o?{backgroundImage:`url(${o})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...m,children:[o&&e("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),l("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&e("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),i&&e("div",{className:n("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:i}),s&&e("div",{className:"mt-6",children:s})]}),a&&e("button",{type:"button",onClick:x,className:n("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":c??v.bannerClose,children:e(C,{className:"w-5 h-5"})})]})}function H({title:t,description:r,children:d,icon:s,action:o,badge:a,closable:c=!1,closeLabel:u,onClose:g,fullWidth:b=!1,className:m,...f}){let[p,v]=w(!0),x=k();if(!p)return null;let i=()=>{v(!1),g?.()},h=d??r;return l("div",{className:n("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",b?"w-full":"rounded-lg",m),...f,children:[s&&e("div",{className:"shrink-0",children:s}),a&&e("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:a}),l("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&e("span",{className:"font-semibold text-sm",children:t}),h&&e("span",{className:"text-sm opacity-90",children:h})]}),o&&e("div",{className:"shrink-0",children:o}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":u??x.bannerClose,children:e(C,{className:"w-4 h-4"})})]})}function T({variant:t="notification",...r}){switch(t){case"hero":return e(V,{...r});case"promotion":return e(H,{...r});default:return e(W,{...r})}}T.displayName="Banner";export{T as Banner};
1
+ "use client";import{useState as w}from"react";import{cn as n}from"../../lib/cn.js";import{useUILabels as k}from"../../lib/i18n.js";import{jsx as e,jsxs as l}from"react/jsx-runtime";function y({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M13 16H12V12H11M12 8H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function B({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M9 12L11 14L15 10M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function L({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 9V13M12 17H12.01M10.29 3.86L1.82 18C1.65 18.3 1.55 18.65 1.55 18.99C1.55 19.34 1.64 19.69 1.81 19.99C1.99 20.29 2.24 20.55 2.54 20.72C2.84 20.901 3.18 20.99 3.53 21H20.47C20.82 20.99 21.16 20.901 21.46 20.72C21.76 20.55 22.01 20.29 22.19 19.99C22.36 19.69 22.449 19.34 22.448 18.99C22.447 18.65 22.35 18.3 22.18 18L13.71 3.86C13.53 3.57 13.28 3.32 12.98 3.15C12.68 2.99 12.34 2.9 12 2.9C11.66 2.9 11.32 2.99 11.02 3.15C10.72 3.32 10.47 3.57 10.29 3.86Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function M({className:t}){return e("svg",{className:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M12 8V12M12 16H12.01M21 12C21 16.97 16.97 21 12 21C7.03 21 3 16.97 3 12C3 7.03 7.03 3 12 3C16.97 3 21 7.03 21 12Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function C({className:t}){return e("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var I={info:y,success:B,warning:L,error:M,default:y},R={info:"bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-300 dark:border-blue-800",success:"bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-300 dark:border-green-800",warning:"bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-300 dark:border-yellow-800",error:"bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-300 dark:border-red-800",default:"bg-gray-50 text-gray-800 border-gray-200 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-700"},P={info:"text-blue-600 dark:text-blue-400",success:"text-green-700 dark:text-green-400",warning:"text-yellow-700 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",default:"text-gray-600 dark:text-gray-400"};function W({type:t="default",title:r,description:d,children:s,icon:o,action:a,closable:c=!1,closeLabel:u,onClose:g,fullWidth:b=!1,className:m,...f}){let[p,v]=w(!0),x=k();if(!p)return null;let i=()=>{v(!1),g?.()},h=I[t],N=s??d;return l("div",{role:"alert",className:n("flex items-start gap-3 border px-4 py-3",b?"w-full":"rounded-lg",R[t],m),...f,children:[e("div",{className:n("shrink-0 mt-0.5",P[t]),children:o??e(h,{className:"w-5 h-5"})}),l("div",{className:"flex-1 min-w-0",children:[r&&e("div",{className:"font-semibold text-sm",children:r}),N&&e("div",{className:n("text-sm",r?"mt-1 opacity-90":!1),children:N}),a&&e("div",{className:"mt-3",children:a})]}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 transition-colors","hover:bg-black/10 dark:hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-current"),"aria-label":u??x.bannerClose,children:e(C,{className:"w-4 h-4"})})]})}function V({title:t,description:r,children:d,action:s,backgroundImage:o,closable:a=!1,closeLabel:c,onClose:u,fullWidth:g=!1,className:b,...m}){let[f,p]=w(!0),v=k();if(!f)return null;let x=()=>{p(!1),u?.()},i=d??r;return l("div",{className:n("relative overflow-hidden bg-gray-900 text-white",g?"w-full":"rounded-xl","py-12 px-6 sm:px-12",b),style:o?{backgroundImage:`url(${o})`,backgroundSize:"cover",backgroundPosition:"center"}:void 0,...m,children:[o&&e("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),l("div",{className:"relative z-10 max-w-3xl mx-auto text-center",children:[t&&e("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight",children:t}),i&&e("div",{className:n("text-base sm:text-lg opacity-90",t?"mt-4":!1),children:i}),s&&e("div",{className:"mt-6",children:s})]}),a&&e("button",{type:"button",onClick:x,className:n("absolute top-4 right-4 z-10 rounded-md p-1.5 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":c??v.bannerClose,children:e(C,{className:"w-5 h-5"})})]})}function H({title:t,description:r,children:d,icon:s,action:o,badge:a,closable:c=!1,closeLabel:u,onClose:g,fullWidth:b=!1,className:m,...f}){let[p,v]=w(!0),x=k();if(!p)return null;let i=()=>{v(!1),g?.()},h=d??r;return l("div",{className:n("relative flex items-center gap-4 bg-linear-to-r from-indigo-600 to-purple-600 text-white px-4 py-3",b?"w-full":"rounded-lg",m),...f,children:[s&&e("div",{className:"shrink-0",children:s}),a&&e("span",{className:"shrink-0 inline-flex items-center rounded-full bg-white/20 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wide",children:a}),l("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-x-4 gap-y-1",children:[t&&e("span",{className:"font-semibold text-sm",children:t}),h&&e("span",{className:"text-sm opacity-90",children:h})]}),o&&e("div",{className:"shrink-0",children:o}),c&&e("button",{type:"button",onClick:i,className:n("shrink-0 rounded-md p-1 text-white/80 transition-colors","hover:text-white hover:bg-white/10","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white"),"aria-label":u??x.bannerClose,children:e(C,{className:"w-4 h-4"})})]})}function T({variant:t="notification",...r}){switch(t){case"hero":return e(V,{...r});case"promotion":return e(H,{...r});default:return e(W,{...r})}}T.displayName="Banner";export{T as Banner};
@@ -1 +1 @@
1
- "use strict";"use client";var se=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var et=(e,a)=>{for(var s in a)se(e,s,{get:a[s],enumerable:!0})},tt=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Xe(a))!Ze.call(e,D)&&D!==s&&se(e,D,{get:()=>a[D],enumerable:!(F=Qe(a,D))||F.enumerable});return e};var at=e=>tt(se({},"__esModule",{value:!0}),e);var bt={};et(bt,{Calendar:()=>ft});module.exports=at(bt);var l=require("react"),c=require("../../lib/cn.cjs"),we=require("../../lib/i18n.cjs"),n=require("react/jsx-runtime"),rt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function V(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function x(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function de(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function ie(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function E(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function J(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function nt(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/rt)}function xe(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function ot(e,a,s){let F=V(e),D=(F.getDay()-a+7)%7,_=T(F,-D),j=s?6:Math.ceil((D+de(e))/7);return Array.from({length:j},(X,G)=>Array.from({length:7},(ue,L)=>T(_,G*7+L)))}function lt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function st({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var it={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},dt={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},ut={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},ct={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},gt={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},z={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Q(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function ke(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ft(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:_,month:j,defaultMonth:X,onMonthChange:G,numberOfMonths:ue=1,weekStartsOn:L=0,locale:R,size:Ce="md",color:v="primary",minDate:k,maxDate:w,disabledDates:O,disabled:y=!1,showOutsideDays:Me=!0,showWeekNumbers:ce=!1,fixedWeeks:Se=!1,captionLayout:Z="label",fromYear:ge,toYear:fe,todayButton:ee=!1,clearButton:te=!1,footer:be,bordered:Ne=!0,renderDay:ye,labels:B,className:Fe,...Re}=e,I=(0,we.useUILabels)(),h=it[Ce],C=Math.max(1,ue),Y=(0,l.useMemo)(()=>g(new Date),[]),ae=s!==void 0,[Ye,Pe]=(0,l.useState)(()=>Q(a,F)),A=ae?Q(a,s):Ye,re=j!==void 0,[Te,Le]=(0,l.useState)(()=>V(X??ke(Q(a,F??s))??new Date)),f=re?V(j):Te,p=(0,l.useCallback)(t=>{let r=V(t);re||Le(r),G?.(r)},[re,G]),me=(0,l.useRef)(null),ne=(0,l.useRef)(!1),[W,U]=(0,l.useState)(()=>{let t=ke(Q(a,F??s)),r=V(X??j??t??new Date),u=t&&ie(t,r)?t:ie(g(new Date),r)?g(new Date):r;return xe(u,k,w)}),Ae=x(f,C-1),Ee=E(W,f)>=0&&E(W,Ae)<=0?W:f;(0,l.useEffect)(()=>{if(!ne.current)return;ne.current=!1,me.current?.querySelector(`[data-day="${J(W)}"]:not([data-outside])`)?.focus()},[W,f]);let P=(0,l.useCallback)(t=>{let r=xe(g(t),k,w);ne.current=!0,U(r);let u=x(f,C-1);E(r,f)<0?p(r):E(r,u)>0&&p(x(r,-(C-1)))},[f,C,k,w,p]),K=(0,l.useCallback)(t=>y||k&&t<g(k)||w&&t>g(w)?!0:typeof O=="function"?O(t):Array.isArray(O)?O.some(r=>N(r,t)):!1,[y,k,w,O]),[oe,he]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{ae||Pe(t),D?.(t)},[ae,D]),q=(0,l.useCallback)(t=>{let r=g(t);if(K(r))return;if(a==="multiple"){let i=A??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(_!==void 0&&i.length>=_)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=A??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(A,r)?null:r)},[a,A,_,M,K]),Be=(0,l.useCallback)(t=>{q(t),U(g(t)),E(t,f)<0?p(t):E(t,x(f,C-1))>0&&p(x(t,-(C-1)))},[q,f,C,p]),pe=!y&&(!k||E(f,V(k))>0),De=!y&&(!w||E(x(f,C-1),V(w))<0),Ie=(0,l.useCallback)(()=>{p(x(f,-1))},[f,p]),We=(0,l.useCallback)(()=>{p(x(f,1))},[f,p]),ze=(0,l.useCallback)(t=>{if(y)return;let r=W;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-L+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-L+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=x(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=x(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,W,P,L]),Ve=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(L+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,L]),Ke=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),ve=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),_e=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),je=(0,l.useMemo)(()=>{if(Z!=="dropdown")return[];let t=Y.getFullYear(),r=ge??k?.getFullYear()??t-100,u=fe??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[Z,ge,fe,k,w,Y]),S=a==="range"?A:null,Oe=S&&S.from&&!S.to&&oe&&oe>S.from?oe:null,$=S?.to??Oe,$e=(0,l.useCallback)((t,r)=>{let u=!ie(t,r),i=K(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(A??[]).some(H=>N(H,t)):a==="range"?(o=N(S?.from,t),b=N($,t),m=o||b,d=!!(S?.from&&$&&t>S.from&&t<$)):m=N(A,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,A,S,$,K,Y]),He=t=>{let r=x(f,t),u=ot(r,L,Se),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Ie,disabled:!pe,"aria-label":B?.previousMonth??I.calendarPreviousMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.nav,!pe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(lt,{className:h.icon})}),Z==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":B?.monthSelect??I.calendarMonth,value:r.getMonth(),disabled:y,onChange:o=>p(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[v],h.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":B?.yearSelect??I.calendarYear,value:r.getFullYear(),disabled:y,onChange:o=>p(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[v],h.select,y&&"cursor-not-allowed opacity-50"),children:je.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",h.caption),children:ve.format(r)}),(0,n.jsx)("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.nextMonth??I.calendarNextMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(st,{className:h.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":ve.format(r),onKeyDown:ze,className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ce&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",h.head),children:[(0,n.jsx)("span",{className:"sr-only",children:B?.weekNumber??I.calendarWeekNumber}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),Ve.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",h.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ce&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",h.head),children:nt(o[0])}),o.map(b=>{let d=$e(b,r),H=J(b);if(d.outside&&!Me)return(0,n.jsx)("td",{className:"p-0"},H);let Je=N(b,Ee)&&!d.outside,le=d.inRange||d.rangeStart&&!!$||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",le&&ut[v],le&&d.rangeStart&&"rounded-l-full",le&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":H,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Je?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":_e.format(b),onClick:()=>{d.disabled||Be(b)},onMouseEnter:()=>a==="range"&&he(g(b)),onMouseLeave:()=>a==="range"&&he(null),onFocus:()=>U(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[v],h.day,d.selected?dt[v]:d.inRange?(0,c.cn)(ct[v],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(gt[v],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:ye?ye(b,d):b.getDate()})},H)})]},J(o[0])))})]})]},J(r))},Ge=(0,l.useCallback)(()=>{p(Y),U(Y),K(Y)||q(Y)},[Y,p,K,q]),Ue=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),qe=!!be||ee||te;return(0,n.jsxs)("div",{ref:me,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Ne&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",h.padding,y&&"opacity-60",Fe),...Re,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",h.gap),children:Array.from({length:C},(t,r)=>He(r))}),qe&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",h.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:be}),(ee||te)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[ee&&(0,n.jsx)("button",{type:"button",onClick:Ge,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[v],y&&"cursor-not-allowed opacity-50"),children:B?.today??I.calendarToday}),te&&(0,n.jsx)("button",{type:"button",onClick:Ue,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[v],y&&"cursor-not-allowed opacity-50"),children:B?.clear??I.calendarClear})]})]})]})}0&&(module.exports={Calendar});
1
+ "use strict";"use client";var se=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var et=(e,a)=>{for(var s in a)se(e,s,{get:a[s],enumerable:!0})},tt=(e,a,s,F)=>{if(a&&typeof a=="object"||typeof a=="function")for(let D of Xe(a))!Ze.call(e,D)&&D!==s&&se(e,D,{get:()=>a[D],enumerable:!(F=Qe(a,D))||F.enumerable});return e};var at=e=>tt(se({},"__esModule",{value:!0}),e);var bt={};et(bt,{Calendar:()=>ft});module.exports=at(bt);var l=require("react"),c=require("../../lib/cn.cjs"),we=require("../../lib/i18n.cjs"),n=require("react/jsx-runtime"),rt=10080*60*1e3;function g(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function V(e){return new Date(e.getFullYear(),e.getMonth(),1)}function T(e,a){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+a)}function v(e,a){return new Date(e.getFullYear(),e.getMonth()+a,1)}function de(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function N(e,a){return!e||!a?!1:e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function ie(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()}function E(e,a){return e.getFullYear()*12+e.getMonth()-(a.getFullYear()*12+a.getMonth())}function J(e){let a=`${e.getMonth()+1}`.padStart(2,"0"),s=`${e.getDate()}`.padStart(2,"0");return`${e.getFullYear()}-${a}-${s}`}function nt(e){let a=g(e);a.setDate(a.getDate()-(a.getDay()+6)%7+3);let s=new Date(a.getFullYear(),0,4);return s.setDate(s.getDate()-(s.getDay()+6)%7+3),1+Math.round((a.getTime()-s.getTime())/rt)}function ve(e,a,s){return a&&e<g(a)?g(a):s&&e>g(s)?g(s):e}function ot(e,a,s){let F=V(e),D=(F.getDay()-a+7)%7,_=T(F,-D),j=s?6:Math.ceil((D+de(e))/7);return Array.from({length:j},(X,G)=>Array.from({length:7},(ue,L)=>T(_,G*7+L)))}function lt({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function st({className:e}){return(0,n.jsx)("svg",{className:e,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var it={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},dt={primary:"bg-blue-600 text-white hover:bg-blue-700",success:"bg-green-700 text-white hover:bg-green-800",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700",info:"bg-cyan-700 text-white hover:bg-cyan-800",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},ut={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},ct={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},gt={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-700 dark:text-green-400",warning:"font-semibold text-yellow-700 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-700 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},z={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function Q(e,a){if(e==="multiple")return Array.isArray(a)?a.map(g):[];if(e==="range"){let s=a??null;return{from:s?.from?g(s.from):null,to:s?.to?g(s.to):null}}return a instanceof Date?g(a):null}function ke(e){return e?e instanceof Date?e:Array.isArray(e)?e[0]??null:e.from??e.to??null:null}function ft(e){let{mode:a="single",value:s,defaultValue:F,onChange:D,max:_,month:j,defaultMonth:X,onMonthChange:G,numberOfMonths:ue=1,weekStartsOn:L=0,locale:R,size:Ce="md",color:x="primary",minDate:k,maxDate:w,disabledDates:O,disabled:y=!1,showOutsideDays:Me=!0,showWeekNumbers:ce=!1,fixedWeeks:Se=!1,captionLayout:Z="label",fromYear:ge,toYear:fe,todayButton:ee=!1,clearButton:te=!1,footer:be,bordered:Ne=!0,renderDay:ye,labels:B,className:Fe,...Re}=e,I=(0,we.useUILabels)(),p=it[Ce],C=Math.max(1,ue),Y=(0,l.useMemo)(()=>g(new Date),[]),ae=s!==void 0,[Ye,Pe]=(0,l.useState)(()=>Q(a,F)),A=ae?Q(a,s):Ye,re=j!==void 0,[Te,Le]=(0,l.useState)(()=>V(X??ke(Q(a,F??s))??new Date)),f=re?V(j):Te,h=(0,l.useCallback)(t=>{let r=V(t);re||Le(r),G?.(r)},[re,G]),me=(0,l.useRef)(null),ne=(0,l.useRef)(!1),[W,U]=(0,l.useState)(()=>{let t=ke(Q(a,F??s)),r=V(X??j??t??new Date),u=t&&ie(t,r)?t:ie(g(new Date),r)?g(new Date):r;return ve(u,k,w)}),Ae=v(f,C-1),Ee=E(W,f)>=0&&E(W,Ae)<=0?W:f;(0,l.useEffect)(()=>{if(!ne.current)return;ne.current=!1,me.current?.querySelector(`[data-day="${J(W)}"]:not([data-outside])`)?.focus()},[W,f]);let P=(0,l.useCallback)(t=>{let r=ve(g(t),k,w);ne.current=!0,U(r);let u=v(f,C-1);E(r,f)<0?h(r):E(r,u)>0&&h(v(r,-(C-1)))},[f,C,k,w,h]),K=(0,l.useCallback)(t=>y||k&&t<g(k)||w&&t>g(w)?!0:typeof O=="function"?O(t):Array.isArray(O)?O.some(r=>N(r,t)):!1,[y,k,w,O]),[oe,pe]=(0,l.useState)(null),M=(0,l.useCallback)(t=>{ae||Pe(t),D?.(t)},[ae,D]),q=(0,l.useCallback)(t=>{let r=g(t);if(K(r))return;if(a==="multiple"){let i=A??[];if(i.some(o=>N(o,r))){M(i.filter(o=>!N(o,r)));return}if(_!==void 0&&i.length>=_)return;M([...i,r].sort((o,b)=>o.getTime()-b.getTime()));return}if(a==="range"){let i=A??{from:null,to:null};if(!i.from||i.to){M({from:r,to:null});return}M(r<i.from?{from:r,to:i.from}:{from:i.from,to:r});return}M(N(A,r)?null:r)},[a,A,_,M,K]),Be=(0,l.useCallback)(t=>{q(t),U(g(t)),E(t,f)<0?h(t):E(t,v(f,C-1))>0&&h(v(t,-(C-1)))},[q,f,C,h]),he=!y&&(!k||E(f,V(k))>0),De=!y&&(!w||E(v(f,C-1),V(w))<0),Ie=(0,l.useCallback)(()=>{h(v(f,-1))},[f,h]),We=(0,l.useCallback)(()=>{h(v(f,1))},[f,h]),ze=(0,l.useCallback)(t=>{if(y)return;let r=W;switch(t.key){case"ArrowLeft":t.preventDefault(),P(T(r,-1));break;case"ArrowRight":t.preventDefault(),P(T(r,1));break;case"ArrowUp":t.preventDefault(),P(T(r,-7));break;case"ArrowDown":t.preventDefault(),P(T(r,7));break;case"Home":t.preventDefault(),P(T(r,-((r.getDay()-L+7)%7)));break;case"End":t.preventDefault(),P(T(r,6-(r.getDay()-L+7)%7));break;case"PageUp":{t.preventDefault();let u=t.shiftKey?-12:-1,i=v(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}case"PageDown":{t.preventDefault();let u=t.shiftKey?12:1,i=v(r,u),m=Math.min(r.getDate(),de(i));P(new Date(i.getFullYear(),i.getMonth(),m));break}default:break}},[y,W,P,L]),Ve=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{weekday:"short"}),r=new Intl.DateTimeFormat(R,{weekday:"long"}),u=new Date(2024,0,7);return Array.from({length:7},(i,m)=>{let o=T(u,(L+m)%7);return{short:t.format(o),long:r.format(o)}})},[R,L]),Ke=(0,l.useMemo)(()=>{let t=new Intl.DateTimeFormat(R,{month:"long"});return Array.from({length:12},(r,u)=>t.format(new Date(2024,u,1)))},[R]),xe=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{month:"long",year:"numeric"}),[R]),_e=(0,l.useMemo)(()=>new Intl.DateTimeFormat(R,{dateStyle:"full"}),[R]),je=(0,l.useMemo)(()=>{if(Z!=="dropdown")return[];let t=Y.getFullYear(),r=ge??k?.getFullYear()??t-100,u=fe??w?.getFullYear()??t+10;return u<r?[r]:Array.from({length:u-r+1},(i,m)=>r+m)},[Z,ge,fe,k,w,Y]),S=a==="range"?A:null,Oe=S&&S.from&&!S.to&&oe&&oe>S.from?oe:null,$=S?.to??Oe,$e=(0,l.useCallback)((t,r)=>{let u=!ie(t,r),i=K(t),m=!1,o=!1,b=!1,d=!1;return a==="multiple"?m=(A??[]).some(H=>N(H,t)):a==="range"?(o=N(S?.from,t),b=N($,t),m=o||b,d=!!(S?.from&&$&&t>S.from&&t<$)):m=N(A,t),{selected:m,today:N(t,Y),outside:u,disabled:i,rangeStart:o,rangeEnd:b,inRange:d}},[a,A,S,$,K,Y]),He=t=>{let r=v(f,t),u=ot(r,L,Se),i=t===0,m=t===C-1;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,n.jsx)("button",{type:"button",onClick:Ie,disabled:!he,"aria-label":B?.previousMonth??I.calendarPreviousMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],p.nav,!he&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!i&&"invisible"),children:(0,n.jsx)(lt,{className:p.icon})}),Z==="dropdown"?(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("select",{"aria-label":B?.monthSelect??I.calendarMonth,value:r.getMonth(),disabled:y,onChange:o=>h(new Date(r.getFullYear(),Number(o.target.value)-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[x],p.select,y&&"cursor-not-allowed opacity-50"),children:Ke.map((o,b)=>(0,n.jsx)("option",{value:b,children:o},o))}),(0,n.jsx)("select",{"aria-label":B?.yearSelect??I.calendarYear,value:r.getFullYear(),disabled:y,onChange:o=>h(new Date(Number(o.target.value),r.getMonth()-t,1)),className:(0,c.cn)("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",z[x],p.select,y&&"cursor-not-allowed opacity-50"),children:je.map(o=>(0,n.jsx)("option",{value:o,children:o},o))})]}):(0,n.jsx)("div",{"aria-live":"polite",className:(0,c.cn)("font-semibold text-gray-900 dark:text-gray-100",p.caption),children:xe.format(r)}),(0,n.jsx)("button",{type:"button",onClick:We,disabled:!De,"aria-label":B?.nextMonth??I.calendarNextMonth,className:(0,c.cn)("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],p.nav,!De&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!m&&"invisible"),children:(0,n.jsx)(st,{className:p.icon})})]}),(0,n.jsxs)("table",{role:"grid","aria-label":xe.format(r),onKeyDown:ze,className:"border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[ce&&(0,n.jsxs)("th",{scope:"col",className:(0,c.cn)("font-normal text-gray-400 dark:text-gray-500",p.head),children:[(0,n.jsx)("span",{className:"sr-only",children:B?.weekNumber??I.calendarWeekNumber}),(0,n.jsx)("span",{"aria-hidden":"true",children:"#"})]}),Ve.map(o=>(0,n.jsx)("th",{scope:"col",abbr:o.long,className:(0,c.cn)("font-medium uppercase text-gray-500 dark:text-gray-400",p.head),children:o.short},o.long))]})}),(0,n.jsx)("tbody",{children:u.map(o=>(0,n.jsxs)("tr",{children:[ce&&(0,n.jsx)("td",{className:(0,c.cn)("text-center align-middle text-gray-400 dark:text-gray-500",p.head),children:nt(o[0])}),o.map(b=>{let d=$e(b,r),H=J(b);if(d.outside&&!Me)return(0,n.jsx)("td",{className:"p-0"},H);let Je=N(b,Ee)&&!d.outside,le=d.inRange||d.rangeStart&&!!$||d.rangeEnd&&!!S?.from;return(0,n.jsx)("td",{role:"presentation",className:(0,c.cn)("p-0",le&&ut[x],le&&d.rangeStart&&"rounded-l-full",le&&d.rangeEnd&&"rounded-r-full"),children:(0,n.jsx)("button",{type:"button","data-day":H,"data-selected":d.selected||void 0,"data-today":d.today||void 0,"data-outside":d.outside||void 0,role:"gridcell",tabIndex:Je?0:-1,disabled:y,"aria-selected":d.selected,"aria-disabled":d.disabled||void 0,"aria-current":d.today?"date":void 0,"aria-label":_e.format(b),onClick:()=>{d.disabled||Be(b)},onMouseEnter:()=>a==="range"&&pe(g(b)),onMouseLeave:()=>a==="range"&&pe(null),onFocus:()=>U(g(b)),className:(0,c.cn)("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",z[x],p.day,d.selected?dt[x]:d.inRange?(0,c.cn)(ct[x],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):d.today?(0,c.cn)(gt[x],"hover:bg-gray-100 dark:hover:bg-gray-700"):(0,c.cn)("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),d.outside&&!d.selected&&"text-gray-400 dark:text-gray-500",d.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:ye?ye(b,d):b.getDate()})},H)})]},J(o[0])))})]})]},J(r))},Ge=(0,l.useCallback)(()=>{h(Y),U(Y),K(Y)||q(Y)},[Y,h,K,q]),Ue=(0,l.useCallback)(()=>{M(a==="multiple"?[]:a==="range"?{from:null,to:null}:null)},[a,M]),qe=!!be||ee||te;return(0,n.jsxs)("div",{ref:me,className:(0,c.cn)("inline-block bg-white dark:bg-gray-900",Ne&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",p.padding,y&&"opacity-60",Fe),...Re,children:[(0,n.jsx)("div",{className:(0,c.cn)("flex flex-wrap",p.gap),children:Array.from({length:C},(t,r)=>He(r))}),qe&&(0,n.jsxs)("div",{className:(0,c.cn)("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",p.footer),children:[(0,n.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:be}),(ee||te)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[ee&&(0,n.jsx)("button",{type:"button",onClick:Ge,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[x],y&&"cursor-not-allowed opacity-50"),children:B?.today??I.calendarToday}),te&&(0,n.jsx)("button",{type:"button",onClick:Ue,disabled:y,className:(0,c.cn)("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",z[x],y&&"cursor-not-allowed opacity-50"),children:B?.clear??I.calendarClear})]})]})]})}0&&(module.exports={Calendar});
@@ -1 +1 @@
1
- "use client";import{useCallback as p,useEffect as Ze,useMemo as _,useRef as we,useState as X}from"react";import{cn as c}from"../../lib/cn.js";import{useUILabels as et}from"../../lib/i18n.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var tt=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function z(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function v(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ce(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function ue(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function A(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function Z(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function at(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/tt)}function Ce(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function rt(a,r,i){let V=z(a),j=(V.getDay()-r+7)%7,O=P(V,-j),$=i?6:Math.ceil((j+ce(a))/7);return Array.from({length:$},(te,q)=>Array.from({length:7},(ge,T)=>P(O,q*7+T)))}function nt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",success:"bg-green-600 text-white hover:bg-green-700 dark:bg-green-500 dark:hover:bg-green-600",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600",info:"bg-cyan-600 text-white hover:bg-cyan-700 dark:bg-cyan-500 dark:hover:bg-cyan-600",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-600 dark:text-green-400",warning:"font-semibold text-yellow-600 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-600 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function ee(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Me(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function yt(a){let{mode:r="single",value:i,defaultValue:V,onChange:j,max:O,month:$,defaultMonth:te,onMonthChange:q,numberOfMonths:ge=1,weekStartsOn:T=0,locale:F,size:Se="md",color:D="primary",minDate:x,maxDate:k,disabledDates:H,disabled:b=!1,showOutsideDays:Ne=!0,showWeekNumbers:fe=!1,fixedWeeks:Fe=!1,captionLayout:ae="label",fromYear:be,toYear:ye,todayButton:re=!1,clearButton:ne=!1,footer:me,bordered:Re=!0,renderDay:he,labels:E,className:Ye,...Pe}=a,B=et(),m=lt[Se],w=Math.max(1,ge),R=_(()=>u(new Date),[]),oe=i!==void 0,[Te,Le]=X(()=>ee(r,V)),L=oe?ee(r,i):Te,le=$!==void 0,[Ae,Ee]=X(()=>z(te??Me(ee(r,V??i))??new Date)),g=le?z($):Ae,h=p(e=>{let t=z(e);le||Ee(t),q?.(t)},[le,q]),pe=we(null),se=we(!1),[I,J]=X(()=>{let e=Me(ee(r,V??i)),t=z(te??$??e??new Date),d=e&&ue(e,t)?e:ue(u(new Date),t)?u(new Date):t;return Ce(d,x,k)}),Be=v(g,w-1),Ie=A(I,g)>=0&&A(I,Be)<=0?I:g;Ze(()=>{if(!se.current)return;se.current=!1,pe.current?.querySelector(`[data-day="${Z(I)}"]:not([data-outside])`)?.focus()},[I,g]);let Y=p(e=>{let t=Ce(u(e),x,k);se.current=!0,J(t);let d=v(g,w-1);A(t,g)<0?h(t):A(t,d)>0&&h(v(t,-(w-1)))},[g,w,x,k,h]),K=p(e=>b||x&&e<u(x)||k&&e>u(k)?!0:typeof H=="function"?H(e):Array.isArray(H)?H.some(t=>S(t,e)):!1,[b,x,k,H]),[ie,De]=X(null),C=p(e=>{oe||Le(e),j?.(e)},[oe,j]),Q=p(e=>{let t=u(e);if(K(t))return;if(r==="multiple"){let l=L??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(O!==void 0&&l.length>=O)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=L??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(L,t)?null:t)},[r,L,O,C,K]),We=p(e=>{Q(e),J(u(e)),A(e,g)<0?h(e):A(e,v(g,w-1))>0&&h(v(e,-(w-1)))},[Q,g,w,h]),ve=!b&&(!x||A(g,z(x))>0),xe=!b&&(!k||A(v(g,w-1),z(k))<0),ze=p(()=>{h(v(g,-1))},[g,h]),Ve=p(()=>{h(v(g,1))},[g,h]),Ke=p(e=>{if(b)return;let t=I;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=v(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=v(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,I,Y,T]),_e=_(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),je=_(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),ke=_(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),Oe=_(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),$e=_(()=>{if(ae!=="dropdown")return[];let e=R.getFullYear(),t=be??x?.getFullYear()??e-100,d=ye??k?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[ae,be,ye,x,k,R]),M=r==="range"?L:null,He=M&&M.from&&!M.to&&ie&&ie>M.from?ie:null,G=M?.to??He,Ge=p((e,t)=>{let d=!ue(e,t),l=K(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(L??[]).some(U=>S(U,e)):r==="range"?(n=S(M?.from,e),f=S(G,e),y=n||f,s=!!(M?.from&&G&&e>M.from&&e<G)):y=S(L,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,L,M,G,K,R]),Ue=e=>{let t=v(g,e),d=rt(t,T,Fe),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:ze,disabled:!ve,"aria-label":E?.previousMonth??B.calendarPreviousMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!ve&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(nt,{className:m.icon})}),ae==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":E?.monthSelect??B.calendarMonth,value:t.getMonth(),disabled:b,onChange:n=>h(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:je.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":E?.yearSelect??B.calendarYear,value:t.getFullYear(),disabled:b,onChange:n=>h(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:$e.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:ke.format(t)}),o("button",{type:"button",onClick:Ve,disabled:!xe,"aria-label":E?.nextMonth??B.calendarNextMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!xe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(ot,{className:m.icon})})]}),N("table",{role:"grid","aria-label":ke.format(t),onKeyDown:Ke,className:"border-collapse",children:[o("thead",{children:N("tr",{children:[fe&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:E?.weekNumber??B.calendarWeekNumber}),o("span",{"aria-hidden":"true",children:"#"})]}),_e.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[fe&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:at(n[0])}),n.map(f=>{let s=Ge(f,t),U=Z(f);if(s.outside&&!Ne)return o("td",{className:"p-0"},U);let Xe=S(f,Ie)&&!s.outside,de=s.inRange||s.rangeStart&&!!G||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",de&&it[D],de&&s.rangeStart&&"rounded-l-full",de&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":U,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Xe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":Oe.format(f),onClick:()=>{s.disabled||We(f)},onMouseEnter:()=>r==="range"&&De(u(f)),onMouseLeave:()=>r==="range"&&De(null),onFocus:()=>J(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.day,s.selected?st[D]:s.inRange?c(dt[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(ut[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:he?he(f,s):f.getDate()})},U)})]},Z(n[0])))})]})]},Z(t))},qe=p(()=>{h(R),J(R),K(R)||Q(R)},[R,h,K,Q]),Je=p(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Qe=!!me||re||ne;return N("div",{ref:pe,className:c("inline-block bg-white dark:bg-gray-900",Re&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Ye),...Pe,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ue(t))}),Qe&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:me}),(re||ne)&&N("div",{className:"flex items-center gap-2",children:[re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.today??B.calendarToday}),ne&&o("button",{type:"button",onClick:Je,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.clear??B.calendarClear})]})]})]})}export{yt as Calendar};
1
+ "use client";import{useCallback as h,useEffect as Ze,useMemo as _,useRef as we,useState as X}from"react";import{cn as c}from"../../lib/cn.js";import{useUILabels as et}from"../../lib/i18n.js";import{jsx as o,jsxs as N}from"react/jsx-runtime";var tt=10080*60*1e3;function u(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())}function z(a){return new Date(a.getFullYear(),a.getMonth(),1)}function P(a,r){return new Date(a.getFullYear(),a.getMonth(),a.getDate()+r)}function x(a,r){return new Date(a.getFullYear(),a.getMonth()+r,1)}function ce(a){return new Date(a.getFullYear(),a.getMonth()+1,0).getDate()}function S(a,r){return!a||!r?!1:a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()&&a.getDate()===r.getDate()}function ue(a,r){return a.getFullYear()===r.getFullYear()&&a.getMonth()===r.getMonth()}function A(a,r){return a.getFullYear()*12+a.getMonth()-(r.getFullYear()*12+r.getMonth())}function Z(a){let r=`${a.getMonth()+1}`.padStart(2,"0"),i=`${a.getDate()}`.padStart(2,"0");return`${a.getFullYear()}-${r}-${i}`}function at(a){let r=u(a);r.setDate(r.getDate()-(r.getDay()+6)%7+3);let i=new Date(r.getFullYear(),0,4);return i.setDate(i.getDate()-(i.getDay()+6)%7+3),1+Math.round((r.getTime()-i.getTime())/tt)}function Ce(a,r,i){return r&&a<u(r)?u(r):i&&a>u(i)?u(i):a}function rt(a,r,i){let V=z(a),j=(V.getDay()-r+7)%7,O=P(V,-j),$=i?6:Math.ceil((j+ce(a))/7);return Array.from({length:$},(te,q)=>Array.from({length:7},(ge,T)=>P(O,q*7+T)))}function nt({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}function ot({className:a}){return o("svg",{className:a,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}var lt={sm:{day:"h-7 w-7 text-xs",head:"h-7 w-7 text-[10px]",caption:"text-xs",nav:"h-6 w-6",icon:"h-3 w-3",padding:"p-2",gap:"gap-3",footer:"text-xs",select:"text-xs py-0.5 pl-1 pr-5"},md:{day:"h-9 w-9 text-sm",head:"h-9 w-9 text-xs",caption:"text-sm",nav:"h-7 w-7",icon:"h-4 w-4",padding:"p-3",gap:"gap-4",footer:"text-sm",select:"text-sm py-1 pl-1.5 pr-6"},lg:{day:"h-11 w-11 text-base",head:"h-11 w-11 text-sm",caption:"text-base",nav:"h-9 w-9",icon:"h-5 w-5",padding:"p-4",gap:"gap-5",footer:"text-sm",select:"text-base py-1.5 pl-2 pr-7"}},st={primary:"bg-blue-600 text-white hover:bg-blue-700",success:"bg-green-700 text-white hover:bg-green-800",warning:"bg-yellow-500 text-gray-900 hover:bg-yellow-600 dark:bg-yellow-400 dark:hover:bg-yellow-500",error:"bg-red-600 text-white hover:bg-red-700",info:"bg-cyan-700 text-white hover:bg-cyan-800",neutral:"bg-gray-700 text-white hover:bg-gray-800 dark:bg-gray-500 dark:hover:bg-gray-400"},it={primary:"bg-blue-50 dark:bg-blue-900/30",success:"bg-green-50 dark:bg-green-900/30",warning:"bg-yellow-50 dark:bg-yellow-900/30",error:"bg-red-50 dark:bg-red-900/30",info:"bg-cyan-50 dark:bg-cyan-900/30",neutral:"bg-gray-100 dark:bg-gray-700/40"},dt={primary:"text-blue-900 dark:text-blue-100",success:"text-green-900 dark:text-green-100",warning:"text-yellow-900 dark:text-yellow-100",error:"text-red-900 dark:text-red-100",info:"text-cyan-900 dark:text-cyan-100",neutral:"text-gray-900 dark:text-gray-100"},ut={primary:"font-semibold text-blue-600 dark:text-blue-400",success:"font-semibold text-green-700 dark:text-green-400",warning:"font-semibold text-yellow-700 dark:text-yellow-400",error:"font-semibold text-red-600 dark:text-red-400",info:"font-semibold text-cyan-700 dark:text-cyan-400",neutral:"font-semibold text-gray-900 dark:text-gray-100"},W={primary:"focus-visible:ring-blue-500",success:"focus-visible:ring-green-500",warning:"focus-visible:ring-yellow-500",error:"focus-visible:ring-red-500",info:"focus-visible:ring-cyan-500",neutral:"focus-visible:ring-gray-500"};function ee(a,r){if(a==="multiple")return Array.isArray(r)?r.map(u):[];if(a==="range"){let i=r??null;return{from:i?.from?u(i.from):null,to:i?.to?u(i.to):null}}return r instanceof Date?u(r):null}function Me(a){return a?a instanceof Date?a:Array.isArray(a)?a[0]??null:a.from??a.to??null:null}function yt(a){let{mode:r="single",value:i,defaultValue:V,onChange:j,max:O,month:$,defaultMonth:te,onMonthChange:q,numberOfMonths:ge=1,weekStartsOn:T=0,locale:F,size:Se="md",color:D="primary",minDate:v,maxDate:k,disabledDates:H,disabled:b=!1,showOutsideDays:Ne=!0,showWeekNumbers:fe=!1,fixedWeeks:Fe=!1,captionLayout:ae="label",fromYear:be,toYear:ye,todayButton:re=!1,clearButton:ne=!1,footer:me,bordered:Re=!0,renderDay:pe,labels:E,className:Ye,...Pe}=a,B=et(),m=lt[Se],w=Math.max(1,ge),R=_(()=>u(new Date),[]),oe=i!==void 0,[Te,Le]=X(()=>ee(r,V)),L=oe?ee(r,i):Te,le=$!==void 0,[Ae,Ee]=X(()=>z(te??Me(ee(r,V??i))??new Date)),g=le?z($):Ae,p=h(e=>{let t=z(e);le||Ee(t),q?.(t)},[le,q]),he=we(null),se=we(!1),[I,J]=X(()=>{let e=Me(ee(r,V??i)),t=z(te??$??e??new Date),d=e&&ue(e,t)?e:ue(u(new Date),t)?u(new Date):t;return Ce(d,v,k)}),Be=x(g,w-1),Ie=A(I,g)>=0&&A(I,Be)<=0?I:g;Ze(()=>{if(!se.current)return;se.current=!1,he.current?.querySelector(`[data-day="${Z(I)}"]:not([data-outside])`)?.focus()},[I,g]);let Y=h(e=>{let t=Ce(u(e),v,k);se.current=!0,J(t);let d=x(g,w-1);A(t,g)<0?p(t):A(t,d)>0&&p(x(t,-(w-1)))},[g,w,v,k,p]),K=h(e=>b||v&&e<u(v)||k&&e>u(k)?!0:typeof H=="function"?H(e):Array.isArray(H)?H.some(t=>S(t,e)):!1,[b,v,k,H]),[ie,De]=X(null),C=h(e=>{oe||Le(e),j?.(e)},[oe,j]),Q=h(e=>{let t=u(e);if(K(t))return;if(r==="multiple"){let l=L??[];if(l.some(n=>S(n,t))){C(l.filter(n=>!S(n,t)));return}if(O!==void 0&&l.length>=O)return;C([...l,t].sort((n,f)=>n.getTime()-f.getTime()));return}if(r==="range"){let l=L??{from:null,to:null};if(!l.from||l.to){C({from:t,to:null});return}C(t<l.from?{from:t,to:l.from}:{from:l.from,to:t});return}C(S(L,t)?null:t)},[r,L,O,C,K]),We=h(e=>{Q(e),J(u(e)),A(e,g)<0?p(e):A(e,x(g,w-1))>0&&p(x(e,-(w-1)))},[Q,g,w,p]),xe=!b&&(!v||A(g,z(v))>0),ve=!b&&(!k||A(x(g,w-1),z(k))<0),ze=h(()=>{p(x(g,-1))},[g,p]),Ve=h(()=>{p(x(g,1))},[g,p]),Ke=h(e=>{if(b)return;let t=I;switch(e.key){case"ArrowLeft":e.preventDefault(),Y(P(t,-1));break;case"ArrowRight":e.preventDefault(),Y(P(t,1));break;case"ArrowUp":e.preventDefault(),Y(P(t,-7));break;case"ArrowDown":e.preventDefault(),Y(P(t,7));break;case"Home":e.preventDefault(),Y(P(t,-((t.getDay()-T+7)%7)));break;case"End":e.preventDefault(),Y(P(t,6-(t.getDay()-T+7)%7));break;case"PageUp":{e.preventDefault();let d=e.shiftKey?-12:-1,l=x(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}case"PageDown":{e.preventDefault();let d=e.shiftKey?12:1,l=x(t,d),y=Math.min(t.getDate(),ce(l));Y(new Date(l.getFullYear(),l.getMonth(),y));break}default:break}},[b,I,Y,T]),_e=_(()=>{let e=new Intl.DateTimeFormat(F,{weekday:"short"}),t=new Intl.DateTimeFormat(F,{weekday:"long"}),d=new Date(2024,0,7);return Array.from({length:7},(l,y)=>{let n=P(d,(T+y)%7);return{short:e.format(n),long:t.format(n)}})},[F,T]),je=_(()=>{let e=new Intl.DateTimeFormat(F,{month:"long"});return Array.from({length:12},(t,d)=>e.format(new Date(2024,d,1)))},[F]),ke=_(()=>new Intl.DateTimeFormat(F,{month:"long",year:"numeric"}),[F]),Oe=_(()=>new Intl.DateTimeFormat(F,{dateStyle:"full"}),[F]),$e=_(()=>{if(ae!=="dropdown")return[];let e=R.getFullYear(),t=be??v?.getFullYear()??e-100,d=ye??k?.getFullYear()??e+10;return d<t?[t]:Array.from({length:d-t+1},(l,y)=>t+y)},[ae,be,ye,v,k,R]),M=r==="range"?L:null,He=M&&M.from&&!M.to&&ie&&ie>M.from?ie:null,G=M?.to??He,Ge=h((e,t)=>{let d=!ue(e,t),l=K(e),y=!1,n=!1,f=!1,s=!1;return r==="multiple"?y=(L??[]).some(U=>S(U,e)):r==="range"?(n=S(M?.from,e),f=S(G,e),y=n||f,s=!!(M?.from&&G&&e>M.from&&e<G)):y=S(L,e),{selected:y,today:S(e,R),outside:d,disabled:l,rangeStart:n,rangeEnd:f,inRange:s}},[r,L,M,G,K,R]),Ue=e=>{let t=x(g,e),d=rt(t,T,Fe),l=e===0,y=e===w-1;return N("div",{className:"flex flex-col",children:[N("div",{className:"mb-2 flex items-center justify-between",children:[o("button",{type:"button",onClick:ze,disabled:!xe,"aria-label":E?.previousMonth??B.calendarPreviousMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!xe&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!l&&"invisible"),children:o(nt,{className:m.icon})}),ae==="dropdown"?N("div",{className:"flex items-center gap-1",children:[o("select",{"aria-label":E?.monthSelect??B.calendarMonth,value:t.getMonth(),disabled:b,onChange:n=>p(new Date(t.getFullYear(),Number(n.target.value)-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:je.map((n,f)=>o("option",{value:f,children:n},n))}),o("select",{"aria-label":E?.yearSelect??B.calendarYear,value:t.getFullYear(),disabled:b,onChange:n=>p(new Date(Number(n.target.value),t.getMonth()-e,1)),className:c("rounded-md border border-gray-300 bg-white font-medium text-gray-900","dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100","focus:outline-none focus-visible:ring-2",W[D],m.select,b&&"cursor-not-allowed opacity-50"),children:$e.map(n=>o("option",{value:n,children:n},n))})]}):o("div",{"aria-live":"polite",className:c("font-semibold text-gray-900 dark:text-gray-100",m.caption),children:ke.format(t)}),o("button",{type:"button",onClick:Ve,disabled:!ve,"aria-label":E?.nextMonth??B.calendarNextMonth,className:c("inline-flex items-center justify-center rounded-md transition-colors","text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.nav,!ve&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent",!y&&"invisible"),children:o(ot,{className:m.icon})})]}),N("table",{role:"grid","aria-label":ke.format(t),onKeyDown:Ke,className:"border-collapse",children:[o("thead",{children:N("tr",{children:[fe&&N("th",{scope:"col",className:c("font-normal text-gray-400 dark:text-gray-500",m.head),children:[o("span",{className:"sr-only",children:E?.weekNumber??B.calendarWeekNumber}),o("span",{"aria-hidden":"true",children:"#"})]}),_e.map(n=>o("th",{scope:"col",abbr:n.long,className:c("font-medium uppercase text-gray-500 dark:text-gray-400",m.head),children:n.short},n.long))]})}),o("tbody",{children:d.map(n=>N("tr",{children:[fe&&o("td",{className:c("text-center align-middle text-gray-400 dark:text-gray-500",m.head),children:at(n[0])}),n.map(f=>{let s=Ge(f,t),U=Z(f);if(s.outside&&!Ne)return o("td",{className:"p-0"},U);let Xe=S(f,Ie)&&!s.outside,de=s.inRange||s.rangeStart&&!!G||s.rangeEnd&&!!M?.from;return o("td",{role:"presentation",className:c("p-0",de&&it[D],de&&s.rangeStart&&"rounded-l-full",de&&s.rangeEnd&&"rounded-r-full"),children:o("button",{type:"button","data-day":U,"data-selected":s.selected||void 0,"data-today":s.today||void 0,"data-outside":s.outside||void 0,role:"gridcell",tabIndex:Xe?0:-1,disabled:b,"aria-selected":s.selected,"aria-disabled":s.disabled||void 0,"aria-current":s.today?"date":void 0,"aria-label":Oe.format(f),onClick:()=>{s.disabled||We(f)},onMouseEnter:()=>r==="range"&&De(u(f)),onMouseLeave:()=>r==="range"&&De(null),onFocus:()=>J(u(f)),className:c("inline-flex items-center justify-center rounded-full transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900",W[D],m.day,s.selected?st[D]:s.inRange?c(dt[D],"hover:bg-gray-200/60 dark:hover:bg-gray-600/60"):s.today?c(ut[D],"hover:bg-gray-100 dark:hover:bg-gray-700"):c("text-gray-900 dark:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-700"),s.outside&&!s.selected&&"text-gray-400 dark:text-gray-500",s.disabled&&"cursor-not-allowed opacity-40 hover:bg-transparent dark:hover:bg-transparent"),children:pe?pe(f,s):f.getDate()})},U)})]},Z(n[0])))})]})]},Z(t))},qe=h(()=>{p(R),J(R),K(R)||Q(R)},[R,p,K,Q]),Je=h(()=>{C(r==="multiple"?[]:r==="range"?{from:null,to:null}:null)},[r,C]),Qe=!!me||re||ne;return N("div",{ref:he,className:c("inline-block bg-white dark:bg-gray-900",Re&&"rounded-lg border border-gray-200 shadow-sm dark:border-gray-700",m.padding,b&&"opacity-60",Ye),...Pe,children:[o("div",{className:c("flex flex-wrap",m.gap),children:Array.from({length:w},(e,t)=>Ue(t))}),Qe&&N("div",{className:c("mt-3 flex items-center justify-between gap-2 border-t border-gray-200 pt-3 dark:border-gray-700",m.footer),children:[o("div",{className:"text-gray-600 dark:text-gray-400",children:me}),(re||ne)&&N("div",{className:"flex items-center gap-2",children:[re&&o("button",{type:"button",onClick:qe,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.today??B.calendarToday}),ne&&o("button",{type:"button",onClick:Je,disabled:b,className:c("rounded-md px-2 py-1 font-medium transition-colors","text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700","focus:outline-none focus-visible:ring-2",W[D],b&&"cursor-not-allowed opacity-50"),children:E?.clear??B.calendarClear})]})]})]})}export{yt as Calendar};
@@ -1 +1 @@
1
- "use strict";"use client";var y=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.prototype.hasOwnProperty;var re=(e,r)=>{for(var u in r)y(e,u,{get:r[u],enumerable:!0})},ae=(e,r,u,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of te(r))!ne.call(e,n)&&n!==u&&y(e,n,{get:()=>r[n],enumerable:!(c=se(r,n))||c.enumerable});return e};var oe=e=>ae(y({},"__esModule",{value:!0}),e);var de={};re(de,{Checkbox:()=>T});module.exports=oe(de);var l=require("react"),t=require("../../lib/cn.cjs"),s=require("react/jsx-runtime"),le=e=>{switch(e){case"sm":return{checkbox:"w-4 h-4",label:"text-xs",description:"text-xs"};case"lg":return{checkbox:"w-6 h-6",label:"text-base",description:"text-sm"};default:return{checkbox:"w-5 h-5",label:"text-sm",description:"text-xs"}}},ce=e=>{switch(e){case"circle":return"rounded-full";case"rounded":return"rounded-md";default:return"rounded"}},ie=({className:e})=>(0,s.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ue=({className:e})=>(0,s.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}),T=(0,l.forwardRef)(({checked:e,defaultChecked:r=!1,onChange:u,disabled:c=!1,readOnly:n=!1,required:I=!1,name:q,value:W,id:j,label:R,description:m,error:x=!1,size:S="md",labelPosition:B="right",checkedColor:p="bg-blue-600",uncheckedColor:k="bg-white dark:bg-gray-800",borderColor:f="border-gray-300 dark:border-gray-600",labelColor:F,errorColor:E="text-red-500",checkmarkColor:_="text-white",hoverColor:d,focusRingColor:A="ring-blue-500",indeterminate:o=!1,icon:L,variant:M="default",shape:D="square",animation:w=!0,showFocusRing:G=!0,className:pe,containerClassName:J,style:K,tabIndex:Q,...U},g)=>{let V=(0,l.useId)(),h=j||V,$=`${h}-error`,H=`${h}-description`,[X,Y]=(0,l.useState)(r),z=e!==void 0,i=z?e:X,b=(0,l.useRef)(null);(0,l.useEffect)(()=>{b.current&&(b.current.indeterminate=o)},[o]);let Z=a=>{if(c||n)return;let P=a.target.checked;z||Y(P),u?.(P,a)},N=le(S),O=ce(D),ee=()=>{let a=(0,t.cn)("relative flex items-center justify-center border-2 transition-all",N.checkbox,O,w&&"duration-200 ease-in-out");return c?(0,t.cn)(a,"opacity-50 cursor-not-allowed",i||o?p:k,f):M==="filled"?(0,t.cn)(a,i||o?p:"bg-gray-100 dark:bg-gray-700",i||o?"border-transparent":f,d&&!n&&`hover:${d}`,"cursor-pointer"):M==="outlined"?(0,t.cn)(a,k,i||o?`border-current ${p.replace("bg-","text-")}`:f,"border-2",d&&!n&&`hover:${d}`,"cursor-pointer"):(0,t.cn)(a,i||o?p:k,i||o?"border-transparent":f,d&&!n&&`hover:${d}`,"cursor-pointer")},C=x!==!1,v=typeof x=="string"?x:void 0;return(0,s.jsxs)("div",{className:(0,t.cn)("inline-flex flex-col",J),children:[(0,s.jsxs)("label",{htmlFor:h,className:(0,t.cn)("inline-flex items-start gap-2",c?"cursor-not-allowed":"cursor-pointer",B==="left"&&"flex-row-reverse justify-end"),children:[(0,s.jsx)("input",{ref:a=>{b&&(b.current=a),typeof g=="function"?g(a):g&&(g.current=a)},type:"checkbox",id:h,name:q,value:W,checked:i,onChange:Z,disabled:c,readOnly:n,required:I,tabIndex:n?-1:Q,"aria-invalid":C,"aria-describedby":(0,t.cn)(v&&$,m&&H),className:"sr-only peer",style:K,...U}),(0,s.jsx)("span",{className:(0,t.cn)(ee(),G&&`peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:${A}`,w&&i&&"scale-100",C&&"border-red-500"),"aria-hidden":"true",children:(i||o)&&(0,s.jsx)("span",{className:(0,t.cn)(_,w&&"animate-in zoom-in-50 duration-200"),children:o?L||(0,s.jsx)(ue,{className:"w-full h-full"}):L||(0,s.jsx)(ie,{className:"w-full h-full"})})}),R&&(0,s.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:(0,t.cn)(N.label,c&&"opacity-50",F,C&&E),children:[R,I&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),m&&(0,s.jsx)("span",{id:H,className:(0,t.cn)(N.description,"text-gray-500 dark:text-gray-400",c&&"opacity-50"),children:m})]})]}),v&&(0,s.jsx)("p",{id:$,className:(0,t.cn)("mt-1 text-xs",E),children:v})]})});T.displayName="Checkbox";0&&(module.exports={Checkbox});
1
+ "use strict";"use client";var y=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var re=Object.prototype.hasOwnProperty;var ne=(e,n)=>{for(var u in n)y(e,u,{get:n[u],enumerable:!0})},ae=(e,n,u,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of te(n))!re.call(e,r)&&r!==u&&y(e,r,{get:()=>n[r],enumerable:!(c=se(n,r))||c.enumerable});return e};var oe=e=>ae(y({},"__esModule",{value:!0}),e);var de={};ne(de,{Checkbox:()=>T});module.exports=oe(de);var l=require("react"),t=require("../../lib/cn.cjs"),s=require("react/jsx-runtime"),le=e=>{switch(e){case"sm":return{checkbox:"w-4 h-4",label:"text-xs",description:"text-xs"};case"lg":return{checkbox:"w-6 h-6",label:"text-base",description:"text-sm"};default:return{checkbox:"w-5 h-5",label:"text-sm",description:"text-xs"}}},ce=e=>{switch(e){case"circle":return"rounded-full";case"rounded":return"rounded-md";default:return"rounded"}},ie=({className:e})=>(0,s.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ue=({className:e})=>(0,s.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}),T=(0,l.forwardRef)(({checked:e,defaultChecked:n=!1,onChange:u,disabled:c=!1,readOnly:r=!1,required:I=!1,name:q,value:W,id:j,label:R,description:m,error:x=!1,size:S="md",labelPosition:B="right",checkedColor:p="bg-blue-600",uncheckedColor:k="bg-white dark:bg-gray-800",borderColor:f="border-gray-300 dark:border-gray-600",labelColor:F,errorColor:E="text-red-600 dark:text-red-400",checkmarkColor:_="text-white",hoverColor:d,focusRingColor:A="ring-blue-500",indeterminate:o=!1,icon:L,variant:M="default",shape:D="square",animation:w=!0,showFocusRing:G=!0,className:pe,containerClassName:J,style:K,tabIndex:Q,...U},g)=>{let V=(0,l.useId)(),h=j||V,$=`${h}-error`,H=`${h}-description`,[X,Y]=(0,l.useState)(n),z=e!==void 0,i=z?e:X,b=(0,l.useRef)(null);(0,l.useEffect)(()=>{b.current&&(b.current.indeterminate=o)},[o]);let Z=a=>{if(c||r)return;let P=a.target.checked;z||Y(P),u?.(P,a)},N=le(S),O=ce(D),ee=()=>{let a=(0,t.cn)("relative flex items-center justify-center border-2 transition-all",N.checkbox,O,w&&"duration-200 ease-in-out");return c?(0,t.cn)(a,"opacity-50 cursor-not-allowed",i||o?p:k,f):M==="filled"?(0,t.cn)(a,i||o?p:"bg-gray-100 dark:bg-gray-700",i||o?"border-transparent":f,d&&!r&&`hover:${d}`,"cursor-pointer"):M==="outlined"?(0,t.cn)(a,k,i||o?`border-current ${p.replace("bg-","text-")}`:f,"border-2",d&&!r&&`hover:${d}`,"cursor-pointer"):(0,t.cn)(a,i||o?p:k,i||o?"border-transparent":f,d&&!r&&`hover:${d}`,"cursor-pointer")},C=x!==!1,v=typeof x=="string"?x:void 0;return(0,s.jsxs)("div",{className:(0,t.cn)("inline-flex flex-col",J),children:[(0,s.jsxs)("label",{htmlFor:h,className:(0,t.cn)("inline-flex items-start gap-2",c?"cursor-not-allowed":"cursor-pointer",B==="left"&&"flex-row-reverse justify-end"),children:[(0,s.jsx)("input",{ref:a=>{b&&(b.current=a),typeof g=="function"?g(a):g&&(g.current=a)},type:"checkbox",id:h,name:q,value:W,checked:i,onChange:Z,disabled:c,readOnly:r,required:I,tabIndex:r?-1:Q,"aria-invalid":C,"aria-describedby":(0,t.cn)(v&&$,m&&H),className:"sr-only peer",style:K,...U}),(0,s.jsx)("span",{className:(0,t.cn)(ee(),G&&`peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:${A}`,w&&i&&"scale-100",C&&"border-red-500"),"aria-hidden":"true",children:(i||o)&&(0,s.jsx)("span",{className:(0,t.cn)(_,w&&"animate-in zoom-in-50 duration-200"),children:o?L||(0,s.jsx)(ue,{className:"w-full h-full"}):L||(0,s.jsx)(ie,{className:"w-full h-full"})})}),R&&(0,s.jsxs)("span",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("span",{className:(0,t.cn)(N.label,c&&"opacity-50",F,C&&E),children:[R,I&&(0,s.jsx)("span",{className:"text-red-600 dark:text-red-400 ml-1",children:"*"})]}),m&&(0,s.jsx)("span",{id:H,className:(0,t.cn)(N.description,"text-gray-500 dark:text-gray-400",c&&"opacity-50"),children:m})]})]}),v&&(0,s.jsx)("p",{id:$,className:(0,t.cn)("mt-1 text-xs",E),children:v})]})});T.displayName="Checkbox";0&&(module.exports={Checkbox});
@@ -1 +1 @@
1
- "use client";import{forwardRef as O,useId as ee,useState as se,useEffect as te,useRef as ne}from"react";import{cn as e}from"../../lib/cn.js";import{jsx as s,jsxs as g}from"react/jsx-runtime";var re=n=>{switch(n){case"sm":return{checkbox:"w-4 h-4",label:"text-xs",description:"text-xs"};case"lg":return{checkbox:"w-6 h-6",label:"text-base",description:"text-sm"};default:return{checkbox:"w-5 h-5",label:"text-sm",description:"text-xs"}}},ae=n=>{switch(n){case"circle":return"rounded-full";case"rounded":return"rounded-md";default:return"rounded"}},oe=({className:n})=>s("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),le=({className:n})=>s("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}),ce=O(({checked:n,defaultChecked:H=!1,onChange:z,disabled:o=!1,readOnly:l=!1,required:C=!1,name:P,value:T,id:q,label:v,description:h,error:b=!1,size:W="md",labelPosition:j="right",checkedColor:i="bg-blue-600",uncheckedColor:m="bg-white dark:bg-gray-800",borderColor:u="border-gray-300 dark:border-gray-600",labelColor:S,errorColor:y="text-red-500",checkmarkColor:B="text-white",hoverColor:c,focusRingColor:F="ring-blue-500",indeterminate:r=!1,icon:I,variant:R="default",shape:_="square",animation:x=!0,showFocusRing:A=!0,className:ie,containerClassName:D,style:G,tabIndex:J,...K},d)=>{let Q=ee(),p=q||Q,E=`${p}-error`,L=`${p}-description`,[U,V]=se(H),M=n!==void 0,a=M?n:U,f=ne(null);te(()=>{f.current&&(f.current.indeterminate=r)},[r]);let X=t=>{if(o||l)return;let $=t.target.checked;M||V($),z?.($,t)},k=re(W),Y=ae(_),Z=()=>{let t=e("relative flex items-center justify-center border-2 transition-all",k.checkbox,Y,x&&"duration-200 ease-in-out");return o?e(t,"opacity-50 cursor-not-allowed",a||r?i:m,u):R==="filled"?e(t,a||r?i:"bg-gray-100 dark:bg-gray-700",a||r?"border-transparent":u,c&&!l&&`hover:${c}`,"cursor-pointer"):R==="outlined"?e(t,m,a||r?`border-current ${i.replace("bg-","text-")}`:u,"border-2",c&&!l&&`hover:${c}`,"cursor-pointer"):e(t,a||r?i:m,a||r?"border-transparent":u,c&&!l&&`hover:${c}`,"cursor-pointer")},w=b!==!1,N=typeof b=="string"?b:void 0;return g("div",{className:e("inline-flex flex-col",D),children:[g("label",{htmlFor:p,className:e("inline-flex items-start gap-2",o?"cursor-not-allowed":"cursor-pointer",j==="left"&&"flex-row-reverse justify-end"),children:[s("input",{ref:t=>{f&&(f.current=t),typeof d=="function"?d(t):d&&(d.current=t)},type:"checkbox",id:p,name:P,value:T,checked:a,onChange:X,disabled:o,readOnly:l,required:C,tabIndex:l?-1:J,"aria-invalid":w,"aria-describedby":e(N&&E,h&&L),className:"sr-only peer",style:G,...K}),s("span",{className:e(Z(),A&&`peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:${F}`,x&&a&&"scale-100",w&&"border-red-500"),"aria-hidden":"true",children:(a||r)&&s("span",{className:e(B,x&&"animate-in zoom-in-50 duration-200"),children:r?I||s(le,{className:"w-full h-full"}):I||s(oe,{className:"w-full h-full"})})}),v&&g("span",{className:"flex flex-col gap-1",children:[g("span",{className:e(k.label,o&&"opacity-50",S,w&&y),children:[v,C&&s("span",{className:"text-red-500 ml-1",children:"*"})]}),h&&s("span",{id:L,className:e(k.description,"text-gray-500 dark:text-gray-400",o&&"opacity-50"),children:h})]})]}),N&&s("p",{id:E,className:e("mt-1 text-xs",y),children:N})]})});ce.displayName="Checkbox";export{ce as Checkbox};
1
+ "use client";import{forwardRef as O,useId as ee,useState as se,useEffect as te,useRef as re}from"react";import{cn as e}from"../../lib/cn.js";import{jsx as s,jsxs as g}from"react/jsx-runtime";var ne=r=>{switch(r){case"sm":return{checkbox:"w-4 h-4",label:"text-xs",description:"text-xs"};case"lg":return{checkbox:"w-6 h-6",label:"text-base",description:"text-sm"};default:return{checkbox:"w-5 h-5",label:"text-sm",description:"text-xs"}}},ae=r=>{switch(r){case"circle":return"rounded-full";case"rounded":return"rounded-md";default:return"rounded"}},oe=({className:r})=>s("svg",{className:r,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),le=({className:r})=>s("svg",{className:r,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}),ce=O(({checked:r,defaultChecked:H=!1,onChange:z,disabled:o=!1,readOnly:l=!1,required:C=!1,name:P,value:T,id:q,label:v,description:h,error:b=!1,size:W="md",labelPosition:j="right",checkedColor:i="bg-blue-600",uncheckedColor:m="bg-white dark:bg-gray-800",borderColor:u="border-gray-300 dark:border-gray-600",labelColor:S,errorColor:y="text-red-600 dark:text-red-400",checkmarkColor:B="text-white",hoverColor:c,focusRingColor:F="ring-blue-500",indeterminate:n=!1,icon:I,variant:R="default",shape:_="square",animation:x=!0,showFocusRing:A=!0,className:ie,containerClassName:D,style:G,tabIndex:J,...K},d)=>{let Q=ee(),p=q||Q,E=`${p}-error`,L=`${p}-description`,[U,V]=se(H),M=r!==void 0,a=M?r:U,f=re(null);te(()=>{f.current&&(f.current.indeterminate=n)},[n]);let X=t=>{if(o||l)return;let $=t.target.checked;M||V($),z?.($,t)},k=ne(W),Y=ae(_),Z=()=>{let t=e("relative flex items-center justify-center border-2 transition-all",k.checkbox,Y,x&&"duration-200 ease-in-out");return o?e(t,"opacity-50 cursor-not-allowed",a||n?i:m,u):R==="filled"?e(t,a||n?i:"bg-gray-100 dark:bg-gray-700",a||n?"border-transparent":u,c&&!l&&`hover:${c}`,"cursor-pointer"):R==="outlined"?e(t,m,a||n?`border-current ${i.replace("bg-","text-")}`:u,"border-2",c&&!l&&`hover:${c}`,"cursor-pointer"):e(t,a||n?i:m,a||n?"border-transparent":u,c&&!l&&`hover:${c}`,"cursor-pointer")},w=b!==!1,N=typeof b=="string"?b:void 0;return g("div",{className:e("inline-flex flex-col",D),children:[g("label",{htmlFor:p,className:e("inline-flex items-start gap-2",o?"cursor-not-allowed":"cursor-pointer",j==="left"&&"flex-row-reverse justify-end"),children:[s("input",{ref:t=>{f&&(f.current=t),typeof d=="function"?d(t):d&&(d.current=t)},type:"checkbox",id:p,name:P,value:T,checked:a,onChange:X,disabled:o,readOnly:l,required:C,tabIndex:l?-1:J,"aria-invalid":w,"aria-describedby":e(N&&E,h&&L),className:"sr-only peer",style:G,...K}),s("span",{className:e(Z(),A&&`peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:${F}`,x&&a&&"scale-100",w&&"border-red-500"),"aria-hidden":"true",children:(a||n)&&s("span",{className:e(B,x&&"animate-in zoom-in-50 duration-200"),children:n?I||s(le,{className:"w-full h-full"}):I||s(oe,{className:"w-full h-full"})})}),v&&g("span",{className:"flex flex-col gap-1",children:[g("span",{className:e(k.label,o&&"opacity-50",S,w&&y),children:[v,C&&s("span",{className:"text-red-600 dark:text-red-400 ml-1",children:"*"})]}),h&&s("span",{id:L,className:e(k.description,"text-gray-500 dark:text-gray-400",o&&"opacity-50"),children:h})]})]}),N&&s("p",{id:E,className:e("mt-1 text-xs",y),children:N})]})});ce.displayName="Checkbox";export{ce as Checkbox};
@@ -1 +1 @@
1
- "use strict";"use client";var S=Object.create;var x=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var J=(e,t)=>{for(var o in t)x(e,o,{get:t[o],enumerable:!0})},N=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of B(t))!H.call(e,s)&&s!==o&&x(e,s,{get:()=>t[s],enumerable:!(r=A(t,s))||r.enumerable});return e};var K=(e,t,o)=>(o=e!=null?S(F(e)):{},N(t||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),L=e=>N(x({},"__esModule",{value:!0}),e);var Q={};J(Q,{CheckboxGroup:()=>P,CheckboxGroupItem:()=>R});module.exports=L(Q);var g=require("react"),u=require("../../lib/cn.cjs"),f=require("./Checkbox.cjs"),i=K(require("react"),1),a=require("react/jsx-runtime"),y=(0,g.createContext)(null),P=({label:e,description:t,value:o,defaultValue:r=[],onChange:s,orientation:n="vertical",spacing:m="md",disabled:l=!1,size:d="md",error:p=!1,required:b=!1,children:z,className:I,labelClassName:V,...w})=>{let[D,M]=i.useState(r),C=o!==void 0,c=C?o:D,v=i.useCallback(h=>{let G=c.includes(h)?c.filter(E=>E!==h):[...c,h];C||M(G),s?.(G)},[c,C,s]),O=i.useMemo(()=>({value:c,onChange:v,disabled:l,size:d}),[c,v,l,d]),W={sm:n==="vertical"?"gap-2":"gap-3",md:n==="vertical"?"gap-3":"gap-4",lg:n==="vertical"?"gap-4":"gap-6"},q=p!==!1,k=typeof p=="string"?p:void 0;return(0,a.jsxs)("div",{className:(0,u.cn)("flex flex-col gap-2",I),...w,children:[(e||t)&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[e&&(0,a.jsxs)("label",{className:(0,u.cn)("text-sm font-medium text-gray-900 dark:text-gray-100",l&&"opacity-50",q&&"text-red-500",V),children:[e,b&&(0,a.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),t&&(0,a.jsx)("p",{className:(0,u.cn)("text-xs text-gray-500 dark:text-gray-400",l&&"opacity-50"),children:t})]}),(0,a.jsx)(y.Provider,{value:O,children:(0,a.jsx)("div",{className:(0,u.cn)("flex",n==="vertical"?"flex-col":"flex-row flex-wrap",W[m]),role:"group",children:z})}),k&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:k})]})};P.displayName="CheckboxGroup";var R=({value:e,disabled:t,size:o,...r})=>{let s=(0,g.useContext)(y);if(!s)return console.warn("CheckboxGroupItem doit \xEAtre utilis\xE9 dans un CheckboxGroup"),(0,a.jsx)(f.Checkbox,{...r,disabled:t,size:o});let{value:n,onChange:m,disabled:l,size:d}=s,p=n.includes(e);return(0,a.jsx)(f.Checkbox,{...r,checked:p,onChange:()=>m(e),disabled:l||t,size:o||d})};R.displayName="CheckboxGroupItem";0&&(module.exports={CheckboxGroup,CheckboxGroupItem});
1
+ "use strict";"use client";var S=Object.create;var x=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var J=(e,t)=>{for(var o in t)x(e,o,{get:t[o],enumerable:!0})},N=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of B(t))!H.call(e,s)&&s!==o&&x(e,s,{get:()=>t[s],enumerable:!(r=A(t,s))||r.enumerable});return e};var K=(e,t,o)=>(o=e!=null?S(F(e)):{},N(t||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),L=e=>N(x({},"__esModule",{value:!0}),e);var Q={};J(Q,{CheckboxGroup:()=>P,CheckboxGroupItem:()=>R});module.exports=L(Q);var g=require("react"),p=require("../../lib/cn.cjs"),f=require("./Checkbox.cjs"),i=K(require("react"),1),a=require("react/jsx-runtime"),y=(0,g.createContext)(null),P=({label:e,description:t,value:o,defaultValue:r=[],onChange:s,orientation:n="vertical",spacing:m="md",disabled:l=!1,size:u="md",error:d=!1,required:b=!1,children:z,className:I,labelClassName:V,...w})=>{let[D,M]=i.useState(r),C=o!==void 0,c=C?o:D,v=i.useCallback(h=>{let G=c.includes(h)?c.filter(E=>E!==h):[...c,h];C||M(G),s?.(G)},[c,C,s]),O=i.useMemo(()=>({value:c,onChange:v,disabled:l,size:u}),[c,v,l,u]),W={sm:n==="vertical"?"gap-2":"gap-3",md:n==="vertical"?"gap-3":"gap-4",lg:n==="vertical"?"gap-4":"gap-6"},q=d!==!1,k=typeof d=="string"?d:void 0;return(0,a.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-2",I),...w,children:[(e||t)&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[e&&(0,a.jsxs)("label",{className:(0,p.cn)("text-sm font-medium text-gray-900 dark:text-gray-100",l&&"opacity-50",q&&"text-red-600 dark:text-red-400",V),children:[e,b&&(0,a.jsx)("span",{className:"text-red-600 dark:text-red-400 ml-1",children:"*"})]}),t&&(0,a.jsx)("p",{className:(0,p.cn)("text-xs text-gray-500 dark:text-gray-400",l&&"opacity-50"),children:t})]}),(0,a.jsx)(y.Provider,{value:O,children:(0,a.jsx)("div",{className:(0,p.cn)("flex",n==="vertical"?"flex-col":"flex-row flex-wrap",W[m]),role:"group",children:z})}),k&&(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-red-400",children:k})]})};P.displayName="CheckboxGroup";var R=({value:e,disabled:t,size:o,...r})=>{let s=(0,g.useContext)(y);if(!s)return console.warn("CheckboxGroupItem doit \xEAtre utilis\xE9 dans un CheckboxGroup"),(0,a.jsx)(f.Checkbox,{...r,disabled:t,size:o});let{value:n,onChange:m,disabled:l,size:u}=s,d=n.includes(e);return(0,a.jsx)(f.Checkbox,{...r,checked:d,onChange:()=>m(e),disabled:l||t,size:o||u})};R.displayName="CheckboxGroupItem";0&&(module.exports={CheckboxGroup,CheckboxGroupItem});
@@ -1 +1 @@
1
- "use client";import{createContext as O,useContext as W}from"react";import{cn as d}from"../../lib/cn.js";import{Checkbox as k}from"./Checkbox.js";import*as n from"react";import{jsx as e,jsxs as C}from"react/jsx-runtime";var G=O(null),q=({label:t,description:o,value:l,defaultValue:p=[],onChange:c,orientation:a="vertical",spacing:x="md",disabled:s=!1,size:u="md",error:i=!1,required:h=!1,children:N,className:y,labelClassName:P,...R})=>{let[z,I]=n.useState(p),g=l!==void 0,r=g?l:z,f=n.useCallback(m=>{let v=r.includes(m)?r.filter(M=>M!==m):[...r,m];g||I(v),c?.(v)},[r,g,c]),V=n.useMemo(()=>({value:r,onChange:f,disabled:s,size:u}),[r,f,s,u]),w={sm:a==="vertical"?"gap-2":"gap-3",md:a==="vertical"?"gap-3":"gap-4",lg:a==="vertical"?"gap-4":"gap-6"},D=i!==!1,b=typeof i=="string"?i:void 0;return C("div",{className:d("flex flex-col gap-2",y),...R,children:[(t||o)&&C("div",{className:"flex flex-col gap-1",children:[t&&C("label",{className:d("text-sm font-medium text-gray-900 dark:text-gray-100",s&&"opacity-50",D&&"text-red-500",P),children:[t,h&&e("span",{className:"text-red-500 ml-1",children:"*"})]}),o&&e("p",{className:d("text-xs text-gray-500 dark:text-gray-400",s&&"opacity-50"),children:o})]}),e(G.Provider,{value:V,children:e("div",{className:d("flex",a==="vertical"?"flex-col":"flex-row flex-wrap",w[x]),role:"group",children:N})}),b&&e("p",{className:"text-xs text-red-500",children:b})]})};q.displayName="CheckboxGroup";var E=({value:t,disabled:o,size:l,...p})=>{let c=W(G);if(!c)return console.warn("CheckboxGroupItem doit \xEAtre utilis\xE9 dans un CheckboxGroup"),e(k,{...p,disabled:o,size:l});let{value:a,onChange:x,disabled:s,size:u}=c,i=a.includes(t);return e(k,{...p,checked:i,onChange:()=>x(t),disabled:s||o,size:l||u})};E.displayName="CheckboxGroupItem";export{q as CheckboxGroup,E as CheckboxGroupItem};
1
+ "use client";import{createContext as O,useContext as W}from"react";import{cn as u}from"../../lib/cn.js";import{Checkbox as k}from"./Checkbox.js";import*as n from"react";import{jsx as e,jsxs as C}from"react/jsx-runtime";var G=O(null),q=({label:t,description:o,value:l,defaultValue:d=[],onChange:c,orientation:a="vertical",spacing:x="md",disabled:s=!1,size:p="md",error:i=!1,required:h=!1,children:N,className:y,labelClassName:P,...R})=>{let[z,I]=n.useState(d),g=l!==void 0,r=g?l:z,f=n.useCallback(m=>{let v=r.includes(m)?r.filter(M=>M!==m):[...r,m];g||I(v),c?.(v)},[r,g,c]),V=n.useMemo(()=>({value:r,onChange:f,disabled:s,size:p}),[r,f,s,p]),w={sm:a==="vertical"?"gap-2":"gap-3",md:a==="vertical"?"gap-3":"gap-4",lg:a==="vertical"?"gap-4":"gap-6"},D=i!==!1,b=typeof i=="string"?i:void 0;return C("div",{className:u("flex flex-col gap-2",y),...R,children:[(t||o)&&C("div",{className:"flex flex-col gap-1",children:[t&&C("label",{className:u("text-sm font-medium text-gray-900 dark:text-gray-100",s&&"opacity-50",D&&"text-red-600 dark:text-red-400",P),children:[t,h&&e("span",{className:"text-red-600 dark:text-red-400 ml-1",children:"*"})]}),o&&e("p",{className:u("text-xs text-gray-500 dark:text-gray-400",s&&"opacity-50"),children:o})]}),e(G.Provider,{value:V,children:e("div",{className:u("flex",a==="vertical"?"flex-col":"flex-row flex-wrap",w[x]),role:"group",children:N})}),b&&e("p",{className:"text-xs text-red-600 dark:text-red-400",children:b})]})};q.displayName="CheckboxGroup";var E=({value:t,disabled:o,size:l,...d})=>{let c=W(G);if(!c)return console.warn("CheckboxGroupItem doit \xEAtre utilis\xE9 dans un CheckboxGroup"),e(k,{...d,disabled:o,size:l});let{value:a,onChange:x,disabled:s,size:p}=c,i=a.includes(t);return e(k,{...d,checked:i,onChange:()=>x(t),disabled:s||o,size:l||p})};E.displayName="CheckboxGroupItem";export{q as CheckboxGroup,E as CheckboxGroupItem};
@@ -1 +1 @@
1
- "use strict";"use client";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var A=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},D=(t,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of U(r))!q.call(t,s)&&s!==a&&g(t,s,{get:()=>r[s],enumerable:!(n=T(r,s))||n.enumerable});return t};var F=t=>D(g({},"__esModule",{value:!0}),t);var _={};A(_,{Chip:()=>f});module.exports=F(_);var o=require("../../lib/cn.cjs"),k=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function G({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var J={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-600 text-white",outlined:"border-cyan-600 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},K={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},Q={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},c={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},X={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},Y={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},Z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function f({label:t,children:r,variant:a="solid",size:n="md",color:s="default",bgColor:b,textColor:p,borderColor:u,rounded:C="full",icon:x,endIcon:h,avatar:d,onClose:w,closable:m=!1,removeLabel:v,clickable:R=!1,selected:N=!1,disabled:l=!1,as:S="span",className:L,onClick:z,...M}){let P=(0,k.useUILabels)(),E=S,V=(0,o.cn)("inline-flex items-center justify-center font-medium transition-all",Q[n],Z[C],a==="outlined"&&"border"),W=(0,o.cn)(b||p||u?(0,o.cn)(b,p,u):J[s][a]),I=N?"ring-2 ring-offset-1 ring-blue-500":"",j=R&&!l?"cursor-pointer hover:opacity-80 active:scale-95":"",B=l?"opacity-50 cursor-not-allowed":"",H=i=>{i.stopPropagation(),w?.()},O=i=>{l||z?.(i)},y=r??t;return(0,e.jsxs)(E,{className:(0,o.cn)(V,W,I,j,B,L),onClick:O,"aria-disabled":l,...M,children:[a==="dot"&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full shrink-0",Y[n],K[s]),"aria-hidden":"true"}),d&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full overflow-hidden shrink-0",X[n]),children:d}),x&&!d&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:x}),y&&(0,e.jsx)("span",{className:"truncate",children:y}),h&&!m&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:h}),m&&(0,e.jsx)("button",{type:"button",onClick:H,disabled:l,className:(0,o.cn)("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",l&&"pointer-events-none"),"aria-label":v??P.chipRemove,children:(0,e.jsx)(G,{className:c[n]})})]})}f.displayName="Chip";0&&(module.exports={Chip});
1
+ "use strict";"use client";var g=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var A=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},D=(t,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of U(r))!q.call(t,s)&&s!==a&&g(t,s,{get:()=>r[s],enumerable:!(n=T(r,s))||n.enumerable});return t};var F=t=>D(g({},"__esModule",{value:!0}),t);var _={};A(_,{Chip:()=>f});module.exports=F(_);var o=require("../../lib/cn.cjs"),k=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime");function G({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var J={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-700 text-white",outlined:"border-green-600 text-green-700 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-700 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-700 text-white",outlined:"border-cyan-600 text-cyan-700 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},K={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},Q={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},c={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},X={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},Y={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},Z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function f({label:t,children:r,variant:a="solid",size:n="md",color:s="default",bgColor:b,textColor:p,borderColor:u,rounded:C="full",icon:x,endIcon:h,avatar:d,onClose:w,closable:m=!1,removeLabel:v,clickable:R=!1,selected:N=!1,disabled:l=!1,as:S="span",className:L,onClick:z,...M}){let P=(0,k.useUILabels)(),E=S,V=(0,o.cn)("inline-flex items-center justify-center font-medium transition-all",Q[n],Z[C],a==="outlined"&&"border"),W=(0,o.cn)(b||p||u?(0,o.cn)(b,p,u):J[s][a]),I=N?"ring-2 ring-offset-1 ring-blue-500":"",j=R&&!l?"cursor-pointer hover:opacity-80 active:scale-95":"",B=l?"opacity-50 cursor-not-allowed":"",H=i=>{i.stopPropagation(),w?.()},O=i=>{l||z?.(i)},y=r??t;return(0,e.jsxs)(E,{className:(0,o.cn)(V,W,I,j,B,L),onClick:O,"aria-disabled":l,...M,children:[a==="dot"&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full shrink-0",Y[n],K[s]),"aria-hidden":"true"}),d&&(0,e.jsx)("span",{className:(0,o.cn)("rounded-full overflow-hidden shrink-0",X[n]),children:d}),x&&!d&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:x}),y&&(0,e.jsx)("span",{className:"truncate",children:y}),h&&!m&&(0,e.jsx)("span",{className:(0,o.cn)("shrink-0",c[n]),children:h}),m&&(0,e.jsx)("button",{type:"button",onClick:H,disabled:l,className:(0,o.cn)("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",l&&"pointer-events-none"),"aria-label":v??P.chipRemove,children:(0,e.jsx)(G,{className:c[n]})})]})}f.displayName="Chip";0&&(module.exports={Chip});
@@ -1 +1 @@
1
- "use client";import{cn as e}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{jsx as t,jsxs as G}from"react/jsx-runtime";function H({className:n}){return t("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var O={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-600 text-white",outlined:"border-green-600 text-green-600 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-600 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-600 text-white",outlined:"border-cyan-600 text-cyan-600 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},T={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},U={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},d={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},q={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},A={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},D={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function F({label:n,children:m,variant:a="solid",size:r="md",color:i="default",bgColor:g,textColor:c,borderColor:b,rounded:y="full",icon:p,endIcon:u,avatar:s,onClose:k,closable:x=!1,removeLabel:f,clickable:C=!1,selected:w=!1,disabled:o=!1,as:v="span",className:R,onClick:N,...S}){let L=B(),z=v,M=e("inline-flex items-center justify-center font-medium transition-all",U[r],D[y],a==="outlined"&&"border"),P=e(g||c||b?e(g,c,b):O[i][a]),E=w?"ring-2 ring-offset-1 ring-blue-500":"",V=C&&!o?"cursor-pointer hover:opacity-80 active:scale-95":"",W=o?"opacity-50 cursor-not-allowed":"",I=l=>{l.stopPropagation(),k?.()},j=l=>{o||N?.(l)},h=m??n;return G(z,{className:e(M,P,E,V,W,R),onClick:j,"aria-disabled":o,...S,children:[a==="dot"&&t("span",{className:e("rounded-full shrink-0",A[r],T[i]),"aria-hidden":"true"}),s&&t("span",{className:e("rounded-full overflow-hidden shrink-0",q[r]),children:s}),p&&!s&&t("span",{className:e("shrink-0",d[r]),children:p}),h&&t("span",{className:"truncate",children:h}),u&&!x&&t("span",{className:e("shrink-0",d[r]),children:u}),x&&t("button",{type:"button",onClick:I,disabled:o,className:e("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",o&&"pointer-events-none"),"aria-label":f??L.chipRemove,children:t(H,{className:d[r]})})]})}F.displayName="Chip";export{F as Chip};
1
+ "use client";import{cn as e}from"../../lib/cn.js";import{useUILabels as B}from"../../lib/i18n.js";import{jsx as t,jsxs as G}from"react/jsx-runtime";function H({className:n}){return t("svg",{className:n,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:t("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var O={default:{solid:"bg-gray-500 text-white",outlined:"border-gray-300 text-gray-700 dark:border-gray-600 dark:text-gray-300 bg-transparent",soft:"bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300",dot:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"},primary:{solid:"bg-blue-600 text-white",outlined:"border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400 bg-transparent",soft:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",dot:"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300"},success:{solid:"bg-green-700 text-white",outlined:"border-green-600 text-green-700 dark:border-green-400 dark:text-green-400 bg-transparent",soft:"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-300",dot:"bg-green-50 text-green-700 dark:bg-green-900/30 dark:text-green-300"},warning:{solid:"bg-yellow-500 text-gray-900",outlined:"border-yellow-500 text-yellow-700 dark:border-yellow-400 dark:text-yellow-400 bg-transparent",soft:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",dot:"bg-yellow-50 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-300"},error:{solid:"bg-red-600 text-white",outlined:"border-red-600 text-red-600 dark:border-red-400 dark:text-red-400 bg-transparent",soft:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",dot:"bg-red-50 text-red-700 dark:bg-red-900/30 dark:text-red-300"},info:{solid:"bg-cyan-700 text-white",outlined:"border-cyan-600 text-cyan-700 dark:border-cyan-400 dark:text-cyan-400 bg-transparent",soft:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/50 dark:text-cyan-300",dot:"bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300"}},T={default:"bg-gray-500",primary:"bg-blue-600",success:"bg-green-600",warning:"bg-yellow-500",error:"bg-red-600",info:"bg-cyan-600"},U={sm:"h-5 text-xs px-2 gap-1",md:"h-6 text-sm px-2.5 gap-1.5",lg:"h-8 text-sm px-3 gap-2"},d={sm:"w-3 h-3",md:"w-3.5 h-3.5",lg:"w-4 h-4"},q={sm:"w-4 h-4 -ml-1",md:"w-5 h-5 -ml-1.5",lg:"w-6 h-6 -ml-1.5"},A={sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"},D={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"};function F({label:n,children:m,variant:a="solid",size:r="md",color:i="default",bgColor:g,textColor:c,borderColor:b,rounded:y="full",icon:p,endIcon:u,avatar:s,onClose:k,closable:x=!1,removeLabel:f,clickable:C=!1,selected:w=!1,disabled:o=!1,as:v="span",className:R,onClick:N,...S}){let L=B(),z=v,M=e("inline-flex items-center justify-center font-medium transition-all",U[r],D[y],a==="outlined"&&"border"),P=e(g||c||b?e(g,c,b):O[i][a]),E=w?"ring-2 ring-offset-1 ring-blue-500":"",V=C&&!o?"cursor-pointer hover:opacity-80 active:scale-95":"",W=o?"opacity-50 cursor-not-allowed":"",I=l=>{l.stopPropagation(),k?.()},j=l=>{o||N?.(l)},h=m??n;return G(z,{className:e(M,P,E,V,W,R),onClick:j,"aria-disabled":o,...S,children:[a==="dot"&&t("span",{className:e("rounded-full shrink-0",A[r],T[i]),"aria-hidden":"true"}),s&&t("span",{className:e("rounded-full overflow-hidden shrink-0",q[r]),children:s}),p&&!s&&t("span",{className:e("shrink-0",d[r]),children:p}),h&&t("span",{className:"truncate",children:h}),u&&!x&&t("span",{className:e("shrink-0",d[r]),children:u}),x&&t("button",{type:"button",onClick:I,disabled:o,className:e("shrink-0 rounded-full hover:bg-black/10 dark:hover:bg-white/10 p-0.5 -mr-1 transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current",o&&"pointer-events-none"),"aria-label":f??L.chipRemove,children:t(H,{className:d[r]})})]})}F.displayName="Chip";export{F as Chip};
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var M=(e,r)=>{for(var o in r)m(e,o,{get:r[o],enumerable:!0})},V=(e,r,o,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of T(r))!W.call(e,s)&&s!==o&&m(e,s,{get:()=>r[s],enumerable:!(l=S(r,s))||l.enumerable});return e};var $=e=>V(m({},"__esModule",{value:!0}),e);var L={};M(L,{CircularProgress:()=>f});module.exports=$(L);var n=require("../../lib/cn.cjs"),t=require("react/jsx-runtime"),D={default:"stroke-gray-500 dark:stroke-gray-400",primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-500 dark:stroke-yellow-400",error:"stroke-red-600 dark:stroke-red-500",info:"stroke-cyan-600 dark:stroke-cyan-500"},O={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",info:"text-cyan-600 dark:text-cyan-400"},j={xs:24,sm:32,md:48,lg:64,xl:96},B={xs:"text-[8px]",sm:"text-[10px]",md:"text-sm",lg:"text-base",xl:"text-xl"},I={thin:2,normal:4,thick:8};function f({value:e=0,indeterminate:r=!1,size:o="md",thickness:l="normal",color:s="primary",progressColor:p,trackColor:y,showValue:h=!1,children:C,valueFormat:k,animated:P=!0,className:v,...b}){let i=Math.min(100,Math.max(0,e)),a=j[o],u=I[l],g=(a-u)/2,c=2*Math.PI*g,d=a/2,w=c-i/100*c,N=p||D[s],R=y||"stroke-gray-200 dark:stroke-gray-700",z=O[s],x=C??(h&&!r?(0,t.jsx)("span",{className:(0,n.cn)("font-semibold",B[o],z),children:k?k(i):`${Math.round(i)}%`}):null);return(0,t.jsxs)("div",{className:(0,n.cn)("relative inline-flex items-center justify-center",v),role:"progressbar","aria-valuenow":r?void 0:i,"aria-valuemin":0,"aria-valuemax":100,...b,children:[(0,t.jsxs)("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:(0,n.cn)(r&&"animate-spin"),style:{transform:"rotate(-90deg)"},children:[(0,t.jsx)("circle",{cx:d,cy:d,r:g,fill:"none",strokeWidth:u,className:R}),(0,t.jsx)("circle",{cx:d,cy:d,r:g,fill:"none",strokeWidth:u,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:r?c*.75:w,className:(0,n.cn)(N,P&&!r&&"transition-[stroke-dashoffset] duration-300 ease-out")})]}),x&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",style:{transform:"rotate(0deg)"},children:x})]})}f.displayName="CircularProgress";0&&(module.exports={CircularProgress});
1
+ "use strict";var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var M=(e,r)=>{for(var o in r)m(e,o,{get:r[o],enumerable:!0})},V=(e,r,o,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of T(r))!W.call(e,s)&&s!==o&&m(e,s,{get:()=>r[s],enumerable:!(l=S(r,s))||l.enumerable});return e};var $=e=>V(m({},"__esModule",{value:!0}),e);var L={};M(L,{CircularProgress:()=>f});module.exports=$(L);var n=require("../../lib/cn.cjs"),t=require("react/jsx-runtime"),D={default:"stroke-gray-500 dark:stroke-gray-400",primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-500 dark:stroke-yellow-400",error:"stroke-red-600 dark:stroke-red-500",info:"stroke-cyan-600 dark:stroke-cyan-500"},O={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-700 dark:text-green-400",warning:"text-yellow-700 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",info:"text-cyan-700 dark:text-cyan-400"},j={xs:24,sm:32,md:48,lg:64,xl:96},B={xs:"text-[8px]",sm:"text-[10px]",md:"text-sm",lg:"text-base",xl:"text-xl"},I={thin:2,normal:4,thick:8};function f({value:e=0,indeterminate:r=!1,size:o="md",thickness:l="normal",color:s="primary",progressColor:p,trackColor:y,showValue:h=!1,children:C,valueFormat:k,animated:P=!0,className:v,...b}){let i=Math.min(100,Math.max(0,e)),a=j[o],u=I[l],g=(a-u)/2,c=2*Math.PI*g,d=a/2,w=c-i/100*c,N=p||D[s],R=y||"stroke-gray-200 dark:stroke-gray-700",z=O[s],x=C??(h&&!r?(0,t.jsx)("span",{className:(0,n.cn)("font-semibold",B[o],z),children:k?k(i):`${Math.round(i)}%`}):null);return(0,t.jsxs)("div",{className:(0,n.cn)("relative inline-flex items-center justify-center",v),role:"progressbar","aria-valuenow":r?void 0:i,"aria-valuemin":0,"aria-valuemax":100,...b,children:[(0,t.jsxs)("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:(0,n.cn)(r&&"animate-spin"),style:{transform:"rotate(-90deg)"},children:[(0,t.jsx)("circle",{cx:d,cy:d,r:g,fill:"none",strokeWidth:u,className:R}),(0,t.jsx)("circle",{cx:d,cy:d,r:g,fill:"none",strokeWidth:u,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:r?c*.75:w,className:(0,n.cn)(N,P&&!r&&"transition-[stroke-dashoffset] duration-300 ease-out")})]}),x&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",style:{transform:"rotate(0deg)"},children:x})]})}f.displayName="CircularProgress";0&&(module.exports={CircularProgress});
@@ -1 +1 @@
1
- import{cn as a}from"../../lib/cn.js";import{jsx as n,jsxs as m}from"react/jsx-runtime";var z={default:"stroke-gray-500 dark:stroke-gray-400",primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-500 dark:stroke-yellow-400",error:"stroke-red-600 dark:stroke-red-500",info:"stroke-cyan-600 dark:stroke-cyan-500"},S={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-600 dark:text-green-400",warning:"text-yellow-600 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",info:"text-cyan-600 dark:text-cyan-400"},T={xs:24,sm:32,md:48,lg:64,xl:96},W={xs:"text-[8px]",sm:"text-[10px]",md:"text-sm",lg:"text-base",xl:"text-xl"},M={thin:2,normal:4,thick:8};function V({value:k=0,indeterminate:e=!1,size:c="md",thickness:x="normal",color:d="primary",progressColor:f,trackColor:p,showValue:y=!1,children:h,valueFormat:u,animated:C=!0,className:P,...v}){let s=Math.min(100,Math.max(0,k)),r=T[c],l=M[x],i=(r-l)/2,t=2*Math.PI*i,o=r/2,b=t-s/100*t,w=f||z[d],N=p||"stroke-gray-200 dark:stroke-gray-700",R=S[d],g=h??(y&&!e?n("span",{className:a("font-semibold",W[c],R),children:u?u(s):`${Math.round(s)}%`}):null);return m("div",{className:a("relative inline-flex items-center justify-center",P),role:"progressbar","aria-valuenow":e?void 0:s,"aria-valuemin":0,"aria-valuemax":100,...v,children:[m("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:a(e&&"animate-spin"),style:{transform:"rotate(-90deg)"},children:[n("circle",{cx:o,cy:o,r:i,fill:"none",strokeWidth:l,className:N}),n("circle",{cx:o,cy:o,r:i,fill:"none",strokeWidth:l,strokeLinecap:"round",strokeDasharray:t,strokeDashoffset:e?t*.75:b,className:a(w,C&&!e&&"transition-[stroke-dashoffset] duration-300 ease-out")})]}),g&&n("div",{className:"absolute inset-0 flex items-center justify-center",style:{transform:"rotate(0deg)"},children:g})]})}V.displayName="CircularProgress";export{V as CircularProgress};
1
+ import{cn as a}from"../../lib/cn.js";import{jsx as n,jsxs as m}from"react/jsx-runtime";var z={default:"stroke-gray-500 dark:stroke-gray-400",primary:"stroke-blue-600 dark:stroke-blue-500",success:"stroke-green-600 dark:stroke-green-500",warning:"stroke-yellow-500 dark:stroke-yellow-400",error:"stroke-red-600 dark:stroke-red-500",info:"stroke-cyan-600 dark:stroke-cyan-500"},S={default:"text-gray-700 dark:text-gray-300",primary:"text-blue-600 dark:text-blue-400",success:"text-green-700 dark:text-green-400",warning:"text-yellow-700 dark:text-yellow-400",error:"text-red-600 dark:text-red-400",info:"text-cyan-700 dark:text-cyan-400"},T={xs:24,sm:32,md:48,lg:64,xl:96},W={xs:"text-[8px]",sm:"text-[10px]",md:"text-sm",lg:"text-base",xl:"text-xl"},M={thin:2,normal:4,thick:8};function V({value:k=0,indeterminate:e=!1,size:c="md",thickness:x="normal",color:d="primary",progressColor:f,trackColor:p,showValue:y=!1,children:h,valueFormat:u,animated:C=!0,className:P,...v}){let s=Math.min(100,Math.max(0,k)),r=T[c],l=M[x],i=(r-l)/2,t=2*Math.PI*i,o=r/2,b=t-s/100*t,w=f||z[d],N=p||"stroke-gray-200 dark:stroke-gray-700",R=S[d],g=h??(y&&!e?n("span",{className:a("font-semibold",W[c],R),children:u?u(s):`${Math.round(s)}%`}):null);return m("div",{className:a("relative inline-flex items-center justify-center",P),role:"progressbar","aria-valuenow":e?void 0:s,"aria-valuemin":0,"aria-valuemax":100,...v,children:[m("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:a(e&&"animate-spin"),style:{transform:"rotate(-90deg)"},children:[n("circle",{cx:o,cy:o,r:i,fill:"none",strokeWidth:l,className:N}),n("circle",{cx:o,cy:o,r:i,fill:"none",strokeWidth:l,strokeLinecap:"round",strokeDasharray:t,strokeDashoffset:e?t*.75:b,className:a(w,C&&!e&&"transition-[stroke-dashoffset] duration-300 ease-out")})]}),g&&n("div",{className:"absolute inset-0 flex items-center justify-center",style:{transform:"rotate(0deg)"},children:g})]})}V.displayName="CircularProgress";export{V as CircularProgress};
@@ -1 +1 @@
1
- "use strict";"use client";var R=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var I=(t,a)=>{for(var r in a)R(t,r,{get:a[r],enumerable:!0})},V=(t,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of P(a))!L.call(t,d)&&d!==r&&R(t,d,{get:()=>a[d],enumerable:!(i=A(a,d))||i.enumerable});return t};var X=t=>V(R({},"__esModule",{value:!0}),t);var ee={};I(ee,{DeviceMockup:()=>$});module.exports=X(ee);var p=require("react"),o=require("../../lib/cn.cjs"),B=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime"),j={phone:{sm:{w:180,h:320},md:{w:240,h:480},lg:{w:300,h:600}},android:{sm:{w:180,h:320},md:{w:240,h:480},lg:{w:300,h:600}},tablet:{sm:{w:320,h:420},md:{w:420,h:560},lg:{w:540,h:720}},laptop:{sm:{w:400,h:250},md:{w:560,h:350},lg:{w:720,h:450}},desktop:{sm:{w:400,h:300},md:{w:560,h:400},lg:{w:720,h:520}},watch:{sm:{w:80,h:96},md:{w:120,h:144},lg:{w:160,h:192}},browser:{sm:{w:400,h:280},md:{w:560,h:380},lg:{w:720,h:480}}},q=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-3 h-3",t),viewBox:"0 0 16 16",fill:"currentColor",children:[(0,e.jsx)("rect",{x:"1",y:"11",width:"2.5",height:"4",rx:"0.5"}),(0,e.jsx)("rect",{x:"5",y:"8",width:"2.5",height:"7",rx:"0.5"}),(0,e.jsx)("rect",{x:"9",y:"5",width:"2.5",height:"10",rx:"0.5"}),(0,e.jsx)("rect",{x:"13",y:"1",width:"2.5",height:"14",rx:"0.5"})]}),E=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-3 h-3",t),viewBox:"0 0 20 20",fill:"currentColor",children:[(0,e.jsx)("path",{d:"M10 14.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3z"}),(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.05 11.95a5.5 5.5 0 017.9 0 .75.75 0 001.08-1.04 7 7 0 00-10.06 0 .75.75 0 001.08 1.04z",clipRule:"evenodd"}),(0,e.jsx)("path",{fillRule:"evenodd",d:"M2.81 8.72a10 10 0 0114.38 0 .75.75 0 001.06-1.06 11.5 11.5 0 00-16.5 0 .75.75 0 001.06 1.06z",clipRule:"evenodd"})]}),O=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-4 h-3",t),viewBox:"0 0 24 14",fill:"currentColor",children:[(0,e.jsx)("rect",{x:"0.5",y:"0.5",width:"20",height:"13",rx:"2",stroke:"currentColor",fill:"none",strokeWidth:"1"}),(0,e.jsx)("rect",{x:"22",y:"4",width:"2",height:"6",rx:"0.5"}),(0,e.jsx)("rect",{x:"2.5",y:"2.5",width:"14",height:"9",rx:"1"})]});function f({time:t="9:41",theme:a,device:r}){let i=r==="watch",d=a==="dark"?"text-white":"text-gray-900";return i?(0,e.jsx)("div",{className:(0,o.cn)("flex items-center justify-center py-0.5",d),style:{fontSize:"8px"},children:(0,e.jsx)("span",{className:"font-medium",children:t})}):(0,e.jsxs)("div",{className:(0,o.cn)("flex items-center justify-between px-4 py-1",a==="dark"?"bg-black/20":"bg-white/20",d),style:{fontSize:"10px"},"data-testid":"status-bar",children:[(0,e.jsx)("span",{className:"font-semibold",children:t}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(q,{className:d}),(0,e.jsx)(E,{className:d}),(0,e.jsx)(O,{className:d})]})]})}function U({theme:t}){let a=t==="dark";return(0,e.jsxs)("div",{className:(0,o.cn)("flex items-center gap-2 px-3 py-2 border-b",a?"bg-gray-800 border-gray-700":"bg-gray-100 border-gray-200"),"data-testid":"browser-chrome",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-400"}),(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-green-400"})]}),(0,e.jsx)("div",{className:(0,o.cn)("flex-1 rounded-md px-3 py-1 text-center",a?"bg-gray-700 text-gray-400":"bg-white text-gray-500 border border-gray-200"),style:{fontSize:"11px"},children:(0,e.jsxs)("span",{className:"flex items-center justify-center gap-1",children:[(0,e.jsx)("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,e.jsx)("path",{fillRule:"evenodd",d:"M8 1a4 4 0 00-4 4v3.5H3a1 1 0 00-1 1V14a1 1 0 001 1h10a1 1 0 001-1V9.5a1 1 0 00-1-1h-1V5a4 4 0 00-4-4zm2.5 7.5V5a2.5 2.5 0 00-5 0v3.5h5z",clipRule:"evenodd"})}),"example.com"]})})]})}function Y({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l,landscape:n=!1}){let h=a==="dark",c=l??(h?"#1a1a1a":"#e5e7eb");if(n){let m=Math.round(i*.35);return(0,e.jsxs)("div",{className:"relative inline-flex flex-row items-center rounded-[2.5rem] shadow-xl",style:{backgroundColor:c,padding:"8px 12px",height:i+16},"data-testid":"device-frame","data-device":"phone",children:[(0,e.jsx)("div",{className:(0,o.cn)("rounded-full mr-2",h?"bg-gray-600":"bg-gray-400"),style:{width:4,height:Math.round(i*.35)},"data-testid":"home-indicator"}),(0,e.jsxs)("div",{className:"rounded-[2rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"phone"}),t]}),(0,e.jsx)("div",{className:"absolute rounded-full bg-black z-10",style:{width:20,height:m,right:10,top:"50%",transform:"translateY(-50%)"},"data-testid":"phone-notch"})]})}let w=Math.round(r*.35);return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[2.5rem] shadow-xl",style:{backgroundColor:c,padding:"12px 8px",width:r+16},"data-testid":"device-frame","data-device":"phone",children:[(0,e.jsx)("div",{className:"absolute top-[10px] rounded-full bg-black z-10",style:{width:w,height:20,left:"50%",transform:"translateX(-50%)"},"data-testid":"phone-notch"}),(0,e.jsxs)("div",{className:"rounded-[2rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"phone"}),t]}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-full mt-2",h?"bg-gray-600":"bg-gray-400"),style:{width:Math.round(r*.35),height:4},"data-testid":"home-indicator"})]})}function G({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[2rem] shadow-xl",style:{backgroundColor:l??(a==="dark"?"#1a1a1a":"#e5e7eb"),padding:"10px 6px",width:r+12},"data-testid":"device-frame","data-device":"android",children:[(0,e.jsx)("div",{className:"absolute top-[6px] rounded-full bg-gray-800 z-10 border border-gray-700",style:{width:8,height:8,left:"50%",transform:"translateX(-50%)"},"data-testid":"camera-dot"}),(0,e.jsxs)("div",{className:"rounded-[1.5rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"android"}),t]})]})}function J({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[1.5rem] shadow-xl",style:{backgroundColor:l??(a==="dark"?"#1a1a1a":"#e5e7eb"),padding:"16px 12px",width:r+24},"data-testid":"device-frame","data-device":"tablet",children:[(0,e.jsx)("div",{className:"absolute top-[8px] rounded-full bg-gray-700 z-10",style:{width:6,height:6,left:"50%",transform:"translateX(-50%)"}}),(0,e.jsxs)("div",{className:"rounded-lg overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"tablet"}),t]})]})}function K({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){let s=a==="dark",l=d??(s?"#1a1a1a":"#d1d5db"),n=r+60;return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"laptop",children:[(0,e.jsxs)("div",{className:"rounded-t-xl shadow-xl relative",style:{backgroundColor:l,padding:"8px 8px 0",width:r+16},children:[(0,e.jsx)("div",{className:"absolute top-[3px] rounded-full bg-gray-700 z-10",style:{width:4,height:4,left:"50%",transform:"translateX(-50%)"}}),(0,e.jsx)("div",{className:"rounded-t-sm overflow-hidden bg-black",style:{width:r,height:i},children:t})]}),(0,e.jsx)("div",{className:(0,o.cn)(s?"bg-gray-800":"bg-gray-400"),style:{width:r+16,height:3}}),(0,e.jsx)("div",{className:"rounded-b-xl shadow-lg",style:{backgroundColor:l,width:n,height:12,clipPath:"polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%)"},"data-testid":"laptop-base"})]})}function Q({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){let s=a==="dark";return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"desktop",children:[(0,e.jsx)("div",{className:"rounded-lg shadow-xl",style:{backgroundColor:d??(s?"#1a1a1a":"#d1d5db"),padding:"8px 8px 20px",width:r+16},children:(0,e.jsx)("div",{className:"rounded-sm overflow-hidden bg-black",style:{width:r,height:i},children:t})}),(0,e.jsx)("div",{className:(0,o.cn)(s?"bg-gray-800":"bg-gray-400"),style:{width:40,height:24},"data-testid":"monitor-stand"}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-t-sm",s?"bg-gray-800":"bg-gray-400"),style:{width:Math.round(r*.4),height:6,borderRadius:"2px 2px 4px 4px"}})]})}function Z({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){let n=a==="dark",h=l??(n?"#1a1a1a":"#d1d5db"),c=Math.round(r*.7);return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"watch",children:[(0,e.jsx)("div",{className:(0,o.cn)("rounded-t-lg",n?"bg-gray-800":"bg-gray-400"),style:{width:c,height:30},"data-testid":"watch-band"}),(0,e.jsxs)("div",{className:"relative rounded-[1.2rem] shadow-xl",style:{backgroundColor:h,padding:"8px 6px",width:r+12},children:[(0,e.jsx)("div",{className:(0,o.cn)("absolute rounded-sm",n?"bg-gray-600":"bg-gray-400"),style:{width:4,height:16,right:-4,top:"30%"},"data-testid":"watch-crown"}),(0,e.jsxs)("div",{className:"rounded-xl overflow-hidden bg-black",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"watch"}),t]})]}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-b-lg",n?"bg-gray-800":"bg-gray-400"),style:{width:c,height:30}})]})}function _({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){return(0,e.jsxs)("div",{className:"inline-flex flex-col rounded-lg shadow-xl overflow-hidden",style:{backgroundColor:d??(a==="dark"?"#1f2937":"#f3f4f6"),width:r},"data-testid":"device-frame","data-device":"browser",children:[(0,e.jsx)(U,{theme:a}),(0,e.jsx)("div",{className:"overflow-hidden bg-white",style:{width:r,height:i},children:t})]})}function $({device:t="phone",src:a,alt:r,children:i,orientation:d="portrait",theme:s="dark",size:l="md",showStatusBar:n=!1,statusBarTime:h,animated:c=!1,scrollSpeed:w=30,frameColor:m,className:F,contentClassName:H}){let M=(0,B.useUILabels)(),D=(0,p.useRef)(null),x=(0,p.useRef)(null),y=j[t][l],C=d==="landscape"&&t!=="watch"&&t!=="browser",g=C?y.h:y.w,u=C?y.w:y.h;(0,p.useEffect)(()=>{if(!c||!D.current)return;let b=D.current,k=null,z=T=>{k===null&&(k=T);let W=(T-k)/1e3;k=T,b.scrollTop+=w*W,b.scrollTop>=b.scrollHeight-b.clientHeight&&(b.scrollTop=0),x.current=requestAnimationFrame(z)};return x.current=requestAnimationFrame(z),()=>{x.current!==null&&cancelAnimationFrame(x.current)}},[c,w]);let v=(0,e.jsx)("div",{ref:c?D:void 0,className:(0,o.cn)("w-full h-full overflow-hidden",c&&"overflow-y-auto scrollbar-hide",H),style:c?{scrollBehavior:"auto"}:void 0,children:a?(0,e.jsx)("img",{src:a,alt:r??M.deviceMockupAlt,className:"w-full h-auto object-cover",draggable:!1}):i}),N={showStatusBar:n,statusBarTime:h},S=()=>{switch(t){case"phone":return(0,e.jsx)(Y,{theme:s,screenW:g,screenH:u,frameColor:m,landscape:C,...N,children:v});case"android":return(0,e.jsx)(G,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"tablet":return(0,e.jsx)(J,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"laptop":return(0,e.jsx)(K,{theme:s,screenW:g,screenH:u,frameColor:m,children:v});case"desktop":return(0,e.jsx)(Q,{theme:s,screenW:g,screenH:u,frameColor:m,children:v});case"watch":return(0,e.jsx)(Z,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"browser":return(0,e.jsx)(_,{theme:s,screenW:g,screenH:u,frameColor:m,children:v})}};return(0,e.jsx)("div",{className:(0,o.cn)("inline-flex",F),"data-testid":"device-mockup","data-orientation":d,"data-theme":s,"data-size":l,children:S()})}0&&(module.exports={DeviceMockup});
1
+ "use strict";"use client";var R=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var I=(t,a)=>{for(var r in a)R(t,r,{get:a[r],enumerable:!0})},V=(t,a,r,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of P(a))!L.call(t,d)&&d!==r&&R(t,d,{get:()=>a[d],enumerable:!(i=A(a,d))||i.enumerable});return t};var X=t=>V(R({},"__esModule",{value:!0}),t);var ee={};I(ee,{DeviceMockup:()=>$});module.exports=X(ee);var p=require("react"),o=require("../../lib/cn.cjs"),B=require("../../lib/i18n.cjs"),e=require("react/jsx-runtime"),j={phone:{sm:{w:180,h:320},md:{w:240,h:480},lg:{w:300,h:600}},android:{sm:{w:180,h:320},md:{w:240,h:480},lg:{w:300,h:600}},tablet:{sm:{w:320,h:420},md:{w:420,h:560},lg:{w:540,h:720}},laptop:{sm:{w:400,h:250},md:{w:560,h:350},lg:{w:720,h:450}},desktop:{sm:{w:400,h:300},md:{w:560,h:400},lg:{w:720,h:520}},watch:{sm:{w:80,h:96},md:{w:120,h:144},lg:{w:160,h:192}},browser:{sm:{w:400,h:280},md:{w:560,h:380},lg:{w:720,h:480}}},q=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-3 h-3",t),viewBox:"0 0 16 16",fill:"currentColor",children:[(0,e.jsx)("rect",{x:"1",y:"11",width:"2.5",height:"4",rx:"0.5"}),(0,e.jsx)("rect",{x:"5",y:"8",width:"2.5",height:"7",rx:"0.5"}),(0,e.jsx)("rect",{x:"9",y:"5",width:"2.5",height:"10",rx:"0.5"}),(0,e.jsx)("rect",{x:"13",y:"1",width:"2.5",height:"14",rx:"0.5"})]}),E=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-3 h-3",t),viewBox:"0 0 20 20",fill:"currentColor",children:[(0,e.jsx)("path",{d:"M10 14.5a1.5 1.5 0 100 3 1.5 1.5 0 000-3z"}),(0,e.jsx)("path",{fillRule:"evenodd",d:"M6.05 11.95a5.5 5.5 0 017.9 0 .75.75 0 001.08-1.04 7 7 0 00-10.06 0 .75.75 0 001.08 1.04z",clipRule:"evenodd"}),(0,e.jsx)("path",{fillRule:"evenodd",d:"M2.81 8.72a10 10 0 0114.38 0 .75.75 0 001.06-1.06 11.5 11.5 0 00-16.5 0 .75.75 0 001.06 1.06z",clipRule:"evenodd"})]}),O=({className:t})=>(0,e.jsxs)("svg",{className:(0,o.cn)("w-4 h-3",t),viewBox:"0 0 24 14",fill:"currentColor",children:[(0,e.jsx)("rect",{x:"0.5",y:"0.5",width:"20",height:"13",rx:"2",stroke:"currentColor",fill:"none",strokeWidth:"1"}),(0,e.jsx)("rect",{x:"22",y:"4",width:"2",height:"6",rx:"0.5"}),(0,e.jsx)("rect",{x:"2.5",y:"2.5",width:"14",height:"9",rx:"1"})]});function f({time:t="9:41",theme:a,device:r}){let i=r==="watch",d=a==="dark"?"text-white":"text-gray-900";return i?(0,e.jsx)("div",{className:(0,o.cn)("flex items-center justify-center py-0.5",d),style:{fontSize:"8px"},children:(0,e.jsx)("span",{className:"font-medium",children:t})}):(0,e.jsxs)("div",{className:(0,o.cn)("flex items-center justify-between px-4 py-1",a==="dark"?"bg-black/20":"bg-white/20",d),style:{fontSize:"10px"},"data-testid":"status-bar",children:[(0,e.jsx)("span",{className:"font-semibold",children:t}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(q,{className:d}),(0,e.jsx)(E,{className:d}),(0,e.jsx)(O,{className:d})]})]})}function U({theme:t}){let a=t==="dark";return(0,e.jsxs)("div",{className:(0,o.cn)("flex items-center gap-2 px-3 py-2 border-b",a?"bg-gray-800 border-gray-700":"bg-gray-100 border-gray-200"),"data-testid":"browser-chrome",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-red-400"}),(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-400"}),(0,e.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-green-400"})]}),(0,e.jsx)("div",{className:(0,o.cn)("flex-1 rounded-md px-3 py-1 text-center",a?"bg-gray-700 text-gray-300":"bg-white text-gray-500 border border-gray-200"),style:{fontSize:"11px"},children:(0,e.jsxs)("span",{className:"flex items-center justify-center gap-1",children:[(0,e.jsx)("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,e.jsx)("path",{fillRule:"evenodd",d:"M8 1a4 4 0 00-4 4v3.5H3a1 1 0 00-1 1V14a1 1 0 001 1h10a1 1 0 001-1V9.5a1 1 0 00-1-1h-1V5a4 4 0 00-4-4zm2.5 7.5V5a2.5 2.5 0 00-5 0v3.5h5z",clipRule:"evenodd"})}),"example.com"]})})]})}function Y({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l,landscape:n=!1}){let h=a==="dark",c=l??(h?"#1a1a1a":"#e5e7eb");if(n){let m=Math.round(i*.35);return(0,e.jsxs)("div",{className:"relative inline-flex flex-row items-center rounded-[2.5rem] shadow-xl",style:{backgroundColor:c,padding:"8px 12px",height:i+16},"data-testid":"device-frame","data-device":"phone",children:[(0,e.jsx)("div",{className:(0,o.cn)("rounded-full mr-2",h?"bg-gray-600":"bg-gray-400"),style:{width:4,height:Math.round(i*.35)},"data-testid":"home-indicator"}),(0,e.jsxs)("div",{className:"rounded-[2rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"phone"}),t]}),(0,e.jsx)("div",{className:"absolute rounded-full bg-black z-10",style:{width:20,height:m,right:10,top:"50%",transform:"translateY(-50%)"},"data-testid":"phone-notch"})]})}let w=Math.round(r*.35);return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[2.5rem] shadow-xl",style:{backgroundColor:c,padding:"12px 8px",width:r+16},"data-testid":"device-frame","data-device":"phone",children:[(0,e.jsx)("div",{className:"absolute top-[10px] rounded-full bg-black z-10",style:{width:w,height:20,left:"50%",transform:"translateX(-50%)"},"data-testid":"phone-notch"}),(0,e.jsxs)("div",{className:"rounded-[2rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"phone"}),t]}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-full mt-2",h?"bg-gray-600":"bg-gray-400"),style:{width:Math.round(r*.35),height:4},"data-testid":"home-indicator"})]})}function G({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[2rem] shadow-xl",style:{backgroundColor:l??(a==="dark"?"#1a1a1a":"#e5e7eb"),padding:"10px 6px",width:r+12},"data-testid":"device-frame","data-device":"android",children:[(0,e.jsx)("div",{className:"absolute top-[6px] rounded-full bg-gray-800 z-10 border border-gray-700",style:{width:8,height:8,left:"50%",transform:"translateX(-50%)"},"data-testid":"camera-dot"}),(0,e.jsxs)("div",{className:"rounded-[1.5rem] overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"android"}),t]})]})}function J({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){return(0,e.jsxs)("div",{className:"relative inline-flex flex-col items-center rounded-[1.5rem] shadow-xl",style:{backgroundColor:l??(a==="dark"?"#1a1a1a":"#e5e7eb"),padding:"16px 12px",width:r+24},"data-testid":"device-frame","data-device":"tablet",children:[(0,e.jsx)("div",{className:"absolute top-[8px] rounded-full bg-gray-700 z-10",style:{width:6,height:6,left:"50%",transform:"translateX(-50%)"}}),(0,e.jsxs)("div",{className:"rounded-lg overflow-hidden bg-black relative",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"tablet"}),t]})]})}function K({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){let s=a==="dark",l=d??(s?"#1a1a1a":"#d1d5db"),n=r+60;return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"laptop",children:[(0,e.jsxs)("div",{className:"rounded-t-xl shadow-xl relative",style:{backgroundColor:l,padding:"8px 8px 0",width:r+16},children:[(0,e.jsx)("div",{className:"absolute top-[3px] rounded-full bg-gray-700 z-10",style:{width:4,height:4,left:"50%",transform:"translateX(-50%)"}}),(0,e.jsx)("div",{className:"rounded-t-sm overflow-hidden bg-black",style:{width:r,height:i},children:t})]}),(0,e.jsx)("div",{className:(0,o.cn)(s?"bg-gray-800":"bg-gray-400"),style:{width:r+16,height:3}}),(0,e.jsx)("div",{className:"rounded-b-xl shadow-lg",style:{backgroundColor:l,width:n,height:12,clipPath:"polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%)"},"data-testid":"laptop-base"})]})}function Q({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){let s=a==="dark";return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"desktop",children:[(0,e.jsx)("div",{className:"rounded-lg shadow-xl",style:{backgroundColor:d??(s?"#1a1a1a":"#d1d5db"),padding:"8px 8px 20px",width:r+16},children:(0,e.jsx)("div",{className:"rounded-sm overflow-hidden bg-black",style:{width:r,height:i},children:t})}),(0,e.jsx)("div",{className:(0,o.cn)(s?"bg-gray-800":"bg-gray-400"),style:{width:40,height:24},"data-testid":"monitor-stand"}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-t-sm",s?"bg-gray-800":"bg-gray-400"),style:{width:Math.round(r*.4),height:6,borderRadius:"2px 2px 4px 4px"}})]})}function Z({children:t,theme:a,screenW:r,screenH:i,showStatusBar:d,statusBarTime:s,frameColor:l}){let n=a==="dark",h=l??(n?"#1a1a1a":"#d1d5db"),c=Math.round(r*.7);return(0,e.jsxs)("div",{className:"inline-flex flex-col items-center","data-testid":"device-frame","data-device":"watch",children:[(0,e.jsx)("div",{className:(0,o.cn)("rounded-t-lg",n?"bg-gray-800":"bg-gray-400"),style:{width:c,height:30},"data-testid":"watch-band"}),(0,e.jsxs)("div",{className:"relative rounded-[1.2rem] shadow-xl",style:{backgroundColor:h,padding:"8px 6px",width:r+12},children:[(0,e.jsx)("div",{className:(0,o.cn)("absolute rounded-sm",n?"bg-gray-600":"bg-gray-400"),style:{width:4,height:16,right:-4,top:"30%"},"data-testid":"watch-crown"}),(0,e.jsxs)("div",{className:"rounded-xl overflow-hidden bg-black",style:{width:r,height:i},children:[d&&(0,e.jsx)(f,{time:s,theme:a,device:"watch"}),t]})]}),(0,e.jsx)("div",{className:(0,o.cn)("rounded-b-lg",n?"bg-gray-800":"bg-gray-400"),style:{width:c,height:30}})]})}function _({children:t,theme:a,screenW:r,screenH:i,frameColor:d}){return(0,e.jsxs)("div",{className:"inline-flex flex-col rounded-lg shadow-xl overflow-hidden",style:{backgroundColor:d??(a==="dark"?"#1f2937":"#f3f4f6"),width:r},"data-testid":"device-frame","data-device":"browser",children:[(0,e.jsx)(U,{theme:a}),(0,e.jsx)("div",{className:"overflow-hidden bg-white",style:{width:r,height:i},children:t})]})}function $({device:t="phone",src:a,alt:r,children:i,orientation:d="portrait",theme:s="dark",size:l="md",showStatusBar:n=!1,statusBarTime:h,animated:c=!1,scrollSpeed:w=30,frameColor:m,className:F,contentClassName:H}){let M=(0,B.useUILabels)(),D=(0,p.useRef)(null),x=(0,p.useRef)(null),y=j[t][l],C=d==="landscape"&&t!=="watch"&&t!=="browser",g=C?y.h:y.w,u=C?y.w:y.h;(0,p.useEffect)(()=>{if(!c||!D.current)return;let b=D.current,k=null,z=T=>{k===null&&(k=T);let W=(T-k)/1e3;k=T,b.scrollTop+=w*W,b.scrollTop>=b.scrollHeight-b.clientHeight&&(b.scrollTop=0),x.current=requestAnimationFrame(z)};return x.current=requestAnimationFrame(z),()=>{x.current!==null&&cancelAnimationFrame(x.current)}},[c,w]);let v=(0,e.jsx)("div",{ref:c?D:void 0,className:(0,o.cn)("w-full h-full overflow-hidden",c&&"overflow-y-auto scrollbar-hide",H),style:c?{scrollBehavior:"auto"}:void 0,children:a?(0,e.jsx)("img",{src:a,alt:r??M.deviceMockupAlt,className:"w-full h-auto object-cover",draggable:!1}):i}),N={showStatusBar:n,statusBarTime:h},S=()=>{switch(t){case"phone":return(0,e.jsx)(Y,{theme:s,screenW:g,screenH:u,frameColor:m,landscape:C,...N,children:v});case"android":return(0,e.jsx)(G,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"tablet":return(0,e.jsx)(J,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"laptop":return(0,e.jsx)(K,{theme:s,screenW:g,screenH:u,frameColor:m,children:v});case"desktop":return(0,e.jsx)(Q,{theme:s,screenW:g,screenH:u,frameColor:m,children:v});case"watch":return(0,e.jsx)(Z,{theme:s,screenW:g,screenH:u,frameColor:m,...N,children:v});case"browser":return(0,e.jsx)(_,{theme:s,screenW:g,screenH:u,frameColor:m,children:v})}};return(0,e.jsx)("div",{className:(0,o.cn)("inline-flex",F),"data-testid":"device-mockup","data-orientation":d,"data-theme":s,"data-size":l,children:S()})}0&&(module.exports={DeviceMockup});