@stokelp/ui 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +4 -4
  2. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs +1 -1
  3. package/dist/components/app/mobile-card/MobileCardNotificationBadge.cjs.map +1 -1
  4. package/dist/components/app/mobile-card/MobileCardNotificationBadge.js +1 -1
  5. package/dist/components/app/mobile-navigation/MobileNavigation.d.ts +2 -1
  6. package/dist/components/app/navigation/AppNavigation.cjs +1 -1
  7. package/dist/components/app/navigation/AppNavigation.cjs.map +1 -1
  8. package/dist/components/app/navigation/AppNavigation.d.ts +2 -2
  9. package/dist/components/app/navigation/AppNavigation.js +1 -1
  10. package/dist/components/avatar/styled.d.ts +4 -5
  11. package/dist/components/button-filter/ButtonFilter.d.ts +3 -3
  12. package/dist/components/chat/Chat.d.ts +4 -4
  13. package/dist/components/chat/ChatDocumentMessage.cjs +1 -1
  14. package/dist/components/chat/ChatDocumentMessage.cjs.map +1 -1
  15. package/dist/components/chat/ChatDocumentMessage.js +2 -2
  16. package/dist/components/chat/ChatMessage.d.ts +3 -3
  17. package/dist/components/chip/Chip.d.ts +1 -1
  18. package/dist/components/combobox/Combobox.cjs +1 -1
  19. package/dist/components/combobox/Combobox.cjs.map +1 -1
  20. package/dist/components/combobox/Combobox.d.ts +4 -3
  21. package/dist/components/combobox/Combobox.js +64 -63
  22. package/dist/components/combobox/Combobox.js.map +1 -1
  23. package/dist/components/flag/styled.d.ts +4 -4
  24. package/dist/components/input/HighlightedInput.d.ts +3 -3
  25. package/dist/components/input/InputAddon.d.ts +3 -3
  26. package/dist/components/pagination/Pagination.d.ts +1 -1
  27. package/dist/components/radio-card-group/RadioCardGroup.d.ts +2 -2
  28. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs +1 -1
  29. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.cjs.map +1 -1
  30. package/dist/components/supplier-rating-badge/SupplierRatingBreakdown.js +2 -2
  31. package/dist/components/switch-card/SwitchCard.d.ts +2 -2
  32. package/dist/components/tabs/Tabs.d.ts +3 -4
  33. package/dist/components/textarea/Textarea.d.ts +3 -3
  34. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +2 -0
  35. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowDownTrayIcon.cjs.map +1 -1
  36. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowDownTrayIcon.js +1 -1
  37. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowDownTrayIcon.js.map +1 -1
  38. package/dist/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +2 -0
  39. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowLeftCircleIcon.cjs.map +1 -1
  40. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowLeftCircleIcon.js +1 -1
  41. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ArrowLeftCircleIcon.js.map +1 -1
  42. package/dist/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +2 -0
  43. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs.map +1 -1
  44. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ChatBubbleLeftRightIcon.js +1 -1
  45. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/ChatBubbleLeftRightIcon.js.map +1 -1
  46. package/dist/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +2 -0
  47. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/CheckCircleIcon.cjs.map +1 -1
  48. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/CheckCircleIcon.js +1 -1
  49. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/CheckCircleIcon.js.map +1 -1
  50. package/dist/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +2 -0
  51. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/DocumentTextIcon.cjs.map +1 -1
  52. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/DocumentTextIcon.js +1 -1
  53. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/DocumentTextIcon.js.map +1 -1
  54. package/dist/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +2 -0
  55. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/XCircleIcon.cjs.map +1 -1
  56. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/XCircleIcon.js +1 -1
  57. package/dist/node_modules/{.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons → @heroicons}/react/24/outline/esm/XCircleIcon.js.map +1 -1
  58. package/dist/node_modules/deepmerge/dist/cjs.cjs +2 -0
  59. package/dist/node_modules/deepmerge/dist/cjs.cjs.map +1 -0
  60. package/dist/node_modules/{.pnpm/deepmerge@4.3.1/node_modules/deepmerge → deepmerge}/dist/cjs.js +2 -2
  61. package/dist/node_modules/deepmerge/dist/cjs.js.map +1 -0
  62. package/dist/theme/recipes/icon-button.cjs +1 -1
  63. package/dist/theme/recipes/icon-button.cjs.map +1 -1
  64. package/dist/theme/recipes/icon-button.js +1 -1
  65. package/package.json +7 -8
  66. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs +0 -2
  67. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs +0 -2
  68. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs +0 -2
  69. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/CheckCircleIcon.cjs +0 -2
  70. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs +0 -2
  71. package/dist/node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/XCircleIcon.cjs +0 -2
  72. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs +0 -2
  73. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.cjs.map +0 -1
  74. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js.map +0 -1
package/README.md CHANGED
@@ -3,13 +3,13 @@
3
3
  ## Commands
4
4
 
5
5
  ```shell
6
- pnpm panda codegen --watch
7
- pnpm panda:lib:watch
8
- pnpm vite build --watch
6
+ npx panda codegen --watch
7
+ npm run panda:lib:watch
8
+ npx vite build --watch
9
9
  ```
10
10
 
11
11
  ### Storybook
12
12
 
13
13
  ```shell
14
- pnpm storybook
14
+ npm run storybook
15
15
  ```
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../chip/Chip.cjs"),t=require("../../icon/Icon.cjs"),n=require("../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs");let r=require("@stokelp/styled-system/jsx"),i=require("react/jsx-runtime");function a({count:a}){return!a||a<=0?null:(0,i.jsxs)(r.HStack,{gap:`space-4`,alignItems:`center`,flexShrink:0,children:[(0,i.jsx)(t.Icon,{size:`sm`,color:`grey.400`,children:(0,i.jsx)(n.default,{})}),(0,i.jsx)(e.Chip,{size:`sm`,display:`flex`,placeContent:`center`,bgColor:`error.500`,w:`size-20`,h:`size-20`,children:(0,i.jsx)(e.ChipLabel,{color:`white`,children:a})})]})}exports.MobileCardNotificationBadge=a;
1
+ "use client";const e=require("../../chip/Chip.cjs"),t=require("../../icon/Icon.cjs"),n=require("../../../node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.cjs");let r=require("@stokelp/styled-system/jsx"),i=require("react/jsx-runtime");function a({count:a}){return!a||a<=0?null:(0,i.jsxs)(r.HStack,{gap:`space-4`,alignItems:`center`,flexShrink:0,children:[(0,i.jsx)(t.Icon,{size:`sm`,color:`grey.400`,children:(0,i.jsx)(n.default,{})}),(0,i.jsx)(e.Chip,{size:`sm`,display:`flex`,placeContent:`center`,bgColor:`error.500`,w:`size-20`,h:`size-20`,children:(0,i.jsx)(e.ChipLabel,{color:`white`,children:a})})]})}exports.MobileCardNotificationBadge=a;
2
2
  //# sourceMappingURL=MobileCardNotificationBadge.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileCardNotificationBadge.cjs","names":["HStack","Icon","ChatBubbleLeftRightIcon","Chip","ChipLabel","require_Chip","require_Icon","require_ChatBubbleLeftRightIcon","_stokelp_styled_system_jsx","react_jsx_runtime","MobileCardNotificationBadge","count"],"sources":["../../../../src/components/app/mobile-card/MobileCardNotificationBadge.tsx"],"sourcesContent":["import { HStack } from '@stokelp/styled-system/jsx'\nimport { Chip, ChipLabel } from '~/components/chip/Chip'\nimport { Icon } from '~/components/icon/Icon'\nimport { ChatBubbleLeftRightIcon } from '@heroicons/react/24/outline'\n\nexport interface MobileCardNotificationBadgeProps {\n count?: number\n}\n\nexport function MobileCardNotificationBadge({ count }: MobileCardNotificationBadgeProps) {\n if (!count || count <= 0) return null\n\n return (\n <HStack gap=\"space-4\" alignItems=\"center\" flexShrink={0}>\n <Icon size=\"sm\" color=\"grey.400\">\n <ChatBubbleLeftRightIcon />\n </Icon>\n <Chip size=\"sm\" display=\"flex\" placeContent=\"center\" bgColor=\"error.500\" w=\"size-20\" h=\"size-20\">\n <ChipLabel color=\"white\">{count}</ChipLabel>\n </Chip>\n </HStack>\n )\n}\n"],"mappings":"A,sTASA,SAAgBU,EAA4B,CAAE,SAA2C,CAGvF,MAFI,CAACC,GAASA,GAAS,EAAU,MAG/B,EAAAF,EAAA,KAAA,CAACT,EAAAA,OAAD,CAAQ,IAAI,UAAU,WAAW,SAAS,WAAY,EAAtD,SAAA,EACE,EAAAS,EAAA,IAAA,CAACR,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,WACpB,UAAA,EAAAQ,EAAA,IAAA,CAACP,EAAAA,QAAD,CAA0B,CAAA,CACtB,CAAA,GACN,EAAAO,EAAA,IAAA,CAACN,EAAAA,KAAD,CAAM,KAAK,KAAK,QAAQ,OAAO,aAAa,SAAS,QAAQ,YAAY,EAAE,UAAU,EAAE,UACrF,UAAA,EAAAM,EAAA,IAAA,CAACL,EAAAA,UAAD,CAAW,MAAM,QAAS,SAAAO,CAAiB,CAAA,CACvC,CAAA,CACA,C,EAEZ,C"}
