@dscout/particle 1.0.0-alpha.18 → 1.0.0-alpha.19
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/advanced_options.js +27 -6
- package/lib/cjs/components/advanced_options.js.map +1 -1
- package/lib/cjs/components/attribute_input.d.ts +2 -1
- package/lib/cjs/components/attribute_input.js +4 -11
- package/lib/cjs/components/attribute_input.js.map +1 -1
- package/lib/cjs/components/attribute_selector.d.ts +3 -0
- package/lib/cjs/components/attribute_selector.js +1 -1
- package/lib/cjs/components/attribute_selector.js.map +1 -1
- package/lib/cjs/components/button.d.ts +2 -1
- package/lib/cjs/components/button.js +2 -2
- package/lib/cjs/components/button.js.map +1 -1
- package/lib/cjs/components/checkbox_input.d.ts +2 -1
- package/lib/cjs/components/checkbox_input.js +4 -3
- package/lib/cjs/components/checkbox_input.js.map +1 -1
- package/lib/cjs/components/collapsible.d.ts +3 -2
- package/lib/cjs/components/collapsible.js.map +1 -1
- package/lib/cjs/components/collapsing_menu.js +5 -6
- package/lib/cjs/components/collapsing_menu.js.map +1 -1
- package/lib/cjs/components/common_button.d.ts +2 -1
- package/lib/cjs/components/common_button.js +2 -2
- package/lib/cjs/components/common_button.js.map +1 -1
- package/lib/cjs/components/common_input.d.ts +3 -1
- package/lib/cjs/components/common_input.js +3 -4
- package/lib/cjs/components/common_input.js.map +1 -1
- package/lib/cjs/components/date_input.d.ts +6 -1
- package/lib/cjs/components/date_input.js +2 -2
- package/lib/cjs/components/date_input.js.map +1 -1
- package/lib/cjs/components/drag_and_drop.js +2 -2
- package/lib/cjs/components/drag_and_drop.js.map +1 -1
- package/lib/cjs/components/email_input.d.ts +3 -1
- package/lib/cjs/components/email_input.js +2 -2
- package/lib/cjs/components/email_input.js.map +1 -1
- package/lib/cjs/components/file_input.js +5 -5
- package/lib/cjs/components/file_input.js.map +1 -1
- package/lib/cjs/components/input_addon.d.ts +1 -2
- package/lib/cjs/components/input_addon.js +1 -2
- package/lib/cjs/components/input_addon.js.map +1 -1
- package/lib/cjs/components/media_query.d.ts +1 -1
- package/lib/cjs/components/modal.js +1 -3
- package/lib/cjs/components/modal.js.map +1 -1
- package/lib/cjs/components/number_input.d.ts +3 -1
- package/lib/cjs/components/number_input.js +2 -2
- package/lib/cjs/components/number_input.js.map +1 -1
- package/lib/cjs/components/password_input.d.ts +3 -1
- package/lib/cjs/components/password_input.js +2 -2
- package/lib/cjs/components/password_input.js.map +1 -1
- package/lib/cjs/components/radio_input.d.ts +2 -1
- package/lib/cjs/components/radio_input.js +4 -3
- package/lib/cjs/components/radio_input.js.map +1 -1
- package/lib/cjs/components/range_input.d.ts +2 -1
- package/lib/cjs/components/range_input.js +2 -2
- package/lib/cjs/components/range_input.js.map +1 -1
- package/lib/cjs/components/search_input.d.ts +3 -1
- package/lib/cjs/components/search_input.js +2 -2
- package/lib/cjs/components/search_input.js.map +1 -1
- package/lib/cjs/components/select_input.d.ts +3 -2
- package/lib/cjs/components/select_input.js +64 -4
- package/lib/cjs/components/select_input.js.map +1 -1
- package/lib/cjs/components/shared_hooks.d.ts +1 -0
- package/lib/cjs/components/shared_hooks.js +6 -1
- package/lib/cjs/components/shared_hooks.js.map +1 -1
- package/lib/cjs/components/tags_input.js +0 -1
- package/lib/cjs/components/tags_input.js.map +1 -1
- package/lib/cjs/components/text_input.d.ts +3 -1
- package/lib/cjs/components/text_input.js +2 -2
- package/lib/cjs/components/text_input.js.map +1 -1
- package/lib/cjs/components/textarea.d.ts +2 -1
- package/lib/cjs/components/textarea.js +2 -3
- package/lib/cjs/components/textarea.js.map +1 -1
- package/lib/cjs/components/togglable_fieldset.js +2 -2
- package/lib/cjs/components/togglable_fieldset.js.map +1 -1
- package/lib/cjs/components/toggle.d.ts +2 -1
- package/lib/cjs/components/toggle.js +2 -4
- package/lib/cjs/components/toggle.js.map +1 -1
- package/lib/cjs/components/tooltip_container.js.map +1 -1
- package/lib/cjs/components/with_addons.d.ts +1 -2
- package/lib/cjs/components/with_addons.js +2 -2
- package/lib/cjs/components/with_addons.js.map +1 -1
- package/lib/cjs/utils/animation.d.ts +1 -1
- package/lib/cjs/utils/animation.js +0 -1
- package/lib/cjs/utils/animation.js.map +1 -1
- package/lib/cjs/utils/dom.d.ts +1 -1
- package/lib/cjs/utils/forms.d.ts +0 -2
- package/lib/cjs/utils/forms.js +1 -11
- package/lib/cjs/utils/forms.js.map +1 -1
- package/lib/cjs/utils/markscout.js.map +1 -1
- package/lib/cjs/utils/refs.d.ts +1 -1
- package/lib/cjs/utils/refs.js.map +1 -1
- package/lib/esm/components/advanced_options.js +4 -6
- package/lib/esm/components/advanced_options.js.map +1 -1
- package/lib/esm/components/attribute_input.d.ts +2 -1
- package/lib/esm/components/attribute_input.js +4 -11
- package/lib/esm/components/attribute_input.js.map +1 -1
- package/lib/esm/components/attribute_selector.d.ts +3 -0
- package/lib/esm/components/attribute_selector.js +1 -1
- package/lib/esm/components/attribute_selector.js.map +1 -1
- package/lib/esm/components/button.d.ts +2 -1
- package/lib/esm/components/button.js +2 -2
- package/lib/esm/components/button.js.map +1 -1
- package/lib/esm/components/checkbox_input.d.ts +2 -1
- package/lib/esm/components/checkbox_input.js +5 -4
- package/lib/esm/components/checkbox_input.js.map +1 -1
- package/lib/esm/components/collapsible.d.ts +3 -2
- package/lib/esm/components/collapsible.js.map +1 -1
- package/lib/esm/components/collapsing_menu.js +5 -6
- package/lib/esm/components/collapsing_menu.js.map +1 -1
- package/lib/esm/components/common_button.d.ts +2 -1
- package/lib/esm/components/common_button.js +2 -2
- package/lib/esm/components/common_button.js.map +1 -1
- package/lib/esm/components/common_input.d.ts +3 -1
- package/lib/esm/components/common_input.js +3 -4
- package/lib/esm/components/common_input.js.map +1 -1
- package/lib/esm/components/date_input.d.ts +6 -1
- package/lib/esm/components/date_input.js +2 -2
- package/lib/esm/components/date_input.js.map +1 -1
- package/lib/esm/components/drag_and_drop.js +2 -2
- package/lib/esm/components/drag_and_drop.js.map +1 -1
- package/lib/esm/components/email_input.d.ts +3 -1
- package/lib/esm/components/email_input.js +2 -2
- package/lib/esm/components/email_input.js.map +1 -1
- package/lib/esm/components/file_input.js +5 -5
- package/lib/esm/components/file_input.js.map +1 -1
- package/lib/esm/components/input_addon.d.ts +1 -2
- package/lib/esm/components/input_addon.js +1 -2
- package/lib/esm/components/input_addon.js.map +1 -1
- package/lib/esm/components/media_query.d.ts +1 -1
- package/lib/esm/components/modal.js +1 -3
- package/lib/esm/components/modal.js.map +1 -1
- package/lib/esm/components/number_input.d.ts +3 -1
- package/lib/esm/components/number_input.js +2 -2
- package/lib/esm/components/number_input.js.map +1 -1
- package/lib/esm/components/password_input.d.ts +3 -1
- package/lib/esm/components/password_input.js +2 -2
- package/lib/esm/components/password_input.js.map +1 -1
- package/lib/esm/components/radio_input.d.ts +2 -1
- package/lib/esm/components/radio_input.js +5 -4
- package/lib/esm/components/radio_input.js.map +1 -1
- package/lib/esm/components/range_input.d.ts +2 -1
- package/lib/esm/components/range_input.js +2 -2
- package/lib/esm/components/range_input.js.map +1 -1
- package/lib/esm/components/search_input.d.ts +3 -1
- package/lib/esm/components/search_input.js +2 -2
- package/lib/esm/components/search_input.js.map +1 -1
- package/lib/esm/components/select_input.d.ts +3 -2
- package/lib/esm/components/select_input.js +41 -4
- package/lib/esm/components/select_input.js.map +1 -1
- package/lib/esm/components/shared_hooks.d.ts +1 -0
- package/lib/esm/components/shared_hooks.js +5 -1
- package/lib/esm/components/shared_hooks.js.map +1 -1
- package/lib/esm/components/tags_input.js +0 -1
- package/lib/esm/components/tags_input.js.map +1 -1
- package/lib/esm/components/text_input.d.ts +3 -1
- package/lib/esm/components/text_input.js +2 -2
- package/lib/esm/components/text_input.js.map +1 -1
- package/lib/esm/components/textarea.d.ts +2 -1
- package/lib/esm/components/textarea.js +2 -3
- package/lib/esm/components/textarea.js.map +1 -1
- package/lib/esm/components/togglable_fieldset.js +2 -2
- package/lib/esm/components/togglable_fieldset.js.map +1 -1
- package/lib/esm/components/toggle.d.ts +2 -1
- package/lib/esm/components/toggle.js +2 -4
- package/lib/esm/components/toggle.js.map +1 -1
- package/lib/esm/components/tooltip_container.js.map +1 -1
- package/lib/esm/components/with_addons.d.ts +1 -2
- package/lib/esm/components/with_addons.js +2 -2
- package/lib/esm/components/with_addons.js.map +1 -1
- package/lib/esm/utils/animation.d.ts +1 -1
- package/lib/esm/utils/animation.js +0 -1
- package/lib/esm/utils/animation.js.map +1 -1
- package/lib/esm/utils/dom.d.ts +1 -1
- package/lib/esm/utils/forms.d.ts +0 -2
- package/lib/esm/utils/forms.js +0 -8
- package/lib/esm/utils/forms.js.map +1 -1
- package/lib/esm/utils/markscout.js.map +1 -1
- package/lib/esm/utils/refs.d.ts +1 -1
- package/lib/esm/utils/refs.js.map +1 -1
- package/lib/stylesheets/particle.css +174 -114
- 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 +28 -60
- package/styles/_reset.scss +7 -2
- package/styles/color_schemes/_bandit_dark.scss +13 -8
- package/styles/color_schemes/_researcher_dark.scss +12 -7
- package/styles/components/attribute_selector/_base.scss +10 -5
- package/styles/components/avatar/_base.scss +2 -0
- package/styles/components/blitz/_base.scss +3 -2
- package/styles/components/button_icon/_base.scss +2 -0
- package/styles/components/button_mode/_base.scss +6 -2
- package/styles/components/buttons/_base.scss +281 -277
- package/styles/components/card/_base.scss +4 -1
- package/styles/components/container/_base.scss +6 -3
- package/styles/components/drag_and_drop/_base.scss +23 -8
- package/styles/components/drag_and_drop/themes/_bandit.scss +15 -0
- package/styles/components/drag_and_drop/themes/_theme_builder.scss +18 -8
- package/styles/components/dropdown/_base.scss +2 -0
- package/styles/components/input_group/_base.scss +0 -4
- package/styles/components/inputs/_base.scss +19 -19
- package/styles/components/inputs/themes/_bandit.scss +3 -3
- package/styles/components/inputs/themes/_theme_builder.scss +9 -10
- package/styles/components/link_text/_base.scss +10 -3
- package/styles/components/menu/_base.scss +8 -6
- package/styles/components/range/_base.scss +16 -3
- package/styles/components/segmented_controls/_base.scss +6 -2
- package/styles/components/selectors/_base.scss +5 -2
- package/styles/components/toggle/_base.scss +5 -2
- package/styles/particle.scss +0 -1
- package/styles/themes/_theme_builder.scss +6 -0
- package/styles/components/_focus-intent.scss +0 -27
|
@@ -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,7 +49,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.AdvancedOptions = 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 button_plain_1 = require("./button_plain");
|
|
@@ -37,19 +60,17 @@ var modifier_1 = require("./modifier");
|
|
|
37
60
|
var collapsible_1 = require("./collapsible");
|
|
38
61
|
function AdvancedOptions(_a) {
|
|
39
62
|
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? true : _b, name = _a.name, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "initialCollapsed", "name", "title"]);
|
|
40
|
-
var
|
|
41
|
-
? "advanced-options-collapsible-content-".concat(id)
|
|
42
|
-
: null;
|
|
63
|
+
var collapsibleContentId = (0, react_1.useId)();
|
|
43
64
|
return (react_1.default.createElement(collapsible_1.CollapsibleStateProvider, { initialCollapsed: initialCollapsed }, function (_a) {
|
|
44
65
|
var isCollapsed = _a.isCollapsed, toggleCollapsed = _a.toggleCollapsed;
|
|
45
66
|
return (react_1.default.createElement("div", { className: (0, class_names_1.default)(_modifierClass), ref: getRef },
|
|
46
67
|
react_1.default.createElement(modifier_1.Modifier, { margin: { bottom: '0.75' } },
|
|
47
|
-
react_1.default.createElement(button_plain_1.ButtonPlain, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls":
|
|
68
|
+
react_1.default.createElement(button_plain_1.ButtonPlain, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": collapsibleContentId, "aria-expanded": !isCollapsed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, disabled: disabled, id: id, onClick: toggleCollapsed, name: name || (typeof title === 'string' ? title : undefined) }),
|
|
48
69
|
react_1.default.createElement(flex_1.Flex, null,
|
|
49
70
|
title,
|
|
50
71
|
' ',
|
|
51
72
|
react_1.default.createElement(triangle_inverted_1.IconTriangleInverted, { direction: isCollapsed ? 'right' : 'down' })))),
|
|
52
|
-
react_1.default.createElement(collapsible_content_1.CollapsibleContent, { collapsed: isCollapsed, id:
|
|
73
|
+
react_1.default.createElement(collapsible_content_1.CollapsibleContent, { collapsed: isCollapsed, id: collapsibleContentId }, children)));
|
|
53
74
|
}));
|
|
54
75
|
}
|
|
55
76
|
exports.AdvancedOptions = AdvancedOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AAKrC,qEAA8C;AAC9C,6EAAyD;AAEzD,+CAA6C;AAC7C,6DAA2D;AAC3D,gEAAkE;AAClE,+BAA8B;AAC9B,uCAAsC;AAEtC,6CAAyD;AAYzD,SAAgB,eAAe,CAAC,EAaT;IAZrB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,wBAAuB,EAAvB,gBAAgB,mBAAG,IAAI,KAAA,EACvB,IAAI,UAAA,EACJ,KAAK,WAAA,EACF,IAAI,cAZuB,oJAa/B,CADQ;IAEP,IAAM,oBAAoB,GAAG,IAAA,aAAK,GAAE,CAAC;IAErC,OAAO,CACL,8BAAC,sCAAwB,IAAC,gBAAgB,EAAE,gBAAgB,IACzD,UAAC,EAAgC;YAA9B,WAAW,iBAAA,EAAE,eAAe,qBAAA;QAAO,OAAA,CACrC,uCAAK,SAAS,EAAE,IAAA,qBAAU,EAAC,cAAc,CAAC,EAAE,GAAG,EAAE,MAAM;YACrD,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;gBAClC,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,oBAAoB,mBACpB,CAAC,WAAW,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;oBAE7D,8BAAC,WAAI;wBACF,KAAK;wBAAE,GAAG;wBACX,8BAAC,wCAAoB,IACnB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GACzC,CACG,CACK,CACL;YACX,8BAAC,wCAAkB,IAAC,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE,oBAAoB,IACjE,QAAQ,CACU,CACjB,CACP;IA3BsC,CA2BtC,CACwB,CAC5B,CAAC;AACJ,CAAC;AAhDD,0CAgDC"}
|
|
@@ -4,6 +4,7 @@ import type { GetRef } from '../utils/refs';
|
|
|
4
4
|
interface AttributeInputProps extends CommonComponentProps, ModifierProps {
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
6
|
checked?: boolean;
|
|
7
|
+
defaultChecked?: boolean;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
getRef?: GetRef<HTMLInputElement>;
|
|
9
10
|
id?: string;
|
|
@@ -14,5 +15,5 @@ interface AttributeInputProps extends CommonComponentProps, ModifierProps {
|
|
|
14
15
|
tabIndex?: number;
|
|
15
16
|
value: number | string;
|
|
16
17
|
}
|
|
17
|
-
export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, checked, disabled, getRef, id, label, name, value, onChange, readOnly, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
|
|
18
|
+
export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, defaultChecked, checked, disabled, getRef, id, label, name, value, onChange, readOnly, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -28,24 +28,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
28
28
|
exports.AttributeInput = void 0;
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
|
-
var forms_1 = require("../utils/forms");
|
|
32
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
33
|
-
|
|
34
|
-
if (id)
|
|
35
|
-
return id;
|
|
36
|
-
if (typeof label === 'string') {
|
|
37
|
-
return (0, forms_1.looksUnique)(label) ? label : (0, forms_1.unique)(label);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
32
|
+
var shared_hooks_1 = require("./shared_hooks");
|
|
40
33
|
function AttributeInput(_a) {
|
|
41
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "checked", "disabled", "getRef", "id", "label", "name", "value", "onChange", "readOnly", "tabIndex"]);
|
|
42
|
-
var attributeId =
|
|
34
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "defaultChecked", "checked", "disabled", "getRef", "id", "label", "name", "value", "onChange", "readOnly", "tabIndex"]);
|
|
35
|
+
var attributeId = (0, shared_hooks_1.useFallbackId)(id);
|
|
43
36
|
var selectorClassName = (0, class_names_1.default)('Attribute', _modifierClass);
|
|
44
37
|
var labelClassName = (0, class_names_1.default)('Attribute__Label', {
|
|
45
38
|
'Attribute__Label--read-only': readOnly
|
|
46
39
|
});
|
|
47
40
|
return (react_1.default.createElement("div", { className: selectorClassName },
|
|
48
|
-
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { id: attributeId, name: name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, ref: getRef, checked: checked, className: "Attribute__Input", onChange: readOnly ? undefined : onChange, type: "radio", value: value, tabIndex: tabIndex, readOnly: readOnly, disabled: disabled })),
|
|
41
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { id: attributeId, name: name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, ref: getRef, checked: checked, defaultChecked: defaultChecked, className: "Attribute__Input", onChange: readOnly ? undefined : onChange, type: "radio", value: value, tabIndex: tabIndex, readOnly: readOnly, disabled: disabled })),
|
|
49
42
|
react_1.default.createElement("label", { className: labelClassName, htmlFor: attributeId },
|
|
50
43
|
react_1.default.createElement("span", { className: "Attribute__Label__Content" }, label))));
|
|
51
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute_input.js","sourceRoot":"","sources":["../../../src/components/attribute_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"attribute_input.js","sourceRoot":"","sources":["../../../src/components/attribute_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,+CAA+C;AAiB/C,SAAgB,cAAc,CAAC,EAkBT;IAjBpB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,cAAc,oBAAA,EACd,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAjBsB,8MAkB9B,CADQ;IAEP,IAAM,WAAW,GAAG,IAAA,4BAAa,EAAC,EAAE,CAAC,CAAC;IAEtC,IAAM,iBAAiB,GAAG,IAAA,qBAAU,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAClE,IAAM,cAAc,GAAG,IAAA,qBAAU,EAAC,kBAAkB,EAAE;QACpD,6BAA6B,EAAE,QAAQ;KACxC,CAAC,CAAC;IAEH,OAAO,CACL,uCAAK,SAAS,EAAE,iBAAiB;QAE/B,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,gBACE,SAAS,qBACJ,cAAc,kBACjB,WAAW,sBACP,eAAe,EACjC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACzC,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAClB;QACF,yCAAO,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW;YACpD,wCAAM,SAAS,EAAC,2BAA2B,IAAE,KAAK,CAAQ,CACpD,CACJ,CACP,CAAC;AACJ,CAAC;AArDD,wCAqDC"}
|
|
@@ -5,6 +5,9 @@ type AttributesMap = {
|
|
|
5
5
|
[name: string]: string;
|
|
6
6
|
};
|
|
7
7
|
interface AttributeSelectorProps extends CommonComponentProps, ModifierProps {
|
|
8
|
+
/**
|
|
9
|
+
* A mapping of each inputs `value` to is `<label>` text.
|
|
10
|
+
*/
|
|
8
11
|
attributes: AttributesMap;
|
|
9
12
|
disabled?: boolean;
|
|
10
13
|
getRef?: GetRef<HTMLInputElement>;
|
|
@@ -38,7 +38,7 @@ function AttributeSelector(_a) {
|
|
|
38
38
|
onClick(target.value);
|
|
39
39
|
}
|
|
40
40
|
function renderAttribute(attribute) {
|
|
41
|
-
return (react_1.default.createElement(attribute_input_1.AttributeInput, { checked: attribute === selected, disabled: disabled, id: "".concat(name, "[").concat(attribute, "]"), key: attribute, label: attributes[attribute], name: name, onChange: handleAttributeSelected, readOnly: readOnly, value: attribute }));
|
|
41
|
+
return (react_1.default.createElement(attribute_input_1.AttributeInput, { checked: selected !== undefined ? attribute === selected : undefined, disabled: disabled, id: "".concat(name, "[").concat(attribute, "]"), key: attribute, label: attributes[attribute], name: name, onChange: handleAttributeSelected, readOnly: readOnly, value: attribute }));
|
|
42
42
|
}
|
|
43
43
|
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: (0, class_names_1.default)('Attribute__Selector spacing-h--0.25', _modifierClass), id: id, ref: getRef }), Object.keys(attributes).map(renderAttribute)));
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,qDAAmD;
|
|
1
|
+
{"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,qDAAmD;AAoBnD,SAAgB,iBAAiB,CAAC,EAcT;IAbvB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAbyB,4JAcjC,CADQ;IAEP,SAAS,uBAAuB,CAAC,EAEK;YADpC,MAAM,YAAA;QAEN,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,eAAe,CAAC,SAA8B;QACrD,OAAO,CACL,8BAAC,gCAAc,IACb,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,EACpE,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,UAAG,IAAI,cAAI,SAAS,MAAG,EAC3B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAC5B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,uBAAuB,EACjC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,GAChB,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,IAAA,qBAAU,EACnB,qCAAqC,EACrC,cAAc,CACf,EACD,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,KAEV,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AArDD,8CAqDC"}
|
|
@@ -26,10 +26,11 @@ interface ButtonProps extends CommonComponentProps, ModifierProps {
|
|
|
26
26
|
onMouseDown?: React.MouseEventHandler<HTMLButtonElement>;
|
|
27
27
|
refProp?: string;
|
|
28
28
|
size?: Sizes;
|
|
29
|
+
tabIndex?: number;
|
|
29
30
|
title?: string;
|
|
30
31
|
type?: 'button' | 'submit';
|
|
31
32
|
width?: Widths;
|
|
32
33
|
variant?: Variants;
|
|
33
34
|
}
|
|
34
|
-
export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, name, onClick, onMouseUp, onMouseDown, refProp, size, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
|
|
35
|
+
export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, name, onClick, onMouseUp, onMouseDown, refProp, size, tabIndex, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
|
|
35
36
|
export {};
|
|
@@ -66,9 +66,9 @@ function supportedClassFor(type, value) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
function Button(_a) {
|
|
69
|
-
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "title", "type", "width", "variant"]);
|
|
69
|
+
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, tabIndex = _a.tabIndex, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "tabIndex", "title", "type", "width", "variant"]);
|
|
70
70
|
var className = (0, class_names_1.default)('Button', supportedClassFor('size', size), supportedClassFor('width', width), supportedClassFor('variant', variant), supportedClassFor('color', color), _modifierClass);
|
|
71
|
-
return (react_1.default.createElement(common_button_1.CommonButton, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, getRef: getRef, id: id, linkComponent: linkComponent, linkProps: linkProps, name: name, onClick: onClick, onMouseUp: onMouseUp, onMouseDown: onMouseDown, refProp: refProp, title: title, type: type }), children));
|
|
71
|
+
return (react_1.default.createElement(common_button_1.CommonButton, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, getRef: getRef, id: id, linkComponent: linkComponent, linkProps: linkProps, name: name, onClick: onClick, onMouseUp: onMouseUp, onMouseDown: onMouseDown, refProp: refProp, tabIndex: tabIndex, title: title, type: type }), children));
|
|
72
72
|
}
|
|
73
73
|
exports.Button = Button;
|
|
74
74
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AAEzD,iDAA+C;AAE/C,IAAM,MAAM,GAAG;IACb,OAAO;IACP,OAAO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kBACnB,WAAW,EACzB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,KAET,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC;AAhED,wBAgEC"}
|
|
@@ -5,6 +5,7 @@ interface CheckboxInputProps extends CommonComponentProps, ModifierProps {
|
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
6
|
checked?: boolean;
|
|
7
7
|
color?: Colors;
|
|
8
|
+
defaultChecked?: boolean;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
getRef?: GetRef<HTMLInputElement>;
|
|
10
11
|
id?: string;
|
|
@@ -16,5 +17,5 @@ interface CheckboxInputProps extends CommonComponentProps, ModifierProps {
|
|
|
16
17
|
tabIndex?: number;
|
|
17
18
|
value?: number | string;
|
|
18
19
|
}
|
|
19
|
-
export declare function CheckboxInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, checked, color, disabled, getRef, id, indeterminate, label, name, onChange, readOnly, tabIndex, value, ...rest }: CheckboxInputProps): React.JSX.Element;
|
|
20
|
+
export declare function CheckboxInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, checked, color, defaultChecked, disabled, getRef, id, indeterminate, label, name, onChange, readOnly, tabIndex, value, ...rest }: CheckboxInputProps): React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -31,6 +31,7 @@ var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
|
31
31
|
var forms_1 = require("../utils/forms");
|
|
32
32
|
var refs_1 = require("../utils/refs");
|
|
33
33
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
34
|
+
var shared_hooks_1 = require("./shared_hooks");
|
|
34
35
|
var checkbox_check_1 = require("../icons/checkbox_check");
|
|
35
36
|
var checkbox_indeterminate_1 = require("../icons/checkbox_indeterminate");
|
|
36
37
|
function renderIcon(checked, indeterminate, readOnly) {
|
|
@@ -39,13 +40,13 @@ function renderIcon(checked, indeterminate, readOnly) {
|
|
|
39
40
|
return react_1.default.createElement(checkbox_check_1.IconCheckboxCheck, { "aria-hidden": true });
|
|
40
41
|
}
|
|
41
42
|
function CheckboxInput(_a) {
|
|
42
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], checked = _a.checked, _b = _a.color, color = _b === void 0 ? 'dscout' : _b, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, indeterminate = _a.indeterminate, label = _a.label, name = _a.name, onChange = _a.onChange, readOnly = _a.readOnly, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "checked", "color", "disabled", "getRef", "id", "indeterminate", "label", "name", "onChange", "readOnly", "tabIndex", "value"]);
|
|
43
|
-
var checkboxId = (0,
|
|
43
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], checked = _a.checked, _b = _a.color, color = _b === void 0 ? 'dscout' : _b, defaultChecked = _a.defaultChecked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, indeterminate = _a.indeterminate, label = _a.label, name = _a.name, onChange = _a.onChange, readOnly = _a.readOnly, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "checked", "color", "defaultChecked", "disabled", "getRef", "id", "indeterminate", "label", "name", "onChange", "readOnly", "tabIndex", "value"]);
|
|
44
|
+
var checkboxId = (0, shared_hooks_1.useFallbackId)(id);
|
|
44
45
|
var className = (0, class_names_1.default)('Selector', _modifierClass, {
|
|
45
46
|
'Selector--with-label': label
|
|
46
47
|
});
|
|
47
48
|
return (react_1.default.createElement("div", { className: className },
|
|
48
|
-
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, checked: checked, className: "Selector__Checkbox", disabled: disabled || readOnly, id: checkboxId, name: name, onChange: onChange, readOnly: readOnly, ref: function (ref) {
|
|
49
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, checked: checked, className: "Selector__Checkbox", defaultChecked: defaultChecked, disabled: disabled || readOnly, id: checkboxId, name: name, onChange: onChange, readOnly: readOnly, ref: function (ref) {
|
|
49
50
|
if (ref)
|
|
50
51
|
ref.indeterminate = indeterminate;
|
|
51
52
|
(0, refs_1.handleGetRef)(getRef, ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox_input.js","sourceRoot":"","sources":["../../../src/components/checkbox_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"checkbox_input.js","sourceRoot":"","sources":["../../../src/components/checkbox_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;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,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,UAAC,GAAG;gBACP,IAAI,GAAG;oBAAE,GAAG,CAAC,aAAa,GAAG,aAAa,CAAC;gBAC3C,IAAA,mBAAY,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAA,kBAAU,EAAC,KAAK,EAAE,QAAQ,CAAC,IAClC;QACF,uCAAK,SAAS,EAAE,IAAA,qBAAU,EAAC,iBAAiB,EAAE,iBAAU,KAAK,CAAE,CAAC,GAAI;QACnE,KAAK,IAAI,CACR,yCAAO,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,UAAU,IACnD,KAAK,CACA,CACT;QACA,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AA3DD,sCA2DC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface CollapsibleStateProviderProps {
|
|
2
3
|
initialCollapsed?: boolean;
|
|
3
4
|
children: ({ isCollapsed, toggleCollapsed }: {
|
|
4
5
|
isCollapsed: boolean;
|
|
5
6
|
toggleCollapsed: () => void;
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
+
}) => React.JSX.Element;
|
|
7
8
|
}
|
|
8
|
-
export declare function CollapsibleStateProvider({ initialCollapsed, children }: CollapsibleStateProviderProps): JSX.Element;
|
|
9
|
+
export declare function CollapsibleStateProvider({ initialCollapsed, children }: CollapsibleStateProviderProps): React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../../src/components/collapsible.tsx"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../../src/components/collapsible.tsx"],"names":[],"mappings":";;;AAAA,+BAAwC;AAaxC,SAAgB,wBAAwB,CAAC,EAGT;QAF9B,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAA,EACxB,QAAQ,cAAA;IAEF,IAAA,KAAgC,IAAA,gBAAQ,EAAC,gBAAgB,CAAC,EAAzD,WAAW,QAAA,EAAE,cAAc,QAA8B,CAAC;IAEjE,SAAS,qBAAqB;QAC5B,cAAc,CAAC,UAAC,aAAa,IAAK,OAAA,CAAC,aAAa,EAAd,CAAc,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,QAAQ,CAAC;QACd,WAAW,aAAA;QACX,eAAe,EAAE,qBAAqB;KACvC,CAAC,CAAC;AACL,CAAC;AAdD,4DAcC"}
|
|
@@ -35,6 +35,7 @@ var circle_minus_1 = require("../icons/circle_minus");
|
|
|
35
35
|
var circle_plus_1 = require("../icons/circle_plus");
|
|
36
36
|
var collapsible_1 = require("./collapsible");
|
|
37
37
|
var separator_1 = require("./separator");
|
|
38
|
+
var shared_hooks_1 = require("./shared_hooks");
|
|
38
39
|
function renderIcon(isCollapsed) {
|
|
39
40
|
if (isCollapsed)
|
|
40
41
|
return react_1.default.createElement(circle_plus_1.IconCirclePlus, null);
|
|
@@ -43,18 +44,16 @@ function renderIcon(isCollapsed) {
|
|
|
43
44
|
function CollapsingMenu(_a) {
|
|
44
45
|
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, collapsedTitle = _a.collapsedTitle, expandedTitle = _a.expandedTitle, getRef = _a.getRef, heading = _a.heading, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? false : _b, name = _a.name, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "collapsedTitle", "expandedTitle", "getRef", "heading", "id", "initialCollapsed", "name"]);
|
|
45
46
|
var className = (0, class_names_1.default)('Menu', 'Menu--tight', 'Menu--contained', _modifierClass);
|
|
46
|
-
var
|
|
47
|
-
? "collapsing-menu-collapsible-content-".concat(id)
|
|
48
|
-
: null;
|
|
47
|
+
var collapsibleContentId = (0, shared_hooks_1.useFallbackId)(id);
|
|
49
48
|
return (react_1.default.createElement(collapsible_1.CollapsibleStateProvider, { initialCollapsed: initialCollapsed }, function (_a) {
|
|
50
49
|
var isCollapsed = _a.isCollapsed, toggleCollapsed = _a.toggleCollapsed;
|
|
51
50
|
return (react_1.default.createElement("div", { className: className, ref: getRef },
|
|
52
51
|
react_1.default.createElement("header", { className: "margin-b--none" },
|
|
53
|
-
react_1.default.createElement("button", __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls":
|
|
52
|
+
react_1.default.createElement("button", __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": collapsibleContentId, "aria-expanded": !isCollapsed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: "Menu__Title Menu__Toggle", name: name ? "".concat(name, "_toggle") : 'toggle', onClick: toggleCollapsed, title: isCollapsed ? collapsedTitle : expandedTitle, type: "button" }),
|
|
54
53
|
react_1.default.createElement(flex_1.Flex, { justify: "between", width: "100%" },
|
|
55
54
|
heading,
|
|
56
|
-
react_1.default.createElement("div", { className: "
|
|
57
|
-
react_1.default.createElement(collapsible_content_1.CollapsibleContent, { id:
|
|
55
|
+
react_1.default.createElement("div", { className: "Menu__Toggle-Icon" }, renderIcon(isCollapsed))))),
|
|
56
|
+
react_1.default.createElement(collapsible_content_1.CollapsibleContent, { id: collapsibleContentId, collapsed: isCollapsed },
|
|
58
57
|
react_1.default.createElement(separator_1.Separator, { size: "0.25" }),
|
|
59
58
|
children)));
|
|
60
59
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsing_menu.js","sourceRoot":"","sources":["../../../src/components/collapsing_menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,6EAAyD;AA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,EAAC,IAAI,CAAC,qBACZ,oBAAoB,mBACpB,CAAC,WAAW,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,UAAG,IAAI,YAAS,CAAC,CAAC,CAAC,QAAQ,EACxC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,EACnD,IAAI,EAAC,QAAQ;oBAEb,8BAAC,WAAI,IAAC,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM;wBACjC,OAAO;wBACR,uCAAK,SAAS,EAAC,mBAAmB,IAC/B,UAAU,CAAC,WAAW,CAAC,CACpB,CACD,CACA,CACF;YACT,8BAAC,wCAAkB,IAAC,EAAE,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW;gBAClE,8BAAC,qBAAS,IAAC,IAAI,EAAC,MAAM,GAAG;gBACxB,QAAQ,CACU,CACjB,CACP;IA7BsC,CA6BtC,CACwB,CAC5B,CAAC;AACJ,CAAC;AAzDD,wCAyDC"}
|
|
@@ -22,8 +22,9 @@ interface CommonButtonProps extends CommonComponentProps {
|
|
|
22
22
|
onMouseUp?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
23
23
|
refProp?: string;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
|
+
tabIndex?: number;
|
|
25
26
|
title?: string;
|
|
26
27
|
type?: 'button' | 'submit';
|
|
27
28
|
}
|
|
28
|
-
export declare function CommonButton({ 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, className, disabled, getRef, id, linkComponent, linkProps, name, onBlur, onClick, onFocus, onMouseDown, onMouseEnter, onMouseLeave, onMouseUp, refProp, style, title, type, ...rest }: CommonButtonProps): React.JSX.Element;
|
|
29
|
+
export declare function CommonButton({ 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, className, disabled, getRef, id, linkComponent, linkProps, name, onBlur, onClick, onFocus, onMouseDown, onMouseEnter, onMouseLeave, onMouseUp, refProp, style, tabIndex, title, type, ...rest }: CommonButtonProps): React.JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -41,11 +41,11 @@ function sanitizeProps(props, disabled) {
|
|
|
41
41
|
}
|
|
42
42
|
function CommonButton(_a) {
|
|
43
43
|
var _b;
|
|
44
|
-
var ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, className = _a.className, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onBlur = _a.onBlur, onClick = _a.onClick, onFocus = _a.onFocus, onMouseDown = _a.onMouseDown, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onMouseUp = _a.onMouseUp, _c = _a.refProp, refProp = _c === void 0 ? 'ref' : _c, style = _a.style, title = _a.title, _d = _a.type, type = _d === void 0 ? 'button' : _d, rest = __rest(_a, ['aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "className", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "refProp", "style", "title", "type"]);
|
|
44
|
+
var ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, className = _a.className, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onBlur = _a.onBlur, onClick = _a.onClick, onFocus = _a.onFocus, onMouseDown = _a.onMouseDown, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onMouseUp = _a.onMouseUp, _c = _a.refProp, refProp = _c === void 0 ? 'ref' : _c, style = _a.style, tabIndex = _a.tabIndex, title = _a.title, _d = _a.type, type = _d === void 0 ? 'button' : _d, rest = __rest(_a, ['aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "className", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onBlur", "onClick", "onFocus", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseUp", "refProp", "style", "tabIndex", "title", "type"]);
|
|
45
45
|
var isLink = !!linkComponent;
|
|
46
46
|
var Component = linkComponent || 'button';
|
|
47
47
|
var refProps = getRef ? (_b = {}, _b[refProp] = getRef, _b) : {};
|
|
48
|
-
return (react_1.default.createElement(Component, __assign({}, sanitizeProps(linkProps, disabled), refProps, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, id: id, name: name, onBlur: onBlur, onClick: onClick, onFocus: onFocus, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseUp: onMouseUp, onMouseDown: onMouseDown, style: style, tabIndex: isLink && disabled ? -1 :
|
|
48
|
+
return (react_1.default.createElement(Component, __assign({}, sanitizeProps(linkProps, disabled), refProps, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, id: id, name: name, onBlur: onBlur, onClick: onClick, onFocus: onFocus, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseUp: onMouseUp, onMouseDown: onMouseDown, style: style, tabIndex: isLink && disabled ? -1 : tabIndex, title: title, type: isLink ? undefined : type }), children));
|
|
49
49
|
}
|
|
50
50
|
exports.CommonButton = CommonButton;
|
|
51
51
|
//# sourceMappingURL=common_button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_button.js","sourceRoot":"","sources":["../../../src/components/common_button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,2DAAqC;AACrC,6EAAyD;
|
|
1
|
+
{"version":3,"file":"common_button.js","sourceRoot":"","sources":["../../../src/components/common_button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,2DAAqC;AACrC,6EAAyD;AA4BzD,IAAM,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAC5C,IAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,SAAS,aAAa,CAAC,KAA8B,EAAE,QAAiB;IACtE,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,IAAM,aAAa,GAAG,QAAQ;QAC5B,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,CAAC,CAAC,qBAAqB,CAAC;IAE1B,OAAO,IAAA,gBAAM,EAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AACtC,CAAC;AAED,SAAgB,YAAY,CAAC,EA4BT;;IA3BlB,IAAiB,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnB,WAAW,qBAAA,EAC3B,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,IAAI,UAAA,EACJ,MAAM,YAAA,E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 -5,6 +5,7 @@ interface CommonInputProps extends CommonComponentProps, ModifierProps {
|
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
6
|
autoComplete?: string;
|
|
7
7
|
autoFocus?: boolean;
|
|
8
|
+
defaultValue?: number | string;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
getRef?: GetRef<HTMLInputElement>;
|
|
10
11
|
id?: string;
|
|
@@ -22,11 +23,12 @@ interface CommonInputProps extends CommonComponentProps, ModifierProps {
|
|
|
22
23
|
placeholder?: string;
|
|
23
24
|
prefix?: React.ReactNode;
|
|
24
25
|
readOnly?: boolean;
|
|
26
|
+
required?: boolean;
|
|
25
27
|
step?: string | number;
|
|
26
28
|
suffix?: React.ReactNode;
|
|
27
29
|
tabIndex?: number;
|
|
28
30
|
type?: string;
|
|
29
31
|
value?: number | string;
|
|
30
32
|
}
|
|
31
|
-
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, disabled, getRef, id, invalid, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
33
|
+
export declare function CommonInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, max, maxLength, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, step, tabIndex, type, value, ...rest }: CommonInputProps): React.JSX.Element;
|
|
32
34
|
export {};
|
|
@@ -33,19 +33,18 @@ var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
|
33
33
|
var with_addons_1 = require("./with_addons");
|
|
34
34
|
function CommonInput(_a) {
|
|
35
35
|
var _b;
|
|
36
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, 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, 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', "autoComplete", "autoFocus", "disabled", "getRef", "id", "invalid", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "suffix", "step", "tabIndex", "type", "value"]);
|
|
36
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, 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', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "max", "maxLength", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "required", "suffix", "step", "tabIndex", "type", "value"]);
|
|
37
37
|
var affixed = !!prefix || !!suffix;
|
|
38
38
|
var inputClass = (0, class_names_1.default)('Input', (_b = {},
|
|
39
39
|
_b[_modifierClass] = _modifierClass && !affixed,
|
|
40
|
-
_b['Input--filled'] = value,
|
|
41
40
|
_b['Input--invalid'] = invalid,
|
|
42
41
|
_b['Input--mini'] = mini,
|
|
43
42
|
_b));
|
|
44
43
|
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, autoComplete: autoComplete,
|
|
45
44
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
46
|
-
autoFocus: autoFocus, className: inputClass, 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, ref: getRef, step: step, tabIndex: tabIndex, type: type, value: (0, forms_1.inputValue)(value, onChange) })));
|
|
45
|
+
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) })));
|
|
47
46
|
if (affixed) {
|
|
48
|
-
return (react_1.default.createElement(with_addons_1.WithAddons, { _modifierClass: _modifierClass, disabled: disabled,
|
|
47
|
+
return (react_1.default.createElement(with_addons_1.WithAddons, { _modifierClass: _modifierClass, disabled: disabled, mini: mini, prefix: prefix, suffix: suffix }, input));
|
|
49
48
|
}
|
|
50
49
|
return input;
|
|
51
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common_input.js","sourceRoot":"","sources":["../../../src/components/common_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AAEzD,6CAA2C;
|
|
1
|
+
{"version":3,"file":"common_input.js","sourceRoot":"","sources":["../../../src/components/common_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AAEzD,6CAA2C;AAgC3C,SAAgB,WAAW,CAAC,EAiCT;;IAhCjB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,OAAO,aAAA,EACP,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,cAhCmB,+WAiC3B,CADQ;IAEP,IAAM,OAAO,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC;IAErC,IAAM,UAAU,GAAG,IAAA,qBAAU,EAAC,OAAO;QACnC,GAAC,cAAc,IAAG,cAAc,IAAI,CAAC,OAAO;QAC5C,oBAAgB,GAAE,OAAO;QACzB,iBAAa,GAAE,IAAI;YACnB,CAAC;IAEH,IAAM,KAAK,GAAG,CACZ,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,wBACT,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,EAC/B,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,MAAM,EAAE,MAAM,IAEb,KAAK,CACK,CACd,CAAC;KACH;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AA3FD,kCA2FC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CommonComponentProps, ModifierProps } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
+
/**
|
|
5
|
+
* Date string in the yyyy-mm-dd format
|
|
6
|
+
*/
|
|
4
7
|
type DateString = `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
|
|
5
8
|
interface DateInputProps extends CommonComponentProps, ModifierProps {
|
|
6
9
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
7
10
|
autoComplete?: string;
|
|
8
11
|
autoFocus?: boolean;
|
|
12
|
+
defaultValue?: number | string;
|
|
9
13
|
disabled?: boolean;
|
|
10
14
|
getRef?: GetRef<HTMLInputElement>;
|
|
11
15
|
id?: string;
|
|
@@ -20,9 +24,10 @@ interface DateInputProps extends CommonComponentProps, ModifierProps {
|
|
|
20
24
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
21
25
|
onPaste?: React.ClipboardEventHandler<HTMLInputElement>;
|
|
22
26
|
readOnly?: boolean;
|
|
27
|
+
required?: boolean;
|
|
23
28
|
step?: string | number;
|
|
24
29
|
tabIndex?: number;
|
|
25
30
|
value?: number | string;
|
|
26
31
|
}
|
|
27
|
-
export declare function DateInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, disabled, getRef, id, invalid, max, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, readOnly, step, tabIndex, value, ...rest }: DateInputProps): React.JSX.Element;
|
|
32
|
+
export declare function DateInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, max, min, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, readOnly, required, step, tabIndex, value, ...rest }: DateInputProps): React.JSX.Element;
|
|
28
33
|
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 DateInput(_a) {
|
|
33
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, max = _a.max, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, readOnly = _a.readOnly, step = _a.step, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "autoFocus", "disabled", "getRef", "id", "invalid", "max", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "readOnly", "step", "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, autoComplete: autoComplete, autoFocus: autoFocus, disabled: disabled, getRef: getRef, id: id, invalid: invalid, max: max, min: min, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, readOnly: readOnly, step: step, tabIndex: tabIndex, type: "date", value: value })));
|
|
33
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, max = _a.max, min = _a.min, mini = _a.mini, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, readOnly = _a.readOnly, required = _a.required, step = _a.step, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "max", "min", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "readOnly", "required", "step", "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, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, id: id, invalid: invalid, max: max, min: min, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, readOnly: readOnly, required: required, step: step, tabIndex: tabIndex, type: "date", value: value })));
|
|
35
35
|
}
|
|
36
36
|
exports.DateInput = DateInput;
|
|
37
37
|
//# sourceMappingURL=date_input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date_input.js","sourceRoot":"","sources":["../../../src/components/date_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,6EAAyD;AAEzD,+CAA6C;
|
|
1
|
+
{"version":3,"file":"date_input.js","sourceRoot":"","sources":["../../../src/components/date_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,6EAAyD;AAEzD,+CAA6C;AAiC7C,SAAgB,SAAS,CAAC,EA4BT;IA3Bf,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,YA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
77
|
-
return (react_1.default.createElement("div", { className: className, onDragOver: disabled ? undefined : onDragOver, onDragEnter: disabled ? undefined : handleEnter, onDragLeave: disabled ? undefined : handleLeave, onDrop: disabled ? undefined : onDrop
|
|
78
|
-
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { accept: accept, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: fileInputClassName, disabled: disabled, id: id, multiple: multiple, name: name, onChange: onChange, ref: getRef, type: "file", value: value })),
|
|
77
|
+
return (react_1.default.createElement("div", { className: className, onDragOver: disabled ? undefined : onDragOver, onDragEnter: disabled ? undefined : handleEnter, onDragLeave: disabled ? undefined : handleLeave, onDrop: disabled ? undefined : onDrop },
|
|
78
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { accept: accept, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: fileInputClassName, disabled: disabled, id: id, multiple: multiple, name: name, onChange: onChange, ref: getRef, tabIndex: tabIndex, type: "file", value: value })),
|
|
79
79
|
children));
|
|
80
80
|
}
|
|
81
81
|
exports.DragAndDrop = DragAndDrop;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag_and_drop.js","sourceRoot":"","sources":["../../../src/components/drag_and_drop.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAKxC,qEAA8C;AAC9C,6EAAyD;AAqBzD,SAAgB,WAAW,CAAC,EAsBT;IArBjB,IAAA,cAAc,oBAAA,EACd,MAAM,YAAA,EACQ,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR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AAC,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CACL,uCACE,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAC7C,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAC/C,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAC/C,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;QAErC,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,MAAM,EAAE,MAAM,gBACF,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,kBAAkB,EAC7B,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,IACZ;QACD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC;AAzED,kCAyEC"}
|
|
@@ -5,6 +5,7 @@ interface EmailInputProps extends CommonComponentProps, ModifierProps {
|
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
6
|
autoComplete?: string;
|
|
7
7
|
autoFocus?: boolean;
|
|
8
|
+
defaultValue?: number | string;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
getRef?: GetRef<HTMLInputElement>;
|
|
10
11
|
id?: string;
|
|
@@ -20,9 +21,10 @@ interface EmailInputProps extends CommonComponentProps, ModifierProps {
|
|
|
20
21
|
placeholder?: string;
|
|
21
22
|
prefix?: React.ReactNode;
|
|
22
23
|
readOnly?: boolean;
|
|
24
|
+
required?: boolean;
|
|
23
25
|
suffix?: React.ReactNode;
|
|
24
26
|
tabIndex?: number;
|
|
25
27
|
value?: number | string;
|
|
26
28
|
}
|
|
27
|
-
export declare function EmailInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, disabled, getRef, id, invalid, maxLength, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, suffix, tabIndex, value, ...rest }: EmailInputProps): React.JSX.Element;
|
|
29
|
+
export declare function EmailInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, defaultValue, disabled, getRef, id, invalid, maxLength, mini, name, onBlur, onChange, onFocus, onKeyDown, onPaste, placeholder, prefix, readOnly, required, suffix, tabIndex, value, ...rest }: EmailInputProps): React.JSX.Element;
|
|
28
30
|
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 EmailInput(_a) {
|
|
33
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, 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, suffix = _a.suffix, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "autoFocus", "disabled", "getRef", "id", "invalid", "maxLength", "mini", "name", "onBlur", "onChange", "onFocus", "onKeyDown", "onPaste", "placeholder", "prefix", "readOnly", "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, autoComplete: autoComplete, autoFocus: autoFocus, disabled: disabled, getRef: getRef, id: id, invalid: invalid, maxLength: maxLength, mini: mini, name: name, onBlur: onBlur, onChange: onChange, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, prefix: prefix, readOnly: readOnly, suffix: suffix, tabIndex: tabIndex, type: "email", value: value })));
|
|
33
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, autoFocus = _a.autoFocus, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, 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', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "id", "invalid", "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, autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, getRef: getRef, id: id, invalid: invalid, 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: "email", value: value })));
|
|
35
35
|
}
|
|
36
36
|
exports.EmailInput = EmailInput;
|
|
37
37
|
//# sourceMappingURL=email_input.js.map
|