gantri-components 2.257.0 → 2.259.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.
@@ -25,6 +25,12 @@ export interface ColorPickerProps extends Partial<ColorPickerDefaultProps> {
25
25
  export interface ColorPickerDefaultProps {
26
26
  allowDeselecting: boolean;
27
27
  allowMultipleSelection: boolean;
28
+ /**
29
+ * When `true`, `disabled` colors collapse to a small centered dot (e.g. a
30
+ * "Creator's choice" view). When `false` (default) they keep their full size
31
+ * but stay non-selectable (e.g. an "All colors" view). The change animates.
32
+ */
33
+ collapseDisabled: boolean;
28
34
  /** List of colors to render. Defaults to Gantri's product colors list. */
29
35
  colors: ColorDetails[];
30
36
  /**
@@ -41,6 +47,9 @@ export interface ColorPickerDefaultProps {
41
47
  export interface ColorDetails {
42
48
  code: ProductColorCode;
43
49
  name: string;
50
+ /** When true, the swatch is not selectable and renders as a small centered
51
+ * dot — used to show palette colors the product is not available in. */
52
+ disabled?: boolean;
44
53
  }
45
54
  export interface ColorPickerChangeEvent extends Pick<ChangeEvent<HTMLInputElement>, Exclude<keyof ChangeEvent<HTMLInputElement>, 'target'>> {
46
55
  target: {
@@ -4,6 +4,8 @@ import { CSSProperties } from 'styled-components';
4
4
  import { ColorPickerVariantProp } from '../../color-picker.types';
5
5
  import { ProductColorCode } from '../../../../styles/theme';
6
6
  interface StyledColorOutlineProps {
7
+ $collapsed?: boolean;
8
+ $disabled?: boolean;
7
9
  $isClickable: boolean;
8
10
  $selected?: boolean;
9
11
  $size?: CSSProperties['width'];
@@ -1129,6 +1131,7 @@ export declare const StyledColor: import("styled-components/dist/types").IStyled
1129
1131
  scrollLeft?: number | import("@react-spring/shared/dist/declarations/src/fluids").FluidValue<number, any> | undefined;
1130
1132
  viewBox?: string | import("@react-spring/shared/dist/declarations/src/fluids").FluidValue<string, any> | undefined;
1131
1133
  }, {
1134
+ $collapsed?: boolean | undefined;
1132
1135
  color: ProductColorCode;
1133
1136
  }>> & string & Omit<import("react-spring").AnimatedComponent<"span">, keyof import("react").Component<any, {}, any>>;
1134
1137
  export {};
@@ -2,7 +2,11 @@ import { CSSProperties } from 'styled-components';
2
2
  import { ColorDetails, ColorPickerVariantProp } from '../../color-picker.types';
3
3
  export interface ColorPickerItemProps extends Partial<ColorPickerItemDefaultProps> {
4
4
  active?: boolean;
5
+ /** When true (with `disabled`), collapse the swatch to a small centered dot. */
6
+ collapseDisabled?: boolean;
5
7
  color: ColorDetails;
8
+ /** Not selectable. Collapses to a small centered dot when `collapseDisabled`. */
9
+ disabled?: boolean;
6
10
  onColorClick?: (color: ColorDetails) => void;
7
11
  readOnly?: boolean;
8
12
  /** Overrides `variant`. */