igloo-d2c-components 1.0.56-non-prod → 1.1.0

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/dist/cjs/index.js CHANGED
@@ -3,11 +3,11 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
+ var styles = require('@mui/material/styles');
6
7
  var material = require('@mui/material');
7
8
  var ArrowDropDownIcon = require('@mui/icons-material/ArrowDropDown');
8
9
  var CloseIcon = require('@mui/icons-material/Close');
9
10
  var AppBar = require('@mui/material/AppBar');
10
- var styles = require('@mui/material/styles');
11
11
  var MenuIcon = require('@mui/icons-material/Menu');
12
12
  var Container = require('@mui/material/Container');
13
13
  var ArrowBackIcon = require('@mui/icons-material/ArrowBack');
@@ -663,6 +663,7 @@ const TenantThemeContext = React.createContext(undefined);
663
663
  /**
664
664
  * TenantThemeProvider
665
665
  * Wraps components to provide tenant-specific theming
666
+ * Creates MUI theme from tenant configuration
666
667
  *
667
668
  * @example
668
669
  * ```tsx
@@ -674,12 +675,72 @@ const TenantThemeContext = React.createContext(undefined);
674
675
  * </TenantThemeProvider>
675
676
  * ```
676
677
  */
677
- function TenantThemeProvider({ children, tenantId, theme, }) {
678
+ function TenantThemeProvider({ children, tenantId, theme: tenantTheme, }) {
679
+ // Create MUI theme with tenant brand + defaults
680
+ const muiTheme = React.useMemo(() => styles.createTheme({
681
+ palette: {
682
+ // Tenant brand colors
683
+ primary: {
684
+ main: tenantTheme.palette.primary.main,
685
+ dark: tenantTheme.palette.primary.dark || tenantTheme.palette.primary.main,
686
+ light: tenantTheme.palette.primary.light || tenantTheme.palette.primary.main,
687
+ contrastText: '#fff',
688
+ },
689
+ secondary: {
690
+ main: tenantTheme.palette.secondary.main,
691
+ dark: tenantTheme.palette.secondary.dark || tenantTheme.palette.secondary.main,
692
+ light: tenantTheme.palette.secondary.light || tenantTheme.palette.secondary.main,
693
+ },
694
+ // MUI defaults for common patterns
695
+ background: {
696
+ default: '#ffffff',
697
+ paper: '#f9f9f9',
698
+ },
699
+ text: {
700
+ primary: '#13131B',
701
+ secondary: '#5F5E62',
702
+ },
703
+ divider: '#E1E2EB',
704
+ // Standard grey palette
705
+ grey: {
706
+ 50: '#FAFAFA',
707
+ 100: '#F5F5F5',
708
+ 200: '#EEEEEE',
709
+ 300: '#E0E0E0',
710
+ 400: '#BDBDBD',
711
+ 500: '#9E9E9E',
712
+ 600: '#757575',
713
+ 700: '#616161',
714
+ 800: '#424242',
715
+ 900: '#212121',
716
+ },
717
+ common: {
718
+ white: '#ffffff',
719
+ black: '#000000',
720
+ },
721
+ },
722
+ typography: {
723
+ fontFamily: tenantTheme.typography?.fontFamily || 'Roboto, sans-serif',
724
+ },
725
+ spacing: 8,
726
+ shape: {
727
+ borderRadius: 8,
728
+ },
729
+ breakpoints: {
730
+ values: {
731
+ xs: 0,
732
+ sm: 600,
733
+ md: 900,
734
+ lg: 1200,
735
+ xl: 1536,
736
+ },
737
+ },
738
+ }), [tenantTheme]);
678
739
  const value = React.useMemo(() => ({
679
740
  tenantId,
680
- theme,
681
- }), [tenantId, theme]);
682
- return (jsxRuntime.jsx(TenantThemeContext.Provider, { value: value, children: children }));
741
+ theme: tenantTheme,
742
+ }), [tenantId, tenantTheme]);
743
+ return (jsxRuntime.jsx(styles.ThemeProvider, { theme: muiTheme, children: jsxRuntime.jsx(TenantThemeContext.Provider, { value: value, children: children }) }));
683
744
  }
684
745
  /**
685
746
  * Hook to access tenant theme configuration
@@ -739,21 +800,20 @@ function useIsTenant(checkTenantId) {
739
800
  * ```
740
801
  */
