@veracity/vui 0.0.15 → 0.2.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 (195) hide show
  1. package/avatar/avatar.js +2 -2
  2. package/box/box.js +1 -1
  3. package/button/button.d.ts +7 -1
  4. package/button/button.js +56 -23
  5. package/button/button.types.d.ts +8 -6
  6. package/button/buttonIcon.d.ts +3 -0
  7. package/{alert/alertText.js → button/buttonIcon.js} +9 -9
  8. package/button/buttonText.d.ts +3 -0
  9. package/button/buttonText.js +30 -0
  10. package/button/buttons.d.ts +4 -3
  11. package/button/buttons.js +4 -3
  12. package/button/consts.js +3 -2
  13. package/button/context.d.ts +2 -2
  14. package/button/context.js +4 -4
  15. package/button/index.d.ts +2 -2
  16. package/button/index.js +2 -2
  17. package/button/theme.d.ts +79 -41
  18. package/button/theme.js +85 -46
  19. package/{button → buttonGroup}/buttonGroup.d.ts +3 -1
  20. package/{button → buttonGroup}/buttonGroup.js +4 -2
  21. package/buttonGroup/context.d.ts +4 -0
  22. package/buttonGroup/context.js +23 -0
  23. package/buttonGroup/helpers.d.ts +3 -0
  24. package/buttonGroup/helpers.js +10 -0
  25. package/buttonGroup/index.d.ts +4 -0
  26. package/{alert → buttonGroup}/index.js +4 -8
  27. package/card/card.d.ts +3 -0
  28. package/{tile/tile.js → card/card.js} +8 -7
  29. package/{tile/tile.types.d.ts → card/card.types.d.ts} +1 -1
  30. package/card/index.d.ts +3 -0
  31. package/{tile → card}/index.js +4 -4
  32. package/card/theme.d.ts +6 -0
  33. package/card/theme.js +10 -0
  34. package/checkbox/checkbox.js +4 -4
  35. package/checkbox/checkbox.types.d.ts +1 -1
  36. package/checkbox/checkboxGroup.types.d.ts +1 -1
  37. package/core/globalStyle.d.ts +4 -1
  38. package/core/globalStyle.js +7 -3
  39. package/core/index.d.ts +2 -0
  40. package/core/index.js +5 -1
  41. package/core/styled.d.ts +4 -0
  42. package/core/styled.js +80 -0
  43. package/core/types/component.d.ts +12 -12
  44. package/core/types/index.d.ts +1 -0
  45. package/core/types/index.js +1 -0
  46. package/core/types/styled.d.ts +11 -0
  47. package/core/utils.d.ts +2 -2
  48. package/core/utils.js +7 -7
  49. package/core/v.d.ts +182 -0
  50. package/core/v.js +6 -0
  51. package/core/vuiProvider.d.ts +13 -2
  52. package/core/vuiProvider.js +1 -1
  53. package/divider/divider.types.d.ts +1 -1
  54. package/heading/heading.types.d.ts +2 -1
  55. package/icon/helpers.d.ts +2 -3
  56. package/icon/helpers.js +6 -8
  57. package/icon/icon.js +3 -2
  58. package/icon/icon.types.d.ts +4 -2
  59. package/icons/library.js +1 -1
  60. package/icons/types.d.ts +1 -1
  61. package/image/image.d.ts +3 -0
  62. package/image/image.js +38 -0
  63. package/image/image.types.d.ts +5 -0
  64. package/image/index.d.ts +3 -0
  65. package/{label → image}/index.js +4 -4
  66. package/image/theme.d.ts +6 -0
  67. package/image/theme.js +10 -0
  68. package/index.d.ts +6 -3
  69. package/index.js +6 -3
  70. package/input/context.d.ts +4 -0
  71. package/{alert → input}/context.js +4 -4
  72. package/input/index.d.ts +2 -0
  73. package/input/index.js +2 -0
  74. package/input/input.d.ts +7 -2
  75. package/input/input.js +33 -22
  76. package/input/input.types.d.ts +7 -3
  77. package/input/inputIcon.d.ts +3 -0
  78. package/input/inputIcon.js +30 -0
  79. package/input/inputInput.d.ts +5 -0
  80. package/input/inputInput.js +36 -0
  81. package/input/theme.d.ts +40 -15
  82. package/input/theme.js +40 -16
  83. package/list/index.d.ts +3 -1
  84. package/list/index.js +3 -1
  85. package/list/list.d.ts +2 -0
  86. package/list/list.js +3 -1
  87. package/list/list.types.d.ts +19 -1
  88. package/list/listHeading.d.ts +2 -2
  89. package/list/listHeading.js +2 -2
  90. package/list/listIcon.js +1 -1
  91. package/list/listItem.d.ts +1 -1
  92. package/list/listItem.js +8 -5
  93. package/list/listText.d.ts +3 -0
  94. package/list/listText.js +30 -0
  95. package/list/theme.d.ts +20 -6
  96. package/list/theme.js +26 -12
  97. package/notification/consts.d.ts +2 -0
  98. package/{alert → notification}/consts.js +7 -7
  99. package/notification/context.d.ts +4 -0
  100. package/notification/context.js +23 -0
  101. package/notification/index.d.ts +8 -0
  102. package/notification/index.js +25 -0
  103. package/notification/notification.d.ts +13 -0
  104. package/{alert/alert.js → notification/notification.js} +25 -25
  105. package/notification/notification.types.d.ts +20 -0
  106. package/notification/notificationButton.d.ts +3 -0
  107. package/{alert/alertButton.js → notification/notificationButton.js} +8 -8
  108. package/notification/notificationIcon.d.ts +3 -0
  109. package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
  110. package/notification/notificationText.d.ts +3 -0
  111. package/notification/notificationText.js +30 -0
  112. package/notification/notificationTitle.d.ts +3 -0
  113. package/notification/notificationTitle.js +30 -0
  114. package/{alert → notification}/theme.d.ts +0 -15
  115. package/{alert → notification}/theme.js +1 -22
  116. package/package.json +2 -3
  117. package/panel/index.d.ts +3 -0
  118. package/panel/index.js +20 -0
  119. package/panel/panel.d.ts +3 -0
  120. package/panel/panel.js +39 -0
  121. package/panel/panel.types.d.ts +4 -0
  122. package/{tile → panel}/theme.d.ts +1 -8
  123. package/{tile → panel}/theme.js +4 -11
  124. package/radio/radio.js +4 -4
  125. package/radio/radio.types.d.ts +1 -1
  126. package/radio/radioGroup.types.d.ts +1 -1
  127. package/skeleton/skeleton.types.d.ts +1 -0
  128. package/spinner/spinner.types.d.ts +1 -0
  129. package/svg/cache.js +1 -5
  130. package/svg/svg.js +2 -3
  131. package/switch/index.d.ts +0 -1
  132. package/switch/index.js +0 -1
  133. package/switch/switch.js +6 -6
  134. package/switch/switch.types.d.ts +19 -4
  135. package/switch/switchButton.d.ts +2 -2
  136. package/switch/switchButton.js +18 -19
  137. package/switch/theme.d.ts +41 -46
  138. package/switch/theme.js +50 -72
  139. package/system/borders.d.ts +3 -1
  140. package/system/custom.d.ts +24 -7
  141. package/system/custom.js +33 -13
  142. package/system/system.d.ts +2 -2
  143. package/system/system.js +1 -1
  144. package/t/t.types.d.ts +2 -1
  145. package/tag/context.d.ts +4 -0
  146. package/tag/context.js +23 -0
  147. package/tag/index.d.ts +6 -0
  148. package/tag/index.js +23 -0
  149. package/tag/tag.d.ts +11 -0
  150. package/tag/tag.js +99 -0
  151. package/{label/label.types.d.ts → tag/tag.types.d.ts} +6 -7
  152. package/tag/tag.types.js +2 -0
  153. package/tag/tagIcon.d.ts +3 -0
  154. package/{alert/alertTitle.js → tag/tagIcon.js} +9 -9
  155. package/tag/tagText.d.ts +3 -0
  156. package/tag/tagText.js +30 -0
  157. package/tag/theme.d.ts +65 -0
  158. package/tag/theme.js +78 -0
  159. package/textarea/textarea.js +2 -1
  160. package/textarea/textarea.types.d.ts +1 -0
  161. package/theme/components.d.ts +291 -223
  162. package/theme/components.js +32 -28
  163. package/theme/defaultTheme.d.ts +291 -223
  164. package/utils/assertion.d.ts +14 -0
  165. package/utils/assertion.js +34 -0
  166. package/utils/index.d.ts +1 -0
  167. package/utils/index.js +1 -0
  168. package/utils/object.d.ts +5 -18
  169. package/utils/object.js +17 -50
  170. package/utils/types.d.ts +2 -0
  171. package/alert/alert.d.ts +0 -13
  172. package/alert/alert.types.d.ts +0 -20
  173. package/alert/alertButton.d.ts +0 -3
  174. package/alert/alertIcon.d.ts +0 -3
  175. package/alert/alertText.d.ts +0 -3
  176. package/alert/alertTitle.d.ts +0 -3
  177. package/alert/consts.d.ts +0 -2
  178. package/alert/context.d.ts +0 -4
  179. package/alert/index.d.ts +0 -8
  180. package/label/index.d.ts +0 -3
  181. package/label/label.d.ts +0 -5
  182. package/label/label.js +0 -71
  183. package/label/theme.d.ts +0 -61
  184. package/label/theme.js +0 -107
  185. package/list/listItem.types.d.ts +0 -16
  186. package/switch/switchButton.types.d.ts +0 -19
  187. package/tile/index.d.ts +0 -3
  188. package/tile/tile.d.ts +0 -3
  189. /package/{button → buttonGroup}/buttonGroup.types.d.ts +0 -0
  190. /package/{button → buttonGroup}/buttonGroup.types.js +0 -0
  191. /package/{alert/alert.types.js → card/card.types.js} +0 -0
  192. /package/{label/label.types.js → core/types/styled.js} +0 -0
  193. /package/{list/listItem.types.js → image/image.types.js} +0 -0
  194. /package/{switch/switchButton.types.js → notification/notification.types.js} +0 -0
  195. /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
