pxd 0.1.7 → 0.1.8
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/components/_internal/mention-editor.d.vue.ts +23 -14
- package/dist/components/_internal/mention-editor.vue +78 -10
- package/dist/components/_internal/tree-node.d.vue.ts +2 -2
- package/dist/components/_internal/tree-node.vue +1 -1
- package/dist/components/active-graph/index.vue +3 -3
- package/dist/components/approval-card/index.d.vue.ts +11 -1
- package/dist/components/approval-card/index.vue +28 -8
- package/dist/components/approval-card/types.d.ts +5 -6
- package/dist/components/avatar/index.vue +1 -1
- package/dist/components/backtop/index.vue +32 -10
- package/dist/components/badge/index.vue +2 -2
- package/dist/components/book/index.vue +1 -1
- package/dist/components/book/types.d.ts +2 -2
- package/dist/components/breadcrumb-item/index.vue +1 -1
- package/dist/components/browser/index.vue +1 -1
- package/dist/components/bubble/index.vue +6 -6
- package/dist/components/bubble/types.d.ts +1 -1
- package/dist/components/bubble-group/index.d.vue.ts +1 -0
- package/dist/components/bubble-group/index.vue +10 -18
- package/dist/components/button/index.vue +2 -2
- package/dist/components/button/types.d.ts +2 -2
- package/dist/components/button-group/types.d.ts +2 -2
- package/dist/components/calendar/index.vue +4 -4
- package/dist/components/carousel/types.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +2 -2
- package/dist/components/checkerboard/index.vue +1 -1
- package/dist/components/chip/index.vue +1 -1
- package/dist/components/chip/types.d.ts +2 -2
- package/dist/components/choicebox/types.d.ts +2 -2
- package/dist/components/choicebox-item/types.d.ts +2 -2
- package/dist/components/code-block/index.vue +9 -9
- package/dist/components/code-block/types.d.ts +2 -2
- package/dist/components/collapse/index.vue +2 -2
- package/dist/components/collapse/types.d.ts +2 -2
- package/dist/components/collapse-group/index.vue +6 -6
- package/dist/components/command-menu/index.d.vue.ts +1 -1
- package/dist/components/command-menu/index.vue +17 -5
- package/dist/components/command-menu/types.d.ts +8 -1
- package/dist/components/config-provider/index.d.vue.ts +3 -0
- package/dist/components/confirm-popover/index.vue +1 -1
- package/dist/components/confirm-popover/types.d.ts +5 -5
- package/dist/components/context-usage/index.vue +13 -6
- package/dist/components/copy-button/index.d.vue.ts +2 -0
- package/dist/components/copy-button/index.vue +7 -3
- package/dist/components/copy-button/types.d.ts +3 -2
- package/dist/components/countdown/index.d.vue.ts +1 -1
- package/dist/components/countdown/index.vue +1 -1
- package/dist/components/description/types.d.ts +2 -2
- package/dist/components/drawer/index.vue +4 -1
- package/dist/components/drawer/types.d.ts +4 -4
- package/dist/components/effort-slider/index.vue +13 -16
- package/dist/components/ellipsis-text/types.d.ts +3 -3
- package/dist/components/empty-state/index.vue +1 -1
- package/dist/components/empty-state/types.d.ts +2 -2
- package/dist/components/error/index.vue +2 -2
- package/dist/components/error/types.d.ts +2 -2
- package/dist/components/feedback-bar/index.vue +4 -4
- package/dist/components/gauge/index.vue +3 -3
- package/dist/components/hint/index.vue +2 -2
- package/dist/components/hold-button/index.d.vue.ts +2 -4
- package/dist/components/hold-button/index.vue +9 -13
- package/dist/components/hold-button/types.d.ts +2 -4
- package/dist/components/hue-text/types.d.ts +2 -2
- package/dist/components/image-preview/index.vue +6 -6
- package/dist/components/input/index.d.vue.ts +6 -6
- package/dist/components/input/index.vue +5 -5
- package/dist/components/kbd/index.vue +1 -1
- package/dist/components/kbd/types.d.ts +2 -2
- package/dist/components/link-button/types.d.ts +1 -1
- package/dist/components/list/index.d.vue.ts +1 -0
- package/dist/components/list/index.vue +8 -2
- package/dist/components/list/types.d.ts +16 -8
- package/dist/components/list-group/index.vue +1 -7
- package/dist/components/list-group/types.d.ts +1 -1
- package/dist/components/list-item/index.d.vue.ts +2 -2
- package/dist/components/list-item/index.vue +16 -3
- package/dist/components/list-item/types.d.ts +1 -0
- package/dist/components/loading-mask/types.d.ts +1 -1
- package/dist/components/marching-ants/index.vue +2 -2
- package/dist/components/marquee/types.d.ts +2 -2
- package/dist/components/mention/index.d.vue.ts +26 -8
- package/dist/components/mention/index.vue +92 -11
- package/dist/components/mention/types.d.ts +37 -5
- package/dist/components/message/index.d.vue.ts +3 -3
- package/dist/components/message/index.vue +3 -3
- package/dist/components/message-item/index.vue +1 -1
- package/dist/components/modal/index.vue +5 -2
- package/dist/components/modal/types.d.ts +4 -4
- package/dist/components/more-button/types.d.ts +2 -2
- package/dist/components/note/index.vue +3 -3
- package/dist/components/note/types.d.ts +3 -3
- package/dist/components/number-input/index.d.vue.ts +4 -4
- package/dist/components/page-number/index.vue +2 -2
- package/dist/components/pagination/index.vue +2 -2
- package/dist/components/pin-input/index.vue +1 -1
- package/dist/components/popover/index.vue +111 -100
- package/dist/components/popover/types.d.ts +0 -2
- package/dist/components/progress/index.d.vue.ts +1 -1
- package/dist/components/project-banner/index.vue +3 -3
- package/dist/components/project-banner/types.d.ts +2 -2
- package/dist/components/questionnaire/index.d.vue.ts +1 -1
- package/dist/components/questionnaire/index.vue +93 -36
- package/dist/components/questionnaire/types.d.ts +5 -1
- package/dist/components/radio/types.d.ts +2 -2
- package/dist/components/rating/index.d.vue.ts +1 -1
- package/dist/components/rating/index.vue +1 -0
- package/dist/components/rating/types.d.ts +2 -2
- package/dist/components/reasoning/index.vue +4 -4
- package/dist/components/reasoning/types.d.ts +2 -2
- package/dist/components/resizable/index.d.vue.ts +1 -1
- package/dist/components/resizable/index.vue +34 -30
- package/dist/components/reveal/index.vue +2 -2
- package/dist/components/rolling-number/index.d.vue.ts +1 -1
- package/dist/components/rolling-number/index.vue +6 -6
- package/dist/components/rolling-number/types.d.ts +1 -1
- package/dist/components/scroll-text/index.vue +3 -2
- package/dist/components/scroll-text/types.d.ts +2 -2
- package/dist/components/scrollable/index.vue +1 -6
- package/dist/components/scrollable/types.d.ts +0 -2
- package/dist/components/search-input/index.d.vue.ts +14 -14
- package/dist/components/search-input/index.vue +2 -2
- package/dist/components/select/index.vue +16 -6
- package/dist/components/select/types.d.ts +9 -1
- package/dist/components/shimmer-text/index.d.vue.ts +1 -1
- package/dist/components/shimmer-text/index.vue +2 -2
- package/dist/components/shimmer-text/types.d.ts +4 -2
- package/dist/components/slider/index.d.vue.ts +1 -1
- package/dist/components/slider/index.vue +34 -2
- package/dist/components/snippet/index.d.vue.ts +2 -0
- package/dist/components/snippet/index.vue +6 -2
- package/dist/components/snippet/types.d.ts +3 -2
- package/dist/components/split-button/index.d.vue.ts +9 -7
- package/dist/components/split-button/index.vue +21 -6
- package/dist/components/split-button/types.d.ts +3 -1
- package/dist/components/status-dot/types.d.ts +2 -2
- package/dist/components/steps/types.d.ts +3 -3
- package/dist/components/stick-to-bottom/index.vue +9 -12
- package/dist/components/stick-to-bottom/types.d.ts +0 -2
- package/dist/components/switch/index.vue +1 -1
- package/dist/components/switch-item/types.d.ts +2 -2
- package/dist/components/tabs/index.vue +3 -3
- package/dist/components/teleport/index.vue +6 -3
- package/dist/components/text/index.vue +1 -1
- package/dist/components/text/types.d.ts +1 -1
- package/dist/components/textarea/index.d.vue.ts +6 -6
- package/dist/components/textarea/index.vue +1 -1
- package/dist/components/textarea/types.d.ts +2 -2
- package/dist/components/time-picker/index.vue +4 -4
- package/dist/components/toc/index.vue +7 -2
- package/dist/components/toc/types.d.ts +1 -0
- package/dist/components/todo-list/index.d.vue.ts +1 -1
- package/dist/components/todo-list/index.vue +138 -103
- package/dist/components/todo-list/types.d.ts +7 -5
- package/dist/components/toggle/index.vue +1 -1
- package/dist/components/toggle-button/index.vue +11 -9
- package/dist/components/toggle-button/types.d.ts +3 -3
- package/dist/components/toggle-button-group/index.vue +2 -1
- package/dist/components/toggle-button-group/types.d.ts +2 -2
- package/dist/components/tool-call/index.vue +31 -35
- package/dist/components/tool-call/types.d.ts +2 -2
- package/dist/components/tour/index.d.vue.ts +1 -1
- package/dist/components/tour/index.vue +1 -1
- package/dist/components/tour/types.d.ts +4 -4
- package/dist/components/tree/index.vue +5 -4
- package/dist/components/tree/types.d.ts +4 -5
- package/dist/components/virtual-list/types.d.ts +3 -3
- package/dist/composables/_internal/use-details-collapse.js +28 -3
- package/dist/composables/_internal/use-list-search.d.ts +15 -0
- package/dist/composables/_internal/use-list-search.js +50 -0
- package/dist/composables/_internal/use-mention-editor.d.ts +10 -5
- package/dist/composables/_internal/use-mention-editor.js +180 -140
- package/dist/composables/_internal/use-mention-suggest.d.ts +10 -8
- package/dist/composables/_internal/use-mention-suggest.js +39 -25
- package/dist/composables/_internal/use-message-group.js +6 -6
- package/dist/composables/_internal/use-popover-responsive.d.ts +1 -1
- package/dist/composables/_internal/use-popover-responsive.js +1 -1
- package/dist/composables/_internal/use-remote-search.d.ts +17 -0
- package/dist/composables/_internal/use-remote-search.js +58 -0
- package/dist/composables/_internal/use-tree.d.ts +2 -2
- package/dist/composables/_internal/use-tree.js +7 -52
- package/dist/composables/_internal/use-word-limit.d.ts +2 -2
- package/dist/composables/use-backoff-retry.d.ts +2 -35
- package/dist/composables/use-backoff-retry.js +5 -98
- package/dist/composables/use-copy-click.js +14 -13
- package/dist/composables/use-countdown.d.ts +1 -1
- package/dist/composables/use-countdown.js +4 -4
- package/dist/composables/use-delay-destroy.js +8 -6
- package/dist/composables/use-message.d.ts +1 -1
- package/dist/composables/use-message.js +1 -1
- package/dist/composables/use-repeat-action.d.ts +1 -1
- package/dist/composables/use-repeat-action.js +3 -3
- package/dist/composables/use-stick-to-bottom.d.ts +4 -21
- package/dist/composables/use-stick-to-bottom.js +138 -24
- package/dist/composables/use-view-transition.d.ts +23 -9
- package/dist/constants/tooltip-variants.d.ts +1 -1
- package/dist/constants/tooltip-variants.js +1 -1
- package/dist/locales/en-us.d.ts +3 -0
- package/dist/locales/en-us.js +4 -1
- package/dist/locales/zh-cn.d.ts +3 -0
- package/dist/locales/zh-cn.js +4 -1
- package/dist/styles/styles.css +1 -1
- package/dist/styles/tw.css +5 -14
- package/dist/types/shared/props.d.ts +5 -2
- package/dist/utils/_internal/mention-html.d.ts +1 -0
- package/dist/utils/_internal/mention-html.js +6 -4
- package/dist/utils/_internal/observer.js +3 -3
- package/dist/utils/backoff-retry.d.ts +15 -0
- package/dist/utils/backoff-retry.js +94 -0
- package/dist/utils/mention-html.d.ts +14 -0
- package/dist/utils/mention-html.js +71 -0
- package/package.json +2 -9
- package/dist/composables/_internal/use-list-filter.d.ts +0 -15
- package/dist/composables/_internal/use-list-filter.js +0 -48
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, onMounted, shallowRef } from "vue";
|
|
3
3
|
import { useVirtualList } from "../../composables/use-virtual-list.js";
|
|
4
4
|
import PBacktop from "../backtop/index.vue";
|
|
5
5
|
import PStickToBottom from "../stick-to-bottom/index.vue";
|
|
@@ -50,26 +50,18 @@ const contentStyle = computed(() => {
|
|
|
50
50
|
if (!isVirtual.value) {
|
|
51
51
|
return undefined;
|
|
52
52
|
}
|
|
53
|
-
return {
|
|
54
|
-
height: `${totalSize.value}px`,
|
|
55
|
-
containIntrinsicSize: `auto ${totalSize.value}px`
|
|
56
|
-
};
|
|
53
|
+
return { "--bubble-group-height": `${totalSize.value}px` };
|
|
57
54
|
});
|
|
58
55
|
function getDataItemKey(item, index) {
|
|
59
56
|
return (props.dataKey ? item[props.dataKey] : index) ?? index;
|
|
60
57
|
}
|
|
61
|
-
watch(() => props.data?.length, (newLen, oldLen) => {
|
|
62
|
-
if (!props.data || !newLen || !oldLen || newLen <= oldLen) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
void nextTick(() => {
|
|
66
|
-
stickRef.value?.stickIfNeeded();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
58
|
onMounted(() => {
|
|
70
59
|
stickRef.value?.forceStickToBottom();
|
|
71
60
|
});
|
|
72
|
-
defineExpose({
|
|
61
|
+
defineExpose({
|
|
62
|
+
scrollSource,
|
|
63
|
+
forceStickToBottom: () => stickRef.value?.forceStickToBottom()
|
|
64
|
+
});
|
|
73
65
|
</script>
|
|
74
66
|
|
|
75
67
|
<template>
|
|
@@ -78,8 +70,8 @@ defineExpose({ scrollSource });
|
|
|
78
70
|
data-bubble-group
|
|
79
71
|
class="pxd-bubble-group relative overflow-x-hidden"
|
|
80
72
|
:threshold="8"
|
|
81
|
-
content-class="pxd-bubble-group--content relative w-full
|
|
82
|
-
:
|
|
73
|
+
content-class="pxd-bubble-group--content relative w-full h-(--bubble-group-height)"
|
|
74
|
+
:style="contentStyle"
|
|
83
75
|
v-bind="$attrs"
|
|
84
76
|
>
|
|
85
77
|
<template v-if="data && virtual">
|
|
@@ -88,7 +80,7 @@ defineExpose({ scrollSource });
|
|
|
88
80
|
:key="virtualItem.key"
|
|
89
81
|
:ref="(el) => measureElement(el)"
|
|
90
82
|
:data-index="virtualItem.index"
|
|
91
|
-
class="pxd-bubble-group--item sibling:pbs-
|
|
83
|
+
class="pxd-bubble-group--item sibling:pbs-3 left-0 top-0 absolute w-full"
|
|
92
84
|
:style="{ transform: `translateY(${virtualItem.start}px)` }"
|
|
93
85
|
>
|
|
94
86
|
<slot name="item" :item="data[virtualItem.index]" :index="virtualItem.index" />
|
|
@@ -99,7 +91,7 @@ defineExpose({ scrollSource });
|
|
|
99
91
|
<div
|
|
100
92
|
v-for="(item, index) in data"
|
|
101
93
|
:key="getDataItemKey(item, index)"
|
|
102
|
-
class="pxd-bubble-group--item sibling:pbs-
|
|
94
|
+
class="pxd-bubble-group--item sibling:pbs-3 w-full"
|
|
103
95
|
>
|
|
104
96
|
<slot name="item" :item="item" :index="index" />
|
|
105
97
|
</div>
|
|
@@ -74,9 +74,9 @@ const { attrs, classes } = useTailwindVariant({
|
|
|
74
74
|
base: "pxd-button inline-flex shrink-0 cursor-pointer touch-manipulation items-center font-inherit select-none focus-visible:z-1 motion-safe:transition-appearance within-group:not-first:rounded-l-none within-group:not-first:border-l-0 within-group:not-last:rounded-r-none",
|
|
75
75
|
variants: {
|
|
76
76
|
size: {
|
|
77
|
-
xxs: `${BASIC_HEIGHTS.xxs} px-1 rounded-sm text-[
|
|
77
|
+
xxs: `${BASIC_HEIGHTS.xxs} px-1 rounded-sm text-[0.6875rem]`,
|
|
78
78
|
xs: `${BASIC_HEIGHTS.xs} px-1 text-xs rounded-sm`,
|
|
79
|
-
sm: `${BASIC_HEIGHTS.sm} px-2
|
|
79
|
+
sm: `${BASIC_HEIGHTS.sm} px-2 rounded-md text-[0.8125rem]`,
|
|
80
80
|
md: `${BASIC_HEIGHTS.md} px-3 text-sm rounded-md`,
|
|
81
81
|
lg: `${BASIC_HEIGHTS.lg} px-4 text-base rounded-lg`
|
|
82
82
|
},
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
ComponentAs,
|
|
3
3
|
ComponentAlign,
|
|
4
4
|
ComponentShape,
|
|
5
|
-
|
|
5
|
+
ComponentSizeWithXxs,
|
|
6
6
|
ComponentVariantWithDefault,
|
|
7
7
|
} from '../../types/shared/props'
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ export type ButtonVariant = ComponentVariantWithDefault | 'ghost' | 'simple' | '
|
|
|
11
11
|
export interface ButtonProps {
|
|
12
12
|
as?: ComponentAs
|
|
13
13
|
variant?: ButtonVariant
|
|
14
|
-
size?:
|
|
14
|
+
size?: ComponentSizeWithXxs
|
|
15
15
|
shape?: ComponentShape
|
|
16
16
|
align?: ComponentAlign
|
|
17
17
|
icon?: boolean
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentSizeWithXxs, ComponentAlign } from '../../types/shared/props'
|
|
2
2
|
import type { ButtonVariant } from '../button/types'
|
|
3
3
|
|
|
4
4
|
export interface ButtonGroupProps {
|
|
5
|
-
size?:
|
|
5
|
+
size?: ComponentSizeWithXxs
|
|
6
6
|
align?: ComponentAlign
|
|
7
7
|
variant?: ButtonVariant
|
|
8
8
|
disabled?: boolean
|
|
@@ -164,7 +164,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
164
164
|
aria-label="Previous year"
|
|
165
165
|
@click="changeYear(-1)"
|
|
166
166
|
>
|
|
167
|
-
<ChevronDoubleLeftIcon class="size-
|
|
167
|
+
<ChevronDoubleLeftIcon class="size-em" aria-hidden="true" />
|
|
168
168
|
</PButton>
|
|
169
169
|
<PButton
|
|
170
170
|
icon
|
|
@@ -174,7 +174,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
174
174
|
aria-label="Previous month"
|
|
175
175
|
@click="changeMonth(-1)"
|
|
176
176
|
>
|
|
177
|
-
<ChevronRightIcon class="size-
|
|
177
|
+
<ChevronRightIcon class="size-em rotate-180" aria-hidden="true" />
|
|
178
178
|
</PButton>
|
|
179
179
|
|
|
180
180
|
<PButton size="xs" class="px-0" @click="selectToday">
|
|
@@ -189,7 +189,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
189
189
|
aria-label="Next month"
|
|
190
190
|
@click="changeMonth(1)"
|
|
191
191
|
>
|
|
192
|
-
<ChevronRightIcon class="size-
|
|
192
|
+
<ChevronRightIcon class="size-em" aria-hidden="true" />
|
|
193
193
|
</PButton>
|
|
194
194
|
<PButton
|
|
195
195
|
icon
|
|
@@ -199,7 +199,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
199
199
|
aria-label="Next year"
|
|
200
200
|
@click="changeYear(1)"
|
|
201
201
|
>
|
|
202
|
-
<ChevronDoubleRightIcon class="size-
|
|
202
|
+
<ChevronDoubleRightIcon class="size-em" aria-hidden="true" />
|
|
203
203
|
</PButton>
|
|
204
204
|
</div>
|
|
205
205
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
BasePosition,
|
|
3
3
|
ComponentDirection,
|
|
4
|
-
|
|
4
|
+
ComponentText,
|
|
5
5
|
ComponentValue,
|
|
6
6
|
} from '../../types/shared/props'
|
|
7
7
|
|
|
8
8
|
export interface CarouselOption {
|
|
9
9
|
/** Rendered as the slide content when no `item` slot is provided. */
|
|
10
|
-
label?:
|
|
10
|
+
label?: ComponentText
|
|
11
11
|
/** Used as the vnode key; falls back to the slide index. */
|
|
12
12
|
value?: ComponentValue
|
|
13
13
|
[key: string]: any
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentText, ComponentValue, ComponentShape } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
type CheckboxModelValue = ComponentValue | boolean
|
|
4
4
|
|
|
5
5
|
export interface CheckboxProps {
|
|
6
|
-
label?:
|
|
6
|
+
label?: ComponentText
|
|
7
7
|
value?: CheckboxModelValue
|
|
8
8
|
shape?: ComponentShape
|
|
9
9
|
disabled?: boolean
|
|
@@ -44,5 +44,5 @@ const computedStyle = computed(() => ({
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<style>
|
|
47
|
-
.pxd-checkerboard{--checkerboard-size:
|
|
47
|
+
.pxd-checkerboard{--checkerboard-size:1.25rem;--checkerboard-primary-color:var(--color-gray-200);--checkerboard-background-color:var(--color-background-100);background-image:repeating-conic-gradient(var(--checkerboard-background-color) 0,var(--checkerboard-background-color) 25%,var(--checkerboard-primary-color) 25%,var(--checkerboard-primary-color) 50%);background-size:var(--checkerboard-size) var(--checkerboard-size)}.pxd-checkerboard[data-variant=dots],.pxd-checkerboard[data-variant=grid]{background-color:var(--checkerboard-background-color)}.pxd-checkerboard[data-variant=grid]{background-image:linear-gradient(to right,transparent calc(100% - 1px),var(--checkerboard-primary-color) calc(100% - 1px)),linear-gradient(to bottom,transparent calc(100% - 1px),var(--checkerboard-primary-color) calc(100% - 1px));background-position:calc(var(--checkerboard-size)/2) calc(var(--checkerboard-size)/2)}.pxd-checkerboard[data-variant=dots]{background-image:radial-gradient(var(--checkerboard-primary-color) 1px,transparent 1px);background-position:0 0}
|
|
48
48
|
</style>
|
|
@@ -62,5 +62,5 @@ const { classes } = useTailwindVariant({
|
|
|
62
62
|
</template>
|
|
63
63
|
|
|
64
64
|
<style>
|
|
65
|
-
.pxd-chip--label:after{content:attr(data-label);display:block;padding-inline
|
|
65
|
+
.pxd-chip--label:after{content:attr(data-label);display:block;padding-inline:.125rem;transform:scale(.875)}
|
|
66
66
|
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentText, ComponentVariant } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
export interface ChipProps {
|
|
4
4
|
size?: number | string
|
|
5
5
|
inset?: boolean
|
|
6
|
-
label?:
|
|
6
|
+
label?: ComponentText
|
|
7
7
|
variant?: ComponentVariant | 'secondary'
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
2
|
+
ComponentText,
|
|
3
3
|
ComponentValue,
|
|
4
4
|
ComponentOption,
|
|
5
5
|
ResponsiveValue,
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
|
|
8
8
|
export interface ChoiceboxProps {
|
|
9
9
|
gap?: ResponsiveValue<number | string>
|
|
10
|
-
label?:
|
|
10
|
+
label?: ComponentText
|
|
11
11
|
multiple?: boolean
|
|
12
12
|
disabled?: boolean
|
|
13
13
|
options?: ComponentOption[]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentText, ComponentValue } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
export interface ChoiceboxItemProps {
|
|
4
|
-
label?:
|
|
4
|
+
label?: ComponentText
|
|
5
5
|
value: ComponentValue
|
|
6
6
|
disabled?: boolean
|
|
7
7
|
description?: string
|
|
@@ -105,11 +105,11 @@ const { scheduleHighlight } = useCodeHighlight();
|
|
|
105
105
|
const slots = useSlots();
|
|
106
106
|
const hasHeader = computed(() => !!(props.title || props.switcher || slots.header || slots.actions));
|
|
107
107
|
const { attrs, classes } = useTailwindVariant({
|
|
108
|
-
base: "pxd-code-block relative flex flex-col text-gray-1000",
|
|
108
|
+
base: "pxd-code-block min-w-0 relative flex max-w-full flex-col text-gray-1000",
|
|
109
109
|
variants: { size: {
|
|
110
|
-
sm: "text-[
|
|
111
|
-
md: "text-[
|
|
112
|
-
lg: "text-[
|
|
110
|
+
sm: "text-[0.8125rem]",
|
|
111
|
+
md: "text-[0.8125rem]",
|
|
112
|
+
lg: "text-[0.9375rem]"
|
|
113
113
|
} }
|
|
114
114
|
}, { selection: () => ({ size: props.size || configProvider.size }) });
|
|
115
115
|
/** FNV-1a over the code: line anchors must stay stable across reloads to be shareable. */
|
|
@@ -234,7 +234,7 @@ onUnmounted(() => {
|
|
|
234
234
|
role="tab"
|
|
235
235
|
:tabindex="option.value === activeTabValue ? 0 : -1"
|
|
236
236
|
:aria-selected="option.value === activeTabValue"
|
|
237
|
-
class="h-8 px-3 font-medium cursor-pointer rounded-md text-[
|
|
237
|
+
class="h-8 px-3 font-medium cursor-pointer rounded-md text-[0.8125rem] text-gray-900 not-aria-selected:hover:text-gray-1000 aria-selected:bg-gray-200 aria-selected:text-gray-1000 motion-safe:transition-colors"
|
|
238
238
|
@click="onTabSelect(option.value)"
|
|
239
239
|
>
|
|
240
240
|
{{ option.label || option.value }}
|
|
@@ -247,8 +247,8 @@ onUnmounted(() => {
|
|
|
247
247
|
class="pxd-code-block--header gap-2 ps-3 pe-0.75 h-9 flex items-center rounded-t-lg border bg-background-200"
|
|
248
248
|
>
|
|
249
249
|
<slot name="header">
|
|
250
|
-
<FileIcon class="size-
|
|
251
|
-
<span class="min-w-0 truncate text-[
|
|
250
|
+
<FileIcon class="size-em shrink-0 text-gray-900" aria-hidden="true" />
|
|
251
|
+
<span class="min-w-0 truncate text-[0.8125rem] text-gray-900">{{ title }}</span>
|
|
252
252
|
</slot>
|
|
253
253
|
|
|
254
254
|
<div class="gap-1 min-w-0 ms-auto flex items-center">
|
|
@@ -257,7 +257,7 @@ onUnmounted(() => {
|
|
|
257
257
|
<div v-if="switcher" class="h-7 group/select relative shrink-0">
|
|
258
258
|
<div
|
|
259
259
|
aria-hidden="true"
|
|
260
|
-
class="px-2 gap-1 flex h-full cursor-pointer items-center rounded-md bg-background-200 text-[
|
|
260
|
+
class="px-2 gap-1 flex h-full cursor-pointer items-center rounded-md bg-background-200 text-[0.8125rem] whitespace-nowrap text-gray-900 group-hover/select:bg-gray-200 has-focus-visible:self-focus-ring motion-safe:transition-colors"
|
|
261
261
|
>
|
|
262
262
|
<span class="truncate">{{ activeSwitcherLabel }}</span>
|
|
263
263
|
<ChevronDownIcon class="size-3 shrink-0" />
|
|
@@ -358,5 +358,5 @@ onUnmounted(() => {
|
|
|
358
358
|
</template>
|
|
359
359
|
|
|
360
360
|
<style>
|
|
361
|
-
.pxd-code-block{--syntax-comment:hsl(var(--color-gray-700-value));--syntax-keyword:hsl(var(--color-purple-900-value));--syntax-operator:hsl(var(--color-gray-800-value));--syntax-string:hsl(var(--color-green-900-value));--syntax-constant:hsl(var(--color-blue-900-value));--syntax-function:hsl(var(--color-teal-900-value));--syntax-type:hsl(var(--color-blue-900-value));--syntax-variable:hsl(var(--color-amber-900-value));--syntax-property:hsl(var(--color-gray-1000-value));--syntax-tag:hsl(var(--color-red-900-value));--syntax-selector:hsl(var(--color-green-900-value));--syntax-inserted:hsl(var(--color-green-900-value));--syntax-deleted:hsl(var(--color-red-900-value))}.pxd-code-block code::highlight(comment),.pxd-code-block code::highlight(quote){color:var(--syntax-comment)}.pxd-code-block code::highlight(at-rule),.pxd-code-block code::highlight(doctype),.pxd-code-block code::highlight(important),.pxd-code-block code::highlight(keyword),.pxd-code-block code::highlight(section),.pxd-code-block code::highlight(storage){color:var(--syntax-keyword)}.pxd-code-block code::highlight(operator),.pxd-code-block code::highlight(punctuation){color:var(--syntax-operator)}.pxd-code-block code::highlight(attribute-value),.pxd-code-block code::highlight(link),.pxd-code-block code::highlight(raw),.pxd-code-block code::highlight(regexp),.pxd-code-block code::highlight(string){color:var(--syntax-string)}.pxd-code-block code::highlight(anchor),.pxd-code-block code::highlight(boolean),.pxd-code-block code::highlight(character-entity),.pxd-code-block code::highlight(constant),.pxd-code-block code::highlight(entity),.pxd-code-block code::highlight(numeric),.pxd-code-block code::highlight(symbol){color:var(--syntax-constant)}.pxd-code-block code::highlight(animation),.pxd-code-block code::highlight(decorator),.pxd-code-block code::highlight(function){color:var(--syntax-function)}.pxd-code-block code::highlight(support),.pxd-code-block code::highlight(type){color:var(--syntax-type)}.pxd-code-block code::highlight(interpolation),.pxd-code-block code::highlight(variable){color:var(--syntax-variable)}.pxd-code-block code::highlight(attribute-name),.pxd-code-block code::highlight(key),.pxd-code-block code::highlight(property){color:var(--syntax-property)}.pxd-code-block code::highlight(tag){color:var(--syntax-tag)}.pxd-code-block code::highlight(selector){color:var(--syntax-selector)}.pxd-code-block code::highlight(inserted){color:var(--syntax-inserted)}.pxd-code-block code::highlight(deleted){color:var(--syntax-deleted)}.pxd-code-block--fade{-webkit-mask-image:linear-gradient(0deg,#000,transparent);mask-image:linear-gradient(0deg,#000,transparent)}.pxd-code-block--line[data-added=true]:after,.pxd-code-block--line[data-removed=true]:after{font-weight:500;inset:0;padding-left
|
|
361
|
+
.pxd-code-block{--syntax-comment:hsl(var(--color-gray-700-value));--syntax-keyword:hsl(var(--color-purple-900-value));--syntax-operator:hsl(var(--color-gray-800-value));--syntax-string:hsl(var(--color-green-900-value));--syntax-constant:hsl(var(--color-blue-900-value));--syntax-function:hsl(var(--color-teal-900-value));--syntax-type:hsl(var(--color-blue-900-value));--syntax-variable:hsl(var(--color-amber-900-value));--syntax-property:hsl(var(--color-gray-1000-value));--syntax-tag:hsl(var(--color-red-900-value));--syntax-selector:hsl(var(--color-green-900-value));--syntax-inserted:hsl(var(--color-green-900-value));--syntax-deleted:hsl(var(--color-red-900-value))}.pxd-code-block code::highlight(comment),.pxd-code-block code::highlight(quote){color:var(--syntax-comment)}.pxd-code-block code::highlight(at-rule),.pxd-code-block code::highlight(doctype),.pxd-code-block code::highlight(important),.pxd-code-block code::highlight(keyword),.pxd-code-block code::highlight(section),.pxd-code-block code::highlight(storage){color:var(--syntax-keyword)}.pxd-code-block code::highlight(operator),.pxd-code-block code::highlight(punctuation){color:var(--syntax-operator)}.pxd-code-block code::highlight(attribute-value),.pxd-code-block code::highlight(link),.pxd-code-block code::highlight(raw),.pxd-code-block code::highlight(regexp),.pxd-code-block code::highlight(string){color:var(--syntax-string)}.pxd-code-block code::highlight(anchor),.pxd-code-block code::highlight(boolean),.pxd-code-block code::highlight(character-entity),.pxd-code-block code::highlight(constant),.pxd-code-block code::highlight(entity),.pxd-code-block code::highlight(numeric),.pxd-code-block code::highlight(symbol){color:var(--syntax-constant)}.pxd-code-block code::highlight(animation),.pxd-code-block code::highlight(decorator),.pxd-code-block code::highlight(function){color:var(--syntax-function)}.pxd-code-block code::highlight(support),.pxd-code-block code::highlight(type){color:var(--syntax-type)}.pxd-code-block code::highlight(interpolation),.pxd-code-block code::highlight(variable){color:var(--syntax-variable)}.pxd-code-block code::highlight(attribute-name),.pxd-code-block code::highlight(key),.pxd-code-block code::highlight(property){color:var(--syntax-property)}.pxd-code-block code::highlight(tag){color:var(--syntax-tag)}.pxd-code-block code::highlight(selector){color:var(--syntax-selector)}.pxd-code-block code::highlight(inserted){color:var(--syntax-inserted)}.pxd-code-block code::highlight(deleted){color:var(--syntax-deleted)}.pxd-code-block--fade{-webkit-mask-image:linear-gradient(0deg,#000,transparent);mask-image:linear-gradient(0deg,#000,transparent)}.pxd-code-block--line[data-added=true]:after,.pxd-code-block--line[data-removed=true]:after{font-weight:500;inset:0;padding-left:.5rem;pointer-events:none;position:absolute}.pxd-code-block--line[data-added=true]:after{color:var(--color-green-900);content:"+"}.pxd-code-block--line[data-removed=true]:after{color:var(--color-red-900);content:"-"}@media (max-width:600px){.pxd-code-block--line-number{display:none}}
|
|
362
362
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentText } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
export interface CodeBlockSwitcherOption {
|
|
4
4
|
label?: string
|
|
@@ -13,7 +13,7 @@ export interface CodeBlockSwitcherProps {
|
|
|
13
13
|
export interface CodeBlockProps {
|
|
14
14
|
code: string
|
|
15
15
|
language?: string
|
|
16
|
-
title?:
|
|
16
|
+
title?: ComponentText
|
|
17
17
|
size?: 'sm' | 'md' | 'lg'
|
|
18
18
|
lineNumbers?: boolean
|
|
19
19
|
highlightedLines?: number[]
|
|
@@ -70,7 +70,7 @@ onBeforeUnmount(() => {
|
|
|
70
70
|
</h3>
|
|
71
71
|
|
|
72
72
|
<ChevronRightIcon
|
|
73
|
-
class="size-
|
|
73
|
+
class="size-em shrink-0 motion-safe:transition-transform"
|
|
74
74
|
:class="{ 'rotate-90': isOpen }"
|
|
75
75
|
/>
|
|
76
76
|
</summary>
|
|
@@ -88,5 +88,5 @@ onBeforeUnmount(() => {
|
|
|
88
88
|
</template>
|
|
89
89
|
|
|
90
90
|
<style>
|
|
91
|
-
.pxd-collapse--trigger{font-size:var(--collapse-font-size,
|
|
91
|
+
.pxd-collapse--trigger{font-size:var(--collapse-font-size,1.5rem);font-weight:var(--collapse-font-weight,600);padding-block:var(--collapse-padding,1.5rem)}
|
|
92
92
|
</style>
|
|
@@ -19,18 +19,18 @@ const props = defineProps({
|
|
|
19
19
|
});
|
|
20
20
|
const SIZES = {
|
|
21
21
|
sm: {
|
|
22
|
-
padding: "
|
|
23
|
-
fontSize: "
|
|
22
|
+
padding: "0.75rem",
|
|
23
|
+
fontSize: "1rem",
|
|
24
24
|
fontWeight: "500"
|
|
25
25
|
},
|
|
26
26
|
md: {
|
|
27
|
-
padding: "
|
|
28
|
-
fontSize: "
|
|
27
|
+
padding: "1.5rem",
|
|
28
|
+
fontSize: "1.5rem",
|
|
29
29
|
fontWeight: "600"
|
|
30
30
|
},
|
|
31
31
|
lg: {
|
|
32
|
-
padding: "
|
|
33
|
-
fontSize: "
|
|
32
|
+
padding: "1.875rem",
|
|
33
|
+
fontSize: "1.75rem",
|
|
34
34
|
fontWeight: "600"
|
|
35
35
|
}
|
|
36
36
|
};
|
|
@@ -23,8 +23,8 @@ declare const __VLS_base: import("vue").DefineComponent<CommandMenuProps, {}, {}
|
|
|
23
23
|
}>, {
|
|
24
24
|
width: string | number;
|
|
25
25
|
modelValue: boolean;
|
|
26
|
-
closeOnPressEscape: boolean;
|
|
27
26
|
placeholder: string;
|
|
27
|
+
closeOnPressEscape: boolean;
|
|
28
28
|
closeOnClickOverlay: boolean;
|
|
29
29
|
closeOnSelectItem: boolean;
|
|
30
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { nextTick, shallowRef, watch } from "vue";
|
|
3
|
-
import { useListFilter } from "../../composables/_internal/use-list-filter.js";
|
|
4
3
|
import { useListKeyboardController } from "../../composables/_internal/use-list-keyboard-controller.js";
|
|
4
|
+
import { useListSearch } from "../../composables/_internal/use-list-search.js";
|
|
5
5
|
import { useModelValue } from "../../composables/_internal/use-model-value.js";
|
|
6
6
|
import { PRESET_MEDIA_QUERIES, useMediaQuery } from "../../composables/use-media-query.js";
|
|
7
7
|
import { useConfigProvider } from "../../contexts/config-provider.js";
|
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
width: {
|
|
21
21
|
type: [String, Number],
|
|
22
22
|
required: false,
|
|
23
|
-
default: "
|
|
23
|
+
default: "40rem"
|
|
24
24
|
},
|
|
25
25
|
virtual: {
|
|
26
26
|
type: Boolean,
|
|
@@ -54,6 +54,14 @@ const props = defineProps({
|
|
|
54
54
|
type: Boolean,
|
|
55
55
|
required: false,
|
|
56
56
|
default: true
|
|
57
|
+
},
|
|
58
|
+
filterMethod: {
|
|
59
|
+
type: Function,
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
remoteFilter: {
|
|
63
|
+
type: Function,
|
|
64
|
+
required: false
|
|
57
65
|
}
|
|
58
66
|
});
|
|
59
67
|
const emits = defineEmits([
|
|
@@ -68,7 +76,10 @@ const listRef = shallowRef();
|
|
|
68
76
|
const configProvider = useConfigProvider();
|
|
69
77
|
const modelValue = useModelValue(props, emits);
|
|
70
78
|
const isSmallScreen = useMediaQuery(PRESET_MEDIA_QUERIES.IS_XS);
|
|
71
|
-
const {
|
|
79
|
+
const { listOptions, pending } = useListSearch(() => props.options ?? [], filterKeyword, {
|
|
80
|
+
filterMethod: () => props.filterMethod,
|
|
81
|
+
remoteFilter: () => props.remoteFilter
|
|
82
|
+
});
|
|
72
83
|
const { onKeydown: onListKeydown } = useListKeyboardController({
|
|
73
84
|
enabled: () => modelValue.value,
|
|
74
85
|
onCommand: (command) => listRef.value?.dispatch(command) ?? false,
|
|
@@ -105,7 +116,7 @@ function onInputKeyword(event) {
|
|
|
105
116
|
const input = event.target;
|
|
106
117
|
filterKeyword.value = input.value.replaceAll("'", "");
|
|
107
118
|
}
|
|
108
|
-
watch(
|
|
119
|
+
watch(listOptions, async () => {
|
|
109
120
|
await nextTick();
|
|
110
121
|
listRef.value?.setFirstAsActive();
|
|
111
122
|
});
|
|
@@ -164,7 +175,8 @@ watch(filteredOptions, async () => {
|
|
|
164
175
|
<PList
|
|
165
176
|
ref="listRef"
|
|
166
177
|
:virtual="virtual"
|
|
167
|
-
:options="
|
|
178
|
+
:options="listOptions"
|
|
179
|
+
:loading="pending"
|
|
168
180
|
:default-active-index="0"
|
|
169
181
|
class="sm:max-h-110 h-full"
|
|
170
182
|
@change="onListItemSelect"
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ListFilterMethodFn,
|
|
3
|
+
ListOptions,
|
|
4
|
+
ListOptionSelected,
|
|
5
|
+
ListRemoteFilterFn,
|
|
6
|
+
} from '../list/types'
|
|
2
7
|
|
|
3
8
|
export interface CommandMenuProps {
|
|
4
9
|
width?: string | number
|
|
@@ -9,6 +14,8 @@ export interface CommandMenuProps {
|
|
|
9
14
|
closeOnSelectItem?: boolean
|
|
10
15
|
closeOnPressEscape?: boolean
|
|
11
16
|
closeOnClickOverlay?: boolean
|
|
17
|
+
filterMethod?: ListFilterMethodFn
|
|
18
|
+
remoteFilter?: ListRemoteFilterFn
|
|
12
19
|
}
|
|
13
20
|
|
|
14
21
|
export interface CommandMenuEmits {
|
|
@@ -66,6 +66,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
66
66
|
skipAll: string;
|
|
67
67
|
prev: string;
|
|
68
68
|
next: string;
|
|
69
|
+
expand: string;
|
|
70
|
+
collapse: string;
|
|
69
71
|
};
|
|
70
72
|
tour: {
|
|
71
73
|
next: string;
|
|
@@ -99,6 +101,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
99
101
|
approve: string;
|
|
100
102
|
reject: string;
|
|
101
103
|
remember: string;
|
|
104
|
+
reason: string;
|
|
102
105
|
pending: string;
|
|
103
106
|
approved: string;
|
|
104
107
|
rejected: string;
|
|
@@ -176,7 +176,7 @@ watch(() => props.modelValue, (value) => {
|
|
|
176
176
|
{{ title }}
|
|
177
177
|
</h3>
|
|
178
178
|
|
|
179
|
-
<p v-if="description" class="m-0 text-[
|
|
179
|
+
<p v-if="description" class="m-0 text-[0.8125rem] text-foreground-secondary">
|
|
180
180
|
{{ description }}
|
|
181
181
|
</p>
|
|
182
182
|
</slot>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPosition,
|
|
1
|
+
import type { ComponentPosition, ComponentText } from '../../types/shared/props'
|
|
2
2
|
import type { Awaitable } from '../../types/shared/utils'
|
|
3
3
|
import type { ButtonVariant } from '../button/types'
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ export type ConfirmBeforeConfirm = () => Awaitable<boolean | void>
|
|
|
6
6
|
|
|
7
7
|
export interface ConfirmPopoverProps {
|
|
8
8
|
modelValue?: boolean
|
|
9
|
-
title?:
|
|
10
|
-
description?:
|
|
11
|
-
confirmText?:
|
|
12
|
-
cancelText?:
|
|
9
|
+
title?: ComponentText
|
|
10
|
+
description?: ComponentText
|
|
11
|
+
confirmText?: ComponentText
|
|
12
|
+
cancelText?: ComponentText
|
|
13
13
|
confirmVariant?: ButtonVariant
|
|
14
14
|
position?: ComponentPosition
|
|
15
15
|
disabled?: boolean
|
|
@@ -52,7 +52,7 @@ const viewItems = computed(() => items.value.map((item, index) => {
|
|
|
52
52
|
}));
|
|
53
53
|
const configProvider = useConfigProvider();
|
|
54
54
|
const { classes, attrs } = useTailwindVariant({
|
|
55
|
-
base: "pxd-context-usage--track flex w-full overflow-hidden rounded-full
|
|
55
|
+
base: "pxd-context-usage--track flex w-full overflow-hidden rounded-full",
|
|
56
56
|
variants: { size: {
|
|
57
57
|
sm: "h-1.5",
|
|
58
58
|
md: "h-2",
|
|
@@ -93,16 +93,16 @@ function onItemLeave() {
|
|
|
93
93
|
@pointerleave="onItemLeave()"
|
|
94
94
|
/>
|
|
95
95
|
<div
|
|
96
|
-
class="pxd-context-usage--free basis-0 pointer-events-none"
|
|
96
|
+
class="pxd-context-usage--free basis-0 pointer-events-none bg-gray-alpha-200"
|
|
97
97
|
:style="{ flexGrow: freeTokens }"
|
|
98
98
|
/>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
101
|
-
<ul v-if="legend" class="pxd-context-usage--legend
|
|
101
|
+
<ul v-if="legend" class="pxd-context-usage--legend flex flex-col">
|
|
102
102
|
<li
|
|
103
103
|
v-for="(item, index) in viewItems"
|
|
104
104
|
:key="index"
|
|
105
|
-
class="min-w-0 gap-2 text-sm m-0! flex cursor-default items-center motion-safe:transition-opacity"
|
|
105
|
+
class="min-w-0 gap-2 sibling:pt-1 text-sm m-0! flex cursor-default items-center motion-safe:transition-opacity"
|
|
106
106
|
:style="{ opacity: item.opacity }"
|
|
107
107
|
@pointerenter="onItemEnter(index)"
|
|
108
108
|
@pointerleave="onItemLeave()"
|
|
@@ -112,8 +112,15 @@ function onItemLeave() {
|
|
|
112
112
|
class="pxd-context-usage--dot size-2 shrink-0 rounded-full bg-(--context-usage-color)"
|
|
113
113
|
:style="{ '--context-usage-color': item.color }"
|
|
114
114
|
/>
|
|
115
|
-
|
|
116
|
-
<span class="text-
|
|
115
|
+
|
|
116
|
+
<span class="min-w-0 flex-1 shrink-0 truncate text-foreground-secondary">{{
|
|
117
|
+
item.name
|
|
118
|
+
}}</span>
|
|
119
|
+
<span class="text-xs text-foreground-secondary tabular-nums">{{ item.tokens }}</span>
|
|
120
|
+
<span
|
|
121
|
+
class="text-xs min-w-10 inline-flex justify-end text-foreground-secondary tabular-nums"
|
|
122
|
+
>{{ item.percentage.toFixed(1) }}%</span
|
|
123
|
+
>
|
|
117
124
|
</li>
|
|
118
125
|
</ul>
|
|
119
126
|
</div>
|
|
@@ -6,8 +6,10 @@ type __VLS_Slots = {} & {
|
|
|
6
6
|
default?: (props: typeof __VLS_9) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_base: import("vue").DefineComponent<CopyButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
error: (args_0: unknown, args_1: PointerEvent) => any;
|
|
9
10
|
copy: (args_0: string, args_1: PointerEvent) => any;
|
|
10
11
|
}, string, import("vue").PublicProps, Readonly<CopyButtonProps> & Readonly<{
|
|
12
|
+
onError?: ((args_0: unknown, args_1: PointerEvent) => any) | undefined;
|
|
11
13
|
onCopy?: ((args_0: string, args_1: PointerEvent) => any) | undefined;
|
|
12
14
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -17,12 +17,16 @@ const props = defineProps({ text: {
|
|
|
17
17
|
required: false,
|
|
18
18
|
skipCheck: true
|
|
19
19
|
} });
|
|
20
|
-
const emits = defineEmits(["copy"]);
|
|
20
|
+
const emits = defineEmits(["copy", "error"]);
|
|
21
21
|
const { isCopied, copyText } = useCopyClick();
|
|
22
22
|
async function onCopyClick(ev) {
|
|
23
23
|
const text = `${(typeof props.text === "function" ? props.text(ev) : props.text) ?? ""}`;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
try {
|
|
25
|
+
await copyText(text);
|
|
26
|
+
emits("copy", text, ev);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
emits("error", error, ev);
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
</script>
|
|
28
32
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentText } from '../../types/shared/props'
|
|
2
2
|
|
|
3
3
|
export interface CopyButtonProps {
|
|
4
|
-
text?:
|
|
4
|
+
text?: ComponentText | ((ev: PointerEvent) => ComponentText)
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export interface CopyButtonEmits {
|
|
8
8
|
copy: [string, PointerEvent]
|
|
9
|
+
error: [unknown, PointerEvent]
|
|
9
10
|
}
|
|
@@ -30,11 +30,11 @@ declare const __VLS_base: import("vue").DefineComponent<CountdownProps, {
|
|
|
30
30
|
onReset?: (() => any) | undefined;
|
|
31
31
|
onFinish?: (() => any) | undefined;
|
|
32
32
|
}>, {
|
|
33
|
+
duration: number;
|
|
33
34
|
format: string;
|
|
34
35
|
millisecond: boolean;
|
|
35
36
|
active: boolean;
|
|
36
37
|
endTime: number;
|
|
37
|
-
durations: number;
|
|
38
38
|
autoReset: boolean;
|
|
39
39
|
precision: number;
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|