@youversion/design-system-components 0.25.0 → 0.27.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.es.js +2521 -1961
  3. package/dist/index.umd.js +3 -3
  4. package/dist/src/EditableWell/EditableWell.d.ts +55 -0
  5. package/dist/src/EditableWell/EditableWell.d.ts.map +1 -0
  6. package/dist/src/EditableWell/EditableWell.stories.d.ts +5 -0
  7. package/dist/src/EditableWell/EditableWell.stories.d.ts.map +1 -0
  8. package/dist/src/EditableWell/index.d.ts +2 -0
  9. package/dist/src/EditableWell/index.d.ts.map +1 -0
  10. package/dist/src/Grid/Column.d.ts +17 -0
  11. package/dist/src/Grid/Column.d.ts.map +1 -0
  12. package/dist/src/Grid/Grid.d.ts +38 -0
  13. package/dist/src/Grid/Grid.d.ts.map +1 -0
  14. package/dist/src/Grid/Grid.stories.d.ts +4 -0
  15. package/dist/src/Grid/Grid.stories.d.ts.map +1 -0
  16. package/dist/src/Grid/Row.d.ts +12 -0
  17. package/dist/src/Grid/Row.d.ts.map +1 -0
  18. package/dist/src/Grid/index.d.ts +4 -0
  19. package/dist/src/Grid/index.d.ts.map +1 -0
  20. package/dist/src/Popover/Popover.stories.d.ts.map +1 -1
  21. package/dist/src/PopoverBody/PopoverBody.d.ts +3 -2
  22. package/dist/src/PopoverBody/PopoverBody.d.ts.map +1 -1
  23. package/dist/src/TabBar/TabBar.d.ts +17 -0
  24. package/dist/src/TabBar/TabBar.d.ts.map +1 -0
  25. package/dist/src/TabBar/TabBarItem.d.ts +12 -0
  26. package/dist/src/TabBar/TabBarItem.d.ts.map +1 -0
  27. package/dist/src/TabBar/index.d.ts +3 -0
  28. package/dist/src/TabBar/index.d.ts.map +1 -0
  29. package/dist/src/UserProfileButton/UserProfileButton.d.ts +38 -0
  30. package/dist/src/UserProfileButton/UserProfileButton.d.ts.map +1 -0
  31. package/dist/src/UserProfileButton/UserProfileButton.stories.d.ts +10 -0
  32. package/dist/src/UserProfileButton/UserProfileButton.stories.d.ts.map +1 -0
  33. package/dist/src/UserProfileButton/index.d.ts +2 -0
  34. package/dist/src/UserProfileButton/index.d.ts.map +1 -0
  35. package/dist/src/hooks/index.d.ts +1 -0
  36. package/dist/src/hooks/index.d.ts.map +1 -1
  37. package/dist/src/hooks/useOnClickOutside.d.ts +32 -0
  38. package/dist/src/hooks/useOnClickOutside.d.ts.map +1 -0
  39. package/dist/src/index.d.ts +4 -0
  40. package/dist/src/index.d.ts.map +1 -1
  41. package/package.json +1 -2
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { BoxProps } from '../Box';
3
+ import { HeadlineVariant } from '../Typography/Typography';
4
+ interface EditableWellBase extends BoxProps {
5
+ /** ARIA Edit Icon Label. */
6
+ editIconLabel?: string;
7
+ /** Used to override the default component type of `a`. */
8
+ editLinkComponent?: React.ElementType;
9
+ /** Title of the EditableWell. */
10
+ title?: string;
11
+ /** Heading level of the title. */
12
+ titleSize?: HeadlineVariant['size'];
13
+ }
14
+ interface EditableWellWithOnClick extends EditableWellBase {
15
+ /** Where the edit button should direct the user. */
16
+ href?: never;
17
+ /** Function to run when Edit Icon is clicked. */
18
+ onClick: () => void;
19
+ }
20
+ interface EditableWellWithHref extends EditableWellBase {
21
+ /** Where the edit button should direct the user. */
22
+ href: string;
23
+ /** Function to run when Edit Icon is clicked. */
24
+ onClick?: never;
25
+ }
26
+ interface EditableWellWithoutButton extends EditableWellBase {
27
+ /** Where the edit button should direct the user. */
28
+ href?: never;
29
+ /** Function to run when Edit Icon is clicked. */
30
+ onClick?: never;
31
+ }
32
+ export type EditableWellProps = EditableWellWithHref | EditableWellWithOnClick | EditableWellWithoutButton;
33
+ /**
34
+ * A specialized container that calls out content that can be modified. Any modifiable content should be added as `children` of the `EditableWell` component.
35
+ *
36
+ * Accepts {@link EditableWellProps}.
37
+ *
38
+ * @example
39
+ * ```tsx
40
+ * import { EditableWell } from '@youversion/design-system-components';
41
+ *
42
+ * function MyComponent() {
43
+ * return (
44
+ * <EditableWell href="https://bible.com" title="Superheroes: A Retrospective">
45
+ * <Text>
46
+ * "You're saying there's a multiverse?"
47
+ * </Text>
48
+ * </EditableWell>
49
+ * );
50
+ * }
51
+ * ```
52
+ */
53
+ export declare const EditableWell: React.ForwardRefExoticComponent<EditableWellProps & React.RefAttributes<HTMLDivElement>>;
54
+ export {};
55
+ //# sourceMappingURL=EditableWell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableWell.d.ts","sourceRoot":"","sources":["../../../src/EditableWell/EditableWell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAExD,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,UAAU,gBAAiB,SAAQ,QAAQ;IACzC,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACtC,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,SAAS,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CACrC;AAED,UAAU,uBAAwB,SAAQ,gBAAgB;IACxD,oDAAoD;IACpD,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,iDAAiD;IACjD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,oBAAqB,SAAQ,gBAAgB;IACrD,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,UAAU,yBAA0B,SAAQ,gBAAgB;IAC1D,oDAAoD;IACpD,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,iDAAiD;IACjD,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,yBAAyB,CAAC;AA0D3G;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,0FAAoC,CAAC"}
@@ -0,0 +1,5 @@
1
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./EditableWell").EditableWellProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export default _default;
3
+ export declare function WithEditButton(): JSX.Element;
4
+ export declare function WithEditLink(): JSX.Element;
5
+ //# sourceMappingURL=EditableWell.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableWell.stories.d.ts","sourceRoot":"","sources":["../../../src/EditableWell/EditableWell.stories.tsx"],"names":[],"mappings":";AAKA,wBAA0G;AAE1G,wBAAgB,cAAc,gBAM7B;AAED,wBAAgB,YAAY,gBAM3B"}
@@ -0,0 +1,2 @@
1
+ export * from './EditableWell';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/EditableWell/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ClassValue } from 'clsx';
2
+ import { ReactNode } from 'react';
3
+ interface Props {
4
+ align?: 'fill' | 'start' | 'center' | 'end';
5
+ children: ReactNode;
6
+ className?: ClassValue;
7
+ start?: number;
8
+ width?: number;
9
+ }
10
+ /**
11
+ * Represents a Column within a **Row** of a **Grid**.
12
+ *
13
+ * Accepts {@link Props}.
14
+ */
15
+ export declare const Column: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
16
+ export {};
17
+ //# sourceMappingURL=Column.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../src/Grid/Column.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAA4B,SAAS,EAAE,MAAM,OAAO,CAAC;AAI5D,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC5C,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqBD;;;;GAIG;AACH,eAAO,MAAM,MAAM,kGAA8B,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Spacing } from '@youversion/design-system-tokens';
2
+ import { AllHTMLAttributes } from 'react';
3
+ type RowSpacingType = `gap-y-${Spacing}`;
4
+ export interface GridProps extends AllHTMLAttributes<HTMLDivElement> {
5
+ rowSpacing?: RowSpacingType;
6
+ }
7
+ /**
8
+ * A **Grid** is a layout component that arranges its children into rows and columns.
9
+ *
10
+ * Accepts {@link GridProps}.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { Grid, Row, Column } from '@youversion/design-system-components';
15
+ *
16
+ * function MyComponent() {
17
+ * return (
18
+ * <>
19
+ * <Grid>
20
+ * <Row>
21
+ * <Column>
22
+ * <span>Row 1, Column 1</span>
23
+ * </Column>
24
+ * </Row>
25
+ * <Row>
26
+ * <Column start={3} width={3}>
27
+ * <span>Row 2, Column 3 - 5</span>
28
+ * </Column>
29
+ * </Row>
30
+ * </Grid>
31
+ * </>
32
+ * );
33
+ * }
34
+ * ```
35
+ */
36
+ export declare const Grid: import("react").ForwardRefExoticComponent<GridProps & import("react").RefAttributes<HTMLDivElement>>;
37
+ export {};
38
+ //# sourceMappingURL=Grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAIpE,KAAK,cAAc,GAAG,SAAS,OAAO,EAAE,CAAC;AAEzC,MAAM,WAAW,SAAU,SAAQ,iBAAiB,CAAC,cAAc,CAAC;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B;AAiBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,IAAI,sGAA4B,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./Grid").GridProps & import("react").RefAttributes<HTMLDivElement>>;
2
+ export default _default;
3
+ export declare const Story: () => JSX.Element;
4
+ //# sourceMappingURL=Grid.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/Grid/Grid.stories.tsx"],"names":[],"mappings":";AAOA,wBAGuB;AAavB,eAAO,MAAM,KAAK,mBAkDjB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React, { AllHTMLAttributes } from 'react';
2
+ interface Props extends AllHTMLAttributes<HTMLDivElement> {
3
+ children: React.ReactNode;
4
+ }
5
+ /**
6
+ * Represents a row within a **Grid**.
7
+ *
8
+ * Accepts {@link Props}.
9
+ */
10
+ export declare const Row: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
11
+ export {};
12
+ //# sourceMappingURL=Row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/Grid/Row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAI3E,UAAU,KAAM,SAAQ,iBAAiB,CAAC,cAAc,CAAC;IACvD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAUD;;;;GAIG;AACH,eAAO,MAAM,GAAG,8EAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './Column';
2
+ export * from './Grid';
3
+ export * from './Row';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Grid/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../src/Popover/Popover.stories.tsx"],"names":[],"mappings":";AAKA,wBAiC0B;AAG1B,eAAO,MAAM,KAAK,4BAkDjB,CAAC"}
1
+ {"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../src/Popover/Popover.stories.tsx"],"names":[],"mappings":";AAKA,wBAsC0B;AAG1B,eAAO,MAAM,KAAK,4BAmDjB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes } from 'react';
1
+ import React, { HTMLAttributes } from 'react';
2
2
  export interface PopoverAlign {
3
3
  horizontal: 'start' | 'center' | 'end';
4
4
  vertical: 'top' | 'bottom';
@@ -8,6 +8,7 @@ export interface PopoverBodyProps extends HTMLAttributes<HTMLDivElement> {
8
8
  /** Focus on first focusable element in scope. Defaults to `true`. */
9
9
  autoFocus?: boolean;
10
10
  children: React.ReactNode;
11
+ closeOnClickInside?: boolean;
11
12
  /** Allows the Popover to be closed by clicking outside of it or pressing Esc key. Defaults to `false`. */
12
13
  isDismissible?: boolean;
13
14
  isOpen: boolean;
@@ -43,5 +44,5 @@ export interface PopoverBodyProps extends HTMLAttributes<HTMLDivElement> {
43
44
  * }
44
45
  * ```
45
46
  */
46
- export declare const PopoverBody: ({ align, autoFocus, children, className, isDismissible, isOpen, onClose, ...rest }: PopoverBodyProps) => JSX.Element;
47
+ export declare const PopoverBody: ({ align, autoFocus, children, className, closeOnClickInside, isDismissible, isOpen, onClose, ...rest }: PopoverBodyProps) => JSX.Element;
47
48
  //# sourceMappingURL=PopoverBody.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PopoverBody.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/PopoverBody.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAU,MAAM,OAAO,CAAC;AAM/C,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,gBA6BlB,CAAC"}
1
+ {"version":3,"file":"PopoverBody.d.ts","sourceRoot":"","sources":["../../../src/PopoverBody/PopoverBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAU,MAAM,OAAO,CAAC;AAOtD,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,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,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,2GAUrB,gBAAgB,gBAkClB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as Icons from '@youversion/design-system-icons/lib/index';
2
+ import { AllHTMLAttributes } from 'react';
3
+ import { TypographyProps } from '../Typography/Typography';
4
+ type NativeAnchorProps = AllHTMLAttributes<HTMLAnchorElement>;
5
+ export type IconNames = keyof typeof Icons;
6
+ export type Tab = {
7
+ href: string;
8
+ iconName: IconNames;
9
+ label: string;
10
+ };
11
+ interface Props extends NativeAnchorProps {
12
+ activeTab: string;
13
+ tabs: Array<Tab>;
14
+ }
15
+ export declare function TabBar({ activeTab, className, tabs, ...rest }: Props & TypographyProps): JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=TabBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../../src/TabBar/TabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,KAAK,CAAC;AAE3C,MAAM,MAAM,GAAG,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,UAAU,KAAM,SAAQ,iBAAiB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,wBAAgB,MAAM,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,GAAG,eAAe,eAUtF"}
@@ -0,0 +1,12 @@
1
+ import { AllHTMLAttributes } from 'react';
2
+ import { TypographyProps } from '../Typography/Typography';
3
+ import { IconNames } from './TabBar';
4
+ type NativeAnchorProps = AllHTMLAttributes<HTMLAnchorElement>;
5
+ interface Props extends NativeAnchorProps {
6
+ active: boolean;
7
+ href: string;
8
+ iconName: IconNames;
9
+ }
10
+ export declare function TabBarItem({ active, children, component, className, href, iconName, ...rest }: Props & TypographyProps): JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=TabBarItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabBarItem.d.ts","sourceRoot":"","sources":["../../../src/TabBar/TabBarItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;AAE9D,UAAU,KAAM,SAAQ,iBAAiB;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,SAAe,EACf,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,KAAK,GAAG,eAAe,eAkBzB"}
@@ -0,0 +1,3 @@
1
+ export { TabBar } from './TabBar';
2
+ export { TabBarItem } from './TabBarItem';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TabBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,38 @@
1
+ import React, { AllHTMLAttributes } from 'react';
2
+ export type UserProfileButtonVariant = 'nav' | 'header';
3
+ export interface UserProfileButtonProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'children' | 'type'> {
4
+ /** The aria-label for the component wrapper. */
5
+ label: string;
6
+ /** Element that is rendered as the user's avatar. */
7
+ userAvatar: React.ReactNode;
8
+ /** Name of the user that will be displayed. */
9
+ userName: string;
10
+ /** Button variant. The 'header' variant only displays **userName** on md screens or larger. */
11
+ variant?: UserProfileButtonVariant;
12
+ }
13
+ /**
14
+ * The **UserProfileButton** component displays a user's name next to a specified avatar element and a dropdown icon.
15
+ *
16
+ * Accepts {@link UserProfileButtonProps}.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { UserProfileButton } from '@youversion/design-system-components';
21
+ *
22
+ * function MyComponent() {
23
+ * return (
24
+ * <>
25
+ * <UserProfileButton
26
+ * label='My Profile'
27
+ * userAvatar={
28
+ * <img alt='Profile Picture' className='object-cover rounded-full' src='https://picsum.photos/100/100' />
29
+ * }
30
+ * userName='Devon'
31
+ * />
32
+ * </>
33
+ * )
34
+ * }
35
+ * ```
36
+ */
37
+ export declare const UserProfileButton: React.ForwardRefExoticComponent<UserProfileButtonProps & React.RefAttributes<HTMLButtonElement>>;
38
+ //# sourceMappingURL=UserProfileButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileButton.d.ts","sourceRoot":"","sources":["../../../src/UserProfileButton/UserProfileButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAA4B,MAAM,OAAO,CAAC;AAK3E,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;IACtF,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAuBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,iBAAiB,kGAAyC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { UserProfileButtonProps } from './UserProfileButton';
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, UserProfileButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
3
+ export default _default;
4
+ type TemplateProps = Omit<UserProfileButtonProps, 'label' | 'userName' | 'userAvatar'> & {
5
+ avatarSrc?: string | null;
6
+ };
7
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TemplateProps>;
8
+ export declare const WithoutImage: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TemplateProps>;
9
+ export declare const WithPopover: () => JSX.Element;
10
+ //# sourceMappingURL=UserProfileButton.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileButton.stories.d.ts","sourceRoot":"","sources":["../../../src/UserProfileButton/UserProfileButton.stories.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;;AAEhF,wBAIoC;AAEpC,KAAK,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,UAAU,GAAG,YAAY,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAyBvH,eAAO,MAAM,OAAO,8GAAoB,CAAC;AAEzC,eAAO,MAAM,YAAY,8GAAoB,CAAC;AAI9C,eAAO,MAAM,WAAW,mBAwBvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './UserProfileButton';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/UserProfileButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './useCombinedRefs';
2
2
  export * from './useLockBodyScroll';
3
+ export * from './useOnClickOutside';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { RefObject } from 'react';
2
+ type Handler = (event: MouseEvent) => void;
3
+ export interface UseOnClickOutsideProps<T> {
4
+ /** Callback that is invoked when the user clicks outside the element referenced by `ref`. */
5
+ handler: Handler;
6
+ /** Reference to the element. */
7
+ ref: RefObject<T>;
8
+ }
9
+ /**
10
+ * Invokes `handler` when the user clicks outside the element referenced by `ref`.
11
+ *
12
+ * Accepts {@link UseOnClickOutsideProps}.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * import { useOnClickOutside } from '@youversion/design-system-components';
17
+ *
18
+ * function MyComponent() {
19
+ * const ref = useRef<HTMLDivElement>(null);
20
+ * useOnClickOutside({ handler: (event) => console.log("Clicked Outside!"), ref });
21
+ *
22
+ * return (
23
+ * <div ref={ref}>
24
+ * ...
25
+ * </div>
26
+ * );
27
+ * }
28
+ * ```
29
+ */
30
+ export declare function useOnClickOutside<T extends HTMLElement = HTMLElement>({ handler, ref, }: UseOnClickOutsideProps<T>): void;
31
+ export {};
32
+ //# sourceMappingURL=useOnClickOutside.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnClickOutside.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOnClickOutside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAE7C,KAAK,OAAO,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;AAE3C,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,6FAA6F;IAC7F,OAAO,EAAE,OAAO,CAAC;IACjB,gCAAgC;IAChC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EAAE,EACrE,OAAO,EACP,GAAG,GACJ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,IAAI,CAgBlC"}
@@ -6,7 +6,9 @@ export * from './Button';
6
6
  export * from './Checkbox';
7
7
  export * from './Dialog';
8
8
  export * from './Divider';
9
+ export * from './EditableWell';
9
10
  export * from './FocusTrap';
11
+ export * from './Grid';
10
12
  export * from './hooks';
11
13
  export * from './HorizontalLoader';
12
14
  export * from './IconButton';
@@ -30,10 +32,12 @@ export * from './SegmentedControl';
30
32
  export * from './Select';
31
33
  export * from './Switch';
32
34
  export * from './Tab';
35
+ export * from './TabBar';
33
36
  export * from './Table';
34
37
  export * from './Tag';
35
38
  export * from './TimePicker';
36
39
  export * from './Tooltip';
37
40
  export * from './Typography';
41
+ export * from './UserProfileButton';
38
42
  export { cn } from './utils/cn';
39
43
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youversion/design-system-components",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "main": "./dist/index.umd.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -21,7 +21,6 @@
21
21
  "validate": "yarn lint && yarn typecheck && yarn test"
22
22
  },
23
23
  "dependencies": {
24
- "@react-aria/overlays": "3.14.0",
25
24
  "@youversion/design-system-core": "0.3.1",
26
25
  "@youversion/design-system-icons": "0.14.1",
27
26
  "@youversion/design-system-tokens": "1.1.1",