1
+ {"version":3,"file":"MobileCardNotificationBadge.cjs","names":["HStack","Icon","ChatBubbleLeftRightIcon","Chip","ChipLabel","require_Chip","require_Icon","require_ChatBubbleLeftRightIcon","_stokelp_styled_system_jsx","react_jsx_runtime","MobileCardNotificationBadge","count"],"sources":["../../../../src/components/app/mobile-card/MobileCardNotificationBadge.tsx"],"sourcesContent":["import { HStack } from '@stokelp/styled-system/jsx'\nimport { Chip, ChipLabel } from '~/components/chip/Chip'\nimport { Icon } from '~/components/icon/Icon'\nimport { ChatBubbleLeftRightIcon } from '@heroicons/react/24/outline'\n\nexport interface MobileCardNotificationBadgeProps {\n count?: number\n}\n\nexport function MobileCardNotificationBadge({ count }: MobileCardNotificationBadgeProps) {\n if (!count || count <= 0) return null\n\n return (\n <HStack gap=\"space-4\" alignItems=\"center\" flexShrink={0}>\n <Icon size=\"sm\" color=\"grey.400\">\n <ChatBubbleLeftRightIcon />\n </Icon>\n <Chip size=\"sm\" display=\"flex\" placeContent=\"center\" bgColor=\"error.500\" w=\"size-20\" h=\"size-20\">\n <ChipLabel color=\"white\">{count}</ChipLabel>\n </Chip>\n </HStack>\n )\n}\n"],"mappings":"A,+PASA,SAAgBU,EAA4B,CAAE,SAA2C,CAGvF,MAFI,CAACC,GAASA,GAAS,EAAU,MAG/B,EAAAF,EAAA,KAAA,CAACT,EAAAA,OAAD,CAAQ,IAAI,UAAU,WAAW,SAAS,WAAY,EAAtD,SAAA,EACE,EAAAS,EAAA,IAAA,CAACR,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,WACpB,UAAA,EAAAQ,EAAA,IAAA,CAACP,EAAAA,QAAD,CAA0B,CAAA,CACtB,CAAA,GACN,EAAAO,EAAA,IAAA,CAACN,EAAAA,KAAD,CAAM,KAAK,KAAK,QAAQ,OAAO,aAAa,SAAS,QAAQ,YAAY,EAAE,UAAU,EAAE,UACrF,UAAA,EAAAM,EAAA,IAAA,CAACL,EAAAA,UAAD,CAAW,MAAM,QAAS,SAAAO,CAAiB,CAAA,CACvC,CAAA,CACA,C,EAEZ,C"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Chip as e, ChipLabel as t } from "../../chip/Chip.js";
3
3
  import { Icon as n } from "../../icon/Icon.js";
4
- import r from "../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js";
4
+ import r from "../../../node_modules/@heroicons/react/24/outline/esm/ChatBubbleLeftRightIcon.js";
5
5
  import { HStack as i } from "@stokelp/styled-system/jsx";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  // src/components/app/mobile-card/MobileCardNotificationBadge.tsx
@@ -2,9 +2,10 @@ import { StyledComponent } from '@stokelp/styled-system/types';
2
2
  import { ComponentProps, FC } from 'react';
3
3
  import { ComponentVariants } from '../../../utils/slots';
4
4
  import { MobileNavigationRecipe } from '@stokelp/styled-system/recipes';
5
+ import { IconProps } from '../../icon/Icon';
5
6
  export declare const Root: ComponentVariants<StyledComponent<"nav", {}>, MobileNavigationRecipe>;
6
7
  export declare const Item: StyledComponent<"a", {}>;
7
- export declare const ItemIcon: FC<any>;
8
+ export declare const ItemIcon: FC<IconProps>;
8
9
  export declare const ItemLabel: StyledComponent<"span", {}>;
9
10
  export interface MobileNavigationProps extends ComponentProps<typeof Root> {
10
11
  }
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../tag/Tag.cjs"),r=require("../../icon/Icon.cjs"),i=require("../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs");let a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react/jsx-runtime");var c=e.__exportAll({Body:()=>_,Footer:()=>w,Header:()=>g,Item:()=>v,ItemAlpha:()=>C,ItemContent:()=>b,ItemIcon:()=>S,ItemLabel:()=>x,ItemSubItems:()=>y,MiniaturizeTrigger:()=>T,Root:()=>h}),{withProvider:l,withContext:u}=t.createStyleContext(o.appNavigation,{dataAttr:!0}),d=`isMiniaturizeNav`,f=()=>{try{return localStorage.getItem(d)===`closed`?`closed`:`open`}catch{return`open`}},p=e=>{try{localStorage.setItem(d,e)}catch{}},m=e=>(0,a.styled)(e),h=l(m(`nav`),`root`,{defaultProps:{}}),g=u(m(`header`),`header`),_=u(m(`main`),`body`),v=u(m(`div`),`item`),y=u(m(`div`),`itemSubItems`),b=u(m(`div`),`itemContent`),x=u(m(`p`),`itemLabel`),S=u(r.Icon,`itemIcon`,{defaultProps:{size:`sm`}}),C=u(n.Tag,`itemAlpha`,{defaultProps:{severity:`success`}}),w=u(m(`footer`),`footer`),T=u(m(`div`),`miniaturizeTrigger`,{defaultProps:{onClick:e=>{e.preventDefault();let t=f()===`closed`?`open`:`closed`;p(t),e.currentTarget.setAttribute(`data-state`,t),window.dispatchEvent(new Event(`storage`))},className:`app-navigation__miniaturizeTrigger`,...{get"data-state"(){return f()}},children:(0,s.jsx)(r.Icon,{children:(0,s.jsx)(i.default,{})})}});Object.defineProperty(exports,"AppNavigation_exports",{enumerable:!0,get:function(){return c}}),exports.Body=_,exports.Footer=w,exports.Header=g,exports.Item=v,exports.ItemAlpha=C,exports.ItemContent=b,exports.ItemIcon=S,exports.ItemLabel=x,exports.ItemSubItems=y,exports.MiniaturizeTrigger=T,exports.Root=h;
1
+ "use client";const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../utils/slots.cjs"),n=require("../../tag/Tag.cjs"),r=require("../../icon/Icon.cjs"),i=require("../../../node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.cjs");let a=require("@stokelp/styled-system/jsx"),o=require("@stokelp/styled-system/recipes"),s=require("react/jsx-runtime");var c=e.__exportAll({Body:()=>_,Footer:()=>w,Header:()=>g,Item:()=>v,ItemAlpha:()=>C,ItemContent:()=>b,ItemIcon:()=>S,ItemLabel:()=>x,ItemSubItems:()=>y,MiniaturizeTrigger:()=>T,Root:()=>h}),{withProvider:l,withContext:u}=t.createStyleContext(o.appNavigation,{dataAttr:!0}),d=`isMiniaturizeNav`,f=()=>{try{return localStorage.getItem(d)===`closed`?`closed`:`open`}catch{return`open`}},p=e=>{try{localStorage.setItem(d,e)}catch{}},m=e=>(0,a.styled)(e),h=l(m(`nav`),`root`,{defaultProps:{}}),g=u(m(`header`),`header`),_=u(m(`main`),`body`),v=u(m(`div`),`item`),y=u(m(`div`),`itemSubItems`),b=u(m(`div`),`itemContent`),x=u(m(`p`),`itemLabel`),S=u(r.Icon,`itemIcon`,{defaultProps:{size:`sm`}}),C=u(n.Tag,`itemAlpha`,{defaultProps:{severity:`success`}}),w=u(m(`footer`),`footer`),T=u(m(`div`),`miniaturizeTrigger`,{defaultProps:{onClick:e=>{e.preventDefault();let t=f()===`closed`?`open`:`closed`;p(t),e.currentTarget.setAttribute(`data-state`,t),window.dispatchEvent(new Event(`storage`))},className:`app-navigation__miniaturizeTrigger`,...{get"data-state"(){return f()}},children:(0,s.jsx)(r.Icon,{children:(0,s.jsx)(i.default,{})})}});Object.defineProperty(exports,"AppNavigation_exports",{enumerable:!0,get:function(){return c}}),exports.Body=_,exports.Footer=w,exports.Header=g,exports.Item=v,exports.ItemAlpha=C,exports.ItemContent=b,exports.ItemIcon=S,exports.ItemLabel=x,exports.ItemSubItems=y,exports.MiniaturizeTrigger=T,exports.Root=h;
2
2
  //# sourceMappingURL=AppNavigation.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppNavigation.cjs","names":["createStyleContext","appNavigation","styled","Icon","Tag","ArrowLeftCircleIcon","require_runtime","require_slots","require_Tag","require_Icon","require_ArrowLeftCircleIcon","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","AppNavigation_exports","Body","Footer","Header","Item","ItemAlpha","ItemContent","ItemIcon","ItemLabel","ItemSubItems","MiniaturizeTrigger","Root","MINIATURIZE_STORAGE_KEY","readMiniaturizeState","writeMiniaturizeState","state","styledTag","tag","withProvider","withContext","newState"],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\nconst MINIATURIZE_STORAGE_KEY = 'isMiniaturizeNav'\n\ntype MiniaturizeState = 'open' | 'closed'\n\n// Whether the nav is collapsed lives in localStorage: no backend field and no teammate\n// sync, and the recipe reads it off `data-state` on the trigger (see the `:has()` rule in\n// theme/recipes/app/navigation.ts).\n//\n// Both helpers swallow their own errors on purpose. A browser that blocks site data\n// (Android Chrome with cookies off, an embedded webview, Safari in lockdown) throws\n// SecurityError on the mere property access, and `typeof localStorage` does not guard\n// against that: it evaluates the same getter. It only guards against the server, where\n// the property is absent.\nconst readMiniaturizeState = (): MiniaturizeState => {\n try {\n return localStorage.getItem(MINIATURIZE_STORAGE_KEY) === 'closed' ? 'closed' : 'open'\n } catch {\n return 'open'\n }\n}\n\nconst writeMiniaturizeState = (state: MiniaturizeState): void => {\n try {\n localStorage.setItem(MINIATURIZE_STORAGE_KEY, state)\n } catch {\n // Storage blocked: the attribute set below still collapses the nav for this page\n // view, the choice just does not survive a reload.\n }\n}\n\n// See Table.tsx for why we wrap `styled(tag)` to pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root', {\n defaultProps: {},\n})\nexport const Header = withContext(styledTag('header'), 'header')\nexport const Body = withContext(styledTag('main'), 'body')\n\nexport const Item = withContext(styledTag('div'), 'item')\nexport const ItemSubItems = withContext(styledTag('div'), 'itemSubItems')\nexport const ItemContent = withContext(styledTag('div'), 'itemContent')\nexport const ItemLabel = withContext(styledTag('p'), 'itemLabel')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemAlpha = withContext(Tag, 'itemAlpha', {\n defaultProps: {\n severity: 'success',\n },\n})\n\nexport const Footer = withContext(styledTag('footer'), 'footer')\n\nexport const MiniaturizeTrigger = withContext(styledTag('div'), 'miniaturizeTrigger', {\n defaultProps: {\n onClick: (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n const newState = readMiniaturizeState() === 'closed' ? 'open' : 'closed'\n writeMiniaturizeState(newState)\n e.currentTarget.setAttribute('data-state', newState)\n window.dispatchEvent(new Event('storage'))\n },\n className: 'app-navigation__miniaturizeTrigger',\n ...{\n // A getter, so the value is read when this object is SPREAD (on every render of the\n // trigger, in createStyleContext) and never when the module is evaluated. As a plain\n // value it read storage at import time, which threw SecurityError on the browsers\n // above and killed the whole chunk: the kit's barrel imports this module, so every\n // page that imports anything from @stokelp/ui went down with it, public marketing\n // pages that show no navigation included.\n get 'data-state'() {\n return readMiniaturizeState()\n },\n },\n children: (\n <Icon>\n <ArrowLeftCircleIcon />\n </Icon>\n ),\n },\n})\n\nexport interface AppNavigationProps extends ComponentProps<typeof Root> {}\nexport interface AppNavigationHeaderProps extends ComponentProps<typeof Header> {}\nexport interface AppNavigationBodyProps extends ComponentProps<typeof Body> {}\nexport interface AppNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface AppNavigationItemSubItemsProps extends ComponentProps<typeof ItemSubItems> {}\nexport interface AppNavigationItemContentProps extends ComponentProps<typeof ItemContent> {}\nexport type AppNavigationItemLabelProps = ComponentProps<typeof ItemLabel>\nexport interface AppNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface AppNavigationFooterProps extends ComponentProps<typeof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,IAAI,MAAM,SAAS,CAAC,CAC3C,EACA,UAAW,qCACX,GAAG,CAOD,GAAI,cAAe,CACjB,OAAOP,EAAqB,CAC9B,CACF,EACA,UACE,EAAAd,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAA,UACE,EAAAU,EAAA,IAAA,CAACR,EAAAA,QAAD,CAAsB,CAAA,CAClB,CAAA,CAEV,CACF,CAAC,E"}
