-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jaskang
committed
Dec 5, 2023
1 parent
775d6c1
commit b3888db
Showing
6 changed files
with
44 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { tw } from './utils/tw' | ||
|
||
export const createRingInputStyle = tw( | ||
`flex items-center rounded-md text-sm shadow-sm ring-1 ring-inset ring-gray-300 focus-within:z-10 focus-within:ring-2 focus-within:ring-primary-500 focus-within:ring-inset`, | ||
{ | ||
variants: { | ||
disabled: { | ||
false: 'cursor-pointer bg-white ring-gray-300', | ||
true: 'cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200', | ||
}, | ||
}, | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { type ColorName, type ColorLv, type ColorAlias, createVars, cvar } from './utils/style' | ||
export { createButtonStyle } from './Button' | ||
export { createAnchorStyle, createAnchorItemStyle } from './Anchor' | ||
export { createRingInputStyle } from './Input' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
import { defineComponent } from "vue"; | ||
|
||
import { computed, defineComponent } from 'vue' | ||
import { createRingInputStyle } from '../../../style/src/Input' | ||
|
||
const RingInput = defineComponent({ | ||
props:{ | ||
disabled:Boolean, | ||
status:{ | ||
props: { | ||
disabled: Boolean, | ||
status: { | ||
type: String, | ||
default:'primary' | ||
default: 'primary', | ||
}, | ||
}, | ||
setup(props,{slots}){ | ||
return ()=> <div | ||
aria-disabled={props.disabled} | ||
class={[ | ||
'z-input focus-within:ring-primary-500 flex items-center rounded-md text-sm shadow-sm ring-1 ring-inset ring-gray-300 focus-within:z-10 focus-within:ring-2 focus-within:ring-inset', | ||
'aria-disabled:cursor-not-allowed aria-disabled:bg-gray-50 aria-disabled:text-gray-500 aria-disabled:ring-gray-200', | ||
]} | ||
> | ||
{slots.default?.()} | ||
</div> | ||
} | ||
setup(props, { slots }) { | ||
const css = computed(() => | ||
createRingInputStyle({ | ||
disabled: props.disabled, | ||
}) | ||
) | ||
return () => <div class={css.value}>{slots.default?.()}</div> | ||
}, | ||
}) | ||
|
||
export default RingInput | ||
export default RingInput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters