@kushagradhawan/kookie-ui 0.1.71 → 0.1.72

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 (96) hide show
  1. package/README.md +4 -0
  2. package/components.css +63 -380
  3. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  4. package/dist/cjs/components/_internal/base-button.js +1 -1
  5. package/dist/cjs/components/_internal/base-button.js.map +3 -3
  6. package/dist/cjs/components/button.d.ts.map +1 -1
  7. package/dist/cjs/components/button.js +1 -1
  8. package/dist/cjs/components/button.js.map +3 -3
  9. package/dist/cjs/components/chatbar.d.ts.map +1 -1
  10. package/dist/cjs/components/chatbar.js.map +2 -2
  11. package/dist/cjs/components/icon-button.d.ts.map +1 -1
  12. package/dist/cjs/components/icon-button.js +2 -2
  13. package/dist/cjs/components/icon-button.js.map +3 -3
  14. package/dist/cjs/components/shell.d.ts.map +1 -1
  15. package/dist/cjs/components/shell.js +1 -1
  16. package/dist/cjs/components/shell.js.map +3 -3
  17. package/dist/cjs/components/toggle-button.d.ts.map +1 -1
  18. package/dist/cjs/components/toggle-button.js +1 -1
  19. package/dist/cjs/components/toggle-button.js.map +3 -3
  20. package/dist/cjs/components/toggle-icon-button.d.ts.map +1 -1
  21. package/dist/cjs/components/toggle-icon-button.js +1 -1
  22. package/dist/cjs/components/toggle-icon-button.js.map +3 -3
  23. package/dist/cjs/hooks/index.d.ts +2 -0
  24. package/dist/cjs/hooks/index.d.ts.map +1 -1
  25. package/dist/cjs/hooks/index.js +1 -1
  26. package/dist/cjs/hooks/index.js.map +3 -3
  27. package/dist/cjs/hooks/use-live-announcer.d.ts.map +1 -1
  28. package/dist/cjs/hooks/use-live-announcer.js +2 -2
  29. package/dist/cjs/hooks/use-live-announcer.js.map +3 -3
  30. package/dist/cjs/hooks/use-toggle-state.d.ts +37 -0
  31. package/dist/cjs/hooks/use-toggle-state.d.ts.map +1 -0
  32. package/dist/cjs/hooks/use-toggle-state.js +2 -0
  33. package/dist/cjs/hooks/use-toggle-state.js.map +7 -0
  34. package/dist/cjs/hooks/use-tooltip-wrapper.d.ts +29 -0
  35. package/dist/cjs/hooks/use-tooltip-wrapper.d.ts.map +1 -0
  36. package/dist/cjs/hooks/use-tooltip-wrapper.js +2 -0
  37. package/dist/cjs/hooks/use-tooltip-wrapper.js.map +7 -0
  38. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  39. package/dist/esm/components/_internal/base-button.js +1 -1
  40. package/dist/esm/components/_internal/base-button.js.map +3 -3
  41. package/dist/esm/components/button.d.ts.map +1 -1
  42. package/dist/esm/components/button.js +1 -1
  43. package/dist/esm/components/button.js.map +3 -3
  44. package/dist/esm/components/chatbar.d.ts.map +1 -1
  45. package/dist/esm/components/chatbar.js.map +2 -2
  46. package/dist/esm/components/icon-button.d.ts.map +1 -1
  47. package/dist/esm/components/icon-button.js +2 -2
  48. package/dist/esm/components/icon-button.js.map +3 -3
  49. package/dist/esm/components/shell.d.ts.map +1 -1
  50. package/dist/esm/components/shell.js +1 -1
  51. package/dist/esm/components/shell.js.map +3 -3
  52. package/dist/esm/components/toggle-button.d.ts.map +1 -1
  53. package/dist/esm/components/toggle-button.js +1 -1
  54. package/dist/esm/components/toggle-button.js.map +3 -3
  55. package/dist/esm/components/toggle-icon-button.d.ts.map +1 -1
  56. package/dist/esm/components/toggle-icon-button.js +1 -1
  57. package/dist/esm/components/toggle-icon-button.js.map +3 -3
  58. package/dist/esm/hooks/index.d.ts +2 -0
  59. package/dist/esm/hooks/index.d.ts.map +1 -1
  60. package/dist/esm/hooks/index.js +1 -1
  61. package/dist/esm/hooks/index.js.map +3 -3
  62. package/dist/esm/hooks/use-live-announcer.d.ts.map +1 -1
  63. package/dist/esm/hooks/use-live-announcer.js +2 -2
  64. package/dist/esm/hooks/use-live-announcer.js.map +3 -3
  65. package/dist/esm/hooks/use-toggle-state.d.ts +37 -0
  66. package/dist/esm/hooks/use-toggle-state.d.ts.map +1 -0
  67. package/dist/esm/hooks/use-toggle-state.js +2 -0
  68. package/dist/esm/hooks/use-toggle-state.js.map +7 -0
  69. package/dist/esm/hooks/use-tooltip-wrapper.d.ts +29 -0
  70. package/dist/esm/hooks/use-tooltip-wrapper.d.ts.map +1 -0
  71. package/dist/esm/hooks/use-tooltip-wrapper.js +2 -0
  72. package/dist/esm/hooks/use-tooltip-wrapper.js.map +7 -0
  73. package/package.json +4 -4
  74. package/schemas/base-button.json +1 -1
  75. package/schemas/button.json +1 -1
  76. package/schemas/icon-button.json +1 -1
  77. package/schemas/index.json +6 -6
  78. package/schemas/toggle-button.json +1 -1
  79. package/schemas/toggle-icon-button.json +1 -1
  80. package/src/components/_internal/base-button.css +136 -614
  81. package/src/components/_internal/base-button.tsx +15 -13
  82. package/src/components/button.tsx +13 -42
  83. package/src/components/chatbar.tsx +1 -13
  84. package/src/components/icon-button.tsx +20 -44
  85. package/src/components/image.css +10 -8
  86. package/src/components/shell.tsx +13 -9
  87. package/src/components/toggle-button.tsx +30 -59
  88. package/src/components/toggle-icon-button.tsx +29 -51
  89. package/src/hooks/index.ts +2 -0
  90. package/src/hooks/use-live-announcer.ts +34 -7
  91. package/src/hooks/use-toggle-state.ts +72 -0
  92. package/src/hooks/use-tooltip-wrapper.ts +28 -0
  93. package/src/styles/tokens/color.css +11 -1
  94. package/styles.css +70 -381
  95. package/tokens/base.css +7 -1
  96. package/tokens.css +7 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/index.ts"],
4
- "sourcesContent": ["export { useLiveAnnouncer } from './use-live-announcer.js';\nexport { useBodyPointerEventsCleanup } from './use-body-pointer-events-cleanup.js';\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wHAAAE,EAAAF,GAAA,IAAAG,EAAiC,mCACjCC,EAA4C",
6
- "names": ["hooks_exports", "__export", "__toCommonJS", "import_use_live_announcer", "import_use_body_pointer_events_cleanup"]
4
+ "sourcesContent": ["export { useLiveAnnouncer } from './use-live-announcer.js';\nexport { useBodyPointerEventsCleanup } from './use-body-pointer-events-cleanup.js';\nexport { useTooltipWrapper } from './use-tooltip-wrapper.js';\nexport { useToggleState } from './use-toggle-state.js';\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sMAAAE,EAAAF,GAAA,IAAAG,EAAiC,mCACjCC,EAA4C,gDAC5CC,EAAkC,oCAClCC,EAA+B",
6
+ "names": ["hooks_exports", "__export", "__toCommonJS", "import_use_live_announcer", "import_use_body_pointer_events_cleanup", "import_use_tooltip_wrapper", "import_use_toggle_state"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-live-announcer.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-live-announcer.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB,cA+Be,MAAM,UAcpD"}
1
+ {"version":3,"file":"use-live-announcer.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-live-announcer.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,gBAAgB,cA+Ce,MAAM,UAmBpD"}
@@ -1,4 +1,4 @@
1
- "use strict";var a=Object.create;var o=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)o(t,n,{get:e[n],enumerable:!0})},c=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!m.call(t,i)&&i!==n&&o(t,i,{get:()=>e[i],enumerable:!(r=l(e,i))||r.enumerable});return t};var v=(t,e,n)=>(n=t!=null?a(d(t)):{},c(e||!t||!t.__esModule?o(n,"default",{value:t,enumerable:!0}):n,t)),f=t=>c(o({},"__esModule",{value:!0}),t);var x={};p(x,{useLiveAnnouncer:()=>h});module.exports=f(x);var u=v(require("react"));function h(){return u.useEffect(()=>{let e=document.getElementById("rt-live-announcer");return e||(e=document.createElement("div"),e.id="rt-live-announcer",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),e.style.cssText=`
1
+ "use strict";var a=Object.create;var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var p=(e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})},l=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of s(n))!m.call(e,o)&&o!==t&&r(e,o,{get:()=>n[o],enumerable:!(i=d(n,o))||i.enumerable});return e};var v=(e,n,t)=>(t=e!=null?a(f(e)):{},l(n||!e||!e.__esModule?r(t,"default",{value:e,enumerable:!0}):t,e)),g=e=>l(r({},"__esModule",{value:!0}),e);var x={};p(x,{useLiveAnnouncer:()=>R});module.exports=g(x);var u=v(require("react"));let c=0;function R(){const e=u.useRef(void 0);return u.useEffect(()=>{let t=document.getElementById("rt-live-announcer");return t||(t=document.createElement("div"),t.id="rt-live-announcer",t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.cssText=`
2
2
  position: absolute;
3
3
  left: -10000px;
4
4
  width: 1px;
@@ -6,5 +6,5 @@
6
6
  overflow: hidden;
7
7
  clip: rect(0, 0, 0, 0);
8
8
  white-space: nowrap;
9
- `,document.body.appendChild(e)),()=>{e&&!e.hasChildNodes()&&e.remove()}},[]),u.useCallback(e=>{const n=document.getElementById("rt-live-announcer");n&&(n.textContent="",setTimeout(()=>{n.textContent=e},100))},[])}
9
+ `,document.body.appendChild(t)),c++,()=>{if(c--,e.current&&clearTimeout(e.current),c===0){const i=document.getElementById("rt-live-announcer");i&&i.remove()}}},[]),u.useCallback(t=>{const i=document.getElementById("rt-live-announcer");i&&(e.current&&clearTimeout(e.current),i.textContent="",e.current=setTimeout(()=>{i.textContent=t},100))},[])}
10
10
  //# sourceMappingURL=use-live-announcer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/use-live-announcer.ts"],
