dopplr-labs / tail-kit Goto Github PK
View Code? Open in Web Editor NEWReact UI kit built using tailwindcss
Home Page: https://tail-kit.web.app/
React UI kit built using tailwindcss
Home Page: https://tail-kit.web.app/
Describe the component
InputNumber
component to enter a number within a certain range with the mouse or keyboard.
Describe the component props
The InputNumber
would have all the props as a default <input type="checkbox" />
html element with some additional properties such as
Prop | Description | Required | Type | Default Value |
---|---|---|---|---|
defaultValue | The initial value | no | number |
|
disabled | If disable the input | no | boolean |
false |
max | The max value | no | number |
Number.MAX_SAFE_INTEGER |
min | The min value | no | number |
Number.MIN_SAFE_INTEGER |
Describe the component use cases
Alert
component to show an error, warning, success, or info message.
Alert
PropsProp | Description | Required | Type | Default Value |
---|---|---|---|---|
type |
Type of the alert which can be either AlertType.error or AlertType.warning or AlertType.success or AlertType.info |
no | AlertType |
AlertType.info |
title |
Alert title | yes | React.ReactNode |
|
content |
Alert content | no | React.ReactNode |
|
icon |
Alert icon | no | JSX.Element or boolean |
|
actions |
Alert action buttons | no | JSX.Element |
|
closable |
Making alert closable. It would render (X) button | no | boolean |
true |
onClose |
Function to be called on pressing the (X) button | no | (event: React.MouseEvent<HTMLButtonElement>) => void |
AlertButton
Prop | Description | Required | Type | Default Value |
---|---|---|---|---|
type |
Type of button | no | AlertButtonType |
AlertButtonType.primary |
label |
Button label | yes | string | |
icon |
Button icon | no | JSX.Element |
|
loading |
Button loading | no | boolean |
|
className |
additional classes | no | string |
|
style |
addtional styles | no | React.CSSProperties |
Is your feature request related to a problem? Please describe.
User should be able to add text or icon in the track of Switch component for both checked and unchecked state.
We usually see this kind of use case in theme toggles for dark/light mode.
Describe the solution you'd like
An example from ant design: https://ant.design/components/switch/#components-switch-demo-text
Describe the component
Checkbox
component to render a checkbox
Describe the component props
The checkbox would have all the props as a default <input type="checkbox" />
html element with some additional properties such as
Prop | Description | Required | Type | Default Value |
---|---|---|---|---|
checked | specifies if the checkbox is selected | no | boolean |
false |
onChange | callback function that is triggered when the checkbox state changes | no | (event: React.ChangeEvent<HTMLInputElement> => void |
|
label | checkbox label | no | React.ReactNode |
|
error | specifies if there is any form error with the checkbox, it would change the border or background color to error color depending on checked value |
boolean |
||
className | additional classes | no | string |
|
style | additional styles | no | React.CSSProperties |
Describe the component use cases
<Checkbox value={true} />
<Checkbox value={rememberMe} onChange={toggleRememberMe} label="Remember Me" />
<Checkbox value={termsAgreed} onChange={toggleTermsAgreed} label="I agree to the terms and conditions" error={!termsAgreed} />
Describe the bug
Register ref of hook useForm
imported from react-hook-form
is not working with Select
component
To Reproduce
Steps to reproduce the behavior:
const handleSubmit = data => console.log(data);
<Form onSubmit={handleSubmit}>
<Form.Item name='gender' label='Gender'>
<Select
options={['Male', 'Female', 'Other']}
placeholder="Select your gender"
className="w-full"
/>
</Form.Item>
<Button type='submit' label='Submit' />
</Form>
Select
component in console.Is your feature request related to a problem? Please describe.
Add quick Navigation support for Month and Year in Date Picker to directly pick a value rather than moving one value at a time.
Snapshot of antd date-picker
Describe the solution you'd like
Inside Date Picker, a user should be able to click on the year to see and navigate through a decade in single click.
Add automation for
dependabot
Currently, the useSyncedState
hook updates the local state with the props. But this hook still lacks functionality to update to call onChange
handlers from the props on updating local state. So to solve this problem almost every component has implemented a different logic. This is not maintainable in long term. There should be a common hook in the form of
const [inputValue, setInputValue] = useSyncedState(value, {
// callback function called when the state is updated
onStateChange: (updatedValue) => {
onChange?.(updatedValue)
},
// comparator function to compare when the state and prop differs
// for perfomance optimization the hook should use shallow comparision by default
// but for the complex cases like date picker, user should have a way to provide a comparator function
comparator: (a, b) => a === b
})
In the above example, the value
and onChange
are props provided to the component, when we want to run it as a controlled component. In absence of these props, the component should behave as an uncontrolled component. So it should also maintain its own state. But this poses a challenge of inputValue
state with value
prop. If there is a new value
, it should update the inputValue
and if there is any change in inputValue
, it should update the value
by calling the onChange
prop.
This hook also aims to provide a simpler mental model to the component developer to consider this element as a simple uncontrolled element and use inputValue
and setInputValue
as it is. The logic of syncing should be handled by hook itself.
Describe the bug
npm publish
command is not able to publish the latest changes on npmjs.com. This is happening after adding Form
component. Error message is telling that Form component has circular dependency with it's other compound component elements.
To Reproduce
Steps to reproduce the behavior:
npm publish
commandonChange function is not called if values are changed using increment/decrement arrow buttons in InputNumber
component.
Steps to Reproduce
import { InputNumber } from '@tail-kit/tail-kit'
export default function BugReproduction(){
const [value, setValue] = useState(3);
function handleChange(event) {
console.log('New Value', event.target.value);
setValue(event.target.value);
}
return <InputNumber value={value} onChange={handleChange} />
}
handleChange
will not be called if value of input is changed using Arrow buttons
Describe the bug
Use tail-kit
in external projects throws ** Invalid hook call** error. This happens because tail-kit
is also bundled with react
and in the projects where these versions don't match, it throws an error. On further inspection, it is found that tail-kit
uses react
as a dependency, instead, it should be used as peer-dependency
.
To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/resizable-panes-forked-r5c0r?file=/src/index.js
Describe the bug
Base Color is computed based on the alert type prop provided by the user. Switching to JIT mode in tailwindCSS is purging the possible classes of the alert component.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Fix CSS classes for the alert component to support jit mode.
Screenshots
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.