@kushagradhawan/kookie-ui 0.1.14 → 0.1.16
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 +1324 -131
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +2 -2
- package/dist/cjs/components/icons.d.ts +2 -1
- package/dist/cjs/components/icons.d.ts.map +1 -1
- package/dist/cjs/components/icons.js +1 -1
- package/dist/cjs/components/icons.js.map +3 -3
- package/dist/cjs/components/image.d.ts +23 -2
- package/dist/cjs/components/image.d.ts.map +1 -1
- package/dist/cjs/components/image.js +1 -1
- package/dist/cjs/components/image.js.map +3 -3
- package/dist/cjs/components/sidebar.d.ts +117 -42
- 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/cjs/components/sidebar.props.d.ts +17 -10
- package/dist/cjs/components/sidebar.props.d.ts.map +1 -1
- package/dist/cjs/components/sidebar.props.js +1 -1
- package/dist/cjs/components/sidebar.props.js.map +3 -3
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js.map +3 -3
- package/dist/esm/components/icons.d.ts +2 -1
- package/dist/esm/components/icons.d.ts.map +1 -1
- package/dist/esm/components/icons.js +1 -1
- package/dist/esm/components/icons.js.map +3 -3
- package/dist/esm/components/image.d.ts +23 -2
- package/dist/esm/components/image.d.ts.map +1 -1
- package/dist/esm/components/image.js +1 -1
- package/dist/esm/components/image.js.map +3 -3
- package/dist/esm/components/sidebar.d.ts +117 -42
- 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 +3 -3
- package/dist/esm/components/sidebar.props.d.ts +17 -10
- package/dist/esm/components/sidebar.props.d.ts.map +1 -1
- package/dist/esm/components/sidebar.props.js +1 -1
- package/dist/esm/components/sidebar.props.js.map +3 -3
- package/package.json +1 -1
- package/src/components/_internal/base-button.css +2 -9
- package/src/components/_internal/base-menu.css +2 -2
- package/src/components/button.css +2 -2
- package/src/components/dropdown-menu.tsx +2 -2
- package/src/components/icon-button.css +2 -2
- package/src/components/icons.tsx +18 -1
- package/src/components/image.css +5 -0
- package/src/components/image.tsx +173 -11
- package/src/components/sidebar.css +850 -54
- package/src/components/sidebar.props.tsx +15 -11
- package/src/components/sidebar.tsx +500 -367
- package/styles.css +1324 -131
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var z=Object.create;var w=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var J=(e,r)=>{for(var n in r)w(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of F(r))!H.call(e,t)&&t!==n&&w(e,t,{get:()=>r[t],enumerable:!(d=A(r,t))||d.enumerable});return e};var L=(e,r,n)=>(n=e!=null?z(q(e)):{},W(r||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),K=e=>W(w({},"__esModule",{value:!0}),e);var Q={};J(Q,{CheckboxItem:()=>x,Content:()=>b,Group:()=>v,Item:()=>R,Label:()=>y,RadioGroup:()=>S,RadioItem:()=>T,Root:()=>g,Separator:()=>B,Sub:()=>N,SubContent:()=>G,SubTrigger:()=>E,Trigger:()=>h,TriggerIcon:()=>k});module.exports=K(Q);var o=L(require("react")),s=L(require("classnames")),p=require("radix-ui"),C=require("./scroll-area.js"),i=require("./dropdown-menu.props.js"),M=require("./theme.js"),
|
|
1
|
+
"use strict";"use client";var z=Object.create;var w=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var J=(e,r)=>{for(var n in r)w(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of F(r))!H.call(e,t)&&t!==n&&w(e,t,{get:()=>r[t],enumerable:!(d=A(r,t))||d.enumerable});return e};var L=(e,r,n)=>(n=e!=null?z(q(e)):{},W(r||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),K=e=>W(w({},"__esModule",{value:!0}),e);var Q={};J(Q,{CheckboxItem:()=>x,Content:()=>b,Group:()=>v,Item:()=>R,Label:()=>y,RadioGroup:()=>S,RadioItem:()=>T,Root:()=>g,Separator:()=>B,Sub:()=>N,SubContent:()=>G,SubTrigger:()=>E,Trigger:()=>h,TriggerIcon:()=>k});module.exports=K(Q);var o=L(require("react")),s=L(require("classnames")),p=require("radix-ui"),C=require("./scroll-area.js"),i=require("./dropdown-menu.props.js"),M=require("./theme.js"),a=require("./icons.js"),I=require("../helpers/extract-props.js"),V=require("../helpers/require-react-element.js");const g=e=>o.createElement(p.DropdownMenu.Root,{...e});g.displayName="DropdownMenu.Root";const h=o.forwardRef(({children:e,...r},n)=>o.createElement(p.DropdownMenu.Trigger,{...r,ref:n,asChild:!0},(0,V.requireReactElement)(e)));h.displayName="DropdownMenu.Trigger";const O=o.createContext({}),b=o.forwardRef((e,r)=>{const n=(0,M.useThemeContext)(),{size:d=i.dropdownMenuContentPropDefs.size.default,variant:t=i.dropdownMenuContentPropDefs.variant.default,highContrast:u=i.dropdownMenuContentPropDefs.highContrast.default}=e,{className:m,children:D,color:c,container:l,forceMount:P,...j}=(0,I.extractProps)(e,i.dropdownMenuContentPropDefs),f=c||n.accentColor;return o.createElement(p.DropdownMenu.Portal,{container:l,forceMount:P},o.createElement(M.Theme,{asChild:!0},o.createElement(p.DropdownMenu.Content,{"data-accent-color":f,align:"start",sideOffset:4,collisionPadding:10,...j,asChild:!1,ref:r,className:(0,s.default)("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",m)},o.createElement(C.ScrollArea,{type:"auto"},o.createElement("div",{className:(0,s.default)("rt-BaseMenuViewport","rt-DropdownMenuViewport")},o.createElement(O.Provider,{value:o.useMemo(()=>({size:d,variant:t,color:f,highContrast:u}),[d,t,f,u])},D))))))});b.displayName="DropdownMenu.Content";const y=o.forwardRef(({className:e,...r},n)=>o.createElement(p.DropdownMenu.Label,{...r,asChild:!1,ref:n,className:(0,s.default)("rt-BaseMenuLabel","rt-DropdownMenuLabel",e)}));y.displayName="DropdownMenu.Label";const R=o.forwardRef((e,r)=>{const{className:n,children:d,color:t=i.dropdownMenuItemPropDefs.color.default,shortcut:u,...m}=e;return o.createElement(p.DropdownMenu.Item,{"data-accent-color":t,...m,ref:r,className:(0,s.default)("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",n)},o.createElement(p.Slot.Slottable,null,d),u&&o.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},u))});R.displayName="DropdownMenu.Item";const v=o.forwardRef(({className:e,...r},n)=>o.createElement(p.DropdownMenu.Group,{...r,asChild:!1,ref:n,className:(0,s.default)("rt-BaseMenuGroup","rt-DropdownMenuGroup",e)}));v.displayName="DropdownMenu.Group";const S=o.forwardRef(({className:e,...r},n)=>o.createElement(p.DropdownMenu.RadioGroup,{...r,asChild:!1,ref:n,className:(0,s.default)("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e)}));S.displayName="DropdownMenu.RadioGroup";const T=o.forwardRef((e,r)=>{const{children:n,className:d,color:t=i.dropdownMenuRadioItemPropDefs.color.default,...u}=e;return o.createElement(p.DropdownMenu.RadioItem,{...u,asChild:!1,ref:r,"data-accent-color":t,className:(0,s.default)("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",d)},n,o.createElement(p.DropdownMenu.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},o.createElement(a.ThickDotIcon,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});T.displayName="DropdownMenu.RadioItem";const x=o.forwardRef((e,r)=>{const{children:n,className:d,shortcut:t,color:u=i.dropdownMenuCheckboxItemPropDefs.color.default,...m}=e;return o.createElement(p.DropdownMenu.CheckboxItem,{...m,asChild:!1,ref:r,"data-accent-color":u,className:(0,s.default)("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",d)},n,o.createElement(p.DropdownMenu.ItemIndicator,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},o.createElement(a.ThickCheckIcon,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),t&&o.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},t))});x.displayName="DropdownMenu.CheckboxItem";const N=e=>o.createElement(p.DropdownMenu.Sub,{...e});N.displayName="DropdownMenu.Sub";const E=o.forwardRef((e,r)=>{const{className:n,children:d,...t}=e;return o.createElement(p.DropdownMenu.SubTrigger,{...t,asChild:!1,ref:r,className:(0,s.default)("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",n)},d,o.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},o.createElement(a.ThickChevronRightIcon,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});E.displayName="DropdownMenu.SubTrigger";const G=o.forwardRef((e,r)=>{const{size:n,variant:d,color:t,highContrast:u}=o.useContext(O),{className:m,children:D,container:c,forceMount:l,...P}=(0,I.extractProps)({size:n,variant:d,color:t,highContrast:u,...e},i.dropdownMenuContentPropDefs);return o.createElement(p.DropdownMenu.Portal,{container:c,forceMount:l},o.createElement(M.Theme,{asChild:!0},o.createElement(p.DropdownMenu.SubContent,{"data-accent-color":t,alignOffset:-Number(n)*4,sideOffset:1,collisionPadding:10,...P,asChild:!1,ref:r,className:(0,s.default)("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",m)},o.createElement(C.ScrollArea,{type:"auto"},o.createElement("div",{className:(0,s.default)("rt-BaseMenuViewport","rt-DropdownMenuViewport")},D)))))});G.displayName="DropdownMenu.SubContent";const B=o.forwardRef(({className:e,...r},n)=>o.createElement(p.DropdownMenu.Separator,{...r,asChild:!1,ref:n,className:(0,s.default)("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e)}));B.displayName="DropdownMenu.Separator";const k=o.forwardRef((e,r)=>o.createElement(a.ChevronDownIcon,{...e,ref:r,className:"rt-DropdownMenuTriggerIcon"}));k.displayName="DropdownMenu.TriggerIcon";
|
|
2
2
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dropdown-menu.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => (\n <DropdownMenuPrimitive.Root {...props} />\n);\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\ntype DropdownMenuContentOwnProps = GetPropDefTypes<typeof dropdownMenuContentPropDefs>;\ntype DropdownMenuContentContextValue = DropdownMenuContentOwnProps;\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuContentContextValue {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props, forwardedRef) => {\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n variant = dropdownMenuContentPropDefs.variant.default,\n highContrast = dropdownMenuContentPropDefs.highContrast.default,\n } = props;\n const { className, children, color, container, forceMount, ...contentProps } = extractProps(\n props,\n dropdownMenuContentPropDefs,\n );\n const resolvedColor = color || themeContext.accentColor;\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-DropdownMenuContent',\n className,\n )}\n >\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n <DropdownMenuContentContext.Provider\n value={React.useMemo(\n () => ({ size, variant, color: resolvedColor, highContrast }),\n [size, variant, resolvedColor, highContrast],\n )}\n >\n {children}\n </DropdownMenuContentContext.Provider>\n </div>\n </ScrollArea>\n </DropdownMenuPrimitive.Content>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuLabel', 'rt-DropdownMenuLabel', className)}\n />\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">{shortcut}</div>}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuGroup', 'rt-DropdownMenuGroup', className)}\n />\n ),\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuRadioGroup', 'rt-DropdownMenuRadioGroup', className)}\n />\n));\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuRadioItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuRadioItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuCheckboxItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuCheckboxItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">{shortcut}</div>}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = (props) => (\n <DropdownMenuPrimitive.Sub {...props} />\n);\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, ...subTriggerProps } = props;\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuSubTrigger',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps> {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const { size, variant, color, highContrast } = React.useContext(DropdownMenuContentContext);\n const { className, children, container, forceMount, ...subContentProps } = extractProps(\n { size, variant, color, highContrast, ...props },\n dropdownMenuContentPropDefs,\n );\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={-Number(size) * 4}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-BaseMenuSubContent',\n 'rt-DropdownMenuContent',\n 'rt-DropdownMenuSubContent',\n className,\n )}\n >\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n {children}\n </div>\n </ScrollArea>\n </DropdownMenuPrimitive.SubContent>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuSeparator', 'rt-DropdownMenuSeparator', className)}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>((props, forwardedRef) => (\n <ChevronDownIcon {...props} ref={forwardedRef} className=\"rt-DropdownMenuTriggerIcon\" />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n};\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,YAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,cAAAC,EAAA,SAAAC,EAAA,cAAAC,EAAA,QAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,YAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAhB,GAEA,IAAAiB,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA4D,oBAE5DC,EAA2B,4BAC3BC,EAKO,oCACPC,EAAuC,sBACvCC,
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { DropdownMenu as DropdownMenuPrimitive, Slot } from 'radix-ui';\n\nimport { ScrollArea } from './scroll-area.js';\nimport {\n dropdownMenuContentPropDefs,\n dropdownMenuItemPropDefs,\n dropdownMenuCheckboxItemPropDefs,\n dropdownMenuRadioItemPropDefs,\n} from './dropdown-menu.props.js';\nimport { Theme, useThemeContext } from './theme.js';\nimport { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon, ThickDotIcon } from './icons.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { requireReactElement } from '../helpers/require-react-element.js';\n\nimport type { IconProps } from './icons.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ninterface DropdownMenuRootProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {}\nconst DropdownMenuRoot: React.FC<DropdownMenuRootProps> = (props) => (\n <DropdownMenuPrimitive.Root {...props} />\n);\nDropdownMenuRoot.displayName = 'DropdownMenu.Root';\n\ntype DropdownMenuTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.Trigger>;\ninterface DropdownMenuTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Trigger, RemovedProps> {}\nconst DropdownMenuTrigger = React.forwardRef<DropdownMenuTriggerElement, DropdownMenuTriggerProps>(\n ({ children, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Trigger {...props} ref={forwardedRef} asChild>\n {requireReactElement(children)}\n </DropdownMenuPrimitive.Trigger>\n ),\n);\nDropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';\n\ntype DropdownMenuContentOwnProps = GetPropDefTypes<typeof dropdownMenuContentPropDefs>;\ntype DropdownMenuContentContextValue = DropdownMenuContentOwnProps;\nconst DropdownMenuContentContext = React.createContext<DropdownMenuContentContextValue>({});\ntype DropdownMenuContentElement = React.ElementRef<typeof DropdownMenuPrimitive.Content>;\ninterface DropdownMenuContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Content, RemovedProps>,\n DropdownMenuContentContextValue {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n}\nconst DropdownMenuContent = React.forwardRef<DropdownMenuContentElement, DropdownMenuContentProps>(\n (props, forwardedRef) => {\n const themeContext = useThemeContext();\n const {\n size = dropdownMenuContentPropDefs.size.default,\n variant = dropdownMenuContentPropDefs.variant.default,\n highContrast = dropdownMenuContentPropDefs.highContrast.default,\n } = props;\n const { className, children, color, container, forceMount, ...contentProps } = extractProps(\n props,\n dropdownMenuContentPropDefs,\n );\n const resolvedColor = color || themeContext.accentColor;\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.Content\n data-accent-color={resolvedColor}\n align=\"start\"\n sideOffset={4}\n collisionPadding={10}\n {...contentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-DropdownMenuContent',\n className,\n )}\n >\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n <DropdownMenuContentContext.Provider\n value={React.useMemo(\n () => ({ size, variant, color: resolvedColor, highContrast }),\n [size, variant, resolvedColor, highContrast],\n )}\n >\n {children}\n </DropdownMenuContentContext.Provider>\n </div>\n </ScrollArea>\n </DropdownMenuPrimitive.Content>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = 'DropdownMenu.Content';\n\ntype DropdownMenuLabelElement = React.ElementRef<typeof DropdownMenuPrimitive.Label>;\ninterface DropdownMenuLabelProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Label, RemovedProps> {}\nconst DropdownMenuLabel = React.forwardRef<DropdownMenuLabelElement, DropdownMenuLabelProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Label\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuLabel', 'rt-DropdownMenuLabel', className)}\n />\n ),\n);\nDropdownMenuLabel.displayName = 'DropdownMenu.Label';\n\ntype DropdownMenuItemElement = React.ElementRef<typeof DropdownMenuPrimitive.Item>;\ntype DropdownMenuItemOwnProps = GetPropDefTypes<typeof dropdownMenuItemPropDefs>;\ninterface DropdownMenuItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Item, RemovedProps>,\n DropdownMenuItemOwnProps {}\nconst DropdownMenuItem = React.forwardRef<DropdownMenuItemElement, DropdownMenuItemProps>(\n (props, forwardedRef) => {\n const {\n className,\n children,\n color = dropdownMenuItemPropDefs.color.default,\n shortcut,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.Item\n data-accent-color={color}\n {...itemProps}\n ref={forwardedRef}\n className={classNames('rt-reset', 'rt-BaseMenuItem', 'rt-DropdownMenuItem', className)}\n >\n <Slot.Slottable>{children}</Slot.Slottable>\n {shortcut && <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">{shortcut}</div>}\n </DropdownMenuPrimitive.Item>\n );\n },\n);\nDropdownMenuItem.displayName = 'DropdownMenu.Item';\n\ntype DropdownMenuGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.Group>;\ninterface DropdownMenuGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Group, RemovedProps> {}\nconst DropdownMenuGroup = React.forwardRef<DropdownMenuGroupElement, DropdownMenuGroupProps>(\n ({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Group\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuGroup', 'rt-DropdownMenuGroup', className)}\n />\n ),\n);\nDropdownMenuGroup.displayName = 'DropdownMenu.Group';\n\ntype DropdownMenuRadioGroupElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>;\ninterface DropdownMenuRadioGroupProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioGroup, RemovedProps> {}\nconst DropdownMenuRadioGroup = React.forwardRef<\n DropdownMenuRadioGroupElement,\n DropdownMenuRadioGroupProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuRadioGroup', 'rt-DropdownMenuRadioGroup', className)}\n />\n));\nDropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';\n\ntype DropdownMenuRadioItemElement = React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>;\ntype DropdownMenuRadioItemOwnProps = GetPropDefTypes<typeof dropdownMenuRadioItemPropDefs>;\ninterface DropdownMenuRadioItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.RadioItem, RemovedProps>,\n DropdownMenuRadioItemOwnProps {}\nconst DropdownMenuRadioItem = React.forwardRef<\n DropdownMenuRadioItemElement,\n DropdownMenuRadioItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n color = dropdownMenuRadioItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.RadioItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuRadioItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuRadioItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickDotIcon className=\"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </DropdownMenuPrimitive.RadioItem>\n );\n});\nDropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';\n\ntype DropdownMenuCheckboxItemElement = React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>;\ntype DropdownMenuCheckboxItemOwnProps = GetPropDefTypes<typeof dropdownMenuCheckboxItemPropDefs>;\ninterface DropdownMenuCheckboxItemProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.CheckboxItem, RemovedProps>,\n DropdownMenuCheckboxItemOwnProps {}\nconst DropdownMenuCheckboxItem = React.forwardRef<\n DropdownMenuCheckboxItemElement,\n DropdownMenuCheckboxItemProps\n>((props, forwardedRef) => {\n const {\n children,\n className,\n shortcut,\n color = dropdownMenuCheckboxItemPropDefs.color.default,\n ...itemProps\n } = props;\n return (\n <DropdownMenuPrimitive.CheckboxItem\n {...itemProps}\n asChild={false}\n ref={forwardedRef}\n data-accent-color={color}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuCheckboxItem',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuCheckboxItem',\n className,\n )}\n >\n {children}\n <DropdownMenuPrimitive.ItemIndicator className=\"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator\">\n <ThickCheckIcon className=\"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n {shortcut && <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">{shortcut}</div>}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\nDropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';\n\ninterface DropdownMenuSubProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Sub> {}\nconst DropdownMenuSub: React.FC<DropdownMenuSubProps> = (props) => (\n <DropdownMenuPrimitive.Sub {...props} />\n);\nDropdownMenuSub.displayName = 'DropdownMenu.Sub';\n\ntype DropdownMenuSubTriggerElement = React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>;\ninterface DropdownMenuSubTriggerProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubTrigger, RemovedProps> {}\nconst DropdownMenuSubTrigger = React.forwardRef<\n DropdownMenuSubTriggerElement,\n DropdownMenuSubTriggerProps\n>((props, forwardedRef) => {\n const { className, children, ...subTriggerProps } = props;\n return (\n <DropdownMenuPrimitive.SubTrigger\n {...subTriggerProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-BaseMenuItem',\n 'rt-BaseMenuSubTrigger',\n 'rt-DropdownMenuItem',\n 'rt-DropdownMenuSubTrigger',\n className,\n )}\n >\n {children}\n <div className=\"rt-BaseMenuShortcut rt-DropdownMenuShortcut\">\n <ThickChevronRightIcon className=\"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon\" />\n </div>\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\nDropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';\n\ntype DropdownMenuSubContentElement = React.ElementRef<typeof DropdownMenuPrimitive.SubContent>;\ninterface DropdownMenuSubContentProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.SubContent, RemovedProps> {\n container?: React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Portal>['container'];\n}\nconst DropdownMenuSubContent = React.forwardRef<\n DropdownMenuSubContentElement,\n DropdownMenuSubContentProps\n>((props, forwardedRef) => {\n const { size, variant, color, highContrast } = React.useContext(DropdownMenuContentContext);\n const { className, children, container, forceMount, ...subContentProps } = extractProps(\n { size, variant, color, highContrast, ...props },\n dropdownMenuContentPropDefs,\n );\n return (\n <DropdownMenuPrimitive.Portal container={container} forceMount={forceMount}>\n <Theme asChild>\n <DropdownMenuPrimitive.SubContent\n data-accent-color={color}\n alignOffset={-Number(size) * 4}\n // Side offset accounts for the outer solid box-shadow\n sideOffset={1}\n collisionPadding={10}\n {...subContentProps}\n asChild={false}\n ref={forwardedRef}\n className={classNames(\n 'rt-PopperContent',\n 'rt-BaseMenuContent',\n 'rt-BaseMenuSubContent',\n 'rt-DropdownMenuContent',\n 'rt-DropdownMenuSubContent',\n className,\n )}\n >\n <ScrollArea type=\"auto\">\n <div className={classNames('rt-BaseMenuViewport', 'rt-DropdownMenuViewport')}>\n {children}\n </div>\n </ScrollArea>\n </DropdownMenuPrimitive.SubContent>\n </Theme>\n </DropdownMenuPrimitive.Portal>\n );\n});\nDropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';\n\ntype DropdownMenuSeparatorElement = React.ElementRef<typeof DropdownMenuPrimitive.Separator>;\ninterface DropdownMenuSeparatorProps\n extends ComponentPropsWithout<typeof DropdownMenuPrimitive.Separator, RemovedProps> {}\nconst DropdownMenuSeparator = React.forwardRef<\n DropdownMenuSeparatorElement,\n DropdownMenuSeparatorProps\n>(({ className, ...props }, forwardedRef) => (\n <DropdownMenuPrimitive.Separator\n {...props}\n asChild={false}\n ref={forwardedRef}\n className={classNames('rt-BaseMenuSeparator', 'rt-DropdownMenuSeparator', className)}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenu.Separator';\n\ntype DropdownMenuTriggerIconElement = React.ElementRef<'svg'>;\ninterface DropdownMenuTriggerIconProps extends IconProps {}\nconst DropdownMenuTriggerIcon = React.forwardRef<\n DropdownMenuTriggerIconElement,\n DropdownMenuTriggerIconProps\n>((props, forwardedRef) => (\n <ChevronDownIcon {...props} ref={forwardedRef} className=\"rt-DropdownMenuTriggerIcon\" />\n));\nDropdownMenuTriggerIcon.displayName = 'DropdownMenu.TriggerIcon';\n\nexport {\n DropdownMenuRoot as Root,\n DropdownMenuTrigger as Trigger,\n DropdownMenuTriggerIcon as TriggerIcon,\n DropdownMenuContent as Content,\n DropdownMenuLabel as Label,\n DropdownMenuItem as Item,\n DropdownMenuGroup as Group,\n DropdownMenuRadioGroup as RadioGroup,\n DropdownMenuRadioItem as RadioItem,\n DropdownMenuCheckboxItem as CheckboxItem,\n DropdownMenuSub as Sub,\n DropdownMenuSubTrigger as SubTrigger,\n DropdownMenuSubContent as SubContent,\n DropdownMenuSeparator as Separator,\n};\n\nexport type {\n DropdownMenuRootProps as RootProps,\n DropdownMenuTriggerProps as TriggerProps,\n DropdownMenuTriggerIconProps as TriggerIconProps,\n DropdownMenuContentProps as ContentProps,\n DropdownMenuLabelProps as LabelProps,\n DropdownMenuItemProps as ItemProps,\n DropdownMenuGroupProps as GroupProps,\n DropdownMenuRadioGroupProps as RadioGroupProps,\n DropdownMenuRadioItemProps as RadioItemProps,\n DropdownMenuCheckboxItemProps as CheckboxItemProps,\n DropdownMenuSubProps as SubProps,\n DropdownMenuSubTriggerProps as SubTriggerProps,\n DropdownMenuSubContentProps as SubContentProps,\n DropdownMenuSeparatorProps as SeparatorProps,\n};\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,YAAAC,EAAA,UAAAC,EAAA,SAAAC,EAAA,UAAAC,EAAA,eAAAC,EAAA,cAAAC,EAAA,SAAAC,EAAA,cAAAC,EAAA,QAAAC,EAAA,eAAAC,EAAA,eAAAC,EAAA,YAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAhB,GAEA,IAAAiB,EAAuB,oBACvBC,EAAuB,yBACvBC,EAA4D,oBAE5DC,EAA2B,4BAC3BC,EAKO,oCACPC,EAAuC,sBACvCC,EAAqF,sBACrFC,EAA6B,uCAC7BC,EAAoC,+CAQpC,MAAMhB,EAAqDiB,GACzDT,EAAA,cAAC,EAAAU,aAAsB,KAAtB,CAA4B,GAAGD,EAAO,EAEzCjB,EAAiB,YAAc,oBAK/B,MAAMK,EAAsBG,EAAM,WAChC,CAAC,CAAE,SAAAW,EAAU,GAAGF,CAAM,EAAGG,IACvBZ,EAAA,cAAC,EAAAU,aAAsB,QAAtB,CAA+B,GAAGD,EAAO,IAAKG,EAAc,QAAO,OACjE,uBAAoBD,CAAQ,CAC/B,CAEJ,EACAd,EAAoB,YAAc,uBAIlC,MAAMgB,EAA6Bb,EAAM,cAA+C,CAAC,CAAC,EAOpFd,EAAsBc,EAAM,WAChC,CAACS,EAAOG,IAAiB,CACvB,MAAME,KAAe,mBAAgB,EAC/B,CACJ,KAAAC,EAAO,8BAA4B,KAAK,QACxC,QAAAC,EAAU,8BAA4B,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,CAAgB,KAAI,gBACzE,CAAE,KAAAb,EAAM,QAAAC,EAAS,MAAAG,EAAO,aAAAF,EAAc,GAAGR,CAAM,EAC/C,6BACF,EACA,OACET,EAAA,cAAC,EAAAU,aAAsB,OAAtB,CAA6B,UAAWU,EAAW,WAAYC,GAC9DrB,EAAA,cAAC,SAAM,QAAO,IACZA,EAAA,cAAC,EAAAU,aAAsB,WAAtB,CACC,oBAAmBS,EACnB,YAAa,CAAC,OAAOJ,CAAI,EAAI,EAE7B,WAAY,EACZ,iBAAkB,GACjB,GAAGa,EACJ,QAAS,GACT,IAAKhB,EACL,aAAW,EAAAY,SACT,mBACA,qBACA,wBACA,yBACA,4BACAN,CACF,GAEAlB,EAAA,cAAC,cAAW,KAAK,QACfA,EAAA,cAAC,OAAI,aAAW,EAAAwB,SAAW,sBAAuB,yBAAyB,GACxEb,CACH,CACF,CACF,CACF,CACF,CAEJ,CAAC,EACDhB,EAAuB,YAAc,0BAKrC,MAAMF,EAAwBO,EAAM,WAGlC,CAAC,CAAE,UAAAkB,EAAW,GAAGT,CAAM,EAAGG,IAC1BZ,EAAA,cAAC,EAAAU,aAAsB,UAAtB,CACE,GAAGD,EACJ,QAAS,GACT,IAAKG,EACL,aAAW,EAAAY,SAAW,uBAAwB,2BAA4BN,CAAS,EACrF,CACD,EACDzB,EAAsB,YAAc,yBAIpC,MAAMK,EAA0BE,EAAM,WAGpC,CAACS,EAAOG,IACRZ,EAAA,cAAC,mBAAiB,GAAGS,EAAO,IAAKG,EAAc,UAAU,6BAA6B,CACvF,EACDd,EAAwB,YAAc",
|
|
6
6
|
"names": ["dropdown_menu_exports", "__export", "DropdownMenuCheckboxItem", "DropdownMenuContent", "DropdownMenuGroup", "DropdownMenuItem", "DropdownMenuLabel", "DropdownMenuRadioGroup", "DropdownMenuRadioItem", "DropdownMenuRoot", "DropdownMenuSeparator", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuTrigger", "DropdownMenuTriggerIcon", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "import_scroll_area", "import_dropdown_menu_props", "import_theme", "import_icons", "import_extract_props", "import_require_react_element", "props", "DropdownMenuPrimitive", "children", "forwardedRef", "DropdownMenuContentContext", "themeContext", "size", "variant", "highContrast", "className", "color", "container", "forceMount", "contentProps", "resolvedColor", "classNames", "shortcut", "itemProps", "subTriggerProps", "subContentProps"]
|
|
7
7
|
}
|
|
@@ -6,6 +6,7 @@ declare const ThickDividerHorizontalIcon: React.ForwardRefExoticComponent<IconPr
|
|
|
6
6
|
declare const ThickCheckIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
7
7
|
declare const ChevronDownIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
8
8
|
declare const ThickChevronRightIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
9
|
-
|
|
9
|
+
declare const ThickDotIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };
|
|
10
11
|
export type { IconProps };
|
|
11
12
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGzF,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAAC;CAAG;AAEtF,QAAA,MAAM,0BAA0B,iFAoB/B,CAAC;AAIF,QAAA,MAAM,cAAc,iFAkBlB,CAAC;AAGH,QAAA,MAAM,eAAe,iFAcnB,CAAC;AAGH,QAAA,MAAM,qBAAqB,iFAkBzB,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGzF,UAAU,SAAU,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAAC;CAAG;AAEtF,QAAA,MAAM,0BAA0B,iFAoB/B,CAAC;AAIF,QAAA,MAAM,cAAc,iFAkBlB,CAAC;AAGH,QAAA,MAAM,eAAe,iFAcnB,CAAC;AAGH,QAAA,MAAM,qBAAqB,iFAkBzB,CAAC;AAGH,QAAA,MAAM,YAAY,iFAchB,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,YAAY,EAAE,CAAC;AAC5G,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var v=Object.create;var i=Object.defineProperty;var
|
|
1
|
+
"use strict";var v=Object.create;var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var I=(o,e)=>{for(var n in e)i(o,n,{get:e[n],enumerable:!0})},w=(o,e,n,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of C(e))!m.call(o,t)&&t!==n&&i(o,t,{get:()=>e[t],enumerable:!(d=g(e,t))||d.enumerable});return o};var u=(o,e,n)=>(n=o!=null?v(f(o)):{},w(e||!o||!o.__esModule?i(n,"default",{value:o,enumerable:!0}):n,o)),a=o=>w(i({},"__esModule",{value:!0}),o);var x={};I(x,{ChevronDownIcon:()=>s,ThickCheckIcon:()=>c,ThickChevronRightIcon:()=>h,ThickDividerHorizontalIcon:()=>l,ThickDotIcon:()=>p});module.exports=a(x);var r=u(require("react"));const l=r.default.forwardRef((o,e)=>r.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...o,ref:e},r.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));l.displayName="ThickDividerHorizontalIcon";const c=r.default.forwardRef((o,e)=>r.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...o,ref:e},r.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));c.displayName="ThickCheckIcon";const s=r.default.forwardRef((o,e)=>r.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...o,ref:e},r.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));s.displayName="ChevronDownIcon";const h=r.default.forwardRef((o,e)=>r.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...o,ref:e},r.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));h.displayName="ThickChevronRightIcon";const p=r.default.forwardRef((o,e)=>r.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...o,ref:e},r.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));p.displayName="ThickDotIcon";
|
|
2
2
|
//# sourceMappingURL=icons.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/icons.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>(\n (props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n }\n);\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon };\nexport type { IconProps };\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,mBAAAC,EAAA,0BAAAC,EAAA,+BAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["icons_exports", "__export", "ChevronDownIcon", "ThickCheckIcon", "ThickChevronRightIcon", "ThickDividerHorizontalIcon", "__toCommonJS", "import_react", "React", "props", "forwardedRef"]
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\n\ntype IconElement = React.ElementRef<'svg'>;\ninterface IconProps extends ComponentPropsWithout<'svg', RemovedProps | 'children'> {}\n\nconst ThickDividerHorizontalIcon = React.forwardRef<IconElement, IconProps>(\n (props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z\"\n />\n </svg>\n );\n }\n);\n\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z\"\n />\n </svg>\n );\n});\nThickCheckIcon.displayName = 'ThickCheckIcon';\n\nconst ChevronDownIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path d=\"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z\" />\n </svg>\n );\n});\nChevronDownIcon.displayName = 'ChevronDownIcon';\n\nconst ThickChevronRightIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronRightIcon.displayName = 'ThickChevronRightIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n width=\"9\"\n height=\"9\"\n viewBox=\"0 0 9 9\"\n fill=\"currentcolor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...props}\n ref={forwardedRef}\n >\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,mBAAAC,EAAA,0BAAAC,EAAA,+BAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAP,GAAA,IAAAQ,EAAkB,oBAOlB,MAAMH,EAA6B,EAAAI,QAAM,WACvC,CAACC,EAAOC,IAEJ,EAAAF,QAAA,cAAC,OACC,MAAM,IACN,OAAO,IACP,QAAQ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Icon", "ThickDividerHorizontalIcon", "ThickDotIcon", "__toCommonJS", "import_react", "React", "props", "forwardedRef"]
|
|
7
7
|
}
|
|
@@ -7,13 +7,34 @@ import type { HeightProps } from '../props/height.props.js';
|
|
|
7
7
|
import type { GetPropDefTypes } from '../props/prop-def.js';
|
|
8
8
|
type ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {
|
|
9
9
|
loading?: 'eager' | 'lazy';
|
|
10
|
+
/**
|
|
11
|
+
* Placeholder image URL to show while the main image is loading.
|
|
12
|
+
* Can be a low-quality/blurred version of the main image.
|
|
13
|
+
*/
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Shows a skeleton placeholder while loading instead of a blank space.
|
|
17
|
+
*/
|
|
18
|
+
showSkeleton?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the image should fade in when loaded. Set to false for background images or when you want immediate visibility.
|
|
21
|
+
*/
|
|
22
|
+
fadeIn?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Callback fired when the image successfully loads.
|
|
25
|
+
*/
|
|
26
|
+
onLoad?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Callback fired when the image fails to load.
|
|
29
|
+
*/
|
|
30
|
+
onError?: (event: React.SyntheticEvent<HTMLImageElement>) => void;
|
|
10
31
|
};
|
|
11
32
|
interface ImageProps extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>, MarginProps, WidthProps, HeightProps, ImageOwnProps {
|
|
12
33
|
/**
|
|
13
34
|
* The alt attribute provides alternative information for an image if a user for some reason cannot view it.
|
|
14
|
-
* Required for accessibility when not using asChild.
|
|
35
|
+
* Required for accessibility when not using asChild. Use empty string for decorative images.
|
|
15
36
|
*/
|
|
16
|
-
alt
|
|
37
|
+
alt: string;
|
|
17
38
|
}
|
|
18
39
|
declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
19
40
|
export { Image };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAOjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,KAAK,aAAa,GAAG,eAAe,CAAC,OAAO,aAAa,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACnE,CAAC;AAEF,UAAU,UACR,SAAQ,qBAAqB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,EACvF,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa;IACf;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,KAAK,qFAkST,CAAC;AAIH,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var F=Object.create;var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var V=(o,e)=>{for(var s in e)b(o,s,{get:e[s],enumerable:!0})},T=(o,e,s,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of K(e))!U.call(o,n)&&n!==s&&b(o,n,{get:()=>e[n],enumerable:!(g=J(e,n))||g.enumerable});return o};var W=(o,e,s)=>(s=o!=null?F(Q(o)):{},T(e||!o||!o.__esModule?b(s,"default",{value:o,enumerable:!0}):s,o)),X=o=>T(b({},"__esModule",{value:!0}),o);var Y={};V(Y,{Image:()=>k});module.exports=X(Y);var r=W(require("react")),a=W(require("classnames")),j=require("./image.props.js"),w=require("../helpers/extract-props.js"),z=require("../props/margin.props.js"),O=require("../props/width.props.js"),q=require("../props/height.props.js"),G=require("./skeleton.js");const k=r.forwardRef((o,e)=>{const{variant:s="surface",children:g}=o,{asChild:n,className:l,radius:i,style:p,loading:u="lazy",alt:h,src:m,placeholder:f,showSkeleton:S=!1,fadeIn:c=!0,onLoad:D,onError:C,children:Z,...d}=(0,w.extractProps)(o,j.imagePropDefs,z.marginPropDefs,O.widthPropDefs,q.heightPropDefs),[y,E]=r.useState(!1),[_,P]=r.useState(!1),[$,v]=r.useState(!!f),I=r.useRef(null),N=r.useCallback(t=>{E(!0),P(!1),v(!1),D?.(t)},[D]),L=r.useCallback(t=>{E(!1),P(!0),v(!1),C?.(t)},[C]);if(r.useEffect(()=>{const t=I.current;t&&t.complete&&t.naturalWidth>0&&(E(!0),P(!1),v(!1))},[m]),!m)return console.warn("Image component: src prop is required"),null;!n&&h===void 0&&console.warn("Image component: alt prop is required for accessibility when not using asChild");const A=S&&!y&&!_?r.createElement(G.Skeleton,{style:{...p,width:"100%",height:"100px",borderRadius:i?`var(--radius-${i})`:void 0},className:l}):null,B=f&&$?r.createElement("img",{"data-radius":i,style:{...p,position:"absolute",top:0,left:0,width:"100%",height:"100%",filter:"blur(4px)",opacity:.7,transition:"opacity 0.3s ease-out"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--placeholder",l),alt:"",src:f}):null,H=r.createElement("img",{"data-radius":i,loading:u,style:{...p,opacity:c?y?1:0:1,transition:c?"opacity 0.3s ease-out":"none"},className:(0,a.default)("rt-reset","rt-Image",s==="blur"&&"rt-Image--blur",l),alt:h,src:m,onLoad:N,onError:L,...d,ref:t=>{I.current=t,typeof e=="function"?e(t):e&&(e.current=t)}}),M=f||S?r.createElement("div",{style:{position:"relative",display:"inline-block"}},A,B,H):H;if(n&&g){const t=r.Children.only(g);return s==="blur"?r.cloneElement(t,{className:(0,a.default)(t.props?.className,"rt-variant-blur"),style:{position:"relative",display:"inline-block",textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...t.props?.style},children:r.createElement(r.Fragment,null,r.createElement("img",{"data-radius":i,loading:u,style:{...p,position:"absolute",top:"8px",left:"0"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",l),alt:"",src:m,...d}),r.createElement("img",{"data-radius":i,loading:u,style:{...p,position:"relative",zIndex:1,opacity:c?y?1:0:1,transition:c?"opacity 0.3s ease-out":"none"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur",l),alt:h,src:m,onLoad:N,onError:L,...d,ref:x=>{I.current=x,typeof e=="function"?e(x):e&&(e.current=x)}}))}):r.cloneElement(t,{className:(0,a.default)(t.props?.className,"rt-Image"),style:{textDecoration:"none",color:"inherit",border:"none",background:"none",padding:0,font:"inherit",cursor:"pointer",...t.props?.style},children:M})}return s==="blur"?r.createElement("div",{className:"rt-variant-blur",style:{position:"relative",display:"inline-block"}},r.createElement("img",{"data-radius":i,loading:u,style:{...p,position:"absolute",top:"8px",left:"0"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur","rt-Image--blur-bg",l),alt:"",src:m,...d}),r.createElement("img",{"data-radius":i,loading:u,style:{...p,position:"relative",zIndex:1,opacity:c?y?1:0:1,transition:c?"opacity 0.3s ease-out":"none"},className:(0,a.default)("rt-reset","rt-Image","rt-Image--blur",l),alt:h,src:m,onLoad:N,onError:L,...d,ref:t=>{I.current=t,typeof e=="function"?e(t):e&&(e.current=t)}})):M});k.displayName="Image";
|
|
2
2
|
//# sourceMappingURL=image.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/image.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility when not using asChild.\n */\n alt?: string;\n}\n\nconst Image = React.forwardRef<ImageElement, ImageProps>((props, forwardedRef) => {\n const { variant = 'surface', fit: _fit = 'cover', children } = props;\n const {\n asChild,\n className,\n radius,\n style,\n loading = 'lazy',\n alt,\n src,\n children: _children, // Extract children to exclude from imgProps\n ...imgProps\n } = extractProps(props, imagePropDefs, marginPropDefs, widthPropDefs, heightPropDefs);\n\n // Create the standard img element\n const imgElement = (\n <img\n data-radius={radius}\n loading={loading}\n style={style}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n variant === 'blur' && 'rt-Image--blur',\n className,\n )}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n );\n\n // Handle asChild - inject img into the child element\n if (asChild && children) {\n const child = React.Children.only(children) as React.ReactElement<any>;\n\n if (variant === 'blur') {\n // For blur variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-variant-blur'),\n style: {\n position: 'relative',\n display: 'inline-block',\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style,\n },\n children: (\n <>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </>\n ),\n });\n } else {\n // For surface variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-Image'),\n style: {\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style, // Allow user overrides\n },\n children: imgElement,\n });\n }\n }\n\n // Regular rendering without asChild\n if (variant === 'blur') {\n return (\n <div className=\"rt-variant-blur\" style={{ position: 'relative', display: 'inline-block' }}>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ ...style, position: 'relative', zIndex: 1 }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n {...imgProps}\n ref={forwardedRef}\n />\n </div>\n );\n }\n\n return imgElement;\n});\n\nImage.displayName = 'Image';\n\nexport { Image };\nexport type { ImageProps };\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAuB,oBACvBC,EAAuB,yBAEvBC,EAA8B,4BAC9BC,EAA6B,uCAC7BC,EAA+B,oCAC/BC,EAA8B,mCAC9BC,EAA+B,
|
|
6
|
-
"names": ["image_exports", "__export", "Image", "__toCommonJS", "React", "import_classnames", "import_image_props", "import_extract_props", "import_margin_props", "import_width_props", "import_height_props", "
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport classNames from 'classnames';\n\nimport { imagePropDefs } from './image.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\nimport { widthPropDefs } from '../props/width.props.js';\nimport { heightPropDefs } from '../props/height.props.js';\nimport { Skeleton } from './skeleton.js';\n\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { WidthProps } from '../props/width.props.js';\nimport type { HeightProps } from '../props/height.props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype ImageElement = React.ElementRef<'img'>;\ntype ImageOwnProps = GetPropDefTypes<typeof imagePropDefs> & {\n loading?: 'eager' | 'lazy';\n /**\n * Placeholder image URL to show while the main image is loading.\n * Can be a low-quality/blurred version of the main image.\n */\n placeholder?: string;\n /**\n * Shows a skeleton placeholder while loading instead of a blank space.\n */\n showSkeleton?: boolean;\n /**\n * Whether the image should fade in when loaded. Set to false for background images or when you want immediate visibility.\n */\n fadeIn?: boolean;\n /**\n * Callback fired when the image successfully loads.\n */\n onLoad?: (event: React.SyntheticEvent<HTMLImageElement>) => void;\n /**\n * Callback fired when the image fails to load.\n */\n onError?: (event: React.SyntheticEvent<HTMLImageElement>) => void;\n};\n\ninterface ImageProps\n extends ComponentPropsWithout<'img', RemovedProps | 'color' | 'width' | 'height' | 'alt'>,\n MarginProps,\n WidthProps,\n HeightProps,\n ImageOwnProps {\n /**\n * The alt attribute provides alternative information for an image if a user for some reason cannot view it.\n * Required for accessibility when not using asChild. Use empty string for decorative images.\n */\n alt: string;\n}\n\nconst Image = React.forwardRef<ImageElement, ImageProps>((props, forwardedRef) => {\n const { variant = 'surface', children } = props;\n const {\n asChild,\n className,\n radius,\n style,\n loading = 'lazy',\n alt,\n src,\n placeholder,\n showSkeleton = false,\n fadeIn = true,\n onLoad: userOnLoad,\n onError: userOnError,\n children: _children, // Extract children to exclude from imgProps\n ...imgProps\n } = extractProps(props, imagePropDefs, marginPropDefs, widthPropDefs, heightPropDefs);\n\n // Loading state management\n const [imageLoaded, setImageLoaded] = React.useState(false);\n const [imageError, setImageError] = React.useState(false);\n const [showPlaceholder, setShowPlaceholder] = React.useState(!!placeholder);\n \n // Ref to check if image is already loaded (for cached images)\n const imgRef = React.useRef<HTMLImageElement>(null);\n\n // Handle image load - moved to top to avoid conditional hook call\n const handleLoad = React.useCallback((event: React.SyntheticEvent<HTMLImageElement>) => {\n setImageLoaded(true);\n setImageError(false);\n setShowPlaceholder(false);\n userOnLoad?.(event);\n }, [userOnLoad]);\n\n // Handle image error - moved to top to avoid conditional hook call\n const handleError = React.useCallback((event: React.SyntheticEvent<HTMLImageElement>) => {\n setImageLoaded(false);\n setImageError(true);\n setShowPlaceholder(false);\n userOnError?.(event);\n }, [userOnError]);\n\n // Check if image is already loaded (for cached images)\n React.useEffect(() => {\n const img = imgRef.current;\n if (img && img.complete && img.naturalWidth > 0) {\n setImageLoaded(true);\n setImageError(false);\n setShowPlaceholder(false);\n }\n }, [src]);\n\n // Validate required props\n if (!src) {\n console.warn('Image component: src prop is required');\n return null;\n }\n\n if (!asChild && alt === undefined) {\n console.warn('Image component: alt prop is required for accessibility when not using asChild');\n }\n\n // Create skeleton placeholder\n const skeletonElement = showSkeleton && !imageLoaded && !imageError ? (\n <Skeleton\n style={{\n ...style,\n width: '100%',\n height: '100px', // Default height, can be overridden by style\n borderRadius: radius ? `var(--radius-${radius})` : undefined,\n }}\n className={className}\n />\n ) : null;\n\n // Create placeholder image element\n const placeholderElement = placeholder && showPlaceholder ? (\n <img\n data-radius={radius}\n style={{\n ...style,\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n filter: 'blur(4px)',\n opacity: 0.7,\n transition: 'opacity 0.3s ease-out',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--placeholder',\n className,\n )}\n alt=\"\"\n src={placeholder}\n />\n ) : null;\n\n // Create the standard img element\n const imgElement = (\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n opacity: fadeIn ? (imageLoaded ? 1 : 0) : 1,\n transition: fadeIn ? 'opacity 0.3s ease-out' : 'none',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n variant === 'blur' && 'rt-Image--blur',\n className,\n )}\n alt={alt}\n src={src}\n onLoad={handleLoad}\n onError={handleError}\n {...imgProps}\n ref={(node) => {\n imgRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n />\n );\n\n // Wrapper for images with placeholders\n const imageWithPlaceholder = (placeholder || showSkeleton) ? (\n <div style={{ position: 'relative', display: 'inline-block' }}>\n {skeletonElement}\n {placeholderElement}\n {imgElement}\n </div>\n ) : imgElement;\n\n // Handle asChild - inject img into the child element\n if (asChild && children) {\n const child = React.Children.only(children) as React.ReactElement<any>;\n\n if (variant === 'blur') {\n // For blur variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-variant-blur'),\n style: {\n position: 'relative',\n display: 'inline-block',\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style,\n },\n children: (\n <>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ \n ...style, \n position: 'relative', \n zIndex: 1,\n opacity: fadeIn ? (imageLoaded ? 1 : 0) : 1,\n transition: fadeIn ? 'opacity 0.3s ease-out' : 'none',\n }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n onLoad={handleLoad}\n onError={handleError}\n {...imgProps}\n ref={(node) => {\n imgRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n />\n </>\n ),\n });\n } else {\n // For surface variant with asChild\n return React.cloneElement(child, {\n className: classNames(child.props?.className, 'rt-Image'),\n style: {\n textDecoration: 'none', // Reset link underlines\n color: 'inherit', // Reset link colors\n border: 'none', // Reset button borders\n background: 'none', // Reset button backgrounds\n padding: 0, // Reset button padding\n font: 'inherit', // Reset button fonts\n cursor: 'pointer', // Ensure interactive cursor\n ...child.props?.style, // Allow user overrides\n },\n children: imageWithPlaceholder,\n });\n }\n }\n\n // Regular rendering without asChild\n if (variant === 'blur') {\n return (\n <div className=\"rt-variant-blur\" style={{ position: 'relative', display: 'inline-block' }}>\n {/* Background blurred image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{\n ...style,\n position: 'absolute',\n top: '8px',\n left: '0',\n }}\n className={classNames(\n 'rt-reset',\n 'rt-Image',\n 'rt-Image--blur',\n 'rt-Image--blur-bg',\n className,\n )}\n alt=\"\"\n src={src}\n {...imgProps}\n />\n {/* Foreground image */}\n <img\n data-radius={radius}\n loading={loading}\n style={{ \n ...style, \n position: 'relative', \n zIndex: 1,\n opacity: fadeIn ? (imageLoaded ? 1 : 0) : 1,\n transition: fadeIn ? 'opacity 0.3s ease-out' : 'none',\n }}\n className={classNames('rt-reset', 'rt-Image', 'rt-Image--blur', className)}\n alt={alt}\n src={src}\n onLoad={handleLoad}\n onError={handleError}\n {...imgProps}\n ref={(node) => {\n imgRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n }}\n />\n </div>\n );\n }\n\n return imageWithPlaceholder;\n});\n\nImage.displayName = 'Image';\n\nexport { Image };\nexport type { ImageProps };\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAEA,IAAAI,EAAuB,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IAAKK,EACJ,GAAGO,EACN,EAEAzB,EAAA,cAAC,OACC,cAAac,EACb,QAASE,EACT,MAAO,CACL,GAAGD,EACH,SAAU,WACV,OAAQ,EACR,QAASM,EAAUK,EAAc,EAAI,EAAK,EAC1C,WAAYL,EAAS,wBAA0B,MACjD,EACA,aAAW,EAAAkB,SAAW,WAAY,WAAY,iBAAkB1B,CAAS,EACzE,IAAKI,EACL,IAAKC,EACL,OAAQe,EACR,QAASE,EACR,GAAGV,EACJ,IAAMgB,GAAS,CACbT,EAAO,QAAUS,EACb,OAAOhC,GAAiB,WAC1BA,EAAagC,CAAI,EACRhC,IACTA,EAAa,QAAUgC,EAE3B,EACF,CACF,EAIGC,CACT,CAAC,EAED5C,EAAM,YAAc",
|
|
6
|
+
"names": ["image_exports", "__export", "Image", "__toCommonJS", "React", "import_classnames", "import_image_props", "import_extract_props", "import_margin_props", "import_width_props", "import_height_props", "import_skeleton", "props", "forwardedRef", "variant", "children", "asChild", "className", "radius", "style", "loading", "alt", "src", "placeholder", "showSkeleton", "fadeIn", "userOnLoad", "userOnError", "_children", "imgProps", "imageLoaded", "setImageLoaded", "imageError", "setImageError", "showPlaceholder", "setShowPlaceholder", "imgRef", "handleLoad", "event", "handleError", "img", "skeletonElement", "placeholderElement", "classNames", "imgElement", "node", "imageWithPlaceholder", "child"]
|
|
7
7
|
}
|
|
@@ -1,71 +1,146 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import type {
|
|
2
|
+
import { Accordion } from 'radix-ui';
|
|
3
|
+
import { sidebarPropDefs } from './sidebar.props';
|
|
4
|
+
import { IconButton } from './icon-button';
|
|
5
|
+
import { Separator } from './separator';
|
|
6
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props';
|
|
7
|
+
import type { GetPropDefTypes } from '../props/prop-def';
|
|
7
8
|
type SidebarContextProps = {
|
|
9
|
+
state: 'expanded' | 'collapsed';
|
|
8
10
|
open: boolean;
|
|
9
11
|
setOpen: (open: boolean) => void;
|
|
10
|
-
|
|
12
|
+
openMobile: boolean;
|
|
13
|
+
setOpenMobile: (open: boolean) => void;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
toggleSidebar: () => void;
|
|
16
|
+
side: 'left' | 'right';
|
|
17
|
+
type: 'sidebar' | 'floating';
|
|
18
|
+
variant: 'soft' | 'surface' | 'ghost';
|
|
19
|
+
menuVariant: 'solid' | 'soft';
|
|
20
|
+
collapsible: 'offcanvas' | 'icon' | 'none';
|
|
21
|
+
size: '1' | '2';
|
|
11
22
|
};
|
|
12
23
|
declare function useSidebar(): SidebarContextProps;
|
|
13
24
|
interface SidebarProviderProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
14
25
|
defaultOpen?: boolean;
|
|
15
26
|
open?: boolean;
|
|
16
27
|
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
side?: 'left' | 'right';
|
|
17
29
|
}
|
|
18
30
|
declare const SidebarProvider: React.ForwardRefExoticComponent<SidebarProviderProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
type
|
|
20
|
-
interface
|
|
31
|
+
type SidebarOwnProps = GetPropDefTypes<typeof sidebarPropDefs>;
|
|
32
|
+
interface SidebarProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarOwnProps {
|
|
21
33
|
}
|
|
22
|
-
declare const
|
|
23
|
-
interface SidebarContentProps extends
|
|
34
|
+
declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
interface SidebarContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
24
36
|
}
|
|
25
37
|
declare const SidebarContent: React.ForwardRefExoticComponent<SidebarContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
-
interface SidebarHeaderProps extends
|
|
38
|
+
interface SidebarHeaderProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
39
|
+
/**
|
|
40
|
+
* Whether to use the default flex container layout.
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
asContainer?: boolean;
|
|
27
44
|
}
|
|
28
45
|
declare const SidebarHeader: React.ForwardRefExoticComponent<SidebarHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
interface SidebarFooterProps extends
|
|
46
|
+
interface SidebarFooterProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
47
|
+
/**
|
|
48
|
+
* Whether to use the default flex container layout.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
asContainer?: boolean;
|
|
30
52
|
}
|
|
31
53
|
declare const SidebarFooter: React.ForwardRefExoticComponent<SidebarFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
54
|
interface SidebarTriggerProps extends ComponentPropsWithout<typeof IconButton, RemovedProps> {
|
|
33
55
|
}
|
|
34
56
|
declare const SidebarTrigger: React.ForwardRefExoticComponent<Omit<SidebarTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
-
interface
|
|
57
|
+
interface SidebarSeparatorProps extends ComponentPropsWithout<typeof Separator, RemovedProps> {
|
|
36
58
|
}
|
|
37
|
-
declare const
|
|
38
|
-
interface
|
|
59
|
+
declare const SidebarSeparator: React.ForwardRefExoticComponent<SidebarSeparatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
60
|
+
interface SidebarMenuProps extends React.ComponentPropsWithoutRef<'ul'> {
|
|
39
61
|
}
|
|
40
|
-
declare const
|
|
41
|
-
|
|
42
|
-
interface SidebarItemProps extends ComponentPropsWithout<'div', RemovedProps>, SidebarItemOwnProps {
|
|
62
|
+
declare const SidebarMenu: React.ForwardRefExoticComponent<SidebarMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
63
|
+
interface SidebarMenuItemProps extends React.ComponentPropsWithoutRef<'li'> {
|
|
43
64
|
}
|
|
44
|
-
declare const
|
|
65
|
+
declare const SidebarMenuItem: React.ForwardRefExoticComponent<SidebarMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
66
|
+
interface SidebarMenuButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
67
|
+
asChild?: boolean;
|
|
68
|
+
isActive?: boolean;
|
|
69
|
+
}
|
|
70
|
+
declare const SidebarMenuButton: React.ForwardRefExoticComponent<SidebarMenuButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
interface SidebarMenuSubProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
72
|
+
defaultOpen?: boolean;
|
|
73
|
+
}
|
|
74
|
+
declare const SidebarMenuSub: React.ForwardRefExoticComponent<SidebarMenuSubProps & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
interface SidebarMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof Accordion.Trigger> {
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
}
|
|
78
|
+
declare const SidebarMenuSubTrigger: React.ForwardRefExoticComponent<SidebarMenuSubTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
79
|
+
interface SidebarMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof Accordion.Content> {
|
|
80
|
+
}
|
|
81
|
+
declare const SidebarMenuSubContent: React.ForwardRefExoticComponent<SidebarMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
82
|
interface SidebarGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
46
83
|
}
|
|
47
84
|
declare const SidebarGroup: React.ForwardRefExoticComponent<SidebarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
48
|
-
interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
interface SidebarGroupLabelProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
86
|
+
asChild?: boolean;
|
|
87
|
+
}
|
|
88
|
+
declare const SidebarGroupLabel: React.ForwardRefExoticComponent<SidebarGroupLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
interface SidebarGroupContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
90
|
+
}
|
|
91
|
+
declare const SidebarGroupContent: React.ForwardRefExoticComponent<SidebarGroupContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
export { SidebarProvider as Provider, Sidebar as Root, SidebarContent as Content, SidebarHeader as Header, SidebarFooter as Footer, SidebarTrigger as Trigger, SidebarSeparator as Separator, SidebarMenu as Menu, SidebarMenuItem as MenuItem, SidebarMenuButton as MenuButton, SidebarMenuSub as MenuSub, SidebarMenuSubTrigger as MenuSubTrigger, SidebarMenuSubContent as MenuSubContent, SidebarGroup as Group, SidebarGroupLabel as GroupLabel, SidebarGroupContent as GroupContent, useSidebar, };
|
|
93
|
+
/**
|
|
94
|
+
* Enhanced Sidebar Header and Footer Usage Examples:
|
|
95
|
+
*
|
|
96
|
+
* 1. Simple default container (backwards compatible):
|
|
97
|
+
* <Sidebar.Header>
|
|
98
|
+
* <Logo />
|
|
99
|
+
* <span>App Name</span>
|
|
100
|
+
* </Sidebar.Header>
|
|
101
|
+
*
|
|
102
|
+
* 2. Custom flex layout:
|
|
103
|
+
* <Sidebar.Header className="rt-justify-between rt-gap-3">
|
|
104
|
+
* <Logo />
|
|
105
|
+
* <Sidebar.MenuButton>
|
|
106
|
+
* <SettingsIcon />
|
|
107
|
+
* </Sidebar.MenuButton>
|
|
108
|
+
* </Sidebar.Header>
|
|
109
|
+
*
|
|
110
|
+
* 3. Column layout for multiple rows:
|
|
111
|
+
* <Sidebar.Header className="rt-flex-col rt-gap-2" asContainer={false}>
|
|
112
|
+
* <div className="rt-flex rt-items-center rt-gap-2">
|
|
113
|
+
* <Logo />
|
|
114
|
+
* <span>App Name</span>
|
|
115
|
+
* </div>
|
|
116
|
+
* <Sidebar.MenuButton>
|
|
117
|
+
* <UserAvatar />
|
|
118
|
+
* <span>John Doe</span>
|
|
119
|
+
* </Sidebar.MenuButton>
|
|
120
|
+
* </Sidebar.Header>
|
|
121
|
+
*
|
|
122
|
+
* 4. Interactive footer with menu button:
|
|
123
|
+
* <Sidebar.Footer>
|
|
124
|
+
* <Sidebar.MenuButton>
|
|
125
|
+
* <UserIcon />
|
|
126
|
+
* <span>Settings</span>
|
|
127
|
+
* <ChevronUpIcon />
|
|
128
|
+
* </Sidebar.MenuButton>
|
|
129
|
+
* </Sidebar.Footer>
|
|
130
|
+
*
|
|
131
|
+
* 5. Custom footer layout:
|
|
132
|
+
* <Sidebar.Footer className="rt-justify-between">
|
|
133
|
+
* <span>v1.0.0</span>
|
|
134
|
+
* <Sidebar.MenuButton>
|
|
135
|
+
* <HelpIcon />
|
|
136
|
+
* </Sidebar.MenuButton>
|
|
137
|
+
* </Sidebar.Footer>
|
|
138
|
+
*
|
|
139
|
+
* Available utility classes:
|
|
140
|
+
* - Layout: rt-flex-row, rt-flex-col
|
|
141
|
+
* - Alignment: rt-items-center, rt-items-start, rt-items-end
|
|
142
|
+
* - Justification: rt-justify-between, rt-justify-center, rt-justify-start, rt-justify-end
|
|
143
|
+
* - Gap: rt-gap-1, rt-gap-2, rt-gap-3, rt-gap-4
|
|
144
|
+
*/
|
|
145
|
+
export type { SidebarProviderProps as ProviderProps, SidebarProps as RootProps, SidebarContentProps as ContentProps, SidebarHeaderProps as HeaderProps, SidebarFooterProps as FooterProps, SidebarTriggerProps as TriggerProps, };
|
|
71
146
|
//# sourceMappingURL=sidebar.d.ts.map
|