-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(docs): fix theme switch re-render * docs(config): update colors example * fix(docs): hide colors VaConfig demo
- Loading branch information
Showing
13 changed files
with
126 additions
and
60 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
21 changes: 21 additions & 0 deletions
21
packages/docs/page-config/ui-elements/config/examples/Colors.vue
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,21 @@ | ||
<template> | ||
<VaConfig :colors="{ variables: { primary: color }, currentPresetName: presetName }"> | ||
<VaCard> | ||
<VaCardContent class="flex flex-col gap-2"> | ||
<VaColorInput v-model="color" /> | ||
<VaButton @click="presetName === 'light' ? presetName = 'dark' : presetName = 'light'">Toggle theme</VaButton> | ||
<VaInput label="login" /> | ||
<VaInput label="password" type="password" /> | ||
<div class="flex gap-2"> | ||
<VaButton>login</VaButton> | ||
<VaButton color="secondary">register</VaButton> | ||
</div> | ||
</VaCardContent> | ||
</VaCard> | ||
</VaConfig> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const color = ref('#f0f') | ||
const presetName = ref('light') | ||
</script> |
41 changes: 41 additions & 0 deletions
41
packages/docs/page-config/ui-elements/config/examples/Components.vue
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,41 @@ | ||
<template> | ||
<va-button-toggle | ||
v-model="config" | ||
:options="[ | ||
{ | ||
label: 'Outline', | ||
value: { | ||
VaInput: { outline: true }, | ||
VaSelect: { outline: true }, | ||
VaButton: { preset: 'secondary' }, | ||
}, | ||
}, | ||
{ | ||
label: 'Solid', | ||
value: { | ||
VaInput: { bordered: true }, | ||
VaSelect: { bordred: true }, | ||
}, | ||
}, | ||
]" | ||
class="mb-4" | ||
/> | ||
|
||
<va-config :components="config"> | ||
<va-card> | ||
<va-card-title>My Card</va-card-title> | ||
<va-card-content class="flex gap-2 flex-col"> | ||
<va-input label="Login" /> | ||
<va-input label="Password" /> | ||
<va-select :options="['one', 'two', 'three']" label="Country" /> | ||
</va-card-content> | ||
<va-card-actions align="right"> | ||
<va-button>My Button</va-button> | ||
</va-card-actions> | ||
</va-card> | ||
</va-config> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
const config = ref(); | ||
</script> |
45 changes: 0 additions & 45 deletions
45
packages/docs/page-config/ui-elements/config/examples/Default.vue
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/docs/page-config/ui-elements/config/examples/Internalization.vue
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,8 @@ | ||
<template> | ||
<VaConfig :i18n="{ | ||
dropzone: 'Перетягніть файли сюди або натисніть, щоб вибрати', | ||
uploadFile: 'Завантажити', | ||
}"> | ||
<VaFileUpload dropzone /> | ||
</VaConfig> | ||
</template> |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export type ButtonOption = { | ||
icon?: string, | ||
iconRight?: string | ||
[prop: string]: string | number | boolean | undefined | ||
label?: string, | ||
value?: unknown, | ||
[prop: string]: any | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { ColorConfig } from '../types' | ||
|
||
export const makeColorsConfig = (values: Omit<ColorConfig, 'variables'>): ColorConfig => ({ | ||
...values, | ||
get variables () { | ||
return this.presets[this.currentPresetName] | ||
}, | ||
set variables (value) { | ||
this.presets[this.currentPresetName] = value | ||
}, | ||
...values, | ||
}) |