1
+ {"version":3,"file":"AppNavigation.cjs","names":["createStyleContext","appNavigation","styled","Icon","Tag","ArrowLeftCircleIcon","require_runtime","require_slots","require_Tag","require_Icon","require_ArrowLeftCircleIcon","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","AppNavigation_exports","Body","Footer","Header","Item","ItemAlpha","ItemContent","ItemIcon","ItemLabel","ItemSubItems","MiniaturizeTrigger","Root","MINIATURIZE_STORAGE_KEY","readMiniaturizeState","writeMiniaturizeState","state","styledTag","tag","withProvider","withContext","newState"],"sources":["../../../../src/components/app/navigation/AppNavigation.tsx"],"sourcesContent":["import { styled } from '@stokelp/styled-system/jsx'\nimport { appNavigation } from '@stokelp/styled-system/recipes'\nimport type { StyledComponent } from '@stokelp/styled-system/types'\nimport { createStyleContext } from '~/utils/slots'\nimport { Icon } from '~/components/icon/Icon'\nimport { ComponentProps, type JSX, type MouseEvent } from 'react'\nimport { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'\nimport { Tag } from '~/components'\n\nconst { withProvider, withContext } = createStyleContext(appNavigation, {\n dataAttr: true,\n})\n\nconst MINIATURIZE_STORAGE_KEY = 'isMiniaturizeNav'\n\ntype MiniaturizeState = 'open' | 'closed'\n\n// Whether the nav is collapsed lives in localStorage: no backend field and no teammate\n// sync, and the recipe reads it off `data-state` on the trigger (see the `:has()` rule in\n// theme/recipes/app/navigation.ts).\n//\n// Both helpers swallow their own errors on purpose. A browser that blocks site data\n// (Android Chrome with cookies off, an embedded webview, Safari in lockdown) throws\n// SecurityError on the mere property access, and `typeof localStorage` does not guard\n// against that: it evaluates the same getter. It only guards against the server, where\n// the property is absent.\nconst readMiniaturizeState = (): MiniaturizeState => {\n try {\n return localStorage.getItem(MINIATURIZE_STORAGE_KEY) === 'closed' ? 'closed' : 'open'\n } catch {\n return 'open'\n }\n}\n\nconst writeMiniaturizeState = (state: MiniaturizeState): void => {\n try {\n localStorage.setItem(MINIATURIZE_STORAGE_KEY, state)\n } catch {\n // Storage blocked: the attribute set below still collapses the nav for this page\n // view, the choice just does not survive a reload.\n }\n}\n\n// See Table.tsx for why we wrap `styled(tag)` to pin the literal tag.\nconst styledTag = <T extends keyof JSX.IntrinsicElements>(tag: T): StyledComponent<T, {}> =>\n styled(tag) as StyledComponent<T, {}>\n\nexport const Root = withProvider(styledTag('nav'), 'root', {\n defaultProps: {},\n})\nexport const Header = withContext(styledTag('header'), 'header')\nexport const Body = withContext(styledTag('main'), 'body')\n\nexport const Item = withContext(styledTag('div'), 'item')\nexport const ItemSubItems = withContext(styledTag('div'), 'itemSubItems')\nexport const ItemContent = withContext(styledTag('div'), 'itemContent')\nexport const ItemLabel = withContext(styledTag('p'), 'itemLabel')\nexport const ItemIcon = withContext(Icon, 'itemIcon', {\n defaultProps: {\n size: 'sm',\n },\n})\nexport const ItemAlpha = withContext(Tag, 'itemAlpha', {\n defaultProps: {\n severity: 'success',\n },\n})\n\nexport const Footer = withContext(styledTag('footer'), 'footer')\n\nexport const MiniaturizeTrigger = withContext(styledTag('div'), 'miniaturizeTrigger', {\n defaultProps: {\n onClick: (e: MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n const newState = readMiniaturizeState() === 'closed' ? 'open' : 'closed'\n writeMiniaturizeState(newState)\n e.currentTarget.setAttribute('data-state', newState)\n window.dispatchEvent(new Event('storage'))\n },\n className: 'app-navigation__miniaturizeTrigger',\n ...{\n // A getter, so the value is read when this object is SPREAD (on every render of the\n // trigger, in createStyleContext) and never when the module is evaluated. As a plain\n // value it read storage at import time, which threw SecurityError on the browsers\n // above and killed the whole chunk: the kit's barrel imports this module, so every\n // page that imports anything from @stokelp/ui went down with it, public marketing\n // pages that show no navigation included.\n get 'data-state'() {\n return readMiniaturizeState()\n },\n },\n children: (\n <Icon>\n <ArrowLeftCircleIcon />\n </Icon>\n ),\n },\n})\n\nexport interface AppNavigationProps extends ComponentProps<typeof Root> {}\nexport interface AppNavigationHeaderProps extends ComponentProps<typeof Header> {}\nexport interface AppNavigationBodyProps extends ComponentProps<typeof Body> {}\nexport interface AppNavigationItemProps extends ComponentProps<typeof Item> {}\nexport interface AppNavigationItemSubItemsProps extends ComponentProps<typeof ItemSubItems> {}\nexport interface AppNavigationItemContentProps extends ComponentProps<typeof ItemContent> {}\nexport type AppNavigationItemLabelProps = ComponentProps<typeof ItemLabel>\nexport interface AppNavigationItemIconProps extends ComponentProps<typeof ItemIcon> {}\nexport interface AppNavigationFooterProps extends ComponentProps<typeof Footer> {}\nexport interface AppNavigationMiniaturizeTriggerProps extends ComponentProps<typeof MiniaturizeTrigger> {}\n"],"mappings":"A,+jBASM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,cAAe,CACtE,SAAU,EACZ,CAAC,EAEKyB,EAA0B,mBAa1BC,MAA+C,CACnD,GAAI,CACF,OAAO,aAAa,QAAQD,CAAuB,IAAM,SAAW,SAAW,MACjF,MAAQ,CACN,MAAO,MACT,CACF,EAEME,EAAyB,GAAkC,CAC/D,GAAI,CACF,aAAa,QAAQF,EAAyBG,CAAK,CACrD,MAAQ,CAGR,CACF,EAGMC,EAAoD,IAAA,EACxD5B,EAAAA,OAAAA,CAAO6B,CAAG,EAECN,EAAOO,EAAaF,EAAU,KAAK,EAAG,OAAQ,CACzD,aAAc,CAAC,CACjB,CAAC,EACYb,EAASgB,EAAYH,EAAU,QAAQ,EAAG,QAAQ,EAClDf,EAAOkB,EAAYH,EAAU,MAAM,EAAG,MAAM,EAE5CZ,EAAOe,EAAYH,EAAU,KAAK,EAAG,MAAM,EAC3CP,EAAeU,EAAYH,EAAU,KAAK,EAAG,cAAc,EAC3DV,EAAca,EAAYH,EAAU,KAAK,EAAG,aAAa,EACzDR,EAAYW,EAAYH,EAAU,GAAG,EAAG,WAAW,EACnDT,EAAWY,EAAY9B,EAAAA,KAAM,WAAY,CACpD,aAAc,CACZ,KAAM,IACR,CACF,CAAC,EACYgB,EAAYc,EAAY7B,EAAAA,IAAK,YAAa,CACrD,aAAc,CACZ,SAAU,SACZ,CACF,CAAC,EAEYY,EAASiB,EAAYH,EAAU,QAAQ,EAAG,QAAQ,EAElDN,EAAqBS,EAAYH,EAAU,KAAK,EAAG,qBAAsB,CACpF,aAAc,CACZ,QAAU,GAAkC,CAC1C,EAAE,eAAe,EACjB,IAAMI,EAAWP,EAAqB,IAAM,SAAW,OAAS,SAChEC,EAAsBM,CAAQ,EAC9B,EAAE,cAAc,aAAa,aAAcA,CAAQ,EACnD,OAAO,cAAc,IAAI,MAAM,SAAS,CAAC,CAC3C,EACA,UAAW,qCACX,GAAG,CAOD,GAAI,cAAe,CACjB,OAAOP,EAAqB,CAC9B,CACF,EACA,UACE,EAAAd,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAA,UACE,EAAAU,EAAA,IAAA,CAACR,EAAAA,QAAD,CAAsB,CAAA,CAClB,CAAA,CAEV,CACF,CAAC,E"}
@@ -2,7 +2,7 @@ import { StyledComponent } from '@stokelp/styled-system/types';
2
2
  import { ComponentProps, FC, ForwardRefExoticComponent, RefAttributes } from 'react';
