gantri-components 2.258.0 → 2.260.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.
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const StyledColorPicker: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const StyledColorList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
+ export declare const StyledColorList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
+ $columns?: number | undefined;
5
+ }>> & string;
@@ -4,6 +4,12 @@ import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
4
4
  export type ColorPickerVariant = 'x-large' | 'large' | 'small';
5
5
  export type ColorPickerVariantProp = ResolutionAwareProp<ColorPickerVariant>;
6
6
  export interface ColorPickerProps extends Partial<ColorPickerDefaultProps> {
7
+ /**
8
+ * When set, render swatches in a CSS grid with this many columns; each swatch
9
+ * fills its column width. When omitted, swatches flow/wrap at their natural
10
+ * size (default).
11
+ */
12
+ columns?: number;
7
13
  labelText?: string;
8
14
  labelTx?: string;
9
15
  labelTxValues?: Record<string, unknown>;
@@ -25,6 +31,12 @@ export interface ColorPickerProps extends Partial<ColorPickerDefaultProps> {
25
31
  export interface ColorPickerDefaultProps {
26
32
  allowDeselecting: boolean;
27
33
  allowMultipleSelection: boolean;
34
+ /**
35
+ * When `true`, `disabled` colors collapse to a small centered dot (e.g. a
36
+ * "Creator's choice" view). When `false` (default) they keep their full size
37
+ * but stay non-selectable (e.g. an "All colors" view). The change animates.
38
+ */
39
+ collapseDisabled: boolean;
28
40
  /** List of colors to render. Defaults to Gantri's product colors list. */
29
41
  colors: ColorDetails[];
30
42
  /**
@@ -4,16 +4,15 @@ 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;
7
8
  $disabled?: boolean;
9
+ $fillWidth?: boolean;
8
10
  $isClickable: boolean;
9
11
  $selected?: boolean;
10
12
  $size?: CSSProperties['width'];
11
13
  $variant?: ColorPickerVariantProp;
12
14
  }
13
15
  export declare const StyledColorOutline: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledColorOutlineProps>> & string;
14
- export declare const StyledDisabledDot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
15
- color: ProductColorCode;
16
- }>> & string;
17
16
  export declare const StyledColor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react-spring").AnimatedProps<{
18
17
  hidden?: boolean | undefined;
19
18
  color?: string | undefined;
@@ -1133,6 +1132,7 @@ export declare const StyledColor: import("styled-components/dist/types").IStyled
1133
1132
  scrollLeft?: number | import("@react-spring/shared/dist/declarations/src/fluids").FluidValue<number, any> | undefined;
1134
1133
  viewBox?: string | import("@react-spring/shared/dist/declarations/src/fluids").FluidValue<string, any> | undefined;
1135
1134
  }, {
1135
+ $collapsed?: boolean | undefined;
1136
1136
  color: ProductColorCode;
1137
1137
  }>> & string & Omit<import("react-spring").AnimatedComponent<"span">, keyof import("react").Component<any, {}, any>>;
1138
1138
  export {};
@@ -2,9 +2,13 @@ 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;
6
- /** Not selectable; rendered as a small centered dot. */
8
+ /** Not selectable. Collapses to a small centered dot when `collapseDisabled`. */
7
9
  disabled?: boolean;
10
+ /** When true, the swatch fills its container width (for grid layouts). */
11
+ fillWidth?: boolean;
8
12
  onColorClick?: (color: ColorDetails) => void;
9
13
  readOnly?: boolean;
10
14
  /** Overrides `variant`. */