@mage-ui/components 0.0.64 → 0.0.66
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","names":[],"sources":["../../../../src/components/controls/dropdown/Menu.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","names":[],"sources":["../../../../src/components/controls/dropdown/Menu.tsx"],"sourcesContent":[],"mappings":";;;;;KAaY,SAAA,GAAY,KACtB;UAGQ,KAAA,CAAM;;EAJJ,UAAA,CAAA,EAAS;IAAA,MAAA,CAAA,EAAA,MAAA;IACnB,QAAA,CAAA,EAAA,MAAA;IADsB,OAAA,CAAA,EAAA,MAAA;;kBAiBL,CAAA,EAAA;IACP,IAAA,CAAM,EAAA,MAAA;IACJ,KAAM,CAAA,EAAA,MAAA;IAAS,KAAA,CAAA,EAAA,MAAA;IAGhB,OA0DZ,CAAA,EAAA,MAAA;EAAA,CAAA;aA/DY,KAAA,CAAM;YACP,KAAA,CAAM;cACJ,KAAA,CAAM;;cAGP;;;;;;;;;;KASV,YAAS,kBAAA,CAAA,GAAA,CAAA;;IAAT,CAAA;MAAA;IAAA,CAAA,EAwD2B,eAxD3B,CAAA,EAwD0C,SAxD1C;IAAS,WAAA,EAAA,MAAA;;SAwDkB,EAAA;IAAe,EAAA,EAAA,IAAA;IAAA,WAAA,EAAA,MAAA;EALxC,CAAA;;KAAA,eAAA;;YAEO,KAAA,CAAM"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Button as e}from"../../buttons/button/Button.js";import{DropdownBase as t}from"./DropdownBase.js";import{comboboxDivider as n,comboboxOption as r,dropdown as
|
|
1
|
+
import{Button as e}from"../../buttons/button/Button.js";import{DropdownBase as t}from"./DropdownBase.js";import{comboboxDivider as n,comboboxOption as r,comboboxOptions as i,dropdown as a}from"@mage-ui/styled-system/recipes";import{jsx as o}from"react/jsx-runtime";import{Children as s,isValidElement as c}from"react";const l=({label:u,a11yLabel:d,classNames:f,buttonClassNames:p,children:m,endSlot:h,startSlot:g,..._})=>o(t,{setSelectedOption:()=>{},target:o(e,{classNames:p,...d&&{"aria-label":d},children:u}),classNames:{dropdown:f?.dropdown??a(),options:f?.options??i()},startSlot:g,endSlot:h,..._,children:s.map(m,(e,i)=>{if(!c(e))return null;let a=e.type.displayName;if(a===l.Option.displayName){let{value:n,children:i}=e.props;return o(t.Option,{value:n,classNames:{option:f?.option??r()},children:i},n)}if(a===l.Divider.displayName)return o(t.Divider,{classNames:{divider:f?.divider??n()}},`${e.type}-${i}`)})}),u=({children:e})=>e,d=()=>null;u.displayName=`Menu.Option`,l.Option=u,d.displayName=`Menu.Divider`,l.Divider=d;export{l as Menu};
|
|
2
2
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","names":["children"],"sources":["../../../../src/components/controls/dropdown/Menu.tsx"],"sourcesContent":["import { Children, isValidElement, type ReactNode } from 'react';\n\nimport {\n comboboxDivider,\n comboboxOption,\n dropdown,\n} from '@mage-ui/styled-system/recipes';\n// import type { FloatingPosition, PopoverWidth } from '@mantine/core';\nimport { Button } from '@/components/buttons';\n\nimport { DropdownBase, type DropdownBaseProps } from './DropdownBase';\n\nexport type MenuProps = Omit<\n DropdownBaseProps,\n 'setSelectedOption' | 'target' | 'opened'\n> & {\n label?: React.ReactNode;\n a11yLabel?: string;\n classNames?: {\n option?: string;\n dropdown?: string;\n divider?: string;\n };\n buttonClassNames?: {\n root?: string;\n inner?: string;\n label?: string;\n section?: string;\n };\n children?: React.ReactNode;\n endSlot?: React.ReactNode;\n startSlot?: React.ReactNode;\n};\n\nexport const Menu = ({\n label,\n a11yLabel,\n classNames,\n buttonClassNames,\n children,\n endSlot,\n startSlot,\n ...props\n}: MenuProps) => {\n return (\n <DropdownBase\n setSelectedOption={() => {}}\n target={\n <Button\n classNames={buttonClassNames}\n {...(a11yLabel && { 'aria-label': a11yLabel })}\n >\n {label}\n </Button>\n }\n classNames={{\n dropdown: classNames?.dropdown ?? dropdown(),\n }}\n startSlot={startSlot}\n endSlot={endSlot}\n {...props}\n >\n {Children.map(children, (child: ReactNode, index: number) => {\n if (!isValidElement(child)) return null;\n\n const typeName = (child.type as { displayName?: string }).displayName;\n\n if (typeName === Menu.Option.displayName) {\n const { value, children } = child.props as MenuOptionProps;\n return (\n <DropdownBase.Option\n key={value}\n value={value}\n classNames={{ option: classNames?.option ?? comboboxOption() }}\n >\n {children}\n </DropdownBase.Option>\n );\n }\n\n if (typeName === Menu.Divider.displayName) {\n return (\n <DropdownBase.Divider\n key={`${child.type}-${index}`}\n classNames={{ divider: classNames?.divider ?? comboboxDivider() }}\n />\n );\n }\n })}\n </DropdownBase>\n );\n};\n\ntype MenuOptionProps = {\n value: string;\n children: React.ReactNode;\n};\n\nconst Option = ({ children }: MenuOptionProps) => {\n return children;\n};\nconst Divider = () => null;\n\nOption.displayName = 'Menu.Option';\nMenu.Option = Option;\n\nDivider.displayName = 'Menu.Divider';\nMenu.Divider = Divider;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Menu.js","names":["children"],"sources":["../../../../src/components/controls/dropdown/Menu.tsx"],"sourcesContent":["import { Children, isValidElement, type ReactNode } from 'react';\n\nimport {\n comboboxDivider,\n comboboxOption,\n comboboxOptions,\n dropdown,\n} from '@mage-ui/styled-system/recipes';\n// import type { FloatingPosition, PopoverWidth } from '@mantine/core';\nimport { Button } from '@/components/buttons';\n\nimport { DropdownBase, type DropdownBaseProps } from './DropdownBase';\n\nexport type MenuProps = Omit<\n DropdownBaseProps,\n 'setSelectedOption' | 'target' | 'opened'\n> & {\n label?: React.ReactNode;\n a11yLabel?: string;\n classNames?: {\n option?: string;\n dropdown?: string;\n divider?: string;\n };\n buttonClassNames?: {\n root?: string;\n inner?: string;\n label?: string;\n section?: string;\n };\n children?: React.ReactNode;\n endSlot?: React.ReactNode;\n startSlot?: React.ReactNode;\n};\n\nexport const Menu = ({\n label,\n a11yLabel,\n classNames,\n buttonClassNames,\n children,\n endSlot,\n startSlot,\n ...props\n}: MenuProps) => {\n return (\n <DropdownBase\n setSelectedOption={() => {}}\n target={\n <Button\n classNames={buttonClassNames}\n {...(a11yLabel && { 'aria-label': a11yLabel })}\n >\n {label}\n </Button>\n }\n classNames={{\n dropdown: classNames?.dropdown ?? dropdown(),\n options: classNames?.options ?? comboboxOptions(),\n }}\n startSlot={startSlot}\n endSlot={endSlot}\n {...props}\n >\n {Children.map(children, (child: ReactNode, index: number) => {\n if (!isValidElement(child)) return null;\n\n const typeName = (child.type as { displayName?: string }).displayName;\n\n if (typeName === Menu.Option.displayName) {\n const { value, children } = child.props as MenuOptionProps;\n return (\n <DropdownBase.Option\n key={value}\n value={value}\n classNames={{ option: classNames?.option ?? comboboxOption() }}\n >\n {children}\n </DropdownBase.Option>\n );\n }\n\n if (typeName === Menu.Divider.displayName) {\n return (\n <DropdownBase.Divider\n key={`${child.type}-${index}`}\n classNames={{ divider: classNames?.divider ?? comboboxDivider() }}\n />\n );\n }\n })}\n </DropdownBase>\n );\n};\n\ntype MenuOptionProps = {\n value: string;\n children: React.ReactNode;\n};\n\nconst Option = ({ children }: MenuOptionProps) => {\n return children;\n};\nconst Divider = () => null;\n\nOption.displayName = 'Menu.Option';\nMenu.Option = Option;\n\nDivider.displayName = 'Menu.Divider';\nMenu.Divider = Divider;\n"],"mappings":"8TAmCA,MAAa,GAAQ,CACnB,QACA,YACA,aACA,mBACA,WACA,UACA,YACA,GAAG,KAGD,EAAC,EAAA,CACC,sBAAyB,GACzB,OACE,EAAC,EAAA,CACC,WAAY,EACZ,GAAK,GAAa,CAAE,aAAc,EAAW,UAE5C,GACM,CAEX,WAAY,CACV,SAAU,GAAY,UAAY,GAAU,CAC5C,QAAS,GAAY,SAAW,GAAiB,CAClD,CACU,YACF,UACT,GAAI,WAEH,EAAS,IAAI,GAAW,EAAkB,IAAkB,CAC3D,GAAI,CAAC,EAAe,EAAM,CAAE,OAAO,KAEnC,IAAM,EAAY,EAAM,KAAkC,YAE1D,GAAI,IAAa,EAAK,OAAO,YAAa,CACxC,GAAM,CAAE,QAAO,SAAA,GAAa,EAAM,MAClC,OACE,EAAC,EAAa,OAAA,CAEL,QACP,WAAY,CAAE,OAAQ,GAAY,QAAU,GAAgB,CAAE,UAE7DA,GAJI,EAKe,CAI1B,GAAI,IAAa,EAAK,QAAQ,YAC5B,OACE,EAAC,EAAa,QAAA,CAEZ,WAAY,CAAE,QAAS,GAAY,SAAW,GAAiB,CAAE,CAAA,CAD5D,GAAG,EAAM,KAAK,GAAG,IAEtB,EAGN,EACW,CASb,GAAU,CAAE,cACT,EAEH,MAAgB,KAEtB,EAAO,YAAc,cACrB,EAAK,OAAS,EAEd,EAAQ,YAAc,eACtB,EAAK,QAAU"}
|
package/dist/panda.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mage-ui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.66",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"rimraf": "^6.0.1",
|
|
27
27
|
"tsdown": "^0.15.6",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
|
-
"@mage-ui/preset": "0.0.
|
|
30
|
-
"@mage-ui/styled-system": "0.0.
|
|
29
|
+
"@mage-ui/preset": "0.0.66",
|
|
30
|
+
"@mage-ui/styled-system": "0.0.66"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@hookform/resolvers": "^5.2.2",
|