@momentum-ui/react-collaboration
Version:
Cisco Momentum UI Framework for React Collaboration Applications
61 lines • 3.66 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import React from 'react';
import classNames from 'classnames';
// TODO: we should not use core colors, only theme colors - to be removed:
import '@momentum-design/tokens/dist/css/core/complete.css';
import '@momentum-design/tokens/dist/css/elevation/complete.css';
import '@momentum-design/tokens/dist/css/effect/complete.css';
// import Momentum fonts and typography defaults:
import '@momentum-design/fonts/dist/css/fonts.css';
import '@momentum-design/tokens/dist/css/typography/complete.css';
// import Momentum theme tokens:
import '@momentum-design/tokens/dist/css/theme/webex/dark-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/dark-bronze-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/dark-indigo-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/dark-jade-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/dark-lavender-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/dark-rose-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-bronze-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-indigo-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-jade-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-lavender-stable.css';
import '@momentum-design/tokens/dist/css/theme/webex/light-rose-stable.css';
import { ThemeProvider as MdcThemeProvider, IconProvider as MdcIconProvider, IllustrationProvider as MdcIllustrationProvider, } from '@momentum-design/components/dist/react';
import { DEFAULTS, STYLE, THEME_CLASS_PREFIX_STABLE } from './ThemeProvider.constants';
import './ThemeProvider.style.scss';
/**
* Provides a collection of CSSVariables based on a ThemeToken to all child elements inside of a rendered `<div />` element.
* @deprecated Use the equivalent from momentum.design (NPM: `@momentum-design/components/dist/react`)
*/
var ThemeProvider = function (_a) {
var children = _a.children, id = _a.id, style = _a.style, theme = _a.theme, restProps = __rest(_a, ["children", "id", "style", "theme"]);
var themeClassStable = "".concat(THEME_CLASS_PREFIX_STABLE, "-").concat(theme || DEFAULTS.THEME);
return (React.createElement(MdcThemeProvider, __assign({ themeclass: themeClassStable, className: classNames(STYLE.typography, STYLE.elevation, STYLE.effect) }, restProps),
React.createElement(MdcIllustrationProvider, null,
React.createElement(MdcIconProvider, null,
React.createElement("div", { className: "".concat(STYLE.wrapper, " ").concat(STYLE.globals), style: style, id: id }, children)))));
};
export default ThemeProvider;
//# sourceMappingURL=ThemeProvider.js.map