4
- "sourcesContent": ["import * as React from 'react';\n\n/**\n * Hook for making live announcements to screen readers\n * Creates a hidden aria-live region for announcing dynamic content changes\n */\nexport function useLiveAnnouncer() {\n\n // Create aria-live region if it doesn't exist\n React.useEffect(() => {\n let liveRegion = document.getElementById('rt-live-announcer');\n \n if (!liveRegion) {\n liveRegion = document.createElement('div');\n liveRegion.id = 'rt-live-announcer';\n liveRegion.setAttribute('aria-live', 'polite');\n liveRegion.setAttribute('aria-atomic', 'true');\n liveRegion.style.cssText = `\n position: absolute;\n left: -10000px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n `;\n document.body.appendChild(liveRegion);\n }\n\n return () => {\n // Clean up on unmount if no other components are using it\n if (liveRegion && !liveRegion.hasChildNodes()) {\n liveRegion.remove();\n }\n };\n }, []);\n\n const announce = React.useCallback((message: string) => {\n const liveRegion = document.getElementById('rt-live-announcer');\n if (liveRegion) {\n // Clear previous announcements\n liveRegion.textContent = '';\n \n // Add new announcement with a small delay to ensure it's announced\n setTimeout(() => {\n liveRegion.textContent = message;\n }, 100);\n }\n }, []);\n\n return announce;\n} "],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBAMhB,SAASF,GAAmB,CAGjC,OAAAE,EAAM,UAAU,IAAM,CACpB,IAAIC,EAAa,SAAS,eAAe,mBAAmB,EAE5D,OAAKA,IACHA,EAAa,SAAS,cAAc,KAAK,EACzCA,EAAW,GAAK,oBAChBA,EAAW,aAAa,YAAa,QAAQ,EAC7CA,EAAW,aAAa,cAAe,MAAM,EAC7CA,EAAW,MAAM,QAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAS3B,SAAS,KAAK,YAAYA,CAAU,GAG/B,IAAM,CAEPA,GAAc,CAACA,EAAW,cAAc,GAC1CA,EAAW,OAAO,CAEtB,CACF,EAAG,CAAC,CAAC,EAEYD,EAAM,YAAaE,GAAoB,CACtD,MAAMD,EAAa,SAAS,eAAe,mBAAmB,EAC1DA,IAEFA,EAAW,YAAc,GAGzB,WAAW,IAAM,CACfA,EAAW,YAAcC,CAC3B,EAAG,GAAG,EAEV,EAAG,CAAC,CAAC,CAGP",
6
- "names": ["use_live_announcer_exports", "__export", "useLiveAnnouncer", "__toCommonJS", "React", "liveRegion", "message"]
4
+ "sourcesContent": ["import * as React from 'react';\n\n/**\n * Reference counter to track how many components are using the live region.\n * Only remove the live region when no components are using it.\n */\nlet liveRegionRefCount = 0;\n\n/**\n * Hook for making live announcements to screen readers\n * Creates a hidden aria-live region for announcing dynamic content changes\n */\nexport function useLiveAnnouncer() {\n // Track the timeout so we can clean it up on unmount\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n // Create aria-live region if it doesn't exist\n React.useEffect(() => {\n let liveRegion = document.getElementById('rt-live-announcer');\n\n if (!liveRegion) {\n liveRegion = document.createElement('div');\n liveRegion.id = 'rt-live-announcer';\n liveRegion.setAttribute('aria-live', 'polite');\n liveRegion.setAttribute('aria-atomic', 'true');\n liveRegion.style.cssText = `\n position: absolute;\n left: -10000px;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n `;\n document.body.appendChild(liveRegion);\n }\n\n // Increment ref count when component mounts\n liveRegionRefCount++;\n\n return () => {\n // Decrement ref count when component unmounts\n liveRegionRefCount--;\n\n // Clean up timeout on unmount\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n // Only remove the live region if no components are using it\n if (liveRegionRefCount === 0) {\n const region = document.getElementById('rt-live-announcer');\n if (region) {\n region.remove();\n }\n }\n };\n }, []);\n\n const announce = React.useCallback((message: string) => {\n const liveRegion = document.getElementById('rt-live-announcer');\n if (liveRegion) {\n // Clear any pending timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n // Clear previous announcements\n liveRegion.textContent = '';\n\n // Add new announcement with a small delay to ensure it's announced\n timeoutRef.current = setTimeout(() => {\n liveRegion.textContent = message;\n }, 100);\n }\n }, []);\n\n return announce;\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBAMvB,IAAIC,EAAqB,EAMlB,SAASH,GAAmB,CAEjC,MAAMI,EAAaF,EAAM,OAAkD,MAAS,EAGpF,OAAAA,EAAM,UAAU,IAAM,CACpB,IAAIG,EAAa,SAAS,eAAe,mBAAmB,EAE5D,OAAKA,IACHA,EAAa,SAAS,cAAc,KAAK,EACzCA,EAAW,GAAK,oBAChBA,EAAW,aAAa,YAAa,QAAQ,EAC7CA,EAAW,aAAa,cAAe,MAAM,EAC7CA,EAAW,MAAM,QAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAS3B,SAAS,KAAK,YAAYA,CAAU,GAItCF,IAEO,IAAM,CAUX,GARAA,IAGIC,EAAW,SACb,aAAaA,EAAW,OAAO,EAI7BD,IAAuB,EAAG,CAC5B,MAAMG,EAAS,SAAS,eAAe,mBAAmB,EACtDA,GACFA,EAAO,OAAO,CAElB,CACF,CACF,EAAG,CAAC,CAAC,EAEYJ,EAAM,YAAaK,GAAoB,CACtD,MAAMF,EAAa,SAAS,eAAe,mBAAmB,EAC1DA,IAEED,EAAW,SACb,aAAaA,EAAW,OAAO,EAIjCC,EAAW,YAAc,GAGzBD,EAAW,QAAU,WAAW,IAAM,CACpCC,EAAW,YAAcE,CAC3B,EAAG,GAAG,EAEV,EAAG,CAAC,CAAC,CAGP",
6
+ "names": ["use_live_announcer_exports", "__export", "useLiveAnnouncer", "__toCommonJS", "React", "liveRegionRefCount", "timeoutRef", "liveRegion", "region", "message"]
7
7
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Options for the useToggleState hook
3
+ */
4
+ interface UseToggleStateOptions {
5
+ /** Controlled pressed state */
6
+ pressed?: boolean;
7
+ /** Callback when pressed state changes */
8
+ onPressedChange?: (pressed: boolean) => void;
9
+ /** Function to get the accessible name for announcements */
10
+ getAccessibleName: () => string;
11
+ /** Component name for warning messages */
12
+ componentName: string;
13
+ }
14
+ /**
15
+ * Hook for shared toggle button state management.
16
+ * Provides accessibility announcements and controlled/uncontrolled warnings.
17
+ *
18
+ * @param options - Configuration options for the toggle state
19
+ * @returns Object containing the handlePressedChange callback
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * const getAccessibleName = React.useCallback(() => 'Toggle button', []);
24
+ *
25
+ * const { handlePressedChange } = useToggleState({
26
+ * pressed,
27
+ * onPressedChange,
28
+ * getAccessibleName,
29
+ * componentName: 'ToggleButton',
30
+ * });
31
+ * ```
32
+ */
33
+ export declare function useToggleState({ pressed, onPressedChange, getAccessibleName, componentName }: UseToggleStateOptions): {
34
+ handlePressedChange: (newPressed: boolean) => void;
35
+ };
36
+ export {};
37
+ //# sourceMappingURL=use-toggle-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-toggle-state.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-toggle-state.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,UAAU,qBAAqB;IAC7B,+BAA+B;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,4DAA4D;IAC5D,iBAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,EAAE,qBAAqB;sCAWnG,OAAO;EAwBvB"}
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var r=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var b=(e,n)=>{for(var o in n)r(e,o,{get:n[o],enumerable:!0})},u=(e,n,o,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of g(n))!m.call(e,s)&&s!==o&&r(e,s,{get:()=>n[s],enumerable:!(t=f(n,s))||t.enumerable});return e};var v=(e,n,o)=>(o=e!=null?p(h(e)):{},u(n||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e)),w=e=>u(r({},"__esModule",{value:!0}),e);var R={};b(R,{useToggleState:()=>N});module.exports=w(R);var a=v(require("react")),i=require("./use-live-announcer.js");function N({pressed:e,onPressedChange:n,getAccessibleName:o,componentName:t}){const s=(0,i.useLiveAnnouncer)(),C=a.useRef(!1),l=a.useCallback(d=>{const c=o();s(`${c} ${d?"pressed":"unpressed"}`),n?.(d)},[s,n,o]);return a.useEffect(()=>{},[e,n,t]),{handlePressedChange:l}}
2
+ //# sourceMappingURL=use-toggle-state.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-toggle-state.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport { useLiveAnnouncer } from './use-live-announcer.js';\n\n/**\n * Options for the useToggleState hook\n */\ninterface UseToggleStateOptions {\n /** Controlled pressed state */\n pressed?: boolean;\n /** Callback when pressed state changes */\n onPressedChange?: (pressed: boolean) => void;\n /** Function to get the accessible name for announcements */\n getAccessibleName: () => string;\n /** Component name for warning messages */\n componentName: string;\n}\n\n/**\n * Hook for shared toggle button state management.\n * Provides accessibility announcements and controlled/uncontrolled warnings.\n *\n * @param options - Configuration options for the toggle state\n * @returns Object containing the handlePressedChange callback\n *\n * @example\n * ```tsx\n * const getAccessibleName = React.useCallback(() => 'Toggle button', []);\n *\n * const { handlePressedChange } = useToggleState({\n * pressed,\n * onPressedChange,\n * getAccessibleName,\n * componentName: 'ToggleButton',\n * });\n * ```\n */\nexport function useToggleState({ pressed, onPressedChange, getAccessibleName, componentName }: UseToggleStateOptions) {\n const announce = useLiveAnnouncer();\n\n // Track if we've already warned about controlled without handler\n const warnedRef = React.useRef(false);\n\n /**\n * Memoized handler for state changes with accessibility announcements.\n * Announces the new state immediately for screen readers.\n */\n const handlePressedChange = React.useCallback(\n (newPressed: boolean) => {\n const accessibleName = getAccessibleName();\n // Announce the state change for screen readers\n announce(`${accessibleName} ${newPressed ? 'pressed' : 'unpressed'}`);\n // Call the user's change handler\n onPressedChange?.(newPressed);\n },\n [announce, onPressedChange, getAccessibleName],\n );\n\n // Development-only warning for controlled/uncontrolled pattern\n // Only warns once to avoid console spam\n React.useEffect(() => {\n if (process.env.NODE_ENV === 'development' && pressed !== undefined && onPressedChange === undefined && !warnedRef.current) {\n warnedRef.current = true;\n console.warn(\n `${componentName}: You provided a \\`pressed\\` prop without an \\`onPressedChange\\` handler. ` +\n 'This will result in a read-only toggle button. If you want the button to be interactive, ' +\n 'you should provide an `onPressedChange` handler.',\n );\n }\n }, [pressed, onPressedChange, componentName]);\n\n return { handlePressedChange };\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAiC,mCAmC1B,SAASH,EAAe,CAAE,QAAAI,EAAS,gBAAAC,EAAiB,kBAAAC,EAAmB,cAAAC,CAAc,EAA0B,CACpH,MAAMC,KAAW,oBAAiB,EAG5BC,EAAYP,EAAM,OAAO,EAAK,EAM9BQ,EAAsBR,EAAM,YAC/BS,GAAwB,CACvB,MAAMC,EAAiBN,EAAkB,EAEzCE,EAAS,GAAGI,CAAc,IAAID,EAAa,UAAY,WAAW,EAAE,EAEpEN,IAAkBM,CAAU,CAC9B,EACA,CAACH,EAAUH,EAAiBC,CAAiB,CAC/C,EAIA,OAAAJ,EAAM,UAAU,IAAM,CAStB,EAAG,CAACE,EAASC,EAAiBE,CAAa,CAAC,EAErC,CAAE,oBAAAG,CAAoB,CAC/B",
6
+ "names": ["use_toggle_state_exports", "__export", "useToggleState", "__toCommonJS", "React", "import_use_live_announcer", "pressed", "onPressedChange", "getAccessibleName", "componentName", "announce", "warnedRef", "handlePressedChange", "newPressed", "accessibleName"]
7
+ }
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Hook for managing tooltip accessibility props and conditional rendering.
4
+ * Encapsulates tooltip ID generation and aria-describedby binding.
5
+ *
6
+ * @param tooltip - The tooltip content (if any)
7
+ * @returns Object containing tooltipId, hasTooltip flag, and accessibility props
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);
12
+ *
13
+ * const button = <button {...accessibilityProps}>Click me</button>;
14
+ *
15
+ * if (!hasTooltip) return button;
16
+ *
17
+ * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;
18
+ * ```
19
+ */
20
+ export declare function useTooltipWrapper(tooltip: React.ReactNode): {
21
+ tooltipId: string;
22
+ hasTooltip: boolean;
23
+ accessibilityProps: {
24
+ 'aria-describedby': string;
25
+ } | {
26
+ 'aria-describedby'?: undefined;
27
+ };
28
+ };
29
+ //# sourceMappingURL=use-tooltip-wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-tooltip-wrapper.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-tooltip-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS;;;;;;;;EAOzD"}
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var c=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var b=(o,e)=>{for(var t in e)c(o,t,{get:e[t],enumerable:!0})},i=(o,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of d(e))!u.call(o,s)&&s!==t&&c(o,s,{get:()=>e[s],enumerable:!(a=n(e,s))||a.enumerable});return o};var m=(o,e,t)=>(t=o!=null?p(l(o)):{},i(e||!o||!o.__esModule?c(t,"default",{value:o,enumerable:!0}):t,o)),R=o=>i(c({},"__esModule",{value:!0}),o);var y={};b(y,{useTooltipWrapper:()=>f});module.exports=R(y);var r=m(require("react"));function f(o){const e=r.useId(),t=!!o,a=r.useMemo(()=>t?{"aria-describedby":e}:{},[t,e]);return{tooltipId:e,hasTooltip:t,accessibilityProps:a}}
2
+ //# sourceMappingURL=use-tooltip-wrapper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-tooltip-wrapper.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\n\n/**\n * Hook for managing tooltip accessibility props and conditional rendering.\n * Encapsulates tooltip ID generation and aria-describedby binding.\n *\n * @param tooltip - The tooltip content (if any)\n * @returns Object containing tooltipId, hasTooltip flag, and accessibility props\n *\n * @example\n * ```tsx\n * const { tooltipId, hasTooltip, accessibilityProps } = useTooltipWrapper(tooltip);\n *\n * const button = <button {...accessibilityProps}>Click me</button>;\n *\n * if (!hasTooltip) return button;\n *\n * return <Tooltip id={tooltipId} content={tooltip}>{button}</Tooltip>;\n * ```\n */\nexport function useTooltipWrapper(tooltip: React.ReactNode) {\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n const accessibilityProps = React.useMemo(() => (hasTooltip ? { 'aria-describedby': tooltipId } : {}), [hasTooltip, tooltipId]);\n\n return { tooltipId, hasTooltip, accessibilityProps };\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBAoBhB,SAASF,EAAkBG,EAA0B,CAC1D,MAAMC,EAAYF,EAAM,MAAM,EACxBG,EAAa,EAAQF,EAErBG,EAAqBJ,EAAM,QAAQ,IAAOG,EAAa,CAAE,mBAAoBD,CAAU,EAAI,CAAC,EAAI,CAACC,EAAYD,CAAS,CAAC,EAE7H,MAAO,CAAE,UAAAA,EAAW,WAAAC,EAAY,mBAAAC,CAAmB,CACrD",
6
+ "names": ["use_tooltip_wrapper_exports", "__export", "useTooltipWrapper", "__toCommonJS", "React", "tooltip", "tooltipId", "hasTooltip", "accessibilityProps"]
7
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/base-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAErE;;;;GAIG;AACH,KAAK,0BAA0B,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACxE,0DAA0D;IAC1D,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,kBAAkB,GACpB,WAAW,GACX,qBAAqB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,kBAAkB,GAAG,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC;AAE/F;;GAEG;AACH,UAAU,eAAgB,SAAQ,0BAA0B;CAAG;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,UAAU,2FA4Kd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"base-button.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/base-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAQ5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAErE;;;;GAIG;AACH,KAAK,0BAA0B,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI;IACxE,0DAA0D;IAC1D,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,kBAAkB,GACpB,WAAW,GACX,qBAAqB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,kBAAkB,GAAG,MAAM,WAAW,GAAG,IAAI,CAAC,CAAC;AAE/F;;GAEG;AACH,UAAU,eAAgB,SAAQ,0BAA0B;CAAG;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,UAAU,2FA8Kd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as t from"react";import N from"classnames";import{Slot as j}from"radix-ui";import{baseButtonPropDefs as f}from"./base-button.props.js";import{Flex as I}from"../flex.js";import{Spinner as O}from"../spinner.js";import{VisuallyHidden as V}from"../visually-hidden.js";import{extractProps as F}from"../../helpers/extract-props.js";import{mapResponsiveProp as H,mapButtonSizeToSpinnerSize as W}from"../../helpers/map-prop-values.js";import{marginPropDefs as G}from"../../props/margin.props.js";const y=t.forwardRef((n,a)=>{const{size:b=f.size.default}=n,{className:B,children:o,asChild:i,as:s,color:P,radius:g,material:h,panelBackground:T,flush:v,disabled:p=n.loading,...d}=F(n,f,G);t.useEffect(()=>{n.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[n.panelBackground]);const r=h??T,c=t.useRef(null);t.useEffect(()=>{const e=c.current;if(!e)return;if(r==="translucent"){e.style.setProperty("will-change","backdrop-filter");const D=()=>{const S=getComputedStyle(e).getPropertyValue("--duration-2")||"75ms",z=parseInt(S)||75;setTimeout(()=>{e&&r!=="translucent"&&e.style.setProperty("will-change","auto")},z)},m=new MutationObserver(D);return m.observe(e,{attributes:!0,attributeFilter:["data-material"]}),()=>{m.disconnect(),e.style.setProperty("will-change","auto")}}else e.style.setProperty("will-change","auto")},[r]);const w=i?j.Root:s||"button",C=i||!s||["button","input","textarea","select"].includes(s),x=!i&&(!s||s==="button"),E="type"in d,M=t.useId(),l=n.loading?`${M}-loading`:void 0,u=t.useMemo(()=>typeof o=="string"?o:t.isValidElement(o)&&typeof o.props?.children=="string"?o.props.children:"button",[o]),k=t.useMemo(()=>n.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":l,"aria-label":`${u} (loading)`}:{},[n.loading,l,u]);return t.createElement(w,{"data-disabled":p||void 0,"data-accent-color":P,"data-radius":g,"data-material":r,"data-panel-background":r,"data-flush":v?"true":void 0,...d,...k,ref:e=>{typeof a=="function"?a(e):a&&(a.current=e),c.current=e},className:N("rt-reset","rt-BaseButton",B),...C&&{disabled:p},...x&&!E?{type:"button"}:{}},n.loading?t.createElement(t.Fragment,null,t.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},o),t.createElement(V,null,t.createElement("span",{id:l},u," is loading, please wait..."),o),t.createElement(I,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},t.createElement("span",null,t.createElement(O,{size:H(b,W),"aria-hidden":"true"})))):o)});y.displayName="BaseButton";export{y as BaseButton};
1
+ import*as e from"react";import j from"classnames";import{Slot as O}from"radix-ui";import{baseButtonPropDefs as b}from"./base-button.props.js";import{Flex as V}from"../flex.js";import{Spinner as F}from"../spinner.js";import{VisuallyHidden as H}from"../visually-hidden.js";import{extractProps as R}from"../../helpers/extract-props.js";import{mapResponsiveProp as W,mapButtonSizeToSpinnerSize as G}from"../../helpers/map-prop-values.js";import{marginPropDefs as $}from"../../props/margin.props.js";const B=e.forwardRef((n,a)=>{const{size:P=b.size.default}=n,{className:g,children:o,asChild:i,as:s,color:h,radius:T,material:v,panelBackground:w,flush:C,disabled:d=n.loading,...c}=R(n,b,$);e.useEffect(()=>{n.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[n.panelBackground]);const r=v??w,m=e.useRef(null),f=e.useRef(r);f.current=r,e.useEffect(()=>{const t=m.current;if(!t)return;if(r==="translucent"){t.style.setProperty("will-change","backdrop-filter");let p;const z=()=>{const I=getComputedStyle(t).getPropertyValue("--duration-2")||"75ms",N=parseInt(I)||75;p=setTimeout(()=>{t&&f.current!=="translucent"&&t.style.setProperty("will-change","auto")},N)},y=new MutationObserver(z);return y.observe(t,{attributes:!0,attributeFilter:["data-material"]}),()=>{p&&clearTimeout(p),y.disconnect(),t.style.setProperty("will-change","auto")}}else t.style.setProperty("will-change","auto")},[r]);const x=i?O.Root:s||"button",E=i||!s||["button","input","textarea","select"].includes(s),M=!i&&(!s||s==="button"),k="type"in c,D=e.useId(),u=n.loading?`${D}-loading`:void 0,l=e.useMemo(()=>typeof o=="string"?o:e.isValidElement(o)&&typeof o.props?.children=="string"?o.props.children:"button",[o]),S=e.useMemo(()=>n.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":u,"aria-label":`${l} (loading)`}:{},[n.loading,u,l]);return e.createElement(x,{"data-disabled":d||void 0,"data-accent-color":h,"data-radius":T,"data-material":r,"data-panel-background":r,"data-flush":C?"true":void 0,...c,...S,ref:t=>{typeof a=="function"?a(t):a&&(a.current=t),m.current=t},className:j("rt-reset","rt-BaseButton",g),...E&&{disabled:d},...M&&!k?{type:"button"}:{}},n.loading?e.createElement(e.Fragment,null,e.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},o),e.createElement(H,null,e.createElement("span",{id:u},l," is loading, please wait..."),o),e.createElement(V,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},e.createElement("span",null,e.createElement(F,{size:W(P,G),"aria-hidden":"true"})))):o)});B.displayName="BaseButton";export{B as BaseButton};
2
2
  //# sourceMappingURL=base-button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/_internal/base-button.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { mapResponsiveProp, mapButtonSizeToSpinnerSize } from '../../helpers/map-prop-values.js';\nimport { marginPropDefs } from '../../props/margin.props.js';\n\nimport type { MarginProps } from '../../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n MarginProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | keyof MarginProps | 'as'>;\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button, IconButton, and other button\n * variants to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Performance optimizations for backdrop-filter effects\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n * - Material/panel background handling\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((props, forwardedRef) => {\n const { size = baseButtonPropDefs.size.default } = props;\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n material,\n panelBackground,\n flush,\n disabled = props.loading, // Loading state automatically disables the button\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs, marginPropDefs);\n\n // Show deprecation warning for panelBackground when used\n // This helps developers migrate to the new material prop\n React.useEffect(() => {\n if (props.panelBackground !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n }, [props.panelBackground]);\n\n // Material takes precedence over panelBackground for backward compatibility\n const effectiveMaterial = material ?? panelBackground;\n\n // Will-change cleanup for backdrop-filter performance optimization\n // This prevents layout thrashing when using translucent materials\n const buttonRef = React.useRef<HTMLElement>(null);\n\n React.useEffect(() => {\n const button = buttonRef.current;\n if (!button) return;\n\n const hasTranslucentMaterial = effectiveMaterial === 'translucent';\n\n if (hasTranslucentMaterial) {\n // Add will-change when material is translucent to optimize rendering\n button.style.setProperty('will-change', 'backdrop-filter');\n\n // Clean up will-change after transition completes to prevent memory leaks\n const cleanup = () => {\n const transitionDuration =\n getComputedStyle(button).getPropertyValue('--duration-2') || '75ms';\n const duration = parseInt(transitionDuration) || 75;\n\n setTimeout(() => {\n if (button && effectiveMaterial !== 'translucent') {\n button.style.setProperty('will-change', 'auto');\n }\n }, duration);\n };\n\n // Listen for material changes to clean up will-change property\n const observer = new MutationObserver(cleanup);\n observer.observe(button, { attributes: true, attributeFilter: ['data-material'] });\n\n return () => {\n observer.disconnect();\n button.style.setProperty('will-change', 'auto');\n };\n } else {\n // Remove will-change when material is not translucent\n button.style.setProperty('will-change', 'auto');\n }\n }, [effectiveMaterial]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n const Comp = asChild ? Slot.Root : as || 'button';\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements\n const shouldPassDisabled =\n asChild || !as || ['button', 'input', 'textarea', 'select'].includes(as);\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = props.loading ? `${loadingId}-loading` : undefined;\n\n // Extract button text for accessibility announcements\n const buttonText = React.useMemo(() => {\n if (typeof children === 'string') return children;\n if (React.isValidElement(children) && typeof (children.props as any)?.children === 'string') {\n return (children.props as any).children;\n }\n return 'button';\n }, [children]);\n\n // Enhanced accessibility props for loading state\n // These ensure screen readers announce the loading state properly\n const accessibilityProps = React.useMemo(() => {\n if (props.loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': describedById,\n 'aria-label': `${buttonText} (loading)`,\n };\n }\n return {};\n }, [props.loading, describedById, buttonText]);\n\n return (\n <Comp\n // The `data-disabled` attribute enables correct styles when doing `<Button asChild disabled>`\n data-disabled={disabled || undefined}\n data-accent-color={color}\n data-radius={radius}\n data-material={effectiveMaterial}\n data-panel-background={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n ref={(node) => {\n // Handle both forwarded ref and internal ref for performance optimization\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n buttonRef.current = node;\n }}\n className={classNames('rt-reset', 'rt-BaseButton', className)}\n {...(shouldPassDisabled && { disabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {props.loading ? (\n <>\n {/**\n * We need a wrapper to set `visibility: hidden` to hide the button content whilst we show the `Spinner`.\n * The button is a flex container with a `gap`, so we use `display: contents` to ensure the correct flex layout.\n *\n * However, `display: contents` removes the content from the accessibility tree in some browsers,\n * so we force remove it with `aria-hidden` and re-add it in the tree with `VisuallyHidden`\n */}\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n\n {/* Enhanced accessibility for loading state */}\n <VisuallyHidden>\n <span id={describedById}>{buttonText} is loading, please wait...</span>\n {children}\n </VisuallyHidden>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner\n size={mapResponsiveProp(size, mapButtonSizeToSpinnerSize)}\n aria-hidden=\"true\"\n />\n </span>\n </Flex>\n </>\n ) : (\n children\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,WAErB,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,QAAAC,MAAY,aACrB,OAAS,WAAAC,MAAe,gBACxB,OAAS,kBA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ACM,EAAA,KACCN,EAAA,cAAC,QAAK,GAAIsC,GAAgBC,EAAW,6BAA2B,EAC/DvB,CACH,EAGAhB,EAAA,cAACI,EAAA,CAAK,QAAO,GAAC,MAAM,SAAS,QAAQ,SAAS,SAAS,WAAW,MAAM,KACtEJ,EAAA,cAAC,YACCA,EAAA,cAACK,EAAA,CACC,KAAMG,EAAkBM,EAAML,CAA0B,EACxD,cAAY,OACd,CACF,CACF,CACF,EAEAO,CAEJ,CAEJ,CAAC,EACDL,EAAW,YAAc",
6
- "names": ["React", "classNames", "Slot", "baseButtonPropDefs", "Flex", "Spinner", "VisuallyHidden", "extractProps", "mapResponsiveProp", "mapButtonSizeToSpinnerSize", "marginPropDefs", "BaseButton", "props", "forwardedRef", "size", "className", "children", "asChild", "as", "color", "radius", "material", "panelBackground", "flush", "disabled", "baseButtonProps", "effectiveMaterial", "buttonRef", "button", "cleanup", "transitionDuration", "duration", "observer", "Comp", "shouldPassDisabled", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "buttonText", "accessibilityProps", "node"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { baseButtonPropDefs } from './base-button.props.js';\nimport { Flex } from '../flex.js';\nimport { Spinner } from '../spinner.js';\nimport { VisuallyHidden } from '../visually-hidden.js';\nimport { extractProps } from '../../helpers/extract-props.js';\nimport { mapResponsiveProp, mapButtonSizeToSpinnerSize } from '../../helpers/map-prop-values.js';\nimport { marginPropDefs } from '../../props/margin.props.js';\n\nimport type { MarginProps } from '../../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../../props/prop-def.js';\n\ntype BaseButtonElement = React.ElementRef<'button'>;\ntype BaseButtonOwnProps = GetPropDefTypes<typeof baseButtonPropDefs>;\n\n/**\n * Polymorphic BaseButton props that support rendering as different HTML elements\n * Uses the proper ComponentPropsWithout pattern for type safety\n * @template C - The element type to render as (defaults to 'button')\n */\ntype PolymorphicBaseButtonProps<C extends React.ElementType = 'button'> = {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & BaseButtonOwnProps &\n MarginProps &\n ComponentPropsWithout<C, RemovedProps | keyof BaseButtonOwnProps | keyof MarginProps | 'as'>;\n\n/**\n * BaseButton props interface that combines all available props\n */\ninterface BaseButtonProps extends PolymorphicBaseButtonProps {}\n\n/**\n * BaseButton component that provides the core button functionality\n *\n * This is the foundational button component that handles all the complex logic\n * including loading states, accessibility, performance optimizations, and\n * polymorphic rendering. It's used by Button, IconButton, and other button\n * variants to ensure consistent behavior across the design system.\n *\n * Key features:\n * - Loading state with spinner and accessibility announcements\n * - Performance optimizations for backdrop-filter effects\n * - Comprehensive accessibility support\n * - Polymorphic rendering support\n * - Material/panel background handling\n *\n * @example\n * ```tsx\n * // Basic usage\n * <BaseButton>Click me</BaseButton>\n *\n * // With loading state\n * <BaseButton loading>Processing...</BaseButton>\n *\n * // Polymorphic rendering\n * <BaseButton as=\"a\" href=\"/link\">Link Button</BaseButton>\n * ```\n */\nconst BaseButton = React.forwardRef<BaseButtonElement, BaseButtonProps>((props, forwardedRef) => {\n const { size = baseButtonPropDefs.size.default } = props;\n\n // Extract button-specific props from the combined props object\n const {\n className,\n children,\n asChild,\n as,\n color,\n radius,\n material,\n panelBackground,\n flush,\n disabled = props.loading, // Loading state automatically disables the button\n ...baseButtonProps\n } = extractProps(props, baseButtonPropDefs, marginPropDefs);\n\n // Show deprecation warning for panelBackground when used\n // This helps developers migrate to the new material prop\n React.useEffect(() => {\n if (props.panelBackground !== undefined) {\n console.warn('Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.');\n }\n }, [props.panelBackground]);\n\n // Material takes precedence over panelBackground for backward compatibility\n const effectiveMaterial = material ?? panelBackground;\n\n // Will-change cleanup for backdrop-filter performance optimization\n // This prevents layout thrashing when using translucent materials\n const buttonRef = React.useRef<HTMLElement>(null);\n\n // Use a ref to track current material value to avoid stale closures in setTimeout\n const materialRef = React.useRef(effectiveMaterial);\n materialRef.current = effectiveMaterial;\n\n React.useEffect(() => {\n const button = buttonRef.current;\n if (!button) return;\n\n const hasTranslucentMaterial = effectiveMaterial === 'translucent';\n\n if (hasTranslucentMaterial) {\n // Add will-change when material is translucent to optimize rendering\n button.style.setProperty('will-change', 'backdrop-filter');\n\n // Track timeout for cleanup\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // Clean up will-change after transition completes to prevent memory leaks\n const cleanup = () => {\n const transitionDuration = getComputedStyle(button).getPropertyValue('--duration-2') || '75ms';\n const duration = parseInt(transitionDuration) || 75;\n\n timeoutId = setTimeout(() => {\n // Use ref to get current value, not stale closure value\n if (button && materialRef.current !== 'translucent') {\n button.style.setProperty('will-change', 'auto');\n }\n }, duration);\n };\n\n // Listen for material changes to clean up will-change property\n const observer = new MutationObserver(cleanup);\n observer.observe(button, { attributes: true, attributeFilter: ['data-material'] });\n\n return () => {\n if (timeoutId) clearTimeout(timeoutId);\n observer.disconnect();\n button.style.setProperty('will-change', 'auto');\n };\n } else {\n // Remove will-change when material is not translucent\n button.style.setProperty('will-change', 'auto');\n }\n }, [effectiveMaterial]);\n\n // asChild takes precedence over as prop for Radix Slot integration\n const Comp = asChild ? Slot.Root : as || 'button';\n\n // Only pass disabled for elements that support it\n // This prevents invalid HTML attributes on unsupported elements\n const shouldPassDisabled = asChild || !as || ['button', 'input', 'textarea', 'select'].includes(as);\n\n // Determine if we are rendering a real <button> element so we can set a safe\n // default type. Native <button> defaults to type=\"submit\" which can cause\n // accidental form submissions. We default to type=\"button\" unless the user\n // explicitly provided a type or we're using asChild (unknown underlying node).\n const isNativeButtonElement = !asChild && (!as || as === 'button');\n const hasExplicitTypeAttribute = 'type' in (baseButtonProps as Record<string, unknown>);\n\n // Generate unique ID for loading announcements\n const loadingId = React.useId();\n const describedById = props.loading ? `${loadingId}-loading` : undefined;\n\n // Extract button text for accessibility announcements\n const buttonText = React.useMemo(() => {\n if (typeof children === 'string') return children;\n if (React.isValidElement(children) && typeof (children.props as any)?.children === 'string') {\n return (children.props as any).children;\n }\n return 'button';\n }, [children]);\n\n // Enhanced accessibility props for loading state\n // These ensure screen readers announce the loading state properly\n const accessibilityProps = React.useMemo(() => {\n if (props.loading) {\n return {\n 'aria-busy': true,\n 'aria-disabled': true,\n 'aria-describedby': describedById,\n 'aria-label': `${buttonText} (loading)`,\n };\n }\n return {};\n }, [props.loading, describedById, buttonText]);\n\n return (\n <Comp\n // The `data-disabled` attribute enables correct styles when doing `<Button asChild disabled>`\n data-disabled={disabled || undefined}\n data-accent-color={color}\n data-radius={radius}\n data-material={effectiveMaterial}\n data-panel-background={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n {...baseButtonProps}\n {...accessibilityProps}\n ref={(node) => {\n // Handle both forwarded ref and internal ref for performance optimization\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n buttonRef.current = node;\n }}\n className={classNames('rt-reset', 'rt-BaseButton', className)}\n {...(shouldPassDisabled && { disabled })}\n {...(isNativeButtonElement && !hasExplicitTypeAttribute ? { type: 'button' } : {})}\n >\n {props.loading ? (\n <>\n {/**\n * We need a wrapper to set `visibility: hidden` to hide the button content whilst we show the `Spinner`.\n * The button is a flex container with a `gap`, so we use `display: contents` to ensure the correct flex layout.\n *\n * However, `display: contents` removes the content from the accessibility tree in some browsers,\n * so we force remove it with `aria-hidden` and re-add it in the tree with `VisuallyHidden`\n */}\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n\n {/* Enhanced accessibility for loading state */}\n <VisuallyHidden>\n <span id={describedById}>{buttonText} is loading, please wait...</span>\n {children}\n </VisuallyHidden>\n\n {/* Centered spinner overlay during loading state */}\n <Flex asChild align=\"center\" justify=\"center\" position=\"absolute\" inset=\"0\">\n <span>\n <Spinner size={mapResponsiveProp(size, mapButtonSizeToSpinnerSize)} aria-hidden=\"true\" />\n </span>\n </Flex>\n </>\n ) : (\n children\n )}\n </Comp>\n );\n});\nBaseButton.displayName = 'BaseButton';\n\nexport { BaseButton };\nexport type { BaseButtonProps };\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,QAAAC,MAAY,WAErB,OAAS,sBAAAC,MAA0B,yBACnC,OAAS,QAAAC,MAAY,aACrB,OAAS,WAAAC,MAAe,gBACxB,OAAS,kBAAAC,MAAsB,wBAC/B,OAAS,gBAAAC,MAAoB,iCAC7B,OAAS,qBAAAC,EAAmB,8BAAAC,MAAkC,mCAC9D,OAAS,kBAAAC,MAAsB,8BAqD/B,MAAMC,EAAaX,EAAM,WAA+C,CAACY,EAAOC,IAAiB,CAC/F,KAAM,CAAE,KAAAC,EAAOX,EAAmB,KAAK,OAAQ,EAAIS,EAG7C,CACJ,UAAAG,EACA,SAAAC,EACA,QAAAC,EACA,GAAAC,EACA,MAAAC,EACA,OAAAC,EACA,SAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,SAAAC,EAAWZ,EAAM,QACjB,GAAGa,CACL,EAAIlB,EAAaK,EAAOT,EAAoBO,CAAc,EAI1DV,EAAM,UAAU,IAAM,CAChBY,EAAM,kBAAoB,QAC5B,QAAQ,KAAK,yHAAyH,CAE1I,EAAG,CAACA,EAAM,eAAe,CAAC,EAG1B,MAAMc,EAAoBL,GAAYC,EAIhCK,EAAY3B,EAAM,OAAoB,IAAI,EAG1C4B,EAAc5B,EAAM,OAAO0B,CAAiB,EAClDE,EAAY,QAAUF,EAEtB1B,EAAM,UAAU,IAAM,CACpB,MAAM6B,EAASF,EAAU,QACzB,GAAI,CAACE,EAAQ,OAIb,GAF+BH,IAAsB,cAEzB,CAE1BG,EAAO,MAAM,YAAY,cAAe,iBAAiB,EAGzD,IAAIC,EAGJ,MAAMC,EAAU,IAAM,CACpB,MAAMC,EAAqB,iBAAiBH,CAAM,EAAE,iBAAiB,cAAc,GAAK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GE,EACH,GAAGiB,EACJ,IAAMC,GAAS,CAET,OAAO9B,GAAiB,WAC1BA,EAAa8B,CAAI,EACR9B,IACTA,EAAa,QAAU8B,GAEzBhB,EAAU,QAAUgB,CACtB,EACA,UAAW1C,EAAW,WAAY,gBAAiBc,CAAS,EAC3D,GAAIqB,GAAsB,CAAE,SAAAZ,CAAS,EACrC,GAAIa,GAAyB,CAACC,EAA2B,CAAE,KAAM,QAAS,EAAI,CAAC,GAE/E1B,EAAM,QACLZ,EAAA,cAAAA,EAAA,cAQEA,EAAA,cAAC,QAAK,MAAO,CAAE,QAAS,WAAY,WAAY,QAAS,EAAG,cAAW,IACpEgB,CACH,EAGAhB,EAAA,cAACM,EAAA,KACCN,EAAA,cAAC,QAAK,GAAIwC,GAAgBC,EAAW,6BAA2B,EAC/DzB,CACH,EAGAhB,EAAA,cAACI,EAAA,CAAK,QAAO,GAAC,MAAM,SAAS,QAAQ,SAAS,SAAS,WAAW,MAAM,KACtEJ,EAAA,cAAC,YACCA,EAAA,cAACK,EAAA,CAAQ,KAAMG,EAAkBM,EAAML,CAA0B,EAAG,cAAY,OAAO,CACzF,CACF,CACF,EAEAO,CAEJ,CAEJ,CAAC,EACDL,EAAW,YAAc",
6
+ "names": ["React", "classNames", "Slot", "baseButtonPropDefs", "Flex", "Spinner", "VisuallyHidden", "extractProps", "mapResponsiveProp", "mapButtonSizeToSpinnerSize", "marginPropDefs", "BaseButton", "props", "forwardedRef", "size", "className", "children", "asChild", "as", "color", "radius", "material", "panelBackground", "flush", "disabled", "baseButtonProps", "effectiveMaterial", "buttonRef", "materialRef", "button", "timeoutId", "cleanup", "transitionDuration", "duration", "observer", "Comp", "shouldPassDisabled", "isNativeButtonElement", "hasExplicitTypeAttribute", "loadingId", "describedById", "buttonText", "accessibilityProps", "node"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,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EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,GAC/C,kBAAkB,GAAG;IACnB;;;OAGG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEJ;;;GAGG;AACH,KAAK,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,cAAc,GAAG;IAC1E,0DAA0D;IAC1D,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;AAElE;;;GAGG;AACH,KAAK,eAAe,GAAG,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;CAAE,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAElK;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,MAAM,EA6DP,eAAe,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import*as i from"react";import S from"classnames";import{BaseButton as R}from"./_internal/base-button.js";import{Tooltip as P}from"./tooltip.js";const f=i.forwardRef(({className:b,tooltip:s,tooltipSide:B="top",tooltipAlign:m="center",tooltipDelayDuration:y,tooltipDisableHoverableContent:g,overrideStyles:e,...u},v)=>{const a=i.useId(),l=!!s,O=i.useMemo(()=>l?{"aria-describedby":a}:{},[l,a]),d=i.useMemo(()=>{if(!e)return;const p={},o=(n,t)=>{t!==void 0&&(p[n]=t)},r=(n,t)=>{t&&(o(`--button-override-${n}color`,t.color),o(`--button-override-${n}background`,t.background),o(`--button-override-${n}background-color`,t.backgroundColor),o(`--button-override-${n}box-shadow`,t.boxShadow),o(`--button-override-${n}filter`,t.filter),o(`--button-override-${n}outline`,t.outline),o(`--button-override-${n}outline-offset`,t.outlineOffset),o(`--button-override-${n}opacity`,t.opacity))};return r("",e.normal),r("hover-",e.hover),r("active-",e.active),r("pressed-",e.pressed),r("open-",e.open),r("disabled-",e.disabled),e.focus&&(o("--button-override-focus-outline",e.focus.outline),o("--button-override-focus-outline-offset",e.focus.outlineOffset)),p},[e]),c=i.createElement(R,{...u,...O,ref:v,className:S("rt-Button",b),style:d?{...d,...u.style}:u.style});return s?i.createElement(P,{content:s,side:B,align:m,delayDuration:y,disableHoverableContent:g,id:a},c):c});f.displayName="Button";export{f as Button};
1
+ import*as i from"react";import R from"classnames";import{BaseButton as C}from"./_internal/base-button.js";import{Tooltip as h}from"./tooltip.js";import{useTooltipWrapper as w}from"../hooks/use-tooltip-wrapper.js";const d=i.forwardRef(({className:c,style:s,tooltip:a,tooltipSide:f="top",tooltipAlign:b="center",tooltipDelayDuration:m,tooltipDisableHoverableContent:B,overrideStyles:o,...y},g)=>{const{tooltipId:v,hasTooltip:O,accessibilityProps:S}=w(a),u=i.useMemo(()=>{if(!o)return;const p={},e=(n,t)=>{t!==void 0&&(p[n]=t)},r=(n,t)=>{t&&(e(`--button-override-${n}color`,t.color),e(`--button-override-${n}background`,t.background),e(`--button-override-${n}background-color`,t.backgroundColor),e(`--button-override-${n}box-shadow`,t.boxShadow),e(`--button-override-${n}filter`,t.filter),e(`--button-override-${n}outline`,t.outline),e(`--button-override-${n}outline-offset`,t.outlineOffset),e(`--button-override-${n}opacity`,t.opacity))};return r("",o.normal),r("hover-",o.hover),r("active-",o.active),r("pressed-",o.pressed),r("open-",o.open),r("disabled-",o.disabled),o.focus&&(e("--button-override-focus-outline",o.focus.outline),e("--button-override-focus-outline-offset",o.focus.outlineOffset)),p},[o]),P=i.useMemo(()=>u?{...u,...s}:s,[u,s]),l=i.createElement(C,{...y,...S,ref:g,className:R("rt-Button",c),style:P});return O?i.createElement(h,{content:a,side:f,align:b,delayDuration:m,disableHoverableContent:B,id:v},l):l});d.displayName="Button";export{d as Button};
2
2
  //# sourceMappingURL=button.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/button.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\n/**\n * Styles that can be overridden for a particular interaction state\n */\ninterface ButtonOverrideStateStyles {\n color?: string;\n background?: string;\n backgroundColor?: string;\n boxShadow?: string;\n filter?: string;\n outline?: string;\n outlineOffset?: string;\n opacity?: string | number;\n}\n\n/**\n * Full set of override styles keyed by interaction state\n */\ninterface ButtonOverrideStyles {\n /** Default/idle state styles */\n normal?: ButtonOverrideStateStyles;\n /** Hover state styles */\n hover?: ButtonOverrideStateStyles;\n /** Active (mouse down) state styles */\n active?: ButtonOverrideStateStyles;\n /** Toggle pressed state styles (data-state=\"on\") */\n pressed?: ButtonOverrideStateStyles;\n /** Open state styles (e.g., when used as a trigger) */\n open?: ButtonOverrideStateStyles;\n /** Disabled state styles */\n disabled?: ButtonOverrideStateStyles;\n /** Focus-visible outline styles */\n focus?: Pick<ButtonOverrideStateStyles, 'outline' | 'outlineOffset'>;\n}\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\ninterface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as'> &\n ButtonTooltipProps & {\n /**\n * When using variant=\"override\", provide token-based styles per state.\n * We propagate these into CSS variables consumed by the override variant.\n */\n overrideStyles?: ButtonOverrideStyles;\n };\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(\n props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> },\n) => React.ReactElement | null;\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n {\n className,\n tooltip,\n tooltipSide = 'top',\n tooltipAlign = 'center',\n tooltipDelayDuration,\n tooltipDisableHoverableContent,\n overrideStyles,\n ...props\n }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Generate unique ID for tooltip accessibility\n const tooltipId = React.useId();\n const hasTooltip = Boolean(tooltip);\n\n // Prepare accessibility props for tooltip integration\n const tooltipAccessibilityProps = React.useMemo(\n () => (hasTooltip ? { 'aria-describedby': tooltipId } : {}),\n [hasTooltip, tooltipId],\n );\n\n // Create the base button element with tooltip accessibility props\n // Map overrideStyles to CSS variables consumed by the override variant rules\n const overrideVars = React.useMemo(() => {\n if (!overrideStyles) return undefined;\n const vars: Record<string, string | number> = {};\n const setVar = (key: string, value: string | number | undefined) => {\n if (value !== undefined) vars[key] = value;\n };\n const apply = (prefix: string, s?: ButtonOverrideStateStyles) => {\n if (!s) return;\n setVar(`--button-override-${prefix}color`, s.color);\n setVar(`--button-override-${prefix}background`, s.background);\n setVar(`--button-override-${prefix}background-color`, s.backgroundColor);\n setVar(`--button-override-${prefix}box-shadow`, s.boxShadow);\n setVar(`--button-override-${prefix}filter`, s.filter);\n setVar(`--button-override-${prefix}outline`, s.outline);\n setVar(`--button-override-${prefix}outline-offset`, s.outlineOffset);\n setVar(`--button-override-${prefix}opacity`, s.opacity as any);\n };\n\n apply('', overrideStyles.normal);\n apply('hover-', overrideStyles.hover);\n apply('active-', overrideStyles.active);\n apply('pressed-', overrideStyles.pressed);\n apply('open-', overrideStyles.open);\n apply('disabled-', overrideStyles.disabled);\n\n if (overrideStyles.focus) {\n setVar('--button-override-focus-outline', overrideStyles.focus.outline);\n setVar('--button-override-focus-outline-offset', overrideStyles.focus.outlineOffset);\n }\n\n return vars as unknown as React.CSSProperties;\n }, [overrideStyles]);\n\n const button = (\n <BaseButton\n {...props}\n {...tooltipAccessibilityProps}\n ref={forwardedRef}\n className={classNames('rt-Button', className)}\n style={overrideVars ? { ...overrideVars, ...(props as any).style } : (props as any).style}\n />\n );\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!tooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip\n content={tooltip}\n side={tooltipSide}\n align={tooltipAlign}\n delayDuration={tooltipDelayDuration}\n disableHoverableContent={tooltipDisableHoverableContent}\n id={tooltipId}\n >\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonOverrideStyles, ButtonOverrideStateStyles };\n"],
5
- "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,6BAC3B,OAAS,WAAAC,MAAe,eA6GxB,MAAMC,EAASJ,EAAM,WACnB,CACE,CACE,UAAAK,EACA,QAAAC,EACA,YAAAC,EAAc,MACd,aAAAC,EAAe,SACf,qBAAAC,EACA,+BAAAC,EACA,eAAAC,EACA,GAAGC,CACL,EACAC,IACG,CAEH,MAAMC,EAAYd,EAAM,MAAM,EACxBe,EAAa,EAAQT,EAGrBU,EAA4BhB,EAAM,QACtC,IAAOe,EAAa,CAAE,mBAAoBD,CAAU,EAAI,CAAC,EACzD,CAACC,EAAYD,CAAS,CACxB,EAIMG,EAAejB,EAAM,QAAQ,IAAM,CACvC,GAAI,CAACW,EAAgB,OACrB,MAAMO,EAAwC,CAAC,EACzCC,EAAS,CAACC,EAAaC,IAAuC,CAC9DA,IAAU,SAAWH,EAAKE,CAAG,EAAIC,EACvC,EACMC,EAAQ,CAACC,EAAgBC,IAAkC,CAC1DA,IACLL,EAAO,qBAAqBI,CAAM,QAASC,EAAE,KAAK,EAClDL,EAAO,qBAAqBI,CAAM,aAAcC,EAAE,UAAU,EAC5DL,EAAO,qBAAqBI,CAAM,mBAAoBC,EAAE,eAAe,EACvEL,EAAO,qBAAqBI,CAAM,aAAcC,EAAE,SAAS,EAC3DL,EAAO,qBAAqBI,CAAM,SAAUC,EAAE,MAAM,EACpDL,EAAO,qBAAqBI,CAAM,UAAWC,EAAE,OAAO,EACtDL,EAAO,qBAAqBI,CAAM,iBAAkBC,EAAE,aAAa,EACnEL,EAAO,qBAAqBI,CAAM,UAAWC,EAAE,OAAc,EAC/D,EAEA,OAAAF,EAAM,GAAIX,EAAe,MAAM,EAC/BW,EAAM,SAAUX,EAAe,KAAK,EACpCW,EAAM,UAAWX,EAAe,MAAM,EACtCW,EAAM,WAAYX,EAAe,OAAO,EACxCW,EAAM,QAASX,EAAe,IAAI,EAClCW,EAAM,YAAaX,EAAe,QAAQ,EAEtCA,EAAe,QACjBQ,EAAO,kCAAmCR,EAAe,MAAM,OAAO,EACtEQ,EAAO,yCAA0CR,EAAe,MAAM,aAAa,GAG9EO,CACT,EAAG,CAACP,CAAc,CAAC,EAEbc,EACJzB,EAAA,cAACE,EAAA,CACE,GAAGU,EACH,GAAGI,EACJ,IAAKH,EACL,UAAWZ,EAAW,YAAaI,CAAS,EAC5C,MAAOY,EAAe,CAAE,GAAGA,EAAc,GAAIL,EAAc,KAAM,EAAKA,EAAc,MACtF,EAIF,OAAKN,EAOHN,EAAA,cAACG,EAAA,CACC,QAASG,EACT,KAAMC,EACN,MAAOC,EACP,cAAeC,EACf,wBAAyBC,EACzB,GAAII,GAEHW,CACH,EAfOA,CAiBX,CACF,EAEArB,EAAO,YAAc",
6
- "names": ["React", "classNames", "BaseButton", "Tooltip", "Button", "className", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "overrideStyles", "props", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "overrideVars", "vars", "setVar", "key", "value", "apply", "prefix", "s", "button"]
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\n\nimport { BaseButton } from './_internal/base-button.js';\nimport { Tooltip } from './tooltip.js';\nimport { useTooltipWrapper } from '../hooks/use-tooltip-wrapper.js';\nimport type { BaseButtonProps } from './_internal/base-button.js';\n\n/**\n * Styles that can be overridden for a particular interaction state\n */\ninterface ButtonOverrideStateStyles {\n color?: string;\n background?: string;\n backgroundColor?: string;\n boxShadow?: string;\n filter?: string;\n outline?: string;\n outlineOffset?: string;\n opacity?: string | number;\n}\n\n/**\n * Full set of override styles keyed by interaction state\n */\ninterface ButtonOverrideStyles {\n /** Default/idle state styles */\n normal?: ButtonOverrideStateStyles;\n /** Hover state styles */\n hover?: ButtonOverrideStateStyles;\n /** Active (mouse down) state styles */\n active?: ButtonOverrideStateStyles;\n /** Toggle pressed state styles (data-state=\"on\") */\n pressed?: ButtonOverrideStateStyles;\n /** Open state styles (e.g., when used as a trigger) */\n open?: ButtonOverrideStateStyles;\n /** Disabled state styles */\n disabled?: ButtonOverrideStateStyles;\n /** Focus-visible outline styles */\n focus?: Pick<ButtonOverrideStateStyles, 'outline' | 'outlineOffset'>;\n}\n\ntype ButtonElement = React.ElementRef<typeof BaseButton>;\n\n/**\n * Tooltip configuration props that can be passed to Button\n * These props are forwarded to the underlying Tooltip component\n */\ninterface ButtonTooltipProps {\n /** Content to display in the tooltip on hover/focus */\n tooltip?: React.ReactNode;\n /** Side of the button where the tooltip should appear */\n tooltipSide?: 'top' | 'right' | 'bottom' | 'left';\n /** Alignment of the tooltip relative to the button */\n tooltipAlign?: 'start' | 'center' | 'end';\n /** Delay before showing the tooltip (in milliseconds) */\n tooltipDelayDuration?: number;\n /** Whether to disable hoverable content behavior */\n tooltipDisableHoverableContent?: boolean;\n}\n\n/**\n * Core Button props excluding the 'as' prop for polymorphic behavior\n * Combines BaseButton props with tooltip functionality\n */\ntype ButtonOwnProps = Omit<BaseButtonProps, 'as'> &\n ButtonTooltipProps & {\n /**\n * When using variant=\"override\", provide token-based styles per state.\n * We propagate these into CSS variables consumed by the override variant.\n */\n overrideStyles?: ButtonOverrideStyles;\n };\n\n/**\n * Polymorphic Button props that support rendering as different HTML elements\n * @template C - The element type to render as (defaults to 'button')\n */\ntype ButtonProps<C extends React.ElementType = 'button'> = ButtonOwnProps & {\n /** Element type to render as (e.g., 'a', 'span', etc.) */\n as?: C;\n} & Omit<React.ComponentPropsWithoutRef<C>, keyof ButtonOwnProps>;\n\n/**\n * Button component type that supports polymorphic rendering\n * @template C - The element type to render as\n */\ntype ButtonComponent = <C extends React.ElementType = 'button'>(props: ButtonProps<C> & { ref?: React.ForwardedRef<ButtonElement> }) => React.ReactElement | null;\n\n/**\n * Button component for triggering actions throughout your interface\n *\n * The Button component is the primary interactive element in the Kookie User Interface.\n * It provides six visual variants, four sizes, comprehensive color options, and built-in\n * tooltip support. The component automatically handles icon sizing, supports responsive\n * layouts, and provides accessibility compliance out of the box.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // Button with variant and size\n * <Button variant=\"solid\" size=\"3\">Primary Action</Button>\n *\n * // Button with tooltip\n * <Button tooltip=\"Save your progress\">Save</Button>\n *\n * // Polymorphic button as link\n * <Button as=\"a\" href=\"/dashboard\">Go to Dashboard</Button>\n * ```\n */\nconst Button = React.forwardRef(\n (\n { className, style, tooltip, tooltipSide = 'top', tooltipAlign = 'center', tooltipDelayDuration, tooltipDisableHoverableContent, overrideStyles, ...props }: ButtonProps,\n forwardedRef: React.ForwardedRef<ButtonElement>,\n ) => {\n // Use shared tooltip wrapper hook for accessibility props\n const { tooltipId, hasTooltip, accessibilityProps: tooltipAccessibilityProps } = useTooltipWrapper(tooltip);\n\n // Create the base button element with tooltip accessibility props\n // Map overrideStyles to CSS variables consumed by the override variant rules\n const overrideVars = React.useMemo(() => {\n if (!overrideStyles) return undefined;\n const vars: Record<string, string | number> = {};\n const setVar = (key: string, value: string | number | undefined) => {\n if (value !== undefined) vars[key] = value;\n };\n const apply = (prefix: string, s?: ButtonOverrideStateStyles) => {\n if (!s) return;\n setVar(`--button-override-${prefix}color`, s.color);\n setVar(`--button-override-${prefix}background`, s.background);\n setVar(`--button-override-${prefix}background-color`, s.backgroundColor);\n setVar(`--button-override-${prefix}box-shadow`, s.boxShadow);\n setVar(`--button-override-${prefix}filter`, s.filter);\n setVar(`--button-override-${prefix}outline`, s.outline);\n setVar(`--button-override-${prefix}outline-offset`, s.outlineOffset);\n setVar(`--button-override-${prefix}opacity`, s.opacity);\n };\n\n apply('', overrideStyles.normal);\n apply('hover-', overrideStyles.hover);\n apply('active-', overrideStyles.active);\n apply('pressed-', overrideStyles.pressed);\n apply('open-', overrideStyles.open);\n apply('disabled-', overrideStyles.disabled);\n\n if (overrideStyles.focus) {\n setVar('--button-override-focus-outline', overrideStyles.focus.outline);\n setVar('--button-override-focus-outline-offset', overrideStyles.focus.outlineOffset);\n }\n\n return vars as React.CSSProperties;\n }, [overrideStyles]);\n\n // Combine override styles with user-provided styles\n const combinedStyle = React.useMemo(() => (overrideVars ? { ...overrideVars, ...style } : style), [overrideVars, style]);\n\n const button = <BaseButton {...props} {...tooltipAccessibilityProps} ref={forwardedRef} className={classNames('rt-Button', className)} style={combinedStyle} />;\n\n // If no tooltip is provided, return the button as-is for better performance\n if (!hasTooltip) {\n return button;\n }\n\n // Wrap with Tooltip when tooltip content is provided\n // This creates a compound component that handles both button and tooltip functionality\n return (\n <Tooltip content={tooltip} side={tooltipSide} align={tooltipAlign} delayDuration={tooltipDelayDuration} disableHoverableContent={tooltipDisableHoverableContent} id={tooltipId}>\n {button}\n </Tooltip>\n );\n },\n) as ButtonComponent & { displayName?: string };\n\nButton.displayName = 'Button';\n\nexport { Button };\nexport type { ButtonProps, ButtonOverrideStyles, ButtonOverrideStateStyles };\n"],
5
+ "mappings": "AAAA,UAAYA,MAAW,QACvB,OAAOC,MAAgB,aAEvB,OAAS,cAAAC,MAAkB,6BAC3B,OAAS,WAAAC,MAAe,eACxB,OAAS,qBAAAC,MAAyB,kCA2GlC,MAAMC,EAASL,EAAM,WACnB,CACE,CAAE,UAAAM,EAAW,MAAAC,EAAO,QAAAC,EAAS,YAAAC,EAAc,MAAO,aAAAC,EAAe,SAAU,qBAAAC,EAAsB,+BAAAC,EAAgC,eAAAC,EAAgB,GAAGC,CAAM,EAC1JC,IACG,CAEH,KAAM,CAAE,UAAAC,EAAW,WAAAC,EAAY,mBAAoBC,CAA0B,EAAId,EAAkBI,CAAO,EAIpGW,EAAenB,EAAM,QAAQ,IAAM,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a,MAAOC,EAAc,cAAeC,EAAsB,wBAAyBC,EAAgC,GAAII,GAClKY,CACH,EAROA,CAUX,CACF,EAEAvB,EAAO,YAAc",
6
+ "names": ["React", "classNames", "BaseButton", "Tooltip", "useTooltipWrapper", "Button", "className", "style", "tooltip", "tooltipSide", "tooltipAlign", "tooltipDelayDuration", "tooltipDisableHoverableContent", "overrideStyles", "props", "forwardedRef", "tooltipId", "hasTooltip", "tooltipAccessibilityProps", "overrideVars", "vars", "setVar", "key", "value", "apply", "prefix", "s", "combinedStyle", "button"]
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chatbar.d.ts","sourceRoot":"","sources":["../../../src/components/chatbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAKzF,KAAK,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AACvD,KAAK,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAGjD,4CAA4C;AAC5C,KAAK,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAChE;;;;GAIG;AACH,UAAU,iBAAiB;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AA4DD;;;;;;;;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