gantri-components 1.142.2 → 1.143.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { IconProps } from './icon.types';
2
- export declare const IconPresets: Partial<IconProps>;
1
+ import { IconDefaultProps } from './icon.types';
2
+ export declare const IconPresets: IconDefaultProps;
@@ -1,11 +1,11 @@
1
1
  import { IconProps } from './icon.types';
2
2
  export declare const StyledSvgIcon: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, {
3
- $height: IconProps['height'];
4
- $width: IconProps['width'];
5
- bottom: IconProps['bottom'];
6
- cursor: IconProps['cursor'];
7
- left: IconProps['left'];
8
- right: IconProps['right'];
9
- size: IconProps['width'];
10
- top: IconProps['top'];
3
+ $height?: IconProps['height'];
4
+ $width?: IconProps['width'];
5
+ bottom?: IconProps['bottom'];
6
+ cursor?: IconProps['cursor'];
7
+ left?: IconProps['left'];
8
+ right?: IconProps['right'];
9
+ size?: IconProps['width'];
10
+ top?: IconProps['top'];
11
11
  }, never>;
@@ -16,3 +16,4 @@ export interface IconProps extends SVGProps<any> {
16
16
  top?: Property.Top;
17
17
  width?: ResolutionAwareProp<Property.Width<string | any>>;
18
18
  }
19
+ export declare type IconDefaultProps = Required<Pick<IconProps, 'color' | 'cursor' | 'opacity' | 'size'>>;
@@ -1,3 +1 @@
1
- import { Environment } from './types/globals.types';
2
1
  export declare const cloudinaryPrefix = "https://res.cloudinary.com/gantri/image/upload";
