@taikai/rocket-kit 3.0.4 → 3.0.6

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.
@@ -1,5 +1,5 @@
1
1
  import React, { CSSProperties } from 'react';
2
- interface Props {
2
+ export interface CheckboxProps {
3
3
  value: string;
4
4
  label?: string | React.ReactNode;
5
5
  checked?: boolean | undefined;
@@ -11,5 +11,5 @@ interface Props {
11
11
  dataTestId?: string;
12
12
  required?: boolean;
13
13
  }
14
- declare const Checkbox: ({ label, value, checked, onChange, error, disabled, className, style, dataTestId, required, }: Props) => React.JSX.Element;
14
+ declare const Checkbox: ({ label, value, checked, onChange, error, disabled, className, style, dataTestId, required, }: CheckboxProps) => React.JSX.Element;
15
15
  export default Checkbox;
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { ErrorFieldColor } from './types';
3
- interface ErrorFieldProps {
3
+ export interface ErrorFieldProps {
4
4
  color?: ErrorFieldColor;
5
5
  error: string;
6
6
  className?: string;
@@ -1,5 +1,5 @@
1
1
  import React, { CSSProperties } from 'react';
2
- interface SpinnerProps {
2
+ export interface SpinnerProps {
3
3
  fill?: string;
4
4
  size?: string;
5
5
  className?: string;
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { TextFieldType } from './types';
3
- interface TextFieldProps {
3
+ export interface TextFieldProps {
4
4
  type?: TextFieldType;
5
5
  error?: string;
6
6
  icon?: string;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export { default as ProgressBar } from './atoms/progress-bar';
22
22
  export { default as Toggle } from './atoms/toggle';
23
23
  export { default as FilePicker } from './atoms/file-picker';
24
24
  export { default as ActionsMenu } from './molecules/actions-menu';
25
+ export { ActionMenuList } from './molecules/actions-menu';
25
26
  export { default as CardValue } from './molecules/card-value';
26
27
  export { default as EmptyTable } from './molecules/empty-table';
27
28
  export { default as ModalFooter } from './molecules/modal-footer';
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ActionMenu } from './types';
3
- interface ActionsMenuListInterface<T> {
3
+ export interface ActionsMenuListInterface<T> {
4
4
  actions: ActionMenu<T>[];
5
5
  data?: any;
6
6
  rowIndex?: number;
7
7
  handleOptionClick?: () => void;
8
8
  }
9
- interface ActionsMenuInterface<T> {
9
+ export interface ActionsMenuInterface<T> {
10
10
  className?: string;
11
11
  ariaLabel?: string;
12
12
  actions: ActionMenu<T>[];
@@ -15,5 +15,5 @@ export interface FieldWidthButtonProps {
15
15
  buttonDisabled?: boolean;
16
16
  clearFieldAfterSubmit?: boolean;
17
17
  }
18
- declare const FieldWidthButton: (props: FieldWidthButtonProps) => React.JSX.Element;
18
+ declare const FieldWidthButton: ({ label, type, name, placeholder, value, onChange, dataTestId, buttonIcon, buttonValue, buttonAction, buttonDisabled, disabled, clearFieldAfterSubmit, }: FieldWidthButtonProps) => React.JSX.Element;
19
19
  export default FieldWidthButton;
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { NoteColor } from './types';
3
- interface NoteCardProps {
3
+ export interface NoteCardProps {
4
4
  color?: NoteColor;
5
5
  value: any;
6
6
  buttonValue?: string;
@@ -457,7 +457,7 @@ const CheckboxLabel = /*#__PURE__*/_styled__default.span.withConfig({
457
457
  const CheckboxInput = /*#__PURE__*/_styled__default.input.withConfig({
458
458
  displayName: "styles__CheckboxInput",
459
459
  componentId: "sc-w5t014-2"
460
- })(["position:absolute;left:0;opacity:0;cursor:pointer;&:checked:not(:disabled)[aria-checked='true'] ~ span{background-color:", ";border-color:", ";&:after{display:block;}}&:checked:disabled[aria-checked='true'] ~ span{border-color:transparent;background-color:", ";color:", ";&:after{display:block;}}&:not(:checked):disabled ~ span{border-color:", ";background-color:", ";}&:hover:not(:disabled){border-color:", ";&:checked ~ span{border-color:", ";}}"], props => props.error ? field.errorBackgroundColor : field.successBackgroundColor, props => props.error ? field.errorBorderColor : field.successBorderColor, field.disabledBackgroundColor, field.disabledColor, field.disabledBackgroundColor, field.backgroundColor, props => props.error ? field.errorBorderColor : field.activeBorderColor, props => props.error ? field.errorBorderColor : field.successBorderColor);
460
+ })(["position:absolute;left:0;opacity:0;cursor:pointer;"]);
461
461
  const Checkmark = /*#__PURE__*/_styled__default.span.withConfig({
462
462
  displayName: "styles__Checkmark",
463
463
  componentId: "sc-w5t014-3"
@@ -5336,24 +5336,23 @@ const Field = _styled__default.div`
5336
5336
  }
5337
5337
  `;
5338
5338
 
5339
- const FieldWidthButton = props => {
5340
- const {
5341
- label,
5342
- type = 'text',
5343
- name,
5344
- placeholder,
5345
- value,
5346
- onChange,
5347
- dataTestId,
5348
- buttonIcon,
5349
- buttonValue,
5350
- buttonAction,
5351
- buttonDisabled,
5352
- disabled = true,
5353
- clearFieldAfterSubmit = false
5354
- } = props;
5339
+ const FieldWidthButton = ({
5340
+ label,
5341
+ type = 'text',
5342
+ name,
5343
+ placeholder,
5344
+ value,
5345
+ onChange,
5346
+ dataTestId,
5347
+ buttonIcon,
5348
+ buttonValue,
5349
+ buttonAction,
5350
+ buttonDisabled,
5351
+ disabled = true,
5352
+ clearFieldAfterSubmit = false
5353
+ }) => {
5355
5354
  const [loading, setLoading] = React.useState(false);
5356
- const [fieldValue, setFieldValue] = React.useState(value ?? null);
5355
+ const [fieldValue, setFieldValue] = React.useState(value ?? '');
5357
5356
  const handleOnClickAction = async () => {
5358
5357
  if ((buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction.constructor.name) !== 'AsyncFunction') {
5359
5358
  buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction(fieldValue);
@@ -5364,6 +5363,10 @@ const FieldWidthButton = props => {
5364
5363
  }
5365
5364
  clearFieldAfterSubmit && setFieldValue('');
5366
5365
  };
5366
+ React.useEffect(() => {
5367
+ if (!value) return;
5368
+ setFieldValue(value);
5369
+ }, [value]);
5367
5370
  return /*#__PURE__*/React__default.createElement(Wrapper$e, null, label && /*#__PURE__*/React__default.createElement(Label, {
5368
5371
  value: label
5369
5372
  }), /*#__PURE__*/React__default.createElement(Field, null, /*#__PURE__*/React__default.createElement(TextField, {
@@ -6021,6 +6024,7 @@ const GridCol$1 = props => {
6021
6024
  }, children);
6022
6025
  };
6023
6026
 
6027
+ exports.ActionMenuList = ActionMenuList;
6024
6028
  exports.ActionsMenu = ActionsMenu;
6025
6029
  exports.AvatarImage = AvatarImage;
6026
6030
  exports.Button = Button;