@veracity/vui 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/avatar/avatar.js +5 -5
  2. package/box/box.js +6 -6
  3. package/button/button.js +19 -23
  4. package/button/button.types.d.ts +33 -3
  5. package/button/buttonIcon.js +3 -3
  6. package/button/buttonText.js +3 -3
  7. package/button/buttons.js +8 -8
  8. package/button/context.js +1 -1
  9. package/button/theme.js +0 -6
  10. package/buttonGroup/buttonGroup.js +5 -10
  11. package/buttonGroup/context.js +1 -1
  12. package/card/card.js +4 -4
  13. package/checkbox/checkbox.js +12 -12
  14. package/checkbox/checkboxGroup.js +7 -7
  15. package/checkbox/checkboxGroup.types.d.ts +1 -1
  16. package/checkbox/context.js +1 -1
  17. package/checkbox/theme.js +5 -2
  18. package/core/globalStyle.js +2 -3
  19. package/core/resetCSS.js +1 -1
  20. package/core/styled.js +11 -7
  21. package/core/utils.js +9 -9
  22. package/core/v.js +1 -1
  23. package/divider/divider.js +6 -6
  24. package/heading/heading.js +6 -6
  25. package/heading/headings.js +6 -6
  26. package/icon/icon.js +6 -6
  27. package/icons/library.js +9 -5
  28. package/image/image.js +4 -4
  29. package/input/context.js +1 -1
  30. package/input/input.js +11 -16
  31. package/input/inputIcon.js +3 -3
  32. package/input/inputInput.js +4 -4
  33. package/link/link.js +6 -6
  34. package/list/context.js +1 -1
  35. package/list/list.js +6 -11
  36. package/list/listHeading.js +3 -3
  37. package/list/listIcon.js +3 -3
  38. package/list/listItem.js +8 -8
  39. package/list/listText.js +3 -3
  40. package/notification/context.js +1 -1
  41. package/notification/notification.js +6 -11
  42. package/notification/notificationButton.js +3 -3
  43. package/notification/notificationIcon.js +3 -3
  44. package/notification/notificationText.js +3 -3
  45. package/notification/notificationTitle.js +3 -3
  46. package/p/p.js +6 -6
  47. package/package.json +1 -1
  48. package/panel/panel.js +4 -4
  49. package/radio/context.js +1 -1
  50. package/radio/radio.js +58 -13
  51. package/radio/radioGroup.js +25 -17
  52. package/radio/radioGroup.types.d.ts +1 -1
  53. package/radio/theme.js +5 -2
  54. package/skeleton/skeleton.js +6 -6
  55. package/spinner/spinner.js +5 -5
  56. package/svg/svg.js +12 -12
  57. package/switch/context.js +1 -1
  58. package/switch/switch.js +12 -50
  59. package/switch/switch.types.d.ts +2 -2
  60. package/switch/switchButton.js +19 -21
  61. package/switch/switchLabel.js +3 -3
  62. package/system/custom.d.ts +11 -7
  63. package/system/custom.js +24 -13
  64. package/system/system.d.ts +4 -3
  65. package/system/system.js +2 -2
  66. package/system/tables.d.ts +14 -0
  67. package/system/tables.js +2 -0
  68. package/t/t.js +6 -6
  69. package/tag/context.js +1 -1
  70. package/tag/index.d.ts +1 -0
  71. package/tag/index.js +1 -0
  72. package/tag/tag.d.ts +2 -0
  73. package/tag/tag.js +14 -12
  74. package/tag/tag.types.d.ts +1 -0
  75. package/tag/tagButton.d.ts +3 -0
  76. package/tag/tagButton.js +30 -0
  77. package/tag/tagIcon.js +3 -3
  78. package/tag/tagText.js +3 -3
  79. package/tag/theme.d.ts +26 -0
  80. package/tag/theme.js +32 -3
  81. package/textarea/textarea.js +9 -9
  82. package/theme/components.d.ts +26 -0
  83. package/theme/defaultTheme.d.ts +26 -0
  84. package/theme/foundations/shadows.js +2 -2
  85. package/theme/index.d.ts +16 -0
  86. package/theme/index.js +33 -1
  87. package/utils/assertion.js +1 -2
  88. package/utils/function.js +9 -5
  89. package/utils/object.js +3 -3
package/avatar/avatar.js CHANGED
@@ -54,15 +54,15 @@ var icon_1 = __importDefault(require("../icon"));
54
54
  var system_1 = require("../system");
55
55
  var utils_1 = require("../utils");
56
56
  var AvatarImage = styled_components_2.default.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\theight: 100%;\n\twidth: 100%;\n\n\t", "\n"], ["\n\theight: 100%;\n\twidth: 100%;\n\n\t", "\n"])), styled_components_1.borders);
57
- exports.AvatarBase = styled_components_2.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"])), system_1.system);
57
+ exports.AvatarBase = styled_components_2.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"])), system_1.system);
58
58
  function defaultGetInitials(name) {
59
59
  if (name === void 0) { name = ''; }
60
60
  var _a = __read(name.split(' '), 2), _b = _a[0], first = _b === void 0 ? '' : _b, _c = _a[1], last = _c === void 0 ? '' : _c;
61
61
  return ("" + first.charAt(0) + last.charAt(0)).toUpperCase();
62
62
  }
