gantri-components 2.129.0-beta.1 → 2.129.0-beta.10

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.
Files changed (23) hide show
  1. package/dist/components/components.types.d.ts +4 -1
  2. package/dist/components/tooltip/tooltip.types.d.ts +2 -0
  3. package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/generate-skus-for-product-id.d.ts +3 -1
  4. package/dist/helpers/generate-skus-functions/generate-skus-for-product-id/generate-skus-for-product-id.types.d.ts +2 -0
  5. package/dist/helpers/generate-skus-functions/generate-skus.types.d.ts +0 -11
  6. package/dist/helpers/generate-skus-functions/get-colors-by-product/__tests__/get-colors-by-product.test.d.ts +1 -0
  7. package/dist/helpers/generate-skus-functions/get-colors-by-product/get-colors-by-product.d.ts +5 -0
  8. package/dist/helpers/generate-skus-functions/get-colors-by-product/get-colors-by-product.types.d.ts +11 -0
  9. package/dist/helpers/generate-skus-functions/get-colors-by-product/index.d.ts +2 -0
  10. package/dist/helpers/generate-skus-functions/get-sku-details/get-sku-details.d.ts +31 -0
  11. package/dist/helpers/generate-skus-functions/get-sku-details/get-sku-details.types.d.ts +18 -0
  12. package/dist/helpers/generate-skus-functions/get-sku-details/index.d.ts +1 -0
  13. package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.d.ts +2 -2
  14. package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.types.d.ts +5 -2
  15. package/dist/helpers/generate-skus-functions/helpers/get-is-color-available-for-product-id/get-is-color-available-for-product-id.d.ts +1 -0
  16. package/dist/helpers/generate-skus-functions/index.d.ts +2 -2
  17. package/dist/index.cjs.js +1 -1
  18. package/dist/index.cjs.js.map +1 -1
  19. package/dist/index.esm.js +1 -1
  20. package/dist/index.esm.js.map +1 -1
  21. package/dist/index.umd.js +1 -1
  22. package/dist/index.umd.js.map +1 -1
  23. package/package.json +1 -1
@@ -1,6 +1,9 @@
1
+ import { TooltipProps } from './tooltip/tooltip.types';
1
2
  export type DynamicListItem<T extends Record<any, any>> = T & {
2
3
  disabled?: boolean;
3
- disabledTooltipDescription?: string;
4
+ /** @deprecated use `disabledTooltipProps` to provide any overrides. */
5
+ disabledTooltipDescription?: TooltipProps['description'];
6
+ disabledTooltipProps?: TooltipProps;
4
7
  };
5
8
  export type DynamicListItemDefaultData = {
6
9
  label: string;
@@ -11,8 +11,10 @@ export type TooltipProps = Partial<TooltipDefaultProps> & Pick<OverlayProps, 'on
11
11
  /** Milliseconds to delay the unhover behavior. */
12
12
  closeDelay?: number;
13
13
  description?: string;
14
+ descriptionHtmlText?: string;
14
15
  descriptionTx?: string;
15
16
  title?: string;
17
+ titleHtmlText?: string;
16
18
  titleTx?: string;
17
19
  };
