@wso2/oxygen-ui 0.0.1-alpha.10 → 0.0.1-alpha.11

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.
Files changed (29) hide show
  1. package/README.md +134 -2
  2. package/dist/components/ComplexSelect/ComplexSelect.d.ts +17 -0
  3. package/dist/components/ComplexSelect/ComplexSelectDivider.d.ts +5 -0
  4. package/dist/components/ComplexSelect/ComplexSelectListHeader.d.ts +7 -0
  5. package/dist/components/ComplexSelect/ComplexSelectMenuItem.d.ts +16 -0
  6. package/dist/components/ComplexSelect/ComplexSelectMenuItemAvatar.d.ts +7 -0
  7. package/dist/components/ComplexSelect/ComplexSelectMenuItemIcon.d.ts +7 -0
  8. package/dist/components/ComplexSelect/ComplexSelectMenuItemText.d.ts +8 -0
  9. package/dist/components/ComplexSelect/index.d.ts +21 -0
  10. package/dist/components/ThemeSwitcher/ThemeSelect.d.ts +37 -0
  11. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +65 -0
  12. package/dist/components/ThemeSwitcher/index.d.ts +4 -0
  13. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.d.ts +58 -3
  14. package/dist/index.d.ts +7 -1
  15. package/dist/index.js +333 -82
  16. package/dist/index.js.map +4 -4
  17. package/dist/styles/OxygenTheme/OxygenTheme.d.ts +1 -20
  18. package/dist/styles/OxygenTheme/OxygenThemeWithRadialBackground.d.ts +17 -0
  19. package/dist/utils/index.d.ts +18 -0
  20. package/dist/utils/pxToRem.d.ts +23 -0
  21. package/package.json +1 -1
  22. package/dist/components/ColorSchemeImage/ColorSchemeImage.js +0 -57
  23. package/dist/components/ColorSchemeImage/ColorSchemeImage.js.map +0 -7
  24. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js +0 -76
  25. package/dist/components/ColorSchemeToggle/ColorSchemeToggle.js.map +0 -7
  26. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js +0 -378
  27. package/dist/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.js.map +0 -7
  28. package/dist/styles/OxygenTheme/OxygenTheme.js +0 -356
  29. package/dist/styles/OxygenTheme/OxygenTheme.js.map +0 -7
@@ -15,24 +15,5 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { Theme } from '@mui/material/styles';
19
- export declare const RadialBodyBackgroundDesign: {
20
- components: {
21
- MuiCssBaseline: {
22
- styleOverrides: {
23
- "html[data-color-scheme='dark'] body": {
24
- backgroundAttachment: string;
25
- backgroundImage: string;
26
- backgroundBlendMode: string;
27
- };
28
- "html[data-color-scheme='light'] body": {
29
- backgroundAttachment: string;
30
- backgroundImage: string;
31
- backgroundBlendMode: string;
32
- };
33
- };
34
- };
35
- };
36
- };
37
- declare const OxygenTheme: Theme;
18
+ declare const OxygenTheme: Omit<import("@mui/material/styles").Theme, "applyStyles"> & import("@mui/material/styles").CssVarsTheme;
38
19
  export default OxygenTheme;
@@ -0,0 +1,17 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ /**
3
+ * Oxygen Theme with Radial Background Design
4
+ * This theme extends the base OxygenTheme and adds radial gradient backgrounds
5
+ * that respond to light/dark color schemes.
6
+ *
7
+ * Usage:
8
+ * ```tsx
9
+ * import { OxygenUIThemeProvider, OxygenThemeWithRadialBackground } from '@wso2/oxygen-ui';
10
+ *
11
+ * <OxygenUIThemeProvider theme={OxygenThemeWithRadialBackground}>
12
+ * <App />
13
+ * </OxygenUIThemeProvider>
14
+ * ```
15
+ */
16
+ declare const OxygenThemeWithRadialBackground: Theme;
17
+ export default OxygenThemeWithRadialBackground;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ export { pxToRem } from './pxToRem';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ /**
19
+ * Helper function to convert px to rem based on base font size (14px)
20
+ * @param size - The size in pixels
21
+ * @returns The size in rem units
22
+ */
23
+ export declare const pxToRem: (size: number) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wso2/oxygen-ui",
3
- "version": "0.0.1-alpha.10",
3
+ "version": "0.0.1-alpha.11",
4
4
  "description": "WSO2 Oxygen UI | Design System - Powered with Material-UI component library with TypeScript support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,57 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
