@sebgroup/green-react 3.21.0 → 3.23.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/index.js +1 -1
- package/package.json +2 -2
- package/src/core/dropdown/index.d.ts +1 -0
- package/src/core/dropdown/index.js +1 -0
- package/src/core/input/index.d.ts +1 -0
- package/src/core/input/index.js +1 -0
- package/src/core/textarea/index.d.ts +1 -0
- package/src/core/textarea/index.js +1 -0
- package/src/index.js +1 -1
- package/src/lib/datepicker/datepicker.js +4 -2
- package/src/lib/dropdown/dropdown.d.ts +2 -1
- package/src/lib/dropdown/dropdown.js +3 -1
- package/src/lib/form/useInput.d.ts +1 -1
- package/src/lib/segmented-control/index.js +1 -1
- package/src/lib/segmented-control/segmented-control.d.ts +13 -8
- package/src/lib/segmented-control/segmented-control.js +13 -8
package/index.js
CHANGED
|
@@ -306,7 +306,7 @@ export { Times } from './src/lib/icons/times.js';
|
|
|
306
306
|
export { InfoCircle } from './src/lib/icons/infoCircle.js';
|
|
307
307
|
export { Edit } from './src/lib/icons/edit.js';
|
|
308
308
|
export { Breadcrumb, BreadcrumbItem } from './src/lib/breadcrumb/breadcrumb.js';
|
|
309
|
-
export {
|
|
309
|
+
export { GdsSegementedControl, GdsSegment, Segment, SegmentedControl } from './src/lib/segmented-control/segmented-control.js';
|
|
310
310
|
import './_rollupPluginBabelHelpers.js';
|
|
311
311
|
import 'react/jsx-runtime';
|
|
312
312
|
import 'react';
|
package/package.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"module": "./src/index.js",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.23.0",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"react": "^17 || ^18",
|
|
8
8
|
"react-dom": "^17 || ^18"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@sebgroup/green-core": "^1.48.1",
|
|
12
|
-
"@sebgroup/chlorophyll": "^3.6.
|
|
12
|
+
"@sebgroup/chlorophyll": "^3.6.10",
|
|
13
13
|
"@sebgroup/extract": "^3.0.1",
|
|
14
14
|
"@lit/react": "^1.0.2",
|
|
15
15
|
"classnames": "^2.3.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GdsDropdown } from "@sebgroup/green-core/components/dropdown/dropdown.js";
|
|
2
2
|
declare const reactWrapper: import("@lit/react").ReactWebComponent<GdsDropdown<any>, {
|
|
3
|
+
onInput: string;
|
|
3
4
|
onChange: string;
|
|
4
5
|
onGdsUiState: string;
|
|
5
6
|
onGdsElementDisconnected: string;
|
package/src/core/input/index.js
CHANGED
package/src/index.js
CHANGED
|
@@ -306,7 +306,7 @@ export { Times } from './lib/icons/times.js';
|
|
|
306
306
|
export { InfoCircle } from './lib/icons/infoCircle.js';
|
|
307
307
|
export { Edit } from './lib/icons/edit.js';
|
|
308
308
|
export { Breadcrumb, BreadcrumbItem } from './lib/breadcrumb/breadcrumb.js';
|
|
309
|
-
export {
|
|
309
|
+
export { GdsSegementedControl, GdsSegment, Segment, SegmentedControl } from './lib/segmented-control/segmented-control.js';
|
|
310
310
|
import '../_rollupPluginBabelHelpers.js';
|
|
311
311
|
import 'react/jsx-runtime';
|
|
312
312
|
import 'react';
|
|
@@ -25,9 +25,10 @@ var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
25
25
|
showWeeks = _a.showWeeks,
|
|
26
26
|
testId = _a.testId,
|
|
27
27
|
validator = _a.validator,
|
|
28
|
+
size = _a.size,
|
|
28
29
|
selectedDate = _a.selectedDate,
|
|
29
30
|
currentDate = _a.currentDate,
|
|
30
|
-
props = __rest(_a, ["label", "onChange", "minDate", "maxDate", "value", "showWeeks", "testId", "validator", "selectedDate", "currentDate"]);
|
|
31
|
+
props = __rest(_a, ["label", "onChange", "minDate", "maxDate", "value", "showWeeks", "testId", "validator", "size", "selectedDate", "currentDate"]);
|
|
31
32
|
if (currentDate && !value) value = currentDate;
|
|
32
33
|
if (selectedDate && !value) value = selectedDate;
|
|
33
34
|
var min = minDate ? minDate : new Date(new Date().getFullYear() - 10, 0, 1);
|
|
@@ -56,7 +57,8 @@ var Datepicker = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
56
57
|
showWeekNumbers: showWeeks,
|
|
57
58
|
onchange: onChangeHandler,
|
|
58
59
|
value: value,
|
|
59
|
-
ref: _ref
|
|
60
|
+
ref: _ref,
|
|
61
|
+
size: size === 'small' ? 'small' : 'large'
|
|
60
62
|
}, props))
|
|
61
63
|
});
|
|
62
64
|
});
|
|
@@ -58,6 +58,7 @@ export declare const CoreDropdown: import("@lit/react").ReactWebComponent<GdsDro
|
|
|
58
58
|
export declare const CoreOption: import("@lit/react").ReactWebComponent<GdsOption, {}>;
|
|
59
59
|
export interface DropdownProps extends DropdownArgs {
|
|
60
60
|
onChange?: OnChange;
|
|
61
|
+
required?: boolean;
|
|
61
62
|
}
|
|
62
|
-
export declare const Dropdown: ({ compareWith, display, id, informationLabel, label, multiSelect, onChange, options, searchFilter, searchable, texts, useValue, validator, value, syncPopoverWidth, disableMobileStyles, onGdsUiState, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
export declare const Dropdown: ({ compareWith, display, id, informationLabel, label, multiSelect, onChange, options, searchFilter, searchable, texts, useValue, validator, value, syncPopoverWidth, disableMobileStyles, onGdsUiState, required, ...props }: DropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
63
64
|
export default Dropdown;
|
|
@@ -43,7 +43,8 @@ var Dropdown = function Dropdown(_a) {
|
|
|
43
43
|
syncPopoverWidth = _a.syncPopoverWidth,
|
|
44
44
|
disableMobileStyles = _a.disableMobileStyles,
|
|
45
45
|
_onGdsUiState = _a.onGdsUiState,
|
|
46
|
-
|
|
46
|
+
required = _a.required,
|
|
47
|
+
props = __rest(_a, ["compareWith", "display", "id", "informationLabel", "label", "multiSelect", "onChange", "options", "searchFilter", "searchable", "texts", "useValue", "validator", "value", "syncPopoverWidth", "disableMobileStyles", "onGdsUiState", "required"]);
|
|
47
48
|
var handleOnChange = function handleOnChange(e) {
|
|
48
49
|
if ('value' in e.detail) {
|
|
49
50
|
onChange === null || onChange === void 0 ? void 0 : onChange(e.detail.value);
|
|
@@ -78,6 +79,7 @@ var Dropdown = function Dropdown(_a) {
|
|
|
78
79
|
hideLabel: props.hideLabel,
|
|
79
80
|
maxHeight: props.maxHeight,
|
|
80
81
|
disableMobileStyles: disableMobileStyles,
|
|
82
|
+
required: required,
|
|
81
83
|
onGdsUiState: function onGdsUiState(e) {
|
|
82
84
|
return _onGdsUiState === null || _onGdsUiState === void 0 ? void 0 : _onGdsUiState(e);
|
|
83
85
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes, RefObject } from 'react';
|
|
2
|
-
declare const useInput: (props: InputHTMLAttributes<HTMLInputElement>, onChanges?: (
|
|
2
|
+
declare const useInput: (props: InputHTMLAttributes<HTMLInputElement>, onChanges?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string) => InputHTMLAttributes<HTMLInputElement> & {
|
|
3
3
|
ref: RefObject<HTMLInputElement>;
|
|
4
4
|
};
|
|
5
5
|
export default useInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { GdsSegementedControl, GdsSegment, Segment, SegmentedControl } from './segmented-control.js';
|
|
2
2
|
import '../../../_tslib.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { GdsSegmentedControl } from '@sebgroup/green-core/components/segmented-control/index.js';
|
|
3
|
-
import { GdsSegment } from '@sebgroup/green-core/components/segmented-control/segment/index.js';
|
|
4
|
-
export declare const
|
|
2
|
+
import { GdsSegmentedControl as CoreSegmentedControl } from '@sebgroup/green-core/components/segmented-control/index.js';
|
|
3
|
+
import { GdsSegment as CoreSegment } from '@sebgroup/green-core/components/segmented-control/segment/index.js';
|
|
4
|
+
export declare const GdsSegementedControl: import("@lit/react").ReactWebComponent<CoreSegmentedControl<any>, {
|
|
5
5
|
onchange: string;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const GdsSegment: import("@lit/react").ReactWebComponent<CoreSegment<any>, {}>;
|
|
8
8
|
export interface SegmentedControlProps {
|
|
9
9
|
value?: string;
|
|
10
|
-
segMinWidth?: number;
|
|
11
10
|
size?: 'small' | 'medium';
|
|
12
11
|
onChange?: (event: Event) => void;
|
|
13
12
|
className?: string;
|
|
@@ -18,7 +17,13 @@ export interface SegmentProps {
|
|
|
18
17
|
className?: string;
|
|
19
18
|
disabled?: boolean;
|
|
20
19
|
children?: ReactNode | ReactNode[];
|
|
20
|
+
width?: string;
|
|
21
|
+
'min-Width'?: string;
|
|
22
|
+
'max-Width'?: string;
|
|
23
|
+
/** @deprecated */
|
|
24
|
+
segMinWidth?: number;
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
declare const
|
|
24
|
-
|
|
26
|
+
/** @deprecated - Use `GdsSegmentedControl` instead */
|
|
27
|
+
export declare const SegmentedControl: React.FC<SegmentedControlProps>;
|
|
28
|
+
/** @deprecated - Use `GdsSegmented` instead */
|
|
29
|
+
export declare const Segment: React.FC<SegmentProps>;
|
|
@@ -4,12 +4,12 @@ import React__default from 'react';
|
|
|
4
4
|
import { createComponent } from '@lit/react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { GdsSegmentedControl } from '@sebgroup/green-core/components/segmented-control/index.js';
|
|
7
|
-
import { GdsSegment } from '@sebgroup/green-core/components/segmented-control/segment/index.js';
|
|
7
|
+
import { GdsSegment as GdsSegment$1 } from '@sebgroup/green-core/components/segmented-control/segment/index.js';
|
|
8
8
|
import { getScopedTagName } from '@sebgroup/green-core/scoping';
|
|
9
9
|
import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles';
|
|
10
10
|
|
|
11
11
|
registerTransitionalStyles();
|
|
12
|
-
var
|
|
12
|
+
var GdsSegementedControl = createComponent({
|
|
13
13
|
tagName: getScopedTagName('gds-segmented-control'),
|
|
14
14
|
elementClass: GdsSegmentedControl,
|
|
15
15
|
events: {
|
|
@@ -17,26 +17,31 @@ var CoreSegementedControl = createComponent({
|
|
|
17
17
|
},
|
|
18
18
|
react: React__default
|
|
19
19
|
});
|
|
20
|
-
var
|
|
20
|
+
var GdsSegment = createComponent({
|
|
21
21
|
tagName: getScopedTagName('gds-segment'),
|
|
22
|
-
elementClass: GdsSegment,
|
|
22
|
+
elementClass: GdsSegment$1,
|
|
23
23
|
react: React__default
|
|
24
24
|
});
|
|
25
|
+
/** @deprecated - Use `GdsSegmentedControl` instead */
|
|
25
26
|
var SegmentedControl = function SegmentedControl(_a) {
|
|
26
27
|
var onChange = _a.onChange,
|
|
27
28
|
className = _a.className,
|
|
28
29
|
props = __rest(_a, ["onChange", "className"]);
|
|
29
|
-
return jsx(
|
|
30
|
+
return jsx(GdsSegementedControl, Object.assign({
|
|
30
31
|
onchange: onChange,
|
|
31
32
|
className: classNames(className)
|
|
32
33
|
}, props));
|
|
33
34
|
};
|
|
35
|
+
/** @deprecated - Use `GdsSegmented` instead */
|
|
34
36
|
var Segment = function Segment(_a) {
|
|
37
|
+
var _b;
|
|
35
38
|
var className = _a.className,
|
|
36
39
|
props = __rest(_a, ["className"]);
|
|
37
|
-
return jsx(
|
|
40
|
+
return jsx(GdsSegment, Object.assign({
|
|
38
41
|
className: classNames(className)
|
|
39
|
-
}, props
|
|
42
|
+
}, props, {
|
|
43
|
+
"min-width": props['min-Width'] || ((_b = props.segMinWidth) === null || _b === void 0 ? void 0 : _b.toString())
|
|
44
|
+
}));
|
|
40
45
|
};
|
|
41
46
|
|
|
42
|
-
export {
|
|
47
|
+
export { GdsSegementedControl, GdsSegment, Segment, SegmentedControl };
|