@sebgroup/green-react 3.18.0 → 3.20.0
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/package.json +2 -2
- package/src/lib/datepicker/datepicker.d.ts +21 -12
- package/src/lib/datepicker/datepicker.js +10 -7
- package/src/lib/form/button/button.d.ts +1 -1
- package/src/lib/form/button/button.js +11 -8
- package/src/lib/form/button/index.js +1 -0
- package/src/lib/form/buttonGroup/buttonGroup.js +5 -3
- package/src/lib/form/buttonGroup/index.js +1 -1
- package/src/lib/form/checkbox/checkbox.d.ts +1 -1
- package/src/lib/form/checkbox/checkbox.js +5 -4
- package/src/lib/form/iconButton/iconButton.d.ts +3 -13
- package/src/lib/form/iconButton/iconButton.js +11 -16
- package/src/lib/form/iconButton/index.js +4 -1
- package/src/lib/form/index.js +1 -1
- package/src/lib/form/input/index.js +1 -0
- package/src/lib/form/input/input.d.ts +9 -5
- package/src/lib/form/input/input.js +21 -13
- package/src/lib/form/radioButton/index.js +1 -0
- package/src/lib/form/radioButton/radioGroup.js +1 -0
- package/src/lib/form/textarea/index.js +1 -0
- package/src/lib/form/textarea/textarea.d.ts +1 -1
- package/src/lib/form/textarea/textarea.js +6 -4
- package/src/lib/formItem/formItem.js +3 -1
- package/src/lib/formItem/index.js +2 -1
- package/src/lib/select/index.js +1 -0
- package/src/lib/select/select.js +1 -0
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"module": "./src/index.js",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.20.0",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"react": "^17 || ^18",
|
|
8
8
|
"react-dom": "^17 || ^18"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@sebgroup/green-core": "^1.41.
|
|
11
|
+
"@sebgroup/green-core": "^1.41.3",
|
|
12
12
|
"@sebgroup/chlorophyll": "^3.6.2",
|
|
13
13
|
"@sebgroup/extract": "^3.0.1",
|
|
14
14
|
"@lit/react": "^1.0.2",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { GdsDatepicker } from '@sebgroup/green-core/components/datepicker/index.js';
|
|
2
3
|
import { GdsValidator } from '@sebgroup/green-core/components/form/form-control';
|
|
3
4
|
export declare const CoreDatepicker: import("@lit/react").ReactWebComponent<GdsDatepicker, {
|
|
@@ -11,35 +12,35 @@ export type DatepickerOptions = {
|
|
|
11
12
|
/**
|
|
12
13
|
* Whether to disable weekends in the calendar.
|
|
13
14
|
*/
|
|
14
|
-
disabledWeekends
|
|
15
|
+
disabledWeekends?: boolean;
|
|
15
16
|
/**
|
|
16
17
|
* Whether to hide the label above the input field.
|
|
17
18
|
*/
|
|
18
|
-
hideLabel
|
|
19
|
+
hideLabel?: boolean;
|
|
19
20
|
/**
|
|
20
21
|
* Validation state of the form control. Setting this to true triggers the invalid state of the control.
|
|
21
22
|
*/
|
|
22
|
-
invalid
|
|
23
|
+
invalid?: boolean;
|
|
23
24
|
/**
|
|
24
25
|
* Validate the form control element. Should return the validity state and an optional validation message.
|
|
25
26
|
*/
|
|
26
|
-
validator
|
|
27
|
+
validator?: GdsValidator;
|
|
27
28
|
/**
|
|
28
29
|
* The label text displayed above the datepicker. This should always be set to a descriptive label.
|
|
29
30
|
*/
|
|
30
|
-
label
|
|
31
|
+
label?: string;
|
|
31
32
|
/**
|
|
32
33
|
* The maximum date that can be selected.
|
|
33
34
|
*/
|
|
34
|
-
maxDate
|
|
35
|
+
maxDate?: Date;
|
|
35
36
|
/**
|
|
36
37
|
* The minimum date that can be selected.
|
|
37
38
|
*/
|
|
38
|
-
minDate
|
|
39
|
+
minDate?: Date;
|
|
39
40
|
/**
|
|
40
41
|
* Controls whether the datepicker popover is open.
|
|
41
42
|
*/
|
|
42
|
-
open
|
|
43
|
+
open?: boolean;
|
|
43
44
|
/**
|
|
44
45
|
* Callback function that is called when the value of the Datepicker changes.
|
|
45
46
|
*/
|
|
@@ -47,15 +48,15 @@ export type DatepickerOptions = {
|
|
|
47
48
|
/**
|
|
48
49
|
* Sets the datepicker as a required field for forms.
|
|
49
50
|
*/
|
|
50
|
-
required
|
|
51
|
+
required?: boolean;
|
|
51
52
|
/**
|
|
52
53
|
* Whether to show a column of week numbers in the calendar.
|
|
53
54
|
*/
|
|
54
|
-
showWeeks
|
|
55
|
+
showWeeks?: boolean;
|
|
55
56
|
/**
|
|
56
57
|
* Whether to use the small variant of the datepicker field.
|
|
57
58
|
*/
|
|
58
|
-
size
|
|
59
|
+
size?: 'small' | 'medium';
|
|
59
60
|
/**
|
|
60
61
|
* The test ID used for testing.
|
|
61
62
|
*/
|
|
@@ -65,6 +66,14 @@ export type DatepickerOptions = {
|
|
|
65
66
|
* This can be a string if set via the value attribute in markup, or via the setAttribute DOM API.
|
|
66
67
|
*/
|
|
67
68
|
value?: Date;
|
|
69
|
+
/**
|
|
70
|
+
* The ref to the datepicker element.
|
|
71
|
+
*/
|
|
72
|
+
ref?: React.Ref<GdsDatepicker>;
|
|
73
|
+
/**
|
|
74
|
+
* The children of the datepicker.
|
|
75
|
+
*/
|
|
76
|
+
children?: React.ReactNode;
|
|
68
77
|
/**
|
|
69
78
|
* @deprecated Use `value` instead.
|
|
70
79
|
*/
|
|
@@ -74,5 +83,5 @@ export type DatepickerOptions = {
|
|
|
74
83
|
*/
|
|
75
84
|
currentDate?: Date;
|
|
76
85
|
};
|
|
77
|
-
export declare const Datepicker:
|
|
86
|
+
export declare const Datepicker: React.ForwardRefExoticComponent<Omit<DatepickerOptions, "ref"> & React.RefAttributes<unknown>>;
|
|
78
87
|
export default Datepicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __rest } from '../../../_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React, { useEffect } from 'react';
|
|
3
|
+
import React, { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
|
|
4
4
|
import { createComponent } from '@lit/react';
|
|
5
5
|
import { GdsDatepicker } from '@sebgroup/green-core/components/datepicker/index.js';
|
|
6
6
|
import { getScopedTagName } from '@sebgroup/green-core/scoping';
|
|
@@ -15,7 +15,7 @@ var CoreDatepicker = createComponent({
|
|
|
15
15
|
},
|
|
16
16
|
react: React
|
|
17
17
|
});
|
|
18
|
-
var Datepicker = function
|
|
18
|
+
var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
19
19
|
var _a$label = _a.label,
|
|
20
20
|
label = _a$label === void 0 ? 'Date' : _a$label,
|
|
21
21
|
onChange = _a.onChange,
|
|
@@ -37,10 +37,13 @@ var Datepicker = function Datepicker(_a) {
|
|
|
37
37
|
onChange(e.detail.value);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
var
|
|
40
|
+
var _ref = useRef(null);
|
|
41
|
+
useImperativeHandle(ref, function () {
|
|
42
|
+
return _ref.current;
|
|
43
|
+
}, [_ref]);
|
|
41
44
|
useEffect(function () {
|
|
42
|
-
if (
|
|
43
|
-
|
|
45
|
+
if (_ref === null || _ref === void 0 ? void 0 : _ref.current) {
|
|
46
|
+
_ref.current.validator = validator;
|
|
44
47
|
}
|
|
45
48
|
}, [validator]);
|
|
46
49
|
return jsx("div", {
|
|
@@ -53,9 +56,9 @@ var Datepicker = function Datepicker(_a) {
|
|
|
53
56
|
showWeekNumbers: showWeeks,
|
|
54
57
|
onchange: onChangeHandler,
|
|
55
58
|
value: value,
|
|
56
|
-
ref:
|
|
59
|
+
ref: _ref
|
|
57
60
|
}, props))
|
|
58
61
|
});
|
|
59
|
-
};
|
|
62
|
+
});
|
|
60
63
|
|
|
61
64
|
export { CoreDatepicker, Datepicker, Datepicker as default };
|
|
@@ -10,5 +10,5 @@ export interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTML
|
|
|
10
10
|
/** Renders as a `data-testid` attribute on the `<button>` element, useful in testing scenarios. */
|
|
11
11
|
testId?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
13
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
14
14
|
export default Button;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { _ as __rest } from '../../../../_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
6
7
|
var _b;
|
|
7
8
|
var className = _a.className,
|
|
8
9
|
variant = _a.variant,
|
|
@@ -12,21 +13,23 @@ function Button(_a) {
|
|
|
12
13
|
type = _a$type === void 0 ? 'button' : _a$type,
|
|
13
14
|
size = _a.size,
|
|
14
15
|
testId = _a.testId,
|
|
15
|
-
|
|
16
|
+
props = __rest(_a, ["className", "variant", "active", "type", "size", "testId"]);
|
|
16
17
|
var buttonClassName = classNames(className, variant, size, {
|
|
17
18
|
active: active
|
|
18
19
|
}) || undefined;
|
|
19
20
|
return variant == 'close' ? jsx("button", Object.assign({
|
|
20
21
|
className: buttonClassName,
|
|
21
|
-
"aria-label": (_b =
|
|
22
|
-
"data-testid": testId
|
|
23
|
-
|
|
22
|
+
"aria-label": (_b = props['aria-label']) !== null && _b !== void 0 ? _b : 'Close',
|
|
23
|
+
"data-testid": testId,
|
|
24
|
+
ref: ref
|
|
25
|
+
}, props, {
|
|
24
26
|
children: jsx("i", {})
|
|
25
27
|
})) : jsx("button", Object.assign({
|
|
26
28
|
className: buttonClassName,
|
|
27
29
|
type: type,
|
|
28
|
-
"data-testid": testId
|
|
29
|
-
|
|
30
|
-
}
|
|
30
|
+
"data-testid": testId,
|
|
31
|
+
ref: ref
|
|
32
|
+
}, props));
|
|
33
|
+
});
|
|
31
34
|
|
|
32
35
|
export { Button, Button as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as _slicedToArray } from '../../../../_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { _ as __rest } from '../../../../_tslib.js';
|
|
2
3
|
import { jsx } from 'react/jsx-runtime';
|
|
3
4
|
import { useState, useEffect } from 'react';
|
|
4
5
|
import { Button } from '../button/button.js';
|
|
5
|
-
import '../../../../_tslib.js';
|
|
6
6
|
import '@sebgroup/extract';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import { Group } from '../group/group.js';
|
|
@@ -43,8 +43,10 @@ var ButtonGroup = function ButtonGroup(_ref) {
|
|
|
43
43
|
return jsx(Group, {
|
|
44
44
|
"data-label": "button-group",
|
|
45
45
|
id: id,
|
|
46
|
-
children: buttons.map(function (
|
|
47
|
-
|
|
46
|
+
children: buttons.map(function (_a) {
|
|
47
|
+
var key = _a.key,
|
|
48
|
+
props = __rest(_a, ["key"]);
|
|
49
|
+
return jsx(Button, Object.assign({}, props), key);
|
|
48
50
|
})
|
|
49
51
|
});
|
|
50
52
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { ButtonGroup } from './buttonGroup.js';
|
|
2
2
|
import '../../../../_rollupPluginBabelHelpers.js';
|
|
3
|
+
import '../../../../_tslib.js';
|
|
3
4
|
import 'react/jsx-runtime';
|
|
4
5
|
import 'react';
|
|
5
6
|
import '../button/button.js';
|
|
6
|
-
import '../../../../_tslib.js';
|
|
7
7
|
import 'classnames';
|
|
8
8
|
import '@sebgroup/extract';
|
|
9
9
|
import '../group/group.js';
|
|
@@ -12,4 +12,4 @@ export interface CheckboxProps extends HTMLProps<HTMLInputElement> {
|
|
|
12
12
|
/** A handler function that takes the event and can act on it */
|
|
13
13
|
onChange?: FormEventHandler<HTMLInputElement>;
|
|
14
14
|
}
|
|
15
|
-
export declare const Checkbox: (
|
|
15
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -3,9 +3,9 @@ import { _ as __rest } from '../../../../_tslib.js';
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { randomId, validateClassName } from '@sebgroup/extract';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import { useState } from 'react';
|
|
6
|
+
import { forwardRef, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
var Checkbox = function
|
|
8
|
+
var Checkbox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
9
9
|
var ariaDescribedBy = _a['aria-describedby'],
|
|
10
10
|
_a$id = _a.id,
|
|
11
11
|
id = _a$id === void 0 ? randomId() : _a$id,
|
|
@@ -35,7 +35,8 @@ var Checkbox = function Checkbox(_a) {
|
|
|
35
35
|
type: "checkbox",
|
|
36
36
|
"data-testid": testId,
|
|
37
37
|
id: uuid,
|
|
38
|
-
required: required
|
|
38
|
+
required: required,
|
|
39
|
+
ref: ref
|
|
39
40
|
}, props)), jsx("i", {})]
|
|
40
41
|
}), validator && jsx("span", {
|
|
41
42
|
className: "form-info",
|
|
@@ -43,6 +44,6 @@ var Checkbox = function Checkbox(_a) {
|
|
|
43
44
|
children: validator.message
|
|
44
45
|
})]
|
|
45
46
|
});
|
|
46
|
-
};
|
|
47
|
+
});
|
|
47
48
|
|
|
48
49
|
export { Checkbox };
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
type?: ButtonType;
|
|
6
|
-
onClick: (event: MouseEvent) => void;
|
|
7
|
-
'aria-expanded'?: boolean;
|
|
8
|
-
'aria-controls'?: string;
|
|
9
|
-
size?: 'small' | 'normal';
|
|
10
|
-
title?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const IconButton: ({ children, onClick, ...props }: IconButtonInterface) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from '../button/button';
|
|
3
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { _ as __rest } from '../../../../_tslib.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Button } from '../button/button.js';
|
|
4
|
+
import '../../../../_tslib.js';
|
|
5
|
+
import 'classnames';
|
|
3
6
|
|
|
4
|
-
var IconButton = function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
props
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onClick: onClick,
|
|
12
|
-
"aria-controls": props['aria-controls'],
|
|
13
|
-
"aria-expanded": props['aria-expanded'],
|
|
14
|
-
type: (_b = props.type) !== null && _b !== void 0 ? _b : 'button',
|
|
15
|
-
title: props.title,
|
|
16
|
-
children: children
|
|
17
|
-
});
|
|
18
|
-
};
|
|
7
|
+
var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
8
|
+
return jsx(Button, Object.assign({}, props, {
|
|
9
|
+
className: "icon",
|
|
10
|
+
ref: ref,
|
|
11
|
+
children: props.children
|
|
12
|
+
}));
|
|
13
|
+
});
|
|
19
14
|
|
|
20
15
|
export { IconButton };
|
package/src/lib/form/index.js
CHANGED
|
@@ -12,9 +12,9 @@ export { RadioGroup } from './radioButton/radioGroup.js';
|
|
|
12
12
|
export { TextArea } from './textarea/textarea.js';
|
|
13
13
|
import '../../../_tslib.js';
|
|
14
14
|
import 'react/jsx-runtime';
|
|
15
|
+
import 'react';
|
|
15
16
|
import 'classnames';
|
|
16
17
|
import '../../../_rollupPluginBabelHelpers.js';
|
|
17
|
-
import 'react';
|
|
18
18
|
import '@sebgroup/extract';
|
|
19
19
|
import './formContext.js';
|
|
20
20
|
import './validateInput.js';
|
|
@@ -9,6 +9,7 @@ import '@sebgroup/extract';
|
|
|
9
9
|
import '../../formItem/formItem.js';
|
|
10
10
|
import 'classnames';
|
|
11
11
|
import '../iconButton/iconButton.js';
|
|
12
|
+
import '../button/button.js';
|
|
12
13
|
import '../../icons/times.js';
|
|
13
14
|
import '../../icons/infoCircle.js';
|
|
14
15
|
import '../group/group.js';
|
|
@@ -13,14 +13,18 @@ export interface InputProps extends IExpandableInformation, DetailedHTMLProps<In
|
|
|
13
13
|
unit?: string;
|
|
14
14
|
/** Validation object */
|
|
15
15
|
validator?: IValidator;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Value of input
|
|
18
|
+
*/
|
|
17
19
|
value?: string | number;
|
|
18
20
|
/** Function called when input value changes */
|
|
19
21
|
onChangeInput?: (value: string) => string;
|
|
22
|
+
/** Pass an string that is an id to another element describing the input-field*/
|
|
23
|
+
'aria-describedby'?: string;
|
|
20
24
|
}
|
|
21
|
-
export declare const Input: (
|
|
22
|
-
export declare const TextInput: (
|
|
23
|
-
export declare const EmailInput: (
|
|
24
|
-
export declare const NumberInput: (
|
|
25
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<Omit<Omit<InputProps, "type">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
27
|
+
export declare const EmailInput: import("react").ForwardRefExoticComponent<Omit<Omit<InputProps, "type">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<Omit<InputProps, "type">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
29
|
export { RadioButton } from '../radioButton/radioButton';
|
|
26
30
|
export { Checkbox } from '../checkbox/checkbox';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _slicedToArray, a as _defineProperty } from '../../../../_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { _ as __rest } from '../../../../_tslib.js';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import { forwardRef, useState, useEffect, useCallback } from 'react';
|
|
5
5
|
import { randomId, validateClassName } from '@sebgroup/extract';
|
|
6
6
|
import { FormItem } from '../../formItem/formItem.js';
|
|
7
7
|
import { Group } from '../group/group.js';
|
|
@@ -9,11 +9,12 @@ import classNames from 'classnames';
|
|
|
9
9
|
export { RadioButton } from '../radioButton/radioButton.js';
|
|
10
10
|
export { Checkbox } from '../checkbox/checkbox.js';
|
|
11
11
|
import '../iconButton/iconButton.js';
|
|
12
|
+
import '../button/button.js';
|
|
12
13
|
import '../../icons/times.js';
|
|
13
14
|
import '../../icons/infoCircle.js';
|
|
14
15
|
import '../useInput.js';
|
|
15
16
|
|
|
16
|
-
var Input = function
|
|
17
|
+
var Input = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
17
18
|
var ariaDescribedBy = _a['aria-describedby'],
|
|
18
19
|
_a$autoComplete = _a.autoComplete,
|
|
19
20
|
autoComplete = _a$autoComplete === void 0 ? 'off' : _a$autoComplete,
|
|
@@ -77,7 +78,8 @@ var Input = function Input(_a) {
|
|
|
77
78
|
onChange: handleChange,
|
|
78
79
|
role: role,
|
|
79
80
|
value: localValue,
|
|
80
|
-
required: required
|
|
81
|
+
required: required,
|
|
82
|
+
ref: ref
|
|
81
83
|
}, props));
|
|
82
84
|
if (showSimpleInput) return input;
|
|
83
85
|
var spanClassName = classNames('form-text', {
|
|
@@ -104,21 +106,27 @@ var Input = function Input(_a) {
|
|
|
104
106
|
})
|
|
105
107
|
})
|
|
106
108
|
});
|
|
107
|
-
};
|
|
108
|
-
var TextInput = function
|
|
109
|
+
});
|
|
110
|
+
var TextInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
109
111
|
return jsx(Input, Object.assign({
|
|
110
112
|
type: "text"
|
|
111
|
-
}, props
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
}, props, {
|
|
114
|
+
ref: ref
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
var EmailInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
114
118
|
return jsx(Input, Object.assign({
|
|
115
119
|
type: "email"
|
|
116
|
-
}, props
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
}, props, {
|
|
121
|
+
ref: ref
|
|
122
|
+
}));
|
|
123
|
+
});
|
|
124
|
+
var NumberInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
119
125
|
return jsx(Input, Object.assign({
|
|
120
126
|
type: "number"
|
|
121
|
-
}, props
|
|
122
|
-
|
|
127
|
+
}, props, {
|
|
128
|
+
ref: ref
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
123
131
|
|
|
124
132
|
export { EmailInput, Input, NumberInput, TextInput };
|
|
@@ -6,6 +6,7 @@ import { FormItem } from '../../formItem/formItem.js';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import '../../../../_tslib.js';
|
|
8
8
|
import '../iconButton/iconButton.js';
|
|
9
|
+
import '../button/button.js';
|
|
9
10
|
import '../../icons/times.js';
|
|
10
11
|
import '../../icons/infoCircle.js';
|
|
11
12
|
|
|
@@ -12,4 +12,4 @@ export interface ITextAreaProps extends IExpandableInformation, DetailedHTMLProp
|
|
|
12
12
|
/** Value of textarea */
|
|
13
13
|
value?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare const TextArea: (
|
|
15
|
+
export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<ITextAreaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -2,14 +2,15 @@ import { _ as _slicedToArray, a as _defineProperty } from '../../../../_rollupPl
|
|
|
2
2
|
import { _ as __rest } from '../../../../_tslib.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { randomId, validateClassName } from '@sebgroup/extract';
|
|
5
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
5
|
+
import { forwardRef, useState, useEffect, useCallback } from 'react';
|
|
6
6
|
import { FormItem } from '../../formItem/formItem.js';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import '../iconButton/iconButton.js';
|
|
9
|
+
import '../button/button.js';
|
|
9
10
|
import '../../icons/times.js';
|
|
10
11
|
import '../../icons/infoCircle.js';
|
|
11
12
|
|
|
12
|
-
var TextArea = function
|
|
13
|
+
var TextArea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
13
14
|
var ariaDescribedBy = _a['aria-describedby'],
|
|
14
15
|
_a$autoComplete = _a.autoComplete,
|
|
15
16
|
autoComplete = _a$autoComplete === void 0 ? 'off' : _a$autoComplete,
|
|
@@ -71,10 +72,11 @@ var TextArea = function TextArea(_a) {
|
|
|
71
72
|
value: localValue,
|
|
72
73
|
"data-testid": dataTestId,
|
|
73
74
|
maxLength: maxLength,
|
|
74
|
-
required: required
|
|
75
|
+
required: required,
|
|
76
|
+
ref: ref
|
|
75
77
|
}, props))
|
|
76
78
|
})
|
|
77
79
|
});
|
|
78
|
-
};
|
|
80
|
+
});
|
|
79
81
|
|
|
80
82
|
export { TextArea };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { _ as _slicedToArray, b as _asyncToGenerator, c as _regeneratorRuntime } from '../../../_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import '../../../_tslib.js';
|
|
4
|
+
import { useRef, useState, useLayoutEffect, useEffect } from 'react';
|
|
4
5
|
import classNames from 'classnames';
|
|
5
6
|
import { IconButton } from '../form/iconButton/iconButton.js';
|
|
6
|
-
import { useRef, useState, useLayoutEffect, useEffect } from 'react';
|
|
7
7
|
import { debounce, randomId, validateClassName, delay } from '@sebgroup/extract';
|
|
8
8
|
import { Times } from '../icons/times.js';
|
|
9
9
|
import { InfoCircle } from '../icons/infoCircle.js';
|
|
10
|
+
import '../form/button/button.js';
|
|
10
11
|
|
|
11
12
|
var FormItem = function FormItem(_ref) {
|
|
12
13
|
var expandableInfo = _ref.expandableInfo,
|
|
@@ -72,6 +73,7 @@ var FormItem = function FormItem(_ref) {
|
|
|
72
73
|
size: "small",
|
|
73
74
|
"aria-expanded": isExpanded,
|
|
74
75
|
"aria-controls": "".concat(inputId, "-expandable-info"),
|
|
76
|
+
"aria-label": expandableInfoButtonLabel,
|
|
75
77
|
onClick: function () {
|
|
76
78
|
var _onClick = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
|
77
79
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -2,9 +2,10 @@ export { FormItem } from './formItem.js';
|
|
|
2
2
|
import '../../../_rollupPluginBabelHelpers.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import '../../../_tslib.js';
|
|
5
|
+
import 'react';
|
|
5
6
|
import 'classnames';
|
|
6
7
|
import '../form/iconButton/iconButton.js';
|
|
7
|
-
import '
|
|
8
|
+
import '../form/button/button.js';
|
|
8
9
|
import '@sebgroup/extract';
|
|
9
10
|
import '../icons/times.js';
|
|
10
11
|
import '../icons/infoCircle.js';
|
package/src/lib/select/index.js
CHANGED
package/src/lib/select/select.js
CHANGED
|
@@ -7,6 +7,7 @@ import { ChevronDown } from '../icons/chevronDown.js';
|
|
|
7
7
|
import { FormItem } from '../formItem/formItem.js';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import '../form/iconButton/iconButton.js';
|
|
10
|
+
import '../form/button/button.js';
|
|
10
11
|
import '../icons/times.js';
|
|
11
12
|
import '../icons/infoCircle.js';
|
|
12
13
|
|