63
- exports.Avatar = core_1.vui(function (props, ref) {
64
- var _a = core_1.omitThemingProps(props), children = _a.children, className = _a.className, _b = _a.getInitials, getInitials = _b === void 0 ? defaultGetInitials : _b, icon = _a.icon, _c = _a.isInteractive, isInteractive = _c === void 0 ? props.onClick !== undefined : _c, isSquare = _a.isSquare, _d = _a.name, name = _d === void 0 ? '' : _d, src = _a.src, rest = __rest(_a, ["children", "className", "getInitials", "icon", "isInteractive", "isSquare", "name", "src"]);
65
- var _e = core_1.useStyleConfig('Avatar', props), activeBg = _e.activeBg, h = _e.h, hoverBg = _e.hoverBg, iconSize = _e.iconSize, styles = __rest(_e, ["activeBg", "h", "hoverBg", "iconSize"]);
63
+ exports.Avatar = (0, core_1.vui)(function (props, ref) {
64
+ var _a = (0, core_1.omitThemingProps)(props), children = _a.children, className = _a.className, _b = _a.getInitials, getInitials = _b === void 0 ? defaultGetInitials : _b, icon = _a.icon, _c = _a.isInteractive, isInteractive = _c === void 0 ? props.onClick !== undefined : _c, isSquare = _a.isSquare, _d = _a.name, name = _d === void 0 ? '' : _d, src = _a.src, rest = __rest(_a, ["children", "className", "getInitials", "icon", "isInteractive", "isSquare", "name", "src"]);
65
+ var _e = (0, core_1.useStyleConfig)('Avatar', props), activeBg = _e.activeBg, h = _e.h, hoverBg = _e.hoverBg, iconSize = _e.iconSize, styles = __rest(_e, ["activeBg", "h", "hoverBg", "iconSize"]);
66
66
  var borderRadius = isSquare ? 'lg' : '50%';
67
67
  var initials = getInitials(name);
68
68
  var interactiveProps = isInteractive
@@ -75,7 +75,7 @@ exports.Avatar = core_1.vui(function (props, ref) {
75
75
  userSelect: 'none'
76
76
  }
77
77
  : {};
78
- return (react_1.default.createElement(exports.AvatarBase, __assign({ borderRadius: borderRadius, className: utils_1.cs('vui-avatar', className), fontWeight: "medium", h: h, ref: ref, transitionDuration: "fast", w: h }, styles, interactiveProps, rest), children ? (children) : src ? (react_1.default.createElement(AvatarImage, { borderRadius: borderRadius, src: src })) : icon ? (react_1.default.createElement(icon_1.default, { name: icon, size: iconSize })) : initials ? (initials) : null));
78
+ return (react_1.default.createElement(exports.AvatarBase, __assign({ borderRadius: borderRadius, className: (0, utils_1.cs)('vui-avatar', className), fontWeight: "medium", h: h, ref: ref, transitionDuration: "fast", w: h }, styles, interactiveProps, rest), children ? (children) : src ? (react_1.default.createElement(AvatarImage, { borderRadius: borderRadius, src: src })) : icon ? (react_1.default.createElement(icon_1.default, { name: icon, size: iconSize })) : initials ? (initials) : null));
79
79
  });
80
80
  exports.Avatar.displayName = 'Avatar';
81
81
  exports.default = exports.Avatar;
package/box/box.js CHANGED
@@ -35,14 +35,14 @@ var styled_components_1 = __importDefault(require("styled-components"));
35
35
  var core_1 = require("../core");
36
36
  var system_1 = require("../system");
37
37
  var utils_1 = require("../utils");
38
- exports.BoxBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tmin-width: 0;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tmin-width: 0;\n\n\t", "\n"])), system_1.system);
39
- exports.Box = core_1.vui(function (props, ref) {
40
- var _a = core_1.omitThemingProps(props), align = _a.align, center = _a.center, centerH = _a.centerH, centerV = _a.centerV, className = _a.className, column = _a.column, direction = _a.direction, hoverShadow = _a.hoverShadow, justify = _a.justify, radius = _a.radius, shadow = _a.shadow, wrap = _a.wrap, rest = __rest(_a, ["align", "center", "centerH", "centerV", "className", "column", "direction", "hoverShadow", "justify", "radius", "shadow", "wrap"]);
41
- var styles = core_1.useStyleConfig('Box', props);
38
+ exports.BoxBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tmin-width: 0;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tmin-width: 0;\n\n\t", "\n"])), system_1.system);
39
+ exports.Box = (0, core_1.vui)(function (props, ref) {
40
+ var _a = (0, core_1.omitThemingProps)(props), align = _a.align, center = _a.center, centerH = _a.centerH, centerV = _a.centerV, className = _a.className, column = _a.column, direction = _a.direction, hoverShadow = _a.hoverShadow, justify = _a.justify, radius = _a.radius, shadow = _a.shadow, wrap = _a.wrap, rest = __rest(_a, ["align", "center", "centerH", "centerV", "className", "column", "direction", "hoverShadow", "justify", "radius", "shadow", "wrap"]);
41
+ var styles = (0, core_1.useStyleConfig)('Box', props);
42
42
  var alignItems = (center || (column ? centerH : centerV)) && 'center';
43
43
  var flexDirection = column && 'column';
44
44
  var justifyContent = (center || (column ? centerV : centerH)) && 'center';
45
- var aliasedProps = utils_1.filterUndefined({
45
+ var aliasedProps = (0, utils_1.filterUndefined)({
46
46
  alignItems: align !== null && align !== void 0 ? align : alignItems,
47
47
  borderRadius: radius,
48
48
  boxShadow: shadow,
@@ -51,7 +51,7 @@ exports.Box = core_1.vui(function (props, ref) {
51
51
  hoverBoxShadow: hoverShadow,
52
52
  justifyContent: justify !== null && justify !== void 0 ? justify : justifyContent
53
53
  });
54
- return (react_1.default.createElement(exports.BoxBase, __assign({ className: utils_1.cs('vui-box', className), ref: ref, transitionDuration: "normal" }, styles, aliasedProps, rest)));
54
+ return (react_1.default.createElement(exports.BoxBase, __assign({ className: (0, utils_1.cs)('vui-box', className), ref: ref, transitionDuration: "normal" }, styles, aliasedProps, rest)));
55
55
  });
56
56
  exports.Box.displayName = 'Box';
57
57
  exports.default = exports.Box;
package/button/button.js CHANGED
@@ -60,37 +60,33 @@ var core_1 = require("../core");
60
60
  var system_1 = require("../system");
61
61
  var utils_1 = require("../utils");
62
62
  var ContentWrapper = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tvisibility: hidden;\n"], ["\n\tvisibility: hidden;\n"])));
63
- var StateWrapper = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\n\t", "\n"], ["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\n\t", "\n"])), system_1.system);
64
- exports.ButtonBase = styled_components_1.default.button.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t", "\n\n\t&:disabled {\n\t\t/* Specified here to avoid conflict with active/hover props */\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t", "\n\n\t&:disabled {\n\t\t/* Specified here to avoid conflict with active/hover props */\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n"])), system_1.system);
65
- exports.Button = core_1.vui(function (props, ref) {
63
+ var StateWrapper = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\n\t", "\n"], ["\n\tbottom: 0;\n\tdisplay: flex;\n\tleft: 0;\n\tposition: absolute;\n\tright: 0;\n\ttop: 0;\n\n\t", "\n"])), system_1.system);
64
+ exports.ButtonBase = styled_components_1.default.button.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t", "\n\n\t&:disabled {\n\t\t/* Specified here to avoid conflict with active/hover props */\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toverflow: hidden;\n\tposition: relative;\n\tuser-select: none;\n\twidth: fit-content;\n\n\t&:focus,\n\t&:focus:hover {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t\tz-index: 1;\n\t}\n\n\t", "\n\n\t&:disabled {\n\t\t/* Specified here to avoid conflict with active/hover props */\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n"])), system_1.system);
65
+ exports.Button = (0, core_1.vui)(function (props, ref) {
66
66
  var _a, _b, _c, _d;
67
- var buttonGroupProps = context_2.useButtonGroup();
67
+ var buttonGroupProps = (0, context_2.useButtonGroup)();
68
68
  var mergedProps = __assign(__assign({}, buttonGroupProps), props);
69
69
  var borderWidthProp = mergedProps.borderWidth, children = mergedProps.children, className = mergedProps.className, colorSchemeProp = mergedProps.colorScheme, disabled = mergedProps.disabled, icon = mergedProps.icon, iconLeft = mergedProps.iconLeft, iconRight = mergedProps.iconRight, isElevated = mergedProps.isElevated, isFullWidth = mergedProps.isFullWidth, isLoading = mergedProps.isLoading, // eslint-disable-line
70
70
  isRound = mergedProps.isRound, isSplit = mergedProps.isSplit, size = mergedProps.size, _e = mergedProps.state, state = _e === void 0 ? props.isLoading ? 'loading' : '' : _e, stateMapping = mergedProps.stateMapping, text = mergedProps.text, variant = mergedProps.variant, rest = __rest(mergedProps, ["borderWidth", "children", "className", "colorScheme", "disabled", "icon", "iconLeft", "iconRight", "isElevated", "isFullWidth", "isLoading", "isRound", "isSplit", "size", "state", "stateMapping", "text", "variant"]);
71
- var hasState = Boolean(state);
71
+ var hasState = Boolean(state) && state !== 'idle';
72
72
  var states = __assign(__assign({}, consts_1.buttonStateMapping), stateMapping);
73
73
  var _f = (_a = states[state]) !== null && _a !== void 0 ? _a : {}, stateIconProps = _f.iconProps, stateProps = __rest(_f, ["iconProps"]);
74
- var colorScheme = utils_1.filterUndefined({
74
+ var colorScheme = (0, utils_1.filterUndefined)({
75
75
  colorScheme: (_c = (_b = states[state]) === null || _b === void 0 ? void 0 : _b.colorScheme) !== null && _c !== void 0 ? _c : colorSchemeProp
76
76
  });
77
- var styles = core_1.useStyleConfig('Button', __assign(__assign({}, mergedProps), colorScheme));
77
+ var styles = (0, core_1.useStyleConfig)('Button', __assign(__assign({}, mergedProps), colorScheme));
78
78
  var _g = styles.container, borderWidth = _g.borderWidth, h = _g.h, _h = _g.spaceX, spaceX = _h === void 0 ? 0 : _h, buttonStyles = __rest(_g, ["borderWidth", "h", "spaceX"]);
79
- var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [
80
- colorScheme,
81
- disabled,
82
- size,
83
- variant
84
- ]);
79
+ var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [colorScheme, disabled, size, variant]);
85
80
  var Content = hasState ? ContentWrapper : react_1.default.Fragment;
86
81
  // Apply more space for text and less space for icons
87
82
  var border = (_d = borderWidthProp !== null && borderWidthProp !== void 0 ? borderWidthProp : borderWidth) !== null && _d !== void 0 ? _d : 0;
88
- var spaceXItem = spaceX - border + 'px';
89
- var spaceXText = spaceX * 2 - border + 'px';
90
- var iconRightMl = isSplit ? 'auto' : spaceXItem;
91
- var pl = icon || iconLeft ? spaceXItem : spaceXText;
92
- var pr = icon || iconRight ? spaceXItem : spaceXText;
93
- var aliasedProps = utils_1.filterUndefined({
83
+ var spaceXItem = spaceX - border;
84
+ var spaceXText = spaceX * 2 - border;
85
+ var iconLeftMr = spaceXItem + 1 + 'px';
86
+ var iconRightMl = isSplit ? 'auto' : spaceXItem + 1 + 'px';
87
+ var pl = (icon || iconLeft ? spaceXItem : spaceXText) + 'px';
88
+ var pr = (icon || iconRight ? spaceXItem : spaceXText) + 'px';
89
+ var aliasedProps = (0, utils_1.filterUndefined)({
94
90
  borderRadius: isRound ? h / 2 : undefined,
95
91
  boxShadow: isElevated ? '2' : undefined,
96
92
  minW: icon ? 0 : undefined,
@@ -98,14 +94,14 @@ exports.Button = core_1.vui(function (props, ref) {
98
94
  w: isFullWidth ? '100%' : undefined
99
95
  });
100
96
  return (react_1.default.createElement(context_1.ButtonProvider, { value: context },
101
- react_1.default.createElement(exports.ButtonBase, __assign({ borderRadius: "md", borderWidth: border, className: utils_1.cs('vui-button', className), disabled: disabled, focusRing: 3, fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast", type: "button" }, buttonStyles, aliasedProps, rest),
97
+ react_1.default.createElement(exports.ButtonBase, __assign({ borderRadius: "md", borderWidth: border, className: (0, utils_1.cs)('vui-button', className), disabled: disabled, focusRing: 3, fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast", type: "button" }, buttonStyles, aliasedProps, rest),
102
98
  hasState && (react_1.default.createElement(StateWrapper, __assign({ onClick: function (e) { return e.stopPropagation(); } }, stateProps),
103
99
  react_1.default.createElement(buttonIcon_1.default, __assign({ m: "auto" }, stateIconProps)))),
104
100
  react_1.default.createElement(Content, null,
105
- utils_1.isString(icon) ? react_1.default.createElement(buttonIcon_1.default, { name: icon }) : icon,
101
+ (0, utils_1.isString)(icon) ? react_1.default.createElement(buttonIcon_1.default, { name: icon }) : icon,
106
102
  !icon && (react_1.default.createElement(react_1.default.Fragment, null,
107
- utils_1.isString(iconLeft) ? react_1.default.createElement(buttonIcon_1.default, { mr: spaceXItem, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : (utils_1.isReactText(text) ? react_1.default.createElement(buttonText_1.default, { text: text }) : text),
108
- utils_1.isString(iconRight) ? react_1.default.createElement(buttonIcon_1.default, { ml: iconRightMl, name: iconRight }) : iconRight))))));
103
+ (0, utils_1.isString)(iconLeft) ? react_1.default.createElement(buttonIcon_1.default, { mr: iconLeftMr, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : ((0, utils_1.isReactText)(text) ? react_1.default.createElement(buttonText_1.default, { text: text }) : text),
104
+ (0, utils_1.isString)(iconRight) ? react_1.default.createElement(buttonIcon_1.default, { ml: iconRightMl, name: iconRight }) : iconRight))))));
109
105
  });
110
106
  exports.Button.displayName = 'Button';
111
107
  exports.Button.Icon = buttonIcon_1.default;
@@ -2,22 +2,52 @@
2
2
  import { IconProp, IconProps } from '../icon';
3
3
  import { SystemProps } from '../system';
4
4
  import { ThemingProps } from '../theme';
5
- import { AnyElement } from '../utils';
5
+ import { AnyElement, AnyString } from '../utils';
6
6
  export interface ButtonProps extends SystemProps, ThemingProps<'Button'> {
7
- colorScheme?: 'blue' | 'green' | 'grey' | 'pink' | 'prussian' | 'red';
7
+ /**
8
+ * Available theme colors for this component.
9
+ * @default prussian
10
+ */
11
+ colorScheme?: 'blue' | 'green' | 'pink' | 'prussian' | 'red';
12
+ /** Icon that replaces any other content. */
8
13
  icon?: IconProp | AnyElement;
14
+ /** Socket placing icon before the children. */
9
15
  iconLeft?: IconProp | AnyElement;
16
+ /** Socket placing icon after the children. */
10
17
  iconRight?: IconProp | AnyElement;
18
+ /**
19
+ * Adds box shadow style.
20
+ * @default false
21
+ */
11
22
  isElevated?: boolean;
23
+ /**
24
+ * Makes the button take full width of the container.
25
+ * @default false
26
+ */
12
27
  isFullWidth?: boolean;
28
+ /**
29
+ * Replaces content with a loading spinner.
30
+ * @default false
31
+ */
13
32
  isLoading?: boolean;
33
+ /**
34
+ * Rounds the borders.
35
+ * @default false
36
+ */
14
37
  isRound?: boolean;
38
+ /**
39
+ * Separates right icon from the content.
40
+ * @default false
41
+ */
15
42
  isSplit?: boolean;
43
+ /** Replaces content with icon and color matching the operation state. */
16
44
  state?: ButtonState;
45
+ /** Object allowing configuration of state variants. */
17
46
  stateMapping?: ButtonStateMapping;
47
+ /** Socket placing text as alternative to children. */
18
48
  text?: React.ReactNode;
19
49
  }
20
- export declare type ButtonState = 'error' | 'loading' | 'success';
50
+ export declare type ButtonState = 'error' | 'idle' | 'loading' | 'success' | AnyString;
21
51
  export declare type ButtonStateMapping = Record<string, SystemProps & {
22
52
  colorScheme: ButtonProps['colorScheme'];
23
53
  iconProps: IconProps;
@@ -19,11 +19,11 @@ var react_1 = __importDefault(require("react"));
19
19
  var context_1 = require("./context");
20
20
  var core_1 = require("../core");
21
21
  var icon_1 = __importDefault(require("../icon"));
22
- exports.ButtonIcon = core_1.vui(function (props, ref) {
22
+ exports.ButtonIcon = (0, core_1.vui)(function (props, ref) {
23
23
  var _a;
24
- var buttonProps = (_a = context_1.useButton()) !== null && _a !== void 0 ? _a : {};
24
+ var buttonProps = (_a = (0, context_1.useButton)()) !== null && _a !== void 0 ? _a : {};
25
25
  var mergedProps = __assign(__assign({}, buttonProps), props);
26
- var styles = core_1.useStyleConfig('Button', mergedProps);
26
+ var styles = (0, core_1.useStyleConfig)('Button', mergedProps);
27
27
  return react_1.default.createElement(icon_1.default, __assign({ className: "vui-buttonIcon", ref: ref }, styles.icon, props));
28
28
  });
29
29
  exports.ButtonIcon.displayName = 'ButtonIcon';
@@ -19,11 +19,11 @@ var react_1 = __importDefault(require("react"));
19
19
  var context_1 = require("./context");
20
20
  var core_1 = require("../core");
21
21
  var t_1 = __importDefault(require("../t"));
22
- exports.ButtonText = core_1.vui(function (props, ref) {
22
+ exports.ButtonText = (0, core_1.vui)(function (props, ref) {
23
23
  var _a;
24
- var buttonProps = (_a = context_1.useButton()) !== null && _a !== void 0 ? _a : {};
24
+ var buttonProps = (_a = (0, context_1.useButton)()) !== null && _a !== void 0 ? _a : {};
25
25
  var mergedProps = __assign(__assign({}, buttonProps), props);
26
- var styles = core_1.useStyleConfig('Button', mergedProps);
26
+ var styles = (0, core_1.useStyleConfig)('Button', mergedProps);
27
27
  return react_1.default.createElement(t_1.default, __assign({ className: "vui-buttonText", fontSize: "inherit", ref: ref }, styles.text, props));
28
28
  });
29
29
  exports.ButtonText.displayName = 'ButtonText';
package/button/buttons.js CHANGED
@@ -18,11 +18,11 @@ exports.TextButton = exports.LineButton = exports.IconButton = exports.DangerBut
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var button_1 = __importDefault(require("./button"));
20
20
  var core_1 = require("../core");
21
- exports.AppButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "solid" }, props))); });
22
- exports.BackButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(exports.IconButton, __assign({ colorScheme: "blue", icon: "falChevronLeft", ref: ref, variant: "text" }, props))); });
23
- exports.CloseButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(exports.IconButton, __assign({ colorScheme: "blue", icon: "falTimes", ref: ref, variant: "text" }, props))); });
24
- exports.CTAButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "green", ref: ref, variant: "solid" }, props))); });
25
- exports.DangerButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "red", ref: ref, variant: "solid" }, props))); });
26
- exports.IconButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "text" }, props))); });
27
- exports.LineButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "outlined" }, props))); });
28
- exports.TextButton = core_1.vui(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "text" }, props))); });
21
+ exports.AppButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "solid" }, props))); });
22
+ exports.BackButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(exports.IconButton, __assign({ colorScheme: "blue", icon: "falArrowLeft", ref: ref, variant: "text" }, props))); });
23
+ exports.CloseButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(exports.IconButton, __assign({ colorScheme: "blue", icon: "falTimes", ref: ref, variant: "text" }, props))); });
24
+ exports.CTAButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "green", ref: ref, variant: "solid" }, props))); });
25
+ exports.DangerButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "red", ref: ref, variant: "solid" }, props))); });
26
+ exports.IconButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "text" }, props))); });
27
+ exports.LineButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "outlined" }, props))); });
28
+ exports.TextButton = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(button_1.default, __assign({ colorScheme: "blue", ref: ref, variant: "text" }, props))); });
package/button/context.js CHANGED
@@ -18,6 +18,6 @@ var __read = (this && this.__read) || function (o, n) {
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.useButton = exports.ButtonProvider = void 0;
20
20
  var core_1 = require("../core");
21
- var _a = __read(core_1.createContext({ isOptional: true }), 2), ButtonProvider = _a[0], useButton = _a[1];
21
+ var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), ButtonProvider = _a[0], useButton = _a[1];
22
22
  exports.ButtonProvider = ButtonProvider;
