@yenio-pld/blocks 1.2.0-rc.2 → 1.2.0-rc.21

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.
@@ -3,7 +3,7 @@
3
3
  // src/theme-init.ts
4
4
  var THEME_STORAGE_KEY = "theme";
5
5
  var THEME_INIT_SCRIPT_ID = "yenio-theme-init";
6
- var THEME_INIT_SCRIPT = `(function(){var t="light";var s;try{s=localStorage.getItem("${THEME_STORAGE_KEY}")}catch(e){}if(s==="dark"||s==="light"){t=s}else{try{if(window.matchMedia("(prefers-color-scheme: dark)").matches)t="dark"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();`;
6
+ var THEME_INIT_SCRIPT = `(function(){var t="light";var s;try{s=localStorage.getItem("${THEME_STORAGE_KEY}")}catch(e){}if(s==="dark"||s==="light"){t=s}else{try{if(window.matchMedia("(prefers-color-scheme: dark)").matches)t="dark"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name="theme-color"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute("media")||"").toLowerCase();var c=m.getAttribute("content");if(!c)continue;if(media.indexOf("dark")!==-1)themeColors.dark=c;else if(media.indexOf("light")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains("dark"))return"dark";if(r.classList.contains("light"))return"light";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name="theme-color"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute("media")||"";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute("content");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute("content",color);metas[j].setAttribute("media","all")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:["class"]})}catch(e){}})();`;
7
7
 
8
8
  exports.THEME_INIT_SCRIPT = THEME_INIT_SCRIPT;
9
9
  exports.THEME_INIT_SCRIPT_ID = THEME_INIT_SCRIPT_ID;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme-init.ts"],"names":[],"mappings":";;;AACO,IAAM,iBAAA,GAAoB;AAE1B,IAAM,oBAAA,GAAuB;AAO7B,IAAM,iBAAA,GAAoB,+DAA+D,iBAAiB,CAAA,mNAAA","file":"theme-init.cjs","sourcesContent":["/** Matches `next-themes` default `storageKey`. */\nexport const THEME_STORAGE_KEY = \"theme\";\n\nexport const THEME_INIT_SCRIPT_ID = \"yenio-theme-init\";\n\n/**\n * Blocking script for the root layout.\n * `next-themes` contract: `attribute=\"class\"`, `storageKey=\"theme\"`, default `system`.\n * The provider injects the class too late for first paint.\n */\nexport const THEME_INIT_SCRIPT = `(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"${THEME_STORAGE_KEY}\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();`;\n"]}
1
+ {"version":3,"sources":["../src/theme-init.ts"],"names":[],"mappings":";;;AACO,IAAM,iBAAA,GAAoB;AAE1B,IAAM,oBAAA,GAAuB;AAO7B,IAAM,iBAAA,GAAoB,+DAA+D,iBAAiB,CAAA,s4CAAA","file":"theme-init.cjs","sourcesContent":["/** Matches `next-themes` default `storageKey`. */\nexport const THEME_STORAGE_KEY = \"theme\";\n\nexport const THEME_INIT_SCRIPT_ID = \"yenio-theme-init\";\n\n/**\n * Blocking script for the root layout.\n * `next-themes` contract: `attribute=\"class\"`, `storageKey=\"theme\"`, default `system`.\n * The provider injects the class too late for first paint.\n */\nexport const THEME_INIT_SCRIPT = `(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"${THEME_STORAGE_KEY}\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute(\"media\")||\"\").toLowerCase();var c=m.getAttribute(\"content\");if(!c)continue;if(media.indexOf(\"dark\")!==-1)themeColors.dark=c;else if(media.indexOf(\"light\")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains(\"dark\"))return\"dark\";if(r.classList.contains(\"light\"))return\"light\";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute(\"media\")||\"\";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute(\"content\");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute(\"content\",color);metas[j].setAttribute(\"media\",\"all\")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:[\"class\"]})}catch(e){}})();`;\n"]}
@@ -6,6 +6,6 @@ declare const THEME_INIT_SCRIPT_ID = "yenio-theme-init";
6
6
  * `next-themes` contract: `attribute="class"`, `storageKey="theme"`, default `system`.
7
7
  * The provider injects the class too late for first paint.
8
8
  */
