@kushagradhawan/kookie-ui 0.1.124 → 0.1.126
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 +93 -0
- package/dist/cjs/components/_internal/base-menu.props.d.ts +52 -1
- package/dist/cjs/components/_internal/base-menu.props.d.ts.map +1 -1
- package/dist/cjs/components/_internal/base-menu.props.js +1 -1
- package/dist/cjs/components/_internal/base-menu.props.js.map +3 -3
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts +60 -0
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -0
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +2 -0
- package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +7 -0
- package/dist/cjs/components/combobox.d.ts.map +1 -1
- package/dist/cjs/components/combobox.js +1 -1
- package/dist/cjs/components/combobox.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.d.ts +28 -7
- package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.js +1 -1
- package/dist/cjs/components/dropdown-menu.js.map +3 -3
- package/dist/cjs/components/dropdown-menu.props.d.ts +1 -1
- package/dist/cjs/components/dropdown-menu.props.d.ts.map +1 -1
- package/dist/cjs/components/dropdown-menu.props.js +1 -1
- package/dist/cjs/components/dropdown-menu.props.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/schemas/shell.schema.d.ts +2 -2
- package/dist/esm/components/_internal/base-menu.props.d.ts +52 -1
- package/dist/esm/components/_internal/base-menu.props.d.ts.map +1 -1
- package/dist/esm/components/_internal/base-menu.props.js +1 -1
- package/dist/esm/components/_internal/base-menu.props.js.map +3 -3
- package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts +60 -0
- package/dist/esm/components/_internal/dropdown-menu-drill-down.d.ts.map +1 -0
- package/dist/esm/components/_internal/dropdown-menu-drill-down.js +2 -0
- package/dist/esm/components/_internal/dropdown-menu-drill-down.js.map +7 -0
- package/dist/esm/components/combobox.d.ts.map +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/combobox.js.map +3 -3
- package/dist/esm/components/dropdown-menu.d.ts +28 -7
- package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.js +1 -1
- package/dist/esm/components/dropdown-menu.js.map +3 -3
- package/dist/esm/components/dropdown-menu.props.d.ts +1 -1
- package/dist/esm/components/dropdown-menu.props.d.ts.map +1 -1
- package/dist/esm/components/dropdown-menu.props.js +1 -1
- package/dist/esm/components/dropdown-menu.props.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/schemas/shell.schema.d.ts +2 -2
- package/package.json +1 -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/toggle-button.json +1 -1
- package/schemas/toggle-icon-button.json +1 -1
- package/src/components/_internal/base-menu.props.ts +31 -1
- package/src/components/_internal/dropdown-menu-drill-down.tsx +242 -0
- package/src/components/combobox.tsx +176 -80
- package/src/components/dropdown-menu.css +119 -0
- package/src/components/dropdown-menu.props.tsx +2 -0
- package/src/components/dropdown-menu.tsx +217 -27
- package/src/components/icons.tsx +14 -1
- package/styles.css +93 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dropdown-menu.props.tsx"],
|
|
4
|
-
"sourcesContent": ["export {\n baseMenuContentPropDefs as dropdownMenuContentPropDefs,\n baseMenuItemPropDefs as dropdownMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs as dropdownMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as dropdownMenuRadioItemPropDefs,\n} from './_internal/base-menu.props.js';\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
|
4
|
+
"sourcesContent": ["export {\n baseMenuContentPropDefs as dropdownMenuContentPropDefs,\n baseMenuSubContentPropDefs as dropdownMenuSubContentPropDefs,\n baseMenuItemPropDefs as dropdownMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs as dropdownMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs as dropdownMenuRadioItemPropDefs,\n submenuBehaviors,\n} from './_internal/base-menu.props.js';\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0WAAAE,EAAAF,GAAA,IAAAG,EAOO",
|
|
6
6
|
"names": ["dropdown_menu_props_exports", "__export", "__toCommonJS", "import_base_menu_props"]
|
|
7
7
|
}
|
|
@@ -6,8 +6,9 @@ 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
|
+
declare const ThickChevronLeftIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
9
10
|
declare const ThickDotIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
-
export { ChevronDownIcon, ThickCheckIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };
|
|
11
|
+
export { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };
|
|
11
12
|
export type { IconProps };
|
|
12
13
|
declare const CloseIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
13
14
|
declare const PaperclipIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -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,iFAU9B,CAAC;AAIH,QAAA,MAAM,cAAc,iFAUlB,CAAC;AAGH,QAAA,MAAM,eAAe,iFAMnB,CAAC;AAGH,QAAA,MAAM,qBAAqB,iFAUzB,CAAC;AAGH,QAAA,MAAM,YAAY,iFAMhB,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,YAAY,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,iFAU9B,CAAC;AAIH,QAAA,MAAM,cAAc,iFAUlB,CAAC;AAGH,QAAA,MAAM,eAAe,iFAMnB,CAAC;AAGH,QAAA,MAAM,qBAAqB,iFAUzB,CAAC;AAGH,QAAA,MAAM,oBAAoB,iFAUxB,CAAC;AAGH,QAAA,MAAM,YAAY,iFAMhB,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,YAAY,EAAE,CAAC;AAClI,YAAY,EAAE,SAAS,EAAE,CAAC;AAG1B,QAAA,MAAM,SAAS,iFAmBb,CAAC;AAGH,QAAA,MAAM,aAAa,iFAkBjB,CAAC;AAGH,QAAA,MAAM,QAAQ,iFAOZ,CAAC;AAGH,QAAA,MAAM,YAAY,iFAUhB,CAAC;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=Object.create;var i=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var L=(e,r)=>{for(var n in r)i(e,n,{get:r[n],enumerable:!0})},m=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of u(r))!x.call(e,t)&&t!==n&&i(e,t,{get:()=>r[t],enumerable:!(a=C(r,t))||a.enumerable});return e};var P=(e,r,n)=>(n=e!=null?I(k(e)):{},m(r||!e||!e.__esModule?i(n,"default",{value:e,enumerable:!0}):n,e)),y=e=>m(i({},"__esModule",{value:!0}),e);var M={};L(M,{ChevronDownIcon:()=>h,CloseIcon:()=>w,FileIcon:()=>g,FileTextIcon:()=>f,PaperclipIcon:()=>v,ThickCheckIcon:()=>l,ThickChevronLeftIcon:()=>p,ThickChevronRightIcon:()=>d,ThickDividerHorizontalIcon:()=>s,ThickDotIcon:()=>c});module.exports=y(M);var o=P(require("react"));const s=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.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"})));s.displayName="ThickDividerHorizontalIcon";const l=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.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"})));l.displayName="ThickCheckIcon";const h=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.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"})));h.displayName="ChevronDownIcon";const d=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.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"})));d.displayName="ThickChevronRightIcon";const p=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));p.displayName="ThickChevronLeftIcon";const c=o.default.forwardRef((e,r)=>o.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:r},o.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));c.displayName="ThickDotIcon";const w=o.default.forwardRef((e,r)=>o.default.createElement("svg",{...e,ref:r,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o.default.createElement("path",{d:"M18 6 6 18"}),o.default.createElement("path",{d:"m6 6 12 12"})));w.displayName="CloseIcon";const v=o.default.forwardRef((e,r)=>o.default.createElement("svg",{...e,ref:r,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));v.displayName="PaperclipIcon";const g=o.default.forwardRef((e,r)=>o.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),o.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));g.displayName="FileIcon";const f=o.default.forwardRef((e,r)=>o.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),o.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),o.default.createElement("path",{d:"M10 9H8"}),o.default.createElement("path",{d:"M16 13H8"}),o.default.createElement("path",{d:"M16 17H8"})));f.displayName="FileTextIcon";
|
|
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>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon };\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,cAAAC,EAAA,aAAAC,EAAA,iBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,0BAAAC,EAAA,+BAAAC,EAAA,iBAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["icons_exports", "__export", "ChevronDownIcon", "CloseIcon", "FileIcon", "FileTextIcon", "PaperclipIcon", "ThickCheckIcon", "ThickChevronRightIcon", "ThickDividerHorizontalIcon", "ThickDotIcon", "__toCommonJS", "import_react", "React", "props", "forwardedRef", "_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>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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\nThickDividerHorizontalIcon.displayName = 'ThickDividerHorizontalIcon';\n\nconst ThickCheckIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\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 ThickChevronLeftIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z\"\n />\n </svg>\n );\n});\nThickChevronLeftIcon.displayName = 'ThickChevronLeftIcon';\n\nconst ThickDotIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 9 9\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\" {...props} ref={forwardedRef}>\n <circle cx=\"4.5\" cy=\"4.5\" r=\"2\" />\n </svg>\n );\n});\nThickDotIcon.displayName = 'ThickDotIcon';\n\nexport { ChevronDownIcon, ThickCheckIcon, ThickChevronLeftIcon, ThickChevronRightIcon, ThickDividerHorizontalIcon, ThickDotIcon };\nexport type { IconProps };\n\n// Additional minimal icons\nconst CloseIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg\n {..._props}\n ref={_forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n});\nCloseIcon.displayName = 'CloseIcon';\n\nconst PaperclipIcon = React.forwardRef<IconElement, IconProps>((props, forwardedRef) => {\n return (\n <svg\n {...props}\n ref={forwardedRef}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n});\nPaperclipIcon.displayName = 'PaperclipIcon';\n\nconst FileIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n </svg>\n );\n});\nFileIcon.displayName = 'FileIcon';\n\nconst FileTextIcon = React.forwardRef<IconElement, IconProps>((_props, _forwardedRef) => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\" />\n <path d=\"M14 2v4a2 2 0 0 0 2 2h4\" />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n});\nFileTextIcon.displayName = 'FileTextIcon';\n\nexport { CloseIcon, PaperclipIcon, FileIcon, FileTextIcon };\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,cAAAC,EAAA,aAAAC,EAAA,iBAAAC,EAAA,kBAAAC,EAAA,mBAAAC,EAAA,yBAAAC,EAAA,0BAAAC,EAAA,+BAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAZ,GAAA,IAAAa,EAAkB,oBAOlB,MAAMH,EAA6B,EAAAI,QAAM,WAAmC,CAACC,EAAOC,IAEhF,EAAAF,QAAA,cAAC,OAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,KAAK,eAAe,MAAM,6BAA8B,GAAGC,EAAO,IAAKC,GACjH,EAAAF,QAAA,cAAC,QACC,SAAS,UACT,SAAS,UACT,EAAE,iKACJ,CACF,CAEH,EAEDJ,EAA2B,YAAc,6BAEzC,MAAMH,EAAiB,EAAAO,QAAM,WAAmC,CAACC,EAAOC,IAEpE,EAAAF,QAAA,cAAC,OAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,KAAK,eAAe,MAAM,6BAA8B,GAAGC,EAAO,IAAKC,GACjH,EAAAF,QAAA,cAAC,QACC,SAAS,UACT,SAAS,UACT,EAAE,sXACJ,CACF,CAEH,EACDP,EAAe,YAAc,iBAE7B,MAAML,EAAkB,EAAAY,QAAM,WAAmC,CAACC,EAAOC,IAErE,EAAAF,QAAA,cAAC,OAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,UAAU,KAAK,eAAe,MAAM,6BAA8B,GAAGC,EAAO,IAAKC,GACjH,EAAAF,QAAA,cAAC,QAAK,EAAE,+TAA+T,CACzU,CAEH,EACDZ,EAAgB,YAAc,kBAE9B,MAAMO,EAAwB,EAAAK,QAAM,WAAmC,CAAC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AQ,YACR,KAAK,OACL,OAAO,eACP,YAAY,IACZ,cAAc,QACd,eAAe,SAEf,EAAAF,QAAA,cAAC,QAAK,EAAE,2HAA2H,CACrI,CAEH,EACDR,EAAc,YAAc,gBAE5B,MAAMF,EAAW,EAAAU,QAAM,WAAmC,CAACG,EAAQC,IAE/D,EAAAJ,QAAA,cAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,SACxK,EAAAA,QAAA,cAAC,QAAK,EAAE,6DAA6D,EACrE,EAAAA,QAAA,cAAC,QAAK,EAAE,0BAA0B,CACpC,CAEH,EACDV,EAAS,YAAc,WAEvB,MAAMC,EAAe,EAAAS,QAAM,WAAmC,CAACG,EAAQC,IAEnE,EAAAJ,QAAA,cAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,SACxK,EAAAA,QAAA,cAAC,QAAK,EAAE,6DAA6D,EACrE,EAAAA,QAAA,cAAC,QAAK,EAAE,0BAA0B,EAClC,EAAAA,QAAA,cAAC,QAAK,EAAE,UAAU,EAClB,EAAAA,QAAA,cAAC,QAAK,EAAE,WAAW,EACnB,EAAAA,QAAA,cAAC,QAAK,EAAE,WAAW,CACrB,CAEH,EACDT,EAAa,YAAc",
|
|
6
|
+
"names": ["icons_exports", "__export", "ChevronDownIcon", "CloseIcon", "FileIcon", "FileTextIcon", "PaperclipIcon", "ThickCheckIcon", "ThickChevronLeftIcon", "ThickChevronRightIcon", "ThickDividerHorizontalIcon", "ThickDotIcon", "__toCommonJS", "import_react", "React", "props", "forwardedRef", "_props", "_forwardedRef"]
|
|
7
7
|
}
|
|
@@ -935,7 +935,7 @@ export declare const ShellTriggerSchema: z.ZodObject<{
|
|
|
935
935
|
'aria-labelledby': z.ZodOptional<z.ZodString>;
|
|
936
936
|
'aria-describedby': z.ZodOptional<z.ZodString>;
|
|
937
937
|
}, "strict", z.ZodTypeAny, {
|
|
938
|
-
target: "left" | "bottom" | "
|
|
938
|
+
target: "left" | "bottom" | "rail" | "panel" | "sidebar" | "inspector";
|
|
939
939
|
action: "collapse" | "toggle" | "expand";
|
|
940
940
|
peekOnHover: boolean;
|
|
941
941
|
className?: string | undefined;
|
|
@@ -948,7 +948,7 @@ export declare const ShellTriggerSchema: z.ZodObject<{
|
|
|
948
948
|
onMouseEnter?: ((...args: unknown[]) => unknown) | undefined;
|
|
949
949
|
onMouseLeave?: ((...args: unknown[]) => unknown) | undefined;
|
|
950
950
|
}, {
|
|
951
|
-
target: "left" | "bottom" | "
|
|
951
|
+
target: "left" | "bottom" | "rail" | "panel" | "sidebar" | "inspector";
|
|
952
952
|
className?: string | undefined;
|
|
953
953
|
style?: Record<string, string | number> | undefined;
|
|
954
954
|
'aria-describedby'?: string | undefined;
|
|
@@ -1,4 +1,55 @@
|
|
|
1
|
+
declare const submenuBehaviors: readonly ["cascade", "drill-down"];
|
|
1
2
|
declare const baseMenuContentPropDefs: {
|
|
3
|
+
/**
|
|
4
|
+
* Controls how submenus behave.
|
|
5
|
+
* - `cascade`: Default cascading behavior where submenus open to the side (portal-based)
|
|
6
|
+
* - `drill-down`: Mobile-friendly behavior where submenus replace the content inline
|
|
7
|
+
* Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`
|
|
8
|
+
*/
|
|
9
|
+
submenuBehavior: {
|
|
10
|
+
type: "enum";
|
|
11
|
+
values: readonly ["cascade", "drill-down"];
|
|
12
|
+
default: "cascade";
|
|
13
|
+
responsive: true;
|
|
14
|
+
};
|
|
15
|
+
highContrast: {
|
|
16
|
+
type: "boolean";
|
|
17
|
+
className: string;
|
|
18
|
+
default: undefined;
|
|
19
|
+
};
|
|
20
|
+
color: {
|
|
21
|
+
type: "enum";
|
|
22
|
+
values: readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky"];
|
|
23
|
+
default: ("gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky") | undefined;
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
type: "enum";
|
|
27
|
+
className: string;
|
|
28
|
+
values: readonly ["1", "2"];
|
|
29
|
+
default: "2";
|
|
30
|
+
responsive: true;
|
|
31
|
+
};
|
|
32
|
+
variant: {
|
|
33
|
+
type: "enum";
|
|
34
|
+
className: string;
|
|
35
|
+
values: readonly ["solid", "soft"];
|
|
36
|
+
default: "solid";
|
|
37
|
+
};
|
|
38
|
+
material: {
|
|
39
|
+
type: "enum";
|
|
40
|
+
values: readonly ["solid", "translucent"];
|
|
41
|
+
default: undefined;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use `material` prop instead. This prop will be removed in a future version.
|
|
45
|
+
*/
|
|
46
|
+
panelBackground: {
|
|
47
|
+
type: "enum";
|
|
48
|
+
values: readonly ["solid", "translucent"];
|
|
49
|
+
default: undefined;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
declare const baseMenuSubContentPropDefs: {
|
|
2
53
|
highContrast: {
|
|
3
54
|
type: "boolean";
|
|
4
55
|
className: string;
|
|
@@ -66,5 +117,5 @@ declare const baseMenuRadioItemPropDefs: {
|
|
|
66
117
|
default: ("gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky") | undefined;
|
|
67
118
|
};
|
|
68
119
|
};
|
|
69
|
-
export { baseMenuContentPropDefs, baseMenuItemPropDefs, baseMenuCheckboxItemPropDefs, baseMenuRadioItemPropDefs, };
|
|
120
|
+
export { baseMenuContentPropDefs, baseMenuSubContentPropDefs, baseMenuItemPropDefs, baseMenuCheckboxItemPropDefs, baseMenuRadioItemPropDefs, submenuBehaviors, };
|
|
70
121
|
//# sourceMappingURL=base-menu.props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-menu.props.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/base-menu.props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-menu.props.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/base-menu.props.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,gBAAgB,oCAAqC,CAAC;AAwC5D,QAAA,MAAM,uBAAuB;IAE3B;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzBH;;OAEG;;;;;;CAoCJ,CAAC;AAGF,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAzC9B;;OAEG;;;;;;CAuCoD,CAAC;AAE1D,QAAA,MAAM,oBAAoB;;;;;;;;;;;;CAMzB,CAAC;AAEF,QAAA,MAAM,4BAA4B;;;;;;;;;CAKjC,CAAC;AAEF,QAAA,MAAM,yBAAyB;;;;;;CAE9B,CAAC;AAEF,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,gBAAgB,GACjB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asChildPropDef as
|
|
1
|
+
import{asChildPropDef as n}from"../../props/as-child.prop.js";import{colorPropDef as e}from"../../props/color.prop.js";import{highContrastPropDef as o}from"../../props/high-contrast.prop.js";const r=["1","2"],a=["solid","soft"],u=["solid","translucent"],i=["solid","translucent"],t=["cascade","drill-down"],s={size:{type:"enum",className:"rt-r-size",values:r,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:a,default:"solid"},material:{type:"enum",values:i,default:void 0},panelBackground:{type:"enum",values:u,default:void 0},...e,...o},p={...s,submenuBehavior:{type:"enum",values:t,default:"cascade",responsive:!0}},f=s,c={...n,...e,shortcut:{type:"string"}},m={...e,shortcut:{type:"string"}},d={...e};export{m as baseMenuCheckboxItemPropDefs,p as baseMenuContentPropDefs,c as baseMenuItemPropDefs,d as baseMenuRadioItemPropDefs,f as baseMenuSubContentPropDefs,t as submenuBehaviors};
|
|
2
2
|
//# sourceMappingURL=base-menu.props.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/components/_internal/base-menu.props.ts"],
|
|
4
|
-
"sourcesContent": ["import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\nimport { highContrastPropDef } from '../../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2'] as const;\nconst contentVariants = ['solid', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst
|
|
5
|
-
"mappings": "AAAA,OAAS,kBAAAA,MAAsB,+BAC/B,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,uBAAAC,MAA2B,oCAIpC,MAAMC,EAAe,CAAC,IAAK,GAAG,EACxBC,EAAkB,CAAC,QAAS,MAAM,EAClCC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,
|
|
6
|
-
"names": ["asChildPropDef", "colorPropDef", "highContrastPropDef", "contentSizes", "contentVariants", "panelBackgrounds", "materials", "baseMenuContentPropDefs", "baseMenuItemPropDefs", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs"]
|
|
4
|
+
"sourcesContent": ["import { asChildPropDef } from '../../props/as-child.prop.js';\nimport { colorPropDef } from '../../props/color.prop.js';\nimport { highContrastPropDef } from '../../props/high-contrast.prop.js';\n\nimport type { PropDef } from '../../props/prop-def.js';\n\nconst contentSizes = ['1', '2'] as const;\nconst contentVariants = ['solid', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\nconst submenuBehaviors = ['cascade', 'drill-down'] as const;\n\n// Base props shared between Content and SubContent\nconst baseMenuSharedPropDefs = {\n size: {\n type: 'enum',\n className: 'rt-r-size',\n values: contentSizes,\n default: '2',\n responsive: true,\n },\n variant: {\n type: 'enum',\n className: 'rt-variant',\n values: contentVariants,\n default: 'solid',\n },\n material: {\n type: 'enum',\n values: materials,\n default: undefined,\n },\n /**\n * @deprecated Use `material` prop instead. This prop will be removed in a future version.\n */\n panelBackground: {\n type: 'enum',\n values: panelBackgrounds,\n default: undefined,\n },\n ...colorPropDef,\n ...highContrastPropDef,\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n variant: PropDef<(typeof contentVariants)[number]>;\n material: PropDef<(typeof materials)[number] | undefined>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n};\n\n// Content-specific props (includes submenuBehavior)\nconst baseMenuContentPropDefs = {\n ...baseMenuSharedPropDefs,\n /**\n * Controls how submenus behave.\n * - `cascade`: Default cascading behavior where submenus open to the side (portal-based)\n * - `drill-down`: Mobile-friendly behavior where submenus replace the content inline\n * Supports responsive values: `{ initial: 'drill-down', md: 'cascade' }`\n */\n submenuBehavior: {\n type: 'enum',\n values: submenuBehaviors,\n default: 'cascade',\n responsive: true,\n },\n} satisfies {\n size: PropDef<(typeof contentSizes)[number]>;\n variant: PropDef<(typeof contentVariants)[number]>;\n material: PropDef<(typeof materials)[number] | undefined>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n submenuBehavior: PropDef<(typeof submenuBehaviors)[number]>;\n};\n\n// SubContent props (no submenuBehavior)\nconst baseMenuSubContentPropDefs = baseMenuSharedPropDefs;\n\nconst baseMenuItemPropDefs = {\n ...asChildPropDef,\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuCheckboxItemPropDefs = {\n ...colorPropDef,\n shortcut: { type: 'string' },\n} satisfies {\n shortcut: PropDef<string>;\n};\n\nconst baseMenuRadioItemPropDefs = {\n ...colorPropDef,\n};\n\nexport {\n baseMenuContentPropDefs,\n baseMenuSubContentPropDefs,\n baseMenuItemPropDefs,\n baseMenuCheckboxItemPropDefs,\n baseMenuRadioItemPropDefs,\n submenuBehaviors,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,kBAAAA,MAAsB,+BAC/B,OAAS,gBAAAC,MAAoB,4BAC7B,OAAS,uBAAAC,MAA2B,oCAIpC,MAAMC,EAAe,CAAC,IAAK,GAAG,EACxBC,EAAkB,CAAC,QAAS,MAAM,EAClCC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EACnCC,EAAmB,CAAC,UAAW,YAAY,EAG3CC,EAAyB,CAC7B,KAAM,CACJ,KAAM,OACN,UAAW,YACX,OAAQL,EACR,QAAS,IACT,WAAY,EACd,EACA,QAAS,CACP,KAAM,OACN,UAAW,aACX,OAAQC,EACR,QAAS,OACX,EACA,SAAU,CACR,KAAM,OACN,OAAQE,EACR,QAAS,MACX,EAIA,gBAAiB,CACf,KAAM,OACN,OAAQD,EACR,QAAS,MACX,EACA,GAAGJ,EACH,GAAGC,CACL,EAQMO,EAA0B,CAC9B,GAAGD,EAOH,gBAAiB,CACf,KAAM,OACN,OAAQD,EACR,QAAS,UACT,WAAY,EACd,CACF,EASMG,EAA6BF,EAE7BG,EAAuB,CAC3B,GAAGX,EACH,GAAGC,EACH,SAAU,CAAE,KAAM,QAAS,CAC7B,EAIMW,EAA+B,CACnC,GAAGX,EACH,SAAU,CAAE,KAAM,QAAS,CAC7B,EAIMY,EAA4B,CAChC,GAAGZ,CACL",
|
|
6
|
+
"names": ["asChildPropDef", "colorPropDef", "highContrastPropDef", "contentSizes", "contentVariants", "panelBackgrounds", "materials", "submenuBehaviors", "baseMenuSharedPropDefs", "baseMenuContentPropDefs", "baseMenuSubContentPropDefs", "baseMenuItemPropDefs", "baseMenuCheckboxItemPropDefs", "baseMenuRadioItemPropDefs"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Breakpoint, Responsive } from '../../props/prop-def.js';
|
|
3
|
+
import type { submenuBehaviors } from './base-menu.props.js';
|
|
4
|
+
type SubmenuBehavior = (typeof submenuBehaviors)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Hook to get the current breakpoint based on window width.
|
|
7
|
+
* Returns 'initial' on the server and during initial hydration.
|
|
8
|
+
* Uses shared breakpoint values from shell.types.js.
|
|
9
|
+
*/
|
|
10
|
+
declare function useBreakpoint(): {
|
|
11
|
+
breakpoint: Breakpoint;
|
|
12
|
+
ready: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Resolves a responsive value to its current value based on the breakpoint.
|
|
16
|
+
* Falls back through smaller breakpoints if the current one isn't defined.
|
|
17
|
+
*/
|
|
18
|
+
declare function resolveResponsiveValue<T>(value: T | Partial<Record<Breakpoint, T>> | undefined, currentBreakpoint: Breakpoint, defaultValue: T): T;
|
|
19
|
+
interface DrillDownContextValue {
|
|
20
|
+
/** Current submenu behavior mode */
|
|
21
|
+
behavior: SubmenuBehavior;
|
|
22
|
+
/** Whether the breakpoint has been resolved (client-side only) */
|
|
23
|
+
ready: boolean;
|
|
24
|
+
/** Stack of active submenu IDs. Empty means root menu is shown. */
|
|
25
|
+
stack: string[];
|
|
26
|
+
/** Navigate into a submenu */
|
|
27
|
+
push: (id: string) => void;
|
|
28
|
+
/** Navigate back to parent menu */
|
|
29
|
+
pop: () => void;
|
|
30
|
+
/** Reset to root menu */
|
|
31
|
+
reset: () => void;
|
|
32
|
+
/** Check if a specific submenu is the currently active one */
|
|
33
|
+
isActive: (id: string) => boolean;
|
|
34
|
+
/** Check if we're at root level (no submenus open) */
|
|
35
|
+
isRoot: boolean;
|
|
36
|
+
/** The currently active submenu ID (or null if at root) */
|
|
37
|
+
currentId: string | null;
|
|
38
|
+
}
|
|
39
|
+
declare const DrillDownContext: React.Context<DrillDownContextValue | null>;
|
|
40
|
+
interface DrillDownProviderProps {
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
submenuBehavior: Responsive<SubmenuBehavior> | undefined;
|
|
43
|
+
}
|
|
44
|
+
declare function DrillDownProvider({ children, submenuBehavior }: DrillDownProviderProps): React.JSX.Element;
|
|
45
|
+
declare function useDrillDown(): DrillDownContextValue;
|
|
46
|
+
/**
|
|
47
|
+
* Hook to check if drill-down context is available (i.e., we're inside Content)
|
|
48
|
+
*/
|
|
49
|
+
declare function useDrillDownOptional(): DrillDownContextValue | null;
|
|
50
|
+
interface SubContextValue {
|
|
51
|
+
/** Unique ID for this submenu */
|
|
52
|
+
id: string;
|
|
53
|
+
/** Label for the back button */
|
|
54
|
+
label: React.ReactNode;
|
|
55
|
+
}
|
|
56
|
+
declare const SubContext: React.Context<SubContextValue | null>;
|
|
57
|
+
declare function useSubContext(): SubContextValue | null;
|
|
58
|
+
export { DrillDownProvider, DrillDownContext, SubContext, useDrillDown, useDrillDownOptional, useSubContext, useBreakpoint, resolveResponsiveValue, };
|
|
59
|
+
export type { SubmenuBehavior, DrillDownContextValue, SubContextValue };
|
|
60
|
+
//# sourceMappingURL=dropdown-menu-drill-down.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu-drill-down.d.ts","sourceRoot":"","sources":["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,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E;AAED,iBAAS,YAAY,0BAMpB;AAED;;GAEG;AACH,iBAAS,oBAAoB,iCAE5B;AAMD,UAAU,eAAe;IACvB,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,QAAA,MAAM,UAAU,uCAAoD,CAAC;AAErE,iBAAS,aAAa,2BAErB;AAED,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,sBAAsB,GACvB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{_BREAKPOINTS as x}from"../shell.types.js";function m(){const[r,l]=e.useState("initial"),[c,s]=e.useState(!1);return e.useEffect(()=>{if(typeof window>"u")return;const a=Object.entries(x).map(([i,o])=>[i,window.matchMedia(o)]),t=()=>{const i=a.filter(([,d])=>d.matches).map(([d])=>d),o=i[i.length-1]??"initial";l(o),s(!0)};t();const u=[];return a.forEach(([,i])=>{const o=i;typeof o.addEventListener=="function"?(o.addEventListener("change",t),u.push(()=>o.removeEventListener?.("change",t))):typeof o.addListener=="function"&&(o.addListener(t),u.push(()=>o.removeListener?.(t)))}),()=>{u.forEach(i=>{try{i()}catch{}})}},[]),{breakpoint:r,ready:c}}function h(r,l,c){if(r==null)return c;if(typeof r!="object")return r;const s=r;if(s[l]!==void 0)return s[l];const n=["xl","lg","md","sm","xs","initial"],a=n.indexOf(l);for(let t=a+1;t<n.length;t++){const u=n[t];if(s[u]!==void 0)return s[u]}return c}const f=e.createContext(null);function g({children:r,submenuBehavior:l}){const{breakpoint:c,ready:s}=m(),[n,a]=e.useState([]),t=e.useMemo(()=>h(l,c,"cascade"),[l,c]),u=e.useRef(t);e.useEffect(()=>{u.current==="drill-down"&&t==="cascade"&&a([]),u.current=t},[t]);const i=e.useCallback(p=>{a(w=>[...w,p])},[]),o=e.useCallback(()=>{a(p=>p.slice(0,-1))},[]),d=e.useCallback(()=>{a([])},[]),v=e.useCallback(p=>n.length===0?!1:n[n.length-1]===p,[n]),D=e.useMemo(()=>({behavior:t,ready:s,stack:n,push:i,pop:o,reset:d,isActive:v,isRoot:n.length===0,currentId:n.length>0?n[n.length-1]:null}),[t,s,n,i,o,d,v]);return e.createElement(f.Provider,{value:D},r)}function y(){const r=e.useContext(f);if(!r)throw new Error("useDrillDown must be used within a DropdownMenu.Content");return r}function C(){return e.useContext(f)}const b=e.createContext(null);function k(){return e.useContext(b)}export{f as DrillDownContext,g as DrillDownProvider,b as SubContext,h as resolveResponsiveValue,m as useBreakpoint,y as useDrillDown,C as useDrillDownOptional,k as useSubContext};
|
|
2
|
+
//# sourceMappingURL=dropdown-menu-drill-down.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/_internal/dropdown-menu-drill-down.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client';\n\nimport * as React from 'react';\nimport type { Breakpoint, Responsive } from '../../props/prop-def.js';\nimport type { submenuBehaviors } from './base-menu.props.js';\nimport { _BREAKPOINTS } from '../shell.types.js';\n\ntype SubmenuBehavior = (typeof submenuBehaviors)[number];\n\n/**\n * Hook to get the current breakpoint based on window width.\n * Returns 'initial' on the server and during initial hydration.\n * Uses shared breakpoint values from shell.types.js.\n */\nfunction useBreakpoint(): { breakpoint: Breakpoint; ready: boolean } {\n const [currentBp, setCurrentBp] = React.useState<Breakpoint>('initial');\n const [ready, setReady] = React.useState(false);\n\n React.useEffect(() => {\n if (typeof window === 'undefined') return;\n\n // Use shared breakpoint media queries from shell.types\n const queries = Object.entries(_BREAKPOINTS) as [keyof typeof _BREAKPOINTS, string][];\n const mqls = queries.map(([k, q]) => [k, window.matchMedia(q)] as const);\n\n const compute = () => {\n // Highest matched breakpoint wins\n const matched = mqls.filter(([, m]) => m.matches).map(([k]) => k);\n const next = (matched[matched.length - 1] as Breakpoint | undefined) ?? 'initial';\n setCurrentBp(next);\n setReady(true);\n };\n\n compute();\n\n const cleanups: Array<() => void> = [];\n mqls.forEach(([, m]) => {\n const mm = m as MediaQueryList & {\n addEventListener?: (type: 'change', listener: () => void) => void;\n removeEventListener?: (type: 'change', listener: () => void) => void;\n addListener?: (listener: () => void) => void;\n removeListener?: (listener: () => void) => void;\n };\n if (typeof mm.addEventListener === 'function') {\n mm.addEventListener('change', compute);\n cleanups.push(() => mm.removeEventListener?.('change', compute));\n } else if (typeof mm.addListener === 'function') {\n mm.addListener(compute);\n cleanups.push(() => mm.removeListener?.(compute));\n }\n });\n\n return () => {\n cleanups.forEach((fn) => {\n try {\n fn();\n } catch (e) {\n // MediaQueryList cleanup can fail in edge cases (e.g., already removed)\n // Log in development to aid debugging\n if (process.env.NODE_ENV !== 'production') {\n console.warn('[DropdownMenu] MediaQueryList cleanup warning:', e);\n }\n }\n });\n };\n }, []);\n\n return { breakpoint: currentBp, ready };\n}\n\n/**\n * Resolves a responsive value to its current value based on the breakpoint.\n * Falls back through smaller breakpoints if the current one isn't defined.\n */\nfunction resolveResponsiveValue<T>(\n value: T | Partial<Record<Breakpoint, T>> | undefined,\n currentBreakpoint: Breakpoint,\n defaultValue: T\n): T {\n if (value === undefined || value === null) {\n return defaultValue;\n }\n\n // Non-object values are returned directly\n if (typeof value !== 'object') {\n return value;\n }\n\n const map = value as Partial<Record<Breakpoint, T>>;\n\n // Check if current breakpoint has a value\n if (map[currentBreakpoint] !== undefined) {\n return map[currentBreakpoint] as T;\n }\n\n // Fall back through smaller breakpoints\n const bpOrder: Breakpoint[] = ['xl', 'lg', 'md', 'sm', 'xs', 'initial'];\n const startIdx = bpOrder.indexOf(currentBreakpoint);\n\n for (let i = startIdx + 1; i < bpOrder.length; i++) {\n const bp = bpOrder[i];\n if (map[bp] !== undefined) {\n return map[bp] as T;\n }\n }\n\n return defaultValue;\n}\n\n// ============================================================================\n// DrillDown Context\n// ============================================================================\n\ninterface DrillDownContextValue {\n /** Current submenu behavior mode */\n behavior: SubmenuBehavior;\n /** Whether the breakpoint has been resolved (client-side only) */\n ready: boolean;\n /** Stack of active submenu IDs. Empty means root menu is shown. */\n stack: string[];\n /** Navigate into a submenu */\n push: (id: string) => void;\n /** Navigate back to parent menu */\n pop: () => void;\n /** Reset to root menu */\n reset: () => void;\n /** Check if a specific submenu is the currently active one */\n isActive: (id: string) => boolean;\n /** Check if we're at root level (no submenus open) */\n isRoot: boolean;\n /** The currently active submenu ID (or null if at root) */\n currentId: string | null;\n}\n\nconst DrillDownContext = React.createContext<DrillDownContextValue | null>(null);\n\ninterface DrillDownProviderProps {\n children: React.ReactNode;\n submenuBehavior: Responsive<SubmenuBehavior> | undefined;\n}\n\nfunction DrillDownProvider({ children, submenuBehavior }: DrillDownProviderProps) {\n const { breakpoint, ready } = useBreakpoint();\n const [stack, setStack] = React.useState<string[]>([]);\n\n // Resolve the current behavior based on breakpoint\n const behavior = React.useMemo(\n () => resolveResponsiveValue(submenuBehavior, breakpoint, 'cascade'),\n [submenuBehavior, breakpoint]\n );\n\n // Reset stack when behavior changes from drill-down to cascade\n const prevBehaviorRef = React.useRef(behavior);\n React.useEffect(() => {\n if (prevBehaviorRef.current === 'drill-down' && behavior === 'cascade') {\n setStack([]);\n }\n prevBehaviorRef.current = behavior;\n }, [behavior]);\n\n const push = React.useCallback((id: string) => {\n setStack((prev) => [...prev, id]);\n }, []);\n\n const pop = React.useCallback(() => {\n setStack((prev) => prev.slice(0, -1));\n }, []);\n\n const reset = React.useCallback(() => {\n setStack([]);\n }, []);\n\n const isActive = React.useCallback(\n (id: string) => {\n if (stack.length === 0) return false;\n return stack[stack.length - 1] === id;\n },\n [stack]\n );\n\n const value = React.useMemo(\n (): DrillDownContextValue => ({\n behavior,\n ready,\n stack,\n push,\n pop,\n reset,\n isActive,\n isRoot: stack.length === 0,\n currentId: stack.length > 0 ? stack[stack.length - 1] : null,\n }),\n [behavior, ready, stack, push, pop, reset, isActive]\n );\n\n return <DrillDownContext.Provider value={value}>{children}</DrillDownContext.Provider>;\n}\n\nfunction useDrillDown() {\n const ctx = React.useContext(DrillDownContext);\n if (!ctx) {\n throw new Error('useDrillDown must be used within a DropdownMenu.Content');\n }\n return ctx;\n}\n\n/**\n * Hook to check if drill-down context is available (i.e., we're inside Content)\n */\nfunction useDrillDownOptional() {\n return React.useContext(DrillDownContext);\n}\n\n// ============================================================================\n// Sub Context (for individual submenu instances)\n// ============================================================================\n\ninterface SubContextValue {\n /** Unique ID for this submenu */\n id: string;\n /** Label for the back button */\n label: React.ReactNode;\n}\n\nconst SubContext = React.createContext<SubContextValue | null>(null);\n\nfunction useSubContext() {\n return React.useContext(SubContext);\n}\n\nexport {\n DrillDownProvider,\n DrillDownContext,\n SubContext,\n useDrillDown,\n useDrillDownOptional,\n useSubContext,\n useBreakpoint,\n resolveResponsiveValue,\n};\n\nexport type { SubmenuBehavior, DrillDownContextValue, SubContextValue };\n"],
|
|
5
|
+
"mappings": "aAEA,UAAYA,MAAW,QAGvB,OAAS,gBAAAC,MAAoB,oBAS7B,SAASC,GAA4D,CACnE,KAAM,CAACC,EAAWC,CAAY,EAAIJ,EAAM,SAAqB,SAAS,EAChE,CAACK,EAAOC,CAAQ,EAAIN,EAAM,SAAS,EAAK,EAE9C,OAAAA,EAAM,UAAU,IAAM,CACpB,GAAI,OAAO,OAAW,IAAa,OAInC,MAAMO,EADU,OAAO,QAAQN,CAAY,EACtB,IAAI,CAAC,CAACO,EAAGC,CAAC,IAAM,CAACD,EAAG,OAAO,WAAWC,CAAC,CAAC,CAAU,EAEjEC,EAAU,IAAM,CAEpB,MAAMC,EAAUJ,EAAK,OAAO,CAAC,CAAC,CAAEK,CAAC,IAAMA,EAAE,OAAO,EAAE,IAAI,CAAC,CAACJ,CAAC,IAAMA,CAAC,EAC1DK,EAAQF,EAAQA,EAAQ,OAAS,CAAC,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3E,OAAOA,CACT,CAKA,SAASC,GAAuB,CAC9B,OAAO3C,EAAM,WAAW0B,CAAgB,CAC1C,CAaA,MAAMkB,EAAa5C,EAAM,cAAsC,IAAI,EAEnE,SAAS6C,GAAgB,CACvB,OAAO7C,EAAM,WAAW4C,CAAU,CACpC",
|
|
6
|
+
"names": ["React", "_BREAKPOINTS", "useBreakpoint", "currentBp", "setCurrentBp", "ready", "setReady", "mqls", "k", "q", "compute", "matched", "m", "next", "cleanups", "mm", "fn", "resolveResponsiveValue", "value", "currentBreakpoint", "defaultValue", "map", "bpOrder", "startIdx", "i", "bp", "DrillDownContext", "DrillDownProvider", "children", "submenuBehavior", "breakpoint", "stack", "setStack", "behavior", "prevBehaviorRef", "push", "id", "prev", "pop", "reset", "isActive", "useDrillDown", "ctx", "useDrillDownOptional", "SubContext", "useSubContext"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAGnD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAK7G,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA;;;;;GAK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|
|
1
|
-
"use client";import*as
|
|
1
|
+
"use client";import*as o from"react";import p from"classnames";import{useControllableState as B}from"radix-ui/internal";import{Command as R}from"cmdk";import{extractProps as oo}from"../helpers/extract-props.js";import{comboboxRootPropDefs as D,comboboxTriggerPropDefs as Io,comboboxContentPropDefs as M}from"./combobox.props.js";import{marginPropDefs as So}from"../props/margin.props.js";import{ChevronDownIcon as Vo,ThickCheckIcon as Eo}from"./icons.js";import{Theme as Ro,useThemeContext as No}from"./theme.js";import{requireReactElement as To}from"../helpers/require-react-element.js";import*as W from"./popover.js";import{ScrollArea as Lo}from"./scroll-area.js";import{Slottable as wo}from"./slot.js";import"./text-field.props.js";const Do=/^rt-r-size-\d$/,eo=o.createContext(null),to=o.createContext(null),no=o.createContext(null),ro=o.createContext(null),N=e=>{const t=o.useContext(eo);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},O=e=>{const t=o.useContext(to);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},ao=e=>{const t=o.useContext(no);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},$=e=>{const t=o.useContext(ro);if(!t)throw new Error(`${e} must be used within Combobox.Root`);return t},qo=e=>{const t=N(e),n=O(e),r=ao(e),i=$(e);return{...t,...n,...r,...i}},so=o.createContext(null),io=()=>o.useContext(so),lo=e=>{const{children:t,size:n=D.size.default,highContrast:r=D.highContrast.default,value:i,defaultValue:s=null,onValueChange:l,open:b,defaultOpen:a=!1,onOpenChange:u,placeholder:c="Select an option",searchPlaceholder:m="Search options...",searchValue:x,defaultSearchValue:f="",onSearchValueChange:C,filter:g,shouldFilter:h=!0,loop:d=!0,disabled:y,resetSearchOnSelect:I=!0,color:V,displayValue:P,...T}=e,E=`combobox-listbox-${o.useId()}`,[H,_]=o.useState(void 0),[k,L]=B({prop:b,defaultProp:a,onChange:u}),[v,q]=B({prop:i,defaultProp:s,onChange:l}),[K,w]=B({prop:x,defaultProp:f,onChange:C}),F=o.useRef(new Map),[X,G]=o.useState(void 0),Z=o.useCallback((S,Y)=>{F.current.set(S,Y),S===v&&G(Y)},[v]),J=o.useCallback(S=>{F.current.delete(S)},[]);o.useEffect(()=>{if(v!=null){const S=F.current.get(v);G(S)}else G(void 0)},[v]);const Q=o.useCallback(S=>{q(S),L(!1),I&&w("")},[L,w,q,I]);o.useEffect(()=>{},[v]);const U=o.useMemo(()=>{if(P!=null)return typeof P=="function"?P(v):P},[P,v]),ho=o.useMemo(()=>({size:n,highContrast:r,placeholder:c,searchPlaceholder:m,filter:g,shouldFilter:h,loop:d,disabled:y,resetSearchOnSelect:I,color:V,listboxId:E}),[n,r,c,m,g,h,d,y,I,V,E]),Po=o.useMemo(()=>({open:k,setOpen:L,value:v,selectedLabel:X,resolvedDisplayValue:U,registerItemLabel:Z,unregisterItemLabel:J,handleSelect:Q}),[k,L,v,X,U,Z,J,Q]),vo=o.useMemo(()=>({searchValue:K,setSearchValue:w}),[K,w]),yo=o.useMemo(()=>({activeDescendantId:H,setActiveDescendantId:_}),[H,_]);return o.createElement(eo.Provider,{value:ho},o.createElement(to.Provider,{value:Po},o.createElement(no.Provider,{value:vo},o.createElement(ro.Provider,{value:yo},o.createElement(W.Root,{open:k,onOpenChange:L,...T},t)))))};lo.displayName="Combobox.Root";const mo=o.forwardRef((e,t)=>{const n=N("Combobox.Trigger"),r=O("Combobox.Trigger"),i=$("Combobox.Trigger"),{children:s,className:l,placeholder:b,disabled:a,readOnly:u,error:c,loading:m,color:x,radius:f,...C}=oo({size:n.size,highContrast:n.highContrast,...e},{size:D.size,highContrast:D.highContrast},Io,So),{material:g,panelBackground:h}=e,d=a??n.disabled,y=x??n.color,I=o.useMemo(()=>({role:"combobox","aria-expanded":r.open,"aria-disabled":d||void 0,"aria-haspopup":"listbox","aria-controls":r.open?n.listboxId:void 0,"aria-activedescendant":r.open?i.activeDescendantId:void 0,"aria-autocomplete":"list"}),[r.open,n.listboxId,i.activeDescendantId,d]),V=o.createElement(o.Fragment,null,o.createElement("span",{className:"rt-SelectTriggerInner"},o.createElement(A,{placeholder:b??n.placeholder})),m?o.createElement("div",{className:"rt-SelectIcon rt-SelectLoadingIcon","aria-hidden":"true"},o.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},o.createElement("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeDasharray:"6 34",strokeDashoffset:"0",className:"rt-SelectLoadingSpinner"}))):o.createElement(Vo,{className:"rt-SelectIcon"})),{type:P,...T}=C,E=o.createElement("button",{"data-accent-color":y,"data-radius":f,"data-panel-background":h,"data-material":g,"data-error":c,"data-loading":m,"data-disabled":d||void 0,"data-read-only":u||void 0,...T,...I,type:P??"button",disabled:d,ref:t,className:p("rt-reset","rt-SelectTrigger","rt-ComboboxTrigger",l)},s?To(s):V);return o.createElement(W.Trigger,{disabled:d},E)});mo.displayName="Combobox.Trigger";const A=o.forwardRef(({placeholder:e,children:t,className:n,...r},i)=>{const s=N("Combobox.Value"),l=O("Combobox.Value"),b=l.resolvedDisplayValue??l.selectedLabel??l.value??void 0,a=e??s.placeholder;return o.createElement("span",{...r,ref:i,className:p("rt-ComboboxValue",n)},b??t??a)});A.displayName="Combobox.Value";const bo=o.forwardRef((e,t)=>{const n=N("Combobox.Content"),r=No(),i=r.panelBackground,s=e.size??n.size??M.size.default,l=e.variant??M.variant.default,b=e.highContrast??n.highContrast??M.highContrast.default,{className:a,children:u,color:c,forceMount:m,container:x,...f}=oo({...e,size:s,variant:l,highContrast:b},M),C=c||n.color||r.accentColor,g=o.useMemo(()=>typeof s!="string"?a:a?.split(/\s+/).filter(Boolean).filter(d=>!Do.test(d)).join(" ")||void 0,[a,s]),h=m===!0?!0:void 0;return o.createElement(W.Content,{size:s,"data-accent-color":C,"data-material":i,"data-panel-background":i,align:"start",sideOffset:4,collisionPadding:10,...f,forceMount:h,container:x,ref:t,className:p("rt-PopperContent","rt-BaseMenuContent","rt-ComboboxContent",g)},o.createElement(Ro,{asChild:!0},o.createElement(so.Provider,{value:{variant:l,size:String(s),color:C,material:i,highContrast:b}},o.createElement(R,{loop:n.loop,shouldFilter:n.shouldFilter,filter:n.filter,className:"rt-ComboboxCommand"},u))))});bo.displayName="Combobox.Content";const co=o.forwardRef(({className:e,startAdornment:t,endAdornment:n,placeholder:r,variant:i,value:s,onValueChange:l,...b},a)=>{const u=N("Combobox.Input"),c=ao("Combobox.Input"),m=io(),x=m?.variant??"solid",f=m?.color,C=m?.material,g=i??(x==="solid"?"surface":"soft"),h=s??c.searchValue,d=l??c.setSearchValue,y=o.createElement("div",{className:p("rt-TextFieldRoot","rt-ComboboxInputRoot",`rt-r-size-${u.size}`,`rt-variant-${g}`),"data-accent-color":f,"data-material":C,"data-panel-background":C},t?o.createElement("div",{className:"rt-TextFieldSlot"},t):null,o.createElement(R.Input,{...b,ref:a,value:h,onValueChange:d,placeholder:r??u.searchPlaceholder,className:p("rt-reset","rt-TextFieldInput",e)}),n?o.createElement("div",{className:"rt-TextFieldSlot","data-side":"right"},n):null);return m?o.createElement("div",{className:"rt-ComboboxSearch"},y):y});co.displayName="Combobox.Input";const po=o.forwardRef(({className:e,...t},n)=>{const r=N("Combobox.List"),i=$("Combobox.List"),s=o.useRef(null),l=o.useCallback(a=>{s.current=a,typeof n=="function"?n(a):n&&(n.current=a)},[n]),{setActiveDescendantId:b}=i;return o.useEffect(()=>{const a=s.current;if(!a)return;const u=()=>{const x=a.querySelector('[data-selected="true"], [aria-selected="true"]')?.id;b(x||void 0)};u();const c=new MutationObserver(u);return c.observe(a,{attributes:!0,attributeFilter:["data-selected","aria-selected"],subtree:!0}),()=>c.disconnect()},[b]),o.createElement(Lo,{type:"auto",className:"rt-ComboboxScrollArea",scrollbars:"vertical",size:"1"},o.createElement("div",{className:p("rt-BaseMenuViewport","rt-ComboboxViewport")},o.createElement(R.List,{...t,ref:l,id:r.listboxId,role:"listbox","aria-label":"Options",className:p("rt-ComboboxList",e)})))});po.displayName="Combobox.List";const uo=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Empty,{...t,ref:n,className:p("rt-ComboboxEmpty",e)}));uo.displayName="Combobox.Empty";const Co=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Group,{...t,ref:n,className:p("rt-BaseMenuGroup","rt-ComboboxGroup",e)}));Co.displayName="Combobox.Group";const xo=o.forwardRef(({className:e,...t},n)=>o.createElement("div",{...t,ref:n,className:p("rt-BaseMenuLabel","rt-ComboboxLabel",e)}));xo.displayName="Combobox.Label";const fo=o.forwardRef(({className:e,...t},n)=>o.createElement(R.Separator,{...t,ref:n,className:p("rt-BaseMenuSeparator","rt-ComboboxSeparator",e)}));fo.displayName="Combobox.Separator";function j(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(e==null||typeof e=="boolean")return"";if(Array.isArray(e))return e.map(j).filter(Boolean).join(" ");if(o.isValidElement(e)){const t=e.props;if(t.children)return j(t.children)}return""}const go=o.forwardRef(({className:e,children:t,label:n,value:r,disabled:i,onSelect:s,keywords:l,...b},a)=>{const u=N("Combobox.Item"),c=O("Combobox.Item"),m=io(),x=o.useMemo(()=>j(t),[t]),f=n??(x||String(r)),C=r!=null&&c.value===r,g=m?.size?`rt-r-size-${m.size}`:void 0,h=l??[f],y=`combobox-item-${o.useId()}`,{registerItemLabel:I,unregisterItemLabel:V,handleSelect:P}=c;o.useEffect(()=>{if(r)return I(r,f),()=>V(r)},[I,V,r,f]);const T=o.useCallback(E=>{P(E),s?.(E)},[P,s]),z=i??u.disabled??!1;return o.createElement(R.Item,{...b,id:y,value:r,keywords:h,role:"option","aria-selected":C,...z?{disabled:!0,"aria-disabled":!0}:{},ref:a,onSelect:T,className:p("rt-reset","rt-BaseMenuItem","rt-ComboboxItem",e)},C?o.createElement("span",{className:p("rt-BaseMenuItemIndicator","rt-ComboboxItemIndicator",g)},o.createElement(Eo,{className:p("rt-BaseMenuItemIndicatorIcon","rt-ComboboxItemIndicatorIcon",g)})):null,o.createElement(wo,null,t))});go.displayName="Combobox.Item";export{bo as Content,uo as Empty,Co as Group,co as Input,go as Item,xo as Label,po as List,lo as Root,fo as Separator,mo as Trigger,A as Value};
|
|
2
2
|
//# sourceMappingURL=combobox.js.map
|