@westpac/ui 0.16.0 → 0.18.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/CHANGELOG.md +12 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/accordion.component.d.ts +2 -1
- package/dist/components/autocomplete/autocomplete.component.js +4 -2
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.d.ts +1 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.js +1 -1
- package/dist/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.js +2 -1
- package/dist/components/badge/badge.component.js +3 -1
- package/dist/components/badge/badge.styles.js +1 -1
- package/dist/components/bottom-sheet/bottom-sheet.component.d.ts +1 -1
- package/dist/components/bottom-sheet/bottom-sheet.component.js +7 -2
- package/dist/components/bottom-sheet/bottom-sheet.types.d.ts +20 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.d.ts +1 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.js +26 -11
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.d.ts +47 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.js +20 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.d.ts +17 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.d.ts +1 -1
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.js +8 -14
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.d.ts +11 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.js +17 -0
- package/dist/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.d.ts +0 -5
- package/dist/components/button-group/button-group.component.js +58 -11
- package/dist/components/button-group/button-group.types.d.ts +9 -1
- package/dist/components/button-group/components/button-group-button/button-group-button.component.js +1 -2
- package/dist/components/checkbox-group/checkbox-group.component.js +61 -10
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +5 -1
- package/dist/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.js +1 -2
- package/dist/components/date-picker/date-picker.types.d.ts +1 -0
- package/dist/components/error-message/error-message.types.d.ts +3 -2
- package/dist/components/icon/components/x-icon.d.ts +2 -0
- package/dist/components/icon/components/x-icon.js +40 -0
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/list/components/list-item/list-item.component.d.ts +1 -1
- package/dist/components/list/list.utils.d.ts +1 -1
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.component.js +4 -2
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.d.ts +10 -0
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.js +7 -2
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.js +7 -2
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.d.ts +43 -5
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.js +30 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.d.ts +1 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.js +21 -4
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.d.ts +47 -5
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.js +32 -1
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.d.ts +16 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.d.ts +2 -1
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.js +11 -2
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.d.ts +18 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +16 -7
- package/dist/components/modal/components/modal-dialog/modal-dialog.types.d.ts +6 -0
- package/dist/components/popover/components/panel/panel.styles.js +2 -2
- package/dist/components/radio-group/components/radio-group-radio/radio-group-radio.component.js +1 -2
- package/dist/components/radio-group/radio-group.component.js +58 -11
- package/dist/components/radio-group/radio-group.types.d.ts +5 -1
- package/dist/components/repeater/repeater.component.js +4 -2
- package/dist/components/selector/components/selector-button-group/selector-button-group.component.js +9 -7
- package/dist/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.js +50 -1
- package/dist/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.js +1 -1
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js +58 -11
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.types.d.ts +5 -1
- package/dist/components/tabs/components/tabs-tab/tabs-tab.component.js +1 -1
- package/dist/components/tabs/tabs.component.d.ts +6 -2
- package/dist/components/tabs/tabs.component.js +7 -1
- package/dist/constants/message.d.ts +1 -0
- package/dist/constants/message.js +1 -0
- package/dist/css/westpac-ui.css +192 -100
- package/dist/css/westpac-ui.min.css +192 -100
- package/package.json +10 -10
- package/src/components/accordion/accordion.component.tsx +3 -3
- package/src/components/accordion/components/accordion-item/accordion-item.component.tsx +2 -2
- package/src/components/autocomplete/autocomplete.component.tsx +5 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.component.tsx +1 -1
- package/src/components/autocomplete/components/autocomplete-list-box/components/autocomplete-list-box-option/autocomplete-list-box-option.styles.ts +1 -1
- package/src/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.tsx +4 -1
- package/src/components/badge/badge.component.tsx +2 -1
- package/src/components/badge/badge.styles.ts +1 -1
- package/src/components/bottom-sheet/bottom-sheet.component.tsx +20 -2
- package/src/components/bottom-sheet/bottom-sheet.types.ts +20 -0
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.component.tsx +33 -14
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.ts +16 -0
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.types.ts +17 -1
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.component.tsx +11 -26
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.styles.ts +14 -0
- package/src/components/bottom-sheet/components/bottom-sheet-modal/bottom-sheet-modal.types.ts +0 -5
- package/src/components/button-group/button-group.component.tsx +58 -11
- package/src/components/button-group/button-group.types.ts +9 -2
- package/src/components/button-group/components/button-group-button/button-group-button.component.tsx +1 -2
- package/src/components/checkbox-group/checkbox-group.component.tsx +62 -10
- package/src/components/checkbox-group/checkbox-group.types.ts +5 -1
- package/src/components/checkbox-group/components/checkbox-group-checkbox/checkbox-group-checkbox.component.tsx +1 -2
- package/src/components/date-picker/date-picker.types.ts +4 -0
- package/src/components/error-message/error-message.component.tsx +2 -2
- package/src/components/error-message/error-message.types.ts +2 -1
- package/src/components/icon/components/x-icon.tsx +37 -0
- package/src/components/icon/index.ts +1 -1
- package/src/components/modal/components/modal-backdrop/modal-backdrop.component.tsx +5 -2
- package/src/components/modal/components/modal-backdrop/modal-backdrop.styles.ts +7 -2
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.tsx +6 -2
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.ts +15 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.tsx +25 -4
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.ts +15 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.types.ts +16 -0
- package/src/components/modal/components/modal-dialog/modal-dialog.component.tsx +10 -3
- package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +14 -5
- package/src/components/modal/components/modal-dialog/modal-dialog.types.ts +7 -0
- package/src/components/pagination/pagination.component.tsx +6 -6
- package/src/components/popover/components/panel/panel.styles.ts +2 -2
- package/src/components/radio-group/components/radio-group-radio/radio-group-radio.component.tsx +1 -2
- package/src/components/radio-group/radio-group.component.tsx +57 -13
- package/src/components/radio-group/radio-group.types.ts +5 -1
- package/src/components/repeater/repeater.component.tsx +2 -0
- package/src/components/selector/components/selector-button-group/selector-button-group.component.tsx +10 -7
- package/src/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.tsx +49 -0
- package/src/components/selector/components/selector-radio-group/components/selector-radio-group-option/selector-radio-group-option.component.tsx +1 -1
- package/src/components/selector/components/selector-radio-group/selector-radio-group.component.tsx +58 -11
- package/src/components/selector/components/selector-radio-group/selector-radio-group.types.ts +5 -1
- package/src/components/tabs/components/tabs-tab/tabs-tab.component.tsx +1 -1
- package/src/components/tabs/tabs.component.tsx +26 -5
- package/src/constants/message.ts +1 -0
- package/src/tailwind/utils/create-font-sizes.ts +11 -8
- package/src/tailwind/utils/generate-font-components.ts +18 -15
- package/src/tailwind/utils/generate-form-control.ts +11 -8
- package/dist/components/icon/components/twitter-icon.d.ts +0 -2
- package/dist/components/icon/components/twitter-icon.js +0 -35
- package/src/components/icon/components/twitter-icon.tsx +0 -37
|
@@ -16,22 +16,69 @@ function _extends() {
|
|
|
16
16
|
import React, { createContext, useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
17
17
|
import { useFocusRing, useRadioGroup } from 'react-aria';
|
|
18
18
|
import { useRadioGroupState } from 'react-stately';
|
|
19
|
+
import { FUNCTION_NOT_IMPLEMENTED } from '../../constants/message.js';
|
|
19
20
|
import { Button } from '../button/index.js';
|
|
20
21
|
import { ExpandMoreIcon } from '../icon/index.js';
|
|
21
22
|
import { ErrorMessage, Hint, Label, RadioGroupRadio } from '../index.js';
|
|
22
23
|
import { styles as radioGroupStyles } from './radio-group.styles.js';
|
|
23
24
|
export const RadioGroupContext = createContext({
|
|
24
|
-
name: '',
|
|
25
|
-
isDisabled: false,
|
|
26
|
-
isReadOnly: false,
|
|
27
|
-
isRequired: false,
|
|
28
|
-
validationState: null,
|
|
29
|
-
selectedValue: null,
|
|
30
|
-
setSelectedValue: ()=>null,
|
|
31
|
-
lastFocusedValue: null,
|
|
32
|
-
setLastFocusedValue: ()=>null,
|
|
33
25
|
orientation: 'vertical',
|
|
34
|
-
size: 'medium'
|
|
26
|
+
size: 'medium',
|
|
27
|
+
state: {
|
|
28
|
+
name: '',
|
|
29
|
+
isDisabled: false,
|
|
30
|
+
isReadOnly: false,
|
|
31
|
+
isRequired: false,
|
|
32
|
+
validationState: null,
|
|
33
|
+
selectedValue: null,
|
|
34
|
+
setSelectedValue: ()=>null,
|
|
35
|
+
lastFocusedValue: null,
|
|
36
|
+
setLastFocusedValue: ()=>null,
|
|
37
|
+
isInvalid: false,
|
|
38
|
+
realtimeValidation: {
|
|
39
|
+
isInvalid: false,
|
|
40
|
+
validationErrors: [],
|
|
41
|
+
validationDetails: {
|
|
42
|
+
badInput: false,
|
|
43
|
+
customError: false,
|
|
44
|
+
patternMismatch: false,
|
|
45
|
+
rangeOverflow: false,
|
|
46
|
+
rangeUnderflow: false,
|
|
47
|
+
stepMismatch: false,
|
|
48
|
+
tooLong: false,
|
|
49
|
+
tooShort: false,
|
|
50
|
+
typeMismatch: false,
|
|
51
|
+
valid: false,
|
|
52
|
+
valueMissing: false
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
displayValidation: {
|
|
56
|
+
isInvalid: false,
|
|
57
|
+
validationErrors: [],
|
|
58
|
+
validationDetails: {
|
|
59
|
+
badInput: false,
|
|
60
|
+
customError: false,
|
|
61
|
+
patternMismatch: false,
|
|
62
|
+
rangeOverflow: false,
|
|
63
|
+
rangeUnderflow: false,
|
|
64
|
+
stepMismatch: false,
|
|
65
|
+
tooLong: false,
|
|
66
|
+
tooShort: false,
|
|
67
|
+
typeMismatch: false,
|
|
68
|
+
valid: false,
|
|
69
|
+
valueMissing: false
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
updateValidation: function() {
|
|
73
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
74
|
+
},
|
|
75
|
+
resetValidation: function() {
|
|
76
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
77
|
+
},
|
|
78
|
+
commitValidation: function() {
|
|
79
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
35
82
|
});
|
|
36
83
|
export function RadioGroup({ className , radios , label , orientation ='vertical' , showAmount =0 , size ='medium' , errorMessage , hintMessage , ...props }) {
|
|
37
84
|
const state = useRadioGroupState({
|
|
@@ -84,7 +131,7 @@ export function RadioGroup({ className , radios , label , orientation ='vertical
|
|
|
84
131
|
id: panelId
|
|
85
132
|
}, React.createElement(RadioGroupContext.Provider, {
|
|
86
133
|
value: {
|
|
87
|
-
|
|
134
|
+
state,
|
|
88
135
|
orientation,
|
|
89
136
|
size
|
|
90
137
|
}
|
|
@@ -126,7 +126,8 @@ export function Repeater({ addText ='Add another item' , indexTag: ItemIndex = '
|
|
|
126
126
|
look: "link",
|
|
127
127
|
size: "small",
|
|
128
128
|
soft: true,
|
|
129
|
-
onClick: ()=>handleRemove(item.id, index)
|
|
129
|
+
onClick: ()=>handleRemove(item.id, index),
|
|
130
|
+
type: "button"
|
|
130
131
|
}, "Remove")));
|
|
131
132
|
})))), React.createElement("div", {
|
|
132
133
|
className: styles.footer()
|
|
@@ -139,7 +140,8 @@ export function Repeater({ addText ='Add another item' , indexTag: ItemIndex = '
|
|
|
139
140
|
look: "link",
|
|
140
141
|
size: "small",
|
|
141
142
|
soft: true,
|
|
142
|
-
onClick: ()=>handleAdd()
|
|
143
|
+
onClick: ()=>handleAdd(),
|
|
144
|
+
type: "button"
|
|
143
145
|
}, addText)), React.createElement(VisuallyHidden, {
|
|
144
146
|
role: "status"
|
|
145
147
|
}, status));
|
package/dist/components/selector/components/selector-button-group/selector-button-group.component.js
CHANGED
|
@@ -13,7 +13,7 @@ function _extends() {
|
|
|
13
13
|
};
|
|
14
14
|
return _extends.apply(this, arguments);
|
|
15
15
|
}
|
|
16
|
-
import { createContext, useCallback, useState } from 'react';
|
|
16
|
+
import { createContext, useCallback, useMemo, useState } from 'react';
|
|
17
17
|
import { useField } from 'react-aria';
|
|
18
18
|
import { ErrorMessage, Hint, Label } from '../../../index.js';
|
|
19
19
|
import { styles } from './selector-button-group.styles.js';
|
|
@@ -31,12 +31,14 @@ export function SelectorButtonGroup({ className , children , label , orientation
|
|
|
31
31
|
selected,
|
|
32
32
|
setSelected
|
|
33
33
|
]);
|
|
34
|
-
const state = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const state = useMemo(()=>({
|
|
35
|
+
value: selected,
|
|
36
|
+
onClick: (id)=>handleChange(id),
|
|
37
|
+
validationState: errorMessage ? 'invalid' : 'valid',
|
|
38
|
+
isDisabled
|
|
39
|
+
}), [
|
|
40
|
+
selected
|
|
41
|
+
]);
|
|
40
42
|
const { labelProps , fieldProps , descriptionProps , errorMessageProps } = useField({
|
|
41
43
|
validationState: state.validationState,
|
|
42
44
|
label,
|
|
@@ -16,6 +16,7 @@ function _extends() {
|
|
|
16
16
|
import React, { createContext } from 'react';
|
|
17
17
|
import { useCheckboxGroup } from 'react-aria';
|
|
18
18
|
import { useCheckboxGroupState } from 'react-stately';
|
|
19
|
+
import { FUNCTION_NOT_IMPLEMENTED } from '../../../../constants/message.js';
|
|
19
20
|
import { ErrorMessage, Hint, Label } from '../../../index.js';
|
|
20
21
|
import { styles } from './selector-checkbox-group.styles.js';
|
|
21
22
|
export const SelectorCheckboxGroupContext = createContext({
|
|
@@ -27,7 +28,55 @@ export const SelectorCheckboxGroupContext = createContext({
|
|
|
27
28
|
addValue: ()=>null,
|
|
28
29
|
removeValue: ()=>null,
|
|
29
30
|
toggleValue: ()=>null,
|
|
30
|
-
validationState: 'valid'
|
|
31
|
+
validationState: 'valid',
|
|
32
|
+
isInvalid: false,
|
|
33
|
+
isRequired: false,
|
|
34
|
+
setInvalid: function() {
|
|
35
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
36
|
+
},
|
|
37
|
+
realtimeValidation: {
|
|
38
|
+
isInvalid: false,
|
|
39
|
+
validationErrors: [],
|
|
40
|
+
validationDetails: {
|
|
41
|
+
badInput: false,
|
|
42
|
+
customError: false,
|
|
43
|
+
patternMismatch: false,
|
|
44
|
+
rangeOverflow: false,
|
|
45
|
+
rangeUnderflow: false,
|
|
46
|
+
stepMismatch: false,
|
|
47
|
+
tooLong: false,
|
|
48
|
+
tooShort: false,
|
|
49
|
+
typeMismatch: false,
|
|
50
|
+
valid: false,
|
|
51
|
+
valueMissing: false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
displayValidation: {
|
|
55
|
+
isInvalid: false,
|
|
56
|
+
validationErrors: [],
|
|
57
|
+
validationDetails: {
|
|
58
|
+
badInput: false,
|
|
59
|
+
customError: false,
|
|
60
|
+
patternMismatch: false,
|
|
61
|
+
rangeOverflow: false,
|
|
62
|
+
rangeUnderflow: false,
|
|
63
|
+
stepMismatch: false,
|
|
64
|
+
tooLong: false,
|
|
65
|
+
tooShort: false,
|
|
66
|
+
typeMismatch: false,
|
|
67
|
+
valid: false,
|
|
68
|
+
valueMissing: false
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
updateValidation: function() {
|
|
72
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
73
|
+
},
|
|
74
|
+
resetValidation: function() {
|
|
75
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
76
|
+
},
|
|
77
|
+
commitValidation: function() {
|
|
78
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
79
|
+
}
|
|
31
80
|
});
|
|
32
81
|
export function SelectorCheckboxGroup(props) {
|
|
33
82
|
const { children , label , description , errorMessage } = props;
|
|
@@ -20,7 +20,7 @@ import { FlexiCell } from '../../../../../index.js';
|
|
|
20
20
|
import { SelectorRadioGroupContext } from '../../selector-radio-group.component.js';
|
|
21
21
|
import { styles as selectorRadioGroupOptionStyles } from './selector-radio-group-option.styles.js';
|
|
22
22
|
function BaseSelectorRadioGroupOption({ className , children , value , withBorder =true , withArrow , after , before , checkIcon ='checkbox' , ...props }, ref) {
|
|
23
|
-
const state = useContext(SelectorRadioGroupContext);
|
|
23
|
+
const { state } = useContext(SelectorRadioGroupContext);
|
|
24
24
|
const localRef = useRef(null);
|
|
25
25
|
const { inputProps , isSelected , isDisabled } = useRadio({
|
|
26
26
|
...props,
|
package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js
CHANGED
|
@@ -16,19 +16,66 @@ function _extends() {
|
|
|
16
16
|
import React, { createContext } from 'react';
|
|
17
17
|
import { useRadioGroup } from 'react-aria';
|
|
18
18
|
import { useRadioGroupState } from 'react-stately';
|
|
19
|
+
import { FUNCTION_NOT_IMPLEMENTED } from '../../../../constants/message.js';
|
|
19
20
|
import { ErrorMessage, Hint, Label } from '../../../index.js';
|
|
20
21
|
import { styles } from './selector-radio-group.styles.js';
|
|
21
22
|
export const SelectorRadioGroupContext = createContext({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
orientation: 'vertical',
|
|
24
|
+
state: {
|
|
25
|
+
name: '',
|
|
26
|
+
isDisabled: false,
|
|
27
|
+
isReadOnly: false,
|
|
28
|
+
isRequired: false,
|
|
29
|
+
validationState: null,
|
|
30
|
+
selectedValue: null,
|
|
31
|
+
setSelectedValue: ()=>null,
|
|
32
|
+
lastFocusedValue: null,
|
|
33
|
+
setLastFocusedValue: ()=>null,
|
|
34
|
+
isInvalid: false,
|
|
35
|
+
realtimeValidation: {
|
|
36
|
+
isInvalid: false,
|
|
37
|
+
validationErrors: [],
|
|
38
|
+
validationDetails: {
|
|
39
|
+
badInput: false,
|
|
40
|
+
customError: false,
|
|
41
|
+
patternMismatch: false,
|
|
42
|
+
rangeOverflow: false,
|
|
43
|
+
rangeUnderflow: false,
|
|
44
|
+
stepMismatch: false,
|
|
45
|
+
tooLong: false,
|
|
46
|
+
tooShort: false,
|
|
47
|
+
typeMismatch: false,
|
|
48
|
+
valid: false,
|
|
49
|
+
valueMissing: false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
displayValidation: {
|
|
53
|
+
isInvalid: false,
|
|
54
|
+
validationErrors: [],
|
|
55
|
+
validationDetails: {
|
|
56
|
+
badInput: false,
|
|
57
|
+
customError: false,
|
|
58
|
+
patternMismatch: false,
|
|
59
|
+
rangeOverflow: false,
|
|
60
|
+
rangeUnderflow: false,
|
|
61
|
+
stepMismatch: false,
|
|
62
|
+
tooLong: false,
|
|
63
|
+
tooShort: false,
|
|
64
|
+
typeMismatch: false,
|
|
65
|
+
valid: false,
|
|
66
|
+
valueMissing: false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
updateValidation: function() {
|
|
70
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
71
|
+
},
|
|
72
|
+
resetValidation: function() {
|
|
73
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
74
|
+
},
|
|
75
|
+
commitValidation: function() {
|
|
76
|
+
throw new Error(FUNCTION_NOT_IMPLEMENTED);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
32
79
|
});
|
|
33
80
|
export function SelectorRadioGroup({ className , children , label , orientation ='vertical' , errorMessage , description , ...props }) {
|
|
34
81
|
const state = useRadioGroupState({
|
|
@@ -51,7 +98,7 @@ export function SelectorRadioGroup({ className , children , label , orientation
|
|
|
51
98
|
})
|
|
52
99
|
}, radioGroupProps), React.createElement(SelectorRadioGroupContext.Provider, {
|
|
53
100
|
value: {
|
|
54
|
-
|
|
101
|
+
state,
|
|
55
102
|
orientation
|
|
56
103
|
}
|
|
57
104
|
}, children)));
|
package/dist/components/selector/components/selector-radio-group/selector-radio-group.types.d.ts
CHANGED
|
@@ -19,5 +19,9 @@ export type SelectorRadioGroupContextState = {
|
|
|
19
19
|
* Controls orientation of `Radio` components, can't be applied directly on `Radio`
|
|
20
20
|
*/
|
|
21
21
|
orientation: 'vertical' | 'horizontal';
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Radio group state
|
|
24
|
+
*/
|
|
25
|
+
state: RadioGroupState;
|
|
26
|
+
};
|
|
23
27
|
export {};
|
|
@@ -18,7 +18,7 @@ import { styles } from './tabs-tab.styles.js';
|
|
|
18
18
|
export function TabsTab({ item: { key , rendered } , state , orientation , justify , color , look }) {
|
|
19
19
|
const ref = useRef(null);
|
|
20
20
|
const { tabProps } = useTab({
|
|
21
|
-
key
|
|
21
|
+
key: key
|
|
22
22
|
}, state, ref);
|
|
23
23
|
const { isFocusVisible , focusProps } = useFocusRing();
|
|
24
24
|
return React.createElement("div", _extends({}, mergeProps(tabProps, focusProps), {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
import { AriaLinkOptions } from 'react-aria';
|
|
3
|
+
import { ItemProps } from 'react-stately';
|
|
2
4
|
import { type TabsProps } from './tabs.types.js';
|
|
3
|
-
export declare function Tabs({ className, orientation, justify, children, color, look, sticky, stickyOffset, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const TabsPanel:
|
|
5
|
+
export declare function Tabs({ className, orientation, justify, children, color, look, sticky, stickyOffset, disabledKeys, selectedKey, defaultSelectedKey, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const TabsPanel: (props: ItemProps<AriaLinkOptions> & AriaLinkOptions & {
|
|
7
|
+
href?: string;
|
|
8
|
+
}) => JSX.Element;
|
|
@@ -18,10 +18,13 @@ import { useTabList } from 'react-aria';
|
|
|
18
18
|
import { Item, useTabListState } from 'react-stately';
|
|
19
19
|
import { TabsTab, TabsTabPanel } from './components/index.js';
|
|
20
20
|
import { styles as tabStyles } from './tabs.styles.js';
|
|
21
|
-
export function Tabs({ className , orientation ='horizontal' , justify , children , color , look ='default' , sticky =false , stickyOffset ={} , ...props }) {
|
|
21
|
+
export function Tabs({ className , orientation ='horizontal' , justify , children , color , look ='default' , sticky =false , stickyOffset ={} , disabledKeys , selectedKey , defaultSelectedKey , ...props }) {
|
|
22
22
|
var _state_selectedItem;
|
|
23
23
|
const state = useTabListState({
|
|
24
24
|
...props,
|
|
25
|
+
disabledKeys: disabledKeys,
|
|
26
|
+
selectedKey: selectedKey,
|
|
27
|
+
defaultSelectedKey: defaultSelectedKey,
|
|
25
28
|
children
|
|
26
29
|
});
|
|
27
30
|
const styles = tabStyles({
|
|
@@ -32,6 +35,9 @@ export function Tabs({ className , orientation ='horizontal' , justify , childre
|
|
|
32
35
|
const ref = useRef(null);
|
|
33
36
|
const { tabListProps } = useTabList({
|
|
34
37
|
...props,
|
|
38
|
+
disabledKeys: disabledKeys,
|
|
39
|
+
selectedKey: selectedKey,
|
|
40
|
+
defaultSelectedKey: defaultSelectedKey,
|
|
35
41
|
orientation
|
|
36
42
|
}, state, ref);
|
|
37
43
|
return React.createElement("div", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FUNCTION_NOT_IMPLEMENTED = "Function not implemented";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const FUNCTION_NOT_IMPLEMENTED = 'Function not implemented';
|