9
- declare const THEME_INIT_SCRIPT = "(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"theme\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();";
9
+ declare const THEME_INIT_SCRIPT = "(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"theme\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute(\"media\")||\"\").toLowerCase();var c=m.getAttribute(\"content\");if(!c)continue;if(media.indexOf(\"dark\")!==-1)themeColors.dark=c;else if(media.indexOf(\"light\")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains(\"dark\"))return\"dark\";if(r.classList.contains(\"light\"))return\"light\";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute(\"media\")||\"\";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute(\"content\");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute(\"content\",color);metas[j].setAttribute(\"media\",\"all\")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:[\"class\"]})}catch(e){}})();";
10
10
 
11
11
  export { THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY };
@@ -6,6 +6,6 @@ declare const THEME_INIT_SCRIPT_ID = "yenio-theme-init";
6
6
  * `next-themes` contract: `attribute="class"`, `storageKey="theme"`, default `system`.
7
7
  * The provider injects the class too late for first paint.
8
8
  */
9
- declare const THEME_INIT_SCRIPT = "(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"theme\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();";
9
+ declare const THEME_INIT_SCRIPT = "(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"theme\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute(\"media\")||\"\").toLowerCase();var c=m.getAttribute(\"content\");if(!c)continue;if(media.indexOf(\"dark\")!==-1)themeColors.dark=c;else if(media.indexOf(\"light\")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains(\"dark\"))return\"dark\";if(r.classList.contains(\"light\"))return\"light\";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute(\"media\")||\"\";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute(\"content\");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute(\"content\",color);metas[j].setAttribute(\"media\",\"all\")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:[\"class\"]})}catch(e){}})();";
10
10
 
11
11
  export { THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY };
@@ -1,7 +1,7 @@
1
1
  // src/theme-init.ts
2
2
  var THEME_STORAGE_KEY = "theme";
3
3
  var THEME_INIT_SCRIPT_ID = "yenio-theme-init";
4
- var THEME_INIT_SCRIPT = `(function(){var t="light";var s;try{s=localStorage.getItem("${THEME_STORAGE_KEY}")}catch(e){}if(s==="dark"||s==="light"){t=s}else{try{if(window.matchMedia("(prefers-color-scheme: dark)").matches)t="dark"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();`;
4
+ var THEME_INIT_SCRIPT = `(function(){var t="light";var s;try{s=localStorage.getItem("${THEME_STORAGE_KEY}")}catch(e){}if(s==="dark"||s==="light"){t=s}else{try{if(window.matchMedia("(prefers-color-scheme: dark)").matches)t="dark"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name="theme-color"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute("media")||"").toLowerCase();var c=m.getAttribute("content");if(!c)continue;if(media.indexOf("dark")!==-1)themeColors.dark=c;else if(media.indexOf("light")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains("dark"))return"dark";if(r.classList.contains("light"))return"light";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name="theme-color"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute("media")||"";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute("content");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute("content",color);metas[j].setAttribute("media","all")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:["class"]})}catch(e){}})();`;
5
5
 
6
6
  export { THEME_INIT_SCRIPT, THEME_INIT_SCRIPT_ID, THEME_STORAGE_KEY };
7
7
  //# sourceMappingURL=theme-init.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/theme-init.ts"],"names":[],"mappings":";AACO,IAAM,iBAAA,GAAoB;AAE1B,IAAM,oBAAA,GAAuB;AAO7B,IAAM,iBAAA,GAAoB,+DAA+D,iBAAiB,CAAA,mNAAA","file":"theme-init.js","sourcesContent":["/** Matches `next-themes` default `storageKey`. */\nexport const THEME_STORAGE_KEY = \"theme\";\n\nexport const THEME_INIT_SCRIPT_ID = \"yenio-theme-init\";\n\n/**\n * Blocking script for the root layout.\n * `next-themes` contract: `attribute=\"class\"`, `storageKey=\"theme\"`, default `system`.\n * The provider injects the class too late for first paint.\n */\nexport const THEME_INIT_SCRIPT = `(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"${THEME_STORAGE_KEY}\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t})();`;\n"]}
1
+ {"version":3,"sources":["../src/theme-init.ts"],"names":[],"mappings":";AACO,IAAM,iBAAA,GAAoB;AAE1B,IAAM,oBAAA,GAAuB;AAO7B,IAAM,iBAAA,GAAoB,+DAA+D,iBAAiB,CAAA,s4CAAA","file":"theme-init.js","sourcesContent":["/** Matches `next-themes` default `storageKey`. */\nexport const THEME_STORAGE_KEY = \"theme\";\n\nexport const THEME_INIT_SCRIPT_ID = \"yenio-theme-init\";\n\n/**\n * Blocking script for the root layout.\n * `next-themes` contract: `attribute=\"class\"`, `storageKey=\"theme\"`, default `system`.\n * The provider injects the class too late for first paint.\n */\nexport const THEME_INIT_SCRIPT = `(function(){var t=\"light\";var s;try{s=localStorage.getItem(\"${THEME_STORAGE_KEY}\")}catch(e){}if(s===\"dark\"||s===\"light\"){t=s}else{try{if(window.matchMedia(\"(prefers-color-scheme: dark)\").matches)t=\"dark\"}catch(e){}}var r=document.documentElement;r.classList.add(t);r.style.colorScheme=t;var themeColors={light:null,dark:null};function captureThemeColors(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');for(var i=0;i<metas.length;i++){var m=metas[i];var media=(m.getAttribute(\"media\")||\"\").toLowerCase();var c=m.getAttribute(\"content\");if(!c)continue;if(media.indexOf(\"dark\")!==-1)themeColors.dark=c;else if(media.indexOf(\"light\")!==-1)themeColors.light=c}}catch(e){}}function resolvedTheme(){if(r.classList.contains(\"dark\"))return\"dark\";if(r.classList.contains(\"light\"))return\"light\";return t}function syncThemeColor(){try{var metas=document.querySelectorAll('meta[name=\"theme-color\"]');if(!metas.length)return;if(!themeColors.light&&!themeColors.dark)captureThemeColors();var theme=resolvedTheme();var color=themeColors[theme];if(!color){for(var i=0;i<metas.length;i++){var media=metas[i].getAttribute(\"media\")||\"\";if(media.indexOf(theme)!==-1){color=metas[i].getAttribute(\"content\");break}}}if(!color)return;for(var j=0;j<metas.length;j++){metas[j].setAttribute(\"content\",color);metas[j].setAttribute(\"media\",\"all\")}}catch(e){}}syncThemeColor();try{new MutationObserver(function(){syncThemeColor()}).observe(r,{attributes:true,attributeFilter:[\"class\"]})}catch(e){}})();`;\n"]}
@@ -52,7 +52,10 @@ function AlertDialogContent({
52
52
  "data-slot": "alert-dialog-content",
53
53
  "data-size": size,
54
54
  className: cn(
55
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs",
55
+ // Match DialogContent: inset/m-auto centering (no translate/zoom),
56
+ // flex-col + h-fit so Safari does not stretch the panel to the
57
+ // viewport (WebKit 260461: out-of-flow grid + fit-content).
58
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 m-auto flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] flex-col gap-4 overflow-y-auto rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs",
56
59
  className
57
60
  ),
58
61
  ...props
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert-dialog.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACGA,SAAS,WAAA,CAAY;AAAA,EACpB,GAAG;AACJ,CAAA,EAAqD;AACpD,EAAA,2BAA6B,oBAAA,CAAA,IAAA,EAArB,EAA0B,WAAA,EAAU,cAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACvE;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,2BACuB,oBAAA,CAAA,OAAA,EAArB,EAA6B,WAAA,EAAU,sBAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAE5E;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,GAAG;AACJ,CAAA,EAAuD;AACtD,EAAA,2BACuB,oBAAA,CAAA,MAAA,EAArB,EAA4B,WAAA,EAAU,qBAAA,EAAuB,GAAG,KAAA,EAAO,CAAA;AAE1E;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,OAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,sBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,wJAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,SAAA;AAAA,EACA,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EAEG;AACF,EAAA,4BACE,iBAAA,EAAA,EACA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,kBAAA,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,0BAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EACsC;AACrC,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,MAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EACsC;AACrC,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,MAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF","file":"alert-dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport type { ComponentProps } from \"react\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nfunction AlertDialog({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n\t);\n}\n\nfunction AlertDialogPortal({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n\t);\n}\n\nfunction AlertDialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tdata-slot=\"alert-dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({\n\tclassName,\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Content> & {\n\tsize?: \"default\" | \"sm\";\n}) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tdata-slot=\"alert-dialog-content\"\n\t\t\t\tdata-size={size}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot=\"alert-dialog-title\"\n\t\t\tclassName={cn(\"text-lg font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot=\"alert-dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogAction({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Action> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Action\n\t\t\tdata-slot=\"alert-dialog-action\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogCancel({\n\tclassName,\n\tvariant = \"outline\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tdata-slot=\"alert-dialog-cancel\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert-dialog.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACGA,SAAS,WAAA,CAAY;AAAA,EACpB,GAAG;AACJ,CAAA,EAAqD;AACpD,EAAA,2BAA6B,oBAAA,CAAA,IAAA,EAArB,EAA0B,WAAA,EAAU,cAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACvE;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,2BACuB,oBAAA,CAAA,OAAA,EAArB,EAA6B,WAAA,EAAU,sBAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAE5E;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,GAAG;AACJ,CAAA,EAAuD;AACtD,EAAA,2BACuB,oBAAA,CAAA,MAAA,EAArB,EAA4B,WAAA,EAAU,qBAAA,EAAuB,GAAG,KAAA,EAAO,CAAA;AAE1E;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC3B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAwD;AACvD,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,OAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,sBAAA;AAAA,MACV,SAAA,EA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,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,uBAAA,EAAyB,SAAS,CAAA;AAAA,MAC/C,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,sBAAA,CAAuB;AAAA,EAC/B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAA4D;AAC3D,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,WAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,0BAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EACsC;AACrC,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,MAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EACsC;AACrC,EAAA,uBACC,GAAA;AAAA,IAAsB,oBAAA,CAAA,MAAA;AAAA,IAArB;AAAA,MACA,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF","file":"alert-dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport type { ComponentProps } from \"react\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nfunction AlertDialog({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Root>) {\n\treturn <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n\t);\n}\n\nfunction AlertDialogPortal({\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n\t);\n}\n\nfunction AlertDialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Overlay\n\t\t\tdata-slot=\"alert-dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogContent({\n\tclassName,\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Content> & {\n\tsize?: \"default\" | \"sm\";\n}) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<AlertDialogPrimitive.Content\n\t\t\t\tdata-slot=\"alert-dialog-content\"\n\t\t\t\tdata-size={size}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t// Match DialogContent: inset/m-auto centering (no translate/zoom),\n\t\t\t\t\t// flex-col + h-fit so Safari does not stretch the panel to the\n\t\t\t\t\t// viewport (WebKit 260461: out-of-flow grid + fit-content).\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 m-auto flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] flex-col gap-4 overflow-y-auto rounded-lg border p-6 shadow-lg duration-200 data-[size=default]:sm:max-w-lg data-[size=sm]:max-w-xs\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nfunction AlertDialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"alert-dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Title>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Title\n\t\t\tdata-slot=\"alert-dialog-title\"\n\t\t\tclassName={cn(\"text-lg font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Description\n\t\t\tdata-slot=\"alert-dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogAction({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Action> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Action\n\t\t\tdata-slot=\"alert-dialog-action\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction AlertDialogCancel({\n\tclassName,\n\tvariant = \"outline\",\n\tsize = \"default\",\n\t...props\n}: ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n\tVariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<AlertDialogPrimitive.Cancel\n\t\t\tdata-slot=\"alert-dialog-cancel\"\n\t\t\tclassName={cn(buttonVariants({ variant, size }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogFooter,\n\tAlertDialogHeader,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"]}
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
7
  variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
8
- size?: "default" | "sm" | "xs" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
8
+ size?: "default" | "sm" | "xs" | "lg" | "touch" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-touch" | "icon-xl" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): React.JSX.Element;
11
11
 
package/dist/ui/button.js CHANGED
@@ -26,10 +26,16 @@ var buttonVariants = cva(
26
26
  xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
27
27
  sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
28
28
  lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
29
+ /** 44px touch target for POS register controls (WCAG AAA aim). */
30
+ touch: "h-11 gap-2 px-4 text-base has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-5",
31
+ /** 56px primary till actions (Charge, Exact cash). */
32
+ xl: "h-14 gap-2 px-5 text-base has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4 [&_svg:not([class*='size-'])]:size-5",
29
33
  icon: "size-8",
30
34
  "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
31
35
  "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
32
- "icon-lg": "size-9"
36
+ "icon-lg": "size-9",
37
+ "icon-touch": "size-11 [&_svg:not([class*='size-'])]:size-5",
38
+ "icon-xl": "size-14 [&_svg:not([class*='size-'])]:size-6"
33
39
  }
34
40
  },
