Skip to content

Commit

Permalink
feat(app): add rounded Input
Browse files Browse the repository at this point in the history
This pull request is intended to add the rounded feature to the Input component
  • Loading branch information
Selemondev authored and Selemondev committed Aug 1, 2023
1 parent 0181544 commit b99646f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/windi/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ const agree = ref('')

<template>
<div class="grid place-items-center mt-72">
<WCheckbox v-model="agree" icon="quill:checkmark-double" variant="warning" help="Please check the checkbox" label="Checkbox" required />
<WInput v-model="agree" icon="quill:checkmark-double" help="Please check the checkbox" label="Checkbox" required />
</div>
</template>
1 change: 1 addition & 0 deletions packages/windi/src/Types/componentsTypes/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface WKbd extends WComponentRoot {
}

export interface WInput extends WComponentRoot {
inputRounded?: string
inputWrapper?: string
inputPlaceholder?: string
inputSize?: string
Expand Down
5 changes: 5 additions & 0 deletions packages/windi/src/components/Input/WInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const props = defineProps({
type: [String, Number],
default: '',
},
rounded: {
type: String,
default: 'md',
},
type: {
type: String,
default: 'text',
Expand Down Expand Up @@ -153,6 +157,7 @@ const inputLabelTextSize = computed(() => {
const inputWrapperClass = computed(() => {
return classNames(
windiTheme.WInput.base.inputRounded[props.rounded],
variant.value.inputWrapper,
variant.value.inputPlaceholder,
windiTheme.WInput.base.inputSize && windiTheme.WInput.base.inputSize[props.size],
Expand Down
9 changes: 8 additions & 1 deletion packages/windi/src/theme/windiTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,14 @@ export default {
WInput: {
base: {
root: 'relative',
inputWrapper: 'relative shadow-sm bg-transparent text-gray-900 dark:text-white ring-1 ring-inset ring-gray-300 dark:ring-gray-400 focus:ring-2 focus:ring-green-500 dark:focus:ring-green-400 block w-full disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none rounded-md',
inputWrapper: 'relative shadow-sm bg-transparent text-gray-900 dark:text-white ring-1 ring-inset ring-gray-300 dark:ring-gray-400 focus:ring-2 focus:ring-green-500 dark:focus:ring-green-400 block w-full disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none',
inputRounded: {
sm: 'rounded-sm',
md: 'rounded-md',
lg: 'rounded-lg',
xl: 'rounded-xl',
full: 'rounded-full',
},
inputPlaceholder: 'placeholder-gray-400 dark:placeholder-gray-500',
inputLabel: 'flex mb-1 dark:text-white',
inputHelp: 'flex mt-1 text-sm text-gray-400 dark:text-gray-900',
Expand Down

0 comments on commit b99646f

Please sign in to comment.