23
23
  exports.useButton = useButton;
package/button/theme.js CHANGED
@@ -54,9 +54,6 @@ function variantSubtle(props) {
54
54
  container.bg = 'blue.20';
55
55
  container.borderColor = 'blue.20';
56
56
  }
57
- if (c === 'grey') {
58
- container.color = 'prussian.80';
59
- }
60
57
  return { container: container };
61
58
  }
62
59
  function variantText(props) {
@@ -76,9 +73,6 @@ function variantText(props) {
76
73
  container.hoverBg = 'blue.20';
77
74
  container.hoverBorderColor = 'blue.20';
78
75
  }
79
- if (c === 'grey') {
80
- container.color = 'prussian.80';
81
- }
82
76
  return { container: container };
83
77
  }
84
78
  var defaultProps = {
@@ -56,18 +56,13 @@ var helpers_1 = require("./helpers");
56
56
  var core_1 = require("../core");
57
57
  var system_1 = require("../system");
58
58
  var utils_1 = require("../utils");
59
- exports.ButtonGroupBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"], ["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"])), function (p) { return core_1.th.color(p.innerBorderColor); }, system_1.system);
60
- exports.ButtonGroup = core_1.vui(function (props, ref) {
59
+ exports.ButtonGroupBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"], ["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"])), function (p) { return core_1.th.color(p.innerBorderColor); }, system_1.system);
60
+ exports.ButtonGroup = (0, core_1.vui)(function (props, ref) {
61
61
  var className = props.className, colorScheme = props.colorScheme, disabled = props.disabled, size = props.size, variant = props.variant, rest = __rest(props, ["className", "colorScheme", "disabled", "size", "variant"]);
62
- var innerBorderColor = helpers_1.getInnerBorderColor(props);
63
- var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [
64
- colorScheme,
65
- disabled,
66
- size,
67
- variant
68
- ]);
62
+ var innerBorderColor = (0, helpers_1.getInnerBorderColor)(props);
63
+ var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [colorScheme, disabled, size, variant]);
69
64
  return (react_1.default.createElement(context_1.ButtonGroupProvider, { value: context },
70
- react_1.default.createElement(exports.ButtonGroupBase, __assign({ className: utils_1.cs('vui-buttonGroup', className) }, { innerBorderColor: innerBorderColor, ref: ref }, rest))));
65
+ react_1.default.createElement(exports.ButtonGroupBase, __assign({ className: (0, utils_1.cs)('vui-buttonGroup', className) }, { innerBorderColor: innerBorderColor, ref: ref }, rest))));
71
66
  });
