From 7090292db91d484db7f6ab61cab4770784e57f31 Mon Sep 17 00:00:00 2001 From: RTAndrew Paul Date: Wed, 8 Feb 2023 15:47:19 +0100 Subject: [PATCH 1/8] v3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6aa3bdc3..b5004bb7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "2.0.2", + "version": "3.0.0", "name": "@taikai/rocket-kit", "author": "taikai", "description": "TAIKAI Design System", From 00799bcb0ce0d6dce121c6d48cac803160804c02 Mon Sep 17 00:00:00 2001 From: Henrique Macedo Date: Fri, 4 Aug 2023 11:44:02 +0100 Subject: [PATCH 2/8] v3.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c7461fc..d83d0ee3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.0.3", + "version": "3.0.4", "name": "@taikai/rocket-kit", "author": "taikai", "description": "TAIKAI Design System", From 2854c7607ac4ad5e95d45e849cdb755dae984a85 Mon Sep 17 00:00:00 2001 From: Henrique Macedo Date: Thu, 21 Sep 2023 14:00:55 +0100 Subject: [PATCH 3/8] v3.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1a61f124..b0c9ad71 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "3.0.4", + "version": "3.0.5", "name": "@taikai/rocket-kit", "author": "taikai", "description": "TAIKAI Design System", From f8f2e94321910f114de7286fa30d658324fb4516 Mon Sep 17 00:00:00 2001 From: RTAndrew Paul Date: Thu, 21 Sep 2023 23:26:25 +0100 Subject: [PATCH 4/8] styles(checkbox): remove clashing styles --- src/atoms/checkbox/styles.tsx | 36 ----------------------------------- 1 file changed, 36 deletions(-) diff --git a/src/atoms/checkbox/styles.tsx b/src/atoms/checkbox/styles.tsx index c4950e4a..aa666c5f 100644 --- a/src/atoms/checkbox/styles.tsx +++ b/src/atoms/checkbox/styles.tsx @@ -45,42 +45,6 @@ export const CheckboxInput = styled.input` left: 0; opacity: 0; cursor: pointer; - - &:checked:not(:disabled)[aria-checked='true'] ~ span { - background-color: ${props => - props.error ? field.errorBackgroundColor : field.successBackgroundColor}; - border-color: ${props => - props.error ? field.errorBorderColor : field.successBorderColor}; - - &:after { - display: block; - } - } - - &:checked:disabled[aria-checked='true'] ~ span { - border-color: transparent; - background-color: ${field.disabledBackgroundColor}; - color: ${field.disabledColor}; - - &:after { - display: block; - } - } - - &:not(:checked):disabled ~ span { - border-color: ${field.disabledBackgroundColor}; - background-color: ${field.backgroundColor}; - } - - &:hover:not(:disabled) { - border-color: ${props => - props.error ? field.errorBorderColor : field.activeBorderColor}; - - &:checked ~ span { - border-color: ${props => - props.error ? field.errorBorderColor : field.successBorderColor}; - } - } `; export const Checkmark = styled.span` From 3863b1925794c1f52369d59818f51fae6ffb680d Mon Sep 17 00:00:00 2001 From: RTAndrew Paul Date: Thu, 21 Sep 2023 23:58:42 +0100 Subject: [PATCH 5/8] fix(field-with-button): listen to `value` state --- src/molecules/field-with-button/index.tsx | 43 ++++++++++++----------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/molecules/field-with-button/index.tsx b/src/molecules/field-with-button/index.tsx index b02d32a5..f9cb4292 100644 --- a/src/molecules/field-with-button/index.tsx +++ b/src/molecules/field-with-button/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import Label from '../../atoms/label'; import TextField from '../../atoms/text-field'; import { TextFieldType } from '../../atoms/text-field/types'; @@ -21,27 +21,23 @@ export interface FieldWidthButtonProps { clearFieldAfterSubmit?: boolean; } -const FieldWidthButton = (props: FieldWidthButtonProps) => { - const { - label, - type = 'text', - name, - placeholder, - value, - onChange, - dataTestId, - buttonIcon, - buttonValue, - buttonAction, - buttonDisabled, - disabled = true, - clearFieldAfterSubmit = false, - } = props; - +const FieldWidthButton = ({ + label, + type = 'text', + name, + placeholder, + value, + onChange, + dataTestId, + buttonIcon, + buttonValue, + buttonAction, + buttonDisabled, + disabled = true, + clearFieldAfterSubmit = false, +}: FieldWidthButtonProps) => { const [loading, setLoading] = useState(false); - const [fieldValue, setFieldValue] = useState( - value ?? null - ); + const [fieldValue, setFieldValue] = useState(null); const handleOnClickAction = async () => { if (buttonAction?.constructor.name !== 'AsyncFunction') { @@ -55,6 +51,11 @@ const FieldWidthButton = (props: FieldWidthButtonProps) => { clearFieldAfterSubmit && setFieldValue(''); }; + useEffect(() => { + if (!value) return; + setFieldValue(value); + }, [value]); + return ( {label &&