@veracity/vui 0.1.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 (123) 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 +13 -13
  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 +10 -10
  22. package/core/v.js +1 -1
  23. package/divider/divider.js +6 -6
  24. package/divider/divider.types.d.ts +1 -0
  25. package/heading/heading.js +6 -6
  26. package/heading/headings.js +6 -6
  27. package/icon/icon.js +6 -6
  28. package/icons/library.js +9 -5
  29. package/image/image.js +4 -4
  30. package/image/image.types.d.ts +1 -0
  31. package/index.d.ts +1 -1
  32. package/index.js +1 -1
  33. package/input/context.js +1 -1
  34. package/input/input.js +13 -17
  35. package/input/inputIcon.js +3 -3
  36. package/input/inputInput.js +4 -4
  37. package/link/link.js +6 -6
  38. package/list/context.js +1 -1
  39. package/list/list.js +6 -11
  40. package/list/listHeading.js +3 -3
  41. package/list/listIcon.js +3 -3
  42. package/list/listItem.js +8 -8
  43. package/list/listText.js +3 -3
  44. package/notification/consts.d.ts +2 -0
  45. package/{alert → notification}/consts.js +7 -7
  46. package/notification/context.d.ts +4 -0
  47. package/{alert → notification}/context.js +4 -4
  48. package/notification/index.d.ts +8 -0
  49. package/{alert → notification}/index.js +8 -8
  50. package/notification/notification.d.ts +13 -0
  51. package/{alert/alert.js → notification/notification.js} +21 -26
  52. package/notification/notification.types.d.ts +20 -0
  53. package/notification/notificationButton.d.ts +3 -0
  54. package/notification/notificationButton.js +30 -0
  55. package/notification/notificationIcon.d.ts +3 -0
  56. package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
  57. package/notification/notificationText.d.ts +3 -0
  58. package/{alert/alertText.js → notification/notificationText.js} +8 -8
  59. package/notification/notificationTitle.d.ts +3 -0
  60. package/{alert/alertTitle.js → notification/notificationTitle.js} +8 -8
  61. package/{alert → notification}/theme.d.ts +0 -17
  62. package/{alert → notification}/theme.js +0 -23
  63. package/p/p.js +6 -6
  64. package/package.json +2 -3
  65. package/panel/panel.js +4 -4
  66. package/radio/context.js +1 -1
  67. package/radio/radio.js +59 -14
  68. package/radio/radioGroup.js +25 -17
  69. package/radio/radioGroup.types.d.ts +1 -1
  70. package/radio/theme.js +5 -2
  71. package/skeleton/skeleton.js +6 -6
  72. package/skeleton/skeleton.types.d.ts +1 -0
  73. package/spinner/spinner.js +5 -5
  74. package/spinner/spinner.types.d.ts +1 -0
  75. package/svg/cache.js +1 -5
  76. package/svg/svg.js +14 -15
  77. package/switch/context.js +1 -1
  78. package/switch/switch.js +13 -51
  79. package/switch/switch.types.d.ts +2 -2
  80. package/switch/switchButton.js +21 -23
  81. package/switch/switchLabel.js +3 -3
  82. package/system/custom.d.ts +11 -7
  83. package/system/custom.js +24 -13
  84. package/system/system.d.ts +4 -3
  85. package/system/system.js +2 -2
  86. package/system/tables.d.ts +14 -0
  87. package/system/tables.js +2 -0
  88. package/t/t.js +6 -6
  89. package/tag/context.js +1 -1
  90. package/tag/index.d.ts +1 -0
  91. package/tag/index.js +1 -0
  92. package/tag/tag.d.ts +2 -0
  93. package/tag/tag.js +14 -12
  94. package/tag/tag.types.d.ts +1 -0
  95. package/tag/tagButton.d.ts +3 -0
  96. package/{alert/alertButton.js → tag/tagButton.js} +9 -9
  97. package/tag/tagIcon.js +3 -3
  98. package/tag/tagText.js +3 -3
  99. package/tag/theme.d.ts +26 -0
  100. package/tag/theme.js +32 -3
  101. package/textarea/textarea.js +10 -9
  102. package/textarea/textarea.types.d.ts +1 -0
  103. package/theme/components.d.ts +54 -44
  104. package/theme/components.js +26 -26
  105. package/theme/defaultTheme.d.ts +54 -44
  106. package/theme/foundations/shadows.js +2 -2
  107. package/theme/index.d.ts +16 -0
  108. package/theme/index.js +33 -1
  109. package/utils/assertion.d.ts +1 -1
  110. package/utils/assertion.js +1 -2
  111. package/utils/function.js +9 -5
  112. package/utils/object.d.ts +1 -12
  113. package/utils/object.js +4 -29
  114. package/alert/alert.d.ts +0 -13
  115. package/alert/alert.types.d.ts +0 -20
  116. package/alert/alertButton.d.ts +0 -3
  117. package/alert/alertIcon.d.ts +0 -3
  118. package/alert/alertText.d.ts +0 -3
  119. package/alert/alertTitle.d.ts +0 -3
  120. package/alert/consts.d.ts +0 -2
  121. package/alert/context.d.ts +0 -4
  122. package/alert/index.d.ts +0 -8
  123. /package/{alert/alert.types.js → notification/notification.types.js} +0 -0