18
20
  export type TooltipDefaultProps = Required<Pick<OverlayProps, 'position' | 'triggerEvent'>> & {
@@ -1,6 +1,6 @@
1
1
  import { GenerateSkusForProductIdProps } from './generate-skus-for-product-id.types';
2
2
  /**
3
- * Provide all of a product's options (available colors are automatically configured based on product ID) and get all possible skus back.
3
+ * Provide all of a product's options (if `isPainted` is `true`, available colors are automatically configured based on product ID) and get all possible skus back.
4
4
  *
5
5
  * *`variants` must be input in the same index order they were provided in!*
6
6
  *
@@ -8,6 +8,7 @@ import { GenerateSkusForProductIdProps } from './generate-skus-for-product-id.ty
8
8
  *
9
9
  * // options as strings
10
10
  * const sku = generateSkusForProductId({
11
+ * isPainted: true,
11
12
  * productId: 123456,
12
13
  * size: 'sm',
13
14
  * variants: [
@@ -18,6 +19,7 @@ import { GenerateSkusForProductIdProps } from './generate-skus-for-product-id.ty
18
19
  *
19
20
  * // options as code objects
20
21
  * const sku = generateSkusForProductId({
22
+ * isPainted: true,
21
23
  * productId: 123456,
22
24
  * size: { code: 'sm' },
23
25
  * variants: [
@@ -1,5 +1,7 @@
1
1
  import { ProductOption } from '../generate-skus.types';
2
2
  export interface GenerateSkusForProductIdProps {
3
+ allowTradeColors: boolean;
4
+ isPainted: boolean;
3
5
  productId: number;
4
6
  size: ProductOption;
5
7
  variants: ProductOption[][] | null | undefined;
@@ -1,14 +1,3 @@
1
- export interface VariantOption {
2
- code: string;
3
- name: string;
4
- selections: VariantSelection[];
5
- }
6
- interface VariantSelection {
7
- code: string;
8
- label: string;
9
- name: string;
10
- }
11
1
  export type ProductOption = {
12
2
  code: string;
13
3
  } | string | null | undefined;
14
- export {};
@@ -0,0 +1,5 @@
1
+ import { GetColorsByProductProps, ProductColorDetail } from './get-colors-by-product.types';
2
+ /**
3
+ * Returns an array of colors that are available for a particular product ID.
4
+ */
5
+ export declare const getColorsByProduct: (props: GetColorsByProductProps) => ProductColorDetail[];
@@ -0,0 +1,11 @@
1
+ import { ProductColorCode } from '../../../styles/theme';
2
+ export interface ProductColorDetail {
3
+ code: ProductColorCode;
4
+ hexColor: string;
5
+ shortColorName: string;
6
+ }
7
+ export interface GetColorsByProductProps {
8
+ allowTradeColors: boolean;
9
+ isPainted: boolean;
10
+ productId: number;
11
+ }
@@ -0,0 +1,2 @@
1
+ export * from './get-colors-by-product';
2
+ export * from './get-colors-by-product.types';
@@ -0,0 +1,31 @@
1
+ import { GetSkuDetailsProps } from './get-sku-details.types';
2
+ /**
3
+ * Provide a sku and the variant options and get all the product option codes back.
4
+ *
5
+ * *`variantOptions` must be input in the same index order they were provided in!*
6
+ */
7
+ export declare const getSkuDetails: (props: GetSkuDetailsProps) => {
8
+ color: string;
9
+ productId: number;
10
+ size: string;
11
+ /**
12
+ * The partial codes that make up the full variant code.
13
+ *
14
+ * @example
15
+ * ```
16
+ * // variants === ['black_7_10_feet_cord', 'chrome_rod_finish']
17
+ *
18
+ * [
19
+ * ['black', '7_10_feet'],
20
+ * ['chrome']
21
+ * ]
22
+ * ```
23
+ */
24
+ variantPartials: string[][];
25
+ /**
26
+ * The full variant codes.
27
+ *
28
+ * @example ['black_7_10_feet_cord', 'chrome_rod_finish']
29
+ */
30
+ variants: string[];
31
+ };
@@ -0,0 +1,18 @@
1
+ export interface GetSkuDetailsProps {
2
+ sku: string;
3
+ skuPartialCodes: SkuPartialCode[][];
4
+ }
5
+ export interface SkuPartialCode {
6
+ /**
7
+ * The full variant code.
8
+ *
9
+ * @example 'black_7_10_feet_cord'
10
+ */
11
+ code: string;
12
+ /**
13
+ * The partial codes that make up the full variant code.
14
+ *
15
+ * @example ['black', '7_10_feet']
16
+ */
17
+ partialCodes: string[];
18
+ }
@@ -0,0 +1 @@
1
+ export * from './get-sku-details';
@@ -8,6 +8,6 @@ export declare const getSkuSelectors: (props: GetSkuSelectorsProps) => {
8
8
  colorCode: string;
9
9
  productId: number;
10
10
  sizeCode: string;
11
- variantCodes: string[];
12
- variantSelectionCodes: string[][];
11
+ variantCompleteCodes: string[];
12
+ variantPartialCodes: string[][];
13
13
  };
@@ -1,5 +1,8 @@
1
- import { VariantOption } from '../generate-skus.types';
2
1
  export interface GetSkuSelectorsProps {
3
2
  sku: string;
4
- variantOptions: VariantOption[][];
3
+ variantOptions: VariantDetails[][];
4
+ }
5
+ export interface VariantDetails {
6
+ code: string;
7
+ partialCodes: string[];
5
8
  }
@@ -1,5 +1,6 @@
1
1
  import { ProductColorCode } from '../../../../styles/theme';
2
2
  export declare const getIsColorAvailableForProductId: (props: {
3
+ allowTradeColors: boolean;
3
4
  colorCode: ProductColorCode;
4
5
  productId: number;
5
6
  }) => boolean;
@@ -1,5 +1,5 @@
1
- export * from './get-colors-by-product-id';
1
+ export * from './get-colors-by-product';
2
2
  export * from './generate-sku';
3
3
  export * from './generate-skus';
4
4
  export * from './generate-skus-for-product-id';
5
- export * from './get-sku-selectors';
5
+ export * from './get-sku-details';