@youcan/celeste 0.6.57 → 0.6.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/celeste.css +155 -18
- package/dist/cjs/chunks/index.js +245 -1
- package/dist/cjs/chunks/pagination-first.js +32 -0
- package/dist/cjs/chunks/pagination-item.js +32 -0
- package/dist/cjs/chunks/pagination-last.js +32 -0
- package/dist/cjs/chunks/pagination-next.js +32 -0
- package/dist/cjs/chunks/pagination-previous.js +32 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/pagination-content.js +30 -0
- package/dist/cjs/pagination-ellipsis.js +34 -0
- package/dist/cjs/pagination-first.js +3 -0
- package/dist/cjs/pagination-item.js +3 -0
- package/dist/cjs/pagination-last.js +3 -0
- package/dist/cjs/pagination-next.js +3 -0
- package/dist/cjs/pagination-previous.js +3 -0
- package/dist/cjs/pagination.js +59 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/pagination/index.d.ts +16 -0
- package/dist/components/pagination/pagination-content.d.ts +21 -0
- package/dist/components/pagination/pagination-ellipsis.d.ts +14 -0
- package/dist/components/pagination/pagination-first.d.ts +14 -0
- package/dist/components/pagination/pagination-item.d.ts +16 -0
- package/dist/components/pagination/pagination-last.d.ts +14 -0
- package/dist/components/pagination/pagination-next.d.ts +14 -0
- package/dist/components/pagination/pagination-previous.d.ts +14 -0
- package/dist/components/pagination/pagination.d.ts +32 -0
- package/dist/es/checkbox-card.js +1 -1
- package/dist/es/checkbox-label.js +1 -1
- package/dist/es/chunks/index.js +309 -65
- package/dist/es/chunks/index3.js +1 -1
- package/dist/es/chunks/pagination-first.js +33 -0
- package/dist/es/chunks/pagination-item.js +33 -0
- package/dist/es/chunks/pagination-last.js +33 -0
- package/dist/es/chunks/pagination-next.js +33 -0
- package/dist/es/chunks/pagination-previous.js +33 -0
- package/dist/es/combobox-group.js +1 -1
- package/dist/es/combobox-input.js +1 -1
- package/dist/es/combobox-item.js +1 -1
- package/dist/es/combobox-list.js +1 -1
- package/dist/es/combobox-root.js +1 -1
- package/dist/es/combobox-separator.js +1 -1
- package/dist/es/combobox-trigger.js +1 -1
- package/dist/es/command-group.js +1 -1
- package/dist/es/command-input.js +1 -1
- package/dist/es/command-item.js +1 -1
- package/dist/es/command-list.js +1 -1
- package/dist/es/command-root.js +1 -1
- package/dist/es/command-separator.js +1 -1
- package/dist/es/digit-input-slot.js +1 -1
- package/dist/es/digit-input.js +1 -1
- package/dist/es/dropdown-menu-content.js +1 -1
- package/dist/es/dropdown-menu-group.js +1 -1
- package/dist/es/dropdown-menu-item.js +1 -1
- package/dist/es/dropdown-menu-label.js +1 -1
- package/dist/es/dropdown-menu-separator.js +1 -1
- package/dist/es/dropdown-menu-sub-content.js +1 -1
- package/dist/es/dropdown-menu-sub-trigger.js +1 -1
- package/dist/es/dropdown-menu-trigger.js +1 -1
- package/dist/es/dropdown-menu.js +1 -1
- package/dist/es/index.js +51 -27
- package/dist/es/label.js +1 -1
- package/dist/es/modal-content.js +1 -1
- package/dist/es/modal-header.js +1 -1
- package/dist/es/pagination-content.js +31 -0
- package/dist/es/pagination-ellipsis.js +35 -0
- package/dist/es/pagination-first.js +4 -0
- package/dist/es/pagination-item.js +4 -0
- package/dist/es/pagination-last.js +4 -0
- package/dist/es/pagination-next.js +4 -0
- package/dist/es/pagination-previous.js +4 -0
- package/dist/es/pagination.js +60 -0
- package/dist/es/popover-content.js +1 -1
- package/dist/es/popover-trigger.js +1 -1
- package/dist/es/progress-bar.js +1 -1
- package/dist/es/progress-circle.js +1 -1
- package/dist/es/radio-group-card.js +1 -1
- package/dist/es/radio-group-label.js +1 -1
- package/dist/es/scroll-bar.js +1 -1
- package/dist/es/segmented-control-item.js +1 -1
- package/dist/es/segmented-control.js +1 -1
- package/dist/es/select-content.js +1 -1
- package/dist/es/select-item.js +1 -1
- package/dist/es/select-trigger.js +1 -1
- package/dist/es/select-value.js +1 -1
- package/dist/es/tab-menu-content.js +1 -1
- package/dist/es/tab-menu-item.js +1 -1
- package/dist/es/tab-menu-list.js +1 -1
- package/dist/es/tab-menu.js +1 -1
- package/dist/es/tooltip.js +1 -1
- package/package.json +3 -3
- package/src/components/index.ts +1 -0
- package/src/components/pagination/index.ts +23 -0
- package/src/components/pagination/pagination-content.vue +36 -0
- package/src/components/pagination/pagination-ellipsis.vue +47 -0
- package/src/components/pagination/pagination-first.vue +29 -0
- package/src/components/pagination/pagination-item.vue +28 -0
- package/src/components/pagination/pagination-last.vue +29 -0
- package/src/components/pagination/pagination-next.vue +29 -0
- package/src/components/pagination/pagination-previous.vue +33 -0
- package/src/components/pagination/pagination.vue +157 -0
- package/src/components/pagination/stories/pagination.stories.ts +154 -0
- package/src/components/switch/switch.vue +34 -16
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { PaginationRoot, type PaginationRootEmits, type PaginationRootProps, useForwardPropsEmits } from 'radix-vue';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<PaginationProps>(), { variant: 'basic' });
|
|
8
|
+
const emits = defineEmits<PaginationRootEmits>();
|
|
9
|
+
|
|
10
|
+
const delegated = reactiveOmit(props, 'class');
|
|
11
|
+
const forwarded = useForwardPropsEmits(delegated, emits);
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export interface PaginationProps extends PaginationRootProps {
|
|
16
|
+
class?: HTMLAttributes['class'];
|
|
17
|
+
variant: 'basic' | 'rounded' | 'group';
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<PaginationRoot
|
|
23
|
+
v-slot="sprops"
|
|
24
|
+
v-bind="forwarded"
|
|
25
|
+
data-slot="pagination"
|
|
26
|
+
:class="clsx('celeste-pagination', `celeste-pagination-variant-${props.variant}`, props.class)"
|
|
27
|
+
>
|
|
28
|
+
<div v-if="$slots.leading" class="celeste-pagination-leading">
|
|
29
|
+
<slot name="leading" v-bind="sprops" />
|
|
30
|
+
</div>
|
|
31
|
+
<div class="celeste-pagination-center">
|
|
32
|
+
<slot v-bind="sprops" />
|
|
33
|
+
</div>
|
|
34
|
+
<div v-if="$slots.trailing" class="celeste-pagination-trailing">
|
|
35
|
+
<slot name="trailing" v-bind="sprops" />
|
|
36
|
+
</div>
|
|
37
|
+
</PaginationRoot>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<style scoped>
|
|
41
|
+
:deep(*) {
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.celeste-pagination {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
width: 100%;
|
|
50
|
+
gap: var(--spacing-8);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.celeste-pagination-leading,
|
|
54
|
+
.celeste-pagination-trailing {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: var(--spacing-8);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.celeste-pagination-center {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex: 1;
|
|
63
|
+
align-items: center;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
gap: var(--spacing-8);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.celeste-pagination :deep(.celeste-pagination-element) {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
width: 32px;
|
|
74
|
+
height: 32px;
|
|
75
|
+
transition: all var(--animation-fast) ease;
|
|
76
|
+
border: 1px solid var(--color-stroke-soft-200);
|
|
77
|
+
background-color: var(--color-bg-white-0);
|
|
78
|
+
color: var(--color-text-sub-600);
|
|
79
|
+
font: var(--label-sm);
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.celeste-pagination :deep(.celeste-pagination-element:not(.celeste-pagination-item, .celeste-pagination-ellipsis)) {
|
|
84
|
+
border-color: transparent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.celeste-pagination
|
|
88
|
+
:deep(.celeste-pagination-element:hover:not(:disabled, [disabled='true'], .celeste-pagination-item-active)) {
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
background-color: var(--color-bg-weak-50);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.celeste-pagination :deep(.celeste-pagination-element:focus-visible:not(:disabled, [disabled='true'])) {
|
|
94
|
+
outline: none;
|
|
95
|
+
color: var(--color-text-strong-950);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.celeste-pagination :deep(.celeste-pagination-element:is(:disabled, [disabled='true'])) {
|
|
99
|
+
color: var(--color-text-disabled-300);
|
|
100
|
+
cursor: not-allowed;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.celeste-pagination :deep(.celeste-pagination-item-active) {
|
|
104
|
+
border-color: transparent;
|
|
105
|
+
background-color: var(--color-bg-weak-50);
|
|
106
|
+
color: var(--color-text-strong-950);
|
|
107
|
+
cursor: default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.celeste-pagination :deep(.celeste-pagination-element i) {
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
width: 18px;
|
|
113
|
+
height: 18px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.celeste-pagination-variant-basic :deep(.celeste-pagination-element) {
|
|
117
|
+
border-radius: var(--radius-8);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.celeste-pagination-variant-rounded :deep(.celeste-pagination-element) {
|
|
121
|
+
border-radius: var(--radius-full);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.celeste-pagination-variant-group :deep(.celeste-pagination-content) {
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
border: 1px solid var(--color-stroke-soft-200);
|
|
127
|
+
border-radius: var(--radius-8);
|
|
128
|
+
gap: var(--spacing-0);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.celeste-pagination-variant-group :deep(.celeste-pagination-element) {
|
|
132
|
+
width: 40px;
|
|
133
|
+
border: none;
|
|
134
|
+
border-left: 1px solid var(--color-stroke-soft-200);
|
|
135
|
+
border-radius: var(--radius-0);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.celeste-pagination-variant-group
|
|
139
|
+
:deep(.celeste-pagination-element:not(.celeste-pagination-item, .celeste-pagination-ellipsis)) {
|
|
140
|
+
border-left-color: var(--color-stroke-soft-200);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.celeste-pagination-variant-group :deep(.celeste-pagination-element:first-child) {
|
|
144
|
+
border-left: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.celeste-pagination-variant-group
|
|
148
|
+
:deep(.celeste-pagination-element:hover:not(:disabled, [disabled='true'], .celeste-pagination-item-active)) {
|
|
149
|
+
border-left-color: var(--color-stroke-soft-200);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.celeste-pagination-variant-group :deep(.celeste-pagination-item-active),
|
|
153
|
+
.celeste-pagination-variant-group
|
|
154
|
+
:deep(.celeste-pagination-element:hover:not(:disabled, [disabled='true'], .celeste-pagination-item-active) + *) {
|
|
155
|
+
border-left-color: var(--color-stroke-soft-200);
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite';
|
|
2
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components';
|
|
3
|
+
import Button from '@/components/button/button.vue';
|
|
4
|
+
import { ref } from 'vue';
|
|
5
|
+
import {
|
|
6
|
+
Pagination,
|
|
7
|
+
PaginationContent,
|
|
8
|
+
PaginationEllipsis,
|
|
9
|
+
PaginationFirst,
|
|
10
|
+
PaginationItem,
|
|
11
|
+
PaginationLast,
|
|
12
|
+
PaginationNext,
|
|
13
|
+
PaginationPrevious,
|
|
14
|
+
} from '..';
|
|
15
|
+
|
|
16
|
+
const meta: Meta<typeof Pagination> = {
|
|
17
|
+
title: 'Components/Pagination',
|
|
18
|
+
component: Pagination,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
|
|
23
|
+
type Story = StoryObj<typeof Pagination>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
total: 100,
|
|
28
|
+
itemsPerPage: 10,
|
|
29
|
+
siblingCount: 1,
|
|
30
|
+
variant: 'basic',
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
render: args => ({
|
|
34
|
+
components: {
|
|
35
|
+
Pagination,
|
|
36
|
+
PaginationContent,
|
|
37
|
+
PaginationEllipsis,
|
|
38
|
+
PaginationFirst,
|
|
39
|
+
PaginationItem,
|
|
40
|
+
PaginationLast,
|
|
41
|
+
PaginationNext,
|
|
42
|
+
PaginationPrevious,
|
|
43
|
+
Button,
|
|
44
|
+
},
|
|
45
|
+
setup() {
|
|
46
|
+
const page = ref(args.page || 1);
|
|
47
|
+
|
|
48
|
+
return { args, page };
|
|
49
|
+
},
|
|
50
|
+
template: `
|
|
51
|
+
<Pagination v-slot="{ page }" v-bind="args">
|
|
52
|
+
<PaginationContent v-slot="{ items }">
|
|
53
|
+
|
|
54
|
+
<PaginationFirst as="a" />
|
|
55
|
+
<PaginationPrevious as="a" />
|
|
56
|
+
|
|
57
|
+
<template v-for="(item, index) in items" :key="index">
|
|
58
|
+
<PaginationItem
|
|
59
|
+
disabled
|
|
60
|
+
as="a"
|
|
61
|
+
v-if="item.type === 'page'"
|
|
62
|
+
:value="item.value"
|
|
63
|
+
:is-active="item.value === page"
|
|
64
|
+
>
|
|
65
|
+
{{ item.value }}
|
|
66
|
+
</PaginationItem>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<PaginationEllipsis :index="4" />
|
|
70
|
+
|
|
71
|
+
<PaginationNext as="a" />
|
|
72
|
+
<PaginationLast as="a" />
|
|
73
|
+
</PaginationContent>
|
|
74
|
+
</Pagination>
|
|
75
|
+
`,
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const WithLeadingAndTrailing: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
total: 100,
|
|
82
|
+
itemsPerPage: 10,
|
|
83
|
+
siblingCount: 1,
|
|
84
|
+
variant: 'basic',
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
render: args => ({
|
|
88
|
+
components: {
|
|
89
|
+
Pagination,
|
|
90
|
+
PaginationContent,
|
|
91
|
+
PaginationEllipsis,
|
|
92
|
+
PaginationFirst,
|
|
93
|
+
PaginationItem,
|
|
94
|
+
PaginationLast,
|
|
95
|
+
PaginationNext,
|
|
96
|
+
PaginationPrevious,
|
|
97
|
+
Button,
|
|
98
|
+
Select,
|
|
99
|
+
SelectTrigger,
|
|
100
|
+
SelectValue,
|
|
101
|
+
SelectContent,
|
|
102
|
+
SelectItem,
|
|
103
|
+
},
|
|
104
|
+
setup() {
|
|
105
|
+
const page = ref(args.page || 1);
|
|
106
|
+
|
|
107
|
+
return { args, page };
|
|
108
|
+
},
|
|
109
|
+
template: `
|
|
110
|
+
<Pagination v-bind="args">
|
|
111
|
+
<template #leading="{ page, pageCount }">
|
|
112
|
+
<span style="font:var(--paragraph-sm);color:var(--color-text-sub-600);">Page {{ page }} of {{ pageCount }}</span>
|
|
113
|
+
</template>
|
|
114
|
+
|
|
115
|
+
<template #trailing="{ page }">
|
|
116
|
+
<Select>
|
|
117
|
+
<SelectTrigger size="xs" variant="default">
|
|
118
|
+
<SelectValue placeholder="7 / page" />
|
|
119
|
+
</SelectTrigger>
|
|
120
|
+
<SelectContent>
|
|
121
|
+
<SelectItem value="7">7 / page</SelectItem>
|
|
122
|
+
<SelectItem value="10">10 / page</SelectItem>
|
|
123
|
+
<SelectItem value="20">20 / page</SelectItem>
|
|
124
|
+
<SelectItem value="50">50 / page</SelectItem>
|
|
125
|
+
</SelectContent>
|
|
126
|
+
</Select>
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
<template #default="{ page }">
|
|
130
|
+
<PaginationContent v-slot="{ items }">
|
|
131
|
+
|
|
132
|
+
<PaginationFirst />
|
|
133
|
+
<PaginationPrevious />
|
|
134
|
+
|
|
135
|
+
<template v-for="(item, index) in items" :key="index">
|
|
136
|
+
<PaginationItem
|
|
137
|
+
v-if="item.type === 'page'"
|
|
138
|
+
:value="item.value"
|
|
139
|
+
:is-active="item.value === page"
|
|
140
|
+
>
|
|
141
|
+
{{ item.value }}
|
|
142
|
+
</PaginationItem>
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<PaginationEllipsis :index="4" />
|
|
146
|
+
|
|
147
|
+
<PaginationNext />
|
|
148
|
+
<PaginationLast />
|
|
149
|
+
</PaginationContent>
|
|
150
|
+
</template>
|
|
151
|
+
</Pagination>
|
|
152
|
+
`,
|
|
153
|
+
}),
|
|
154
|
+
};
|
|
@@ -22,47 +22,65 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
22
22
|
|
|
23
23
|
<style lang="scss">
|
|
24
24
|
.celeste-switch {
|
|
25
|
-
--
|
|
26
|
-
--
|
|
25
|
+
--width: 26px;
|
|
26
|
+
--height: 16px;
|
|
27
|
+
--bg-color: var(--color-bg-soft-200);
|
|
27
28
|
--animation-function: cubic-bezier(0.18, 0.89, 0.43, 1.19);
|
|
28
29
|
|
|
29
30
|
position: relative;
|
|
30
|
-
width: var(--
|
|
31
|
-
height: var(--
|
|
31
|
+
width: var(--width);
|
|
32
|
+
height: var(--height);
|
|
32
33
|
transition: background var(--animation-fast) ease-out;
|
|
33
34
|
border: 1px solid transparent;
|
|
34
35
|
border-radius: var(--radius-full);
|
|
35
|
-
background-color: var(--
|
|
36
|
+
background-color: var(--bg-color);
|
|
36
37
|
cursor: pointer;
|
|
37
38
|
|
|
38
39
|
.celeste-switch-thumb {
|
|
39
|
-
--
|
|
40
|
+
--thumb-size: 12px;
|
|
41
|
+
--thumb-hole: 4px;
|
|
40
42
|
|
|
41
43
|
position: absolute;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
width: var(--thumb-size);
|
|
46
|
+
height: var(--thumb-size);
|
|
44
47
|
transform: translateY(-50%);
|
|
45
48
|
transition-property: inset-inline-start, width, height;
|
|
46
49
|
transition-duration: var(--animation-fast);
|
|
47
50
|
transition-timing-function: var(--animation-function), ease-out, ease-out;
|
|
48
|
-
border: calc(var(--switch-thumb-size) / 4) solid var(--color-static-white);
|
|
49
51
|
border-radius: var(--radius-full);
|
|
52
|
+
background-color: var(--color-static-white);
|
|
50
53
|
box-shadow: var(--shadow-toggle-switch);
|
|
51
54
|
inset-block-start: 50%;
|
|
52
55
|
inset-inline-start: 1px;
|
|
56
|
+
will-change: transform;
|
|
53
57
|
|
|
54
58
|
&[data-state='checked'] {
|
|
55
|
-
inset-inline-start: calc(100% -
|
|
59
|
+
inset-inline-start: calc(100% - var(--thumb-size) - 1px);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&::before {
|
|
63
|
+
content: '';
|
|
64
|
+
position: absolute;
|
|
65
|
+
width: var(--thumb-hole);
|
|
66
|
+
height: var(--thumb-hole);
|
|
67
|
+
margin: auto;
|
|
68
|
+
transition: background var(--animation-fast) ease-out;
|
|
69
|
+
border-radius: var(--radius-full);
|
|
70
|
+
background-color: var(--bg-color);
|
|
71
|
+
inset: var(--spacing-0);
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
&[aria-checked='true'] {
|
|
60
|
-
|
|
76
|
+
--bg-color: var(--color-primary-base);
|
|
61
77
|
}
|
|
62
78
|
|
|
63
79
|
&:disabled {
|
|
80
|
+
--bg-color: var(--color-bg-white-0);
|
|
81
|
+
|
|
64
82
|
border-color: var(--color-stroke-soft-200);
|
|
65
|
-
background-color: var(--
|
|
83
|
+
background-color: var(--bg-color);
|
|
66
84
|
pointer-events: none;
|
|
67
85
|
|
|
68
86
|
.celeste-switch-thumb {
|
|
@@ -72,20 +90,20 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
|
72
90
|
box-shadow: none;
|
|
73
91
|
|
|
74
92
|
&[data-state='checked'] {
|
|
75
|
-
inset-inline-start: calc(100% - var(--
|
|
93
|
+
inset-inline-start: calc(100% - var(--thumb-size));
|
|
76
94
|
}
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
|
|
80
98
|
&:active:not(:disabled) .celeste-switch-thumb {
|
|
81
|
-
--
|
|
99
|
+
--thumb-size: 10px;
|
|
82
100
|
}
|
|
83
101
|
|
|
84
102
|
&:hover:not(:active, :disabled) {
|
|
85
|
-
|
|
103
|
+
--bg-color: var(--color-bg-sub-300);
|
|
86
104
|
|
|
87
105
|
&[aria-checked='true'] {
|
|
88
|
-
|
|
106
|
+
--bg-color: var(--color-primary-darker);
|
|
89
107
|
}
|
|
90
108
|
}
|
|
91
109
|
}
|