gantri-components 1.144.0-beta.7 → 1.144.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.
Files changed (37) hide show
  1. package/README.md +4 -2
  2. package/dist/components/button/button.constants.d.ts +17 -0
  3. package/dist/components/button/button.types.d.ts +1 -1
  4. package/dist/components/checkbox/checkbox.styles.d.ts +4 -2
  5. package/dist/components/checkbox/checkbox.types.d.ts +3 -1
  6. package/dist/components/circular-progress/circular-progress.presets.d.ts +2 -1
  7. package/dist/components/circular-progress/circular-progress.types.d.ts +2 -1
  8. package/dist/components/color-picker/components/color-picker-item/color-picker-item.styles.d.ts +13 -0
  9. package/dist/components/color-picker/components/color-picker-item/color-picker.styles.d.ts +0 -1
  10. package/dist/components/formik-input/__tests__/formik-input.test.d.ts +1 -0
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/modal/modal.styles.d.ts +1 -1
  13. package/dist/components/pills/components/index.d.ts +1 -0
  14. package/dist/components/pills/components/pill/index.d.ts +1 -0
  15. package/dist/components/pills/components/pill/pill.d.ts +3 -0
  16. package/dist/components/pills/components/pill/pill.styles.d.ts +3 -0
  17. package/dist/components/pills/components/pill/pill.types.d.ts +9 -0
  18. package/dist/components/pills/index.d.ts +2 -0
  19. package/dist/components/pills/pills.d.ts +3 -0
  20. package/dist/components/pills/pills.styles.d.ts +1 -0
  21. package/dist/components/pills/pills.types.d.ts +20 -0
  22. package/dist/components/radio/radio.styles.d.ts +3 -0
  23. package/dist/components/radio/radio.types.d.ts +2 -0
  24. package/dist/components/text-field/text-field.styles.d.ts +0 -1
  25. package/dist/components/text-field/text-field.types.d.ts +1 -0
  26. package/dist/components/toggle/toggle.d.ts +3 -0
  27. package/dist/components/toggle/toggle.presets.d.ts +2 -0
  28. package/dist/components/toggle/toggle.styles.styles.d.ts +9 -0
  29. package/dist/components/toggle/toggle.types.d.ts +21 -0
  30. package/dist/components/typography/typography.types.d.ts +2 -2
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.esm.js +1 -1
  34. package/dist/index.umd.js +1 -1
  35. package/dist/styles/theme.d.ts +51 -1
  36. package/dist/test-utils/render-with-providers.d.ts +2 -1
  37. package/package.json +2 -2
package/README.md CHANGED
@@ -2,12 +2,14 @@
2
2
 
3
3
  ## Deploying beta code changes
4
4
 
5
- If you'd like to deploy some code that can be pulled into another repo, you can merge your changes into the `beta` branch. After deployment (you can verify deployment by looking at the released versions [here](https://www.npmjs.com/package/gantri-components)), you can install the beta code to your repo using `yarn add gantri-components@beta`. Just be sure not to reinstall the normal version when you're done.
5
+ If you'd like to deploy some code that can be pulled into another repo, you can merge your changes into the `beta` branch. After deployment (you can verify deployment status [here](https://github.com/gantri/gantri-components/actions/workflows/publish.yml)), you can install the beta code to your repo using `yarn add gantri-components@beta`. Just be sure not to reinstall the normal version when you're done.
6
+
7
+ #### NOTE: `chore` commit prefixes do not trigger a new version deployment. For a list of commit prefixes and their deployment versions, please see [this document](https://github.com/semantic-release/commit-analyzer/blob/master/lib/default-release-rules.js).
6
8
 
7
9
  ## Testing
8
10
 
