gantri-components 1.161.5 → 2.0.0-beta.2

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.
@@ -1,2 +1,2 @@
1
1
  import { ColorPickerDefaultProps } from './color-picker.types';
2
- export declare const ColorPickerPresets: ColorPickerDefaultProps;
2
+ export declare const colorPickerDefaultProps: ColorPickerDefaultProps;
@@ -1,4 +1,5 @@
1
1
  import { ChangeEvent } from 'react';
2
+ import { ProductColorCode } from '../../styles/theme';
2
3
  export declare type ColorPickerVariant = 'large' | 'small';
3
4
  export interface ColorPickerProps extends Partial<ColorPickerDefaultProps> {
4
5
  labelText?: string;
@@ -6,21 +7,19 @@ export interface ColorPickerProps extends Partial<ColorPickerDefaultProps> {
6
7
  labelTxValues?: Record<string, unknown>;
7
8
  name?: string;
8
9
  onChange?: (event: ColorPickerChangeEvent) => void;
9
- onValueChange?: (selected: PickerColor | PickerColor[] | null) => void;
10
+ onValueChange?: (selected: ColorDetails | ColorDetails[] | null) => void;
10
11
  readOnly?: boolean;
11
12
  value?: string | string[];
12
13
  }
13
14
  export interface ColorPickerDefaultProps {
14
15
  allowMultipleSelection: boolean;
15
16
  /** List of colors to render. Defaults to Gantri's product colors list. */
16
- colors: PickerColor[];
17
+ colors: ColorDetails[];
17
18
  variant: ColorPickerVariant;
18
19
  }
19
- export interface PickerColor {
20
- code: string;
21
- name: string;
22
- tooltipLabel?: string;
23
- value?: string;
20
+ export interface ColorDetails {
21
+ code: ProductColorCode;
22
+ label: string;
24
23
  }
25
24
  export interface ColorPickerChangeEvent extends Pick<ChangeEvent<HTMLInputElement>, Exclude<keyof ChangeEvent<HTMLInputElement>, 'target'>> {
26
25
  target: {
@@ -1,5 +1,6 @@
1
1
  import { CSSProperties } from 'styled-components';
2
2
  import { ColorPickerVariant } from '../../color-picker.types';
3
+ import { ProductColorCode } from '../../../../styles/theme';
3
4
  export declare const StyledColorOutline: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
5
  $isClickable: boolean;
5
6
  $selected?: boolean | undefined;
@@ -9,5 +10,5 @@ export declare const StyledColorOutline: import("styled-components").StyledCompo
9
10
  export declare const StyledColor: import("styled-components").StyledComponent<import("react-spring").AnimatedComponent<"span">, import("styled-components").DefaultTheme, {
10
11
  $size?: CSSProperties['width'];
11
12
  $variant?: ColorPickerVariant | undefined;
12
- color: string;
13
+ color: ProductColorCode;
13
14
  }, never>;
@@ -1,9 +1,9 @@
1
1
  import { CSSProperties } from 'styled-components';
2
- import { ColorPickerVariant, PickerColor } from '../../color-picker.types';
2
+ import { ColorPickerVariant, ColorDetails } from '../../color-picker.types';
3
3
  export interface ColorPickerItemProps extends Partial<ColorPickerItemDefaultProps> {
4
4
  active?: boolean;
5
- color: PickerColor;
6
- onColorClick?: (color: PickerColor) => void;
5
+ color: ColorDetails;
6
+ onColorClick?: (color: ColorDetails) => void;
7
7
  /** Overrides `variant`. */
8
8
  size?: CSSProperties['width'];
9
9
  }