@veracity/vui 0.5.2 → 0.6.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/button/button.js +1 -1
- package/button/buttonIcon.js +15 -2
- package/button/buttonText.js +15 -2
- package/button/context.d.ts +2 -2
- package/button/context.js +3 -3
- package/buttonGroup/context.d.ts +2 -2
- package/buttonGroup/context.js +3 -3
- package/checkbox/checkbox.js +1 -1
- package/checkbox/context.d.ts +2 -2
- package/checkbox/context.js +3 -3
- package/core/links.d.ts +3 -2
- package/core/links.js +47 -41
- package/dialog/dialogBody.js +13 -1
- package/dialog/dialogCancelButton.js +14 -1
- package/dialog/dialogCloseButton.js +14 -1
- package/dialog/dialogFooter.js +2 -2
- package/dialog/dialogHeader.js +2 -2
- package/dialog/dialogIcon.js +14 -1
- package/dialog/dialogSubmitButton.js +14 -1
- package/dialog/dialogTitle.js +14 -1
- package/footer/footerColumn.js +3 -2
- package/footer/footerContent.js +14 -1
- package/footer/footerHeading.js +14 -1
- package/footer/footerLink.js +14 -1
- package/footer/footerRow.js +14 -1
- package/footer/footerSection.js +2 -2
- package/footer/footerTrademark.js +3 -2
- package/header/headerAccount.js +3 -3
- package/header/headerAccountUserInfo.js +4 -3
- package/header/headerContent.js +14 -1
- package/header/headerCreateAccount.js +3 -2
- package/header/headerDivider.js +14 -1
- package/header/headerLogo.js +3 -2
- package/header/headerMainLinks.js +3 -2
- package/header/headerMobileContent.js +13 -1
- package/header/headerMobileToggle.js +13 -1
- package/header/headerNotifications.js +3 -2
- package/header/headerServices.js +1 -1
- package/header/headerServicesMessage.js +3 -2
- package/header/headerSignIn.js +3 -2
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/input/context.d.ts +2 -2
- package/input/context.js +3 -3
- package/input/input.js +1 -1
- package/input/inputIcon.js +15 -2
- package/input/inputInput.js +14 -2
- package/link/context.d.ts +2 -2
- package/link/context.js +3 -3
- package/link/linkIcon.js +15 -2
- package/link/linkText.js +15 -2
- package/list/context.d.ts +2 -2
- package/list/context.js +3 -3
- package/list/listDivider.js +15 -2
- package/list/listHeading.js +15 -2
- package/list/listIcon.js +15 -2
- package/list/listItem.js +3 -3
- package/list/listText.js +15 -2
- package/menu/menuButton.js +15 -2
- package/menu/menuItem.js +2 -2
- package/menu/menuList.js +4 -3
- package/modal/modalBackdrop.js +13 -1
- package/modal/modalContent.js +13 -1
- package/notification/context.d.ts +2 -2
- package/notification/context.js +3 -3
- package/notification/notificationButton.js +16 -3
- package/notification/notificationIcon.js +16 -3
- package/notification/notificationText.js +15 -2
- package/notification/notificationTitle.js +15 -2
- package/package.json +1 -1
- package/pagination/context.d.ts +4 -0
- package/pagination/context.js +23 -0
- package/pagination/helpers.d.ts +3 -0
- package/pagination/helpers.js +56 -0
- package/pagination/index.d.ts +13 -0
- package/pagination/index.js +31 -0
- package/pagination/pagination.d.ts +21 -0
- package/pagination/pagination.js +70 -0
- package/pagination/pagination.types.d.ts +31 -0
- package/pagination/pagination.types.js +2 -0
- package/pagination/paginationButton.d.ts +4 -0
- package/pagination/paginationButton.js +51 -0
- package/pagination/paginationEllipsis.d.ts +4 -0
- package/pagination/paginationEllipsis.js +41 -0
- package/pagination/paginationGoToPage.d.ts +4 -0
- package/pagination/paginationGoToPage.js +53 -0
- package/pagination/paginationNavigation.d.ts +4 -0
- package/pagination/paginationNavigation.js +68 -0
- package/pagination/paginationPrevNext.d.ts +4 -0
- package/pagination/paginationPrevNext.js +49 -0
- package/pagination/paginationResults.d.ts +4 -0
- package/pagination/paginationResults.js +42 -0
- package/pagination/theme.d.ts +8 -0
- package/pagination/theme.js +14 -0
- package/pagination/usePagination.d.ts +14 -0
- package/pagination/usePagination.js +58 -0
- package/pagination/usePagination.types.d.ts +12 -0
- package/pagination/usePagination.types.js +2 -0
- package/popover/popoverContent.js +2 -2
- package/popover/popoverTrigger.js +3 -3
- package/radio/context.d.ts +2 -2
- package/radio/context.js +3 -3
- package/radio/radio.js +1 -1
- package/spinner/consts.d.ts +0 -12
- package/spinner/consts.js +4 -8
- package/spinner/spinner.js +2 -2
- package/switch/context.d.ts +2 -2
- package/switch/context.js +3 -3
- package/switch/switchButton.js +2 -2
- package/switch/switchLabel.js +15 -2
- package/tag/context.d.ts +2 -2
- package/tag/context.js +3 -3
- package/tag/tagButton.js +16 -3
- package/tag/tagIcon.js +15 -2
- package/tag/tagText.js +15 -2
- package/textarea/textarea.js +1 -1
- package/theme/components.d.ts +7 -0
- package/theme/components.js +20 -18
- package/theme/defaultTheme.d.ts +7 -0
- package/utils/react.d.ts +16 -2
- package/utils/react.js +41 -3
package/button/button.js
CHANGED
|
@@ -73,7 +73,7 @@ exports.ButtonBase = core_1.styled.buttonBox(templateObject_3 || (templateObject
|
|
|
73
73
|
*/
|
|
74
74
|
exports.Button = (0, core_1.vui)(function (props, ref) {
|
|
75
75
|
var _a, _b, _c, _d;
|
|
76
|
-
var buttonGroupProps = (0, context_1.
|
|
76
|
+
var buttonGroupProps = (0, context_1.useButtonGroupContext)();
|
|
77
77
|
var mergedProps = __assign(__assign({}, buttonGroupProps), props);
|
|
78
78
|
var borderWidthProp = mergedProps.borderWidth, children = mergedProps.children, className = mergedProps.className, colorSchemeProp = mergedProps.colorScheme, disabled = mergedProps.disabled, icon = mergedProps.icon, iconLeft = mergedProps.iconLeft, iconRight = mergedProps.iconRight, isElevated = mergedProps.isElevated, isFullWidth = mergedProps.isFullWidth, isLoading = mergedProps.isLoading, // eslint-disable-line
|
|
79
79
|
isRound = mergedProps.isRound, isSplit = mergedProps.isSplit, isTruncated = mergedProps.isTruncated, size = mergedProps.size, _e = mergedProps.state, state = _e === void 0 ? props.isLoading ? 'loading' : '' : _e, stateMapping = mergedProps.stateMapping, text = mergedProps.text, variant = mergedProps.variant, rest = __rest(mergedProps, ["borderWidth", "children", "className", "colorScheme", "disabled", "icon", "iconLeft", "iconRight", "isElevated", "isFullWidth", "isLoading", "isRound", "isSplit", "isTruncated", "size", "state", "stateMapping", "text", "variant"]);
|
package/button/buttonIcon.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,11 +29,13 @@ exports.ButtonIcon = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var core_1 = require("../core");
|
|
20
31
|
var icon_1 = __importDefault(require("../icon"));
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Displays an icon within the Button. */
|
|
23
35
|
exports.ButtonIcon = (0, core_1.vui)(function (props, ref) {
|
|
24
|
-
var
|
|
25
|
-
|
|
36
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
37
|
+
var styles = (0, core_1.useStyleConfig)('Button', (0, context_1.useButtonContext)());
|
|
38
|
+
return react_1.default.createElement(icon_1.default, __assign({ className: (0, utils_1.cs)('vui-buttonIcon', className), ref: ref }, styles.icon, rest));
|
|
26
39
|
});
|
|
27
40
|
exports.ButtonIcon.displayName = 'ButtonIcon';
|
|
28
41
|
exports.default = exports.ButtonIcon;
|
package/button/buttonText.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,11 +29,13 @@ exports.ButtonText = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var core_1 = require("../core");
|
|
20
31
|
var t_1 = __importDefault(require("../t"));
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Displays the text label of the button. */
|
|
23
35
|
exports.ButtonText = (0, core_1.vui)(function (props, ref) {
|
|
24
|
-
var
|
|
25
|
-
|
|
36
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
37
|
+
var styles = (0, core_1.useStyleConfig)('Button', (0, context_1.useButtonContext)());
|
|
38
|
+
return react_1.default.createElement(t_1.default, __assign({ className: (0, utils_1.cs)('vui-buttonText', className), fontSize: "inherit", ref: ref }, styles.text, rest));
|
|
26
39
|
});
|
|
27
40
|
exports.ButtonText.displayName = 'ButtonText';
|
|
28
41
|
exports.default = exports.ButtonText;
|
package/button/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Dict } from '../utils';
|
|
3
|
-
declare const ButtonProvider: import("react").Provider<Dict<any>>,
|
|
4
|
-
export { ButtonProvider,
|
|
3
|
+
declare const ButtonProvider: import("react").Provider<Dict<any>>, useButtonContext: () => Dict<any>;
|
|
4
|
+
export { ButtonProvider, useButtonContext };
|
package/button/context.js
CHANGED
|
@@ -16,8 +16,8 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.useButtonContext = exports.ButtonProvider = void 0;
|
|
20
20
|
var utils_1 = require("../utils");
|
|
21
|
-
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), ButtonProvider = _a[0],
|
|
21
|
+
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), ButtonProvider = _a[0], useButtonContext = _a[1];
|
|
22
22
|
exports.ButtonProvider = ButtonProvider;
|
|
23
|
-
exports.
|
|
23
|
+
exports.useButtonContext = useButtonContext;
|
package/buttonGroup/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Dict } from '../utils';
|
|
3
|
-
declare const ButtonGroupProvider: import("react").Provider<Dict<any>>,
|
|
4
|
-
export { ButtonGroupProvider,
|
|
3
|
+
declare const ButtonGroupProvider: import("react").Provider<Dict<any>>, useButtonGroupContext: () => Dict<any>;
|
|
4
|
+
export { ButtonGroupProvider, useButtonGroupContext };
|
package/buttonGroup/context.js
CHANGED
|
@@ -16,8 +16,8 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.useButtonGroupContext = exports.ButtonGroupProvider = void 0;
|
|
20
20
|
var utils_1 = require("../utils");
|
|
21
|
-
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), ButtonGroupProvider = _a[0],
|
|
21
|
+
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), ButtonGroupProvider = _a[0], useButtonGroupContext = _a[1];
|
|
22
22
|
exports.ButtonGroupProvider = ButtonGroupProvider;
|
|
23
|
-
exports.
|
|
23
|
+
exports.useButtonGroupContext = useButtonGroupContext;
|
package/checkbox/checkbox.js
CHANGED
|
@@ -85,7 +85,7 @@ exports.CheckboxBase = core_1.styled.labelBox(templateObject_3 || (templateObjec
|
|
|
85
85
|
*/
|
|
86
86
|
exports.Checkbox = (0, core_1.vui)(function (props, ref) {
|
|
87
87
|
var _a;
|
|
88
|
-
var _b = (_a = (0, context_1.
|
|
88
|
+
var _b = (_a = (0, context_1.useCheckboxGroupContext)()) !== null && _a !== void 0 ? _a : {}, groupDefaultValue = _b.defaultValue, checkboxGroupProps = __rest(_b, ["defaultValue"]);
|
|
89
89
|
var mergedProps = __assign(__assign({}, checkboxGroupProps), props);
|
|
90
90
|
var _c = (0, core_1.omitThemingProps)(mergedProps), checked = _c.checked, children = _c.children, className = _c.className, _d = _c.defaultChecked, defaultChecked = _d === void 0 ? groupDefaultValue !== undefined ? groupDefaultValue.includes(props.value) : undefined : _d, disabled = _c.disabled, _e = _c.icon, iconProp = _e === void 0 ? 'cuiCheckboxUnselected' : _e, _f = _c.iconChecked, iconChecked = _f === void 0 ? 'cuiCheckboxSelected' : _f, _g = _c.iconIndeterminate, iconIndeterminate = _g === void 0 ? 'cuiCheckboxIndeterminate' : _g, id = _c.id, inputProps = _c.inputProps, inputRef = _c.inputRef, isIndeterminate = _c.isIndeterminate, label = _c.label, name = _c.name, onChange = _c.onChange, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "iconIndeterminate", "id", "inputProps", "inputRef", "isIndeterminate", "label", "name", "onChange", "required", "value"]);
|
|
91
91
|
var _h = __read((0, react_1.useState)(defaultChecked), 2), isChecked = _h[0], setIsChecked = _h[1];
|
package/checkbox/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Dict } from '../utils';
|
|
3
|
-
declare const CheckboxGroupProvider: import("react").Provider<Dict<any>>,
|
|
4
|
-
export { CheckboxGroupProvider,
|
|
3
|
+
declare const CheckboxGroupProvider: import("react").Provider<Dict<any>>, useCheckboxGroupContext: () => Dict<any>;
|
|
4
|
+
export { CheckboxGroupProvider, useCheckboxGroupContext };
|
package/checkbox/context.js
CHANGED
|
@@ -16,8 +16,8 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.useCheckboxGroupContext = exports.CheckboxGroupProvider = void 0;
|
|
20
20
|
var utils_1 = require("../utils");
|
|
21
|
-
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), CheckboxGroupProvider = _a[0],
|
|
21
|
+
var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), CheckboxGroupProvider = _a[0], useCheckboxGroupContext = _a[1];
|
|
22
22
|
exports.CheckboxGroupProvider = CheckboxGroupProvider;
|
|
23
|
-
exports.
|
|
23
|
+
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
package/core/links.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Dict, Environment } from '../utils';
|
|
|
3
3
|
export declare type LinksDict = Dict<string>;
|
|
4
4
|
declare type LinksContextType = [LinksDict, Dispatch<SetStateAction<LinksDict>>];
|
|
5
5
|
/**
|
|
6
|
-
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
6
|
+
* Adds loggedIn=1 parameter to the URL if 'isLoggedIn' flag is true, which means the user is logged in.
|
|
7
|
+
* If 'isLoggedIn' is falsy, loggedin param will be removed.
|
|
7
8
|
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
8
9
|
*/
|
|
9
10
|
export declare function getLoggedInLink(link: string, isLoggedIn?: boolean): string;
|
|
@@ -14,7 +15,7 @@ export declare function LinksProvider(props: {
|
|
|
14
15
|
export declare function useLinks(): LinksContextType;
|
|
15
16
|
/**
|
|
16
17
|
* Retrieves the links from CDN for the given environment and appends them with loggedin=1 parameter
|
|
17
|
-
* if user is logged in. Links will be reloaded
|
|
18
|
+
* if user is logged in. Links will be reloaded when 'env' changes or updated when 'isLoggedIn' changes.
|
|
18
19
|
*/
|
|
19
20
|
export declare function useLoadLinks(env?: Environment, isLoggedIn?: boolean): void;
|
|
20
21
|
export {};
|
package/core/links.js
CHANGED
|
@@ -88,14 +88,19 @@ var utils_1 = require("../utils");
|
|
|
88
88
|
var consts_1 = require("./consts");
|
|
89
89
|
var LinksContext = (0, react_1.createContext)(undefined);
|
|
90
90
|
/**
|
|
91
|
-
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
91
|
+
* Adds loggedIn=1 parameter to the URL if 'isLoggedIn' flag is true, which means the user is logged in.
|
|
92
|
+
* If 'isLoggedIn' is falsy, loggedin param will be removed.
|
|
92
93
|
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
93
94
|
*/
|
|
94
95
|
function getLoggedInLink(link, isLoggedIn) {
|
|
95
96
|
try {
|
|
96
97
|
var url = new URL(link);
|
|
97
|
-
if (isLoggedIn)
|
|
98
|
+
if (isLoggedIn) {
|
|
98
99
|
url.searchParams.append('loggedin', '1');
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
url.searchParams.delete('loggedin');
|
|
103
|
+
}
|
|
99
104
|
return url.toString();
|
|
100
105
|
}
|
|
101
106
|
catch (_a) {
|
|
@@ -120,54 +125,55 @@ function useLinks() {
|
|
|
120
125
|
exports.useLinks = useLinks;
|
|
121
126
|
/**
|
|
122
127
|
* Retrieves the links from CDN for the given environment and appends them with loggedin=1 parameter
|
|
123
|
-
* if user is logged in. Links will be reloaded
|
|
128
|
+
* if user is logged in. Links will be reloaded when 'env' changes or updated when 'isLoggedIn' changes.
|
|
124
129
|
*/
|
|
125
130
|
function useLoadLinks(env, isLoggedIn) {
|
|
131
|
+
var _this = this;
|
|
126
132
|
var _a = __read(useLinks(), 2), setLinks = _a[1];
|
|
133
|
+
// Load links from the CDN for the given environment.
|
|
134
|
+
var loadLinks = function (env) { return __awaiter(_this, void 0, void 0, function () {
|
|
135
|
+
var response, data, _a;
|
|
136
|
+
return __generator(this, function (_b) {
|
|
137
|
+
switch (_b.label) {
|
|
138
|
+
case 0:
|
|
139
|
+
_b.trys.push([0, 3, , 4]);
|
|
140
|
+
return [4 /*yield*/, fetch(consts_1.cdnUrls[env] + "/common/data/links/base.json")];
|
|
141
|
+
case 1:
|
|
142
|
+
response = _b.sent();
|
|
143
|
+
if (!response.ok)
|
|
144
|
+
return [2 /*return*/];
|
|
145
|
+
return [4 /*yield*/, response.json()];
|
|
146
|
+
case 2:
|
|
147
|
+
data = _b.sent();
|
|
148
|
+
if ((0, utils_1.isObject)(data)) {
|
|
149
|
+
setLinks(updateLoggedInParam(data));
|
|
150
|
+
}
|
|
151
|
+
return [3 /*break*/, 4];
|
|
152
|
+
case 3:
|
|
153
|
+
_a = _b.sent();
|
|
154
|
+
console.error('Failed to retrieve links');
|
|
155
|
+
return [3 /*break*/, 4];
|
|
156
|
+
case 4: return [2 /*return*/];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}); };
|
|
160
|
+
/**
|
|
161
|
+
* Adds/removes loggedin=1 URL param for each link based on isLoggedIn arg.
|
|
162
|
+
* useCallbackRef is used here to prevent a stale closure in async loadLinks.
|
|
163
|
+
*/
|
|
164
|
+
var updateLoggedInParam = (0, utils_1.useCallbackRef)(function (links) {
|
|
165
|
+
return Object.keys(links).reduce(function (loggedInLinks, key) {
|
|
166
|
+
loggedInLinks[key] = getLoggedInLink(links[key], isLoggedIn);
|
|
167
|
+
return loggedInLinks;
|
|
168
|
+
}, {});
|
|
169
|
+
});
|
|
127
170
|
(0, react_1.useEffect)(function () {
|
|
128
171
|
if (!env)
|
|
129
172
|
return;
|
|
130
173
|
loadLinks(env);
|
|
131
174
|
}, [env]);
|
|
132
175
|
(0, react_1.useEffect)(function () {
|
|
133
|
-
|
|
176
|
+
setLinks(updateLoggedInParam);
|
|
134
177
|
}, [isLoggedIn]);
|
|
135
|
-
// Adds loggedin=1 param to each link if user is logged in.
|
|
136
|
-
function appendLoggedInParam(isLoggedIn) {
|
|
137
|
-
setLinks(function (state) {
|
|
138
|
-
return Object.keys(state).reduce(function (links, key) {
|
|
139
|
-
links[key] = getLoggedInLink(state[key], isLoggedIn);
|
|
140
|
-
return links;
|
|
141
|
-
}, {});
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
// Load links from the CDN for the given environment.
|
|
145
|
-
function loadLinks(env) {
|
|
146
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
147
|
-
var response, data, _a;
|
|
148
|
-
return __generator(this, function (_b) {
|
|
149
|
-
switch (_b.label) {
|
|
150
|
-
case 0:
|
|
151
|
-
_b.trys.push([0, 3, , 4]);
|
|
152
|
-
return [4 /*yield*/, fetch(consts_1.cdnUrls[env] + "/common/data/links/base.json")];
|
|
153
|
-
case 1:
|
|
154
|
-
response = _b.sent();
|
|
155
|
-
if (!response.ok)
|
|
156
|
-
return [2 /*return*/];
|
|
157
|
-
return [4 /*yield*/, response.json()];
|
|
158
|
-
case 2:
|
|
159
|
-
data = _b.sent();
|
|
160
|
-
if ((0, utils_1.isObject)(data))
|
|
161
|
-
setLinks(data);
|
|
162
|
-
return [3 /*break*/, 4];
|
|
163
|
-
case 3:
|
|
164
|
-
_a = _b.sent();
|
|
165
|
-
console.error('Failed to retrieve links');
|
|
166
|
-
return [3 /*break*/, 4];
|
|
167
|
-
case 4: return [2 /*return*/];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
178
|
}
|
|
173
179
|
exports.useLoadLinks = useLoadLinks;
|
package/dialog/dialogBody.js
CHANGED
|
@@ -29,6 +29,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
29
29
|
__setModuleDefault(result, mod);
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
32
43
|
var __read = (this && this.__read) || function (o, n) {
|
|
33
44
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
34
45
|
if (!m) return o;
|
|
@@ -60,6 +71,7 @@ var context_1 = require("./context");
|
|
|
60
71
|
*/
|
|
61
72
|
exports.DialogBody = (0, core_1.vui)(function (props, ref) {
|
|
62
73
|
var _a;
|
|
74
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
63
75
|
var _b = (_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}, bodyId = _b.bodyId, icon = _b.icon, status = _b.status;
|
|
64
76
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
65
77
|
var _c = __read((0, react_1.useState)(false), 2), isScrolled = _c[0], setIsScrolled = _c[1];
|
|
@@ -79,7 +91,7 @@ exports.DialogBody = (0, core_1.vui)(function (props, ref) {
|
|
|
79
91
|
var borderProps = isScrolled ? { borderColor: 'grey.30' } : {};
|
|
80
92
|
// Add more body padding when custom or status icon is displayed
|
|
81
93
|
var paddingProps = (icon !== null && icon !== void 0 ? icon : status) !== undefined ? { px: 8 } : { px: 3 };
|
|
82
|
-
return (react_1.default.createElement(box_1.Box, __assign({ borderBottom: "1px solid transparent", borderTop: "1px solid transparent", className:
|
|
94
|
+
return (react_1.default.createElement(box_1.Box, __assign({ borderBottom: "1px solid transparent", borderTop: "1px solid transparent", className: (0, utils_1.cs)('vui-dialogBody', className), column: true, id: bodyId, overflowY: "auto", pb: 2, pt: 1.5, ref: (0, utils_1.mergeRefs)(ref, bodyRef) }, borderProps, paddingProps, styles.body, rest)));
|
|
83
95
|
});
|
|
84
96
|
exports.DialogBody.displayName = 'DialogBody';
|
|
85
97
|
exports.default = exports.DialogBody;
|
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,13 +29,15 @@ exports.DialogCancelButton = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var button_1 = require("../button");
|
|
20
31
|
var core_1 = require("../core");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Shows an outlined Button in the Dialog Footer, which by default closes the Dialog. */
|
|
23
35
|
exports.DialogCancelButton = (0, core_1.vui)(function (props, ref) {
|
|
24
36
|
var _a;
|
|
37
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
25
38
|
var onClose = ((_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}).onClose;
|
|
26
39
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
27
|
-
return (react_1.default.createElement(button_1.LineButton, __assign({ className:
|
|
40
|
+
return (react_1.default.createElement(button_1.LineButton, __assign({ className: (0, utils_1.cs)('vui-dialogCancelButton', className), onClick: onClose, ref: ref }, styles.cancelButton, rest)));
|
|
28
41
|
});
|
|
29
42
|
exports.DialogCancelButton.displayName = 'DialogCancelButton';
|
|
30
43
|
exports.default = exports.DialogCancelButton;
|
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,13 +29,15 @@ exports.DialogCloseButton = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var button_1 = require("../button");
|
|
20
31
|
var core_1 = require("../core");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Shows a CloseButton in the Dialog Header, which by default closes the Dialog. */
|
|
23
35
|
exports.DialogCloseButton = (0, core_1.vui)(function (props, ref) {
|
|
24
36
|
var _a;
|
|
37
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
25
38
|
var onClose = ((_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}).onClose;
|
|
26
39
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
27
|
-
return (react_1.default.createElement(button_1.CloseButton, __assign({ activeBg: "grey.30", className:
|
|
40
|
+
return (react_1.default.createElement(button_1.CloseButton, __assign({ activeBg: "grey.30", className: (0, utils_1.cs)('vui-dialogCloseButton', className), color: "grey.80", hoverBg: "grey.20", onClick: onClose, position: "absolute", ref: ref, right: 16, size: "sm", top: 16 }, styles.closeButton, rest)));
|
|
28
41
|
});
|
|
29
42
|
exports.DialogCloseButton.displayName = 'DialogCloseButton';
|
|
30
43
|
exports.default = exports.DialogCloseButton;
|
package/dialog/dialogFooter.js
CHANGED
|
@@ -35,9 +35,9 @@ var dialogCancelButton_1 = __importDefault(require("./dialogCancelButton"));
|
|
|
35
35
|
var dialogSubmitButton_1 = __importDefault(require("./dialogSubmitButton"));
|
|
36
36
|
/** Shows control buttons below the Dialog Body. By default includes cancel and submit buttons. */
|
|
37
37
|
exports.DialogFooter = (0, core_1.vui)(function (props, ref) {
|
|
38
|
-
var cancelButton = props.cancelButton, children = props.children, submitButton = props.submitButton, rest = __rest(props, ["cancelButton", "children", "submitButton"]);
|
|
38
|
+
var cancelButton = props.cancelButton, children = props.children, className = props.className, submitButton = props.submitButton, rest = __rest(props, ["cancelButton", "children", "className", "submitButton"]);
|
|
39
39
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
40
|
-
return (react_1.default.createElement(box_1.Box, __assign({ className:
|
|
40
|
+
return (react_1.default.createElement(box_1.Box, __assign({ className: (0, utils_1.cs)('vui-dialogFooter', className), justifyContent: "flex-end", p: 3, pt: 2, ref: ref }, styles.footer, rest), children !== null && children !== void 0 ? children : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
41
|
(0, utils_1.isJsx)(cancelButton) ? cancelButton : cancelButton && react_1.default.createElement(dialogCancelButton_1.default, __assign({}, cancelButton)),
|
|
42
42
|
(0, utils_1.isJsx)(submitButton) ? submitButton : submitButton && react_1.default.createElement(dialogSubmitButton_1.default, __assign({}, submitButton))))));
|
|
43
43
|
});
|
package/dialog/dialogHeader.js
CHANGED
|
@@ -37,14 +37,14 @@ var dialogTitle_1 = __importDefault(require("./dialogTitle"));
|
|
|
37
37
|
/** Shows title, status icon and close button above the Dialog Body. */
|
|
38
38
|
exports.DialogHeader = (0, core_1.vui)(function (props, ref) {
|
|
39
39
|
var _a;
|
|
40
|
-
var children = props.children, closeButton = props.closeButton, iconProp = props.icon, titleProp = props.title, rest = __rest(props, ["children", "closeButton", "icon", "title"]);
|
|
40
|
+
var children = props.children, className = props.className, closeButton = props.closeButton, iconProp = props.icon, titleProp = props.title, rest = __rest(props, ["children", "className", "closeButton", "icon", "title"]);
|
|
41
41
|
var _b = (_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}, onClose = _b.onClose, status = _b.status;
|
|
42
42
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
43
43
|
var icon = (0, utils_1.isString)(iconProp) ? { name: iconProp } : iconProp;
|
|
44
44
|
var showCloseButton = Boolean(closeButton !== undefined ? closeButton : onClose);
|
|
45
45
|
var showIcon = Boolean(icon || status);
|
|
46
46
|
var title = (0, utils_1.isReactText)(titleProp) ? { text: titleProp } : titleProp;
|
|
47
|
-
return (react_1.default.createElement(box_1.Box, __assign({ className:
|
|
47
|
+
return (react_1.default.createElement(box_1.Box, __assign({ className: (0, utils_1.cs)('vui-dialogHeader', className), icon: icon, pb: 1.5, pl: 3, position: "relative", pr: 8, pt: 3, ref: ref }, styles.header, rest), children !== null && children !== void 0 ? children : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
48
48
|
(0, utils_1.isJsx)(icon) ? icon : showIcon && react_1.default.createElement(dialogIcon_1.default, __assign({}, icon)),
|
|
49
49
|
(0, utils_1.isJsx)(title) ? title : title && react_1.default.createElement(dialogTitle_1.default, __assign({}, title)),
|
|
50
50
|
(0, utils_1.isJsx)(closeButton) ? closeButton : showCloseButton && react_1.default.createElement(dialogCloseButton_1.default, null)))));
|
package/dialog/dialogIcon.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,15 +29,17 @@ exports.DialogIcon = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var core_1 = require("../core");
|
|
20
31
|
var icon_1 = require("../icon");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var consts_1 = require("./consts");
|
|
22
34
|
var context_1 = require("./context");
|
|
23
35
|
/** Shows an icon based on a given status. Optionally, can be a custom icon. */
|
|
24
36
|
exports.DialogIcon = (0, core_1.vui)(function (props, ref) {
|
|
25
37
|
var _a, _b;
|
|
38
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
26
39
|
var _c = ((_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}).status, status = _c === void 0 ? '' : _c;
|
|
27
40
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
28
41
|
var iconProps = ((_b = consts_1.dialogStatusMapping[status]) !== null && _b !== void 0 ? _b : {}).iconProps;
|
|
29
|
-
return react_1.default.createElement(icon_1.Icon, __assign({ className:
|
|
42
|
+
return react_1.default.createElement(icon_1.Icon, __assign({ className: (0, utils_1.cs)('vui-dialogIcon', className), mr: 2, ref: ref }, styles.icon, iconProps, rest));
|
|
30
43
|
});
|
|
31
44
|
exports.DialogIcon.displayName = 'DialogIcon';
|
|
32
45
|
exports.default = exports.DialogIcon;
|
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,11 +29,13 @@ exports.DialogSubmitButton = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var button_1 = require("../button");
|
|
20
31
|
var core_1 = require("../core");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Shows a button in the Dialog Footer, which triggers the main action of the Dialog. */
|
|
23
35
|
exports.DialogSubmitButton = (0, core_1.vui)(function (props, ref) {
|
|
36
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
24
37
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
25
|
-
return (react_1.default.createElement(button_1.Button, __assign({ className:
|
|
38
|
+
return (react_1.default.createElement(button_1.Button, __assign({ className: (0, utils_1.cs)('vui-dialogSubmitButton', className), ml: 2, ref: ref, text: "Submit" }, styles.submitButton, rest)));
|
|
26
39
|
});
|
|
27
40
|
exports.DialogSubmitButton.displayName = 'DialogSubmitButton';
|
|
28
41
|
exports.default = exports.DialogSubmitButton;
|
package/dialog/dialogTitle.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,13 +29,15 @@ exports.DialogTitle = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var core_1 = require("../core");
|
|
20
31
|
var heading_1 = require("../heading");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Shows a title in the Dialog Header. Receives id linked to aria-labelledby on the Dialog for accessibility. */
|
|
23
35
|
exports.DialogTitle = (0, core_1.vui)(function (props, ref) {
|
|
24
36
|
var _a;
|
|
37
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
25
38
|
var titleId = ((_a = (0, context_1.useDialogContext)()) !== null && _a !== void 0 ? _a : {}).titleId;
|
|
26
39
|
var styles = (0, core_1.useStyleConfig)('Dialog', (0, context_1.useDialogContext)());
|
|
27
|
-
return react_1.default.createElement(heading_1.H4, __assign({ className:
|
|
40
|
+
return react_1.default.createElement(heading_1.H4, __assign({ className: (0, utils_1.cs)('vui-dialogTitle', className), id: titleId, ref: ref }, styles.title, rest));
|
|
28
41
|
});
|
|
29
42
|
exports.DialogTitle.displayName = 'DialogTitle';
|
|
30
43
|
exports.default = exports.DialogTitle;
|
package/footer/footerColumn.js
CHANGED
|
@@ -28,12 +28,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
var react_1 = __importDefault(require("react"));
|
|
29
29
|
var box_1 = __importDefault(require("../box"));
|
|
30
30
|
var core_1 = require("../core");
|
|
31
|
+
var utils_1 = require("../utils");
|
|
31
32
|
var context_1 = require("./context");
|
|
32
33
|
var footerSection_1 = __importDefault(require("./footerSection"));
|
|
33
34
|
/** Organizes sections with links into a single column. Different width per breakpoint. */
|
|
34
35
|
var FooterColumn = (0, core_1.vui)(function (props, ref) {
|
|
35
|
-
var children = props.children, sections = props.sections, rest = __rest(props, ["children", "sections"]);
|
|
36
|
+
var children = props.children, className = props.className, sections = props.sections, rest = __rest(props, ["children", "className", "sections"]);
|
|
36
37
|
var styles = (0, core_1.useStyleConfig)('Footer', (0, context_1.useFooterContext)());
|
|
37
|
-
return (react_1.default.createElement(box_1.default, __assign({ className:
|
|
38
|
+
return (react_1.default.createElement(box_1.default, __assign({ className: (0, utils_1.cs)('vui-footerColumn', className), column: true, flex: { xs: '0 0 100%', sm: '0 0 50%', md: '0 0 25%' }, p: 1.5, ref: ref, spaceY: 4 }, styles.column, rest), children !== null && children !== void 0 ? children : sections === null || sections === void 0 ? void 0 : sections.map(function (section, index) { return react_1.default.createElement(footerSection_1.default, __assign({ key: index }, section)); })));
|
|
38
39
|
});
|
|
39
40
|
exports.default = FooterColumn;
|
package/footer/footerContent.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,11 +29,13 @@ exports.FooterContent = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var box_1 = __importDefault(require("../box"));
|
|
20
31
|
var core_1 = require("../core");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Controls max-width of the content and centers itself horizontally. */
|
|
23
35
|
exports.FooterContent = (0, core_1.vui)(function (props, ref) {
|
|
36
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
24
37
|
var styles = (0, core_1.useStyleConfig)('Footer', (0, context_1.useFooterContext)());
|
|
25
|
-
return (react_1.default.createElement(box_1.default, __assign({ className:
|
|
38
|
+
return (react_1.default.createElement(box_1.default, __assign({ className: (0, utils_1.cs)('vui-footerContent', className), column: true, maxW: 1200, mx: "auto", ref: ref, w: "100%" }, styles.content, rest)));
|
|
26
39
|
});
|
|
27
40
|
exports.FooterContent.displayName = 'FooterContent';
|
|
28
41
|
exports.default = exports.FooterContent;
|
package/footer/footerHeading.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
26
|
};
|
|
@@ -18,11 +29,13 @@ exports.FooterHeading = void 0;
|
|
|
18
29
|
var react_1 = __importDefault(require("react"));
|
|
19
30
|
var core_1 = require("../core");
|
|
20
31
|
var heading_1 = __importDefault(require("../heading"));
|
|
32
|
+
var utils_1 = require("../utils");
|
|
21
33
|
var context_1 = require("./context");
|
|
22
34
|
/** Heading of a links section. */
|
|
23
35
|
exports.FooterHeading = (0, core_1.vui)(function (props, ref) {
|
|
36
|
+
var className = props.className, rest = __rest(props, ["className"]);
|
|
24
37
|
var styles = (0, core_1.useStyleConfig)('Footer', (0, context_1.useFooterContext)());
|
|
25
|
-
return react_1.default.createElement(heading_1.default, __assign({ className:
|
|
38
|
+
return (react_1.default.createElement(heading_1.default, __assign({ className: (0, utils_1.cs)('vui-footerHeading', className), mb: 1, ref: ref, size: "h5" }, styles.heading, rest)));
|
|
26
39
|
});
|
|
27
40
|
exports.FooterHeading.displayName = 'FooterHeading';
|
|
28
41
|
exports.default = exports.FooterHeading;
|