2024-11-10 19:16:58 +00:00
|
|
|
<template>
|
|
|
|
<Fieldset legend="General" :toggleable="true">
|
|
|
|
<section class="flex justify-between items-center mb-4">
|
|
|
|
<div class="flex gap-2 items-center">
|
|
|
|
<span class="text-sm">Primary</span>
|
2024-11-14 03:58:28 +00:00
|
|
|
<input :defaultValue="primaryColor" @input="onPrimaryColorChange($event)" type="color" :title="$preset.semantic.primary['500']" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
2024-11-10 19:53:33 +00:00
|
|
|
<DesignColorPalette :value="$preset.semantic.primary" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</section>
|
|
|
|
<section class="grid grid-cols-4 mb-3 gap-2">
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.transitionDuration" label="Transition Duration" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.disabledOpacity" label="Disabled Opacity" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.iconSize" label="Icon Size" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.anchorGutter" label="Anchor Gutter" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.content.borderRadius" label="Border Radius" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.mask.transitionDuration" label="Mask Transition Dur." />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1"></div>
|
|
|
|
<div class="flex flex-col gap-1"></div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<div class="text-sm mb-1 font-semibold text-surface-950 dark:text-surface-0">Focus Ring</div>
|
|
|
|
<section class="grid grid-cols-4 gap-2">
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.focusRing.width" label="Width" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.focusRing.style" label="Style" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 09:18:07 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.focusRing.color" label="Color" type="color" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-1">
|
2024-11-12 13:44:52 +00:00
|
|
|
<DesignTokenField v-model="$preset.semantic.focusRing.offset" label="Offset" />
|
2024-11-10 19:16:58 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</Fieldset>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-11-14 03:58:28 +00:00
|
|
|
import { isObject } from '@primeuix/utils';
|
|
|
|
import { $dt, palette } from '@primevue/themes';
|
2024-11-10 19:16:58 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
inject: ['$preset'],
|
2024-11-14 03:58:28 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
primaryColor: this.getColor('{primary.500}')
|
|
|
|
};
|
|
|
|
},
|
2024-11-10 19:16:58 +00:00
|
|
|
methods: {
|
|
|
|
onPrimaryColorChange(event) {
|
|
|
|
this.$preset.semantic.primary = palette(event.target.value);
|
2024-11-14 03:58:28 +00:00
|
|
|
},
|
|
|
|
getColor(color) {
|
|
|
|
const colorScheme = this.$appState.darkTheme ? 'light' : 'dark';
|
|
|
|
const token = color?.replace(/{|}/g, '');
|
|
|
|
const tokenValue = $dt(token)?.value;
|
|
|
|
|
|
|
|
return (isObject(tokenValue) ? tokenValue[colorScheme]?.value : tokenValue) ?? color;
|
2024-11-10 19:16:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|