@sb1/ffe-form-react 100.0.4 → 100.1.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/es/TextField.js +31 -0
- package/es/index.js +1 -0
- package/es/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/TextField.js +37 -0
- package/lib/index.js +3 -1
- package/lib/tsconfig.cjs.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/types/TextField.d.ts +12 -0
- package/types/index.d.ts +1 -0
- package/types/tsconfig.types.tsbuildinfo +1 -1
package/es/TextField.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
export var TextField = React.forwardRef(function (_a, ref) {
|
|
26
|
+
var className = _a.className, inline = _a.inline, textRightAlign = _a.textRightAlign, prefix = _a.prefix, suffix = _a.suffix, rest = __rest(_a, ["className", "inline", "textRightAlign", "prefix", "suffix"]);
|
|
27
|
+
return (React.createElement("div", { className: classNames('ffe-text-field__wrapper', 'ffe-default-mode', { 'ffe-text-field__wrapper--inline': inline }, className) },
|
|
28
|
+
prefix && (React.createElement("div", { className: "ffe-text-field__prefix" }, prefix)),
|
|
29
|
+
React.createElement("input", __assign({ className: classNames('ffe-text-field', 'ffe-default-mode', { 'ffe-text-field--text-right-align': textRightAlign }), ref: ref }, rest)),
|
|
30
|
+
suffix && (React.createElement("div", { className: "ffe-text-field__suffix" }, suffix))));
|
|
31
|
+
});
|
package/es/index.js
CHANGED
|
@@ -10,5 +10,6 @@ export { RadioButton } from './RadioButton';
|
|
|
10
10
|
export { RadioButtonInputGroup, } from './RadioButtonInputGroup';
|
|
11
11
|
export { RadioSwitch } from './RadioSwitch';
|
|
12
12
|
export { TextArea } from './TextArea';
|
|
13
|
+
export { TextField } from './TextField';
|
|
13
14
|
export { Tooltip } from './Tooltip';
|
|
14
15
|
export { ToggleSwitch } from './ToggleSwitch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|
|
1
|
+
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/TextField.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|
package/lib/TextField.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.TextField = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
31
|
+
exports.TextField = react_1.default.forwardRef(function (_a, ref) {
|
|
32
|
+
var className = _a.className, inline = _a.inline, textRightAlign = _a.textRightAlign, prefix = _a.prefix, suffix = _a.suffix, rest = __rest(_a, ["className", "inline", "textRightAlign", "prefix", "suffix"]);
|
|
33
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('ffe-text-field__wrapper', 'ffe-default-mode', { 'ffe-text-field__wrapper--inline': inline }, className) },
|
|
34
|
+
prefix && (react_1.default.createElement("div", { className: "ffe-text-field__prefix" }, prefix)),
|
|
35
|
+
react_1.default.createElement("input", __assign({ className: (0, classnames_1.default)('ffe-text-field', 'ffe-default-mode', { 'ffe-text-field--text-right-align': textRightAlign }), ref: ref }, rest)),
|
|
36
|
+
suffix && (react_1.default.createElement("div", { className: "ffe-text-field__suffix" }, suffix))));
|
|
37
|
+
});
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToggleSwitch = exports.Tooltip = exports.TextArea = exports.RadioSwitch = exports.RadioButtonInputGroup = exports.RadioButton = exports.RadioBlock = exports.PhoneNumber = exports.Label = exports.InputGroup = exports.InputTextLike = exports.Input = exports.Checkbox = exports.SuccessFieldMessage = exports.InfoFieldMessage = exports.ErrorFieldMessage = void 0;
|
|
3
|
+
exports.ToggleSwitch = exports.Tooltip = exports.TextField = exports.TextArea = exports.RadioSwitch = exports.RadioButtonInputGroup = exports.RadioButton = exports.RadioBlock = exports.PhoneNumber = exports.Label = exports.InputGroup = exports.InputTextLike = exports.Input = exports.Checkbox = exports.SuccessFieldMessage = exports.InfoFieldMessage = exports.ErrorFieldMessage = void 0;
|
|
4
4
|
var message_1 = require("./message");
|
|
5
5
|
Object.defineProperty(exports, "ErrorFieldMessage", { enumerable: true, get: function () { return message_1.ErrorFieldMessage; } });
|
|
6
6
|
Object.defineProperty(exports, "InfoFieldMessage", { enumerable: true, get: function () { return message_1.InfoFieldMessage; } });
|
|
@@ -27,6 +27,8 @@ var RadioSwitch_1 = require("./RadioSwitch");
|
|
|
27
27
|
Object.defineProperty(exports, "RadioSwitch", { enumerable: true, get: function () { return RadioSwitch_1.RadioSwitch; } });
|
|
28
28
|
var TextArea_1 = require("./TextArea");
|
|
29
29
|
Object.defineProperty(exports, "TextArea", { enumerable: true, get: function () { return TextArea_1.TextArea; } });
|
|
30
|
+
var TextField_1 = require("./TextField");
|
|
31
|
+
Object.defineProperty(exports, "TextField", { enumerable: true, get: function () { return TextField_1.TextField; } });
|
|
30
32
|
var Tooltip_1 = require("./Tooltip");
|
|
31
33
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
32
34
|
var ToggleSwitch_1 = require("./ToggleSwitch");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|
|
1
|
+
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/TextField.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-form-react",
|
|
3
|
-
"version": "100.
|
|
3
|
+
"version": "100.1.1",
|
|
4
4
|
"description": "React component for form elements in ffe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-collapse-react": "^100.
|
|
29
|
-
"@sb1/ffe-form": "^100.
|
|
30
|
-
"@sb1/ffe-icons-react": "^100.
|
|
28
|
+
"@sb1/ffe-collapse-react": "^100.1.1",
|
|
29
|
+
"@sb1/ffe-form": "^100.1.1",
|
|
30
|
+
"@sb1/ffe-icons-react": "^100.1.1",
|
|
31
31
|
"classnames": "^2.3.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@sb1/ffe-buildtool": "^100.
|
|
34
|
+
"@sb1/ffe-buildtool": "^100.1.1",
|
|
35
35
|
"eslint": "^9.22.0",
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "6ae73c2e7574d096f6faf05c35b186210dd18cf5"
|
|
46
46
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TextFieldProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
3
|
+
/** Text fields default to `display: block;`. Set this to `true` to apply the inline modifier. */
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
/** Make the text right aligned */
|
|
6
|
+
textRightAlign?: boolean;
|
|
7
|
+
/** Add a prefix inside the input */
|
|
8
|
+
prefix?: string;
|
|
9
|
+
/** Add a suffix inside the input */
|
|
10
|
+
suffix?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
package/types/index.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export { RadioButton, RadioButtonProps } from './RadioButton';
|
|
|
10
10
|
export { RadioButtonInputGroup, RadioButtonInputGroupProps, } from './RadioButtonInputGroup';
|
|
11
11
|
export { RadioSwitch, RadioSwitchProps } from './RadioSwitch';
|
|
12
12
|
export { TextArea, TextAreaProps } from './TextArea';
|
|
13
|
+
export { TextField, TextFieldProps } from './TextField';
|
|
13
14
|
export { Tooltip, TooltipProps } from './Tooltip';
|
|
14
15
|
export { ToggleSwitch, ToggleSwitchProps } from './ToggleSwitch';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|
|
1
|
+
{"root":["../src/BaseRadioButton.tsx","../src/Checkbox.tsx","../src/Input.tsx","../src/InputGroup.tsx","../src/InputTextLike.tsx","../src/Label.tsx","../src/PhoneNumber.tsx","../src/RadioBlock.tsx","../src/RadioButton.tsx","../src/RadioButtonInputGroup.tsx","../src/RadioSwitch.tsx","../src/TextArea.tsx","../src/TextField.tsx","../src/ToggleSwitch.tsx","../src/Tooltip.tsx","../src/index.ts","../src/types.ts","../src/documentation/RadioButton-example.tsx","../src/documentation/RadioSwitch-example.tsx","../src/i18n/en.ts","../src/i18n/i18n.ts","../src/i18n/nb.ts","../src/i18n/nn.ts","../src/message/BaseFieldMessage.tsx","../src/message/ErrorFieldMessage.tsx","../src/message/InfoFieldMessage.tsx","../src/message/SuccessFieldMessage.tsx","../src/message/index.tsx"],"version":"5.9.2"}
|