pollination-react-io 1.6.1 → 1.7.2

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 (42) hide show
  1. package/README.md +0 -17
  2. package/build/AuthUser/AuthUser.d.ts +0 -1
  3. package/build/CreateStudy/CreateStudy.d.ts +1 -2
  4. package/build/CreateStudy/CreateStudy.types.d.ts +8 -2
  5. package/build/GetModel/GetModel.types.d.ts +1 -0
  6. package/build/RecipeInputsForm/RecipeInputsForm.d.ts +0 -1
  7. package/build/RecipeInputsForm/RecipeInputsForm.types.d.ts +4 -1
  8. package/build/RunCommand/RunCommand.d.ts +0 -1
  9. package/build/SelectAccount/SelectAccount.d.ts +0 -2
  10. package/build/SelectCloudArtifacts/SelectCloudArtifacts.d.ts +4 -0
  11. package/build/SelectCloudArtifacts/SelectCloudArtifacts.types.d.ts +9 -0
  12. package/build/SelectCloudArtifacts/getFileTypeIcon.d.ts +2 -0
  13. package/build/SelectProject/SelectProject.d.ts +0 -2
  14. package/build/SelectStudy/SelectStudy.d.ts +0 -2
  15. package/build/SendResults/SendResults.d.ts +0 -1
  16. package/build/atoms/Button/Button.d.ts +1 -2
  17. package/build/atoms/ComboBox/ComboBox.d.ts +0 -1
  18. package/build/atoms/ComboBox/ComboBox.types.d.ts +14 -1
  19. package/build/atoms/Dropdown/Dropdown.d.ts +0 -1
  20. package/build/atoms/FileInput/FileInput.d.ts +0 -1
  21. package/build/atoms/NumberInput/NumberInput.types.d.ts +1 -0
  22. package/build/atoms/RadioList/RadioList.d.ts +0 -1
  23. package/build/atoms/SettingsButton/index.d.ts +1 -1
  24. package/build/atoms/TextInput/TextInput.d.ts +0 -1
  25. package/build/atoms/TextInput/TextInput.types.d.ts +3 -2
  26. package/build/atoms/Tooltip/index.d.ts +0 -1
  27. package/build/hooks/index.d.ts +1 -0
  28. package/build/hooks/types.d.ts +8 -1
  29. package/build/hooks/useArtifacts.d.ts +1 -1
  30. package/build/hooks/useCreateStudy.d.ts +17 -0
  31. package/build/index.d.ts +1 -2
  32. package/build/index.esm.js +6062 -1351
  33. package/build/index.esm.js.map +1 -1
  34. package/build/index.js +6063 -1352
  35. package/build/index.js.map +1 -1
  36. package/build/variables.css +12 -0
  37. package/package.json +7 -10
  38. package/build/PreviewBakeGeometry/PreviewBakeGeometry.d.ts +0 -4
  39. package/build/PreviewBakeGeometry/PreviewBakeGeometry.types.d.ts +0 -4
  40. package/build/PreviewBakeModel/PreviewBakeModel.d.ts +0 -4
  41. package/build/PreviewBakeModel/PreviewBakeModel.types.d.ts +0 -4
  42. package/build/hooks/hooks.types.d.ts +0 -5