-
30
- // src/components/ColorSchemeImage/ColorSchemeImage.tsx
31
- import Box from "@mui/material/Box";
32
- import { useColorScheme } from "@mui/material/styles";
33
- import useMediaQuery from "@mui/material/useMediaQuery";
34
- import { jsx } from "react/jsx-runtime";
35
- function ColorSchemeImage(_a) {
36
- var _b = _a, { src, alt, width = 16, height = 16 } = _b, rest = __objRest(_b, ["src", "alt", "width", "height"]);
37
- const { mode } = useColorScheme();
38
- const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
39
- let actualMode;
40
- if (mode === "system") {
41
- actualMode = prefersDark ? "dark" : "light";
42
- } else {
43
- actualMode = mode;
44
- }
45
- const imageSrc = actualMode === "dark" ? src.dark : src.light;
46
- let imageAlt;
47
- if (typeof alt === "string") {
48
- imageAlt = alt;
49
- } else {
50
- imageAlt = actualMode === "dark" ? alt.dark : alt.light;
51
- }
52
- return /* @__PURE__ */ jsx(Box, __spreadValues({ component: "img", src: imageSrc, alt: imageAlt, width, height }, rest));
53
- }
54
- export {
55
- ColorSchemeImage as default
56
- };
57
- //# sourceMappingURL=ColorSchemeImage.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ColorSchemeImage/ColorSchemeImage.tsx"],
4
- "sourcesContent": ["/*\n * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport Box, { BoxProps } from '@mui/material/Box';\nimport { useColorScheme } from '@mui/material/styles';\nimport useMediaQuery from '@mui/material/useMediaQuery';\nimport { JSX } from 'react';\n\n/**\n * Represents attributes for different color schemes (light and dark modes).\n */\nexport interface ColorSchemeImageAttribute {\n /** The value for light mode */\n light: string;\n\n /** The value for dark mode */\n dark: string;\n}\n\n/**\n * Props for the ColorSchemeImage component.\n * Extends BoxProps to inherit all Box component properties.\n */\nexport interface ColorSchemeImageProps extends BoxProps {\n /** Source URLs for the icon in different color schemes */\n src: ColorSchemeImageAttribute;\n\n /** Alt text for the icon, can be a string or different text for each color scheme */\n alt: ColorSchemeImageAttribute | string;\n\n /** Width of the icon in pixels or CSS units */\n width?: number | string;\n\n /** Height of the icon in pixels or CSS units */\n height?: number | string;\n}\n\n/**\n * A color scheme image component that automatically switches between light and dark mode variants\n * based on the current color scheme. Supports both automatic system preference detection\n * and manual color scheme selection.\n *\n * @param props - The component props\n * @param props.src - Object containing light and dark mode image sources\n * @param props.alt - Alt text for accessibility, can be a string or object with light/dark variants\n * @param props.width - Icon width, defaults to 16px\n * @param props.height - Icon height, defaults to 16px\n * @param props.rest - Additional props passed to the underlying Box component\n * @returns A color scheme image component that adapts to the current color scheme\n *\n * @example\n * ```tsx\n * <ColorSchemeImage\n * src={{\n * light: '/icons/logo-light.svg',\n * dark: '/icons/logo-dark.svg'\n * }}\n * alt=\"Company Logo\"\n * width={24}\n * height={24}\n * />\n * ```\n *\n * @example\n * ```tsx\n * <ColorSchemeImage\n * src={{\n * light: '/icons/home-light.png',\n * dark: '/icons/home-dark.png'\n * }}\n * alt={{\n * light: 'Home icon (light mode)',\n * dark: 'Home icon (dark mode)'\n * }}\n * />\n * ```\n */\nexport default function ColorSchemeImage({src, alt, width = 16, height = 16, ...rest}: ColorSchemeImageProps): \n JSX.Element {\n\n const {mode} = useColorScheme();\n\n const prefersDark = useMediaQuery('(prefers-color-scheme: dark)');\n\n let actualMode: string | undefined;\n\n if (mode === 'system') {\n actualMode = prefersDark ? 'dark' : 'light';\n } else {\n actualMode = mode;\n }\n\n const imageSrc: string = actualMode === 'dark' ? src.dark : src.light;\n let imageAlt: string;\n\n if (typeof alt === 'string') {\n imageAlt = alt;\n } else {\n imageAlt = actualMode === 'dark' ? alt.dark : alt.light;\n }\n\n return <Box component=\"img\" src={imageSrc} alt={imageAlt} width={width} height={height} {...rest} />;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,OAAO,SAAuB;AAC9B,SAAS,sBAAsB;AAC/B,OAAO,mBAAmB;AAgGjB;AAxBM,SAAR,iBAAkC,IAC3B;AAD2B,eAAC,OAAK,KAAK,QAAQ,IAAI,SAAS,GA5FzE,IA4FyC,IAAuC,iBAAvC,IAAuC,CAAtC,OAAK,OAAK,SAAY;AAG9D,QAAM,EAAC,KAAI,IAAI,eAAe;AAE9B,QAAM,cAAc,cAAc,8BAA8B;AAEhE,MAAI;AAEJ,MAAI,SAAS,UAAU;AACrB,iBAAa,cAAc,SAAS;AAAA,EACtC,OAAO;AACL,iBAAa;AAAA,EACf;AAEA,QAAM,WAAmB,eAAe,SAAS,IAAI,OAAO,IAAI;AAChE,MAAI;AAEJ,MAAI,OAAO,QAAQ,UAAU;AAC3B,eAAW;AAAA,EACb,OAAO;AACL,eAAW,eAAe,SAAS,IAAI,OAAO,IAAI;AAAA,EACpD;AAEA,SAAO,oBAAC,sBAAI,WAAU,OAAM,KAAK,UAAU,KAAK,UAAU,OAAc,UAAoB,KAAM;AACpG;",
6
- "names": []
7
- }
@@ -1,76 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
-
33
- // src/components/ColorSchemeToggle/ColorSchemeToggle.tsx
34
- import { useColorScheme } from "@mui/material/styles";
35
- import IconButton from "@mui/material/IconButton";
36
- import { Moon, Monitor, Sun } from "@wso2/oxygen-ui-icons-react";
37
- import { Tooltip } from "@mui/material";
38
- import { jsx } from "react/jsx-runtime";
39
- var ColorSchemeToggle = (_a) => {
40
- var _b = _a, {
41
- darkModeIcon,
42
- lightModeIcon,
43
- systemModeIcon
44
- } = _b, buttonProps = __objRest(_b, [
45
- "darkModeIcon",
46
- "lightModeIcon",
47
- "systemModeIcon"
48
- ]);
49
- const { mode, setMode } = useColorScheme();
50
- if (!mode) {
51
- return null;
52
- }
53
- const nextMode = (currentMode2) => {
54
- if (currentMode2 === "light") return "dark";
55
- if (currentMode2 === "dark") return "system";
56
- return "light";
57
- };
58
- const currentMode = mode != null ? mode : "system";
59
- const ColorSchemeIcon = () => {
60
- switch (currentMode) {
61
- case "light":
62
- return lightModeIcon != null ? lightModeIcon : /* @__PURE__ */ jsx(Sun, {});
63
- case "dark":
64
- return darkModeIcon != null ? darkModeIcon : /* @__PURE__ */ jsx(Moon, {});
65
- default:
66
- return systemModeIcon != null ? systemModeIcon : /* @__PURE__ */ jsx(Monitor, {});
67
- }
68
- };
69
- return /* @__PURE__ */ jsx(Tooltip, { title: `${currentMode.charAt(0).toUpperCase()}${currentMode.slice(1)} Mode`, children: /* @__PURE__ */ jsx(IconButton, __spreadProps(__spreadValues({}, buttonProps), { onClick: () => setMode(nextMode(currentMode)), children: /* @__PURE__ */ jsx(ColorSchemeIcon, {}) })) });
70
- };
71
- var ColorSchemeToggle_default = ColorSchemeToggle;
72
- export {
73
- ColorSchemeToggle,
74
- ColorSchemeToggle_default as default
75
- };
76
- //# sourceMappingURL=ColorSchemeToggle.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/ColorSchemeToggle/ColorSchemeToggle.tsx"],
4
- "sourcesContent": ["/*\n * Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { useColorScheme } from '@mui/material/styles';\nimport IconButton, { IconButtonProps } from '@mui/material/IconButton';\nimport { Moon, Monitor, Sun } from '@wso2/oxygen-ui-icons-react';\nimport { Tooltip } from '@mui/material';\n\n/**\n * Props for the ColorSchemeToggle component.\n * @remarks Extends MUI IconButtonProps.\n * @see {@link https://mui.com/material-ui/api/icon-button/#props IconButtonProps}\n */\ninterface ColorSchemeToggleProps extends IconButtonProps {\n darkModeIcon?: React.ReactNode;\n lightModeIcon?: React.ReactNode;\n systemModeIcon?: React.ReactNode;\n}\n\ntype Mode = 'light' | 'dark' | 'system';\n\nexport const ColorSchemeToggle: React.FC<ColorSchemeToggleProps> = ({\n darkModeIcon,\n lightModeIcon,\n systemModeIcon,\n ...buttonProps\n}) => {\n const { mode, setMode } = useColorScheme();\n\n if (!mode) {\n return null;\n }\n\n const nextMode = (currentMode: Mode): Mode => {\n if (currentMode === 'light') return 'dark';\n if (currentMode === 'dark') return 'system';\n return 'light';\n };\n\n const currentMode: Mode = mode ?? 'system';\n\n const ColorSchemeIcon = () => {\n switch (currentMode) {\n case 'light':\n return lightModeIcon ?? <Sun />;\n case 'dark':\n return darkModeIcon ?? <Moon />;\n default:\n return systemModeIcon ?? <Monitor />;\n }\n };\n\n return (\n <Tooltip title={`${currentMode.charAt(0).toUpperCase()}${currentMode.slice(1)} Mode`}>\n <IconButton {...buttonProps} onClick={() => setMode(nextMode(currentMode))}>\n <ColorSchemeIcon />\n </IconButton>\n </Tooltip>\n );\n};\n\nexport default ColorSchemeToggle;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAS,sBAAsB;AAC/B,OAAO,gBAAqC;AAC5C,SAAS,MAAM,SAAS,WAAW;AACnC,SAAS,eAAe;AAsCQ;AAvBzB,IAAM,oBAAsD,CAAC,OAK9D;AAL8D,eAClE;AAAA;AAAA,IACA;AAAA,IACA;AAAA,EAvCF,IAoCoE,IAI/D,wBAJ+D,IAI/D;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,EAAE,MAAM,QAAQ,IAAI,eAAe;AAEzC,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,CAACA,iBAA4B;AAC5C,QAAIA,iBAAgB,QAAS,QAAO;AACpC,QAAIA,iBAAgB,OAAQ,QAAO;AACnC,WAAO;AAAA,EACT;AAEA,QAAM,cAAoB,sBAAQ;AAElC,QAAM,kBAAkB,MAAM;AAC5B,YAAQ,aAAa;AAAA,MACnB,KAAK;AACH,eAAO,wCAAiB,oBAAC,OAAI;AAAA,MAC/B,KAAK;AACH,eAAO,sCAAgB,oBAAC,QAAK;AAAA,MAC/B;AACE,eAAO,0CAAkB,oBAAC,WAAQ;AAAA,IACtC;AAAA,EACF;AAEA,SACE,oBAAC,WAAQ,OAAO,GAAG,YAAY,OAAO,CAAC,EAAE,YAAY,CAAC,GAAG,YAAY,MAAM,CAAC,CAAC,SAC3E,8BAAC,6CAAe,cAAf,EAA4B,SAAS,MAAM,QAAQ,SAAS,WAAW,CAAC,GACvE,8BAAC,mBAAgB,IACnB,GACF;AAEJ;AAEA,IAAO,4BAAQ;",
6
- "names": ["currentMode"]
7
- }
@@ -1,378 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
- // src/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.tsx
22
- import { useMemo } from "react";
23
- import { ThemeProvider as MUIThemeProvider, StyledEngineProvider, createTheme as createTheme2 } from "@mui/material/styles";
24
- import { CssBaseline } from "@mui/material";
25
-
26
- // src/styles/OxygenTheme/OxygenTheme.ts
27
- import { createTheme } from "@mui/material/styles";
28
- import { ChevronDown, X } from "@wso2/oxygen-ui-icons-react";
29
- import React from "react";
30
- var noShadows = Array(25).fill("none");
31
- var OxygenThemePrimitives = {
32
- primary: {
33
- color: "linear-gradient(77.74deg, #e74420ff 11.16%, #fa7b3f 99.55%)",
34
- colorHover: "linear-gradient(77.74deg, #d04036ff 11.16%, #f2621f 99.55%)"
35
- }
36
- };
37
- var RadialBodyBackgroundDesign = {
38
- components: {
39
- MuiCssBaseline: {
40
- styleOverrides: {
41
- "html[data-color-scheme='dark'] body": {
42
- backgroundAttachment: "fixed",
43
- backgroundImage: `
44
- radial-gradient(circle at 65% 30%, rgba(255, 116, 0, 0.15) 10%, rgba(0, 0, 0, 0) 60% 40%),
45
- radial-gradient(circle at 15% 50%, rgba(74, 41, 165, 0.32) 1%, rgba(0, 0, 0, 0) 40% 70%),
46
- radial-gradient(circle at center, rgba(0, 0, 0, 0.6) 0%, var(--mui-palette-background-default) 100%)
47
- `,
48
- backgroundBlendMode: "screen"
49
- },
50
- "html[data-color-scheme='light'] body": {
51
- backgroundAttachment: "fixed",
52
- backgroundImage: `
53
- radial-gradient(circle at 65% 30%, rgba(255, 116, 0, 0.1) 10%, rgba(255, 255, 255, 0) 40% 40%),
54
- radial-gradient(circle at 15% 50%, rgba(74, 41, 165, 0.1) 1%, rgba(255, 255, 255, 0) 40% 70%),
55
- radial-gradient(circle at center, rgba(255, 255, 255, 0.6) 0%, var(--mui-palette-background-default) 100%)
56
- `,
57
- backgroundBlendMode: "normal"
58
- }
59
- }
60
- }
61
- }
62
- };
63
- var baseTheme = createTheme();
64
- var OxygenTheme = createTheme({
65
- typography: {
66
- fontFamily: "'Inter Variable', sans-serif",
67
- fontWeightRegular: 400,
68
- fontSize: 14,
69
- h1: {
70
- fontSize: baseTheme.typography.pxToRem(36),
71
- fontWeight: 400
72
- },
73
- h2: {
74
- fontSize: baseTheme.typography.pxToRem(30),
75
- fontWeight: 400
76
- },
77
- h3: {
78
- fontSize: baseTheme.typography.pxToRem(24),
79
- fontWeight: 400
80
- },
81
- h4: {
82
- fontSize: baseTheme.typography.pxToRem(18),
83
- fontWeight: 400
84
- },
85
- h5: {
86
- fontSize: baseTheme.typography.pxToRem(16),
87
- fontWeight: 400
88
- },
89
- h6: {
90
- fontSize: baseTheme.typography.pxToRem(14),
91
- fontWeight: 500
92
- },
93
- subtitle1: {
94
- fontSize: baseTheme.typography.pxToRem(18)
95
- },
96
- subtitle2: {
97
- fontSize: baseTheme.typography.pxToRem(14),
98
- fontWeight: 400
99
- },
100
- body1: {
101
- fontSize: baseTheme.typography.pxToRem(14)
102
- },
103
- body2: {
104
- fontSize: baseTheme.typography.pxToRem(14),
105
- fontWeight: 400
106
- },
107
- caption: {
108
- fontSize: baseTheme.typography.pxToRem(12),
109
- fontWeight: 400
110
- }
111
- },
112
- shadows: noShadows,
113
- shape: {
114
- borderRadius: 15
115
- },
116
- cssVariables: {
117
- colorSchemeSelector: "data-color-scheme"
118
- },
119
- colorSchemes: {
120
- light: {
121
- palette: {
122
- primary: {
123
- main: "#fa7b3f",
124
- contrastText: "#ffffff"
125
- },
126
- secondary: {
127
- main: "#e8e8e8"
128
- },
129
- background: {
130
- default: "#f5f5f5",
131
- paper: "#ffffff"
132
- },
133
- text: {
134
- primary: "#40404B",
135
- secondary: "#40404B"
136
- },
137
- divider: "#00000012"
138
- }
139
- },
140
- dark: {
141
- palette: {
142
- primary: {
143
- main: "#F87643",
144
- contrastText: "#ffffff"
145
- },
146
- secondary: {
147
- main: "#3c3c3c"
148
- },
149
- background: {
150
- default: "#000000",
151
- paper: "#00000088"
152
- },
153
- text: {
154
- primary: "#efefef",
155
- secondary: "#D0D3E2"
156
- },
157
- divider: "#ffffff16"
158
- }
159
- }
160
- },
161
- components: {
162
- MuiAvatar: {
163
- styleOverrides: {
164
- root: ({ theme }) => __spreadValues(__spreadValues({}, theme.applyStyles("light", {
165
- backgroundColor: "#ebebeb",
166
- color: "#40404B"
167
- })), theme.applyStyles("dark", {
168
- backgroundColor: "#3c3c3c",
169
- color: "#D0D3E2"
170
- }))
171
- }
172
- },
173
- MuiAutocomplete: {
174
- defaultProps: {
175
- popupIcon: React.createElement(ChevronDown),
176
- clearIcon: React.createElement(X)
177
- }
178
- },
179
- MuiButton: {
180
- styleOverrides: {
181
- root: {
182
- borderRadius: 20,
183
- textTransform: "none",
184
- fontWeight: 400
185
- },
186
- containedPrimary: {
187
- "&:not(:disabled)": {
188
- background: OxygenThemePrimitives.primary.color,
189
- color: "#fff",
190
- "&:hover": {
191
- background: OxygenThemePrimitives.primary.colorHover,
192
- color: "#fff"
193
- }
194
- }
195
- }
196
- }
197
- },
198
- MuiDialog: {
199
- styleOverrides: {
200
- paper: ({ theme }) => __spreadValues(__spreadValues({
201
- WebkitBackdropFilter: "blur(10px)",
202
- backdropFilter: "blur(10px)"
203
- }, theme.applyStyles("light", {
204
- background: "rgba(255, 255, 255, 0.7)"
205
- })), theme.applyStyles("dark", {
206
- background: "rgba(10, 10, 10, 0.7)"
207
- }))
208
- }
209
- },
210
- MuiDrawer: {
211
- styleOverrides: {
212
- paper: ({ theme }) => __spreadValues({}, theme.applyStyles("dark", {
213
- background: "transparent"
214
- }))
215
- }
216
- },
217
- MuiFormLabel: {
218
- styleOverrides: {
219
- root: ({ theme }) => ({
220
- fontSize: theme.typography.body2.fontSize,
221
- marginBottom: "6px"
222
- })
223
- }
224
- },
225
- MuiPaper: {
226
- styleOverrides: {
227
- root: ({ theme }) => __spreadValues(__spreadValues({
228
- borderRadius: theme.shape.borderRadius,
229
- WebkitBackdropFilter: "blur(3px)",
230
- backdropFilter: "blur(3px)"
231
- }, theme.applyStyles("light", {
232
- border: "1px solid #ffffff7a",
233
- background: "rgb(230 230 230 / 5%)",
234
- boxShadow: "0 10px 22px 0 rgba(6, 6, 14, 0.1),0 24px 48px 0 rgba(199, 211, 234, 0.05) inset,0 1px 1px 0 rgba(199, 211, 234, 0.12) inset"
235
- })), theme.applyStyles("dark", {
236
- border: "1px solid #d2d2d20f",
237
- background: "rgb(230 230 230 / 1%)",
238
- boxShadow: "0 24px 32px 0 rgba(6, 6, 14, 0.70),0 24px 48px 0 rgba(199, 211, 234, 0.05) inset,0 1px 1px 0 rgba(199, 211, 234, 0.12) inset"
239
- }))
240
- }
241
- },
242
- MuiPopover: {
243
- styleOverrides: {
244
- paper: ({ theme }) => __spreadValues(__spreadValues({}, theme.applyStyles("light", {
245
- background: "#ffffff9c"
246
- })), theme.applyStyles("dark", {
247
- background: "#040404c2"
248
- }))
249
- }
250
- },
251
- MuiTextField: {
252
- defaultProps: { size: "small" }
253
- },
254
- MuiSelect: {
255
- defaultProps: {
256
- size: "small",
257
- IconComponent: ChevronDown
258
- },
259
- styleOverrides: {
260
- icon: {
261
- top: "50%",
262
- transform: "translateY(-50%)",
263
- marginTop: 0
264
- },
265
- select: {
266
- paddingTop: "10px",
267
- paddingBottom: "10px"
268
- }
269
- }
270
- },
271
- MuiOutlinedInput: {
272
- styleOverrides: {
273
- root: ({ theme }) => __spreadValues(__spreadValues({
274
- fontSize: theme.typography.body2.fontSize,
275
- borderRadius: 8
276
- }, theme.applyStyles("light", {
277
- background: "#ffffffc4"
278
- })), theme.applyStyles("dark", {
279
- background: "#ffffff05"
280
- })),
281
- notchedOutline: ({ theme }) => __spreadValues(__spreadValues({
282
- borderWidth: 1
283
- }, theme.applyStyles("light", {
284
- borderColor: "#d9d9d987"
285
- })), theme.applyStyles("dark", {
286
- borderColor: "#ffffff0d"
287
- }))
288
- }
289
- },
290
- MuiMenuItem: {
291
- styleOverrides: {
292
- root: ({ theme }) => ({
293
- fontSize: theme.typography.body2.fontSize
294
- })
295
- }
296
- },
297
- MuiLink: {
298
- styleOverrides: {
299
- root: ({ theme }) => ({
300
- color: theme.palette.primary.main,
301
- textDecoration: "none",
302
- "&:hover": {
303
- color: theme.palette.primary.dark,
304
- textDecoration: "underline"
305
- }
306
- })
307
- }
308
- },
309
- MuiListItemButton: {
310
- styleOverrides: {
311
- root: ({ theme }) => ({
312
- borderRadius: 8,
313
- "&.Mui-selected": __spreadProps(__spreadValues(__spreadValues({}, theme.applyStyles("light", {
314
- backgroundColor: theme.palette.action.selected
315
- })), theme.applyStyles("dark", {
316
- backgroundColor: "#ffffff1a"
317
- })), {
318
- "&:hover": __spreadValues(__spreadValues({}, theme.applyStyles("light", {
319
- backgroundColor: theme.palette.action.hover
320
- })), theme.applyStyles("dark", {
321
- backgroundColor: "#ffffff1a"
322
- }))
323
- })
324
- })
325
- }
326
- },
327
- MuiDataGrid: {
328
- styleOverrides: {
329
- root: ({ theme }) => ({
330
- border: "none",
331
- backgroundColor: "transparent",
332
- overflow: "hidden",
333
- "& .MuiDataGrid-columnHeaders": {
334
- backgroundColor: "#ffffff0a",
335
- borderBottom: "1px solid",
336
- borderColor: theme.palette.divider
337
- }
338
- }),
339
- columnHeaders: ({ theme }) => ({
340
- backgroundColor: "#ffffff0a",
341
- borderBottom: "1px solid",
342
- borderColor: theme.palette.divider
343
- }),
344
- columnHeader: {
345
- backgroundColor: "transparent"
346
- },
347
- cell: ({ theme }) => ({
348
- borderBottom: "1px solid",
349
- backgroundColor: "transparent",
350
- borderColor: theme.palette.divider
351
- })
352
- }
353
- }
354
- }
355
- });
356
- var OxygenTheme_default = OxygenTheme;
357
-
358
- // src/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.tsx
359
- import { jsx, jsxs } from "react/jsx-runtime";
360
- function OxygenUIThemeProvider({
361
- children,
362
- theme,
363
- radialBackground = false
364
- }) {
365
- const resolvedTheme = useMemo(() => {
366
- if (theme) return theme;
367
- if (!radialBackground) return OxygenTheme_default;
368
- return createTheme2(OxygenTheme_default, RadialBodyBackgroundDesign);
369
- }, [theme, radialBackground]);
370
- return /* @__PURE__ */ jsx(StyledEngineProvider, { injectFirst: true, children: /* @__PURE__ */ jsxs(MUIThemeProvider, { theme: resolvedTheme, children: [
371
- /* @__PURE__ */ jsx(CssBaseline, {}),
372
- children
373
- ] }) });
374
- }
375
- export {
376
- OxygenUIThemeProvider as default
377
- };
378
- //# sourceMappingURL=OxygenUIThemeProvider.js.map