9
11
  Testing is done using [Jest](https://jestjs.io/docs/using-matchers) for base JavaScript functionality and Jest with [React Testing Library](https://testing-library.com/docs/react-testing-library/cheatsheet) for React functionality.
10
12
 
11
- You can run all tests locally by running `npm test` in the command line. By default, this script is run with the `--watch` [option](https://jestjs.io/docs/cli#options) which will watch for saved changes and automatically re-run related tests. You can add other options to the command by adding running `npm test -- {{option flag}}` (example: `npm test -- --verbose`).
13
+ You can run all tests locally by running `yarn test` in the command line. By default, this script is run with the `--watch` [option](https://jestjs.io/docs/cli#options) which will watch for saved changes and automatically re-run related tests. You can add other options to the command by adding running `yarn test {{option flag}}` (example: `yarn test --verbose`).
12
14
 
13
15
  All tests are run on GitHub each time new code is pushed to your PR.
@@ -0,0 +1,17 @@
1
+ export declare const buttonSizeHeights: {
2
+ extraLarge: string;
3
+ large: string;
4
+ mini: string;
5
+ small: string;
6
+ };
7
+ export declare const buttonWidths: {
8
+ lg: string;
9
+ md: string;
10
+ sm: string;
11
+ };
12
+ export declare const buttonSizePaddings: {
13
+ extraLarge: string;
14
+ large: string;
15
+ mini: string;
16
+ small: string;
17
+ };
@@ -20,7 +20,7 @@ export interface ButtonProps extends BaseProps {
20
20
  minWidth?: ResolutionAwareProp<Property.Width>;
21
21
  onClick?: (event: MouseEvent) => void;
22
22
  processing?: boolean;
23
- size?: 'large' | 'small';
23
+ size?: 'extraLarge' | 'large' | 'small' | 'mini';
24
24
  text?: string;
25
25
  textLineHeight?: Property.LineHeight;
26
26
  textVariant?: TextVariant;
@@ -1,7 +1,9 @@
1
+ import { CheckboxVariant } from './checkbox.types';
1
2
  export declare const StyledCheckboxWrapper: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {}, never>;
2
3
  export declare const StyledCheckboxContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
- disabled: boolean;
4
+ $disabled: boolean;
4
5
  }, never>;
5
6
  export declare const StyledCheckbox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
6
- checked: boolean;
7
+ $checked: boolean;
8
+ $variant?: CheckboxVariant | undefined;
7
9
  }, never>;
@@ -1,6 +1,7 @@
1
1
  import { JSXElementConstructor } from 'react';
2
- import { TextVariant } from '../typography/typography.types';
2
+ import { TextVariant } from '../typography';
3
3
  import { FieldChangeEvent } from '../text-field';
4
+ export declare type CheckboxVariant = 'primary' | 'alert';
4
5
  export interface CheckboxProps<T = boolean> {
5
6
  /** Overrides `labelTx` and `labelText` props to render `Component` inside a `label` element. */
6
7
  Component?: JSXElementConstructor<{
@@ -15,6 +16,7 @@ export interface CheckboxProps<T = boolean> {
15
16
  name?: string;
16
17
  onChange?: (event: FieldChangeEvent<T>) => void;
17
18
  onSelected?: (value: T) => void;
19
+ variant?: CheckboxVariant;
18
20
  }
19
21
  export interface LabelContentProps extends Pick<CheckboxProps, 'labelText' | 'labelTx' | 'labelVariant' | 'Component'> {
20
22
  isChecked: boolean;
@@ -1,2 +1,3 @@
1
- import { CircularProgressProps } from './circular-progress.types';
1
+ import { CircularProgressBaseSize, CircularProgressProps } from './circular-progress.types';
2
2
  export declare const CircularProgressPresets: Partial<CircularProgressProps>;
3
+ export declare const CircularProgressSizes: Record<CircularProgressBaseSize, string>;
@@ -1,4 +1,5 @@
1
1
  import { Property } from 'csstype';
2
+ export declare type CircularProgressBaseSize = 'small' | 'medium' | 'large';
2
3
  export interface CircularProgressProps {
3
- size?: Property.Height;
4
+ size?: CircularProgressBaseSize | Property.Height;
4
5
  }
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from 'styled-components';
2
+ import { ColorPickerVariant } from '../../color-picker.types';
3
+ export declare const StyledColorOutline: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
+ $isClickable: boolean;
5
+ $selected?: boolean | undefined;
6
+ $size?: CSSProperties['width'];
7
+ $variant?: ColorPickerVariant | undefined;
8
+ }, never>;
9
+ export declare const StyledColor: import("styled-components").StyledComponent<import("react-spring").AnimatedComponent<"span">, import("styled-components").DefaultTheme, {
10
+ $size?: CSSProperties['width'];
11
+ $variant?: ColorPickerVariant | undefined;
12
+ color: string;
13
+ }, never>;
@@ -1,7 +1,6 @@
1
1
  import { CSSProperties } from 'styled-components';
2
2
  import { ColorPickerVariant } from '../../color-picker.types';
3
3
  export declare const StyledColorOutline: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
4
- $isClickable: boolean;
5
4
  $selected?: boolean | undefined;
6
5
  $size?: CSSProperties['width'];
7
6
  $variant?: ColorPickerVariant | undefined;
@@ -20,6 +20,7 @@ export * from './in-view';
20
20
  export * from './linear-progress';
21
21
  export * from './modal';
22
22
  export * from './overlay';
23
+ export * from './pills';
23
24
  export * from './radio';
24
25
  export * from './search-field';
25
26
  export * from './stack';
@@ -21,5 +21,5 @@ export declare const StyledModalBodyContent: import("styled-components").StyledC
21
21
  export declare const StyledModalScrollableContent: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../grid/grid.types").GridProps & import("react").RefAttributes<import("../grid/grid.types").GridProps>>, import("styled-components").DefaultTheme, {}, never>;
22
22
  export declare const StyledModalChildrenContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
23
  export declare const StyledModalBackdrop: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
- export declare const StyledModalCloseButtonContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
+ export declare const StyledModalCloseButtonContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
25
25
  export declare const StyleMobileCloseContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1 @@
1
+ export * from './pill';
@@ -0,0 +1 @@
1
+ export { Pill } from './pill';
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { PillProps } from './pill.types';
3
+ export declare const Pill: FC<PillProps>;
@@ -0,0 +1,3 @@
1
+ export declare const StyledPill: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
+ $selected?: boolean | undefined;
3
+ }, never>;
@@ -0,0 +1,9 @@
1
+ export interface PillProps {
2
+ icon?: JSX.Element;
3
+ onSelected?: (value: string | number) => void;
4
+ selected?: boolean;
5
+ text?: string;
6
+ tx?: string;
7
+ txValues?: Record<string, unknown>;
8
+ value: string | number;
9
+ }
@@ -0,0 +1,2 @@
1
+ export { Pills } from './pills';
2
+ export { Pill } from './components';
@@ -0,0 +1,3 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ import { PillsProps } from './pills.types';
3
+ export declare const Pills: FC<PropsWithChildren<PillsProps>>;
@@ -0,0 +1 @@
1
+ export declare const StyledPills: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,20 @@
1
+ import { ChangeEvent, FocusEvent } from 'react';
2
+ import { BlurChangeEvent } from '../dropdown';
3
+ export interface PillsProps {
4
+ name?: string;
5
+ onBlur?: (event: BlurChangeEvent) => void;
6
+ onChange?: (event: PillsChangeEvent) => void;
7
+ onFocus?: (event: FocusChangeEvent) => void;
8
+ value?: string | number | undefined;
9
+ }
10
+ export interface PillsChangeEvent<T = string | number> extends Pick<ChangeEvent<HTMLInputElement>, Exclude<keyof ChangeEvent<HTMLInputElement>, 'target'>> {
11
+ target: {
12
+ name: string;
13
+ value: T;
14
+ };
15
+ }
16
+ export interface FocusChangeEvent extends Pick<FocusEvent<HTMLDivElement>, Exclude<keyof FocusEvent<HTMLDivElement>, 'target'>> {
17
+ target: {
18
+ name: string;
19
+ };
20
+ }
@@ -1,9 +1,12 @@
1
+ import { RadioVariant } from './radio.types';
1
2
  export declare const StyledRadioWrapper: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {}, never>;
2
3
  export declare const StyledRadioContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
4
  $disabled?: boolean | undefined;
4
5
  }, never>;
5
6
  export declare const StyledRadio: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
6
7
  $checked?: boolean | undefined;
8
+ $disabled?: boolean | undefined;
9
+ $variant?: RadioVariant | undefined;
7
10
  }, never>;
8
11
  export declare const StyledRadioInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
9
12
  export declare const StyledRadioMarker: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
@@ -1,4 +1,5 @@
1
1
  import { TextVariant } from '../typography';
2
+ export declare type RadioVariant = 'primary' | 'alert';
2
3
  export interface RadioProps {
3
4
  disabled?: boolean;
4
5
  groupValue?: any;
@@ -10,4 +11,5 @@ export interface RadioProps {
10
11
  onChange?: (event: any) => void;
11
12
  onSelected?: (value: any) => void;
12
13
  value?: any;
14
+ variant?: RadioVariant;
13
15
  }
@@ -1,6 +1,5 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
2
  import { StyledInputContainerProps, StyledParentContainerProps } from './text-field.types';
3
3
  export declare const StyledParentContainer: import("styled-components").StyledComponent<"div", DefaultTheme, StyledParentContainerProps, never>;
4
- export declare const StyledIconContainer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
5
4
  export declare const StyledInputContainer: import("styled-components").StyledComponent<"div", DefaultTheme, StyledInputContainerProps, never>;
6
5
  export declare const StyledInput: import("styled-components").StyledComponent<"input", DefaultTheme, {}, never>;
@@ -72,6 +72,7 @@ export interface StyledInputContainerProps extends Pick<TextFieldProps, 'variant
72
72
  $withErrors: boolean;
73
73
  }
74
74
  export interface StyledParentContainerProps extends Pick<TextFieldProps, 'labelPosition' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'horizontalMargin' | 'verticalMargin' | 'margin'> {
75
+ $disabled: boolean;
75
76
  }
76
77
  export interface ErrorMessageProps {
77
78
  errorMessage?: ErrorMessageType;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ToggleProps } from './toggle.types';
3
+ export declare const Toggle: FC<ToggleProps>;
@@ -0,0 +1,2 @@
1
+ import { ToggleProps } from './toggle.types';
2
+ export declare const TogglePresets: Partial<ToggleProps>;
@@ -0,0 +1,9 @@
1
+ export declare const StyledToggleContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
2
+ $disabled?: boolean | undefined;
3
+ }, never>;
4
+ export declare const StyledToggle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
5
+ $checked: boolean;
6
+ $disabled?: boolean | undefined;
7
+ $withErrors: boolean;
8
+ }, never>;
9
+ export declare const StyledToggleSwitch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -0,0 +1,21 @@
1
+ import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
2
+ import { TextVariant } from '../typography';
3
+ import { ErrorMessageType } from '../text-field';
4
+ export declare type ToggleVariant = 'primary' | 'alert';
5
+ export interface ToggleProps extends Pick<DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, 'onChange' | 'onBlur' | 'onFocus'> {
6
+ checked?: boolean;
7
+ disabled?: boolean;
8
+ errorMessage?: ErrorMessageType;
9
+ labelPosition?: 'left' | 'right';
10
+ labelText?: string;
11
+ labelTx?: string;
12
+ labelVariant?: TextVariant;
13
+ name?: string;
14
+ onSelected?: (value: boolean) => void;
15
+ value?: boolean;
16
+ variant?: ToggleVariant;
17
+ }
18
+ export interface ToggleLabelProps extends Pick<ToggleProps, 'labelText' | 'labelTx' | 'labelVariant'> {
19
+ color?: 't1' | 't2';
20
+ fieldId: string;
21
+ }
@@ -1,12 +1,12 @@
1
1
  import { Property } from 'csstype';
2
2
  import { DefaultTheme } from 'styled-components';
3
- import { CSSProperties } from 'react';
3
+ import { AriaAttributes, CSSProperties } from 'react';
4
4
  import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
5
5
  export declare type TextAlign = 'string' | 'left' | 'center' | 'right' | 'unset';
6
6
  export declare type TypographyColor = keyof DefaultTheme['colors']['typography'];
7
7
  export declare type TextVariant = 'p0' | 'p1' | 'p2' | 'p3' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'hero';
8
8
  export declare type TextStyle = 'regular' | 'bold';
9
- export interface TypographyProps extends Partial<TypographyDefaultProps> {
9
+ export interface TypographyProps extends Partial<TypographyDefaultProps>, AriaAttributes {
10
10
  align?: ResolutionAwareProp<string>;
11
11
  alignSelf?: ResolutionAwareProp<Property.AlignSelf>;
12
12
  className?: string;