feat: publish ColorSwatchPicker and shared swatch picker parts

This commit is contained in:
maoyingjie
2026-10-27 14:42:29 +08:00
parent fa4146ee0b
commit 8d9adda8da
38 changed files with 3232 additions and 9 deletions
@@ -0,0 +1,35 @@
<script setup lang="ts">
import {
ColorSwatchPicker,
ColorSwatchPickerIndicator,
ColorSwatchPickerItem,
ColorSwatchPickerSwatch,
} from "@heroui-vue/components";
const colors = [
"#F43F5E",
"#D946EF",
"#8B5CF6",
"#3B82F6",
"#06B6D4",
"#10B981",
"#84CC16",
];
</script>
<template>
<ColorSwatchPicker data-custom="foo" v-slot="root">
<ColorSwatchPickerItem
v-for="color in colors"
:key="color"
:color="color"
v-slot="state"
>
<ColorSwatchPickerSwatch
:data-item-selected="state.isSelected || undefined"
:data-picker-layout="root.layout"
/>
<ColorSwatchPickerIndicator />
</ColorSwatchPickerItem>
</ColorSwatchPicker>
</template>