@accelint/design-toolkit 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/action-bar/index.js +2 -0
- package/dist/components/action-bar/styles.d.ts +1 -1
- package/dist/components/action-bar/styles.js +1 -1
- package/dist/components/action-bar/styles.js.map +1 -1
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/chip/index.js +2 -0
- package/dist/components/classification-badge/index.js +3 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.d.ts +1 -1
- package/dist/components/classification-badge/styles.js +1 -1
- package/dist/components/classification-badge/styles.js.map +1 -1
- package/dist/components/classification-banner/index.js +3 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.d.ts +1 -1
- package/dist/components/classification-banner/styles.js +1 -1
- package/dist/components/classification-banner/styles.js.map +1 -1
- package/dist/components/color-picker/index.js +2 -0
- package/dist/components/combobox-field/index.js +2 -0
- package/dist/components/combobox-field/styles.d.ts +1 -1
- package/dist/components/combobox-field/styles.js +1 -1
- package/dist/components/combobox-field/styles.js.map +1 -1
- package/dist/components/date-field/index.js +2 -0
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +1 -1
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/details-list/index.js +2 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/styles.d.ts +1 -1
- package/dist/components/dialog/styles.js +1 -1
- package/dist/components/dialog/styles.js.map +1 -1
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/styles.d.ts +3 -3
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/hero/index.js +2 -0
- package/dist/components/hotkey/index.js +2 -0
- package/dist/components/icon/index.js +3 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/input/index.js +2 -0
- package/dist/components/label/index.js +2 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/link/styles.d.ts +1 -1
- package/dist/components/link/styles.js +1 -1
- package/dist/components/link/styles.js.map +1 -1
- package/dist/components/menu/index.js +2 -0
- package/dist/components/options/index.js +2 -0
- package/dist/components/options/styles.d.ts +1 -1
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/popover/index.js +2 -0
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/query-builder/action-element.js +2 -0
- package/dist/components/query-builder/group.js +2 -0
- package/dist/components/query-builder/rule.js +2 -0
- package/dist/components/query-builder/value-editor.js +2 -0
- package/dist/components/radio/index.js +2 -0
- package/dist/components/search-field/index.js +2 -0
- package/dist/components/select-field/index.js +2 -0
- package/dist/components/sidenav/index.d.ts +16 -3
- package/dist/components/sidenav/index.js +3 -1
- package/dist/components/sidenav/index.js.map +1 -1
- package/dist/components/sidenav/styles.d.ts +43 -1
- package/dist/components/sidenav/styles.js +1 -1
- package/dist/components/sidenav/styles.js.map +1 -1
- package/dist/components/sidenav/types.d.ts +40 -8
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/styles.d.ts +1 -1
- package/dist/components/slider/styles.js +1 -1
- package/dist/components/slider/styles.js.map +1 -1
- package/dist/components/switch/index.js +2 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/styles.d.ts +1 -1
- package/dist/components/tabs/styles.js +1 -1
- package/dist/components/tabs/styles.js.map +1 -1
- package/dist/components/text-area-field/index.js +2 -0
- package/dist/components/text-field/index.js +2 -0
- package/dist/components/tooltip/index.js +3 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.js +3 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/view-stack/index.js +2 -0
- package/dist/hooks/use-tree/actions/cache.js +1 -1
- package/dist/hooks/use-tree/actions/cache.js.map +1 -1
- package/dist/hooks/use-tree/actions/index.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/providers/theme-provider.js +2 -0
- package/dist/styles.css +43 -2
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/drawer/styles.ts"],"names":["DrawerStyles","tv","DrawerTitleStylesDefaults","DrawerTitleStyles","DrawerMenuStylesDefaults","DrawerMenuStyles"],"mappings":"mCAcO,MAAMA,EAAeC,EAAAA,CAAG,CAC7B,MAAO,CACL,MAAA,CAAQ,CAEN,6BAAA,CACA,8CAAA,CACA,4BACA,+CAAA,CACA,6BAAA,CAEA,mGACA,2BAAA,CACA,8CAAA,CAEA,2BAAA,CACA,6BAAA,CACA,8BAAA,CACA,6BAAA,CAGA,2CACA,0CAAA,CACA,8EAAA,CACA,+EAGA,iEAAA,CACA,0FAAA,CACA,wDACA,0BACF,CAAA,CACA,IAAA,CAAM,sEAAA,CACN,MAAA,CAAQ,CACN,eACA,gCAAA,CACA,uCAAA,CACA,gDAGA,qGAAA,CACA,iHAAA,CACA,0GACA,6GAAA,CAGA,6DAAA,CACA,mEAAA,CACA,+DAAA,CACA,iEAAA,CAGA,kHAAA,CACA,6HACA,oHAAA,CACA,0HACF,EACA,KAAA,CAAO,CACL,2CACA,wBAAA,CACA,sPAAA,CACA,yPAAA,CACA,mPAAA,CACA,4PACF,CAAA,CACA,KAAM,sBAAA,CACN,OAAA,CAAS,CACP,iEACF,CAAA,CACA,OAAQ,CAAC,6DAA6D,CAAA,CACtE,MAAA,CAAQ,6DACV,CACF,CAAC,CAAA,CAEYC,CAAAA,CAA4B,CACvC,KAAA,CAAO,CACT,EAEaC,CAAAA,CAAoBF,EAAAA,CAAG,CAClC,IAAA,CAAM,wBAAA,CACN,QAAA,CAAU,CACR,KAAA,CAAO,CACL,EAAG,EAAA,CACH,CAAA,CAAG,GACH,CAAA,CAAG,EAAA,CACH,CAAA,CAAG,EAAA,CACH,CAAA,CAAG,EAAA,CACH,EAAG,EACL,CACF,EACA,gBAAA,CAAkB,CAChB,CACE,KAAA,CAAO,CAAC,CAAA,CAAG,CAAA,CAAG,CAAC,CAAA,CACf,UAAW,eACb,CAAA,CACA,CACE,KAAA,CAAO,CAAC,EAAG,CAAA,CAAG,CAAC,CAAA,CACf,SAAA,CAAW,eACb,CACF,EACA,eAAA,CAAiBC,CACnB,CAAC,CAAA,CAEYE,CAAAA,CAA2B,CACtC,QAAA,CAAU,QACZ,CAAA,CAEaC,CAAAA,CAAmBJ,EAAAA,CAAG,CACjC,MAAO,CACL,IAAA,CAAM,CACJ,oDAAA,CAGA,0LAAA,CACA,uMACA,mHAAA,CACA,gJAAA,CAEA,kFAAA,CACA,uIAAA,CACA,0GAAA,CACA,0IACF,EACA,IAAA,CAAM,CACJ,4CACA,yDAAA,CACA,gBAAA,CAEA,mDAEA,kEAAA,CAEA,uBAAA,CAEA,kDACF,CACF,CAAA,CACA,QAAA,CAAU,CACR,QAAA,CAAU,CACR,MAAO,CACL,IAAA,CAAM,CACJ,kFAAA,CACA,oFAAA,CACA,gFAAA,CACA,sFACF,CACF,CAAA,CACA,OAAQ,CACN,IAAA,CAAM,CACJ,kFAAA,CACA,oFAAA,CACA,kFACA,uFACF,CACF,CAAA,CACA,GAAA,CAAK,CACH,IAAA,CAAM,CACJ,kFAAA,CACA,oFAAA,CACA,kFACA,uFACF,CACF,CACF,CACF,CAAA,CACA,eAAA,CAAiBG,CACnB,CAAC","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from 'tailwind-variants';\n\nexport const DrawerStyles = tv({\n slots: {\n layout: [\n //properties\n '[--drawer-main-row-start:1]', //top overlay\n 'data-[push~=top]:[--drawer-main-row-start:2]',\n '[--drawer-main-row-end:4]', //bottom overlay\n 'data-[push~=bottom]:[--drawer-main-row-end:3]',\n '[--drawer-main-col-start:1]', //left overlay\n // biome-ignore lint/style/noUnusedTemplateLiteral: This is necessary to properly evaulate \\/\n `data-[push~=left]:[--drawer-main-col-start:2] has-[.group\\\\/sidenav]:[--drawer-main-col-start:2]`,\n '[--drawer-main-col-end:4]', //right overlay\n 'data-[push~=right]:[--drawer-main-col-end:3]',\n\n '[--drawer-menu-size:40px]',\n '[--drawer-size-small:100px]',\n '[--drawer-size-medium:200px]',\n '[--drawer-size-large:400px]',\n\n //Grid template definitions\n '[--route-layout-grid-cols:auto_1fr_auto]',\n '[--route-layout-grid-rows:auto_1fr_auto]',\n '[--drawer-main-cols:var(--drawer-main-col-start)/var(--drawer-main-col-end)]',\n '[--drawer-main-rows:var(--drawer-main-row-start)/var(--drawer-main-row-end)]',\n\n //container\n 'group/layout relative top-[var(--classification-banner-height)]',\n 'grid grid-cols-[var(--route-layout-grid-cols)] grid-rows-[var(--route-layout-grid-rows)]',\n 'transition-[grid-template-columns,grid-template-rows]',\n 'h-full max-h-full w-full',\n ],\n main: 'relative col-[var(--drawer-main-cols)] row-[var(--drawer-main-rows)]',\n drawer: [\n 'group/drawer',\n 'bg-surface-default text-body-m',\n 'relative flex h-full min-h-0 flex-col',\n 'pointer-events-none [&>*]:pointer-events-auto',\n\n //Base positioning\n 'placement-top:col-start-2 placement-top:col-end-3 placement-top:row-start-1 placement-top:row-end-2',\n 'placement-bottom:col-start-2 placement-bottom:col-end-3 placement-bottom:row-start-3 placement-bottom:row-end-4',\n 'placement-left:col-start-1 placement-left:col-end-2 placement-left:row-start-2 placement-left:row-end-3',\n 'placement-right:col-start-3 placement-right:col-end-4 placement-right:row-start-2 placement-right:row-end-3',\n\n //Extend positioning\n 'group-data-[extend~=top]/layout:placement-top:col-span-full',\n 'group-data-[extend~=bottom]/layout:placement-bottom:col-span-full',\n 'group-data-[extend~=left]/layout:placement-left:row-span-full',\n 'group-data-[extend~=right]/layout:placement-right:row-span-full',\n\n //Extend fitment\n 'group-data-[extend=top]/layout:placement-left:row-end-4 group-data-[extend=top]/layout:placement-right:row-end-4',\n 'group-data-[extend=bottom]/layout:placement-left:row-start-1 group-data-[extend=bottom]/layout:placement-right:row-start-1',\n 'group-data-[extend=left]/layout:placement-bottom:col-end-4 group-data-[extend=left]/layout:placement-top:col-end-4',\n 'group-data-[extend=right]/layout:placement-bottom:col-start-1 group-data-[extend=right]/layout:placement-top:col-start-1',\n ],\n panel: [\n 'hidden h-full min-h-0 flex-col gap-s p-l',\n 'group-open/drawer:flex',\n 'group-placement-left/drawer:group-size-large/drawer:w-[var(--drawer-size-large)] group-placement-left/drawer:group-size-medium/drawer:w-[var(--drawer-size-medium)] group-placement-left/drawer:group-size-small/drawer:w-[var(--drawer-size-small)]',\n 'group-placement-right/drawer:group-size-large/drawer:w-[var(--drawer-size-large)] group-placement-right/drawer:group-size-medium/drawer:w-[var(--drawer-size-medium)] group-placement-right/drawer:group-size-small/drawer:w-[var(--drawer-size-small)]',\n 'group-placement-top/drawer:group-size-large/drawer:h-[var(--drawer-size-large)] group-placement-top/drawer:group-size-medium/drawer:h-[var(--drawer-size-medium)] group-placement-top/drawer:group-size-small/drawer:h-[var(--drawer-size-small)]',\n 'group-placement-bottom/drawer:group-size-large/drawer:h-[var(--drawer-size-large)] group-placement-bottom/drawer:group-size-medium/drawer:h-[var(--drawer-size-medium)] group-placement-bottom/drawer:group-size-small/drawer:h-[var(--drawer-size-small)]',\n ],\n view: 'flex h-full flex-col',\n content: [\n 'fg-primary-bold flex max-h-full flex-1 flex-col overflow-y-auto',\n ],\n header: ['mb-s flex flex-row items-center justify-between pt-px pr-px'],\n footer: 'fg-primary-bold mt-s flex flex-row items-center justify-end',\n },\n});\n\nexport const DrawerTitleStylesDefaults = {\n level: 2,\n} as const;\n\nexport const DrawerTitleStyles = tv({\n base: 'fg-primary-bold w-full',\n variants: {\n level: {\n 1: '',\n 2: '',\n 3: '',\n 4: '',\n 5: '',\n 6: '',\n },\n },\n compoundVariants: [\n {\n level: [1, 2, 3],\n className: 'text-header-l',\n },\n {\n level: [4, 5, 6],\n className: 'text-header-m',\n },\n ],\n defaultVariants: DrawerTitleStylesDefaults,\n});\n\nexport const DrawerMenuStylesDefaults = {\n position: 'center',\n} as const;\n\nexport const DrawerMenuStyles = tv({\n slots: {\n menu: [\n 'absolute flex rounded-large bg-surface-default p-s',\n\n //horizontal\n 'group-placement-top/drawer:transform-[translateX(-50%)] group-placement-top/drawer:left-[50%] group-placement-top/drawer:h-[var(--drawer-menu-size)] group-placement-top/drawer:flex-row',\n 'group-placement-bottom/drawer:transform-[translateX(-50%)] group-placement-bottom/drawer:left-[50%] group-placement-bottom/drawer:h-[var(--drawer-menu-size)] group-placement-bottom/drawer:flex-row',\n 'group-placement-bottom/drawer:-translate-y-[var(--drawer-menu-size)] group-placement-bottom/drawer:rounded-b-none',\n 'group-placement-top/drawer:bottom-0 group-placement-top/drawer:translate-y-[var(--drawer-menu-size)] group-placement-top/drawer:rounded-t-none',\n //vertical\n 'group-placement-left/drawer:left-full group-placement-left/drawer:rounded-l-none',\n 'group-placement-left/drawer:w-[var(--drawer-menu-size)] group-placement-left/drawer:flex-col group-placement-left/drawer:items-center',\n 'group-placement-right/drawer:-left-[var(--drawer-menu-size)] group-placement-right/drawer:rounded-r-none',\n 'group-placement-right/drawer:w-[var(--drawer-menu-size)] group-placement-right/drawer:flex-col group-placement-right/drawer:items-center',\n ],\n item: [\n 'flex flex-col items-center justify-center',\n 'sudo:fg-primary-muted !p-xs cursor-pointer outline-none',\n 'rounded-medium',\n //hover\n 'sudo:hover:fg-primary-bold hover:!bg-transparent',\n //selected\n 'selected:fg-accent-primary-bold selected:bg-accent-primary-muted',\n //focused\n 'focus:fg-primary-bold',\n //disabled\n 'disabled:fg-disabled disabled:cursor-not-allowed',\n ],\n },\n variants: {\n position: {\n start: {\n menu: [\n 'group-placement-left/drawer:-translate-y-1/2 group-placement-left/drawer:top-1/8',\n 'group-placement-right/drawer:-translate-y-1/2 group-placement-right/drawer:top-1/8',\n 'group-placement-top/drawer:left-1/8 group-placement-top/drawer:translate-x-1/4',\n 'group-placement-bottom/drawer:left-1/8 group-placement-bottom/drawer:translate-x-1/4',\n ],\n },\n center: {\n menu: [\n 'group-placement-left/drawer:-translate-y-1/2 group-placement-left/drawer:top-1/2',\n 'group-placement-right/drawer:-translate-y-1/2 group-placement-right/drawer:top-1/2',\n 'group-placement-top/drawer:-translate-x-1/8 group-placement-top/drawer:left-1/2',\n 'group-placement-bottom/drawer:-translate-x-1/8 group-placement-bottom/drawer:left-1/2',\n ],\n },\n end: {\n menu: [\n 'group-placement-left/drawer:-translate-y-7/2 group-placement-left/drawer:top-7/8',\n 'group-placement-right/drawer:-translate-y-7/8 group-placement-right/drawer:top-7/8',\n 'group-placement-top/drawer:-translate-x-1/2 group-placement-top/drawer:left-7/8',\n 'group-placement-bottom/drawer:-translate-x-1/2 group-placement-bottom/drawer:left-7/8',\n ],\n },\n },\n },\n defaultVariants: DrawerMenuStylesDefaults,\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/drawer/styles.ts"],"names":["e","DrawerTitleStyles","DrawerMenuStyles"],"mappings":"6CAeS,CACLA,EAAA,CAAA,CAAA,KAEE,CAAA,CAAA,MAAA,CAAA,CAAA,6BACA,CAAA,0EAEA,CAAA,+CACA,CAAA,gIAGA,CAAA,2BACA,CAAA,8CAEA,CAAA,2BACA,CAAA,6BACA,CAAA,8BACA,CAAA,wEAIA,CAAA,0CACA,CAAA,6JAIA,CAAA,iEACA,CAAA,kJAEA,CAAA,0BAEI,CAAA,CAAA,IAAA,CAAA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,CAAA,IAAA,CAAA,CAAA,kFACA,CAAA,sKAEA,CAAA,uFAIF,CAAA,CAAA,CAAM,GACJ,CAAA,CAAA,IAAA,CAAA,CAAA,kFACA,CAAA,sKAEA,CAAA,uFAKR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const DrawerStyles = tv({\n slots: {\n layout: [\n //properties\n '[--drawer-main-row-start:1]', //top overlay\n 'data-[push~=top]:[--drawer-main-row-start:2]',\n '[--drawer-main-row-end:4]', //bottom overlay\n 'data-[push~=bottom]:[--drawer-main-row-end:3]',\n '[--drawer-main-col-start:1]', //left overlay\n // biome-ignore lint/style/noUnusedTemplateLiteral: This is necessary to properly evaulate \\/\n `data-[push~=left]:[--drawer-main-col-start:2] has-[.group\\\\/sidenav]:[--drawer-main-col-start:2]`,\n '[--drawer-main-col-end:4]', //right overlay\n 'data-[push~=right]:[--drawer-main-col-end:3]',\n\n '[--drawer-menu-size:40px]',\n '[--drawer-size-small:100px]',\n '[--drawer-size-medium:200px]',\n '[--drawer-size-large:400px]',\n\n //Grid template definitions\n '[--route-layout-grid-cols:auto_1fr_auto]',\n '[--route-layout-grid-rows:auto_1fr_auto]',\n '[--drawer-main-cols:var(--drawer-main-col-start)/var(--drawer-main-col-end)]',\n '[--drawer-main-rows:var(--drawer-main-row-start)/var(--drawer-main-row-end)]',\n\n //container\n 'group/layout relative top-[var(--classification-banner-height)]',\n 'grid grid-cols-[var(--route-layout-grid-cols)] grid-rows-[var(--route-layout-grid-rows)]',\n 'transition-[grid-template-columns,grid-template-rows]',\n 'h-full max-h-full w-full',\n ],\n main: 'relative col-[var(--drawer-main-cols)] row-[var(--drawer-main-rows)]',\n drawer: [\n 'group/drawer',\n 'bg-surface-default text-body-m',\n 'relative flex h-full min-h-0 flex-col',\n 'pointer-events-none [&>*]:pointer-events-auto',\n\n //Base positioning\n 'placement-top:col-start-2 placement-top:col-end-3 placement-top:row-start-1 placement-top:row-end-2',\n 'placement-bottom:col-start-2 placement-bottom:col-end-3 placement-bottom:row-start-3 placement-bottom:row-end-4',\n 'placement-left:col-start-1 placement-left:col-end-2 placement-left:row-start-2 placement-left:row-end-3',\n 'placement-right:col-start-3 placement-right:col-end-4 placement-right:row-start-2 placement-right:row-end-3',\n\n //Extend positioning\n 'group-data-[extend~=top]/layout:placement-top:col-span-full',\n 'group-data-[extend~=bottom]/layout:placement-bottom:col-span-full',\n 'group-data-[extend~=left]/layout:placement-left:row-span-full',\n 'group-data-[extend~=right]/layout:placement-right:row-span-full',\n\n //Extend fitment\n 'group-data-[extend=top]/layout:placement-left:row-end-4 group-data-[extend=top]/layout:placement-right:row-end-4',\n 'group-data-[extend=bottom]/layout:placement-left:row-start-1 group-data-[extend=bottom]/layout:placement-right:row-start-1',\n 'group-data-[extend=left]/layout:placement-bottom:col-end-4 group-data-[extend=left]/layout:placement-top:col-end-4',\n 'group-data-[extend=right]/layout:placement-bottom:col-start-1 group-data-[extend=right]/layout:placement-top:col-start-1',\n ],\n panel: [\n 'hidden h-full min-h-0 flex-col gap-s p-l',\n 'group-open/drawer:flex',\n 'group-placement-left/drawer:group-size-large/drawer:w-[var(--drawer-size-large)] group-placement-left/drawer:group-size-medium/drawer:w-[var(--drawer-size-medium)] group-placement-left/drawer:group-size-small/drawer:w-[var(--drawer-size-small)]',\n 'group-placement-right/drawer:group-size-large/drawer:w-[var(--drawer-size-large)] group-placement-right/drawer:group-size-medium/drawer:w-[var(--drawer-size-medium)] group-placement-right/drawer:group-size-small/drawer:w-[var(--drawer-size-small)]',\n 'group-placement-top/drawer:group-size-large/drawer:h-[var(--drawer-size-large)] group-placement-top/drawer:group-size-medium/drawer:h-[var(--drawer-size-medium)] group-placement-top/drawer:group-size-small/drawer:h-[var(--drawer-size-small)]',\n 'group-placement-bottom/drawer:group-size-large/drawer:h-[var(--drawer-size-large)] group-placement-bottom/drawer:group-size-medium/drawer:h-[var(--drawer-size-medium)] group-placement-bottom/drawer:group-size-small/drawer:h-[var(--drawer-size-small)]',\n ],\n view: 'flex h-full flex-col',\n content: [\n 'fg-primary-bold flex max-h-full flex-1 flex-col overflow-y-auto',\n ],\n header: ['mb-s flex flex-row items-center justify-between pt-px pr-px'],\n footer: 'fg-primary-bold mt-s flex flex-row items-center justify-end',\n },\n});\n\nexport const DrawerTitleStylesDefaults = {\n level: 2,\n} as const;\n\nexport const DrawerTitleStyles = tv({\n base: 'fg-primary-bold w-full',\n variants: {\n level: {\n 1: '',\n 2: '',\n 3: '',\n 4: '',\n 5: '',\n 6: '',\n },\n },\n compoundVariants: [\n {\n level: [1, 2, 3],\n className: 'text-header-l',\n },\n {\n level: [4, 5, 6],\n className: 'text-header-m',\n },\n ],\n defaultVariants: DrawerTitleStylesDefaults,\n});\n\nexport const DrawerMenuStylesDefaults = {\n position: 'center',\n} as const;\n\nexport const DrawerMenuStyles = tv({\n slots: {\n menu: [\n 'absolute flex rounded-large bg-surface-default p-s',\n\n //horizontal\n 'group-placement-top/drawer:transform-[translateX(-50%)] group-placement-top/drawer:left-[50%] group-placement-top/drawer:h-[var(--drawer-menu-size)] group-placement-top/drawer:flex-row',\n 'group-placement-bottom/drawer:transform-[translateX(-50%)] group-placement-bottom/drawer:left-[50%] group-placement-bottom/drawer:h-[var(--drawer-menu-size)] group-placement-bottom/drawer:flex-row',\n 'group-placement-bottom/drawer:-translate-y-[var(--drawer-menu-size)] group-placement-bottom/drawer:rounded-b-none',\n 'group-placement-top/drawer:bottom-0 group-placement-top/drawer:translate-y-[var(--drawer-menu-size)] group-placement-top/drawer:rounded-t-none',\n //vertical\n 'group-placement-left/drawer:left-full group-placement-left/drawer:rounded-l-none',\n 'group-placement-left/drawer:w-[var(--drawer-menu-size)] group-placement-left/drawer:flex-col group-placement-left/drawer:items-center',\n 'group-placement-right/drawer:-left-[var(--drawer-menu-size)] group-placement-right/drawer:rounded-r-none',\n 'group-placement-right/drawer:w-[var(--drawer-menu-size)] group-placement-right/drawer:flex-col group-placement-right/drawer:items-center',\n ],\n item: [\n 'flex flex-col items-center justify-center',\n 'sudo:fg-primary-muted !p-xs cursor-pointer outline-none',\n 'rounded-medium',\n //hover\n 'sudo:hover:fg-primary-bold hover:!bg-transparent',\n //selected\n 'selected:fg-accent-primary-bold selected:bg-accent-primary-muted',\n //focused\n 'focus:fg-primary-bold',\n //disabled\n 'disabled:fg-disabled disabled:cursor-not-allowed',\n ],\n },\n variants: {\n position: {\n start: {\n menu: [\n 'group-placement-left/drawer:-translate-y-1/2 group-placement-left/drawer:top-1/8',\n 'group-placement-right/drawer:-translate-y-1/2 group-placement-right/drawer:top-1/8',\n 'group-placement-top/drawer:left-1/8 group-placement-top/drawer:translate-x-1/4',\n 'group-placement-bottom/drawer:left-1/8 group-placement-bottom/drawer:translate-x-1/4',\n ],\n },\n center: {\n menu: [\n 'group-placement-left/drawer:-translate-y-1/2 group-placement-left/drawer:top-1/2',\n 'group-placement-right/drawer:-translate-y-1/2 group-placement-right/drawer:top-1/2',\n 'group-placement-top/drawer:-translate-x-1/8 group-placement-top/drawer:left-1/2',\n 'group-placement-bottom/drawer:-translate-x-1/8 group-placement-bottom/drawer:left-1/2',\n ],\n },\n end: {\n menu: [\n 'group-placement-left/drawer:-translate-y-7/2 group-placement-left/drawer:top-7/8',\n 'group-placement-right/drawer:-translate-y-7/8 group-placement-right/drawer:top-7/8',\n 'group-placement-top/drawer:-translate-x-1/2 group-placement-top/drawer:left-7/8',\n 'group-placement-bottom/drawer:-translate-x-1/2 group-placement-bottom/drawer:left-7/8',\n ],\n },\n },\n },\n defaultVariants: DrawerMenuStylesDefaults,\n});\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {Text,useContextProps,Provider,HeadingContext,TextContext,Header,Heading}from'react-aria-components';import {containsExactChildren}from'./../../lib/react.js';import {Icon,IconContext}from'../icon/index.js';import {HeroStyles}from'./styles.js';const {hero:b,icon:f,title:P,subtitle:S}=HeroStyles(),g=createContext(null);function e({ref:o,...a}){[a,o]=useContextProps(a,o??null,g);const{children:l,classNames:t,compact:i,...s}=a;return containsExactChildren({children:l,componentName:e.displayName,restrictions:[[Icon,{min:1,max:1}],[e.Title,{min:1,max:1}],[e.Subtitle,{min:0}]]}),jsx(Provider,{values:[[IconContext,{className:f({className:t?.icon}),size:"large"}],[HeadingContext,{className:P({className:t?.title}),level:2}],[TextContext,{className:S({className:t?.subtitle})}]],children:jsx(Header,{...s,ref:o,className:b({className:t?.hero}),"data-layout":i?"grid":"stack",children:l})})}e.displayName="Hero",e.Title=Heading,e.Title.displayName="Hero.Title",e.Subtitle=Text,e.Subtitle.displayName="Hero.Subtitle";export{e as Hero,g as HeroContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Keyboard}from'react-aria-components';import {Icon}from'../icon/index.js';import {HotkeyStyles,HotkeyStylesDefaults}from'./styles.js';const {key:c,set:v}=HotkeyStyles(),y=createContext(null);function i({children:e,...o}){return jsx(y.Provider,{value:o,children:e})}i.displayName="Hotkey.Provider";function s({ref:e,children:o,...t}){[t,e]=useContextProps(t,e??null,y);const{className:a,variant:l=HotkeyStylesDefaults.variant}=t;return jsx(Keyboard,{ref:e,...t,className:c({className:a,variant:l}),children:o})}s.displayName="Hotkey";function n({children:e,...o}){const{className:t}=o;return jsx("div",{className:v({className:t}),children:jsx(Icon.Provider,{size:"large",children:e})})}n.displayName="Hotkey.Set",s.Set=n,s.Provider=i;export{s as Hotkey,y as HotkeyContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps}from'react-aria-components';import {IconStyles}from'./styles.js';const r=createContext(null);function t({children:o,...e}){return jsx(r.Provider,{value:e,children:o})}t.displayName="Icon.Provider";function n({ref:o,...e}){[e,o]=useContextProps(e,o??null,r);const{children:s,className:p,size:c="medium",...m}=e;return jsx("span",{...m,ref:o,className:IconStyles({className:p}),"data-size":c,children:s})}n.displayName="Icon",n.Provider=t;export{n as Icon,r as IconContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"mLAqBEA,MAAwD,CAAA,CAAAC,aAAA,CAAI,IAE9D,EAAA,oBAAkC,CAAA,CAAGC,CAAM,GACzC,WAAoBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,gBAC/B,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,2BA+BN,CAAA,SAAgB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,CAAAA,CAAOG,CAAG,EAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,gBAAkB,CAAA,CAAA,CAAA,QAAaE,CAAK,GAAIL,CAE1D,WACGC,GAAA,CAAA,OACKI,CAAAA,GACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,SAAwB,CAAAG,UAAA,CAAA,CAAA,UACxB,CAAA,CAAA,CAAA,CAAA,sBAKN,CACAC,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWL,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { IconStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLSpanElement>>(null);\n\nfunction IconProvider({ children, ...props }: ProviderProps<IconProps>) {\n return <IconContext.Provider value={props}>{children}</IconContext.Provider>;\n}\nIconProvider.displayName = 'Icon.Provider';\n\n/**\n * Icon - A wrapper component for displaying SVG icons with consistent sizing\n *\n * Provides a standardized container for SVG icons with built-in size variants and\n * proper accessibility support. Works seamlessly with the Accelint icon library\n * and supports custom SVG elements with consistent styling and alignment.\n *\n * @example\n * // Basic icon usage\n * <Icon>\n * <Settings />\n * </Icon>\n *\n * @example\n * // Icon with different sizes\n * <Icon size=\"small\">\n * <User />\n * </Icon>\n * <Icon size=\"large\">\n * <Dashboard />\n * </Icon>\n *\n * @example\n * // Icon in button context (automatically inherits sizing)\n * <Button>\n * <Icon><Plus /></Icon>\n * Add Item\n * </Button>\n */\nexport function Icon({ ref, ...props }: IconProps) {\n [props, ref] = useContextProps(props, ref ?? null, IconContext);\n\n const { children, className, size = 'medium', ...rest } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={IconStyles({ className })}\n data-size={size}\n >\n {children}\n </span>\n );\n}\nIcon.displayName = 'Icon';\nIcon.Provider = IconProvider;\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {CancelFill}from'@accelint/icons';import {useControlledState}from'@react-stately/utils';import {createContext}from'react';import {useContextProps,InputContext,Input,composeRenderProps}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {InputStyles,InputStylesDefaults}from'./styles.js';const {container:w,sizer:A,input:B,clear:F}=InputStyles(),v={target:{value:""}},K=createContext(null);function k({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps({...a},t??null,K);const{classNames:u,autoSize:r,defaultValue:h="",disabled:i,placeholder:d,readOnly:c,required:m,size:f="medium",type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[s,b]=useControlledState(g,h),z=(`${s??""}`.length||d?.length)??0,I=s==null||s==="";function p(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:u?.container,autoSize:r,type:l,isClearable:n}),"data-disabled":i||null,"data-empty":I||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!d&&I||null,"data-readonly":c||null,"data-required":m||null,"data-size":f,children:[jsx("div",{className:A({className:u?.sizer,autoSize:r,type:l,isClearable:n}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(u?.input,e=>B({className:e,autoSize:r,type:l,isClearable:n})),disabled:i,placeholder:d,readOnly:c,required:m,type:l,value:s,onChange:p,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&p(v);}})}),n&&jsx(Button,{className:composeRenderProps(u?.clear,e=>F({className:e,autoSize:r,type:l,isClearable:n})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:i,onPress:()=>{p(v),t?.current?.focus();},children:jsx(Icon,{children:jsx(CancelFill,{})})})]})}k.displayName="Input";export{k as Input,K as InputContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Label}from'react-aria-components';import {LabelStyles}from'./styles.js';const o=createContext(null);function t({children:r,...e}){return jsx(o.Provider,{value:e,children:r})}t.displayName="Label.Provider";function a({ref:r,...e}){[e,r]=useContextProps(e,r??null,o);const{children:i,className:s,isDisabled:n,isRequired:l,...p}=e;return jsxs(Label,{...p,className:LabelStyles({className:s}),"data-disabled":n||null,"data-required":l||null,children:[i,!l&&" (optional)"]})}a.displayName="Label",a.Provider=t;export{a as Label,o as LabelContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {useContextProps,LinkContext,Link,composeRenderProps}from'react-aria-components';import {LinkStyles}from'./styles.js';function o({children:i,...r}){return jsx(LinkContext.Provider,{value:r,children:i})}o.displayName="Link.Provider";function s({ref:i,...r}){[r,i]=useContextProps(r,i??null,LinkContext);const{allowsVisited:n=false,className:l,isVisited:p=false,...a}=r;return jsx(Link,{...a,ref:i,className:composeRenderProps(l,d=>LinkStyles({className:d})),"data-visited":n&&p||null})}s.displayName="Link",s.Provider=o;export{s as Link};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
|
|
3
|
-
declare const LinkStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], unknown, unknown
|
|
3
|
+
declare const LinkStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], unknown, unknown>>;
|
|
4
4
|
|
|
5
5
|
export { LinkStyles };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const a=tv({base:["inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom","enabled:fg-accent-primary-bold","enabled:hover:fg-accent-primary-hover enabled:hover:bg-interactive-bold-hover","enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-interactive-bold-hover","enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-interactive-bold-pressed","disabled:fg-disabled disabled:cursor-not-allowed"]});export{a as LinkStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/link/styles.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/link/styles.tsx"],"names":["e"],"mappings":"sCAeE,MAAM,CACJ,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,8GAEA,CAAA,+EACA,CAAA,+FACA,CAAA,uFACA,CAAA,kDAEH,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const LinkStyles = tv({\n base: [\n 'inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom',\n 'enabled:fg-accent-primary-bold',\n 'enabled:hover:fg-accent-primary-hover enabled:hover:bg-interactive-bold-hover',\n 'enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-interactive-bold-hover',\n 'enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-interactive-bold-pressed',\n 'disabled:fg-disabled disabled:cursor-not-allowed',\n ],\n});\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import T from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {useContextProps,Popover,composeRenderProps,Menu,MenuTrigger,SubmenuTrigger,MenuSection,Header,Collection,Separator,Text,MenuItem,Provider,KeyboardContext,DEFAULT_SLOT}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {IconContext,Icon}from'../icon/index.js';import {MenuStyles,MenuStylesDefaults}from'./styles.js';const {menu:U,icon:_,item:q,label:z,description:B,more:G,section:J,header:Q,separator:W,hotkey:X,popover:Y}=MenuStyles(),d=createContext(null);function P({children:t,classNames:e,items:n,title:a,...s}){return jsxs(MenuSection,{...s,className:J({className:e?.section}),children:[a&&jsx(Header,{className:Q({className:e?.header}),children:a}),jsx(Collection,{items:n,children:t})]})}P.displayName="Menu.Section";function S({className:t,...e}){return jsx(Separator,{...e,className:W({className:t})})}S.displayName="Menu.Separator";function N({children:t,className:e,...n}){return jsx(Text,{...n,slot:"label",className:z({className:e}),children:t})}N.displayName="Menu.Item.Label";function v({children:t,className:e,...n}){return jsx(Text,{...n,slot:"description",className:B({className:e}),children:t})}v.displayName="Menu.Item.Description";function m({children:t,classNames:e,color:n="info",...a}){const s=useContext(d),l=(isSlottedContextValue(s)?void 0:s?.variant)??MenuStylesDefaults.variant;return jsx(MenuItem,{...a,className:composeRenderProps(e?.item,r=>q({className:r,variant:l})),"data-color":n,children:composeRenderProps(t,(r,{hasSubmenu:p})=>jsxs(Provider,{values:[[KeyboardContext,{className:X({className:e?.hotkey})}],[IconContext,{slots:{[DEFAULT_SLOT]:{className:_({className:e?.icon})},submenu:{className:G({className:e?.more})}}}]],children:[typeof r=="string"?jsx(Text,{slot:"label",className:e?.text,children:r}):r,p&&jsx(Icon,{slot:"submenu",children:jsx(T,{})})]}))})}m.displayName="Menu.Item",m.Label=N,m.Description=v;function i({ref:t,...e}){[e,t]=useContextProps(e,t??null,d);const{children:n,classNames:a,popoverProps:s,selectionMode:l="single",variant:r=MenuStylesDefaults.variant,...p}=e;return jsx(Popover,{...s,className:composeRenderProps(a?.popover,c=>Y({className:c})),children:jsx(d.Provider,{value:{variant:r},children:jsx(Menu,{...p,ref:t,className:composeRenderProps(a?.menu,c=>U({className:c,variant:r})),selectionMode:l,children:n})})})}i.displayName="Menu",i.Trigger=MenuTrigger,i.Submenu=SubmenuTrigger,i.Item=m,i.Separator=S,i.Section=P;export{i as Menu,d as MenuContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,ListBox,composeRenderProps,ListBoxSection,Header,Collection,Text,ListBoxItem}from'react-aria-components';import {Icon}from'../icon/index.js';import {OptionsStyles}from'./styles.js';const {list:S,section:b,header:B,item:v,content:z,icon:H,label:V,description:g}=OptionsStyles(),E=createContext(null);function O({children:t,classNames:e,header:n,items:i}){return jsxs(ListBoxSection,{id:n,className:b({className:e?.section}),children:[jsx(Header,{className:B({className:e?.header}),children:n}),jsx(Collection,{items:i,children:t})]})}O.displayName="Options.Section";function I({className:t,...e}){return jsx("div",{...e,className:z({className:t})})}I.displayName="Options.Item.Content";function r({className:t,...e}){return jsx(Text,{...e,slot:"label",className:V({className:t})})}r.displayName="Options.Item.Label";function x({className:t,...e}){return jsx(Text,{...e,slot:"description",className:g({className:t})})}x.displayName="Options.Item.Description";function p({children:t,classNames:e,color:n="info",textValue:i=typeof t=="string"?t:"",...a}){return jsx(ListBoxItem,{...a,className:composeRenderProps(e?.item,s=>v({className:s})),textValue:i,"data-color":n,children:composeRenderProps(t,s=>jsx(Icon.Provider,{className:H({className:e?.icon}),size:"small",children:typeof s=="string"?jsx(r,{children:s}):s}))})}p.displayName="Options.Item",p.Label=r,p.Content=I,p.Description=x;function l({ref:t,...e}){[e,t]=useContextProps(e,t??null,E);const{children:n,className:i,size:a,...s}=e;return jsx(ListBox,{...s,ref:t,className:composeRenderProps(i,d=>S({className:d})),"data-size":a,children:n})}l.displayName="Options",l.Item=p,l.Section=O;export{l as Options,E as OptionsContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const i=tv({slots:{list:"group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static",section:"mt-s",header:"fg-primary-muted m-xs my-s text-header-xs",item:["group/options-item fg-primary-bold flex items-center gap-s p-s text-body-s outline outline-transparent","group-size-small/options:pt-xs group-size-small/options:pb-xs","group-size-large/options:pt-s group-size-large/options:pb-s","enabled:cursor-pointer","enabled:hover:fg-a11y-on-accent","enabled:focus-visible:fg-a11y-on-accent enabled:focus-visible:outline-interactive-hover","enabled:focus-visible:color-info:bg-accent-primary-bold","enabled:hover:color-info:bg-accent-primary-bold","enabled:hover:color-serious:bg-serious-bold","enabled:focus-visible:color-serious:bg-serious-bold","disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent"],content:"flex min-w-0 flex-auto flex-col gap-xxs",icon:["group-enabled/options-item:group-color-info/options-item:fg-primary-bold","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-a11y-on-accent","group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-a11y-on-accent","group-enabled/options-item:group-color-serious/options-item:fg-serious-bold","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-a11y-on-accent","group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-a11y-on-accent"],label:["truncate","group-enabled/options-item:group-color-info/options-item:fg-primary-bold","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-a11y-on-accent","group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-a11y-on-accent","group-enabled/options-item:group-color-serious/options-item:fg-serious-bold","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-a11y-on-accent","group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-a11y-on-accent"],description:["group-enabled/options-item:fg-primary-muted truncate text-body-xs","group-enabled/options-item:group-hover/options-item:fg-a11y-on-accent","group-enabled/options-item:group-focus-visible/options-item:fg-a11y-on-accent","group-disabled/options-item:fg-disabled"]}});export{i as OptionsStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/options/styles.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/options/styles.ts"],"names":["o"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,+IACG,CAAA,OACT,CAAA,MAAQ,CAAA,MAAA,CAAA,2CAEN,CAAA,IAAA,CAAA,CAAA,wGACA,CAAA,+DACA,CAAA,6DACA,CAAA,wBACA,CAAA,iCACA,CAAA,yFACA,CAAA,yDACA,CAAA,iDACA,CAAA,6CACA,CAAA,qDACA,CAAA,0EAEO,CAAA,CAAA,OAAA,CAAA,yCAEP,CAAA,IAAA,CAAA,CAAA,0EACA,CAAA,qGACA,CAAA,6GACA,CAAA,6EACA,CAAA,wGACA,CAAA,gHAGA,CAAA,CAAA,KAAA,CAAA,CAAA,UACA,CAAA,0EACA,CAAA,qGACA,CAAA,6GACA,CAAA,6EACA,CAAA,wGACA,CAAA,gHAEF,CAAA,CAAA,WACE,CAAA,CAAA,mEACA,CAAA,uEACA,CAAA,+EACA,CAAA,yCAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const OptionsStyles = tv({\n slots: {\n list: 'group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static',\n section: 'mt-s',\n header: 'fg-primary-muted m-xs my-s text-header-xs',\n item: [\n 'group/options-item fg-primary-bold flex items-center gap-s p-s text-body-s outline outline-transparent',\n 'group-size-small/options:pt-xs group-size-small/options:pb-xs',\n 'group-size-large/options:pt-s group-size-large/options:pb-s',\n 'enabled:cursor-pointer',\n 'enabled:hover:fg-a11y-on-accent',\n 'enabled:focus-visible:fg-a11y-on-accent enabled:focus-visible:outline-interactive-hover',\n 'enabled:focus-visible:color-info:bg-accent-primary-bold',\n 'enabled:hover:color-info:bg-accent-primary-bold',\n 'enabled:hover:color-serious:bg-serious-bold',\n 'enabled:focus-visible:color-serious:bg-serious-bold',\n 'disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent',\n ],\n content: 'flex min-w-0 flex-auto flex-col gap-xxs',\n icon: [\n 'group-enabled/options-item:group-color-info/options-item:fg-primary-bold',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious-bold',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-a11y-on-accent',\n ],\n label: [\n 'truncate',\n 'group-enabled/options-item:group-color-info/options-item:fg-primary-bold',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious-bold',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-a11y-on-accent',\n ],\n description: [\n 'group-enabled/options-item:fg-primary-muted truncate text-body-xs',\n 'group-enabled/options-item:group-hover/options-item:fg-a11y-on-accent',\n 'group-enabled/options-item:group-focus-visible/options-item:fg-a11y-on-accent',\n 'group-disabled/options-item:fg-disabled',\n ],\n },\n});\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {DialogTrigger,Popover,Dialog,Heading,Pressable}from'react-aria-components';import {PopoverStyles}from'./styles.js';const {content:c,body:y,title:N,footer:T}=PopoverStyles(),e=({placement:r="bottom",children:o,...p})=>jsx(DialogTrigger,{...p,children:o});e.displayName="Popover";const A=({children:r,...o})=>jsx(Pressable,{...o,children:r});e.displayName="Popover.Trigger";const i=({children:r,className:o,...p})=>jsx(Popover,{className:c({className:o}),...p,children:jsx(Dialog,{children:r})});i.displayName="Popover.Content";const a=({children:r,className:o,...p})=>jsx(Heading,{slot:"title",className:N({className:o}),...p,children:r});a.displayName="Popover.Title";const s=({children:r,className:o})=>jsx("div",{className:y({className:o}),children:r});s.displayName="Popover.Body";const P=({children:r,className:o})=>jsx("div",{className:T({className:o}),children:r});P.displayName="Popover.Footer",e.Title=a,e.Content=i,e.Body=s,e.Footer=P,e.Trigger=A;export{e as Popover};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["PopoverStyles","Popover","rest","jsx","t","n","props","g","l","PopoverContent","v","PopoverTitle","PopoverBody","PopoverFooter","PopoverTrigger"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["PopoverStyles","Popover","rest","jsx","t","n","props","g","l","PopoverContent","v","PopoverTitle","PopoverBody","PopoverFooter","PopoverTrigger"],"mappings":"mLAgCQ,MAAA,CAAA,OAAS,CAAA,CAAA,CAAA,YAAa,CAAA,CAAA,CAAA,MAAWA,CAAAA,CAAc,CAAA,CAqC1CC,aAAAA,EAAW,CACtB,aAAY,CAAA,CAAA,CAAA,iBAEZ,CAAA,CAAGC,CACL,GAAA,CACSC,CAAAA,GAACC,GAAmB,CAAAC,aAAA,CAAGH,CAAAA,aAAgB,CAEhDD,EAAQ,EAAA,CAAA,CAAA,WAAc,CAAA,gBAEI,CAAA,CAAA,CAAA,CAAA,UAAaK,CAAM,GAAA,CACpCH,IAACC,GAAW,WAAGE,CAAAA,GAAQ,CAAA,CAAA,QAAS,CAEzCL,CAAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,6BAER,CAAA,MACE,CAAA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAGC,CACL,GAAA,CAEIC,CAAAA,GAACC,GAAY,CAAAG,OAAA,CAAA,CAAA,SAAqB,CAAA,CAAA,CAAA,CAAA,SAAW,CAAI,CAAA,CAAA,CAAGL,CAAAA,GAElD,CAAA,CAAA,SAACE,GAAY,CAAAI,MAAA,CAAA,CAAA,QAAS,CACxB,CAAA,CAGJC,EAAe,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,wBAEL,CAAA,CAAA,CAAA,CAAA,oBAAqB,CAAA,CAAGP,CAAK,GAAA,CAEjDC,CAAAA,GAACC,GAAY,CAAAM,OAAA,CAAA,CAAA,IAAK,CAAA,iBAA2B,cAAe,CAAA,CAAA,CAAGR,CAAAA,GAC5D,CAAA,CAAA,QACH,CAIJS,CAAAA,CAAa,eAAc,CAAA,eAE3B,CAAA,MAAuB,YAAU,CAAA,CAAA,CAAA,SAAU,CAAA,CAClCR,CAAAA,GAACC,GAAA,CAAA,gBAAsB,cAAe,CAAA,CAAA,CAAA,CAAA,QAAS,CAExDQ,CAAAA,CAAY,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,qBAGxB,CAAA,CAAA,CAAA,CAAA,oBAEF,CAAA,CAIST,CAAAA,GAACC,GAAA,CAAA,KAAI,CAAA,CAAA,SAAoB,CAAA,CAAA,CAAA,CAAA,SAAW,CAAI,CAAA,CAAA,CAAA,CAAA,QAAS,CAE1DS,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBAEpB,CAAA,CAAA,CAAA,KACRZ,CAAQ,CAAA,CAAA,CAAA,CAAA,OACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,IACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,MACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,OAAUa,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport {\n Dialog as AriaDialog,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n Popover as AriaPopover,\n Pressable,\n} from 'react-aria-components';\nimport { PopoverStyles } from './styles';\nimport type { ReactNode } from 'react';\nimport type {\n PopoverBodyProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './types';\n\nconst { content, body, title, footer } = PopoverStyles();\n\n/**\n * Popover - A floating content container positioned relative to a trigger element\n *\n * Provides accessible popover functionality with flexible positioning and content\n * organization. Perfect for contextual information, menus, or supplementary content\n * that appears on demand without interrupting the user's workflow.\n *\n * @example\n * // Basic popover\n * <Popover>\n * <Popover.Trigger>\n * <Button>Show Info</Button>\n * </Popover.Trigger>\n * <Popover.Content>\n * <Popover.Body>\n * <p>Additional information appears here</p>\n * </Popover.Body>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * // Popover with title and actions\n * <Popover placement=\"top\">\n * <Popover.Trigger>\n * <Button>Options</Button>\n * </Popover.Trigger>\n * <Popover.Content>\n * <Popover.Title>Quick Actions</Popover.Title>\n * <Popover.Body>\n * <Button>Edit</Button>\n * <Button>Delete</Button>\n * </Popover.Body>\n * </Popover.Content>\n * </Popover>\n */\nexport const Popover = ({\n placement = 'bottom',\n children,\n ...rest\n}: PopoverProps) => {\n return <AriaDialogTrigger {...rest}>{children}</AriaDialogTrigger>;\n};\nPopover.displayName = 'Popover';\n\nconst PopoverTrigger = ({ children, ...props }: PopoverTriggerProps) => {\n return <Pressable {...props}>{children}</Pressable>;\n};\nPopover.displayName = 'Popover.Trigger';\n\nconst PopoverContent = ({\n children,\n className,\n ...rest\n}: PopoverContentProps) => {\n return (\n <AriaPopover className={content({ className })} {...rest}>\n {/* @ts-expect-error package version mismatch TODO */}\n <AriaDialog>{children}</AriaDialog>\n </AriaPopover>\n );\n};\nPopoverContent.displayName = 'Popover.Content';\n\nconst PopoverTitle = ({ children, className, ...rest }: PopoverTitleProps) => {\n return (\n <AriaHeading slot='title' className={title({ className })} {...rest}>\n {children}\n </AriaHeading>\n );\n};\n\nPopoverTitle.displayName = 'Popover.Title';\n\nconst PopoverBody = ({ children, className }: PopoverBodyProps) => {\n return <div className={body({ className })}>{children}</div>;\n};\nPopoverBody.displayName = 'Popover.Body';\n\nconst PopoverFooter = ({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) => {\n return <div className={footer({ className })}>{children}</div>;\n};\nPopoverFooter.displayName = 'Popover.Footer';\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\nPopover.Body = PopoverBody;\nPopover.Footer = PopoverFooter;\nPopover.Trigger = PopoverTrigger;\n"]}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {useCallback,useMemo}from'react';import {Button}from'../button/index.js';import {pressToMouseEvent}from'./utils.js';function E({disabled:e,disabledTranslation:t,title:o,handleOnClick:r}){const s=useCallback(p=>r(pressToMouseEvent(p)),[r]),m=useMemo(()=>t?.title&&e?t.title:o,[t?.title,e,o]);return jsx(Button,{isDisabled:e&&!t,onPress:s,size:"small",variant:"outline",children:m})}export{E as ActionElement};//# sourceMappingURL=action-element.js.map
|
|
2
4
|
//# sourceMappingURL=action-element.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import'client-only';import {useMemo}from'react';import {useRuleGroup,useStopEventPropagation,TestID}from'react-querybuilder';import {cn}from'./../../lib/utils.js';function O(t){const a=useRuleGroup(t),{schema:{controls:{ruleGroupBodyElements:s}}}=a,{schema:{classNames:n}}=t,c=useStopEventPropagation(a.addRule),i=useStopEventPropagation(a.addGroup),d=useStopEventPropagation(a.cloneGroup),m=useStopEventPropagation(a.toggleLockGroup),p=useStopEventPropagation(a.removeGroup),v=useMemo(()=>({...a,addGroup:i,addRule:c,cloneGroup:d,removeGroup:p,toggleLockGroup:m}),[i,c,d,a,p,m]);return jsxs("div",{className:cn(n.ruleGroup),children:[jsx("div",{className:cn(n.header),children:jsx(C,{...v})}),jsx("div",{className:cn(n.body),children:jsx(s,{...v})}),jsx("div",{className:cn(n.header),children:jsx(N,{...v})})]})}function C(t){const a=t.schema.showLockButtons,s=t.path.length>0,n=t.schema.showCloneButtons&&s,{schema:{controls:{combinatorSelector:c,cloneGroupAction:i,lockGroupAction:d,removeGroupAction:m}}}=t;return jsxs(Fragment,{children:[jsx(c,{testID:TestID.combinators,options:t.schema.combinators,ruleGroup:t.ruleGroup,value:t.combinator,title:t.translations.combinators.title,className:t.classNames.combinators,handleOnChange:t.onCombinatorChange,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,context:t.context,validation:t.validationResult,schema:t.schema},TestID.combinators),n&&jsx("div",{children:jsx(i,{testID:TestID.cloneGroup,label:t.translations.cloneRuleGroup.label,title:t.translations.cloneRuleGroup.title,className:t.classNames.cloneGroup,handleOnClick:t.cloneGroup,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,context:t.context,validation:t.validationResult,ruleOrGroup:t.ruleGroup,schema:t.schema},TestID.cloneGroup)}),a&&jsx("div",{children:jsx(d,{testID:TestID.lockGroup,label:t.translations.lockGroup.label,title:t.translations.lockGroup.title,className:t.classNames.lockGroup,handleOnClick:t.toggleLockGroup,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,disabledTranslation:t.parentDisabled?void 0:t.translations.lockGroupDisabled,context:t.context,validation:t.validationResult,ruleOrGroup:t.ruleGroup,schema:t.schema},TestID.lockGroup)}),s&&jsx("div",{children:jsx(m,{testID:TestID.removeGroup,label:t.translations.removeGroup.label,title:t.translations.removeGroup.title,className:t.classNames.removeGroup,handleOnClick:t.removeGroup,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,context:t.context,validation:t.validationResult,ruleOrGroup:t.ruleGroup,schema:t.schema},TestID.removeGroup)})]})}function N(t){const{schema:{controls:{addGroupAction:a,addRuleAction:s}}}=t;return jsxs(Fragment,{children:[jsx(s,{testID:TestID.addRule,label:t.translations.addRule.label,title:t.translations.addRule.title,className:t.classNames.addRule,handleOnClick:t.addRule,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,context:t.context,validation:t.validationResult,ruleOrGroup:t.ruleGroup,schema:t.schema},TestID.addRule),jsx(a,{testID:TestID.addGroup,label:t.translations.addGroup.label,title:t.translations.addGroup.title,className:t.classNames.addGroup,handleOnClick:t.addGroup,rules:t.ruleGroup.rules,level:t.path.length,path:t.path,disabled:t.disabled,context:t.context,validation:t.validationResult,ruleOrGroup:t.ruleGroup,schema:t.schema},TestID.addGroup)]})}export{O as RuleGroup,N as RuleGroupFooterComponent,C as RuleGroupHeaderComponent};//# sourceMappingURL=group.js.map
|
|
2
4
|
//# sourceMappingURL=group.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import'client-only';import {useContext}from'react';import {useRule,useStopEventPropagation,TestID}from'react-querybuilder';function Z(d){const e=useRule(d),v=useContext(d.context),{classNames:r,disabled:C,operators:S,outerClassName:p,rule:{field:u,operator:n,value:f,valueSource:m},schema:{controls:{fieldSelector:N,operatorSelector:g,valueSourceSelector:k,valueEditor:D,cloneRuleAction:O,lockRuleAction:y,removeRuleAction:E},fields:b,listsAsArrays:A,parseNumbers:I,showCloneButtons:T,showLockButtons:x},fieldData:R,generateOnChangeHandler:s,inputType:L,parentDisabled:B,path:h,translations:l,valueEditorType:P,valueEditorSeparator:w,values:G,valueSources:V,valueSourceOptions:H,validationResult:Q}=e,F=useStopEventPropagation(e.cloneRule),q=useStopEventPropagation(e.toggleLockRule),z=useStopEventPropagation(e.removeRule),o={context:v,disabled:C,level:h.length,path:h,schema:e.schema,validation:Q},J=!["null","notNull"].includes(n)&&V.length>1;return jsxs(Fragment,{children:[v.showRuleLines&&jsx("span",{className:"rule-lines relative"}),jsxs("div",{className:p,children:[jsx(N,{testID:TestID.fields,options:b,title:l.fields.title,value:u,operator:n,className:r.fields,handleOnChange:s("field"),rule:e.rule,...o}),jsx(g,{testID:TestID.operators,field:u,fieldData:e.fieldData,title:e.translations.operators.title,options:S,value:n,className:e.classNames.operators,handleOnChange:e.generateOnChangeHandler("operator"),rule:e.rule,...o}),jsx(D,{testID:TestID.valueEditor,field:u,fieldData:R,title:l.value.title,operator:n,value:f,valueSource:m??"value",type:P,inputType:L,values:G,listsAsArrays:A,parseNumbers:I,separator:w,className:r.value,handleOnChange:s("value"),rule:e.rule,...o}),J&&jsx(k,{testID:TestID.valueSourceSelector,field:u,fieldData:R,title:l.valueSourceSelector.title,options:H,value:m??"value",className:r.valueSource,handleOnChange:s("valueSource"),rule:e.rule,...o})]}),jsxs("div",{className:p,children:[jsx(E,{testID:TestID.removeRule,label:l.removeRule.label??"remove",title:l.removeRule.title??"remove",className:r.removeRule,handleOnClick:z,ruleOrGroup:e.rule,...o}),T&&jsx(O,{testID:TestID.cloneRule,label:l.cloneRule.label??"clone",title:l.cloneRule.title??"clone",className:r.cloneRule,handleOnClick:F,ruleOrGroup:e.rule,...o}),x&&jsx(y,{testID:TestID.lockRule,label:l.lockRule.label??"lock",title:l.lockRule.title??"lock",className:r.lockRule,handleOnClick:q,disabledTranslation:B?void 0:l.lockRuleDisabled,ruleOrGroup:e.rule,...o})]})]})}export{Z as Rule};//# sourceMappingURL=rule.js.map
|
|
2
4
|
//# sourceMappingURL=rule.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,Fragment}from'react/jsx-runtime';import'client-only';import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';function k({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){const{valid:l}=getValidationResult(o,t);return jsx(Checkbox,{isDisabled:a,isSelected:r,onChange:i,"aria-invalid":!l,"aria-label":e})}function x({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r,values:l}){const{valid:d}=getValidationResult(o,t);return jsx(Radio.Group,{value:r,isDisabled:a,onChange:i,"aria-invalid":!d,"aria-label":e,"aria-labelledby":e,children:l?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}const R=[];function S({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,type:r,value:l,values:d=R,...n}){const{valid:c}=getValidationResult(o,t);return jsx(ValueSelector,{...n,disabled:a,multiple:r==="multiselect",options:d,title:e,validation:!c,value:l,handleOnChange:i,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){const{valid:l}=getValidationResult(o,t);return jsx(Switch,{isDisabled:a,isSelected:!!r,onChange:i,"aria-invalid":!l,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,inputType:r,rule:l,value:d}){const{valid:n,reasons:c}=getValidationResult(l,i);return jsx(TextField,{inputProps:{placeholder:t,type:r??"text"},size:"small",value:d,isDisabled:a,isInvalid:!n,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:c?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,rule:r,value:l}){const{valid:d,reasons:n}=getValidationResult(r,i);return jsx(TextAreaField,{size:"small",errorMessage:n?.join("/n"),inputProps:{placeholder:t},value:l,isDisabled:a,isInvalid:!d,onChange:o,"aria-label":e,"aria-invalid":!d,"aria-labelledby":e})}const O={checkbox:k,radio:x,select:S,switch:T,text:w,textarea:I};function J(a){const{fieldData:{name:e,valueEditorType:t},operator:i,rule:o}=a,{valueAsArray:r,multiValueHandler:l}=useValueEditor({...a,skipHook:true}),d=useCallback(s=>({...o,value:r[s]}),[o,r]),n=useCallback(s=>l(s,0),[l]),c=useCallback(s=>l(s,1),[l]),E=(typeof t=="function"?t(i):t)??"text",f=O?.[E];return i==="null"||i==="notNull"||!f?null:multiValueOperators.includes(i)?jsx(Fragment,{children:["start","end"].map((s,m)=>jsx("div",{children:jsx(f,{...a,rule:d(m),value:r[m],handleOnChange:m?c:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{J as ValueEditor};//# sourceMappingURL=value-editor.js.map
|
|
2
4
|
//# sourceMappingURL=value-editor.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';const {group:y,groupLabel:C,radio:A,control:L,label:g}=RadioStyles(),D=createContext(null);function p({ref:o,...r}){[r,o]=useContextProps(r,o??null,D);const{children:s,classNames:a,label:t,...m}=r;return jsx(RadioGroup,{...m,ref:o,className:composeRenderProps(a?.group,l=>y({className:l})),children:composeRenderProps(s,(l,{isDisabled:R,isRequired:c})=>jsxs(Fragment,{children:[t&&jsx(Label,{className:C({className:a?.label}),isDisabled:R,isRequired:c,children:t}),l]}))})}p.displayName="Radio.Group";function d({classNames:o,children:r,...s}){return jsx(Radio,{...s,className:composeRenderProps(o?.radio,a=>A({className:a})),children:composeRenderProps(r,a=>jsxs(Fragment,{children:[jsx("span",{className:L({className:o?.control})}),jsx("span",{className:g({className:o?.label}),children:a})]}))})}d.displayName="Radio",d.Group=p;export{d as Radio,D as RadioContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {Search,Loop,CancelFill}from'@accelint/icons';import {createContext}from'react';import {useContextProps,SearchField,composeRenderProps,Input,Button}from'react-aria-components';import {Icon}from'../icon/index.js';import {SearchFieldStyles,SearchFieldStylesDefaults}from'./styles.js';const {field:I,input:g,search:L,loading:A,clear:B}=SearchFieldStyles(),c=createContext(null);function n({children:r,...a}){return jsx(c.Provider,{value:a,children:r})}n.displayName="SearchField.Provider";function d({ref:r,...a}){[a,r]=useContextProps(a,r??null,c);const{classNames:o,inputProps:p,isLoading:m=false,variant:i=SearchFieldStylesDefaults.variant,...h}=a;return jsx(Icon.Provider,{size:"small",children:jsxs(SearchField,{...h,ref:r,className:composeRenderProps(o?.field,l=>I({className:l,variant:i})),children:[jsx(Icon,{className:L({className:o?.search,variant:i}),children:jsx(Search,{})}),jsx(Input,{...p,className:composeRenderProps(o?.input,l=>g({className:l,variant:i})),type:"search"}),m?jsx(Icon,{className:A({className:o?.loading,variant:i}),children:jsx(Loop,{})}):jsx(Button,{className:composeRenderProps(o?.clear,l=>B({className:l,variant:i})),children:jsx(Icon,{children:jsx(CancelFill,{})})})]})})}d.displayName="SearchField",d.Provider=n;export{d as SearchField,c as SearchFieldContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import V from'@accelint/icons/chevron-down';import {createContext}from'react';import {useContextProps,Select,composeRenderProps,SelectValue,Text,FieldError,Popover,Virtualizer,ListLayout}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Options}from'../options/index.js';import {SelectFieldStyles}from'./styles.js';const {description:k,error:G,trigger:J,label:d,field:K,value:Q}=SelectFieldStyles(),m=createContext(null);function u({children:o,...t}){return jsx(m.Provider,{value:t,children:o})}u.displayName="SelectField.Provider";function P({ref:o,...t}){[t,o]=useContextProps(t,o??null,m);const{size:i="medium",children:S,classNames:r,description:n,errorMessage:f,label:N,layoutOptions:F,isInvalid:y,...g}=t,c=f||null,p=i==="small",b=!p&&!!d;return jsx(Select,{...g,ref:o,className:composeRenderProps(r?.field,s=>K({className:s})),isInvalid:y||(c?true:void 0),"data-size":i,children:composeRenderProps(S,(s,{isRequired:x,isDisabled:C,isInvalid:L})=>jsxs(Fragment,{children:[b&&jsx(Label,{className:d({className:r?.label}),isRequired:x,isDisabled:C,children:N}),jsxs(Button,{className:composeRenderProps(r?.trigger,a=>J({className:a})),variant:"outline",size:i,children:[jsx(SelectValue,{className:Q({className:r?.value})}),jsx(Icon,{children:jsx(V,{className:"transform group-open/select-field:rotate-180"})})]}),!!n&&!(p||L)&&jsx(Text,{className:k({className:r?.description}),slot:"description",children:n}),jsx(FieldError,{className:composeRenderProps(r?.error,a=>G({className:a})),children:c}),jsx(Popover,{className:"min-w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:F,children:jsx(Options,{children:s})})})]}))})}P.displayName="SelectField",P.Provider=u;export{P as SelectField,m as SelectFieldContext};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { SidenavProps, SidenavTriggerProps, SidenavHeaderProps, SidenavItemProps, SidenavLinkProps, SidenavDividerProps, SidenavAvatarProps, SidenavFooterProps, SidenavContentProps } from './types.js';
|
|
2
|
+
import { SidenavProps, SidenavTriggerProps, SidenavHeaderProps, SidenavItemProps, SidenavLinkProps, SidenavDividerProps, SidenavAvatarProps, SidenavFooterProps, SidenavContentProps, SidenavMenuProps, SidenavMenuItemProps } from './types.js';
|
|
3
|
+
import '@accelint/bus';
|
|
4
|
+
import '@accelint/core';
|
|
3
5
|
import 'react';
|
|
4
6
|
import 'react-aria-components';
|
|
7
|
+
import './events.js';
|
|
5
8
|
|
|
6
|
-
declare function Sidenav({ className, isHiddenWhenClosed, children, ...rest }: SidenavProps): react_jsx_runtime.JSX.Element | null;
|
|
9
|
+
declare function Sidenav({ id, className, isHiddenWhenClosed, children, ...rest }: SidenavProps): react_jsx_runtime.JSX.Element | null;
|
|
7
10
|
declare namespace Sidenav {
|
|
8
11
|
var displayName: string;
|
|
9
12
|
var Trigger: typeof SidenavTrigger;
|
|
@@ -14,6 +17,7 @@ declare namespace Sidenav {
|
|
|
14
17
|
var Avatar: typeof SidenavAvatar;
|
|
15
18
|
var Footer: typeof SidenavFooter;
|
|
16
19
|
var Content: typeof SidenavContent;
|
|
20
|
+
var Menu: typeof SidenavMenu;
|
|
17
21
|
}
|
|
18
22
|
declare function SidenavContent({ className, children, ...rest }: SidenavContentProps): react_jsx_runtime.JSX.Element;
|
|
19
23
|
declare namespace SidenavContent {
|
|
@@ -27,7 +31,7 @@ declare function SidenavFooter(props: SidenavFooterProps): react_jsx_runtime.JSX
|
|
|
27
31
|
declare namespace SidenavFooter {
|
|
28
32
|
var displayName: string;
|
|
29
33
|
}
|
|
30
|
-
declare function SidenavTrigger({ children, ...rest }: SidenavTriggerProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare function SidenavTrigger({ children, for: type, ...rest }: SidenavTriggerProps): react_jsx_runtime.JSX.Element;
|
|
31
35
|
declare namespace SidenavTrigger {
|
|
32
36
|
var displayName: string;
|
|
33
37
|
}
|
|
@@ -47,5 +51,14 @@ declare function SidenavAvatar({ children, className, ...rest }: SidenavAvatarPr
|
|
|
47
51
|
declare namespace SidenavAvatar {
|
|
48
52
|
var displayName: string;
|
|
49
53
|
}
|
|
54
|
+
declare function SidenavMenu({ icon, title, classNames, children, ...rest }: SidenavMenuProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare namespace SidenavMenu {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
var Item: typeof SidenavMenuItem;
|
|
58
|
+
}
|
|
59
|
+
declare function SidenavMenuItem({ className, children, ...rest }: SidenavMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare namespace SidenavMenuItem {
|
|
61
|
+
var displayName: string;
|
|
62
|
+
}
|
|
50
63
|
|
|
51
64
|
export { Sidenav };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {useOn,useEmit}from'@accelint/bus/react';import {uuid,isUUID}from'@accelint/core';import {ChevronLeft,ArrowNortheast,ChevronDown}from'@accelint/icons';import {createContext,useState,useContext,useRef}from'react';import {Provider,HeadingContext,DEFAULT_SLOT,Header,Button,composeRenderProps,Pressable,Text,TextContext,ToggleButton,Link,Heading,Disclosure,DisclosurePanel,DialogTrigger,Popover}from'react-aria-components';import {containsExactChildren,containsAnyOfExactChildren}from'./../../lib/react.js';import {Avatar,AvatarContext}from'../avatar/index.js';import {Icon,IconContext}from'../icon/index.js';import {Tooltip}from'../tooltip/index.js';import {SidenavEventTypes}from'./events.js';import {SidenavStyles}from'./styles.js';const{sidenav:ve,content:pe,header:ce,toggle:ue,heading:ge,divider:Se,item:Ne,text:z,transient:c,avatar:fe,avatarHeading:Pe,avatarIcon:V,avatarText:Te,link:xe,tooltip:O,menu:ye,menuButton:_,menuHeading:Ce,menuPanel:Ie,menuItem:De,panelHeading:Be,panelContent:G}=SidenavStyles(),N=createContext({id:uuid(),isOpen:false});function d({id:a,className:n,isHiddenWhenClosed:i,children:t,...r}){containsExactChildren({children:t,componentName:d.displayName,restrictions:[[A,{min:1,max:1}],[b,{min:1,max:1}],[L,{min:0,max:1}]]});const[o,m]=useState(false);return useOn(SidenavEventTypes.toggle,s=>{s.payload.id===a&&m(Q=>!Q);}),useOn(SidenavEventTypes.open,s=>{!o&&s.payload.id===a&&m(true);}),useOn(SidenavEventTypes.close,s=>{o&&s.payload.id===a&&m(false);}),i&&!o?null:jsx(Provider,{values:[[HeadingContext,{slots:{[DEFAULT_SLOT]:{className:ge({className:c()})},menu:{className:Ce({className:c()})},panel:{className:Be()}}}],[N,{id:a,isOpen:o}]],children:jsx("nav",{...r,className:ve({className:n}),"data-open":o||null,children:t})})}d.displayName="Sidenav";function b({className:a,children:n,...i}){return jsx("div",{...i,className:pe({className:a}),children:n})}b.displayName="Sidenav.Content";function A({children:a,classNames:n,...i}){const t=useEmit(SidenavEventTypes.toggle),{id:r}=useContext(N);return jsx(Header,{...i,className:ce({className:n?.header}),children:jsxs(Button,{className:composeRenderProps(n?.button,o=>ue({className:o})),onPress:()=>t({id:r}),children:[a,jsx(Icon,{className:c(),children:jsx(ChevronLeft,{})})]})})}A.displayName="Sidenav.Header";function L(a){return jsx("footer",{...a})}L.displayName="Sidenav.Footer";function J({children:a,for:n,...i}){const[t,r]=isUUID(n)?["toggle",n]:n.split(":"),o=useEmit(SidenavEventTypes[t]);return jsx(Pressable,{...i,onPress:()=>o({id:r}),children:a})}J.displayName="Sidenav.Trigger";function M({children:a,classNames:n,textValue:i,...t}){containsAnyOfExactChildren({children:a,componentName:M.displayName,restrictions:[[[y,{min:1,max:1}]],[[Icon,{min:1,max:1}],[Text,{min:1,max:1}]]]});const{isOpen:r}=useContext(N),o=useRef(null);return jsx(Provider,{values:[[IconContext,{size:"medium"}],[TextContext,{className:z({className:c()})}]],children:jsxs(Tooltip,{isDisabled:r,children:[jsx(Tooltip.Trigger,{children:jsx(ToggleButton,{...t,ref:o,className:composeRenderProps(n?.button,m=>Ne({className:m})),children:a})}),jsx(Tooltip.Body,{parentRef:o,placement:"right",className:O(),children:i})]})})}M.displayName="Sidenav.Item";function k({children:a,classNames:n,textValue:i,...t}){containsExactChildren({children:a,componentName:k.displayName,restrictions:[[Icon,{min:1,max:1}],[Text,{min:1,max:1}]]});const{isOpen:r}=useContext(N),o=useRef(null);return jsx(Provider,{values:[[TextContext,{className:z({className:c()})}]],children:jsxs(Tooltip,{isDisabled:r,children:[jsx(Tooltip.Trigger,{children:jsx(Link,{...t,ref:o,className:composeRenderProps(n?.button,m=>xe({className:m})),children:composeRenderProps(a,m=>jsxs(Fragment,{children:[m,jsx(Icon,{className:c(),children:jsx(ArrowNortheast,{})})]}))})}),jsxs(Tooltip.Body,{parentRef:o,placement:"right",className:O(),children:[i,jsx(Icon,{children:jsx(ArrowNortheast,{})})]})]})})}k.displayName="Sidenav.Link";function K({className:a,...n}){return jsx("hr",{...n,className:Se({className:a})})}K.displayName="Sidenav.Divider";function y({children:a,className:n,...i}){return containsAnyOfExactChildren({children:a,componentName:y.displayName,restrictions:[[[Avatar,{min:1,max:1}],[Heading,{min:1,max:1}],[Text,{min:0,max:1}]],[[Icon,{min:1,max:1}],[Heading,{min:1,max:1}],[Text,{min:0,max:1}]]]}),jsx(Provider,{values:[[IconContext,{size:"large",className:V()}],[HeadingContext,{className:Pe({className:c()})}],[TextContext,{className:Te({className:c()})}],[AvatarContext,{classNames:{avatar:V()}}]],children:jsx("div",{...i,className:fe({className:n}),children:a})})}y.displayName="Sidenav.Avatar";function C({icon:a,title:n,classNames:i,children:t,...r}){containsExactChildren({children:t,componentName:C.displayName,restrictions:[[I,{min:2}]]});const{isOpen:o}=useContext(N),m=useRef(null);return o?jsxs(Disclosure,{className:composeRenderProps(i?.menu,s=>ye({className:s})),children:[jsxs(Button,{...r,slot:"trigger",className:composeRenderProps(i?.button,s=>_({className:s})),children:[a,jsx(Heading,{slot:"menu",children:n}),jsx(Icon,{className:c({className:i?.icon}),children:jsx(ChevronDown,{className:"transform group-expanded/menu:rotate-180"})})]}),jsx(DisclosurePanel,{className:composeRenderProps(i?.disclosurePanel,s=>s??""),children:jsx("div",{className:G({className:i?.panelContent}),children:t})})]}):jsxs(DialogTrigger,{children:[jsxs(Tooltip,{isDisabled:o,children:[jsx(Tooltip.Trigger,{children:jsx(Button,{...r,ref:m,className:composeRenderProps(i?.button,s=>_({className:s})),children:a})}),jsx(Tooltip.Body,{parentRef:m,placement:"right",className:O(),children:n})]}),jsxs(Popover,{className:composeRenderProps(i?.popoverPanel,s=>Ie({className:s})),placement:"right top",shouldFlip:false,children:[jsx(Heading,{slot:"panel",children:n}),jsx("div",{className:G({className:i?.panelContent}),children:t})]})]})}C.displayName="Sidenav.Menu";function I({className:a,children:n,...i}){return containsExactChildren({children:n,componentName:I.displayName,restrictions:[[Text,{min:1,max:1}]]}),jsx(ToggleButton,{...i,className:composeRenderProps(a,t=>De({className:t})),children:n})}I.displayName="Sidenav.Menu.Item",C.Item=I,d.Trigger=J,d.Header=A,d.Item=M,d.Link=k,d.Divider=K,d.Avatar=y,d.Footer=L,d.Content=b,d.Menu=C;export{d as Sidenav};//# sourceMappingURL=index.js.map
|
|
2
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/sidenav/index.tsx"],"names":["toggle","heading","divider","item","transient","avatar","avatarHeading","avatarIcon","link","SidenavContext","W","className","rest","Sidenav","g","SidenavFooter","open","setOpen","useState","useOn","SidenavEventTypes","prev","isHiddenWhenClosed","Provider","P","e","A","sidenav","SidenavContent","jsx","content","children","emit","Header","k","header","G","Button","classNames","v","w","SidenavHeader","R","SidenavTrigger","useEmit","Pressable","textValue","SidenavItem","U","Icon","Text","d","useContext","N","ref","IconContext","L","b","f","S","l","ToggleButton","SidenavLink","useRef","p","text","Link","jsxs","q","re","B","SidenavDivider","containsExactChildren","SidenavAvatar","HeadingContext","TextContext","avatarText"],"mappings":"goBAoDE,KAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,MAAAC,CAAAA,CACA,CA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IAAA,CAAA,CAAA,GAAM,CAAA,CAAA,CAAA,GAAS,YAAW9C,QAAAA,CAAAA,CAAW,MAEnDmE,CACA,CAAE,CAAAhB,WAAA,CAAA,CAAA,IAAA,CAAA,OAA2B,CAAA,SAAqB,CAAE,EAAG,EACzD,CACA,CAACiB,CAAAA,CAAajD,cAAE,WAAWkD,CAAAA,EAAa,WAAWxE,CAAU,CAAE,EAAG,CAAC,CACrE,CAAA,CAEA,CAAA,CAAAuD,WAAA,CAAA,CAAA,aAAM,CAAA,SAAS,CAAA,CAAA,EAAA,CAAWtD,CAAAA,CAAAA,CAAO,CAAE,CAAA,QAAA,CAAAM,GAAU,CAAC,KAC3C,CAAA,CAAA,GAAA,CAAAoB,CAAAA,SAKK,CAAA,EAAA,CAAA,CAAA,SAAc,CAAA,CAAA,CAAA,CAAA,CAAA,QAE5BlB,CAAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACA,CAAS4B,kBAEFqB,CAAAA,OACP,CAAA,CAAA,CAAA,CAAUS,CAAAA,MACV,CAAA,CAAA,CAAA,CAASE,KACT,CAAA,CAAA,CAAA,CAAA,CAAA,IACR5D,CAAQ,CAAA,CAAA,CAAA,CAAA,OAAUe,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useEmit, useOn } from '@accelint/bus/react';\nimport { ArrowNortheast, ChevronLeft } from '@accelint/icons';\nimport { createContext, useContext, useRef, useState } from 'react';\nimport {\n Button,\n composeRenderProps,\n Header,\n Heading,\n HeadingContext,\n Link,\n Pressable,\n Provider,\n Text,\n TextContext,\n ToggleButton,\n} from 'react-aria-components';\nimport { containsAnyOfExactChildren, containsExactChildren } from '@/lib/react';\nimport { Icon, IconContext } from '../icon';\nimport { Tooltip } from '../tooltip';\nimport { SidenavEventTypes } from './events';\nimport { SidenavStyles } from './styles';\nimport type {\n SidenavAvatarProps,\n SidenavContentProps,\n SidenavContextValue,\n SidenavDividerProps,\n SidenavFooterProps,\n SidenavHeaderProps,\n SidenavItemProps,\n SidenavLinkProps,\n SidenavProps,\n SidenavTriggerProps,\n} from './types';\n\nconst {\n sidenav,\n content,\n header,\n toggle,\n heading,\n divider,\n item,\n text,\n transient,\n avatar,\n avatarHeading,\n avatarIcon,\n avatarText,\n link,\n tooltip,\n} = SidenavStyles();\n\nconst SidenavContext = createContext<SidenavContextValue>({ open: false });\n\nexport function Sidenav({\n className,\n isHiddenWhenClosed,\n children,\n ...rest\n}: SidenavProps) {\n containsExactChildren({\n children,\n componentName: Sidenav.displayName,\n restrictions: [\n [SidenavHeader, { min: 1, max: 1 }],\n [SidenavContent, { min: 1, max: 1 }],\n [SidenavFooter, { min: 0, max: 1 }],\n ],\n });\n const [open, setOpen] = useState(false);\n\n useOn(SidenavEventTypes.toggle, () => setOpen((prev) => !prev));\n\n if (isHiddenWhenClosed && !open) {\n return null;\n }\n\n return (\n <Provider\n values={[\n [HeadingContext, { className: heading({ className: transient() }) }],\n [SidenavContext, { open }],\n ]}\n >\n <nav\n {...rest}\n className={sidenav({ className })}\n data-open={open || null}\n >\n {children}\n </nav>\n </Provider>\n );\n}\nSidenav.displayName = 'Sidenav';\n\nfunction SidenavContent({ className, children, ...rest }: SidenavContentProps) {\n return (\n <div {...rest} className={content({ className })}>\n {children}\n </div>\n );\n}\nSidenavContent.displayName = 'Sidenav.Content';\n\nfunction SidenavHeader({ children, classNames, ...rest }: SidenavHeaderProps) {\n const emit = useEmit(SidenavEventTypes.toggle);\n\n return (\n <Header {...rest} className={header({ className: classNames?.header })}>\n <Button\n className={toggle({ className: classNames?.button })}\n onPress={() => emit()}\n >\n {children}\n <Icon className={transient()}>\n <ChevronLeft />\n </Icon>\n </Button>\n </Header>\n );\n}\nSidenavHeader.displayName = 'Sidenav.Header';\n\nfunction SidenavFooter(props: SidenavFooterProps) {\n return <footer {...props} />;\n}\nSidenavFooter.displayName = 'Sidenav.Footer';\n\nfunction SidenavTrigger({ children, ...rest }: SidenavTriggerProps) {\n const emit = useEmit(SidenavEventTypes.toggle);\n\n return (\n <Pressable {...rest} onPress={() => emit()}>\n {children}\n </Pressable>\n );\n}\nSidenavTrigger.displayName = 'Sidenav.Trigger';\n\nfunction SidenavItem({\n children,\n classNames,\n textValue,\n ...rest\n}: SidenavItemProps) {\n containsAnyOfExactChildren({\n children,\n componentName: SidenavItem.displayName,\n restrictions: [\n [[SidenavAvatar, { min: 1, max: 1 }]],\n [\n [Icon, { min: 1, max: 1 }],\n [Text, { min: 1, max: 1 }],\n ],\n ],\n });\n\n const { open } = useContext(SidenavContext);\n\n // Implement ref to place tooltip inside Button DOM to enable contextual styling\n const ref = useRef(null);\n\n return (\n <Provider\n values={[\n [IconContext, { size: 'medium' }],\n [TextContext, { className: text({ className: transient() }) }],\n ]}\n >\n <Tooltip isDisabled={open}>\n <Tooltip.Trigger>\n <ToggleButton\n {...rest}\n ref={ref}\n className={item({ className: classNames?.button })}\n >\n {children}\n </ToggleButton>\n </Tooltip.Trigger>\n <Tooltip.Body parentRef={ref} placement='right' className={tooltip()}>\n {textValue}\n </Tooltip.Body>\n </Tooltip>\n </Provider>\n );\n}\nSidenavItem.displayName = 'Sidenav.Item';\n\nfunction SidenavLink({\n children,\n classNames,\n textValue,\n ...rest\n}: SidenavLinkProps) {\n containsExactChildren({\n children,\n componentName: SidenavLink.displayName,\n restrictions: [\n [Icon, { min: 1, max: 1 }],\n [Text, { min: 1, max: 1 }],\n ],\n });\n\n const { open } = useContext(SidenavContext);\n\n // Implement ref to place tooltip inside Link DOM to enable contextual styling\n const ref = useRef(null);\n\n return (\n <Provider\n values={[\n [IconContext, { size: 'medium', slot: 'icon' }],\n [TextContext, { className: text({ className: transient() }) }],\n ]}\n >\n <Tooltip isDisabled={open}>\n <Tooltip.Trigger>\n <Link\n {...rest}\n ref={ref}\n className={link({ className: classNames?.button })}\n >\n {composeRenderProps(children, (children) => (\n <>\n {children}\n <Icon size='medium' className={transient()}>\n <ArrowNortheast />\n </Icon>\n </>\n ))}\n </Link>\n </Tooltip.Trigger>\n <Tooltip.Body parentRef={ref} placement='right' className={tooltip()}>\n {textValue}\n <Icon size='medium'>\n <ArrowNortheast />\n </Icon>\n </Tooltip.Body>\n </Tooltip>\n </Provider>\n );\n}\nSidenavLink.displayName = 'Sidenav.Link';\n\nfunction SidenavDivider({ className, ...rest }: SidenavDividerProps) {\n return <hr {...rest} className={divider({ className })} />;\n}\nSidenavDivider.displayName = 'Sidenav.Divider';\n\nfunction SidenavAvatar({ children, className, ...rest }: SidenavAvatarProps) {\n containsExactChildren({\n children,\n componentName: SidenavAvatar.displayName,\n restrictions: [\n [Icon, { min: 1, max: 1 }],\n [Heading, { min: 1, max: 1 }],\n [Text, { min: 1, max: 1 }],\n ],\n });\n\n return (\n <Provider\n values={[\n [IconContext, { size: 'large', className: avatarIcon() }],\n [\n HeadingContext,\n { className: avatarHeading({ className: transient() }) },\n ],\n [TextContext, { className: avatarText({ className: transient() }) }],\n ]}\n >\n <div {...rest} className={avatar({ className })}>\n {children}\n </div>\n </Provider>\n );\n}\nSidenavAvatar.displayName = 'Sidenav.Avatar';\n\nSidenav.Trigger = SidenavTrigger;\nSidenav.Header = SidenavHeader;\nSidenav.Item = SidenavItem;\nSidenav.Link = SidenavLink;\nSidenav.Divider = SidenavDivider;\nSidenav.Avatar = SidenavAvatar;\nSidenav.Footer = SidenavFooter;\nSidenav.Content = SidenavContent;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/sidenav/index.tsx"],"names":["item","text","transient","avatar","tooltip","menuHeading","menuPanel","SidenavStyles","uuid","id","le","$","className","X","isHiddenWhenClosed","children","rest","Sidenav","SidenavContent","isOpen","setIsOpen","useState","useOn","SidenavEventTypes","data","prev","D","S","Provider","DEFAULT_SLOT","heading","e","T","ee","panelHeading","SidenavContext","sidenav","useContext","jsx","Header","h","header","classNames","oe","Button","composeRenderProps","toggle","v","E","emit","l","ChevronLeft","SidenavHeader","u","Z","SidenavFooter","props","SidenavTrigger","isUUID","useEmit","event","Pressable","re","SidenavItem","q","SidenavAvatar","Icon","ref","useRef","g","IconContext","f","B","TextContext","w","jsxs","Tooltip","H","ToggleButton","SidenavLink","textValue","x","Text","Link","te","ArrowNortheast","Ee","F","SidenavDivider","Heading","me","P","avatarIcon","HeadingContext","avatarHeading","R","avatarText","AvatarContext","SidenavMenu","icon","containsExactChildren","Disclosure","menu","menuButton","ChevronDown","Y","ie","DialogTrigger","ae","se","panelContent","SidenavMenuItem","menuItem","U"],"mappings":"yyBAkEE,KAAA,CAAA,kBAEA,CAAA,EAAAA,OACA,CAAAC,EACA,UAAAC,CAAAA,OACA,CAAAC,EAAAA,CACA,OAAA,CAAA,EAAA,CAAA,OACA,CAAA,IAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,MACA,iBACAC,CACA,EAAA,CAAA,UACA,CAAA,CAAA,CAAA,kBACAC,CAAAA,EACA,CAAA,OAAA,CAAAC,MACA,CAAA,EAAA,CAAA,UACA,CAAA,CAAA,CAAA,wBAEEC,CAAAA,EAAc,CAAA,QAGhB,CAAIC,EAAK,aAEV,CAEM,EAAA,CAAA,YACLC,CAAAA,CACA,CAAA,CAAAC,aAAA,EAAA,CAAA,CAAA,CAAAC,aAAAC,EACA,EAAA,CAAAC,IAAA,EAAA,CAAA,MAAA,C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AAA,CAAA,sCACT,CAAE,eACzB,CAAA,CAGCuB,CAAAA,WAEE,CAAA,YAA0C1B,CAAAA,CACxCoG,CAAAA,IAAAA,CAAS,CAAE,GAAA,CAAA,CAAA,CAAA,GAAA,CAAApG,CAAU,CAAC,CACxB,CAAA,CAEC,CAAA,CAAAmB,GAAA,CAAAkF,YAAA,CAAA,CAAA,IACH,CAEJ,SACgB,CAAA/D,kBAAA,CAAA,CAAA,CAAA,CAAc,oBAE9BgD,CAAAA,QAEAjF,CAAAA,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,WACA,CAAA,oBAEO8D,CAAAA,CACf9D,gBACQ,CAAA,CAAA,CAAA,CAAA,CAASgD,MACT,CAAA,CAAA,CAAA,CAAA,CAASV,IACT,CAAA,CAAA,CAAA,CAAA,CAAA,IAAUrC,CAClBD,EAAQ,CAAA,CAAA,OAAOiF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useEmit, useOn } from '@accelint/bus/react';\nimport { isUUID, type UniqueId, uuid } from '@accelint/core';\nimport { ArrowNortheast, ChevronDown, ChevronLeft } from '@accelint/icons';\nimport { createContext, useContext, useRef, useState } from 'react';\nimport {\n Button,\n composeRenderProps,\n DEFAULT_SLOT,\n DialogTrigger,\n Disclosure,\n DisclosurePanel,\n Header,\n Heading,\n HeadingContext,\n Link,\n Popover,\n Pressable,\n Provider,\n Text,\n TextContext,\n ToggleButton,\n} from 'react-aria-components';\nimport { containsAnyOfExactChildren, containsExactChildren } from '@/lib/react';\nimport { Avatar, AvatarContext } from '../avatar';\nimport { Icon, IconContext } from '../icon';\nimport { Tooltip } from '../tooltip';\nimport { SidenavEventTypes } from './events';\nimport { SidenavStyles } from './styles';\nimport type {\n SidenavAvatarProps,\n SidenavCloseEvent,\n SidenavContentProps,\n SidenavContextValue,\n SidenavDividerProps,\n SidenavEvent,\n SidenavFooterProps,\n SidenavHeaderProps,\n SidenavItemProps,\n SidenavLinkProps,\n SidenavMenuItemProps,\n SidenavMenuProps,\n SidenavOpenEvent,\n SidenavProps,\n SidenavToggleEvent,\n SidenavTriggerProps,\n} from './types';\n\nconst {\n sidenav,\n content,\n header,\n toggle,\n heading,\n divider,\n item,\n text,\n transient,\n avatar,\n avatarHeading,\n avatarIcon,\n avatarText,\n link,\n tooltip,\n menu,\n menuButton,\n menuHeading,\n menuPanel,\n menuItem,\n panelHeading,\n panelContent,\n} = SidenavStyles();\n\nconst SidenavContext = createContext<SidenavContextValue>({\n id: uuid(),\n isOpen: false,\n});\n\nexport function Sidenav({\n id,\n className,\n isHiddenWhenClosed,\n children,\n ...rest\n}: SidenavProps) {\n containsExactChildren({\n children,\n componentName: Sidenav.displayName,\n restrictions: [\n [SidenavHeader, { min: 1, max: 1 }],\n [SidenavContent, { min: 1, max: 1 }],\n [SidenavFooter, { min: 0, max: 1 }],\n ],\n });\n const [isOpen, setIsOpen] = useState(false);\n\n useOn(SidenavEventTypes.toggle, (data: SidenavToggleEvent) => {\n if (data.payload.id === id) {\n setIsOpen((prev) => !prev);\n }\n });\n\n useOn(SidenavEventTypes.open, (data: SidenavOpenEvent) => {\n if (!isOpen && data.payload.id === id) {\n setIsOpen(true);\n }\n });\n\n useOn(SidenavEventTypes.close, (data: SidenavCloseEvent) => {\n if (isOpen && data.payload.id === id) {\n setIsOpen(false);\n }\n });\n\n if (isHiddenWhenClosed && !isOpen) {\n return null;\n }\n\n return (\n <Provider\n values={[\n [\n HeadingContext,\n {\n slots: {\n [DEFAULT_SLOT]: {\n className: heading({ className: transient() }),\n },\n menu: { className: menuHeading({ className: transient() }) },\n panel: { className: panelHeading() },\n },\n },\n ],\n [SidenavContext, { id, isOpen }],\n ]}\n >\n <nav\n {...rest}\n className={sidenav({ className })}\n data-open={isOpen || null}\n >\n {children}\n </nav>\n </Provider>\n );\n}\nSidenav.displayName = 'Sidenav';\n\nfunction SidenavContent({ className, children, ...rest }: SidenavContentProps) {\n return (\n <div {...rest} className={content({ className })}>\n {children}\n </div>\n );\n}\nSidenavContent.displayName = 'Sidenav.Content';\n\nfunction SidenavHeader({ children, classNames, ...rest }: SidenavHeaderProps) {\n const emit = useEmit<SidenavToggleEvent>(SidenavEventTypes.toggle);\n const { id } = useContext(SidenavContext);\n\n return (\n <Header {...rest} className={header({ className: classNames?.header })}>\n <Button\n className={composeRenderProps(classNames?.button, (className) =>\n toggle({ className }),\n )}\n onPress={() => emit({ id })}\n >\n {children}\n <Icon className={transient()}>\n <ChevronLeft />\n </Icon>\n </Button>\n </Header>\n );\n}\nSidenavHeader.displayName = 'Sidenav.Header';\n\nfunction SidenavFooter(props: SidenavFooterProps) {\n return <footer {...props} />;\n}\nSidenavFooter.displayName = 'Sidenav.Footer';\n\nfunction SidenavTrigger({ children, for: type, ...rest }: SidenavTriggerProps) {\n const [event, id] = (isUUID(type) ? ['toggle', type] : type.split(':')) as [\n 'close' | 'open' | 'toggle',\n UniqueId,\n ];\n const emit = useEmit<SidenavEvent>(SidenavEventTypes[event]);\n\n return (\n <Pressable {...rest} onPress={() => emit({ id })}>\n {children}\n </Pressable>\n );\n}\nSidenavTrigger.displayName = 'Sidenav.Trigger';\n\nfunction SidenavItem({\n children,\n classNames,\n textValue,\n ...rest\n}: SidenavItemProps) {\n containsAnyOfExactChildren({\n children,\n componentName: SidenavItem.displayName,\n restrictions: [\n [[SidenavAvatar, { min: 1, max: 1 }]],\n [\n [Icon, { min: 1, max: 1 }],\n [Text, { min: 1, max: 1 }],\n ],\n ],\n });\n\n const { isOpen } = useContext(SidenavContext);\n\n // Implement ref to place tooltip inside Button DOM to enable contextual styling\n const ref = useRef(null);\n\n return (\n <Provider\n values={[\n [IconContext, { size: 'medium' }],\n [TextContext, { className: text({ className: transient() }) }],\n ]}\n >\n <Tooltip isDisabled={isOpen}>\n <Tooltip.Trigger>\n <ToggleButton\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.button, (className) =>\n item({ className }),\n )}\n >\n {children}\n </ToggleButton>\n </Tooltip.Trigger>\n <Tooltip.Body parentRef={ref} placement='right' className={tooltip()}>\n {textValue}\n </Tooltip.Body>\n </Tooltip>\n </Provider>\n );\n}\nSidenavItem.displayName = 'Sidenav.Item';\n\nfunction SidenavLink({\n children,\n classNames,\n textValue,\n ...rest\n}: SidenavLinkProps) {\n containsExactChildren({\n children,\n componentName: SidenavLink.displayName,\n restrictions: [\n [Icon, { min: 1, max: 1 }],\n [Text, { min: 1, max: 1 }],\n ],\n });\n\n const { isOpen } = useContext(SidenavContext);\n\n // Implement ref to place tooltip inside Link DOM to enable contextual styling\n const ref = useRef(null);\n\n return (\n <Provider\n values={[[TextContext, { className: text({ className: transient() }) }]]}\n >\n <Tooltip isDisabled={isOpen}>\n <Tooltip.Trigger>\n <Link\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.button, (className) =>\n link({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n {children}\n <Icon className={transient()}>\n <ArrowNortheast />\n </Icon>\n </>\n ))}\n </Link>\n </Tooltip.Trigger>\n <Tooltip.Body parentRef={ref} placement='right' className={tooltip()}>\n {textValue}\n <Icon>\n <ArrowNortheast />\n </Icon>\n </Tooltip.Body>\n </Tooltip>\n </Provider>\n );\n}\nSidenavLink.displayName = 'Sidenav.Link';\n\nfunction SidenavDivider({ className, ...rest }: SidenavDividerProps) {\n return <hr {...rest} className={divider({ className })} />;\n}\nSidenavDivider.displayName = 'Sidenav.Divider';\n\nfunction SidenavAvatar({ children, className, ...rest }: SidenavAvatarProps) {\n containsAnyOfExactChildren({\n children,\n componentName: SidenavAvatar.displayName,\n restrictions: [\n [\n [Avatar, { min: 1, max: 1 }],\n [Heading, { min: 1, max: 1 }],\n [Text, { min: 0, max: 1 }],\n ],\n [\n [Icon, { min: 1, max: 1 }],\n [Heading, { min: 1, max: 1 }],\n [Text, { min: 0, max: 1 }],\n ],\n ],\n });\n\n return (\n <Provider\n values={[\n [IconContext, { size: 'large', className: avatarIcon() }],\n [\n HeadingContext,\n { className: avatarHeading({ className: transient() }) },\n ],\n [TextContext, { className: avatarText({ className: transient() }) }],\n [AvatarContext, { classNames: { avatar: avatarIcon() } }],\n ]}\n >\n <div {...rest} className={avatar({ className })}>\n {children}\n </div>\n </Provider>\n );\n}\nSidenavAvatar.displayName = 'Sidenav.Avatar';\n\nfunction SidenavMenu({\n icon,\n title,\n classNames,\n children,\n ...rest\n}: SidenavMenuProps) {\n containsExactChildren({\n children,\n componentName: SidenavMenu.displayName,\n restrictions: [[SidenavMenuItem, { min: 2 }]],\n });\n\n const { isOpen } = useContext(SidenavContext);\n const ref = useRef(null);\n\n return isOpen ? (\n <Disclosure\n className={composeRenderProps(classNames?.menu, (className) =>\n menu({ className }),\n )}\n >\n <Button\n {...rest}\n slot='trigger'\n className={composeRenderProps(classNames?.button, (className) =>\n menuButton({ className }),\n )}\n >\n {icon}\n <Heading slot='menu'>{title}</Heading>\n <Icon className={transient({ className: classNames?.icon })}>\n <ChevronDown className='transform group-expanded/menu:rotate-180' />\n </Icon>\n </Button>\n <DisclosurePanel\n className={composeRenderProps(\n classNames?.disclosurePanel,\n (className) => className ?? '',\n )}\n >\n <div className={panelContent({ className: classNames?.panelContent })}>\n {children}\n </div>\n </DisclosurePanel>\n </Disclosure>\n ) : (\n <DialogTrigger>\n <Tooltip isDisabled={isOpen}>\n <Tooltip.Trigger>\n <Button\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.button, (className) =>\n menuButton({ className }),\n )}\n >\n {icon}\n </Button>\n </Tooltip.Trigger>\n <Tooltip.Body parentRef={ref} placement='right' className={tooltip()}>\n {title}\n </Tooltip.Body>\n </Tooltip>\n <Popover\n className={composeRenderProps(classNames?.popoverPanel, (className) =>\n menuPanel({ className }),\n )}\n placement='right top'\n shouldFlip={false}\n >\n <Heading slot='panel'>{title}</Heading>\n <div className={panelContent({ className: classNames?.panelContent })}>\n {children}\n </div>\n </Popover>\n </DialogTrigger>\n );\n}\nSidenavMenu.displayName = 'Sidenav.Menu';\n\nfunction SidenavMenuItem({\n className,\n children,\n ...rest\n}: SidenavMenuItemProps) {\n containsExactChildren({\n children,\n componentName: SidenavMenuItem.displayName,\n restrictions: [[Text, { min: 1, max: 1 }]],\n });\n\n return (\n <ToggleButton\n {...rest}\n className={composeRenderProps(className, (className) =>\n menuItem({ className }),\n )}\n >\n {children}\n </ToggleButton>\n );\n}\nSidenavMenuItem.displayName = 'Sidenav.Menu.Item';\n\nSidenavMenu.Item = SidenavMenuItem;\n\nSidenav.Trigger = SidenavTrigger;\nSidenav.Header = SidenavHeader;\nSidenav.Item = SidenavItem;\nSidenav.Link = SidenavLink;\nSidenav.Divider = SidenavDivider;\nSidenav.Avatar = SidenavAvatar;\nSidenav.Footer = SidenavFooter;\nSidenav.Content = SidenavContent;\nSidenav.Menu = SidenavMenu;\n"]}
|