Skip to content

Commit c18bda5

Browse files
committed
fix!: remove useless CheckboxGroup components
1 parent 5dc9094 commit c18bda5

File tree

8 files changed

+65
-221
lines changed

8 files changed

+65
-221
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Checkbox Group
3+
status: alpha
4+
source: https://github.com/typlog/ui/tree/main/src/components/checkbox
5+
reka: https://reka-ui.com/docs/components/checkbox-group
6+
radix: https://www.radix-ui.com/themes/docs/components/checkbox-group
7+
---
8+
9+
<Example name="checkbox-group/Nested.vue" />
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue'
3+
import { CheckboxGroup, Checkbox } from '#components'
4+
5+
const scopes = ref(['tenant:read'])
6+
</script>
7+
8+
<template>
9+
<div class="text-sm">
10+
<div class="flex items-center gap-2 mb-2">
11+
<span class="font-medium">Token Scopes</span>
12+
<span>{{ scopes }}</span>
13+
</div>
14+
<CheckboxGroup v-model="scopes">
15+
<label class="flex items-center gap-1">
16+
<Checkbox parent />
17+
<span>Tenant Permissions</span>
18+
</label>
19+
<label class="pl-4 flex items-center gap-1">
20+
<Checkbox value="tenant:read" />
21+
<span>Tenant Read Permission</span>
22+
</label>
23+
<label class="pl-4 flex items-center gap-1">
24+
<Checkbox value="tenant:write" />
25+
<span>Tenant Write Permission</span>
26+
</label>
27+
<label class="pl-4 flex items-center gap-1">
28+
<Checkbox value="tenant:admin" />
29+
<span>Tenant Admin Permission</span>
30+
</label>
31+
</CheckboxGroup>
32+
<CheckboxGroup v-model="scopes">
33+
<label class="flex items-center gap-1">
34+
<Checkbox parent />
35+
<span>User Profile</span>
36+
</label>
37+
<label class="pl-4 flex items-center gap-1">
38+
<Checkbox value="user:read" />
39+
<span>Read user profile</span>
40+
</label>
41+
<label class="pl-4 flex items-center gap-1">
42+
<Checkbox value="user:write" />
43+
<span>Update user profile</span>
44+
</label>
45+
<label class="pl-4 flex items-center gap-1">
46+
<Checkbox value="user:tenants" />
47+
<span>Fetch user's tenants</span>
48+
</label>
49+
</CheckboxGroup>
50+
</div>
51+
</template>

src/components/checkbox/Checkbox.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { CheckboxRootEmits, CheckboxRootProps } from 'reka-ui'
33
import type { ColorType } from '../types'
44
55
export interface CheckboxProps extends CheckboxRootProps {
6-
parent?: boolean
76
color?: ColorType
87
variant?: 'surface' | 'soft'
98
size?: '1' | '2' | '3'
@@ -22,7 +21,7 @@ const props = withDefaults(defineProps<CheckboxProps>(), {
2221
variant: 'surface',
2322
})
2423
25-
const forwarded = useForwardPropsEmitsWithout(props, emits, ['parent', 'color', 'size', 'variant', 'highContrast'])
24+
const forwarded = useForwardPropsEmitsWithout(props, emits, ['color', 'size', 'variant', 'highContrast'])
2625
const resetClass = buildPropsClass(props, ['size', 'variant', 'highContrast'])
2726
</script>
2827

src/components/checkbox/CheckboxGroupControl.vue

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/components/checkbox/CheckboxGroupItem.vue

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/components/checkbox/CheckboxGroupRoot.vue

Lines changed: 0 additions & 108 deletions
This file was deleted.

src/components/checkbox/index.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@ export {
44
} from './Checkbox.vue'
55

66
export {
7-
default as CheckboxGroup,
8-
type CheckboxGroupProps,
9-
} from './CheckboxGroup.vue'
10-
11-
export {
12-
default as CheckboxGroupRoot,
13-
} from './CheckboxGroupRoot.vue'
14-
15-
export {
16-
default as CheckboxGroupItem,
17-
} from './CheckboxGroupItem.vue'
18-
19-
export {
20-
default as CheckboxGroupControl,
21-
} from './CheckboxGroupControl.vue'
7+
CheckboxGroupRoot as CheckboxGroup,
8+
type CheckboxGroupRootProps as CheckboxGroupProps,
9+
} from 'reka-ui'

src/components/inputs/TextField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export interface TextFieldProps {
2727
</script>
2828

2929
<script setup lang="ts">
30-
import { computed, useTemplateRef } from 'vue'
30+
import { useTemplateRef } from 'vue'
3131
import { buildPropsClass } from '../util'
3232
3333
defineOptions({

0 commit comments

Comments
 (0)