@veracity/vui 0.0.9 → 0.0.11

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 (117) hide show
  1. package/alert/alert.js +3 -3
  2. package/alert/alert.types.d.ts +2 -1
  3. package/alert/alertIcon.js +3 -3
  4. package/alert/alertTitle.d.ts +1 -1
  5. package/alert/alertTitle.js +1 -1
  6. package/alert/consts.js +17 -5
  7. package/avatar/avatar.d.ts +3 -4
  8. package/avatar/avatar.js +2 -2
  9. package/avatar/avatar.types.d.ts +2 -6
  10. package/box/box.d.ts +3 -4
  11. package/box/box.js +3 -4
  12. package/box/box.types.d.ts +2 -4
  13. package/button/button.d.ts +3 -4
  14. package/button/button.js +19 -14
  15. package/button/button.types.d.ts +9 -5
  16. package/button/buttonGroup.d.ts +3 -2
  17. package/button/buttonGroup.js +3 -4
  18. package/button/buttonGroup.types.d.ts +2 -4
  19. package/button/consts.d.ts +2 -0
  20. package/button/consts.js +26 -0
  21. package/button/theme.d.ts +1 -0
  22. package/button/theme.js +1 -0
  23. package/checkbox/checkbox.d.ts +3 -2
  24. package/checkbox/checkbox.js +5 -7
  25. package/checkbox/checkbox.types.d.ts +4 -6
  26. package/checkbox/checkboxGroup.d.ts +3 -2
  27. package/checkbox/checkboxGroup.js +3 -4
  28. package/checkbox/checkboxGroup.types.d.ts +2 -4
  29. package/divider/divider.d.ts +3 -2
  30. package/divider/divider.js +3 -4
  31. package/divider/divider.types.d.ts +2 -4
  32. package/heading/heading.d.ts +3 -4
  33. package/heading/heading.js +2 -4
  34. package/heading/heading.types.d.ts +2 -4
  35. package/icons/baseIcons/fad/fadSpinnerThird.d.ts +3 -0
  36. package/icons/baseIcons/fad/fadSpinnerThird.js +7 -0
  37. package/icons/baseIcons/fal/falSignIn.d.ts +3 -0
  38. package/icons/baseIcons/fal/falSignIn.js +7 -0
  39. package/icons/baseIcons/types.d.ts +1 -1
  40. package/icons/consts.js +2 -0
  41. package/input/consts.js +13 -7
  42. package/input/helpers.d.ts +2 -0
  43. package/input/helpers.js +9 -0
  44. package/input/input.d.ts +4 -5
  45. package/input/input.js +66 -13
  46. package/input/input.types.d.ts +10 -12
  47. package/input/theme.d.ts +0 -1
  48. package/input/theme.js +2 -4
  49. package/label/label.d.ts +3 -4
  50. package/label/label.js +5 -9
  51. package/label/label.types.d.ts +2 -5
  52. package/link/link.d.ts +3 -4
  53. package/link/link.js +4 -6
  54. package/link/link.types.d.ts +4 -5
  55. package/link/theme.d.ts +5 -0
  56. package/link/theme.js +14 -1
  57. package/list/list.d.ts +3 -2
  58. package/list/list.js +3 -4
  59. package/list/list.types.d.ts +2 -4
  60. package/list/listItem.d.ts +3 -2
  61. package/list/listItem.js +3 -4
  62. package/list/listItem.types.d.ts +2 -4
  63. package/p/p.d.ts +3 -4
  64. package/p/p.js +2 -4
  65. package/p/p.types.d.ts +2 -4
  66. package/package.json +1 -1
  67. package/radio/radio.d.ts +3 -2
  68. package/radio/radio.js +5 -7
  69. package/radio/radio.types.d.ts +4 -6
  70. package/radio/radioGroup.d.ts +3 -2
  71. package/radio/radioGroup.js +3 -4
  72. package/radio/radioGroup.types.d.ts +2 -4
  73. package/skeleton/skeleton.d.ts +3 -2
  74. package/skeleton/skeleton.js +3 -4
  75. package/skeleton/skeleton.types.d.ts +2 -4
  76. package/spinner/spinner.js +3 -4
  77. package/spinner/spinner.types.d.ts +2 -2
  78. package/svg/svg.d.ts +4 -3
  79. package/svg/svg.js +8 -8
  80. package/svg/svg.types.d.ts +3 -11
  81. package/switch/switch.d.ts +3 -2
  82. package/switch/switch.js +3 -4
  83. package/switch/switch.types.d.ts +2 -4
  84. package/switch/switchButton.d.ts +5 -4
  85. package/switch/switchButton.js +6 -9
  86. package/switch/switchButton.types.d.ts +2 -8
  87. package/system/animations.d.ts +9 -7
  88. package/system/backgrounds.d.ts +8 -8
  89. package/system/borders.d.ts +138 -129
  90. package/system/colors.d.ts +1 -2
  91. package/system/effects.d.ts +15 -12
  92. package/system/flexboxes.d.ts +43 -54
  93. package/system/index.d.ts +2 -0
  94. package/system/index.js +7 -0
  95. package/system/interactivity.d.ts +17 -23
  96. package/system/layout.d.ts +69 -74
  97. package/system/sizing.d.ts +27 -27
  98. package/system/space.d.ts +89 -87
  99. package/system/system.d.ts +17 -0
  100. package/system/system.js +5 -0
  101. package/system/transforms.d.ts +53 -53
  102. package/system/transitions.d.ts +20 -25
  103. package/system/typography.d.ts +68 -61
  104. package/t/t.d.ts +3 -4
  105. package/t/t.js +2 -4
  106. package/t/t.types.d.ts +2 -4
  107. package/textarea/helpers.d.ts +2 -0
  108. package/textarea/helpers.js +9 -0
  109. package/textarea/textarea.d.ts +5 -5
  110. package/textarea/textarea.js +79 -10
  111. package/textarea/textarea.types.d.ts +22 -4
  112. package/textarea/theme.d.ts +7 -3
  113. package/textarea/theme.js +7 -4
  114. package/theme/components.d.ts +12 -4
  115. package/theme/defaultTheme.d.ts +12 -4
  116. package/theme/foundations/animations.js +6 -6
  117. package/tile/tile.types.d.ts +2 -4
