@sinco/react 1.0.4-rc.6 → 1.0.4-rc.7
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/index.js +1135 -62
- package/package.json +1 -1
- package/src/lib/Components/EmptyState.d.ts +1 -2
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { forwardRef, useContext } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
6
|
|
|
@@ -1088,6 +1088,15 @@ $$1({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$2
|
|
|
1088
1088
|
assign: assign$2
|
|
1089
1089
|
});
|
|
1090
1090
|
|
|
1091
|
+
function chainPropTypes(propType1, propType2) {
|
|
1092
|
+
if (process.env.NODE_ENV === 'production') {
|
|
1093
|
+
return () => null;
|
|
1094
|
+
}
|
|
1095
|
+
return function validate(...args) {
|
|
1096
|
+
return propType1(...args) || propType2(...args);
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1091
1100
|
function isPlainObject(item) {
|
|
1092
1101
|
return item !== null && typeof item === 'object' && item.constructor === Object;
|
|
1093
1102
|
}
|
|
@@ -2554,6 +2563,58 @@ function capitalize(string) {
|
|
|
2554
2563
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
2555
2564
|
}
|
|
2556
2565
|
|
|
2566
|
+
function getTypeByValue(value) {
|
|
2567
|
+
const valueType = typeof value;
|
|
2568
|
+
switch (valueType) {
|
|
2569
|
+
case 'number':
|
|
2570
|
+
if (Number.isNaN(value)) {
|
|
2571
|
+
return 'NaN';
|
|
2572
|
+
}
|
|
2573
|
+
if (!Number.isFinite(value)) {
|
|
2574
|
+
return 'Infinity';
|
|
2575
|
+
}
|
|
2576
|
+
if (value !== Math.floor(value)) {
|
|
2577
|
+
return 'float';
|
|
2578
|
+
}
|
|
2579
|
+
return 'number';
|
|
2580
|
+
case 'object':
|
|
2581
|
+
if (value === null) {
|
|
2582
|
+
return 'null';
|
|
2583
|
+
}
|
|
2584
|
+
return value.constructor.name;
|
|
2585
|
+
default:
|
|
2586
|
+
return valueType;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
// IE 11 support
|
|
2591
|
+
function ponyfillIsInteger(x) {
|
|
2592
|
+
// eslint-disable-next-line no-restricted-globals
|
|
2593
|
+
return typeof x === 'number' && isFinite(x) && Math.floor(x) === x;
|
|
2594
|
+
}
|
|
2595
|
+
const isInteger = Number.isInteger || ponyfillIsInteger;
|
|
2596
|
+
function requiredInteger(props, propName, componentName, location) {
|
|
2597
|
+
const propValue = props[propName];
|
|
2598
|
+
if (propValue == null || !isInteger(propValue)) {
|
|
2599
|
+
const propType = getTypeByValue(propValue);
|
|
2600
|
+
return new RangeError(`Invalid ${location} \`${propName}\` of type \`${propType}\` supplied to \`${componentName}\`, expected \`integer\`.`);
|
|
2601
|
+
}
|
|
2602
|
+
return null;
|
|
2603
|
+
}
|
|
2604
|
+
function validator(props, propName, ...other) {
|
|
2605
|
+
const propValue = props[propName];
|
|
2606
|
+
if (propValue === undefined) {
|
|
2607
|
+
return null;
|
|
2608
|
+
}
|
|
2609
|
+
return requiredInteger(props, propName, ...other);
|
|
2610
|
+
}
|
|
2611
|
+
function validatorNoop() {
|
|
2612
|
+
return null;
|
|
2613
|
+
}
|
|
2614
|
+
validator.isRequired = requiredInteger;
|
|
2615
|
+
validatorNoop.isRequired = validatorNoop;
|
|
2616
|
+
var integerPropType = process.env.NODE_ENV === 'production' ? validatorNoop : validator;
|
|
2617
|
+
|
|
2557
2618
|
/**
|
|
2558
2619
|
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
2559
2620
|
* @param {object} defaultProps
|
|
@@ -4936,7 +4997,7 @@ tags.forEach(function (tagName) {
|
|
|
4936
4997
|
* This source code is licensed under the MIT license found in the
|
|
4937
4998
|
* LICENSE file in the root directory of this source tree.
|
|
4938
4999
|
*/
|
|
4939
|
-
function styled$
|
|
5000
|
+
function styled$3(tag, options) {
|
|
4940
5001
|
const stylesFactory = newStyled(tag, options);
|
|
4941
5002
|
if (process.env.NODE_ENV !== 'production') {
|
|
4942
5003
|
return (...styles) => {
|
|
@@ -4961,7 +5022,7 @@ const internal_processStyles = (tag, processor) => {
|
|
|
4961
5022
|
}
|
|
4962
5023
|
};
|
|
4963
5024
|
|
|
4964
|
-
const _excluded$
|
|
5025
|
+
const _excluded$f = ["values", "unit", "step"];
|
|
4965
5026
|
const sortBreakpointsValues = values => {
|
|
4966
5027
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
4967
5028
|
key,
|
|
@@ -4996,7 +5057,7 @@ function createBreakpoints(breakpoints) {
|
|
|
4996
5057
|
unit = 'px',
|
|
4997
5058
|
step = 5
|
|
4998
5059
|
} = breakpoints,
|
|
4999
|
-
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$
|
|
5060
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded$f);
|
|
5000
5061
|
const sortedValues = sortBreakpointsValues(values);
|
|
5001
5062
|
const keys = Object.keys(sortedValues);
|
|
5002
5063
|
function up(key) {
|
|
@@ -5122,6 +5183,61 @@ function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
5122
5183
|
return acc;
|
|
5123
5184
|
}, style);
|
|
5124
5185
|
}
|
|
5186
|
+
function mergeBreakpointsInOrder(breakpointsInput, ...styles) {
|
|
5187
|
+
const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);
|
|
5188
|
+
const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});
|
|
5189
|
+
return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);
|
|
5190
|
+
}
|
|
5191
|
+
|
|
5192
|
+
// compute base for responsive values; e.g.,
|
|
5193
|
+
// [1,2,3] => {xs: true, sm: true, md: true}
|
|
5194
|
+
// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}
|
|
5195
|
+
function computeBreakpointsBase(breakpointValues, themeBreakpoints) {
|
|
5196
|
+
// fixed value
|
|
5197
|
+
if (typeof breakpointValues !== 'object') {
|
|
5198
|
+
return {};
|
|
5199
|
+
}
|
|
5200
|
+
const base = {};
|
|
5201
|
+
const breakpointsKeys = Object.keys(themeBreakpoints);
|
|
5202
|
+
if (Array.isArray(breakpointValues)) {
|
|
5203
|
+
breakpointsKeys.forEach((breakpoint, i) => {
|
|
5204
|
+
if (i < breakpointValues.length) {
|
|
5205
|
+
base[breakpoint] = true;
|
|
5206
|
+
}
|
|
5207
|
+
});
|
|
5208
|
+
} else {
|
|
5209
|
+
breakpointsKeys.forEach(breakpoint => {
|
|
5210
|
+
if (breakpointValues[breakpoint] != null) {
|
|
5211
|
+
base[breakpoint] = true;
|
|
5212
|
+
}
|
|
5213
|
+
});
|
|
5214
|
+
}
|
|
5215
|
+
return base;
|
|
5216
|
+
}
|
|
5217
|
+
function resolveBreakpointValues({
|
|
5218
|
+
values: breakpointValues,
|
|
5219
|
+
breakpoints: themeBreakpoints,
|
|
5220
|
+
base: customBase
|
|
5221
|
+
}) {
|
|
5222
|
+
const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);
|
|
5223
|
+
const keys = Object.keys(base);
|
|
5224
|
+
if (keys.length === 0) {
|
|
5225
|
+
return breakpointValues;
|
|
5226
|
+
}
|
|
5227
|
+
let previous;
|
|
5228
|
+
return keys.reduce((acc, breakpoint, i) => {
|
|
5229
|
+
if (Array.isArray(breakpointValues)) {
|
|
5230
|
+
acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];
|
|
5231
|
+
previous = i;
|
|
5232
|
+
} else if (typeof breakpointValues === 'object') {
|
|
5233
|
+
acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];
|
|
5234
|
+
previous = breakpoint;
|
|
5235
|
+
} else {
|
|
5236
|
+
acc[breakpoint] = breakpointValues;
|
|
5237
|
+
}
|
|
5238
|
+
return acc;
|
|
5239
|
+
}, {});
|
|
5240
|
+
}
|
|
5125
5241
|
|
|
5126
5242
|
function getPath(obj, path, checkVars = true) {
|
|
5127
5243
|
if (!path || typeof path !== 'string') {
|
|
@@ -5156,7 +5272,7 @@ function getStyleValue(themeMapping, transform, propValueFinal, userValue = prop
|
|
|
5156
5272
|
}
|
|
5157
5273
|
return value;
|
|
5158
5274
|
}
|
|
5159
|
-
function style$
|
|
5275
|
+
function style$2(options) {
|
|
5160
5276
|
const {
|
|
5161
5277
|
prop,
|
|
5162
5278
|
cssProperty = options.prop,
|
|
@@ -5317,12 +5433,12 @@ function resolveCssProperty(props, keys, prop, transformer) {
|
|
|
5317
5433
|
const propValue = props[prop];
|
|
5318
5434
|
return handleBreakpoints(props, propValue, styleFromPropValue);
|
|
5319
5435
|
}
|
|
5320
|
-
function style(props, keys) {
|
|
5436
|
+
function style$1(props, keys) {
|
|
5321
5437
|
const transformer = createUnarySpacing(props.theme);
|
|
5322
5438
|
return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});
|
|
5323
5439
|
}
|
|
5324
5440
|
function margin(props) {
|
|
5325
|
-
return style(props, marginKeys);
|
|
5441
|
+
return style$1(props, marginKeys);
|
|
5326
5442
|
}
|
|
5327
5443
|
margin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {
|
|
5328
5444
|
obj[key] = responsivePropType$1;
|
|
@@ -5330,7 +5446,7 @@ margin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((ob
|
|
|
5330
5446
|
}, {}) : {};
|
|
5331
5447
|
margin.filterProps = marginKeys;
|
|
5332
5448
|
function padding(props) {
|
|
5333
|
-
return style(props, paddingKeys);
|
|
5449
|
+
return style$1(props, paddingKeys);
|
|
5334
5450
|
}
|
|
5335
5451
|
padding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {
|
|
5336
5452
|
obj[key] = responsivePropType$1;
|
|
@@ -5404,48 +5520,48 @@ function borderTransform(value) {
|
|
|
5404
5520
|
}
|
|
5405
5521
|
return `${value}px solid`;
|
|
5406
5522
|
}
|
|
5407
|
-
const border = style$
|
|
5523
|
+
const border = style$2({
|
|
5408
5524
|
prop: 'border',
|
|
5409
5525
|
themeKey: 'borders',
|
|
5410
5526
|
transform: borderTransform
|
|
5411
5527
|
});
|
|
5412
|
-
const borderTop = style$
|
|
5528
|
+
const borderTop = style$2({
|
|
5413
5529
|
prop: 'borderTop',
|
|
5414
5530
|
themeKey: 'borders',
|
|
5415
5531
|
transform: borderTransform
|
|
5416
5532
|
});
|
|
5417
|
-
const borderRight = style$
|
|
5533
|
+
const borderRight = style$2({
|
|
5418
5534
|
prop: 'borderRight',
|
|
5419
5535
|
themeKey: 'borders',
|
|
5420
5536
|
transform: borderTransform
|
|
5421
5537
|
});
|
|
5422
|
-
const borderBottom = style$
|
|
5538
|
+
const borderBottom = style$2({
|
|
5423
5539
|
prop: 'borderBottom',
|
|
5424
5540
|
themeKey: 'borders',
|
|
5425
5541
|
transform: borderTransform
|
|
5426
5542
|
});
|
|
5427
|
-
const borderLeft = style$
|
|
5543
|
+
const borderLeft = style$2({
|
|
5428
5544
|
prop: 'borderLeft',
|
|
5429
5545
|
themeKey: 'borders',
|
|
5430
5546
|
transform: borderTransform
|
|
5431
5547
|
});
|
|
5432
|
-
const borderColor = style$
|
|
5548
|
+
const borderColor = style$2({
|
|
5433
5549
|
prop: 'borderColor',
|
|
5434
5550
|
themeKey: 'palette'
|
|
5435
5551
|
});
|
|
5436
|
-
const borderTopColor = style$
|
|
5552
|
+
const borderTopColor = style$2({
|
|
5437
5553
|
prop: 'borderTopColor',
|
|
5438
5554
|
themeKey: 'palette'
|
|
5439
5555
|
});
|
|
5440
|
-
const borderRightColor = style$
|
|
5556
|
+
const borderRightColor = style$2({
|
|
5441
5557
|
prop: 'borderRightColor',
|
|
5442
5558
|
themeKey: 'palette'
|
|
5443
5559
|
});
|
|
5444
|
-
const borderBottomColor = style$
|
|
5560
|
+
const borderBottomColor = style$2({
|
|
5445
5561
|
prop: 'borderBottomColor',
|
|
5446
5562
|
themeKey: 'palette'
|
|
5447
5563
|
});
|
|
5448
|
-
const borderLeftColor = style$
|
|
5564
|
+
const borderLeftColor = style$2({
|
|
5449
5565
|
prop: 'borderLeftColor',
|
|
5450
5566
|
themeKey: 'palette'
|
|
5451
5567
|
});
|
|
@@ -5518,31 +5634,31 @@ rowGap.propTypes = process.env.NODE_ENV !== 'production' ? {
|
|
|
5518
5634
|
rowGap: responsivePropType$1
|
|
5519
5635
|
} : {};
|
|
5520
5636
|
rowGap.filterProps = ['rowGap'];
|
|
5521
|
-
const gridColumn = style$
|
|
5637
|
+
const gridColumn = style$2({
|
|
5522
5638
|
prop: 'gridColumn'
|
|
5523
5639
|
});
|
|
5524
|
-
const gridRow = style$
|
|
5640
|
+
const gridRow = style$2({
|
|
5525
5641
|
prop: 'gridRow'
|
|
5526
5642
|
});
|
|
5527
|
-
const gridAutoFlow = style$
|
|
5643
|
+
const gridAutoFlow = style$2({
|
|
5528
5644
|
prop: 'gridAutoFlow'
|
|
5529
5645
|
});
|
|
5530
|
-
const gridAutoColumns = style$
|
|
5646
|
+
const gridAutoColumns = style$2({
|
|
5531
5647
|
prop: 'gridAutoColumns'
|
|
5532
5648
|
});
|
|
5533
|
-
const gridAutoRows = style$
|
|
5649
|
+
const gridAutoRows = style$2({
|
|
5534
5650
|
prop: 'gridAutoRows'
|
|
5535
5651
|
});
|
|
5536
|
-
const gridTemplateColumns = style$
|
|
5652
|
+
const gridTemplateColumns = style$2({
|
|
5537
5653
|
prop: 'gridTemplateColumns'
|
|
5538
5654
|
});
|
|
5539
|
-
const gridTemplateRows = style$
|
|
5655
|
+
const gridTemplateRows = style$2({
|
|
5540
5656
|
prop: 'gridTemplateRows'
|
|
5541
5657
|
});
|
|
5542
|
-
const gridTemplateAreas = style$
|
|
5658
|
+
const gridTemplateAreas = style$2({
|
|
5543
5659
|
prop: 'gridTemplateAreas'
|
|
5544
5660
|
});
|
|
5545
|
-
const gridArea = style$
|
|
5661
|
+
const gridArea = style$2({
|
|
5546
5662
|
prop: 'gridArea'
|
|
5547
5663
|
});
|
|
5548
5664
|
compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);
|
|
@@ -5553,18 +5669,18 @@ function paletteTransform(value, userValue) {
|
|
|
5553
5669
|
}
|
|
5554
5670
|
return value;
|
|
5555
5671
|
}
|
|
5556
|
-
const color = style$
|
|
5672
|
+
const color = style$2({
|
|
5557
5673
|
prop: 'color',
|
|
5558
5674
|
themeKey: 'palette',
|
|
5559
5675
|
transform: paletteTransform
|
|
5560
5676
|
});
|
|
5561
|
-
const bgcolor = style$
|
|
5677
|
+
const bgcolor = style$2({
|
|
5562
5678
|
prop: 'bgcolor',
|
|
5563
5679
|
cssProperty: 'backgroundColor',
|
|
5564
5680
|
themeKey: 'palette',
|
|
5565
5681
|
transform: paletteTransform
|
|
5566
5682
|
});
|
|
5567
|
-
const backgroundColor = style$
|
|
5683
|
+
const backgroundColor = style$2({
|
|
5568
5684
|
prop: 'backgroundColor',
|
|
5569
5685
|
themeKey: 'palette',
|
|
5570
5686
|
transform: paletteTransform
|
|
@@ -5574,7 +5690,7 @@ compose(color, bgcolor, backgroundColor);
|
|
|
5574
5690
|
function sizingTransform(value) {
|
|
5575
5691
|
return value <= 1 && value !== 0 ? `${value * 100}%` : value;
|
|
5576
5692
|
}
|
|
5577
|
-
const width = style$
|
|
5693
|
+
const width = style$2({
|
|
5578
5694
|
prop: 'width',
|
|
5579
5695
|
transform: sizingTransform
|
|
5580
5696
|
});
|
|
@@ -5592,33 +5708,33 @@ const maxWidth = props => {
|
|
|
5592
5708
|
return null;
|
|
5593
5709
|
};
|
|
5594
5710
|
maxWidth.filterProps = ['maxWidth'];
|
|
5595
|
-
const minWidth = style$
|
|
5711
|
+
const minWidth = style$2({
|
|
5596
5712
|
prop: 'minWidth',
|
|
5597
5713
|
transform: sizingTransform
|
|
5598
5714
|
});
|
|
5599
|
-
const height = style$
|
|
5715
|
+
const height = style$2({
|
|
5600
5716
|
prop: 'height',
|
|
5601
5717
|
transform: sizingTransform
|
|
5602
5718
|
});
|
|
5603
|
-
const maxHeight = style$
|
|
5719
|
+
const maxHeight = style$2({
|
|
5604
5720
|
prop: 'maxHeight',
|
|
5605
5721
|
transform: sizingTransform
|
|
5606
5722
|
});
|
|
5607
|
-
const minHeight = style$
|
|
5723
|
+
const minHeight = style$2({
|
|
5608
5724
|
prop: 'minHeight',
|
|
5609
5725
|
transform: sizingTransform
|
|
5610
5726
|
});
|
|
5611
|
-
style$
|
|
5727
|
+
style$2({
|
|
5612
5728
|
prop: 'size',
|
|
5613
5729
|
cssProperty: 'width',
|
|
5614
5730
|
transform: sizingTransform
|
|
5615
5731
|
});
|
|
5616
|
-
style$
|
|
5732
|
+
style$2({
|
|
5617
5733
|
prop: 'size',
|
|
5618
5734
|
cssProperty: 'height',
|
|
5619
5735
|
transform: sizingTransform
|
|
5620
5736
|
});
|
|
5621
|
-
const boxSizing = style$
|
|
5737
|
+
const boxSizing = style$2({
|
|
5622
5738
|
prop: 'boxSizing'
|
|
5623
5739
|
});
|
|
5624
5740
|
compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);
|
|
@@ -6025,7 +6141,7 @@ const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
|
6025
6141
|
styleFunctionSx.filterProps = ['sx'];
|
|
6026
6142
|
var styleFunctionSx$1 = styleFunctionSx;
|
|
6027
6143
|
|
|
6028
|
-
const _excluded$
|
|
6144
|
+
const _excluded$e = ["breakpoints", "palette", "spacing", "shape"];
|
|
6029
6145
|
function createTheme$1(options = {}, ...args) {
|
|
6030
6146
|
const {
|
|
6031
6147
|
breakpoints: breakpointsInput = {},
|
|
@@ -6033,7 +6149,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6033
6149
|
spacing: spacingInput,
|
|
6034
6150
|
shape: shapeInput = {}
|
|
6035
6151
|
} = options,
|
|
6036
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
6152
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$e);
|
|
6037
6153
|
const breakpoints = createBreakpoints(breakpointsInput);
|
|
6038
6154
|
const spacing = createSpacing(spacingInput);
|
|
6039
6155
|
let muiTheme = deepmerge({
|
|
@@ -6061,19 +6177,64 @@ function createTheme$1(options = {}, ...args) {
|
|
|
6061
6177
|
function isObjectEmpty(obj) {
|
|
6062
6178
|
return Object.keys(obj).length === 0;
|
|
6063
6179
|
}
|
|
6064
|
-
function useTheme$
|
|
6180
|
+
function useTheme$2(defaultTheme = null) {
|
|
6065
6181
|
const contextTheme = React.useContext(ThemeContext);
|
|
6066
6182
|
return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;
|
|
6067
6183
|
}
|
|
6068
6184
|
|
|
6069
6185
|
const systemDefaultTheme$1 = createTheme$1();
|
|
6070
|
-
function useTheme(defaultTheme = systemDefaultTheme$1) {
|
|
6071
|
-
return useTheme$
|
|
6186
|
+
function useTheme$1(defaultTheme = systemDefaultTheme$1) {
|
|
6187
|
+
return useTheme$2(defaultTheme);
|
|
6188
|
+
}
|
|
6189
|
+
|
|
6190
|
+
const _excluded$d = ["sx"];
|
|
6191
|
+
const splitProps = props => {
|
|
6192
|
+
var _props$theme$unstable, _props$theme;
|
|
6193
|
+
const result = {
|
|
6194
|
+
systemProps: {},
|
|
6195
|
+
otherProps: {}
|
|
6196
|
+
};
|
|
6197
|
+
const config = (_props$theme$unstable = props == null ? void 0 : (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1;
|
|
6198
|
+
Object.keys(props).forEach(prop => {
|
|
6199
|
+
if (config[prop]) {
|
|
6200
|
+
result.systemProps[prop] = props[prop];
|
|
6201
|
+
} else {
|
|
6202
|
+
result.otherProps[prop] = props[prop];
|
|
6203
|
+
}
|
|
6204
|
+
});
|
|
6205
|
+
return result;
|
|
6206
|
+
};
|
|
6207
|
+
function extendSxProp(props) {
|
|
6208
|
+
const {
|
|
6209
|
+
sx: inSx
|
|
6210
|
+
} = props,
|
|
6211
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$d);
|
|
6212
|
+
const {
|
|
6213
|
+
systemProps,
|
|
6214
|
+
otherProps
|
|
6215
|
+
} = splitProps(other);
|
|
6216
|
+
let finalSx;
|
|
6217
|
+
if (Array.isArray(inSx)) {
|
|
6218
|
+
finalSx = [systemProps, ...inSx];
|
|
6219
|
+
} else if (typeof inSx === 'function') {
|
|
6220
|
+
finalSx = (...args) => {
|
|
6221
|
+
const result = inSx(...args);
|
|
6222
|
+
if (!isPlainObject(result)) {
|
|
6223
|
+
return systemProps;
|
|
6224
|
+
}
|
|
6225
|
+
return _extends({}, systemProps, result);
|
|
6226
|
+
};
|
|
6227
|
+
} else {
|
|
6228
|
+
finalSx = _extends({}, systemProps, inSx);
|
|
6229
|
+
}
|
|
6230
|
+
return _extends({}, otherProps, {
|
|
6231
|
+
sx: finalSx
|
|
6232
|
+
});
|
|
6072
6233
|
}
|
|
6073
6234
|
|
|
6074
6235
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
6075
6236
|
|
|
6076
|
-
const _excluded$
|
|
6237
|
+
const _excluded$c = ["variant"];
|
|
6077
6238
|
function isEmpty$1(string) {
|
|
6078
6239
|
return string.length === 0;
|
|
6079
6240
|
}
|
|
@@ -6087,7 +6248,7 @@ function propsToClassKey(props) {
|
|
|
6087
6248
|
const {
|
|
6088
6249
|
variant
|
|
6089
6250
|
} = props,
|
|
6090
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
|
6251
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$c);
|
|
6091
6252
|
let classKey = variant || '';
|
|
6092
6253
|
Object.keys(other).sort().forEach(key => {
|
|
6093
6254
|
if (key === 'color') {
|
|
@@ -6099,7 +6260,7 @@ function propsToClassKey(props) {
|
|
|
6099
6260
|
return classKey;
|
|
6100
6261
|
}
|
|
6101
6262
|
|
|
6102
|
-
const _excluded$
|
|
6263
|
+
const _excluded$b = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
|
|
6103
6264
|
function isEmpty(obj) {
|
|
6104
6265
|
return Object.keys(obj).length === 0;
|
|
6105
6266
|
}
|
|
@@ -6194,7 +6355,7 @@ function createStyled(input = {}) {
|
|
|
6194
6355
|
skipSx: inputSkipSx,
|
|
6195
6356
|
overridesResolver
|
|
6196
6357
|
} = inputOptions,
|
|
6197
|
-
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$
|
|
6358
|
+
options = _objectWithoutPropertiesLoose(inputOptions, _excluded$b);
|
|
6198
6359
|
|
|
6199
6360
|
// if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.
|
|
6200
6361
|
const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;
|
|
@@ -6215,7 +6376,7 @@ function createStyled(input = {}) {
|
|
|
6215
6376
|
// for string (html) tag, preserve the behavior in emotion & styled-components.
|
|
6216
6377
|
shouldForwardPropOption = undefined;
|
|
6217
6378
|
}
|
|
6218
|
-
const defaultStyledResolver = styled$
|
|
6379
|
+
const defaultStyledResolver = styled$3(tag, _extends({
|
|
6219
6380
|
shouldForwardProp: shouldForwardPropOption,
|
|
6220
6381
|
label
|
|
6221
6382
|
}, options));
|
|
@@ -6307,6 +6468,9 @@ function createStyled(input = {}) {
|
|
|
6307
6468
|
};
|
|
6308
6469
|
}
|
|
6309
6470
|
|
|
6471
|
+
const styled$2 = createStyled();
|
|
6472
|
+
var systemStyled = styled$2;
|
|
6473
|
+
|
|
6310
6474
|
function getThemeProps(params) {
|
|
6311
6475
|
const {
|
|
6312
6476
|
theme,
|
|
@@ -6325,7 +6489,7 @@ function useThemeProps$1({
|
|
|
6325
6489
|
defaultTheme,
|
|
6326
6490
|
themeId
|
|
6327
6491
|
}) {
|
|
6328
|
-
let theme = useTheme(defaultTheme);
|
|
6492
|
+
let theme = useTheme$1(defaultTheme);
|
|
6329
6493
|
if (themeId) {
|
|
6330
6494
|
theme = theme[themeId] || theme;
|
|
6331
6495
|
}
|
|
@@ -6508,6 +6672,27 @@ function getContrastRatio(foreground, background) {
|
|
|
6508
6672
|
return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
|
|
6509
6673
|
}
|
|
6510
6674
|
|
|
6675
|
+
/**
|
|
6676
|
+
* Sets the absolute transparency of a color.
|
|
6677
|
+
* Any existing alpha values are overwritten.
|
|
6678
|
+
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
6679
|
+
* @param {number} value - value to set the alpha channel to in the range 0 - 1
|
|
6680
|
+
* @returns {string} A CSS color string. Hex input values are returned as rgb
|
|
6681
|
+
*/
|
|
6682
|
+
function alpha(color, value) {
|
|
6683
|
+
color = decomposeColor(color);
|
|
6684
|
+
value = clamp(value);
|
|
6685
|
+
if (color.type === 'rgb' || color.type === 'hsl') {
|
|
6686
|
+
color.type += 'a';
|
|
6687
|
+
}
|
|
6688
|
+
if (color.type === 'color') {
|
|
6689
|
+
color.values[3] = `/${value}`;
|
|
6690
|
+
} else {
|
|
6691
|
+
color.values[3] = value;
|
|
6692
|
+
}
|
|
6693
|
+
return recomposeColor(color);
|
|
6694
|
+
}
|
|
6695
|
+
|
|
6511
6696
|
/**
|
|
6512
6697
|
* Darkens a color.
|
|
6513
6698
|
* @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()
|
|
@@ -6550,6 +6735,161 @@ function lighten(color, coefficient) {
|
|
|
6550
6735
|
return recomposeColor(color);
|
|
6551
6736
|
}
|
|
6552
6737
|
|
|
6738
|
+
const _excluded$a = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"];
|
|
6739
|
+
const defaultTheme$2 = createTheme$1();
|
|
6740
|
+
// widening Theme to any so that the consumer can own the theme structure.
|
|
6741
|
+
const defaultCreateStyledComponent = systemStyled('div', {
|
|
6742
|
+
name: 'MuiStack',
|
|
6743
|
+
slot: 'Root',
|
|
6744
|
+
overridesResolver: (props, styles) => styles.root
|
|
6745
|
+
});
|
|
6746
|
+
function useThemePropsDefault(props) {
|
|
6747
|
+
return useThemeProps$1({
|
|
6748
|
+
props,
|
|
6749
|
+
name: 'MuiStack',
|
|
6750
|
+
defaultTheme: defaultTheme$2
|
|
6751
|
+
});
|
|
6752
|
+
}
|
|
6753
|
+
|
|
6754
|
+
/**
|
|
6755
|
+
* Return an array with the separator React element interspersed between
|
|
6756
|
+
* each React node of the input children.
|
|
6757
|
+
*
|
|
6758
|
+
* > joinChildren([1,2,3], 0)
|
|
6759
|
+
* [1,0,2,0,3]
|
|
6760
|
+
*/
|
|
6761
|
+
function joinChildren(children, separator) {
|
|
6762
|
+
const childrenArray = React.Children.toArray(children).filter(Boolean);
|
|
6763
|
+
return childrenArray.reduce((output, child, index) => {
|
|
6764
|
+
output.push(child);
|
|
6765
|
+
if (index < childrenArray.length - 1) {
|
|
6766
|
+
output.push( /*#__PURE__*/React.cloneElement(separator, {
|
|
6767
|
+
key: `separator-${index}`
|
|
6768
|
+
}));
|
|
6769
|
+
}
|
|
6770
|
+
return output;
|
|
6771
|
+
}, []);
|
|
6772
|
+
}
|
|
6773
|
+
const getSideFromDirection = direction => {
|
|
6774
|
+
return {
|
|
6775
|
+
row: 'Left',
|
|
6776
|
+
'row-reverse': 'Right',
|
|
6777
|
+
column: 'Top',
|
|
6778
|
+
'column-reverse': 'Bottom'
|
|
6779
|
+
}[direction];
|
|
6780
|
+
};
|
|
6781
|
+
const style = ({
|
|
6782
|
+
ownerState,
|
|
6783
|
+
theme
|
|
6784
|
+
}) => {
|
|
6785
|
+
let styles = _extends({
|
|
6786
|
+
display: 'flex',
|
|
6787
|
+
flexDirection: 'column'
|
|
6788
|
+
}, handleBreakpoints({
|
|
6789
|
+
theme
|
|
6790
|
+
}, resolveBreakpointValues({
|
|
6791
|
+
values: ownerState.direction,
|
|
6792
|
+
breakpoints: theme.breakpoints.values
|
|
6793
|
+
}), propValue => ({
|
|
6794
|
+
flexDirection: propValue
|
|
6795
|
+
})));
|
|
6796
|
+
if (ownerState.spacing) {
|
|
6797
|
+
const transformer = createUnarySpacing(theme);
|
|
6798
|
+
const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
|
|
6799
|
+
if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {
|
|
6800
|
+
acc[breakpoint] = true;
|
|
6801
|
+
}
|
|
6802
|
+
return acc;
|
|
6803
|
+
}, {});
|
|
6804
|
+
const directionValues = resolveBreakpointValues({
|
|
6805
|
+
values: ownerState.direction,
|
|
6806
|
+
base
|
|
6807
|
+
});
|
|
6808
|
+
const spacingValues = resolveBreakpointValues({
|
|
6809
|
+
values: ownerState.spacing,
|
|
6810
|
+
base
|
|
6811
|
+
});
|
|
6812
|
+
if (typeof directionValues === 'object') {
|
|
6813
|
+
Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {
|
|
6814
|
+
const directionValue = directionValues[breakpoint];
|
|
6815
|
+
if (!directionValue) {
|
|
6816
|
+
const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';
|
|
6817
|
+
directionValues[breakpoint] = previousDirectionValue;
|
|
6818
|
+
}
|
|
6819
|
+
});
|
|
6820
|
+
}
|
|
6821
|
+
const styleFromPropValue = (propValue, breakpoint) => {
|
|
6822
|
+
if (ownerState.useFlexGap) {
|
|
6823
|
+
return {
|
|
6824
|
+
gap: getValue(transformer, propValue)
|
|
6825
|
+
};
|
|
6826
|
+
}
|
|
6827
|
+
return {
|
|
6828
|
+
'& > :not(style) + :not(style)': {
|
|
6829
|
+
margin: 0,
|
|
6830
|
+
[`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)
|
|
6831
|
+
}
|
|
6832
|
+
};
|
|
6833
|
+
};
|
|
6834
|
+
styles = deepmerge(styles, handleBreakpoints({
|
|
6835
|
+
theme
|
|
6836
|
+
}, spacingValues, styleFromPropValue));
|
|
6837
|
+
}
|
|
6838
|
+
styles = mergeBreakpointsInOrder(theme.breakpoints, styles);
|
|
6839
|
+
return styles;
|
|
6840
|
+
};
|
|
6841
|
+
function createStack(options = {}) {
|
|
6842
|
+
const {
|
|
6843
|
+
// This will allow adding custom styled fn (for example for custom sx style function)
|
|
6844
|
+
createStyledComponent = defaultCreateStyledComponent,
|
|
6845
|
+
useThemeProps = useThemePropsDefault,
|
|
6846
|
+
componentName = 'MuiStack'
|
|
6847
|
+
} = options;
|
|
6848
|
+
const useUtilityClasses = () => {
|
|
6849
|
+
const slots = {
|
|
6850
|
+
root: ['root']
|
|
6851
|
+
};
|
|
6852
|
+
return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});
|
|
6853
|
+
};
|
|
6854
|
+
const StackRoot = createStyledComponent(style);
|
|
6855
|
+
const Stack = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {
|
|
6856
|
+
const themeProps = useThemeProps(inProps);
|
|
6857
|
+
const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.
|
|
6858
|
+
const {
|
|
6859
|
+
component = 'div',
|
|
6860
|
+
direction = 'column',
|
|
6861
|
+
spacing = 0,
|
|
6862
|
+
divider,
|
|
6863
|
+
children,
|
|
6864
|
+
className,
|
|
6865
|
+
useFlexGap = false
|
|
6866
|
+
} = props,
|
|
6867
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
|
6868
|
+
const ownerState = {
|
|
6869
|
+
direction,
|
|
6870
|
+
spacing,
|
|
6871
|
+
useFlexGap
|
|
6872
|
+
};
|
|
6873
|
+
const classes = useUtilityClasses();
|
|
6874
|
+
return /*#__PURE__*/jsx(StackRoot, _extends({
|
|
6875
|
+
as: component,
|
|
6876
|
+
ownerState: ownerState,
|
|
6877
|
+
ref: ref,
|
|
6878
|
+
className: clsx(classes.root, className)
|
|
6879
|
+
}, other, {
|
|
6880
|
+
children: divider ? joinChildren(children, divider) : children
|
|
6881
|
+
}));
|
|
6882
|
+
});
|
|
6883
|
+
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
|
|
6884
|
+
children: PropTypes.node,
|
|
6885
|
+
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
6886
|
+
divider: PropTypes.node,
|
|
6887
|
+
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
6888
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
6889
|
+
} : void 0;
|
|
6890
|
+
return Stack;
|
|
6891
|
+
}
|
|
6892
|
+
|
|
6553
6893
|
function createMixins(breakpoints, mixins) {
|
|
6554
6894
|
return _extends({
|
|
6555
6895
|
toolbar: {
|
|
@@ -6698,7 +7038,7 @@ const green = {
|
|
|
6698
7038
|
};
|
|
6699
7039
|
var green$1 = green;
|
|
6700
7040
|
|
|
6701
|
-
const _excluded$
|
|
7041
|
+
const _excluded$9 = ["mode", "contrastThreshold", "tonalOffset"];
|
|
6702
7042
|
const light = {
|
|
6703
7043
|
// The colors used to style the text.
|
|
6704
7044
|
text: {
|
|
@@ -6867,7 +7207,7 @@ function createPalette(palette) {
|
|
|
6867
7207
|
contrastThreshold = 3,
|
|
6868
7208
|
tonalOffset = 0.2
|
|
6869
7209
|
} = palette,
|
|
6870
|
-
other = _objectWithoutPropertiesLoose(palette, _excluded$
|
|
7210
|
+
other = _objectWithoutPropertiesLoose(palette, _excluded$9);
|
|
6871
7211
|
const primary = palette.primary || getDefaultPrimary(mode);
|
|
6872
7212
|
const secondary = palette.secondary || getDefaultSecondary(mode);
|
|
6873
7213
|
const error = palette.error || getDefaultError(mode);
|
|
@@ -6991,7 +7331,7 @@ const theme2 = createTheme({ palette: {
|
|
|
6991
7331
|
return paletteOutput;
|
|
6992
7332
|
}
|
|
6993
7333
|
|
|
6994
|
-
const _excluded$
|
|
7334
|
+
const _excluded$8 = ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"];
|
|
6995
7335
|
function round(value) {
|
|
6996
7336
|
return Math.round(value * 1e5) / 1e5;
|
|
6997
7337
|
}
|
|
@@ -7022,7 +7362,7 @@ function createTypography(palette, typography) {
|
|
|
7022
7362
|
allVariants,
|
|
7023
7363
|
pxToRem: pxToRem2
|
|
7024
7364
|
} = _ref,
|
|
7025
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
7365
|
+
other = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
7026
7366
|
if (process.env.NODE_ENV !== 'production') {
|
|
7027
7367
|
if (typeof fontSize !== 'number') {
|
|
7028
7368
|
console.error('MUI: `fontSize` is required to be a number.');
|
|
@@ -7089,7 +7429,7 @@ function createShadow(...px) {
|
|
|
7089
7429
|
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
|
7090
7430
|
var shadows$1 = shadows;
|
|
7091
7431
|
|
|
7092
|
-
const _excluded$
|
|
7432
|
+
const _excluded$7 = ["duration", "easing", "delay"];
|
|
7093
7433
|
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
|
7094
7434
|
// to learn the context in which each easing should be used.
|
|
7095
7435
|
const easing = {
|
|
@@ -7140,7 +7480,7 @@ function createTransitions(inputTransitions) {
|
|
|
7140
7480
|
easing: easingOption = mergedEasing.easeInOut,
|
|
7141
7481
|
delay = 0
|
|
7142
7482
|
} = options,
|
|
7143
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
7483
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$7);
|
|
7144
7484
|
if (process.env.NODE_ENV !== 'production') {
|
|
7145
7485
|
const isString = value => typeof value === 'string';
|
|
7146
7486
|
// IE11 support, replace with Number.isNaN
|
|
@@ -7187,7 +7527,7 @@ const zIndex = {
|
|
|
7187
7527
|
};
|
|
7188
7528
|
var zIndex$1 = zIndex;
|
|
7189
7529
|
|
|
7190
|
-
const _excluded$
|
|
7530
|
+
const _excluded$6 = ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"];
|
|
7191
7531
|
function createTheme(options = {}, ...args) {
|
|
7192
7532
|
const {
|
|
7193
7533
|
mixins: mixinsInput = {},
|
|
@@ -7195,7 +7535,7 @@ function createTheme(options = {}, ...args) {
|
|
|
7195
7535
|
transitions: transitionsInput = {},
|
|
7196
7536
|
typography: typographyInput = {}
|
|
7197
7537
|
} = options,
|
|
7198
|
-
other = _objectWithoutPropertiesLoose(options, _excluded$
|
|
7538
|
+
other = _objectWithoutPropertiesLoose(options, _excluded$6);
|
|
7199
7539
|
if (options.vars) {
|
|
7200
7540
|
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
|
7201
7541
|
Please use another name.` : formatMuiErrorMessage(18));
|
|
@@ -7256,6 +7596,15 @@ Please use another name.` : formatMuiErrorMessage(18));
|
|
|
7256
7596
|
const defaultTheme = createTheme();
|
|
7257
7597
|
var defaultTheme$1 = defaultTheme;
|
|
7258
7598
|
|
|
7599
|
+
function useTheme() {
|
|
7600
|
+
const theme = useTheme$1(defaultTheme$1);
|
|
7601
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7602
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
7603
|
+
React.useDebugValue(theme);
|
|
7604
|
+
}
|
|
7605
|
+
return theme[THEME_ID] || theme;
|
|
7606
|
+
}
|
|
7607
|
+
|
|
7259
7608
|
function useThemeProps({
|
|
7260
7609
|
props,
|
|
7261
7610
|
name
|
|
@@ -7276,13 +7625,25 @@ const styled = createStyled({
|
|
|
7276
7625
|
});
|
|
7277
7626
|
var styled$1 = styled;
|
|
7278
7627
|
|
|
7628
|
+
// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61
|
|
7629
|
+
const getOverlayAlpha = elevation => {
|
|
7630
|
+
let alphaValue;
|
|
7631
|
+
if (elevation < 1) {
|
|
7632
|
+
alphaValue = 5.11916 * elevation ** 2;
|
|
7633
|
+
} else {
|
|
7634
|
+
alphaValue = 4.5 * Math.log(elevation + 1) + 2;
|
|
7635
|
+
}
|
|
7636
|
+
return (alphaValue / 100).toFixed(2);
|
|
7637
|
+
};
|
|
7638
|
+
var getOverlayAlpha$1 = getOverlayAlpha;
|
|
7639
|
+
|
|
7279
7640
|
function getSvgIconUtilityClass(slot) {
|
|
7280
7641
|
return generateUtilityClass('MuiSvgIcon', slot);
|
|
7281
7642
|
}
|
|
7282
7643
|
generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);
|
|
7283
7644
|
|
|
7284
|
-
const _excluded = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
7285
|
-
const useUtilityClasses = ownerState => {
|
|
7645
|
+
const _excluded$5 = ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"];
|
|
7646
|
+
const useUtilityClasses$5 = ownerState => {
|
|
7286
7647
|
const {
|
|
7287
7648
|
color,
|
|
7288
7649
|
fontSize,
|
|
@@ -7347,7 +7708,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
7347
7708
|
titleAccess,
|
|
7348
7709
|
viewBox = '0 0 24 24'
|
|
7349
7710
|
} = props,
|
|
7350
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
7711
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$5);
|
|
7351
7712
|
const ownerState = _extends({}, props, {
|
|
7352
7713
|
color,
|
|
7353
7714
|
component,
|
|
@@ -7360,7 +7721,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
7360
7721
|
if (!inheritViewBox) {
|
|
7361
7722
|
more.viewBox = viewBox;
|
|
7362
7723
|
}
|
|
7363
|
-
const classes = useUtilityClasses(ownerState);
|
|
7724
|
+
const classes = useUtilityClasses$5(ownerState);
|
|
7364
7725
|
return /*#__PURE__*/jsxs(SvgIconRoot, _extends({
|
|
7365
7726
|
as: component,
|
|
7366
7727
|
className: clsx(classes.root, className),
|
|
@@ -8665,6 +9026,673 @@ fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCal
|
|
|
8665
9026
|
];
|
|
8666
9027
|
});
|
|
8667
9028
|
|
|
9029
|
+
function getPaperUtilityClass(slot) {
|
|
9030
|
+
return generateUtilityClass('MuiPaper', slot);
|
|
9031
|
+
}
|
|
9032
|
+
generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);
|
|
9033
|
+
|
|
9034
|
+
const _excluded$4 = ["className", "component", "elevation", "square", "variant"];
|
|
9035
|
+
const useUtilityClasses$4 = ownerState => {
|
|
9036
|
+
const {
|
|
9037
|
+
square,
|
|
9038
|
+
elevation,
|
|
9039
|
+
variant,
|
|
9040
|
+
classes
|
|
9041
|
+
} = ownerState;
|
|
9042
|
+
const slots = {
|
|
9043
|
+
root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]
|
|
9044
|
+
};
|
|
9045
|
+
return composeClasses(slots, getPaperUtilityClass, classes);
|
|
9046
|
+
};
|
|
9047
|
+
const PaperRoot = styled$1('div', {
|
|
9048
|
+
name: 'MuiPaper',
|
|
9049
|
+
slot: 'Root',
|
|
9050
|
+
overridesResolver: (props, styles) => {
|
|
9051
|
+
const {
|
|
9052
|
+
ownerState
|
|
9053
|
+
} = props;
|
|
9054
|
+
return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];
|
|
9055
|
+
}
|
|
9056
|
+
})(({
|
|
9057
|
+
theme,
|
|
9058
|
+
ownerState
|
|
9059
|
+
}) => {
|
|
9060
|
+
var _theme$vars$overlays;
|
|
9061
|
+
return _extends({
|
|
9062
|
+
backgroundColor: (theme.vars || theme).palette.background.paper,
|
|
9063
|
+
color: (theme.vars || theme).palette.text.primary,
|
|
9064
|
+
transition: theme.transitions.create('box-shadow')
|
|
9065
|
+
}, !ownerState.square && {
|
|
9066
|
+
borderRadius: theme.shape.borderRadius
|
|
9067
|
+
}, ownerState.variant === 'outlined' && {
|
|
9068
|
+
border: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
9069
|
+
}, ownerState.variant === 'elevation' && _extends({
|
|
9070
|
+
boxShadow: (theme.vars || theme).shadows[ownerState.elevation]
|
|
9071
|
+
}, !theme.vars && theme.palette.mode === 'dark' && {
|
|
9072
|
+
backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha$1(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha$1(ownerState.elevation))})`
|
|
9073
|
+
}, theme.vars && {
|
|
9074
|
+
backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]
|
|
9075
|
+
}));
|
|
9076
|
+
});
|
|
9077
|
+
const Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {
|
|
9078
|
+
const props = useThemeProps({
|
|
9079
|
+
props: inProps,
|
|
9080
|
+
name: 'MuiPaper'
|
|
9081
|
+
});
|
|
9082
|
+
const {
|
|
9083
|
+
className,
|
|
9084
|
+
component = 'div',
|
|
9085
|
+
elevation = 1,
|
|
9086
|
+
square = false,
|
|
9087
|
+
variant = 'elevation'
|
|
9088
|
+
} = props,
|
|
9089
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$4);
|
|
9090
|
+
const ownerState = _extends({}, props, {
|
|
9091
|
+
component,
|
|
9092
|
+
elevation,
|
|
9093
|
+
square,
|
|
9094
|
+
variant
|
|
9095
|
+
});
|
|
9096
|
+
const classes = useUtilityClasses$4(ownerState);
|
|
9097
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9098
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
9099
|
+
const theme = useTheme();
|
|
9100
|
+
if (theme.shadows[elevation] === undefined) {
|
|
9101
|
+
console.error([`MUI: The elevation provided <Paper elevation={${elevation}}> is not available in the theme.`, `Please make sure that \`theme.shadows[${elevation}]\` is defined.`].join('\n'));
|
|
9102
|
+
}
|
|
9103
|
+
}
|
|
9104
|
+
return /*#__PURE__*/jsx(PaperRoot, _extends({
|
|
9105
|
+
as: component,
|
|
9106
|
+
ownerState: ownerState,
|
|
9107
|
+
className: clsx(classes.root, className),
|
|
9108
|
+
ref: ref
|
|
9109
|
+
}, other));
|
|
9110
|
+
});
|
|
9111
|
+
process.env.NODE_ENV !== "production" ? Paper.propTypes /* remove-proptypes */ = {
|
|
9112
|
+
// ----------------------------- Warning --------------------------------
|
|
9113
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9114
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9115
|
+
// ----------------------------------------------------------------------
|
|
9116
|
+
/**
|
|
9117
|
+
* The content of the component.
|
|
9118
|
+
*/
|
|
9119
|
+
children: PropTypes.node,
|
|
9120
|
+
/**
|
|
9121
|
+
* Override or extend the styles applied to the component.
|
|
9122
|
+
*/
|
|
9123
|
+
classes: PropTypes.object,
|
|
9124
|
+
/**
|
|
9125
|
+
* @ignore
|
|
9126
|
+
*/
|
|
9127
|
+
className: PropTypes.string,
|
|
9128
|
+
/**
|
|
9129
|
+
* The component used for the root node.
|
|
9130
|
+
* Either a string to use a HTML element or a component.
|
|
9131
|
+
*/
|
|
9132
|
+
component: PropTypes.elementType,
|
|
9133
|
+
/**
|
|
9134
|
+
* Shadow depth, corresponds to `dp` in the spec.
|
|
9135
|
+
* It accepts values between 0 and 24 inclusive.
|
|
9136
|
+
* @default 1
|
|
9137
|
+
*/
|
|
9138
|
+
elevation: chainPropTypes(integerPropType, props => {
|
|
9139
|
+
const {
|
|
9140
|
+
elevation,
|
|
9141
|
+
variant
|
|
9142
|
+
} = props;
|
|
9143
|
+
if (elevation > 0 && variant === 'outlined') {
|
|
9144
|
+
return new Error(`MUI: Combining \`elevation={${elevation}}\` with \`variant="${variant}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`);
|
|
9145
|
+
}
|
|
9146
|
+
return null;
|
|
9147
|
+
}),
|
|
9148
|
+
/**
|
|
9149
|
+
* If `true`, rounded corners are disabled.
|
|
9150
|
+
* @default false
|
|
9151
|
+
*/
|
|
9152
|
+
square: PropTypes.bool,
|
|
9153
|
+
/**
|
|
9154
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9155
|
+
*/
|
|
9156
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
9157
|
+
/**
|
|
9158
|
+
* The variant to use.
|
|
9159
|
+
* @default 'elevation'
|
|
9160
|
+
*/
|
|
9161
|
+
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])
|
|
9162
|
+
} : void 0;
|
|
9163
|
+
var Paper$1 = Paper;
|
|
9164
|
+
|
|
9165
|
+
function getTypographyUtilityClass(slot) {
|
|
9166
|
+
return generateUtilityClass('MuiTypography', slot);
|
|
9167
|
+
}
|
|
9168
|
+
generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);
|
|
9169
|
+
|
|
9170
|
+
const _excluded$3 = ["align", "className", "component", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"];
|
|
9171
|
+
const useUtilityClasses$3 = ownerState => {
|
|
9172
|
+
const {
|
|
9173
|
+
align,
|
|
9174
|
+
gutterBottom,
|
|
9175
|
+
noWrap,
|
|
9176
|
+
paragraph,
|
|
9177
|
+
variant,
|
|
9178
|
+
classes
|
|
9179
|
+
} = ownerState;
|
|
9180
|
+
const slots = {
|
|
9181
|
+
root: ['root', variant, ownerState.align !== 'inherit' && `align${capitalize(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']
|
|
9182
|
+
};
|
|
9183
|
+
return composeClasses(slots, getTypographyUtilityClass, classes);
|
|
9184
|
+
};
|
|
9185
|
+
const TypographyRoot = styled$1('span', {
|
|
9186
|
+
name: 'MuiTypography',
|
|
9187
|
+
slot: 'Root',
|
|
9188
|
+
overridesResolver: (props, styles) => {
|
|
9189
|
+
const {
|
|
9190
|
+
ownerState
|
|
9191
|
+
} = props;
|
|
9192
|
+
return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
|
|
9193
|
+
}
|
|
9194
|
+
})(({
|
|
9195
|
+
theme,
|
|
9196
|
+
ownerState
|
|
9197
|
+
}) => _extends({
|
|
9198
|
+
margin: 0
|
|
9199
|
+
}, ownerState.variant && theme.typography[ownerState.variant], ownerState.align !== 'inherit' && {
|
|
9200
|
+
textAlign: ownerState.align
|
|
9201
|
+
}, ownerState.noWrap && {
|
|
9202
|
+
overflow: 'hidden',
|
|
9203
|
+
textOverflow: 'ellipsis',
|
|
9204
|
+
whiteSpace: 'nowrap'
|
|
9205
|
+
}, ownerState.gutterBottom && {
|
|
9206
|
+
marginBottom: '0.35em'
|
|
9207
|
+
}, ownerState.paragraph && {
|
|
9208
|
+
marginBottom: 16
|
|
9209
|
+
}));
|
|
9210
|
+
const defaultVariantMapping = {
|
|
9211
|
+
h1: 'h1',
|
|
9212
|
+
h2: 'h2',
|
|
9213
|
+
h3: 'h3',
|
|
9214
|
+
h4: 'h4',
|
|
9215
|
+
h5: 'h5',
|
|
9216
|
+
h6: 'h6',
|
|
9217
|
+
subtitle1: 'h6',
|
|
9218
|
+
subtitle2: 'h6',
|
|
9219
|
+
body1: 'p',
|
|
9220
|
+
body2: 'p',
|
|
9221
|
+
inherit: 'p'
|
|
9222
|
+
};
|
|
9223
|
+
|
|
9224
|
+
// TODO v6: deprecate these color values in v5.x and remove the transformation in v6
|
|
9225
|
+
const colorTransformations = {
|
|
9226
|
+
primary: 'primary.main',
|
|
9227
|
+
textPrimary: 'text.primary',
|
|
9228
|
+
secondary: 'secondary.main',
|
|
9229
|
+
textSecondary: 'text.secondary',
|
|
9230
|
+
error: 'error.main'
|
|
9231
|
+
};
|
|
9232
|
+
const transformDeprecatedColors = color => {
|
|
9233
|
+
return colorTransformations[color] || color;
|
|
9234
|
+
};
|
|
9235
|
+
const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
|
|
9236
|
+
const themeProps = useThemeProps({
|
|
9237
|
+
props: inProps,
|
|
9238
|
+
name: 'MuiTypography'
|
|
9239
|
+
});
|
|
9240
|
+
const color = transformDeprecatedColors(themeProps.color);
|
|
9241
|
+
const props = extendSxProp(_extends({}, themeProps, {
|
|
9242
|
+
color
|
|
9243
|
+
}));
|
|
9244
|
+
const {
|
|
9245
|
+
align = 'inherit',
|
|
9246
|
+
className,
|
|
9247
|
+
component,
|
|
9248
|
+
gutterBottom = false,
|
|
9249
|
+
noWrap = false,
|
|
9250
|
+
paragraph = false,
|
|
9251
|
+
variant = 'body1',
|
|
9252
|
+
variantMapping = defaultVariantMapping
|
|
9253
|
+
} = props,
|
|
9254
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$3);
|
|
9255
|
+
const ownerState = _extends({}, props, {
|
|
9256
|
+
align,
|
|
9257
|
+
color,
|
|
9258
|
+
className,
|
|
9259
|
+
component,
|
|
9260
|
+
gutterBottom,
|
|
9261
|
+
noWrap,
|
|
9262
|
+
paragraph,
|
|
9263
|
+
variant,
|
|
9264
|
+
variantMapping
|
|
9265
|
+
});
|
|
9266
|
+
const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
|
|
9267
|
+
const classes = useUtilityClasses$3(ownerState);
|
|
9268
|
+
return /*#__PURE__*/jsx(TypographyRoot, _extends({
|
|
9269
|
+
as: Component,
|
|
9270
|
+
ref: ref,
|
|
9271
|
+
ownerState: ownerState,
|
|
9272
|
+
className: clsx(classes.root, className)
|
|
9273
|
+
}, other));
|
|
9274
|
+
});
|
|
9275
|
+
process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes */ = {
|
|
9276
|
+
// ----------------------------- Warning --------------------------------
|
|
9277
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9278
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9279
|
+
// ----------------------------------------------------------------------
|
|
9280
|
+
/**
|
|
9281
|
+
* Set the text-align on the component.
|
|
9282
|
+
* @default 'inherit'
|
|
9283
|
+
*/
|
|
9284
|
+
align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),
|
|
9285
|
+
/**
|
|
9286
|
+
* The content of the component.
|
|
9287
|
+
*/
|
|
9288
|
+
children: PropTypes.node,
|
|
9289
|
+
/**
|
|
9290
|
+
* Override or extend the styles applied to the component.
|
|
9291
|
+
*/
|
|
9292
|
+
classes: PropTypes.object,
|
|
9293
|
+
/**
|
|
9294
|
+
* @ignore
|
|
9295
|
+
*/
|
|
9296
|
+
className: PropTypes.string,
|
|
9297
|
+
/**
|
|
9298
|
+
* The component used for the root node.
|
|
9299
|
+
* Either a string to use a HTML element or a component.
|
|
9300
|
+
*/
|
|
9301
|
+
component: PropTypes.elementType,
|
|
9302
|
+
/**
|
|
9303
|
+
* If `true`, the text will have a bottom margin.
|
|
9304
|
+
* @default false
|
|
9305
|
+
*/
|
|
9306
|
+
gutterBottom: PropTypes.bool,
|
|
9307
|
+
/**
|
|
9308
|
+
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
|
9309
|
+
*
|
|
9310
|
+
* Note that text overflow can only happen with block or inline-block level elements
|
|
9311
|
+
* (the element needs to have a width in order to overflow).
|
|
9312
|
+
* @default false
|
|
9313
|
+
*/
|
|
9314
|
+
noWrap: PropTypes.bool,
|
|
9315
|
+
/**
|
|
9316
|
+
* If `true`, the element will be a paragraph element.
|
|
9317
|
+
* @default false
|
|
9318
|
+
*/
|
|
9319
|
+
paragraph: PropTypes.bool,
|
|
9320
|
+
/**
|
|
9321
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9322
|
+
*/
|
|
9323
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
9324
|
+
/**
|
|
9325
|
+
* Applies the theme typography styles.
|
|
9326
|
+
* @default 'body1'
|
|
9327
|
+
*/
|
|
9328
|
+
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string]),
|
|
9329
|
+
/**
|
|
9330
|
+
* The component maps the variant prop to a range of different HTML element types.
|
|
9331
|
+
* For instance, subtitle1 to `<h6>`.
|
|
9332
|
+
* If you wish to change that mapping, you can provide your own.
|
|
9333
|
+
* Alternatively, you can use the `component` prop.
|
|
9334
|
+
* @default {
|
|
9335
|
+
* h1: 'h1',
|
|
9336
|
+
* h2: 'h2',
|
|
9337
|
+
* h3: 'h3',
|
|
9338
|
+
* h4: 'h4',
|
|
9339
|
+
* h5: 'h5',
|
|
9340
|
+
* h6: 'h6',
|
|
9341
|
+
* subtitle1: 'h6',
|
|
9342
|
+
* subtitle2: 'h6',
|
|
9343
|
+
* body1: 'p',
|
|
9344
|
+
* body2: 'p',
|
|
9345
|
+
* inherit: 'p',
|
|
9346
|
+
* }
|
|
9347
|
+
*/
|
|
9348
|
+
variantMapping: PropTypes /* @typescript-to-proptypes-ignore */.object
|
|
9349
|
+
} : void 0;
|
|
9350
|
+
var Typography$1 = Typography;
|
|
9351
|
+
|
|
9352
|
+
function getCardUtilityClass(slot) {
|
|
9353
|
+
return generateUtilityClass('MuiCard', slot);
|
|
9354
|
+
}
|
|
9355
|
+
generateUtilityClasses('MuiCard', ['root']);
|
|
9356
|
+
|
|
9357
|
+
const _excluded$2 = ["className", "raised"];
|
|
9358
|
+
const useUtilityClasses$2 = ownerState => {
|
|
9359
|
+
const {
|
|
9360
|
+
classes
|
|
9361
|
+
} = ownerState;
|
|
9362
|
+
const slots = {
|
|
9363
|
+
root: ['root']
|
|
9364
|
+
};
|
|
9365
|
+
return composeClasses(slots, getCardUtilityClass, classes);
|
|
9366
|
+
};
|
|
9367
|
+
const CardRoot = styled$1(Paper$1, {
|
|
9368
|
+
name: 'MuiCard',
|
|
9369
|
+
slot: 'Root',
|
|
9370
|
+
overridesResolver: (props, styles) => styles.root
|
|
9371
|
+
})(() => {
|
|
9372
|
+
return {
|
|
9373
|
+
overflow: 'hidden'
|
|
9374
|
+
};
|
|
9375
|
+
});
|
|
9376
|
+
const Card = /*#__PURE__*/React.forwardRef(function Card(inProps, ref) {
|
|
9377
|
+
const props = useThemeProps({
|
|
9378
|
+
props: inProps,
|
|
9379
|
+
name: 'MuiCard'
|
|
9380
|
+
});
|
|
9381
|
+
const {
|
|
9382
|
+
className,
|
|
9383
|
+
raised = false
|
|
9384
|
+
} = props,
|
|
9385
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$2);
|
|
9386
|
+
const ownerState = _extends({}, props, {
|
|
9387
|
+
raised
|
|
9388
|
+
});
|
|
9389
|
+
const classes = useUtilityClasses$2(ownerState);
|
|
9390
|
+
return /*#__PURE__*/jsx(CardRoot, _extends({
|
|
9391
|
+
className: clsx(classes.root, className),
|
|
9392
|
+
elevation: raised ? 8 : undefined,
|
|
9393
|
+
ref: ref,
|
|
9394
|
+
ownerState: ownerState
|
|
9395
|
+
}, other));
|
|
9396
|
+
});
|
|
9397
|
+
process.env.NODE_ENV !== "production" ? Card.propTypes /* remove-proptypes */ = {
|
|
9398
|
+
// ----------------------------- Warning --------------------------------
|
|
9399
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9400
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9401
|
+
// ----------------------------------------------------------------------
|
|
9402
|
+
/**
|
|
9403
|
+
* The content of the component.
|
|
9404
|
+
*/
|
|
9405
|
+
children: PropTypes.node,
|
|
9406
|
+
/**
|
|
9407
|
+
* Override or extend the styles applied to the component.
|
|
9408
|
+
*/
|
|
9409
|
+
classes: PropTypes.object,
|
|
9410
|
+
/**
|
|
9411
|
+
* @ignore
|
|
9412
|
+
*/
|
|
9413
|
+
className: PropTypes.string,
|
|
9414
|
+
/**
|
|
9415
|
+
* If `true`, the card will use raised styling.
|
|
9416
|
+
* @default false
|
|
9417
|
+
*/
|
|
9418
|
+
raised: chainPropTypes(PropTypes.bool, props => {
|
|
9419
|
+
if (props.raised && props.variant === 'outlined') {
|
|
9420
|
+
return new Error('MUI: Combining `raised={true}` with `variant="outlined"` has no effect.');
|
|
9421
|
+
}
|
|
9422
|
+
return null;
|
|
9423
|
+
}),
|
|
9424
|
+
/**
|
|
9425
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9426
|
+
*/
|
|
9427
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
9428
|
+
} : void 0;
|
|
9429
|
+
var Card$1 = Card;
|
|
9430
|
+
|
|
9431
|
+
function getCardContentUtilityClass(slot) {
|
|
9432
|
+
return generateUtilityClass('MuiCardContent', slot);
|
|
9433
|
+
}
|
|
9434
|
+
generateUtilityClasses('MuiCardContent', ['root']);
|
|
9435
|
+
|
|
9436
|
+
const _excluded$1 = ["className", "component"];
|
|
9437
|
+
const useUtilityClasses$1 = ownerState => {
|
|
9438
|
+
const {
|
|
9439
|
+
classes
|
|
9440
|
+
} = ownerState;
|
|
9441
|
+
const slots = {
|
|
9442
|
+
root: ['root']
|
|
9443
|
+
};
|
|
9444
|
+
return composeClasses(slots, getCardContentUtilityClass, classes);
|
|
9445
|
+
};
|
|
9446
|
+
const CardContentRoot = styled$1('div', {
|
|
9447
|
+
name: 'MuiCardContent',
|
|
9448
|
+
slot: 'Root',
|
|
9449
|
+
overridesResolver: (props, styles) => styles.root
|
|
9450
|
+
})(() => {
|
|
9451
|
+
return {
|
|
9452
|
+
padding: 16,
|
|
9453
|
+
'&:last-child': {
|
|
9454
|
+
paddingBottom: 24
|
|
9455
|
+
}
|
|
9456
|
+
};
|
|
9457
|
+
});
|
|
9458
|
+
const CardContent = /*#__PURE__*/React.forwardRef(function CardContent(inProps, ref) {
|
|
9459
|
+
const props = useThemeProps({
|
|
9460
|
+
props: inProps,
|
|
9461
|
+
name: 'MuiCardContent'
|
|
9462
|
+
});
|
|
9463
|
+
const {
|
|
9464
|
+
className,
|
|
9465
|
+
component = 'div'
|
|
9466
|
+
} = props,
|
|
9467
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
9468
|
+
const ownerState = _extends({}, props, {
|
|
9469
|
+
component
|
|
9470
|
+
});
|
|
9471
|
+
const classes = useUtilityClasses$1(ownerState);
|
|
9472
|
+
return /*#__PURE__*/jsx(CardContentRoot, _extends({
|
|
9473
|
+
as: component,
|
|
9474
|
+
className: clsx(classes.root, className),
|
|
9475
|
+
ownerState: ownerState,
|
|
9476
|
+
ref: ref
|
|
9477
|
+
}, other));
|
|
9478
|
+
});
|
|
9479
|
+
process.env.NODE_ENV !== "production" ? CardContent.propTypes /* remove-proptypes */ = {
|
|
9480
|
+
// ----------------------------- Warning --------------------------------
|
|
9481
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9482
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9483
|
+
// ----------------------------------------------------------------------
|
|
9484
|
+
/**
|
|
9485
|
+
* The content of the component.
|
|
9486
|
+
*/
|
|
9487
|
+
children: PropTypes.node,
|
|
9488
|
+
/**
|
|
9489
|
+
* Override or extend the styles applied to the component.
|
|
9490
|
+
*/
|
|
9491
|
+
classes: PropTypes.object,
|
|
9492
|
+
/**
|
|
9493
|
+
* @ignore
|
|
9494
|
+
*/
|
|
9495
|
+
className: PropTypes.string,
|
|
9496
|
+
/**
|
|
9497
|
+
* The component used for the root node.
|
|
9498
|
+
* Either a string to use a HTML element or a component.
|
|
9499
|
+
*/
|
|
9500
|
+
component: PropTypes.elementType,
|
|
9501
|
+
/**
|
|
9502
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9503
|
+
*/
|
|
9504
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
9505
|
+
} : void 0;
|
|
9506
|
+
var CardContent$1 = CardContent;
|
|
9507
|
+
|
|
9508
|
+
function getCardMediaUtilityClass(slot) {
|
|
9509
|
+
return generateUtilityClass('MuiCardMedia', slot);
|
|
9510
|
+
}
|
|
9511
|
+
generateUtilityClasses('MuiCardMedia', ['root', 'media', 'img']);
|
|
9512
|
+
|
|
9513
|
+
const _excluded = ["children", "className", "component", "image", "src", "style"];
|
|
9514
|
+
const useUtilityClasses = ownerState => {
|
|
9515
|
+
const {
|
|
9516
|
+
classes,
|
|
9517
|
+
isMediaComponent,
|
|
9518
|
+
isImageComponent
|
|
9519
|
+
} = ownerState;
|
|
9520
|
+
const slots = {
|
|
9521
|
+
root: ['root', isMediaComponent && 'media', isImageComponent && 'img']
|
|
9522
|
+
};
|
|
9523
|
+
return composeClasses(slots, getCardMediaUtilityClass, classes);
|
|
9524
|
+
};
|
|
9525
|
+
const CardMediaRoot = styled$1('div', {
|
|
9526
|
+
name: 'MuiCardMedia',
|
|
9527
|
+
slot: 'Root',
|
|
9528
|
+
overridesResolver: (props, styles) => {
|
|
9529
|
+
const {
|
|
9530
|
+
ownerState
|
|
9531
|
+
} = props;
|
|
9532
|
+
const {
|
|
9533
|
+
isMediaComponent,
|
|
9534
|
+
isImageComponent
|
|
9535
|
+
} = ownerState;
|
|
9536
|
+
return [styles.root, isMediaComponent && styles.media, isImageComponent && styles.img];
|
|
9537
|
+
}
|
|
9538
|
+
})(({
|
|
9539
|
+
ownerState
|
|
9540
|
+
}) => _extends({
|
|
9541
|
+
display: 'block',
|
|
9542
|
+
backgroundSize: 'cover',
|
|
9543
|
+
backgroundRepeat: 'no-repeat',
|
|
9544
|
+
backgroundPosition: 'center'
|
|
9545
|
+
}, ownerState.isMediaComponent && {
|
|
9546
|
+
width: '100%'
|
|
9547
|
+
}, ownerState.isImageComponent && {
|
|
9548
|
+
// ⚠️ object-fit is not supported by IE11.
|
|
9549
|
+
objectFit: 'cover'
|
|
9550
|
+
}));
|
|
9551
|
+
const MEDIA_COMPONENTS = ['video', 'audio', 'picture', 'iframe', 'img'];
|
|
9552
|
+
const IMAGE_COMPONENTS = ['picture', 'img'];
|
|
9553
|
+
const CardMedia = /*#__PURE__*/React.forwardRef(function CardMedia(inProps, ref) {
|
|
9554
|
+
const props = useThemeProps({
|
|
9555
|
+
props: inProps,
|
|
9556
|
+
name: 'MuiCardMedia'
|
|
9557
|
+
});
|
|
9558
|
+
const {
|
|
9559
|
+
children,
|
|
9560
|
+
className,
|
|
9561
|
+
component = 'div',
|
|
9562
|
+
image,
|
|
9563
|
+
src,
|
|
9564
|
+
style
|
|
9565
|
+
} = props,
|
|
9566
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
9567
|
+
const isMediaComponent = MEDIA_COMPONENTS.indexOf(component) !== -1;
|
|
9568
|
+
const composedStyle = !isMediaComponent && image ? _extends({
|
|
9569
|
+
backgroundImage: `url("${image}")`
|
|
9570
|
+
}, style) : style;
|
|
9571
|
+
const ownerState = _extends({}, props, {
|
|
9572
|
+
component,
|
|
9573
|
+
isMediaComponent,
|
|
9574
|
+
isImageComponent: IMAGE_COMPONENTS.indexOf(component) !== -1
|
|
9575
|
+
});
|
|
9576
|
+
const classes = useUtilityClasses(ownerState);
|
|
9577
|
+
return /*#__PURE__*/jsx(CardMediaRoot, _extends({
|
|
9578
|
+
className: clsx(classes.root, className),
|
|
9579
|
+
as: component,
|
|
9580
|
+
role: !isMediaComponent && image ? 'img' : undefined,
|
|
9581
|
+
ref: ref,
|
|
9582
|
+
style: composedStyle,
|
|
9583
|
+
ownerState: ownerState,
|
|
9584
|
+
src: isMediaComponent ? image || src : undefined
|
|
9585
|
+
}, other, {
|
|
9586
|
+
children: children
|
|
9587
|
+
}));
|
|
9588
|
+
});
|
|
9589
|
+
process.env.NODE_ENV !== "production" ? CardMedia.propTypes /* remove-proptypes */ = {
|
|
9590
|
+
// ----------------------------- Warning --------------------------------
|
|
9591
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9592
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9593
|
+
// ----------------------------------------------------------------------
|
|
9594
|
+
/**
|
|
9595
|
+
* The content of the component.
|
|
9596
|
+
*/
|
|
9597
|
+
children: chainPropTypes(PropTypes.node, props => {
|
|
9598
|
+
if (!props.children && !props.image && !props.src && !props.component) {
|
|
9599
|
+
return new Error('MUI: Either `children`, `image`, `src` or `component` prop must be specified.');
|
|
9600
|
+
}
|
|
9601
|
+
return null;
|
|
9602
|
+
}),
|
|
9603
|
+
/**
|
|
9604
|
+
* Override or extend the styles applied to the component.
|
|
9605
|
+
*/
|
|
9606
|
+
classes: PropTypes.object,
|
|
9607
|
+
/**
|
|
9608
|
+
* @ignore
|
|
9609
|
+
*/
|
|
9610
|
+
className: PropTypes.string,
|
|
9611
|
+
/**
|
|
9612
|
+
* The component used for the root node.
|
|
9613
|
+
* Either a string to use a HTML element or a component.
|
|
9614
|
+
*/
|
|
9615
|
+
component: PropTypes.elementType,
|
|
9616
|
+
/**
|
|
9617
|
+
* Image to be displayed as a background image.
|
|
9618
|
+
* Either `image` or `src` prop must be specified.
|
|
9619
|
+
* Note that caller must specify height otherwise the image will not be visible.
|
|
9620
|
+
*/
|
|
9621
|
+
image: PropTypes.string,
|
|
9622
|
+
/**
|
|
9623
|
+
* An alias for `image` property.
|
|
9624
|
+
* Available only with media components.
|
|
9625
|
+
* Media components: `video`, `audio`, `picture`, `iframe`, `img`.
|
|
9626
|
+
*/
|
|
9627
|
+
src: PropTypes.string,
|
|
9628
|
+
/**
|
|
9629
|
+
* @ignore
|
|
9630
|
+
*/
|
|
9631
|
+
style: PropTypes.object,
|
|
9632
|
+
/**
|
|
9633
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9634
|
+
*/
|
|
9635
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
9636
|
+
} : void 0;
|
|
9637
|
+
var CardMedia$1 = CardMedia;
|
|
9638
|
+
|
|
9639
|
+
const Stack = createStack({
|
|
9640
|
+
createStyledComponent: styled$1('div', {
|
|
9641
|
+
name: 'MuiStack',
|
|
9642
|
+
slot: 'Root',
|
|
9643
|
+
overridesResolver: (props, styles) => styles.root
|
|
9644
|
+
}),
|
|
9645
|
+
useThemeProps: inProps => useThemeProps({
|
|
9646
|
+
props: inProps,
|
|
9647
|
+
name: 'MuiStack'
|
|
9648
|
+
})
|
|
9649
|
+
});
|
|
9650
|
+
process.env.NODE_ENV !== "production" ? Stack.propTypes /* remove-proptypes */ = {
|
|
9651
|
+
// ----------------------------- Warning --------------------------------
|
|
9652
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
9653
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
9654
|
+
// ----------------------------------------------------------------------
|
|
9655
|
+
/**
|
|
9656
|
+
* The content of the component.
|
|
9657
|
+
*/
|
|
9658
|
+
children: PropTypes.node,
|
|
9659
|
+
/**
|
|
9660
|
+
* The component used for the root node.
|
|
9661
|
+
* Either a string to use a HTML element or a component.
|
|
9662
|
+
*/
|
|
9663
|
+
component: PropTypes.elementType,
|
|
9664
|
+
/**
|
|
9665
|
+
* Defines the `flex-direction` style property.
|
|
9666
|
+
* It is applied for all screen sizes.
|
|
9667
|
+
* @default 'column'
|
|
9668
|
+
*/
|
|
9669
|
+
direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),
|
|
9670
|
+
/**
|
|
9671
|
+
* Add an element between each child.
|
|
9672
|
+
*/
|
|
9673
|
+
divider: PropTypes.node,
|
|
9674
|
+
/**
|
|
9675
|
+
* Defines the space between immediate children.
|
|
9676
|
+
* @default 0
|
|
9677
|
+
*/
|
|
9678
|
+
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
9679
|
+
/**
|
|
9680
|
+
* The system prop, which allows defining system overrides as well as additional CSS styles.
|
|
9681
|
+
*/
|
|
9682
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
9683
|
+
/**
|
|
9684
|
+
* If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
|
|
9685
|
+
*
|
|
9686
|
+
* While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
|
|
9687
|
+
* it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
|
|
9688
|
+
*
|
|
9689
|
+
* To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
|
|
9690
|
+
* @default false
|
|
9691
|
+
*/
|
|
9692
|
+
useFlexGap: PropTypes.bool
|
|
9693
|
+
} : void 0;
|
|
9694
|
+
var Stack$1 = Stack;
|
|
9695
|
+
|
|
8668
9696
|
var UrlImage;
|
|
8669
9697
|
(function (UrlImage) {
|
|
8670
9698
|
UrlImage["error"] = "src/assets/images/error.svg";
|
|
@@ -8672,5 +9700,50 @@ var UrlImage;
|
|
|
8672
9700
|
UrlImage["noresult"] = "src/assets/images/noresult.svg";
|
|
8673
9701
|
UrlImage["create"] = "src/assets/images/create.svg";
|
|
8674
9702
|
})(UrlImage || (UrlImage = {}));
|
|
9703
|
+
const EmptyState = ({
|
|
9704
|
+
state: _state = 'create',
|
|
9705
|
+
title,
|
|
9706
|
+
content,
|
|
9707
|
+
actions
|
|
9708
|
+
}) => {
|
|
9709
|
+
return jsx(Card$1, {
|
|
9710
|
+
elevation: 1,
|
|
9711
|
+
children: jsxs(CardContent$1, {
|
|
9712
|
+
sx: {
|
|
9713
|
+
display: 'flex',
|
|
9714
|
+
alignItems: 'center',
|
|
9715
|
+
justifyContent: 'center',
|
|
9716
|
+
flexDirection: 'column',
|
|
9717
|
+
gap: 4
|
|
9718
|
+
},
|
|
9719
|
+
children: [jsx(CardMedia$1, {
|
|
9720
|
+
component: "img",
|
|
9721
|
+
src: UrlImage[_state],
|
|
9722
|
+
sx: {
|
|
9723
|
+
width: 206,
|
|
9724
|
+
height: 187
|
|
9725
|
+
}
|
|
9726
|
+
}), jsxs(Stack$1, {
|
|
9727
|
+
direction: "column",
|
|
9728
|
+
spacing: 2,
|
|
9729
|
+
children: [title && jsx(Typography$1, {
|
|
9730
|
+
variant: "h6",
|
|
9731
|
+
textAlign: "center",
|
|
9732
|
+
children: title
|
|
9733
|
+
}), content && jsx(Typography$1, {
|
|
9734
|
+
variant: "body1",
|
|
9735
|
+
textAlign: "center",
|
|
9736
|
+
color: "text.secondary",
|
|
9737
|
+
children: content
|
|
9738
|
+
}), _state === 'create' && actions && jsx(Stack$1, {
|
|
9739
|
+
direction: "row",
|
|
9740
|
+
spacing: 2,
|
|
9741
|
+
justifyContent: "center",
|
|
9742
|
+
children: actions
|
|
9743
|
+
})]
|
|
9744
|
+
})]
|
|
9745
|
+
})
|
|
9746
|
+
});
|
|
9747
|
+
};
|
|
8675
9748
|
|
|
8676
|
-
export { SincoTheme, UrlImage };
|
|
9749
|
+
export { EmptyState, SincoTheme, UrlImage };
|