3
3
  import { ComponentVariants } from '../../../utils/slots';
4
4
  import { AppNavigationRecipe } from '@stokelp/styled-system/recipes';
5
- import { TagProps } from '../..';
5
+ import { IconProps, TagProps } from '../..';
6
6
  export declare const Root: ComponentVariants<StyledComponent<"nav", {}>, AppNavigationRecipe>;
7
7
  export declare const Header: StyledComponent<"header", {}>;
8
8
  export declare const Body: StyledComponent<"main", {}>;
@@ -10,7 +10,7 @@ export declare const Item: StyledComponent<"div", {}>;
10
10
  export declare const ItemSubItems: StyledComponent<"div", {}>;
11
11
  export declare const ItemContent: StyledComponent<"div", {}>;
12
12
  export declare const ItemLabel: StyledComponent<"p", {}>;
13
- export declare const ItemIcon: FC<any>;
13
+ export declare const ItemIcon: FC<IconProps>;
14
14
  export declare const ItemAlpha: ForwardRefExoticComponent< TagProps & RefAttributes<HTMLDivElement>>;
15
15
  export declare const Footer: StyledComponent<"footer", {}>;
16
16
  export declare const MiniaturizeTrigger: StyledComponent<"div", {}>;
@@ -3,7 +3,7 @@ import { __exportAll as e } from "../../../_virtual/_rolldown/runtime.js";
3
3
  import { createStyleContext as t } from "../../../utils/slots.js";
4
4
  import { Tag as n } from "../../tag/Tag.js";
5
5
  import { Icon as r } from "../../icon/Icon.js";
6
- import i from "../../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js";
6
+ import i from "../../../node_modules/@heroicons/react/24/outline/esm/ArrowLeftCircleIcon.js";
7
7
  import { styled as a } from "@stokelp/styled-system/jsx";
8
8
  import { appNavigation as o } from "@stokelp/styled-system/recipes";
9
9
  import { jsx as s } from "react/jsx-runtime";
