@rabex-kit/rabex-ui 0.1.33 → 0.1.35

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.
@@ -3126,20 +3126,32 @@ var RabexTabs = {
3126
3126
  root: function root(_ref) {
3127
3127
  var ownerState = _ref.ownerState,
3128
3128
  theme = _ref.theme;
3129
- return _extends({
3129
+ // The ownerState now contains all the props you need
3130
+ var _ref2 = ownerState || {},
3131
+ hasBorder = _ref2.hasBorder,
3132
+ isSeparate = _ref2.isSeparate,
3133
+ size = _ref2.size,
3134
+ mode = _ref2.mode,
3135
+ variant = _ref2.variant,
3136
+ orientation = _ref2.orientation;
3137
+ // Default styles applied to all tabs
3138
+ var baseStyles = {
3130
3139
  borderRadius: 8,
3131
3140
  minHeight: 'unset',
3132
- color: theme.palette.base.A10
3133
- }, ownerState.mode === 'underline' && {
3141
+ color: theme.palette.base.A10,
3142
+ /// remove the separation border
3143
+ '& .MuiTab-root::after': {
3144
+ display: 'none'
3145
+ }
3146
+ };
3147
+ // Mode-specific styles
3148
+ var modeStyles = mode === 'underline' ? {
3134
3149
  '& .MuiTab-root.Mui-selected': {
3135
3150
  borderRadius: 4,
3136
3151
  color: theme.palette.mode === 'light' ? theme.palette.textColor.A60 : theme.palette.textColor.A0
3137
3152
  },
3138
- '& .MuiTabs-flexContainer': {
3139
- // padding: theme.spacing(1)
3140
- },
3141
3153
  backgroundColor: 'unset'
3142
- }, ownerState.mode === 'pill' && {
3154
+ } : {
3143
3155
  '& .MuiTab-root.Mui-selected': {
3144
3156
  borderRadius: 4,
3145
3157
  color: theme.palette.mode === 'light' ? theme.palette.textColor.A60 : theme.palette.textColor.A0
@@ -3148,58 +3160,97 @@ var RabexTabs = {
3148
3160
  padding: theme.spacing(1)
3149
3161
  },
3150
3162
  backgroundColor: theme.palette.mode === 'light' ? theme.palette.secondary.A100 : theme.palette.secondary.A100
3151
- }, ownerState.size === 'sm' && {
3152
- '& .MuiTabs-fixed': {
3153
- padding: theme.spacing(1, 2),
3154
- marginBottom: theme.spacing(2)
3155
- },
3156
- height: theme.spacing(8),
3157
- borderRadius: theme.spacing(2)
3158
- }, ownerState.size === 'md' && {
3159
- '& .MuiTabs-fixed': {
3160
- padding: theme.spacing(2, 4),
3161
- marginBottom: theme.spacing(2)
3162
- },
3163
- height: theme.spacing(10),
3164
- borderRadius: theme.spacing(2)
3165
- }, ownerState.size === 'lg' && {
3166
- '& .MuiTabs-fixed': {
3167
- padding: theme.spacing(3, 4),
3168
- marginBottom: theme.spacing(3)
3169
- },
3170
- height: theme.spacing(12),
3171
- borderRadius: theme.spacing(3)
3172
- }, ownerState.mode === 'underline' && {
3173
- '& .MuiTab-root.Mui-selected': {
3174
- borderRadius: 4,
3175
- color: theme.palette.mode === 'light' ? theme.palette.textColor.A60 : theme.palette.textColor.A0
3163
+ };
3164
+ // Size-specific styles
3165
+ var sizeMap = mode === 'underline' ? {
3166
+ sm: {
3167
+ '& .MuiTabs-fixed': {
3168
+ '& .MuiTab-root': {
3169
+ padding: theme.spacing(1, 2)
3170
+ },
3171
+ // padding: theme.spacing(1, 2),
3172
+ marginBottom: theme.spacing(2)
3173
+ },
3174
+ height: theme.spacing(8),
3175
+ borderRadius: theme.spacing(2)
3176
3176
  },
3177
- '& .MuiTabs-flexContainer': {
3178
- padding: theme.spacing(1)
3177
+ md: {
3178
+ '& .MuiTabs-fixed': {
3179
+ '& .MuiTab-root': {
3180
+ padding: theme.spacing(2, 4)
3181
+ },
3182
+ // padding: theme.spacing(2, 4),
3183
+ marginBottom: theme.spacing(2)
3184
+ },
3185
+ height: theme.spacing(10),
3186
+ borderRadius: theme.spacing(2)
3179
3187
  },
3180
- backgroundColor: 'unset'
3181
- }, ownerState.mode === 'pill' && {
3182
- '& .MuiTab-root.Mui-selected': {
3183
- borderRadius: 4,
3184
- color: theme.palette.mode === 'light' ? theme.palette.textColor.A60 : theme.palette.textColor.A0
3188
+ lg: {
3189
+ '& .MuiTabs-fixed': {
3190
+ '& .MuiTab-root': {
3191
+ padding: theme.spacing(3, 4)
3192
+ },
3193
+ // padding: theme.spacing(3, 4),
3194
+ marginBottom: theme.spacing(3)
3195
+ },
3196
+ height: theme.spacing(12),
3197
+ borderRadius: theme.spacing(3)
3198
+ }
3199
+ } : {
3200
+ sm: {
3201
+ '& .MuiTabs-fixed': {
3202
+ padding: theme.spacing(1, 2),
3203
+ marginBottom: theme.spacing(2)
3204
+ },
3205
+ height: theme.spacing(8),
3206
+ borderRadius: theme.spacing(2)
3185
3207
  },
3186
- '& .MuiTabs-flexContainer': {
3187
- padding: theme.spacing(1)
3208
+ md: {
3209
+ '& .MuiTabs-fixed': {
3210
+ padding: theme.spacing(2, 4),
3211
+ marginBottom: theme.spacing(2)
3212
+ },
3213
+ height: theme.spacing(10),
3214
+ borderRadius: theme.spacing(2)
3188
3215
  },
3189
- backgroundColor: theme.palette.mode === 'light' ? theme.palette.secondary.A100 : theme.palette.secondary.A100
3190
- }, ownerState.variant === 'fullWidth' && {
3216
+ lg: {
3217
+ '& .MuiTabs-fixed': {
3218
+ padding: theme.spacing(3, 4),
3219
+ marginBottom: theme.spacing(3)
3220
+ },
3221
+ height: theme.spacing(12),
3222
+ borderRadius: theme.spacing(3)
3223
+ }
3224
+ };
3225
+ var sizeStyles = sizeMap[size || 'sm'] || sizeMap.sm;
3226
+ // Variant-specific styles
3227
+ var variantStyles = variant === 'fullWidth' ? {
3191
3228
  width: '100%'
3192
- }, ownerState.orientation === 'vertical' && {
3229
+ } : {};
3230
+ // Orientation-specific styles
3231
+ var orientationStyles = orientation === 'vertical' ? {
3193
3232
  '& .MuiTab-root::after': {
3194
3233
  content: 'unset',
3195
3234
  display: 'none'
3196
3235
  }
3197
- });
3236
+ } : {};
3237
+ // Border styles
3238
+ var borderStyles = hasBorder ? isSeparate ? {
3239
+ '& .MuiTab-root': {
3240
+ borderRadius: 5,
3241
+ padding: theme.spacing(2, 3),
3242
+ border: "2px dotted " + theme.palette.base.A40
3243
+ }
3244
+ } : {
3245
+ border: "2px dotted " + theme.palette.base.A40
3246
+ } : {};
3247
+ // Return combined styles
3248
+ return _extends({}, baseStyles, modeStyles, sizeStyles, variantStyles, orientationStyles, borderStyles);
3198
3249
  },
3199
- indicator: function indicator(_ref2) {
3200
- var ownerState = _ref2.ownerState;
3250
+ indicator: function indicator(_ref3) {
3251
+ var ownerState = _ref3.ownerState;
3201
3252
  return {
3202
- display: ownerState.mode === 'underline' ? 'show' : 'none'
3253
+ display: (ownerState === null || ownerState === void 0 ? void 0 : ownerState.mode) === 'underline' ? 'show' : 'none'
3203
3254
  };
3204
3255
  }
3205
3256
  },