package/README.md CHANGED
@@ -75,22 +75,6 @@ which will install the local component library as a dependency in `test-app`. It
75
75
  ```
76
76
 
77
77
  Your components can then be imported and used in that project.
78
- ### Using Component Library SASS Variables
79
-
80
- I've found that it's helpful to export SASS variables to projects consuming the library. As such, I've added the `rollup-plugin-copy` NPM package and used it to copy the [`src/typography.scss`](src/typography.scss) and [`variables.scss`](src/variables.scss) into the `build` directory as part of the Rollup bundle process. This allows you to use these variables in your projects consuming the component library.
81
-
82
- For example, let's say you installed `harvey-component-library` into your project. To use the exported variables/mixins, in a SASS file you would do the following:
83
-
84
- ```Sass
85
- @import '~harvey-component-library/build/typography';
86
-
87
- .example-container {
88
- @include heading;
89
-
90
- color: $harvey-white;
91
- }
92
- ```
93
-
94
78
  ## Additional Help
95
79
 
96
80
  ### Dark Mode
@@ -105,7 +89,6 @@ Read https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-schem
105
89
  [Built with react-component-library](https://blog.harveydelaney.com/creating-your-own-react-component-library/)
106
90
 
107
91
  - [Rollup](https://github.com/rollup/rollup)
108
- - [Sass](https://sass-lang.com/)
109
92
  - [TypeScript](https://www.typescriptlang.org/)
110
93
  - [Storybook](https://storybook.js.org/)
111
94
  - [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library)
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { AuthUserProps } from './AuthUser.types';
3
- import './AuthUser.scss';
4
3
  export declare const AuthUser: React.FC<AuthUserProps>;
5
4
  export default AuthUser;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import 'react-tabs/style/react-tabs.css';
3
3
  import { CreateStudyProps } from './CreateStudy.types';
4
- import './CreateStudy.scss';
5
- declare const CreateStudy: React.FC<CreateStudyProps>;
4
+ export declare const CreateStudy: React.FC<CreateStudyProps>;
6
5
  export default CreateStudy;
@@ -1,2 +1,8 @@
1
- import type { ConfigurationParameters } from '@pollination-solutions/pollination-sdk';
2
- export declare type CreateStudyProps = ConfigurationParameters;
1
+ import type { UserPrivate } from '@pollination-solutions/pollination-sdk';
2
+ import { CSSProperties } from 'react';
3
+ import { APIClient } from '../hooks';
4
+ export declare type CreateStudyProps = {
5
+ authUser?: UserPrivate;
6
+ client?: APIClient;
7
+ style?: CSSProperties;
8
+ };
@@ -14,4 +14,5 @@ export interface GetModelProps {
14
14
  };
15
15
  buttonLabel?: string;
16
16
  inputProps?: HTMLProps<HTMLInputElement>;
17
+ showHelpText?: boolean;
17
18
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { RecipeInputsFormProps } from './RecipeInputsForm.types';
3
- import './RecipeInputsForm.scss';
4
3
  declare const RecipeInputsForm: React.FC<RecipeInputsFormProps>;
5
4
  export default RecipeInputsForm;
@@ -1,6 +1,9 @@
1
1
  import { RecipeInterface } from '@pollination-solutions/pollination-sdk';
2
+ import { CSSProperties } from 'react';
3
+ import { Message } from '../hooks';
2
4
  export interface RecipeInputsFormProps {
3
5
  recipe: RecipeInterface;
4
- onSubmit?: (data: any) => Promise<void>;
6
+ onSubmit?: (data: any) => Promise<void> | Promise<Message> | void;
5
7
  disabled?: boolean;
8
+ labelStyle?: CSSProperties;
6
9
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { RunCommandProps } from './RunCommand.types';
3
- import './RunCommand.scss';
4
3
  declare const RunCommand: React.FC<RunCommandProps>;
5
4
  export default RunCommand;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
2
  import { SelectAccountProps } from './SelectAccount.types';
3
- import '../styles/buttons-group.scss';
4
- import '../styles/variables.scss';
5
3
  export declare const SelectAccount: React.FC<SelectAccountProps>;
6
4
  export default SelectAccount;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SelectCloudArtifactsProps } from './SelectCloudArtifacts.types';
3
+ declare const SelectCloudArtifacts: React.FC<SelectCloudArtifactsProps>;
4
+ export default SelectCloudArtifacts;
@@ -0,0 +1,9 @@
1
+ import { FileMeta } from '@pollination-solutions/pollination-sdk';
2
+ import { APIClient } from '../hooks';
3
+ export interface SelectCloudArtifactsProps {
4
+ projectOwner?: string;
5
+ projectName?: string;
6
+ fileExtensionMatch?: string;
7
+ onChange?: (artifact: FileMeta) => void;
8
+ client?: APIClient;
9
+ }
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const getFileIcon: (type?: string) => React.ReactNode;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
2
  import { SelectProjectProps } from './SelectProject.types';
3
- import '../styles/buttons-group.scss';
4
- import '../styles/variables.scss';
5
3
  export declare const SelectProject: React.FC<SelectProjectProps>;
6
4
  export default SelectProject;
@@ -1,6 +1,4 @@
1
1
  import React from 'react';
2
2
  import { SelectStudyProps } from './SelectStudy.types';
3
- import '../styles/buttons-group.scss';
4
- import '../styles/variables.scss';
5
3
  export declare const SelectStudy: React.FC<SelectStudyProps>;
6
4
  export default SelectStudy;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { SendResultsProps } from './SendResults.types';
3
- import '../styles/buttons-group.scss';
4
3
  export declare const SendResults: React.FC<SendResultsProps>;
5
4
  export default SendResults;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from './Button.types';
3
- import './Button.scss';
4
- declare const Button: React.FC<ButtonProps>;
3
+ export declare const Button: React.FC<ButtonProps>;
5
4
  export default Button;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import 'react-perfect-scrollbar/dist/css/styles.css';
3
3
  import { ComboBoxProps } from './ComboBox.types';
4
- import './ComboBox.scss';
5
4
  export declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps>;
6
5
  export default ComboBox;
@@ -1,4 +1,5 @@
1
- import { CSSProperties, HTMLProps, ReactNode, Ref } from 'react';
1
+ import { UseComboboxState, UseComboboxStateChangeOptions } from 'downshift';
2
+ import { CSSProperties, HTMLProps, ReactElement, ReactNode, Ref } from 'react';
2
3
  export interface ComboBoxProps {
3
4
  items: {
4
5
  id: string;
@@ -8,11 +9,23 @@ export interface ComboBoxProps {
8
9
  setSelected?: (item: any) => void;
9
10
  loading?: boolean;
10
11
  disabled?: boolean;
12
+ icon?: ReactElement;
11
13
  inputStyle?: CSSProperties;
12
14
  menuStyle?: CSSProperties;
13
15
  inputProps?: HTMLProps<HTMLInputElement>;
16
+ header?: ReactNode;
14
17
  footer?: string | ReactNode;
15
18
  noMatchText?: string;
16
19
  ref?: Ref<any>;
17
20
  onScrollReachEnd?: (...args: any) => void;
21
+ stateReducer?: (state: UseComboboxState<{
22
+ id: string;
23
+ name: string;
24
+ }>, actionAndChanges: UseComboboxStateChangeOptions<{
25
+ id: string;
26
+ name: string;
27
+ }>) => Partial<UseComboboxState<{
28
+ id: string;
29
+ name: string;
30
+ }>>;
18
31
  }
@@ -1,6 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
3
- import './Dropdown.scss';
4
3
  export declare type Option = {
5
4
  type: 'checkbox' | 'radio' | 'button' | 'label' | 'link';
6
5
  id: string;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { FileInputProps } from './FileInput.types';
3
- import './FileInput.scss';
4
3
  export declare const FileInput: React.FC<FileInputProps>;
5
4
  export default FileInput;
@@ -3,4 +3,5 @@ export interface NumberInputProps {
3
3
  inputProps?: HTMLProps<HTMLInputElement>;
4
4
  icon?: ReactNode;
5
5
  style?: CSSProperties;
6
+ reset?: any;
6
7
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { RadioListProps } from './RadioList.types';
3
- import './RadioList.scss';
4
3
  export declare const RadioList: React.FC<RadioListProps>;
5
4
  export default RadioList;
@@ -1,6 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import { OptionGroup } from '../Dropdown/Dropdown';
3
- import '../../styles/buttons-group.scss';
4
3
  export interface SettingsButtonProps {
5
4
  onClick: () => void;
6
5
  label: string | ReactNode;
@@ -9,5 +8,6 @@ export interface SettingsButtonProps {
9
8
  disabled?: boolean;
10
9
  triggerIcon?: React.ReactNode;
11
10
  helpText?: string;
11
+ icon?: ReactNode;
12
12
  }
13
13
  export declare const SettingsButton: FC<SettingsButtonProps>;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import { TextInputProps } from './TextInput.types';
3
- import './TextInput.scss';
4
3
  export declare const TextInput: React.FC<TextInputProps>;
5
4
  export default TextInput;
@@ -1,6 +1,7 @@
1
- import { CSSProperties, HTMLProps, ReactNode } from 'react';
1
+ import { CSSProperties, HTMLProps, ReactElement } from 'react';
2
2
  export interface TextInputProps {
3
3
  inputProps?: HTMLProps<HTMLInputElement>;
4
- icon?: ReactNode;
4
+ icon?: ReactElement;
5
5
  style?: CSSProperties;
6
+ reset?: any;
6
7
  }
@@ -1,5 +1,4 @@
1
1
  import React, { CSSProperties, FC } from 'react';
2
- import './Tooltip.scss';
3
2
  interface TooltipProps {
4
3
  content: React.ReactNode | string;
5
4
  side?: 'top' | 'right' | 'bottom' | 'left';
@@ -1,5 +1,6 @@
1
1
  export type { Options, Message, Coordinates, SettingsOptions, } from './types';
2
2
  export * from './useAPIClient';
3
+ export * from './useCreateStudy';
3
4
  export * from './useGetHbjson';
4
5
  export * from './useGetGeometry';
5
6
  export * from './useSendHbjson';
@@ -5,11 +5,13 @@ export interface Options {
5
5
  export declare type GeometryAction = 'BakeGeometry' | 'ClearGeometry' | 'DrawGeometry' | 'DisableDraw' | 'CombinedRendering';
6
6
  export declare type ModelAction = 'BakePollinationModel' | 'DisableDrawPollinationModel' | 'DrawPollinationModel' | 'CombinedRenderingPollinationModel';
7
7
  export declare type ResultsAction = 'DrawResults' | 'ClearResults' | 'SubscribeDrawResults' | 'AddResults' | 'DeleteResults';
8
- export declare type Action = GeometryAction | ModelAction | ResultsAction | 'RunCommand' | 'SetModelSettings';
8
+ export declare type StudyAction = 'CreateStudy';
9
+ export declare type Action = GeometryAction | ModelAction | ResultsAction | StudyAction | 'RunCommand' | 'SetModelSettings';
9
10
  export interface Message {
10
11
  action?: Action;
11
12
  data?: any;
12
13
  options?: any;
14
+ uniqueId?: string;
13
15
  }
14
16
  export interface Coordinates {
15
17
  lat: number;
@@ -19,3 +21,8 @@ export interface SettingsOptions {
19
21
  earth_anchor?: Coordinates;
20
22
  units?: number;
21
23
  }
24
+ export interface UseGetHBJSONArgs {
25
+ isPollinationModel: boolean;
26
+ syncToken: string;
27
+ key: string;
28
+ }
@@ -2,7 +2,7 @@ import { FileMeta } from '@pollination-solutions/pollination-sdk';
2
2
  import { FileWithPath } from 'react-dropzone';
3
3
  import { APIClient } from './useAPIClient';
4
4
  export declare const useArtifacts: (owner: string, name: string, client: APIClient) => {
5
- listArtifacts: (path: string | undefined) => Promise<FileMeta[]>;
5
+ listArtifacts: (path?: string[]) => Promise<FileMeta[]>;
6
6
  deleteArtifact: (path: string) => Promise<void>;
7
7
  downloadArtifact: (path: string) => Promise<any>;
8
8
  uploadArtifact: (folderRoot: FileMeta | undefined, file: FileWithPath) => Promise<import("@pollination-solutions/pollination-sdk").S3UploadRequest>;
@@ -0,0 +1,17 @@
1
+ import { APIClient } from './useAPIClient';
2
+ declare global {
3
+ interface Window {
4
+ sketchup?: any;
5
+ chrome?: any;
6
+ }
7
+ }
8
+ interface JobArgs {
9
+ name: string;
10
+ source: string;
11
+ description?: string;
12
+ }
13
+ export declare const useCreateStudy: (accountName: string, projectName: string, client: APIClient) => {
14
+ host: string;
15
+ createStudy: (({ name, source, description }: JobArgs, data: object) => Promise<void>) | (({ name, source, description }: JobArgs, data: object, key?: string) => Promise<import("./types").Message>);
16
+ };
17
+ export {};
package/build/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  export * from './hooks';
2
2
  export * from './AuthUser/AuthUser';
3
+ export * from './CreateStudy/CreateStudy';
3
4
  export * from './GetGeometry/GetGeometry';
4
5
  export * from './GetModel/GetModel';
5
- export * from './PreviewBakeGeometry/PreviewBakeGeometry';
6
- export * from './PreviewBakeModel/PreviewBakeModel';
7
6
  export * from './RunCommand/RunCommand';
8
7
  export * from './SelectAccount/SelectAccount';
9
8
  export * from './SelectStudy/SelectStudy';