35
41
  defaultVariants: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx"],"names":["ButtonPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACtB,4lBAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,wDAAA;AAAA,QACT,OAAA,EACC,iLAAA;AAAA,QACD,SAAA,EACC,gLAAA;AAAA,QACD,KAAA,EACC,kHAAA;AAAA,QACD,WAAA,EACC,6NAAA;AAAA,QACD,IAAA,EAAM;AAAA,OACP;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EACC,sFAAA;AAAA,QACD,EAAA,EAAI,+MAAA;AAAA,QACJ,EAAA,EAAI,yNAAA;AAAA,QACJ,EAAA,EAAI,sFAAA;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EACC,yHAAA;AAAA,QACD,SAAA,EACC,oFAAA;AAAA,QACD,SAAA,EAAW;AAAA;AACZ,KACD;AAAA,IACA,eAAA,EAAiB;AAAA,MAChB,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACP;AAEF;AAEA,SAAS,MAAA,CAAO;AAAA,EACf,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EAAgE;AAC/D,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF","file":"button.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n\t\"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n\t\t\t\tsecondary:\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n\t\t\t\tghost:\n\t\t\t\t\t\"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault:\n\t\t\t\t\t\"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\txs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tsm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\tlg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\ticon: \"size-8\",\n\t\t\t\t\"icon-xs\":\n\t\t\t\t\t\"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\t\"icon-sm\":\n\t\t\t\t\t\"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n\t\t\t\t\"icon-lg\": \"size-9\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t},\n);\n\nfunction Button({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<ButtonPrimitive\n\t\t\tdata-slot=\"button\"\n\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Button, buttonVariants };\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/button.tsx"],"names":["ButtonPrimitive"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACAA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACtB,4lBAAA;AAAA,EACA;AAAA,IACC,QAAA,EAAU;AAAA,MACT,OAAA,EAAS;AAAA,QACR,OAAA,EAAS,wDAAA;AAAA,QACT,OAAA,EACC,iLAAA;AAAA,QACD,SAAA,EACC,gLAAA;AAAA,QACD,KAAA,EACC,kHAAA;AAAA,QACD,WAAA,EACC,6NAAA;AAAA,QACD,IAAA,EAAM;AAAA,OACP;AAAA,MACA,IAAA,EAAM;AAAA,QACL,OAAA,EACC,sFAAA;AAAA,QACD,EAAA,EAAI,+MAAA;AAAA,QACJ,EAAA,EAAI,yNAAA;AAAA,QACJ,EAAA,EAAI,sFAAA;AAAA;AAAA,QAEJ,KAAA,EACC,kIAAA;AAAA;AAAA,QAED,EAAA,EAAI,kIAAA;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EACC,yHAAA;AAAA,QACD,SAAA,EACC,oFAAA;AAAA,QACD,SAAA,EAAW,QAAA;AAAA,QACX,YAAA,EAAc,8CAAA;AAAA,QACd,SAAA,EAAW;AAAA;AACZ,KACD;AAAA,IACA,eAAA,EAAiB;AAAA,MAChB,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACP;AAEF;AAEA,SAAS,MAAA,CAAO;AAAA,EACf,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,GAAG;AACJ,CAAA,EAAgE;AAC/D,EAAA,uBACC,GAAA;AAAA,IAACA,QAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,QAAA;AAAA,MACV,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACL;AAEF","file":"button.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n\t\"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n\t\t\t\toutline:\n\t\t\t\t\t\"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n\t\t\t\tsecondary:\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n\t\t\t\tghost:\n\t\t\t\t\t\"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n\t\t\t\tdestructive:\n\t\t\t\t\t\"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault:\n\t\t\t\t\t\"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\txs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tsm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\tlg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\t/** 44px touch target for POS register controls (WCAG AAA aim). */\n\t\t\t\ttouch:\n\t\t\t\t\t\"h-11 gap-2 px-4 text-base has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t/** 56px primary till actions (Charge, Exact cash). */\n\t\t\t\txl: \"h-14 gap-2 px-5 text-base has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\ticon: \"size-8\",\n\t\t\t\t\"icon-xs\":\n\t\t\t\t\t\"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\t\"icon-sm\":\n\t\t\t\t\t\"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n\t\t\t\t\"icon-lg\": \"size-9\",\n\t\t\t\t\"icon-touch\": \"size-11 [&_svg:not([class*='size-'])]:size-5\",\n\t\t\t\t\"icon-xl\": \"size-14 [&_svg:not([class*='size-'])]:size-6\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t},\n);\n\nfunction Button({\n\tclassName,\n\tvariant = \"default\",\n\tsize = \"default\",\n\t...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n\treturn (\n\t\t<ButtonPrimitive\n\t\t\tdata-slot=\"button\"\n\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Button, buttonVariants };\n"]}
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { InputHTMLAttributes, ComponentProps } from 'react';
3
+
4
+ type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "checked" | "defaultChecked"> & {
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ onCheckedChange?: (checked: boolean) => void;
8
+ };
9
+ /**
10
+ * Accessible checkbox. Native input (not Base UI) so jsdom / Playwright
11
+ * `getByRole('checkbox')` and `.check()` work without PointerEvent polyfills.
12
+ */
13
+ declare function Checkbox({ className, checked, defaultChecked, onCheckedChange, disabled, id, ...props }: CheckboxProps): React.JSX.Element;
14
+ declare function CheckboxLabel({ className, ...props }: ComponentProps<"label">): React.JSX.Element;
15
+
16
+ export { Checkbox, CheckboxLabel };
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { CheckIcon } from 'lucide-react';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ function Checkbox({
11
+ className,
12
+ checked,
13
+ defaultChecked,
14
+ onCheckedChange,
15
+ disabled,
16
+ id,
17
+ ...props
18
+ }) {
19
+ return /* @__PURE__ */ jsxs("span", { className: cn("relative inline-flex size-4 shrink-0", className), children: [
20
+ /* @__PURE__ */ jsx(
21
+ "input",
22
+ {
23
+ ...props,
24
+ checked,
25
+ className: "peer absolute inset-0 z-10 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
26
+ "data-slot": "checkbox",
27
+ defaultChecked,
28
+ disabled,
29
+ id,
30
+ onChange: (event) => onCheckedChange?.(event.target.checked),
31
+ type: "checkbox"
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsx(
35
+ "span",
36
+ {
37
+ "aria-hidden": true,
38
+ className: cn(
39
+ "pointer-events-none flex size-4 items-center justify-center rounded-[4px] border border-input bg-background text-primary-foreground transition-colors",
40
+ "peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50",
41
+ "peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100",
42
+ "peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
43
+ "peer-aria-invalid:border-destructive peer-aria-invalid:ring-3 peer-aria-invalid:ring-destructive/20"
44
+ ),
45
+ children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3 opacity-0", strokeWidth: 3 })
46
+ }
47
+ )
48
+ ] });
49
+ }
50
+ function CheckboxLabel({ className, ...props }) {
51
+ return /* @__PURE__ */ jsx(
52
+ "label",
53
+ {
54
+ "data-slot": "checkbox-label",
55
+ className: cn(
56
+ "text-sm leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
57
+ className
58
+ ),
59
+ ...props
60
+ }
61
+ );
62
+ }
63
+
64
+ export { Checkbox, CheckboxLabel };
65
+ //# sourceMappingURL=checkbox.js.map
66
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/checkbox.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACeA,SAAS,QAAA,CAAS;AAAA,EACjB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAkB;AACjB,EAAA,4BACE,MAAA,EAAA,EAAK,SAAA,EAAW,EAAA,CAAG,sCAAA,EAAwC,SAAS,CAAA,EACpE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAG,KAAA;AAAA,QACJ,OAAA;AAAA,QACA,SAAA,EAAU,2FAAA;AAAA,QACV,WAAA,EAAU,UAAA;AAAA,QACV,cAAA;AAAA,QACA,QAAA;AAAA,QACA,EAAA;AAAA,QACA,UAAU,CAAC,KAAA,KAAU,eAAA,GAAkB,KAAA,CAAM,OAAO,OAAO,CAAA;AAAA,QAC3D,IAAA,EAAK;AAAA;AAAA,KACN;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACA,aAAA,EAAW,IAAA;AAAA,QACX,SAAA,EAAW,EAAA;AAAA,UACV,uJAAA;AAAA,UACA,0FAAA;AAAA,UACA,sFAAA;AAAA,UACA,2DAAA;AAAA,UACA;AAAA,SACD;AAAA,QAEA,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,kBAAA,EAAmB,aAAa,CAAA,EAAG;AAAA;AAAA;AACzD,GAAA,EACD,CAAA;AAEF;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAA4B;AACxE,EAAA,uBACC,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,gBAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,6EAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"checkbox.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { CheckIcon } from \"lucide-react\";\nimport type { ComponentProps, InputHTMLAttributes } from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\ntype CheckboxProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t\"type\" | \"onChange\" | \"checked\" | \"defaultChecked\"\n> & {\n\tchecked?: boolean;\n\tdefaultChecked?: boolean;\n\tonCheckedChange?: (checked: boolean) => void;\n};\n\n/**\n * Accessible checkbox. Native input (not Base UI) so jsdom / Playwright\n * `getByRole('checkbox')` and `.check()` work without PointerEvent polyfills.\n */\nfunction Checkbox({\n\tclassName,\n\tchecked,\n\tdefaultChecked,\n\tonCheckedChange,\n\tdisabled,\n\tid,\n\t...props\n}: CheckboxProps) {\n\treturn (\n\t\t<span className={cn(\"relative inline-flex size-4 shrink-0\", className)}>\n\t\t\t<input\n\t\t\t\t{...props}\n\t\t\t\tchecked={checked}\n\t\t\t\tclassName=\"peer absolute inset-0 z-10 size-full cursor-pointer opacity-0 disabled:cursor-not-allowed\"\n\t\t\t\tdata-slot=\"checkbox\"\n\t\t\t\tdefaultChecked={defaultChecked}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={id}\n\t\t\t\tonChange={(event) => onCheckedChange?.(event.target.checked)}\n\t\t\t\ttype=\"checkbox\"\n\t\t\t/>\n\t\t\t<span\n\t\t\t\taria-hidden\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"pointer-events-none flex size-4 items-center justify-center rounded-[4px] border border-input bg-background text-primary-foreground transition-colors\",\n\t\t\t\t\t\"peer-focus-visible:border-ring peer-focus-visible:ring-3 peer-focus-visible:ring-ring/50\",\n\t\t\t\t\t\"peer-checked:border-primary peer-checked:bg-primary peer-checked:[&_svg]:opacity-100\",\n\t\t\t\t\t\"peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n\t\t\t\t\t\"peer-aria-invalid:border-destructive peer-aria-invalid:ring-3 peer-aria-invalid:ring-destructive/20\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<CheckIcon className=\"size-3 opacity-0\" strokeWidth={3} />\n\t\t\t</span>\n\t\t</span>\n\t);\n}\n\nfunction CheckboxLabel({ className, ...props }: ComponentProps<\"label\">) {\n\treturn (\n\t\t<label\n\t\t\tdata-slot=\"checkbox-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"text-sm leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Checkbox, CheckboxLabel };\n"]}
@@ -0,0 +1 @@
1
+ export { Combobox } from '@base-ui/react/combobox';
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ export { Combobox } from '@base-ui/react/combobox';
3
+ //# sourceMappingURL=combobox.js.map
4
+ //# sourceMappingURL=combobox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"combobox.js","sourcesContent":[]}
@@ -2,10 +2,12 @@ import * as React from 'react';
2
2
  import { ComponentProps } from 'react';
3
3
  import * as DialogPrimitive from '@radix-ui/react-dialog';
4
4
 
5
+ /** Portal target for Base UI popups nested in this dialog (Select, Combobox, …). */
6
+ declare function useDialogPortalContainer(): HTMLElement | null;
5
7
  declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
6
8
  declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
7
9
  declare function DialogClose({ ...props }: ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
8
- declare function DialogContent({ className, children, showCloseButton, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
10
+ declare function DialogContent({ className, children, showCloseButton, onPointerDownOutside, onInteractOutside, onFocusOutside, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
9
11
  showCloseButton?: boolean;
10
12
  }): React.JSX.Element;
11
13
  declare function DialogHeader({ className, ...props }: ComponentProps<"div">): React.JSX.Element;
@@ -13,4 +15,4 @@ declare function DialogFooter({ className, ...props }: ComponentProps<"div">): R
13
15
  declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
14
16
  declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
15
17
 
16
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
18
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, useDialogPortalContainer };
package/dist/ui/dialog.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
3
  import { XIcon } from 'lucide-react';
4
+ import { createContext, useContext, useState } from 'react';
4
5
  import { clsx } from 'clsx';
5
6
  import { twMerge } from 'tailwind-merge';
6
7
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -8,6 +9,10 @@ import { jsx, jsxs } from 'react/jsx-runtime';
8
9
  function cn(...inputs) {
9
10
  return twMerge(clsx(inputs));
10
11
  }
12
+ var DialogPortalContainerContext = createContext(null);
13
+ function useDialogPortalContainer() {
14
+ return useContext(DialogPortalContainerContext);
15
+ }
11
16
  function Dialog({ ...props }) {
12
17
  return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
13
18
  }
@@ -42,32 +47,83 @@ function DialogOverlay({
42
47
  }
43
48
  );
44
49
  }
50
+ function isPortaledOverlayTarget(target) {
51
+ if (!(target instanceof Element)) return false;
52
+ return Boolean(
53
+ target.closest(
54
+ [
55
+ '[data-slot="select-positioner"]',
56
+ '[data-slot="select-popup"]',
57
+ '[data-slot="combobox-positioner"]',
58
+ '[role="listbox"]',
59
+ '[role="option"]',
60
+ "[data-base-ui-portal]",
61
+ "[data-base-ui-focus-guard]",
62
+ "[data-base-ui-inert]"
63
+ ].join(", ")
64
+ )
65
+ );
66
+ }
45
67
  function DialogContent({
46
68
  className,
47
69
  children,
48
70
  showCloseButton = true,
71
+ onPointerDownOutside,
72
+ onInteractOutside,
73
+ onFocusOutside,
49
74
  ...props
50
75
  }) {
76
+ const [portalContainer, setPortalContainer] = useState(
77
+ null
78
+ );
51
79
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
52
80
  /* @__PURE__ */ jsx(DialogOverlay, {}),
53
- /* @__PURE__ */ jsxs(
81
+ /* @__PURE__ */ jsx(DialogPortalContainerContext.Provider, { value: portalContainer, children: /* @__PURE__ */ jsxs(
54
82
  DialogPrimitive.Content,
55
83
  {
56
84
  "data-slot": "dialog-content",
57
85
  className: cn(
58
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
86
+ // Center with inset + margin, not translate. Translate (and zoom
87
+ // scale) create a containing block that misaligns Google Places
88
+ // PlaceAutocompleteElement prediction lists and other fixed UI.
89
+ // flex-col + h-fit: Safari stretches out-of-flow `display:grid`
90
+ // panels to the viewport (WebKit 260461); flex sizes to content.
91
+ // overflow-visible: Select/Combobox portal into this node; an
92
+ // overflow scrollport here folds abspos popup height into the
93
+ // dialog and stretches the panel when a list opens.
94
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 m-auto flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] flex-col overflow-visible rounded-lg border shadow-lg duration-200 sm:max-w-lg",
59
95
  className
60
96
  ),
61
97
  ...props,
98
+ ref: setPortalContainer,
99
+ onPointerDownOutside: (event) => {
100
+ if (isPortaledOverlayTarget(event.target)) event.preventDefault();
101
+ onPointerDownOutside?.(event);
102
+ },
103
+ onInteractOutside: (event) => {
104
+ if (isPortaledOverlayTarget(event.target)) event.preventDefault();
105
+ onInteractOutside?.(event);
106
+ },
107
+ onFocusOutside: (event) => {
108
+ if (isPortaledOverlayTarget(event.target)) event.preventDefault();
109
+ onFocusOutside?.(event);
110
+ },
62
111
  children: [
63
- children,
112
+ /* @__PURE__ */ jsx(
113
+ "div",
114
+ {
115
+ "data-slot": "dialog-body",
116
+ className: "flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6",
117
+ children
118
+ }
119
+ ),
64
120
  showCloseButton ? /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
65
121
  /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
66
122
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
67
123
  ] }) : null
68
124
  ]
69
125
  }
70
- )
126
+ ) })
71
127
  ] });
