Skip to content

Commit

Permalink
Merge pull request #446 from kelvininc/dc/input-disabled
Browse files Browse the repository at this point in the history
fix(text-field)!: rename props existing in native input to avoid conflict with lp
  • Loading branch information
djcouto committed May 10, 2024
2 parents 60732f8 + 49bce1c commit 51ed823
Show file tree
Hide file tree
Showing 41 changed files with 271 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const BaseInputTemplate = <T, S extends StrictRJSFSchema = RJSFSchema, F extends
id={id}
size={optionComponentSize ?? componentSize}
examples={examples}
disabled={disabled || readonly}
readonly={readonly}
inputDisabled={disabled || readonly}
inputReadonly={readonly}
maxLength={schema.maxLength ?? maxLength}
minLength={schema.minLength ?? minLength}
min={min}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const WrapIfAdditionalTemplate = <T, S extends StrictRJSFSchema = RJSFSchema, F
<KvTextField
id={`${id}-key`}
label={keyLabel}
disabled={disabled || readonly}
required={required}
inputDisabled={disabled || readonly}
inputRequired={required}
type={EInputFieldType.Text}
value={label}
onTextFieldBlur={!readonly ? handleBlur : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Default.args = {
inputConfig: {
label: 'Options',
icon: EIconName.Layer,
required: true,
inputRequired: true,
placeholder: 'Select an option',
helpText: 'You can select several options',
size: EComponentSize.Large
Expand All @@ -63,7 +63,7 @@ Disabled.args = {
inputConfig: {
label: 'Options',
icon: EIconName.Layer,
required: true,
inputRequired: true,
placeholder: 'Select an option',
helpText: 'You can select several options',
size: EComponentSize.Large
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
title: 'Inputs/Search',
component: 'kv-search',
argTypes: {
disabled: { control: { type: 'boolean' } },
inputDisabled: { control: { type: 'boolean' } },
size: {
control: 'radio',
options: Object.values(EComponentSize)
Expand Down Expand Up @@ -40,7 +40,7 @@ const SearchTemplate: ComponentStory<typeof KvSearch> = args => {
export const Default = SearchTemplate.bind({});
Default.args = {
value: '',
disabled: false,
inputDisabled: false,
placeholder: 'Placeholder Here',
size: EComponentSize.Large
};
Expand All @@ -50,7 +50,7 @@ Disabled.args = {
...Default.args,
value: '',
placeholder: 'Search disabled',
disabled: true,
inputDisabled: true,
size: EComponentSize.Large
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default {
title: 'Inputs/Text Field',
component: 'kv-text-field',
argTypes: {
disabled: { control: { type: 'boolean' } },
required: { control: { type: 'boolean' } },
inputDisabled: { control: { type: 'boolean' } },
inputRequired: { control: { type: 'boolean' } },
loading: { control: { type: 'boolean' } },
helpText: { control: { type: 'array' } },
value: { control: { type: 'text' } },
Expand Down Expand Up @@ -45,8 +45,8 @@ const TextFieldLeftSlotTemplate: ComponentStory<typeof KvTextField> = args => (
export const Default = TextFieldTemplate.bind({});
Default.args = {
label: 'Default Text Field',
disabled: false,
required: false,
inputDisabled: false,
inputRequired: false,
loading: false,
placeholder: 'text here',
state: EValidationState.None,
Expand All @@ -56,8 +56,8 @@ Default.args = {
export const WithTextInputMask = TextFieldTemplate.bind({});
WithTextInputMask.args = {
label: 'Text Field with text input mask',
disabled: false,
required: false,
inputDisabled: false,
inputRequired: false,
loading: false,
value: 'Possible Text Here',
inputMaskRegex: '[a-zA-Z s]+',
Expand All @@ -71,8 +71,8 @@ WithTextInputMask.args = {
export const WithNumericInputMask = TextFieldTemplate.bind({});
WithNumericInputMask.args = {
label: 'Text Field with numeric input mask',
disabled: false,
required: false,
inputDisabled: false,
inputRequired: false,
loading: false,
value: 0,
min: -100,
Expand All @@ -95,7 +95,7 @@ Disabled.args = {
...Default.args,
label: 'Disabled Text Field',
value: 'text value',
disabled: true,
inputDisabled: true,
state: EValidationState.None,
size: EComponentSize.Large
};
Expand All @@ -104,7 +104,7 @@ export const Required = TextFieldTemplate.bind({});
Required.args = {
...Default.args,
label: 'Required Text Field',
required: true,
inputRequired: true,
state: EValidationState.None,
size: EComponentSize.Large
};
Expand All @@ -113,7 +113,7 @@ export const MaxMinLength = TextFieldTemplate.bind({});
MaxMinLength.args = {
...Default.args,
label: 'Required Text Field',
required: true,
inputRequired: true,
minLength: 5,
maxLength: 10
};
Expand All @@ -123,7 +123,7 @@ MaxMinValue.args = {
...Default.args,
type: EInputFieldType.Number,
label: 'Required Text Field',
required: true,
inputRequired: true,
min: 0,
max: 10
};
Expand All @@ -133,7 +133,7 @@ Step.args = {
...Default.args,
type: EInputFieldType.Number,
label: 'Required Text Field',
required: true,
inputRequired: true,
step: 0.1
};

Expand Down Expand Up @@ -185,8 +185,8 @@ SlimIcon.args = {
export const WithLeftSlot = TextFieldLeftSlotTemplate.bind({});
WithLeftSlot.args = {
label: 'Left Slot Text Field',
disabled: false,
required: false,
inputDisabled: false,
inputRequired: false,
loading: false,
placeholder: 'text here',
state: EValidationState.None,
Expand All @@ -196,8 +196,8 @@ WithLeftSlot.args = {
export const DateTimeInputMask = TextFieldTemplate.bind({});
DateTimeInputMask.args = {
label: 'Date time input mask',
disabled: false,
required: false,
inputDisabled: false,
inputRequired: false,
loading: false,
useInputMask: true,
type: EInputFieldType.DateTime,
Expand Down

0 comments on commit 51ed823

Please sign in to comment.