@veracity/vui 0.0.15 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/alert/alert.js +10 -10
  2. package/alert/alert.types.d.ts +3 -3
  3. package/alert/alertText.d.ts +2 -2
  4. package/alert/alertText.js +2 -2
  5. package/alert/alertTitle.d.ts +2 -2
  6. package/alert/alertTitle.js +2 -2
  7. package/alert/theme.d.ts +2 -0
  8. package/alert/theme.js +5 -3
  9. package/avatar/avatar.js +2 -2
  10. package/box/box.js +1 -1
  11. package/button/button.d.ts +7 -1
  12. package/button/button.js +56 -23
  13. package/button/button.types.d.ts +8 -6
  14. package/button/buttonIcon.d.ts +3 -0
  15. package/button/buttonIcon.js +30 -0
  16. package/button/buttonText.d.ts +3 -0
  17. package/button/buttonText.js +30 -0
  18. package/button/buttons.d.ts +4 -3
  19. package/button/buttons.js +4 -3
  20. package/button/consts.js +3 -2
  21. package/button/context.d.ts +2 -2
  22. package/button/context.js +4 -4
  23. package/button/index.d.ts +2 -2
  24. package/button/index.js +2 -2
  25. package/button/theme.d.ts +79 -41
  26. package/button/theme.js +85 -46
  27. package/{button → buttonGroup}/buttonGroup.d.ts +3 -1
  28. package/{button → buttonGroup}/buttonGroup.js +4 -2
  29. package/buttonGroup/context.d.ts +4 -0
  30. package/buttonGroup/context.js +23 -0
  31. package/buttonGroup/helpers.d.ts +3 -0
  32. package/buttonGroup/helpers.js +10 -0
  33. package/buttonGroup/index.d.ts +4 -0
  34. package/buttonGroup/index.js +21 -0
  35. package/card/card.d.ts +3 -0
  36. package/{tile/tile.js → card/card.js} +8 -7
  37. package/{tile/tile.types.d.ts → card/card.types.d.ts} +1 -1
  38. package/card/index.d.ts +3 -0
  39. package/{tile → card}/index.js +4 -4
  40. package/card/theme.d.ts +6 -0
  41. package/card/theme.js +10 -0
  42. package/checkbox/checkbox.js +2 -2
  43. package/checkbox/checkbox.types.d.ts +1 -1
  44. package/checkbox/checkboxGroup.types.d.ts +1 -1
  45. package/core/globalStyle.d.ts +4 -1
  46. package/core/globalStyle.js +7 -3
  47. package/core/index.d.ts +2 -0
  48. package/core/index.js +5 -1
  49. package/core/styled.d.ts +4 -0
  50. package/core/styled.js +80 -0
  51. package/core/types/component.d.ts +12 -12
  52. package/core/types/index.d.ts +1 -0
  53. package/core/types/index.js +1 -0
  54. package/core/types/styled.d.ts +11 -0
  55. package/core/utils.d.ts +2 -2
  56. package/core/utils.js +6 -6
  57. package/core/v.d.ts +182 -0
  58. package/core/v.js +6 -0
  59. package/core/vuiProvider.d.ts +13 -2
  60. package/core/vuiProvider.js +1 -1
  61. package/divider/divider.types.d.ts +0 -1
  62. package/heading/heading.types.d.ts +2 -1
  63. package/icon/helpers.d.ts +2 -3
  64. package/icon/helpers.js +6 -8
  65. package/icon/icon.js +3 -2
  66. package/icon/icon.types.d.ts +4 -2
  67. package/icons/library.js +1 -1
  68. package/icons/types.d.ts +1 -1
  69. package/image/image.d.ts +3 -0
  70. package/image/image.js +38 -0
  71. package/image/image.types.d.ts +4 -0
  72. package/image/index.d.ts +3 -0
  73. package/{label → image}/index.js +4 -4
  74. package/image/theme.d.ts +6 -0
  75. package/image/theme.js +10 -0
  76. package/index.d.ts +5 -2
  77. package/index.js +5 -2
  78. package/input/context.d.ts +4 -0
  79. package/input/context.js +23 -0
  80. package/input/index.d.ts +2 -0
  81. package/input/index.js +2 -0
  82. package/input/input.d.ts +7 -2
  83. package/input/input.js +32 -22
  84. package/input/input.types.d.ts +7 -3
  85. package/input/inputIcon.d.ts +3 -0
  86. package/input/inputIcon.js +30 -0
  87. package/input/inputInput.d.ts +5 -0
  88. package/input/inputInput.js +36 -0
  89. package/input/theme.d.ts +40 -15
  90. package/input/theme.js +40 -16
  91. package/list/index.d.ts +3 -1
  92. package/list/index.js +3 -1
  93. package/list/list.d.ts +2 -0
  94. package/list/list.js +3 -1
  95. package/list/list.types.d.ts +19 -1
  96. package/list/listHeading.d.ts +2 -2
  97. package/list/listHeading.js +2 -2
  98. package/list/listIcon.js +1 -1
  99. package/list/listItem.d.ts +1 -1
  100. package/list/listItem.js +8 -5
  101. package/list/listText.d.ts +3 -0
  102. package/list/listText.js +30 -0
  103. package/list/theme.d.ts +20 -6
  104. package/list/theme.js +26 -12
  105. package/package.json +1 -1
  106. package/panel/index.d.ts +3 -0
  107. package/panel/index.js +20 -0
  108. package/panel/panel.d.ts +3 -0
  109. package/panel/panel.js +39 -0
  110. package/panel/panel.types.d.ts +4 -0
  111. package/{tile → panel}/theme.d.ts +1 -8
  112. package/{tile → panel}/theme.js +4 -11
  113. package/radio/radio.js +2 -2
  114. package/radio/radio.types.d.ts +1 -1
  115. package/radio/radioGroup.types.d.ts +1 -1
  116. package/switch/index.d.ts +0 -1
  117. package/switch/index.js +0 -1
  118. package/switch/switch.js +6 -6
  119. package/switch/switch.types.d.ts +19 -4
  120. package/switch/switchButton.d.ts +2 -2
  121. package/switch/switchButton.js +15 -16
  122. package/switch/theme.d.ts +41 -46
  123. package/switch/theme.js +50 -72
  124. package/system/borders.d.ts +3 -1
  125. package/system/custom.d.ts +24 -7
  126. package/system/custom.js +33 -13
  127. package/system/system.d.ts +2 -2
  128. package/system/system.js +1 -1
  129. package/t/t.types.d.ts +2 -1
  130. package/tag/context.d.ts +4 -0
  131. package/tag/context.js +23 -0
  132. package/tag/index.d.ts +6 -0
  133. package/tag/index.js +23 -0
  134. package/tag/tag.d.ts +11 -0
  135. package/tag/tag.js +99 -0
  136. package/{label/label.types.d.ts → tag/tag.types.d.ts} +6 -7
  137. package/tag/tag.types.js +2 -0
  138. package/tag/tagIcon.d.ts +3 -0
  139. package/tag/tagIcon.js +30 -0
  140. package/tag/tagText.d.ts +3 -0
  141. package/tag/tagText.js +30 -0
  142. package/tag/theme.d.ts +65 -0
  143. package/tag/theme.js +78 -0
  144. package/theme/components.d.ts +265 -181
  145. package/theme/components.js +36 -32
  146. package/theme/defaultTheme.d.ts +265 -181
  147. package/utils/assertion.d.ts +14 -0
  148. package/utils/assertion.js +34 -0
  149. package/utils/index.d.ts +1 -0
  150. package/utils/index.js +1 -0
  151. package/utils/object.d.ts +4 -6
  152. package/utils/object.js +18 -26
  153. package/utils/types.d.ts +2 -0
  154. package/label/index.d.ts +0 -3
  155. package/label/label.d.ts +0 -5
  156. package/label/label.js +0 -71
  157. package/label/theme.d.ts +0 -61
  158. package/label/theme.js +0 -107
  159. package/list/listItem.types.d.ts +0 -16
  160. package/switch/switchButton.types.d.ts +0 -19
  161. package/tile/index.d.ts +0 -3
  162. package/tile/tile.d.ts +0 -3
  163. /package/{button → buttonGroup}/buttonGroup.types.d.ts +0 -0
  164. /package/{button → buttonGroup}/buttonGroup.types.js +0 -0
  165. /package/{label/label.types.js → card/card.types.js} +0 -0
  166. /package/{list/listItem.types.js → core/types/styled.js} +0 -0
  167. /package/{switch/switchButton.types.js → image/image.types.js} +0 -0
  168. /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
