@sebgroup/green-react 1.10.0 → 1.11.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.
package/index.js CHANGED
@@ -2493,7 +2493,7 @@ const IconButton = _a => {
2493
2493
  } = _a,
2494
2494
  props = __rest(_a, ["children", "onClick"]);
2495
2495
  return jsx("button", Object.assign({
2496
- className: "icon",
2496
+ className: `icon ${props.size == 'small' && 'small'}`,
2497
2497
  onClick: onClick,
2498
2498
  "aria-controls": props['aria-controls'],
2499
2499
  "aria-expanded": props['aria-expanded'],
@@ -2796,6 +2796,7 @@ const FormItem = ({
2796
2796
  children: labelInformation
2797
2797
  }))]
2798
2798
  })), expandableInfo && jsx(IconButton, Object.assign({
2799
+ size: "small",
2799
2800
  "aria-expanded": isExpanded,
2800
2801
  "aria-controls": `${inputId}-expandable-info`,
2801
2802
  onClick: event => __awaiter(void 0, void 0, void 0, function* () {
@@ -3908,7 +3909,7 @@ const Tabs = ({
3908
3909
  role: "tabpanel",
3909
3910
  "aria-hidden": selectedTab !== index
3910
3911
  }, {
3911
- children: tab.props.children
3912
+ children: selectedTab === index && tab.props.children
3912
3913
  }), index))]
3913
3914
  })]
3914
3915
  });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/chlorophyll": "^1.10.3",
9
+ "@sebgroup/chlorophyll": "^1.11.0",
10
10
  "@sebgroup/extract": "^1.3.4",
11
11
  "classnames": "^2.3.2"
12
12
  },
@@ -6,6 +6,7 @@ interface IconButtonInterface {
6
6
  onClick: (event: MouseEvent) => void;
7
7
  'aria-expanded'?: boolean;
8
8
  'aria-controls'?: string;
9
+ size?: 'small' | 'normal';
9
10
  }
10
11
  declare const IconButton: ({ children, onClick, ...props }: IconButtonInterface) => JSX.Element;
11
12
  export default IconButton;
@@ -1,7 +1,7 @@
1
1
  import React, { InputHTMLAttributes } from 'react';
2
2
  import { IValidator } from '@sebgroup/extract';
3
3
  import { CheckboxProps, NumberInputProps, RadioButtonProps, TextInputProps } from '../types';
4
- export declare type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator, expandableInfo?: string, expandableInfoButtonLabel?: string, testId?: string) => JSX.Element;
4
+ export declare type Renderer = (type: string, props: InputHTMLAttributes<HTMLInputElement>, onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void, onChangeInput?: (value: string) => string, label?: string, info?: string, validator?: IValidator, expandableInfo?: React.ReactNode, expandableInfoButtonLabel?: string, testId?: string) => JSX.Element;
5
5
  export declare const RenderInput: Renderer;
6
6
  export declare const TextInput: ({ label, info, testId, onChange, onChangeInput, validator, expandableInfo, expandableInfoButtonLabel, ...props }: TextInputProps) => JSX.Element;
7
7
  export declare const EmailInput: ({ label, info, onChange, onChangeInput, validator, testId, ...props }: TextInputProps) => JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { IValidator } from '@sebgroup/extract';
2
- import { HTMLProps } from 'react';
2
+ import React, { HTMLProps } from 'react';
3
3
  export interface TextInputProps extends HTMLProps<HTMLInputElement> {
4
4
  type?: 'text' | 'email' | 'number';
5
5
  label?: string;
6
6
  info?: string;
7
7
  testId?: string;
8
- expandableInfo?: string;
8
+ expandableInfo?: React.ReactNode;
9
9
  expandableInfoButtonLabel?: string;
10
10
  validator?: IValidator;
11
11
  onChangeInput?: (value: string) => string;
@@ -15,7 +15,7 @@ export interface NumberInputProps extends TextInputProps {
15
15
  min?: number;
16
16
  max?: number;
17
17
  step?: number;
18
- expandableInfo?: string;
18
+ expandableInfo?: React.ReactNode;
19
19
  expandableInfoButtonLabel?: string;
20
20
  }
21
21
  export interface CheckboxProps extends HTMLProps<HTMLInputElement> {
@@ -6,7 +6,7 @@ interface FormItemProps {
6
6
  label?: string;
7
7
  labelInformation?: string;
8
8
  validator?: IValidator;
9
- expandableInfo?: string;
9
+ expandableInfo?: React.ReactNode;
10
10
  inputId?: string;
11
11
  children: ReactNode;
12
12
  expandableInfoButtonLabel?: string;