pollination-react-io 1.7.2 → 1.8.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.
package/README.md CHANGED
@@ -75,6 +75,22 @@ 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
+
78
94
  ## Additional Help
79
95
 
80
96
  ### Dark Mode
@@ -89,6 +105,7 @@ Read https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-schem
89
105
  [Built with react-component-library](https://blog.harveydelaney.com/creating-your-own-react-component-library/)
90
106
 
91
107
  - [Rollup](https://github.com/rollup/rollup)
108
+ - [Sass](https://sass-lang.com/)
92
109
  - [TypeScript](https://www.typescriptlang.org/)
93
110
  - [Storybook](https://storybook.js.org/)
94
111
  - [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library)
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ComboFileSelectorProps } from './ComboFileSelector.types';
3
+ export declare const ComboFileSelector: React.FC<ComboFileSelectorProps>;
4
+ export default ComboFileSelector;
@@ -0,0 +1,10 @@
1
+ import { HTMLProps } from 'react';
2
+ import { APIClient } from '../hooks';
3
+ export interface ComboFileSelectorProps {
4
+ projectOwner?: string;
5
+ projectName?: string;
6
+ defaultOption?: 'get_model' | 'get_file' | 'get_cloud';
7
+ onChange?: (...any: any) => void;
8
+ client: APIClient;
9
+ inputProps?: HTMLProps<HTMLInputElement>;
10
+ }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import 'react-tabs/style/react-tabs.css';
3
2
  import { CreateStudyProps } from './CreateStudy.types';
3
+ import 'react-tabs/style/react-tabs.css';
4
4
  export declare const CreateStudy: React.FC<CreateStudyProps>;
5
5
  export default CreateStudy;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { RecipeInputsFormProps } from './RecipeInputsForm.types';
3
+ import './RecipeInputsForm.scss';
3
4
  declare const RecipeInputsForm: React.FC<RecipeInputsFormProps>;
4
5
  export default RecipeInputsForm;
@@ -1,9 +1,10 @@
1
1
  import { RecipeInterface } from '@pollination-solutions/pollination-sdk';
2
- import { CSSProperties } from 'react';
3
- import { Message } from '../hooks';
2
+ import { APIClient, Message } from '../hooks';
4
3
  export interface RecipeInputsFormProps {
5
4
  recipe: RecipeInterface;
6
5
  onSubmit?: (data: any) => Promise<void> | Promise<Message> | void;
7
6
  disabled?: boolean;
8
- labelStyle?: CSSProperties;
7
+ projectOwner?: string;
8
+ projectName?: string;
9
+ client?: APIClient;
9
10
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ButtonProps } from './Button.types';
3
- export declare const Button: React.FC<ButtonProps>;
3
+ import './Button.scss';
4
+ declare const Button: React.FC<ButtonProps>;
4
5
  export default Button;
@@ -1,5 +1,6 @@
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';
4
5
  export declare const ComboBox: React.ForwardRefExoticComponent<ComboBoxProps>;
5
6
  export default ComboBox;
@@ -1,5 +1,6 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
3
+ import './Dropdown.scss';
3
4
  export declare type Option = {
4
5
  type: 'checkbox' | 'radio' | 'button' | 'label' | 'link';
5
6
  id: string;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FileInputProps } from './FileInput.types';
3
+ import './FileInput.scss';
3
4
  export declare const FileInput: React.FC<FileInputProps>;
4
5
  export default FileInput;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { RadioListProps } from './RadioList.types';
3
+ import './RadioList.scss';
3
4
  export declare const RadioList: React.FC<RadioListProps>;
4
5
  export default RadioList;
@@ -1,5 +1,6 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  import { OptionGroup } from '../Dropdown/Dropdown';
3
+ import './SettingsButton.scss';
3
4
  export interface SettingsButtonProps {
4
5
  onClick: () => void;
5
6
  label: string | ReactNode;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  import { TextInputProps } from './TextInput.types';
3
+ import './TextInput.scss';
3
4
  export declare const TextInput: React.FC<TextInputProps>;
4
5
  export default TextInput;
@@ -1,4 +1,5 @@
1
1
  import React, { CSSProperties, FC } from 'react';
2
+ import './Tooltip.scss';
2
3
  interface TooltipProps {
3
4
  content: React.ReactNode | string;
4
5
  side?: 'top' | 'right' | 'bottom' | 'left';
@@ -22,7 +22,7 @@ export declare class APIClient {
22
22
  constructor(props: ConfigurationParameters);
23
23
  private init;
24
24
  /** Overwrite current configuration and re-create all api clients. */
25
- configure(basePath?: string, token?: string): void;
25
+ configure(config: Partial<ConfigurationParameters>): void;
26
26
  }
27
27
  export declare const useAPIClient: (config?: ConfigurationParameters) => {
28
28
  client: React.MutableRefObject<APIClient>;
package/build/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './hooks';
2
2
  export * from './AuthUser/AuthUser';
3
3
  export * from './CreateStudy/CreateStudy';
4
+ export * from './ComboFileSelector/ComboFileSelector';
4
5
  export * from './GetGeometry/GetGeometry';
5
6
  export * from './GetModel/GetModel';
6
7
  export * from './RunCommand/RunCommand';