gantri-components 2.132.1 → 2.133.0-beta.1

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 (48) hide show
  1. package/dist/components/file-uploader/components/configured-custom-content/configured-custom-content.types.d.ts +1 -1
  2. package/dist/components/file-uploader/file-uploader.types.d.ts +1 -0
  3. package/dist/components/filter-button/filter-button.types.d.ts +0 -1
  4. package/dist/components/pills/components/pill/pill.types.d.ts +0 -1
  5. package/dist/components/table/components/selectable-row-checkbox-wrapper/selectable-row-checkbox-wrapper.types.d.ts +0 -1
  6. package/dist/components/table/components/table-draggable-row/table-draggable-row.styles.d.ts +0 -3
  7. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.d.ts +2 -0
  8. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/clear-selected-rows.styles.d.ts +2 -0
  9. package/dist/components/table/hooks/use-selectable-table-rows/components/clear-selected-rows/index.d.ts +1 -0
  10. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/index.d.ts +1 -0
  11. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.d.ts +4 -0
  12. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.styles.d.ts +2 -0
  13. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-row-cell/selectable-row-cell.types.d.ts +6 -0
  14. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/index.d.ts +1 -0
  15. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.d.ts +3 -0
  16. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-footer/selectable-table-row-footer.types.d.ts +3 -0
  17. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/index.d.ts +1 -0
  18. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.d.ts +4 -0
  19. package/dist/components/table/hooks/use-selectable-table-rows/components/selectable-table-row-header/selectable-table-row-header.types.d.ts +5 -0
  20. package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.d.ts +3 -0
  21. package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/get-row-range.types.d.ts +6 -0
  22. package/dist/components/table/hooks/use-selectable-table-rows/helpers/get-row-range/index.d.ts +1 -0
  23. package/dist/components/table/hooks/use-selectable-table-rows/index.d.ts +1 -0
  24. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.constants.d.ts +6 -0
  25. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.d.ts +10 -0
  26. package/dist/components/table/hooks/use-selectable-table-rows/use-selectable-table-rows.types.d.ts +9 -0
  27. package/dist/global/context/index.d.ts +1 -0
  28. package/dist/global/context/translation/index.d.ts +1 -0
  29. package/dist/global/context/translation/translation.context.d.ts +11 -0
  30. package/dist/global/context/translation-name-space/index.d.ts +1 -0
  31. package/dist/global/context/translation-name-space/translation-name-space.context.d.ts +11 -0
  32. package/dist/helpers/generate-skus-functions/get-colors-by-product-id/__tests__/get-colors-by-product-id.test.d.ts +1 -0
  33. package/dist/helpers/generate-skus-functions/get-colors-by-product-id/get-colors-by-product-id.d.ts +9 -0
  34. package/dist/helpers/generate-skus-functions/get-colors-by-product-id/index.d.ts +1 -0
  35. package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.d.ts +13 -0
  36. package/dist/helpers/generate-skus-functions/get-sku-selectors/get-sku-selectors.types.d.ts +8 -0
  37. package/dist/helpers/generate-skus-functions/get-sku-selectors/index.d.ts +1 -0
  38. package/dist/hooks/index.d.ts +1 -0
  39. package/dist/hooks/use-provider/index.d.ts +1 -0
  40. package/dist/hooks/use-provider/use-provider.d.ts +33 -0
  41. package/dist/hooks/use-provider/use-provider.types.d.ts +2 -0
  42. package/dist/index.cjs.js +2 -1
  43. package/dist/index.cjs.js.map +1 -0
  44. package/dist/index.esm.js +2 -1
  45. package/dist/index.esm.js.map +1 -0
  46. package/dist/index.umd.js +2 -1
  47. package/dist/index.umd.js.map +1 -0
  48. package/package.json +5 -4
@@ -1,6 +1,6 @@
1
1
  import { FileUploaderProps } from '../../file-uploader.types';
2
2
  import { OptionalValues } from '../../../../types/common';