@@ -1,11 +1,10 @@
1
- import { Avatar } from '@ark-ui/react';
2
- import { ComponentProps, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
1
+ import { Avatar, PolymorphicProps } from '@ark-ui/react';
2
+ import { ComponentProps, ReactNode, ForwardRefExoticComponent, ClassAttributes, HTMLAttributes, RefAttributes } from 'react';
3
3
  import { StyledComponent } from '@stokelp/styled-system/jsx';
4
- import { Assign, AnyProps } from '@stokelp/styled-system/types';
5
4
  import { AvatarGroupVariantProps, AvatarRecipe } from '@stokelp/styled-system/recipes';
6
5
  import { ComponentVariants } from '../../utils/slots';
7
- declare const InnerGroup: StyledComponent<any, Assign<AnyProps, AvatarGroupVariantProps>>;
8
- export declare const Group: ForwardRefExoticComponent<any>;
6
+ declare const InnerGroup: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & PolymorphicProps>, AvatarGroupVariantProps>;
7
+ export declare const Group: ForwardRefExoticComponent<Omit<AvatarGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
9
8
  export declare const Root: ComponentVariants<StyledComponent<ForwardRefExoticComponent<Avatar.RootProps & RefAttributes<HTMLDivElement>>, {}>, AvatarRecipe>;
10
9
  export declare const Image: StyledComponent<ForwardRefExoticComponent<Avatar.ImageProps & RefAttributes<HTMLImageElement>>, {}>;
11
10
  export declare const Fallback: StyledComponent<ForwardRefExoticComponent<Avatar.FallbackProps & RefAttributes<HTMLSpanElement>>, {}>;
@@ -1,7 +1,7 @@
1
- import { ComponentProps } from 'react';
1
+ import { ComponentProps, ForwardRefExoticComponent, ClassAttributes, ButtonHTMLAttributes } from 'react';
2
2
  import { StyledComponent } from '@stokelp/styled-system/jsx';
3
- import { Assign, AnyProps } from '@stokelp/styled-system/types';
3
+ import { PolymorphicProps } from '@ark-ui/react';
4
4
  import { ButtonFilterVariantProps } from '@stokelp/styled-system/recipes';
5
- export declare const ButtonFilter: StyledComponent<any, Assign<AnyProps, ButtonFilterVariantProps>>;
5
+ export declare const ButtonFilter: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & PolymorphicProps>, ButtonFilterVariantProps>;
6
6
  export interface ButtonFilterProps extends ComponentProps<typeof ButtonFilter> {
7
7
  }
@@ -2,15 +2,15 @@ import { FC, ReactElement, ForwardRefExoticComponent, ClassAttributes, HTMLAttri
2
2
  import { chat, ChatRecipe, ChatMessageVariantProps } from '@stokelp/styled-system/recipes';
3
3
  import { ChatMessageProps } from './ChatMessage.tsx';
4
4
  import { ChatDocumentMessageProps } from './ChatDocumentMessage.tsx';
5
- import { HTMLStyledProps, RecipeVariantProps, Assign, AnyProps } from '@stokelp/styled-system/types';
5
+ import { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types';
6
6
  import { ChatProfileAvatarProps } from './ChatProfileAvatar.tsx';
7
7
  import { ComponentVariants } from '../../utils/slots.tsx';
8
8
  import { PolymorphicProps } from '@ark-ui/react';
9
9
  import { StyledComponent } from '@stokelp/styled-system/jsx';
10
10
  export declare const MessageContainer: ComponentVariants<ForwardRefExoticComponent< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & PolymorphicProps>, ChatRecipe>;
11
- export declare const Message: ComponentVariants<StyledComponent<any, Assign<AnyProps, ChatMessageVariantProps>>, ChatRecipe>;
12
- export declare const DocumentMessage: ComponentVariants<FC<any>, ChatRecipe>;
13
- export declare const ProfileAvatar: ComponentVariants<FC<any>, ChatRecipe>;
11
+ export declare const Message: ComponentVariants<StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & PolymorphicProps>, ChatMessageVariantProps>, ChatRecipe>;
12
+ export declare const DocumentMessage: ComponentVariants<FC<ChatDocumentMessageProps>, ChatRecipe>;
13
+ export declare const ProfileAvatar: ComponentVariants<FC<ChatProfileAvatarProps>, ChatRecipe>;
14
14
  type ChatRootMessage = {
15
15
  side?: 'left' | 'right' | 'center';
16
16
  children: ReactElement;
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../text/Text.cjs"),t=require("../icon/Icon.cjs"),n=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs"),r=require("../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs");let i=require("@stokelp/styled-system/jsx"),a=require("@stokelp/styled-system/recipes"),o=require("react/jsx-runtime");var s=(0,i.styled)(i.HStack,a.chatDocumentMessage),c=({documentID:a,documentName:c,onCardClick:l,...u})=>(0,o.jsxs)(s,{onClick:e=>{l&&l(e,a)},...u,children:[(0,o.jsxs)(i.HStack,{gap:`space-8`,children:[(0,o.jsx)(t.Icon,{size:`xs`,color:`primary.900`,children:(0,o.jsx)(r.default,{})}),(0,o.jsx)(e.Text,{bold:!0,children:c})]}),(0,o.jsx)(t.Icon,{size:`xs`,color:`primary.500`,children:(0,o.jsx)(n.default,{})})]});exports.ChatDocumentMessage=c;
1
+ "use client";const e=require("../text/Text.cjs"),t=require("../icon/Icon.cjs"),n=require("../../node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.cjs"),r=require("../../node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.cjs");let i=require("@stokelp/styled-system/jsx"),a=require("@stokelp/styled-system/recipes"),o=require("react/jsx-runtime");var s=(0,i.styled)(i.HStack,a.chatDocumentMessage),c=({documentID:a,documentName:c,onCardClick:l,...u})=>(0,o.jsxs)(s,{onClick:e=>{l&&l(e,a)},...u,children:[(0,o.jsxs)(i.HStack,{gap:`space-8`,children:[(0,o.jsx)(t.Icon,{size:`xs`,color:`primary.900`,children:(0,o.jsx)(r.default,{})}),(0,o.jsx)(e.Text,{bold:!0,children:c})]}),(0,o.jsx)(t.Icon,{size:`xs`,color:`primary.500`,children:(0,o.jsx)(n.default,{})})]});exports.ChatDocumentMessage=c;
2
2
  //# sourceMappingURL=ChatDocumentMessage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatDocumentMessage.cjs","names":["styled","HStack","chatDocumentMessage","Icon","DocumentTextIcon","Text","ArrowDownTrayIcon","require_Text","require_Icon","require_ArrowDownTrayIcon","require_DocumentTextIcon","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","StyledHStack","ChatDocumentMessage","props","onCardClick","event","documentID","documentName"],"sources":["../../../src/components/chat/ChatDocumentMessage.tsx"],"sourcesContent":["import { FC } from 'react'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { chatDocumentMessage } from '@stokelp/styled-system/recipes'\nimport { HStack, styled } from '@stokelp/styled-system/jsx'\nimport { Icon, Text } from '~/components'\nimport { DocumentTextIcon, ArrowDownTrayIcon } from '@heroicons/react/24/outline'\n\nexport type ChatDocumentMessageProps = {\n documentID: number | string\n documentName: string\n documentUrl?: string\n onCardClick?: (event: React.MouseEvent<HTMLDivElement>, documentID: number | string) => void\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof chatDocumentMessage>\n\nconst StyledHStack = styled(HStack, chatDocumentMessage)\n\nexport const ChatDocumentMessage: FC<ChatDocumentMessageProps> = ({\n documentID,\n documentName,\n onCardClick,\n ...props\n}) => {\n return (\n <StyledHStack\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n if (onCardClick) {\n onCardClick(event, documentID)\n }\n }}\n {...props}\n >\n <HStack gap=\"space-8\">\n <Icon size=\"xs\" color=\"primary.900\">\n <DocumentTextIcon />\n </Icon>\n <Text bold>{documentName}</Text>\n </HStack>\n <Icon size=\"xs\" color=\"primary.500\">\n <ArrowDownTrayIcon />\n </Icon>\n </StyledHStack>\n )\n}\n"],"mappings":"A,+dAeA,IAAMc,GAAA,EAAed,EAAAA,OAAAA,CAAOC,EAAAA,OAAQC,EAAAA,mBAAmB,EAE1Ca,GAAqD,CAChE,aACA,eACA,cACA,GAAGC,MAGD,EAAAH,EAAA,KAAA,CAACC,EAAD,CACE,QAAU,GAA4C,CAChDG,GACFA,EAAYC,EAAOC,CAAU,CAEjC,EACA,GAAIH,EANN,SAAA,EAQE,EAAAH,EAAA,KAAA,CAACZ,EAAAA,OAAD,CAAQ,IAAI,UAAZ,SAAA,EACE,EAAAY,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,cACpB,UAAA,EAAAU,EAAA,IAAA,CAACT,EAAAA,QAAD,CAAmB,CAAA,CACf,CAAA,GACN,EAAAS,EAAA,IAAA,CAACR,EAAAA,KAAD,CAAM,KAAA,GAAM,SAAAe,CAAmB,CAAA,CACzB,CACR,CAAA,GAAA,EAAAP,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,cACpB,UAAA,EAAAU,EAAA,IAAA,CAACP,EAAAA,QAAD,CAAoB,CAAA,CAChB,CAAA,CACM,C"}
1
+ {"version":3,"file":"ChatDocumentMessage.cjs","names":["styled","HStack","chatDocumentMessage","Icon","DocumentTextIcon","Text","ArrowDownTrayIcon","require_Text","require_Icon","require_ArrowDownTrayIcon","require_DocumentTextIcon","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react_jsx_runtime","StyledHStack","ChatDocumentMessage","props","onCardClick","event","documentID","documentName"],"sources":["../../../src/components/chat/ChatDocumentMessage.tsx"],"sourcesContent":["import { FC } from 'react'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { chatDocumentMessage } from '@stokelp/styled-system/recipes'\nimport { HStack, styled } from '@stokelp/styled-system/jsx'\nimport { Icon, Text } from '~/components'\nimport { DocumentTextIcon, ArrowDownTrayIcon } from '@heroicons/react/24/outline'\n\nexport type ChatDocumentMessageProps = {\n documentID: number | string\n documentName: string\n documentUrl?: string\n onCardClick?: (event: React.MouseEvent<HTMLDivElement>, documentID: number | string) => void\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof chatDocumentMessage>\n\nconst StyledHStack = styled(HStack, chatDocumentMessage)\n\nexport const ChatDocumentMessage: FC<ChatDocumentMessageProps> = ({\n documentID,\n documentName,\n onCardClick,\n ...props\n}) => {\n return (\n <StyledHStack\n onClick={(event: React.MouseEvent<HTMLDivElement>) => {\n if (onCardClick) {\n onCardClick(event, documentID)\n }\n }}\n {...props}\n >\n <HStack gap=\"space-8\">\n <Icon size=\"xs\" color=\"primary.900\">\n <DocumentTextIcon />\n </Icon>\n <Text bold>{documentName}</Text>\n </HStack>\n <Icon size=\"xs\" color=\"primary.500\">\n <ArrowDownTrayIcon />\n </Icon>\n </StyledHStack>\n )\n}\n"],"mappings":"A,iXAeA,IAAMc,GAAA,EAAed,EAAAA,OAAAA,CAAOC,EAAAA,OAAQC,EAAAA,mBAAmB,EAE1Ca,GAAqD,CAChE,aACA,eACA,cACA,GAAGC,MAGD,EAAAH,EAAA,KAAA,CAACC,EAAD,CACE,QAAU,GAA4C,CAChDG,GACFA,EAAYC,EAAOC,CAAU,CAEjC,EACA,GAAIH,EANN,SAAA,EAQE,EAAAH,EAAA,KAAA,CAACZ,EAAAA,OAAD,CAAQ,IAAI,UAAZ,SAAA,EACE,EAAAY,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,cACpB,UAAA,EAAAU,EAAA,IAAA,CAACT,EAAAA,QAAD,CAAmB,CAAA,CACf,CAAA,GACN,EAAAS,EAAA,IAAA,CAACR,EAAAA,KAAD,CAAM,KAAA,GAAM,SAAAe,CAAmB,CAAA,CACzB,CACR,CAAA,GAAA,EAAAP,EAAA,IAAA,CAACV,EAAAA,KAAD,CAAM,KAAK,KAAK,MAAM,cACpB,UAAA,EAAAU,EAAA,IAAA,CAACP,EAAAA,QAAD,CAAoB,CAAA,CAChB,CAAA,CACM,C"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Text as e } from "../text/Text.js";
3
3
  import { Icon as t } from "../icon/Icon.js";
4
- import n from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js";
5
- import r from "../../node_modules/.pnpm/@heroicons_react@2.2.0_react@19.3.1/node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js";
4
+ import n from "../../node_modules/@heroicons/react/24/outline/esm/ArrowDownTrayIcon.js";
5
+ import r from "../../node_modules/@heroicons/react/24/outline/esm/DocumentTextIcon.js";
6
6
  import { HStack as i, styled as a } from "@stokelp/styled-system/jsx";
7
7
  import { chatDocumentMessage as o } from "@stokelp/styled-system/recipes";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
- import { ComponentProps } from 'react';
1
+ import { ComponentProps, ForwardRefExoticComponent, ClassAttributes, HTMLAttributes } from 'react';
2
2
  import { StyledComponent } from '@stokelp/styled-system/jsx';
3
- import { Assign, AnyProps } from '@stokelp/styled-system/types';
3
+ import { PolymorphicProps } from '@ark-ui/react';
4
4
  import { ChatMessageVariantProps } from '@stokelp/styled-system/recipes';
5
- export declare const ChatMessage: StyledComponent<any, Assign<AnyProps, ChatMessageVariantProps>>;
5
+ export declare const ChatMessage: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & PolymorphicProps>, ChatMessageVariantProps>;
6
6
  export interface ChatMessageProps extends ComponentProps<typeof ChatMessage> {
7
7
  }
@@ -4,7 +4,7 @@ import { StyledComponent } from '@stokelp/styled-system/jsx';
4
4
  import { PolymorphicProps } from '@ark-ui/react';
5
5
  import { ChipRecipe } from '@stokelp/styled-system/recipes';
6
6
  export declare const Chip: ComponentVariants<StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLSpanElement> & HTMLAttributes<HTMLSpanElement> & PolymorphicProps>, {}>, ChipRecipe>;
7
- export declare const ChipAvatar: StyledComponent<string, {}>;
7
+ export declare const ChipAvatar: StyledComponent<"img", {}>;
8
8
  export declare const ChipLabel: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLSpanElement> & HTMLAttributes<HTMLSpanElement> & PolymorphicProps>, {}>;
9
9
  export declare const ChipClearTrigger: StyledComponent<ForwardRefExoticComponent< ClassAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & PolymorphicProps>, {}>;
10
10
  export interface ChipProps extends ComponentProps<typeof Chip> {
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../utils/slots.cjs"),t=require("../tooltip/Tooltip.cjs"),n=require("../text/Text.cjs"),r=require("../../shared/ConditionalWrapper.cjs"),i=require("../ui-labels/UiLabelsProvider.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),p=require("react-window"),m=require("lodash");var{withProvider:h,withContext:g}=e.createStyleContext(l.combobox),_=h((0,c.styled)(s.Combobox.Root),`root`,{defaultProps:{loopFocus:!0}}),v=g((0,c.styled)(s.Combobox.ClearTrigger),`clearTrigger`),y=g((0,c.styled)(s.Combobox.Content),`content`),b=g((0,c.styled)(s.Combobox.Input),`input`),x=g((0,c.styled)(s.Combobox.Control),`control`),S=g((0,c.styled)(s.Combobox.Item),`item`),C=g((0,c.styled)(s.Combobox.ItemText),`itemText`),ee=g((0,c.styled)(s.Combobox.Positioner),`positioner`),w=g((0,c.styled)(s.Combobox.Trigger),`trigger`),T=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,fill:`white`}),(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,className:(0,f.css)({stroke:`grey.100`})})]}),E=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{y:`0.5`,width:`16`,height:`16`,rx:`4`,className:(0,f.css)({fill:`primary.500`})}),(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z`,fill:`white`})]});function D({item:e,isMultiple:t,renderItem:n}){let r=(0,s.useComboboxItemContext)();return(0,d.jsxs)(d.Fragment,{children:[t?r.selected?(0,d.jsx)(E,{}):(0,d.jsx)(T,{}):null,n?n(e):(0,d.jsx)(C,{truncate:!0,children:e.label})]})}var O=({items:e=[],initialItems:c,debounceMs:l=0,placeholder:f,emptyLabel:h,loadingLabel:g,usePortal:C=!0,withAutoFilter:T=!0,positioning:E,loadItems:O,renderItem:k,renderValue:A,onResetInitialItems:j,isLoading:M,value:N,openDropdownOnFocus:P=!0,clearValueWhenEmpty:F=!0,virtualized:te,rowHeight:I=34,returnItemsOnEmpty:L,multiple:R=!1,...z})=>{let B=i.useUiLabels(),[V,H]=(0,u.useState)(()=>e),[U,W]=(0,u.useState)(!1),[G,K]=(0,u.useState)(!1),q=typeof O==`function`,J=(0,u.useMemo)(()=>O?(0,m.debounce)(async e=>{try{K(!0),W(!0);let t=await O(e);H(t)}catch(e){console.error(e),H([])}finally{W(!1)}},l):null,[O,l]),Y=[...!q&&!T?e:V,...c??[]],X=(0,u.useCallback)(async t=>{c&&c.length>0&&!c.find(e=>e.label===t.inputValue)&&j?.();let{inputValue:n}=t;if(J)J(n);else{let t=T&&n!==``?e.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())):e;if(t.length===0&&L)return H(e);H(t)}},[J,e,T]);(0,u.useEffect)(()=>{J||H(e)},[e,J]);let Z=(0,u.useMemo)(()=>(0,s.createListCollection)({items:Y}),[Y]),ne=M??U,Q=g??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:B.loading}),$=h??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:B.noResults});return(0,d.jsxs)(_,{lazyMount:!0,unmountOnExit:!0,collection:Z,positioning:{sameWidth:!0,gutter:0,...E},"data-recipe":`combobox`,onInputValueChange:X,value:N,...z,multiple:R,children:[R?(0,d.jsx)(s.Combobox.Context,{children:t=>(0,d.jsxs)(x,{"data-multiple":`true`,"data-open":t.open||void 0,children:[t.value.map(n=>{let r=e.find(e=>String(e.value)===String(n));return r?(0,d.jsxs)(o.Chip,{size:`sm`,children:[A?A(r):(0,d.jsx)(o.ChipLabel,{children:r.label}),!z.readOnly&&!z.disabled&&(0,d.jsx)(o.ChipClearTrigger,{"aria-label":`Retirer ${r.label}`,onClick:()=>t.setValue(t.value.filter(e=>String(e)!==String(n)))})]},n):null}),(0,d.jsx)(b,{asChild:!0,"data-multiple":`true`,placeholder:t.hasSelectedItems?void 0:f,onFocus:()=>{P&&!q&&t.setOpen(!0)},children:(0,d.jsx)(a.Input,{})}),(0,d.jsx)(w,{asChild:!0,hidden:q&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})})]})}):(0,d.jsxs)(x,{children:[(0,d.jsx)(s.Combobox.Context,{children:e=>(0,d.jsx)(b,{asChild:!0,placeholder:f,onInput:t=>{let n=t.currentTarget.value;F&&n===``&&e.clearValue()},onFocus:()=>{P&&!q&&e.setOpen(!0)},children:(0,d.jsx)(a.Input,{})})}),(0,d.jsx)(w,{asChild:!0,hidden:q&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})}),(0,d.jsx)(v,{disabled:z.readOnly,onClick:j,asChild:!0,children:(0,d.jsx)(`button`,{children:(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z`,fill:`currentColor`})})})})]}),(0,d.jsx)(r.ConditionalWrapper,{when:C,wrapper:e=>(0,d.jsx)(s.Portal,{children:e}),children:(0,d.jsx)(ee,{children:(0,d.jsx)(y,{children:ne?Q:Y.length===0?(0,d.jsx)(d.Fragment,{children:q?G?$:Q:$}):te?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(p.FixedSizeList,{height:Math.min(I*Y.length,180),itemCount:Y.length,itemSize:I,width:`100%`,children:({index:e,style:n})=>(0,d.jsx)(r.ConditionalWrapper,{when:!!Y[e].tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:Y[e].tooltip,children:n}),children:(0,d.jsx)(S,{item:Y[e],style:n,children:(0,d.jsx)(D,{renderItem:k,item:Y[e],isMultiple:R})},Y[e].value)},Y[e].value)})}):Y.map(e=>(0,d.jsx)(r.ConditionalWrapper,{when:!!e.tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:e.tooltip,children:n}),children:(0,d.jsx)(S,{item:e,children:(0,d.jsx)(D,{renderItem:k,item:e,isMultiple:R})},e.value)},e.value))})})})]})};exports.Combobox=O;
1
+ "use client";const e=require("../../utils/slots.cjs"),t=require("../tooltip/Tooltip.cjs"),n=require("../text/Text.cjs"),r=require("../../shared/ConditionalWrapper.cjs"),i=require("../ui-labels/UiLabelsProvider.cjs"),a=require("../input/Input.cjs"),o=require("../chip/Chip.cjs");let s=require("@ark-ui/react"),c=require("@stokelp/styled-system/jsx"),l=require("@stokelp/styled-system/recipes"),u=require("react"),d=require("react/jsx-runtime"),f=require("@stokelp/styled-system/css"),p=require("react-window"),m=require("@zag-js/utils");var{withProvider:h,withContext:g}=e.createStyleContext(l.combobox),_=h((0,c.styled)(s.Combobox.Root),`root`,{defaultProps:{loopFocus:!0}}),v=g((0,c.styled)(s.Combobox.ClearTrigger),`clearTrigger`),y=g((0,c.styled)(s.Combobox.Content),`content`),b=g((0,c.styled)(s.Combobox.Input),`input`),x=g((0,c.styled)(s.Combobox.Control),`control`),S=g((0,c.styled)(s.Combobox.Item),`item`),C=g((0,c.styled)(s.Combobox.ItemText),`itemText`),w=g((0,c.styled)(s.Combobox.Positioner),`positioner`),T=g((0,c.styled)(s.Combobox.Trigger),`trigger`),E=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,fill:`white`}),(0,d.jsx)(`rect`,{x:`0.5`,y:`1`,width:`15`,height:`15`,rx:`3.5`,className:(0,f.css)({stroke:`grey.100`})})]}),D=()=>(0,d.jsxs)(`svg`,{width:`16`,height:`17`,viewBox:`0 0 16 17`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,d.jsx)(`rect`,{y:`0.5`,width:`16`,height:`16`,rx:`4`,className:(0,f.css)({fill:`primary.500`})}),(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z`,fill:`white`})]});function O({item:e,isMultiple:t,renderItem:n}){let r=(0,s.useComboboxItemContext)();return(0,d.jsxs)(d.Fragment,{children:[t?r.selected?(0,d.jsx)(D,{}):(0,d.jsx)(E,{}):null,n?n(e):(0,d.jsx)(C,{truncate:!0,children:e.label})]})}var k=({items:e=[],initialItems:c,debounceMs:l=0,placeholder:f,emptyLabel:h,loadingLabel:g,usePortal:C=!0,withAutoFilter:E=!0,positioning:D,loadItems:k,renderItem:A,renderValue:j,onResetInitialItems:M,isLoading:N,value:P,defaultValue:F,openDropdownOnFocus:I=!0,clearValueWhenEmpty:ee=!0,virtualized:te,rowHeight:L=34,returnItemsOnEmpty:R,multiple:z=!1,...B})=>{let V=i.useUiLabels(),[H,U]=(0,u.useState)(()=>e),[W,G]=(0,u.useState)(!1),[K,q]=(0,u.useState)(!1),J=typeof k==`function`,Y=(0,u.useMemo)(()=>k?(0,m.debounce)(async e=>{try{q(!0),G(!0);let t=await k(e);U(t)}catch(e){console.error(e),U([])}finally{G(!1)}},l):null,[k,l]),X=[...!J&&!E?e:H,...c??[]],Z=(0,u.useCallback)(async t=>{c&&c.length>0&&!c.find(e=>e.label===t.inputValue)&&M?.();let{inputValue:n}=t;if(Y)Y(n);else{let t=E&&n!==``?e.filter(e=>e.label.toLowerCase().includes(n.toLowerCase())):e;if(t.length===0&&R)return U(e);U(t)}},[Y,e,E]);(0,u.useEffect)(()=>{Y||U(e)},[e,Y]);let ne=(0,u.useMemo)(()=>(0,s.createListCollection)({items:X}),[X]),re=N??W,Q=g??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:V.loading}),$=h??(0,d.jsx)(n.Text,{p:`space-8`,textAlign:`center`,children:V.noResults});return(0,d.jsxs)(_,{lazyMount:!0,unmountOnExit:!0,collection:ne,positioning:{sameWidth:!0,gutter:0,...D},"data-recipe":`combobox`,onInputValueChange:Z,value:P,defaultValue:F,...B,multiple:z,children:[z?(0,d.jsx)(s.Combobox.Context,{children:t=>(0,d.jsxs)(x,{"data-multiple":`true`,"data-open":t.open||void 0,children:[t.value.map(n=>{let r=e.find(e=>String(e.value)===String(n));return r?(0,d.jsxs)(o.Chip,{size:`sm`,children:[j?j(r):(0,d.jsx)(o.ChipLabel,{children:r.label}),!B.readOnly&&!B.disabled&&(0,d.jsx)(o.ChipClearTrigger,{"aria-label":`Retirer ${r.label}`,onClick:()=>t.setValue(t.value.filter(e=>String(e)!==String(n)))})]},n):null}),(0,d.jsx)(b,{asChild:!0,"data-multiple":`true`,placeholder:t.hasSelectedItems?void 0:f,onFocus:()=>{I&&!J&&t.setOpen(!0)},children:(0,d.jsx)(a.Input,{})}),(0,d.jsx)(T,{asChild:!0,hidden:J&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})})]})}):(0,d.jsxs)(x,{children:[(0,d.jsx)(s.Combobox.Context,{children:e=>(0,d.jsx)(b,{asChild:!0,placeholder:f,onInput:t=>{let n=t.currentTarget.value;ee&&n===``&&e.clearValue()},onFocus:()=>{I&&!J&&e.setOpen(!0)},children:(0,d.jsx)(a.Input,{})})}),(0,d.jsx)(T,{asChild:!0,hidden:J&&(!c||c.length===0),children:(0,d.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z`,fill:`currentColor`})})}),(0,d.jsx)(v,{disabled:B.readOnly,onClick:M,asChild:!0,children:(0,d.jsx)(`button`,{children:(0,d.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,d.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z`,fill:`currentColor`})})})})]}),(0,d.jsx)(r.ConditionalWrapper,{when:C,wrapper:e=>(0,d.jsx)(s.Portal,{children:e}),children:(0,d.jsx)(w,{children:(0,d.jsx)(y,{children:re?Q:X.length===0?(0,d.jsx)(d.Fragment,{children:J?K?$:Q:$}):te?(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(p.FixedSizeList,{height:Math.min(L*X.length,180),itemCount:X.length,itemSize:L,width:`100%`,children:({index:e,style:n})=>(0,d.jsx)(r.ConditionalWrapper,{when:!!X[e].tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:X[e].tooltip,children:n}),children:(0,d.jsx)(S,{item:X[e],style:n,children:(0,d.jsx)(O,{renderItem:A,item:X[e],isMultiple:z})},X[e].value)},X[e].value)})}):X.map(e=>(0,d.jsx)(r.ConditionalWrapper,{when:!!e.tooltip,wrapper:n=>(0,d.jsx)(t.Tooltip,{label:e.tooltip,children:n}),children:(0,d.jsx)(S,{item:e,children:(0,d.jsx)(O,{renderItem:A,item:e,isMultiple:z})},e.value)},e.value))})})})]})};exports.Combobox=k;
2
2
  //# sourceMappingURL=Combobox.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","useUiLabels","useState","useMemo","debounce","useCallback","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","ConditionalWrapper","Portal","FixedSizeList","Tooltip","require_slots","require_Tooltip","require_Text","require_ConditionalWrapper","require_UiLabelsProvider","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","lodash","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","items","setItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","v","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight","index"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from 'lodash'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {\n value?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & HTMLStyledProps<'div'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":"A,ihBAwBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DoC,EAAOC,GAAA,EAAapC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKoC,EAAeC,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EsC,EAAUD,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DuC,EAAQF,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDwC,EAAUH,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DyC,EAAOJ,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAI,EAAG,MAAM,EACnD0C,EAAWL,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D2C,GAAaN,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,UAAU,EAAG,YAAY,EACrE4C,EAAUP,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAqC5D6C,OACJ,EAAAf,EAA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CAAA,EACpFc,IACF,EAAAlE,EAAA,IAAA,CAAA3B,EAAAA,SAAA,CAAA,UACE,EAAA2B,EAAA,IAAA,CAACb,EAAAA,cAAD,CACE,OAAQ,KAAK,IAAIgF,EAAY3B,EAAS,OAAQ,GAAG,EACjD,UAAWA,EAAS,OACpB,SAAU2B,EACV,MAAM,OAEJ,UAAA,CAAE,QAAO,YACT,EAAAnE,EAAA,IAAA,CAACf,EAAAA,mBAAD,CAEE,KAAM,CAAC,CAACuD,EAAS4B,EAAM,CAAC,QACxB,QAAS,IAAY,EAAApE,EAAA,IAAA,CAACZ,EAAAA,QAAD,CAAS,MAAOoD,EAAS4B,EAAM,CAAC,QAAU,UAAkB,CAAA,EAEjF,UAAA,EAAApE,EAAA,IAAA,CAACW,EAAD,CAAkC,KAAM6B,EAAS4B,GAAe,QAC9D,UAAA,EAAApE,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAY,KAAMuB,EAAS4B,GAAQ,WAAYb,CAAW,CAAA,CACnF,EAFKf,EAAS4B,EAAM,CAAC,KAErB,CACY,EAPb5B,EAAS4B,EAAM,CAAC,KAOH,CAET,CAAA,CACf,CAAA,EAEF5B,EAAS,IAAI,IACX,EAAAxC,EAAA,IAAA,CAACf,EAAAA,mBAAD,CAEE,KAAM,CAAC,CAACoC,EAAK,QACb,QAAS,IAAY,EAAArB,EAAA,IAAA,CAACZ,EAAAA,QAAD,CAAS,MAAOiC,EAAK,QAAU,UAAkB,CAAA,EAEtE,UAAA,EAAArB,EAAA,IAAA,CAACW,EAAD,CAA6B,OAC3B,UAAA,EAAAX,EAAA,IAAA,CAACiB,EAAD,CAA6B,aAAkB,OAAM,WAAYsC,CAAW,CAAA,CACxE,EAFKlC,EAAK,KAEV,CACY,EAPbA,EAAK,KAOQ,CACrB,CAEI,CAAA,CACC,CAAA,CACM,CAAA,CAChB,C,EAEV,E"}
1
+ {"version":3,"file":"Combobox.cjs","names":["createStyleContext","combobox","styled","ArkCombobox","css","useComboboxItemContext","_Fragment","useUiLabels","useState","useMemo","debounce","useCallback","createListCollection","Text","Chip","ChipLabel","ChipClearTrigger","UIInput","ConditionalWrapper","Portal","FixedSizeList","Tooltip","require_slots","require_Tooltip","require_Text","require_ConditionalWrapper","require_UiLabelsProvider","require_Input","require_Chip","_ark_ui_react","_stokelp_styled_system_jsx","_stokelp_styled_system_recipes","react","react_jsx_runtime","_stokelp_styled_system_css","react_window","_zag_js_utils","Root","withProvider","ClearTrigger","withContext","Content","Input","Control","Item","ItemText","Positioner","Trigger","MultipleUncheckedIndicator","MultipleCheckedIndicator","CustomInnerItem","context","isMultiple","renderItem","item","Combobox","itemsFromUsers","controlledIsLoading","props","uiLabels","items","setItems","isLoading","setIsLoading","firstQueryTriggered","setFirstQueryTriggered","asyncMode","loadItems","debouncedLoadItems","newItems","value","error","debounceMs","allItems","withAutoFilter","initialItems","handleInputChange","details","onResetInitialItems","inputValue","returnItemsOnEmpty","collection","effectiveIsLoading","loadingContent","loadingLabel","emptyContent","emptyLabel","positioning","multiple","api","i","v","renderValue","x","placeholder","openDropdownOnFocus","e","clearValueWhenEmpty","usePortal","virtualized","rowHeight","index"],"sources":["../../../src/components/combobox/Combobox.tsx"],"sourcesContent":["import {\n Combobox as ArkCombobox,\n type ComboboxRootProps,\n createListCollection,\n Portal,\n useComboboxItemContext,\n} from '@ark-ui/react'\nimport { FC, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'\nimport { styled } from '@stokelp/styled-system/jsx'\nimport { debounce } from '@zag-js/utils'\n\nimport { combobox } from '@stokelp/styled-system/recipes'\nimport { createStyleContext } from '~/utils/slots'\nimport { Input as UIInput } from '~/components/input'\n\nimport { ConditionalWrapper } from '~/shared/ConditionalWrapper'\nimport { Text } from '~/components/text/Text'\nimport { Tooltip } from '~/components/tooltip/Tooltip'\nimport { useUiLabels } from '~/components/ui-labels/UiLabelsProvider'\nimport { Chip, ChipClearTrigger, ChipLabel } from '~/components/chip'\nimport { HTMLStyledProps, RecipeVariantProps } from '@stokelp/styled-system/types'\nimport { FixedSizeList } from 'react-window'\nimport { css } from '@stokelp/styled-system/css'\n\nconst { withProvider, withContext } = createStyleContext(combobox)\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst Root = withProvider(styled(ArkCombobox.Root<any>), 'root', {\n defaultProps: {\n loopFocus: true,\n },\n})\n\nconst ClearTrigger = withContext(styled(ArkCombobox.ClearTrigger), 'clearTrigger')\nconst Content = withContext(styled(ArkCombobox.Content), 'content')\nconst Input = withContext(styled(ArkCombobox.Input), 'input')\nconst Control = withContext(styled(ArkCombobox.Control), 'control')\nconst Item = withContext(styled(ArkCombobox.Item), 'item')\nconst ItemText = withContext(styled(ArkCombobox.ItemText), 'itemText')\nconst Positioner = withContext(styled(ArkCombobox.Positioner), 'positioner')\nconst Trigger = withContext(styled(ArkCombobox.Trigger), 'trigger')\n\nexport type ComboboxItem = {\n value: string | number\n label: string\n disabled?: boolean\n tooltip?: ReactNode\n}\n\nexport type ComboboxProps<T extends ComboboxItem> = Omit<\n ComboboxRootProps<T>,\n 'collection' | 'value' | 'defaultValue'\n> & {\n // Item values may be numbers: the chips compare them as strings.\n value?: Array<string | number>\n defaultValue?: Array<string | number>\n items?: T[]\n initialItems?: T[]\n renderItem?: (item: T) => ReactNode\n /**\n * Renders the inner content of each selected chip in `multiple` mode.\n * Receives the selected item and should return the chip body (the removable\n * clear button is appended automatically). Defaults to the item label.\n */\n renderValue?: (item: T) => ReactNode\n loadItems?: (inputValue: string) => Promise<T[]>\n debounceMs?: number\n emptyLabel?: ReactNode\n loadingLabel?: ReactNode\n placeholder?: string\n usePortal?: boolean\n isLoading?: boolean\n withAutoFilter?: boolean\n onResetInitialItems?: () => void\n openDropdownOnFocus?: boolean\n clearValueWhenEmpty?: boolean\n virtualized?: boolean\n rowHeight?: number\n returnItemsOnEmpty?: boolean\n} & Omit<HTMLStyledProps<'div'>, 'defaultValue'> &\n RecipeVariantProps<typeof combobox>\n\nconst MultipleUncheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"1\" width=\"15\" height=\"15\" rx=\"3.5\" className={css({ stroke: 'grey.100' })} />\n </svg>\n)\n\nconst MultipleCheckedIndicator: FC = () => (\n <svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect y=\"0.5\" width=\"16\" height=\"16\" rx=\"4\" className={css({ fill: 'primary.500' })} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.958 4.81298C12.1303 4.92787 12.1769 5.16069 12.062 5.33301L7.56202 12.083C7.4997 12.1765 7.39875 12.2371 7.28695 12.2482C7.17515 12.2592 7.06428 12.2196 6.98483 12.1402L3.98483 9.14017C3.83839 8.99372 3.83839 8.75628 3.98483 8.60984C4.13128 8.46339 4.36872 8.46339 4.51517 8.60984L7.19172 11.2864L11.438 4.91699C11.5529 4.74467 11.7857 4.6981 11.958 4.81298Z\"\n fill=\"white\"\n />\n </svg>\n)\n\ninterface InnerItemProps<Item extends ComboboxItem> {\n item: Item\n isMultiple?: boolean\n renderItem?: (item: Item) => ReactNode\n}\n\nfunction CustomInnerItem<Item extends ComboboxItem>({ item, isMultiple, renderItem }: InnerItemProps<Item>) {\n const context = useComboboxItemContext()\n\n return (\n <>\n {isMultiple ? context.selected ? <MultipleCheckedIndicator /> : <MultipleUncheckedIndicator /> : null}\n {renderItem ? renderItem(item) : <ItemText truncate>{item.label}</ItemText>}\n </>\n )\n}\n\nexport const Combobox = <T extends ComboboxItem>({\n items: itemsFromUsers = [],\n initialItems,\n debounceMs = 0,\n placeholder,\n emptyLabel,\n loadingLabel,\n usePortal = true,\n withAutoFilter = true,\n positioning,\n loadItems,\n renderItem,\n renderValue,\n onResetInitialItems,\n isLoading: controlledIsLoading,\n value,\n defaultValue,\n openDropdownOnFocus = true,\n clearValueWhenEmpty = true,\n virtualized,\n rowHeight = 34,\n returnItemsOnEmpty,\n multiple = false,\n ...props\n}: ComboboxProps<T>) => {\n const uiLabels = useUiLabels()\n const [items, setItems] = useState(() => itemsFromUsers)\n const [isLoading, setIsLoading] = useState(false)\n const [firstQueryTriggered, setFirstQueryTriggered] = useState(false)\n const asyncMode = typeof loadItems === 'function'\n\n const debouncedLoadItems = useMemo(\n () =>\n loadItems\n ? debounce(async (value: string) => {\n try {\n setFirstQueryTriggered(true)\n setIsLoading(true)\n const newItems = await loadItems(value)\n setItems(newItems)\n } catch (error) {\n console.error(error)\n setItems([])\n } finally {\n setIsLoading(false)\n }\n }, debounceMs)\n : null,\n [loadItems, debounceMs],\n )\n\n // A sync, unfiltered list has nothing to derive: read the prop itself. The mirrored\n // `items` state only catches up in an effect, one render late, and zag re-derives the\n // input text from the collection the moment `value` changes: a value set in the same\n // render as the item that carries it was stringified against a list without it, and\n // the input went blank.\n const sourceItems = !asyncMode && !withAutoFilter ? itemsFromUsers : items\n const allItems = [...sourceItems, ...(initialItems ?? [])]\n\n const handleInputChange = useCallback(\n async (details: ArkCombobox.InputValueChangeDetails) => {\n if (\n initialItems &&\n initialItems.length > 0 &&\n !initialItems.find((item: ComboboxItem) => item.label === details.inputValue)\n ) {\n onResetInitialItems?.()\n }\n const { inputValue } = details\n\n if (debouncedLoadItems) {\n debouncedLoadItems(inputValue)\n } else {\n const items =\n withAutoFilter && inputValue !== ''\n ? itemsFromUsers.filter((item: ComboboxItem) => item.label.toLowerCase().includes(inputValue.toLowerCase()))\n : itemsFromUsers\n\n if (items.length === 0 && returnItemsOnEmpty) {\n return setItems(itemsFromUsers)\n }\n setItems(items)\n }\n },\n [debouncedLoadItems, itemsFromUsers, withAutoFilter],\n )\n\n // Keep the visible items in sync with the source list whenever it changes\n // (e.g. options that load asynchronously after mount). Without this, an empty\n // input shows a stale/empty list (the no-results label) until the user types.\n // Consumers memoize `items`, so this only fires on real data changes, not on\n // every keystroke.\n useEffect(() => {\n if (!debouncedLoadItems) {\n setItems(itemsFromUsers)\n }\n }, [itemsFromUsers, debouncedLoadItems])\n\n const collection = useMemo(() => createListCollection({ items: allItems }), [allItems])\n\n const effectiveIsLoading = controlledIsLoading ?? isLoading\n\n const loadingContent = loadingLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.loading}\n </Text>\n )\n const emptyContent = emptyLabel ?? (\n <Text p=\"space-8\" textAlign=\"center\">\n {uiLabels.noResults}\n </Text>\n )\n return (\n <Root\n lazyMount\n unmountOnExit\n collection={collection}\n positioning={{ sameWidth: true, gutter: 0, ...positioning }}\n data-recipe=\"combobox\"\n onInputValueChange={handleInputChange}\n value={value as string[] | undefined}\n defaultValue={defaultValue as string[] | undefined}\n {...props}\n multiple={multiple}\n >\n {multiple ? (\n // Tags-input layout: the control (styled via the recipe's `&[data-multiple]`\n // selectors) is the bordered box holding the selected chips and a\n // borderless growing input.\n <ArkCombobox.Context>\n {api => (\n <Control data-multiple=\"true\" data-open={api.open || undefined}>\n {/* Resolve chips from the current value against the full source\n list rather than ark's cached `selectedItems`: the cache is only\n re-derived on value changes, so async-loaded defaults would show\n 0 chips until the user selects something. Looking up in\n itemsFromUsers (never the filtered list) also keeps chips visible\n while the user is typing to filter. */}\n {api.value.map(v => {\n const item = itemsFromUsers.find((i: T) => String(i.value) === String(v))\n if (!item) return null\n return (\n <Chip key={v} size=\"sm\">\n {renderValue ? renderValue(item) : <ChipLabel>{item.label}</ChipLabel>}\n {!props.readOnly && !props.disabled && (\n <ChipClearTrigger\n aria-label={`Retirer ${item.label}`}\n // Remove by strict-equality-safe filter: stored values may\n // be numbers while item.value is compared as a string.\n onClick={() => api.setValue(api.value.filter(x => String(x) !== String(v)))}\n />\n )}\n </Chip>\n )\n })}\n <Input\n asChild\n data-multiple=\"true\"\n placeholder={api.hasSelectedItems ? undefined : placeholder}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n </Control>\n )}\n </ArkCombobox.Context>\n ) : (\n <Control>\n <ArkCombobox.Context>\n {api => (\n <Input\n asChild\n placeholder={placeholder}\n onInput={(e: React.FormEvent<HTMLInputElement>) => {\n const value = e.currentTarget.value\n\n if (clearValueWhenEmpty && value === '') {\n api.clearValue()\n }\n }}\n onFocus={() => {\n if (!openDropdownOnFocus || asyncMode) return\n api.setOpen(true)\n }}\n >\n <UIInput />\n </Input>\n )}\n </ArkCombobox.Context>\n <Trigger asChild hidden={asyncMode && (!initialItems || initialItems.length === 0)}>\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.5303 16.2803C12.2374 16.5732 11.7626 16.5732 11.4697 16.2803L3.96967 8.78033C3.67678 8.48744 3.67678 8.01256 3.96967 7.71967C4.26256 7.42678 4.73744 7.42678 5.03033 7.71967L12 14.6893L18.9697 7.71967C19.2626 7.42678 19.7374 7.42678 20.0303 7.71967C20.3232 8.01256 20.3232 8.48744 20.0303 8.78033L12.5303 16.2803Z\"\n fill=\"currentColor\"\n />\n </svg>\n </Trigger>\n <ClearTrigger disabled={props.readOnly} onClick={onResetInitialItems} asChild>\n <button>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10ZM7.68306 7.68306C7.92714 7.43898 8.32286 7.43898 8.56694 7.68306L10 9.11612L11.4331 7.68306C11.6771 7.43898 12.0729 7.43898 12.3169 7.68306C12.561 7.92714 12.561 8.32286 12.3169 8.56694L10.8839 10L12.3169 11.4331C12.561 11.6771 12.561 12.0729 12.3169 12.3169C12.0729 12.561 11.6771 12.561 11.4331 12.3169L10 10.8839L8.56694 12.3169C8.32286 12.561 7.92714 12.561 7.68306 12.3169C7.43898 12.0729 7.43898 11.6771 7.68306 11.4331L9.11612 10L7.68306 8.56694C7.43898 8.32286 7.43898 7.92714 7.68306 7.68306Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n </ClearTrigger>\n </Control>\n )}\n <ConditionalWrapper when={usePortal} wrapper={children => <Portal>{children}</Portal>}>\n <Positioner>\n <Content>\n {effectiveIsLoading ? (\n loadingContent\n ) : allItems.length === 0 ? (\n <>{asyncMode ? (firstQueryTriggered ? emptyContent : loadingContent) : emptyContent}</>\n ) : virtualized ? (\n <>\n <FixedSizeList\n height={Math.min(rowHeight * allItems.length, 180)}\n itemCount={allItems.length}\n itemSize={rowHeight}\n width=\"100%\"\n >\n {({ index, style }) => (\n <ConditionalWrapper\n key={allItems[index].value}\n when={!!allItems[index].tooltip}\n wrapper={children => <Tooltip label={allItems[index].tooltip}>{children}</Tooltip>}\n >\n <Item key={allItems[index].value} item={allItems[index]} style={style}>\n <CustomInnerItem renderItem={renderItem} item={allItems[index]} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n )}\n </FixedSizeList>\n </>\n ) : (\n allItems.map(item => (\n <ConditionalWrapper\n key={item.value}\n when={!!item.tooltip}\n wrapper={children => <Tooltip label={item.tooltip}>{children}</Tooltip>}\n >\n <Item key={item.value} item={item}>\n <CustomInnerItem renderItem={renderItem} item={item} isMultiple={multiple} />\n </Item>\n </ConditionalWrapper>\n ))\n )}\n </Content>\n </Positioner>\n </ConditionalWrapper>\n </Root>\n )\n}\n"],"mappings":"A,whBAwBA,GAAM,CAAE,eAAc,eAAgBA,EAAAA,mBAAmBC,EAAAA,QAAQ,EAG3DoC,EAAOC,GAAA,EAAapC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAS,EAAG,OAAQ,CAC/D,aAAc,CACZ,UAAW,EACb,CACF,CAAC,EAEKoC,EAAeC,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,YAAY,EAAG,cAAc,EAC3EsC,EAAUD,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DuC,EAAQF,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,KAAK,EAAG,OAAO,EACtDwC,EAAUH,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,OAAO,EAAG,SAAS,EAC5DyC,EAAOJ,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,IAAI,EAAG,MAAM,EACnD0C,EAAWL,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,QAAQ,EAAG,UAAU,EAC/D2C,EAAaN,GAAA,EAAYtC,EAAAA,OAAAA,CAAOC,EAAAA,SAAY,UAAU,EAAG,YAAY,EACrE4C,EAAUP,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A,CACM,CAAA,CAChB,C,EAEV,E"}
@@ -8,8 +8,9 @@ export type ComboboxItem = {
8
8
  disabled?: boolean;
9
9
  tooltip?: ReactNode;
10
10
  };
11
- export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value'> & {
11
+ export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, 'collection' | 'value' | 'defaultValue'> & {
12
12
  value?: Array<string | number>;
13
+ defaultValue?: Array<string | number>;
13
14
  items?: T[];
14
15
  initialItems?: T[];
15
16
  renderItem?: (item: T) => ReactNode;
@@ -33,5 +34,5 @@ export type ComboboxProps<T extends ComboboxItem> = Omit<ComboboxRootProps<T>, '
33
34
  virtualized?: boolean;
34
35
  rowHeight?: number;
35
36
  returnItemsOnEmpty?: boolean;
36
- } & HTMLStyledProps<'div'> & RecipeVariantProps<typeof combobox>;
37
- export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import('react').JSX.Element;
37
+ } & Omit<HTMLStyledProps<'div'>, 'defaultValue'> & RecipeVariantProps<typeof combobox>;
38
+ export declare const Combobox: <T extends ComboboxItem>({ items: itemsFromUsers, initialItems, debounceMs, placeholder, emptyLabel, loadingLabel, usePortal, withAutoFilter, positioning, loadItems, renderItem, renderValue, onResetInitialItems, isLoading: controlledIsLoading, value, defaultValue, openDropdownOnFocus, clearValueWhenEmpty, virtualized, rowHeight, returnItemsOnEmpty, multiple, ...props }: ComboboxProps<T>) => import('react').JSX.Element;