@youversion/design-system-components 1.0.0 → 1.1.1
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 +12 -0
- package/dist/index.es.js +592 -581
- package/dist/index.umd.js +2 -2
- package/dist/src/UserProfileButton/UserProfileButton.d.ts +23 -0
- package/dist/src/UserProfileButton/UserProfileButton.d.ts.map +1 -1
- package/dist/src/UserProfileButton/UserProfileButton.stories.d.ts +1 -0
- package/dist/src/UserProfileButton/UserProfileButton.stories.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@ export type UserProfileButtonVariant = 'nav' | 'header';
|
|
|
3
3
|
export interface UserProfileButtonProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'children' | 'type'> {
|
|
4
4
|
/** The aria-label for the component wrapper. */
|
|
5
5
|
label: string;
|
|
6
|
+
/** Optional color theme for non-standard backgrounds. */
|
|
7
|
+
theme?: 'default' | 'white';
|
|
6
8
|
/** Element that is rendered as the user's avatar. */
|
|
7
9
|
userAvatar: React.ReactNode;
|
|
8
10
|
/** Name of the user that will be displayed. */
|
|
@@ -33,6 +35,27 @@ export interface UserProfileButtonProps extends Omit<AllHTMLAttributes<HTMLButto
|
|
|
33
35
|
* )
|
|
34
36
|
* }
|
|
35
37
|
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* Using a color theme.
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { UserProfileButton } from '@youversion/design-system-components';
|
|
43
|
+
*
|
|
44
|
+
* function MyComponent() {
|
|
45
|
+
* return (
|
|
46
|
+
* <>
|
|
47
|
+
* <UserProfileButton
|
|
48
|
+
* label='My Profile'
|
|
49
|
+
* theme='white'
|
|
50
|
+
* userAvatar={
|
|
51
|
+
* <img alt='Profile Picture' className='object-cover rounded-full' src='https://picsum.photos/100/100' />
|
|
52
|
+
* }
|
|
53
|
+
* userName='Devon'
|
|
54
|
+
* />
|
|
55
|
+
* </>
|
|
56
|
+
* )
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
36
59
|
*/
|
|
37
60
|
export declare const UserProfileButton: React.ForwardRefExoticComponent<UserProfileButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
61
|
//# sourceMappingURL=UserProfileButton.d.ts.map
|
|
@@ -1 +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;
|
|
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,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,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;AAqCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,iBAAiB,kGAAyC,CAAC"}
|
|
@@ -7,4 +7,5 @@ type TemplateProps = Omit<UserProfileButtonProps, 'label' | 'userName' | 'userAv
|
|
|
7
7
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TemplateProps>;
|
|
8
8
|
export declare const WithoutImage: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TemplateProps>;
|
|
9
9
|
export declare const WithPopover: () => JSX.Element;
|
|
10
|
+
export declare const ThemeWhite: () => JSX.Element;
|
|
10
11
|
//# sourceMappingURL=UserProfileButton.stories.d.ts.map
|
|
@@ -1 +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"}
|
|
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;AAEF,eAAO,MAAM,UAAU,mBAOtB,CAAC"}
|