@financial-times/o3-form 0.5.4 → 0.6.2
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/cjs/CheckBox.d.ts +1 -1
- package/cjs/CheckBox.js +12 -3
- package/cjs/Error-summary.d.ts +1 -1
- package/cjs/PasswordInput.d.ts +1 -1
- package/cjs/RadioButton.d.ts +1 -1
- package/cjs/TextInput.d.ts +1 -1
- package/cjs/fieldComponents/Feedback.d.ts +1 -1
- package/cjs/fieldComponents/FormField.d.ts +1 -1
- package/cjs/{index-B6g8Gfrb.d.ts → index-CufC9u5W.d.ts} +1 -0
- package/cjs/index.d.ts +1 -1
- package/css/main.css +13 -1
- package/esm/CheckBox.d.ts +1 -1
- package/esm/CheckBox.js +12 -3
- package/esm/Error-summary.d.ts +1 -1
- package/esm/PasswordInput.d.ts +1 -1
- package/esm/RadioButton.d.ts +1 -1
- package/esm/TextInput.d.ts +1 -1
- package/esm/fieldComponents/Feedback.d.mts +1 -1
- package/esm/fieldComponents/FormField.d.mts +1 -1
- package/esm/{index-B6g8Gfrb.d.ts → index-CufC9u5W.d.ts} +1 -0
- package/esm/index.d.ts +1 -1
- package/package.json +4 -2
package/cjs/CheckBox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CheckBoxProps, F as FormFieldsetProps } from './index-
|
|
2
|
+
import { C as CheckBoxProps, F as FormFieldsetProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const CheckBoxItem: (props: CheckBoxProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const CheckBox: (props: CheckBoxProps) => react_jsx_runtime.JSX.Element;
|
package/cjs/CheckBox.js
CHANGED
|
@@ -4,7 +4,7 @@ var _outils = require('@financial-times/o-utils');
|
|
|
4
4
|
var _FormField = require('./fieldComponents/FormField');
|
|
5
5
|
const uniqueId = _outils.uidBuilder.call(void 0, "o3-form-checkbox-input");
|
|
6
6
|
const CheckBoxItem = (props) => {
|
|
7
|
-
let { inputId, attributes, optional, error } = props;
|
|
7
|
+
let { inputId, checkboxDescription, attributes, optional, error } = props;
|
|
8
8
|
if (!inputId) {
|
|
9
9
|
inputId = uniqueId("_");
|
|
10
10
|
}
|
|
@@ -24,7 +24,10 @@ const CheckBoxItem = (props) => {
|
|
|
24
24
|
"aria-required": !optional
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: inputId, className: "o3-form-input-checkbox__label", children:
|
|
27
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { htmlFor: inputId, className: "o3-form-input-checkbox__label", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
28
|
+
props.checkboxLabel,
|
|
29
|
+
checkboxDescription && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "o3-form-input-checkbox__description", children: checkboxDescription })
|
|
30
|
+
] }) })
|
|
28
31
|
] });
|
|
29
32
|
};
|
|
30
33
|
const CheckBox = (props) => {
|
|
@@ -33,7 +36,13 @@ const CheckBox = (props) => {
|
|
|
33
36
|
labelId: props.inputId,
|
|
34
37
|
descriptionId: props.inputId
|
|
35
38
|
};
|
|
36
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FormField.TitledFormField, { ...newProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
39
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _FormField.TitledFormField, { ...newProps, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
40
|
+
CheckBoxItem,
|
|
41
|
+
{
|
|
42
|
+
...newProps,
|
|
43
|
+
checkboxDescription: props.checkboxDescription
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
37
46
|
};
|
|
38
47
|
const CheckBoxGroup = (props) => {
|
|
39
48
|
const { children, ...restProps } = props;
|
package/cjs/Error-summary.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { E as ErrorSummaryProps } from './index-
|
|
2
|
+
import { E as ErrorSummaryProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const ErrorSummary: ({ errors, errorMessage, }: ErrorSummaryProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
package/cjs/PasswordInput.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as PasswordInputProps } from './index-
|
|
2
|
+
import { P as PasswordInputProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const PasswordInput: ({ label, feedback, description, disabled, attributes, inputId, optional, }: PasswordInputProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
package/cjs/RadioButton.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RadioButtonProps, F as FormFieldsetProps } from './index-
|
|
2
|
+
import { R as RadioButtonProps, F as FormFieldsetProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const RadioButtonItem: (props: RadioButtonProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const RadioButtonGroup: (props: FormFieldsetProps) => react_jsx_runtime.JSX.Element;
|
package/cjs/TextInput.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { T as TextInputProps } from './index-
|
|
2
|
+
import { T as TextInputProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const TextInput: ({ label, feedback, description, disabled, length, attributes, inputId, optional, }: TextInputProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as FeedbackProps } from '../index-
|
|
2
|
+
import { a as FeedbackProps } from '../index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const Feedback: ({ message, type }: FeedbackProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { b as FormFieldProps, F as FormFieldsetProps } from '../index-
|
|
2
|
+
import { b as FormFieldProps, F as FormFieldsetProps } from '../index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const LabeledFormField: ({ inputId, label, description, feedback, children, optional, }: FormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const TitledFormField: ({ label, description, feedback, children, optional, }: FormFieldProps) => react_jsx_runtime.JSX.Element;
|
package/cjs/index.d.ts
CHANGED
package/css/main.css
CHANGED
|
@@ -168,6 +168,9 @@ input[class*=o3-form-text-input][type=text]:disabled {
|
|
|
168
168
|
.o3-form-input-checkbox__input:disabled + label {
|
|
169
169
|
color: var(--_o3-form-color-use-case-border-disabled);
|
|
170
170
|
}
|
|
171
|
+
.o3-form-input-checkbox__input:disabled + label .o3-form-input-checkbox__description {
|
|
172
|
+
color: var(--_o3-form-color-use-case-border-disabled);
|
|
173
|
+
}
|
|
171
174
|
.o3-form-input-checkbox__input:checked:disabled + label::before {
|
|
172
175
|
background-color: var(--_o3-form-color-use-case-selected-disabled);
|
|
173
176
|
border-color: var(--_o3-form-color-use-case-selected-disabled);
|
|
@@ -231,13 +234,22 @@ input[class*=o3-form-text-input][type=text]:disabled {
|
|
|
231
234
|
}
|
|
232
235
|
.o3-form-input-checkbox__label {
|
|
233
236
|
display: flex;
|
|
234
|
-
align-items:
|
|
237
|
+
align-items: flex-start;
|
|
235
238
|
font-family: var(--o3-type-body-base-font-family);
|
|
236
239
|
font-size: var(--o3-type-body-base-font-size);
|
|
237
240
|
font-weight: var(--o3-type-body-base-font-weight);
|
|
238
241
|
line-height: var(--o3-type-body-base-line-height);
|
|
239
242
|
color: var(--o3-color-use-case-body-text);
|
|
240
243
|
}
|
|
244
|
+
.o3-form-input-checkbox__description {
|
|
245
|
+
display: block;
|
|
246
|
+
font-family: var(--o3-type-detail-font-family);
|
|
247
|
+
font-size: var(--o3-type-detail-font-size);
|
|
248
|
+
font-weight: var(--o3-type-detail-font-weight);
|
|
249
|
+
line-height: var(--o3-type-detail-line-height);
|
|
250
|
+
color: var(--o3-color-use-case-body-text);
|
|
251
|
+
margin-top: var(--o3-spacing-4xs);
|
|
252
|
+
}
|
|
241
253
|
|
|
242
254
|
/* src/css/components/radio-button.css */
|
|
243
255
|
.o3-form-input-radio-button + label::before {
|
package/esm/CheckBox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CheckBoxProps, F as FormFieldsetProps } from './index-
|
|
2
|
+
import { C as CheckBoxProps, F as FormFieldsetProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const CheckBoxItem: (props: CheckBoxProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const CheckBox: (props: CheckBoxProps) => react_jsx_runtime.JSX.Element;
|
package/esm/CheckBox.js
CHANGED
|
@@ -4,7 +4,7 @@ import { uidBuilder } from "@financial-times/o-utils";
|
|
|
4
4
|
import { TitledFormField, FormFieldset } from "./fieldComponents/FormField";
|
|
5
5
|
const uniqueId = uidBuilder("o3-form-checkbox-input");
|
|
6
6
|
const CheckBoxItem = (props) => {
|
|
7
|
-
let { inputId, attributes, optional, error } = props;
|
|
7
|
+
let { inputId, checkboxDescription, attributes, optional, error } = props;
|
|
8
8
|
if (!inputId) {
|
|
9
9
|
inputId = uniqueId("_");
|
|
10
10
|
}
|
|
@@ -24,7 +24,10 @@ const CheckBoxItem = (props) => {
|
|
|
24
24
|
"aria-required": !optional
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "o3-form-input-checkbox__label", children:
|
|
27
|
+
/* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "o3-form-input-checkbox__label", children: /* @__PURE__ */ jsxs("span", { children: [
|
|
28
|
+
props.checkboxLabel,
|
|
29
|
+
checkboxDescription && /* @__PURE__ */ jsx("span", { className: "o3-form-input-checkbox__description", children: checkboxDescription })
|
|
30
|
+
] }) })
|
|
28
31
|
] });
|
|
29
32
|
};
|
|
30
33
|
const CheckBox = (props) => {
|
|
@@ -33,7 +36,13 @@ const CheckBox = (props) => {
|
|
|
33
36
|
labelId: props.inputId,
|
|
34
37
|
descriptionId: props.inputId
|
|
35
38
|
};
|
|
36
|
-
return /* @__PURE__ */ jsx(TitledFormField, { ...newProps, children: /* @__PURE__ */ jsx(
|
|
39
|
+
return /* @__PURE__ */ jsx(TitledFormField, { ...newProps, children: /* @__PURE__ */ jsx(
|
|
40
|
+
CheckBoxItem,
|
|
41
|
+
{
|
|
42
|
+
...newProps,
|
|
43
|
+
checkboxDescription: props.checkboxDescription
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
37
46
|
};
|
|
38
47
|
const CheckBoxGroup = (props) => {
|
|
39
48
|
const { children, ...restProps } = props;
|
package/esm/Error-summary.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { E as ErrorSummaryProps } from './index-
|
|
2
|
+
import { E as ErrorSummaryProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const ErrorSummary: ({ errors, errorMessage, }: ErrorSummaryProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
package/esm/PasswordInput.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as PasswordInputProps } from './index-
|
|
2
|
+
import { P as PasswordInputProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const PasswordInput: ({ label, feedback, description, disabled, attributes, inputId, optional, }: PasswordInputProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
package/esm/RadioButton.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RadioButtonProps, F as FormFieldsetProps } from './index-
|
|
2
|
+
import { R as RadioButtonProps, F as FormFieldsetProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const RadioButtonItem: (props: RadioButtonProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const RadioButtonGroup: (props: FormFieldsetProps) => react_jsx_runtime.JSX.Element;
|
package/esm/TextInput.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { T as TextInputProps } from './index-
|
|
2
|
+
import { T as TextInputProps } from './index-CufC9u5W.js';
|
|
3
3
|
|
|
4
4
|
declare const TextInput: ({ label, feedback, description, disabled, length, attributes, inputId, optional, }: TextInputProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { a as FeedbackProps } from '../index-
|
|
2
|
+
import { a as FeedbackProps } from '../index-CufC9u5W.mjs';
|
|
3
3
|
|
|
4
4
|
declare const Feedback: ({ message, type }: FeedbackProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { b as FormFieldProps, F as FormFieldsetProps } from '../index-
|
|
2
|
+
import { b as FormFieldProps, F as FormFieldsetProps } from '../index-CufC9u5W.mjs';
|
|
3
3
|
|
|
4
4
|
declare const LabeledFormField: ({ inputId, label, description, feedback, children, optional, }: FormFieldProps) => react_jsx_runtime.JSX.Element;
|
|
5
5
|
declare const TitledFormField: ({ label, description, feedback, children, optional, }: FormFieldProps) => react_jsx_runtime.JSX.Element;
|
package/esm/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/o3-form",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Provides a viewport-aware tooltip for annotating or or highlighting other aspects of a product's UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"form",
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@financial-times/o-utils": "^2.2.1",
|
|
38
|
-
"@financial-times/o3-figma-sb-links": "^0.0.0",
|
|
39
38
|
"@financial-times/o3-foundation": "^3.0.0"
|
|
40
39
|
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@financial-times/o3-figma-sb-links": "^0.0.0"
|
|
42
|
+
},
|
|
41
43
|
"engines": {
|
|
42
44
|
"npm": ">7"
|
|
43
45
|
},
|