72
128
  }
73
129
  function DialogHeader({ className, ...props }) {
@@ -120,6 +176,6 @@ function DialogDescription({
120
176
  );
121
177
  }
122
178
 
123
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
179
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, useDialogPortalContainer };
124
180
  //# sourceMappingURL=dialog.js.map
125
181
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/dialog.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACEA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAgD;AAC1E,EAAA,2BAAwB,eAAA,CAAA,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC5D;AAEA,SAAS,aAAA,CAAc;AAAA,EACtB,GAAG;AACJ,CAAA,EAAmD;AAClD,EAAA,2BAAwB,eAAA,CAAA,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACvE;AAEA,SAAS,YAAA,CAAa;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{ clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"../lib/utils\";\n\nfunction Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Trigger>) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Portal>) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Close>) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn (\n\t\t<DialogPrimitive.Overlay\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseButton = true,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Content> & {\n\tshowCloseButton?: boolean;\n}) {\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPrimitive.Content\n\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{showCloseButton ? (\n\t\t\t\t\t<DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\">\n\t\t\t\t\t\t<XIcon className=\"size-4\" />\n\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t) : null}\n\t\t\t</DialogPrimitive.Content>\n\t\t</DialogPortal>\n\t);\n}\n\nfunction DialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\tclassName={cn(\"text-lg leading-none font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n};\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/dialog.tsx"],"names":[],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC3C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC5B;ACOA,IAAM,4BAAA,GAA+B,cAAkC,IAAI,CAAA;AAG3E,SAAS,wBAAA,GAA+C;AACvD,EAAA,OAAO,WAAW,4BAA4B,CAAA;AAC/C;AAEA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAgD;AAC1E,EAAA,2BAAwB,eAAA,CAAA,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC5D;AAEA,SAAS,aAAA,CAAc;AAAA,EACtB,GAAG;AACJ,CAAA,EAAmD;AAClD,EAAA,2BAAwB,eAAA,CAAA,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACvE;AAEA,SAAS,YAAA,CAAa;AAAA,EACrB,GAAG;AACJ,CAAA,EAAkD;AACjD,EAAA,2BAAwB,eAAA,CAAA,MAAA,EAAhB,EAAuB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACrE;AAEA,SAAS,WAAA,CAAY;AAAA,EACpB,GAAG;AACJ,CAAA,EAAiD;AAChD,EAAA,2BAAwB,eAAA,CAAA,KAAA,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a,EAAE,SAAA,EAAW,GAAG,OAAM,EAA0B;AACrE,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,8CAAA,EAAgD,SAAS,CAAA;AAAA,MACtE,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,YAAA,CAAa,EAAE,SAAA,EAAW,GAAG,OAAM,EAA0B;AACrE,EAAA,uBACC,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,wDAAA;AAAA,QACA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,WAAA,CAAY;AAAA,EACpB,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAiD;AAChD,EAAA,uBACC,GAAA;AAAA,IAAiB,eAAA,CAAA,KAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,oCAAA,EAAsC,SAAS,CAAA;AAAA,MAC5D,GAAG;AAAA;AAAA,GACL;AAEF;AAEA,SAAS,iBAAA,CAAkB;AAAA,EAC1B,SAAA;AAAA,EACA,GAAG;AACJ,CAAA,EAAuD;AACtD,EAAA,uBACC,GAAA;AAAA,IAAiB,eAAA,CAAA,WAAA;AAAA,IAAhB;AAAA,MACA,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACL;AAEF","file":"dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\nimport {\n\tcreateContext,\n\tuseContext,\n\tuseState,\n\ttype ComponentProps,\n} from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst DialogPortalContainerContext = createContext<HTMLElement | null>(null);\n\n/** Portal target for Base UI popups nested in this dialog (Select, Combobox, …). */\nfunction useDialogPortalContainer(): HTMLElement | null {\n\treturn useContext(DialogPortalContainerContext);\n}\n\nfunction Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>) {\n\treturn <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Trigger>) {\n\treturn <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Portal>) {\n\treturn <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Close>) {\n\treturn <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Overlay>) {\n\treturn (\n\t\t<DialogPrimitive.Overlay\n\t\t\tdata-slot=\"dialog-overlay\"\n\t\t\tclassName={cn(\n\t\t\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * Portaled Base UI Select / Combobox popups (and their focus guards / inert\n * backdrops) sit outside Dialog Content in the DOM when not using the dialog\n * portal container. Treat those nodes as inside the dialog for dismiss/focus.\n */\nfunction isPortaledOverlayTarget(target: EventTarget | null): boolean {\n\tif (!(target instanceof Element)) return false;\n\treturn Boolean(\n\t\ttarget.closest(\n\t\t\t[\n\t\t\t\t'[data-slot=\"select-positioner\"]',\n\t\t\t\t'[data-slot=\"select-popup\"]',\n\t\t\t\t'[data-slot=\"combobox-positioner\"]',\n\t\t\t\t'[role=\"listbox\"]',\n\t\t\t\t'[role=\"option\"]',\n\t\t\t\t\"[data-base-ui-portal]\",\n\t\t\t\t\"[data-base-ui-focus-guard]\",\n\t\t\t\t\"[data-base-ui-inert]\",\n\t\t\t].join(\", \"),\n\t\t),\n\t);\n}\n\nfunction DialogContent({\n\tclassName,\n\tchildren,\n\tshowCloseButton = true,\n\tonPointerDownOutside,\n\tonInteractOutside,\n\tonFocusOutside,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Content> & {\n\tshowCloseButton?: boolean;\n}) {\n\tconst [portalContainer, setPortalContainer] = useState<HTMLElement | null>(\n\t\tnull,\n\t);\n\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<DialogPortalContainerContext.Provider value={portalContainer}>\n\t\t\t\t<DialogPrimitive.Content\n\t\t\t\t\tdata-slot=\"dialog-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t// Center with inset + margin, not translate. Translate (and zoom\n\t\t\t\t\t\t// scale) create a containing block that misaligns Google Places\n\t\t\t\t\t\t// PlaceAutocompleteElement prediction lists and other fixed UI.\n\t\t\t\t\t\t// flex-col + h-fit: Safari stretches out-of-flow `display:grid`\n\t\t\t\t\t\t// panels to the viewport (WebKit 260461); flex sizes to content.\n\t\t\t\t\t\t// overflow-visible: Select/Combobox portal into this node; an\n\t\t\t\t\t\t// overflow scrollport here folds abspos popup height into the\n\t\t\t\t\t\t// dialog and stretches the panel when a list opens.\n\t\t\t\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 m-auto flex h-fit max-h-[calc(100%-2rem)] w-full max-w-[calc(100%-2rem)] flex-col overflow-visible rounded-lg border shadow-lg duration-200 sm:max-w-lg\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={setPortalContainer}\n\t\t\t\t\tonPointerDownOutside={(event) => {\n\t\t\t\t\t\tif (isPortaledOverlayTarget(event.target)) event.preventDefault();\n\t\t\t\t\t\tonPointerDownOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\tonInteractOutside={(event) => {\n\t\t\t\t\t\tif (isPortaledOverlayTarget(event.target)) event.preventDefault();\n\t\t\t\t\t\tonInteractOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t\tonFocusOutside={(event) => {\n\t\t\t\t\t\tif (isPortaledOverlayTarget(event.target)) event.preventDefault();\n\t\t\t\t\t\tonFocusOutside?.(event);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tdata-slot=\"dialog-body\"\n\t\t\t\t\t\tclassName=\"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t\t{showCloseButton ? (\n\t\t\t\t\t\t<DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\">\n\t\t\t\t\t\t\t<XIcon className=\"size-4\" />\n\t\t\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t\t\t</DialogPrimitive.Close>\n\t\t\t\t\t) : null}\n\t\t\t\t</DialogPrimitive.Content>\n\t\t\t</DialogPortalContainerContext.Provider>\n\t\t</DialogPortal>\n\t);\n}\n\nfunction DialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-header\"\n\t\t\tclassName={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"dialog-footer\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogTitle({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Title>) {\n\treturn (\n\t\t<DialogPrimitive.Title\n\t\t\tdata-slot=\"dialog-title\"\n\t\t\tclassName={cn(\"text-lg leading-none font-semibold\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DialogDescription({\n\tclassName,\n\t...props\n}: ComponentProps<typeof DialogPrimitive.Description>) {\n\treturn (\n\t\t<DialogPrimitive.Description\n\t\t\tdata-slot=\"dialog-description\"\n\t\t\tclassName={cn(\"text-muted-foreground text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n\tuseDialogPortalContainer,\n};\n"]}
@@ -1,5 +1,9 @@
1
1
  import * as React from 'react';
2
2
 
3
- declare function Select({ className, ...props }: React.ComponentProps<"select">): React.JSX.Element;
3
+ type SelectProps = Omit<React.ComponentProps<"select">, "onChange" | "children" | "size" | "multiple"> & {
4
+ onChange?: React.ChangeEventHandler<HTMLSelectElement>;
5
+ children?: React.ReactNode;
6
+ };
7
+ declare function Select({ className, children, value, defaultValue, onChange, disabled, required, name, id, autoFocus, tabIndex, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, }: SelectProps): React.JSX.Element;
4
8
 
5
9
  export { Select };