@ilo-org/react 0.1.2 → 0.2.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 +21 -0
- package/lib/cjs/{DailyMotion-4f88e10b.js → DailyMotion-2aa7f048.js} +4 -5
- package/lib/cjs/{Facebook-d993b91c.js → Facebook-87e24af8.js} +4 -5
- package/lib/cjs/{FilePlayer-8272a6ea.js → FilePlayer-e1216cc8.js} +4 -5
- package/lib/cjs/{Kaltura-fbd2c46f.js → Kaltura-a673a8e9.js} +4 -5
- package/lib/cjs/{Mixcloud-2b4ffb85.js → Mixcloud-f9575c31.js} +4 -5
- package/lib/cjs/{Preview-8238ea6e.js → Preview-468c3a7f.js} +2 -2
- package/lib/cjs/{SoundCloud-356fd92d.js → SoundCloud-7c59f293.js} +4 -5
- package/lib/cjs/{Streamable-407ca855.js → Streamable-83e516e5.js} +4 -5
- package/lib/cjs/{Twitch-ca00faaf.js → Twitch-fdfa1c77.js} +4 -5
- package/lib/cjs/VideoPlayer-9ce35136.js +2059 -0
- package/lib/cjs/{Vidyard-9d037503.js → Vidyard-096bba3c.js} +4 -5
- package/lib/cjs/{Vimeo-6898bfd9.js → Vimeo-2cb7476f.js} +4 -5
- package/lib/cjs/{Wistia-ed77bf25.js → Wistia-5e830ac8.js} +4 -5
- package/lib/cjs/{YouTube-909bd761.js → YouTube-25a1d9a0.js} +4 -5
- package/lib/cjs/components/Footer/Footer.js +23 -0
- package/lib/cjs/components/Footer/index.js +18 -0
- package/lib/cjs/components/LocalNav/LocalNav.js +102 -0
- package/lib/cjs/components/LocalNav/index.js +14 -0
- package/lib/cjs/components/Video/Video.js +2 -4
- package/lib/cjs/components/Video/VideoPlayer.js +10 -1445
- package/lib/cjs/components/Video/index.js +1 -3
- package/lib/cjs/components/index.js +6 -4
- package/lib/cjs/index.js +5 -3
- package/lib/esm/{DailyMotion-9a7aeab5.js → DailyMotion-66b6eff2.js} +1 -2
- package/lib/esm/{Facebook-eb35da52.js → Facebook-dbd1003d.js} +1 -2
- package/lib/esm/{FilePlayer-22314795.js → FilePlayer-617ed2ce.js} +1 -2
- package/lib/esm/{Kaltura-b97bb455.js → Kaltura-bbcec33d.js} +1 -2
- package/lib/esm/{Mixcloud-41d6dc0b.js → Mixcloud-a681ec69.js} +1 -2
- package/lib/esm/{Preview-6d2a6792.js → Preview-407cc648.js} +1 -1
- package/lib/esm/{SoundCloud-0fac2e7a.js → SoundCloud-16e78ee5.js} +1 -2
- package/lib/esm/{Streamable-46f19a16.js → Streamable-ecb225c1.js} +1 -2
- package/lib/esm/{Twitch-1be39438.js → Twitch-8d1b6769.js} +1 -2
- package/lib/esm/VideoPlayer-62e0ce79.js +2054 -0
- package/lib/esm/{Vidyard-6185c490.js → Vidyard-57e2834a.js} +1 -2
- package/lib/esm/{Vimeo-a807e7e1.js → Vimeo-faa058a2.js} +1 -2
- package/lib/esm/{Wistia-eef03ce2.js → Wistia-24fb5120.js} +1 -2
- package/lib/esm/{YouTube-e030042e.js → YouTube-01b3e51f.js} +1 -2
- package/lib/esm/components/Footer/Footer.js +21 -0
- package/lib/esm/components/Footer/index.js +12 -0
- package/lib/esm/components/LocalNav/LocalNav.js +100 -0
- package/lib/esm/components/LocalNav/index.js +8 -0
- package/lib/esm/components/Video/Video.js +1 -3
- package/lib/esm/components/Video/VideoPlayer.js +9 -1448
- package/lib/esm/components/Video/index.js +1 -3
- package/lib/esm/components/index.js +4 -4
- package/lib/esm/index.js +3 -3
- package/lib/types/react/src/components/ContextMenu/ContextMenu.props.d.ts +1 -2
- package/lib/types/react/src/components/Footer/Footer.d.ts +4 -0
- package/lib/types/react/src/components/Footer/Footer.props.d.ts +70 -0
- package/lib/types/react/src/components/Footer/index.d.ts +1 -0
- package/lib/types/react/src/components/LinkList/LinkList.props.d.ts +2 -3
- package/lib/types/react/src/components/LocalNav/LocalNav.d.ts +4 -0
- package/lib/types/react/src/components/LocalNav/LocalNav.props.d.ts +50 -0
- package/lib/types/react/src/components/LocalNav/index.d.ts +1 -0
- package/lib/types/react/src/components/index.d.ts +2 -0
- package/lib/types/react/src/types/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/ContextMenu/ContextMenu.props.ts +1 -1
- package/src/components/Footer/Footer.args.ts +105 -0
- package/src/components/Footer/Footer.props.ts +84 -0
- package/src/components/Footer/Footer.tsx +107 -0
- package/src/components/Footer/index.ts +1 -0
- package/src/components/LinkList/LinkList.props.ts +2 -2
- package/src/components/LocalNav/LocalNav.args.ts +64 -0
- package/src/components/LocalNav/LocalNav.props.ts +60 -0
- package/src/components/LocalNav/LocalNav.tsx +175 -0
- package/src/components/LocalNav/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/types/index.ts +1 -0
- package/lib/cjs/_commonjsHelpers-9f9f50a8.js +0 -39
- package/lib/cjs/patterns-975adf3c.js +0 -579
- package/lib/esm/_commonjsHelpers-849bcf65.js +0 -35
- package/lib/esm/patterns-53247c1d.js +0 -575
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { LinkProps, ContextMenuProps } from "../ContextMenu/ContextMenu.props";
|
|
2
|
+
|
|
3
|
+
export interface LocalNavProps {
|
|
4
|
+
/**
|
|
5
|
+
* Props for the background colour of the LocalNav
|
|
6
|
+
*/
|
|
7
|
+
background?: string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the logo of the LocalNav
|
|
11
|
+
*/
|
|
12
|
+
logo?: Required<string>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Props for the home url of the LocalNav
|
|
16
|
+
*/
|
|
17
|
+
siteurl?: Required<string>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Specify the primary items for the LocalNav
|
|
21
|
+
*/
|
|
22
|
+
primarynav?: Required<PrimaryNavProps>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Specify the main link for the LocalNav
|
|
26
|
+
*/
|
|
27
|
+
mainlink?: LinkProps;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Specify the menu close label for the LocalNav
|
|
31
|
+
*/
|
|
32
|
+
menucloselabel?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Specify the language label for the LocalNav
|
|
36
|
+
*/
|
|
37
|
+
languagelabel?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Specify the language context menu for the LocalNav
|
|
41
|
+
*/
|
|
42
|
+
languagecontextmenu?: ContextMenuProps;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface PrimaryNavProps {
|
|
46
|
+
/**
|
|
47
|
+
* Specify the label for local nav
|
|
48
|
+
*/
|
|
49
|
+
navlabel?: Required<string>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Specify the close label for mobile local nav
|
|
53
|
+
*/
|
|
54
|
+
mobilecloselabel?: Required<string>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Specify the social links
|
|
58
|
+
*/
|
|
59
|
+
items?: Required<Array<LinkProps>>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { FC, useState } from "react";
|
|
2
|
+
import useGlobalSettings from "../../hooks/useGlobalSettings";
|
|
3
|
+
import { ContextMenu } from "../ContextMenu";
|
|
4
|
+
import { LocalNavProps } from "./LocalNav.props";
|
|
5
|
+
import { brand } from "@ilo-org/themes/tokens/brand/base.json";
|
|
6
|
+
import classnames from "classnames";
|
|
7
|
+
|
|
8
|
+
const LocalNav: FC<LocalNavProps> = ({
|
|
9
|
+
background,
|
|
10
|
+
logo,
|
|
11
|
+
siteurl,
|
|
12
|
+
primarynav,
|
|
13
|
+
mainlink,
|
|
14
|
+
menucloselabel,
|
|
15
|
+
languagelabel,
|
|
16
|
+
languagecontextmenu,
|
|
17
|
+
}) => {
|
|
18
|
+
const { prefix } = useGlobalSettings();
|
|
19
|
+
|
|
20
|
+
const [toggleMenuOpen, setMenuToggleOpen] = useState(false);
|
|
21
|
+
const [toggleLanguageOpen, setLanguageToggleOpen] = useState(false);
|
|
22
|
+
|
|
23
|
+
const baseClass = `${prefix}--header`;
|
|
24
|
+
const localNavClasses = classnames(baseClass, `${baseClass}--local`, {
|
|
25
|
+
[`${prefix}--mobile--open`]: toggleMenuOpen,
|
|
26
|
+
[`${prefix}--select--open`]: toggleLanguageOpen,
|
|
27
|
+
});
|
|
28
|
+
const bg = background ? background : brand["ilo-dark-blue"].value;
|
|
29
|
+
|
|
30
|
+
const handleMenuToggle = () => {
|
|
31
|
+
setMenuToggleOpen(!toggleMenuOpen);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleLanguageToggle = () => {
|
|
35
|
+
setLanguageToggleOpen(!toggleLanguageOpen);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<header className={localNavClasses}>
|
|
40
|
+
<div
|
|
41
|
+
className={`${baseClass}--utility-bar ${baseClass}--utility-bar--local`}
|
|
42
|
+
style={{ background: bg }}
|
|
43
|
+
>
|
|
44
|
+
<nav className={`${prefix}--nav--local`}>
|
|
45
|
+
<div className={`${prefix}--nav--local--logo-wrapper`}>
|
|
46
|
+
<a href={siteurl} className={`${prefix}--nav--local--logo-link`}>
|
|
47
|
+
<img
|
|
48
|
+
src={logo}
|
|
49
|
+
alt="ILO Logo"
|
|
50
|
+
className={`${prefix}--nav--local--logo`}
|
|
51
|
+
/>
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
<ul className={`${prefix}--nav--local--set`}>
|
|
55
|
+
{primarynav?.items &&
|
|
56
|
+
primarynav.items.map((item, index) => (
|
|
57
|
+
<li className={`${prefix}--nav--local--item`} key={index}>
|
|
58
|
+
<a href={item.url} className={`${prefix}--nav--local--link`}>
|
|
59
|
+
<span>{item.label}</span>
|
|
60
|
+
</a>
|
|
61
|
+
</li>
|
|
62
|
+
))}
|
|
63
|
+
</ul>
|
|
64
|
+
</nav>
|
|
65
|
+
<div className={`${prefix}--language-switcher`}>
|
|
66
|
+
<div className={`${prefix}--language-switcher--wrap`}>
|
|
67
|
+
{mainlink && (
|
|
68
|
+
<span className={`${prefix}--language-switcher--link--wrap`}>
|
|
69
|
+
<a
|
|
70
|
+
href={mainlink.url}
|
|
71
|
+
className={`${prefix}--language-switcher--link`}
|
|
72
|
+
>
|
|
73
|
+
{mainlink.label}
|
|
74
|
+
</a>
|
|
75
|
+
</span>
|
|
76
|
+
)}
|
|
77
|
+
<button
|
|
78
|
+
className={`${prefix}--language-switcher--button`}
|
|
79
|
+
type="button"
|
|
80
|
+
>
|
|
81
|
+
{languagelabel}
|
|
82
|
+
</button>
|
|
83
|
+
<ContextMenu links={languagecontextmenu?.links}></ContextMenu>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<button className={`${baseClass}--menu`} onClick={handleMenuToggle}>
|
|
87
|
+
Menu
|
|
88
|
+
</button>
|
|
89
|
+
<div className={`${baseClass}--navigation`}>
|
|
90
|
+
<div className={`${baseClass}--inner`}>
|
|
91
|
+
<div className={`${prefix}--mobile--nav`}>
|
|
92
|
+
<div className={`${prefix}--mobile--nav--logo`}>
|
|
93
|
+
<a href={siteurl} className={`${baseClass}--logo-link`}>
|
|
94
|
+
<img
|
|
95
|
+
className={`${baseClass}--logo`}
|
|
96
|
+
src={logo}
|
|
97
|
+
alt="ILO Logo"
|
|
98
|
+
/>
|
|
99
|
+
</a>
|
|
100
|
+
<button
|
|
101
|
+
className={`${baseClass}--menu--close`}
|
|
102
|
+
onClick={handleMenuToggle}
|
|
103
|
+
>
|
|
104
|
+
{menucloselabel}
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
<div className={`${prefix}--mobile--nav--language--switcher`}>
|
|
108
|
+
<button
|
|
109
|
+
className={`${prefix}--mobile--nav--language--switcher--button`}
|
|
110
|
+
onClick={handleLanguageToggle}
|
|
111
|
+
type="button"
|
|
112
|
+
>
|
|
113
|
+
{languagelabel}
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
<div className={`${prefix}--mobile--nav--language--select`}>
|
|
117
|
+
<div className={`${baseClass}--inner`}>
|
|
118
|
+
<div className={`${prefix}--mobile--subnav--menu`}>
|
|
119
|
+
<button
|
|
120
|
+
className={`${prefix}--mobile--subnav--back`}
|
|
121
|
+
onClick={handleLanguageToggle}
|
|
122
|
+
type="button"
|
|
123
|
+
></button>
|
|
124
|
+
<button
|
|
125
|
+
className={`${baseClass}--menu--close`}
|
|
126
|
+
onClick={handleMenuToggle}
|
|
127
|
+
>
|
|
128
|
+
Close
|
|
129
|
+
</button>
|
|
130
|
+
<h6 className={`${prefix}--mobile--subnav--label`}>
|
|
131
|
+
{languagelabel}
|
|
132
|
+
</h6>
|
|
133
|
+
</div>
|
|
134
|
+
<ul className={`${prefix}--nav--set`}>
|
|
135
|
+
{languagecontextmenu?.links &&
|
|
136
|
+
languagecontextmenu.links.map((item, index) => (
|
|
137
|
+
<li className={`${prefix}--nav--items`} key={index}>
|
|
138
|
+
<a
|
|
139
|
+
href={item.url}
|
|
140
|
+
className={`${prefix}--nav--link ${prefix}--nav--language`}
|
|
141
|
+
>
|
|
142
|
+
{item.label}
|
|
143
|
+
</a>
|
|
144
|
+
</li>
|
|
145
|
+
))}
|
|
146
|
+
</ul>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
<nav
|
|
151
|
+
className={`${prefix}--nav`}
|
|
152
|
+
aria-labelledby="primary-navigation"
|
|
153
|
+
>
|
|
154
|
+
<h2 className={`${prefix}--nav--label`} id="primary-navigation">
|
|
155
|
+
{primarynav?.navlabel}
|
|
156
|
+
</h2>
|
|
157
|
+
<ul className={`${prefix}--nav--set`}>
|
|
158
|
+
{primarynav?.items &&
|
|
159
|
+
primarynav.items.map((item, index) => (
|
|
160
|
+
<li className={`${prefix}--nav--items`} key={index}>
|
|
161
|
+
<a href={item.url} className={`${prefix}--nav--link`}>
|
|
162
|
+
{item.label}
|
|
163
|
+
</a>
|
|
164
|
+
</li>
|
|
165
|
+
))}
|
|
166
|
+
</ul>
|
|
167
|
+
</nav>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</header>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export default LocalNav;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LocalNav } from "./LocalNav";
|
package/src/components/index.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -48,3 +48,4 @@ export type NotificationTypes = "error" | "info" | "success" | "warning";
|
|
|
48
48
|
export type PositionTypes = "top" | "bottom" | "left" | "right";
|
|
49
49
|
export type SizeTypes = "small" | "medium" | "large";
|
|
50
50
|
export type TagTypes = "anchor" | "display" | "button";
|
|
51
|
+
export type SocialTypes = "instagram" | "facebook" | "twitter" | "youtube";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
4
|
-
|
|
5
|
-
function getDefaultExportFromCjs (x) {
|
|
6
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function getAugmentedNamespace(n) {
|
|
10
|
-
if (n.__esModule) return n;
|
|
11
|
-
var f = n.default;
|
|
12
|
-
if (typeof f == "function") {
|
|
13
|
-
var a = function a () {
|
|
14
|
-
if (this instanceof a) {
|
|
15
|
-
var args = [null];
|
|
16
|
-
args.push.apply(args, arguments);
|
|
17
|
-
var Ctor = Function.bind.apply(f, args);
|
|
18
|
-
return new Ctor();
|
|
19
|
-
}
|
|
20
|
-
return f.apply(this, arguments);
|
|
21
|
-
};
|
|
22
|
-
a.prototype = f.prototype;
|
|
23
|
-
} else a = {};
|
|
24
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
25
|
-
Object.keys(n).forEach(function (k) {
|
|
26
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
27
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return n[k];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
return a;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
exports.commonjsGlobal = commonjsGlobal;
|
|
38
|
-
exports.getAugmentedNamespace = getAugmentedNamespace;
|
|
39
|
-
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|