3
- export type ConfiguredCustomContentProps = OptionalValues<Pick<FileUploaderProps, 'CustomContent' | 'enableCopyUrl' | 'fileName' | 'fileUrl' | 'isDraggable' | 'isReplaceable' | 'processing' | 'SortableDragHandleWrapper'>> & {
3
+ export type ConfiguredCustomContentProps = OptionalValues<Required<Pick<FileUploaderProps, 'CustomContent' | 'enableCopyUrl' | 'fileName' | 'fileUrl' | 'isDisabled' | 'isDraggable' | 'isReplaceable' | 'processing' | 'SortableDragHandleWrapper'>>> & {
4
4
  deleteFile: () => Promise<void>;
5
5
  handleOpenFileSelect: () => void;
6
6
  isDraggingOver: boolean;
@@ -73,6 +73,7 @@ export type FileUploaderCustomContent = (props: {
73
73
  fileName: string;
74
74
  fileUrl: string;
75
75
  handleOpenFileSelect: () => void;
76
+ isDisabled: boolean | undefined;
76
77
  isDraggingOver: boolean;
77
78
  processing: boolean;
78
79
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
3
2
  import { ButtonSize } from '../button/button.types';
4
3
  export interface FilterButtonProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface PillProps {
3
2
  icon?: JSX.Element;
4
3
  onSelected?: (value: string | number) => void;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface SelectableRowCheckboxWrapperProps {
3
2
  Component: JSX.Element;
4
3
  index: number;
@@ -1,4 +1 @@
1
- export declare const StyledDraggableRowTr: import("styled-components").StyledComponent<"tr", import("styled-components").DefaultTheme, {
2
- reorderEnabled: boolean;
3
- }, never>;
4
1
  export declare const StyledDraggableRowWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,2 @@
1
+ export declare const dataAttrClearSelected = "data-clear-selected";
2
+ export declare const ClearSelectedRows: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledPointerFlex: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../flex/flex.types").FlexProps & import("react").RefAttributes<import("../../../../../flex/flex.types").FlexProps>>, import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { RowData } from '@tanstack/react-table';
3
+ import { SelectableRowCellProps } from './selectable-row-cell.types';
4
+ export declare const SelectableRowCell: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowCellProps<TData>>) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledCheckboxCell: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../../../cell/cell.types").CellProps & import("react").RefAttributes<import("../../../../../cell/cell.types").CellProps>>, import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,6 @@
1
+ import { Row, RowData, Table } from '@tanstack/react-table';
2
+ export interface SelectableRowCellProps<TData extends RowData> {
3
+ index: number;
4
+ row: Row<TData>;
5
+ table: Table<TData>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './selectable-table-row-footer';
@@ -0,0 +1,3 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { SelectableRowFooterProps } from './selectable-table-row-footer.types';
3
+ export declare const SelectableRowFooter: (props: PropsWithChildren<SelectableRowFooterProps>) => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './selectable-table-row-header';
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { RowData } from '@tanstack/react-table';
3
+ import { SelectableRowHeaderProps } from './selectable-table-row-header.types';
4
+ export declare const SelectableRowHeader: <TData extends RowData<import("../../../..").CustomTData>>(props: React.PropsWithChildren<SelectableRowHeaderProps<TData>>) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { RowData, Table } from '@tanstack/react-table';
2
+ export interface SelectableRowHeaderProps<TData extends RowData> {
3
+ index: number;
4
+ table: Table<TData>;
5
+ }
@@ -0,0 +1,3 @@
1
+ import { Row, RowData } from '@tanstack/react-table';
2
+ import { GetRowRangeProps } from './get-row-range.types';
3
+ export declare const getRowRange: <TData extends RowData<import("../../../..").CustomTData>>(props: GetRowRangeProps<TData>) => Row<TData>[];
@@ -0,0 +1,6 @@
1
+ import { Row, RowData } from '@tanstack/react-table';
2
+ export interface GetRowRangeProps<TData extends RowData> {
3
+ currentIndex: number;
4
+ prevIndex: number;
5
+ rows: Row<TData>[];
6
+ }
@@ -0,0 +1 @@
1
+ export * from './use-selectable-table-rows';
@@ -0,0 +1,6 @@
1
+ export declare const selectableRowsCheckboxSize = "2rem";
2
+ export declare const dataAttrIsRowSelected = "data-is-row-selected";
3
+ export declare const rowSelectionTypes: {
4
+ readonly checkboxes: "checkboxes";
5
+ readonly custom: "custom";
6
+ };
@@ -0,0 +1,10 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ export declare const useSelectableTableRows: <TData extends RowData<import("../..").CustomTData>>() => {
3
+ deselectRows: (rowIds: (string | number)[]) => void;
4
+ getIsRowSelected: (rowId: number | string) => boolean;
5
+ getSelectedRowData: (props: {
6
+ idProperty: keyof TData;
7
+ records: TData[];
8
+ }) => (TData | undefined)[];
9
+ selectRows: (rowIds: (string | number)[]) => void;
10
+ };
@@ -0,0 +1,9 @@
1
+ import { RowData } from '@tanstack/react-table';
2
+ import { rowSelectionTypes } from './use-selectable-table-rows.constants';
3
+ export interface RowSelection<TData extends RowData> {
4
+ disabled?: boolean;
5
+ idProperty?: keyof TData;
6
+ onSelect?: (selectedRecords: TData[]) => void;
7
+ type: RowSelectionType;
8
+ }
9
+ export type RowSelectionType = typeof rowSelectionTypes[keyof typeof rowSelectionTypes];
@@ -0,0 +1 @@
1
+ export * from './translation';
@@ -0,0 +1 @@
1
+ export * from './translation.context';
@@ -0,0 +1,11 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type TranslationNameSpaceState = string[] | string;
3
+ export declare const defaultTranslationNameSpace: TranslationNameSpaceState;
4
+ export declare const TranslationContext: React.Context<TranslationNameSpaceState>;
5
+ export declare const useTranslationContext: () => {
6
+ nameSpace: TranslationNameSpaceState;
7
+ };
8
+ export declare const TranslationProvider: (props: React.PropsWithChildren<{
9
+ nameSpace: TranslationNameSpaceState;
10
+ }>) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export * from './translation-name-space.context';
@@ -0,0 +1,11 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ type TranslationNameSpaceState = string[] | string;
3
+ export declare const defaultTranslationNameSpace: TranslationNameSpaceState;
4
+ export declare const TranslationContext: React.Context<TranslationNameSpaceState>;
5
+ export declare const useTranslationContext: () => {
6
+ nameSpace: TranslationNameSpaceState;
7
+ };
8
+ export declare const TranslationProvider: (props: React.PropsWithChildren<{
9
+ nameSpace: TranslationNameSpaceState;
10
+ }>) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ProductColorCode } from '../../../styles/theme';
2
+ /**
3
+ * Returns an array of colors that are available for a particular product ID.
4
+ */
5
+ export declare const getColorsByProductId: (productId: number) => {
6
+ code: ProductColorCode;
7
+ hexColor: string;
8
+ shortColorName: string;
9
+ }[];
@@ -0,0 +1 @@
1
+ export * from './get-colors-by-product-id';
@@ -0,0 +1,13 @@
1
+ import { GetSkuSelectorsProps } from './get-sku-selectors.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 getSkuSelectors: (props: GetSkuSelectorsProps) => {
8
+ colorCode: string;
9
+ productId: number;
10
+ sizeCode: string;
11
+ variantCompleteCodes: string[];
12
+ variantPartialCodes: string[][];
13
+ };
@@ -0,0 +1,8 @@
1
+ export interface GetSkuSelectorsProps {
2
+ sku: string;
3
+ variantOptions: VariantDetails[][];
4
+ }
5
+ export interface VariantDetails {
6
+ code: string;
7
+ partialCodes: string[];
8
+ }
@@ -0,0 +1 @@
1
+ export * from './get-sku-selectors';
@@ -0,0 +1 @@
1
+ export * from './use-provider';
@@ -0,0 +1 @@
1
+ export * from './use-provider';
@@ -0,0 +1,33 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { GenericContextValue } from './use-provider.types';
3
+ export declare const createGenericContext: <Type>(defaultValue: Type) => React.Context<GenericContextValue<Type>>;
4
+ /**
5
+ * ```
6
+ * const defaultMyValue = 'foo';
7
+ *
8
+ * const MyContext = createGenericContext(defaultMyValue);
9
+ *
10
+ * const OuterWrapper = () => {
11
+ * const MyProvider = useProvider({
12
+ * Context: MyContext,
13
+ * defaultValue: defaultMyValue,
14
+ * });
15
+ *
16
+ * return (
17
+ * <MyProvider>
18
+ * <InnerComponent />
19
+ * </MyProvider>
20
+ * );
21
+ * }
22
+ *
23
+ * const InnerComponent = () => {
24
+ * const [myValue, setMyValue] = useContext(MyContext);
25
+ *
26
+ * // ...
27
+ * }
28
+ * ```
29
+ */
30
+ export declare const useProvider: <Type>(props: {
31
+ Context: React.Context<GenericContextValue<Type>>;
32
+ defaultValue: Type;
33
+ }) => React.MemoExoticComponent<({ children }: PropsWithChildren<Record<never, never>>) => JSX.Element>;
@@ -0,0 +1,2 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export type GenericContextValue<Type> = [Type, Dispatch<SetStateAction<Type>>];