@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
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isString = exports.isReactText = exports.isObject = exports.isNumber = exports.isFunction = exports.isArray = void 0;
4
+ /** Is value an array. */
5
+ function isArray(value) {
6
+ return Array.isArray(value);
7
+ }
8
+ exports.isArray = isArray;
9
+ /** Is value a function. */
10
+ function isFunction(value) {
11
+ return typeof value === 'function';
12
+ }
13
+ exports.isFunction = isFunction;
14
+ /** Is value a number. */
15
+ function isNumber(value) {
16
+ return typeof value === 'number';
17
+ }
18
+ exports.isNumber = isNumber;
19
+ /** Is value an object. */
20
+ function isObject(value) {
21
+ var type = typeof value;
22
+ return value !== null && (type === 'object' || type === 'function') && !isArray(value);
23
+ }
24
+ exports.isObject = isObject;
25
+ /** Is value a valid ReactText - string or number */
26
+ function isReactText(value) {
27
+ return isNumber(value) || isString(value);
28
+ }
29
+ exports.isReactText = isReactText;
30
+ /** Is value a string */
31
+ function isString(value) {
32
+ return Object.prototype.toString.call(value) === '[object String]';
33
+ }
34
+ exports.isString = isString;
package/utils/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './assertion';
1
2
  export * from './function';
2
3
  export * from './object';
3
4
  export * from './styles';
package/utils/index.js CHANGED
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./assertion"), exports);
13
14
  __exportStar(require("./function"), exports);
14
15
  __exportStar(require("./object"), exports);
15
16
  __exportStar(require("./styles"), exports);
package/utils/object.d.ts CHANGED
@@ -1,27 +1,14 @@
1
1
  import { Dict } from './types';
2
2
  /** Removes keys from an object if their value is undefined. */
3
3
  export declare const filterUndefined: (object: Dict) => Dict<any>;
4
- /**
5
- * Recursively retrieves a nested property of a given object
6
- * @param object
7
- * @param path string, such as: 'user.name', or array ['user', 'name']
8
- * @param separator used when path is a string to split individual keys
9
- */
10
- export declare function get(object: Dict, path: string | string[], separator?: string): any | undefined;
11
- /** Checks if the item is an object. */
12
- export declare function isObj(item: any): boolean;
13
4
  /**
14
5
  * Recursively deep merges two objects in an immutable fashion, following these rules:
15
- * - Property exists in both objects and is an object itself => merge
16
- * - Property exists in both objects and has the same, non-object type => override
17
- * - Property doesn't exist in source => override
6
+ * - Key exists in target and both keys are objects => merge
7
+ * - Key exists in target and both keys are arrays => concat (not unique)
8
+ * - Key isn't an object, an array or doesn't exist in target => override
18
9
  */
19
- export declare function mergeWith<TSource extends Dict, TOverride extends Dict>(source: TSource, override: TOverride): TSource & TOverride;
20
- declare type FilterFn<T> = (value: any, key: string, object: T) => boolean;
10
+ export declare function merge<Target extends Dict, Source extends Dict>(target: Target, source: Source): Target & Source;
21
11
  /**
22
12
  * Returns the items of an object that meet the condition specified in a callback function.
23
13
  */
24
- export declare function objectFilter<T extends Dict>(object: T, fn: FilterFn<T>): Dict<any>;
25
- /** Removes given keys from an object. */
26
- export declare function omit<T extends Dict, K extends keyof T>(object: T, keys: K[]): Omit<T, K>;
27
- export {};
14
+ export declare function objectFilter<T extends Dict>(object: T, fn: (value: any, key: string, object: T) => boolean): Dict<any>;
package/utils/object.js CHANGED
@@ -11,60 +11,38 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.omit = exports.objectFilter = exports.mergeWith = exports.isObj = exports.get = exports.filterUndefined = void 0;
14
+ exports.objectFilter = exports.merge = exports.filterUndefined = void 0;
15
+ var assertion_1 = require("./assertion");
15
16
  /** Removes keys from an object if their value is undefined. */
16
17
  var filterUndefined = function (object) { return objectFilter(object, function (val) { return val !== null && val !== undefined; }); };
