Skip to content

Commit 8032b90

Browse files
committed
fix!: using unplugin-icons
1 parent 236371c commit 8032b90

File tree

16 files changed

+56
-198
lines changed

16 files changed

+56
-198
lines changed

.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineConfig({
1515
// @ts-expect-error this seems a type bug
1616
tailwindcss(),
1717
// @ts-expect-error this seems a type bug
18-
Icons({ compiler: 'vue3' }),
18+
Icons({ scale: 1, compiler: 'vue3' }),
1919
],
2020
resolve: {
2121
alias: {

docs/content/components/checkbox.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ radix: https://www.radix-ui.com/themes/docs/components/checkbox
1818
### Size
1919

2020
<Example name="checkbox/Size.vue" />
21+
22+
### State
23+
24+
<Example name="checkbox/State.vue" />

docs/examples/checkbox/State.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
import { Checkbox } from '#components'
3+
</script>
4+
5+
<template>
6+
<div class="flex items-center gap-2">
7+
<Checkbox />
8+
<Checkbox default-value="indeterminate" />
9+
<Checkbox :default-value="true" />
10+
</div>
11+
</template>

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
},
2525
"devDependencies": {
2626
"@iconify-json/lucide": "^1.2.58",
27+
"@iconify-json/radix-icons": "^1.2.2",
2728
"@radix-ui/colors": "^3.0.0",
2829
"@tailwindcss/typography": "^0.5.16",
2930
"@tailwindcss/vite": "^4.0.6",

src/components/accordion/AccordionIndicator.vue

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,19 @@ export interface AccordionIndicatorProps {
99
</script>
1010

1111
<script setup lang="ts">
12+
import ChevronIcon from '~icons/radix-icons/chevron-right'
13+
1214
withDefaults(defineProps<AccordionIndicatorProps>(), {
1315
variant: 'chevron',
1416
})
1517
</script>
1618

1719
<template>
1820
<div class="ui-AccordionIndicator">
19-
<svg
21+
<ChevronIcon
2022
v-if="variant == 'chevron'"
2123
class="ui-AccordionIndicator-chevron"
22-
xmlns="http://www.w3.org/2000/svg"
23-
width="1em"
24-
height="1em"
25-
viewBox="0 0 24 24"
26-
fill="none"
27-
stroke="currentColor"
28-
stroke-width="2"
29-
stroke-linecap="round"
30-
stroke-linejoin="round"
31-
>
32-
<path d="m9 18 6-6-6-6" />
33-
</svg>
24+
/>
3425
<div v-if="variant == 'plus'" class="ui-AccordionIndicator-plus">
3526
<span class="ui-AccordionIndicator-plus-1"></span>
3627
<span class="ui-AccordionIndicator-plus-2"></span>

src/components/checkbox/Checkbox.vue

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,23 @@ const resetClass = buildPropsClass(props, ['size', 'variant', 'highContrast'])
3838
as-child
3939
>
4040
<svg
41+
width="9"
42+
height="9"
43+
viewBox="0 0 9 9"
44+
fill="currentcolor"
4145
xmlns="http://www.w3.org/2000/svg"
42-
viewBox="0 0 24 24"
43-
fill="none"
44-
stroke="currentColor"
45-
stroke-width="4"
46-
stroke-linecap="round"
47-
stroke-linejoin="round"
4846
>
4947
<path
5048
v-if="state === 'indeterminate'"
51-
d="M5 12h14"
49+
fillRule="evenodd"
50+
clipRule="evenodd"
51+
d="M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"
5252
/>
5353
<path
5454
v-else
55-
d="M20 6 9 17l-5-5"
55+
fillRule="evenodd"
56+
clipRule="evenodd"
57+
d="M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"
5658
/>
5759
</svg>
5860
</CheckboxIndicator>

src/components/collapsible/CollapsibleIndicator.vue

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1+
<script setup lang="ts">
2+
import ChevronIcon from '~icons/radix-icons/chevron-right'
3+
</script>
4+
15
<template>
2-
<svg
3-
class="ui-CollapsibleIndicator"
4-
xmlns="http://www.w3.org/2000/svg"
5-
width="1em"
6-
height="1em"
7-
viewBox="0 0 24 24"
8-
fill="none"
9-
stroke="currentColor"
10-
stroke-width="2"
11-
stroke-linecap="round"
12-
stroke-linejoin="round"
13-
>
14-
<path d="m9 18 6-6-6-6" />
15-
</svg>
6+
<ChevronIcon class="ui-CollapsibleIndicator" />
167
</template>
178

189
<style>

src/components/combobox/ComboboxInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
useForwardPropsEmits,
2424
injectComboboxRootContext,
2525
} from 'reka-ui'
26-
import { Icon } from '@iconify/vue'
26+
import ChevronDownIcon from '~icons/radix-icons/chevron-down'
2727
2828
defineOptions({
2929
inheritAttrs: false,
@@ -134,7 +134,7 @@ watch(values, () => {
134134
}"
135135
/>
136136
<ComboboxTrigger class="ui-ComboboxTrigger">
137-
<Icon icon="radix-icons:chevron-down" />
137+
<ChevronDownIcon />
138138
</ComboboxTrigger>
139139
</ComboboxAnchor>
140140
</template>

src/components/combobox/ComboboxItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup lang="ts">
2-
import { Icon } from '@iconify/vue'
32
import {
43
ComboboxItem,
54
ComboboxItemIndicator,
65
useForwardProps,
76
type ComboboxItemProps,
87
} from 'reka-ui'
8+
import CheckIcon from '~icons/radix-icons/check'
99
1010
const props = defineProps<ComboboxItemProps>()
1111
const forwarded = useForwardProps(props)
@@ -17,7 +17,7 @@ const forwarded = useForwardProps(props)
1717
v-bind="forwarded"
1818
>
1919
<ComboboxItemIndicator class="ui-ComboboxItemIndicator">
20-
<Icon icon="radix-icons:check" />
20+
<CheckIcon />
2121
</ComboboxItemIndicator>
2222
<slot></slot>
2323
</ComboboxItem>

0 commit comments

Comments
 (0)