package/switch/switch.js CHANGED
@@ -76,8 +76,9 @@ var t_1 = require("../t");
76
76
  var utils_1 = require("../utils");
77
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
78
  exports.Switch = core_1.vui(function (props, ref) {
79
- var checked = props.checked, children = props.children, className = props.className, colorScheme = props.colorScheme, defaultChecked = props.defaultChecked, disabled = props.disabled, innerLabelOff = props.innerLabelOff, innerLabelOn = props.innerLabelOn, inputProps = props.inputProps, 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, ["checked", "children", "className", "colorScheme", "defaultChecked", "disabled", "innerLabelOff", "innerLabelOn", "inputProps", "inputRef", "labelLeft", "labelRight", "name", "onBlur", "onChange", "onFocus", "required", "size", "value", "variant"]);
80
- var _a = __read(react_1.useState(defaultChecked), 2), isChecked = _a[0], setIsChecked = _a[1];
79
+ 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];
81
82
  var styles = core_1.useStyleConfig('Switch', props);
82
83
  react_1.useEffect(function () {
83
84
  checked !== undefined && setIsChecked(checked);
@@ -120,10 +121,9 @@ exports.Switch = core_1.vui(function (props, ref) {
120
121
  'data-disabled': disabled ? true : false
121
122
  });
122
123
  return (react_1.default.createElement(context_1.SwitchProvider, { value: context },
123
- react_1.default.createElement(exports.SwitchBase, __assign({ className: utils_1.cs('vui-switch', className), ref: ref }, styles.container, aliasedProps, rest), children ? (children) : (react_1.default.createElement(react_1.default.Fragment, null,
124
- labelLeft && react_1.default.createElement(switchLabel_1.SwitchLabel, { mr: 1 }, labelLeft),
125
- react_1.default.createElement(switchButton_1.SwitchButton, __assign({}, { innerLabelOff: innerLabelOff, innerLabelOn: innerLabelOn, inputProps: inputProps, inputRef: inputRef })),
126
- labelRight && react_1.default.createElement(switchLabel_1.SwitchLabel, { ml: 1 }, labelRight))))));
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)));
127
127
  });