17
18
  exports.filterUndefined = filterUndefined;
18
- /**
19
- * Recursively retrieves a nested property of a given object
20
- * @param object
21
- * @param path string, such as: 'user.name', or array ['user', 'name']
22
- * @param separator used when path is a string to split individual keys
23
- */
24
- function get(object, path, separator) {
25
- if (separator === void 0) { separator = '.'; }
26
- if (!isObj(object))
27
- return;
28
- var keys = Array.isArray(path) ? path : path.split(separator);
29
- return keys.reduce(function (obj, property) { return obj === null || obj === void 0 ? void 0 : obj[property]; }, object);
30
- }
31
- exports.get = get;
32
- /** Checks if the item is an object. */
33
- function isObj(item) {
34
- return item && typeof item === 'object' && item.constructor === Object;
35
- }
36
- exports.isObj = isObj;
37
19
  /**
38
20
  * Recursively deep merges two objects in an immutable fashion, following these rules:
39
- * - Property exists in both objects and is an object itself => merge
40
- * - Property exists in both objects and has the same, non-object type => override
41
- * - Property doesn't exist in source => override
21
+ * - Key exists in target and both keys are objects => merge
22
+ * - Key exists in target and both keys are arrays => concat (not unique)
23
+ * - Key isn't an object, an array or doesn't exist in target => override
42
24
  */