package/radio/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 = {
@@ -35,15 +35,15 @@ 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.SkeletonBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n\n\t", "\n"], ["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n\n\t", "\n"])), system_1.system);
39
- exports.Skeleton = core_1.vui(function (props, ref) {
40
- var _a = core_1.omitThemingProps(props), className = _a.className, _b = _a.repeat, repeat = _b === void 0 ? 1 : _b, rest = __rest(_a, ["className", "repeat"]);
41
- var styles = core_1.useStyleConfig('Skeleton', props);
38
+ exports.SkeletonBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n\n\t", "\n"], ["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n\n\t", "\n"])), system_1.system);
39
+ exports.Skeleton = (0, core_1.vui)(function (props, ref) {
40
+ var _a = (0, core_1.omitThemingProps)(props), className = _a.className, _b = _a.repeat, repeat = _b === void 0 ? 1 : _b, rest = __rest(_a, ["className", "repeat"]);
41
+ var styles = (0, core_1.useStyleConfig)('Skeleton', props);
42
42
  var arr = Array(repeat).fill(0);
43
- var aliasedProps = utils_1.filterUndefined({
43
+ var aliasedProps = (0, utils_1.filterUndefined)({
44
44
  w: props.variant === 'circle' ? styles.h : undefined
45
45
  });
46
- return (react_1.default.createElement(react_1.default.Fragment, null, arr.map(function (_, i) { return (react_1.default.createElement(exports.SkeletonBase, __assign({ className: utils_1.cs('vui-skeleton', className), key: i, ref: ref }, styles, aliasedProps, rest))); })));
46
+ return (react_1.default.createElement(react_1.default.Fragment, null, arr.map(function (_, i) { return (react_1.default.createElement(exports.SkeletonBase, __assign({ className: (0, utils_1.cs)('vui-skeleton', className), key: i, ref: ref }, styles, aliasedProps, rest))); })));
47
47
  });
48
48
  exports.Skeleton.displayName = 'Skeleton';
49
49
  exports.default = exports.Skeleton;
@@ -1,6 +1,7 @@
1
1
  import { SystemProps } from '../system';
2
2
  import { ThemingProps } from '../theme';
3
3
  export interface SkeletonProps extends SystemProps, ThemingProps<'Skeleton'> {
4
+ children?: never;
4
5
  colorScheme?: 'blue' | 'grey';
5
6
  repeat?: number;
6
7
  }
@@ -38,21 +38,21 @@ var core_1 = require("../core");
38
38
  var system_1 = require("../system");
39
39
  var t_1 = __importDefault(require("../t"));
40
40
  var utils_1 = require("../utils");
41
- exports.SpinnerCircle = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-shrink: 0;\n\n\t", "\n\n\tanimation-duration: ", ";\n"], ["\n\tdisplay: flex;\n\tflex-shrink: 0;\n\n\t", "\n\n\tanimation-duration: ", ";\n"])), system_1.system, function (p) { return p.speed; });
42
- exports.Spinner = core_1.vui(function (props, ref) {
41
+ exports.SpinnerCircle = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-shrink: 0;\n\n\t", "\n\n\tanimation-duration: ", ";\n"], ["\n\tdisplay: flex;\n\tflex-shrink: 0;\n\n\t", "\n\n\tanimation-duration: ", ";\n"])), system_1.system, function (p) { return p.speed; });
42
+ exports.Spinner = (0, core_1.vui)(function (props, ref) {
43
43
  var _a;
44
44
  var className = props.className, emptyColor = props.emptyColor, size = props.size, _b = props.speed, speedProp = _b === void 0 ? 'normal' : _b, text = props.text, _c = props.textPosition, textPosition = _c === void 0 ? 'bottom' : _c, thickness = props.thickness, rest = __rest(props, ["className", "emptyColor", "size", "speed", "text", "textPosition", "thickness"]);
45
- var styles = core_1.useStyleConfig('Spinner', props);
45
+ var styles = (0, core_1.useStyleConfig)('Spinner', props);
46
46
  var isCustomSize = typeof size === 'number';
47
47
  var positionProps = consts_1.spinnerPositionMapping[textPosition];
48
48
  var speed = (_a = consts_1.spinnerSpeedMapping[speedProp]) !== null && _a !== void 0 ? _a : speedProp;
49
- var circleProps = utils_1.filterUndefined({
49
+ var circleProps = (0, utils_1.filterUndefined)({
50
50
  borderColor: emptyColor,
51
51
  borderWidth: isCustomSize ? thickness !== null && thickness !== void 0 ? thickness : 4 : thickness,
52
52
  h: isCustomSize ? size : undefined,
53
53
  w: isCustomSize ? size : undefined
54
54
  });
55
- return (react_1.default.createElement(box_1.default, __assign({ center: true, className: utils_1.cs('vui-spinner', className), ref: ref, transitionDuration: "fast" }, styles.container, positionProps.container, rest),
55
+ return (react_1.default.createElement(box_1.default, __assign({ center: true, className: (0, utils_1.cs)('vui-spinner', className), ref: ref, transitionDuration: "fast" }, styles.container, positionProps.container, rest),
56
56
  react_1.default.createElement(exports.SpinnerCircle, __assign({ animation: "spin", borderRadius: "round", className: "vui-spinnerCircle", speed: speed }, styles.circle, positionProps.circle, circleProps)),
57
57
  text && (react_1.default.createElement(t_1.default, __assign({ className: "vui-spinnerText" }, styles.text), text))));
58
58
  });
@@ -5,6 +5,7 @@ export interface SpinnerCircleStyleProps extends SystemProps {
5
5
  speed?: string;
6
6
  }
7
7
  export interface SpinnerProps extends Omit<BoxProps, 'size' | 'variant'>, Omit<ThemingProps<'Spinner'>, 'size'> {
8
+ children?: never;
8
9
  colorScheme?: 'blue' | 'grey' | 'prussian';
9
10
  emptyColor?: string;
10
11
  speed?: string;
package/svg/cache.js CHANGED
@@ -1,9 +1,5 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var axios_1 = __importDefault(require("axios"));
7
3
  /**
8
4
  * Provides svg caching functionality to avoid redundant XHR requests.
9
5
  * When the retrieved item doesn't exist in cache yet, a request is sent
@@ -20,7 +16,7 @@ var Cache = /** @class */ (function () {
20
16
  this.get = function (src) {
21
17
  var item = _this.cache.get(src);
22
18
  if (!item) {
23
- var promise = axios_1.default.get(src).then(function (res) { return res.data; });
19
+ var promise = fetch(src).then(function (res) { return res.text(); });
24
20
  _this.add(src, promise);
25
21
  return promise;
26
22
  }
package/svg/svg.js CHANGED
@@ -108,19 +108,21 @@ var helpers_1 = require("./helpers");
108
108
  var core_1 = require("../core");
109
109
  var system_1 = require("../system");
110
110
  var utils_1 = require("../utils");
111
- exports.SvgBase = styled_components_1.default.svg.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n\n\t", "\n"], ["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n\n\t", "\n"])), function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); }, function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); }, system_1.system);
112
- exports.Svg = core_1.vui(function (props, ref) {
111
+ exports.SvgBase = styled_components_1.default.svg.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n\n\t", "\n"], ["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n\n\t", "\n"])), function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); }, function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); }, system_1.system);
112
+ exports.Svg = (0, core_1.vui)(function (props, ref) {
113
113
  var children = props.children, className = props.className, src = props.src, rest = __rest(props, ["children", "className", "src"]);
114
- var _a = __read(react_1.useState(helpers_1.initState()), 2), state = _a[0], setState = _a[1];
115
- var isMountedRef = react_1.useRef(false);
116
- var srcRef = react_1.useRef(src);
117
- react_1.useEffect(function () {
114
+ var _a = __read((0, react_1.useState)((0, helpers_1.initState)()), 2), state = _a[0], setState = _a[1];
115
+ var isMountedRef = (0, react_1.useRef)(false);
116
+ var srcRef = (0, react_1.useRef)(src);
117
+ var _b = state.content, content = _b === void 0 ? '' : _b, _c = state.svgAttributes, svgAttributes = _c === void 0 ? {} : _c;
118
+ var innerHTML = !children ? { __html: content } : undefined;
119
+ (0, react_1.useEffect)(function () {
118
120
  isMountedRef.current = true;
119
121
  return function () {
120
122
  isMountedRef.current = false;
121
123
  };
122
124
  }, []);
123
- react_1.useEffect(function () {
125
+ (0, react_1.useEffect)(function () {
124
126
  srcRef.current = src;
125
127
  function loadSvg(src) {
126
128
  return __awaiter(this, void 0, void 0, function () {
@@ -132,9 +134,9 @@ exports.Svg = core_1.vui(function (props, ref) {
132
134
  return [4 /*yield*/, cache_1.default.get(src)];
133
135
  case 1:
134
136
  response = _a.sent();
135
- content_1 = helpers_1.getSvgContent(response);
136
- svgEl = helpers_1.stringToHTML(response);
137
- svgAttributes_1 = helpers_1.getAttributes(svgEl);
137
+ content_1 = (0, helpers_1.getSvgContent)(response);
138
+ svgEl = (0, helpers_1.stringToHTML)(response);
139
+ svgAttributes_1 = (0, helpers_1.getAttributes)(svgEl);
138
140
  svgAttributes_1['data-src'] = src !== null && src !== void 0 ? src : '';
139
141
  // Update state only when requested 'src' and current 'src' are the same
140
142
  if (srcRef.current === src && isMountedRef.current) {
@@ -145,7 +147,7 @@ exports.Svg = core_1.vui(function (props, ref) {
145
147
  error_1 = _a.sent();
146
148
  console.error(error_1); // eslint-disable-line no-console
147
149
  if (isMountedRef.current) {
148
- setState(helpers_1.initState());
150
+ setState((0, helpers_1.initState)());
149
151
  }
150
152
  return [3 /*break*/, 3];
151
153
  case 3: return [2 /*return*/];
@@ -155,10 +157,7 @@ exports.Svg = core_1.vui(function (props, ref) {
155
157
  }
156
158
  src && loadSvg(src);
157
159
  }, [src]);
158
- var _b = state.content, content = _b === void 0 ? '' : _b, _c = state.svgAttributes, svgAttributes = _c === void 0 ? {} : _c;
159
- var innerHTML = !children ? { __html: content } : undefined;
160
- // const pathFill = Array.isArray(fill) ? fill : [fill]
161
- return (react_1.default.createElement(exports.SvgBase, __assign({ className: utils_1.cs('vui-svg', className), dangerouslySetInnerHTML: innerHTML, ref: ref, xmlns: "http://www.w3.org/2000/svg" }, svgAttributes, rest), children));
160
+ return (react_1.default.createElement(exports.SvgBase, __assign({ className: (0, utils_1.cs)('vui-svg', className), dangerouslySetInnerHTML: innerHTML, ref: ref, xmlns: "http://www.w3.org/2000/svg" }, svgAttributes, rest), children));
162
161
  });
163
162
  exports.Svg.displayName = 'Svg';
164
163
  exports.default = exports.Svg;
package/switch/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.useSwitch = exports.SwitchProvider = void 0;
20
20
  var core_1 = require("../core");
21
- var _a = __read(core_1.createContext({ isOptional: true }), 2), SwitchProvider = _a[0], useSwitch = _a[1];
21
+ var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), SwitchProvider = _a[0], useSwitch = _a[1];
22
22
  exports.SwitchProvider = SwitchProvider;
23
23
  exports.useSwitch = useSwitch;
package/switch/switch.js CHANGED
@@ -44,22 +44,6 @@ var __rest = (this && this.__rest) || function (s, e) {
44
44
  }
45
45
  return t;
46
46
  };
47
- var __read = (this && this.__read) || function (o, n) {
48
- var m = typeof Symbol === "function" && o[Symbol.iterator];
49
- if (!m) return o;
50
- var i = m.call(o), r, ar = [], e;
51
- try {
52
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
53
- }
54
- catch (error) { e = { error: error }; }
55
- finally {
56
- try {
57
- if (r && !r.done && (m = i["return"])) m.call(i);
58
- }
59
- finally { if (e) throw e.error; }
60
- }
61
- return ar;
62
- };
63
47
  var __importDefault = (this && this.__importDefault) || function (mod) {
64
48
  return (mod && mod.__esModule) ? mod : { "default": mod };
65
49
  };
@@ -74,56 +58,34 @@ var core_1 = require("../core");
74
58
  var system_1 = require("../system");
75
59
  var t_1 = require("../t");
76
60
  var utils_1 = require("../utils");
77
- exports.SwitchBase = styled_components_1.default.label.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\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\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"])), t_1.TBase, system_1.system);
78
- exports.Switch = core_1.vui(function (props, ref) {
61
+ exports.SwitchBase = styled_components_1.default.label.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\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\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"])), t_1.TBase, system_1.system);
62
+ exports.Switch = (0, core_1.vui)(function (props, ref) {
79
63
  var _a;
80
- var button = props.button, checked = props.checked, children = props.children, className = props.className, colorScheme = props.colorScheme, defaultChecked = props.defaultChecked, disabled = props.disabled, innerLabelOff = props.innerLabelOff, innerLabelOn = props.innerLabelOn, inputRef = props.inputRef, labelLeft = props.labelLeft, labelRight = props.labelRight, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, required = props.required, size = props.size, value = props.value, variant = props.variant, rest = __rest(props, ["button", "checked", "children", "className", "colorScheme", "defaultChecked", "disabled", "innerLabelOff", "innerLabelOn", "inputRef", "labelLeft", "labelRight", "name", "onBlur", "onChange", "onFocus", "required", "size", "value", "variant"]);
81
- var _b = __read(react_1.useState(defaultChecked), 2), isChecked = _b[0], setIsChecked = _b[1];
82
- var styles = core_1.useStyleConfig('Switch', props);
83
- react_1.useEffect(function () {
84
- checked !== undefined && setIsChecked(checked);
85
- }, [checked]);
86
- var handleOnChange = react_1.useCallback(function (e) {
87
- setIsChecked(e.target.checked);
88
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
89
- }, [onChange]);
90
- var context = react_1.useMemo(function () {
91
- return utils_1.filterUndefined({
64
+ var button = props.button, checked = props.checked, children = props.children, className = props.className, colorScheme = props.colorScheme, defaultChecked = props.defaultChecked, disabled = props.disabled, id = props.id, innerLabelOff = props.innerLabelOff, innerLabelOn = props.innerLabelOn, inputRef = props.inputRef, labelLeft = props.labelLeft, labelRight = props.labelRight, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, required = props.required, size = props.size, value = props.value, variant = props.variant, rest = __rest(props, ["button", "checked", "children", "className", "colorScheme", "defaultChecked", "disabled", "id", "innerLabelOff", "innerLabelOn", "inputRef", "labelLeft", "labelRight", "name", "onBlur", "onChange", "onFocus", "required", "size", "value", "variant"]);
65
+ var styles = (0, core_1.useStyleConfig)('Switch', props);
66
+ var context = (0, react_1.useMemo)(function () {
67
+ return (0, utils_1.filterUndefined)({
68
+ checked: checked,
92
69
  colorScheme: colorScheme,
93
70
  defaultChecked: defaultChecked,
94
71
  disabled: disabled,
95
- isChecked: isChecked,
96
72
  name: name,
97
73
  onBlur: onBlur,
98
- onChange: handleOnChange,
74
+ onChange: onChange,
99
75
  onFocus: onFocus,
100
76
  required: required,
101
77
  size: size,
102
78
  value: value,
103
79
  variant: variant
104
80
  });
105
- }, [
106
- colorScheme,
107
- defaultChecked,
108
- disabled,
109
- handleOnChange,
110
- isChecked,
111
- name,
112
- onBlur,
113
- onFocus,
114
- required,
115
- size,
116
- value,
117
- variant
118
- ]);
119
- var aliasedProps = utils_1.filterUndefined({
120
- 'data-checked': isChecked ? true : false,
81
+ }, [checked, colorScheme, defaultChecked, disabled, name, onBlur, onChange, onFocus, required, size, value, variant]);
82
+ var aliasedProps = (0, utils_1.filterUndefined)({
121
83
  'data-disabled': disabled ? true : false
122
84
  });
123
85
  return (react_1.default.createElement(context_1.SwitchProvider, { value: context },
124
- react_1.default.createElement(exports.SwitchBase, __assign({ className: utils_1.cs('vui-switch', className), ref: ref }, styles.container, aliasedProps, rest),
125
- utils_1.isReactText(labelLeft) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { mr: 1, text: labelLeft }) : labelLeft, (_a = children !== null && children !== void 0 ? children : button) !== null && _a !== void 0 ? _a : react_1.default.createElement(switchButton_1.SwitchButton, __assign({}, { innerLabelOff: innerLabelOff, innerLabelOn: innerLabelOn, inputRef: inputRef })),
126
- utils_1.isReactText(labelRight) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { ml: 1, text: labelRight }) : labelRight)));
86
+ react_1.default.createElement(exports.SwitchBase, __assign({ className: (0, utils_1.cs)('vui-switch', className), ref: ref }, styles.container, aliasedProps, rest),
87
+ (0, utils_1.isReactText)(labelLeft) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { mr: 1, text: labelLeft }) : labelLeft, (_a = children !== null && children !== void 0 ? children : button) !== null && _a !== void 0 ? _a : react_1.default.createElement(switchButton_1.SwitchButton, __assign({}, { id: id, innerLabelOff: innerLabelOff, innerLabelOn: innerLabelOn, inputRef: inputRef })),
88
+ (0, utils_1.isReactText)(labelRight) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { ml: 1, text: labelRight }) : labelRight)));
127
89
  });
128
90
  exports.Switch.displayName = 'Switch';
129
91
  exports.Switch.Button = switchButton_1.SwitchButton;
@@ -4,7 +4,7 @@ import { SystemProps } from '../system';
4
4
  import { ThemingProps } from '../theme';
5
5
  export interface SwitchButtonProps extends SystemProps, ThemingProps<'Switch'> {
6
6
  checked?: boolean;
7
- colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
7
+ colorScheme?: 'blue' | 'green' | 'prussian';
8
8
  disabled?: boolean;
9
9
  innerLabelOff?: ReactNode;
10
10
  innerLabelOn?: ReactNode;
@@ -20,7 +20,7 @@ export interface SwitchButtonProps extends SystemProps, ThemingProps<'Switch'> {
20
20
  export interface SwitchProps extends SystemProps, ThemingProps<'Switch'> {
21
21
  button?: ReactNode;
22
22
  checked?: boolean;
23
- colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
23
+ colorScheme?: 'blue' | 'green' | 'prussian';
24
24
  disabled?: boolean;
25
25
  innerLabelOff?: ReactNode;
26
26
  innerLabelOn?: ReactNode;
@@ -71,25 +71,23 @@ var context_1 = require("./context");
71
71
  var core_1 = require("../core");
72
72
  var system_1 = require("../system");
73
73
  var utils_1 = require("../utils");
74
- exports.SwitchInput = styled_components_1.default.input.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"], ["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"])), system_1.system);
75
- exports.SwitchThumb = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"], ["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"])), system_1.system);
76
- exports.SwitchTrack = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
77
- exports.SwitchButtonBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"])), exports.SwitchThumb, exports.SwitchTrack, system_1.system);
78
- exports.SwitchButton = core_1.vui(function (props, ref) {
74
+ exports.SwitchInput = styled_components_1.default.input.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"], ["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"])), system_1.system);
75
+ exports.SwitchThumb = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"], ["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"])), system_1.system);
76
+ exports.SwitchTrack = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
77
+ exports.SwitchButtonBase = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\t--x-ring-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\t--x-ring-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"])), exports.SwitchThumb, exports.SwitchTrack, system_1.system);
78
+ exports.SwitchButton = (0, core_1.vui)(function (props, ref) {
79
79
  var _a;
80
- var _b = (_a = context_1.useSwitch()) !== null && _a !== void 0 ? _a : {}, switchIsChecked = _b.isChecked, switchProps = __rest(_b, ["isChecked"]);
80
+ var switchProps = (_a = (0, context_1.useSwitch)()) !== null && _a !== void 0 ? _a : {};
81
81
  var mergedProps = __assign(__assign({}, switchProps), props);
82
- var _c = core_1.omitThemingProps(mergedProps), checked = _c.checked, className = _c.className, defaultChecked = _c.defaultChecked, disabled = _c.disabled, innerLabelOff = _c.innerLabelOff, innerLabelOn = _c.innerLabelOn, inputProps = _c.inputProps, inputRef = _c.inputRef, name = _c.name, onBlur = _c.onBlur, onChange = _c.onChange, onFocus = _c.onFocus, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "className", "defaultChecked", "disabled", "innerLabelOff", "innerLabelOn", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "required", "value"]);
83
- var _d = __read(react_1.useState(defaultChecked), 2), isChecked = _d[0], setIsChecked = _d[1];
84
- var _e = __read(react_1.useState(false), 2), isFocused = _e[0], setIsFocused = _e[1];
85
- var styles = core_1.useStyleConfig('Switch', mergedProps);
86
- var _f = styles.button, thumbStyles = _f.thumb, trackStyles = _f.track, buttonStyles = __rest(_f, ["thumb", "track"]);
87
- var isControlled = checked !== undefined || switchIsChecked !== undefined;
88
- react_1.useEffect(function () {
89
- if (isControlled) {
90
- setIsChecked(checked !== null && checked !== void 0 ? checked : switchIsChecked);
91
- }
92
- }, [checked, isControlled, switchIsChecked]);
82
+ var _b = (0, core_1.omitThemingProps)(mergedProps), checked = _b.checked, className = _b.className, defaultChecked = _b.defaultChecked, disabled = _b.disabled, id = _b.id, innerLabelOff = _b.innerLabelOff, innerLabelOn = _b.innerLabelOn, inputProps = _b.inputProps, inputRef = _b.inputRef, name = _b.name, onBlur = _b.onBlur, onChange = _b.onChange, onFocus = _b.onFocus, required = _b.required, value = _b.value, rest = __rest(_b, ["checked", "className", "defaultChecked", "disabled", "id", "innerLabelOff", "innerLabelOn", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "required", "value"]);
83
+ var isControlled = (0, react_1.useRef)(checked !== undefined).current;
84
+ var _c = __read((0, react_1.useState)(checked !== null && checked !== void 0 ? checked : defaultChecked), 2), isChecked = _c[0], setIsChecked = _c[1];
85
+ var _d = __read((0, react_1.useState)(false), 2), isFocused = _d[0], setIsFocused = _d[1];
86
+ var styles = (0, core_1.useStyleConfig)('Switch', mergedProps);
87
+ var _e = styles.button, thumbStyles = _e.thumb, trackStyles = _e.track, buttonStyles = __rest(_e, ["thumb", "track"]);
88
+ (0, react_1.useEffect)(function () {
89
+ isControlled && setIsChecked(checked);
90
+ }, [checked, isControlled]);
93
91
  function handleOnBlur(e) {
94
92
  setIsFocused(false);
95
93
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
@@ -105,23 +103,23 @@ exports.SwitchButton = core_1.vui(function (props, ref) {
105
103
  var hDiff = (thumbStyles.h - trackStyles.h) / 2;
106
104
  var thumbOffset = "calc(100% - " + Math.abs(hDiff - thumbStyles.h) + "px)";
107
105
  var labelOffset = thumbStyles.h - hDiff + 4 + "px";
108
- var buttonAliasedProps = utils_1.filterUndefined({
106
+ var buttonAliasedProps = (0, utils_1.filterUndefined)({
109
107
  'data-checked': isChecked ? true : false,
110
108
  'data-disabled': disabled ? true : false,
111
109
  'data-focused': isFocused ? true : false
112
110
  });
113
- var thumbAliasedProps = utils_1.filterUndefined({
111
+ var thumbAliasedProps = (0, utils_1.filterUndefined)({
114
112
  left: isChecked ? thumbOffset : -hDiff,
115
113
  ring: isFocused ? thumbStyles.ring : 0
116
114
  });
117
- var trackAliasedProps = utils_1.filterUndefined({
115
+ var trackAliasedProps = (0, utils_1.filterUndefined)({
118
116
  bg: isChecked ? trackStyles.bg : 'grey.50',
119
117
  pl: isChecked ? 1 : labelOffset,
120
118
  pr: isChecked ? labelOffset : 1,
121
- ring: isFocused ? trackStyles.ring : 0
119
+ ring: isFocused ? trackStyles.ring : disabled ? 1 : 0
122
120
  });
123
- return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: utils_1.cs('vui-switchButton', className), ref: ref }, buttonStyles, buttonAliasedProps, rest),
124
- react_1.default.createElement(exports.SwitchInput, __assign({ className: "vui-switchInput", onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, name: name, required: required, value: value }, inputProps)),
121
+ return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: (0, utils_1.cs)('vui-switchButton', className), ref: ref }, buttonStyles, buttonAliasedProps, rest),
122
+ react_1.default.createElement(exports.SwitchInput, __assign({ className: "vui-switchInput", onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
125
123
  react_1.default.createElement(exports.SwitchTrack, __assign({ borderRadius: "round", className: "vui-switchTrack", transitionDuration: "fast" }, trackStyles, trackAliasedProps),
126
124
  !isChecked && innerLabelOff,
127
125
  react_1.default.createElement(exports.SwitchThumb, __assign({ borderRadius: "round", className: "vui-switchThumb", transitionDuration: "fast" }, thumbStyles, thumbAliasedProps)),
@@ -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.SwitchLabel = core_1.vui(function (props, ref) {
22
+ exports.SwitchLabel = (0, core_1.vui)(function (props, ref) {
23
23
  var _a;
24
- var switchProps = (_a = context_1.useSwitch()) !== null && _a !== void 0 ? _a : {};
24
+ var switchProps = (_a = (0, context_1.useSwitch)()) !== null && _a !== void 0 ? _a : {};
25
25
  var mergedProps = __assign(__assign({}, switchProps), props);
26
- var styles = core_1.useStyleConfig('Switch', mergedProps);
26
+ var styles = (0, core_1.useStyleConfig)('Switch', mergedProps);
27
27
  return react_1.default.createElement(t_1.default, __assign({ className: "vui-switchLabel", display: "flex", ref: ref }, styles.label, props));
28
28
  });
29
29
  exports.SwitchLabel.displayName = 'SwitchLabel';
@@ -2,30 +2,34 @@ import { BorderRadiusProp } from './borders';
2
2
  export interface BorderRadiusBottomProps {
3
3
  borderRadiusBottom?: BorderRadiusProp;
4
4
  }
5
- export declare const borderRadiusBottom: import("@xstyled/system").StyleGenerator;
5
+ export declare const borderRadiusBottom: import("@xstyled/styled-components").StyleGenerator;
6
6
  export interface BorderRadiusLeftProps {
7
7
  borderRadiusLeft?: BorderRadiusProp;
8
8
  }
9
- export declare const borderRadiusLeft: import("@xstyled/system").StyleGenerator;
9
+ export declare const borderRadiusLeft: import("@xstyled/styled-components").StyleGenerator;
10
10
  export interface BorderRadiusRightProps {
11
11
  borderRadiusRight?: BorderRadiusProp;
12
12
  }
13
- export declare const borderRadiusRight: import("@xstyled/system").StyleGenerator;
13
+ export declare const borderRadiusRight: import("@xstyled/styled-components").StyleGenerator;
14
14
  export interface BorderRadiusTopProps {
15
15
  borderRadiusTop?: BorderRadiusProp;
16
16
  }
17
- export declare const borderRadiusTop: import("@xstyled/system").StyleGenerator;
17
+ export declare const borderRadiusTop: import("@xstyled/styled-components").StyleGenerator;
18
18
  export interface IsTruncatedProps {
19
19
  isTruncated?: boolean;
20
20
  }
21
21
  /** Provides styling to truncate single-line text. */
22
- export declare const isTruncated: import("@xstyled/system").StyleGenerator;
22
+ export declare const isTruncated: import("@xstyled/styled-components").StyleGenerator;
23
23
  export interface MaxLinesProps {
24
24
  maxLines?: number;
25
25
  }
26
26
  /** Provides styling to truncate multi-line text. */
27
- export declare const maxLines: import("@xstyled/system").StyleGenerator;
27
+ export declare const maxLines: import("@xstyled/styled-components").StyleGenerator;
28
+ export declare type SpaceAroundProps = {
29
+ spaceAround?: number | string;
30
+ };
31
+ export declare const spaceAround: import("@xstyled/styled-components").StyleGenerator;
28
32
  export declare type WordBreakProps = {
29
33
  wordBreak?: 'normal' | 'break-all' | 'keep-all' | 'break-word';
30
34
  };
31
- export declare const wordBreak: import("@xstyled/system").StyleGenerator;
35
+ export declare const wordBreak: import("@xstyled/styled-components").StyleGenerator;
package/system/custom.js CHANGED
@@ -1,29 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wordBreak = exports.maxLines = exports.isTruncated = exports.borderRadiusTop = exports.borderRadiusRight = exports.borderRadiusLeft = exports.borderRadiusBottom = void 0;
4
- var system_1 = require("@xstyled/system");
5
- exports.borderRadiusBottom = system_1.style({
3
+ exports.wordBreak = exports.spaceAround = exports.maxLines = exports.isTruncated = exports.borderRadiusTop = exports.borderRadiusRight = exports.borderRadiusLeft = exports.borderRadiusBottom = void 0;
4
+ var styled_components_1 = require("@xstyled/styled-components");
5
+ exports.borderRadiusBottom = (0, styled_components_1.style)({
6
6
  prop: 'borderRadiusBottom',
7
- themeGet: system_1.getRadius,
7
+ themeGet: styled_components_1.getRadius,
8
8
  cssProperty: ['borderBottomLeftRadius', 'borderBottomRightRadius']
9
9
  });
10
- exports.borderRadiusLeft = system_1.style({
10
+ exports.borderRadiusLeft = (0, styled_components_1.style)({
11
11
  prop: 'borderRadiusLeft',
12
- themeGet: system_1.getRadius,
12
+ themeGet: styled_components_1.getRadius,
13
13
  cssProperty: ['borderBottomLeftRadius', 'borderTopLeftRadius']
14
14
  });
15
- exports.borderRadiusRight = system_1.style({
15
+ exports.borderRadiusRight = (0, styled_components_1.style)({
16
16
  prop: 'borderRadiusRight',
17
- themeGet: system_1.getRadius,
17
+ themeGet: styled_components_1.getRadius,
18
18
  cssProperty: ['borderBottomRightRadius', 'borderTopRightRadius']
19
19
  });
20
- exports.borderRadiusTop = system_1.style({
20
+ exports.borderRadiusTop = (0, styled_components_1.style)({
21
21
  prop: 'borderRadiusTop',
22
- themeGet: system_1.getRadius,
22
+ themeGet: styled_components_1.getRadius,
23
23
  cssProperty: ['borderTopLeftRadius', 'borderTopRightRadius']
24
24
  });
25
25
  /** Provides styling to truncate single-line text. */
26
- exports.isTruncated = system_1.style({
26
+ exports.isTruncated = (0, styled_components_1.style)({
27
27
  prop: 'isTruncated',
28
28
  cssProperty: function () {
29
29
  return {
@@ -35,7 +35,7 @@ exports.isTruncated = system_1.style({
35
35
  states: {}
36
36
  });
37
37
  /** Provides styling to truncate multi-line text. */
38
- exports.maxLines = system_1.style({
38
+ exports.maxLines = (0, styled_components_1.style)({
39
39
  prop: 'maxLines',
40
40
  cssProperty: function (value) {
41
41
  return {
@@ -47,6 +47,17 @@ exports.maxLines = system_1.style({
47
47
  },
48
48
  states: {}
49
49
  });
50
- exports.wordBreak = system_1.style({
50
+ exports.spaceAround = (0, styled_components_1.style)({
51
+ prop: 'spaceAround',
52
+ themeGet: styled_components_1.getSpace,
53
+ cssProperty: function (value) {
54
+ return {
55
+ '& > *': {
56
+ margin: value
57
+ }
58
+ };
59
+ }
60
+ });
61
+ exports.wordBreak = (0, styled_components_1.style)({
51
62
  prop: 'wordBreak'
52
63
  });
@@ -4,14 +4,15 @@ import { BordersProps } from './borders';
4
4
  import { EffectsProps } from './effects';
5
5
  import { FlexboxesProps } from './flexboxes';
6
6
  import { InteractivityProps } from './interactivity';
7
- import { BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, IsTruncatedProps, MaxLinesProps, WordBreakProps } from './custom';
7
+ import { BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, IsTruncatedProps, MaxLinesProps, SpaceAroundProps, WordBreakProps } from './custom';
8
8
  import { LayoutProps } from './layout';
9
9
  import { SizingProps } from './sizing';
10
10
  import { SpaceProps } from './space';
11
+ import { TablesProps } from './tables';
11
12
  import { TransformsProps } from './transforms';
12
13
  import { TransitionsProps } from './transitions';
13
14
  import { TypographyProps } from './typography';
14
- export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
15
+ export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, SpaceAroundProps, TablesProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
15
16
  }
16
- declare const _default: import("@xstyled/system").StyleGenerator;
17
+ declare const _default: import("@xstyled/styled-components").StyleGenerator;
17
18
  export default _default;
package/system/system.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var system_1 = require("@xstyled/system");
3
+ var styled_components_1 = require("@xstyled/styled-components");
4
4
  var custom_1 = require("./custom");
5
- exports.default = system_1.compose(system_1.animation, system_1.backgroundColor, system_1.borders, custom_1.borderRadiusBottom, custom_1.borderRadiusLeft, custom_1.borderRadiusRight, custom_1.borderRadiusTop, system_1.color, system_1.effects, system_1.flexboxes, system_1.interactivity, custom_1.isTruncated, system_1.layout, custom_1.maxLines, system_1.sizing, system_1.space, system_1.transforms, system_1.transitions, system_1.typography, custom_1.wordBreak);
5
+ exports.default = (0, styled_components_1.compose)(styled_components_1.animation, styled_components_1.backgroundColor, styled_components_1.borders, custom_1.borderRadiusBottom, custom_1.borderRadiusLeft, custom_1.borderRadiusRight, custom_1.borderRadiusTop, styled_components_1.color, styled_components_1.effects, styled_components_1.flexboxes, styled_components_1.interactivity, custom_1.isTruncated, styled_components_1.layout, custom_1.maxLines, styled_components_1.sizing, styled_components_1.space, custom_1.spaceAround, styled_components_1.tables, styled_components_1.transforms, styled_components_1.transitions, styled_components_1.typography, custom_1.wordBreak);
@@ -0,0 +1,14 @@
1
+ import { SystemProp } from '@xstyled/system';
2
+ import * as CSS from 'csstype';
3
+ import { VuiTheme } from '../theme';
4
+ declare type BorderCollapseProp = SystemProp<CSS.Property.BorderCollapse, VuiTheme>;
5
+ export interface BorderCollapseProps {
6
+ borderCollapse?: BorderCollapseProp;
7
+ }
8
+ declare type TableLayoutProp = SystemProp<CSS.Property.TableLayout, VuiTheme>;
9
+ export interface TableLayoutProps {
10
+ tableLayout?: TableLayoutProp;
11
+ }
12
+ export interface TablesProps extends BorderCollapseProps, TableLayoutProps {
13
+ }
14
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/t/t.js CHANGED
@@ -35,11 +35,11 @@ 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.TBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
39
- exports.T = core_1.vui(function (props, ref) {
40
- var _a = core_1.omitThemingProps(props), align = _a.align, casing = _a.casing, centerV = _a.centerV, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "centerV", "children", "className", "decoration", "text", "weight"]);
41
- var styles = core_1.useStyleConfig('T', props);
42
- var aliasedProps = utils_1.filterUndefined({
38
+ exports.TBase = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
39
+ exports.T = (0, core_1.vui)(function (props, ref) {
40
+ var _a = (0, core_1.omitThemingProps)(props), align = _a.align, casing = _a.casing, centerV = _a.centerV, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "centerV", "children", "className", "decoration", "text", "weight"]);
41
+ var styles = (0, core_1.useStyleConfig)('T', props);
42
+ var aliasedProps = (0, utils_1.filterUndefined)({
43
43
  alignItems: centerV ? 'center' : undefined,
44
44
  display: centerV ? 'inline-flex' : undefined,
45
45
  fontWeight: weight,
@@ -47,7 +47,7 @@ exports.T = core_1.vui(function (props, ref) {
47
47
  textDecoration: decoration,
48
48
  textTransform: casing
49
49
  });
50
- return (react_1.default.createElement(exports.TBase, __assign({ className: utils_1.cs('vui-t', className), ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
50
+ return (react_1.default.createElement(exports.TBase, __assign({ className: (0, utils_1.cs)('vui-t', className), ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
51
51
  });
52
52
  exports.T.displayName = 'T';
53
53
  exports.default = exports.T;
package/tag/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.useTag = exports.TagProvider = void 0;
20
20
  var core_1 = require("../core");
21
- var _a = __read(core_1.createContext({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
21
+ var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
22
22
  exports.TagProvider = TagProvider;
23
23
  exports.useTag = useTag;
package/tag/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './context';
2
2
  export * from './tag';
3
3
  export * from './tag.types';
4
+ export * from './tagButton';
4
5
  export * from './tagIcon';
5
6
  export * from './tagText';
6
7
  export { default } from './tag';