128
128
  exports.Switch.displayName = 'Switch';
129
129
  exports.Switch.Button = switchButton_1.SwitchButton;
@@ -1,14 +1,29 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
2
- import { ChangeEventHandler, FocusEventHandler } from '../core';
1
+ import { ReactNode, ReactText } from 'react';
2
+ import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../core';
3
3
  import { SystemProps } from '../system';
4
4
  import { ThemingProps } from '../theme';
5
+ export interface SwitchButtonProps extends SystemProps, ThemingProps<'Switch'> {
6
+ checked?: boolean;
7
+ colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
8
+ disabled?: boolean;
9
+ innerLabelOff?: ReactNode;
10
+ innerLabelOn?: ReactNode;
11
+ inputProps?: PropsOf<'input', SystemProps>;
12
+ inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
13
+ name?: string;
14
+ onBlur?: FocusEventHandler;
15
+ onChange?: ChangeEventHandler;
16
+ onFocus?: FocusEventHandler;
17
+ required?: boolean;
18
+ value?: number | string;
19
+ }
5
20
  export interface SwitchProps extends SystemProps, ThemingProps<'Switch'> {
21
+ button?: ReactNode;
6
22
  checked?: boolean;
7
23
  colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
8
24
  disabled?: boolean;
9
25
  innerLabelOff?: ReactNode;
10
26
  innerLabelOn?: ReactNode;
11
- inputProps?: HTMLAttributes<HTMLInputElement>;
12
27
  inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
13
28
  labelLeft?: ReactNode;
14
29
  labelRight?: ReactNode;
@@ -17,5 +32,5 @@ export interface SwitchProps extends SystemProps, ThemingProps<'Switch'> {
17
32
  onChange?: ChangeEventHandler;
18
33
  onFocus?: FocusEventHandler;
19
34
  required?: boolean;
20
- value?: number | string;
35
+ value?: ReactText;
21
36
  }
@@ -1,6 +1,6 @@
1
- import { SwitchButtonProps } from './switchButton.types';
1
+ import { SwitchButtonProps } from './switch.types';
2
2
  import { SystemProps } from '../system';
3
- export declare const SwitchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const SwitchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, SystemProps, never>;
4
4
  export declare const SwitchThumb: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
5
5
  export declare const SwitchTrack: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
6
6
  export declare const SwitchButtonBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
@@ -71,9 +71,9 @@ 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(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\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"])));
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
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\tposition: relative;\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tposition: relative;\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
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
78
  exports.SwitchButton = core_1.vui(function (props, ref) {
79
79
  var _a;
@@ -83,6 +83,7 @@ exports.SwitchButton = core_1.vui(function (props, ref) {
83
83
  var _d = __read(react_1.useState(defaultChecked), 2), isChecked = _d[0], setIsChecked = _d[1];
84
84
  var _e = __read(react_1.useState(false), 2), isFocused = _e[0], setIsFocused = _e[1];
85
85
  var styles = core_1.useStyleConfig('Switch', mergedProps);
86
+ var _f = styles.button, thumbStyles = _f.thumb, trackStyles = _f.track, buttonStyles = __rest(_f, ["thumb", "track"]);
86
87
  var isControlled = checked !== undefined || switchIsChecked !== undefined;
87
88
  react_1.useEffect(function () {
88
89
  if (isControlled) {
@@ -101,31 +102,29 @@ exports.SwitchButton = core_1.vui(function (props, ref) {
101
102
  setIsFocused(true);
102
103
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
103
104
  }
104
- var hDiff = (styles.thumb.h - styles.track.h) / 2;
105
- var thumbOffset = "calc(100% - " + Math.abs(hDiff - styles.thumb.h) + "px)";
106
- var labelOffset = styles.thumb.h - hDiff + 4 + "px";
107
- var buttonProps = utils_1.filterUndefined({
105
+ var hDiff = (thumbStyles.h - trackStyles.h) / 2;
106
+ var thumbOffset = "calc(100% - " + Math.abs(hDiff - thumbStyles.h) + "px)";
107
+ var labelOffset = thumbStyles.h - hDiff + 4 + "px";
108
+ var buttonAliasedProps = utils_1.filterUndefined({
108
109
  'data-checked': isChecked ? true : false,
109
110
  'data-disabled': disabled ? true : false,
110
111
  'data-focused': isFocused ? true : false
111
112
  });
112
- var thumbProps = utils_1.filterUndefined({
113
+ var thumbAliasedProps = utils_1.filterUndefined({
113
114
  left: isChecked ? thumbOffset : -hDiff,
114
- ring: isFocused ? styles.thumb.ring : 0
115
+ ring: isFocused ? thumbStyles.ring : 0
115
116
  });
116
- var trackProps = utils_1.filterUndefined({
117
- bg: isChecked ? styles.track.bg : 'grey.50',
117
+ var trackAliasedProps = utils_1.filterUndefined({
118
+ bg: isChecked ? trackStyles.bg : 'grey.50',
118
119
  pl: isChecked ? 1 : labelOffset,
119
120
  pr: isChecked ? labelOffset : 1,
120
- ring: isFocused ? styles.track.ring : 0
121
+ ring: isFocused ? trackStyles.ring : 0
121
122
  });
122
- return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: utils_1.cs('vui-switchButton', className),
123
- // p={1}
124
- ref: ref }, styles.button, buttonProps, rest),
123
+ return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: utils_1.cs('vui-switchButton', className), ref: ref }, buttonStyles, buttonAliasedProps, rest),
125
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)),
126
- react_1.default.createElement(exports.SwitchTrack, __assign({ borderRadius: 100, className: "vui-switchTrack", transitionDuration: "fast" }, styles.track, trackProps),
125
+ react_1.default.createElement(exports.SwitchTrack, __assign({ borderRadius: "round", className: "vui-switchTrack", transitionDuration: "fast" }, trackStyles, trackAliasedProps),
127
126
  !isChecked && innerLabelOff,
128
- react_1.default.createElement(exports.SwitchThumb, __assign({ borderRadius: "50%", className: "vui-switchThumb", transitionDuration: "fast" }, styles.thumb, thumbProps)),
127
+ react_1.default.createElement(exports.SwitchThumb, __assign({ borderRadius: "round", className: "vui-switchThumb", transitionDuration: "fast" }, thumbStyles, thumbAliasedProps)),
129
128
  isChecked && innerLabelOn)));
130
129
  });
131
130
  exports.SwitchButton.displayName = 'SwitchButton';
package/switch/theme.d.ts CHANGED
@@ -1,71 +1,67 @@
1
1
  import { Dict } from '../utils';
2
- declare function sizeLg(props: Dict): {
2
+ declare function sizeLg(): {
3
+ container: {};
3
4
  button: {
4
5
  fontSize: string;
6
+ minW: number;
7
+ thumb: {
8
+ h: number;
9
+ w: number;
10
+ };
11
+ track: {
12
+ h: number;
13
+ };
5
14
  };
6
15
  label: {
7
16
  size: string;
8
17
  };
9
- thumb: {
10
- h: number;
11
- w: number;
12
- };
13
- track: {
14
- h: number;
15
- minW: number;
16
- };
17
18
  };
18
- declare function sizeMd(props: Dict): {
19
+ declare function sizeMd(): {
20
+ container: {};
19
21
  button: {
20
22
  fontSize: string;
23
+ minW: number;
24
+ thumb: {
25
+ h: number;
26
+ w: number;
27
+ };
28
+ track: {
29
+ h: number;
30
+ };
21
31
  };
22
32
  label: {
23
33
  size: string;
24
34
  };
25
- thumb: {
26
- h: number;
27
- w: number;
28
- };
29
- track: {
30
- h: number;
31
- minW: number;
32
- };
33
35
  };
34
- declare function sizeSm(props: Dict): {
36
+ declare function sizeSm(): {
37
+ container: {};
35
38
  button: {
36
39
  fontSize: string;
40
+ minW: number;
41
+ thumb: {
42
+ h: number;
43
+ w: number;
44
+ };
45
+ track: {
46
+ h: number;
47
+ };
37
48
  };
38
49
  label: {
39
50
  size: string;
40
51
  };
41
- thumb: {
42
- h: number;
43
- w: number;
44
- };
45
- track: {
46
- h: number;
47
- minW: number;
48
- };
49
52
  };
50
53
  declare function variantContained(props: Dict): {
51
- thumb: {
52
- bg: string;
53
- };
54
- track: {
55
- bg: string;
56
- ring: number;
57
- };
58
- };
59
- declare function variantThin(props: Dict): {
60
- thumb: {
61
- bg: string;
62
- borderColor: string;
63
- borderWidth: number;
64
- ring: number;
65
- };
66
- track: {
67
- bg: string;
68
- };
54
+ container: {};
55
+ button: {
56
+ thumb: {
57
+ bg: string;
58
+ };
59
+ track: {
60
+ bg: string;
61
+ ring: number;
62
+ };
63
+ };
64
+ label: {};
69
65
  };
70
66
  declare const _default: {
71
67
  defaultProps: {
@@ -81,7 +77,6 @@ declare const _default: {
81
77
  };
82
78
  variants: {
83
79
  contained: typeof variantContained;
84
- thin: typeof variantThin;
85
80
  };
86
81
  };
87
82
  export default _default;
package/switch/theme.js CHANGED
@@ -1,109 +1,87 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- function sizeLg(props) {
4
- var variant = props.variant;
3
+ function sizeLg() {
4
+ var container = {};
5
5
  var button = {
6
- fontSize: 'md'
6
+ fontSize: 'md',
7
+ minW: 50,
8
+ thumb: {
9
+ h: 24,
10
+ w: 24
11
+ },
12
+ track: {
13
+ h: 28
14
+ }
7
15
  };
8
16
  var label = {
9
17
  size: 'lg'
10
18
  };
11
- var thumb = {
12
- h: 24,
13
- w: 24
14
- };
15
- var track = {
16
- h: 28,
17
- minW: 50
18
- };
19
- if (variant === 'thin') {
20
- track.h = 18;
21
- track.minW = 40;
22
- }
23
- return { button: button, label: label, thumb: thumb, track: track };
19
+ return { container: container, button: button, label: label };
24
20
  }
25
- function sizeMd(props) {
26
- var variant = props.variant;
21
+ function sizeMd() {
22
+ var container = {};
27
23
  var button = {
28
- fontSize: 'sm'
24
+ fontSize: 'sm',
25
+ minW: 42,
26
+ thumb: {
27
+ h: 20,
28
+ w: 20
29
+ },
30
+ track: {
31
+ h: 24
32
+ }
29
33
  };
30
34
  var label = {
31
35
  size: 'md'
32
36
  };
33
- var thumb = {
34
- h: 20,
35
- w: 20
36
- };
37
- var track = {
38
- h: 24,
39
- minW: 42
40
- };
41
- if (variant === 'thin') {
42
- track.h = 14;
43
- track.minW = 32;
44
- }
45
- return { button: button, label: label, thumb: thumb, track: track };
37
+ return { container: container, button: button, label: label };
46
38
  }
47
- function sizeSm(props) {
48
- var variant = props.variant;
39
+ function sizeSm() {
40
+ var container = {};
49
41
  var button = {
50
- fontSize: 'xs'
42
+ fontSize: 'xs',
43
+ minW: 34,
44
+ thumb: {
45
+ h: 16,
46
+ w: 16
47
+ },
48
+ track: {
49
+ h: 20
50
+ }
51
51
  };
52
52
  var label = {
53
53
  size: 'sm'
54
54
  };
55
- var thumb = {
56
- h: 16,
57
- w: 16
58
- };
59
- var track = {
60
- h: 20,
61
- minW: 34
62
- };
63
- if (variant === 'thin') {
64
- track.h = 10;
65
- track.minW = 24;
66
- }
67
- return { button: button, label: label, thumb: thumb, track: track };
55
+ return { container: container, button: button, label: label };
68
56
  }
69
57
  function variantContained(props) {
70
58
  var c = props.colorScheme;
71
- var thumb = {
72
- bg: 'white'
73
- };
74
- var track = {
75
- bg: c + ".80",
76
- ring: 3
77
- };
78
- return { thumb: thumb, track: track };
79
- }
80
- function variantThin(props) {
81
- var c = props.colorScheme;
82
- var thumb = {
83
- bg: 'white',
84
- borderColor: c + ".80",
85
- borderWidth: 1,
86
- ring: 3
87
- };
88
- var track = {
89
- bg: c + ".80"
90
- };
91
- return { thumb: thumb, track: track };
59
+ var container = {};
60
+ var button = {
61
+ thumb: {
62
+ bg: 'white'
63
+ },
64
+ track: {
65
+ bg: c + ".80",
66
+ ring: 3
67
+ }
68
+ };
69
+ var label = {};
70
+ return { container: container, button: button, label: label };
92
71
  }
93
72
  var defaultProps = {
94
73
  colorScheme: 'blue',
95
74
  size: 'md',
96
75
  variant: 'contained'
97
76
  };
98
- var parts = ['container', 'button', 'label', 'track', 'thumb'];
77
+ var parts = ['container', 'button', 'label'];
99
78
  var sizes = {
100
79
  sm: sizeSm,
101
80
  md: sizeMd,
102
81
  lg: sizeLg
103
82
  };
104
83
  var variants = {
105
- contained: variantContained,
106
- thin: variantThin
84
+ contained: variantContained
107
85
  };
108
86
  exports.default = {
109
87
  defaultProps: defaultProps,
@@ -77,7 +77,7 @@ export interface BorderStyleProps {
77
77
  borderStyle?: BorderStyleProp;
78
78
  hoverBorderStyle?: BorderStyleProp;
79
79
  }
80
- declare type BorderRadiusProp = SystemProp<RadiusGetter, VuiTheme>;
80
+ export declare type BorderRadiusProp = SystemProp<RadiusGetter, VuiTheme>;
81
81
  export interface BorderRadiusProps {
82
82
  borderRadius?: BorderRadiusProp;
83
83
  hoverBorderRadius?: BorderRadiusProp;
@@ -129,6 +129,7 @@ export interface RingProps {
129
129
  focusRing?: RingProp;
130
130
  focusVisibleRing?: RingProp;
131
131
  focusWithinRing?: RingProp;
132
+ hoverRing?: RingProp;
132
133
  }
133
134
  declare type RingColorProp = SystemProp<ColorGetter, VuiTheme>;
134
135
  export interface RingColorProps {
@@ -136,6 +137,7 @@ export interface RingColorProps {
136
137
  focusRingColor?: RingColorProp;
137
138
  focusVisibleRingColor?: RingColorProp;
138
139
  focusWithinRingColor?: RingColorProp;
140
+ hoverRingColor?: RingColorProp;
139
141
  }
140
142
  export interface BordersProps extends BorderProps, BorderTopProps, BorderRightProps, BorderBottomProps, BorderLeftProps, BorderColorProps, BorderTopColorProps, BorderRightColorProps, BorderBottomColorProps, BorderLeftColorProps, BorderWidthProps, BorderTopWidthProps, BorderRightWidthProps, BorderBottomWidthProps, BorderLeftWidthProps, BorderStyleProps, BorderRadiusProps, OutlineProps, OutlineColorProps, OutlineWidthProps, OutlineStyleProps, DivideXProps, DivideYProps, DivideXReverseProps, DivideYReverseProps, DivideColorProps, DivideStyleProps, RingProps, RingColorProps {
141
143
  }
@@ -1,14 +1,31 @@
1
- /** Provides styling to truncate multi-line text. */
2
- export declare const maxLines: import("@xstyled/system").StyleGenerator;
3
- export interface MaxLinesProps {
4
- maxLines?: number;
1
+ import { BorderRadiusProp } from './borders';
2
+ export interface BorderRadiusBottomProps {
3
+ borderRadiusBottom?: BorderRadiusProp;
5
4
  }
6
- /** Provides styling to truncate single-line text. */
7
- export declare const isTruncated: import("@xstyled/system").StyleGenerator;
8
- export declare const wordBreak: import("@xstyled/system").StyleGenerator;
5
+ export declare const borderRadiusBottom: import("@xstyled/system").StyleGenerator;
6
+ export interface BorderRadiusLeftProps {
7
+ borderRadiusLeft?: BorderRadiusProp;
8
+ }
9
+ export declare const borderRadiusLeft: import("@xstyled/system").StyleGenerator;
10
+ export interface BorderRadiusRightProps {
11
+ borderRadiusRight?: BorderRadiusProp;
12
+ }
13
+ export declare const borderRadiusRight: import("@xstyled/system").StyleGenerator;
14
+ export interface BorderRadiusTopProps {
15
+ borderRadiusTop?: BorderRadiusProp;
16
+ }
17
+ export declare const borderRadiusTop: import("@xstyled/system").StyleGenerator;
9
18
  export interface IsTruncatedProps {
10
19
  isTruncated?: boolean;
11
20
  }
21
+ /** Provides styling to truncate single-line text. */
22
+ export declare const isTruncated: import("@xstyled/system").StyleGenerator;
23
+ export interface MaxLinesProps {
24
+ maxLines?: number;
25
+ }
26
+ /** Provides styling to truncate multi-line text. */
27
+ export declare const maxLines: import("@xstyled/system").StyleGenerator;
12
28
  export declare type WordBreakProps = {
13
29
  wordBreak?: 'normal' | 'break-all' | 'keep-all' | 'break-word';
14
30
  };
31
+ export declare const wordBreak: import("@xstyled/system").StyleGenerator;
package/system/custom.js CHANGED
@@ -1,19 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wordBreak = exports.isTruncated = exports.maxLines = void 0;
3
+ exports.wordBreak = exports.maxLines = exports.isTruncated = exports.borderRadiusTop = exports.borderRadiusRight = exports.borderRadiusLeft = exports.borderRadiusBottom = void 0;
4
4
  var system_1 = require("@xstyled/system");
5
- /** Provides styling to truncate multi-line text. */
6
- exports.maxLines = system_1.style({
7
- prop: 'maxLines',
8
- cssProperty: function (value) {
9
- return {
10
- display: '-webkit-box',
11
- overflow: 'hidden',
12
- '-webkit-line-clamp': "" + value,
13
- '-webkit-box-orient': 'vertical'
14
- };
15
- },
16
- states: {}
5
+ exports.borderRadiusBottom = system_1.style({
6
+ prop: 'borderRadiusBottom',
7
+ themeGet: system_1.getRadius,
8
+ cssProperty: ['borderBottomLeftRadius', 'borderBottomRightRadius']
9
+ });
10
+ exports.borderRadiusLeft = system_1.style({
11
+ prop: 'borderRadiusLeft',
12
+ themeGet: system_1.getRadius,
13
+ cssProperty: ['borderBottomLeftRadius', 'borderTopLeftRadius']
14
+ });
15
+ exports.borderRadiusRight = system_1.style({
16
+ prop: 'borderRadiusRight',
17
+ themeGet: system_1.getRadius,
18
+ cssProperty: ['borderBottomRightRadius', 'borderTopRightRadius']
19
+ });
20
+ exports.borderRadiusTop = system_1.style({
21
+ prop: 'borderRadiusTop',
22
+ themeGet: system_1.getRadius,
23
+ cssProperty: ['borderTopLeftRadius', 'borderTopRightRadius']
17
24
  });
18
25
  /** Provides styling to truncate single-line text. */
19
26
  exports.isTruncated = system_1.style({
@@ -27,6 +34,19 @@ exports.isTruncated = system_1.style({
27
34
  },
28
35
  states: {}
29
36
  });
37
+ /** Provides styling to truncate multi-line text. */
38
+ exports.maxLines = system_1.style({
39
+ prop: 'maxLines',
40
+ cssProperty: function (value) {
41
+ return {
42
+ display: '-webkit-box',
43
+ overflow: 'hidden',
44
+ '-webkit-line-clamp': "" + value,
45
+ '-webkit-box-orient': 'vertical'
46
+ };
47
+ },
48
+ states: {}
49
+ });
30
50
  exports.wordBreak = system_1.style({
31
51
  prop: 'wordBreak'
32
52
  });
@@ -4,14 +4,14 @@ import { BordersProps } from './borders';
4
4
  import { EffectsProps } from './effects';
5
5
  import { FlexboxesProps } from './flexboxes';
6
6
  import { InteractivityProps } from './interactivity';
7
- import { IsTruncatedProps, MaxLinesProps, WordBreakProps } from './custom';
7
+ import { BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, IsTruncatedProps, MaxLinesProps, WordBreakProps } from './custom';
8
8
  import { LayoutProps } from './layout';
9
9
  import { SizingProps } from './sizing';
10
10
  import { SpaceProps } from './space';
11
11
  import { TransformsProps } from './transforms';
12
12
  import { TransitionsProps } from './transitions';
13
13
  import { TypographyProps } from './typography';
14
- export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
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
15
  }
16
16
  declare const _default: import("@xstyled/system").StyleGenerator;
17
17
  export default _default;
package/system/system.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var system_1 = require("@xstyled/system");
4
4
  var custom_1 = require("./custom");
5
- exports.default = system_1.compose(system_1.animation, system_1.backgroundColor, system_1.borders, 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 = 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);
package/t/t.types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ReactText } from 'react';
1
2
  import { SystemProps, TypographyProps } from '../system';
2
3
  import { ThemingProps } from '../theme';
3
4
  export interface TProps extends SystemProps, ThemingProps<'T'> {
@@ -5,6 +6,6 @@ export interface TProps extends SystemProps, ThemingProps<'T'> {
5
6
  casing?: TypographyProps['textTransform'];
6
7
  centerV?: boolean;
7
8
  decoration?: TypographyProps['textDecoration'];
8
- text?: number | string;
9
+ text?: ReactText;
9
10
  weight?: TypographyProps['fontWeight'];
10
11
  }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { Dict } from '../utils';
3
+ declare const TagProvider: import("react").Provider<Dict<any>>, useTag: () => Dict<any>;
4
+ export { TagProvider, useTag };
package/tag/context.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.useTag = exports.TagProvider = void 0;
20
+ var core_1 = require("../core");
21
+ var _a = __read(core_1.createContext({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
22
+ exports.TagProvider = TagProvider;
23
+ exports.useTag = useTag;
package/tag/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export * from './context';
2
+ export * from './tag';
3
+ export * from './tag.types';
4
+ export * from './tagIcon';
5
+ export * from './tagText';
6
+ export { default } from './tag';