@pantheon-systems/pds-toolkit-react 1.0.0-dev.192 → 1.0.0-dev.193
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.
|
@@ -5,6 +5,7 @@ import './segmented-button.css';
|
|
|
5
5
|
* Structure for each option in the SegmentedButton component.
|
|
6
6
|
*/
|
|
7
7
|
interface OptionType {
|
|
8
|
+
id?: string;
|
|
8
9
|
value: string;
|
|
9
10
|
label: string;
|
|
10
11
|
iconName?: PDSIcon;
|
|
@@ -28,7 +29,7 @@ export interface SegmentedButtonProps {
|
|
|
28
29
|
/**
|
|
29
30
|
* Optional initial selected option value.
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
defaultValue?: string;
|
|
32
33
|
/**
|
|
33
34
|
* Label for the SegmentedButton — visually hidden, used for screen readers only.
|
|
34
35
|
*/
|
|
@@ -49,5 +50,5 @@ export interface SegmentedButtonProps {
|
|
|
49
50
|
/**
|
|
50
51
|
* SegmentedButton UI component
|
|
51
52
|
*/
|
|
52
|
-
export declare const SegmentedButton: ({ disabled, id,
|
|
53
|
+
export declare const SegmentedButton: ({ disabled, id, defaultValue, label, onChange, options, className, ...props }: SegmentedButtonProps) => React.JSX.Element;
|
|
53
54
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export function ToggleButton({ disabled, id,
|
|
1
|
+
export function ToggleButton({ disabled, id, defaultValue, label, onChange, options, ...props }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
id: any;
|
|
5
|
-
|
|
5
|
+
defaultValue: any;
|
|
6
6
|
label: any;
|
|
7
7
|
onChange: any;
|
|
8
8
|
options: any;
|
|
@@ -11,7 +11,7 @@ export namespace ToggleButton {
|
|
|
11
11
|
namespace propTypes {
|
|
12
12
|
let disabled: PropTypes.Requireable<boolean>;
|
|
13
13
|
let id: PropTypes.Validator<string>;
|
|
14
|
-
let
|
|
14
|
+
let defaultValue: PropTypes.Requireable<string>;
|
|
15
15
|
let label: PropTypes.Validator<string>;
|
|
16
16
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
17
|
let options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
@@ -27,6 +27,10 @@ export namespace ToggleButton {
|
|
|
27
27
|
* Option icon
|
|
28
28
|
*/
|
|
29
29
|
iconName: PropTypes.Requireable<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Unique ID for the option
|
|
32
|
+
*/
|
|
33
|
+
id: PropTypes.Requireable<string>;
|
|
30
34
|
}>[]>;
|
|
31
35
|
let className: PropTypes.Requireable<string>;
|
|
32
36
|
}
|