@phillips/seldon 1.51.0 → 1.52.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/dist/assets/account_circle.svg.js +2 -2
- package/dist/components/Accordion/AccordionItem.d.ts +8 -4
- package/dist/components/Accordion/AccordionItem.js +67 -65
- package/dist/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/components/Header/Header.d.ts +20 -13
- package/dist/components/Header/Header.js +73 -76
- package/dist/components/Header/utils.d.ts +2 -9
- package/dist/components/Header/utils.js +3 -7
- package/dist/components/LanguageSelector/LanguageSelector.d.ts +36 -0
- package/dist/components/LanguageSelector/LanguageSelector.js +73 -0
- package/dist/components/LanguageSelector/index.d.ts +1 -0
- package/dist/components/Link/Link.d.ts +3 -11
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Navigation/Navigation.d.ts +12 -4
- package/dist/components/Navigation/Navigation.js +34 -51
- package/dist/components/Navigation/NavigationItem/NavigationItem.d.ts +15 -10
- package/dist/components/Navigation/NavigationItem/NavigationItem.js +19 -37
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.d.ts +12 -3
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +33 -29
- package/dist/components/Navigation/NavigationList/NavigationList.d.ts +2 -2
- package/dist/components/Navigation/NavigationList/NavigationList.js +31 -32
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Search/Search.js +134 -122
- package/dist/components/Search/SearchButton.js +21 -17
- package/dist/components/Search/SearchResults/SearchResults.js +14 -13
- package/dist/components/UserManagement/UserManagement.d.ts +21 -13
- package/dist/components/UserManagement/UserManagement.js +31 -61
- package/dist/index.d.ts +1 -0
- package/dist/index.js +65 -62
- package/dist/scss/_utils.scss +13 -3
- package/dist/scss/_vars.scss +30 -11
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Accordion/_accordion.scss +3 -0
- package/dist/scss/components/Dropdown/_dropdown.scss +2 -0
- package/dist/scss/components/Header/_header.scss +72 -86
- package/dist/scss/components/LanguageSelector/_languageSelector.scss +47 -0
- package/dist/scss/components/Link/_link.scss +15 -4
- package/dist/scss/components/LinkList/_linkList.scss +4 -0
- package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +4 -119
- package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +75 -0
- package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +29 -42
- package/dist/scss/components/Navigation/_navigation.scss +24 -82
- package/dist/scss/components/Search/SearchResults/_searchResults.scss +1 -25
- package/dist/scss/components/Search/_search.scss +48 -7
- package/dist/scss/components/Search/_searchButton.scss +6 -2
- package/dist/scss/components/UserManagement/_userManagement.scss +33 -94
- package/dist/scss/components/Video/_video.scss +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +31 -24
- package/package.json +2 -1
|
@@ -1,145 +1,157 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { TextVariants as
|
|
9
|
-
import
|
|
10
|
-
import { useOnClickOutside as
|
|
11
|
-
import { HeaderContext as
|
|
12
|
-
import { SearchButton as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
onSearch:
|
|
16
|
-
searchResults:
|
|
17
|
-
state:
|
|
18
|
-
defaultValue:
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import c, { useEffect as P } from "react";
|
|
3
|
+
import { getCommonProps as y, px as j, encodeURLSearchParams as C } from "../../utils/index.js";
|
|
4
|
+
import p from "../../node_modules/classnames/index.js";
|
|
5
|
+
import D from "../Input/Input.js";
|
|
6
|
+
import H from "../Link/Link.js";
|
|
7
|
+
import O from "./SearchResults/SearchResults.js";
|
|
8
|
+
import { TextVariants as V } from "../Text/types.js";
|
|
9
|
+
import A from "../Text/Text.js";
|
|
10
|
+
import { useOnClickOutside as F } from "../../node_modules/usehooks-ts/dist/index.js";
|
|
11
|
+
import { HeaderContext as K } from "../Header/Header.js";
|
|
12
|
+
import { SearchButton as M } from "./SearchButton.js";
|
|
13
|
+
import U from "../../node_modules/react-transition-group/esm/CSSTransition.js";
|
|
14
|
+
const te = ({
|
|
15
|
+
onSearch: u,
|
|
16
|
+
searchResults: E = [],
|
|
17
|
+
state: i = "idle",
|
|
18
|
+
defaultValue: N = "",
|
|
19
19
|
className: R,
|
|
20
|
-
placeholder:
|
|
20
|
+
placeholder: I = "",
|
|
21
21
|
searchButtonText: l = "Search",
|
|
22
|
-
loadingText:
|
|
23
|
-
invalidText:
|
|
24
|
-
getAllResultsText:
|
|
25
|
-
getAllResultsLink:
|
|
26
|
-
...
|
|
22
|
+
loadingText: b = "Search In Progress...",
|
|
23
|
+
invalidText: w = "Invalid search",
|
|
24
|
+
getAllResultsText: k = (e) => `View all results for ${e}`,
|
|
25
|
+
getAllResultsLink: _ = (e) => `/Search?Search=${e}`,
|
|
26
|
+
...S
|
|
27
27
|
}) => {
|
|
28
|
-
var
|
|
29
|
-
const { className: e, "data-testid":
|
|
30
|
-
|
|
31
|
-
const
|
|
28
|
+
var g;
|
|
29
|
+
const { className: e, "data-testid": d, ...L } = y(S, "Search"), o = c.useContext(K), m = c.useRef(null), f = c.useRef(null), x = c.useRef(null), a = o.isSearchExpanded, s = (g = m.current) == null ? void 0 : g.value;
|
|
30
|
+
F(x, () => $(!1));
|
|
31
|
+
const v = (r) => {
|
|
32
32
|
var n;
|
|
33
33
|
if (r.stopPropagation(), r.key === "Enter") {
|
|
34
34
|
if (r.preventDefault(), s && s.length > 2) {
|
|
35
|
-
const
|
|
36
|
-
window.location.href =
|
|
35
|
+
const T = C(_(s));
|
|
36
|
+
window.location.href = T;
|
|
37
37
|
}
|
|
38
38
|
r.currentTarget instanceof HTMLAnchorElement && r.currentTarget.click();
|
|
39
39
|
}
|
|
40
|
-
r.key === "Escape" && (
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
r.key === "Escape" && (o.setIsSearchExpanded(!1), (n = f.current) == null || n.reset());
|
|
41
|
+
};
|
|
42
|
+
P(() => {
|
|
43
|
+
var r;
|
|
44
|
+
if (a) {
|
|
45
|
+
(r = m.current) == null || r.focus();
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
}, [a]);
|
|
49
|
+
const $ = (r) => {
|
|
50
|
+
var n;
|
|
51
|
+
o.setIsSearchExpanded(r), (n = f.current) == null || n.reset();
|
|
48
52
|
};
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
children: /* @__PURE__ */ p(
|
|
60
|
-
"form",
|
|
53
|
+
return /* @__PURE__ */ h(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
onClick: () => o.setIsSearchExpanded(!0),
|
|
57
|
+
className: `${e}__container`,
|
|
58
|
+
ref: x,
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ t(A, { variant: V.heading4, className: `${e}__container__label`, children: l }),
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
"div",
|
|
61
63
|
{
|
|
62
|
-
|
|
63
|
-
className:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
children:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
...L,
|
|
65
|
+
className: p(e, R, { [`${e}--active`]: a }),
|
|
66
|
+
"data-testid": d,
|
|
67
|
+
role: "search",
|
|
68
|
+
...S,
|
|
69
|
+
children: /* @__PURE__ */ h(
|
|
70
|
+
"form",
|
|
71
|
+
{
|
|
72
|
+
"data-testid": `${d}-form`,
|
|
73
|
+
className: p(`${e}__form`, {
|
|
74
|
+
[`${e}__form--active`]: a
|
|
75
|
+
}),
|
|
76
|
+
ref: f,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ h(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: p(`${e}__content-wrapper`, {
|
|
82
|
+
[`${e}__content-wrapper--active`]: a
|
|
83
|
+
}),
|
|
84
|
+
role: "combobox",
|
|
85
|
+
"aria-haspopup": "listbox",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ t(
|
|
88
|
+
U,
|
|
89
|
+
{
|
|
90
|
+
in: a,
|
|
91
|
+
classNames: `${j}-input`,
|
|
92
|
+
addEndListener: () => {
|
|
93
|
+
},
|
|
94
|
+
children: /* @__PURE__ */ t(
|
|
95
|
+
D,
|
|
96
|
+
{
|
|
97
|
+
"aria-hidden": !a,
|
|
98
|
+
className: `${e}__input`,
|
|
99
|
+
id: "search-input",
|
|
100
|
+
hideLabel: !0,
|
|
101
|
+
labelText: l,
|
|
102
|
+
placeholder: a ? I : "",
|
|
103
|
+
type: "text",
|
|
104
|
+
defaultValue: N,
|
|
105
|
+
invalid: i === "invalid",
|
|
106
|
+
invalidText: w,
|
|
107
|
+
onKeyDown: v,
|
|
108
|
+
onChange: u ? (r) => {
|
|
109
|
+
u(r.target.value);
|
|
110
|
+
} : void 0,
|
|
111
|
+
ref: m
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
M,
|
|
86
118
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
type: "text",
|
|
94
|
-
defaultValue: I,
|
|
95
|
-
invalid: c === "invalid",
|
|
96
|
-
invalidText: E,
|
|
97
|
-
onKeyDown: _,
|
|
98
|
-
onChange: S ? (r) => {
|
|
99
|
-
S(r.target.value);
|
|
100
|
-
} : void 0,
|
|
101
|
-
ref: h
|
|
119
|
+
className: e,
|
|
120
|
+
searchButtonText: l,
|
|
121
|
+
state: i,
|
|
122
|
+
testId: d,
|
|
123
|
+
isSearchExpanded: a,
|
|
124
|
+
setIsSearchExpanded: $
|
|
102
125
|
}
|
|
103
126
|
)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
className: e,
|
|
110
|
-
searchButtonText: l,
|
|
111
|
-
state: c,
|
|
112
|
-
testId: m,
|
|
113
|
-
isSearchExpanded: t,
|
|
114
|
-
setIsSearchExpanded: g
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
s && s.length > 2 ? /* @__PURE__ */ a(
|
|
121
|
-
F,
|
|
122
|
-
{
|
|
123
|
-
autoCompleteResults: C,
|
|
124
|
-
isLoading: c === "loading",
|
|
125
|
-
loadingText: w,
|
|
126
|
-
onKeyDown: _,
|
|
127
|
-
children: /* @__PURE__ */ a("li", { className: `${e}__result`, children: /* @__PURE__ */ a(
|
|
128
|
-
D,
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
s && s.length > 2 ? /* @__PURE__ */ t(
|
|
131
|
+
O,
|
|
129
132
|
{
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
autoCompleteResults: E,
|
|
134
|
+
isLoading: i === "loading",
|
|
135
|
+
loadingText: b,
|
|
136
|
+
onKeyDown: v,
|
|
137
|
+
children: /* @__PURE__ */ t("li", { className: `${e}__result`, children: /* @__PURE__ */ t(
|
|
138
|
+
H,
|
|
139
|
+
{
|
|
140
|
+
href: ((r) => C(_(r)))(s),
|
|
141
|
+
children: /* @__PURE__ */ t("p", { children: k(s) })
|
|
142
|
+
}
|
|
143
|
+
) }, "viewAllSearchResults")
|
|
132
144
|
}
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
145
|
+
) : null
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
)
|
|
137
149
|
}
|
|
138
150
|
)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
142
154
|
};
|
|
143
155
|
export {
|
|
144
|
-
|
|
156
|
+
te as default
|
|
145
157
|
};
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
state:
|
|
6
|
-
isSearchExpanded:
|
|
7
|
-
setIsSearchExpanded:
|
|
8
|
-
searchButtonText:
|
|
2
|
+
import _ from "../../assets/search.svg.js";
|
|
3
|
+
import b from "../../assets/close.svg.js";
|
|
4
|
+
const m = ({
|
|
5
|
+
state: l,
|
|
6
|
+
isSearchExpanded: i,
|
|
7
|
+
setIsSearchExpanded: u,
|
|
8
|
+
searchButtonText: e,
|
|
9
9
|
className: t,
|
|
10
10
|
testId: o,
|
|
11
|
-
...
|
|
12
|
-
}) =>
|
|
11
|
+
...a
|
|
12
|
+
}) => i ? i ? /* @__PURE__ */ n(
|
|
13
13
|
"button",
|
|
14
14
|
{
|
|
15
|
-
...
|
|
15
|
+
...a,
|
|
16
16
|
type: "button",
|
|
17
17
|
"data-testid": `${o}-close-button`,
|
|
18
18
|
"aria-label": "Close Search",
|
|
19
19
|
className: `${t}__button ${t}__button--close`,
|
|
20
|
-
onClick: () =>
|
|
21
|
-
|
|
20
|
+
onClick: (r) => {
|
|
21
|
+
u(!1), r.stopPropagation();
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ n(b, { "data-testid": `${o}-form-icon`, className: `${t}__button__icon` })
|
|
22
24
|
}
|
|
23
25
|
) : null : /* @__PURE__ */ n(
|
|
24
26
|
"button",
|
|
25
27
|
{
|
|
26
|
-
...
|
|
28
|
+
...a,
|
|
27
29
|
type: "button",
|
|
28
30
|
"data-testid": `${o}-button`,
|
|
29
|
-
"aria-label":
|
|
31
|
+
"aria-label": e,
|
|
30
32
|
className: `${t}__button ${t}__button--search`,
|
|
31
|
-
onClick: () =>
|
|
32
|
-
|
|
33
|
+
onClick: (r) => {
|
|
34
|
+
u(!0), r.stopPropagation();
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ n(_, { "data-testid": `${o}-button-icon`, className: `${t}__button__icon` })
|
|
33
37
|
}
|
|
34
38
|
);
|
|
35
39
|
export {
|
|
36
|
-
|
|
40
|
+
m as SearchButton
|
|
37
41
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { px as s } from "../../../utils/index.js";
|
|
3
3
|
import d from "../../Link/Link.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { LinkVariants as m } from "../../Link/types.js";
|
|
5
|
+
const p = ({
|
|
6
|
+
autoCompleteResults: a = [],
|
|
7
|
+
isLoading: i,
|
|
8
|
+
children: l,
|
|
9
|
+
loadingText: n = "Loading...",
|
|
10
|
+
onKeyDown: c
|
|
10
11
|
}) => {
|
|
11
|
-
const
|
|
12
|
-
return /* @__PURE__ */ r("div", { className: `${s}-search__results`, children: /* @__PURE__ */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const t = Array.isArray(a) && a.length > 0;
|
|
13
|
+
return /* @__PURE__ */ r("div", { className: `${s}-search__results`, children: /* @__PURE__ */ h("ul", { "data-testid": "search-results", className: `${s}-search__results-container`, children: [
|
|
14
|
+
i ? /* @__PURE__ */ r("li", { className: `${s}-search__result`, children: n }) : null,
|
|
15
|
+
t && a.map((e) => /* @__PURE__ */ r("li", { className: `${s}-search__result`, children: /* @__PURE__ */ r(d, { href: e.url, onKeyDown: c, variant: m.snwFlyoutLink, children: e.label }) }, e.id)),
|
|
16
|
+
l
|
|
16
17
|
] }) });
|
|
17
18
|
};
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
p as default
|
|
20
21
|
};
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, ElementType, ReactNode } from 'react';
|
|
2
2
|
import { LinkProps } from '../Link/Link';
|
|
3
|
-
import { SupportedLanguages } from '../../types/commonTypes';
|
|
4
3
|
import { AuthState } from './types';
|
|
5
|
-
export interface UserManagementProps extends
|
|
6
|
-
languageOptions?: {
|
|
7
|
-
label: string;
|
|
8
|
-
value: SupportedLanguages;
|
|
9
|
-
}[];
|
|
10
|
-
currentLanguage?: SupportedLanguages;
|
|
11
|
-
onLanguageChange?: (language: SupportedLanguages) => void;
|
|
4
|
+
export interface UserManagementProps extends ComponentProps<'div'> {
|
|
12
5
|
/**
|
|
13
6
|
* The authentication state for the current user
|
|
14
7
|
*/
|
|
15
8
|
authState?: AuthState;
|
|
9
|
+
/**
|
|
10
|
+
* Triggered when the login button is clicked
|
|
11
|
+
*/
|
|
16
12
|
onLogin?: () => void;
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Allows override of the default `<a` element. Can be used to support Remix `<Link`
|
|
15
|
+
*/
|
|
16
|
+
accountDetailsLinkComponent?: ElementType<LinkProps>;
|
|
17
|
+
/**
|
|
18
|
+
* The href for the account details link
|
|
19
|
+
*/
|
|
20
|
+
href?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The label for the login button
|
|
23
|
+
*/
|
|
19
24
|
loginLabel?: ReactNode;
|
|
20
|
-
|
|
25
|
+
/**
|
|
26
|
+
* The label for the account details link
|
|
27
|
+
*/
|
|
28
|
+
accountLabel?: ReactNode;
|
|
21
29
|
}
|
|
22
|
-
declare const UserManagement: (
|
|
30
|
+
declare const UserManagement: import("react").ForwardRefExoticComponent<Omit<UserManagementProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
31
|
export default UserManagement;
|
|
@@ -1,63 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
(h = document.activeElement) == null || h.blur(), _(e);
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ p("div", { ...x, className: z(l, f), ...g, children: [
|
|
34
|
-
/* @__PURE__ */ a("ul", { className: `${l}__account-wrapper`, children: A && /* @__PURE__ */ p(S, { children: [
|
|
35
|
-
/* @__PURE__ */ a(L, { children: /* @__PURE__ */ a(P, { className: `${l}__account-icon` }) }),
|
|
36
|
-
/* @__PURE__ */ a(
|
|
37
|
-
y,
|
|
38
|
-
{
|
|
39
|
-
className: `${l}__login`,
|
|
40
|
-
onClick: c ? b : N,
|
|
41
|
-
label: c ? $ : C
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
] }) }),
|
|
45
|
-
/* @__PURE__ */ a(T, { className: `${l}__language`, label: I, children: /* @__PURE__ */ a(U, { id: `${w}-langauge-selection-list`, className: `${l}__language__selections`, children: t.map((e) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
46
|
-
M,
|
|
47
|
-
{
|
|
48
|
-
type: "radio",
|
|
49
|
-
id: `radio-${e.value}`,
|
|
50
|
-
labelText: e.label,
|
|
51
|
-
value: e.value,
|
|
52
|
-
inline: !0,
|
|
53
|
-
name: "languages",
|
|
54
|
-
checked: e.value === s,
|
|
55
|
-
onChange: () => E(e.value)
|
|
56
|
-
}
|
|
57
|
-
) }, e.value)) }) }),
|
|
58
|
-
v
|
|
59
|
-
] });
|
|
60
|
-
};
|
|
1
|
+
import { jsx as o, Fragment as L, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x } from "react";
|
|
3
|
+
import { getCommonProps as C, noOp as b } from "../../utils/index.js";
|
|
4
|
+
import r from "../../assets/account_circle.svg.js";
|
|
5
|
+
import v from "../../node_modules/classnames/index.js";
|
|
6
|
+
import { AuthState as a } from "./types.js";
|
|
7
|
+
import { TextVariants as s } from "../Text/types.js";
|
|
8
|
+
import m from "../Text/Text.js";
|
|
9
|
+
const A = x(
|
|
10
|
+
({
|
|
11
|
+
accountDetailsLinkComponent: i = "a",
|
|
12
|
+
className: l,
|
|
13
|
+
onLogin: d = b,
|
|
14
|
+
authState: e = a.LoggedOut,
|
|
15
|
+
loginLabel: g = "Login",
|
|
16
|
+
accountLabel: p = "Account",
|
|
17
|
+
href: u = "/account",
|
|
18
|
+
...t
|
|
19
|
+
}, f) => {
|
|
20
|
+
const { className: n, ...h } = C(t, "UserManagement"), N = e === a.LoggedIn, _ = e !== a.Loading;
|
|
21
|
+
return /* @__PURE__ */ o("div", { ...h, className: v(n, l), ...t, ref: f, children: _ && /* @__PURE__ */ o(L, { children: N ? /* @__PURE__ */ c(i, { className: `${n}__login`, href: u, children: [
|
|
22
|
+
/* @__PURE__ */ o(r, { className: `${n}__account-icon` }),
|
|
23
|
+
/* @__PURE__ */ o(m, { variant: s.body3, children: p })
|
|
24
|
+
] }) : /* @__PURE__ */ c("button", { className: `${n}__login`, onClick: d, children: [
|
|
25
|
+
/* @__PURE__ */ o(r, { className: `${n}__account-icon` }),
|
|
26
|
+
/* @__PURE__ */ o(m, { variant: s.body3, children: g })
|
|
27
|
+
] }) }) });
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
A.displayName = "UserManagement";
|
|
61
31
|
export {
|
|
62
|
-
|
|
32
|
+
A as default
|
|
63
33
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -38,3 +38,4 @@ export * from './types/commonTypes';
|
|
|
38
38
|
export { Breadcrumb, type BreadcrumbProps } from './components/Breadcrumb';
|
|
39
39
|
export * from './components/Dropdown';
|
|
40
40
|
export { default as Video, type VideoProps } from './components/Video/Video';
|
|
41
|
+
export * from './components/LanguageSelector';
|