@@ -1,68 +1,75 @@
1
- import { ITheme, SystemProp, VariantsType } from '@xstyled/system';
1
+ import { SystemProp, VariantsType } from '@xstyled/system';
2
2
  import { Globals, Property } from 'csstype';
3
3
  import { ColorGetter } from './colors';
4
4
  import { VuiTheme } from '../theme';
5
- export declare type FontGetter<T extends ITheme = VuiTheme> = VariantsType<T['fonts']>;
6
- export declare type FontSizeGetter<T extends ITheme = VuiTheme> = VariantsType<T['fontSizes']>;
7
- export declare type FontWeightGetter<T extends ITheme = VuiTheme> = VariantsType<T['fontWeights']>;
8
- export declare type LineHeightGetter<T extends ITheme = VuiTheme> = VariantsType<T['lineHeights']>;
9
- declare type FontFamilyProp<T extends ITheme> = SystemProp<FontGetter<T>, T>;
10
- export interface FontFamilyProps<T extends ITheme = VuiTheme> {
11
- fontFamily?: FontFamilyProp<T>;
12
- hoverFontFamily?: FontFamilyProp<T>;
13
- }
14
- declare type FontSizeProp<T extends ITheme> = SystemProp<FontSizeGetter<T>, T>;
15
- export interface FontSizeProps<T extends ITheme = VuiTheme> {
16
- fontSize?: FontSizeProp<T>;
17
- hoverFontSize?: FontSizeProp<T>;
18
- }
19
- declare type FontStyleProp<T extends ITheme> = SystemProp<Property.FontStyle, T>;
20
- export interface FontStyleProps<T extends ITheme = VuiTheme> {
21
- fontStyle?: FontStyleProp<T>;
22
- hoverFontStyle?: FontStyleProp<T>;
23
- }
24
- declare type FontWeightProp<T extends ITheme> = SystemProp<FontWeightGetter<T>, T>;
25
- export interface FontWeightProps<T extends ITheme = VuiTheme> {
26
- fontWeight?: FontWeightProp<T>;
27
- hoverFontWeight?: FontWeightProp<T>;
28
- }
29
- declare type LineHeightProp<T extends ITheme> = SystemProp<LineHeightGetter<T>, T>;
30
- export interface LineHeightProps<T extends ITheme = VuiTheme> {
31
- lineHeight?: LineHeightProp<T>;
32
- hoverLineHeight?: LineHeightProp<T>;
33
- }
34
- declare type ColorProp<T extends ITheme> = SystemProp<ColorGetter<T>, T>;
35
- export interface ColorProps<T extends ITheme = VuiTheme> {
36
- color?: ColorProp<T>;
37
- disabledColor?: ColorProp<T>;
38
- hoverColor?: ColorProp<T>;
39
- placeholderColor?: ColorProp<T>;
40
- }
41
- declare type TextTransformProp<T extends ITheme> = SystemProp<Property.TextTransform, T>;
42
- export interface TextTransformProps<T extends ITheme = VuiTheme> {
43
- textTransform?: TextTransformProp<T>;
44
- hoverTextTransform?: TextTransformProp<T>;
5
+ export declare type FontGetter = VariantsType<VuiTheme['fonts']>;
6
+ export declare type FontSizeGetter = VariantsType<VuiTheme['fontSizes']>;
7
+ export declare type FontWeightGetter = VariantsType<VuiTheme['fontWeights']>;
8
+ export declare type LineHeightGetter = VariantsType<unknown>;
9
+ declare type FontFamilyProp = SystemProp<FontGetter, VuiTheme>;
10
+ export interface FontFamilyProps {
11
+ fontFamily?: FontFamilyProp;
12
+ }
13
+ declare type FontSizeProp = SystemProp<FontSizeGetter, VuiTheme>;
14
+ export interface FontSizeProps {
15
+ fontSize?: FontSizeProp;
16
+ }
17
+ declare type FontStyleProp = SystemProp<Property.FontStyle, VuiTheme>;
18
+ export interface FontStyleProps {
19
+ fontStyle?: FontStyleProp;
20
+ }
21
+ declare type FontWeightProp = SystemProp<FontWeightGetter, VuiTheme>;
22
+ export interface FontWeightProps {
23
+ fontWeight?: FontWeightProp;
24
+ }
25
+ declare type LineHeightProp = SystemProp<LineHeightGetter, VuiTheme>;
26
+ export interface LineHeightProps {
27
+ lineHeight?: LineHeightProp;
28
+ }
29
+ declare type ColorProp = ColorGetter;
30
+ export interface ColorProps {
31
+ color?: ColorProp;
32
+ disabledColor?: ColorProp;
33
+ hoverColor?: ColorProp;
34
+ placeholderColor?: ColorProp;
35
+ }
36
+ declare type TextTransformProp = SystemProp<Property.TextTransform, VuiTheme>;
37
+ export interface TextTransformProps {
38
+ textTransform?: TextTransformProp;
45
39
  }
46
40
  declare type TextDecoration = Globals | 'overline' | 'underline' | 'line-through';
47
- declare type TextDecorationProp<T extends ITheme> = SystemProp<TextDecoration, T>;
48
- export interface TextDecorationProps<T extends ITheme = VuiTheme> {
49
- textDecoration?: TextDecorationProp<T>;
50
- hoverTextDecoration?: TextDecorationProp<T>;
51
- }
52
- declare type TextAlignProp<T extends ITheme> = SystemProp<Property.TextAlign, T>;
53
- export interface TextAlignProps<T extends ITheme = VuiTheme> {
54
- textAlign?: TextAlignProp<T>;
55
- hoverTextAlign?: TextAlignProp<T>;
56
- }
57
- declare type VerticalAlignProp<T extends ITheme> = SystemProp<Property.VerticalAlign, T>;
58
- export interface VerticalAlignProps<T extends ITheme = VuiTheme> {
59
- verticalAlign?: VerticalAlignProp<T>;
60
- hoverVerticalAlign?: VerticalAlignProp<T>;
61
- }
62
- declare type ListStyleTypeProp<T extends ITheme> = SystemProp<Property.ListStyleType, T>;
63
- export interface ListStyleTypeProps<T extends ITheme = VuiTheme> {
64
- listStyleType?: ListStyleTypeProp<T>;
65
- }
66
- export interface TypographyProps<T extends ITheme = VuiTheme> extends FontFamilyProps<T>, FontSizeProps<T>, FontStyleProps<T>, FontWeightProps<T>, LineHeightProps<T>, ColorProps<T>, TextTransformProps<T>, TextDecorationProps<T>, TextAlignProps<T>, VerticalAlignProps<T>, ListStyleTypeProps<T> {
41
+ declare type TextDecorationProp = SystemProp<TextDecoration, VuiTheme>;
42
+ export interface TextDecorationProps {
43
+ textDecoration?: TextDecorationProp;
44
+ }
45
+ declare type TextAlignProp = SystemProp<Property.TextAlign, VuiTheme>;
46
+ export interface TextAlignProps {
47
+ textAlign?: TextAlignProp;
48
+ }
49
+ declare type VerticalAlignProp = SystemProp<Property.VerticalAlign, VuiTheme>;
50
+ export interface VerticalAlignProps {
51
+ verticalAlign?: VerticalAlignProp;
52
+ }
53
+ declare type LetterSpacingProp = SystemProp<Property.LetterSpacing, VuiTheme>;
54
+ export interface LetterSpacingProps {
55
+ letterSpacing?: LetterSpacingProp;
56
+ }
57
+ declare type WhiteSpaceProp = SystemProp<Property.WhiteSpace, VuiTheme>;
58
+ export interface WhiteSpaceProps {
59
+ whiteSpace?: WhiteSpaceProp;
60
+ }
61
+ declare type TextOverflowProp = SystemProp<Property.TextOverflow, VuiTheme>;
62
+ export interface TextOverflowProps {
63
+ textOverflow?: TextOverflowProp;
64
+ }
65
+ declare type ListStyleTypeProp = SystemProp<Property.ListStyleType, VuiTheme>;
66
+ export interface ListStyleTypeProps {
67
+ listStyleType?: ListStyleTypeProp;
68
+ }
69
+ declare type ListStylePositionProp = SystemProp<Property.ListStylePosition, VuiTheme>;
70
+ export interface ListStylePositionProps {
71
+ listStylePosition?: ListStylePositionProp;
72
+ }
73
+ export interface TypographyProps extends FontFamilyProps, FontSizeProps, FontStyleProps, FontWeightProps, LineHeightProps, ColorProps, TextTransformProps, TextDecorationProps, TextAlignProps, VerticalAlignProps, LetterSpacingProps, WhiteSpaceProps, TextOverflowProps, ListStyleTypeProps, ListStylePositionProps {
67
74
  }
68
75
  export {};
package/t/t.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { TProps, TStyleProps } from './t.types';
2
- export declare const TBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TStyleProps & {
3
- color?: any;
4
- }, never>;
1
+ import { TProps } from './t.types';
2
+ import { SystemProps } from '../system';
3
+ export declare const TBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
5
4
  export declare const T: import("../core").VuiComponent<"span", TProps>;
6
5
  export default T;
package/t/t.js CHANGED
@@ -30,14 +30,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
32
  exports.T = exports.TBase = void 0;
33
- var styled_components_1 = require("@xstyled/styled-components");
34
33
  var react_1 = __importDefault(require("react"));
35
- var styled_components_2 = __importDefault(require("styled-components"));
34
+ var styled_components_1 = __importDefault(require("styled-components"));
36
35
  var core_1 = require("../core");
37
36
  var system_1 = require("../system");
38
37
  var utils_1 = require("../utils");
39
- var generator = styled_components_1.compose(styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.cursor, styled_components_1.flexboxes, system_1.isTruncated, styled_components_1.sizing, styled_components_1.space, styled_components_1.transitions, styled_components_1.typography);
40
- exports.TBase = styled_components_2.default.span.withConfig(core_1.forwardPropConfig(generator))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), generator);
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);
41
39
  exports.T = core_1.vui(function (props, ref) {
42
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, isFlex = _a.isFlex, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "centerV", "children", "className", "decoration", "isFlex", "text", "weight"]);
43
41
  var styles = core_1.useStyleConfig('T', props);
