@telegraph/modal 0.1.21 → 0.2.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/CHANGELOG.md +22 -0
- package/README.md +31 -17
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +481 -466
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Modal/Modal.d.ts +21 -12
- package/dist/types/Modal/Modal.d.ts.map +1 -1
- package/dist/types/Modal/index.d.ts +1 -0
- package/dist/types/Modal/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +8 -7
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import { FocusScope } from '@radix-ui/react-focus-scope';
|
|
2
2
|
import { Button } from '@telegraph/button';
|
|
3
|
-
import { PolymorphicProps, TgphComponentProps, TgphElement } from '@telegraph/helpers';
|
|
4
|
-
import { Stack } from '@telegraph/layout';
|
|
3
|
+
import { PolymorphicProps, RemappedOmit, TgphComponentProps, TgphElement } from '@telegraph/helpers';
|
|
4
|
+
import { Box, Stack } from '@telegraph/layout';
|
|
5
|
+
import { Heading as TelegraphHeading } from '@telegraph/typography';
|
|
5
6
|
import { default as React } from 'react';
|
|
6
7
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
7
|
-
type RootProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog.Root>, "modal"> & React.ComponentPropsWithoutRef<typeof FocusScope> & TgphComponentProps<typeof Stack> & {
|
|
8
|
+
export type RootProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog.Root>, "modal"> & React.ComponentPropsWithoutRef<typeof FocusScope> & TgphComponentProps<typeof Stack> & {
|
|
8
9
|
a11yTitle: string;
|
|
9
10
|
a11yDescription?: string;
|
|
10
11
|
layer?: number;
|
|
11
12
|
};
|
|
12
13
|
declare const Root: ({ defaultOpen: defaultOpenProp, open: openProp, onOpenChange: onOpenChangeProp, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
13
|
-
type
|
|
14
|
+
export type OverlayProps = TgphComponentProps<typeof Box> & {
|
|
15
|
+
layer: number;
|
|
16
|
+
};
|
|
17
|
+
export type ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> & TgphComponentProps<typeof Stack>;
|
|
14
18
|
declare const Content: React.ForwardRefExoticComponent<Omit<ContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
type CloseProps<T extends TgphElement> = TgphComponentProps<typeof Button<T>> & Omit<React.ComponentPropsWithoutRef<typeof Dialog.Close>, "color">;
|
|
16
|
-
declare const Close: <T extends TgphElement>({ size, variant, ...props }: CloseProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
type BodyProps<T extends TgphElement> = PolymorphicProps<T> & TgphComponentProps<typeof Stack>;
|
|
18
|
-
declare const Body: <T extends TgphElement>({ style, children, ...props }: BodyProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
type HeaderProps<T extends TgphElement> = PolymorphicProps<T> & TgphComponentProps<typeof Stack>;
|
|
20
|
-
declare const Header: <T extends TgphElement>({ children, ...props }: HeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
type FooterProps<T extends TgphElement> = PolymorphicProps<T> & TgphComponentProps<typeof Stack>;
|
|
22
|
-
declare const Footer: <T extends TgphElement>({ children, ...props }: FooterProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export type CloseProps<T extends TgphElement = "button"> = TgphComponentProps<typeof Button<T>> & Omit<React.ComponentPropsWithoutRef<typeof Dialog.Close>, "color">;
|
|
20
|
+
declare const Close: <T extends TgphElement = "button">({ size, variant, ...props }: CloseProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type BodyProps<T extends TgphElement = "div"> = PolymorphicProps<T> & Omit<TgphComponentProps<typeof Stack>, "as">;
|
|
22
|
+
declare const Body: <T extends TgphElement = "div">({ style, children, ...props }: BodyProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export type HeaderProps<T extends TgphElement = "div"> = PolymorphicProps<T> & Omit<TgphComponentProps<typeof Stack>, "as">;
|
|
24
|
+
declare const Header: <T extends TgphElement = "div">({ children, ...props }: HeaderProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export type FooterProps<T extends TgphElement = "div"> = PolymorphicProps<T> & Omit<TgphComponentProps<typeof Stack>, "as">;
|
|
26
|
+
declare const Footer: <T extends TgphElement = "div">({ children, ...props }: FooterProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
type HeadingProps<T extends TgphElement> = RemappedOmit<TgphComponentProps<typeof TelegraphHeading<T>>, "as"> & {
|
|
28
|
+
as?: T;
|
|
29
|
+
};
|
|
30
|
+
declare const Heading: <T extends TgphElement = "h2">({ as, size, weight, ...props }: HeadingProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
23
31
|
declare const Modal: {
|
|
24
32
|
Root: typeof Root;
|
|
25
33
|
Content: typeof Content;
|
|
@@ -27,6 +35,7 @@ declare const Modal: {
|
|
|
27
35
|
Body: typeof Body;
|
|
28
36
|
Header: typeof Header;
|
|
29
37
|
Footer: typeof Footer;
|
|
38
|
+
Heading: typeof Heading;
|
|
30
39
|
};
|
|
31
40
|
export { Modal };
|
|
32
41
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO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I,CAAC,SAAS,WAAW,GAAG,IAAI,EAAE,gCAK5C,YAAY,CAAC,CAAC,CAAC,4CASjB,CAAC;AAEF,QAAA,MAAM,KAAK,EAAS;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB,CAAC;AAYF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Modal } from './Modal';
|
|
2
|
+
export type { RootProps as ModalRootProps, ContentProps as ModalContentProps, CloseProps as ModalCloseProps, BodyProps as ModalBodyProps, HeaderProps as ModalHeaderProps, FooterProps as ModalFooterProps, OverlayProps as ModalOverlayProps, } from './Modal';
|
|
2
3
|
export { ModalStackingProvider, useModalStacking } from './ModalStacking';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EACV,SAAS,IAAI,cAAc,EAC3B,YAAY,IAAI,iBAAiB,EACjC,UAAU,IAAI,eAAe,EAC7B,SAAS,IAAI,cAAc,EAC3B,WAAW,IAAI,gBAAgB,EAC/B,WAAW,IAAI,gBAAgB,EAC/B,YAAY,IAAI,iBAAiB,GAClC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACvD,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/modal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/modal",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,13 +31,14 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
33
33
|
"@radix-ui/react-focus-scope": "^1.1.8",
|
|
34
|
-
"@radix-ui/react-portal": "^1.1.
|
|
34
|
+
"@radix-ui/react-portal": "^1.1.10",
|
|
35
35
|
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
36
|
-
"@telegraph/button": "^0.
|
|
36
|
+
"@telegraph/button": "^0.4.0",
|
|
37
37
|
"@telegraph/helpers": "^0.0.15",
|
|
38
|
-
"@telegraph/icon": "^0.
|
|
39
|
-
"@telegraph/layout": "^0.
|
|
38
|
+
"@telegraph/icon": "^0.4.0",
|
|
39
|
+
"@telegraph/layout": "^0.4.0",
|
|
40
40
|
"@telegraph/style-engine": "^0.2.2",
|
|
41
|
+
"@telegraph/typography": "^0.2.0",
|
|
41
42
|
"lucide-react": "^0.544.0",
|
|
42
43
|
"motion": "^12.23.12"
|
|
43
44
|
},
|
|
@@ -49,8 +50,8 @@
|
|
|
49
50
|
"@telegraph/vite-config": "^0.0.15",
|
|
50
51
|
"@types/react": "^19.2.9",
|
|
51
52
|
"eslint": "^8.56.0",
|
|
52
|
-
"react": "^19.2.
|
|
53
|
-
"react-dom": "^19.2.
|
|
53
|
+
"react": "^19.2.4",
|
|
54
|
+
"react-dom": "^19.2.4",
|
|
54
55
|
"typescript": "^5.9.3",
|
|
55
56
|
"vite": "^6.4.1"
|
|
56
57
|
},
|