@arbor-education/design-system.components 0.3.6 → 0.4.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 +16 -0
- package/CLAUDE.md +9 -0
- package/dist/components/avatar/Avatar.d.ts +11 -0
- package/dist/components/avatar/Avatar.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.js +17 -0
- package/dist/components/avatar/Avatar.js.map +1 -0
- package/dist/components/avatar/Avatar.stories.d.ts +14 -0
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.stories.js +66 -0
- package/dist/components/avatar/Avatar.stories.js.map +1 -0
- package/dist/components/avatar/Avatar.test.d.ts +2 -0
- package/dist/components/avatar/Avatar.test.d.ts.map +1 -0
- package/dist/components/avatar/Avatar.test.js +51 -0
- package/dist/components/avatar/Avatar.test.js.map +1 -0
- package/dist/components/banner/Banner.d.ts +19 -0
- package/dist/components/banner/Banner.d.ts.map +1 -0
- package/dist/components/banner/Banner.js +33 -0
- package/dist/components/banner/Banner.js.map +1 -0
- package/dist/components/banner/Banner.stories.d.ts +72 -0
- package/dist/components/banner/Banner.stories.d.ts.map +1 -0
- package/dist/components/banner/Banner.stories.js +84 -0
- package/dist/components/banner/Banner.stories.js.map +1 -0
- package/dist/components/banner/Banner.test.d.ts +2 -0
- package/dist/components/banner/Banner.test.d.ts.map +1 -0
- package/dist/components/banner/Banner.test.js +72 -0
- package/dist/components/banner/Banner.test.js.map +1 -0
- package/dist/components/dropdown/Dropdown.d.ts +2 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/Dropdown.js +5 -1
- package/dist/components/dropdown/Dropdown.js.map +1 -1
- package/dist/components/dropdown/items/DropdownGroup.d.ts +3 -0
- package/dist/components/dropdown/items/DropdownGroup.d.ts.map +1 -0
- package/dist/components/dropdown/items/DropdownGroup.js +8 -0
- package/dist/components/dropdown/items/DropdownGroup.js.map +1 -0
- package/dist/components/dropdown/items/DropdownSeparator.d.ts +3 -0
- package/dist/components/dropdown/items/DropdownSeparator.d.ts.map +1 -0
- package/dist/components/dropdown/items/DropdownSeparator.js +8 -0
- package/dist/components/dropdown/items/DropdownSeparator.js.map +1 -0
- package/dist/components/userDropdown/UserDropdown.d.ts +47 -0
- package/dist/components/userDropdown/UserDropdown.d.ts.map +1 -0
- package/dist/components/userDropdown/UserDropdown.js +13 -0
- package/dist/components/userDropdown/UserDropdown.js.map +1 -0
- package/dist/components/userDropdown/UserDropdown.stories.d.ts +12 -0
- package/dist/components/userDropdown/UserDropdown.stories.d.ts.map +1 -0
- package/dist/components/userDropdown/UserDropdown.stories.js +222 -0
- package/dist/components/userDropdown/UserDropdown.stories.js.map +1 -0
- package/dist/components/userDropdown/UserDropdown.test.d.ts +2 -0
- package/dist/components/userDropdown/UserDropdown.test.d.ts.map +1 -0
- package/dist/components/userDropdown/UserDropdown.test.js +197 -0
- package/dist/components/userDropdown/UserDropdown.test.js.map +1 -0
- package/dist/components/userDropdown/assets/arbor.png +0 -0
- package/dist/components/userDropdown/assets/govhub.png +0 -0
- package/dist/components/userDropdown/assets/key.png +0 -0
- package/dist/components/userDropdown/assets/logos.d.ts +7 -0
- package/dist/components/userDropdown/assets/logos.d.ts.map +1 -0
- package/dist/components/userDropdown/assets/logos.js +13 -0
- package/dist/components/userDropdown/assets/logos.js.map +1 -0
- package/dist/components/userDropdown/assets/robin.png +0 -0
- package/dist/components/userDropdown/assets/sampeople.png +0 -0
- package/dist/components/userDropdown/assets/timetabler.png +0 -0
- package/dist/components/userDropdown/internal/UserDropdownAppItem.d.ts +3 -0
- package/dist/components/userDropdown/internal/UserDropdownAppItem.d.ts.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownAppItem.js +9 -0
- package/dist/components/userDropdown/internal/UserDropdownAppItem.js.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownCollapsibleSection.d.ts +9 -0
- package/dist/components/userDropdown/internal/UserDropdownCollapsibleSection.d.ts.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownCollapsibleSection.js +11 -0
- package/dist/components/userDropdown/internal/UserDropdownCollapsibleSection.js.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownSignOut.d.ts +7 -0
- package/dist/components/userDropdown/internal/UserDropdownSignOut.d.ts.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownSignOut.js +9 -0
- package/dist/components/userDropdown/internal/UserDropdownSignOut.js.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownTrigger.d.ts +11 -0
- package/dist/components/userDropdown/internal/UserDropdownTrigger.d.ts.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownTrigger.js +10 -0
- package/dist/components/userDropdown/internal/UserDropdownTrigger.js.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownUserInfo.d.ts +8 -0
- package/dist/components/userDropdown/internal/UserDropdownUserInfo.d.ts.map +1 -0
- package/dist/components/userDropdown/internal/UserDropdownUserInfo.js +17 -0
- package/dist/components/userDropdown/internal/UserDropdownUserInfo.js.map +1 -0
- package/dist/index.css +463 -53
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/components/avatar/Avatar.stories.tsx +84 -0
- package/src/components/avatar/Avatar.test.tsx +60 -0
- package/src/components/avatar/Avatar.tsx +68 -0
- package/src/components/avatar/avatar.scss +71 -0
- package/src/components/banner/Banner.stories.tsx +96 -0
- package/src/components/banner/Banner.test.tsx +86 -0
- package/src/components/banner/Banner.tsx +81 -0
- package/src/components/banner/banner.scss +67 -0
- package/src/components/button/button.scss +0 -5
- package/src/components/card/card.scss +0 -3
- package/src/components/dropdown/Dropdown.tsx +5 -1
- package/src/components/dropdown/dropdown.scss +4 -4
- package/src/components/dropdown/items/DropdownGroup.tsx +11 -0
- package/src/components/dropdown/items/DropdownSeparator.tsx +9 -0
- package/src/components/formField/fieldset/fieldset.scss +0 -2
- package/src/components/formField/formField.scss +0 -2
- package/src/components/formField/inputs/checkbox/checkboxInput.scss +0 -2
- package/src/components/formField/inputs/input.scss +0 -3
- package/src/components/formField/inputs/radio/radioButtonInput.scss +0 -2
- package/src/components/formField/inputs/selectDropdown/selectDropdown.scss +0 -1
- package/src/components/formField/label/label.scss +0 -2
- package/src/components/modal/modal.scss +0 -3
- package/src/components/pill/pill.scss +0 -3
- package/src/components/searchBar/searchBar.scss +0 -3
- package/src/components/table/columnFilters/columnFilters.scss +0 -6
- package/src/components/table/pagination/pagination.scss +0 -4
- package/src/components/tabs/tabs.scss +0 -2
- package/src/components/tag/tag.scss +0 -3
- package/src/components/toast/toast.scss +0 -1
- package/src/components/tooltip/tooltip.scss +0 -3
- package/src/components/userDropdown/UserDropdown.stories.tsx +237 -0
- package/src/components/userDropdown/UserDropdown.test.tsx +349 -0
- package/src/components/userDropdown/UserDropdown.tsx +110 -0
- package/src/components/userDropdown/assets/arbor.png +0 -0
- package/src/components/userDropdown/assets/govhub.png +0 -0
- package/src/components/userDropdown/assets/key.png +0 -0
- package/src/components/userDropdown/assets/logos.ts +13 -0
- package/src/components/userDropdown/assets/robin.png +0 -0
- package/src/components/userDropdown/assets/sampeople.png +0 -0
- package/src/components/userDropdown/assets/timetabler.png +0 -0
- package/src/components/userDropdown/internal/UserDropdownAppItem.tsx +21 -0
- package/src/components/userDropdown/internal/UserDropdownCollapsibleSection.tsx +38 -0
- package/src/components/userDropdown/internal/UserDropdownSignOut.tsx +19 -0
- package/src/components/userDropdown/internal/UserDropdownTrigger.tsx +42 -0
- package/src/components/userDropdown/internal/UserDropdownUserInfo.tsx +60 -0
- package/src/components/userDropdown/userDropdown.scss +377 -0
- package/src/global.scss +9 -1
- package/src/index.scss +3 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +1 -1
- package/vite-env.d.ts +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownAppItem.js","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownAppItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC5D,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEnD,OAAO,CACL,MAAC,QAAQ,CAAC,IAAI,IAAC,SAAS,EAAC,4BAA4B,EAAC,OAAO,EAAE,OAAO,aACnE,IAAI,IAAI,cAAK,SAAS,EAAC,iCAAiC,YAAE,IAAI,GAAO,EACtE,eAAK,SAAS,EAAC,iCAAiC,aAC9C,cAAK,SAAS,EAAC,iCAAiC,YAAE,IAAI,GAAO,EAC5D,WAAW,IAAI,cAAK,SAAS,EAAC,wCAAwC,YAAE,WAAW,GAAO,IACvF,EACN,cAAK,SAAS,EAAC,kCAAkC,iBAAa,MAAM,YAClE,KAAC,IAAI,IAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAE,EAAE,GAAI,GACpC,IACQ,CACjB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UserDropdownApp } from '../UserDropdown';
|
|
2
|
+
type UserDropdownCollapsibleSectionProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
apps: UserDropdownApp[];
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const UserDropdownCollapsibleSection: (props: UserDropdownCollapsibleSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=UserDropdownCollapsibleSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownCollapsibleSection.d.ts","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownCollapsibleSection.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,KAAK,mCAAmC,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,OAAO,mCAAmC,4CAyBxF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Icon } from '../../icon/Icon';
|
|
4
|
+
import { Dropdown } from '../../dropdown/Dropdown';
|
|
5
|
+
import { UserDropdownAppItem } from './UserDropdownAppItem';
|
|
6
|
+
export const UserDropdownCollapsibleSection = (props) => {
|
|
7
|
+
const { label, apps, defaultOpen = false } = props;
|
|
8
|
+
const [isOpen, setIsOpen] = useState(defaultOpen);
|
|
9
|
+
return (_jsxs("div", { className: "ds-user-dropdown__collapsible-section", children: [_jsxs("div", { className: "ds-user-dropdown__collapsible-section-header", onClick: () => { setIsOpen(!isOpen); }, role: "button", tabIndex: 0, "aria-expanded": isOpen, children: [_jsx("span", { className: "ds-user-dropdown__collapsible-section-label", children: label }), _jsx(Icon, { name: isOpen ? 'chevron-up' : 'chevron-down', size: 16, className: "ds-user-dropdown__collapsible-section-icon" })] }), isOpen && (_jsx(Dropdown.Group, { className: "ds-user-dropdown__collapsible-section-content", children: apps.map((app, index) => (_jsx(UserDropdownAppItem, { ...app }, index))) }))] }));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=UserDropdownCollapsibleSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownCollapsibleSection.js","sourceRoot":"","sources":["../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"file":"UserDropdownSignOut.d.ts","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownSignOut.tsx"],"names":[],"mappings":"AAIA,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CASlE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon } from '../../icon/Icon';
|
|
4
|
+
import { Dropdown } from '../../dropdown/Dropdown';
|
|
5
|
+
export const UserDropdownSignOut = (props) => {
|
|
6
|
+
const { onClick, label = 'Sign out' } = props;
|
|
7
|
+
return (_jsxs(Dropdown.Item, { className: "ds-user-dropdown__sign-out", onClick: onClick, children: [_jsx(Icon, { name: "log-out", size: 24 }), _jsx("span", { className: "ds-user-dropdown__sign-out-label", children: label })] }));
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=UserDropdownSignOut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownSignOut.js","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownSignOut.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAOxD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE9C,OAAO,CACL,MAAC,QAAQ,CAAC,IAAI,IAAC,SAAS,EAAC,4BAA4B,EAAC,OAAO,EAAE,OAAO,aACpE,KAAC,IAAI,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,EAAE,GAAI,EACjC,eAAM,SAAS,EAAC,kCAAkC,YAAE,KAAK,GAAQ,IACnD,CACjB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type UserDropdownTriggerProps = {
|
|
2
|
+
avatarSrc?: string;
|
|
3
|
+
avatarAlt?: string;
|
|
4
|
+
avatarInitials?: string;
|
|
5
|
+
logoSrc?: string;
|
|
6
|
+
logoAlt?: string;
|
|
7
|
+
variant?: 'dark' | 'light';
|
|
8
|
+
};
|
|
9
|
+
export declare const UserDropdownTrigger: (props: UserDropdownTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=UserDropdownTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownTrigger.d.ts","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownTrigger.tsx"],"names":[],"mappings":"AAKA,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CA2BlE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Dropdown } from '../../dropdown/Dropdown';
|
|
4
|
+
import { Avatar } from '../../avatar/Avatar';
|
|
5
|
+
import { Button } from '../../button/Button';
|
|
6
|
+
export const UserDropdownTrigger = (props) => {
|
|
7
|
+
const { avatarSrc, avatarAlt, avatarInitials, logoSrc, logoAlt = 'Logo', variant = 'dark' } = props;
|
|
8
|
+
return (_jsxs("div", { className: `ds-user-dropdown__trigger-container ds-user-dropdown__trigger-container--${variant}${logoSrc ? ' ds-user-dropdown__trigger-container--with-logo' : ''}`, children: [_jsx(Dropdown.Trigger, { children: _jsx(Button, { variant: "secondary", borderless: true, iconRightName: "chevron-down", className: "ds-user-dropdown__trigger", children: _jsx(Avatar, { size: "medium", src: avatarSrc, alt: avatarAlt, initials: avatarInitials }) }) }), logoSrc && (_jsxs(_Fragment, { children: [_jsx("div", { className: "ds-user-dropdown__trigger-divider" }), _jsx("img", { src: logoSrc, alt: logoAlt, className: "ds-user-dropdown__trigger-logo" })] }))] }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=UserDropdownTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownTrigger.js","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownTrigger.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAWlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IAEpG,OAAO,CACL,eACE,SAAS,EAAE,4EAA4E,OAAO,GAC5F,OAAO,CAAC,CAAC,CAAC,iDAAiD,CAAC,CAAC,CAAC,EAChE,EAAE,aAEF,KAAC,QAAQ,CAAC,OAAO,cACf,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,UAAU,EAAE,IAAI,EAChB,aAAa,EAAC,cAAc,EAC5B,SAAS,EAAC,2BAA2B,YAErC,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAI,GAC3E,GACQ,EAClB,OAAO,IAAI,CACV,8BACE,cAAK,SAAS,EAAC,mCAAmC,GAAG,EACrD,cAAK,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAC,gCAAgC,GAAG,IAC7E,CACJ,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UserDropdownUser, UserDropdownUserInfoAction } from '../UserDropdown';
|
|
2
|
+
type UserDropdownUserInfoProps = {
|
|
3
|
+
user: UserDropdownUser;
|
|
4
|
+
action?: UserDropdownUserInfoAction;
|
|
5
|
+
};
|
|
6
|
+
export declare const UserDropdownUserInfo: (props: UserDropdownUserInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=UserDropdownUserInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownUserInfo.d.ts","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownUserInfo.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAEpF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,4CA8CpE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import { DropdownMenu } from 'radix-ui';
|
|
4
|
+
import { Avatar } from '../../avatar/Avatar';
|
|
5
|
+
import { Icon } from '../../icon/Icon';
|
|
6
|
+
import { Dropdown } from '../../dropdown/Dropdown';
|
|
7
|
+
import { PopupParentContext } from '../../../utils/PopupParentContext';
|
|
8
|
+
export const UserDropdownUserInfo = (props) => {
|
|
9
|
+
const { user, action } = props;
|
|
10
|
+
const popupParentRef = useContext(PopupParentContext);
|
|
11
|
+
const content = (_jsxs(_Fragment, { children: [_jsx(Avatar, { size: "medium", src: user.avatarSrc, alt: user.avatarAlt, initials: user.avatarInitials }), _jsxs("div", { className: "ds-user-dropdown__user-info-text", children: [_jsx("div", { className: "ds-user-dropdown__user-info-name", children: user.name }), user.subtitle && _jsx("div", { className: "ds-user-dropdown__user-info-role", children: user.subtitle })] }), action && _jsx(Icon, { name: "chevron-right", size: 16, className: "ds-user-dropdown__user-info-chevron" })] }));
|
|
12
|
+
if (action?.type === 'menu') {
|
|
13
|
+
return (_jsxs(DropdownMenu.Sub, { children: [_jsx(DropdownMenu.SubTrigger, { className: "ds-user-dropdown__user-info", children: content }), _jsx(DropdownMenu.Portal, { container: popupParentRef.current, children: _jsx(DropdownMenu.SubContent, { className: "ds-user-dropdown__sub-content", children: action.items.map((item, index) => (_jsx(DropdownMenu.Item, { className: "ds-user-dropdown__sub-item", onSelect: item.onClick, children: item.label }, index))) }) })] }));
|
|
14
|
+
}
|
|
15
|
+
return (_jsx(Dropdown.Item, { className: "ds-user-dropdown__user-info", onClick: action?.type === 'link' ? action.onClick : undefined, children: content }));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=UserDropdownUserInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserDropdownUserInfo.js","sourceRoot":"","sources":["../../../../src/components/userDropdown/internal/UserDropdownUserInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,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