@bolttech/atoms-segmented-control 0.2.2 → 0.3.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 CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@bolttech/atoms-segmented-control",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "main": "./index.cjs",
5
5
  "type": "commonjs",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {
8
- "@edirect/frontend-foundations": "0.0.53",
8
+ "@edirect/frontend-foundations": "0.0.55",
9
9
  "react": "18.2.0",
10
10
  "styled-components": "5.3.6"
11
11
  },
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { SegmentedControlProps } from './atoms-segmented-control.type';
3
- export declare function SegmentedControl(props: SegmentedControlProps): JSX.Element;
3
+ export declare function SegmentedControl({ id, dataTestId, value, options, errorMessage, onChange, onBlur, onFocus, }: SegmentedControlProps): JSX.Element;
4
4
  export default SegmentedControl;
@@ -1,7 +1,10 @@
1
- export declare const StyledAtomsSegmentedControl: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
1
+ export declare const SegmentedControlContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const SegmentedControlWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
3
  export declare const Option: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
3
4
  pressed: boolean;
5
+ hasError: boolean;
4
6
  }, never>;
5
7
  export declare const OptionLabel: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
6
8
  pressed: boolean;
7
9
  }, never>;
10
+ export declare const LabelError: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {}, never>;
@@ -1,8 +1,14 @@
1
+ /// <reference types="react" />
1
2
  export interface SegmentedControlProps {
2
- selected?: string | number;
3
+ id?: string;
4
+ dataTestId?: string;
5
+ value?: string | number;
3
6
  options: {
4
7
  label: string;
5
8
  value: string | number;
6
9
  }[];
7
- onSelect?: (valueSelected: string | number) => void;
10
+ errorMessage?: string;
11
+ onChange?: (value: string | number) => void;
12
+ onBlur?: ((value: unknown) => void) | ((evt: React.FocusEvent<HTMLElement, Element>) => void);
13
+ onFocus?: ((value: unknown) => void) | ((evt: React.FocusEvent<HTMLElement, Element>) => void);
8
14
  }