package/tag/theme.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import { Dict } from '../utils';
2
+ declare function variantSolid(props: Dict): {
3
+ container: {
4
+ hoverBg: string;
5
+ activeBg: string;
6
+ bg: string;
7
+ color: string;
8
+ };
9
+ };
10
+ declare function variantSubtle(props: Dict): {
11
+ container: {
12
+ hoverBg: string;
13
+ activeBg: string;
14
+ bg: string;
15
+ color: string;
16
+ };
17
+ };
18
+ declare const _default: {
19
+ defaultProps: {
20
+ colorScheme: string;
21
+ size: string;
22
+ variant: string;
23
+ };
24
+ parts: string[];
25
+ sizes: {
26
+ sm: {
27
+ container: {
28
+ fontSize: string;
29
+ h: number;
30
+ spaceX: number;
31
+ };
32
+ icon: {
33
+ size: string;
34
+ };
35
+ text: {};
36
+ };
37
+ md: {
38
+ container: {
39
+ fontSize: string;
40
+ h: number;
41
+ spaceX: number;
42
+ };
43
+ icon: {
44
+ size: string;
45
+ };
46
+ text: {};
47
+ };
48
+ lg: {
49
+ container: {
50
+ fontSize: string;
51
+ h: number;
52
+ spaceX: number;
53
+ };
54
+ icon: {
55
+ size: string;
56
+ };
57
+ text: {};
58
+ };
59
+ };
60
+ variants: {
61
+ solid: typeof variantSolid;
62
+ subtle: typeof variantSubtle;
63
+ };
64
+ };
65
+ export default _default;
package/tag/theme.js ADDED
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function variantSolid(props) {
4
+ var c = props.colorScheme;
5
+ var container = {
6
+ hoverBg: c + ".90",
7
+ activeBg: c + ".100",
8
+ bg: c + ".80",
9
+ color: 'white'
10
+ };
11
+ if (c === 'yellow') {
12
+ container.hoverBg = c + ".80";
13
+ container.activeBg = c + ".90";
14
+ container.bg = c + ".70";
15
+ }
16
+ return { container: container };
17
+ }
18
+ function variantSubtle(props) {
19
+ var c = props.colorScheme;
20
+ var container = {
21
+ hoverBg: c + ".30",
22
+ activeBg: c + ".40",
23
+ bg: c + ".20",
24
+ color: 'prussian.80'
25
+ };
26
+ return { container: container };
27
+ }
28
+ var defaultProps = {
29
+ colorScheme: 'blue',
30
+ size: 'md',
31
+ variant: 'subtle'
32
+ };
33
+ var parts = ['container', 'icon', 'text'];
34
+ var sizes = {
35
+ sm: {
36
+ container: {
37
+ fontSize: 'sm',
38
+ h: 24,
39
+ spaceX: 4
40
+ },
41
+ icon: {
42
+ size: 'xs'
43
+ },
44
+ text: {}
45
+ },
46
+ md: {
47
+ container: {
48
+ fontSize: 'sm',
49
+ h: 32,
50
+ spaceX: 6
51
+ },
52
+ icon: {
53
+ size: 'sm'
54
+ },
55
+ text: {}
56
+ },
57
+ lg: {
58
+ container: {
59
+ fontSize: 'md',
60
+ h: 40,
61
+ spaceX: 8
62
+ },
63
+ icon: {
64
+ size: 'md'
65
+ },
66
+ text: {}
67
+ }
68
+ };
69
+ var variants = {
70
+ solid: variantSolid,
71
+ subtle: variantSubtle
72
+ };
73
+ exports.default = {
74
+ defaultProps: defaultProps,
75
+ parts: parts,
76
+ sizes: sizes,
77
+ variants: variants
78
+ };
@@ -76,7 +76,7 @@ exports.TextareaTextarea = styled_components_1.default.textarea.withConfig(core_
76
76
  exports.TextareaBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"])), system_1.system);
77
77
  exports.Textarea = core_1.vui(function (props, ref) {
78
78
  var _a = __read(react_1.useState(helpers_1.getInitialCount(props)), 2), count = _a[0], setCount = _a[1];
79
- var _b = core_1.omitThemingProps(props), autoFocus = _b.autoFocus, className = _b.className, colorSchemeProp = _b.colorScheme, defaultValue = _b.defaultValue, disabled = _b.disabled, isInvalid = _b.isInvalid, maxLength = _b.maxLength, name = _b.name, onBlur = _b.onBlur, onChangeProp = _b.onChange, onFocus = _b.onFocus, placeholder = _b.placeholder, readOnly = _b.readOnly, required = _b.required, resize = _b.resize, showCount = _b.showCount, _c = _b.textareaProps, textareaProps = _c === void 0 ? {} : _c, textareaRef = _b.textareaRef, value = _b.value, rest = __rest(_b, ["autoFocus", "className", "colorScheme", "defaultValue", "disabled", "isInvalid", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "readOnly", "required", "resize", "showCount", "textareaProps", "textareaRef", "value"]);
79
+ var _b = core_1.omitThemingProps(props), autoFocus = _b.autoFocus, className = _b.className, colorSchemeProp = _b.colorScheme, defaultValue = _b.defaultValue, disabled = _b.disabled, id = _b.id, isInvalid = _b.isInvalid, maxLength = _b.maxLength, name = _b.name, onBlur = _b.onBlur, onChangeProp = _b.onChange, onFocus = _b.onFocus, placeholder = _b.placeholder, readOnly = _b.readOnly, required = _b.required, resize = _b.resize, showCount = _b.showCount, _c = _b.textareaProps, textareaProps = _c === void 0 ? {} : _c, textareaRef = _b.textareaRef, value = _b.value, rest = __rest(_b, ["autoFocus", "className", "colorScheme", "defaultValue", "disabled", "id", "isInvalid", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "readOnly", "required", "resize", "showCount", "textareaProps", "textareaRef", "value"]);
80
80
  var colorProps = utils_1.filterUndefined({
81
81
  colorScheme: colorSchemeProp !== null && colorSchemeProp !== void 0 ? colorSchemeProp : (isInvalid ? 'red' : undefined)
82
82
  });
@@ -95,6 +95,7 @@ exports.Textarea = core_1.vui(function (props, ref) {
95
95
  autoFocus: autoFocus,
96
96
  defaultValue: defaultValue,
97
97
  disabled: disabled,
98
+ id: id,
98
99
  maxLength: maxLength,
99
100
  name: name,
100
101
  onBlur: onBlur,
@@ -4,6 +4,7 @@ import { SystemProps } from '../system';
4
4
  import { ThemingProps } from '../theme';
5
5
  export interface TextareaProps extends SystemProps, ThemingProps<'Textarea'> {
6
6
  autoFocus?: boolean;
7
+ children?: never;
7
8
  colorScheme?: 'green' | 'grey' | 'red';
8
9
  cols?: number;
9
10
  defaultValue?: number | string;