package/t/t.types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { BackgroundColorProps, BordersProps, CursorProps, FlexboxesProps, IsTruncatedProps, SizingProps, SpaceProps, TransitionsProps, TypographyProps } from '../system';
1
+ import { SystemProps, TypographyProps } from '../system';
2
2
  import { ThemingProps } from '../theme';
3
- export interface TProps extends TStyleProps, ThemingProps<'T'> {
3
+ export interface TProps extends SystemProps, ThemingProps<'T'> {
4
4
  align?: TypographyProps['textAlign'];
5
5
  casing?: TypographyProps['textTransform'];
6
6
  centerV?: boolean;
@@ -9,5 +9,3 @@ export interface TProps extends TStyleProps, ThemingProps<'T'> {
9
9
  text?: number | string;
10
10
  weight?: TypographyProps['fontWeight'];
11
11
  }
12
- export interface TStyleProps extends BackgroundColorProps, BordersProps, CursorProps, FlexboxesProps, IsTruncatedProps, SizingProps, SpaceProps, TransitionsProps, TypographyProps {
13
- }
@@ -0,0 +1,2 @@
1
+ import { TextareaProps } from './textarea.types';
2
+ export declare function getInitialCount(props: TextareaProps): number;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getInitialCount = void 0;
4
+ function getInitialCount(props) {
5
+ var _a, _b;
6
+ var defaultValue = props.defaultValue, value = props.value;
7
+ return (_b = (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.toString().length) !== null && _a !== void 0 ? _a : value === null || value === void 0 ? void 0 : value.toString().length) !== null && _b !== void 0 ? _b : 0;
8
+ }
9
+ exports.getInitialCount = getInitialCount;
@@ -1,6 +1,6 @@
1
- import { TextareaProps, TextareaStyleProps } from './textarea.types';
2
- export declare const TextareaBase: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, TextareaStyleProps & {
3
- color?: any;
4
- }, never>;
5
- export declare const Textarea: import("../core").VuiComponent<"textarea", TextareaProps>;
1
+ import { TextareaProps } from './textarea.types';
2
+ import { SystemProps } from '../system';
3
+ export declare const TextareaTextarea: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, SystemProps, never>;
4
+ export declare const TextareaBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, SystemProps, never>;
5
+ export declare const Textarea: import("../core").VuiComponent<"div", TextareaProps>;
6
6
  export default Textarea;
@@ -14,6 +14,25 @@ var __assign = (this && this.__assign) || function () {
14
14
  };
15
15
  return __assign.apply(this, arguments);
16
16
  };
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
17
36
  var __rest = (this && this.__rest) || function (s, e) {
18
37
  var t = {};
19
38
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -25,23 +44,73 @@ var __rest = (this && this.__rest) || function (s, e) {
25
44
  }
26
45
  return t;
27
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
+ };
28
63
  var __importDefault = (this && this.__importDefault) || function (mod) {
29
64
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
65
  };
31
66
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.Textarea = exports.TextareaBase = void 0;
33
- var styled_components_1 = require("@xstyled/styled-components");
34
- var react_1 = __importDefault(require("react"));
35
- var styled_components_2 = __importDefault(require("styled-components"));
67
+ exports.Textarea = exports.TextareaBase = exports.TextareaTextarea = void 0;
68
+ var react_1 = __importStar(require("react"));
69
+ var styled_components_1 = __importDefault(require("styled-components"));
70
+ var helpers_1 = require("./helpers");
36
71
  var core_1 = require("../core");
72
+ var system_1 = require("../system");
73
+ var t_1 = __importDefault(require("../t"));
37
74
  var utils_1 = require("../utils");
38
- var generator = styled_components_1.compose(styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.color, styled_components_1.fontSize, styled_components_1.resize, styled_components_1.sizing, styled_components_1.space, styled_components_1.transitions);
39
- exports.TextareaBase = styled_components_2.default.textarea.withConfig(core_1.forwardPropConfig(generator))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-width: 1px;\n\tmin-height: 80px;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"], ["\n\tborder-width: 1px;\n\tmin-height: 80px;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"])), generator);
75
+ exports.TextareaTextarea = styled_components_1.default.textarea.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
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);
40
77
  exports.Textarea = core_1.vui(function (props, ref) {
41
- var _a = core_1.omitThemingProps(props), className = _a.className, rest = __rest(_a, ["className"]);
42
- var styles = core_1.useStyleConfig('Textarea', props);
43
- return (react_1.default.createElement(exports.TextareaBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-textarea', className), p: 1, placeholderColor: "grey.60", ref: ref, transitionDuration: "fast" }, styles, rest)));
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"]);
80
+ var colorProps = utils_1.filterUndefined({
81
+ colorScheme: colorSchemeProp !== null && colorSchemeProp !== void 0 ? colorSchemeProp : (isInvalid ? 'red' : undefined)
82
+ });
83
+ var styles = core_1.useStyleConfig('Textarea', __assign(__assign({}, colorProps), props));
84
+ function onChange(e) {
85
+ setCount(e.target.value.length);
86
+ onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(e);
87
+ }
88
+ var aliasedProps = utils_1.filterUndefined({
89
+ bg: readOnly ? 'grey.20' : undefined,
90
+ focusBorderColor: !readOnly ? 'transparent' : undefined,
91
+ focusRing: readOnly ? 0 : undefined
92
+ });
93
+ return (react_1.default.createElement(exports.TextareaBase, __assign({ className: utils_1.cs('vui-textarea', className), ref: ref }, styles.container, rest),
94
+ react_1.default.createElement(exports.TextareaTextarea, __assign({ borderRadius: "md", className: "vui-textareaTextarea", p: 1, placeholderColor: "grey.60", ref: textareaRef, transitionDuration: "fast" }, {
95
+ autoFocus: autoFocus,
96
+ defaultValue: defaultValue,
97
+ disabled: disabled,
98
+ maxLength: maxLength,
99
+ name: name,
100
+ onBlur: onBlur,
101
+ onChange: onChange,
102
+ onFocus: onFocus,
103
+ placeholder: placeholder,
104
+ readOnly: readOnly,
105
+ required: required,
106
+ resize: resize,
107
+ value: value
108
+ }, styles.textarea, aliasedProps, textareaProps)),
109
+ showCount && (react_1.default.createElement(t_1.default, { color: "grey.80", position: "absolute", right: 0, size: "sm", top: "calc(100% + 2px)" },
110
+ count,
111
+ " / ",
112
+ maxLength))));
44
113
  });
45
114
  exports.Textarea.displayName = 'Textarea';
46
115
  exports.default = exports.Textarea;
47
- var templateObject_1;
116
+ var templateObject_1, templateObject_2;
@@ -1,7 +1,25 @@
1
- import { BackgroundColorProps, BordersProps, ColorProps, FontSizeProps, ResizeProps, SizingProps, SpaceProps, TransitionsProps } from '../system';
1
+ /// <reference types="react" />
2
+ import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../core';
3
+ import { SystemProps } from '../system';
2
4
  import { ThemingProps } from '../theme';
3
- export interface TextareaProps extends TextareaStyleProps, ThemingProps<'Textarea'> {
5
+ export interface TextareaProps extends SystemProps, ThemingProps<'Textarea'> {
6
+ autoFocus?: boolean;
4
7
  colorScheme?: 'green' | 'grey' | 'red';
5
- }
6
- export interface TextareaStyleProps extends BackgroundColorProps, BordersProps, ColorProps, FontSizeProps, ResizeProps, SizingProps, SpaceProps, TransitionsProps {
8
+ cols?: number;
9
+ defaultValue?: number | string;
10
+ disabled?: boolean;
11
+ isInvalid?: boolean;
12
+ maxLength?: number;
13
+ name?: string;
14
+ onBlur?: FocusEventHandler<HTMLTextAreaElement>;
15
+ onChange?: ChangeEventHandler<HTMLTextAreaElement>;
16
+ onFocus?: FocusEventHandler<HTMLTextAreaElement>;
17
+ placeholder?: string;
18
+ readOnly?: boolean;
19
+ required?: boolean;
20
+ rows?: number;
21
+ showCount?: boolean;
22
+ textareaProps?: PropsOf<'textarea', SystemProps>;
23
+ textareaRef?: React.MutableRefObject<HTMLTextAreaElement | null> | null;
24
+ value?: number | string;
7
25
  }
@@ -1,14 +1,18 @@
1
1
  import { Dict } from '../utils';
2
2
  declare function variantDefault(props: Dict): {
3
- borderColor: string;
4
- focusRing: number;
5
- focusRingColor: string;
3
+ container: {};
4
+ textarea: {
5
+ borderColor: string;
6
+ focusRing: number;
7
+ focusRingColor: string;
8
+ };
6
9
  };
7
10
  declare const _default: {
8
11
  defaultProps: {
9
12
  colorScheme: string;
10
13
  variant: string;
11
14
  };
15
+ parts: string[];
12
16
  sizes: {};
13
17
  variants: {
14
18
  default: typeof variantDefault;
package/textarea/theme.js CHANGED
@@ -2,27 +2,30 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  function variantDefault(props) {
4
4
  var c = props.colorScheme;
5
- var styles = {
5
+ var container = {};
6
+ var textarea = {
6
7
  borderColor: c + ".80",
7
8
  focusRing: 2,
8
9
  focusRingColor: c + ".80"
9
10
  };
10
11
  if (c === 'grey') {
11
- styles.borderColor = c + ".60";
12
- styles.focusRingColor = 'blue.50';
12
+ textarea.borderColor = c + ".60";
13
+ textarea.focusRingColor = 'blue.50';
13
14
  }
14
- return styles;
15
+ return { container: container, textarea: textarea };
15
16
  }
16
17
  var defaultProps = {
17
18
  colorScheme: 'grey',
18
19
  variant: 'default'
19
20
  };
21
+ var parts = ['container', 'textarea'];
20
22
  var sizes = {};
21
23
  var variants = {
22
24
  default: variantDefault
23
25
  };
24
26
  exports.default = {
25
27
  defaultProps: defaultProps,
28
+ parts: parts,
26
29
  sizes: sizes,
27
30
  variants: variants
28
31
  };
@@ -143,6 +143,7 @@ declare const _default: {
143
143
  borderWidth: number;
144
144
  };
145
145
  solid: (props: import("..").Dict<any>) => {
146
+ borderColor: string;
146
147
  hoverBg: string;
147
148
  activeBg: string;
148
149
  bg: string;
@@ -307,7 +308,6 @@ declare const _default: {
307
308
  borderColor: string;
308
309
  focusWithinRing: number;
309
310
  focusWithinRingColor: string;
310
- iconColor: string;
311
311
  };
312
312
  };
313
313
  };
@@ -391,6 +391,10 @@ declare const _default: {
391
391
  color: string;
392
392
  hoverColor: string;
393
393
  };
394
+ light: (props: import("..").Dict<any>) => {
395
+ color: string;
396
+ hoverColor: string;
397
+ };
394
398
  };
395
399
  };
396
400
  List: {
@@ -744,12 +748,16 @@ declare const _default: {
744
748
  colorScheme: string;
745
749
  variant: string;
746
750
  };
751
+ parts: string[];
747
752
  sizes: {};
748
753
  variants: {
749
754
  default: (props: import("..").Dict<any>) => {
750
- borderColor: string;
751
- focusRing: number;
752
- focusRingColor: string;
755
+ container: {};
756
+ textarea: {
757
+ borderColor: string;
758
+ focusRing: number;
759
+ focusRingColor: string;
760
+ };
753
761
  };
754
762
  };
755
763
  };
@@ -294,6 +294,7 @@ declare const defaultTheme: {
294
294
  borderWidth: number;
295
295
  };
296
296
  solid: (props: import("..").Dict<any>) => {
297
+ borderColor: string;
297
298
  hoverBg: string;
298
299
  activeBg: string;
299
300
  bg: string;
@@ -458,7 +459,6 @@ declare const defaultTheme: {
458
459
  borderColor: string;
459
460
  focusWithinRing: number;
460
461
  focusWithinRingColor: string;
461
- iconColor: string;
462
462
  };
463
463
  };
464
464
  };
@@ -542,6 +542,10 @@ declare const defaultTheme: {
542
542
  color: string;
543
543
  hoverColor: string;
544
544
  };
545
+ light: (props: import("..").Dict<any>) => {
546
+ color: string;
547
+ hoverColor: string;
548
+ };
545
549
  };
546
550
  };
