@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
package/dist/index.js CHANGED
@@ -128,98 +128,74 @@ var __objRest = (source, exclude) => {
128
128
  })();
129
129
 
130
130
  // src/styles/OxygenTheme/OxygenTheme.ts
131
- import { createTheme } from "@mui/material/styles";
131
+ import { extendTheme } from "@mui/material/styles";
132
132
  import { ChevronDown, X } from "@wso2/oxygen-ui-icons-react";
133
133
  import React from "react";
134
- var noShadows = Array(25).fill("none");
135
- var OxygenThemePrimitives = {
134
+
135
+ // src/utils/pxToRem.ts
136
+ var pxToRem = (size) => `${size / 14}rem`;
137
+
138
+ // src/styles/OxygenTheme/OxygenTheme.ts
139
+ var primitives = {
136
140
  primary: {
137
- color: "linear-gradient(77.74deg, #e74420ff 11.16%, #fa7b3f 99.55%)",
138
- colorHover: "linear-gradient(77.74deg, #d04036ff 11.16%, #f2621f 99.55%)"
141
+ gradientColor: "linear-gradient(77.74deg, #e74420ff 11.16%, #fa7b3f 99.55%)",
142
+ gradientColorHover: "linear-gradient(77.74deg, #d04036ff 11.16%, #f2621f 99.55%)"
139
143
  }
140
144
  };
141
- var RadialBodyBackgroundDesign = {
142
- components: {
143
- MuiCssBaseline: {
144
- styleOverrides: {
145
- "html[data-color-scheme='dark'] body": {
146
- backgroundAttachment: "fixed",
147
- backgroundImage: `
148
- radial-gradient(circle at 65% 30%, rgba(255, 116, 0, 0.15) 10%, rgba(0, 0, 0, 0) 60% 40%),
149
- radial-gradient(circle at 15% 50%, rgba(74, 41, 165, 0.32) 1%, rgba(0, 0, 0, 0) 40% 70%),
150
- radial-gradient(circle at center, rgba(0, 0, 0, 0.6) 0%, var(--mui-palette-background-default) 100%)
151
- `,
152
- backgroundBlendMode: "screen"
153
- },
154
- "html[data-color-scheme='light'] body": {
155
- backgroundAttachment: "fixed",
156
- backgroundImage: `
157
- radial-gradient(circle at 65% 30%, rgba(255, 116, 0, 0.1) 10%, rgba(255, 255, 255, 0) 40% 40%),
158
- radial-gradient(circle at 15% 50%, rgba(74, 41, 165, 0.1) 1%, rgba(255, 255, 255, 0) 40% 70%),
159
- radial-gradient(circle at center, rgba(255, 255, 255, 0.6) 0%, var(--mui-palette-background-default) 100%)
160
- `,
161
- backgroundBlendMode: "normal"
162
- }
163
- }
164
- }
165
- }
166
- };
167
- var baseTheme = createTheme();
168
- var OxygenTheme = createTheme({
145
+ var OxygenTheme = extendTheme({
146
+ cssVarPrefix: "oxygen",
147
+ colorSchemeSelector: "data-color-scheme",
169
148
  typography: {
170
149
  fontFamily: "'Inter Variable', sans-serif",
171
150
  fontWeightRegular: 400,
172
151
  fontSize: 14,
173
152
  h1: {
174
- fontSize: baseTheme.typography.pxToRem(36),
153
+ fontSize: pxToRem(36),
175
154
  fontWeight: 400
176
155
  },
177
156
  h2: {
178
- fontSize: baseTheme.typography.pxToRem(30),
157
+ fontSize: pxToRem(30),
179
158
  fontWeight: 400
180
159
  },
181
160
  h3: {
182
- fontSize: baseTheme.typography.pxToRem(24),
161
+ fontSize: pxToRem(24),
183
162
  fontWeight: 400
184
163
  },
185
164
  h4: {
186
- fontSize: baseTheme.typography.pxToRem(18),
165
+ fontSize: pxToRem(18),
187
166
  fontWeight: 400
188
167
  },
189
168
  h5: {
190
- fontSize: baseTheme.typography.pxToRem(16),
169
+ fontSize: pxToRem(16),
191
170
  fontWeight: 400
192
171
  },
193
172
  h6: {
194
- fontSize: baseTheme.typography.pxToRem(14),
173
+ fontSize: pxToRem(14),
195
174
  fontWeight: 500
196
175
  },
197
176
  subtitle1: {
198
- fontSize: baseTheme.typography.pxToRem(18)
177
+ fontSize: pxToRem(18)
199
178
  },
200
179
  subtitle2: {
201
- fontSize: baseTheme.typography.pxToRem(14),
180
+ fontSize: pxToRem(14),
202
181
  fontWeight: 400
203
182
  },
204
183
  body1: {
205
- fontSize: baseTheme.typography.pxToRem(14)
184
+ fontSize: pxToRem(14)
206
185
  },
207
186
  body2: {
208
- fontSize: baseTheme.typography.pxToRem(14),
187
+ fontSize: pxToRem(14),
209
188
  fontWeight: 400
210
189
  },
211
190
  caption: {
212
- fontSize: baseTheme.typography.pxToRem(12),
191
+ fontSize: pxToRem(12),
213
192
  fontWeight: 400
214
193
  }
215
194
  },
216
- shadows: noShadows,
195
+ shadows: Array(25).fill("none"),
217
196
  shape: {
218
197
  borderRadius: 15
219
198
  },
220
- cssVariables: {
221
- colorSchemeSelector: "data-color-scheme"
222
- },
223
199
  colorSchemes: {
224
200
  light: {
225
201
  palette: {
@@ -289,10 +265,10 @@ var OxygenTheme = createTheme({
289
265
  },
290
266
  containedPrimary: {
291
267
  "&:not(:disabled)": {
292
- background: OxygenThemePrimitives.primary.color,
268
+ background: primitives.primary.gradientColor,
293
269
  color: "#fff",
294
270
  "&:hover": {
295
- background: OxygenThemePrimitives.primary.colorHover,
271
+ background: primitives.primary.gradientColorHover,
296
272
  color: "#fff"
297
273
  }
298
274
  }
@@ -459,25 +435,100 @@ var OxygenTheme = createTheme({
459
435
  });
460
436
  var OxygenTheme_default = OxygenTheme;
461
437
 
438
+ // src/styles/OxygenTheme/OxygenThemeWithRadialBackground.ts
439
+ var _a, _b, _c;
440
+ var OxygenThemeWithRadialBackground = __spreadProps(__spreadValues({}, OxygenTheme_default), {
441
+ components: __spreadProps(__spreadValues({}, OxygenTheme_default.components), {
442
+ MuiCssBaseline: __spreadProps(__spreadValues({}, ((_a = OxygenTheme_default.components) == null ? void 0 : _a.MuiCssBaseline) || {}), {
443
+ styleOverrides: __spreadProps(__spreadValues({}, typeof ((_c = (_b = OxygenTheme_default.components) == null ? void 0 : _b.MuiCssBaseline) == null ? void 0 : _c.styleOverrides) === "object" ? OxygenTheme_default.components.MuiCssBaseline.styleOverrides : {}), {
444
+ "html[data-color-scheme='dark'] body": {
445
+ backgroundAttachment: "fixed",
446
+ backgroundImage: `
447
+ radial-gradient(circle at 65% 30%, rgb(255 116 0 / 13%) 10%, rgba(0, 0, 0, 0) 60% 40%),
448
+ radial-gradient(circle at 15% 50%, rgb(74 41 165 / 22%) 1%, rgba(0, 0, 0, 0) 40% 70%),
449
+ radial-gradient(circle at center, rgba(0, 0, 0, 0.6) 0%, var(--oxygen-palette-background-default) 100%)
450
+ `,
451
+ backgroundBlendMode: "screen"
452
+ },
453
+ "html[data-color-scheme='light'] body": {
454
+ backgroundAttachment: "fixed",
455
+ backgroundImage: `
456
+ radial-gradient(circle at 65% 30%, rgba(255, 116, 0, 0.1) 10%, rgba(255, 255, 255, 0) 40% 40%),
457
+ radial-gradient(circle at 15% 50%, rgba(74, 41, 165, 0.1) 1%, rgba(255, 255, 255, 0) 40% 70%),
458
+ radial-gradient(circle at center, rgba(255, 255, 255, 0.6) 0%, var(--oxygen-palette-background-default) 100%)
459
+ `,
460
+ backgroundBlendMode: "normal"
461
+ }
462
+ })
463
+ })
464
+ })
465
+ });
466
+ var OxygenThemeWithRadialBackground_default = OxygenThemeWithRadialBackground;
467
+
462
468
  // src/contexts/OxygenUIThemeProvider/OxygenUIThemeProvider.tsx
463
- import { useMemo } from "react";
464
- import { ThemeProvider as MUIThemeProvider, StyledEngineProvider, createTheme as createTheme2 } from "@mui/material/styles";
469
+ import { ThemeProvider, StyledEngineProvider } from "@mui/material/styles";
465
470
  import { CssBaseline } from "@mui/material";
471
+ import { createContext, useContext, useState } from "react";
466
472
  import { jsx, jsxs } from "react/jsx-runtime";
473
+ var defaultThemes = [
474
+ {
475
+ key: "default",
476
+ label: "Default",
477
+ theme: OxygenTheme_default
478
+ },
479
+ {
480
+ key: "radial",
481
+ label: "Radial Background",
482
+ theme: OxygenThemeWithRadialBackground_default
483
+ }
484
+ ];
485
+ var ThemeSwitcherContext = createContext(null);
486
+ var useThemeSwitcher = () => {
487
+ const context = useContext(ThemeSwitcherContext);
488
+ if (!context) {
489
+ throw new Error("useThemeSwitcher must be used within OxygenUIThemeProvider with themes prop");
490
+ }
491
+ return context;
492
+ };
467
493
  function OxygenUIThemeProvider({
468
494
  children,
469
495
  theme,
470
- radialBackground = false
496
+ themes,
497
+ initialTheme
471
498
  }) {
472
- const resolvedTheme = useMemo(() => {
473
- if (theme) return theme;
474
- if (!radialBackground) return OxygenTheme_default;
475
- return createTheme2(OxygenTheme_default, RadialBodyBackgroundDesign);
476
- }, [theme, radialBackground]);
477
- return /* @__PURE__ */ jsx(StyledEngineProvider, { injectFirst: true, children: /* @__PURE__ */ jsxs(MUIThemeProvider, { theme: resolvedTheme, children: [
478
- /* @__PURE__ */ jsx(CssBaseline, {}),
499
+ var _a2, _b2, _c2;
500
+ const useThemeSwitching = !!themes;
501
+ const themeOptions = themes || defaultThemes;
502
+ const [currentThemeKey, setCurrentThemeKey] = useState(
503
+ initialTheme || ((_a2 = themeOptions[0]) == null ? void 0 : _a2.key) || "default"
504
+ );
505
+ let resolvedTheme;
506
+ if (useThemeSwitching) {
507
+ resolvedTheme = ((_b2 = themeOptions.find((t) => t.key === currentThemeKey)) == null ? void 0 : _b2.theme) || ((_c2 = themeOptions[0]) == null ? void 0 : _c2.theme);
508
+ } else {
509
+ resolvedTheme = theme || OxygenTheme_default;
510
+ }
511
+ const setTheme = (themeKey) => {
512
+ if (themeOptions.some((t) => t.key === themeKey)) {
513
+ setCurrentThemeKey(themeKey);
514
+ }
515
+ };
516
+ const isActive = (themeKey) => currentThemeKey === themeKey;
517
+ const contextValue = {
518
+ theme: resolvedTheme,
519
+ currentTheme: currentThemeKey,
520
+ themes: themeOptions,
521
+ setTheme,
522
+ isActive
523
+ };
524
+ const content = /* @__PURE__ */ jsx(StyledEngineProvider, { injectFirst: true, children: /* @__PURE__ */ jsxs(ThemeProvider, { theme: resolvedTheme, children: [
525
+ /* @__PURE__ */ jsx(CssBaseline, { enableColorScheme: true }),
479
526
  children
480
527
  ] }) });
528
+ if (useThemeSwitching) {
529
+ return /* @__PURE__ */ jsx(ThemeSwitcherContext.Provider, { value: contextValue, children: content });
530
+ }
531
+ return content;
481
532
  }
482
533
 
483
534
  // src/components/ColorSchemeImage/ColorSchemeImage.tsx
@@ -485,8 +536,8 @@ import Box from "@mui/material/Box";
485
536
  import { useColorScheme } from "@mui/material/styles";
486
537
  import useMediaQuery from "@mui/material/useMediaQuery";
487
538
  import { jsx as jsx2 } from "react/jsx-runtime";
488
- function ColorSchemeImage(_a) {
489
- var _b = _a, { src, alt, width = 16, height = 16 } = _b, rest = __objRest(_b, ["src", "alt", "width", "height"]);
539
+ function ColorSchemeImage(_a2) {
540
+ var _b2 = _a2, { src, alt, width = 16, height = 16 } = _b2, rest = __objRest(_b2, ["src", "alt", "width", "height"]);
490
541
  const { mode } = useColorScheme();
491
542
  const prefersDark = useMediaQuery("(prefers-color-scheme: dark)");
492
543
  let actualMode;
@@ -511,12 +562,12 @@ import IconButton from "@mui/material/IconButton";
511
562
  import { Moon, Monitor, Sun } from "@wso2/oxygen-ui-icons-react";
512
563
  import { Tooltip } from "@mui/material";
513
564
  import { jsx as jsx3 } from "react/jsx-runtime";
514
- var ColorSchemeToggle = (_a) => {
515
- var _b = _a, {
565
+ var ColorSchemeToggle = (_a2) => {
566
+ var _b2 = _a2, {
516
567
  darkModeIcon,
517
568
  lightModeIcon,
518
569
  systemModeIcon
519
- } = _b, buttonProps = __objRest(_b, [
570
+ } = _b2, buttonProps = __objRest(_b2, [
520
571
  "darkModeIcon",
521
572
  "lightModeIcon",
522
573
  "systemModeIcon"
@@ -545,12 +596,207 @@ var ColorSchemeToggle = (_a) => {
545
596
  };
546
597
  var ColorSchemeToggle_default = ColorSchemeToggle;
547
598
 
599
+ // src/components/ComplexSelect/ComplexSelect.tsx
600
+ import MuiSelect, { selectClasses } from "@mui/material/Select";
601
+ import MuiFormControl from "@mui/material/FormControl";
602
+ import MuiInputLabel from "@mui/material/InputLabel";
603
+
604
+ // src/components/ComplexSelect/ComplexSelectListHeader.tsx
605
+ import MuiListSubheader from "@mui/material/ListSubheader";
606
+ import { jsx as jsx4 } from "react/jsx-runtime";
607
+ function ComplexSelectListHeader(_a2) {
608
+ var _b2 = _a2, { children, sx } = _b2, props = __objRest(_b2, ["children", "sx"]);
609
+ return /* @__PURE__ */ jsx4(MuiListSubheader, __spreadProps(__spreadValues({ sx: __spreadValues({ pt: 0 }, sx) }, props), { children }));
610
+ }
611
+ var ComplexSelectListHeader_default = ComplexSelectListHeader;
612
+
613
+ // src/components/ComplexSelect/ComplexSelectMenuItem.tsx
614
+ import MuiMenuItem from "@mui/material/MenuItem";
615
+
616
+ // src/components/ComplexSelect/ComplexSelectMenuItemAvatar.tsx
617
+ import { styled } from "@mui/material/styles";
618
+ import MuiListItemAvatar from "@mui/material/ListItemAvatar";
619
+ import MuiAvatar from "@mui/material/Avatar";
620
+ import { jsx as jsx5 } from "react/jsx-runtime";
621
+ var StyledAvatar = styled(MuiAvatar)(({ theme }) => ({
622
+ width: 28,
623
+ height: 28,
624
+ backgroundColor: (theme.vars || theme).palette.background.paper,
625
+ color: (theme.vars || theme).palette.text.secondary,
626
+ border: `1px solid ${(theme.vars || theme).palette.divider}`
627
+ }));
628
+ var StyledListItemAvatar = styled(MuiListItemAvatar)({
629
+ minWidth: 0,
630
+ marginRight: 12
631
+ });
632
+ function ComplexSelectMenuItemAvatar(_a2) {
633
+ var _b2 = _a2, { children } = _b2, props = __objRest(_b2, ["children"]);
634
+ return /* @__PURE__ */ jsx5(StyledListItemAvatar, { children: /* @__PURE__ */ jsx5(StyledAvatar, __spreadProps(__spreadValues({}, props), { children })) });
635
+ }
636
+ var ComplexSelectMenuItemAvatar_default = ComplexSelectMenuItemAvatar;
637
+
638
+ // src/components/ComplexSelect/ComplexSelectMenuItemText.tsx
639
+ import MuiListItemText from "@mui/material/ListItemText";
640
+ import { jsx as jsx6 } from "react/jsx-runtime";
641
+ function ComplexSelectMenuItemText(_a2) {
642
+ var _b2 = _a2, { primary, secondary } = _b2, props = __objRest(_b2, ["primary", "secondary"]);
643
+ return /* @__PURE__ */ jsx6(MuiListItemText, __spreadValues({ primary, secondary }, props));
644
+ }
645
+ var ComplexSelectMenuItemText_default = ComplexSelectMenuItemText;
646
+
647
+ // src/components/ComplexSelect/ComplexSelectMenuItemIcon.tsx
648
+ import MuiListItemIcon from "@mui/material/ListItemIcon";
649
+ import { jsx as jsx7 } from "react/jsx-runtime";
650
+ function ComplexSelectMenuItemIcon(_a2) {
651
+ var _b2 = _a2, { children } = _b2, props = __objRest(_b2, ["children"]);
652
+ return /* @__PURE__ */ jsx7(MuiListItemIcon, __spreadProps(__spreadValues({}, props), { children }));
653
+ }
654
+ var ComplexSelectMenuItemIcon_default = ComplexSelectMenuItemIcon;
655
+
656
+ // src/components/ComplexSelect/ComplexSelectMenuItem.tsx
657
+ import { jsx as jsx8 } from "react/jsx-runtime";
658
+ var ComplexSelectMenuItem = Object.assign(
659
+ (_a2) => {
660
+ var _b2 = _a2, { children } = _b2, props = __objRest(_b2, ["children"]);
661
+ return /* @__PURE__ */ jsx8(MuiMenuItem, __spreadProps(__spreadValues({}, props), { children }));
662
+ },
663
+ {
664
+ Avatar: ComplexSelectMenuItemAvatar_default,
665
+ Text: ComplexSelectMenuItemText_default,
666
+ Icon: ComplexSelectMenuItemIcon_default
667
+ }
668
+ );
669
+ var ComplexSelectMenuItem_default = ComplexSelectMenuItem;
670
+
671
+ // src/components/ComplexSelect/ComplexSelectDivider.tsx
672
+ import MuiDivider from "@mui/material/Divider";
673
+ import { jsx as jsx9 } from "react/jsx-runtime";
674
+ function ComplexSelectDivider(_a2) {
675
+ var _b2 = _a2, { sx } = _b2, props = __objRest(_b2, ["sx"]);
676
+ return /* @__PURE__ */ jsx9(MuiDivider, __spreadValues({ sx: __spreadValues({ mx: -1 }, sx) }, props));
677
+ }
678
+ var ComplexSelectDivider_default = ComplexSelectDivider;
679
+
680
+ // src/components/ComplexSelect/ComplexSelect.tsx
681
+ import { jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
682
+ function ComplexSelect(_a2) {
683
+ var _b2 = _a2, { children, sx, label, labelId } = _b2, props = __objRest(_b2, ["children", "sx", "label", "labelId"]);
684
+ const selectContent = /* @__PURE__ */ jsx10(
685
+ MuiSelect,
686
+ __spreadProps(__spreadValues({}, props), {
687
+ label,
688
+ labelId,
689
+ sx: __spreadValues({
690
+ maxHeight: 56,
691
+ "&.MuiList-root": {
692
+ p: "8px"
693
+ },
694
+ [`& .${selectClasses.select}`]: {
695
+ display: "flex",
696
+ alignItems: "center",
697
+ gap: "2px",
698
+ pl: 1
699
+ }
700
+ }, sx),
701
+ children
702
+ })
703
+ );
704
+ if (label) {
705
+ const generatedLabelId = labelId || `complex-select-label-${Math.random().toString(36).substr(2, 9)}`;
706
+ return /* @__PURE__ */ jsxs2(MuiFormControl, { fullWidth: props.fullWidth, sx: { minWidth: 120 }, children: [
707
+ /* @__PURE__ */ jsx10(MuiInputLabel, { id: generatedLabelId, children: label }),
708
+ /* @__PURE__ */ jsx10(
709
+ MuiSelect,
710
+ __spreadProps(__spreadValues({}, props), {
711
+ label,
712
+ labelId: generatedLabelId,
713
+ sx: __spreadValues({
714
+ maxHeight: 56,
715
+ "&.MuiList-root": {
716
+ p: "8px"
717
+ },
718
+ [`& .${selectClasses.select}`]: {
719
+ display: "flex",
720
+ alignItems: "center",
721
+ gap: "2px",
722
+ pl: 1
723
+ }
724
+ }, sx),
725
+ children
726
+ })
727
+ )
728
+ ] });
729
+ }
730
+ return selectContent;
731
+ }
732
+ var ComplexSelectCompound = Object.assign(ComplexSelect, {
733
+ ListHeader: ComplexSelectListHeader_default,
734
+ MenuItem: ComplexSelectMenuItem_default,
735
+ Divider: ComplexSelectDivider_default
736
+ });
737
+ var ComplexSelect_default = ComplexSelectCompound;
738
+
739
+ // src/components/ThemeSwitcher/ThemeSelect.tsx
740
+ import { Select, MenuItem, FormControl, InputLabel } from "@mui/material";
741
+ import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
742
+ function ThemeSelect({
743
+ size = "small",
744
+ showLabel = false,
745
+ label = "Theme",
746
+ variant = "outlined",
747
+ sx
748
+ }) {
749
+ const { currentTheme, themes, setTheme } = useThemeSwitcher();
750
+ const handleChange = (event) => {
751
+ setTheme(event.target.value);
752
+ };
753
+ return /* @__PURE__ */ jsxs3(FormControl, { size, variant, sx: __spreadValues({ minWidth: 120 }, sx), children: [
754
+ showLabel && /* @__PURE__ */ jsx11(InputLabel, { id: "theme-select-label", children: label }),
755
+ /* @__PURE__ */ jsx11(
756
+ Select,
757
+ {
758
+ labelId: showLabel ? "theme-select-label" : void 0,
759
+ value: currentTheme,
760
+ onChange: handleChange,
761
+ label: showLabel ? label : void 0,
762
+ children: themes.map((themeOption) => /* @__PURE__ */ jsx11(MenuItem, { value: themeOption.key, children: themeOption.label }, themeOption.key))
763
+ }
764
+ )
765
+ ] });
766
+ }
767
+
768
+ // src/components/ThemeSwitcher/ThemeSwitcher.tsx
769
+ import { Fragment, jsx as jsx12 } from "react/jsx-runtime";
770
+ function ThemeSwitcher({
771
+ children,
772
+ size,
773
+ showLabel,
774
+ label,
775
+ variant,
776
+ sx
777
+ }) {
778
+ const themeSwitcherContext = useThemeSwitcher();
779
+ if (children) {
780
+ return /* @__PURE__ */ jsx12(Fragment, { children: children(themeSwitcherContext) });
781
+ }
782
+ return /* @__PURE__ */ jsx12(
783
+ ThemeSelect,
784
+ {
785
+ size,
786
+ showLabel,
787
+ label,
788
+ variant,
789
+ sx
790
+ }
791
+ );
792
+ }
793
+
548
794
  // src/layouts/Layout.tsx
549
795
  import Box2 from "@mui/material/Box";
550
- import { jsx as jsx4 } from "react/jsx-runtime";
551
- function Layout(_a) {
552
- var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
553
- return /* @__PURE__ */ jsx4(
796
+ import { jsx as jsx13 } from "react/jsx-runtime";
797
+ function Layout(_a2) {
798
+ var _b2 = _a2, { children = null, sx } = _b2, rest = __objRest(_b2, ["children", "sx"]);
799
+ return /* @__PURE__ */ jsx13(
554
800
  Box2,
555
801
  __spreadProps(__spreadValues({
556
802
  sx: __spreadValues({
@@ -566,10 +812,10 @@ var Layout_default = Layout;
566
812
 
567
813
  // src/layouts/LayoutSidebar.tsx
568
814
  import Box3 from "@mui/material/Box";
569
- import { jsx as jsx5 } from "react/jsx-runtime";
570
- function LayoutSidebar(_a) {
571
- var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
572
- return /* @__PURE__ */ jsx5(
815
+ import { jsx as jsx14 } from "react/jsx-runtime";
816
+ function LayoutSidebar(_a2) {
817
+ var _b2 = _a2, { children = null, sx } = _b2, rest = __objRest(_b2, ["children", "sx"]);
818
+ return /* @__PURE__ */ jsx14(
573
819
  Box3,
574
820
  __spreadProps(__spreadValues({
575
821
  sx: __spreadValues({
@@ -591,10 +837,10 @@ var LayoutNavbar_default = LayoutNavbar;
591
837
 
592
838
  // src/layouts/LayoutContent.tsx
593
839
  import Box4 from "@mui/material/Box";
594
- import { jsx as jsx6 } from "react/jsx-runtime";
595
- function LayoutContent(_a) {
596
- var _b = _a, { children = null } = _b, rest = __objRest(_b, ["children"]);
597
- return /* @__PURE__ */ jsx6(
840
+ import { jsx as jsx15 } from "react/jsx-runtime";
841
+ function LayoutContent(_a2) {
842
+ var _b2 = _a2, { children = null } = _b2, rest = __objRest(_b2, ["children"]);
843
+ return /* @__PURE__ */ jsx15(
598
844
  Box4,
599
845
  __spreadProps(__spreadValues({
600
846
  component: "main",
@@ -613,10 +859,10 @@ var LayoutContent_default = LayoutContent;
613
859
 
614
860
  // src/layouts/LayoutHeader.tsx
615
861
  import Box5 from "@mui/material/Box";
616
- import { jsx as jsx7 } from "react/jsx-runtime";
617
- function LayoutHeader(_a) {
618
- var _b = _a, { children = null, sx } = _b, rest = __objRest(_b, ["children", "sx"]);
619
- return /* @__PURE__ */ jsx7(
862
+ import { jsx as jsx16 } from "react/jsx-runtime";
863
+ function LayoutHeader(_a2) {
864
+ var _b2 = _a2, { children = null, sx } = _b2, rest = __objRest(_b2, ["children", "sx"]);
865
+ return /* @__PURE__ */ jsx16(
620
866
  Box5,
621
867
  __spreadProps(__spreadValues({
622
868
  sx: __spreadValues({
@@ -648,11 +894,16 @@ export {
648
894
  Charts,
649
895
  ColorSchemeImage,
650
896
  ColorSchemeToggle_default as ColorSchemeToggle,
897
+ ComplexSelect_default as ComplexSelect,
651
898
  DataGrid,
652
899
  DatePickers,
653
900
  layouts_default as Layout,
654
901
  OxygenTheme_default as OxygenTheme,
902
+ OxygenThemeWithRadialBackground_default as OxygenThemeWithRadialBackground,
655
903
  OxygenUIThemeProvider,
656
- TreeView
904
+ ThemeSelect,
905
+ ThemeSwitcher,
906
+ TreeView,
907
+ useThemeSwitcher
657
908
  };
658
909
  //# sourceMappingURL=index.js.map