@dscout/particle 1.0.0-alpha.24 → 1.0.0-alpha.26
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.
- package/lib/cjs/components/button_plain.d.ts +9 -3
- package/lib/cjs/components/button_plain.js +47 -3
- package/lib/cjs/components/button_plain.js.map +1 -1
- package/lib/cjs/components/common_input.d.ts +2 -1
- package/lib/cjs/components/common_input.js +4 -3
- package/lib/cjs/components/common_input.js.map +1 -1
- package/lib/cjs/components/input_group_item.d.ts +3 -1
- package/lib/cjs/components/input_group_item.js +8 -2
- package/lib/cjs/components/input_group_item.js.map +1 -1
- package/lib/cjs/components/search_input.d.ts +4 -1
- package/lib/cjs/components/search_input.js +2 -2
- package/lib/cjs/components/search_input.js.map +1 -1
- package/lib/cjs/components/text_input.d.ts +2 -1
- package/lib/cjs/components/text_input.js +2 -2
- package/lib/cjs/components/text_input.js.map +1 -1
- package/lib/cjs/components/with_addons.d.ts +2 -1
- package/lib/cjs/components/with_addons.js +2 -2
- package/lib/cjs/components/with_addons.js.map +1 -1
- package/lib/cjs/types.d.ts +12 -0
- package/lib/cjs/utils/dom.d.ts +1 -1
- package/lib/esm/components/button_plain.d.ts +9 -3
- package/lib/esm/components/button_plain.js +25 -4
- package/lib/esm/components/button_plain.js.map +1 -1
- package/lib/esm/components/common_input.d.ts +2 -1
- package/lib/esm/components/common_input.js +4 -3
- package/lib/esm/components/common_input.js.map +1 -1
- package/lib/esm/components/input_group_item.d.ts +3 -1
- package/lib/esm/components/input_group_item.js +8 -2
- package/lib/esm/components/input_group_item.js.map +1 -1
- package/lib/esm/components/search_input.d.ts +4 -1
- package/lib/esm/components/search_input.js +2 -2
- package/lib/esm/components/search_input.js.map +1 -1
- package/lib/esm/components/text_input.d.ts +2 -1
- package/lib/esm/components/text_input.js +2 -2
- package/lib/esm/components/text_input.js.map +1 -1
- package/lib/esm/components/with_addons.d.ts +2 -1
- package/lib/esm/components/with_addons.js +2 -2
- package/lib/esm/components/with_addons.js.map +1 -1
- package/lib/esm/types.d.ts +12 -0
- package/lib/esm/utils/dom.d.ts +1 -1
- package/lib/stylesheets/particle.css +68 -14
- package/lib/stylesheets/particle.css.map +1 -1
- package/lib/stylesheets/particle.min.css +1 -1
- package/lib/stylesheets/particle.min.css.gz +0 -0
- package/package.json +1 -1
- package/styles/components/input_group/_base.scss +34 -1
- package/styles/components/inputs/_base.scss +20 -0
- package/styles/components/inputs/themes/_theme_builder.scss +11 -5
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
2
|
+
import type { Colors, CommonComponentProps, Dimensions, MarginModifierProp, ModifierClassProp, PaddingModifierProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
-
interface ButtonPlainProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
4
|
+
interface ButtonPlainProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp, PaddingModifierProp {
|
|
5
5
|
'aria-controls'?: string;
|
|
6
6
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
color?: Colors;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
display?: 'block' | 'inline-block';
|
|
9
11
|
getRef?: GetRef<HTMLButtonElement>;
|
|
12
|
+
hoverColor?: Colors;
|
|
10
13
|
id?: string;
|
|
11
14
|
name?: string;
|
|
12
15
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
16
|
title?: string;
|
|
17
|
+
truncate?: boolean;
|
|
14
18
|
type?: 'button' | 'submit';
|
|
19
|
+
underlined?: boolean;
|
|
20
|
+
width?: Dimensions;
|
|
15
21
|
}
|
|
16
|
-
export declare function ButtonPlain({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, margin, name, onClick, title, type, ...rest }: ButtonPlainProps): React.JSX.Element;
|
|
22
|
+
export declare function ButtonPlain({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, color, disabled, display, getRef, hoverColor, id, margin, name, onClick, padding, title, truncate, type, underlined, width, ...rest }: ButtonPlainProps): React.JSX.Element;
|
|
17
23
|
export {};
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
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
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,13 +49,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.ButtonPlain = void 0;
|
|
29
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
30
53
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
54
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
55
|
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
33
56
|
function ButtonPlain(_a) {
|
|
34
|
-
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, title = _a.title,
|
|
35
|
-
|
|
57
|
+
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, color = _a.color, disabled = _a.disabled, _b = _a.display, display = _b === void 0 ? 'inline-block' : _b, getRef = _a.getRef, hoverColor = _a.hoverColor, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, padding = _a.padding, title = _a.title, _c = _a.truncate, truncate = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'button' : _d, underlined = _a.underlined, width = _a.width, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "color", "disabled", "display", "getRef", "hoverColor", "id", "margin", "name", "onClick", "padding", "title", "truncate", "type", "underlined", "width"]);
|
|
58
|
+
var _e = (0, react_1.useState)(false), hovered = _e[0], setHovered = _e[1];
|
|
59
|
+
var colorClass = (0, react_1.useMemo)(function () {
|
|
60
|
+
var colorEnum = color;
|
|
61
|
+
if (hovered && hoverColor && !disabled) {
|
|
62
|
+
colorEnum = hoverColor;
|
|
63
|
+
}
|
|
64
|
+
return colorEnum && "color--".concat(colorEnum);
|
|
65
|
+
}, [hovered, color, hoverColor]);
|
|
66
|
+
var classes = (0, class_names_1.default)('Button--plain', _modifierClass, colorClass, (0, modifier_classes_1.getDimensionClass)('width', width), (0, modifier_classes_1.getSpacingClass)('margin', margin), (0, modifier_classes_1.getSpacingClass)('padding', padding), {
|
|
67
|
+
'text-decoration--underline': underlined,
|
|
68
|
+
'display--b': display === 'block',
|
|
69
|
+
truncate: truncate
|
|
70
|
+
});
|
|
71
|
+
return (react_1.default.createElement("button", __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-describedby": ariaDescribedby, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className: classes, disabled: disabled, id: id, name: name, onBlur: function () {
|
|
72
|
+
setHovered(false);
|
|
73
|
+
}, onClick: onClick, onFocus: function () {
|
|
74
|
+
setHovered(true);
|
|
75
|
+
}, onMouseEnter: function () {
|
|
76
|
+
setHovered(true);
|
|
77
|
+
}, onMouseLeave: function () {
|
|
78
|
+
setHovered(false);
|
|
79
|
+
}, ref: getRef, title: title,
|
|
36
80
|
// eslint-disable-next-line react/button-has-type
|
|
37
81
|
type: type }), children));
|
|
38
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button_plain.js","sourceRoot":"","sources":["../../../src/components/button_plain.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button_plain.js","sourceRoot":"","sources":["../../../src/components/button_plain.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AAYjD,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA+E;AAyB/E,SAAgB,WAAW,CAAC,EAwBT;IAvBjB,IAAA,cAAc,oBAAA,EACG,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,eAAwB,EAAxB,OAAO,mBAAG,cAAc,KAAA,EACxB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,OAAO,aAAA,EACP,KAAK,WAAA,EACL,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,YAAe,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,UAAU,gBAAA,EACV,KAAK,WAAA,EACF,IAAI,cAvBmB,+QAwB3B,CADQ;IAED,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAC;IAE9C,IAAM,UAAU,GAAG,IAAA,eAAO,EAAC;QACzB,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAI,OAAO,IAAI,UAAU,IAAI,CAAC,QAAQ,EAAE;YACtC,SAAS,GAAG,UAAU,CAAC;SACxB;QAED,OAAO,SAAS,IAAI,iBAAU,SAAS,CAAE,CAAC;IAC5C,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAEjC,IAAM,OAAO,GAAG,IAAA,qBAAU,EACxB,eAAe,EACf,cAAc,EACd,UAAU,EACV,IAAA,oCAAiB,EAAC,OAAO,EAAE,KAAK,CAAC,EACjC,IAAA,kCAAe,EAAC,QAAQ,EAAE,MAAM,CAAC,EACjC,IAAA,kCAAe,EAAC,SAAS,EAAE,OAAO,CAAC,EACnC;QACE,4BAA4B,EAAE,UAAU;QACxC,YAAY,EAAE,OAAO,KAAK,OAAO;QACjC,QAAQ,UAAA;KACT,CACF,CAAC;IAEF,OAAO,CACL,qDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,sBACT,eAAe,mBAClB,YAAY,gBACf,SAAS,qBACJ,cAAc,EAC/B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,MAAM,EAAE;YACN,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;YACP,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EACD,YAAY,EAAE;YACZ,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EACD,YAAY,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,EACD,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK;QACZ,iDAAiD;QACjD,IAAI,EAAE,IAAI,KAET,QAAQ,CACF,CACV,CAAC;AACJ,CAAC;AApFD,kCAoFC"}
|
|
@@ -9,6 +9,7 @@ interface CommonInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
9
9
|
defaultValue?: number | string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
getRef?: GetRef<HTMLInputElement>;
|
|
12
|
+
icon?: React.JSX.Element;
|
|
12
13
|
id?: string;
|
|
13
14
|
invalid?: boolean;
|
|
14
15
|
max?: number | string;
|
|
@@ -31,5 +32,5 @@ interface CommonInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
31
32
|
type?: string;
|
|
32
33
|
value?: number | string;
|
|
33
34
|
}
|
|
34
|
-
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, margin, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
35
|
+
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, icon, id, invalid, margin, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
35
36
|
export {};
|
|
@@ -34,19 +34,20 @@ var modifier_classes_1 = require("../utils/modifier_classes");
|
|
|
34
34
|
var with_addons_1 = require("./with_addons");
|
|
35
35
|
function CommonInput(_a) {
|
|
36
36
|
var _b;
|
|
37
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, margin = _a.margin, max = _a.max, maxLength = _a.maxLength, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, step = _a.step, tabIndex = _a.tabIndex, type = _a.type, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "margin", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "step", "tabIndex", "type", "value"]);
|
|
38
|
-
var affixed = !!prefix || !!suffix;
|
|
37
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, icon = _a.icon, id = _a.id, invalid = _a.invalid, margin = _a.margin, max = _a.max, maxLength = _a.maxLength, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, step = _a.step, tabIndex = _a.tabIndex, type = _a.type, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "icon", "id", "invalid", "margin", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "step", "tabIndex", "type", "value"]);
|
|
38
|
+
var affixed = !!prefix || !!suffix || !!icon;
|
|
39
39
|
var inputClass = (0, class_names_1.default)('Input', (_b = {},
|
|
40
40
|
_b[(0, modifier_classes_1.getMarginClass)(margin)] = !affixed,
|
|
41
41
|
_b[_modifierClass] = _modifierClass && !affixed,
|
|
42
42
|
_b['Input--invalid'] = invalid,
|
|
43
43
|
_b['Input--mini'] = mini,
|
|
44
|
+
_b['Input--with-icon'] = !!icon,
|
|
44
45
|
_b));
|
|
45
46
|
var input = (react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete,
|
|
46
47
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
47
48
|
autoFocus: autoFocus, className: inputClass, defaultValue: defaultValue, disabled: disabled, id: id, max: max, maxLength: maxLength, min: min, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, readOnly: readOnly, required: required, ref: getRef, step: step, tabIndex: tabIndex, type: type, value: (0, forms_1.inputValue)(value, onChange) })));
|
|
48
49
|
if (affixed) {
|
|
49
|
-
return (react_1.default.createElement(with_addons_1.WithAddons, { _modifierClass: _modifierClass, disabled: disabled, margin: margin, mini: mini, prefix: prefix, suffix: suffix }, input));
|
|
50
|
+
return (react_1.default.createElement(with_addons_1.WithAddons, { _modifierClass: _modifierClass, disabled: disabled, icon: icon, margin: margin, mini: mini, prefix: prefix, suffix: suffix }, input));
|
|
50
51
|
}
|
|
51
52
|
return input;
|
|
52
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_input.js","sourceRoot":"","sources":["../../../src/components/common_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AACzD,8DAA2D;AAE3D,6CAA2C;
|
|
1
|
+
{"version":3,"file":"common_input.js","sourceRoot":"","sources":["../../../src/components/common_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AACzD,8DAA2D;AAE3D,6CAA2C;AAqC3C,SAAgB,WAAW,CAAC,EAoCT;;IAnCjB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,EAAE,QAAA,EACF,OAAO,aAAA,EACP,MAAM,YAAA,EACN,GAAG,SAAA,EACH,SAAS,eAAA,EACT,GAAG,SAAA,EACH,IAAI,UAAA,EACJ,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,SAAS,eAAA,EACT,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,KAAK,WAAA,EACF,IAAI,cAnCmB,kZAoC3B,CADQ;IAEP,IAAM,OAAO,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC;IAE/C,IAAM,UAAU,GAAG,IAAA,qBAAU,EAAC,OAAO;QACnC,GAAC,IAAA,iCAAc,EAAC,MAAM,CAAC,IAAG,CAAC,OAAO;QAClC,GAAC,cAAc,IAAG,cAAc,IAAI,CAAC,OAAO;QAC5C,oBAAgB,GAAE,OAAO;QACzB,iBAAa,GAAE,IAAI;QACnB,sBAAkB,GAAE,CAAC,CAAC,IAAI;YAC1B,CAAC;IAEH,IAAM,KAAK,GAAG,CACZ,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,wBACT,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,mBAChB,YAAY,EAC3B,YAAY,EAAE,YAAY;QAC1B,iDAAiD;QACjD,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAA,kBAAU,EAAC,KAAK,EAAE,QAAQ,CAAC,IAClC,CACH,CAAC;IAEF,IAAI,OAAO,EAAE;QACX,OAAO,CACL,8BAAC,wBAAU,IACT,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,IAEb,KAAK,CACK,CACd,CAAC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAnGD,kCAmGC"}
|
|
@@ -2,9 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import type { CommonComponentProps } from '../types';
|
|
3
3
|
interface InputGroupItemProps extends CommonComponentProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
+
icon?: React.JSX.Element;
|
|
5
6
|
id?: string;
|
|
6
7
|
grow?: '0' | '1' | '2' | '3';
|
|
7
8
|
shrink?: '0' | '1' | '2' | '3';
|
|
9
|
+
standalone?: boolean;
|
|
8
10
|
}
|
|
9
|
-
export declare function InputGroupItem({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, id, grow, shrink, ...rest }: InputGroupItemProps): React.JSX.Element;
|
|
11
|
+
export declare function InputGroupItem({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, icon, id, grow, shrink, standalone, ...rest }: InputGroupItemProps): React.JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -29,14 +29,20 @@ exports.InputGroupItem = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
|
+
var types_1 = require("../utils/types");
|
|
32
33
|
function InputGroupItem(_a) {
|
|
33
34
|
var _b;
|
|
34
|
-
var ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, id = _a.id, grow = _a.grow, shrink = _a.shrink, rest = __rest(_a, ['aria-label', 'aria-labelledby', 'aria-describedby', "children", "id", "grow", "shrink"]);
|
|
35
|
+
var ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, icon = _a.icon, id = _a.id, grow = _a.grow, shrink = _a.shrink, standalone = _a.standalone, rest = __rest(_a, ['aria-label', 'aria-labelledby', 'aria-describedby', "children", "icon", "id", "grow", "shrink", "standalone"]);
|
|
36
|
+
var hasIcon = (0, types_1.isPresent)(icon);
|
|
35
37
|
var className = (0, class_names_1.default)('Input-Group__Item', (_b = {},
|
|
36
38
|
_b["flex-grow--".concat(grow)] = grow !== undefined,
|
|
37
39
|
_b["flex-shrink--".concat(shrink)] = shrink !== undefined,
|
|
40
|
+
_b['position--r'] = !!icon,
|
|
41
|
+
_b['Input-Group__Item--standalone'] = standalone,
|
|
38
42
|
_b));
|
|
39
|
-
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: className, id: id }),
|
|
43
|
+
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: className, id: id }),
|
|
44
|
+
children,
|
|
45
|
+
hasIcon && (react_1.default.createElement("span", { className: "Input-Group__Icon", "aria-hidden": "true" }, icon))));
|
|
40
46
|
}
|
|
41
47
|
exports.InputGroupItem = InputGroupItem;
|
|
42
48
|
//# sourceMappingURL=input_group_item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input_group_item.js","sourceRoot":"","sources":["../../../src/components/input_group_item.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAI1B,qEAA8C;AAC9C,6EAAyD;
|
|
1
|
+
{"version":3,"file":"input_group_item.js","sourceRoot":"","sources":["../../../src/components/input_group_item.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAI1B,qEAA8C;AAC9C,6EAAyD;AACzD,wCAA2C;AAW3C,SAAgB,cAAc,CAAC,EAWT;;IAVpB,IAAc,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,UAAU,gBAAA,EACP,IAAI,cAVsB,+GAW9B,CADQ;IAEP,IAAM,OAAO,GAAG,IAAA,iBAAS,EAAC,IAAI,CAAC,CAAC;IAEhC,IAAM,SAAS,GAAG,IAAA,qBAAU,EAAC,mBAAmB;QAC9C,GAAC,qBAAc,IAAI,CAAE,IAAG,IAAI,KAAK,SAAS;QAC1C,GAAC,uBAAgB,MAAM,CAAE,IAAG,MAAM,KAAK,SAAS;QAChD,iBAAa,GAAE,CAAC,CAAC,IAAI;QACrB,mCAA+B,GAAE,UAAU;YAC3C,CAAC;IAEH,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE;QAEL,QAAQ;QACR,OAAO,IAAI,CACV,wCAAM,SAAS,EAAC,mBAAmB,iBAAa,MAAM,IACnD,IAAI,CACA,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAtCD,wCAsCC"}
|
|
@@ -9,6 +9,7 @@ interface SearchInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
9
9
|
defaultValue?: number | string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
getRef?: GetRef<HTMLInputElement>;
|
|
12
|
+
icon?: React.JSX.Element;
|
|
12
13
|
id?: string;
|
|
13
14
|
invalid?: boolean;
|
|
14
15
|
mini?: boolean;
|
|
@@ -19,10 +20,12 @@ interface SearchInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
19
20
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
20
21
|
onPaste?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
21
22
|
placeholder?: string;
|
|
23
|
+
prefix?: React.ReactNode;
|
|
22
24
|
readOnly?: boolean;
|
|
23
25
|
required?: boolean;
|
|
26
|
+
suffix?: React.ReactNode;
|
|
24
27
|
tabIndex?: number;
|
|
25
28
|
value?: string;
|
|
26
29
|
}
|
|
27
|
-
export declare function SearchInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, margin, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, readOnly, required, tabIndex, value, ...rest }: SearchInputProps): React.JSX.Element;
|
|
30
|
+
export declare function SearchInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, icon, id, invalid, margin, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, tabIndex, value, ...rest }: SearchInputProps): React.JSX.Element;
|
|
28
31
|
export {};
|
|
@@ -30,8 +30,8 @@ var react_1 = __importDefault(require("react"));
|
|
|
30
30
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
31
31
|
var common_input_1 = require("./common_input");
|
|
32
32
|
function SearchInput(_a) {
|
|
33
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, margin = _a.margin, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, _b = _a.placeholder, placeholder = _b === void 0 ? 'Search' : _b, readOnly = _a.readOnly, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "margin", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "readOnly", "required", "tabIndex", "value"]);
|
|
34
|
-
return (react_1.default.createElement(common_input_1.CommonInput, __assign({}, (0, data_attributes_1.default)(rest), { _modifierClass: _modifierClass, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, id: id, invalid: invalid, margin: margin, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, readOnly: readOnly, required: required, tabIndex: tabIndex, type: "search", value: value })));
|
|
33
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, icon = _a.icon, id = _a.id, invalid = _a.invalid, margin = _a.margin, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, _b = _a.placeholder, placeholder = _b === void 0 ? 'Search' : _b, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "icon", "id", "invalid", "margin", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "tabIndex", "value"]);
|
|
34
|
+
return (react_1.default.createElement(common_input_1.CommonInput, __assign({}, (0, data_attributes_1.default)(rest), { _modifierClass: _modifierClass, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, icon: icon, id: id, invalid: invalid, margin: margin, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, prefix: prefix, readOnly: readOnly, required: required, suffix: suffix, tabIndex: tabIndex, type: "search", value: value })));
|
|
35
35
|
}
|
|
36
36
|
exports.SearchInput = SearchInput;
|
|
37
37
|
//# sourceMappingURL=search_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search_input.js","sourceRoot":"","sources":["../../../src/components/search_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,6EAAyD;AAEzD,+CAA6C;
|
|
1
|
+
{"version":3,"file":"search_input.js","sourceRoot":"","sources":["../../../src/components/search_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,6EAAyD;AAEzD,+CAA6C;AAgC7C,SAAgB,WAAW,CAAC,EA+BT;IA9BjB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,EAAE,QAAA,EACF,OAAO,aAAA,EACP,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,SAAS,eAAA,EACT,OAAO,aAAA,EACP,mBAAsB,EAAtB,WAAW,mBAAG,QAAQ,KAAA,EACtB,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,KAAK,WAAA,EACF,IAAI,cA9BmB,uWA+B3B,CADQ;IAEP,OAAO,CACL,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,cAAc,EAAE,cAAc,sBACZ,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,mBAChB,YAAY,EAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,IACZ,CACH,CAAC;AACJ,CAAC;AAnED,kCAmEC"}
|
|
@@ -9,6 +9,7 @@ interface TextInputProps extends CommonComponentProps, MarginModifierProp, Modif
|
|
|
9
9
|
defaultValue?: number | string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
getRef?: GetRef<HTMLInputElement>;
|
|
12
|
+
icon?: React.JSX.Element;
|
|
12
13
|
id?: string;
|
|
13
14
|
invalid?: boolean;
|
|
14
15
|
maxLength?: number;
|
|
@@ -27,5 +28,5 @@ interface TextInputProps extends CommonComponentProps, MarginModifierProp, Modif
|
|
|
27
28
|
tabIndex?: number;
|
|
28
29
|
value?: number | string;
|
|
29
30
|
}
|
|
30
|
-
export declare function TextInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, margin, maxLength, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, tabIndex, value, ...rest }: TextInputProps): React.JSX.Element;
|
|
31
|
+
export declare function TextInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, icon, id, invalid, margin, maxLength, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, tabIndex, value, ...rest }: TextInputProps): React.JSX.Element;
|
|
31
32
|
export {};
|
|
@@ -30,8 +30,8 @@ var react_1 = __importDefault(require("react"));
|
|
|
30
30
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
31
31
|
var common_input_1 = require("./common_input");
|
|
32
32
|
function TextInput(_a) {
|
|
33
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, margin = _a.margin, maxLength = _a.maxLength, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "margin", "maxLength", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "tabIndex", "value"]);
|
|
34
|
-
return (react_1.default.createElement(common_input_1.CommonInput, __assign({}, (0, data_attributes_1.default)(rest), { _modifierClass: _modifierClass, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, id: id, invalid: invalid, margin: margin, maxLength: maxLength, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, prefix: prefix, readOnly: readOnly, required: required, suffix: suffix, tabIndex: tabIndex, type: "text", value: value })));
|
|
33
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, icon = _a.icon, id = _a.id, invalid = _a.invalid, margin = _a.margin, maxLength = _a.maxLength, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "icon", "id", "invalid", "margin", "maxLength", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "tabIndex", "value"]);
|
|
34
|
+
return (react_1.default.createElement(common_input_1.CommonInput, __assign({}, (0, data_attributes_1.default)(rest), { _modifierClass: _modifierClass, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, icon: icon, id: id, invalid: invalid, margin: margin, maxLength: maxLength, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, prefix: prefix, readOnly: readOnly, required: required, suffix: suffix, tabIndex: tabIndex, type: "text", value: value })));
|
|
35
35
|
}
|
|
36
36
|
exports.TextInput = TextInput;
|
|
37
37
|
//# sourceMappingURL=text_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text_input.js","sourceRoot":"","sources":["../../../src/components/text_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,6EAAyD;AAEzD,+CAA6C;
|
|
1
|
+
{"version":3,"file":"text_input.js","sourceRoot":"","sources":["../../../src/components/text_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,6EAAyD;AAEzD,+CAA6C;AAiC7C,SAAgB,SAAS,CAAC,EAgCT;IA/Bf,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,EAAE,QAAA,EACF,OAAO,aAAA,EACP,MAAM,YAAA,EACN,SAAS,eAAA,EACT,IAAI,UAAA,EACJ,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,SAAS,eAAA,EACT,OAAO,aAAA,EACP,WAAW,iBAAA,EACX,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,KAAK,WAAA,EACF,IAAI,cA/BiB,oXAgCzB,CADQ;IAEP,OAAO,CACL,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,cAAc,EAAE,cAAc,sBACZ,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,mBAChB,YAAY,EAC3B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,IACZ,CACH,CAAC;AACJ,CAAC;AArED,8BAqEC"}
|
|
@@ -3,9 +3,10 @@ import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from
|
|
|
3
3
|
interface WithAddonsProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
icon?: React.JSX.Element;
|
|
6
7
|
mini?: boolean;
|
|
7
8
|
prefix?: React.ReactNode;
|
|
8
9
|
suffix?: React.ReactNode;
|
|
9
10
|
}
|
|
10
|
-
export declare function WithAddons({ _modifierClass, children, disabled, margin, mini, prefix, suffix }: WithAddonsProps): React.JSX.Element;
|
|
11
|
+
export declare function WithAddons({ _modifierClass, children, disabled, icon, margin, mini, prefix, suffix }: WithAddonsProps): React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -10,7 +10,7 @@ var input_addon_1 = require("./input_addon");
|
|
|
10
10
|
var input_group_1 = require("./input_group");
|
|
11
11
|
var input_group_item_1 = require("./input_group_item");
|
|
12
12
|
function WithAddons(_a) {
|
|
13
|
-
var _modifierClass = _a._modifierClass, children = _a.children, disabled = _a.disabled, margin = _a.margin, mini = _a.mini, prefix = _a.prefix, suffix = _a.suffix;
|
|
13
|
+
var _modifierClass = _a._modifierClass, children = _a.children, disabled = _a.disabled, icon = _a.icon, margin = _a.margin, mini = _a.mini, prefix = _a.prefix, suffix = _a.suffix;
|
|
14
14
|
var hasPrefix = (0, types_1.isPresent)(prefix);
|
|
15
15
|
var hasSuffix = (0, types_1.isPresent)(suffix);
|
|
16
16
|
function renderAddon(type) {
|
|
@@ -21,7 +21,7 @@ function WithAddons(_a) {
|
|
|
21
21
|
}
|
|
22
22
|
return (react_1.default.createElement(input_group_1.InputGroup, { margin: margin, _modifierClass: _modifierClass },
|
|
23
23
|
hasPrefix && renderAddon('prefix'),
|
|
24
|
-
react_1.default.createElement(input_group_item_1.InputGroupItem, { grow: "1" }, children),
|
|
24
|
+
react_1.default.createElement(input_group_item_1.InputGroupItem, { standalone: !hasPrefix && !hasSuffix, icon: icon, grow: "1" }, children),
|
|
25
25
|
hasSuffix && renderAddon('suffix')));
|
|
26
26
|
}
|
|
27
27
|
exports.WithAddons = WithAddons;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with_addons.js","sourceRoot":"","sources":["../../../src/components/with_addons.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAQ1B,wCAA2C;AAE3C,6CAA2C;AAC3C,6CAA2C;AAC3C,uDAAoD;
|
|
1
|
+
{"version":3,"file":"with_addons.js","sourceRoot":"","sources":["../../../src/components/with_addons.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAA0B;AAQ1B,wCAA2C;AAE3C,6CAA2C;AAC3C,6CAA2C;AAC3C,uDAAoD;AAcpD,SAAgB,UAAU,CAAC,EAST;QARhB,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,MAAM,YAAA,EACN,MAAM,YAAA;IAEN,IAAM,SAAS,GAAG,IAAA,iBAAS,EAAC,MAAM,CAAC,CAAC;IACpC,IAAM,SAAS,GAAG,IAAA,iBAAS,EAAC,MAAM,CAAC,CAAC;IAEpC,SAAS,WAAW,CAAC,IAAyB;QAC5C,IAAM,YAAY,GAAG,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,CAAC;QACxC,IAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAEvC,OAAO,CACL,8BAAC,iCAAc;YACb,8BAAC,wBAAU,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,IACvC,WAAW,CACD,CACE,CAClB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,8BAAC,wBAAU,IAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc;QACvD,SAAS,IAAI,WAAW,CAAC,QAAQ,CAAC;QACnC,8BAAC,iCAAc,IACb,UAAU,EAAE,CAAC,SAAS,IAAI,CAAC,SAAS,EACpC,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,GAAG,IAEP,QAAQ,CACM;QAChB,SAAS,IAAI,WAAW,CAAC,QAAQ,CAAC,CACxB,CACd,CAAC;AACJ,CAAC;AAvCD,gCAuCC"}
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -16,6 +16,18 @@ export type MarginModifierProp = {
|
|
|
16
16
|
left?: Margin;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
export type Padding = Spacing | 'auto';
|
|
20
|
+
export type PaddingModifierProp = {
|
|
21
|
+
padding?: Padding | {
|
|
22
|
+
all?: Padding;
|
|
23
|
+
horizontal?: Padding;
|
|
24
|
+
vertical?: Padding;
|
|
25
|
+
top?: Padding;
|
|
26
|
+
right?: Padding;
|
|
27
|
+
bottom?: Padding;
|
|
28
|
+
left?: Padding;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
19
31
|
export interface ModifierClassProp {
|
|
20
32
|
_modifierClass?: string;
|
|
21
33
|
}
|
package/lib/cjs/utils/dom.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type StyleProperty = keyof RemoveIndexSignature<Omit<CSSStyleDeclaration, 'paren
|
|
|
6
6
|
export declare function formatPx(value: number): string;
|
|
7
7
|
export declare function getClientRect(element: Element): DOMRect;
|
|
8
8
|
export declare function getElementPropertyValue(element: Element, property: StyleProperty): string | number;
|
|
9
|
-
export declare function getElementPropertyValues(element: Element, ...properties: StyleProperty[]): Record<"marker" | "margin" | "padding" | "all" | "top" | "right" | "bottom" | "left" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignmentBaseline" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "baselineShift" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "clip" | "clipPath" | "clipRule" | "
|
|
9
|
+
export declare function getElementPropertyValues(element: Element, ...properties: StyleProperty[]): Record<"marker" | "margin" | "padding" | "all" | "top" | "right" | "bottom" | "left" | "color" | "display" | "width" | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignmentBaseline" | "animation" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "background" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "baselineShift" | "blockSize" | "border" | "borderBlock" | "borderBlockColor" | "borderBlockEnd" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStart" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBlockStyle" | "borderBlockWidth" | "borderBottom" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderColor" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImage" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInline" | "borderInlineColor" | "borderInlineEnd" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStart" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderInlineStyle" | "borderInlineWidth" | "borderLeft" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRadius" | "borderRight" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderStyle" | "borderTop" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "borderWidth" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "clear" | "clip" | "clipPath" | "clipRule" | "colorInterpolation" | "colorInterpolationFilters" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRule" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "columns" | "contain" | "container" | "containerName" | "containerType" | "content" | "counterIncrement" | "counterReset" | "counterSet" | "cssFloat" | "cssText" | "cursor" | "direction" | "dominantBaseline" | "emptyCells" | "fill" | "fillOpacity" | "fillRule" | "filter" | "flex" | "flexBasis" | "flexDirection" | "flexFlow" | "flexGrow" | "flexShrink" | "flexWrap" | "float" | "floodColor" | "floodOpacity" | "font" | "fontFamily" | "fontFeatureSettings" | "fontKerning" | "fontOpticalSizing" | "fontPalette" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontVariationSettings" | "fontWeight" | "gap" | "grid" | "gridArea" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumn" | "gridColumnEnd" | "gridColumnGap" | "gridColumnStart" | "gridGap" | "gridRow" | "gridRowEnd" | "gridRowGap" | "gridRowStart" | "gridTemplate" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "inlineSize" | "inset" | "insetBlock" | "insetBlockEnd" | "insetBlockStart" | "insetInline" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lightingColor" | "lineBreak" | "lineHeight" | "listStyle" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlock" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInline" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "markerEnd" | "markerMid" | "markerStart" | "mask" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offset" | "offsetDistance" | "offsetPath" | "offsetRotate" | "opacity" | "order" | "orphans" | "outline" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowClipMargin" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlock" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInline" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "placeContent" | "placeItems" | "placeSelf" | "pointerEvents" | "position" | "printColorAdjust" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyPosition" | "scale" | "scrollBehavior" | "scrollMargin" | "scrollMarginBlock" | "scrollMarginBlockEnd" | "scrollMarginBlockStart" | "scrollMarginBottom" | "scrollMarginInline" | "scrollMarginInlineEnd" | "scrollMarginInlineStart" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPadding" | "scrollPaddingBlock" | "scrollPaddingBlockEnd" | "scrollPaddingBlockStart" | "scrollPaddingBottom" | "scrollPaddingInline" | "scrollPaddingInlineEnd" | "scrollPaddingInlineStart" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollbarGutter" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textAnchor" | "textCombineUpright" | "textDecoration" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasis" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transition" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "webkitAlignContent" | "webkitAlignItems" | "webkitAlignSelf" | "webkitAnimation" | "webkitAnimationDelay" | "webkitAnimationDirection" | "webkitAnimationDuration" | "webkitAnimationFillMode" | "webkitAnimationIterationCount" | "webkitAnimationName" | "webkitAnimationPlayState" | "webkitAnimationTimingFunction" | "webkitAppearance" | "webkitBackfaceVisibility" | "webkitBackgroundClip" | "webkitBackgroundOrigin" | "webkitBackgroundSize" | "webkitBorderBottomLeftRadius" | "webkitBorderBottomRightRadius" | "webkitBorderRadius" | "webkitBorderTopLeftRadius" | "webkitBorderTopRightRadius" | "webkitBoxAlign" | "webkitBoxFlex" | "webkitBoxOrdinalGroup" | "webkitBoxOrient" | "webkitBoxPack" | "webkitBoxShadow" | "webkitBoxSizing" | "webkitFilter" | "webkitFlex" | "webkitFlexBasis" | "webkitFlexDirection" | "webkitFlexFlow" | "webkitFlexGrow" | "webkitFlexShrink" | "webkitFlexWrap" | "webkitJustifyContent" | "webkitLineClamp" | "webkitMask" | "webkitMaskBoxImage" | "webkitMaskBoxImageOutset" | "webkitMaskBoxImageRepeat" | "webkitMaskBoxImageSlice" | "webkitMaskBoxImageSource" | "webkitMaskBoxImageWidth" | "webkitMaskClip" | "webkitMaskComposite" | "webkitMaskImage" | "webkitMaskOrigin" | "webkitMaskPosition" | "webkitMaskRepeat" | "webkitMaskSize" | "webkitOrder" | "webkitPerspective" | "webkitPerspectiveOrigin" | "webkitTextFillColor" | "webkitTextSizeAdjust" | "webkitTextStroke" | "webkitTextStrokeColor" | "webkitTextStrokeWidth" | "webkitTransform" | "webkitTransformOrigin" | "webkitTransformStyle" | "webkitTransition" | "webkitTransitionDelay" | "webkitTransitionDuration" | "webkitTransitionProperty" | "webkitTransitionTimingFunction" | "webkitUserSelect" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex", string | number>;
|
|
10
10
|
export declare function getActiveElement(): Element;
|
|
11
11
|
export declare function getTabbableElements(rootElement: Element): Element[];
|
|
12
12
|
export declare function calculateVerticalMargin(element: Element): number;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
2
|
+
import type { Colors, CommonComponentProps, Dimensions, MarginModifierProp, ModifierClassProp, PaddingModifierProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
-
interface ButtonPlainProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
4
|
+
interface ButtonPlainProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp, PaddingModifierProp {
|
|
5
5
|
'aria-controls'?: string;
|
|
6
6
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
+
color?: Colors;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
display?: 'block' | 'inline-block';
|
|
9
11
|
getRef?: GetRef<HTMLButtonElement>;
|
|
12
|
+
hoverColor?: Colors;
|
|
10
13
|
id?: string;
|
|
11
14
|
name?: string;
|
|
12
15
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
16
|
title?: string;
|
|
17
|
+
truncate?: boolean;
|
|
14
18
|
type?: 'button' | 'submit';
|
|
19
|
+
underlined?: boolean;
|
|
20
|
+
width?: Dimensions;
|
|
15
21
|
}
|
|
16
|
-
export declare function ButtonPlain({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, margin, name, onClick, title, type, ...rest }: ButtonPlainProps): React.JSX.Element;
|
|
22
|
+
export declare function ButtonPlain({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, color, disabled, display, getRef, hoverColor, id, margin, name, onClick, padding, title, truncate, type, underlined, width, ...rest }: ButtonPlainProps): React.JSX.Element;
|
|
17
23
|
export {};
|
|
@@ -20,13 +20,34 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React from 'react';
|
|
23
|
+
import React, { useMemo, useState } from 'react';
|
|
24
24
|
import classNames from '../utils/class_names';
|
|
25
25
|
import getDataAttributes from '../utils/data_attributes';
|
|
26
|
-
import {
|
|
26
|
+
import { getDimensionClass, getSpacingClass } from '../utils/modifier_classes';
|
|
27
27
|
export function ButtonPlain(_a) {
|
|
28
|
-
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, title = _a.title,
|
|
29
|
-
|
|
28
|
+
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, color = _a.color, disabled = _a.disabled, _b = _a.display, display = _b === void 0 ? 'inline-block' : _b, getRef = _a.getRef, hoverColor = _a.hoverColor, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, padding = _a.padding, title = _a.title, _c = _a.truncate, truncate = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'button' : _d, underlined = _a.underlined, width = _a.width, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "color", "disabled", "display", "getRef", "hoverColor", "id", "margin", "name", "onClick", "padding", "title", "truncate", "type", "underlined", "width"]);
|
|
29
|
+
var _e = useState(false), hovered = _e[0], setHovered = _e[1];
|
|
30
|
+
var colorClass = useMemo(function () {
|
|
31
|
+
var colorEnum = color;
|
|
32
|
+
if (hovered && hoverColor && !disabled) {
|
|
33
|
+
colorEnum = hoverColor;
|
|
34
|
+
}
|
|
35
|
+
return colorEnum && "color--".concat(colorEnum);
|
|
36
|
+
}, [hovered, color, hoverColor]);
|
|
37
|
+
var classes = classNames('Button--plain', _modifierClass, colorClass, getDimensionClass('width', width), getSpacingClass('margin', margin), getSpacingClass('padding', padding), {
|
|
38
|
+
'text-decoration--underline': underlined,
|
|
39
|
+
'display--b': display === 'block',
|
|
40
|
+
truncate: truncate
|
|
41
|
+
});
|
|
42
|
+
return (React.createElement("button", __assign({}, getDataAttributes(rest), { "aria-controls": ariaControls, "aria-describedby": ariaDescribedby, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className: classes, disabled: disabled, id: id, name: name, onBlur: function () {
|
|
43
|
+
setHovered(false);
|
|
44
|
+
}, onClick: onClick, onFocus: function () {
|
|
45
|
+
setHovered(true);
|
|
46
|
+
}, onMouseEnter: function () {
|
|
47
|
+
setHovered(true);
|
|
48
|
+
}, onMouseLeave: function () {
|
|
49
|
+
setHovered(false);
|
|
50
|
+
}, ref: getRef, title: title,
|
|
30
51
|
// eslint-disable-next-line react/button-has-type
|
|
31
52
|
type: type }), children));
|
|
32
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button_plain.js","sourceRoot":"","sources":["../../../src/components/button_plain.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button_plain.js","sourceRoot":"","sources":["../../../src/components/button_plain.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAYjD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAyB/E,MAAM,UAAU,WAAW,CAAC,EAwBT;IAvBjB,IAAA,cAAc,oBAAA,EACG,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,eAAwB,EAAxB,OAAO,mBAAG,cAAc,KAAA,EACxB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,OAAO,aAAA,EACP,KAAK,WAAA,EACL,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,YAAe,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,UAAU,gBAAA,EACV,KAAK,WAAA,EACF,IAAI,cAvBmB,+QAwB3B,CADQ;IAED,IAAA,KAAwB,QAAQ,CAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAC;IAE9C,IAAM,UAAU,GAAG,OAAO,CAAC;QACzB,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAI,OAAO,IAAI,UAAU,IAAI,CAAC,QAAQ,EAAE;YACtC,SAAS,GAAG,UAAU,CAAC;SACxB;QAED,OAAO,SAAS,IAAI,iBAAU,SAAS,CAAE,CAAC;IAC5C,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;IAEjC,IAAM,OAAO,GAAG,UAAU,CACxB,eAAe,EACf,cAAc,EACd,UAAU,EACV,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,EACjC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,EACjC,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,EACnC;QACE,4BAA4B,EAAE,UAAU;QACxC,YAAY,EAAE,OAAO,KAAK,OAAO;QACjC,QAAQ,UAAA;KACT,CACF,CAAC;IAEF,OAAO,CACL,2CACM,iBAAiB,CAAC,IAAI,CAAC,qBACZ,YAAY,sBACT,eAAe,mBAClB,YAAY,gBACf,SAAS,qBACJ,cAAc,EAC/B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,MAAM,EAAE;YACN,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;YACP,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EACD,YAAY,EAAE;YACZ,UAAU,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,EACD,YAAY,EAAE;YACZ,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,EACD,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK;QACZ,iDAAiD;QACjD,IAAI,EAAE,IAAI,KAET,QAAQ,CACF,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -9,6 +9,7 @@ interface CommonInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
9
9
|
defaultValue?: number | string;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
getRef?: GetRef<HTMLInputElement>;
|
|
12
|
+
icon?: React.JSX.Element;
|
|
12
13
|
id?: string;
|
|
13
14
|
invalid?: boolean;
|
|
14
15
|
max?: number | string;
|
|
@@ -31,5 +32,5 @@ interface CommonInputProps extends CommonComponentProps, MarginModifierProp, Mod
|
|
|
31
32
|
type?: string;
|
|
32
33
|
value?: number | string;
|
|
33
34
|
}
|
|
34
|
-
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, margin, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
35
|
+
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, icon, id, invalid, margin, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
35
36
|
export {};
|
|
@@ -28,19 +28,20 @@ import { getMarginClass } from '../utils/modifier_classes';
|
|
|
28
28
|
import { WithAddons } from './with_addons';
|
|
29
29
|
export function CommonInput(_a) {
|
|
30
30
|
var _b;
|
|
31
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, margin = _a.margin, max = _a.max, maxLength = _a.maxLength, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, step = _a.step, tabIndex = _a.tabIndex, type = _a.type, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "margin", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "step", "tabIndex", "type", "value"]);
|
|
32
|
-
var affixed = !!prefix || !!suffix;
|
|
31
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, icon = _a.icon, id = _a.id, invalid = _a.invalid, margin = _a.margin, max = _a.max, maxLength = _a.maxLength, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, prefix = _a.prefix, readOnly = _a.readOnly, required = _a.required, suffix = _a.suffix, step = _a.step, tabIndex = _a.tabIndex, type = _a.type, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "icon", "id", "invalid", "margin", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "step", "tabIndex", "type", "value"]);
|
|
32
|
+
var affixed = !!prefix || !!suffix || !!icon;
|
|
33
33
|
var inputClass = classNames('Input', (_b = {},
|
|
34
34
|
_b[getMarginClass(margin)] = !affixed,
|
|
35
35
|
_b[_modifierClass] = _modifierClass && !affixed,
|
|
36
36
|
_b['Input--invalid'] = invalid,
|
|
37
37
|
_b['Input--mini'] = mini,
|
|
38
|
+
_b['Input--with-icon'] = !!icon,
|
|
38
39
|
_b));
|
|
39
40
|
var input = (React.createElement("input", __assign({}, getDataAttributes(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete,
|
|
40
41
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
41
42
|
autoFocus: autoFocus, className: inputClass, defaultValue: defaultValue, disabled: disabled, id: id, max: max, maxLength: maxLength, min: min, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, readOnly: readOnly, required: required, ref: getRef, step: step, tabIndex: tabIndex, type: type, value: inputValue(value, onChange) })));
|
|
42
43
|
if (affixed) {
|
|
43
|
-
return (React.createElement(WithAddons, { _modifierClass: _modifierClass, disabled: disabled, margin: margin, mini: mini, prefix: prefix, suffix: suffix }, input));
|
|
44
|
+
return (React.createElement(WithAddons, { _modifierClass: _modifierClass, disabled: disabled, icon: icon, margin: margin, mini: mini, prefix: prefix, suffix: suffix }, input));
|
|
44
45
|
}
|
|
45
46
|
return input;
|
|
46
47
|
}
|