72
67
  exports.ButtonGroup.displayName = 'ButtonGroup';
73
68
  exports.default = exports.ButtonGroup;
@@ -18,6 +18,6 @@ var __read = (this && this.__read) || function (o, n) {
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.useButtonGroup = exports.ButtonGroupProvider = void 0;
20
20
  var core_1 = require("../core");
21
- var _a = __read(core_1.createContext({ isOptional: true }), 2), ButtonGroupProvider = _a[0], useButtonGroup = _a[1];
21
+ var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), ButtonGroupProvider = _a[0], useButtonGroup = _a[1];
22
22
  exports.ButtonGroupProvider = ButtonGroupProvider;
23
23
  exports.useButtonGroup = useButtonGroup;
package/card/card.js CHANGED
@@ -30,9 +30,9 @@ var react_1 = __importDefault(require("react"));
30
30
  var box_1 = __importDefault(require("../box"));
31
31
  var core_1 = require("../core");
32
32
  var utils_1 = require("../utils");
33
- exports.Card = core_1.vui(function (props, ref) {
34
- var _a = core_1.omitThemingProps(props), className = _a.className, _b = _a.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, rest = __rest(_a, ["className", "isInteractive"]);
35
- var styles = core_1.useStyleConfig('Card', props);
33
+ exports.Card = (0, core_1.vui)(function (props, ref) {
34
+ var _a = (0, core_1.omitThemingProps)(props), className = _a.className, _b = _a.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, rest = __rest(_a, ["className", "isInteractive"]);
35
+ var styles = (0, core_1.useStyleConfig)('Card', props);
36
36
  var interactiveProps = isInteractive
37
37
  ? {
38
38
  cursor: 'pointer',
@@ -41,7 +41,7 @@ exports.Card = core_1.vui(function (props, ref) {
41
41
  userSelect: 'none'
42
42
  }
43
43
  : {};
44
- return (react_1.default.createElement(box_1.default, __assign({ bg: "white", borderRadius: "md", className: utils_1.cs('vui-card', className), ref: ref, ring: 1, ringColor: "transparent", shadow: "2" }, styles, interactiveProps, rest)));
44
+ return (react_1.default.createElement(box_1.default, __assign({ bg: "white", borderRadius: "md", className: (0, utils_1.cs)('vui-card', className), ref: ref, ring: 1, ringColor: "transparent", shadow: "2" }, styles, interactiveProps, rest)));
45
45
  });
46
46
  exports.Card.displayName = 'Card';
47
47
  exports.default = exports.Card;
@@ -74,28 +74,28 @@ var system_1 = require("../system");
74
74
  var t_1 = __importDefault(require("../t"));
75
75
  var utils_1 = require("../utils");
76
76
  exports.CheckboxInput = styled_components_1.default.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: 0;\n\twidth: 100%;\n\tz-index: 1;\n"], ["\n\tcursor: inherit;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: 0;\n\twidth: 100%;\n\tz-index: 1;\n"])));
77
- exports.CheckboxBase = styled_components_1.default.label.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t:hover .vui-checkboxControl {\n\t\tcolor: ", ";\n\t}\n\n\t&.disabled {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\n\t\t.vui-checkboxControl {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t:hover .vui-checkboxControl {\n\t\tcolor: ", ";\n\t}\n\n\t&.disabled {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\n\t\t.vui-checkboxControl {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"])), function (p) { return core_1.th.color(p.controlHoverColor)(p); }, system_1.system);
78
- exports.CheckboxControl = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t", "\n"], ["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
79
- exports.Checkbox = core_1.vui(function (props, ref) {
80
- var checkboxGroupProps = context_1.useCheckboxGroup();
77
+ exports.CheckboxBase = styled_components_1.default.label.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t:hover .vui-checkboxControl {\n\t\tcolor: ", ";\n\t}\n\n\t&.disabled {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\n\t\t.vui-checkboxControl {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t:hover .vui-checkboxControl {\n\t\tcolor: ", ";\n\t}\n\n\t&.disabled {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\n\t\t.vui-checkboxControl {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"])), function (p) { return core_1.th.color(p.controlHoverColor)(p); }, system_1.system);
78
+ exports.CheckboxControl = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t", "\n"], ["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
79
+ exports.Checkbox = (0, core_1.vui)(function (props, ref) {
80
+ var _a = (0, context_1.useCheckboxGroup)(), groupDefaultValue = _a.defaultValue, checkboxGroupProps = __rest(_a, ["defaultValue"]);
81
81
  var mergedProps = __assign(__assign({}, checkboxGroupProps), props);
82
- var _a = core_1.omitThemingProps(mergedProps), checked = _a.checked, children = _a.children, className = _a.className, defaultChecked = _a.defaultChecked, disabled = _a.disabled, _b = _a.icon, iconProp = _b === void 0 ? 'cuiCheckboxUnselected' : _b, _c = _a.iconChecked, iconChecked = _c === void 0 ? 'cuiCheckboxSelected' : _c, _d = _a.iconIndeterminate, iconIndeterminate = _d === void 0 ? 'cuiCheckboxIndeterminate' : _d, id = _a.id, inputProps = _a.inputProps, inputRef = _a.inputRef, isIndeterminate = _a.isIndeterminate, label = _a.label, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, rest = __rest(_a, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "iconIndeterminate", "id", "inputProps", "inputRef", "isIndeterminate", "label", "name", "onChange", "required", "value"]);
83
- var _e = __read(react_1.useState(defaultChecked), 2), isChecked = _e[0], setIsChecked = _e[1];
84
- var styles = core_1.useStyleConfig('Checkbox', mergedProps);
85
- var _f = styles.control, controlColor = _f.color, hoverColor = _f.hoverColor, controlStyles = __rest(_f, ["color", "hoverColor"]);
86
- react_1.useEffect(function () {
87
- checked !== undefined && setIsChecked(checked);
88
- }, [checked]);
82
+ var _b = (0, core_1.omitThemingProps)(mergedProps), checked = _b.checked, children = _b.children, className = _b.className, _c = _b.defaultChecked, defaultChecked = _c === void 0 ? groupDefaultValue !== undefined ? groupDefaultValue.includes(props.value) : undefined : _c, disabled = _b.disabled, _d = _b.icon, iconProp = _d === void 0 ? 'cuiCheckboxUnselected' : _d, _e = _b.iconChecked, iconChecked = _e === void 0 ? 'cuiCheckboxSelected' : _e, _f = _b.iconIndeterminate, iconIndeterminate = _f === void 0 ? 'cuiCheckboxIndeterminate' : _f, id = _b.id, inputProps = _b.inputProps, inputRef = _b.inputRef, isIndeterminate = _b.isIndeterminate, label = _b.label, name = _b.name, onChange = _b.onChange, required = _b.required, value = _b.value, rest = __rest(_b, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "iconIndeterminate", "id", "inputProps", "inputRef", "isIndeterminate", "label", "name", "onChange", "required", "value"]);
83
+ var _g = __read((0, react_1.useState)(defaultChecked), 2), isChecked = _g[0], setIsChecked = _g[1];
84
+ var styles = (0, core_1.useStyleConfig)('Checkbox', mergedProps);
85
+ var _h = styles.control, controlColor = _h.color, hoverColor = _h.hoverColor, controlStyles = __rest(_h, ["color", "hoverColor"]);
89
86
  var isFilled = isChecked || isIndeterminate;
90
87
  var icon = isIndeterminate ? iconIndeterminate : isChecked ? iconChecked : iconProp;
91
88
  var controlMr = children || label ? 1 : 0;
92
89
  var color = isFilled ? controlColor : 'grey.60';
93
90
  var controlHoverColor = isFilled ? hoverColor : 'grey.90';
91
+ (0, react_1.useEffect)(function () {
92
+ checked !== undefined && setIsChecked(checked);
93
+ }, [checked]);
94
94
  function handleOnChange(e) {
95
95
  setIsChecked(e.target.checked);
96
96
  onChange === null || onChange === void 0 ? void 0 : onChange(e);
97
97
  }
98
- return (react_1.default.createElement(exports.CheckboxBase, __assign({ className: utils_1.cs('vui-checkbox', disabled && 'disabled', className), controlHoverColor: controlHoverColor, ref: ref }, styles.container, rest),
98
+ return (react_1.default.createElement(exports.CheckboxBase, __assign({ className: (0, utils_1.cs)('vui-checkbox', disabled && 'disabled', className), controlHoverColor: controlHoverColor, ref: ref }, styles.container, rest),
99
99
  react_1.default.createElement(exports.CheckboxControl, __assign({ borderRadius: "sm", className: "vui-checkboxControl", color: color, focusWithinRing: 3, mr: controlMr, transitionDuration: "fast" }, controlStyles),
100
100
  react_1.default.createElement(exports.CheckboxInput, __assign({ className: "vui-checkboxInput", onChange: handleOnChange, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
101
101
  react_1.default.createElement(icon_1.default, { className: "vui-checkboxIcon", h: "100%", name: icon, w: "100%" })), children !== null && children !== void 0 ? children : (label && (react_1.default.createElement(t_1.default, __assign({ className: "vui-checkboxLabel", lineHeight: "normal" }, styles.label), label)))));
@@ -55,15 +55,15 @@ var context_1 = require("./context");
55
55
  var core_1 = require("../core");
56
56
  var system_1 = require("../system");
57
57
  var utils_1 = require("../utils");
58
- exports.CheckboxGroupBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t", "\n"])), system_1.system);
59
- exports.CheckboxGroup = core_1.vui(function (props, ref) {
60
- var className = props.className, colorScheme = props.colorScheme, disabled = props.disabled, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, row = props.row, size = props.size, variant = props.variant, rest = __rest(props, ["className", "colorScheme", "disabled", "name", "onBlur", "onChange", "onFocus", "row", "size", "variant"]);
61
- var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, disabled: disabled, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, size: size, variant: variant }); }, [colorScheme, disabled, name, onBlur, onChange, onFocus, size, variant]);
62
- var aliasedProps = utils_1.filterUndefined({
63
- flexDirection: row ? 'row' : undefined
58
+ exports.CheckboxGroupBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t", "\n"])), system_1.system);
59
+ exports.CheckboxGroup = (0, core_1.vui)(function (props, ref) {
60
+ var className = props.className, colorScheme = props.colorScheme, defaultValue = props.defaultValue, disabled = props.disabled, isRow = props.isRow, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, size = props.size, variant = props.variant, rest = __rest(props, ["className", "colorScheme", "defaultValue", "disabled", "isRow", "name", "onBlur", "onChange", "onFocus", "size", "variant"]);
61
+ var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, defaultValue: defaultValue, disabled: disabled, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, size: size, variant: variant }); }, [colorScheme, defaultValue, disabled, name, onBlur, onChange, onFocus, size, variant]);
62
+ var aliasedProps = (0, utils_1.filterUndefined)({
63
+ flexDirection: isRow ? 'row' : undefined
64
64
  });
65
65
  return (react_1.default.createElement(context_1.CheckboxGroupProvider, { value: context },
66
- react_1.default.createElement(exports.CheckboxGroupBase, __assign({ className: utils_1.cs('vui-checkboxGroup', className), ref: ref }, aliasedProps, rest))));
66
+ react_1.default.createElement(exports.CheckboxGroupBase, __assign({ className: (0, utils_1.cs)('vui-checkboxGroup', className), ref: ref }, aliasedProps, rest))));
67
67
  });
68
68
  exports.CheckboxGroup.displayName = 'CheckboxGroup';
69
69
  exports.default = exports.CheckboxGroup;
@@ -4,9 +4,9 @@ import { ThemingProps } from '../theme';
4
4
  export interface CheckboxGroupProps extends SystemProps, ThemingProps<'Checkbox'> {
5
5
  colorScheme?: 'blue' | 'prussian';
6
6
  disabled?: boolean;
7
+ isRow?: boolean;
7
8
  name?: string;
8
9
  onBlur?: FocusEventHandler;
9
10
  onChange?: ChangeEventHandler;
10
11
  onFocus?: FocusEventHandler;
11
- row?: boolean;
12
12
  }
@@ -18,6 +18,6 @@ var __read = (this && this.__read) || function (o, n) {
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.useCheckboxGroup = exports.CheckboxGroupProvider = void 0;
20
20
  var core_1 = require("../core");
21
- var _a = __read(core_1.createContext({ isOptional: true }), 2), CheckboxGroupProvider = _a[0], useCheckboxGroup = _a[1];
21
+ var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), CheckboxGroupProvider = _a[0], useCheckboxGroup = _a[1];
22
22
  exports.CheckboxGroupProvider = CheckboxGroupProvider;
23
23
  exports.useCheckboxGroup = useCheckboxGroup;
package/checkbox/theme.js CHANGED
@@ -2,12 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function variantDefault(props) {
4
4
  var c = props.colorScheme;
5
- var controlStyles = {
5
+ var control = {
6
6
  color: c + ".80",
7
7
  hoverColor: c + ".90"
8
8
  };
9
+ if (c === 'prussian') {
10
+ control.hoverColor = 'prussian.70';
11
+ }
9
12
  return {
10
- control: controlStyles
13
+ control: control
11
14
  };
12
15
  }
13
16
  var defaultProps = {
@@ -38,8 +38,7 @@ var styled_components_1 = require("styled-components");
38
38
  var foundations_1 = __importDefault(require("../theme/foundations"));
39
39
  var styles_1 = require("../styles");
40
40
  var utils_1 = require("../utils");
41
- exports.default = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t", "\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"], ["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t",
42
- "\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"
41
+ exports.default = (0, styled_components_1.createGlobalStyle)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t", "\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"], ["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t", "\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"
43
42
  /** Recursively maps through all theme styles and generates a set of CSS properties */
44
43
  ])), styles_1.fontFaces, generateCSSVariables, function (p) {
45
44
  return p.globalStyle &&
@@ -48,7 +47,7 @@ exports.default = styled_components_1.createGlobalStyle(templateObject_1 || (tem
48
47
  /** Recursively maps through all theme styles and generates a set of CSS properties */
49
48
  function generateCSSVariables() {
50
49
  function computeStyle(name, value) {
51
- if (!utils_1.isObject(value))
50
+ if (!(0, utils_1.isObject)(value))
52
51
  return name + ": " + (typeof value === 'string' ? value : value + "px") + ";\n";
53
52
  return Object.entries(value).reduce(function (str, _a) {
54
53
  var _b = __read(_a, 2), key = _b[0], value = _b[1];
package/core/resetCSS.js CHANGED
@@ -5,5 +5,5 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var styled_components_1 = require("styled-components");
8
- exports.default = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"], ["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"])));
8
+ exports.default = (0, styled_components_1.createGlobalStyle)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"], ["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"])));
9
9
  var templateObject_1;
package/core/styled.js CHANGED
@@ -39,19 +39,23 @@ var __read = (this && this.__read) || function (o, n) {
39
39
  }
40
40
  return ar;
41
41
  };
42
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
43
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
44
- to[j] = from[i];
45
- return to;
42
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
43
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
44
+ if (ar || !(i in from)) {
45
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
46
+ ar[i] = from[i];
47
+ }
48
+ }
49
+ return to.concat(ar || Array.prototype.slice.call(from));
46
50
  };
47
51
  Object.defineProperty(exports, "__esModule", { value: true });
48
52
  var styled_components_1 = __importStar(require("styled-components"));
49
53
  var utils_1 = require("./utils");
50
54
  var system_1 = require("../system");
51
55
  function createStyled(generator) {
52
- var config = generator ? utils_1.forwardPropConfig(generator) : {};
56
+ var config = generator ? (0, utils_1.forwardPropConfig)(generator) : {};
53
57
  var styled = (function (component) {
54
- var baseStyled = config ? styled_components_1.default(component).withConfig(config) : styled_components_1.default(component);
58
+ var baseStyled = config ? (0, styled_components_1.default)(component).withConfig(config) : (0, styled_components_1.default)(component);
55
59
  return getCreateStyle(baseStyled, styled_components_1.css, generator);
56
60
  });
57
61
  Object.keys(styled_components_1.default).forEach(function (key) {
@@ -66,7 +70,7 @@ function getCreateStyle(baseCreateStyle, css, generator) {
66
70
  for (var _i = 0; _i < arguments.length; _i++) {
67
71
  args[_i] = arguments[_i];
68
72
  }
69
- return baseCreateStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", "", ""], ["", "", ""])), css.apply(void 0, __spreadArray([], __read(args))), generator);
73
+ return baseCreateStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", "", ""], ["", "", ""])), css.apply(void 0, __spreadArray([], __read(args), false)), generator);
70
74
  };
71
75
  createStyle.attrs = function (attrs) {
72
76
  return getCreateStyle(baseCreateStyle.attrs(attrs), css, generator);