@vitality-ds/components 4.8.0 → 4.8.1
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/dist/Form/FormField/components/FormFieldLabel/index.spec.js +3 -3
- package/dist/Form/FormField/index.js +13 -4
- package/dist/Form/FormField/styles/IconWrapper.styles.js +8 -1
- package/dist/Form/Label/index.js +2 -3
- package/dist/components/src/Form/FormField/components/FormFieldLabel/index.spec.js +3 -3
- package/dist/components/src/Form/FormField/components/FormFieldLabel/index.spec.js.map +1 -1
- package/dist/components/src/Form/FormField/components/FormFieldLabel/types.d.ts +2 -2
- package/dist/components/src/Form/FormField/components/FormFieldLabel/types.d.ts.map +1 -1
- package/dist/components/src/Form/FormField/constants.d.ts +1 -1
- package/dist/components/src/Form/FormField/index.d.ts.map +1 -1
- package/dist/components/src/Form/FormField/index.js +9 -3
- package/dist/components/src/Form/FormField/index.js.map +1 -1
- package/dist/components/src/Form/FormField/styles/IconWrapper.styles.d.ts.map +1 -1
- package/dist/components/src/Form/FormField/styles/IconWrapper.styles.js +7 -0
- package/dist/components/src/Form/FormField/styles/IconWrapper.styles.js.map +1 -1
- package/dist/components/src/Form/Label/index.d.ts +1 -1
- package/dist/components/src/Form/Label/index.d.ts.map +1 -1
- package/dist/components/src/Form/Label/index.js +2 -2
- package/dist/components/src/Form/Label/index.js.map +1 -1
- package/dist/components/src/Input/Textarea/index.d.ts +1 -1
- package/dist/esm/Form/FormField/components/FormFieldLabel/index.spec.js +3 -3
- package/dist/esm/Form/FormField/index.js +13 -4
- package/dist/esm/Form/FormField/styles/IconWrapper.styles.js +9 -2
- package/dist/esm/Form/Label/index.js +2 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -9,7 +9,7 @@ describe("getInputComponent", function () {
|
|
|
9
9
|
var _render = (0, _react.render)(/*#__PURE__*/_react2["default"].createElement(_index["default"], {
|
|
10
10
|
fieldType: "text",
|
|
11
11
|
content: "Foo",
|
|
12
|
-
|
|
12
|
+
htmlFor: "foo"
|
|
13
13
|
})),
|
|
14
14
|
container = _render.container;
|
|
15
15
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
@@ -18,7 +18,7 @@ describe("getInputComponent", function () {
|
|
|
18
18
|
var _render2 = (0, _react.render)(/*#__PURE__*/_react2["default"].createElement(_index["default"], {
|
|
19
19
|
fieldType: "text",
|
|
20
20
|
content: "Foo",
|
|
21
|
-
|
|
21
|
+
htmlFor: "foo"
|
|
22
22
|
})),
|
|
23
23
|
container = _render2.container;
|
|
24
24
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
@@ -27,7 +27,7 @@ describe("getInputComponent", function () {
|
|
|
27
27
|
var _render3 = (0, _react.render)(/*#__PURE__*/_react2["default"].createElement(_index["default"], {
|
|
28
28
|
fieldType: "checkbox",
|
|
29
29
|
content: "Foo",
|
|
30
|
-
|
|
30
|
+
htmlFor: "foo"
|
|
31
31
|
})),
|
|
32
32
|
container = _render3.container;
|
|
33
33
|
expect(container.children[0].tagName).toEqual("LEGEND");
|
|
@@ -8,7 +8,9 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _icons = require("@vitality-ds/icons");
|
|
11
|
+
var _system = require("@vitality-ds/system");
|
|
11
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _Box = _interopRequireDefault(require("../../Box"));
|
|
12
14
|
var _Stack = _interopRequireDefault(require("../../Stack"));
|
|
13
15
|
var _Tooltip = _interopRequireDefault(require("../../Tooltip"));
|
|
14
16
|
var _HelperMessage = _interopRequireDefault(require("../HelperMessage"));
|
|
@@ -37,18 +39,25 @@ function FormField(_ref) {
|
|
|
37
39
|
spacing: "sm",
|
|
38
40
|
direction: "horizontal",
|
|
39
41
|
align: "center"
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
43
|
+
maxWidth: infoTooltipContent ? "90%" : "100%"
|
|
40
44
|
}, /*#__PURE__*/_react["default"].createElement(_FormFieldLabel["default"], {
|
|
41
45
|
fieldType: type,
|
|
42
46
|
content: label,
|
|
43
|
-
|
|
47
|
+
htmlFor: id,
|
|
44
48
|
required: required,
|
|
45
49
|
hasError: hasError
|
|
46
|
-
}), infoTooltipContent && /*#__PURE__*/_react["default"].createElement(
|
|
50
|
+
})), infoTooltipContent && /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
51
|
+
maxWidth: "10%",
|
|
52
|
+
minWidth: "16px" // this is the same width as the icon size="sm"
|
|
53
|
+
,
|
|
54
|
+
minHeight: _system.theme.fontSizes.caption.value
|
|
55
|
+
}, /*#__PURE__*/_react["default"].createElement(_styled.IconWrapper, null, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
47
56
|
content: infoTooltipContent
|
|
48
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
57
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_icons.Info, {
|
|
49
58
|
color: "inherit",
|
|
50
59
|
size: "sm"
|
|
51
|
-
})))), /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
|
|
60
|
+
})))))), /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
|
|
52
61
|
onChange: onChange,
|
|
53
62
|
value: value,
|
|
54
63
|
id: id,
|
|
@@ -6,5 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _system = require("@vitality-ds/system");
|
|
8
8
|
var _default = exports["default"] = (0, _system.css)({
|
|
9
|
-
margin: "unset"
|
|
9
|
+
margin: "unset",
|
|
10
|
+
position: "relative",
|
|
11
|
+
"& > div": {
|
|
12
|
+
height: _system.theme.fontSizes.caption.value,
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center"
|
|
16
|
+
}
|
|
10
17
|
});
|
package/dist/Form/Label/index.js
CHANGED
|
@@ -9,12 +9,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _styled = require("./styled");
|
|
10
10
|
function Label(_ref) {
|
|
11
11
|
var content = _ref.content,
|
|
12
|
-
|
|
12
|
+
htmlFor = _ref.htmlFor,
|
|
13
13
|
required = _ref.required,
|
|
14
14
|
hasError = _ref.hasError;
|
|
15
15
|
return /*#__PURE__*/_react["default"].createElement(_styled.BaseLabel, {
|
|
16
|
-
htmlFor:
|
|
17
|
-
id: id
|
|
16
|
+
htmlFor: htmlFor
|
|
18
17
|
}, content, required && /*#__PURE__*/_react["default"].createElement(_styled.BaseLabelRequired, {
|
|
19
18
|
hasError: hasError
|
|
20
19
|
}, "*"));
|
|
@@ -8,15 +8,15 @@ var react_2 = __importDefault(require("react"));
|
|
|
8
8
|
var index_1 = __importDefault(require("./index"));
|
|
9
9
|
describe("getInputComponent", function () {
|
|
10
10
|
it("should return a <label> component when no fieldType is provided", function () {
|
|
11
|
-
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "text", content: "Foo",
|
|
11
|
+
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "text", content: "Foo", htmlFor: "foo" })).container;
|
|
12
12
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
13
13
|
});
|
|
14
14
|
it("should return a <label> component when no fieldType `text` is provided", function () {
|
|
15
|
-
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "text", content: "Foo",
|
|
15
|
+
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "text", content: "Foo", htmlFor: "foo" })).container;
|
|
16
16
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
17
17
|
});
|
|
18
18
|
it("should return a <legend> element when passed a checkbox type", function () {
|
|
19
|
-
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "checkbox", content: "Foo",
|
|
19
|
+
var container = (0, react_1.render)(react_2.default.createElement(index_1.default, { fieldType: "checkbox", content: "Foo", htmlFor: "foo" })).container;
|
|
20
20
|
expect(container.children[0].tagName).toEqual("LEGEND");
|
|
21
21
|
});
|
|
22
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../../../../src/Form/FormField/components/FormFieldLabel/index.spec.tsx"],"names":[],"mappings":";;;;;AAAA,gDAAgD;AAChD,gDAA0B;AAE1B,kDAAqC;AAErC,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,EAAE,CAAC,iEAAiE,EAAE;QAC5D,IAAA,SAAS,GAAK,IAAA,cAAM,EAC1B,8BAAC,eAAc,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../../../../src/Form/FormField/components/FormFieldLabel/index.spec.tsx"],"names":[],"mappings":";;;;;AAAA,gDAAgD;AAChD,gDAA0B;AAE1B,kDAAqC;AAErC,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,EAAE,CAAC,iEAAiE,EAAE;QAC5D,IAAA,SAAS,GAAK,IAAA,cAAM,EAC1B,8BAAC,eAAc,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,KAAK,GAAG,CAChE,UAFgB,CAEf;QACF,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,wEAAwE,EAAE;QACnE,IAAA,SAAS,GAAK,IAAA,cAAM,EAC1B,8BAAC,eAAc,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,KAAK,GAAG,CAChE,UAFgB,CAEf;QACF,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,8DAA8D,EAAE;QACzD,IAAA,SAAS,GAAK,IAAA,cAAM,EAC1B,8BAAC,eAAc,IAAC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,KAAK,GAAG,CACpE,UAFgB,CAEf;QACF,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -17,9 +17,9 @@ export declare type FormFieldLabelProps<T> = ExcludedProps & {
|
|
|
17
17
|
*/
|
|
18
18
|
required?: valueof<Pick<CommonProps, "required">>;
|
|
19
19
|
/**
|
|
20
|
-
* Id used for the
|
|
20
|
+
* Id used for the htmlFor attribute that should match the input's id
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
htmlFor: valueof<Pick<HTMLLabelElement, "htmlFor">>;
|
|
23
23
|
/**
|
|
24
24
|
* Indicates the associated field type - used to determine whether to use a <label> or <fieldset> element
|
|
25
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/Form/FormField/components/FormFieldLabel/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,oBAAY,SAAS,GAAG,KA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,CAAC,CAAC;IACpD;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC"}
|
|
@@ -2498,7 +2498,7 @@ export declare const INPUT_MAPPINGS: {
|
|
|
2498
2498
|
resize?: "none" | "auto" | "horizontal" | "vertical" | "smart";
|
|
2499
2499
|
maxRows?: number;
|
|
2500
2500
|
minRows?: number;
|
|
2501
|
-
}, "name" | "disabled" | "placeholder" | "value" | "color" | "resize" | "translate" | "css" | "prefix" | "hidden" | "style" | "wrap" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "asChild" | "as" | "autoFocus" | "required" | "
|
|
2501
|
+
}, "name" | "disabled" | "placeholder" | "value" | "color" | "resize" | "translate" | "css" | "prefix" | "hidden" | "style" | "wrap" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "asChild" | "as" | "autoFocus" | "required" | "cols" | "rows" | "hasError" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "dirName" | "minRows" | "maxRows"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
2502
2502
|
};
|
|
2503
2503
|
password: {
|
|
2504
2504
|
component: import("react").ForwardRefExoticComponent<Pick<Omit<import("../../Input/TextInput/types").TextInputProps<"text", "text">, "type" | "adornEnd"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Form/FormField/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Form/FormField/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,KAAK,EAEV,cAAc,EACd,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,iBAAS,SAAS,CAAC,CAAC,SAAS,qBAAqB,EAAE,EAClD,KAAK,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,KAAK,EACL,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,kBAAkB,EAClB,GAAG,SAAS,EACb,EAAE,cAAc,CAAC,CAAC,CAAC,eAyDnB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -26,7 +26,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var icons_1 = require("@vitality-ds/icons");
|
|
29
|
+
var system_1 = require("@vitality-ds/system");
|
|
29
30
|
var react_1 = __importDefault(require("react"));
|
|
31
|
+
var Box_1 = __importDefault(require("../../Box"));
|
|
30
32
|
var Stack_1 = __importDefault(require("../../Stack"));
|
|
31
33
|
var Tooltip_1 = __importDefault(require("../../Tooltip"));
|
|
32
34
|
var HelperMessage_1 = __importDefault(require("../HelperMessage"));
|
|
@@ -42,10 +44,14 @@ function FormField(_a) {
|
|
|
42
44
|
var ariaErrorId = (0, logic_1.getErrorMessageId)(id);
|
|
43
45
|
return (react_1.default.createElement(Fieldset_1.default, __assign({}, restProps),
|
|
44
46
|
react_1.default.createElement(Stack_1.default, { spacing: "sm", direction: "horizontal", align: "center" },
|
|
45
|
-
react_1.default.createElement(
|
|
46
|
-
|
|
47
|
+
react_1.default.createElement(Box_1.default, { maxWidth: infoTooltipContent ? "90%" : "100%" },
|
|
48
|
+
react_1.default.createElement(FormFieldLabel_1.default, { fieldType: type, content: label, htmlFor: id, required: required, hasError: hasError })),
|
|
49
|
+
infoTooltipContent && (react_1.default.createElement(Box_1.default, { maxWidth: "10%", minWidth: "16px" // this is the same width as the icon size="sm"
|
|
50
|
+
, minHeight: system_1.theme.fontSizes.caption.value },
|
|
47
51
|
react_1.default.createElement(styled_1.IconWrapper, null,
|
|
48
|
-
react_1.default.createElement(
|
|
52
|
+
react_1.default.createElement(Tooltip_1.default, { content: infoTooltipContent },
|
|
53
|
+
react_1.default.createElement("div", null,
|
|
54
|
+
react_1.default.createElement(icons_1.Info, { color: "inherit", size: "sm" }))))))),
|
|
49
55
|
react_1.default.createElement(Component, __assign({ onChange: onChange, value: value, id: id, "aria-labelledby": id, "aria-describedby": ariaDescribedById, "aria-required": required, "aria-errormessage": ariaErrorId, required: required, hasError: hasError }, inputProps)),
|
|
50
56
|
helperMessage && (react_1.default.createElement(HelperMessage_1.default, { hasError: hasError, id: hasError ? ariaErrorId : ariaDescribedById }, helperMessage))));
|
|
51
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Form/FormField/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA0C;AAC1C,gDAA0B;AAE1B,sDAAgC;AAChC,0DAAoC;AACpC,mEAA6C;AAC7C,mEAA6C;AAC7C,+EAAyD;AACzD,iCAIiB;AACjB,mCAAuC;AAOvC,SAAS,SAAS,CAAkC,EAYhC;IAXlB,IAAA,KAAK,WAAA,E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C,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,IAE7C,aAAa,CACA,CACjB,CACQ,CACZ,CAAC;AACJ,CAAC;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWrapper.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/Form/FormField/styles/IconWrapper.styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,
|
|
1
|
+
{"version":3,"file":"IconWrapper.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/Form/FormField/styles/IconWrapper.styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAUG"}
|
|
@@ -3,5 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var system_1 = require("@vitality-ds/system");
|
|
4
4
|
exports.default = (0, system_1.css)({
|
|
5
5
|
margin: "unset",
|
|
6
|
+
position: "relative",
|
|
7
|
+
"& > div": {
|
|
8
|
+
height: system_1.theme.fontSizes.caption.value,
|
|
9
|
+
display: "flex",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
},
|
|
6
13
|
});
|
|
7
14
|
//# sourceMappingURL=IconWrapper.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconWrapper.styles.js","sourceRoot":"","sources":["../../../../../../src/Form/FormField/styles/IconWrapper.styles.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"IconWrapper.styles.js","sourceRoot":"","sources":["../../../../../../src/Form/FormField/styles/IconWrapper.styles.ts"],"names":[],"mappings":";;AAAA,8CAAiD;AAEjD,kBAAe,IAAA,YAAG,EAAC;IACjB,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,UAAU;IAEpB,SAAS,EAAE;QACT,MAAM,EAAE,cAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;QACrC,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { LabelProps } from "./types";
|
|
3
|
-
declare function Label({ content,
|
|
3
|
+
declare function Label({ content, htmlFor, required, hasError }: LabelProps): JSX.Element;
|
|
4
4
|
export default Label;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Form/Label/index.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,iBAAS,KAAK,CAAC,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Form/Label/index.tsx"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,iBAAS,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,eAOlE;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var styled_1 = require("./styled");
|
|
8
8
|
function Label(_a) {
|
|
9
|
-
var content = _a.content,
|
|
10
|
-
return (react_1.default.createElement(styled_1.BaseLabel, { htmlFor:
|
|
9
|
+
var content = _a.content, htmlFor = _a.htmlFor, required = _a.required, hasError = _a.hasError;
|
|
10
|
+
return (react_1.default.createElement(styled_1.BaseLabel, { htmlFor: htmlFor },
|
|
11
11
|
content,
|
|
12
12
|
required && react_1.default.createElement(styled_1.BaseLabelRequired, { hasError: hasError }, "*")));
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Form/Label/index.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAE1B,mCAAwD;AAGxD,SAAS,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/Form/Label/index.tsx"],"names":[],"mappings":";;;;;AAAA,gDAA0B;AAE1B,mCAAwD;AAGxD,SAAS,KAAK,CAAC,EAAoD;QAAlD,OAAO,aAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,QAAQ,cAAA;IACnD,OAAO,CACL,8BAAC,kBAAS,IAAC,OAAO,EAAE,OAAO;QACxB,OAAO;QACP,QAAQ,IAAI,8BAAC,0BAAiB,IAAC,QAAQ,EAAE,QAAQ,QAAuB,CAC/D,CACb,CAAC;AACJ,CAAC;AAED,kBAAe,KAAK,CAAC"}
|
|
@@ -836,6 +836,6 @@ declare const Textarea: React.ForwardRefExoticComponent<Pick<{
|
|
|
836
836
|
resize?: "none" | "auto" | "horizontal" | "vertical" | "smart";
|
|
837
837
|
maxRows?: number;
|
|
838
838
|
minRows?: number;
|
|
839
|
-
}, "name" | "disabled" | "placeholder" | "value" | "color" | "resize" | "translate" | "css" | "prefix" | "hidden" | "style" | "wrap" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "asChild" | "as" | "autoFocus" | "required" | "
|
|
839
|
+
}, "name" | "disabled" | "placeholder" | "value" | "color" | "resize" | "translate" | "css" | "prefix" | "hidden" | "style" | "wrap" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "asChild" | "as" | "autoFocus" | "required" | "cols" | "rows" | "hasError" | "autoComplete" | "maxLength" | "minLength" | "readOnly" | "dirName" | "minRows" | "maxRows"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
840
840
|
export default Textarea;
|
|
841
841
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,7 +6,7 @@ describe("getInputComponent", function () {
|
|
|
6
6
|
var _render = render(/*#__PURE__*/React.createElement(FormFieldLabel, {
|
|
7
7
|
fieldType: "text",
|
|
8
8
|
content: "Foo",
|
|
9
|
-
|
|
9
|
+
htmlFor: "foo"
|
|
10
10
|
})),
|
|
11
11
|
container = _render.container;
|
|
12
12
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
@@ -15,7 +15,7 @@ describe("getInputComponent", function () {
|
|
|
15
15
|
var _render2 = render(/*#__PURE__*/React.createElement(FormFieldLabel, {
|
|
16
16
|
fieldType: "text",
|
|
17
17
|
content: "Foo",
|
|
18
|
-
|
|
18
|
+
htmlFor: "foo"
|
|
19
19
|
})),
|
|
20
20
|
container = _render2.container;
|
|
21
21
|
expect(container.children[0].tagName).toEqual("LABEL");
|
|
@@ -24,7 +24,7 @@ describe("getInputComponent", function () {
|
|
|
24
24
|
var _render3 = render(/*#__PURE__*/React.createElement(FormFieldLabel, {
|
|
25
25
|
fieldType: "checkbox",
|
|
26
26
|
content: "Foo",
|
|
27
|
-
|
|
27
|
+
htmlFor: "foo"
|
|
28
28
|
})),
|
|
29
29
|
container = _render3.container;
|
|
30
30
|
expect(container.children[0].tagName).toEqual("LEGEND");
|
|
@@ -2,7 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["label", "helperMessage", "hasError", "inputProps", "onChange", "value", "id", "type", "required", "infoTooltipContent"];
|
|
4
4
|
import { Info } from "@vitality-ds/icons";
|
|
5
|
+
import { theme } from "@vitality-ds/system";
|
|
5
6
|
import React from "react";
|
|
7
|
+
import Box from "../../Box";
|
|
6
8
|
import Stack from "../../Stack";
|
|
7
9
|
import Tooltip from "../../Tooltip";
|
|
8
10
|
import HelperMessage from "../HelperMessage";
|
|
@@ -30,18 +32,25 @@ function FormField(_ref) {
|
|
|
30
32
|
spacing: "sm",
|
|
31
33
|
direction: "horizontal",
|
|
32
34
|
align: "center"
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
36
|
+
maxWidth: infoTooltipContent ? "90%" : "100%"
|
|
33
37
|
}, /*#__PURE__*/React.createElement(FormFieldLabel, {
|
|
34
38
|
fieldType: type,
|
|
35
39
|
content: label,
|
|
36
|
-
|
|
40
|
+
htmlFor: id,
|
|
37
41
|
required: required,
|
|
38
42
|
hasError: hasError
|
|
39
|
-
}), infoTooltipContent && /*#__PURE__*/React.createElement(
|
|
43
|
+
})), infoTooltipContent && /*#__PURE__*/React.createElement(Box, {
|
|
44
|
+
maxWidth: "10%",
|
|
45
|
+
minWidth: "16px" // this is the same width as the icon size="sm"
|
|
46
|
+
,
|
|
47
|
+
minHeight: theme.fontSizes.caption.value
|
|
48
|
+
}, /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
40
49
|
content: infoTooltipContent
|
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Info, {
|
|
42
51
|
color: "inherit",
|
|
43
52
|
size: "sm"
|
|
44
|
-
})))), /*#__PURE__*/React.createElement(Component, _extends({
|
|
53
|
+
})))))), /*#__PURE__*/React.createElement(Component, _extends({
|
|
45
54
|
onChange: onChange,
|
|
46
55
|
value: value,
|
|
47
56
|
id: id,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import { css } from "@vitality-ds/system";
|
|
1
|
+
import { css, theme } from "@vitality-ds/system";
|
|
2
2
|
export default css({
|
|
3
|
-
margin: "unset"
|
|
3
|
+
margin: "unset",
|
|
4
|
+
position: "relative",
|
|
5
|
+
"& > div": {
|
|
6
|
+
height: theme.fontSizes.caption.value,
|
|
7
|
+
display: "flex",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
justifyContent: "center"
|
|
10
|
+
}
|
|
4
11
|
});
|
|
@@ -2,12 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { BaseLabel, BaseLabelRequired } from "./styled";
|
|
3
3
|
function Label(_ref) {
|
|
4
4
|
var content = _ref.content,
|
|
5
|
-
|
|
5
|
+
htmlFor = _ref.htmlFor,
|
|
6
6
|
required = _ref.required,
|
|
7
7
|
hasError = _ref.hasError;
|
|
8
8
|
return /*#__PURE__*/React.createElement(BaseLabel, {
|
|
9
|
-
htmlFor:
|
|
10
|
-
id: id
|
|
9
|
+
htmlFor: htmlFor
|
|
11
10
|
}, content, required && /*#__PURE__*/React.createElement(BaseLabelRequired, {
|
|
12
11
|
hasError: hasError
|
|
13
12
|
}, "*"));
|