547
551
  List: {
@@ -895,12 +899,16 @@ declare const defaultTheme: {
895
899
  colorScheme: string;
896
900
  variant: string;
897
901
  };
902
+ parts: string[];
898
903
  sizes: {};
899
904
  variants: {
900
905
  default: (props: import("..").Dict<any>) => {
901
- borderColor: string;
902
- focusRing: number;
903
- focusRingColor: string;
906
+ container: {};
907
+ textarea: {
908
+ borderColor: string;
909
+ focusRing: number;
910
+ focusRingColor: string;
911
+ };
904
912
  };
905
913
  };
906
914
  };
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  bounce: 'vui-bounce 1s infinite',
5
- fadeDown: 'vui-fadeDown 0.3s ease-in-out',
6
- fadeIn: 'vui-fadeIn 0.3s ease-in-out',
7
- fadeLeft: 'vui-fadeLeft 0.3s ease-in-out',
8
- fadeOut: 'vui-fadeOut 0.3s ease-in-out',
9
- fadeRight: 'vui-fadeRight 0.3s ease-in-out',
10
- fadeUp: 'vui-fadeUp 0.3s ease-in-out',
5
+ fadeDown: 'vui-fadeDown 0.2s ease-in-out',
6
+ fadeIn: 'vui-fadeIn 0.2s ease-in-out',
7
+ fadeLeft: 'vui-fadeLeft 0.2s ease-in-out',
8
+ fadeOut: 'vui-fadeOut 0.2s ease-in-out',
9
+ fadeRight: 'vui-fadeRight 0.2s ease-in-out',
10
+ fadeUp: 'vui-fadeUp 0.2s ease-in-out',
11
11
  pulse: 'vui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite',
12
12
  spin: 'vui-spin 1s linear infinite'
13
13
  };
@@ -1,7 +1,5 @@
1
- import { BoxProps, BoxStyleProps } from '../box';
1
+ import { BoxProps } from '../box';
2
2
  import { ThemingProps } from '../theme';
3
- export interface TileProps extends Omit<BoxProps, 'size' | 'variant'>, TileStyleProps, ThemingProps<'Tile'> {
3
+ export interface TileProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Tile'> {
4
4
  isInteractive?: boolean;
5
5
  }
6
- export interface TileStyleProps extends BoxStyleProps {
7
- }