43
- function mergeWith(source, override) {
44
- var output;
45
- if (isObj(source) && isObj(override)) {
46
- output = __assign({}, source);
47
- Object.keys(override).forEach(function (key) {
25
+ function merge(target, source) {
26
+ var output = __assign({}, target);
27
+ if (assertion_1.isObject(target) && assertion_1.isObject(source)) {
28
+ Object.keys(source).forEach(function (key) {
29
+ var _a;
48
30
  if (key === '__proto__')
49
31
  return;
50
- if (key in source) {
51
- if (override[key] && typeof source[key] === typeof override[key]) {
52
- if (isObj(override[key])) {
53
- output[key] = mergeWith(source[key], override[key]);
54
- }
55
- else {
56
- output[key] = override[key];
57
- }
58
- }
32
+ if (key in target && assertion_1.isObject(target[key]) && assertion_1.isObject(source[key])) {
33
+ output[key] = merge(target[key], source[key]);
34
+ }
35
+ else if (key in target && assertion_1.isArray(target[key]) && assertion_1.isArray(source[key])) {
36
+ output[key] = (_a = target[key]) === null || _a === void 0 ? void 0 : _a.concat(source[key]);
59
37
  }
60
38
  else {
61
- output[key] = override[key];
39
+ output[key] = source[key];
62
40
  }
63
41
  });
64
42
  }
65
43
  return output;
66
44
  }
67
- exports.mergeWith = mergeWith;
45
+ exports.merge = merge;
68
46
  /**
69
47
  * Returns the items of an object that meet the condition specified in a callback function.
70
48
  */
@@ -80,14 +58,3 @@ function objectFilter(object, fn) {
80
58
  return result;
81
59
  }
82
60
  exports.objectFilter = objectFilter;
83
- /** Removes given keys from an object. */
84
- function omit(object, keys) {
85
- var result = {};
86
- Object.keys(object).forEach(function (key) {
87
- if (keys.includes(key))
88
- return;
89
- result[key] = object[key];
90
- });
91
- return result;
92
- }
93
- exports.omit = omit;
package/utils/types.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare type AnyElement = React.ReactNode & {};
1
3
  export declare type AnyNumber = number & {};
2
4
  export declare type AnyString = string & {};
3
5
  export declare type Dict<T = any> = Record<string, T>;
package/alert/alert.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { AlertProps } from './alert.types';
2
- import AlertButton from './alertButton';
3
- import AlertIcon from './alertIcon';
4
- import AlertText from './alertText';
5
- import AlertTitle from './alertTitle';
6
- import { VuiComponent } from '../core';
7
- export declare const Alert: VuiComponent<"div", AlertProps> & {
8
- Button: typeof AlertButton;
9
- Icon: typeof AlertIcon;
10
- Text: typeof AlertText;
11
- Title: typeof AlertTitle;
12
- };
13
- export default Alert;
@@ -1,20 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { BoxProps } from '../box';
3
- import { IconProps } from '../icon';
4
- import { VuiIcon } from '../icons';
5
- import { ThemingProps } from '../theme';
6
- export interface AlertProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Alert'> {
7
- action?: ReactNode;
8
- colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
9
- icon?: VuiIcon | (ReactNode & {});
10
- onClose?: () => void;
11
- status?: AlertStatus;
12
- statusMapping?: AlertStatusMapping;
13
- text?: ReactNode;
14
- title?: ReactNode;
15
- }
16
- export declare type AlertStatus = 'error' | 'info' | 'loading' | 'success' | 'warning';
17
- export declare type AlertStatusMapping = Record<string, {
18
- colorScheme?: AlertProps['colorScheme'];
19
- iconProps: IconProps;
20
- }>;
@@ -1,3 +0,0 @@
1
- import { ButtonProps } from '../button';
2
- export declare const AlertButton: import("../core").VuiComponent<"button", ButtonProps>;
3
- export default AlertButton;
@@ -1,3 +0,0 @@
1
- import { IconProps } from '../icon';
2
- export declare const AlertIcon: import("../core").VuiComponent<"svg", IconProps>;
3
- export default AlertIcon;
@@ -1,3 +0,0 @@
1
- import { PProps } from '../p';
2
- export declare const AlertText: import("../core").VuiComponent<"p", PProps>;
3
- export default AlertText;
@@ -1,3 +0,0 @@
1
- import { TProps } from '../t';
2
- export declare const AlertTitle: import("../core").VuiComponent<"span", TProps>;
3
- export default AlertTitle;
package/alert/consts.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { AlertStatusMapping } from './alert.types';
2
- export declare const alertStatusMapping: AlertStatusMapping;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { AlertProps } from './alert.types';
3
- declare const AlertProvider: import("react").Provider<Partial<AlertProps>>, useAlert: () => Partial<AlertProps>;
4
- export { AlertProvider, useAlert };
package/alert/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from './alert';
2
- export * from './alert.types';
3
- export * from './alertButton';
4
- export * from './alertIcon';
5
- export * from './alertText';
6
- export * from './alertTitle';
7
- export * from './context';
8
- export { default } from './alert';
package/label/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './label';
2
- export * from './label.types';
3
- export { default } from './label';
package/label/label.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { LabelProps } from './label.types';
2
- import { SystemProps } from '../system';
3
- export declare const LabelBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
4
- export declare const Label: import("../core").VuiComponent<"span", LabelProps>;
5
- export default Label;
package/label/label.js DELETED
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
- return cooked;
5
- };
6
- var __assign = (this && this.__assign) || function () {
7
- __assign = Object.assign || function(t) {
8
- for (var s, i = 1, n = arguments.length; i < n; i++) {
9
- s = arguments[i];
10
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
- t[p] = s[p];
12
- }
13
- return t;
14
- };
15
- return __assign.apply(this, arguments);
16
- };
17
- var __rest = (this && this.__rest) || function (s, e) {
18
- var t = {};
19
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
- t[p] = s[p];
21
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
- t[p[i]] = s[p[i]];
25
- }
26
- return t;
27
- };
28
- var __importDefault = (this && this.__importDefault) || function (mod) {
29
- return (mod && mod.__esModule) ? mod : { "default": mod };
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Label = exports.LabelBase = void 0;
33
- var react_1 = __importDefault(require("react"));
34
- var styled_components_1 = __importDefault(require("styled-components"));
35
- var core_1 = require("../core");
36
- var icon_1 = __importDefault(require("../icon"));
37
- var system_1 = require("../system");
38
- var utils_1 = require("../utils");
39
- var Text = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.isTruncated);
40
- exports.LabelBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"])), system_1.system);
41
- exports.Label = core_1.vui(function (props, ref) {
42
- var _a = core_1.omitThemingProps(props), casing = _a.casing, children = _a.children, className = _a.className, icon = _a.icon, iconLeft = _a.iconLeft, iconRight = _a.iconRight, isElevated = _a.isElevated, isFullWidth = _a.isFullWidth, _b = _a.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, isRound = _a.isRound, isSplit = _a.isSplit, _c = _a.isTruncated, isTruncated = _c === void 0 ? true : _c, itemLeft = _a.itemLeft, itemRight = _a.itemRight, text = _a.text, weight = _a.weight, rest = __rest(_a, ["casing", "children", "className", "icon", "iconLeft", "iconRight", "isElevated", "isFullWidth", "isInteractive", "isRound", "isSplit", "isTruncated", "itemLeft", "itemRight", "text", "weight"]);
43
- var _d = core_1.useStyleConfig('Label', props), activeBg = _d.activeBg, h = _d.h, hoverBg = _d.hoverBg, _e = _d.iconSize, iconSize = _e === void 0 ? 'md' : _e, _f = _d.spaceX, spaceXBase = _f === void 0 ? 0 : _f, styles = __rest(_d, ["activeBg", "h", "hoverBg", "iconSize", "spaceX"]);
44
- var spaceX = spaceXBase / 8;
45
- var spaceXText = (spaceXBase + 4) / 8;
46
- var iconRightMl = isSplit ? 'auto' : spaceX;
47
- var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
48
- var pr = icon || itemRight || iconRight ? spaceX : spaceXText;
49
- var interactiveProps = isInteractive
50
- ? {
51
- cursor: 'pointer',
52
- hoverBg: hoverBg,
53
- activeBg: activeBg,
54
- focusRing: 3,
55
- tabIndex: 0,
56
- userSelect: 'none'
57
- }
58
- : {};
59
- var aliasedProps = utils_1.filterUndefined({
60
- borderRadius: isRound ? h / 2 : undefined,
61
- boxShadow: isElevated ? '1' : undefined,
62
- fontWeight: weight,
63
- textTransform: casing,
64
- w: isFullWidth ? '100%' : undefined
65
- });
66
- return (react_1.default.createElement(exports.LabelBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-label', className), fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, styles, interactiveProps, aliasedProps, rest), icon ? (react_1.default.createElement(icon_1.default, { icon: icon, size: iconSize })) : (react_1.default.createElement(react_1.default.Fragment, null, itemLeft !== null && itemLeft !== void 0 ? itemLeft : (iconLeft && react_1.default.createElement(icon_1.default, { icon: iconLeft, mr: spaceX, size: iconSize })),
67
- react_1.default.createElement(Text, { isTruncated: isTruncated }, children !== null && children !== void 0 ? children : text), itemRight !== null && itemRight !== void 0 ? itemRight : (iconRight && react_1.default.createElement(icon_1.default, { icon: iconRight, ml: iconRightMl, size: iconSize }))))));
68
- });
69
- exports.Label.displayName = 'Label';
70
- exports.default = exports.Label;
71
- var templateObject_1, templateObject_2;
package/label/theme.d.ts DELETED
@@ -1,61 +0,0 @@
1
- import { Dict } from '../utils';
2
- declare function variantOutlined(props: Dict): {
3
- hoverBg: string;
4
- activeBg: string;
5
- bg: string;
6
- color: string;
7
- borderColor: string;
8
- borderWidth: number;
9
- };
10
- declare function variantSolid(props: Dict): {
11
- hoverBg: string;
12
- activeBg: string;
13
- bg: string;
14
- color: string;
15
- };
16
- declare function variantSubtle(props: Dict): {
17
- hoverBg: string;
18
- activeBg: string;
19
- bg: string;
20
- color: string;
21
- };
22
- declare function variantText(props: Dict): {
23
- hoverBg: string;
24
- activeBg: string;
25
- bg: string;
26
- color: string;
27
- };
28
- declare const _default: {
29
- defaultProps: {
30
- colorScheme: string;
31
- size: string;
32
- variant: string;
33
- };
34
- sizes: {
35
- sm: {
36
- fontSize: string;
37
- h: number;
38
- iconSize: string;
39
- spaceX: number;
40
- };
41
- md: {
42
- fontSize: string;
43
- h: number;
44
- iconSize: string;
45
- spaceX: number;
46
- };
47
- lg: {
48
- fontSize: string;
49
- h: number;
50
- iconSize: string;
51
- spaceX: number;
52
- };
53
- };
54
- variants: {
55
- outlined: typeof variantOutlined;
56
- solid: typeof variantSolid;
57
- subtle: typeof variantSubtle;
58
- text: typeof variantText;
59
- };
60
- };
61
- export default _default;
package/label/theme.js DELETED
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- function variantOutlined(props) {
15
- var c = props.colorScheme;
16
- var styles = __assign({ borderColor: c + ".80", borderWidth: 1 }, variantText(props));
17
- return styles;
18
- }
19
- function variantSolid(props) {
20
- var c = props.colorScheme;
21
- var styles = {
22
- hoverBg: c + ".90",
23
- activeBg: c + ".100",
24
- bg: c + ".80",
25
- color: 'white'
26
- };
27
- if (c === 'yellow') {
28
- styles.hoverBg = c + ".80";
29
- styles.activeBg = c + ".90";
30
- styles.bg = c + ".70";
31
- }
32
- return styles;
33
- }
34
- function variantSubtle(props) {
35
- var c = props.colorScheme;
36
- var styles = {
37
- hoverBg: c + ".30",
38
- activeBg: c + ".40",
39
- bg: c + ".20",
40
- color: c + ".80"
41
- };
42
- // Special cases
43
- if (c === 'green') {
44
- styles.color = c + ".90";
45
- }
46
- if (c === 'grey') {
47
- styles.color = "prussian.80";
48
- }
49
- if (c === 'red') {
50
- styles.color = c + ".90";
51
- }
52
- if (c === 'yellow') {
53
- styles.color = c + ".100";
54
- }
55
- return styles;
56
- }
57
- function variantText(props) {
58
- var c = props.colorScheme;
59
- var styles = {
60
- hoverBg: c + ".20",
61
- activeBg: c + ".30",
62
- bg: 'transparent',
63
- color: c + ".80"
64
- };
65
- // Special cases
66
- if (c === 'prussian') {
67
- styles.activeBg = 'blue.30';
68
- styles.hoverBg = 'blue.20';
69
- }
70
- return styles;
71
- }
72
- var defaultProps = {
73
- colorScheme: 'blue',
74
- size: 'md',
75
- variant: 'subtle'
76
- };
77
- var sizes = {
78
- sm: {
79
- fontSize: 'sm',
80
- h: 24,
81
- iconSize: 'xs',
82
- spaceX: 4
83
- },
84
- md: {
85
- fontSize: 'sm',
86
- h: 32,
87
- iconSize: 'sm',
88
- spaceX: 6
89
- },
90
- lg: {
91
- fontSize: 'md',
92
- h: 40,
93
- iconSize: 'md',
94
- spaceX: 8
95
- }
96
- };
97
- var variants = {
98
- outlined: variantOutlined,
99
- solid: variantSolid,
100
- subtle: variantSubtle,
101
- text: variantText
102
- };
103
- exports.default = {
104
- defaultProps: defaultProps,
105
- sizes: sizes,
106
- variants: variants
107
- };
@@ -1,16 +0,0 @@
1
- import { IconProp } from '../icon';
2
- import { SystemProps } from '../system';
3
- import { ThemingProps } from '../theme';
4
- export interface ListItemProps extends SystemProps, ThemingProps<'List'> {
5
- center?: boolean;
6
- centerH?: boolean;
7
- centerV?: boolean;
8
- colorScheme?: 'blue' | 'grey';
9
- column?: boolean;
10
- disabled?: boolean;
11
- iconLeft?: IconProp;
12
- iconRight?: IconProp;
13
- isInteractive?: boolean;
14
- isSelected?: boolean;
15
- text?: number | string;
16
- }
@@ -1,19 +0,0 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
2
- import { ChangeEventHandler, FocusEventHandler } from '../core';
3
- import { SystemProps } from '../system';
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?: HTMLAttributes<HTMLInputElement>;
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
- }
package/tile/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './tile';
2
- export * from './tile.types';
3
- export { default } from './tile';
package/tile/tile.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { TileProps } from './tile.types';
2
- export declare const Tile: import("../core").VuiComponent<"div", TileProps>;
3
- export default Tile;
File without changes
File without changes
File without changes
File without changes
File without changes