3
- export declare const defaultEnv: Environment;
@@ -1,6 +1,5 @@
1
- import { GetFileUrlArgs } from './types/get-file-url.types';
2
- import { DirectoryName, Environment } from './types/globals.types';
3
- export declare const getCloudinaryEnvFolder: (buildEnv: Environment) => 'production' | 'staging' | 'develop';
1
+ import { GetFileUrlArgs } from './get-file-url.types';
2
+ import { DirectoryName } from '../get-folder-structure/types/globals.types';
4
3
  /**
5
4
  * https://www.notion.so/gantri/Asset-Directory-Structure-674ff9974018475c89a78249950b4216
6
5
  *
@@ -0,0 +1,5 @@
1
+ import { GetFolderStructureArgs } from '../get-folder-structure/types/get-folder-structure.types';
2
+ import { DirectoryName } from '../get-folder-structure/types/globals.types';
3
+ export declare type GetFileUrlArgs<Directory extends DirectoryName> = GetFolderStructureArgs<Directory> & {
4
+ fileName: string;
5
+ };
@@ -0,0 +1,2 @@
1
+ import { Environment } from './types/globals.types';
2
+ export declare const defaultEnv: Environment;
@@ -0,0 +1,19 @@
1
+ import { GetFolderStructureArgs } from './types/get-folder-structure.types';
2
+ import { DirectoryName, Environment } from './types/globals.types';
3
+ export declare const getCloudinaryEnvFolder: (buildEnv: Environment) => 'production' | 'staging' | 'develop';
4
+ /**
5
+ * https://www.notion.so/gantri/Asset-Directory-Structure-674ff9974018475c89a78249950b4216
6
+ *
7
+ * While not strictly necessary, it's highly recommended that you copy the `directory` value to the type definition to ensure highly accurate types:
8
+ *
9
+ * @example
10
+ * const folder = getFolderStructure<'products'>({
11
+ * directory: 'products',
12
+ * fileType: 'value-props',
13
+ * identifiers: {
14
+ * productId: product.id,
15
+ * },
16
+ * });
17
+ *
18
+ */
19
+ export declare const getFolderStructure: <Directory extends DirectoryName>(args: GetFolderStructureArgs<Directory>) => string | undefined;
@@ -0,0 +1 @@
1
+ export * from './get-folder-structure';
@@ -0,0 +1,17 @@
1
+ import { Environment } from './globals.types';
2
+ export declare type DesignersFileType = 'collection-pages-lifestyle-imagery' | 'collection-pages-value-props' | 'collection-pages' | 'editorial-imagery' | 'handouts' | 'headshot' | 'hero-imagery' | 'logo' | 'process-imagery' | 'quote-imagery';
3
+ interface DesignersRootLevel {
4
+ /** User ID, NOT designer ID! */
5
+ userId: number;
6
+ }
7
+ interface DesignersCollectionPagesLevel extends DesignersRootLevel {
8
+ collectionId: number;
9
+ }
10
+ interface DesignersArgs<FileType extends DesignersFileType, Identifiers extends Record<string, any>> {
11
+ directory: 'designers';
12
+ env?: Environment;
13
+ fileType: FileType;
14
+ identifiers: Identifiers;
15
+ }
16
+ export declare type GetDesignersArgs<FileType extends DesignersFileType> = FileType extends 'editorial-imagery' | 'handouts' | 'headshot' | 'hero-imagery' | 'logo' | 'process-imagery' | 'quote-imagery' ? DesignersArgs<FileType, DesignersRootLevel> : FileType extends 'collection-pages-lifestyle-imagery' | 'collection-pages-value-props' | 'collection-pages' ? DesignersArgs<FileType, DesignersCollectionPagesLevel> : never;
17
+ export {};
@@ -0,0 +1,4 @@
1
+ import { GetDesignersArgs, DesignersFileType } from './designers.types';
2
+ import { DirectoryName } from './globals.types';
3
+ import { ProductsFileType, GetProductsArgs } from './products.types';
4
+ export declare type GetFolderStructureArgs<Directory extends DirectoryName> = Directory extends 'products' ? GetProductsArgs<ProductsFileType> : Directory extends 'designers' ? GetDesignersArgs<DesignersFileType> : never;
@@ -0,0 +1,3 @@
1
+ export declare type DirectoryName = 'designers' | 'designs' | 'downloads' | 'inventory-purchases' | 'parts' | 'products' | 'stocks' | 'users';
2
+ export declare type TemplateVersion = 'draft' | string;
3
+ export declare type Environment = 'local' | 'develop' | 'staging' | 'production';
@@ -0,0 +1,21 @@
1
+ import { Environment, TemplateVersion } from './globals.types';
2
+ export declare type ProductsFileType = 'bulb-change-instructions' | 'dimming-photos' | 'handouts' | 'job-instructions' | 'lifestyle-photos' | 'model' | 'part-stl' | 'part-thumbnail' | 'product-photos' | 'scale-photo' | 'value-props';
3
+ interface ProductsRootLevel {
4
+ productId: number;
5
+ }
6
+ interface ProductsSkuLevel extends ProductsRootLevel {
7
+ sku: string;
8
+ }
9
+ interface ProductsTemplateLevel extends ProductsRootLevel {
10
+ partId: number;
11
+ /** String with the value of `draft` or `${number}.${number}`. */
12
+ templateVersion: TemplateVersion;
13
+ }
14
+ interface ProductsArgs<FileType extends ProductsFileType, Identifiers extends Record<string, any>> {
15
+ directory: 'products';
16
+ env?: Environment;
17
+ fileType: FileType;
18
+ identifiers: Identifiers;
19
+ }
20
+ export declare type GetProductsArgs<FileType extends ProductsFileType> = FileType extends 'bulb-change-instructions' | 'handouts' | 'value-props' ? ProductsArgs<FileType, ProductsRootLevel> : FileType extends 'dimming-photos' | 'lifestyle-photos' | 'model' | 'product-photos' | 'scale-photo' ? ProductsArgs<FileType, ProductsSkuLevel> : FileType extends 'job-instructions' | 'part-stl' | 'part-thumbnail' ? ProductsArgs<FileType, ProductsTemplateLevel> : never;
21
+ export {};
@@ -1,2 +1,3 @@
1
1
  export * from './layout.helpers';
2
2
  export * from './get-file-url';
3
+ export * from './get-folder-structure';