@dscout/particle 1.0.0-alpha.21 → 1.0.0-alpha.22
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/attribute_input.d.ts +2 -1
- package/lib/cjs/components/attribute_input.js +2 -2
- package/lib/cjs/components/attribute_input.js.map +1 -1
- package/lib/cjs/components/attribute_selector.d.ts +2 -1
- package/lib/cjs/components/attribute_selector.js +2 -2
- package/lib/cjs/components/attribute_selector.js.map +1 -1
- package/lib/cjs/components/blitz.d.ts +2 -2
- package/lib/cjs/components/blitz.js +28 -4
- package/lib/cjs/components/blitz.js.map +1 -1
- package/lib/cjs/components/checkbox_input.d.ts +3 -1
- package/lib/cjs/components/checkbox_input.js +2 -2
- package/lib/cjs/components/checkbox_input.js.map +1 -1
- package/lib/cjs/components/drag_and_drop.d.ts +3 -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/file_input.d.ts +3 -1
- package/lib/cjs/components/file_input.js +2 -2
- package/lib/cjs/components/file_input.js.map +1 -1
- package/lib/cjs/components/focus_trap.d.ts +1 -1
- package/lib/cjs/components/modal.d.ts +2 -2
- package/lib/cjs/components/modal.js.map +1 -1
- package/lib/cjs/components/radio_input.d.ts +2 -1
- package/lib/cjs/components/radio_input.js +2 -2
- 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/select_input.d.ts +3 -1
- package/lib/cjs/components/select_input.js +3 -3
- package/lib/cjs/components/select_input.js.map +1 -1
- package/lib/cjs/components/textarea.d.ts +3 -1
- package/lib/cjs/components/textarea.js +3 -3
- package/lib/cjs/components/textarea.js.map +1 -1
- package/lib/cjs/components/theme_provider.d.ts +29 -1
- package/lib/cjs/components/theme_provider.js +28 -28
- package/lib/cjs/components/theme_provider.js.map +1 -1
- package/lib/cjs/components/toggle.d.ts +3 -1
- package/lib/cjs/components/toggle.js +2 -2
- package/lib/cjs/components/toggle.js.map +1 -1
- package/lib/esm/components/attribute_input.d.ts +2 -1
- package/lib/esm/components/attribute_input.js +2 -2
- package/lib/esm/components/attribute_input.js.map +1 -1
- package/lib/esm/components/attribute_selector.d.ts +2 -1
- package/lib/esm/components/attribute_selector.js +2 -2
- package/lib/esm/components/attribute_selector.js.map +1 -1
- package/lib/esm/components/blitz.d.ts +2 -2
- package/lib/esm/components/blitz.js +5 -4
- package/lib/esm/components/blitz.js.map +1 -1
- package/lib/esm/components/checkbox_input.d.ts +3 -1
- package/lib/esm/components/checkbox_input.js +2 -2
- package/lib/esm/components/checkbox_input.js.map +1 -1
- package/lib/esm/components/drag_and_drop.d.ts +3 -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/file_input.d.ts +3 -1
- package/lib/esm/components/file_input.js +2 -2
- package/lib/esm/components/file_input.js.map +1 -1
- package/lib/esm/components/focus_trap.d.ts +1 -1
- package/lib/esm/components/modal.d.ts +2 -2
- package/lib/esm/components/modal.js.map +1 -1
- package/lib/esm/components/radio_input.d.ts +2 -1
- package/lib/esm/components/radio_input.js +2 -2
- 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/select_input.d.ts +3 -1
- package/lib/esm/components/select_input.js +3 -3
- package/lib/esm/components/select_input.js.map +1 -1
- package/lib/esm/components/textarea.d.ts +3 -1
- package/lib/esm/components/textarea.js +3 -3
- package/lib/esm/components/textarea.js.map +1 -1
- package/lib/esm/components/theme_provider.d.ts +29 -1
- package/lib/esm/components/theme_provider.js +28 -28
- package/lib/esm/components/theme_provider.js.map +1 -1
- package/lib/esm/components/toggle.d.ts +3 -1
- package/lib/esm/components/toggle.js +2 -2
- package/lib/esm/components/toggle.js.map +1 -1
- package/lib/stylesheets/particle.css +14 -14
- package/lib/stylesheets/particle.min.css +1 -1
- package/lib/stylesheets/particle.min.css.gz +0 -0
- package/package.json +1 -1
- package/styles/color_schemes/_base_colors.scss +1 -1
- package/styles/components/container/_base.scss +1 -1
- package/styles/components/drag_and_drop/themes/_theme_builder.scss +3 -3
|
@@ -12,8 +12,9 @@ interface AttributeInputProps extends CommonComponentProps, ModifierProps {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
14
14
|
readOnly?: boolean;
|
|
15
|
+
required?: boolean;
|
|
15
16
|
tabIndex?: number;
|
|
16
17
|
value: number | string;
|
|
17
18
|
}
|
|
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;
|
|
19
|
+
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, required, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -31,14 +31,14 @@ var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
32
|
var shared_hooks_1 = require("./shared_hooks");
|
|
33
33
|
function AttributeInput(_a) {
|
|
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"]);
|
|
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, required = _a.required, 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", "required", "tabIndex"]);
|
|
35
35
|
var attributeId = (0, shared_hooks_1.useFallbackId)(id);
|
|
36
36
|
var selectorClassName = (0, class_names_1.default)('Attribute', _modifierClass);
|
|
37
37
|
var labelClassName = (0, class_names_1.default)('Attribute__Label', {
|
|
38
38
|
'Attribute__Label--read-only': readOnly
|
|
39
39
|
});
|
|
40
40
|
return (react_1.default.createElement("div", { className: selectorClassName },
|
|
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 })),
|
|
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, required: required, disabled: disabled })),
|
|
42
42
|
react_1.default.createElement("label", { className: labelClassName, htmlFor: attributeId },
|
|
43
43
|
react_1.default.createElement("span", { className: "Attribute__Label__Content" }, label))));
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAkB/C,SAAgB,cAAc,CAAC,EAmBT;IAlBpB,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,EACR,QAAQ,cAAA,EACL,IAAI,cAlBsB,0NAmB9B,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,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;AAvDD,wCAuDC"}
|
|
@@ -15,7 +15,8 @@ interface AttributeSelectorProps extends CommonComponentProps, ModifierProps {
|
|
|
15
15
|
name?: string;
|
|
16
16
|
onClick: (value: string) => void;
|
|
17
17
|
readOnly?: boolean;
|
|
18
|
+
required?: boolean;
|
|
18
19
|
selected?: keyof AttributesMap;
|
|
19
20
|
}
|
|
20
|
-
export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, name, onClick, readOnly, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
|
|
21
|
+
export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, name, onClick, readOnly, required, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -31,14 +31,14 @@ var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
32
|
var attribute_input_1 = require("./attribute_input");
|
|
33
33
|
function AttributeSelector(_a) {
|
|
34
|
-
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "name", "onClick", "readOnly", "selected"]);
|
|
34
|
+
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, required = _a.required, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "name", "onClick", "readOnly", "required", "selected"]);
|
|
35
35
|
function handleAttributeSelected(_a) {
|
|
36
36
|
var target = _a.target;
|
|
37
37
|
if (onClick)
|
|
38
38
|
onClick(target.value);
|
|
39
39
|
}
|
|
40
40
|
function renderAttribute(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 }));
|
|
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, required: required, 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;AAqBnD,SAAgB,iBAAiB,CAAC,EAeT;IAdvB,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,EACR,QAAQ,cAAA,EACL,IAAI,cAdyB,wKAejC,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,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;AAvDD,8CAuDC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
2
|
import type { CommonComponentProps } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
interface BlitzProps extends CommonComponentProps {
|
|
@@ -6,7 +6,7 @@ interface BlitzProps extends CommonComponentProps {
|
|
|
6
6
|
closeButtonTitle?: string;
|
|
7
7
|
getRef?: GetRef<HTMLDivElement>;
|
|
8
8
|
id?: string;
|
|
9
|
-
initialFocusOn?: Element | string;
|
|
9
|
+
initialFocusOn?: RefObject<Element> | Element | string;
|
|
10
10
|
isVisible?: boolean;
|
|
11
11
|
requestClose?: () => void;
|
|
12
12
|
type?: 'alert' | 'notification' | 'coaching';
|
|
@@ -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.Blitz = 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,17 +60,18 @@ var CLOSE_BUTTON_NAME = 'close';
|
|
|
37
60
|
var DEFAULT_FOCUS_SELECTOR = "button[name=\"".concat(CLOSE_BUTTON_NAME, "\"]");
|
|
38
61
|
function Blitz(_a) {
|
|
39
62
|
var ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, _b = _a.closeButtonTitle, closeButtonTitle = _b === void 0 ? 'Close' : _b, getRef = _a.getRef, id = _a.id, initialFocusOn = _a.initialFocusOn, isVisible = _a.isVisible, requestClose = _a.requestClose, _c = _a.type, type = _c === void 0 ? 'notification' : _c, rest = __rest(_a, ['aria-label', 'aria-labelledby', 'aria-describedby', "children", "closeButtonTitle", "getRef", "id", "initialFocusOn", "isVisible", "requestClose", "type"]);
|
|
63
|
+
var labelId = (0, react_1.useId)();
|
|
40
64
|
var wrapperClassName = (0, class_names_1.default)('Blitz__Wrapper', {
|
|
41
65
|
'Blitz__Wrapper--show': isVisible
|
|
42
66
|
});
|
|
43
|
-
var alertClassName = (0, class_names_1.default)('Blitz', 'flex', {
|
|
67
|
+
var alertClassName = (0, class_names_1.default)('Blitz', 'flex', 'color--invert', {
|
|
44
68
|
'bg-color--dscout': type === 'notification',
|
|
45
69
|
'bg-color--alert': type === 'alert',
|
|
46
70
|
'bg-color--coachmark': type === 'coaching'
|
|
47
71
|
});
|
|
48
72
|
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { className: wrapperClassName }),
|
|
49
|
-
react_1.default.createElement(focus_trap_1.FocusTrap, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: alertClassName, fallbackFocusOn: DEFAULT_FOCUS_SELECTOR, getRef: getRef, id: id, initialFocusOn: initialFocusOn, role: "alertdialog", setInitialFocus: isVisible },
|
|
50
|
-
children,
|
|
73
|
+
react_1.default.createElement(focus_trap_1.FocusTrap, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby || labelId, "aria-describedby": ariaDescribedby, className: alertClassName, fallbackFocusOn: DEFAULT_FOCUS_SELECTOR, getRef: getRef, id: id, initialFocusOn: initialFocusOn, role: "alertdialog", setInitialFocus: isVisible },
|
|
74
|
+
react_1.default.createElement("span", { className: "flex", id: labelId }, children),
|
|
51
75
|
react_1.default.createElement(modifier_1.Modifier, { margin: { left: '1' } },
|
|
52
76
|
react_1.default.createElement(button_plain_1.ButtonPlain, { "aria-label": closeButtonTitle, name: CLOSE_BUTTON_NAME, onClick: requestClose, title: closeButtonTitle },
|
|
53
77
|
react_1.default.createElement(x_1.IconX, { "aria-hidden": true }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blitz.js","sourceRoot":"","sources":["../../../src/components/blitz.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blitz.js","sourceRoot":"","sources":["../../../src/components/blitz.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqD;AAKrD,qEAAsC;AACtC,6EAAyD;AAEzD,+CAA6C;AAC7C,2CAAyC;AACzC,gCAAmC;AACnC,uCAAsC;AAatC,IAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,IAAM,sBAAsB,GAAG,wBAAgB,iBAAiB,QAAI,CAAC;AAErE,SAAgB,KAAK,CAAC,EAaT;IAZX,IAAc,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,wBAA0B,EAA1B,gBAAgB,mBAAG,OAAO,KAAA,EAC1B,MAAM,YAAA,EACN,EAAE,QAAA,EACF,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,YAAqB,EAArB,IAAI,mBAAG,cAAc,KAAA,EAClB,IAAI,cAZa,4JAarB,CADQ;IAEP,IAAM,OAAO,GAAG,IAAA,aAAK,GAAE,CAAC;IAExB,IAAM,gBAAgB,GAAG,IAAA,qBAAE,EAAC,gBAAgB,EAAE;QAC5C,sBAAsB,EAAE,SAAS;KAClC,CAAC,CAAC;IAEH,IAAM,cAAc,GAAG,IAAA,qBAAE,EAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE;QAC1D,kBAAkB,EAAE,IAAI,KAAK,cAAc;QAC3C,iBAAiB,EAAE,IAAI,KAAK,OAAO;QACnC,qBAAqB,EAAE,IAAI,KAAK,UAAU;KAC3C,CAAC,CAAC;IAEH,OAAO,CACL,kDAAS,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAAE,SAAS,EAAE,gBAAgB;QAC3D,8BAAC,sBAAS,kBACI,SAAS,qBACJ,cAAc,IAAI,OAAO,sBACxB,eAAe,EACjC,SAAS,EAAE,cAAc,EACzB,eAAe,EAAE,sBAAsB,EACvC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,aAAa,EAClB,eAAe,EAAE,SAAS;YAE1B,wCAAM,SAAS,EAAC,MAAM,EAAC,EAAE,EAAE,OAAO,IAC/B,QAAQ,CACJ;YACP,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;gBAC7B,8BAAC,0BAAW,kBACE,gBAAgB,EAC5B,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,gBAAgB;oBAEvB,8BAAC,SAAK,0BAAe,CACT,CACL,CACD,CACR,CACP,CAAC;AACJ,CAAC;AAxDD,sBAwDC"}
|
|
@@ -3,6 +3,7 @@ import type { GetRef } from '../utils/refs';
|
|
|
3
3
|
import type { Colors, CommonComponentProps, ModifierProps } from '../types';
|
|
4
4
|
interface CheckboxInputProps extends CommonComponentProps, ModifierProps {
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
6
7
|
checked?: boolean;
|
|
7
8
|
color?: Colors;
|
|
8
9
|
defaultChecked?: boolean;
|
|
@@ -14,8 +15,9 @@ interface CheckboxInputProps extends CommonComponentProps, ModifierProps {
|
|
|
14
15
|
name?: string;
|
|
15
16
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
16
17
|
readOnly?: boolean;
|
|
18
|
+
required?: boolean;
|
|
17
19
|
tabIndex?: number;
|
|
18
20
|
value?: number | string;
|
|
19
21
|
}
|
|
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;
|
|
22
|
+
export declare function CheckboxInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, checked, color, defaultChecked, disabled, getRef, id, indeterminate, label, name, onChange, readOnly, required, tabIndex, value, ...rest }: CheckboxInputProps): React.JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -40,13 +40,13 @@ function renderIcon(checked, indeterminate, readOnly) {
|
|
|
40
40
|
return react_1.default.createElement(checkbox_check_1.IconCheckboxCheck, { "aria-hidden": true });
|
|
41
41
|
}
|
|
42
42
|
function CheckboxInput(_a) {
|
|
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"]);
|
|
43
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], 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, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "checked", "color", "defaultChecked", "disabled", "getRef", "id", "indeterminate", "label", "name", "onChange", "readOnly", "required", "tabIndex", "value"]);
|
|
44
44
|
var checkboxId = (0, shared_hooks_1.useFallbackId)(id);
|
|
45
45
|
var className = (0, class_names_1.default)('Selector', _modifierClass, {
|
|
46
46
|
'Selector--with-label': label
|
|
47
47
|
});
|
|
48
48
|
return (react_1.default.createElement("div", { className: className },
|
|
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
|
+
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, checked: checked, className: "Selector__Checkbox", defaultChecked: defaultChecked, disabled: disabled || readOnly, id: checkboxId, name: name, onChange: onChange, readOnly: readOnly, required: required, ref: function (ref) {
|
|
50
50
|
if (ref)
|
|
51
51
|
ref.indeterminate = indeterminate;
|
|
52
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,wCAA4C;AAC5C,sCAA6C;AAC7C,6EAAyD;AAEzD,+CAA+C;AAE/C,0DAA4D;AAC5D,0EAA4E;
|
|
1
|
+
{"version":3,"file":"checkbox_input.js","sourceRoot":"","sources":["../../../src/components/checkbox_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;AAC5C,sCAA6C;AAC7C,6EAAyD;AAEzD,+CAA+C;AAE/C,0DAA4D;AAC5D,0EAA4E;AAqB5E,SAAS,UAAU,CACjB,OAAgB,EAChB,aAAsB,EACtB,QAAiB;IAEjB,IAAI,aAAa,IAAI,CAAC,CAAC,OAAO,IAAI,QAAQ,CAAC;QACzC,OAAO,8BAAC,kDAAyB,0BAAe,CAAC;IAEnD,OAAO,8BAAC,kCAAiB,0BAAe,CAAC;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,EAsBT;IArBnB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,OAAO,aAAA,EACP,aAAgB,EAAhB,KAAK,mBAAG,QAAQ,KAAA,EAChB,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,aAAa,mB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AAE,QAAQ,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AA/DD,sCA+DC"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { CommonComponentProps, ModifierProps } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
interface DragAndDropProps extends CommonComponentProps, ModifierProps {
|
|
5
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
5
6
|
accept?: string;
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
disabled?: boolean;
|
|
@@ -15,9 +16,10 @@ interface DragAndDropProps extends CommonComponentProps, ModifierProps {
|
|
|
15
16
|
onDragLeave?: React.DragEventHandler<HTMLInputElement>;
|
|
16
17
|
onDragOver?: React.DragEventHandler<HTMLInputElement>;
|
|
17
18
|
onDrop?: React.DragEventHandler<HTMLInputElement>;
|
|
19
|
+
required?: boolean;
|
|
18
20
|
success?: boolean;
|
|
19
21
|
tabIndex?: number;
|
|
20
22
|
value?: string;
|
|
21
23
|
}
|
|
22
|
-
export declare function DragAndDrop({ _modifierClass, accept, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, error, children, disabled, getRef, id, multiple, name, onChange, onDrop, onDragEnter, onDragOver, onDragLeave, success, tabIndex, value, ...rest }: DragAndDropProps): React.JSX.Element;
|
|
24
|
+
export declare function DragAndDrop({ _modifierClass, accept, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-required': ariaRequired, error, children, disabled, getRef, id, multiple, name, onChange, onDrop, onDragEnter, onDragOver, onDragLeave, required, success, tabIndex, value, ...rest }: DragAndDropProps): React.JSX.Element;
|
|
23
25
|
export {};
|
|
@@ -53,7 +53,7 @@ var react_1 = __importStar(require("react"));
|
|
|
53
53
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
54
54
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
55
55
|
function DragAndDrop(_a) {
|
|
56
|
-
var _modifierClass = _a._modifierClass, accept = _a.accept, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], error = _a.error, children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, multiple = _a.multiple, name = _a.name, onChange = _a.onChange, onDrop = _a.onDrop, onDragEnter = _a.onDragEnter, onDragOver = _a.onDragOver, onDragLeave = _a.onDragLeave, success = _a.success, tabIndex = _a.tabIndex, _b = _a.value, value = _b === void 0 ? '' : _b, rest = __rest(_a, ["_modifierClass", "accept", 'aria-label', 'aria-labelledby', 'aria-describedby', "error", "children", "disabled", "getRef", "id", "multiple", "name", "onChange", "onDrop", "onDragEnter", "onDragOver", "onDragLeave", "success", "tabIndex", "value"]);
|
|
56
|
+
var _modifierClass = _a._modifierClass, accept = _a.accept, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaRequired = _a["aria-required"], error = _a.error, children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, multiple = _a.multiple, name = _a.name, onChange = _a.onChange, onDrop = _a.onDrop, onDragEnter = _a.onDragEnter, onDragOver = _a.onDragOver, onDragLeave = _a.onDragLeave, required = _a.required, success = _a.success, tabIndex = _a.tabIndex, _b = _a.value, value = _b === void 0 ? '' : _b, rest = __rest(_a, ["_modifierClass", "accept", 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-required', "error", "children", "disabled", "getRef", "id", "multiple", "name", "onChange", "onDrop", "onDragEnter", "onDragOver", "onDragLeave", "required", "success", "tabIndex", "value"]);
|
|
57
57
|
var _c = (0, react_1.useState)(false), draggedOver = _c[0], setDraggedOver = _c[1];
|
|
58
58
|
var className = (0, class_names_1.default)('Drag-and-Drop', _modifierClass, {
|
|
59
59
|
'Drag-and-Drop--dragged-over': draggedOver,
|
|
@@ -75,7 +75,7 @@ function DragAndDrop(_a) {
|
|
|
75
75
|
onDragLeave(event);
|
|
76
76
|
}
|
|
77
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 })),
|
|
78
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { accept: accept, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, className: fileInputClassName, disabled: disabled, id: id, multiple: multiple, name: name, onChange: onChange, ref: getRef, required: required, 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;
|
|
1
|
+
{"version":3,"file":"drag_and_drop.js","sourceRoot":"","sources":["../../../src/components/drag_and_drop.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAKxC,qEAA8C;AAC9C,6EAAyD;AAuBzD,SAAgB,WAAW,CAAC,EAwBT;IAvBjB,IAAA,cAAc,oBAAA,EACd,MAAM,YAAA,EACQ,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EAClB,YAAY,sBAAA,EAC7B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AC,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,mBAClB,YAAY,EAC3B,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,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,IACZ;QACD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC;AA7ED,kCA6EC"}
|
|
@@ -4,15 +4,17 @@ import type { GetRef } from '../utils/refs';
|
|
|
4
4
|
interface FileInputProps extends CommonComponentProps, ModifierProps {
|
|
5
5
|
accept?: string;
|
|
6
6
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
7
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
7
8
|
filename?: string;
|
|
8
9
|
getRef?: GetRef<HTMLInputElement>;
|
|
9
10
|
id?: string;
|
|
10
11
|
label?: string;
|
|
11
12
|
multiple?: boolean;
|
|
12
13
|
name?: string;
|
|
14
|
+
required?: boolean;
|
|
13
15
|
value?: string;
|
|
14
16
|
tabIndex?: number;
|
|
15
17
|
onChange?: React.ChangeEventHandler;
|
|
16
18
|
}
|
|
17
|
-
export declare function FileInput({ _modifierClass, accept, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, filename, getRef, id, label, multiple, name, value, tabIndex, onChange, ...rest }: FileInputProps): React.JSX.Element;
|
|
19
|
+
export declare function FileInput({ _modifierClass, accept, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, filename, getRef, id, label, multiple, name, required, value, tabIndex, onChange, ...rest }: FileInputProps): React.JSX.Element;
|
|
18
20
|
export {};
|
|
@@ -30,10 +30,10 @@ var react_1 = __importDefault(require("react"));
|
|
|
30
30
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
31
31
|
var shared_hooks_1 = require("./shared_hooks");
|
|
32
32
|
function FileInput(_a) {
|
|
33
|
-
var _modifierClass = _a._modifierClass, accept = _a.accept, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], filename = _a.filename, getRef = _a.getRef, id = _a.id, label = _a.label, multiple = _a.multiple, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, tabIndex = _a.tabIndex, onChange = _a.onChange, rest = __rest(_a, ["_modifierClass", "accept", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "filename", "getRef", "id", "label", "multiple", "name", "value", "tabIndex", "onChange"]);
|
|
33
|
+
var _modifierClass = _a._modifierClass, accept = _a.accept, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaRequired = _a["aria-required"], filename = _a.filename, getRef = _a.getRef, id = _a.id, label = _a.label, multiple = _a.multiple, name = _a.name, required = _a.required, _b = _a.value, value = _b === void 0 ? '' : _b, tabIndex = _a.tabIndex, onChange = _a.onChange, rest = __rest(_a, ["_modifierClass", "accept", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "filename", "getRef", "id", "label", "multiple", "name", "required", "value", "tabIndex", "onChange"]);
|
|
34
34
|
var inputId = (0, shared_hooks_1.useFallbackId)(id);
|
|
35
35
|
return (react_1.default.createElement("div", { className: _modifierClass },
|
|
36
|
-
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { accept: accept, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref: getRef, id: inputId, className: "File-Input", multiple: multiple, name: name, value: value, onChange: onChange, tabIndex: tabIndex, type: "file" })),
|
|
36
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { accept: accept, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, ref: getRef, id: inputId, className: "File-Input", multiple: multiple, name: name, required: required, value: value, onChange: onChange, tabIndex: tabIndex, type: "file" })),
|
|
37
37
|
react_1.default.createElement("label", { htmlFor: inputId, className: "File-Input__Label Button Button--small Button--color-dscout" }, label),
|
|
38
38
|
!!filename && (react_1.default.createElement("span", { className: "color--gray-2 margin-l--0.75" }, filename))));
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file_input.js","sourceRoot":"","sources":["../../../src/components/file_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,6EAAyD;AACzD,+CAA+C;
|
|
1
|
+
{"version":3,"file":"file_input.js","sourceRoot":"","sources":["../../../src/components/file_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,6EAAyD;AACzD,+CAA+C;AAkB/C,SAAgB,SAAS,CAAC,EAmBT;IAlBf,IAAA,cAAc,oBAAA,EACd,MAAM,YAAA,EACc,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA,EACV,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAlBiB,wNAmBzB,CADQ;IAEP,IAAM,OAAO,GAAG,IAAA,4BAAa,EAAC,EAAE,CAAC,CAAC;IAElC,OAAO,CACL,uCAAK,SAAS,EAAE,cAAc;QAC5B,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,MAAM,EAAE,MAAM,sBACI,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,mBAChB,YAAY,EAC3B,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,OAAO,EACX,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,IACX;QACF,yCACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,6DAA6D,IAEtE,KAAK,CACA;QACP,CAAC,CAAC,QAAQ,IAAI,CACb,wCAAM,SAAS,EAAC,8BAA8B,IAAE,QAAQ,CAAQ,CACjE,CACG,CACP,CAAC;AACJ,CAAC;AAtDD,8BAsDC"}
|
|
@@ -7,7 +7,7 @@ interface FocusTrapProps extends CommonComponentProps {
|
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
fallbackFocusOn?: RefObject<Element> | Element | string;
|
|
9
9
|
getRef?: GetRef<HTMLDivElement | HTMLSpanElement>;
|
|
10
|
-
initialFocusOn?: Element | string;
|
|
10
|
+
initialFocusOn?: RefObject<Element> | Element | string;
|
|
11
11
|
refProp?: string;
|
|
12
12
|
setInitialFocus?: boolean;
|
|
13
13
|
[key: string]: unknown;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
2
|
import type { CommonComponentProps, Spacing } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
interface ModalProps extends CommonComponentProps {
|
|
5
5
|
animationDuration?: number;
|
|
6
6
|
backdropColor?: 'coachmark' | 'default' | 'dscout' | 'main' | 'success';
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
initialFocusOn?: Element | string;
|
|
8
|
+
initialFocusOn?: RefObject<Element> | Element | string;
|
|
9
9
|
getRef?: GetRef;
|
|
10
10
|
id?: string;
|
|
11
11
|
isOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/components/modal.tsx"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/components/modal.tsx"],"names":[],"mappings":";AAAA,4DAA4D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE5D,6CAA2E;AAG3E,qEAA8C;AAC9C,oCAAmD;AACnD,sCAA6C;AAC7C,uDAAiC;AACjC,2CAAyC;AACzC,6EAAyD;AAkBzD,IAAM,gCAAgC,GAAG,GAAG,CAAC,CAAC,2BAA2B;AAEzE,SAAgB,KAAK,CAAC,EAkBT;;IAjBX,IAAc,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,yBAAoD,EAApD,iBAAiB,mBAAG,gCAAgC,KAAA,EACpD,aAAa,mBAAA,EACb,MAAM,YAAA,EACN,EAAE,QAAA,EACF,cAAc,oBAAA,EACd,cAAc,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,QAAQ,cAAA,EACR,eAAa,EAAb,OAAO,mBAAG,GAAG,KAAA,EACb,eAAc,EAAd,OAAO,mBAAG,IAAI,KAAA,EACd,oBAAmB,EAAnB,YAAY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Ac,EACzB,eAAe,EAAE,YAAY,EAC7B,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,UAAC,GAAG;gBACV,IAAI,GAAG;oBAAE,YAAY,CAAC,OAAO,GAAG,GAAG,CAAC;gBACpC,IAAA,mBAAY,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC,EACD,IAAI,EAAC,QAAQ,EACb,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,EAAE,QAAQ,UAAA,EAAE,KAAK,OAAA,EAAE,EAC1B,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAEhC,CAAC,MAAM,IAAI,kBAAkB,IAAI,OAAO,CAAC,IAAI,QAAQ,CAC5C,CACR,CACP,CAAC;AACJ,CAAC;AAjID,sBAiIC"}
|
|
@@ -13,8 +13,9 @@ interface RadioInputProps extends CommonComponentProps, ModifierProps {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
15
|
readOnly?: boolean;
|
|
16
|
+
required?: boolean;
|
|
16
17
|
tabIndex?: number;
|
|
17
18
|
value?: number | string;
|
|
18
19
|
}
|
|
19
|
-
export declare function RadioInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, checked, color, defaultChecked, disabled, getRef, id, label, name, onChange, readOnly, tabIndex, value, ...rest }: RadioInputProps): React.JSX.Element;
|
|
20
|
+
export declare function RadioInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, checked, color, defaultChecked, disabled, getRef, id, label, name, onChange, readOnly, required, tabIndex, value, ...rest }: RadioInputProps): React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -33,13 +33,13 @@ var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
|
33
33
|
var shared_hooks_1 = require("./shared_hooks");
|
|
34
34
|
var radio_circle_1 = require("../icons/radio_circle");
|
|
35
35
|
function RadioInput(_a) {
|
|
36
|
-
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, 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", "label", "name", "onChange", "readOnly", "tabIndex", "value"]);
|
|
36
|
+
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, label = _a.label, name = _a.name, onChange = _a.onChange, readOnly = _a.readOnly, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "checked", "color", "defaultChecked", "disabled", "getRef", "id", "label", "name", "onChange", "readOnly", "required", "tabIndex", "value"]);
|
|
37
37
|
var radioId = (0, shared_hooks_1.useFallbackId)(id);
|
|
38
38
|
var className = (0, class_names_1.default)('Selector', _modifierClass, {
|
|
39
39
|
'Selector--with-label': label
|
|
40
40
|
});
|
|
41
41
|
return (react_1.default.createElement("div", { className: className },
|
|
42
|
-
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__Radio", defaultChecked: defaultChecked, disabled: disabled, id: radioId, name: name, onChange: onChange, readOnly: readOnly, ref: getRef, tabIndex: tabIndex, type: "radio", value: (0, forms_1.inputValue)(value, onChange) })),
|
|
42
|
+
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__Radio", defaultChecked: defaultChecked, disabled: disabled, id: radioId, name: name, onChange: onChange, readOnly: readOnly, required: required, ref: getRef, tabIndex: tabIndex, type: "radio", value: (0, forms_1.inputValue)(value, onChange) })),
|
|
43
43
|
react_1.default.createElement("div", { className: (0, class_names_1.default)('Selector__Field', "color--".concat(color)) }),
|
|
44
44
|
label && (react_1.default.createElement("label", { className: "Selector__Label", htmlFor: radioId }, label)),
|
|
45
45
|
react_1.default.createElement(radio_circle_1.IconRadioCircle, { "aria-hidden": true })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio_input.js","sourceRoot":"","sources":["../../../src/components/radio_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AAEzD,+CAA+C;AAE/C,sDAAwD;
|
|
1
|
+
{"version":3,"file":"radio_input.js","sourceRoot":"","sources":["../../../src/components/radio_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,qEAA8C;AAC9C,wCAA4C;AAC5C,6EAAyD;AAEzD,+CAA+C;AAE/C,sDAAwD;AAmBxD,SAAgB,UAAU,CAAC,EAoBT;IAnBhB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EAC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AAC;AA3DD,gCA2DC"}
|
|
@@ -12,9 +12,10 @@ interface RangeInputProps extends CommonComponentProps, ModifierProps {
|
|
|
12
12
|
minimum?: number | string;
|
|
13
13
|
name?: string;
|
|
14
14
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
|
+
required?: boolean;
|
|
15
16
|
step?: string | number;
|
|
16
17
|
tabIndex?: number;
|
|
17
18
|
value?: number | string;
|
|
18
19
|
}
|
|
19
|
-
export declare function RangeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, getRef, id, defaultValue, disabled, maximum, minimum, name, onChange, tabIndex, value, step, ...rest }: RangeInputProps): React.JSX.Element;
|
|
20
|
+
export declare function RangeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, getRef, id, defaultValue, disabled, maximum, minimum, name, onChange, required, tabIndex, value, step, ...rest }: RangeInputProps): React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -34,9 +34,9 @@ function renderMinOrMax(value) {
|
|
|
34
34
|
return react_1.default.createElement("div", { className: className }, value);
|
|
35
35
|
}
|
|
36
36
|
function RangeInput(_a) {
|
|
37
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, getRef = _a.getRef, id = _a.id, defaultValue = _a.defaultValue, disabled = _a.disabled, maximum = _a.maximum, minimum = _a.minimum, name = _a.name, onChange = _a.onChange, tabIndex = _a.tabIndex, value = _a.value, step = _a.step, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "getRef", "id", "defaultValue", "disabled", "maximum", "minimum", "name", "onChange", "tabIndex", "value", "step"]);
|
|
37
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, getRef = _a.getRef, id = _a.id, defaultValue = _a.defaultValue, disabled = _a.disabled, maximum = _a.maximum, minimum = _a.minimum, name = _a.name, onChange = _a.onChange, required = _a.required, tabIndex = _a.tabIndex, value = _a.value, step = _a.step, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "getRef", "id", "defaultValue", "disabled", "maximum", "minimum", "name", "onChange", "required", "tabIndex", "value", "step"]);
|
|
38
38
|
return (react_1.default.createElement("fieldset", { className: _modifierClass },
|
|
39
|
-
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, className: "Range margin-t--0.75 margin-b--1", defaultValue: defaultValue, id: id, max: maximum || 100, min: minimum || 0, name: name, onChange: onChange, ref: getRef, step: step, tabIndex: tabIndex, type: "range", disabled: disabled, value: value })),
|
|
39
|
+
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, className: "Range margin-t--0.75 margin-b--1", defaultValue: defaultValue, id: id, max: maximum || 100, min: minimum || 0, name: name, onChange: onChange, ref: getRef, required: required, step: step, tabIndex: tabIndex, type: "range", disabled: disabled, value: value })),
|
|
40
40
|
((0, types_1.exists)(minimum) || (0, types_1.exists)(maximum)) && (react_1.default.createElement("div", { className: "flex justify--between" },
|
|
41
41
|
renderMinOrMax(minimum),
|
|
42
42
|
renderMinOrMax(maximum)))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range_input.js","sourceRoot":"","sources":["../../../src/components/range_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,wCAAwC;AACxC,6EAAyD;
|
|
1
|
+
{"version":3,"file":"range_input.js","sourceRoot":"","sources":["../../../src/components/range_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAK1B,wCAAwC;AACxC,6EAAyD;AAmBzD,SAAS,cAAc,CAAC,KAAsB;IAC5C,IAAM,SAAS,GAAG,yCAAyC,CAAC;IAE5D,OAAO,uCAAK,SAAS,EAAE,SAAS,IAAG,KAAK,CAAO,CAAC;AAClD,CAAC;AAED,SAAgB,UAAU,CAAC,EAoBT;IAnBhB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,YAAY,kBAAA,EACZ,MAAM,YAAA,EACN,EAAE,QAAA,EACF,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,IAAI,UAAA,EACD,IAAI,cAnBkB,sOAoB1B,CADQ;IAEP,OAAO,CACL,4CAAU,SAAS,EAAE,cAAc;QACjC,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,wBACT,eAAe,kBACnB,WAAW,gBACb,SAAS,qBACJ,cAAc,EAC/B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAC,kCAAkC,EAC5C,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,OAAO,IAAI,GAAG,EACnB,GAAG,EAAE,OAAO,IAAI,CAAC,EACjB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,IACZ;QACD,CAAC,IAAA,cAAM,EAAC,OAAO,CAAC,IAAI,IAAA,cAAM,EAAC,OAAO,CAAC,CAAC,IAAI,CACvC,uCAAK,SAAS,EAAC,uBAAuB;YACnC,cAAc,CAAC,OAAO,CAAC;YACvB,cAAc,CAAC,OAAO,CAAC,CACpB,CACP,CACQ,CACZ,CAAC;AACJ,CAAC;AArDD,gCAqDC"}
|
|
@@ -3,6 +3,7 @@ import type { CommonComponentProps, ModifierProps } from '../types';
|
|
|
3
3
|
import { type GetRef } from '../utils/refs';
|
|
4
4
|
interface SelectInputProps extends CommonComponentProps, ModifierProps {
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
6
7
|
autoComplete?: string;
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
defaultValue?: number | string;
|
|
@@ -16,9 +17,10 @@ interface SelectInputProps extends CommonComponentProps, ModifierProps {
|
|
|
16
17
|
onFocus?: React.FocusEventHandler<HTMLSelectElement>;
|
|
17
18
|
prefix?: React.ReactNode;
|
|
18
19
|
readOnly?: boolean;
|
|
20
|
+
required?: boolean;
|
|
19
21
|
suffix?: React.ReactNode;
|
|
20
22
|
tabIndex?: number;
|
|
21
23
|
value?: number | string;
|
|
22
24
|
}
|
|
23
|
-
export declare function SelectInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, children, defaultValue, disabled, getRef, id, invalid, mini, name, onChange, onFocus, prefix, readOnly, suffix, tabIndex, value, ...rest }: SelectInputProps): React.JSX.Element;
|
|
25
|
+
export declare function SelectInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, children, defaultValue, disabled, getRef, id, invalid, mini, name, onChange, onFocus, prefix, readOnly, required, suffix, tabIndex, value, ...rest }: SelectInputProps): React.JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -57,7 +57,7 @@ var triangle_inverted_1 = require("../icons/triangle_inverted");
|
|
|
57
57
|
var with_addons_1 = require("./with_addons");
|
|
58
58
|
function SelectInput(_a) {
|
|
59
59
|
var _b;
|
|
60
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], autoComplete = _a.autoComplete, children = _a.children, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, _c = _a.mini, mini = _c === void 0 ? false : _c, name = _a.name, onChange = _a.onChange, onFocus = _a.onFocus, 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", "children", "defaultValue", "disabled", "getRef", "id", "invalid", "mini", "name", "onChange", "onFocus", "prefix", "readOnly", "suffix", "tabIndex", "value"]);
|
|
60
|
+
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, children = _a.children, defaultValue = _a.defaultValue, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, invalid = _a.invalid, _c = _a.mini, mini = _c === void 0 ? false : _c, name = _a.name, onChange = _a.onChange, onFocus = _a.onFocus, 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", "children", "defaultValue", "disabled", "getRef", "id", "invalid", "mini", "name", "onChange", "onFocus", "prefix", "readOnly", "required", "suffix", "tabIndex", "value"]);
|
|
61
61
|
var isControlledInput = value !== undefined;
|
|
62
62
|
var _d = (0, react_1.useState)(isControlledInput ? null : !!defaultValue), filled = _d[0], setFilled = _d[1];
|
|
63
63
|
var inputRef = (0, react_1.useRef)(null);
|
|
@@ -96,7 +96,7 @@ function SelectInput(_a) {
|
|
|
96
96
|
'Input--mini': mini
|
|
97
97
|
});
|
|
98
98
|
var input = (react_1.default.createElement("div", { className: wrapperClassName },
|
|
99
|
-
react_1.default.createElement("select", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, autoComplete: autoComplete, className: selectClassName, defaultValue: defaultValue, disabled: disabled, id: id, name: name, onChange: function (event) {
|
|
99
|
+
react_1.default.createElement("select", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete, className: selectClassName, defaultValue: defaultValue, disabled: disabled, id: id, name: name, onChange: function (event) {
|
|
100
100
|
if (isControlledInput) {
|
|
101
101
|
if (onChange)
|
|
102
102
|
onChange(event);
|
|
@@ -107,7 +107,7 @@ function SelectInput(_a) {
|
|
|
107
107
|
}, onFocus: onFocus, tabIndex: tabIndex, ref: function (ref) {
|
|
108
108
|
(0, refs_1.handleGetRef)(inputRef, ref);
|
|
109
109
|
(0, refs_1.handleGetRef)(getRef, ref);
|
|
110
|
-
}, value: value }), children),
|
|
110
|
+
}, required: required, value: value }), children),
|
|
111
111
|
react_1.default.createElement("div", { className: "Dropdown__Toggle__Icon" },
|
|
112
112
|
react_1.default.createElement(triangle_inverted_1.IconTriangleInverted, null))));
|
|
113
113
|
if (affixed) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select_input.js","sourceRoot":"","sources":["../../../src/components/select_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAG3D,sCAA0D;AAE1D,qEAA8C;AAC9C,6EAAyD;AAEzD,gEAAkE;AAClE,6CAA2C;
|
|
1
|
+
{"version":3,"file":"select_input.js","sourceRoot":"","sources":["../../../src/components/select_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAG3D,sCAA0D;AAE1D,qEAA8C;AAC9C,6EAAyD;AAEzD,gEAAkE;AAClE,6CAA2C;AAwB3C,SAAgB,WAAW,CAAC,EAyBT;;IAxBjB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EAChB,YAAY,sBAAA,EAC7B,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,OAAO,aAAA,EACP,YAAY,EAAZ,IAAI,mBAAG,KAAK,KAAA,EACZ,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,KAAK,WAAA,EACF,IAAI,cAxBmB,mSAyB3B,CADQ;IAEP,IAAM,iBAAiB,GAAG,KAAK,KAAK,SAAS,CAAC;IAExC,IAAA,KAAsB,IAAA,gBAAQ,EAClC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAC1C,EAF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,iBAAiB,EAAE;oBACrB,IAAI,QAAQ;wBAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;iBAC/B;qBAAM;oBACL,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;iBACjC;YACH,CAAC,EACD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,UAAC,GAAG;gBACP,IAAA,mBAAY,EAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;gBAC5B,IAAA,mBAAY,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,KAEX,QAAQ,CACF;QACT,uCAAK,SAAS,EAAC,wBAAwB;YACrC,8BAAC,wCAAoB,OAAG,CACpB,CACF,CACP,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;AA3HD,kCA2HC"}
|
|
@@ -4,6 +4,7 @@ import type { GetRef } from '../utils/refs';
|
|
|
4
4
|
type TshirtSize = 'small' | 'medium' | 'large';
|
|
5
5
|
interface TextareaProps extends CommonComponentProps, ModifierProps {
|
|
6
6
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
7
|
+
'aria-required'?: React.AriaAttributes['aria-required'];
|
|
7
8
|
autoComplete?: string;
|
|
8
9
|
autoFocus?: boolean;
|
|
9
10
|
defaultValue?: string;
|
|
@@ -22,7 +23,8 @@ interface TextareaProps extends CommonComponentProps, ModifierProps {
|
|
|
22
23
|
onPaste?: React.ClipboardEventHandler<HTMLTextAreaElement>;
|
|
23
24
|
placeholder?: string;
|
|
24
25
|
readOnly?: boolean;
|
|
26
|
+
required?: boolean;
|
|
25
27
|
value?: string;
|
|
26
28
|
}
|
|
27
|
-
export declare function Textarea({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, autoComplete, autoFocus, defaultValue, disabled, getRef, height, id, invalid, maxLength, name, onBlur, onChange, onCut, onFocus, onKeyDown, onPaste, placeholder, readOnly, value, ...rest }: TextareaProps): React.JSX.Element;
|
|
29
|
+
export declare function Textarea({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-required': ariaRequired, autoComplete, autoFocus, defaultValue, disabled, getRef, height, id, invalid, maxLength, name, onBlur, onChange, onCut, onFocus, onKeyDown, onPaste, placeholder, readOnly, required, value, ...rest }: TextareaProps): React.JSX.Element;
|
|
28
30
|
export {};
|
|
@@ -44,13 +44,13 @@ function heightClassName(height) {
|
|
|
44
44
|
return "height--".concat(heightEnum);
|
|
45
45
|
}
|
|
46
46
|
function Textarea(_a) {
|
|
47
|
-
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, height = _a.height, id = _a.id, invalid = _a.invalid, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onCut = _a.onCut, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, readOnly = _a.readOnly, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "height", "id", "invalid", "maxLength", "name", "onBlur", "onChange", "onCut", "onFocus", "onKeyDown", "onPaste", "placeholder", "readOnly", "value"]);
|
|
47
|
+
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, height = _a.height, id = _a.id, invalid = _a.invalid, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onCut = _a.onCut, onFocus = _a.onFocus, onKeyDown = _a.onKeyDown, onPaste = _a.onPaste, placeholder = _a.placeholder, readOnly = _a.readOnly, required = _a.required, value = _a.value, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', 'aria-required', "autoComplete", "autoFocus", "defaultValue", "disabled", "getRef", "height", "id", "invalid", "maxLength", "name", "onBlur", "onChange", "onCut", "onFocus", "onKeyDown", "onPaste", "placeholder", "readOnly", "required", "value"]);
|
|
48
48
|
var textareaClassName = (0, class_names_1.default)('Input', 'resize--vertical', heightClassName(height), _modifierClass, {
|
|
49
49
|
'Input--invalid': invalid
|
|
50
50
|
});
|
|
51
|
-
return (react_1.default.createElement("textarea", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, autoComplete: autoComplete,
|
|
51
|
+
return (react_1.default.createElement("textarea", __assign({}, (0, data_attributes_1.default)(rest), { "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-required": ariaRequired, autoComplete: autoComplete,
|
|
52
52
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
53
|
-
autoFocus: autoFocus, className: textareaClassName, defaultValue: defaultValue, disabled: disabled, id: id, maxLength: maxLength, name: name, onBlur: onBlur, onChange: onChange, onCut: onCut, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, readOnly: readOnly, ref: getRef, value: (0, forms_1.inputValue)(value, onChange) })));
|
|
53
|
+
autoFocus: autoFocus, className: textareaClassName, defaultValue: defaultValue, disabled: disabled, id: id, maxLength: maxLength, name: name, onBlur: onBlur, onChange: onChange, onCut: onCut, onFocus: onFocus, onKeyDown: onKeyDown, onPaste: onPaste, placeholder: placeholder, readOnly: readOnly, required: required, ref: getRef, value: (0, forms_1.inputValue)(value, onChange) })));
|
|
54
54
|
}
|
|
55
55
|
exports.Textarea = Textarea;
|
|
56
56
|
//# sourceMappingURL=textarea.js.map
|