@brightlocal/ui-components 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.js +2 -2
  4. package/dist/alert.cjs +1 -1
  5. package/dist/alert.js +64 -64
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.js +38 -38
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts.map +1 -1
  10. package/dist/blocks/sidebar.js +23 -23
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.js +34 -34
  13. package/dist/button.cjs +1 -1
  14. package/dist/button.d.ts.map +1 -1
  15. package/dist/button.js +58 -57
  16. package/dist/calendar.cjs +1 -1
  17. package/dist/calendar.d.ts.map +1 -1
  18. package/dist/calendar.js +19 -40
  19. package/dist/centred-layout.cjs +1 -1
  20. package/dist/centred-layout.js +1 -1
  21. package/dist/chart.cjs +2 -2
  22. package/dist/chart.d.ts +3 -1
  23. package/dist/chart.d.ts.map +1 -1
  24. package/dist/chart.js +21 -21
  25. package/dist/checkbox.cjs +1 -1
  26. package/dist/checkbox.js +3 -3
  27. package/dist/combobox.cjs +1 -1
  28. package/dist/combobox.d.ts.map +1 -1
  29. package/dist/combobox.js +39 -42
  30. package/dist/command.cjs +1 -1
  31. package/dist/command.js +35 -35
  32. package/dist/context-menu.cjs +1 -1
  33. package/dist/context-menu.js +2 -2
  34. package/dist/date-picker.cjs +1 -1
  35. package/dist/date-picker.js +7 -7
  36. package/dist/dialog.cjs +1 -1
  37. package/dist/dialog.js +22 -22
  38. package/dist/dropdown-menu.cjs +1 -1
  39. package/dist/dropdown-menu.d.ts.map +1 -1
  40. package/dist/dropdown-menu.js +40 -45
  41. package/dist/field.cjs +1 -1
  42. package/dist/field.d.ts.map +1 -1
  43. package/dist/field.js +38 -30
  44. package/dist/header.d.ts.map +1 -1
  45. package/dist/header.js +1 -4
  46. package/dist/index.cjs +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +334 -319
  50. package/dist/input-chip.d.ts.map +1 -1
  51. package/dist/input-chip.js +18 -25
  52. package/dist/input-group.cjs +1 -1
  53. package/dist/input-group.js +10 -10
  54. package/dist/input-otp.cjs +1 -1
  55. package/dist/input-otp.js +6 -6
  56. package/dist/input-password.cjs +1 -1
  57. package/dist/input-password.d.ts.map +1 -1
  58. package/dist/input-password.js +16 -16
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +9 -9
  61. package/dist/label.cjs +1 -1
  62. package/dist/label.js +1 -1
  63. package/dist/link.cjs +1 -1
  64. package/dist/link.d.ts.map +1 -1
  65. package/dist/link.js +1 -8
  66. package/dist/logo.cjs +1 -1
  67. package/dist/logo.d.ts.map +1 -1
  68. package/dist/logo.js +23 -11
  69. package/dist/menubar.cjs +1 -1
  70. package/dist/menubar.js +12 -12
  71. package/dist/pagination.cjs +1 -1
  72. package/dist/pagination.d.ts.map +1 -1
  73. package/dist/pagination.js +15 -15
  74. package/dist/radio-group.cjs +1 -1
  75. package/dist/radio-group.js +3 -3
  76. package/dist/resizable.d.ts +1 -1
  77. package/dist/select.cjs +1 -1
  78. package/dist/select.d.ts +1 -1
  79. package/dist/select.d.ts.map +1 -1
  80. package/dist/select.js +46 -50
  81. package/dist/sheet.cjs +1 -1
  82. package/dist/sheet.d.ts.map +1 -1
  83. package/dist/sheet.js +19 -19
  84. package/dist/sonner.cjs +1 -1
  85. package/dist/sonner.d.ts.map +1 -1
  86. package/dist/sonner.js +7 -8
  87. package/dist/switch.cjs +1 -1
  88. package/dist/switch.js +28 -28
  89. package/dist/tabs.cjs +1 -1
  90. package/dist/tabs.d.ts.map +1 -1
  91. package/dist/tabs.js +10 -12
  92. package/dist/toggle.cjs +1 -1
  93. package/dist/toggle.js +9 -9
  94. package/dist/typography.cjs +1 -0
  95. package/dist/typography.d.ts +176 -0
  96. package/dist/typography.d.ts.map +1 -0
  97. package/dist/typography.js +331 -0
  98. package/package.json +2 -2
  99. package/src/blocks/data-table.tsx +10 -10
  100. package/src/blocks/sidebar.tsx +13 -13
  101. package/src/components/accordion.tsx +2 -2
  102. package/src/components/alert.tsx +10 -10
  103. package/src/components/breadcrumb.tsx +3 -3
  104. package/src/components/button.tsx +7 -7
  105. package/src/components/calendar.tsx +4 -22
  106. package/src/components/centred-layout.tsx +1 -1
  107. package/src/components/chart.tsx +5 -5
  108. package/src/components/checkbox.tsx +3 -3
  109. package/src/components/combobox.tsx +4 -8
  110. package/src/components/command.tsx +5 -5
  111. package/src/components/context-menu.tsx +2 -2
  112. package/src/components/date-picker.tsx +1 -1
  113. package/src/components/dialog.tsx +3 -3
  114. package/src/components/dropdown-menu.tsx +6 -11
  115. package/src/components/field.tsx +27 -19
  116. package/src/components/header.tsx +1 -4
  117. package/src/components/input-chip.tsx +1 -4
  118. package/src/components/input-group.tsx +1 -1
  119. package/src/components/input-otp.tsx +3 -3
  120. package/src/components/input-password.tsx +2 -10
  121. package/src/components/input.tsx +1 -1
  122. package/src/components/label.tsx +1 -1
  123. package/src/components/link.tsx +1 -5
  124. package/src/components/logo.tsx +11 -5
  125. package/src/components/menubar.tsx +2 -2
  126. package/src/components/pagination.tsx +4 -8
  127. package/src/components/radio-group.tsx +2 -2
  128. package/src/components/select.tsx +8 -12
  129. package/src/components/sheet.tsx +5 -5
  130. package/src/components/sonner.tsx +4 -5
  131. package/src/components/switch.tsx +1 -1
  132. package/src/components/tabs.tsx +0 -2
  133. package/src/components/toggle.tsx +1 -1
  134. package/src/components/typography.tsx +678 -0
  135. package/src/index.ts +1 -0