741
802
  const Button = React__namespace.default.memo(function Button({ tenantColored = false, variant = 'contained', sx, color, ...props }) {
803
+ const theme = material.useTheme();
742
804
  const tenantTheme = useTenantTheme();
743
- const theme = tenantTheme?.theme;
744
- const baseWordSpacingSx = { wordSpacing: '0px' };
745
- const buttonSx = tenantColored && theme
805
+ const buttonSx = tenantColored && tenantTheme?.theme
746
806
  ? {
747
- ...baseWordSpacingSx,
748
- backgroundColor: theme.palette?.primary?.main,
749
- color: '#fff',
807
+ wordSpacing: 0,
808
+ backgroundColor: tenantTheme.theme.palette?.primary?.main,
809
+ color: theme.palette.common.white,
750
810
  '&:hover': {
751
- backgroundColor: theme.palette?.primary?.dark || theme.palette?.primary?.main,
811
+ backgroundColor: tenantTheme.theme.palette?.primary?.dark || tenantTheme.theme.palette?.primary?.main,
752
812
  },
753
813
  ...sx,
754
814
  }
755
815
  : {
756
- ...baseWordSpacingSx,
816
+ wordSpacing: 0,
757
817
  ...sx,
758
818
  };
759
819
  return (jsxRuntime.jsx(material.Button, { variant: variant, color: tenantColored ? undefined : color, sx: buttonSx, ...props }));
@@ -773,11 +833,11 @@ const Button = React__namespace.default.memo(function Button({ tenantColored = f
773
833
  * ```
774
834
  */
775
835
  const Card = React__namespace.default.memo(function Card({ title, headerAction, content, actions, tenantAccent = false, sx, children, ...props }) {
836
+ const theme = material.useTheme();
776
837
  const tenantTheme = useTenantTheme();
777
- const theme = tenantTheme?.theme;
778
- const cardSx = tenantAccent && theme
838
+ const cardSx = tenantAccent && tenantTheme?.theme
779
839
  ? {
780
- borderTop: `4px solid ${theme.palette?.primary?.main || '#000000'}`,
840
+ borderTop: `4px solid ${tenantTheme.theme.palette?.primary?.main || theme.palette.primary.main}`,
781
841
  ...sx,
782
842
  }
783
843
  : sx;
@@ -798,18 +858,18 @@ const Card = React__namespace.default.memo(function Card({ title, headerAction,
798
858
  * ```
799
859
  */
800
860
  const Banner = React__namespace.default.memo(function Banner({ title, description, action, gradient = true, sx, ...props }) {
861
+ const theme = material.useTheme();
801
862
  const tenantTheme = useTenantTheme();
802
- const theme = tenantTheme?.theme;
803
- const primaryColor = theme?.palette?.primary?.main || '#000000';
804
- const lightColor = theme?.palette?.primary?.light || primaryColor;
863
+ const primaryColor = tenantTheme?.theme?.palette?.primary?.main || theme.palette.primary.main;
864
+ const lightColor = tenantTheme?.theme?.palette?.primary?.light || theme.palette.primary.light;
805
865
  const background = gradient
806
866
  ? `linear-gradient(135deg, ${primaryColor} 0%, ${lightColor} 100%)`
807
867
  : primaryColor;
808
868
  return (jsxRuntime.jsxs(material.Box, { sx: {
809
869
  background,
810
- color: 'white',
811
- padding: '32px',
812
- borderRadius: '12px',
870
+ color: theme.palette.common.white,
871
+ padding: theme.spacing(4),
872
+ borderRadius: `${theme.shape.borderRadius}px`,
813
873
  textAlign: 'center',
814
874
  ...sx,
815
875
  }, ...props, children: [jsxRuntime.jsx(material.Typography, { variant: "h4", component: "h2", gutterBottom: true, fontWeight: "bold", children: title }), description && (jsxRuntime.jsx(material.Typography, { variant: "body1", sx: { opacity: 0.95, mb: action ? 2 : 0 }, children: description })), action && jsxRuntime.jsx(material.Box, { sx: { mt: 2 }, children: action })] }));
@@ -2052,16 +2112,16 @@ function sanitizeUrl(url, fallback = '#') {
2052
2112
  return fallback;
2053
2113
  }
2054
2114
 
2055
- const DivFooter = styles.styled('div')(() => ({
2056
- backgroundColor: '#424242',
2057
- padding: '20px 16px',
2058
- '@media (min-width: 769px)': {
2059
- padding: '70px 0px',
2115
+ const DivFooter = styles.styled('div')(({ theme }) => ({
2116
+ backgroundColor: theme.palette.grey[800],
2117
+ padding: theme.spacing(2.5, 2),
2118
+ [theme.breakpoints.up('md')]: {
2119
+ padding: theme.spacing(8.75, 0),
2060
2120
  },
2061
2121
  }));
2062
2122
  const DivFooterConterResponsiveLayout = styles.styled('div')(({ theme }) => ({
2063
- color: '#fff',
2064
- [theme.breakpoints.up(1025)]: {
2123
+ color: theme.palette.common.white,
2124
+ [theme.breakpoints.up('lg')]: {
2065
2125
  minWidth: '1128px',
2066
2126
  maxWidth: '1128px',
2067
2127
  margin: '0 auto',
@@ -2071,68 +2131,64 @@ const FooterHiddenContent = styles.styled('div')(({ simplifiedLayout }) => simpl
2071
2131
  const DivIglooIntro = styles.styled('div')(({ theme }) => ({
2072
2132
  display: 'flex',
2073
2133
  flexDirection: 'column',
2074
- gap: '24px',
2075
- color: theme?.palette.common?.white || '#fff',
2076
- '@media (min-width: 769px)': {
2134
+ gap: theme.spacing(3),
2135
+ color: theme.palette.common.white,
2136
+ [theme.breakpoints.up('md')]: {
2077
2137
  width: 320,
2078
2138
  marginRight: 194,
2079
2139
  },
2080
2140
  }));
2081
- const DivSocial = styles.styled('div')(() => ({
2141
+ const DivSocial = styles.styled('div')(({ theme }) => ({
2082
2142
  display: 'flex',
2083
2143
  alignItems: 'center',
2084
2144
  margin: '0 auto',
2085
- columnGap: '32px',
2145
+ columnGap: theme.spacing(4),
2086
2146
  flexDirection: 'row',
2087
- '@media (min-width: 769px)': {
2147
+ [theme.breakpoints.up('md')]: {
2088
2148
  margin: 'initial',
2089
2149
  },
2090
2150
  }));
2091
2151
  const ButtonIcon = styles.styled(material.Button)(({ theme }) => ({
2092
- color: theme.palette.common?.white || '#fff',
2093
- padding: '0 !important',
2094
- minWidth: 'auto !important',
2152
+ color: theme.palette.common.white,
2153
+ padding: 0,
2154
+ minWidth: 'auto',
2095
2155
  }));
2096
- const TypographyIntro = styles.styled(material.Typography)(() => ({
2156
+ const TypographyIntro = styles.styled(material.Typography)(({ theme }) => ({
2097
2157
  textAlign: 'center',
2098
- color: `#fff !important`,
2099
- '@media (min-width: 769px)': {
2158
+ color: theme.palette.common.white,
2159
+ [theme.breakpoints.up('md')]: {
2100
2160
  textAlign: 'left',
2101
2161
  },
2102
2162
  }));
2103
- const TypographyAddressFooter = styles.styled(material.Typography)(() => ({
2104
- marginTop: 16,
2163
+ const TypographyAddressFooter = styles.styled(material.Typography)(({ theme }) => ({
2164
+ marginTop: theme.spacing(2),
2105
2165
  textAlign: 'center',
2106
- color: '#fff',
2107
- '@media (min-width: 769px)': {
2166
+ color: theme.palette.common.white,
2167
+ [theme.breakpoints.up('md')]: {
2108
2168
  textAlign: 'left',
2109
2169
  },
2110
2170
  }));
2111
- const DivLogos = styles.styled('div')(() => ({
2171
+ const DivLogos = styles.styled('div')(({ theme }) => ({
2112
2172
  display: 'flex',
2113
2173
  flexDirection: 'column',
2114
- gap: 16,
2174
+ gap: theme.spacing(2),
2115
2175
  alignItems: 'center',
2116
- marginTop: 16,
2117
- '@media (min-width: 769px)': {
2176
+ marginTop: theme.spacing(2),
2177
+ [theme.breakpoints.up('md')]: {
2118
2178
  width: '100%',
2119
2179
  marginTop: 0,
2120
2180
  gap: 'initial',
2121
2181
  alignItems: 'baseline',
2122
2182
  },
2123
2183
  }));
2124
- const DivFirstRow = styles.styled('div')(() => ({
2184
+ const DivFirstRow = styles.styled('div')(({ theme }) => ({
2125
2185
  display: 'flex',
2126
2186
  flexDirection: 'row',
2127
- gap: 16,
2187
+ gap: theme.spacing(2),
2128
2188
  }));
2129
2189
  const ButtonOjkLink = styles.styled(material.Button)(() => ({
2130
2190
  display: 'flex',
2131
2191
  justifyContent: 'flex-start',
2132
- '@media (min-width: 769px)': {
2133
- display: 'flex !important',
2134
- justifyContent: 'flex-start !important ',
2135
- },
2136
2192
  }));
2137
2193
  const ImageOjkLicense = styles.styled('img')(() => ({
2138
2194
  alignSelf: 'flex-start',
@@ -2145,53 +2201,53 @@ const ButtonSolisoustamaLink = styles.styled(material.Button)(() => ({
2145
2201
  const ImageSolisoustama = styles.styled('img')(() => ({
2146
2202
  height: 'auto',
2147
2203
  }));
2148
- const DivLinks = styles.styled('div')(() => ({
2204
+ const DivLinks = styles.styled('div')(({ theme }) => ({
2149
2205
  display: 'flex',
2150
2206
  flex: 1,
2151
2207
  alignItems: 'center',
2152
- gap: 16,
2208
+ gap: theme.spacing(2),
2153
2209
  justifyContent: 'center',
2154
- '@media (min-width: 769px)': {
2210
+ [theme.breakpoints.up('md')]: {
2155
2211
  flex: '1 1',
2156
2212
  alignItems: 'normal',
2157
2213
  },
2158
2214
  }));
2159
- const DivSection = styles.styled('div')(() => ({
2215
+ const DivSection = styles.styled('div')(({ theme }) => ({
2160
2216
  display: 'flex',
2161
2217
  flexDirection: 'column',
2162
- gap: 16,
2218
+ gap: theme.spacing(2),
2163
2219
  flex: 1,
2164
2220
  alignItems: 'flex-start',
2165
- '@media (min-width: 769px)': {
2166
- gap: 24,
2221
+ [theme.breakpoints.up('md')]: {
2222
+ gap: theme.spacing(3),
2167
2223
  '&:not(:first-of-type)': {
2168
2224
  marginLeft: 194,
2169
2225
  },
2170
2226
  },
2171
2227
  }));
2172
- const ButtonBottomLink = styles.styled(material.Button)(() => ({
2173
- color: '#fff !important',
2228
+ const ButtonBottomLink = styles.styled(material.Button)(({ theme }) => ({
2229
+ color: theme.palette.common.white,
2174
2230
  textTransform: 'capitalize',
2175
- '@media (min-width: 769px)': {
2176
- padding: '0 !important',
2177
- textAlign: 'left !important',
2178
- minWidth: 'auto !important',
2231
+ [theme.breakpoints.up('md')]: {
2232
+ padding: 0,
2233
+ textAlign: 'left',
2234
+ minWidth: 'auto',
2179
2235
  },
2180
2236
  }));
2181
- const StyledDivider = styles.styled(material.Divider)(() => ({
2182
- margin: '24px 0 16px !important',
2183
- borderColor: '#5F5E62 !important',
2237
+ const StyledDivider = styles.styled(material.Divider)(({ theme }) => ({
2238
+ margin: theme.spacing(3, 0, 2),
2239
+ borderColor: '#5F5E62',
2184
2240
  }));
2185
2241
  const DivBottom = styles.styled('div')(() => ({
2186
2242
  display: 'flex',
2187
2243
  justifyContent: 'space-between',
2188
2244
  alignItems: 'center',
2189
2245
  }));
2190
- const DivSep = styles.styled('div')(() => ({
2246
+ const DivSep = styles.styled('div')(({ theme }) => ({
2191
2247
  width: '1px',
2192
2248
  height: 10,
2193
2249
  borderRadius: '1px',
2194
- backgroundColor: '#fff',
2250
+ backgroundColor: theme.palette.common.white,
2195
2251
  }));
2196
2252
  const AnchorLink = styles.styled('a')(() => ({
2197
2253
  color: 'inherit',