-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5945 from kodadot/refactor/neo-switch
refactor: add NeoSwitch
- Loading branch information
Showing
10 changed files
with
81 additions
and
67 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
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
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
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,31 @@ | ||
<template> | ||
<Story title="NeoSwitch" :layout="{ type: 'grid', width: '600px' }"> | ||
<Variant title="NeoSwitch"> | ||
<NeoSwitch>Default</NeoSwitch> | ||
|
||
<br /> | ||
|
||
<NeoSwitch v-model="isSwitched"> | ||
{{ isSwitched }} | ||
</NeoSwitch> | ||
|
||
<br /> | ||
|
||
<NeoSwitch v-model="isSwitchedCustom" true-value="Yes" false-value="No"> | ||
{{ isSwitchedCustom }} | ||
</NeoSwitch> | ||
|
||
<br /> | ||
|
||
<NeoSwitch disabled>Disabled</NeoSwitch> | ||
</Variant> | ||
</Story> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { ref } from 'vue' | ||
import NeoSwitch from './NeoSwitch.vue' | ||
const isSwitched = ref(false) | ||
const isSwitchedCustom = ref('Yes') | ||
</script> |
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,24 @@ | ||
<script lang="ts"> | ||
import { OSwitch } from '@oruga-ui/oruga' | ||
export default { | ||
extends: OSwitch, | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '../../scss/_theme.scss'; | ||
@import '@oruga-ui/oruga/src/scss/utilities/_expressions.scss'; | ||
@import '@oruga-ui/oruga/src/scss/utilities/_variables.scss'; | ||
@import '@oruga-ui/oruga/src/scss/utilities/_animations.scss'; | ||
@import '@oruga-ui/oruga/src/scss/utilities/_helpers.scss'; | ||
@import '@oruga-ui/oruga/src/scss/components/_switch.scss'; | ||
.o-switch { | ||
&__check--checked { | ||
@include ktheme() { | ||
background-color: theme('k-primary'); | ||
} | ||
} | ||
} | ||
</style> |
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