@womp/kookie-ui 0.35.7 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/components.css +12 -0
  2. package/dist/cjs/components/_internal/use-close-warning.d.ts +12 -0
  3. package/dist/cjs/components/_internal/use-close-warning.d.ts.map +1 -0
  4. package/dist/cjs/components/_internal/use-close-warning.js +3 -0
  5. package/dist/cjs/components/_internal/use-close-warning.js.map +7 -0
  6. package/dist/cjs/components/dialog.d.ts.map +1 -1
  7. package/dist/cjs/components/dialog.js +1 -1
  8. package/dist/cjs/components/dialog.js.map +4 -4
  9. package/dist/cjs/components/index.js +2 -2
  10. package/dist/cjs/components/index.js.map +4 -4
  11. package/dist/cjs/components/sheet.d.ts +7 -4
  12. package/dist/cjs/components/sheet.d.ts.map +1 -1
  13. package/dist/cjs/components/sheet.js +1 -1
  14. package/dist/cjs/components/sheet.js.map +4 -4
  15. package/dist/cjs/index.js +3 -3
  16. package/dist/cjs/index.js.map +4 -4
  17. package/dist/esm/{chunk-HGF4CKRY.js → chunk-3ZBEWLSO.js} +2 -2
  18. package/dist/esm/{chunk-26O4RBOJ.js → chunk-5BABJBV3.js} +2 -2
  19. package/dist/esm/{chunk-5APRBJRR.js → chunk-5GTQXMS2.js} +2 -2
  20. package/dist/esm/{chunk-LR4X7SVV.js → chunk-5RLGDXOM.js} +2 -2
  21. package/dist/esm/{chunk-SGKLJDA3.js → chunk-74JANLVU.js} +2 -2
  22. package/dist/esm/{chunk-TUZ665BA.js → chunk-7E3ZOVRL.js} +2 -2
  23. package/dist/esm/{chunk-OMPLFDS6.js → chunk-ASBTPKH3.js} +2 -2
  24. package/dist/esm/{chunk-JFJV4HL3.js → chunk-CFXFWIRM.js} +2 -2
  25. package/dist/esm/{chunk-YLGIP3A5.js → chunk-CJZGEHVB.js} +2 -2
  26. package/dist/esm/{chunk-TRJAVWCK.js → chunk-DNY4WWZF.js} +2 -2
  27. package/dist/esm/{chunk-C6VGCYFQ.js → chunk-E6MOZSYV.js} +2 -2
  28. package/dist/esm/{chunk-Y5ITMKC6.js → chunk-G7S2BMS3.js} +2 -2
  29. package/dist/esm/{chunk-SR42NATX.js → chunk-GHIHF55B.js} +2 -2
  30. package/dist/esm/chunk-HWT2K2XR.js +3 -0
  31. package/dist/esm/chunk-HWT2K2XR.js.map +7 -0
  32. package/dist/esm/{chunk-D42VCLKH.js → chunk-ICO5ULJL.js} +2 -2
  33. package/dist/esm/{chunk-KBSH6CBD.js → chunk-IN6D33TU.js} +2 -2
  34. package/dist/esm/{chunk-FYZXC7AL.js → chunk-JJVAVLCN.js} +2 -2
  35. package/dist/esm/{chunk-R4DMVTM3.js → chunk-M6THDAMU.js} +2 -2
  36. package/dist/esm/{chunk-VBF3XALY.js → chunk-MS2ONKJJ.js} +2 -2
  37. package/dist/esm/{chunk-XFMAA4MD.js → chunk-NJG42JDM.js} +2 -2
  38. package/dist/esm/{chunk-NJ7RQYLX.js → chunk-OIJQSUUM.js} +2 -2
  39. package/dist/esm/{chunk-VYF6KKYM.js → chunk-ONJYRJ66.js} +2 -2
  40. package/dist/esm/chunk-PIVHOUEA.js +3 -0
  41. package/dist/esm/chunk-PIVHOUEA.js.map +7 -0
  42. package/dist/esm/{chunk-UH6CJXHY.js → chunk-QPGW6RJG.js} +2 -2
  43. package/dist/esm/{chunk-X4PWBFOT.js → chunk-SIYOLE6P.js} +2 -2
  44. package/dist/esm/{chunk-QBONJMSE.js → chunk-VRQK7U7J.js} +2 -2
  45. package/dist/esm/{chunk-TANYRHGP.js → chunk-W3X4N4JE.js} +2 -2
  46. package/dist/esm/{chunk-OPYTQ34H.js → chunk-W4CPV4PO.js} +2 -2
  47. package/dist/esm/{chunk-YLPCYCYA.js → chunk-WT4IDG2W.js} +2 -2
  48. package/dist/esm/chunk-YOESAYMJ.js +3 -0
  49. package/dist/esm/chunk-YOESAYMJ.js.map +7 -0
  50. package/dist/esm/{chunk-FVRVBB6O.js → chunk-YOZXIUZY.js} +2 -2
  51. package/dist/esm/{chunk-OGVKMDO7.js → chunk-YRCXTCIT.js} +2 -2
  52. package/dist/esm/components/_internal/base-button.js +1 -1
  53. package/dist/esm/components/_internal/portal-theme.js +1 -1
  54. package/dist/esm/components/_internal/use-close-warning.d.ts +12 -0
  55. package/dist/esm/components/_internal/use-close-warning.d.ts.map +1 -0
  56. package/dist/esm/components/_internal/use-close-warning.js +3 -0
  57. package/dist/esm/components/_internal/use-close-warning.js.map +7 -0
  58. package/dist/esm/components/accordion.js +1 -1
  59. package/dist/esm/components/alert-dialog.js +1 -1
  60. package/dist/esm/components/avatar.js +1 -1
  61. package/dist/esm/components/button.js +1 -1
  62. package/dist/esm/components/chatbar.js +1 -1
  63. package/dist/esm/components/checkbox-group.js +1 -1
  64. package/dist/esm/components/checkbox.js +1 -1
  65. package/dist/esm/components/chip.js +1 -1
  66. package/dist/esm/components/combobox.js +1 -1
  67. package/dist/esm/components/command.js +1 -1
  68. package/dist/esm/components/context-menu.js +1 -1
  69. package/dist/esm/components/dialog.d.ts.map +1 -1
  70. package/dist/esm/components/dialog.js +1 -1
  71. package/dist/esm/components/dropdown-menu.js +1 -1
  72. package/dist/esm/components/index.js +1 -1
  73. package/dist/esm/components/message-scroller.js +1 -1
  74. package/dist/esm/components/navigator.js +1 -1
  75. package/dist/esm/components/notice.js +1 -1
  76. package/dist/esm/components/popover.js +1 -1
  77. package/dist/esm/components/radio-group.js +1 -1
  78. package/dist/esm/components/radio.js +1 -1
  79. package/dist/esm/components/select.js +1 -1
  80. package/dist/esm/components/sheet.d.ts +7 -4
  81. package/dist/esm/components/sheet.d.ts.map +1 -1
  82. package/dist/esm/components/sheet.js +1 -1
  83. package/dist/esm/components/sidebar.js +1 -1
  84. package/dist/esm/components/slider.js +1 -1
  85. package/dist/esm/components/switch.js +1 -1
  86. package/dist/esm/components/tabs.js +1 -1
  87. package/dist/esm/components/text-area.js +1 -1
  88. package/dist/esm/components/text-field.js +1 -1
  89. package/dist/esm/components/theme.js +1 -1
  90. package/dist/esm/components/toggle.js +1 -1
  91. package/dist/esm/components/toolbar.js +1 -1
  92. package/dist/esm/components/tooltip.js +1 -1
  93. package/dist/esm/index.js +1 -1
  94. package/package.json +1 -5
  95. package/src/components/_internal/base-dialog.css +15 -0
  96. package/src/components/_internal/use-close-warning.ts +38 -0
  97. package/src/components/dialog.tsx +6 -1
  98. package/src/components/sheet.tsx +11 -5
  99. package/styles.css +12 -0
  100. package/dist/esm/chunk-QV66TN2A.js +0 -3
  101. package/dist/esm/chunk-QV66TN2A.js.map +0 -7
  102. package/dist/esm/chunk-XVN43IZL.js +0 -3
  103. package/dist/esm/chunk-XVN43IZL.js.map +0 -7
  104. /package/dist/esm/{chunk-HGF4CKRY.js.map → chunk-3ZBEWLSO.js.map} +0 -0
  105. /package/dist/esm/{chunk-26O4RBOJ.js.map → chunk-5BABJBV3.js.map} +0 -0
  106. /package/dist/esm/{chunk-5APRBJRR.js.map → chunk-5GTQXMS2.js.map} +0 -0
  107. /package/dist/esm/{chunk-LR4X7SVV.js.map → chunk-5RLGDXOM.js.map} +0 -0
  108. /package/dist/esm/{chunk-SGKLJDA3.js.map → chunk-74JANLVU.js.map} +0 -0
  109. /package/dist/esm/{chunk-TUZ665BA.js.map → chunk-7E3ZOVRL.js.map} +0 -0
  110. /package/dist/esm/{chunk-OMPLFDS6.js.map → chunk-ASBTPKH3.js.map} +0 -0
  111. /package/dist/esm/{chunk-JFJV4HL3.js.map → chunk-CFXFWIRM.js.map} +0 -0
  112. /package/dist/esm/{chunk-YLGIP3A5.js.map → chunk-CJZGEHVB.js.map} +0 -0
  113. /package/dist/esm/{chunk-TRJAVWCK.js.map → chunk-DNY4WWZF.js.map} +0 -0
  114. /package/dist/esm/{chunk-C6VGCYFQ.js.map → chunk-E6MOZSYV.js.map} +0 -0
  115. /package/dist/esm/{chunk-Y5ITMKC6.js.map → chunk-G7S2BMS3.js.map} +0 -0
  116. /package/dist/esm/{chunk-SR42NATX.js.map → chunk-GHIHF55B.js.map} +0 -0
  117. /package/dist/esm/{chunk-D42VCLKH.js.map → chunk-ICO5ULJL.js.map} +0 -0
  118. /package/dist/esm/{chunk-KBSH6CBD.js.map → chunk-IN6D33TU.js.map} +0 -0
  119. /package/dist/esm/{chunk-FYZXC7AL.js.map → chunk-JJVAVLCN.js.map} +0 -0
  120. /package/dist/esm/{chunk-R4DMVTM3.js.map → chunk-M6THDAMU.js.map} +0 -0
  121. /package/dist/esm/{chunk-VBF3XALY.js.map → chunk-MS2ONKJJ.js.map} +0 -0
  122. /package/dist/esm/{chunk-XFMAA4MD.js.map → chunk-NJG42JDM.js.map} +0 -0
  123. /package/dist/esm/{chunk-NJ7RQYLX.js.map → chunk-OIJQSUUM.js.map} +0 -0
  124. /package/dist/esm/{chunk-VYF6KKYM.js.map → chunk-ONJYRJ66.js.map} +0 -0
  125. /package/dist/esm/{chunk-UH6CJXHY.js.map → chunk-QPGW6RJG.js.map} +0 -0
  126. /package/dist/esm/{chunk-X4PWBFOT.js.map → chunk-SIYOLE6P.js.map} +0 -0
  127. /package/dist/esm/{chunk-QBONJMSE.js.map → chunk-VRQK7U7J.js.map} +0 -0
  128. /package/dist/esm/{chunk-TANYRHGP.js.map → chunk-W3X4N4JE.js.map} +0 -0
  129. /package/dist/esm/{chunk-OPYTQ34H.js.map → chunk-W4CPV4PO.js.map} +0 -0
  130. /package/dist/esm/{chunk-YLPCYCYA.js.map → chunk-WT4IDG2W.js.map} +0 -0
  131. /package/dist/esm/{chunk-FVRVBB6O.js.map → chunk-YOZXIUZY.js.map} +0 -0
  132. /package/dist/esm/{chunk-OGVKMDO7.js.map → chunk-YRCXTCIT.js.map} +0 -0
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as g}from"./chunk-FATCGZZE.js";import{a as f}from"./chunk-OBSZOD5M.js";import{b as C}from"./chunk-3RJVW6RK.js";import{a}from"./chunk-TGRHRMQI.js";import{a as d}from"./chunk-FICBVI4M.js";import{a as h}from"./chunk-HGF4CKRY.js";import{c}from"./chunk-5ON3XLRD.js";import{a as P}from"./chunk-4KBKS3ZE.js";import{c as m}from"./chunk-OKQAVYW4.js";import{a as W}from"./chunk-VQPANPMI.js";var j={};W(j,{Close:()=>E,Content:()=>y,Description:()=>T,Root:()=>S,Title:()=>D,Trigger:()=>R});import*as e from"react";import k from"classnames";import{Dialog as i}from"radix-ui";var S=t=>e.createElement(i.Root,{...t,modal:!0});S.displayName="Sheet.Root";var R=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Trigger,{...o,ref:r,asChild:!0},a(t)));R.displayName="Sheet.Trigger";var{align:Y,...w}=g,u=w,B={Title:({children:t})=>e.createElement(i.Title,{asChild:!0},t),Close:({children:t})=>e.createElement(i.Close,{asChild:!0},t)},v=e.createContext(null),y=e.forwardRef((t,o)=>{let{side:r="start",forceMount:s,container:n,className:N,...x}=t,b=c(x,u.size),H={left:"start",right:"end",start:"start",end:"end",top:"top",bottom:"bottom"}[r],{className:O,...l}=m(b,u),z=e.useRef(0),M=e.useCallback(p=>{typeof o=="function"?o(p):o&&(o.current=p)},[o]);return C(),e.createElement(i.Portal,{container:n,forceMount:s},e.createElement(v.Provider,{value:z},e.createElement(h,{asChild:!0},e.createElement(i.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay kui-SheetOverlay"},e.createElement(i.Content,{...l,ref:M,className:k("kui-BaseDialogContent","kui-SheetContent",N,O),"data-side":H,"aria-modal":"true",children:e.createElement(P.Provider,{value:B},l.children)})))))});y.displayName="Sheet.Content";var D=e.forwardRef(({size:t="4",weight:o="medium",...r},s)=>{let n=e.useContext(v);return e.useLayoutEffect(()=>{if(n)return n.current+=1,()=>{n.current-=1}},[n]),e.createElement(i.Title,{asChild:!0},e.createElement(f,{ref:s,size:t,weight:o,...r}))});D.displayName="Sheet.Title";var T=e.forwardRef(({size:t="2",emphasis:o="medium",...r},s)=>e.createElement(i.Description,{asChild:!0},e.createElement(d,{ref:s,size:t,emphasis:o,...r})));T.displayName="Sheet.Description";var E=e.forwardRef(({children:t,...o},r)=>e.createElement(i.Close,{...o,ref:r,asChild:!0},a(t)));E.displayName="Sheet.Close";export{S as a,R as b,y as c,D as d,T as e,E as f,j as g};
3
- //# sourceMappingURL=chunk-QV66TN2A.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/sheet.tsx"],
4
- "sourcesContent": ["'use client';\n\n/**\n * Sheet\n *\n * A side-placed overlay built on top of Radix Dialog. It inherits accessibility,\n * focus management, overlay behavior, and sizing scales from the base dialog, and\n * adds side placement, suited for navigation panels and drawers.\n *\n * Structure mirrors Dialog:\n * - Root, Trigger, Content, Title, Description, Close\n *\n * Notes\n * - Side: set with `side` on `Sheet.Content`. Aliases: `left` \u2192 `start`, `right` \u2192 `end`.\n * - Sizing: reuses Dialog content prop defs (width/min/max/height/size). Size follows the\n * Theme size; start/end sheets cap at the size's overlay width unless maxWidth is set.\n * - A11y: provide an accessible name via `Sheet.Title` or `aria-label` on `Sheet.Content`.\n * Radix owns the focus trap, initial focus and the return of focus to the trigger.\n *\n * Example\n * <Sheet.Root>\n * <Sheet.Trigger>\n * <Button>Open</Button>\n * </Sheet.Trigger>\n * <Sheet.Content side=\"end\" width={{ initial: '280px', md: '360px' }}>\n * <Sheet.Title>Details</Sheet.Title>\n * ...\n * <Sheet.Close>\n * <Button>Close</Button>\n * </Sheet.Close>\n * </Sheet.Content>\n * </Sheet.Root>\n */\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { NavigatorHostContext, type NavigatorHost } from './_internal/navigator-host.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { HeadingProps } from './heading.js';\n\n/**\n * Supported sides for the Sheet.\n * Aliases are normalized RTL-aware: `left` \u2192 `start`, `right` \u2192 `end`.\n */\ntype SheetSide = 'start' | 'end' | 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Sheet is a side-placed overlay built on the Dialog primitive.\n * It reuses Dialog's accessibility, focus, overlay, and size scales, while adding side placement.\n */\n\n// Root\n/**\n * Props for `Sheet.Root` (Radix Dialog root with `modal` forced on).\n */\ninterface SheetRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst Root: React.FC<SheetRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nRoot.displayName = 'Sheet.Root';\n\n// Trigger\n/** Element type for `Sheet.Trigger`. */\ntype SheetTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\n/** Props for `Sheet.Trigger` (expects a single element child). */\ninterface SheetTriggerProps extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst Trigger = React.forwardRef<SheetTriggerElement, SheetTriggerProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Trigger {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n));\nTrigger.displayName = 'Sheet.Trigger';\n\n// Content\n/** Element type for `Sheet.Content`. */\n// Reuse dialog content prop defs for size/width/height tokens.\n// Built once at module scope: `extractProps` memoises on the identity of the\n// prop def objects it is handed, so rebuilding these per render would recompile\n// them every time a sheet renders.\nconst { align: _alignPropDef, ...dialogPropDefsForSheet } = dialogContentPropDefs;\nconst sheetPropDefs = dialogPropDefsForSheet;\n\n/** What a Navigator screen in this panel uses: its title names the sheet, its close closes it. */\nconst sheetNavigatorHost: NavigatorHost = {\n Title: ({ children }) => <DialogPrimitive.Title asChild>{children}</DialogPrimitive.Title>,\n Close: ({ children }) => <DialogPrimitive.Close asChild>{children}</DialogPrimitive.Close>,\n};\n\n/** Counts the Sheet.Title elements mounted inside a Sheet.Content, for the dev-only name check. */\nconst SheetTitleCountContext = React.createContext<React.MutableRefObject<number> | null>(null);\n\ntype SheetContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface SheetContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n Omit<DialogContentOwnProps, 'align'> {\n /** Side where the Sheet should appear. `left`/`right` alias to `start`/`end`. */\n side?: SheetSide;\n /** Optional DOM container to portal into. Defaults to `document.body`. */\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\n\n/**\n * Renders the Sheet panel. Normalizes left/right to logical start/end and\n * forwards dialog sizing props. Provide an accessible name via `Sheet.Title`\n * or `aria-label`.\n */\nconst Content = React.forwardRef<SheetContentElement, SheetContentProps>((allProps, forwardedRef) => {\n const { side = 'start', forceMount, container, className, ...ownProps } = allProps;\n const restProps = useThemeSizeProps(ownProps, sheetPropDefs.size);\n const normalizedSideMap: Record<SheetSide, 'start' | 'end' | 'top' | 'bottom'> = {\n left: 'start',\n right: 'end',\n start: 'start',\n end: 'end',\n top: 'top',\n bottom: 'bottom',\n };\n const normalizedSide = normalizedSideMap[side];\n // Size/width/height class names come from the dialog defs \u2014 see `sheetPropDefs`.\n const { className: extractedClassName, ...contentProps } = extractProps(restProps, sheetPropDefs);\n\n // Dev-only a11y guard: the panel needs a name. A Sheet.Title anywhere inside counts it\n // in a layout effect, which runs before this ref is attached, so nesting doesn't matter.\n const titleCountRef = React.useRef(0);\n const combinedRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n if (process.env.NODE_ENV !== 'production' && node) {\n const hasName = titleCountRef.current > 0 || Boolean(node.getAttribute('aria-label')) || Boolean(node.getAttribute('aria-labelledby'));\n if (!hasName) {\n console.warn('Sheet.Content: Missing accessible name. Include Sheet.Title inside it or provide aria-label.');\n }\n }\n },\n [forwardedRef],\n );\n\n useBodyPointerEventsCleanup();\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <SheetTitleCountContext.Provider value={titleCountRef}>\n <PortalTheme asChild>\n <DialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-DialogOverlay kui-SheetOverlay\">\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('kui-BaseDialogContent', 'kui-SheetContent', className, extractedClassName)}\n data-side={normalizedSide}\n aria-modal=\"true\"\n children={<NavigatorHostContext.Provider value={sheetNavigatorHost}>{contentProps.children}</NavigatorHostContext.Provider>}\n />\n </DialogPrimitive.Overlay>\n </PortalTheme>\n </SheetTitleCountContext.Provider>\n </DialogPrimitive.Portal>\n );\n});\nContent.displayName = 'Sheet.Content';\n\n// Title - renders as Heading with sensible defaults\ntype SheetTitleElement = React.ElementRef<typeof Heading>;\ntype SheetTitleProps = HeadingProps;\n/** Accessible title for the Sheet. Renders as Heading with sensible defaults. */\nconst Title = React.forwardRef<SheetTitleElement, SheetTitleProps>(({ size = '4', weight = 'medium', ...props }, ref) => {\n const titleCountRef = React.useContext(SheetTitleCountContext);\n React.useLayoutEffect(() => {\n if (!titleCountRef) return;\n titleCountRef.current += 1;\n return () => {\n titleCountRef.current -= 1;\n };\n }, [titleCountRef]);\n return (\n <DialogPrimitive.Title asChild>\n <Heading ref={ref} size={size} weight={weight} {...props} />\n </DialogPrimitive.Title>\n );\n});\nTitle.displayName = 'Sheet.Title';\n\n// Description - renders as Text with sensible defaults\ntype SheetDescriptionElement = React.ElementRef<typeof Text>;\ntype SheetDescriptionProps = React.ComponentPropsWithoutRef<typeof Text>;\n/** Supplementary description text for Sheet content. Renders as Text with sensible defaults. */\nconst Description = React.forwardRef<SheetDescriptionElement, SheetDescriptionProps>(({ size = '2', emphasis = 'medium', ...rest }, ref) => (\n <DialogPrimitive.Description asChild>\n <Text ref={ref} size={size} emphasis={emphasis} {...rest} />\n </DialogPrimitive.Description>\n));\nDescription.displayName = 'Sheet.Description';\n\ntype SheetCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface SheetCloseProps extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\n/** Close button for the Sheet. Expects a single element child rendered via `asChild`. */\nconst Close = React.forwardRef<SheetCloseElement, SheetCloseProps>(({ children, ...props }, ref) => (\n <DialogPrimitive.Close {...props} ref={ref} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n));\nClose.displayName = 'Sheet.Close';\n\nexport { Root, Trigger, Content, Title, Description, Close };\nexport type {\n SheetRootProps as RootProps,\n SheetTriggerProps as TriggerProps,\n SheetContentProps as ContentProps,\n SheetTitleProps as TitleProps,\n SheetDescriptionProps as DescriptionProps,\n SheetCloseProps as CloseProps,\n};\n"],
5
- "mappings": ";sYAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAkCA,UAAYC,MAAW,QACvB,OAAOC,MAAgB,aACvB,OAAS,UAAUC,MAAuB,WAgC1C,IAAMC,EAAkCC,GAAU,gBAACC,EAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EACzFD,EAAK,YAAc,aAOnB,IAAMG,EAAgB,aAAmD,CAAC,CAAE,SAAAC,EAAU,GAAGH,CAAM,EAAGI,IAChG,gBAACH,EAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAClDC,EAAoBF,CAAQ,CAC/B,CACD,EACDD,EAAQ,YAAc,gBAQtB,GAAM,CAAE,MAAOI,EAAe,GAAGC,CAAuB,EAAIC,EACtDC,EAAgBF,EAGhBG,EAAoC,CACxC,MAAO,CAAC,CAAE,SAAAP,CAAS,IAAM,gBAACF,EAAgB,MAAhB,CAAsB,QAAO,IAAEE,C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AAWf,CAAsB,EAC7D,OAAM,kBAAgB,IAAM,CAC1B,GAAKe,EACL,OAAAA,EAAc,SAAW,EAClB,IAAM,CACXA,EAAc,SAAW,CAC3B,CACF,EAAG,CAACA,CAAa,CAAC,EAEhB,gBAACzB,EAAgB,MAAhB,CAAsB,QAAO,IAC5B,gBAACmC,EAAA,CAAQ,IAAKhC,EAAK,KAAM8B,EAAM,OAAQC,EAAS,GAAGnC,EAAO,CAC5D,CAEJ,CAAC,EACDiC,EAAM,YAAc,cAMpB,IAAMI,EAAoB,aAA2D,CAAC,CAAE,KAAAH,EAAO,IAAK,SAAAI,EAAW,SAAU,GAAGC,CAAK,EAAGnC,IAClI,gBAACH,EAAgB,YAAhB,CAA4B,QAAO,IAClC,gBAACuC,EAAA,CAAK,IAAKpC,EAAK,KAAM8B,EAAM,SAAUI,EAAW,GAAGC,EAAM,CAC5D,CACD,EACDF,EAAY,YAAc,oBAK1B,IAAMI,EAAc,aAA+C,CAAC,CAAE,SAAAtC,EAAU,GAAGH,CAAM,EAAGI,IAC1F,gBAACH,EAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKI,EAAK,QAAO,IAChDC,EAAoBF,CAAQ,CAC/B,CACD,EACDsC,EAAM,YAAc",
6
- "names": ["sheet_exports", "__export", "Close", "Content", "Description", "Root", "Title", "Trigger", "React", "classNames", "DialogPrimitive", "Root", "props", "DialogPrimitive", "Trigger", "children", "ref", "requireReactElement", "_alignPropDef", "dialogPropDefsForSheet", "dialogContentPropDefs", "sheetPropDefs", "sheetNavigatorHost", "SheetTitleCountContext", "Content", "allProps", "forwardedRef", "side", "forceMount", "container", "className", "ownProps", "restProps", "useThemeSizeProps", "normalizedSide", "extractedClassName", "contentProps", "extractProps", "titleCountRef", "combinedRef", "node", "useBodyPointerEventsCleanup", "PortalTheme", "classNames", "NavigatorHostContext", "Title", "size", "weight", "Heading", "Description", "emphasis", "rest", "Text", "Close"]
7
- }
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as m}from"./chunk-FATCGZZE.js";import{a as D}from"./chunk-OBSZOD5M.js";import{a as c,b as C}from"./chunk-3RJVW6RK.js";import{a as l}from"./chunk-TGRHRMQI.js";import{a as P}from"./chunk-FICBVI4M.js";import{a as g}from"./chunk-HGF4CKRY.js";import{c as n}from"./chunk-5ON3XLRD.js";import{a as p}from"./chunk-4KBKS3ZE.js";import{c as r}from"./chunk-OKQAVYW4.js";import{a as W}from"./chunk-VQPANPMI.js";var A={};W(A,{Close:()=>u,Content:()=>R,Description:()=>T,Root:()=>d,Title:()=>y,Trigger:()=>v});import*as o from"react";import B from"classnames";import{Dialog as i}from"radix-ui";var d=e=>o.createElement(i.Root,{...e,modal:!0});d.displayName="Dialog.Root";var v=o.forwardRef(({children:e,...t},a)=>o.createElement(i.Trigger,{...t,ref:a,asChild:!0},l(e)));v.displayName="Dialog.Trigger";var{align:O,...f}=m,S={align:O},z={Title:({children:e})=>o.createElement(i.Title,{asChild:!0},e),Close:({children:e})=>o.createElement(i.Close,{asChild:!0},e)},R=o.forwardRef(({align:e,...t},a)=>{let h=n(t,f.size),{className:N}=r({align:e},S),{className:E,forceMount:x,container:H,onCloseAutoFocus:k,...s}=r(h,f);return C(),o.createElement(i.Portal,{container:H,forceMount:x},o.createElement(g,{asChild:!0},o.createElement(i.Overlay,{className:"kui-BaseDialogOverlay kui-DialogOverlay"},o.createElement("div",{className:"kui-BaseDialogScroll kui-DialogScroll"},o.createElement("div",{className:`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${N}`},o.createElement(i.Content,{...s,ref:a,className:B("kui-BaseDialogContent","kui-DialogContent",E),children:o.createElement(p.Provider,{value:z},s.children),"aria-modal":"true",onCloseAutoFocus:w=>{k?.(w),c()}}))))))});R.displayName="Dialog.Content";var y=o.forwardRef((e,t)=>o.createElement(i.Title,{asChild:!0},o.createElement(D,{size:"5",trim:"start",...e,asChild:!1,ref:t})));y.displayName="Dialog.Title";var T=o.forwardRef((e,t)=>o.createElement(i.Description,{asChild:!0},o.createElement(P,{as:"p",size:"3",...e,asChild:!1,ref:t})));T.displayName="Dialog.Description";var u=o.forwardRef(({children:e,...t},a)=>o.createElement(i.Close,{...t,ref:a,asChild:!0},l(e)));u.displayName="Dialog.Close";export{d as a,v as b,R as c,y as d,T as e,u as f,A as g};
3
- //# sourceMappingURL=chunk-XVN43IZL.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/components/dialog.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\n\nimport { dialogContentPropDefs } from './dialog.props.js';\nimport { Heading } from './heading.js';\nimport { Text } from './text.js';\nimport { PortalTheme } from './_internal/portal-theme.js';\nimport { NavigatorHostContext, type NavigatorHost } from './_internal/navigator-host.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { useThemeSizeProps } from '../hooks/theme-size.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { releaseBodyPointerEvents, useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type { ComponentPropsWithout, RemovedProps, ComponentPropsAs } from '../helpers/component-props.js';\n\ninterface DialogRootProps extends ComponentPropsWithout<typeof DialogPrimitive.Root, 'modal'> {}\nconst DialogRoot: React.FC<DialogRootProps> = (props) => <DialogPrimitive.Root {...props} modal />;\nDialogRoot.displayName = 'Dialog.Root';\n\ntype DialogTriggerElement = React.ElementRef<typeof DialogPrimitive.Trigger>;\ninterface DialogTriggerProps extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n));\nDialogTrigger.displayName = 'Dialog.Trigger';\n\n// Split once at module scope. `extractProps` memoises on the identity of the\n// prop def objects it is handed, so rebuilding these per render would recompile\n// them on every render.\nconst { align: alignPropDef, ...contentPropDefs } = dialogContentPropDefs;\nconst alignPropDefs = { align: alignPropDef };\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>, DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\n/** What a Navigator screen in this panel uses: its title names the panel, its close closes it. */\nconst dialogNavigatorHost: NavigatorHost = {\n Title: ({ children }) => <DialogPrimitive.Title asChild>{children}</DialogPrimitive.Title>,\n Close: ({ children }) => <DialogPrimitive.Close asChild>{children}</DialogPrimitive.Close>,\n};\n\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(({ align, ...ownProps }, forwardedRef) => {\n const props = useThemeSizeProps(ownProps, contentPropDefs.size);\n const { className: alignClassName } = extractProps({ align }, alignPropDefs);\n\n const { className, forceMount, container, onCloseAutoFocus, ...contentProps } = extractProps(props, contentPropDefs);\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <PortalTheme asChild>\n <DialogPrimitive.Overlay className=\"kui-BaseDialogOverlay kui-DialogOverlay\">\n <div className=\"kui-BaseDialogScroll kui-DialogScroll\">\n <div className={`kui-BaseDialogScrollPadding kui-DialogScrollPadding ${alignClassName}`}>\n <DialogPrimitive.Content\n {...contentProps}\n ref={forwardedRef}\n className={classNames('kui-BaseDialogContent', 'kui-DialogContent', className)}\n children={<NavigatorHostContext.Provider value={dialogNavigatorHost}>{contentProps.children}</NavigatorHostContext.Provider>}\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Radix returns focus to the trigger unless the caller prevents it.\n onCloseAutoFocus?.(event);\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n releaseBodyPointerEvents();\n }}\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </PortalTheme>\n </DialogPrimitive.Portal>\n );\n});\nDialogContent.displayName = 'Dialog.Content';\n\ntype DialogTitleElement = React.ElementRef<typeof Heading>;\ntype DialogTitleProps = ComponentPropsWithout<typeof Heading, 'asChild'>;\nconst DialogTitle = React.forwardRef<DialogTitleElement, DialogTitleProps>((props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n));\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>((props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n));\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n));\nDialogClose.displayName = 'Dialog.Close';\n\nexport { DialogRoot as Root, DialogTrigger as Trigger, DialogContent as Content, DialogTitle as Title, DialogDescription as Description, DialogClose as Close };\n\nexport type {\n DialogRootProps as RootProps,\n DialogTriggerProps as TriggerProps,\n DialogContentProps as ContentProps,\n DialogTitleProps as TitleProps,\n DialogDescriptionProps as DescriptionProps,\n DialogCloseProps as CloseProps,\n};\n"],
5
- "mappings": ";uZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA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GAAGoB,EACJ,IAAKjB,EACL,UAAWoB,EAAW,wBAAyB,oBAAqBP,CAAS,EAC7E,SAAU,gBAACQ,EAAqB,SAArB,CAA8B,MAAOf,GAAsBW,EAAa,QAAS,EAC5F,aAAW,OACX,iBAAmBK,GAAU,CAE3BN,IAAmBM,CAAK,EAExBC,EAAyB,CAC3B,EACF,CACF,CACF,CACF,CACF,CACF,CAEJ,CAAC,EACDhB,EAAc,YAAc,iBAI5B,IAAMiB,EAAoB,aAAiD,CAAC5B,EAAOI,IACjF,gBAACH,EAAgB,MAAhB,CAAsB,QAAO,IAC5B,gBAAC4B,EAAA,CAAQ,KAAK,IAAI,KAAK,QAAS,GAAG7B,EAAO,QAAS,GAAO,IAAKI,EAAc,CAC/E,CACD,EACDwB,EAAY,YAAc,eAI1B,IAAME,EAA0B,aAA6D,CAAC9B,EAAOI,IACnG,gBAACH,EAAgB,YAAhB,CAA4B,QAAO,IAClC,gBAAC8B,EAAA,CAAK,GAAG,IAAI,KAAK,IAAK,GAAG/B,EAAO,QAAS,GAAO,IAAKI,EAAc,CACtE,CACD,EACD0B,EAAkB,YAAc,qBAIhC,IAAME,EAAoB,aAAiD,CAAC,CAAE,SAAA7B,EAAU,GAAGH,CAAM,EAAGI,IAClG,gBAACH,EAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKI,EAAc,QAAO,IACzDC,EAAoBF,CAAQ,CAC/B,CACD,EACD6B,EAAY,YAAc",
6
- "names": ["dialog_exports", "__export", "DialogClose", "DialogContent", "DialogDescription", "DialogRoot", "DialogTitle", "DialogTrigger", "React", "classNames", "DialogPrimitive", "DialogRoot", "props", "DialogPrimitive", "DialogTrigger", "children", "forwardedRef", "requireReactElement", "alignPropDef", "contentPropDefs", "dialogContentPropDefs", "alignPropDefs", "dialogNavigatorHost", "DialogContent", "align", "ownProps", "useThemeSizeProps", "alignClassName", "extractProps", "className", "forceMount", "container", "onCloseAutoFocus", "contentProps", "useBodyPointerEventsCleanup", "PortalTheme", "classNames", "NavigatorHostContext", "event", "releaseBodyPointerEvents", "DialogTitle", "Heading", "DialogDescription", "Text", "DialogClose"]
7
- }