@ensi-platform/admin-ui 0.8.2 → 0.8.5
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/bin/ai.js +8682 -0
- package/dist/{Component-CDgOJr89.js → Component-B73be-FU.js} +2 -2
- package/dist/{Component-CDgOJr89.js.map → Component-B73be-FU.js.map} +1 -1
- package/dist/{Component-D25FKJAT.js → Component-BRHoDRtF.js} +2 -2
- package/dist/{Component-D25FKJAT.js.map → Component-BRHoDRtF.js.map} +1 -1
- package/dist/action-popup/index.js +1 -1
- package/dist/arrangement-settings/index.js +1 -1
- package/dist/bottom-sheet/index.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useOverlayExitComplete.d.ts +2 -1
- package/dist/hooks/useOverlayExitComplete.d.ts.map +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/provider/Component.d.ts +3 -2
- package/dist/provider/Component.d.ts.map +1 -1
- package/dist/provider/index.js +50 -53
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/types.d.ts +8 -2
- package/dist/provider/types.d.ts.map +1 -1
- package/dist/useOverlayExitComplete-Bra8dR0m.js +15 -0
- package/dist/useOverlayExitComplete-Bra8dR0m.js.map +1 -0
- package/docs/README.md +2 -2
- package/docs/ai.md +9 -9
- package/package.json +8 -8
- package/src/docs/ai/Description.md +9 -9
- package/src/provider/docs/Description.md +2 -1
- package/src/provider/types.ts +10 -2
- package/dist/useOverlayExitComplete-CwaErLze.js +0 -16
- package/dist/useOverlayExitComplete-CwaErLze.js.map +0 -1
- package/scripts/consumer-root.ts +0 -66
- package/scripts/sync-agents-consumer.ts +0 -81
- package/scripts/sync-consumer.ts +0 -31
- package/scripts/sync-skill-consumer.ts +0 -57
- /package/{docs/skills → ai/skills/admin-ui}/SKILL.md +0 -0
|
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as x, Fragment as B } from "react/jsx-runtime";
|
|
|
2
2
|
import l from "classnames";
|
|
3
3
|
import { OverlayTriggerStateContext as V, Heading as L, ModalOverlay as O, Modal as R, Dialog as z } from "react-aria-components";
|
|
4
4
|
import { s as T } from "./index-h8z54aFR.js";
|
|
5
|
-
import { u as F } from "./useOverlayExitComplete-
|
|
5
|
+
import { u as F } from "./useOverlayExitComplete-Bra8dR0m.js";
|
|
6
6
|
import { useContext as H } from "react";
|
|
7
7
|
import { C as j } from "./Clear-DcxADxz6.js";
|
|
8
8
|
import { u as E } from "./hooks-BlX5Y4Zt.js";
|
|
@@ -175,4 +175,4 @@ const Ce = Object.assign(v, {
|
|
|
175
175
|
export {
|
|
176
176
|
Ce as D
|
|
177
177
|
};
|
|
178
|
-
//# sourceMappingURL=Component-
|
|
178
|
+
//# sourceMappingURL=Component-B73be-FU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-CDgOJr89.js","sources":["../src/drawer/components/Body/index.tsx","../src/drawer/components/CloseButton/theme.ts","../src/drawer/components/CloseButton/index.tsx","../src/drawer/components/Footer/index.tsx","../src/drawer/components/Header/index.tsx","../src/drawer/components/Title/theme.ts","../src/drawer/components/Title/index.tsx","../src/drawer/theme.ts","../src/drawer/Component.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport { type IDrawerBodyProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerBody = ({ children, className, ...props }: IDrawerBodyProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerBody.displayName = 'Drawer.Body';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const drawerCloseButtonVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import { useContext } from 'react';\n\nimport cn from 'classnames';\nimport { OverlayTriggerStateContext } from 'react-aria-components';\n\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { drawerCloseButtonVariants } from './theme';\nimport { type IDrawerCloseButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerCloseButton = ({\n className,\n dataTestId,\n onClick,\n size = 'md',\n ...props\n}: IDrawerCloseButtonProps) => {\n const { close } = useAuiLabels();\n const state = useContext(OverlayTriggerStateContext);\n\n return (\n <button\n {...props}\n type=\"button\"\n className={cn(drawerCloseButtonVariants({ size }), className)}\n aria-label={close}\n data-test-id={dataTestId}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n state?.close();\n }\n }}\n >\n <Clear className={styles.icon} />\n </button>\n );\n};\n\nDrawerCloseButton.displayName = 'Drawer.CloseButton';\n","import cn from 'classnames';\n\nimport { type IDrawerFooterProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerFooter = ({ children, className, ...props }: IDrawerFooterProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerFooter.displayName = 'Drawer.Footer';\n","import cn from 'classnames';\n\nimport { type IDrawerHeaderProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerHeader = ({ children, className, ...props }: IDrawerHeaderProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerHeader.displayName = 'Drawer.Header';\n","import { cva } from 'class-variance-authority';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const drawerTitleVariants = cva([styles.root, typographyStyles.bodyL]);\n","import cn from 'classnames';\nimport { Heading } from 'react-aria-components';\n\nimport { drawerTitleVariants } from './theme';\nimport { type IDrawerTitleProps } from './types';\n\nexport const DrawerTitle = ({ children, className, ...props }: IDrawerTitleProps) => (\n <Heading {...props} slot=\"title\" level={2} className={cn(drawerTitleVariants(), className)}>\n {children}\n </Heading>\n);\n\nDrawerTitle.displayName = 'Drawer.Title';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const drawerOverlayVariants = cva(styles.overlay, {\n variants: {\n placement: {\n left: styles.left,\n right: styles.right,\n },\n },\n defaultVariants: {\n placement: 'right',\n },\n});\n\nexport const drawerPanelVariants = cva(styles.panel, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n placement: {\n left: styles.panelLeft,\n right: styles.panelRight,\n },\n fullscreen: {\n true: styles.fullscreen,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n placement: 'right',\n fullscreen: false,\n },\n});\n","import cn from 'classnames';\nimport { Dialog, Modal as RacModal, ModalOverlay } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { useOverlayExitComplete } from '@/hooks';\n\nimport { DrawerBody } from './components/Body';\nimport { DrawerCloseButton } from './components/CloseButton';\nimport { DrawerFooter } from './components/Footer';\nimport { DrawerHeader } from './components/Header';\nimport { DrawerTitle } from './components/Title';\nimport { drawerOverlayVariants, drawerPanelVariants } from './theme';\nimport { type IDrawerProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst DrawerExitComplete = ({\n open,\n isExiting,\n onExitComplete,\n}: {\n open: boolean;\n isExiting: boolean;\n onExitComplete?: () => void;\n}) => {\n useOverlayExitComplete(open, isExiting, onExitComplete);\n\n return null;\n};\n\nconst DrawerRoot = supportRef(\n ({\n ref,\n children,\n open,\n onOpenChange,\n onExitComplete,\n size = 'md',\n variant = 'primary',\n placement = 'right',\n fullscreen = false,\n dismissable = true,\n keyboardDismissable = true,\n className,\n dataTestId,\n ...props\n }: IDrawerProps) => (\n <ModalOverlay\n {...props}\n isOpen={open}\n onOpenChange={onOpenChange}\n isDismissable={dismissable}\n isKeyboardDismissDisabled={!keyboardDismissable}\n className={drawerOverlayVariants({ placement })}\n >\n {({ isExiting }) => (\n <>\n <DrawerExitComplete open={open} isExiting={isExiting} onExitComplete={onExitComplete} />\n <RacModal\n ref={ref}\n className={cn(\n drawerPanelVariants({\n size: fullscreen ? undefined : size,\n variant,\n placement,\n fullscreen,\n }),\n className\n )}\n >\n <Dialog className={styles.dialog} data-test-id={dataTestId}>\n {children}\n </Dialog>\n </RacModal>\n </>\n )}\n </ModalOverlay>\n )\n);\n\nDrawerRoot.displayName = 'Drawer';\n\nexport const Drawer = Object.assign(DrawerRoot, {\n Header: DrawerHeader,\n Title: DrawerTitle,\n Body: DrawerBody,\n Footer: DrawerFooter,\n CloseButton: DrawerCloseButton,\n});\n"],"names":["DrawerBody","children","className","props","jsx","cn","styles","drawerCloseButtonVariants","cva","DrawerCloseButton","dataTestId","onClick","size","close","useAuiLabels","state","useContext","OverlayTriggerStateContext","event","Clear","DrawerFooter","DrawerHeader","drawerTitleVariants","typographyStyles","DrawerTitle","Heading","drawerOverlayVariants","drawerPanelVariants","DrawerExitComplete","open","isExiting","onExitComplete","useOverlayExitComplete","DrawerRoot","supportRef","ref","onOpenChange","variant","placement","fullscreen","dismissable","keyboardDismissable","ModalOverlay","jsxs","Fragment","RacModal","Dialog","Drawer"],"mappings":";;;;;;;;;;;;GAMaA,IAAa,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QACjD,gBAAAC,EAAC,OAAA,EAAK,GAAGD,GAAO,WAAWE,EAAGC,EAAO,MAAMJ,CAAS,GAC/C,UAAAD,GACL;AAGJD,EAAW,cAAc;;;;;;;GCRZO,IAA4BC,EAAIF,EAAO,MAAM;AAAA,EACtD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,EACf;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,EAAA;AAEd,CAAC,GCFYG,IAAoB,CAAC;AAAA,EAC9B,WAAAP;AAAA,EACA,YAAAQ;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGT;AACP,MAA+B;AAC3B,QAAM,EAAE,OAAAU,EAAA,IAAUC,EAAA,GACZC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AA,CAAC,EAAE,WAAAR,EAAA,MACA,gBAAAa,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAxC,EAACwB,IAAA,EAAmB,MAAAC,GAAY,WAAAC,GAAsB,gBAAAC,EAAA,CAAgC;AAAA,QACtF,gBAAA3B;AAAA,UAACyC;AAAAA,UAAA;AAAA,YACG,KAAAV;AAAA,YACA,WAAW9B;AAAA,cACPsB,GAAoB;AAAA,gBAChB,MAAMY,IAAa,SAAY3B;AAAA,gBAC/B,SAAAyB;AAAA,gBACA,WAAAC;AAAA,gBACA,YAAAC;AAAA,cAAA,CACH;AAAA,cACDrC;AAAA,YAAA;AAAA,YAGJ,4BAAC4C,GAAA,EAAO,WAAWxC,EAAO,QAAQ,gBAAcI,GAC3C,UAAAT,EAAA,CACL;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;AAEAgC,EAAW,cAAc;AAElB,MAAMc,KAAS,OAAO,OAAOd,GAAY;AAAA,EAC5C,QAAQZ;AAAA,EACR,OAAOG;AAAA,EACP,MAAMxB;AAAA,EACN,QAAQoB;AAAA,EACR,aAAaX;AACjB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Component-B73be-FU.js","sources":["../src/drawer/components/Body/index.tsx","../src/drawer/components/CloseButton/theme.ts","../src/drawer/components/CloseButton/index.tsx","../src/drawer/components/Footer/index.tsx","../src/drawer/components/Header/index.tsx","../src/drawer/components/Title/theme.ts","../src/drawer/components/Title/index.tsx","../src/drawer/theme.ts","../src/drawer/Component.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport { type IDrawerBodyProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerBody = ({ children, className, ...props }: IDrawerBodyProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerBody.displayName = 'Drawer.Body';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const drawerCloseButtonVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import { useContext } from 'react';\n\nimport cn from 'classnames';\nimport { OverlayTriggerStateContext } from 'react-aria-components';\n\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { drawerCloseButtonVariants } from './theme';\nimport { type IDrawerCloseButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerCloseButton = ({\n className,\n dataTestId,\n onClick,\n size = 'md',\n ...props\n}: IDrawerCloseButtonProps) => {\n const { close } = useAuiLabels();\n const state = useContext(OverlayTriggerStateContext);\n\n return (\n <button\n {...props}\n type=\"button\"\n className={cn(drawerCloseButtonVariants({ size }), className)}\n aria-label={close}\n data-test-id={dataTestId}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n state?.close();\n }\n }}\n >\n <Clear className={styles.icon} />\n </button>\n );\n};\n\nDrawerCloseButton.displayName = 'Drawer.CloseButton';\n","import cn from 'classnames';\n\nimport { type IDrawerFooterProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerFooter = ({ children, className, ...props }: IDrawerFooterProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerFooter.displayName = 'Drawer.Footer';\n","import cn from 'classnames';\n\nimport { type IDrawerHeaderProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const DrawerHeader = ({ children, className, ...props }: IDrawerHeaderProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nDrawerHeader.displayName = 'Drawer.Header';\n","import { cva } from 'class-variance-authority';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const drawerTitleVariants = cva([styles.root, typographyStyles.bodyL]);\n","import cn from 'classnames';\nimport { Heading } from 'react-aria-components';\n\nimport { drawerTitleVariants } from './theme';\nimport { type IDrawerTitleProps } from './types';\n\nexport const DrawerTitle = ({ children, className, ...props }: IDrawerTitleProps) => (\n <Heading {...props} slot=\"title\" level={2} className={cn(drawerTitleVariants(), className)}>\n {children}\n </Heading>\n);\n\nDrawerTitle.displayName = 'Drawer.Title';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const drawerOverlayVariants = cva(styles.overlay, {\n variants: {\n placement: {\n left: styles.left,\n right: styles.right,\n },\n },\n defaultVariants: {\n placement: 'right',\n },\n});\n\nexport const drawerPanelVariants = cva(styles.panel, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n placement: {\n left: styles.panelLeft,\n right: styles.panelRight,\n },\n fullscreen: {\n true: styles.fullscreen,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n placement: 'right',\n fullscreen: false,\n },\n});\n","import cn from 'classnames';\nimport { Dialog, Modal as RacModal, ModalOverlay } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { useOverlayExitComplete } from '@/hooks';\n\nimport { DrawerBody } from './components/Body';\nimport { DrawerCloseButton } from './components/CloseButton';\nimport { DrawerFooter } from './components/Footer';\nimport { DrawerHeader } from './components/Header';\nimport { DrawerTitle } from './components/Title';\nimport { drawerOverlayVariants, drawerPanelVariants } from './theme';\nimport { type IDrawerProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst DrawerExitComplete = ({\n open,\n isExiting,\n onExitComplete,\n}: {\n open: boolean;\n isExiting: boolean;\n onExitComplete?: () => void;\n}) => {\n useOverlayExitComplete(open, isExiting, onExitComplete);\n\n return null;\n};\n\nconst DrawerRoot = supportRef(\n ({\n ref,\n children,\n open,\n onOpenChange,\n onExitComplete,\n size = 'md',\n variant = 'primary',\n placement = 'right',\n fullscreen = false,\n dismissable = true,\n keyboardDismissable = true,\n className,\n dataTestId,\n ...props\n }: IDrawerProps) => (\n <ModalOverlay\n {...props}\n isOpen={open}\n onOpenChange={onOpenChange}\n isDismissable={dismissable}\n isKeyboardDismissDisabled={!keyboardDismissable}\n className={drawerOverlayVariants({ placement })}\n >\n {({ isExiting }) => (\n <>\n <DrawerExitComplete open={open} isExiting={isExiting} onExitComplete={onExitComplete} />\n <RacModal\n ref={ref}\n className={cn(\n drawerPanelVariants({\n size: fullscreen ? undefined : size,\n variant,\n placement,\n fullscreen,\n }),\n className\n )}\n >\n <Dialog className={styles.dialog} data-test-id={dataTestId}>\n {children}\n </Dialog>\n </RacModal>\n </>\n )}\n </ModalOverlay>\n )\n);\n\nDrawerRoot.displayName = 'Drawer';\n\nexport const Drawer = Object.assign(DrawerRoot, {\n Header: DrawerHeader,\n Title: DrawerTitle,\n Body: DrawerBody,\n Footer: DrawerFooter,\n CloseButton: DrawerCloseButton,\n});\n"],"names":["DrawerBody","children","className","props","jsx","cn","styles","drawerCloseButtonVariants","cva","DrawerCloseButton","dataTestId","onClick","size","close","useAuiLabels","state","useContext","OverlayTriggerStateContext","event","Clear","DrawerFooter","DrawerHeader","drawerTitleVariants","typographyStyles","DrawerTitle","Heading","drawerOverlayVariants","drawerPanelVariants","DrawerExitComplete","open","isExiting","onExitComplete","useOverlayExitComplete","DrawerRoot","supportRef","ref","onOpenChange","variant","placement","fullscreen","dismissable","keyboardDismissable","ModalOverlay","jsxs","Fragment","RacModal","Dialog","Drawer"],"mappings":";;;;;;;;;;;;GAMaA,IAAa,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QACjD,gBAAAC,EAAC,OAAA,EAAK,GAAGD,GAAO,WAAWE,EAAGC,EAAO,MAAMJ,CAAS,GAC/C,UAAAD,GACL;AAGJD,EAAW,cAAc;;;;;;;GCRZO,IAA4BC,EAAIF,EAAO,MAAM;AAAA,EACtD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,EACf;AAAA,EAEJ,iBAA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ACA,GAAGP;AAAA,EAAA,MAEH,gBAAAC;AAAA,IAACsC;AAAA,IAAA;AAAA,MACI,GAAGvC;AAAA,MACJ,QAAQ0B;AAAA,MACR,cAAAO;AAAA,MACA,eAAeI;AAAA,MACf,2BAA2B,CAACC;AAAA,MAC5B,WAAWf,GAAsB,EAAE,WAAAY,GAAW;AAAA,MAE7C,UAAA,CAAC,EAAE,WAAAR,EAAA,MACA,gBAAAa,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAxC,EAACwB,IAAA,EAAmB,MAAAC,GAAY,WAAAC,GAAsB,gBAAAC,EAAA,CAAgC;AAAA,QACtF,gBAAA3B;AAAA,UAACyC;AAAAA,UAAA;AAAA,YACG,KAAAV;AAAA,YACA,WAAW9B;AAAA,cACPsB,GAAoB;AAAA,gBAChB,MAAMY,IAAa,SAAY3B;AAAA,gBAC/B,SAAAyB;AAAA,gBACA,WAAAC;AAAA,gBACA,YAAAC;AAAA,cAAA,CACH;AAAA,cACDrC;AAAA,YAAA;AAAA,YAGJ,4BAAC4C,GAAA,EAAO,WAAWxC,EAAO,QAAQ,gBAAcI,GAC3C,UAAAT,EAAA,CACL;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;AAEAgC,EAAW,cAAc;AAElB,MAAMc,KAAS,OAAO,OAAOd,GAAY;AAAA,EAC5C,QAAQZ;AAAA,EACR,OAAOG;AAAA,EACP,MAAMxB;AAAA,EACN,QAAQoB;AAAA,EACR,aAAaX;AACjB,CAAC;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as B, Fragment as O } from "react/jsx-runtime";
|
|
|
2
2
|
import a from "classnames";
|
|
3
3
|
import { OverlayTriggerStateContext as V, Heading as h, ModalOverlay as z, Modal as T, Dialog as D } from "react-aria-components";
|
|
4
4
|
import { s as F } from "./index-h8z54aFR.js";
|
|
5
|
-
import { u as H } from "./useOverlayExitComplete-
|
|
5
|
+
import { u as H } from "./useOverlayExitComplete-Bra8dR0m.js";
|
|
6
6
|
import { useContext as j } from "react";
|
|
7
7
|
import { C as E } from "./Clear-DcxADxz6.js";
|
|
8
8
|
import { u as L } from "./hooks-BlX5Y4Zt.js";
|
|
@@ -148,4 +148,4 @@ const No = Object.assign(g, {
|
|
|
148
148
|
export {
|
|
149
149
|
No as M
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=Component-
|
|
151
|
+
//# sourceMappingURL=Component-BRHoDRtF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component-D25FKJAT.js","sources":["../src/modal/components/Body/index.tsx","../src/modal/components/CloseButton/theme.ts","../src/modal/components/CloseButton/index.tsx","../src/modal/components/Footer/index.tsx","../src/modal/components/Header/index.tsx","../src/modal/components/Title/theme.ts","../src/modal/components/Title/index.tsx","../src/modal/theme.ts","../src/modal/Component.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport { type IModalBodyProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalBody = ({ children, className, ...props }: IModalBodyProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalBody.displayName = 'Modal.Body';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const modalCloseButtonVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import { useContext } from 'react';\n\nimport cn from 'classnames';\nimport { OverlayTriggerStateContext } from 'react-aria-components';\n\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { modalCloseButtonVariants } from './theme';\nimport { type IModalCloseButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalCloseButton = ({ className, dataTestId, onClick, size = 'md', ...props }: IModalCloseButtonProps) => {\n const { close } = useAuiLabels();\n const state = useContext(OverlayTriggerStateContext);\n\n return (\n <button\n {...props}\n type=\"button\"\n className={cn(modalCloseButtonVariants({ size }), className)}\n aria-label={close}\n data-test-id={dataTestId}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n state?.close();\n }\n }}\n >\n <Clear className={styles.icon} />\n </button>\n );\n};\n\nModalCloseButton.displayName = 'Modal.CloseButton';\n","import cn from 'classnames';\n\nimport { type IModalFooterProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalFooter = ({ children, className, ...props }: IModalFooterProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalFooter.displayName = 'Modal.Footer';\n","import cn from 'classnames';\n\nimport { type IModalHeaderProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalHeader = ({ children, className, ...props }: IModalHeaderProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalHeader.displayName = 'Modal.Header';\n","import { cva } from 'class-variance-authority';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const modalTitleVariants = cva([styles.root, typographyStyles.bodyL]);\n","import cn from 'classnames';\nimport { Heading } from 'react-aria-components';\n\nimport { modalTitleVariants } from './theme';\nimport { type IModalTitleProps } from './types';\n\nexport const ModalTitle = ({ children, className, ...props }: IModalTitleProps) => (\n <Heading {...props} slot=\"title\" level={2} className={cn(modalTitleVariants(), className)}>\n {children}\n </Heading>\n);\n\nModalTitle.displayName = 'Modal.Title';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const modalOverlayVariants = cva(styles.overlay);\n\nexport const modalPanelVariants = cva(styles.panel, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n fullscreen: {\n true: styles.fullscreen,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n fullscreen: false,\n },\n});\n","import cn from 'classnames';\nimport { Dialog, Modal as RacModal, ModalOverlay } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { useOverlayExitComplete } from '@/hooks';\n\nimport { ModalBody } from './components/Body';\nimport { ModalCloseButton } from './components/CloseButton';\nimport { ModalFooter } from './components/Footer';\nimport { ModalHeader } from './components/Header';\nimport { ModalTitle } from './components/Title';\nimport { modalOverlayVariants, modalPanelVariants } from './theme';\nimport { type IModalProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst ModalExitComplete = ({\n open,\n isExiting,\n onExitComplete,\n}: {\n open: boolean;\n isExiting: boolean;\n onExitComplete?: () => void;\n}) => {\n useOverlayExitComplete(open, isExiting, onExitComplete);\n\n return null;\n};\n\nconst ModalRoot = supportRef(\n ({\n ref,\n children,\n open,\n onOpenChange,\n onExitComplete,\n size = 'md',\n variant = 'primary',\n fullscreen = false,\n dismissable = true,\n keyboardDismissable = true,\n className,\n dataTestId,\n ...props\n }: IModalProps) => (\n <ModalOverlay\n {...props}\n isOpen={open}\n onOpenChange={onOpenChange}\n isDismissable={dismissable}\n isKeyboardDismissDisabled={!keyboardDismissable}\n className={modalOverlayVariants()}\n >\n {({ isExiting }) => (\n <>\n <ModalExitComplete open={open} isExiting={isExiting} onExitComplete={onExitComplete} />\n <RacModal\n ref={ref}\n className={cn(\n modalPanelVariants({\n size: fullscreen ? undefined : size,\n variant,\n fullscreen,\n }),\n className\n )}\n >\n <Dialog className={styles.dialog} data-test-id={dataTestId}>\n {children}\n </Dialog>\n </RacModal>\n </>\n )}\n </ModalOverlay>\n )\n);\n\nModalRoot.displayName = 'Modal';\n\nexport const Modal = Object.assign(ModalRoot, {\n Header: ModalHeader,\n Title: ModalTitle,\n Body: ModalBody,\n Footer: ModalFooter,\n CloseButton: ModalCloseButton,\n});\n"],"names":["ModalBody","children","className","props","jsx","cn","styles","modalCloseButtonVariants","cva","ModalCloseButton","dataTestId","onClick","size","close","useAuiLabels","state","useContext","OverlayTriggerStateContext","event","Clear","ModalFooter","ModalHeader","modalTitleVariants","typographyStyles","ModalTitle","Heading","modalOverlayVariants","modalPanelVariants","ModalExitComplete","open","isExiting","onExitComplete","useOverlayExitComplete","ModalRoot","supportRef","ref","onOpenChange","variant","fullscreen","dismissable","keyboardDismissable","ModalOverlay","jsxs","Fragment","RacModal","Dialog","Modal"],"mappings":";;;;;;;;;;;;GAMaA,IAAY,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QAChD,gBAAAC,EAAC,OAAA,EAAK,GAAGD,GAAO,WAAWE,EAAGC,EAAO,MAAMJ,CAAS,GAC/C,UAAAD,GACL;AAGJD,EAAU,cAAc;;;;;;;GCRXO,IAA2BC,EAAIF,EAAO,MAAM;AAAA,EACrD,UAAU;AAAA,IACN,MAAM;AAAA,MACF,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,MACX,IAAIA,EAAO;AAAA,IAAA;AAAA,EACf;AAAA,EAEJ,iBAAiB;AAAA,IACb,MAAM;AAAA,EAAA;AAEd,CAAC,GCFYG,IAAmB,CAAC,EAAE,WAAAP,GAAW,YAAAQ,GAAY,SAAAC,GAAS,MAAAC,IAAO,MAAM,GAAGT,QAAoC;AACnH,QAAM,EAAE,OAAAU,EAAA,IAAUC,EAAA,GACZC,IAAQC,EAAWC,CAA0B;AAEnD,SACI,gBAAAb;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGD;AAAA,MACJ,MAAK;AAAA,MACL,WAAWE,EAAGE,EAAyB,EAAE,MAAAK,EAAA,CAAM,GAAGV,CAAS;AAAA,MAC3D,cAAYW;AAAA,MACZ,gBAAcH;AAAA,MACd,SAAS,CAAAQ,MAAS;AACd,QAAAP,IAAUO,CAAK,GACVA,EAAM,oBACPH,GAAO,MAAA;AAAA,MAEf;AAAA,MAEA,UAAA,gBAAAX,EAACe,GAAA,EAAM,WAAWb,EAAO,KAAA,CAAM;AAAA,IAAA;AAAA,EAAA;AAG3C;AAEAG,EAAiB,cAAc;;;GC9BlBW,IAAc,CAAC,EAAE,UAAAnB,GAAU,WAAAC,GAA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AAA4B;AAAA,IACA,cAAAO;AAAA,IACA,gBAAAL;AAAA,IACA,MAAAnB,IAAO;AAAA,IACP,SAAAyB,IAAU;AAAA,IACV,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,qBAAAC,IAAsB;AAAA,IACtB,WAAAtC;AAAA,IACA,YAAAQ;AAAA,IACA,GAAGP;AAAA,EAAA,MAEH,gBAAAC;AAAA,IAACqC;AAAA,IAAA;AAAA,MACI,GAAGtC;AAAA,MACJ,QAAQ0B;AAAA,MACR,cAAAO;AAAA,MACA,eAAeG;AAAA,MACf,2BAA2B,CAACC;AAAA,MAC5B,WAAWd,GAAA;AAAA,MAEV,UAAA,CAAC,EAAE,WAAAI,EAAA,MACA,gBAAAY,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAvC,EAACwB,IAAA,EAAkB,MAAAC,GAAY,WAAAC,GAAsB,gBAAAC,EAAA,CAAgC;AAAA,QACrF,gBAAA3B;AAAA,UAACwC;AAAAA,UAAA;AAAA,YACG,KAAAT;AAAA,YACA,WAAW9B;AAAA,cACPsB,GAAmB;AAAA,gBACf,MAAMW,IAAa,SAAY1B;AAAA,gBAC/B,SAAAyB;AAAA,gBACA,YAAAC;AAAA,cAAA,CACH;AAAA,cACDpC;AAAA,YAAA;AAAA,YAGJ,4BAAC2C,GAAA,EAAO,WAAWvC,EAAO,QAAQ,gBAAcI,GAC3C,UAAAT,EAAA,CACL;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;AAEAgC,EAAU,cAAc;AAEjB,MAAMa,KAAQ,OAAO,OAAOb,GAAW;AAAA,EAC1C,QAAQZ;AAAA,EACR,OAAOG;AAAA,EACP,MAAMxB;AAAA,EACN,QAAQoB;AAAA,EACR,aAAaX;AACjB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Component-BRHoDRtF.js","sources":["../src/modal/components/Body/index.tsx","../src/modal/components/CloseButton/theme.ts","../src/modal/components/CloseButton/index.tsx","../src/modal/components/Footer/index.tsx","../src/modal/components/Header/index.tsx","../src/modal/components/Title/theme.ts","../src/modal/components/Title/index.tsx","../src/modal/theme.ts","../src/modal/Component.tsx"],"sourcesContent":["import cn from 'classnames';\n\nimport { type IModalBodyProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalBody = ({ children, className, ...props }: IModalBodyProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalBody.displayName = 'Modal.Body';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const modalCloseButtonVariants = cva(styles.root, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n","import { useContext } from 'react';\n\nimport cn from 'classnames';\nimport { OverlayTriggerStateContext } from 'react-aria-components';\n\nimport { Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { modalCloseButtonVariants } from './theme';\nimport { type IModalCloseButtonProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalCloseButton = ({ className, dataTestId, onClick, size = 'md', ...props }: IModalCloseButtonProps) => {\n const { close } = useAuiLabels();\n const state = useContext(OverlayTriggerStateContext);\n\n return (\n <button\n {...props}\n type=\"button\"\n className={cn(modalCloseButtonVariants({ size }), className)}\n aria-label={close}\n data-test-id={dataTestId}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n state?.close();\n }\n }}\n >\n <Clear className={styles.icon} />\n </button>\n );\n};\n\nModalCloseButton.displayName = 'Modal.CloseButton';\n","import cn from 'classnames';\n\nimport { type IModalFooterProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalFooter = ({ children, className, ...props }: IModalFooterProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalFooter.displayName = 'Modal.Footer';\n","import cn from 'classnames';\n\nimport { type IModalHeaderProps } from './types';\n\nimport styles from './styles.module.css';\n\nexport const ModalHeader = ({ children, className, ...props }: IModalHeaderProps) => (\n <div {...props} className={cn(styles.root, className)}>\n {children}\n </div>\n);\n\nModalHeader.displayName = 'Modal.Header';\n","import { cva } from 'class-variance-authority';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const modalTitleVariants = cva([styles.root, typographyStyles.bodyL]);\n","import cn from 'classnames';\nimport { Heading } from 'react-aria-components';\n\nimport { modalTitleVariants } from './theme';\nimport { type IModalTitleProps } from './types';\n\nexport const ModalTitle = ({ children, className, ...props }: IModalTitleProps) => (\n <Heading {...props} slot=\"title\" level={2} className={cn(modalTitleVariants(), className)}>\n {children}\n </Heading>\n);\n\nModalTitle.displayName = 'Modal.Title';\n","import { cva } from 'class-variance-authority';\n\nimport styles from './styles.module.css';\n\nexport const modalOverlayVariants = cva(styles.overlay);\n\nexport const modalPanelVariants = cva(styles.panel, {\n variants: {\n size: {\n sm: styles.sm,\n md: styles.md,\n lg: styles.lg,\n },\n variant: {\n primary: styles.primary,\n },\n fullscreen: {\n true: styles.fullscreen,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n fullscreen: false,\n },\n});\n","import cn from 'classnames';\nimport { Dialog, Modal as RacModal, ModalOverlay } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { useOverlayExitComplete } from '@/hooks';\n\nimport { ModalBody } from './components/Body';\nimport { ModalCloseButton } from './components/CloseButton';\nimport { ModalFooter } from './components/Footer';\nimport { ModalHeader } from './components/Header';\nimport { ModalTitle } from './components/Title';\nimport { modalOverlayVariants, modalPanelVariants } from './theme';\nimport { type IModalProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst ModalExitComplete = ({\n open,\n isExiting,\n onExitComplete,\n}: {\n open: boolean;\n isExiting: boolean;\n onExitComplete?: () => void;\n}) => {\n useOverlayExitComplete(open, isExiting, onExitComplete);\n\n return null;\n};\n\nconst ModalRoot = supportRef(\n ({\n ref,\n children,\n open,\n onOpenChange,\n onExitComplete,\n size = 'md',\n variant = 'primary',\n fullscreen = false,\n dismissable = true,\n keyboardDismissable = true,\n className,\n dataTestId,\n ...props\n }: IModalProps) => (\n <ModalOverlay\n {...props}\n isOpen={open}\n onOpenChange={onOpenChange}\n isDismissable={dismissable}\n isKeyboardDismissDisabled={!keyboardDismissable}\n className={modalOverlayVariants()}\n >\n {({ isExiting }) => (\n <>\n <ModalExitComplete open={open} isExiting={isExiting} onExitComplete={onExitComplete} />\n <RacModal\n ref={ref}\n className={cn(\n modalPanelVariants({\n size: fullscreen ? undefined : size,\n variant,\n fullscreen,\n }),\n className\n )}\n >\n <Dialog className={styles.dialog} data-test-id={dataTestId}>\n {children}\n </Dialog>\n </RacModal>\n </>\n )}\n </ModalOverlay>\n )\n);\n\nModalRoot.displayName = 'Modal';\n\nexport const Modal = Object.assign(ModalRoot, {\n Header: ModalHeader,\n Title: ModalTitle,\n Body: ModalBody,\n Footer: ModalFooter,\n CloseButton: ModalCloseButton,\n});\n"],"names":["ModalBody","children","className","props","jsx","cn","styles","modalCloseButtonVariants","cva","ModalCloseButton","dataTestId","onClick","size","close","useAuiLabels","state","useContext","OverlayTriggerStateContext","event","Clear","ModalFooter","ModalHeader","modalTitleVariants","typographyStyles","ModalTitle","Heading","modalOverlayVariants","modalPanelVariants","ModalExitComplete","open","isExiting","onExitComplete","useOverlayExitComplete","ModalRoot","supportRef","ref","onOpenChange","variant","fullscreen","dismissable","keyboardDismissable","ModalOverlay","jsxs","Fragment","RacModal","Dialog","Modal"],"mappings":";;;;;;;;;;;;GAMaA,IAAY,CAAC,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,QAChD,gBAAAC,EAAC,OAAA,EAAK,GAAGD,GAAO,WAAWE,EAAGC,EAAO,MAAMJ,CAAS,GAC/C,UAAAD,GACL;AAGJD,EAAU,cAAc;;;;;;;GCRXO,IAA2BC,EAAIF,EAAO,MAAM;AAAA,EACrD,UAAU;AA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V,UAAA,CAAC,EAAE,WAAAI,EAAA,MACA,gBAAAY,EAAAC,GAAA,EACI,UAAA;AAAA,QAAA,gBAAAvC,EAACwB,IAAA,EAAkB,MAAAC,GAAY,WAAAC,GAAsB,gBAAAC,EAAA,CAAgC;AAAA,QACrF,gBAAA3B;AAAA,UAACwC;AAAAA,UAAA;AAAA,YACG,KAAAT;AAAA,YACA,WAAW9B;AAAA,cACPsB,GAAmB;AAAA,gBACf,MAAMW,IAAa,SAAY1B;AAAA,gBAC/B,SAAAyB;AAAA,gBACA,YAAAC;AAAA,cAAA,CACH;AAAA,cACDpC;AAAA,YAAA;AAAA,YAGJ,4BAAC2C,GAAA,EAAO,WAAWvC,EAAO,QAAQ,gBAAcI,GAC3C,UAAAT,EAAA,CACL;AAAA,UAAA;AAAA,QAAA;AAAA,MACJ,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;AAEAgC,EAAU,cAAc;AAEjB,MAAMa,KAAQ,OAAO,OAAOb,GAAW;AAAA,EAC1C,QAAQZ;AAAA,EACR,OAAOG;AAAA,EACP,MAAMxB;AAAA,EACN,QAAQoB;AAAA,EACR,aAAaX;AACjB,CAAC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as P } from "react";
|
|
3
3
|
import { B as d } from "../Component-CBWeJZfB.js";
|
|
4
|
-
import { M as n } from "../Component-
|
|
4
|
+
import { M as n } from "../Component-BRHoDRtF.js";
|
|
5
5
|
import { u as m } from "../hooks-BlX5Y4Zt.js";
|
|
6
6
|
const i = ({
|
|
7
7
|
open: l,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as L, createContext as P, useContext as q, useState as _ } from "react";
|
|
3
3
|
import { B } from "../Component-CBWeJZfB.js";
|
|
4
|
-
import { D as g } from "../Component-
|
|
4
|
+
import { D as g } from "../Component-B73be-FU.js";
|
|
5
5
|
import { u as R } from "../hooks-BlX5Y4Zt.js";
|
|
6
6
|
import H from "classnames";
|
|
7
7
|
import { useDragAndDrop as V, DropIndicator as G, GridList as M, GridListItem as O, Button as T } from "react-aria-components";
|
|
@@ -3,7 +3,7 @@ import { useContext as O, createContext as A, useRef as p, useCallback as h, use
|
|
|
3
3
|
import B from "classnames";
|
|
4
4
|
import { OverlayTriggerStateContext as W, Heading as k, ModalOverlay as z, Modal as K, Dialog as U } from "react-aria-components";
|
|
5
5
|
import { s as G } from "../index-h8z54aFR.js";
|
|
6
|
-
import { u as X } from "../useOverlayExitComplete-
|
|
6
|
+
import { u as X } from "../useOverlayExitComplete-Bra8dR0m.js";
|
|
7
7
|
import { C as q } from "../Clear-DcxADxz6.js";
|
|
8
8
|
import { u as J } from "../hooks-BlX5Y4Zt.js";
|
|
9
9
|
import { cva as E } from "class-variance-authority";
|
package/dist/drawer/index.js
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Calls `onExitComplete` once after the overlay has been shown and then fully left
|
|
3
3
|
* (`open === false` and `isExiting === false`), including when exit animation is skipped
|
|
4
|
-
* or the overlay unmounts during exit.
|
|
4
|
+
* or the overlay unmounts during exit. The unmount call is deferred by a tick so the
|
|
5
|
+
* Strict Mode mount → cleanup → mount replay does not fire it.
|
|
5
6
|
*/
|
|
6
7
|
export declare const useOverlayExitComplete: (open: boolean, isExiting: boolean, onExitComplete?: () => void) => void;
|
|
7
8
|
//# sourceMappingURL=useOverlayExitComplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverlayExitComplete.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOverlayExitComplete.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"useOverlayExitComplete.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOverlayExitComplete.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,OAAO,EAAE,WAAW,OAAO,EAAE,iBAAiB,MAAM,IAAI,SAmCpG,CAAC"}
|
package/dist/modal/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ElementType } from 'react';
|
|
2
|
+
import { TAdminUiProviderProps } from './types';
|
|
3
|
+
export declare const AdminUiProvider: (<P extends ElementType = "div">({ children, direction, locale, labels: labelsProp, linkComponent, className, ...props }: TAdminUiProviderProps<P>) => import("react").JSX.Element) & {
|
|
3
4
|
displayName?: string;
|
|
4
5
|
};
|
|
5
6
|
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/provider/Component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/provider/Component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,WAAW,EAAY,MAAM,OAAO,CAAC;AAU3F,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA6D5E,eAAO,MAAM,eAAe,IACvB,CAAC,SAAS,WAAW,mGAQnB,qBAAqB,CAAC,CAAC,CAAC;;CAkB9B,CAAC"}
|
package/dist/provider/index.js
CHANGED
|
@@ -1,73 +1,70 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { UNSAFE_PortalProvider as
|
|
5
|
-
import { useLocale as
|
|
6
|
-
import { s as
|
|
7
|
-
import { typographyStyles as
|
|
8
|
-
import { A as
|
|
9
|
-
import { a as
|
|
10
|
-
import '../assets/index3.css';const
|
|
11
|
-
root:
|
|
12
|
-
},
|
|
13
|
-
({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const { direction: c } = x(), e = t ?? c, [d, f] = y(null), p = (a) => {
|
|
22
|
-
if (f(a), typeof o == "function") {
|
|
23
|
-
o(a);
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as L, useCallback as P, useMemo as d } from "react";
|
|
3
|
+
import h from "classnames";
|
|
4
|
+
import { UNSAFE_PortalProvider as U } from "react-aria";
|
|
5
|
+
import { useLocale as _, I18nProvider as E } from "react-aria-components";
|
|
6
|
+
import { s as p } from "../index-h8z54aFR.js";
|
|
7
|
+
import { typographyStyles as S } from "../typography/index.js";
|
|
8
|
+
import { A as g, d as C } from "../hooks-BlX5Y4Zt.js";
|
|
9
|
+
import { a as J, u as K, b as O, c as Q } from "../hooks-BlX5Y4Zt.js";
|
|
10
|
+
import '../assets/index3.css';const D = "aub_styles-module_root_d7401", M = {
|
|
11
|
+
root: D
|
|
12
|
+
}, N = p(
|
|
13
|
+
({ as: n, children: c, className: o, direction: e, value: t, ref: s, ...u }) => {
|
|
14
|
+
const a = n ?? "div", { direction: A } = _(), l = e ?? A, [R, b] = x(null), f = L(s);
|
|
15
|
+
f.current = s;
|
|
16
|
+
const y = P((m) => {
|
|
17
|
+
b(m);
|
|
18
|
+
const { current: i } = f;
|
|
19
|
+
if (typeof i == "function") {
|
|
20
|
+
i(m);
|
|
24
21
|
return;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
23
|
+
i && (i.current = m);
|
|
24
|
+
}, []), v = d(
|
|
28
25
|
() => ({
|
|
29
|
-
...
|
|
30
|
-
direction:
|
|
26
|
+
...t,
|
|
27
|
+
direction: l
|
|
31
28
|
}),
|
|
32
|
-
[
|
|
29
|
+
[t, l]
|
|
33
30
|
);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
31
|
+
return /* @__PURE__ */ r(g.Provider, { value: v, children: /* @__PURE__ */ r(U, { getContainer: () => R, children: /* @__PURE__ */ r(
|
|
32
|
+
a,
|
|
36
33
|
{
|
|
37
34
|
...u,
|
|
38
|
-
ref:
|
|
39
|
-
className:
|
|
40
|
-
dir:
|
|
41
|
-
children:
|
|
35
|
+
ref: y,
|
|
36
|
+
className: h(M.root, S.bodyM, o),
|
|
37
|
+
dir: l,
|
|
38
|
+
children: c
|
|
42
39
|
}
|
|
43
40
|
) }) });
|
|
44
41
|
}
|
|
45
|
-
),
|
|
42
|
+
), B = p(
|
|
46
43
|
({
|
|
47
|
-
children:
|
|
48
|
-
direction:
|
|
49
|
-
locale:
|
|
50
|
-
labels:
|
|
51
|
-
linkComponent:
|
|
52
|
-
className:
|
|
53
|
-
...
|
|
44
|
+
children: n,
|
|
45
|
+
direction: c,
|
|
46
|
+
locale: o = "ru-RU",
|
|
47
|
+
labels: e,
|
|
48
|
+
linkComponent: t,
|
|
49
|
+
className: s,
|
|
50
|
+
...u
|
|
54
51
|
}) => {
|
|
55
|
-
const
|
|
52
|
+
const a = d(
|
|
56
53
|
() => ({
|
|
57
|
-
locale:
|
|
58
|
-
labels: { ...
|
|
59
|
-
linkComponent:
|
|
54
|
+
locale: o,
|
|
55
|
+
labels: { ...C, ...e },
|
|
56
|
+
linkComponent: t
|
|
60
57
|
}),
|
|
61
|
-
[
|
|
58
|
+
[o, e, t]
|
|
62
59
|
);
|
|
63
|
-
return /* @__PURE__ */
|
|
60
|
+
return /* @__PURE__ */ r(E, { locale: o, children: /* @__PURE__ */ r(N, { ...u, className: s, direction: c, value: a, children: n }) });
|
|
64
61
|
}
|
|
65
62
|
);
|
|
66
63
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
B as AdminUiProvider,
|
|
65
|
+
J as useAuiDirection,
|
|
66
|
+
K as useAuiLabels,
|
|
67
|
+
O as useAuiLink,
|
|
68
|
+
Q as useAuiLocale
|
|
72
69
|
};
|
|
73
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/provider/Component.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\n\nimport cn from 'classnames';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria';\nimport { I18nProvider, useLocale } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { AuiContext, defaultLabels } from './context';\nimport { type
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/provider/Component.tsx"],"sourcesContent":["import { useCallback, useMemo, useRef, useState, type ElementType, type Ref } from 'react';\n\nimport cn from 'classnames';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria';\nimport { I18nProvider, useLocale } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\nimport { typographyStyles } from '@ds/typography';\n\nimport { AuiContext, defaultLabels } from './context';\nimport { type IAuiContextValue, type TAdminUiProviderProps } from './types';\n\nimport styles from './styles.module.css';\n\ntype TRootRef = Ref<HTMLElement>;\n\ntype TAdminUiRootProps = {\n as?: ElementType;\n value: Omit<IAuiContextValue, 'direction'>;\n ref?: TRootRef;\n} & Omit<TAdminUiProviderProps, 'as' | 'locale' | 'labels' | 'linkComponent' | 'ref'>;\n\nconst AdminUiRoot = supportRef(\n ({ as, children, className, direction: directionProp, value, ref, ...props }: TAdminUiRootProps) => {\n const Root = (as ?? 'div') as ElementType;\n const { direction: localeDirection } = useLocale();\n const direction = directionProp ?? localeDirection;\n const [portalEl, setPortalEl] = useState<HTMLElement | null>(null);\n const externalRef = useRef<TRootRef>(ref);\n\n externalRef.current = ref;\n\n const setRootRef = useCallback((node: HTMLElement | null) => {\n setPortalEl(node);\n\n const { current } = externalRef;\n\n if (typeof current === 'function') {\n current(node);\n\n return;\n }\n\n if (current) current.current = node;\n }, []);\n\n const contextValue = useMemo<IAuiContextValue>(\n () => ({\n ...value,\n direction,\n }),\n [value, direction]\n );\n\n return (\n <AuiContext.Provider value={contextValue}>\n <PortalProvider getContainer={() => portalEl}>\n <Root\n {...props}\n ref={setRootRef}\n className={cn(styles.root, typographyStyles.bodyM, className)}\n dir={direction}\n >\n {children}\n </Root>\n </PortalProvider>\n </AuiContext.Provider>\n );\n }\n);\n\nexport const AdminUiProvider = supportRef(\n <P extends ElementType = 'div'>({\n children,\n direction,\n locale = 'ru-RU',\n labels: labelsProp,\n linkComponent,\n className,\n ...props\n }: TAdminUiProviderProps<P>) => {\n const value = useMemo(\n () => ({\n locale,\n labels: { ...defaultLabels, ...labelsProp },\n linkComponent,\n }),\n [locale, labelsProp, linkComponent]\n );\n\n return (\n <I18nProvider locale={locale}>\n <AdminUiRoot {...props} className={className} direction={direction} value={value}>\n {children}\n </AdminUiRoot>\n </I18nProvider>\n );\n }\n);\n"],"names":["AdminUiRoot","supportRef","as","children","className","directionProp","value","ref","props","Root","localeDirection","useLocale","direction","portalEl","setPortalEl","useState","externalRef","useRef","setRootRef","useCallback","node","current","contextValue","useMemo","jsx","AuiContext","PortalProvider","cn","styles","typographyStyles","AdminUiProvider","locale","labelsProp","linkComponent","defaultLabels","I18nProvider"],"mappings":";;;;;;;;;;;GAsBMA,IAAcC;AAAA,EAChB,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,WAAAC,GAAW,WAAWC,GAAe,OAAAC,GAAO,KAAAC,GAAK,GAAGC,QAA+B;AAChG,UAAMC,IAAQP,KAAM,OACd,EAAE,WAAWQ,EAAA,IAAoBC,EAAA,GACjCC,IAAYP,KAAiBK,GAC7B,CAACG,GAAUC,CAAW,IAAIC,EAA6B,IAAI,GAC3DC,IAAcC,EAAiBV,CAAG;AAExC,IAAAS,EAAY,UAAUT;AAEtB,UAAMW,IAAaC,EAAY,CAACC,MAA6B;AACzD,MAAAN,EAAYM,CAAI;AAEhB,YAAM,EAAE,SAAAC,MAAYL;AAEpB,UAAI,OAAOK,KAAY,YAAY;AAC/B,QAAAA,EAAQD,CAAI;AAEZ;AAAA,MACJ;AAEA,MAAIC,QAAiB,UAAUD;AAAA,IACnC,GAAG,CAAA,CAAE,GAECE,IAAeC;AAAA,MACjB,OAAO;AAAA,QACH,GAAGjB;AAAA,QACH,WAAAM;AAAA,MAAA;AAAA,MAEJ,CAACN,GAAOM,CAAS;AAAA,IAAA;AAGrB,WACI,gBAAAY,EAACC,EAAW,UAAX,EAAoB,OAAOH,GACxB,UAAA,gBAAAE,EAACE,GAAA,EAAe,cAAc,MAAMb,GAChC,UAAA,gBAAAW;AAAA,MAACf;AAAA,MAAA;AAAA,QACI,GAAGD;AAAA,QACJ,KAAKU;AAAA,QACL,WAAWS,EAAGC,EAAO,MAAMC,EAAiB,OAAOzB,CAAS;AAAA,QAC5D,KAAKQ;AAAA,QAEJ,UAAAT;AAAA,MAAA;AAAA,IAAA,GAET,EAAA,CACJ;AAAA,EAER;AACJ,GAEa2B,IAAkB7B;AAAA,EAC3B,CAAgC;AAAA,IAC5B,UAAAE;AAAA,IACA,WAAAS;AAAA,IACA,QAAAmB,IAAS;AAAA,IACT,QAAQC;AAAA,IACR,eAAAC;AAAA,IACA,WAAA7B;AAAA,IACA,GAAGI;AAAA,EAAA,MACyB;AAC5B,UAAMF,IAAQiB;AAAA,MACV,OAAO;AAAA,QACH,QAAAQ;AAAA,QACA,QAAQ,EAAE,GAAGG,GAAe,GAAGF,EAAA;AAAA,QAC/B,eAAAC;AAAA,MAAA;AAAA,MAEJ,CAACF,GAAQC,GAAYC,CAAa;AAAA,IAAA;AAGtC,WACI,gBAAAT,EAACW,GAAA,EAAa,QAAAJ,GACV,UAAA,gBAAAP,EAACxB,GAAA,EAAa,GAAGQ,GAAO,WAAAJ,GAAsB,WAAAQ,GAAsB,OAAAN,GAC/D,UAAAH,EAAA,CACL,EAAA,CACJ;AAAA,EAER;AACJ;"}
|
package/dist/provider/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { TMergeElementProps } from '../ds/common/index.js';
|
|
2
3
|
export type TTextDirection = 'ltr' | 'rtl';
|
|
3
4
|
/** Built-in a11y / UI label strings. */
|
|
4
5
|
export interface IAuiLabels {
|
|
@@ -80,9 +81,10 @@ export interface IAuiContextValue {
|
|
|
80
81
|
/** Host router link. Defaults to `a`. */
|
|
81
82
|
linkComponent?: TAuiLinkComponent;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
/** Own / chrome props (not from DOM). */
|
|
85
|
+
export interface IAdminUiProviderOwnProps {
|
|
84
86
|
children: ReactNode;
|
|
85
|
-
/** Text direction. Defaults to
|
|
87
|
+
/** Text direction. Defaults to the locale direction. */
|
|
86
88
|
direction?: TTextDirection;
|
|
87
89
|
/** BCP 47 locale. */
|
|
88
90
|
locale?: string;
|
|
@@ -91,4 +93,8 @@ export interface IAdminUiProviderProps extends Omit<ComponentPropsWithRef<'div'>
|
|
|
91
93
|
/** Host router link for menu navigation. Defaults to `a`. */
|
|
92
94
|
linkComponent?: TAuiLinkComponent;
|
|
93
95
|
}
|
|
96
|
+
export type TAdminUiProviderProps<P extends ElementType = 'div'> = {
|
|
97
|
+
/** Root element. Defaults to `div`. */
|
|
98
|
+
as?: P;
|
|
99
|
+
} & Omit<TMergeElementProps<P, IAdminUiProviderOwnProps>, 'dir'>;
|
|
94
100
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAErF,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3C,wCAAwC;AACxC,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAA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AiB,GAAG,WAAW,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;AAExE,8BAA8B;AAC9B,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,yCAAyC;IACzC,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,yCAAyC;AACzC,MAAM,WAAW,wBAAwB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACrC;AAED,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI;IAC/D,uCAAuC;IACvC,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,wBAAwB,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRef as c, useEffect as s } from "react";
|
|
2
|
+
const a = (r, t, n) => {
|
|
3
|
+
const e = c(!1), u = c(n), f = c(void 0);
|
|
4
|
+
u.current = n, (r || t) && (e.current = !0), s(() => {
|
|
5
|
+
!e.current || r || t || (e.current = !1, u.current?.());
|
|
6
|
+
}, [r, t]), s(() => (clearTimeout(f.current), () => {
|
|
7
|
+
f.current = setTimeout(() => {
|
|
8
|
+
e.current && (e.current = !1, u.current?.());
|
|
9
|
+
}, 0);
|
|
10
|
+
}), []);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
a as u
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=useOverlayExitComplete-Bra8dR0m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverlayExitComplete-Bra8dR0m.js","sources":["../src/hooks/useOverlayExitComplete.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n/**\n * Calls `onExitComplete` once after the overlay has been shown and then fully left\n * (`open === false` and `isExiting === false`), including when exit animation is skipped\n * or the overlay unmounts during exit. The unmount call is deferred by a tick so the\n * Strict Mode mount → cleanup → mount replay does not fire it.\n */\nexport const useOverlayExitComplete = (open: boolean, isExiting: boolean, onExitComplete?: () => void) => {\n const hadPresenceRef = useRef(false);\n const onExitCompleteRef = useRef(onExitComplete);\n const unmountTimerRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n onExitCompleteRef.current = onExitComplete;\n\n if (open || isExiting) {\n hadPresenceRef.current = true;\n }\n\n useEffect(() => {\n if (!hadPresenceRef.current || open || isExiting) {\n return;\n }\n\n hadPresenceRef.current = false;\n onExitCompleteRef.current?.();\n }, [open, isExiting]);\n\n useEffect(() => {\n // Strict Mode replay: cancel the exit scheduled by the simulated unmount.\n clearTimeout(unmountTimerRef.current);\n\n return () => {\n // Defer so Strict Mode's mount → cleanup → mount does not remove a live overlay.\n unmountTimerRef.current = setTimeout(() => {\n if (!hadPresenceRef.current) {\n return;\n }\n\n hadPresenceRef.current = false;\n onExitCompleteRef.current?.();\n }, 0);\n };\n }, []);\n};\n"],"names":["useOverlayExitComplete","open","isExiting","onExitComplete","hadPresenceRef","useRef","onExitCompleteRef","unmountTimerRef","useEffect"],"mappings":";AAQO,MAAMA,IAAyB,CAACC,GAAeC,GAAoBC,MAAgC;AACtG,QAAMC,IAAiBC,EAAO,EAAK,GAC7BC,IAAoBD,EAAOF,CAAc,GACzCI,IAAkBF,EAAsC,MAAS;AACvE,EAAAC,EAAkB,UAAUH,IAExBF,KAAQC,OACRE,EAAe,UAAU,KAG7BI,EAAU,MAAM;AACZ,IAAI,CAACJ,EAAe,WAAWH,KAAQC,MAIvCE,EAAe,UAAU,IACzBE,EAAkB,UAAA;AAAA,EACtB,GAAG,CAACL,GAAMC,CAAS,CAAC,GAEpBM,EAAU,OAEN,aAAaD,EAAgB,OAAO,GAE7B,MAAM;AAET,IAAAA,EAAgB,UAAU,WAAW,MAAM;AACvC,MAAKH,EAAe,YAIpBA,EAAe,UAAU,IACzBE,EAAkB,UAAA;AAAA,IACtB,GAAG,CAAC;AAAA,EACR,IACD,CAAA,CAAE;AACT;"}
|
package/docs/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Канал | Где | Для кого |
|
|
6
6
|
| --- | --- | --- |
|
|
7
7
|
| Онбординг / API примитивов | Storybook + `src/<name>/docs/` | люди + агенты |
|
|
8
|
-
| Пакет (этот каталог) | `docs/*.md`, `
|
|
8
|
+
| Пакет (этот каталог) | `docs/*.md`, `ai/skills/` | контрибьюторы, АП |
|
|
9
9
|
| Визуал АП (текст) | [`design-language.md`](./design-language.md) | продукт / дизайн (в npm публикуется) |
|
|
10
10
|
|
|
11
11
|
## В этом каталоге
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
- [architecture.md](./architecture.md) — стек, токены, Form, exports
|
|
14
14
|
- [ai.md](./ai.md) — канал для АП / skills
|
|
15
15
|
- [design-language.md](./design-language.md) — визуальный канон (слои, CascadeMenu WIP, list/detail); в npm уходит [design-language.en.md](./design-language.en.md)
|
|
16
|
-
- [skills/](
|
|
16
|
+
- [`ai/skills/admin-ui/`](../ai/skills/admin-ui/) — skill `admin-ui` (в npm через `ai-sync`; postinstall пишет `.cursor` / `.claude` / `.agents` и блок в `AGENTS.md`, см. [ai.md](./ai.md))
|
|
17
17
|
|
|
18
18
|
## Storybook
|
|
19
19
|
|
package/docs/ai.md
CHANGED
|
@@ -23,25 +23,25 @@ The npm package ships English only, renamed for agents:
|
|
|
23
23
|
|
|
24
24
|
Thin router for **consuming** the UI kit (pick a primitive, then read its Description). Authoring Description / stories — separate skill `write-component-docs`.
|
|
25
25
|
|
|
26
|
-
Location in the package: `
|
|
26
|
+
Location in the package: `ai/skills/admin-ui/SKILL.md`.
|
|
27
27
|
|
|
28
28
|
In a consumer app:
|
|
29
29
|
|
|
30
|
-
- skill — `node_modules/@ensi-platform/admin-ui/
|
|
30
|
+
- skill — `node_modules/@ensi-platform/admin-ui/ai/skills/admin-ui/`
|
|
31
31
|
- contract — `node_modules/@ensi-platform/admin-ui/src/<name>/docs/`, `…/types.ts` (`icons`, `hooks`, `combobox` included)
|
|
32
32
|
|
|
33
|
-
`postinstall` (`
|
|
33
|
+
`postinstall` runs `admin-ui:ai` (`bin/ai.js`). It copies the skill directory and writes a pointer:
|
|
34
34
|
|
|
35
|
-
- `.cursor/skills/admin-ui
|
|
36
|
-
- `.claude/skills/admin-ui
|
|
37
|
-
- marker `<!-- @ensi-platform/admin-ui:start -->` … `:end` in the consumer repo `AGENTS.md` (rest of the file stays)
|
|
35
|
+
- `.cursor/skills/admin-ui/`
|
|
36
|
+
- `.claude/skills/admin-ui/`
|
|
37
|
+
- `.agents/skills/admin-ui/` and marker `<!-- @ensi-platform/admin-ui:start -->` … `:end` in the consumer repo `AGENTS.md` (rest of the file stays)
|
|
38
38
|
|
|
39
39
|
Limits:
|
|
40
40
|
|
|
41
|
-
- consumer root is the nearest `.git` from `INIT_CWD`; if none, the script
|
|
41
|
+
- consumer root is the nearest `.git` from `INIT_CWD`; if none, the script exits and `|| exit 0` keeps `install` green
|
|
42
|
+
- export is skipped inside the admin-ui repository
|
|
42
43
|
- **pnpm ≥ 9** ignores dependency lifecycle scripts until `pnpm approve-builds @ensi-platform/admin-ui` (or `pnpm.onlyBuiltDependencies`), then `pnpm install` again
|
|
43
|
-
- manual run: `
|
|
44
|
-
- opt out of all three: `ADMIN_UI_SKIP_CONSUMER_SYNC=1`
|
|
44
|
+
- manual run: `pnpm exec admin-ui:ai` (`--cursor`, `--claude`, `--codex`; no flags means all three)
|
|
45
45
|
|
|
46
46
|
Updating a Description does not require editing the skill.
|
|
47
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ensi-platform/admin-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Admin UI for Ensi admin panel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -9,15 +9,10 @@
|
|
|
9
9
|
],
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"docs/skills",
|
|
13
12
|
"docs/ai.md",
|
|
14
13
|
"docs/architecture.md",
|
|
15
14
|
"docs/README.md",
|
|
16
15
|
"docs/design-language.md",
|
|
17
|
-
"scripts/consumer-root.ts",
|
|
18
|
-
"scripts/sync-skill-consumer.ts",
|
|
19
|
-
"scripts/sync-agents-consumer.ts",
|
|
20
|
-
"scripts/sync-consumer.ts",
|
|
21
16
|
"src/*/docs/Description.md",
|
|
22
17
|
"src/*/docs/Example.md",
|
|
23
18
|
"src/*/docs/cssVariables.ts",
|
|
@@ -27,7 +22,9 @@
|
|
|
27
22
|
"src/ds/typography/docs/Example.md",
|
|
28
23
|
"src/ds/typography/docs/cssVariables.ts",
|
|
29
24
|
"src/docs/getting-started/Description.md",
|
|
30
|
-
"src/docs/ai/Description.md"
|
|
25
|
+
"src/docs/ai/Description.md",
|
|
26
|
+
"ai",
|
|
27
|
+
"bin"
|
|
31
28
|
],
|
|
32
29
|
"keywords": [
|
|
33
30
|
"ensi",
|
|
@@ -274,7 +271,10 @@
|
|
|
274
271
|
"import": "./dist/vertical-tabs/index.js"
|
|
275
272
|
}
|
|
276
273
|
},
|
|
274
|
+
"bin": {
|
|
275
|
+
"admin-ui:ai": "./bin/ai.js"
|
|
276
|
+
},
|
|
277
277
|
"scripts": {
|
|
278
|
-
"postinstall": "node
|
|
278
|
+
"postinstall": "node ./bin/ai.js || exit 0"
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -23,25 +23,25 @@ The npm package ships English only, renamed for agents:
|
|
|
23
23
|
|
|
24
24
|
Thin router for **consuming** the UI kit (pick a primitive, then read its Description). Authoring Description / stories — separate skill `write-component-docs`.
|
|
25
25
|
|
|
26
|
-
Location in the package: `
|
|
26
|
+
Location in the package: `ai/skills/admin-ui/SKILL.md`.
|
|
27
27
|
|
|
28
28
|
In a consumer app:
|
|
29
29
|
|
|
30
|
-
- skill — `node_modules/@ensi-platform/admin-ui/
|
|
30
|
+
- skill — `node_modules/@ensi-platform/admin-ui/ai/skills/admin-ui/`
|
|
31
31
|
- contract — `node_modules/@ensi-platform/admin-ui/src/<name>/docs/`, `…/types.ts` (`icons`, `hooks`, `combobox` included)
|
|
32
32
|
|
|
33
|
-
`postinstall` (`
|
|
33
|
+
`postinstall` runs `admin-ui:ai` (`bin/ai.js`). It copies the skill directory and writes a pointer:
|
|
34
34
|
|
|
35
|
-
- `.cursor/skills/admin-ui
|
|
36
|
-
- `.claude/skills/admin-ui
|
|
37
|
-
- marker `<!-- @ensi-platform/admin-ui:start -->` … `:end` in the consumer repo `AGENTS.md` (rest of the file stays)
|
|
35
|
+
- `.cursor/skills/admin-ui/`
|
|
36
|
+
- `.claude/skills/admin-ui/`
|
|
37
|
+
- `.agents/skills/admin-ui/` and marker `<!-- @ensi-platform/admin-ui:start -->` … `:end` in the consumer repo `AGENTS.md` (rest of the file stays)
|
|
38
38
|
|
|
39
39
|
Limits:
|
|
40
40
|
|
|
41
|
-
- consumer root is the nearest `.git` from `INIT_CWD`; if none, the script
|
|
41
|
+
- consumer root is the nearest `.git` from `INIT_CWD`; if none, the script exits and `|| exit 0` keeps `install` green
|
|
42
|
+
- export is skipped inside the admin-ui repository
|
|
42
43
|
- **pnpm ≥ 9** ignores dependency lifecycle scripts until `pnpm approve-builds @ensi-platform/admin-ui` (or `pnpm.onlyBuiltDependencies`), then `pnpm install` again
|
|
43
|
-
- manual run: `
|
|
44
|
-
- opt out of all three: `ADMIN_UI_SKIP_CONSUMER_SYNC=1`
|
|
44
|
+
- manual run: `pnpm exec admin-ui:ai` (`--cursor`, `--claude`, `--codex`; no flags means all three)
|
|
45
45
|
|
|
46
46
|
Updating a Description does not require editing the skill.
|
|
47
47
|
|