@popmenu/common-ui 0.27.0 → 0.29.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/build/components/Typography/Typography.d.ts +1 -1
- package/build/components/Typography/TypographyProps.d.ts +6 -1
- package/build/components/Typography/index.d.ts +1 -1
- package/build/components/Typography/variantMap.d.ts +3 -0
- package/build/components/index.d.ts +1 -1
- package/build/index.es.js +125 -45
- package/build/index.es.js.map +1 -1
- package/build/index.js +125 -45
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -155,57 +155,57 @@ function __rest(s, e) {
|
|
|
155
155
|
return t;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
var _path$
|
|
158
|
+
var _path$2g;
|
|
159
159
|
|
|
160
|
-
function _extends$
|
|
160
|
+
function _extends$3t() { _extends$3t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3t.apply(this, arguments); }
|
|
161
161
|
|
|
162
162
|
function SvgMinusCircle(props) {
|
|
163
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
163
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3t({
|
|
164
164
|
viewBox: "0 0 16 16",
|
|
165
|
+
fill: "none",
|
|
165
166
|
strokeLinecap: "round",
|
|
166
167
|
strokeLinejoin: "round",
|
|
167
|
-
stroke: "currentColor",
|
|
168
168
|
width: "1em",
|
|
169
|
-
height: "1em"
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
169
|
+
height: "1em"
|
|
170
|
+
}, props), _path$2g || (_path$2g = /*#__PURE__*/React__namespace.createElement("path", {
|
|
171
|
+
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zM5.333 8h5.334",
|
|
172
|
+
stroke: "currentColor"
|
|
173
173
|
})));
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
var _path$
|
|
176
|
+
var _path$28;
|
|
177
177
|
|
|
178
|
-
function _extends$
|
|
178
|
+
function _extends$3l() { _extends$3l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3l.apply(this, arguments); }
|
|
179
179
|
|
|
180
180
|
function SvgPlusCircle(props) {
|
|
181
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
181
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3l({
|
|
182
182
|
viewBox: "0 0 16 16",
|
|
183
|
+
fill: "none",
|
|
183
184
|
strokeLinecap: "round",
|
|
184
185
|
strokeLinejoin: "round",
|
|
185
|
-
stroke: "currentColor",
|
|
186
186
|
width: "1em",
|
|
187
|
-
height: "1em"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
height: "1em"
|
|
188
|
+
}, props), _path$28 || (_path$28 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
189
|
+
d: "M8 14.667A6.667 6.667 0 108 1.334a6.667 6.667 0 000 13.333zm0-9.334v5.334M5.333 8h5.334",
|
|
190
|
+
stroke: "currentColor"
|
|
191
191
|
})));
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
var _path$
|
|
194
|
+
var _path$1W;
|
|
195
195
|
|
|
196
|
-
function _extends$
|
|
196
|
+
function _extends$31() { _extends$31 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$31.apply(this, arguments); }
|
|
197
197
|
|
|
198
198
|
function SvgUser(props) {
|
|
199
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
199
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$31({
|
|
200
200
|
viewBox: "0 0 16 16",
|
|
201
|
+
fill: "none",
|
|
201
202
|
strokeLinecap: "round",
|
|
202
203
|
strokeLinejoin: "round",
|
|
203
|
-
stroke: "currentColor",
|
|
204
204
|
width: "1em",
|
|
205
|
-
height: "1em"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
height: "1em"
|
|
206
|
+
}, props), _path$1W || (_path$1W = /*#__PURE__*/React__namespace.createElement("path", {
|
|
207
|
+
d: "M13.333 14v-1.333A2.667 2.667 0 0010.667 10H5.333a2.667 2.667 0 00-2.666 2.667V14M8 7.333A2.667 2.667 0 108 2a2.667 2.667 0 000 5.333z",
|
|
208
|
+
stroke: "currentColor"
|
|
209
209
|
})));
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -436,29 +436,109 @@ var Checkbox = React.forwardRef(function (props, ref) {
|
|
|
436
436
|
});
|
|
437
437
|
Checkbox.displayName = 'Checkbox';
|
|
438
438
|
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
|
|
439
|
+
var weights = {
|
|
440
|
+
regular: 400,
|
|
441
|
+
'semi-bold': 600,
|
|
442
|
+
bold: 700,
|
|
443
|
+
};
|
|
444
|
+
var getColor = function (theme, props) {
|
|
445
|
+
var color = props.color;
|
|
446
|
+
if (color === undefined) {
|
|
447
|
+
return undefined;
|
|
448
|
+
}
|
|
449
|
+
if (['white', 'black'].includes(color)) {
|
|
450
|
+
return theme.palette.common[color];
|
|
451
|
+
}
|
|
452
|
+
if (color.match(/^grey\.\d{3}/)) {
|
|
453
|
+
var scale = color.split('.')[1];
|
|
454
|
+
return theme.palette.grey[scale] || theme.palette.grey[900];
|
|
455
|
+
}
|
|
456
|
+
if ([
|
|
457
|
+
'primary.light',
|
|
458
|
+
'primary.dark',
|
|
459
|
+
'secondary.light',
|
|
460
|
+
'secondary',
|
|
461
|
+
'secondary.dark',
|
|
462
|
+
'info.light',
|
|
463
|
+
'info.dark',
|
|
464
|
+
'success.light',
|
|
465
|
+
'success.dark',
|
|
466
|
+
'error.light',
|
|
467
|
+
'error.dark',
|
|
468
|
+
'warning.light',
|
|
469
|
+
'warning.dark',
|
|
470
|
+
].includes(color)) {
|
|
471
|
+
var _a = color.split('.'), paletteKey = _a[0], variant = _a[1];
|
|
472
|
+
return theme.palette[paletteKey][variant];
|
|
473
|
+
}
|
|
474
|
+
if (['success', 'info', 'error', 'warning', 'primary', 'secondary'].includes(color)) {
|
|
475
|
+
return theme.palette[color].main;
|
|
476
|
+
}
|
|
477
|
+
if (['textPrimary', 'textSecondary'].includes(color)) {
|
|
478
|
+
return theme.palette.text[color.slice(4).toLowerCase()];
|
|
479
|
+
}
|
|
480
|
+
return undefined;
|
|
481
|
+
};
|
|
482
|
+
var useTypographyStyles = styles.makeStyles(function (theme) {
|
|
483
|
+
var _a;
|
|
484
|
+
return ({
|
|
485
|
+
root: (_a = {},
|
|
486
|
+
_a["& ." + iconStaticClassName] = {
|
|
487
|
+
position: 'relative',
|
|
488
|
+
top: '0.125em',
|
|
489
|
+
padding: '0 0.125em',
|
|
490
|
+
boxSizing: 'content-box',
|
|
491
|
+
},
|
|
492
|
+
_a.fontFamily = theme.typography.fontFamily,
|
|
493
|
+
_a.fontWeight = function (_a) {
|
|
494
|
+
var variant = _a.variant, weight = _a.weight;
|
|
495
|
+
return (weight ? weights[weight] : theme.typography[variant || 'body1'].fontWeight);
|
|
496
|
+
},
|
|
497
|
+
_a.fontSize = function (_a) {
|
|
498
|
+
var variant = _a.variant;
|
|
499
|
+
return theme.typography[variant || 'body1'].fontSize;
|
|
500
|
+
},
|
|
501
|
+
_a.lineHeight = function (_a) {
|
|
502
|
+
var variant = _a.variant;
|
|
503
|
+
return theme.typography[variant || 'body1'].lineHeight;
|
|
504
|
+
},
|
|
505
|
+
_a.textTransform = function (_a) {
|
|
506
|
+
var variant = _a.variant;
|
|
507
|
+
return theme.typography[variant || 'body1'].textTransform;
|
|
508
|
+
},
|
|
509
|
+
_a.color = function (props) { return getColor(theme, props); },
|
|
510
|
+
_a),
|
|
511
|
+
caption: {
|
|
512
|
+
display: 'inline',
|
|
513
|
+
},
|
|
514
|
+
overline: {
|
|
515
|
+
display: 'inline',
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
var variantMap = {
|
|
521
|
+
h1: 'h1',
|
|
522
|
+
h2: 'h2',
|
|
523
|
+
h3: 'h3',
|
|
524
|
+
h4: 'h4',
|
|
525
|
+
h5: 'h5',
|
|
526
|
+
h6: 'h6',
|
|
527
|
+
h7: 'h6',
|
|
528
|
+
body1: 'p',
|
|
529
|
+
body2: 'p',
|
|
530
|
+
subtitle1: 'h6',
|
|
531
|
+
subtitle2: 'h6',
|
|
532
|
+
caption: 'span',
|
|
533
|
+
overline: 'span',
|
|
534
|
+
};
|
|
457
535
|
|
|
458
536
|
var Typography = React.forwardRef(function (props, ref) {
|
|
459
|
-
props.weight; var restProps = __rest(props, ["weight"]);
|
|
460
|
-
var
|
|
461
|
-
|
|
537
|
+
props.weight; var _a = props.variant, variant = _a === void 0 ? 'body1' : _a; props.color; var restProps = __rest(props, ["weight", "variant", "color"]);
|
|
538
|
+
var validatedVariant = Object.keys(variantMap).includes(variant) ? variant : 'body1';
|
|
539
|
+
var classes = useTypographyStyles(__assign(__assign({}, props), { variant: validatedVariant }));
|
|
540
|
+
var component = variantMap[validatedVariant];
|
|
541
|
+
return React__default['default'].createElement(core.Typography, __assign({ component: component, ref: ref, classes: classes }, restProps, { variant: "inherit" }));
|
|
462
542
|
});
|
|
463
543
|
Typography.displayName = 'Typography';
|
|
464
544
|
|