@kushagradhawan/kookie-ui 0.1.47 → 0.1.49
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.
- package/components.css +858 -30
- package/dist/cjs/components/_internal/shell-bottom.d.ts +31 -0
- package/dist/cjs/components/_internal/shell-bottom.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-bottom.js +2 -0
- package/dist/cjs/components/_internal/shell-bottom.js.map +7 -0
- package/dist/cjs/components/_internal/shell-handles.d.ts +7 -0
- package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-handles.js +2 -0
- package/dist/cjs/components/_internal/shell-handles.js.map +7 -0
- package/dist/cjs/components/_internal/shell-inspector.d.ts +31 -0
- package/dist/cjs/components/_internal/shell-inspector.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-inspector.js +2 -0
- package/dist/cjs/components/_internal/shell-inspector.js.map +7 -0
- package/dist/cjs/components/_internal/shell-resize.d.ts +24 -0
- package/dist/cjs/components/_internal/shell-resize.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-resize.js +2 -0
- package/dist/cjs/components/_internal/shell-resize.js.map +7 -0
- package/dist/cjs/components/_internal/shell-sidebar.d.ts +37 -0
- package/dist/cjs/components/_internal/shell-sidebar.d.ts.map +1 -0
- package/dist/cjs/components/_internal/shell-sidebar.js +2 -0
- package/dist/cjs/components/_internal/shell-sidebar.js.map +7 -0
- package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
- package/dist/cjs/components/alert-dialog.js +1 -1
- package/dist/cjs/components/alert-dialog.js.map +2 -2
- package/dist/cjs/components/dialog.d.ts.map +1 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/schemas/index.d.ts +2 -0
- package/dist/cjs/components/schemas/index.d.ts.map +1 -1
- package/dist/cjs/components/schemas/index.js +1 -1
- package/dist/cjs/components/schemas/index.js.map +3 -3
- package/dist/cjs/components/schemas/shell.schema.d.ts +1025 -0
- package/dist/cjs/components/schemas/shell.schema.d.ts.map +1 -0
- package/dist/cjs/components/schemas/shell.schema.js +2 -0
- package/dist/cjs/components/schemas/shell.schema.js.map +7 -0
- package/dist/cjs/components/shell.context.d.ts +37 -0
- package/dist/cjs/components/shell.context.d.ts.map +1 -0
- package/dist/cjs/components/shell.context.js +2 -0
- package/dist/cjs/components/shell.context.js.map +7 -0
- package/dist/cjs/components/shell.d.ts +6 -68
- package/dist/cjs/components/shell.d.ts.map +1 -1
- package/dist/cjs/components/shell.hooks.d.ts +3 -0
- package/dist/cjs/components/shell.hooks.d.ts.map +1 -0
- package/dist/cjs/components/shell.hooks.js +2 -0
- package/dist/cjs/components/shell.hooks.js.map +7 -0
- package/dist/cjs/components/shell.js +1 -1
- package/dist/cjs/components/shell.js.map +3 -3
- package/dist/cjs/components/shell.types.d.ts +20 -0
- package/dist/cjs/components/shell.types.d.ts.map +1 -0
- package/dist/cjs/components/shell.types.js +2 -0
- package/dist/cjs/components/shell.types.js.map +7 -0
- package/dist/cjs/components/sidebar.d.ts +1 -1
- package/dist/cjs/components/sidebar.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.js +1 -1
- package/dist/cjs/components/sidebar.js.map +3 -3
- package/dist/esm/components/_internal/shell-bottom.d.ts +31 -0
- package/dist/esm/components/_internal/shell-bottom.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-bottom.js +2 -0
- package/dist/esm/components/_internal/shell-bottom.js.map +7 -0
- package/dist/esm/components/_internal/shell-handles.d.ts +7 -0
- package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-handles.js +2 -0
- package/dist/esm/components/_internal/shell-handles.js.map +7 -0
- package/dist/esm/components/_internal/shell-inspector.d.ts +31 -0
- package/dist/esm/components/_internal/shell-inspector.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-inspector.js +2 -0
- package/dist/esm/components/_internal/shell-inspector.js.map +7 -0
- package/dist/esm/components/_internal/shell-resize.d.ts +24 -0
- package/dist/esm/components/_internal/shell-resize.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-resize.js +2 -0
- package/dist/esm/components/_internal/shell-resize.js.map +7 -0
- package/dist/esm/components/_internal/shell-sidebar.d.ts +37 -0
- package/dist/esm/components/_internal/shell-sidebar.d.ts.map +1 -0
- package/dist/esm/components/_internal/shell-sidebar.js +2 -0
- package/dist/esm/components/_internal/shell-sidebar.js.map +7 -0
- package/dist/esm/components/alert-dialog.d.ts.map +1 -1
- package/dist/esm/components/alert-dialog.js +1 -1
- package/dist/esm/components/alert-dialog.js.map +2 -2
- package/dist/esm/components/dialog.d.ts.map +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +2 -2
- package/dist/esm/components/schemas/index.d.ts +2 -0
- package/dist/esm/components/schemas/index.d.ts.map +1 -1
- package/dist/esm/components/schemas/index.js +1 -1
- package/dist/esm/components/schemas/index.js.map +3 -3
- package/dist/esm/components/schemas/shell.schema.d.ts +1025 -0
- package/dist/esm/components/schemas/shell.schema.d.ts.map +1 -0
- package/dist/esm/components/schemas/shell.schema.js +2 -0
- package/dist/esm/components/schemas/shell.schema.js.map +7 -0
- package/dist/esm/components/shell.context.d.ts +37 -0
- package/dist/esm/components/shell.context.d.ts.map +1 -0
- package/dist/esm/components/shell.context.js +2 -0
- package/dist/esm/components/shell.context.js.map +7 -0
- package/dist/esm/components/shell.d.ts +6 -68
- package/dist/esm/components/shell.d.ts.map +1 -1
- package/dist/esm/components/shell.hooks.d.ts +3 -0
- package/dist/esm/components/shell.hooks.d.ts.map +1 -0
- package/dist/esm/components/shell.hooks.js +2 -0
- package/dist/esm/components/shell.hooks.js.map +7 -0
- package/dist/esm/components/shell.js +1 -1
- package/dist/esm/components/shell.js.map +3 -3
- package/dist/esm/components/shell.types.d.ts +20 -0
- package/dist/esm/components/shell.types.d.ts.map +1 -0
- package/dist/esm/components/shell.types.js +2 -0
- package/dist/esm/components/shell.types.js.map +7 -0
- package/dist/esm/components/sidebar.d.ts +1 -1
- package/dist/esm/components/sidebar.d.ts.map +1 -1
- package/dist/esm/components/sidebar.js +1 -1
- package/dist/esm/components/sidebar.js.map +2 -2
- package/layout/utilities.css +168 -84
- package/layout.css +168 -84
- package/package.json +2 -1
- package/schemas/base-button.json +1 -1
- package/schemas/button.json +1 -1
- package/schemas/icon-button.json +1 -1
- package/schemas/index.json +6 -6
- package/schemas/shell-bottom.json +168 -0
- package/schemas/shell-content.json +34 -0
- package/schemas/shell-handle.json +34 -0
- package/schemas/shell-header.json +42 -0
- package/schemas/shell-inspector.json +171 -0
- package/schemas/shell-panel.json +167 -0
- package/schemas/shell-rail.json +132 -0
- package/schemas/shell-root.json +54 -0
- package/schemas/shell-sidebar.json +182 -0
- package/schemas/shell-trigger.json +76 -0
- package/schemas/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/shell-bottom.tsx +251 -0
- package/src/components/_internal/shell-handles.tsx +193 -0
- package/src/components/_internal/shell-inspector.tsx +242 -0
- package/src/components/_internal/shell-resize.tsx +30 -0
- package/src/components/_internal/shell-sidebar.tsx +347 -0
- package/src/components/alert-dialog.tsx +6 -0
- package/src/components/dialog.tsx +6 -0
- package/src/components/schemas/index.ts +46 -0
- package/src/components/schemas/shell.schema.ts +403 -0
- package/src/components/shell.context.tsx +56 -0
- package/src/components/shell.css +5 -17
- package/src/components/shell.hooks.ts +31 -0
- package/src/components/shell.tsx +368 -1684
- package/src/components/shell.types.ts +27 -0
- package/src/components/sidebar.tsx +1 -1
- package/src/styles/tokens/blur.css +2 -2
- package/src/styles/tokens/color.css +2 -2
- package/styles.css +1031 -116
- package/tokens/base.css +5 -2
- package/tokens.css +5 -2
- package/utilities.css +168 -84
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} 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\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\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>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,EAAsB,sBACtBC,EAA6B,uCAC7BC,EAAoC,+CACpCC,EAA4C,uDAU5C,MAAMb,EAAyCc,GAAUV,EAAA,cAAC,EAAAW,OAAgB,KAAhB,CAAsB,GAAGD,EAAO,MAAK,GAAC,EAChGd,EAAW,YAAc,cAKzB,MAAME,EAAgBE,EAAM,WAC1B,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAyB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OAC3D,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAc,YAAc,iBAQ5B,MAAMJ,EAAgBM,EAAM,WAC1B,CAAC,CAAE,MAAAc,EAAO,GAAGJ,CAAM,EAAGG,IAAiB,CACrC,KAAM,CACJ,MAAOE,EACP,gBAAiBC,EACjB,SAAUC,EACV,GAAGC,CACL,EAAI,wBAEE,CAAE,UAAWC,CAAe,KAAI,gBAAa,CAAE,MA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IAAM,CACXF,EAAQ,oBAAoB,UAAWI,CAAa,CACtD,CACF,EAAG,CAAC,CAAC,EAGHpC,EAAA,cAAC,EAAAW,OAAgB,OAAhB,CAAuB,UAAWc,EAAW,WAAYD,GACxDxB,EAAA,cAAC,SAAM,QAAO,IACZA,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CAAwB,UAAU,yCACjCX,EAAA,cAAC,OAAI,UAAU,uCACbA,EAAA,cAAC,OACC,UAAW,qDAAqDmB,CAAc,IAE9EnB,EAAA,cAAC,EAAAW,OAAgB,QAAhB,CACE,GAAGiB,EACJ,IAAKE,EACL,aAAW,EAAAQ,SAAW,uBAAwB,mBAAoBf,CAAS,EAC3E,gBAAeD,EACf,wBAAuBA,EACvB,SAAU,GACV,KAAK,SACL,aAAW,
|
|
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 { Theme } from './theme.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\nimport { useBodyPointerEventsCleanup } from '../hooks/use-body-pointer-events-cleanup.js';\n\nimport type { DialogContentOwnProps } from './dialog.props.js';\nimport type {\n ComponentPropsWithout,\n RemovedProps,\n ComponentPropsAs,\n} 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\n extends ComponentPropsWithout<typeof DialogPrimitive.Trigger, RemovedProps> {}\nconst DialogTrigger = React.forwardRef<DialogTriggerElement, DialogTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Trigger>\n ),\n);\nDialogTrigger.displayName = 'Dialog.Trigger';\n\ntype DialogContentElement = React.ElementRef<typeof DialogPrimitive.Content>;\ninterface DialogContentProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Content, RemovedProps>,\n DialogContentOwnProps {\n container?: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];\n}\nconst DialogContent = React.forwardRef<DialogContentElement, DialogContentProps>(\n ({ align, ...props }, forwardedRef) => {\n const {\n align: alignPropDef,\n panelBackground: panelBackgroundPropDef,\n material: materialPropDef,\n ...propDefs\n } = dialogContentPropDefs;\n\n const { className: alignClassName } = extractProps({ align }, { align: alignPropDef });\n\n // Extract panelBackground and material from props\n const { panelBackground: extractedPanelBackground } = extractProps(\n { panelBackground: props.panelBackground },\n { panelBackground: panelBackgroundPropDef },\n );\n\n const { material: extractedMaterial } = extractProps(\n { material: props.material },\n { material: materialPropDef },\n );\n\n // Handle material prop with panelBackground fallback\n const materialValue = React.useMemo(() => {\n if (extractedMaterial !== undefined) {\n console.warn(\n 'Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.',\n );\n }\n return extractedMaterial ?? extractedPanelBackground;\n }, [extractedMaterial, extractedPanelBackground]);\n\n const {\n className,\n forceMount,\n container,\n panelBackground: _,\n material: __,\n ...contentProps\n } = extractProps(props, propDefs);\n\n // Focus management\n const contentRef = React.useRef<HTMLDivElement>(null);\n const combinedRef = React.useMemo(\n () => (node: HTMLDivElement | null) => {\n contentRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n\n // Cleanup stuck pointer-events on body\n useBodyPointerEventsCleanup();\n\n // Focus trap effect\n React.useEffect(() => {\n // SSR safety - only run on client\n if (typeof window === 'undefined') return;\n\n const content = contentRef.current;\n if (!content) return;\n\n const focusableElements = content.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n\n if (focusableElements.length === 0) return;\n\n const firstElement = focusableElements[0] as HTMLElement;\n const lastElement = focusableElements[focusableElements.length - 1] as HTMLElement;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n } else {\n if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n }\n }\n };\n\n content.addEventListener('keydown', handleKeyDown);\n\n // Focus first element when dialog opens\n firstElement.focus();\n\n return () => {\n content.removeEventListener('keydown', handleKeyDown);\n };\n }, []);\n\n return (\n <DialogPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DialogPrimitive.Overlay className=\"rt-BaseDialogOverlay rt-DialogOverlay\">\n <div className=\"rt-BaseDialogScroll rt-DialogScroll\">\n <div\n className={`rt-BaseDialogScrollPadding rt-DialogScrollPadding ${alignClassName}`}\n >\n <DialogPrimitive.Content\n {...contentProps}\n ref={combinedRef}\n className={classNames('rt-BaseDialogContent', 'rt-DialogContent', className)}\n data-material={materialValue}\n data-panel-background={materialValue}\n tabIndex={-1}\n role=\"dialog\"\n aria-modal=\"true\"\n onCloseAutoFocus={(event) => {\n // Prevent default focus behavior\n event.preventDefault();\n // Restore pointer-events to body (Radix UI fix for issue #1241)\n document.body.style.pointerEvents = '';\n }}\n />\n {/* ARIA live region for screen reader announcements */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"rt-sr-only\"\n id=\"dialog-announcement\"\n />\n </div>\n </div>\n </DialogPrimitive.Overlay>\n </Theme>\n </DialogPrimitive.Portal>\n );\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>(\n (props, forwardedRef) => (\n <DialogPrimitive.Title asChild>\n <Heading size=\"5\" mb=\"3\" trim=\"start\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Title>\n ),\n);\nDialogTitle.displayName = 'Dialog.Title';\n\ntype DialogDescriptionElement = HTMLParagraphElement;\ntype DialogDescriptionProps = ComponentPropsAs<typeof Text, 'p'>;\nconst DialogDescription = React.forwardRef<DialogDescriptionElement, DialogDescriptionProps>(\n (props, forwardedRef) => (\n <DialogPrimitive.Description asChild>\n <Text as=\"p\" size=\"3\" {...props} asChild={false} ref={forwardedRef} />\n </DialogPrimitive.Description>\n ),\n);\nDialogDescription.displayName = 'Dialog.Description';\n\ntype DialogCloseElement = React.ElementRef<typeof DialogPrimitive.Close>;\ninterface DialogCloseProps\n extends ComponentPropsWithout<typeof DialogPrimitive.Close, RemovedProps> {}\nconst DialogClose = React.forwardRef<DialogCloseElement, DialogCloseProps>(\n ({ children, ...props }, forwardedRef) => (\n <DialogPrimitive.Close {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DialogPrimitive.Close>\n ),\n);\nDialogClose.displayName = 'Dialog.Close';\n\nexport {\n DialogRoot as Root,\n DialogTrigger as Trigger,\n DialogContent as Content,\n DialogTitle as Title,\n DialogDescription as Description,\n DialogClose as Close,\n};\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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA0C,oBAE1CC,EAAsC,6BACtCC,EAAwB,wBACxBC,EAAqB,qBACrBC,E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V,GAAG,sBACL,CACF,CACF,CACF,CACF,CACF,CAEJ,CACF,EACAN,EAAc,YAAc,iBAI5B,MAAMG,EAAcG,EAAM,WACxB,CAACU,EAAOG,IACNb,EAAA,cAAC,EAAAW,OAAgB,MAAhB,CAAsB,QAAO,IAC5BX,EAAA,cAAC,WAAQ,KAAK,IAAI,GAAG,IAAI,KAAK,QAAS,GAAGU,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtF,CAEJ,EACAhB,EAAY,YAAc,eAI1B,MAAMF,EAAoBK,EAAM,WAC9B,CAACU,EAAOG,IACNb,EAAA,cAAC,EAAAW,OAAgB,YAAhB,CAA4B,QAAO,IAClCX,EAAA,cAAC,QAAK,GAAG,IAAI,KAAK,IAAK,GAAGU,EAAO,QAAS,GAAO,IAAKG,EAAc,CACtE,CAEJ,EACAlB,EAAkB,YAAc,qBAKhC,MAAMF,EAAcO,EAAM,WACxB,CAAC,CAAE,SAAAY,EAAU,GAAGF,CAAM,EAAGG,IACvBb,EAAA,cAAC,EAAAW,OAAgB,MAAhB,CAAuB,GAAGD,EAAO,IAAKG,EAAc,QAAO,OACzD,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAnB,EAAY,YAAc",
|
|
6
6
|
"names": ["dialog_exports", "__export", "DialogClose", "DialogContent", "DialogDescription", "DialogRoot", "DialogTitle", "DialogTrigger", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_dialog_props", "import_heading", "import_text", "import_theme", "import_extract_props", "import_require_react_element", "import_use_body_pointer_events_cleanup", "props", "DialogPrimitive", "children", "forwardedRef", "align", "alignPropDef", "panelBackgroundPropDef", "materialPropDef", "propDefs", "alignClassName", "extractedPanelBackground", "extractedMaterial", "materialValue", "className", "forceMount", "container", "_", "__", "contentProps", "contentRef", "combinedRef", "node", "content", "focusableElements", "firstElement", "lastElement", "handleKeyDown", "event", "classNames"]
|
|
7
7
|
}
|
|
@@ -28,6 +28,8 @@ export { ToggleButtonSchema, parseToggleButtonProps } from './toggle-button.sche
|
|
|
28
28
|
export type { ToggleButtonProps } from './toggle-button.schema.js';
|
|
29
29
|
export { ToggleIconButtonSchema, parseToggleIconButtonProps } from './toggle-icon-button.schema.js';
|
|
30
30
|
export type { ToggleIconButtonProps } from './toggle-icon-button.schema.js';
|
|
31
|
+
export { ShellRootSchema, ShellHeaderSchema, ShellRailSchema, ShellPanelSchema, ShellSidebarSchema, ShellContentSchema, ShellInspectorSchema, ShellBottomSchema, ShellTriggerSchema, ShellHandleSchema, parseShellRootProps, parseShellHeaderProps, parseShellRailProps, parseShellPanelProps, parseShellSidebarProps, parseShellContentProps, parseShellInspectorProps, parseShellBottomProps, parseShellTriggerProps, parseShellHandleProps, } from './shell.schema.js';
|
|
32
|
+
export type { ShellRootProps, ShellHeaderProps, ShellRailProps, ShellPanelProps, ShellSidebarProps, ShellContentProps, ShellInspectorProps, ShellBottomProps, ShellTriggerProps, ShellHandleProps, PaneMode, SidebarMode, PresentationValue, Breakpoint, PaneTarget, TriggerAction, ResponsiveMode, ResponsiveSidebarMode, ResponsivePresentation, PaneSizePersistence, } from './shell.schema.js';
|
|
31
33
|
/**
|
|
32
34
|
* Generic parseProps helper for development-time validation
|
|
33
35
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC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BAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAKvE;AAED,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var S=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var g=(r,o)=>{for(var s in o)S(r,s,{get:o[s],enumerable:!0})},u=(r,o,s,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of c(o))!i.call(r,t)&&t!==s&&S(r,t,{get:()=>o[t],enumerable:!(m=P(o,t))||m.enumerable});return r};var B=r=>u(S({},"__esModule",{value:!0}),r);var f={};g(f,{BaseButtonSchema:()=>l.BaseButtonSchema,ButtonSchema:()=>p.ButtonSchema,IconButtonSchema:()=>a.IconButtonSchema,ShellBottomSchema:()=>e.ShellBottomSchema,ShellContentSchema:()=>e.ShellContentSchema,ShellHandleSchema:()=>e.ShellHandleSchema,ShellHeaderSchema:()=>e.ShellHeaderSchema,ShellInspectorSchema:()=>e.ShellInspectorSchema,ShellPanelSchema:()=>e.ShellPanelSchema,ShellRailSchema:()=>e.ShellRailSchema,ShellRootSchema:()=>e.ShellRootSchema,ShellSidebarSchema:()=>e.ShellSidebarSchema,ShellTriggerSchema:()=>e.ShellTriggerSchema,ToggleButtonSchema:()=>n.ToggleButtonSchema,ToggleIconButtonSchema:()=>h.ToggleIconButtonSchema,parseBaseButtonProps:()=>l.parseBaseButtonProps,parseButtonProps:()=>p.parseButtonProps,parseIconButtonProps:()=>a.parseIconButtonProps,parseProps:()=>d,parseShellBottomProps:()=>e.parseShellBottomProps,parseShellContentProps:()=>e.parseShellContentProps,parseShellHandleProps:()=>e.parseShellHandleProps,parseShellHeaderProps:()=>e.parseShellHeaderProps,parseShellInspectorProps:()=>e.parseShellInspectorProps,parseShellPanelProps:()=>e.parseShellPanelProps,parseShellRailProps:()=>e.parseShellRailProps,parseShellRootProps:()=>e.parseShellRootProps,parseShellSidebarProps:()=>e.parseShellSidebarProps,parseShellTriggerProps:()=>e.parseShellTriggerProps,parseToggleButtonProps:()=>n.parseToggleButtonProps,parseToggleIconButtonProps:()=>h.parseToggleIconButtonProps});module.exports=B(f);var l=require("./base-button.schema.js"),p=require("./button.schema.js"),a=require("./icon-button.schema.js"),n=require("./toggle-button.schema.js"),h=require("./toggle-icon-button.schema.js"),e=require("./shell.schema.js"),x=require("zod");function d(r,o){return o}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/schemas/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Button component schemas - Single source of truth for all button-related components\n *\n * This module exports Zod schemas for all button components, providing:\n * - Type-safe prop validation\n * - Machine-readable JSON schema generation\n * - Development-time prop validation\n * - Consistent API across all button variants\n *\n * @example\n * ```tsx\n * import { ButtonSchema, parseButtonProps } from './schemas';\n *\n * // Type-safe prop validation\n * const props = ButtonSchema.parse({ variant: 'solid', size: '2' });\n *\n * // Development-time validation\n * const validatedProps = parseButtonProps(userProps);\n * ```\n */\n\n// Base schemas\nexport { BaseButtonSchema, parseBaseButtonProps } from './base-button.schema.js';\nexport type { BaseButtonProps } from './base-button.schema.js';\n\n// Button schemas\nexport { ButtonSchema, parseButtonProps } from './button.schema.js';\nexport type { ButtonProps } from './button.schema.js';\n\n// IconButton schemas\nexport { IconButtonSchema, parseIconButtonProps } from './icon-button.schema.js';\nexport type { IconButtonProps } from './icon-button.schema.js';\n\n// ToggleButton schemas\nexport { ToggleButtonSchema, parseToggleButtonProps } from './toggle-button.schema.js';\nexport type { ToggleButtonProps } from './toggle-button.schema.js';\n\n// ToggleIconButton schemas\nexport { ToggleIconButtonSchema, parseToggleIconButtonProps } from './toggle-icon-button.schema.js';\nexport type { ToggleIconButtonProps } from './toggle-icon-button.schema.js';\n\n/**\n * Generic parseProps helper for development-time validation\n *\n * This function provides a type-safe way to validate props in development mode.\n * It should only be used in development as it adds runtime overhead.\n *\n * @param schema - Zod schema to validate against\n * @param props - Props to validate\n * @returns Validated and normalized props\n *\n * @example\n * ```tsx\n * import { parseProps } from './schemas';\n * import { ButtonSchema } from './schemas';\n *\n * // In development, this will validate props and show helpful errors\n * const validatedProps = parseProps(ButtonSchema, userProps);\n * ```\n */\nexport function parseProps<T>(schema: z.ZodSchema<T>, props: unknown): T {\n if (process.env.NODE_ENV === 'development') {\n return schema.parse(props);\n }\n return props as T;\n}\n\nimport { z } from 'zod';\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
|
6
|
-
"names": ["schemas_exports", "__export", "parseProps", "__toCommonJS", "import_base_button_schema", "import_button_schema", "import_icon_button_schema", "import_toggle_button_schema", "import_toggle_icon_button_schema", "import_zod", "schema", "props"]
|
|
4
|
+
"sourcesContent": ["/**\n * Button component schemas - Single source of truth for all button-related components\n *\n * This module exports Zod schemas for all button components, providing:\n * - Type-safe prop validation\n * - Machine-readable JSON schema generation\n * - Development-time prop validation\n * - Consistent API across all button variants\n *\n * @example\n * ```tsx\n * import { ButtonSchema, parseButtonProps } from './schemas';\n *\n * // Type-safe prop validation\n * const props = ButtonSchema.parse({ variant: 'solid', size: '2' });\n *\n * // Development-time validation\n * const validatedProps = parseButtonProps(userProps);\n * ```\n */\n\n// Base schemas\nexport { BaseButtonSchema, parseBaseButtonProps } from './base-button.schema.js';\nexport type { BaseButtonProps } from './base-button.schema.js';\n\n// Button schemas\nexport { ButtonSchema, parseButtonProps } from './button.schema.js';\nexport type { ButtonProps } from './button.schema.js';\n\n// IconButton schemas\nexport { IconButtonSchema, parseIconButtonProps } from './icon-button.schema.js';\nexport type { IconButtonProps } from './icon-button.schema.js';\n\n// ToggleButton schemas\nexport { ToggleButtonSchema, parseToggleButtonProps } from './toggle-button.schema.js';\nexport type { ToggleButtonProps } from './toggle-button.schema.js';\n\n// ToggleIconButton schemas\nexport { ToggleIconButtonSchema, parseToggleIconButtonProps } from './toggle-icon-button.schema.js';\nexport type { ToggleIconButtonProps } from './toggle-icon-button.schema.js';\n\n// Shell schemas\nexport {\n ShellRootSchema,\n ShellHeaderSchema,\n ShellRailSchema,\n ShellPanelSchema,\n ShellSidebarSchema,\n ShellContentSchema,\n ShellInspectorSchema,\n ShellBottomSchema,\n ShellTriggerSchema,\n ShellHandleSchema,\n parseShellRootProps,\n parseShellHeaderProps,\n parseShellRailProps,\n parseShellPanelProps,\n parseShellSidebarProps,\n parseShellContentProps,\n parseShellInspectorProps,\n parseShellBottomProps,\n parseShellTriggerProps,\n parseShellHandleProps,\n} from './shell.schema.js';\nexport type {\n ShellRootProps,\n ShellHeaderProps,\n ShellRailProps,\n ShellPanelProps,\n ShellSidebarProps,\n ShellContentProps,\n ShellInspectorProps,\n ShellBottomProps,\n ShellTriggerProps,\n ShellHandleProps,\n PaneMode,\n SidebarMode,\n PresentationValue,\n Breakpoint,\n PaneTarget,\n TriggerAction,\n ResponsiveMode,\n ResponsiveSidebarMode,\n ResponsivePresentation,\n PaneSizePersistence,\n} from './shell.schema.js';\n\n/**\n * Generic parseProps helper for development-time validation\n *\n * This function provides a type-safe way to validate props in development mode.\n * It should only be used in development as it adds runtime overhead.\n *\n * @param schema - Zod schema to validate against\n * @param props - Props to validate\n * @returns Validated and normalized props\n *\n * @example\n * ```tsx\n * import { parseProps } from './schemas';\n * import { ButtonSchema } from './schemas';\n *\n * // In development, this will validate props and show helpful errors\n * const validatedProps = parseProps(ButtonSchema, userProps);\n * ```\n */\nexport function parseProps<T>(schema: z.ZodSchema<T>, props: unknown): T {\n if (process.env.NODE_ENV === 'development') {\n return schema.parse(props);\n }\n return props as T;\n}\n\nimport { z } from 'zod';\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8wBAAAE,EAAA,unBAAAC,EAAAH,GAsBA,IAAAI,EAAuD,mCAIvDC,EAA+C,8BAI/CC,EAAuD,mCAIvDC,EAA2D,qCAI3DC,EAAmE,0CAInEC,EAqBO,6BAkDPC,EAAkB,eAPX,SAASR,EAAcS,EAAwBC,EAAmB,CAIvE,OAAOA,CACT",
|
|
6
|
+
"names": ["schemas_exports", "__export", "parseProps", "__toCommonJS", "import_base_button_schema", "import_button_schema", "import_icon_button_schema", "import_toggle_button_schema", "import_toggle_icon_button_schema", "import_shell_schema", "import_zod", "schema", "props"]
|
|
7
7
|
}
|