package/dist/combobox.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),U=require("react"),T=require("@brightlocal/icons"),V=require("class-variance-authority"),f=require("@brightlocal/ui-components/lib/utils"),I=require("@brightlocal/ui-components/popover"),l=require("@brightlocal/ui-components/command");function $(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const a in o)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(e,a,t.get?t:{enumerable:!0,get:()=>o[a]})}}return e.default=o,Object.freeze(e)}const n=$(U),E=n.createContext(null);function y(){const o=n.useContext(E);if(!o)throw new Error("Combobox components must be used within a <Combobox>");return o}function F({value:o,onValueChange:e,open:a,onOpenChange:t,shouldFilter:s=!0,disabled:i=!1,children:c}){const[g,d]=n.useState(""),[m,C]=n.useState(!1),[x,u]=n.useState(()=>new Map),v=o!==void 0,p=a!==void 0,h=v?o:g,w=p?a:m,j=n.useCallback(b=>{p||C(b),t?.(b)},[p,t]),N=n.useCallback(b=>{v||d(b),e?.(b)},[v,e]),S=n.useCallback((b,R)=>{u(k=>{if(k.get(b)===R)return k;const L=new Map(k);return L.set(b,R),L})},[]),D=n.useMemo(()=>({open:w,setOpen:j,value:h,onValueChange:N,shouldFilter:s,disabled:i,itemLabels:x,registerItem:S}),[w,j,h,N,s,i,x,S]);return r.jsx(E.Provider,{value:D,children:r.jsx(I.Popover,{open:w,onOpenChange:j,children:c})})}const A=V.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","hover:bg-accent","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:bg-neutral-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],{variants:{variant:{default:[]}},defaultVariants:{variant:"default"}}),O=n.forwardRef(({className:o,variant:e,dataHook:a,trackingEl:t,trackingLabel:s,children:i,...c},g)=>{const{open:d,disabled:m,value:C}=y(),x=n.useId(),u=!C;return r.jsx(I.PopoverTrigger,{asChild:!0,children:r.jsxs("button",{ref:g,"aria-controls":d?x:void 0,"aria-expanded":d,"aria-haspopup":"listbox",className:f.cn(A({variant:e}),o),"data-hook":a,"data-placeholder":u,"data-slot":"combobox-trigger","data-state":d?"open":"closed","data-tracking-el":t||"combobox-trigger","data-tracking-label":s,disabled:m||c.disabled,role:"combobox",type:"button",...c,children:[i,r.jsx(T.ChevronsUpDownIcon,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0",size:16})]})})});O.displayName="ComboboxTrigger";function H({placeholder:o,className:e}){const{value:a,itemLabels:t}=y(),s=a?t.get(a)||a:o;return r.jsx("span",{className:f.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",e),"data-slot":"combobox-value",children:s})}function B({dataHook:o,className:e,children:a,align:t="start",hideList:s=!1}){const{shouldFilter:i}=y();return r.jsx(I.PopoverContent,{align:t,className:f.cn("w-[var(--radix-popover-trigger-width)] p-0",e),"data-slot":"combobox-popover",side:"bottom",children:r.jsx(l.Command,{className:f.cn("border-0 shadow-none",s&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:o||"combobox-command",shouldFilter:i,children:a})})}const P=n.forwardRef((o,e)=>r.jsx(l.CommandInput,{ref:e,"data-slot":"combobox-input",...o}));P.displayName="ComboboxInput";const q=n.forwardRef((o,e)=>r.jsx(l.CommandList,{ref:e,"data-slot":"combobox-list",...o}));q.displayName="ComboboxList";const _=n.forwardRef((o,e)=>r.jsx(l.CommandEmpty,{ref:e,"data-slot":"combobox-empty",...o}));_.displayName="ComboboxEmpty";const z=n.forwardRef((o,e)=>r.jsx(l.CommandGroup,{ref:e,"data-slot":"combobox-group",...o}));z.displayName="ComboboxGroup";function J(o,e,a){if(!e||!e.trim())return o;const t=new RegExp(`(${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),s=o.split(t);return r.jsx("span",{children:s.map((i,c)=>c%2===1?r.jsx("span",{className:a,children:i},c):r.jsx(n.Fragment,{children:i},c))})}const M=n.forwardRef(({value:o,label:e,dataHook:a,children:t,className:s,highlight:i,highlightClassName:c,...g},d)=>{const{value:m,onValueChange:C,setOpen:x,registerItem:u}=y(),v=m===o,p=n.useMemo(()=>e||(typeof t=="string"?t:typeof t=="number"?String(t):o),[e,t,o]),h=n.useRef(u);n.useEffect(()=>{h.current=u},[u]),n.useEffect(()=>{h.current(o,p)},[o,p]);const w=()=>{C(o===m?"":o),x(!1)},j=()=>i&&typeof t=="string"?J(t,i,c||"text-sm leading-normal font-semibold"):t;return r.jsxs(l.CommandItem,{ref:d,className:f.cn("justify-between",s),"data-slot":"combobox-item",dataHook:a,value:o,onSelect:w,...g,children:[j(),v&&r.jsx(T.CheckIcon,{"aria-hidden":"true",className:"text-muted-foreground shrink-0",size:16})]})});M.displayName="ComboboxItem";const G=n.forwardRef((o,e)=>r.jsx(l.CommandSeparator,{ref:e,"data-slot":"combobox-separator",...o}));G.displayName="ComboboxSeparator";function K({className:o,children:e}){return r.jsx("div",{className:f.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",o),"data-slot":"combobox-loading",children:e||r.jsxs(r.Fragment,{children:[r.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=F;exports.ComboboxContent=B;exports.ComboboxEmpty=_;exports.ComboboxGroup=z;exports.ComboboxInput=P;exports.ComboboxItem=M;exports.ComboboxList=q;exports.ComboboxLoading=K;exports.ComboboxSeparator=G;exports.ComboboxTrigger=O;exports.ComboboxValue=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),V=require("react"),T=require("@brightlocal/icons"),$=require("class-variance-authority"),f=require("@brightlocal/ui-components/lib/utils"),S=require("@brightlocal/ui-components/popover"),l=require("@brightlocal/ui-components/command");function z(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const a in o)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(e,a,t.get?t:{enumerable:!0,get:()=>o[a]})}}return e.default=o,Object.freeze(e)}const r=z(V),E=r.createContext(null);function y(){const o=r.useContext(E);if(!o)throw new Error("Combobox components must be used within a <Combobox>");return o}function F({value:o,onValueChange:e,open:a,onOpenChange:t,shouldFilter:s=!0,disabled:c=!1,children:i}){const[g,d]=r.useState(""),[m,C]=r.useState(!1),[x,u]=r.useState(()=>new Map),v=o!==void 0,p=a!==void 0,h=v?o:g,w=p?a:m,j=r.useCallback(b=>{p||C(b),t?.(b)},[p,t]),N=r.useCallback(b=>{v||d(b),e?.(b)},[v,e]),I=r.useCallback((b,R)=>{u(k=>{if(k.get(b)===R)return k;const L=new Map(k);return L.set(b,R),L})},[]),U=r.useMemo(()=>({open:w,setOpen:j,value:h,onValueChange:N,shouldFilter:s,disabled:c,itemLabels:x,registerItem:I}),[w,j,h,N,s,c,x,I]);return n.jsx(E.Provider,{value:U,children:n.jsx(S.Popover,{open:w,onOpenChange:j,children:i})})}const A=$.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","hover:bg-accent","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:bg-neutral-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{default:[]}},defaultVariants:{variant:"default"}}),O=r.forwardRef(({className:o,variant:e,dataHook:a,trackingEl:t,trackingLabel:s,children:c,...i},g)=>{const{open:d,disabled:m,value:C}=y(),x=r.useId(),u=!C;return n.jsx(S.PopoverTrigger,{asChild:!0,children:n.jsxs("button",{ref:g,"aria-controls":d?x:void 0,"aria-expanded":d,"aria-haspopup":"listbox",className:f.cn(A({variant:e}),o),"data-hook":a,"data-placeholder":u,"data-slot":"combobox-trigger","data-state":d?"open":"closed","data-tracking-el":t||"combobox-trigger","data-tracking-label":s,disabled:m||i.disabled,role:"combobox",type:"button",...i,children:[c,n.jsx(T.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});O.displayName="ComboboxTrigger";function H({placeholder:o,className:e}){const{value:a,itemLabels:t}=y(),s=a?t.get(a)||a:o;return n.jsx("span",{className:f.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",e),"data-slot":"combobox-value",children:s})}function B({dataHook:o,className:e,children:a,align:t="start",hideList:s=!1}){const{shouldFilter:c}=y();return n.jsx(S.PopoverContent,{align:t,className:f.cn("w-[var(--radix-popover-trigger-width)] p-0",e),"data-slot":"combobox-popover",side:"bottom",children:n.jsx(l.Command,{className:f.cn("border-0 shadow-none",s&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:o||"combobox-command",shouldFilter:c,children:a})})}const P=r.forwardRef((o,e)=>n.jsx(l.CommandInput,{ref:e,"data-slot":"combobox-input",...o}));P.displayName="ComboboxInput";const q=r.forwardRef((o,e)=>n.jsx(l.CommandList,{ref:e,"data-slot":"combobox-list",...o}));q.displayName="ComboboxList";const M=r.forwardRef((o,e)=>n.jsx(l.CommandEmpty,{ref:e,"data-slot":"combobox-empty",...o}));M.displayName="ComboboxEmpty";const _=r.forwardRef((o,e)=>n.jsx(l.CommandGroup,{ref:e,"data-slot":"combobox-group",...o}));_.displayName="ComboboxGroup";function J(o,e,a){if(!e||!e.trim())return o;const t=new RegExp(`(${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),s=o.split(t);return n.jsx("span",{children:s.map((c,i)=>i%2===1?n.jsx("span",{className:a,children:c},i):n.jsx(r.Fragment,{children:c},i))})}const G=r.forwardRef(({value:o,label:e,dataHook:a,children:t,className:s,highlight:c,highlightClassName:i,...g},d)=>{const{value:m,onValueChange:C,setOpen:x,registerItem:u}=y(),v=m===o,p=r.useMemo(()=>e||(typeof t=="string"?t:typeof t=="number"?String(t):o),[e,t,o]),h=r.useRef(u);r.useEffect(()=>{h.current=u},[u]),r.useEffect(()=>{h.current(o,p)},[o,p]);const w=()=>{C(o===m?"":o),x(!1)},j=()=>c&&typeof t=="string"?J(t,c,i||"text-sm leading-normal font-semibold"):t;return n.jsxs(l.CommandItem,{ref:d,className:f.cn("justify-between",s),"data-slot":"combobox-item",dataHook:a,value:o,onSelect:w,...g,children:[j(),v&&n.jsx(T.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});G.displayName="ComboboxItem";const D=r.forwardRef((o,e)=>n.jsx(l.CommandSeparator,{ref:e,"data-slot":"combobox-separator",...o}));D.displayName="ComboboxSeparator";function K({className:o,children:e}){return n.jsx("div",{className:f.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",o),"data-slot":"combobox-loading",children:e||n.jsxs(n.Fragment,{children:[n.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=F;exports.ComboboxContent=B;exports.ComboboxEmpty=M;exports.ComboboxGroup=_;exports.ComboboxInput=P;exports.ComboboxItem=G;exports.ComboboxList=q;exports.ComboboxLoading=K;exports.ComboboxSeparator=D;exports.ComboboxTrigger=O;exports.ComboboxValue=H;
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0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C;IACd,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,QAAA,MAAM,YAAY,uGA8EjB,CAAC;AAOF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CACvD,OAAO,gBAAgB,CACxB,CAAC;AAEF,QAAA,MAAM,iBAAiB,2MAOrB,CAAC;AAOH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAoBrE;AAMD,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,eAAe,GAChB,CAAC"}
package/dist/combobox.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as n, jsxs as I, Fragment as j } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as I, Fragment as j } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import { CheckIcon as z, ChevronsUpDownIcon as P } from "@brightlocal/icons";
4
- import { cva as M } from "class-variance-authority";
3
+ import { Check as P, ChevronsUpDown as M } from "@brightlocal/icons";
4
+ import { cva as G } from "class-variance-authority";
5
5
  import { cn as f } from "@brightlocal/ui-components/lib/utils";
6
- import { Popover as _, PopoverContent as G, PopoverTrigger as U } from "@brightlocal/ui-components/popover";
7
- import { Command as $, CommandEmpty as F, CommandGroup as O, CommandInput as D, CommandItem as H, CommandList as V, CommandSeparator as q } from "@brightlocal/ui-components/command";
6
+ import { Popover as U, PopoverContent as _, PopoverTrigger as $ } from "@brightlocal/ui-components/popover";
7
+ import { Command as F, CommandEmpty as O, CommandGroup as z, CommandInput as D, CommandItem as H, CommandList as V, CommandSeparator as q } from "@brightlocal/ui-components/command";
8
8
  const E = t.createContext(null);
9
9
  function y() {
10
10
  const o = t.useContext(E);
@@ -15,7 +15,7 @@ function y() {
15
15
  function so({
16
16
  value: o,
17
17
  onValueChange: e,
18
- open: a,
18
+ open: n,
19
19
  onOpenChange: r,
20
20
  shouldFilter: s = !0,
21
21
  disabled: d = !1,
@@ -23,7 +23,7 @@ function so({
23
23
  }) {
24
24
  const [x, c] = t.useState(""), [l, g] = t.useState(!1), [u, b] = t.useState(
25
25
  () => /* @__PURE__ */ new Map()
26
- ), C = o !== void 0, p = a !== void 0, v = C ? o : x, h = p ? a : l, w = t.useCallback(
26
+ ), C = o !== void 0, p = n !== void 0, v = C ? o : x, h = p ? n : l, w = t.useCallback(
27
27
  (m) => {
28
28
  p || g(m), r?.(m);
29
29
  },
@@ -61,9 +61,9 @@ function so({
61
61
  R
62
62
  ]
63
63
  );
64
- return /* @__PURE__ */ n(E.Provider, { value: T, children: /* @__PURE__ */ n(_, { open: h, onOpenChange: w, children: i }) });
64
+ return /* @__PURE__ */ a(E.Provider, { value: T, children: /* @__PURE__ */ a(U, { open: h, onOpenChange: w, children: i }) });
65
65
  }
66
- const A = M(
66
+ const A = G(
67
67
  [
68
68
  // Base layout
69
69
  "relative flex w-full items-center justify-between gap-2",
@@ -89,8 +89,7 @@ const A = M(
89
89
  // Transitions
90
90
  "transition-[background-color,border-color,box-shadow] duration-200 ease-out",
91
91
  // Icon styles
92
- "[&_svg]:pointer-events-none [&_svg]:shrink-0",
93
- "[&_svg:not([class*='size-'])]:size-4"
92
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0"
94
93
  ],
95
94
  {
96
95
  variants: {
@@ -106,14 +105,14 @@ const A = M(
106
105
  ({
107
106
  className: o,
108
107
  variant: e,
109
- dataHook: a,
108
+ dataHook: n,
110
109
  trackingEl: r,
111
110
  trackingLabel: s,
112
111
  children: d,
113
112
  ...i
114
113
  }, x) => {
115
114
  const { open: c, disabled: l, value: g } = y(), u = t.useId(), b = !g;
116
- return /* @__PURE__ */ n(U, { asChild: !0, children: /* @__PURE__ */ I(
115
+ return /* @__PURE__ */ a($, { asChild: !0, children: /* @__PURE__ */ I(
117
116
  "button",
118
117
  {
119
118
  ref: x,
@@ -121,7 +120,7 @@ const A = M(
121
120
  "aria-expanded": c,
122
121
  "aria-haspopup": "listbox",
123
122
  className: f(A({ variant: e }), o),
124
- "data-hook": a,
123
+ "data-hook": n,
125
124
  "data-placeholder": b,
126
125
  "data-slot": "combobox-trigger",
127
126
  "data-state": c ? "open" : "closed",
@@ -133,12 +132,11 @@ const A = M(
133
132
  ...i,
134
133
  children: [
135
134
  d,
136
- /* @__PURE__ */ n(
137
- P,
135
+ /* @__PURE__ */ a(
136
+ M,
138
137
  {
139
138
  "aria-hidden": "true",
140
- className: "text-muted-foreground ml-auto shrink-0",
141
- size: 16
139
+ className: "text-muted-foreground ml-auto shrink-0"
142
140
  }
143
141
  )
144
142
  ]
@@ -148,8 +146,8 @@ const A = M(
148
146
  );
149
147
  B.displayName = "ComboboxTrigger";
150
148
  function io({ placeholder: o, className: e }) {
151
- const { value: a, itemLabels: r } = y(), s = a ? r.get(a) || a : o;
152
- return /* @__PURE__ */ n(
149
+ const { value: n, itemLabels: r } = y(), s = n ? r.get(n) || n : o;
150
+ return /* @__PURE__ */ a(
153
151
  "span",
154
152
  {
155
153
  className: f(
@@ -164,20 +162,20 @@ function io({ placeholder: o, className: e }) {
164
162
  function mo({
165
163
  dataHook: o,
166
164
  className: e,
167
- children: a,
165
+ children: n,
168
166
  align: r = "start",
169
167
  hideList: s = !1
170
168
  }) {
171
169
  const { shouldFilter: d } = y();
172
- return /* @__PURE__ */ n(
173
- G,
170
+ return /* @__PURE__ */ a(
171
+ _,
174
172
  {
175
173
  align: r,
176
174
  className: f("w-[var(--radix-popover-trigger-width)] p-0", e),
177
175
  "data-slot": "combobox-popover",
178
176
  side: "bottom",
179
- children: /* @__PURE__ */ n(
180
- $,
177
+ children: /* @__PURE__ */ a(
178
+ F,
181
179
  {
182
180
  className: f(
183
181
  "border-0 shadow-none",
@@ -186,36 +184,36 @@ function mo({
186
184
  "data-slot": "combobox-command",
187
185
  dataHook: o || "combobox-command",
188
186
  shouldFilter: d,
189
- children: a
187
+ children: n
190
188
  }
191
189
  )
192
190
  }
193
191
  );
194
192
  }
195
- const J = t.forwardRef((o, e) => /* @__PURE__ */ n(D, { ref: e, "data-slot": "combobox-input", ...o }));
193
+ const J = t.forwardRef((o, e) => /* @__PURE__ */ a(D, { ref: e, "data-slot": "combobox-input", ...o }));
196
194
  J.displayName = "ComboboxInput";
197
- const K = t.forwardRef((o, e) => /* @__PURE__ */ n(V, { ref: e, "data-slot": "combobox-list", ...o }));
195
+ const K = t.forwardRef((o, e) => /* @__PURE__ */ a(V, { ref: e, "data-slot": "combobox-list", ...o }));
198
196
  K.displayName = "ComboboxList";
199
- const Q = t.forwardRef((o, e) => /* @__PURE__ */ n(F, { ref: e, "data-slot": "combobox-empty", ...o }));
197
+ const Q = t.forwardRef((o, e) => /* @__PURE__ */ a(O, { ref: e, "data-slot": "combobox-empty", ...o }));
200
198
  Q.displayName = "ComboboxEmpty";
201
- const W = t.forwardRef((o, e) => /* @__PURE__ */ n(O, { ref: e, "data-slot": "combobox-group", ...o }));
199
+ const W = t.forwardRef((o, e) => /* @__PURE__ */ a(z, { ref: e, "data-slot": "combobox-group", ...o }));
202
200
  W.displayName = "ComboboxGroup";
203
- function X(o, e, a) {
201
+ function X(o, e, n) {
204
202
  if (!e || !e.trim())
205
203
  return o;
206
204
  const r = new RegExp(
207
205
  `(${e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
208
206
  "gi"
209
207
  ), s = o.split(r);
210
- return /* @__PURE__ */ n("span", { children: s.map(
211
- (d, i) => i % 2 === 1 ? /* @__PURE__ */ n("span", { className: a, children: d }, i) : /* @__PURE__ */ n(t.Fragment, { children: d }, i)
208
+ return /* @__PURE__ */ a("span", { children: s.map(
209
+ (d, i) => i % 2 === 1 ? /* @__PURE__ */ a("span", { className: n, children: d }, i) : /* @__PURE__ */ a(t.Fragment, { children: d }, i)
212
210
  ) });
213
211
  }
214
212
  const Y = t.forwardRef(
215
213
  ({
216
214
  value: o,
217
215
  label: e,
218
- dataHook: a,
216
+ dataHook: n,
219
217
  children: r,
220
218
  className: s,
221
219
  highlight: d,
@@ -241,18 +239,17 @@ const Y = t.forwardRef(
241
239
  ref: c,
242
240
  className: f("justify-between", s),
243
241
  "data-slot": "combobox-item",
244
- dataHook: a,
242
+ dataHook: n,
245
243
  value: o,
246
244
  onSelect: h,
247
245
  ...x,
248
246
  children: [
249
247
  w(),
250
- C && /* @__PURE__ */ n(
251
- z,
248
+ C && /* @__PURE__ */ a(
249
+ P,
252
250
  {
253
251
  "aria-hidden": "true",
254
- className: "text-muted-foreground shrink-0",
255
- size: 16
252
+ className: "text-muted-foreground shrink-0"
256
253
  }
257
254
  )
258
255
  ]
@@ -261,10 +258,10 @@ const Y = t.forwardRef(
261
258
  }
262
259
  );
263
260
  Y.displayName = "ComboboxItem";
264
- const Z = t.forwardRef((o, e) => /* @__PURE__ */ n(q, { ref: e, "data-slot": "combobox-separator", ...o }));
261
+ const Z = t.forwardRef((o, e) => /* @__PURE__ */ a(q, { ref: e, "data-slot": "combobox-separator", ...o }));
265
262
  Z.displayName = "ComboboxSeparator";
266
263
  function co({ className: o, children: e }) {
267
- return /* @__PURE__ */ n(
264
+ return /* @__PURE__ */ a(
268
265
  "div",
269
266
  {
270
267
  className: f(
@@ -273,7 +270,7 @@ function co({ className: o, children: e }) {
273
270
  ),
274
271
  "data-slot": "combobox-loading",
275
272
  children: e || /* @__PURE__ */ I(j, { children: [
276
- /* @__PURE__ */ n(
273
+ /* @__PURE__ */ a(
277
274
  "div",
278
275
  {
279
276
  "aria-hidden": "true",
package/dist/command.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),z=require("react"),m=require("cmdk"),f=require("@brightlocal/icons"),O=require("@brightlocal/ui-components/button"),c=require("@brightlocal/ui-components/lib/utils");function E(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const d=E(z),C=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,...r},s)=>n.jsx(m.Command,{ref:s,className:c.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",e),"data-hook":t,"data-slot":"command","data-tracking-el":a,"data-tracking-label":o,...r}));C.displayName="Command";const b=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,value:r,onValueChange:s,onClear:l,...i},S)=>{const u=d.useRef(null),[I,g]=d.useState("");d.useImperativeHandle(S,()=>u.current,[]);const p=r!==void 0,x=p?r:I,R=String(x).length>0,_=h=>{p||g(h),s?.(h)},q=()=>{p||g(""),s?.(""),l?.(),u.current?.focus()};return n.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":t,"data-slot":"command-input-wrapper",children:[n.jsx(f.SearchIcon,{className:"shrink-0 opacity-50",size:16}),n.jsx(m.Command.Input,{ref:u,className:c.cn("placeholder:text-muted-foreground flex w-full bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),"data-slot":"command-input","data-tracking-el":a,"data-tracking-label":o,value:x,onValueChange:_,...i}),R&&n.jsx(O.Button,{"aria-label":"Clear search",className:"text-muted-foreground hover:text-foreground",dataHook:"command-input-clear",variant:"ghost",onClick:q,children:n.jsx(f.XIcon,{size:16})})]})});b.displayName="CommandInput";const k=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.List,{ref:o,className:c.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),"data-hook":t,"data-slot":"command-list",...a}));k.displayName="CommandList";const y=d.forwardRef(({dataHook:e,...t},a)=>n.jsx(m.Command.Empty,{ref:a,className:"py-6 text-center text-sm","data-hook":e,"data-slot":"command-empty",...t}));y.displayName="CommandEmpty";const v=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.Group,{ref:o,className:c.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),"data-hook":t,"data-slot":"command-group",...a}));v.displayName="CommandGroup";const N=d.forwardRef(({className:e,dataHook:t,...a},o)=>n.jsx(m.Command.Separator,{ref:o,className:c.cn("bg-border -mx-1 h-px",e),"data-hook":t,"data-slot":"command-separator",...a}));N.displayName="CommandSeparator";const j=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,selected:r,children:s,...l},i)=>n.jsxs(m.Command.Item,{ref:i,className:c.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),"data-hook":t,"data-selected-item":r||void 0,"data-slot":"command-item","data-tracking-el":a,"data-tracking-label":o,...l,children:[s,r&&n.jsx(f.CheckIcon,{className:"text-foreground ml-auto",size:16})]}));j.displayName="CommandItem";const w=d.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:o,...r},s)=>n.jsx("span",{ref:s,className:c.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-hook":t,"data-slot":"command-shortcut","data-tracking-el":a,"data-tracking-label":o,...r}));w.displayName="CommandShortcut";exports.Command=C;exports.CommandEmpty=y;exports.CommandGroup=v;exports.CommandInput=b;exports.CommandItem=j;exports.CommandList=k;exports.CommandSeparator=N;exports.CommandShortcut=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),O=require("react"),s=require("cmdk"),f=require("@brightlocal/icons"),E=require("@brightlocal/ui-components/button"),c=require("@brightlocal/ui-components/lib/utils");function G(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,o.get?o:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const d=G(O),C=d.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:o,...r},m)=>n.jsx(s.Command,{ref:m,className:c.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",a),"data-hook":t,"data-slot":"command","data-tracking-el":e,"data-tracking-label":o,...r}));C.displayName="Command";const b=d.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:o,value:r,onValueChange:m,onClear:l,...i},S)=>{const u=d.useRef(null),[R,g]=d.useState("");d.useImperativeHandle(S,()=>u.current,[]);const p=r!==void 0,x=p?r:R,I=String(x).length>0,_=h=>{p||g(h),m?.(h)},q=()=>{p||g(""),m?.(""),l?.(),u.current?.focus()};return n.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":t,"data-slot":"command-input-wrapper",children:[n.jsx(f.Search,{className:"shrink-0 opacity-50"}),n.jsx(s.Command.Input,{ref:u,className:c.cn("placeholder:text-muted-foreground flex w-full bg-transparent text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",a),"data-slot":"command-input","data-tracking-el":e,"data-tracking-label":o,value:x,onValueChange:_,...i}),I&&n.jsx(E.Button,{"aria-label":"Clear search",className:"text-muted-foreground hover:text-foreground",dataHook:"command-input-clear",variant:"ghost",onClick:q,children:n.jsx(f.X,{})})]})});b.displayName="CommandInput";const k=d.forwardRef(({className:a,dataHook:t,...e},o)=>n.jsx(s.Command.List,{ref:o,className:c.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",a),"data-hook":t,"data-slot":"command-list",...e}));k.displayName="CommandList";const y=d.forwardRef(({dataHook:a,...t},e)=>n.jsx(s.Command.Empty,{ref:e,className:"py-6 text-center text-sm","data-hook":a,"data-slot":"command-empty",...t}));y.displayName="CommandEmpty";const v=d.forwardRef(({className:a,dataHook:t,...e},o)=>n.jsx(s.Command.Group,{ref:o,className:c.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",a),"data-hook":t,"data-slot":"command-group",...e}));v.displayName="CommandGroup";const N=d.forwardRef(({className:a,dataHook:t,...e},o)=>n.jsx(s.Command.Separator,{ref:o,className:c.cn("bg-border -mx-1 h-px",a),"data-hook":t,"data-slot":"command-separator",...e}));N.displayName="CommandSeparator";const j=d.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:o,selected:r,children:m,...l},i)=>n.jsxs(s.Command.Item,{ref:i,className:c.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",a),"data-hook":t,"data-selected-item":r||void 0,"data-slot":"command-item","data-tracking-el":e,"data-tracking-label":o,...l,children:[m,r&&n.jsx(f.Check,{className:"text-foreground ml-auto"})]}));j.displayName="CommandItem";const w=d.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:o,...r},m)=>n.jsx("span",{ref:m,className:c.cn("text-muted-foreground ml-auto text-xs tracking-widest",a),"data-hook":t,"data-slot":"command-shortcut","data-tracking-el":e,"data-tracking-label":o,...r}));w.displayName="CommandShortcut";exports.Command=C;exports.CommandEmpty=y;exports.CommandGroup=v;exports.CommandInput=b;exports.CommandItem=j;exports.CommandList=k;exports.CommandSeparator=N;exports.CommandShortcut=w;
package/dist/command.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx as d, jsxs as x } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import { Command as s } from "cmdk";
4
- import { SearchIcon as N, XIcon as w, CheckIcon as I } from "@brightlocal/icons";
5
- import { Button as R } from "@brightlocal/ui-components/button";
4
+ import { Search as v, X as w, Check as R } from "@brightlocal/icons";
5
+ import { Button as I } from "@brightlocal/ui-components/button";
6
6
  import { cn as l } from "@brightlocal/ui-components/lib/utils";
7
- const _ = r.forwardRef(({ className: a, dataHook: e, trackingEl: t, trackingLabel: o, ...n }, m) => /* @__PURE__ */ d(
7
+ const S = r.forwardRef(({ className: a, dataHook: e, trackingEl: t, trackingLabel: o, ...n }, m) => /* @__PURE__ */ d(
8
8
  s,
9
9
  {
10
10
  ref: m,
@@ -19,8 +19,8 @@ const _ = r.forwardRef(({ className: a, dataHook: e, trackingEl: t, trackingLabe
19
19
  ...n
20
20
  }
21
21
  ));
22
- _.displayName = "Command";
23
- const S = r.forwardRef(
22
+ S.displayName = "Command";
23
+ const _ = r.forwardRef(
24
24
  ({
25
25
  className: a,
26
26
  dataHook: e,
@@ -33,9 +33,9 @@ const S = r.forwardRef(
33
33
  }, k) => {
34
34
  const p = r.useRef(null), [C, f] = r.useState("");
35
35
  r.useImperativeHandle(k, () => p.current, []);
36
- const u = n !== void 0, g = u ? n : C, b = String(g).length > 0, v = (h) => {
36
+ const u = n !== void 0, g = u ? n : C, b = String(g).length > 0, y = (h) => {
37
37
  u || f(h), m?.(h);
38
- }, y = () => {
38
+ }, N = () => {
39
39
  u || f(""), m?.(""), c?.(), p.current?.focus();
40
40
  };
41
41
  return /* @__PURE__ */ x(
@@ -45,7 +45,7 @@ const S = r.forwardRef(
45
45
  "data-hook": e,
46
46
  "data-slot": "command-input-wrapper",
47
47
  children: [
48
- /* @__PURE__ */ d(N, { className: "shrink-0 opacity-50", size: 16 }),
48
+ /* @__PURE__ */ d(v, { className: "shrink-0 opacity-50" }),
49
49
  /* @__PURE__ */ d(
50
50
  s.Input,
51
51
  {
@@ -58,19 +58,19 @@ const S = r.forwardRef(
58
58
  "data-tracking-el": t,
59
59
  "data-tracking-label": o,
60
60
  value: g,
61
- onValueChange: v,
61
+ onValueChange: y,
62
62
  ...i
63
63
  }
64
64
  ),
65
65
  b && /* @__PURE__ */ d(
66
- R,
66
+ I,
67
67
  {
68
68
  "aria-label": "Clear search",
69
69
  className: "text-muted-foreground hover:text-foreground",
70
70
  dataHook: "command-input-clear",
71
71
  variant: "ghost",
72
- onClick: y,
73
- children: /* @__PURE__ */ d(w, { size: 16 })
72
+ onClick: N,
73
+ children: /* @__PURE__ */ d(w, {})
74
74
  }
75
75
  )
76
76
  ]
@@ -78,8 +78,8 @@ const S = r.forwardRef(
78
78
  );
79
79
  }
80
80
  );
81
- S.displayName = "CommandInput";
82
- const z = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
81
+ _.displayName = "CommandInput";
82
+ const E = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
83
83
  s.List,
84
84
  {
85
85
  ref: o,
@@ -92,8 +92,8 @@ const z = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__
92
92
  ...t
93
93
  }
94
94
  ));
95
- z.displayName = "CommandList";
96
- const E = r.forwardRef(({ dataHook: a, ...e }, t) => /* @__PURE__ */ d(
95
+ E.displayName = "CommandList";
96
+ const G = r.forwardRef(({ dataHook: a, ...e }, t) => /* @__PURE__ */ d(
97
97
  s.Empty,
98
98
  {
99
99
  ref: t,
@@ -103,8 +103,8 @@ const E = r.forwardRef(({ dataHook: a, ...e }, t) => /* @__PURE__ */ d(
103
103
  ...e
104
104
  }
105
105
  ));
106
- E.displayName = "CommandEmpty";
107
- const G = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
106
+ G.displayName = "CommandEmpty";
107
+ const L = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
108
108
  s.Group,
109
109
  {
110
110
  ref: o,
@@ -117,8 +117,8 @@ const G = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__
117
117
  ...t
118
118
  }
119
119
  ));
120
- G.displayName = "CommandGroup";
121
- const L = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
120
+ L.displayName = "CommandGroup";
121
+ const j = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__ */ d(
122
122
  s.Separator,
123
123
  {
124
124
  ref: o,
@@ -128,8 +128,8 @@ const L = r.forwardRef(({ className: a, dataHook: e, ...t }, o) => /* @__PURE__
128
128
  ...t
129
129
  }
130
130
  ));
131
- L.displayName = "CommandSeparator";
132
- const j = r.forwardRef(
131
+ j.displayName = "CommandSeparator";
132
+ const B = r.forwardRef(
133
133
  ({
134
134
  className: a,
135
135
  dataHook: e,
@@ -143,7 +143,7 @@ const j = r.forwardRef(
143
143
  {
144
144
  ref: i,
145
145
  className: l(
146
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
146
+ "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
147
147
  a
148
148
  ),
149
149
  "data-hook": e,
@@ -154,13 +154,13 @@ const j = r.forwardRef(
154
154
  ...c,
155
155
  children: [
156
156
  m,
157
- n && /* @__PURE__ */ d(I, { className: "text-foreground ml-auto", size: 16 })
157
+ n && /* @__PURE__ */ d(R, { className: "text-foreground ml-auto" })
158
158
  ]
159
159
  }
160
160
  )
161
161
  );
162
- j.displayName = "CommandItem";
163
- const B = r.forwardRef(
162
+ B.displayName = "CommandItem";
163
+ const H = r.forwardRef(
164
164
  ({ className: a, dataHook: e, trackingEl: t, trackingLabel: o, ...n }, m) => /* @__PURE__ */ d(
165
165
  "span",
166
166
  {
@@ -177,14 +177,14 @@ const B = r.forwardRef(
177
177
  }
178
178
  )
179
179
  );
180
- B.displayName = "CommandShortcut";
180
+ H.displayName = "CommandShortcut";
181
181
  export {
182
- _ as Command,
183
- E as CommandEmpty,
184
- G as CommandGroup,
185
- S as CommandInput,
186
- j as CommandItem,
187
- z as CommandList,
188
- L as CommandSeparator,
189
- B as CommandShortcut
182
+ S as Command,
183
+ G as CommandEmpty,
184
+ L as CommandGroup,
185
+ _ as CommandInput,
186
+ B as CommandItem,
187
+ E as CommandList,
188
+ j as CommandSeparator,
189
+ H as CommandShortcut
190
190
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),I=require("react"),z=require("@radix-ui/react-context-menu"),m=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils");function x(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=x(I),a=x(z);function p({...e}){return o.jsx(a.Root,{"data-slot":"context-menu",...e})}p.displayName="ContextMenu";const f=s.forwardRef(({dataHook:e,...n},t)=>o.jsx(a.Trigger,{ref:t,"data-hook":e,"data-slot":"context-menu-trigger",...n}));f.displayName="ContextMenuTrigger";function b({...e}){return o.jsx(a.Group,{"data-slot":"context-menu-group",...e})}b.displayName="ContextMenuGroup";function g({...e}){return o.jsx(a.Portal,{"data-slot":"context-menu-portal",...e})}g.displayName="ContextMenuPortal";function C({...e}){return o.jsx(a.Sub,{"data-slot":"context-menu-sub",...e})}C.displayName="ContextMenuSub";function M({...e}){return o.jsx(a.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}M.displayName="ContextMenuRadioGroup";const h=s.forwardRef(({className:e,inset:n,children:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.SubTrigger,{ref:l,className:d.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none",n&&"pl-8",e),"data-hook":r,"data-slot":"context-menu-sub-trigger","data-tracking-el":u,"data-tracking-label":i,...c,children:[t,o.jsx(m.ChevronRight,{className:"ml-auto",size:16})]}));h.displayName="ContextMenuSubTrigger";const j=s.forwardRef(({className:e,...n},t)=>o.jsx(a.SubContent,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-sub-content",...n}));j.displayName="ContextMenuSubContent";const y=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Portal,{children:o.jsx(a.Content,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-content",...n})}));y.displayName="ContextMenuContent";const N=s.forwardRef(({className:e,inset:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsx(a.Item,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),"data-hook":t,"data-slot":"context-menu-item","data-tracking-el":r,"data-tracking-label":u,...i}));N.displayName="ContextMenuItem";const R=s.forwardRef(({className:e,children:n,checked:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.CheckboxItem,{ref:l,checked:t,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":r,"data-slot":"context-menu-checkbox-item","data-tracking-el":u,"data-tracking-label":i,...c,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Check,{size:16})})}),n]}));R.displayName="ContextMenuCheckboxItem";const S=s.forwardRef(({className:e,children:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsxs(a.RadioItem,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":t,"data-slot":"context-menu-radio-item","data-tracking-el":r,"data-tracking-label":u,...i,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Circle,{className:"fill-current",size:8})})}),n]}));S.displayName="ContextMenuRadioItem";const k=s.forwardRef(({className:e,inset:n,...t},r)=>o.jsx(a.Label,{ref:r,className:d.cn("text-foreground px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),"data-slot":"context-menu-label",...t}));k.displayName="ContextMenuLabel";const w=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Separator,{ref:t,className:d.cn("bg-border -mx-1 my-1 h-px",e),"data-slot":"context-menu-separator",...n}));w.displayName="ContextMenuSeparator";const v=s.forwardRef(({className:e,...n},t)=>o.jsx("span",{ref:t,className:d.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-slot":"context-menu-shortcut",...n}));v.displayName="ContextMenuShortcut";exports.ContextMenu=p;exports.ContextMenuCheckboxItem=R;exports.ContextMenuContent=y;exports.ContextMenuGroup=b;exports.ContextMenuItem=N;exports.ContextMenuLabel=k;exports.ContextMenuPortal=g;exports.ContextMenuRadioGroup=M;exports.ContextMenuRadioItem=S;exports.ContextMenuSeparator=w;exports.ContextMenuShortcut=v;exports.ContextMenuSub=C;exports.ContextMenuSubContent=j;exports.ContextMenuSubTrigger=h;exports.ContextMenuTrigger=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),I=require("react"),z=require("@radix-ui/react-context-menu"),m=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils");function x(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const s=x(I),a=x(z);function p({...e}){return o.jsx(a.Root,{"data-slot":"context-menu",...e})}p.displayName="ContextMenu";const f=s.forwardRef(({dataHook:e,...n},t)=>o.jsx(a.Trigger,{ref:t,"data-hook":e,"data-slot":"context-menu-trigger",...n}));f.displayName="ContextMenuTrigger";function b({...e}){return o.jsx(a.Group,{"data-slot":"context-menu-group",...e})}b.displayName="ContextMenuGroup";function g({...e}){return o.jsx(a.Portal,{"data-slot":"context-menu-portal",...e})}g.displayName="ContextMenuPortal";function C({...e}){return o.jsx(a.Sub,{"data-slot":"context-menu-sub",...e})}C.displayName="ContextMenuSub";function M({...e}){return o.jsx(a.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}M.displayName="ContextMenuRadioGroup";const h=s.forwardRef(({className:e,inset:n,children:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.SubTrigger,{ref:l,className:d.cn("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none",n&&"pl-8",e),"data-hook":r,"data-slot":"context-menu-sub-trigger","data-tracking-el":u,"data-tracking-label":i,...c,children:[t,o.jsx(m.ChevronRight,{className:"ml-auto"})]}));h.displayName="ContextMenuSubTrigger";const j=s.forwardRef(({className:e,...n},t)=>o.jsx(a.SubContent,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-sub-content",...n}));j.displayName="ContextMenuSubContent";const y=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Portal,{children:o.jsx(a.Content,{ref:t,className:d.cn("border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",e),"data-slot":"context-menu-content",...n})}));y.displayName="ContextMenuContent";const N=s.forwardRef(({className:e,inset:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsx(a.Item,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),"data-hook":t,"data-slot":"context-menu-item","data-tracking-el":r,"data-tracking-label":u,...i}));N.displayName="ContextMenuItem";const R=s.forwardRef(({className:e,children:n,checked:t,dataHook:r,trackingEl:u,trackingLabel:i,...c},l)=>o.jsxs(a.CheckboxItem,{ref:l,checked:t,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":r,"data-slot":"context-menu-checkbox-item","data-tracking-el":u,"data-tracking-label":i,...c,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Check,{})})}),n]}));R.displayName="ContextMenuCheckboxItem";const S=s.forwardRef(({className:e,children:n,dataHook:t,trackingEl:r,trackingLabel:u,...i},c)=>o.jsxs(a.RadioItem,{ref:c,className:d.cn("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-hook":t,"data-slot":"context-menu-radio-item","data-tracking-el":r,"data-tracking-label":u,...i,children:[o.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:o.jsx(a.ItemIndicator,{children:o.jsx(m.Circle,{className:"fill-current",size:8})})}),n]}));S.displayName="ContextMenuRadioItem";const k=s.forwardRef(({className:e,inset:n,...t},r)=>o.jsx(a.Label,{ref:r,className:d.cn("text-foreground px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),"data-slot":"context-menu-label",...t}));k.displayName="ContextMenuLabel";const w=s.forwardRef(({className:e,...n},t)=>o.jsx(a.Separator,{ref:t,className:d.cn("bg-border -mx-1 my-1 h-px",e),"data-slot":"context-menu-separator",...n}));w.displayName="ContextMenuSeparator";const v=s.forwardRef(({className:e,...n},t)=>o.jsx("span",{ref:t,className:d.cn("text-muted-foreground ml-auto text-xs tracking-widest",e),"data-slot":"context-menu-shortcut",...n}));v.displayName="ContextMenuShortcut";exports.ContextMenu=p;exports.ContextMenuCheckboxItem=R;exports.ContextMenuContent=y;exports.ContextMenuGroup=b;exports.ContextMenuItem=N;exports.ContextMenuLabel=k;exports.ContextMenuPortal=g;exports.ContextMenuRadioGroup=M;exports.ContextMenuRadioItem=S;exports.ContextMenuSeparator=w;exports.ContextMenuShortcut=v;exports.ContextMenuSub=C;exports.ContextMenuSubContent=j;exports.ContextMenuSubTrigger=h;exports.ContextMenuTrigger=f;
@@ -64,7 +64,7 @@ const y = r.forwardRef(
64
64
  ...c,
65
65
  children: [
66
66
  o,
67
- /* @__PURE__ */ t(x, { className: "ml-auto", size: 16 })
67
+ /* @__PURE__ */ t(x, { className: "ml-auto" })
68
68
  ]
69
69
  }
70
70
  )
@@ -139,7 +139,7 @@ const v = r.forwardRef(
139
139
  "data-tracking-label": l,
140
140
  ...c,
141
141
  children: [
142
- /* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(p, { size: 16 }) }) }),
142
+ /* @__PURE__ */ t("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ t(n.ItemIndicator, { children: /* @__PURE__ */ t(p, {}) }) }),
143
143
  a
144
144
  ]
145
145
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),H=require("react"),k=require("date-fns"),M=require("@brightlocal/icons"),g=require("@brightlocal/ui-components/lib/utils"),L=require("./input.cjs"),S=require("@brightlocal/ui-components/calendar"),j=require("@brightlocal/ui-components/popover"),p=require("@brightlocal/ui-components/select");function A(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const D=A(H),v=D.createContext(null);function b(){const e=D.useContext(v);if(!e)throw new Error("DatePicker compound components must be used within DatePickerRoot");return e}function T({children:e,dataHook:n,trackingEl:t,trackingLabel:r,mode:s="single",date:d,onDateChange:u,dateRange:l,onDateRangeChange:c,placeholder:a,disabled:i,dateFormat:f,open:h,onOpenChange:P,defaultOpen:m=!1}){const[V,$]=D.useState(m),w=h!==void 0,x=w?h:V,y=D.useCallback(C=>{w||$(C),P?.(C)},[w,P]),_=D.useMemo(()=>({mode:s,open:x,setOpen:y,disabled:i,date:d,onDateChange:u,dateRange:l,onDateRangeChange:c,dateFormat:f??(s==="single"?"PPP":"PP"),placeholder:a??(s==="single"?"Pick a date":"Pick a date range"),dataHook:n,trackingEl:t,trackingLabel:r}),[s,x,y,i,d,u,l,c,f,a,n,t,r]);return o.jsx(v.Provider,{value:_,children:o.jsx(j.Popover,{open:x,onOpenChange:y,children:e})})}T.displayName="DatePickerRoot";const N=D.forwardRef(({className:e,children:n,id:t,...r},s)=>{const{mode:d,date:u,dateRange:l,dateFormat:c,placeholder:a,disabled:i,dataHook:f}=b(),P=d==="single"?u?k.format(u,c):null:l?.from?l.to?`${k.format(l.from,c)} - ${k.format(l.to,c)}`:k.format(l.from,c):null,m=P!==null;return o.jsx(j.PopoverTrigger,{asChild:!0,children:o.jsxs("button",{ref:s,"aria-label":r["aria-label"]??(d==="single"?"Select date":"Select date range"),className:g.cn(L.inputVariants({hasIcon:!0}),"relative cursor-pointer justify-start text-left",!m&&"text-muted-foreground",e),"data-hook":`${f}-trigger`,"data-slot":"date-picker-trigger",disabled:i,id:t,type:"button",...r,children:[o.jsx(M.Calendar,{className:g.cn("text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2",i&&"opacity-50"),"data-slot":"calendar-icon"}),n??(m?P:o.jsx("span",{children:a}))]})})});N.displayName="DatePickerTrigger";const R=D.forwardRef(({className:e,children:n,...t},r)=>{const{dataHook:s}=b();return o.jsx(j.PopoverContent,{ref:r,align:"start",className:g.cn("w-auto rounded-lg p-0",e),dataHook:`${s}-content`,...t,children:n})});R.displayName="DatePickerContent";function E({className:e,closeOnSelect:n=!0,...t}){const{mode:r,date:s,onDateChange:d,dateRange:u,onDateRangeChange:l,setOpen:c,disabled:a,dataHook:i}=b();return r==="single"?o.jsx(S.Calendar,{captionLayout:"dropdown",className:g.cn("border-0 shadow-none",e),dataHook:`${i}-calendar`,disabled:a,endMonth:new Date(2100,11,31),mode:"single",selected:s,startMonth:new Date(1900,0,1),onSelect:f=>{d?.(f),n&&c(!1)},...t}):o.jsx(S.Calendar,{captionLayout:"dropdown",className:g.cn("border-0 shadow-none",e),dataHook:`${i}-calendar`,disabled:a,endMonth:new Date(2100,11,31),mode:"range",selected:u,startMonth:new Date(1900,0,1),onSelect:l,...t})}E.displayName="DatePickerCalendar";const q=[{label:"Today",date:()=>new Date},{label:"Tomorrow",date:()=>{const e=new Date;return e.setDate(e.getDate()+1),e}},{label:"In 3 days",date:()=>{const e=new Date;return e.setDate(e.getDate()+3),e}},{label:"In a week",date:()=>{const e=new Date;return e.setDate(e.getDate()+7),e}}];function O({presets:e=q,placeholder:n="Select preset",className:t}){const{mode:r,date:s,onDateChange:d,disabled:u,dataHook:l}=b();if(r!=="single")return process.env.NODE_ENV!=="production"&&console.warn("DatePickerPresets only works with mode='single'"),null;const c=s?e.find(a=>a.date().toDateString()===s.toDateString())?.label:void 0;return o.jsxs(p.Select,{disabled:u,value:c,onValueChange:a=>{const i=e.find(f=>f.label===a);i&&d?.(i.date())},children:[o.jsx(p.SelectTrigger,{className:g.cn("w-full",t),dataHook:`${l}-preset-select`,children:o.jsx(p.SelectValue,{placeholder:n})}),o.jsx(p.SelectContent,{children:e.map(a=>o.jsx(p.SelectItem,{"data-hook":`${l}-preset-${a.label.toLowerCase().replace(/\s+/g,"-")}`,value:a.label,children:a.label},a.label))})]})}O.displayName="DatePickerPresets";exports.DEFAULT_DATE_PRESETS=q;exports.DatePickerCalendar=E;exports.DatePickerContent=R;exports.DatePickerPresets=O;exports.DatePickerRoot=T;exports.DatePickerTrigger=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),H=require("react"),k=require("date-fns"),M=require("@brightlocal/icons"),g=require("@brightlocal/ui-components/lib/utils"),L=require("./input.cjs"),S=require("@brightlocal/ui-components/calendar"),j=require("@brightlocal/ui-components/popover"),p=require("@brightlocal/ui-components/select");function A(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const D=A(H),v=D.createContext(null);function b(){const e=D.useContext(v);if(!e)throw new Error("DatePicker compound components must be used within DatePickerRoot");return e}function T({children:e,dataHook:n,trackingEl:t,trackingLabel:r,mode:s="single",date:d,onDateChange:u,dateRange:l,onDateRangeChange:c,placeholder:a,disabled:i,dateFormat:f,open:h,onOpenChange:P,defaultOpen:m=!1}){const[V,$]=D.useState(m),w=h!==void 0,x=w?h:V,y=D.useCallback(C=>{w||$(C),P?.(C)},[w,P]),_=D.useMemo(()=>({mode:s,open:x,setOpen:y,disabled:i,date:d,onDateChange:u,dateRange:l,onDateRangeChange:c,dateFormat:f??(s==="single"?"PPP":"PP"),placeholder:a??(s==="single"?"Pick a date":"Pick a date range"),dataHook:n,trackingEl:t,trackingLabel:r}),[s,x,y,i,d,u,l,c,f,a,n,t,r]);return o.jsx(v.Provider,{value:_,children:o.jsx(j.Popover,{open:x,onOpenChange:y,children:e})})}T.displayName="DatePickerRoot";const N=D.forwardRef(({className:e,children:n,id:t,...r},s)=>{const{mode:d,date:u,dateRange:l,dateFormat:c,placeholder:a,disabled:i,dataHook:f}=b(),P=d==="single"?u?k.format(u,c):null:l?.from?l.to?`${k.format(l.from,c)} - ${k.format(l.to,c)}`:k.format(l.from,c):null,m=P!==null;return o.jsx(j.PopoverTrigger,{asChild:!0,children:o.jsxs("button",{ref:s,"aria-label":r["aria-label"]??(d==="single"?"Select date":"Select date range"),className:g.cn(L.inputVariants({hasIcon:!0}),"relative cursor-pointer justify-start text-left",!m&&"text-muted-foreground",e),"data-hook":`${f}-trigger`,"data-slot":"date-picker-trigger",disabled:i,id:t,type:"button",...r,children:[o.jsx(M.Calendar,{className:g.cn("text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2",i&&"opacity-50"),"data-slot":"calendar-icon"}),n??(m?P:o.jsx("span",{children:a}))]})})});N.displayName="DatePickerTrigger";const R=D.forwardRef(({className:e,children:n,...t},r)=>{const{dataHook:s}=b();return o.jsx(j.PopoverContent,{ref:r,align:"start",className:g.cn("w-auto rounded-lg p-0",e),dataHook:`${s}-content`,...t,children:n})});R.displayName="DatePickerContent";function E({className:e,closeOnSelect:n=!0,...t}){const{mode:r,date:s,onDateChange:d,dateRange:u,onDateRangeChange:l,setOpen:c,disabled:a,dataHook:i}=b();return r==="single"?o.jsx(S.Calendar,{captionLayout:"dropdown",className:g.cn("border-0 shadow-none",e),dataHook:`${i}-calendar`,disabled:a,endMonth:new Date(2100,11,31),mode:"single",selected:s,startMonth:new Date(1900,0,1),onSelect:f=>{d?.(f),n&&c(!1)},...t}):o.jsx(S.Calendar,{captionLayout:"dropdown",className:g.cn("border-0 shadow-none",e),dataHook:`${i}-calendar`,disabled:a,endMonth:new Date(2100,11,31),mode:"range",selected:u,startMonth:new Date(1900,0,1),onSelect:l,...t})}E.displayName="DatePickerCalendar";const q=[{label:"Today",date:()=>new Date},{label:"Tomorrow",date:()=>{const e=new Date;return e.setDate(e.getDate()+1),e}},{label:"In 3 days",date:()=>{const e=new Date;return e.setDate(e.getDate()+3),e}},{label:"In a week",date:()=>{const e=new Date;return e.setDate(e.getDate()+7),e}}];function O({presets:e=q,placeholder:n="Select preset",className:t}){const{mode:r,date:s,onDateChange:d,disabled:u,dataHook:l}=b();if(r!=="single")return process.env.NODE_ENV!=="production"&&console.warn("DatePickerPresets only works with mode='single'"),null;const c=s?e.find(a=>a.date().toDateString()===s.toDateString())?.label:void 0;return o.jsxs(p.Select,{disabled:u,value:c,onValueChange:a=>{const i=e.find(f=>f.label===a);i&&d?.(i.date())},children:[o.jsx(p.SelectTrigger,{className:g.cn("w-full",t),dataHook:`${l}-preset-select`,children:o.jsx(p.SelectValue,{placeholder:n})}),o.jsx(p.SelectContent,{children:e.map(a=>o.jsx(p.SelectItem,{"data-hook":`${l}-preset-${a.label.toLowerCase().replace(/\s+/g,"-")}`,value:a.label,children:a.label},a.label))})]})}O.displayName="DatePickerPresets";exports.DEFAULT_DATE_PRESETS=q;exports.DatePickerCalendar=E;exports.DatePickerContent=R;exports.DatePickerPresets=O;exports.DatePickerRoot=T;exports.DatePickerTrigger=N;
@@ -99,7 +99,7 @@ const F = f.forwardRef(({ className: e, children: c, id: r, ...l }, a) => {
99
99
  V,
100
100
  {
101
101
  className: p(
102
- "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2",
102
+ "text-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2",
103
103
  i && "opacity-50"
104
104
  ),
105
105
  "data-slot": "calendar-icon"
@@ -126,7 +126,7 @@ const U = f.forwardRef(({ className: e, children: c, ...r }, l) => {
126
126
  );
127
127
  });
128
128
  U.displayName = "DatePickerContent";
129
- function z({
129
+ function q({
130
130
  className: e,
131
131
  closeOnSelect: c = !0,
132
132
  ...r
@@ -173,8 +173,8 @@ function z({
173
173
  }
174
174
  );
175
175
  }
176
- z.displayName = "DatePickerCalendar";
177
- const q = [
176
+ q.displayName = "DatePickerCalendar";
177
+ const z = [
178
178
  {
179
179
  label: "Today",
180
180
  date: () => /* @__PURE__ */ new Date()
@@ -202,7 +202,7 @@ const q = [
202
202
  }
203
203
  ];
204
204
  function B({
205
- presets: e = q,
205
+ presets: e = z,
206
206
  placeholder: c = "Select preset",
207
207
  className: r
208
208
  }) {
@@ -243,8 +243,8 @@ function B({
243
243
  }
244
244
  B.displayName = "DatePickerPresets";
245
245
  export {
246
- q as DEFAULT_DATE_PRESETS,
247
- z as DatePickerCalendar,
246
+ z as DEFAULT_DATE_PRESETS,
247
+ q as DatePickerCalendar,
248
248
  U as DatePickerContent,
249
249
  B as DatePickerPresets,
250
250
  A as DatePickerRoot,
package/dist/dialog.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),h=require("@brightlocal/icons"),l=require("@brightlocal/ui-components/lib/utils");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=c(v),s=c(w),g=s.Root;g.displayName="Dialog";const f=i.forwardRef(({dataHook:e,...a},t)=>o.jsx(s.Trigger,{ref:t,"data-hook":e,"data-slot":"dialog-trigger",...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(s.Portal,{...e})}n.displayName="DialogPortal";const u=i.forwardRef(({...e},a)=>o.jsx(s.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Overlay,{ref:t,className:l.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=i.forwardRef(({className:e,children:a,dataHook:t,trackingEl:r,trackingLabel:b,...j},N)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(s.Content,{ref:N,className:l.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":b,...j,children:[a,o.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(h.XIcon,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName="DialogContent";const p=i.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:l.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=i.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:l.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Title,{ref:t,className:l.cn("text-lg leading-none font-semibold",e),"data-slot":"dialog-title",...a}));x.displayName="DialogTitle";const y=i.forwardRef(({className:e,...a},t)=>o.jsx(s.Description,{ref:t,className:l.cn("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...a}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),v=require("react"),w=require("@radix-ui/react-dialog"),h=require("@brightlocal/icons"),s=require("@brightlocal/ui-components/lib/utils");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=c(v),i=c(w),g=i.Root;g.displayName="Dialog";const f=l.forwardRef(({dataHook:e,...a},t)=>o.jsx(i.Trigger,{ref:t,"data-hook":e,"data-slot":"dialog-trigger",...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(i.Portal,{...e})}n.displayName="DialogPortal";const u=l.forwardRef(({...e},a)=>o.jsx(i.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Overlay,{ref:t,className:s.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=l.forwardRef(({className:e,children:a,dataHook:t,trackingEl:r,trackingLabel:b,...j},N)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(i.Content,{ref:N,className:s.cn("bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":r,"data-tracking-label":b,...j,children:[a,o.jsxs(i.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[o.jsx(h.X,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));m.displayName="DialogContent";const p=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=l.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:s.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Title,{ref:t,className:s.cn("text-lg leading-none font-semibold",e),"data-slot":"dialog-title",...a}));x.displayName="DialogTitle";const y=l.forwardRef(({className:e,...a},t)=>o.jsx(i.Description,{ref:t,className:s.cn("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...a}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;