@youversion/design-system-components 0.0.4 → 0.0.6
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 +23 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/Breadcrumb/Breadcrumbs.d.ts +8 -0
- package/dist/Breadcrumb/Breadcrumbs.d.ts.map +1 -0
- package/dist/Breadcrumb/index.d.ts +3 -0
- package/dist/Breadcrumb/index.d.ts.map +1 -0
- package/dist/Button/Button.d.ts +27 -11
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/FocusTrap/FocusTrap.d.ts +27 -0
- package/dist/FocusTrap/FocusTrap.d.ts.map +1 -0
- package/dist/FocusTrap/index.d.ts +2 -0
- package/dist/FocusTrap/index.d.ts.map +1 -0
- package/dist/LinkButton/LinkButton.d.ts +42 -0
- package/dist/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/LinkButton/index.d.ts +2 -0
- package/dist/LinkButton/index.d.ts.map +1 -0
- package/dist/List/List.d.ts.map +1 -1
- package/dist/ListItem/ListItem.d.ts +26 -1
- package/dist/ListItem/ListItem.d.ts.map +1 -1
- package/dist/ListItemText/ListItemText.d.ts.map +1 -1
- package/dist/Popover/Popover.d.ts +36 -0
- package/dist/Popover/Popover.d.ts.map +1 -0
- package/dist/Popover/index.d.ts +2 -0
- package/dist/Popover/index.d.ts.map +1 -0
- package/dist/PopoverBody/PopoverBody.d.ts +47 -0
- package/dist/PopoverBody/PopoverBody.d.ts.map +1 -0
- package/dist/PopoverBody/PopoverBody.module.css.d.ts +5 -0
- package/dist/PopoverBody/PopoverBodyContents.d.ts +29 -0
- package/dist/PopoverBody/PopoverBodyContents.d.ts.map +1 -0
- package/dist/PopoverBody/PopoverBodyWrapper.d.ts +30 -0
- package/dist/PopoverBody/PopoverBodyWrapper.d.ts.map +1 -0
- package/dist/PopoverBody/index.d.ts +2 -0
- package/dist/PopoverBody/index.d.ts.map +1 -0
- package/dist/PopoverTrigger/PopoverTrigger.d.ts +9 -0
- package/dist/PopoverTrigger/PopoverTrigger.d.ts.map +1 -0
- package/dist/PopoverTrigger/index.d.ts +2 -0
- package/dist/PopoverTrigger/index.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +906 -614
- package/dist/index.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @youversion/design-system-components
|
|
2
2
|
|
|
3
|
+
## 0.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5538398: - Added Popover related Components
|
|
8
|
+
- **Popover**
|
|
9
|
+
- **PopoverTrigger**
|
|
10
|
+
- **PopoverBody**
|
|
11
|
+
- **FocusTrap**
|
|
12
|
+
- Updating ListItems for better accessibility
|
|
13
|
+
- 047f14c: - Added **Breadcrumb** component
|
|
14
|
+
- Added **Breadcrumbs** component
|
|
15
|
+
|
|
16
|
+
## 0.0.5
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 6134287: - Updated **ListItem** to support _startAction_ and _endAction_
|
|
21
|
+
- Added RTL support to storybook
|
|
22
|
+
- Updated RTL styling in **Input**
|
|
23
|
+
- 5031ce0: Added `LinkButton` component.
|
|
24
|
+
Updated `Button` component's variable naming and logic.
|
|
25
|
+
|
|
3
26
|
## 0.0.4
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TypographyProps } from '../Typography/Typography';
|
|
3
|
+
type NativeAnchorProps = React.AllHTMLAttributes<HTMLAnchorElement>;
|
|
4
|
+
interface BreadcrumbProps extends NativeAnchorProps {
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Breadcrumb: {
|
|
8
|
+
({ children, component, className, active, ...rest }: BreadcrumbProps & TypographyProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=Breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,KAAK,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAEpE,UAAU,eAAgB,SAAQ,iBAAiB;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,UAAU;0DAMpB,eAAe,GAAG,eAAe;;CAcnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode | Array<React.ReactNode>;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Breadcrumbs: React.ForwardRefExoticComponent<BreadcrumbsProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/Breadcrumbs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6CD,eAAO,MAAM,WAAW,yFAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Breadcrumb/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
import { ElementType } from 'react';
|
|
2
2
|
import { AllHTMLAttributes, ForwardedRef } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type IconPosition = 'start' | 'end' | undefined;
|
|
4
|
+
export declare const buttonSizeOptions: {
|
|
4
5
|
lg: string;
|
|
5
6
|
md: string;
|
|
6
7
|
sm: string;
|
|
7
8
|
xl: string;
|
|
8
9
|
xs: string;
|
|
9
10
|
};
|
|
10
|
-
export declare const
|
|
11
|
+
export declare const determineSizeClasses: (iconPosition: IconPosition) => {
|
|
12
|
+
lg: string;
|
|
13
|
+
md: string;
|
|
14
|
+
sm: string;
|
|
15
|
+
xl: string;
|
|
16
|
+
xs: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const iconSizes: {
|
|
19
|
+
lg: number;
|
|
20
|
+
md: number;
|
|
21
|
+
sm: number;
|
|
22
|
+
xl: number;
|
|
23
|
+
xs: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultButtonClasses = "items-center leading-default font-bold ease-in-out duration-100 focus:outline-2 focus:outline-info-light dark:focus:outline-info-dark flex w-full max-w-fit";
|
|
26
|
+
export declare const variantClasses: {
|
|
11
27
|
all_caps: string;
|
|
12
28
|
borderless: string;
|
|
13
29
|
brand: string;
|
|
@@ -19,16 +35,16 @@ export declare const themeClasses: {
|
|
|
19
35
|
export interface BaseButtonProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'size'> {
|
|
20
36
|
children: React.ReactNode;
|
|
21
37
|
icon?: ElementType;
|
|
22
|
-
iconPosition?:
|
|
38
|
+
iconPosition?: IconPosition;
|
|
23
39
|
type?: 'button' | 'submit' | 'reset';
|
|
24
40
|
}
|
|
25
41
|
export interface BaseVariants extends BaseButtonProps {
|
|
26
|
-
|
|
27
|
-
variant
|
|
42
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
43
|
+
variant?: 'secondary' | 'primary' | 'stroked' | 'borderless' | 'risk' | 'brand';
|
|
28
44
|
}
|
|
29
45
|
export interface AllCapsVariant extends BaseButtonProps {
|
|
30
|
-
|
|
31
|
-
variant
|
|
46
|
+
size?: 'xs' | 'sm' | 'md';
|
|
47
|
+
variant?: 'all_caps';
|
|
32
48
|
}
|
|
33
49
|
export type ButtonProps = BaseVariants | AllCapsVariant;
|
|
34
50
|
/**
|
|
@@ -37,8 +53,8 @@ export type ButtonProps = BaseVariants | AllCapsVariant;
|
|
|
37
53
|
* @param children - Content of the Button.
|
|
38
54
|
* @param icon - An Icon Element.
|
|
39
55
|
* @param iconPosition - If and Where the Icon will be placed.
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
56
|
+
* @param variant - The look of the button.
|
|
57
|
+
* @param size - The size of the button.
|
|
42
58
|
*
|
|
43
59
|
* @returns A Button with content and styling.
|
|
44
60
|
*
|
|
@@ -50,13 +66,13 @@ export type ButtonProps = BaseVariants | AllCapsVariant;
|
|
|
50
66
|
* function MyComponent() {
|
|
51
67
|
* return (
|
|
52
68
|
* <>
|
|
53
|
-
* <Button
|
|
69
|
+
* <Button>Press Me!</Button>
|
|
54
70
|
* <Button icon={TriangleDownStroked} iconPosition='start' size='md' variant='secondary' >Press Me Too!</Button>
|
|
55
71
|
* </>
|
|
56
72
|
* )
|
|
57
73
|
* }
|
|
58
74
|
* ```
|
|
59
75
|
*/
|
|
60
|
-
export declare const ButtonComponent: ({ className, children, disabled, icon, iconPosition,
|
|
76
|
+
export declare const ButtonComponent: ({ className, children, disabled, icon, iconPosition, size, variant, ...rest }: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) => JSX.Element;
|
|
61
77
|
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
62
78
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAc,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAExD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAc,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;AAEvD,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,iBAAkB,YAAY;;;;;;CA2B9D,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,eAAO,MAAM,oBAAoB,gKAC8H,CAAC;AAEhK,eAAO,MAAM,cAAc;;;;;;;;CAe1B,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACzF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;CACjF;AAED,MAAM,WAAW,cAAe,SAAQ,eAAe;IACrD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,cAAc,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,eAAe,kFACwE,WAAW,OACxG,aAAa,iBAAiB,CAAC,gBAsBrC,CAAC;AAEF,eAAO,MAAM,MAAM,2GAA8B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FocusTrapProps {
|
|
3
|
+
autoFocus?: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Allows users to prevent the user from tabbing outside the children of the FocusTrap component.
|
|
8
|
+
*
|
|
9
|
+
* Accepts {@link FocusTrapProps}.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { Button, FocusTrap } from '@youversion/design-system-components';
|
|
14
|
+
*
|
|
15
|
+
* function MyComponent() {
|
|
16
|
+
* return (
|
|
17
|
+
* <>
|
|
18
|
+
* <FocusTrap>
|
|
19
|
+
* <Button>First Button</Button>
|
|
20
|
+
* <Button>Second Button</Button>
|
|
21
|
+
* </FocusTrap>
|
|
22
|
+
* </>
|
|
23
|
+
* )
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const FocusTrap: ({ children, autoFocus }: FocusTrapProps) => JSX.Element;
|
|
27
|
+
//# sourceMappingURL=FocusTrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusTrap.d.ts","sourceRoot":"","sources":["../../../src/FocusTrap/FocusTrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,4BAAoC,cAAc,gBAkFvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/FocusTrap/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ElementType, ForwardedRef } from 'react';
|
|
2
|
+
import { AllCapsVariant, BaseVariants } from '../Button';
|
|
3
|
+
export interface LinkButtonAllCapsWithComponentProps extends AllCapsVariant {
|
|
4
|
+
component: ElementType;
|
|
5
|
+
href?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LinkButtonWithComponentProps extends BaseVariants {
|
|
8
|
+
component: ElementType;
|
|
9
|
+
href?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LinkButtonAllCapsWithoutComponentProps extends AllCapsVariant {
|
|
12
|
+
component?: never;
|
|
13
|
+
href: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LinkButtonWithoutComponentProps extends BaseVariants {
|
|
16
|
+
component?: never;
|
|
17
|
+
href: string;
|
|
18
|
+
}
|
|
19
|
+
export type LinkButtonProps = LinkButtonAllCapsWithComponentProps | LinkButtonWithComponentProps | LinkButtonAllCapsWithoutComponentProps | LinkButtonWithoutComponentProps;
|
|
20
|
+
export declare const LinkButtonComponent: ({ className, children, component, icon, iconPosition, variant, size, ...rest }: LinkButtonProps, ref: ForwardedRef<HTMLAnchorElement>) => JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* The **LinkButton** is used to display a Button as a Link.
|
|
23
|
+
*
|
|
24
|
+
* Accepts {@link LinkButtonProps}.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { LinkButton } from '@youversion/design-system-components';
|
|
29
|
+
* import { TriangleDownStroked } from '@youversion/design-system-icons/index';
|
|
30
|
+
*
|
|
31
|
+
* function MyComponent() {
|
|
32
|
+
* return (
|
|
33
|
+
* <>
|
|
34
|
+
* <LinkButton href="https://www.bible.com" >Press Me!</LinkButton>
|
|
35
|
+
* <LinkButton href="https://www.bible.com" icon={TriangleDownStroked} iconPosition='start' size='md' variant='secondary' >Press Me Too!</LinkButton>
|
|
36
|
+
* </>
|
|
37
|
+
* )
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const LinkButton: import("react").ForwardRefExoticComponent<LinkButtonProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
42
|
+
//# sourceMappingURL=LinkButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.d.ts","sourceRoot":"","sources":["../../../src/LinkButton/LinkButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,WAAW,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AAE7E,OAAO,EACL,cAAc,EACd,YAAY,EAKb,MAAM,WAAW,CAAC;AAMnB,MAAM,WAAW,mCAAoC,SAAQ,cAAc;IACzE,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,4BAA6B,SAAQ,YAAY;IAChE,SAAS,EAAE,WAAW,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sCAAuC,SAAQ,cAAc;IAC5E,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,+BAAgC,SAAQ,YAAY;IACnE,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,eAAe,GACvB,mCAAmC,GACnC,4BAA4B,GAC5B,sCAAsC,GACtC,+BAA+B,CAAC;AAEpC,eAAO,MAAM,mBAAmB,mFAU3B,eAAe,OACb,aAAa,iBAAiB,CAAC,gBAiCrC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,+GAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/LinkButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/List/List.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/List/List.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/List/List.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,cAAc,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI,wGAA4B,CAAC"}
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
2
|
+
interface StartIconWithActionProps {
|
|
3
|
+
/** Action to take when clicking the startIcon. */
|
|
4
|
+
startAction: () => void;
|
|
5
|
+
startIcon: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface StartIconWithOutActionProps {
|
|
8
|
+
startAction?: never;
|
|
9
|
+
startIcon?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
interface EndIconWithActionProps {
|
|
12
|
+
/** Action to take when clicking the endIcon. */
|
|
13
|
+
endAction: () => void;
|
|
14
|
+
endIcon: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
interface EndIconWithoutActionProps {
|
|
17
|
+
endAction?: never;
|
|
18
|
+
endIcon?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
type StartIconAndActionProps = StartIconWithActionProps | StartIconWithOutActionProps;
|
|
21
|
+
type EndIconAndActionProps = EndIconWithActionProps | EndIconWithoutActionProps;
|
|
22
|
+
type AllIconAndActionProps = StartIconAndActionProps & EndIconAndActionProps;
|
|
23
|
+
interface ListItemPropsBase extends HTMLAttributes<HTMLLIElement> {
|
|
3
24
|
children: React.ReactNode;
|
|
4
25
|
className?: string;
|
|
26
|
+
/** Display a divider between ListItems. */
|
|
5
27
|
divider?: boolean;
|
|
6
28
|
endIcon?: React.ReactNode;
|
|
29
|
+
onClick?: () => void;
|
|
7
30
|
startIcon?: React.ReactNode;
|
|
8
31
|
}
|
|
32
|
+
export type ListItemProps = ListItemPropsBase & AllIconAndActionProps;
|
|
9
33
|
/**
|
|
10
34
|
* The **ListItem** component is to be used inside of the **List** component. This will be each item inside the list.
|
|
11
35
|
*
|
|
@@ -32,4 +56,5 @@ export interface ListItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
|
32
56
|
* ```
|
|
33
57
|
*/
|
|
34
58
|
export declare const ListItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
59
|
+
export {};
|
|
35
60
|
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA4B,cAAc,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA4B,cAAc,EAAiB,MAAM,OAAO,CAAC;AAIvF,UAAU,wBAAwB;IAChC,kDAAkD;IAClD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,2BAA2B;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,UAAU,sBAAsB;IAC9B,gDAAgD;IAChD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,KAAK,uBAAuB,GAAG,wBAAwB,GAAG,2BAA2B,CAAC;AACtF,KAAK,qBAAqB,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;AAChF,KAAK,qBAAqB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AAE7E,UAAU,iBAAkB,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC/D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,qBAAqB,CAAC;AAsDtE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,QAAQ,qFAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemText.d.ts","sourceRoot":"","sources":["../../../src/ListItemText/ListItemText.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemText.d.ts","sourceRoot":"","sources":["../../../src/ListItemText/ListItemText.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,YAAY,kCAA0C,oBAAoB,gBAMtF,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { HtmlHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface PopoverProps extends HtmlHTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A Popover can be used to display some content on top of another.
|
|
7
|
+
*
|
|
8
|
+
* Accepts {@link PopoverProps}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { Button, List, ListItem, ListItemText, Popover, PopoverBody, PopoverTrigger } from '@youversion/design-system-components';
|
|
13
|
+
*
|
|
14
|
+
* function MyComponent() {
|
|
15
|
+
* return (
|
|
16
|
+
* <Popover>
|
|
17
|
+
* <PopoverTrigger onToggle={handleToggle}>
|
|
18
|
+
* <Button>Toggle</Button>
|
|
19
|
+
* </PopoverTrigger>
|
|
20
|
+
* <PopoverBody
|
|
21
|
+
* isOpen={isOpen}
|
|
22
|
+
* onClose={handleClose}
|
|
23
|
+
* >
|
|
24
|
+
* <List>
|
|
25
|
+
* <ListItem divider={true} onClick={handleListItemClick}>
|
|
26
|
+
* <ListItemText>First Item</ListItemText>
|
|
27
|
+
* </ListItem>
|
|
28
|
+
* </List>
|
|
29
|
+
* </PopoverBody>
|
|
30
|
+
* </Popover>
|
|
31
|
+
* )
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const Popover: ({ children, className, ...rest }: PopoverProps) => JSX.Element;
|
|
36
|
+
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/Popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,WAAW,YAAa,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACtE,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,OAAO,qCAAsC,YAAY,gBAMrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Popover/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface PopoverAlign {
|
|
3
|
+
horizontal: 'start' | 'center' | 'end';
|
|
4
|
+
vertical: 'top' | 'bottom';
|
|
5
|
+
}
|
|
6
|
+
export interface PopoverBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
align?: PopoverAlign;
|
|
8
|
+
/** Focus on first focusable element in scope. Defaults to `true`. */
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/** Allows the Popover to be closed by clicking outside of it or pressing Esc key. Defaults to `false`. */
|
|
12
|
+
isDismissible?: boolean;
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A PopoverBody is used to render content inside a Popover.
|
|
18
|
+
*
|
|
19
|
+
* Accepts {@link PopoverBodyProps}.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { Button, List, ListItem, ListItemText, Popover, PopoverBody, PopoverTrigger } from '@youversion/design-system-components';
|
|
24
|
+
*
|
|
25
|
+
* function MyComponent() {
|
|
26
|
+
* return (
|
|
27
|
+
* <Popover>
|
|
28
|
+
* <PopoverTrigger onToggle={handleToggle}>
|
|
29
|
+
* <Button>Toggle</Button>
|
|
30
|
+
* </PopoverTrigger>
|
|
31
|
+
* <PopoverBody
|
|
32
|
+
* isOpen={isOpen}
|
|
33
|
+
* onClose={handleClose}
|
|
34
|
+
* >
|
|
35
|
+
* <List>
|
|
36
|
+
* <ListItem divider={true} onClick={handleListItemClick}>
|
|
37
|
+
* <ListItemText>First Item</ListItemText>
|
|
38
|
+
* </ListItem>
|
|
39
|
+
* </List>
|
|
40
|
+
* </PopoverBody>
|
|
41
|
+
* </Popover>
|
|
42
|
+
* )
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const PopoverBody: ({ align, autoFocus, children, className, isDismissible, isOpen, onClose, ...rest }: PopoverBodyProps) => JSX.Element;
|
|
47
|
+
//# sourceMappingURL=PopoverBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverBody.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/PopoverBody.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,0GAA0G;IAC1G,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,WAAW,uFASrB,gBAAgB,gBAiBlB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PopoverAlign, PopoverBodyProps } from './PopoverBody';
|
|
2
|
+
export interface PopoverBodyContentsProps extends Omit<PopoverBodyProps, 'autoFocus' | 'isOpen'> {
|
|
3
|
+
align: PopoverAlign;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The **PopoverBodyContents** component is an internal only component that is used to handle internal contents of
|
|
7
|
+
* PopoverBody.tsx.
|
|
8
|
+
*
|
|
9
|
+
* Accepts {@link PopoverBodyContentsProps}.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <PopoverBodyWrapper open={isOpen}>
|
|
14
|
+
* <FocusTrap autoFocus={autoFocus}>
|
|
15
|
+
* <PopoverBodyContents
|
|
16
|
+
* align={align}
|
|
17
|
+
* className={className}
|
|
18
|
+
* isDismissible={isDismissible}
|
|
19
|
+
* onClose={onClose}
|
|
20
|
+
* {...rest}
|
|
21
|
+
* >
|
|
22
|
+
* {children}
|
|
23
|
+
* </PopoverBodyContents>
|
|
24
|
+
* </FocusTrap>
|
|
25
|
+
* </PopoverBodyWrapper>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const PopoverBodyContents: ({ align, children, className, isDismissible, onClose, ...rest }: PopoverBodyContentsProps) => JSX.Element;
|
|
29
|
+
//# sourceMappingURL=PopoverBodyContents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverBodyContents.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/PopoverBodyContents.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG/D,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC9F,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,oEAO7B,wBAAwB,gBAiF1B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface PopoverBodyWrapperProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
open: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The **PopoverBodyWrapper** is and internal only component to be used only inside PopoverBody.tsx and is
|
|
7
|
+
* used to control rendering of its children.
|
|
8
|
+
*
|
|
9
|
+
* Accepts {@link PopoverBodyWrapperProps}.
|
|
10
|
+
*
|
|
11
|
+
* @returns A React component that renders its children if the open prop is true.
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <PopoverBodyWrapper open={isOpen}>
|
|
15
|
+
* <FocusTrap autoFocus={autoFocus}>
|
|
16
|
+
* <PopoverBodyContents
|
|
17
|
+
* align={align}
|
|
18
|
+
* className={className}
|
|
19
|
+
* isDismissible={isDismissible}
|
|
20
|
+
* onClose={onClose}
|
|
21
|
+
* {...rest}
|
|
22
|
+
* >
|
|
23
|
+
* {children}
|
|
24
|
+
* </PopoverBodyContents>
|
|
25
|
+
* </FocusTrap>
|
|
26
|
+
* </PopoverBodyWrapper>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const PopoverBodyWrapper: ({ open, children }: PopoverBodyWrapperProps) => JSX.Element;
|
|
30
|
+
//# sourceMappingURL=PopoverBodyWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverBodyWrapper.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/PopoverBodyWrapper.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kBAAkB,uBAAwB,uBAAuB,gBAE7E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PopoverTriggerProps {
|
|
2
|
+
children: React.ReactElement;
|
|
3
|
+
/** Disable the PopoverTrigger and pass that disable status down to the child. */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** A function to toggle the popover state. */
|
|
6
|
+
onToggle: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const PopoverTrigger: ({ onToggle, children, disabled }: PopoverTriggerProps) => JSX.Element;
|
|
9
|
+
//# sourceMappingURL=PopoverTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopoverTrigger.d.ts","sourceRoot":"","sources":["../../../src/PopoverTrigger/PopoverTrigger.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,qCAAsC,mBAAmB,gBAQnF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/PopoverTrigger/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export * from './Box';
|
|
2
|
+
export * from './Breadcrumb';
|
|
2
3
|
export * from './Button';
|
|
4
|
+
export * from './FocusTrap';
|
|
3
5
|
export * from './IconButton';
|
|
4
6
|
export * from './IconLinkButton';
|
|
5
7
|
export * from './Input';
|
|
8
|
+
export * from './LinkButton';
|
|
6
9
|
export * from './List';
|
|
7
10
|
export * from './ListItem';
|
|
8
11
|
export * from './ListItemText';
|
|
12
|
+
export * from './Popover';
|
|
13
|
+
export * from './PopoverBody';
|
|
14
|
+
export * from './PopoverTrigger';
|
|
9
15
|
export * from './Tooltip';
|
|
10
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|