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.
Files changed (213) hide show
  1. package/dist/components/_internal/mention-editor.d.vue.ts +23 -14
  2. package/dist/components/_internal/mention-editor.vue +78 -10
  3. package/dist/components/_internal/tree-node.d.vue.ts +2 -2
  4. package/dist/components/_internal/tree-node.vue +1 -1
  5. package/dist/components/active-graph/index.vue +3 -3
  6. package/dist/components/approval-card/index.d.vue.ts +11 -1
  7. package/dist/components/approval-card/index.vue +28 -8
  8. package/dist/components/approval-card/types.d.ts +5 -6
  9. package/dist/components/avatar/index.vue +1 -1
  10. package/dist/components/backtop/index.vue +32 -10
  11. package/dist/components/badge/index.vue +2 -2
  12. package/dist/components/book/index.vue +1 -1
  13. package/dist/components/book/types.d.ts +2 -2
  14. package/dist/components/breadcrumb-item/index.vue +1 -1
  15. package/dist/components/browser/index.vue +1 -1
  16. package/dist/components/bubble/index.vue +6 -6
  17. package/dist/components/bubble/types.d.ts +1 -1
  18. package/dist/components/bubble-group/index.d.vue.ts +1 -0
  19. package/dist/components/bubble-group/index.vue +10 -18
  20. package/dist/components/button/index.vue +2 -2
  21. package/dist/components/button/types.d.ts +2 -2
  22. package/dist/components/button-group/types.d.ts +2 -2
  23. package/dist/components/calendar/index.vue +4 -4
  24. package/dist/components/carousel/types.d.ts +2 -2
  25. package/dist/components/checkbox/types.d.ts +2 -2
  26. package/dist/components/checkerboard/index.vue +1 -1
  27. package/dist/components/chip/index.vue +1 -1
  28. package/dist/components/chip/types.d.ts +2 -2
  29. package/dist/components/choicebox/types.d.ts +2 -2
  30. package/dist/components/choicebox-item/types.d.ts +2 -2
  31. package/dist/components/code-block/index.vue +9 -9
  32. package/dist/components/code-block/types.d.ts +2 -2
  33. package/dist/components/collapse/index.vue +2 -2
  34. package/dist/components/collapse/types.d.ts +2 -2
  35. package/dist/components/collapse-group/index.vue +6 -6
  36. package/dist/components/command-menu/index.d.vue.ts +1 -1
  37. package/dist/components/command-menu/index.vue +17 -5
  38. package/dist/components/command-menu/types.d.ts +8 -1
  39. package/dist/components/config-provider/index.d.vue.ts +3 -0
  40. package/dist/components/confirm-popover/index.vue +1 -1
  41. package/dist/components/confirm-popover/types.d.ts +5 -5
  42. package/dist/components/context-usage/index.vue +13 -6
  43. package/dist/components/copy-button/index.d.vue.ts +2 -0
  44. package/dist/components/copy-button/index.vue +7 -3
  45. package/dist/components/copy-button/types.d.ts +3 -2
  46. package/dist/components/countdown/index.d.vue.ts +1 -1
  47. package/dist/components/countdown/index.vue +1 -1
  48. package/dist/components/description/types.d.ts +2 -2
  49. package/dist/components/drawer/index.vue +4 -1
  50. package/dist/components/drawer/types.d.ts +4 -4
  51. package/dist/components/effort-slider/index.vue +13 -16
  52. package/dist/components/ellipsis-text/types.d.ts +3 -3
  53. package/dist/components/empty-state/index.vue +1 -1
  54. package/dist/components/empty-state/types.d.ts +2 -2
  55. package/dist/components/error/index.vue +2 -2
  56. package/dist/components/error/types.d.ts +2 -2
  57. package/dist/components/feedback-bar/index.vue +4 -4
  58. package/dist/components/gauge/index.vue +3 -3
  59. package/dist/components/hint/index.vue +2 -2
  60. package/dist/components/hold-button/index.d.vue.ts +2 -4
  61. package/dist/components/hold-button/index.vue +9 -13
  62. package/dist/components/hold-button/types.d.ts +2 -4
  63. package/dist/components/hue-text/types.d.ts +2 -2
  64. package/dist/components/image-preview/index.vue +6 -6
  65. package/dist/components/input/index.d.vue.ts +6 -6
  66. package/dist/components/input/index.vue +5 -5
  67. package/dist/components/kbd/index.vue +1 -1
  68. package/dist/components/kbd/types.d.ts +2 -2
  69. package/dist/components/link-button/types.d.ts +1 -1
  70. package/dist/components/list/index.d.vue.ts +1 -0
  71. package/dist/components/list/index.vue +8 -2
  72. package/dist/components/list/types.d.ts +16 -8
  73. package/dist/components/list-group/index.vue +1 -7
  74. package/dist/components/list-group/types.d.ts +1 -1
  75. package/dist/components/list-item/index.d.vue.ts +2 -2
  76. package/dist/components/list-item/index.vue +16 -3
  77. package/dist/components/list-item/types.d.ts +1 -0
  78. package/dist/components/loading-mask/types.d.ts +1 -1
  79. package/dist/components/marching-ants/index.vue +2 -2
  80. package/dist/components/marquee/types.d.ts +2 -2
  81. package/dist/components/mention/index.d.vue.ts +26 -8
  82. package/dist/components/mention/index.vue +92 -11
  83. package/dist/components/mention/types.d.ts +37 -5
  84. package/dist/components/message/index.d.vue.ts +3 -3
  85. package/dist/components/message/index.vue +3 -3
  86. package/dist/components/message-item/index.vue +1 -1
  87. package/dist/components/modal/index.vue +5 -2
  88. package/dist/components/modal/types.d.ts +4 -4
  89. package/dist/components/more-button/types.d.ts +2 -2
  90. package/dist/components/note/index.vue +3 -3
  91. package/dist/components/note/types.d.ts +3 -3
  92. package/dist/components/number-input/index.d.vue.ts +4 -4
  93. package/dist/components/page-number/index.vue +2 -2
  94. package/dist/components/pagination/index.vue +2 -2
  95. package/dist/components/pin-input/index.vue +1 -1
  96. package/dist/components/popover/index.vue +111 -100
  97. package/dist/components/popover/types.d.ts +0 -2
  98. package/dist/components/progress/index.d.vue.ts +1 -1
  99. package/dist/components/project-banner/index.vue +3 -3
  100. package/dist/components/project-banner/types.d.ts +2 -2
  101. package/dist/components/questionnaire/index.d.vue.ts +1 -1
  102. package/dist/components/questionnaire/index.vue +93 -36
  103. package/dist/components/questionnaire/types.d.ts +5 -1
  104. package/dist/components/radio/types.d.ts +2 -2
  105. package/dist/components/rating/index.d.vue.ts +1 -1
  106. package/dist/components/rating/index.vue +1 -0
  107. package/dist/components/rating/types.d.ts +2 -2
  108. package/dist/components/reasoning/index.vue +4 -4
  109. package/dist/components/reasoning/types.d.ts +2 -2
  110. package/dist/components/resizable/index.d.vue.ts +1 -1
  111. package/dist/components/resizable/index.vue +34 -30
  112. package/dist/components/reveal/index.vue +2 -2
  113. package/dist/components/rolling-number/index.d.vue.ts +1 -1
  114. package/dist/components/rolling-number/index.vue +6 -6
  115. package/dist/components/rolling-number/types.d.ts +1 -1
  116. package/dist/components/scroll-text/index.vue +3 -2
  117. package/dist/components/scroll-text/types.d.ts +2 -2
  118. package/dist/components/scrollable/index.vue +1 -6
  119. package/dist/components/scrollable/types.d.ts +0 -2
  120. package/dist/components/search-input/index.d.vue.ts +14 -14
  121. package/dist/components/search-input/index.vue +2 -2
  122. package/dist/components/select/index.vue +16 -6
  123. package/dist/components/select/types.d.ts +9 -1
  124. package/dist/components/shimmer-text/index.d.vue.ts +1 -1
  125. package/dist/components/shimmer-text/index.vue +2 -2
  126. package/dist/components/shimmer-text/types.d.ts +4 -2
  127. package/dist/components/slider/index.d.vue.ts +1 -1
  128. package/dist/components/slider/index.vue +34 -2
  129. package/dist/components/snippet/index.d.vue.ts +2 -0
  130. package/dist/components/snippet/index.vue +6 -2
  131. package/dist/components/snippet/types.d.ts +3 -2
  132. package/dist/components/split-button/index.d.vue.ts +9 -7
  133. package/dist/components/split-button/index.vue +21 -6
  134. package/dist/components/split-button/types.d.ts +3 -1
  135. package/dist/components/status-dot/types.d.ts +2 -2
  136. package/dist/components/steps/types.d.ts +3 -3
  137. package/dist/components/stick-to-bottom/index.vue +9 -12
  138. package/dist/components/stick-to-bottom/types.d.ts +0 -2
  139. package/dist/components/switch/index.vue +1 -1
  140. package/dist/components/switch-item/types.d.ts +2 -2
  141. package/dist/components/tabs/index.vue +3 -3
  142. package/dist/components/teleport/index.vue +6 -3
  143. package/dist/components/text/index.vue +1 -1
  144. package/dist/components/text/types.d.ts +1 -1
  145. package/dist/components/textarea/index.d.vue.ts +6 -6
  146. package/dist/components/textarea/index.vue +1 -1
  147. package/dist/components/textarea/types.d.ts +2 -2
  148. package/dist/components/time-picker/index.vue +4 -4
  149. package/dist/components/toc/index.vue +7 -2
  150. package/dist/components/toc/types.d.ts +1 -0
  151. package/dist/components/todo-list/index.d.vue.ts +1 -1
  152. package/dist/components/todo-list/index.vue +138 -103
  153. package/dist/components/todo-list/types.d.ts +7 -5
  154. package/dist/components/toggle/index.vue +1 -1
  155. package/dist/components/toggle-button/index.vue +11 -9
  156. package/dist/components/toggle-button/types.d.ts +3 -3
  157. package/dist/components/toggle-button-group/index.vue +2 -1
  158. package/dist/components/toggle-button-group/types.d.ts +2 -2
  159. package/dist/components/tool-call/index.vue +31 -35
  160. package/dist/components/tool-call/types.d.ts +2 -2
  161. package/dist/components/tour/index.d.vue.ts +1 -1
  162. package/dist/components/tour/index.vue +1 -1
  163. package/dist/components/tour/types.d.ts +4 -4
  164. package/dist/components/tree/index.vue +5 -4
  165. package/dist/components/tree/types.d.ts +4 -5
  166. package/dist/components/virtual-list/types.d.ts +3 -3
  167. package/dist/composables/_internal/use-details-collapse.js +28 -3
  168. package/dist/composables/_internal/use-list-search.d.ts +15 -0
  169. package/dist/composables/_internal/use-list-search.js +50 -0
  170. package/dist/composables/_internal/use-mention-editor.d.ts +10 -5
  171. package/dist/composables/_internal/use-mention-editor.js +180 -140
  172. package/dist/composables/_internal/use-mention-suggest.d.ts +10 -8
  173. package/dist/composables/_internal/use-mention-suggest.js +39 -25
  174. package/dist/composables/_internal/use-message-group.js +6 -6
  175. package/dist/composables/_internal/use-popover-responsive.d.ts +1 -1
  176. package/dist/composables/_internal/use-popover-responsive.js +1 -1
  177. package/dist/composables/_internal/use-remote-search.d.ts +17 -0
  178. package/dist/composables/_internal/use-remote-search.js +58 -0
  179. package/dist/composables/_internal/use-tree.d.ts +2 -2
  180. package/dist/composables/_internal/use-tree.js +7 -52
  181. package/dist/composables/_internal/use-word-limit.d.ts +2 -2
  182. package/dist/composables/use-backoff-retry.d.ts +2 -35
  183. package/dist/composables/use-backoff-retry.js +5 -98
  184. package/dist/composables/use-copy-click.js +14 -13
  185. package/dist/composables/use-countdown.d.ts +1 -1
  186. package/dist/composables/use-countdown.js +4 -4
  187. package/dist/composables/use-delay-destroy.js +8 -6
  188. package/dist/composables/use-message.d.ts +1 -1
  189. package/dist/composables/use-message.js +1 -1
  190. package/dist/composables/use-repeat-action.d.ts +1 -1
  191. package/dist/composables/use-repeat-action.js +3 -3
  192. package/dist/composables/use-stick-to-bottom.d.ts +4 -21
  193. package/dist/composables/use-stick-to-bottom.js +138 -24
  194. package/dist/composables/use-view-transition.d.ts +23 -9
  195. package/dist/constants/tooltip-variants.d.ts +1 -1
  196. package/dist/constants/tooltip-variants.js +1 -1
  197. package/dist/locales/en-us.d.ts +3 -0
  198. package/dist/locales/en-us.js +4 -1
  199. package/dist/locales/zh-cn.d.ts +3 -0
  200. package/dist/locales/zh-cn.js +4 -1
  201. package/dist/styles/styles.css +1 -1
  202. package/dist/styles/tw.css +5 -14
  203. package/dist/types/shared/props.d.ts +5 -2
  204. package/dist/utils/_internal/mention-html.d.ts +1 -0
  205. package/dist/utils/_internal/mention-html.js +6 -4
  206. package/dist/utils/_internal/observer.js +3 -3
  207. package/dist/utils/backoff-retry.d.ts +15 -0
  208. package/dist/utils/backoff-retry.js +94 -0
  209. package/dist/utils/mention-html.d.ts +14 -0
  210. package/dist/utils/mention-html.js +71 -0
  211. package/package.json +2 -9
  212. package/dist/composables/_internal/use-list-filter.d.ts +0 -15
  213. package/dist/composables/_internal/use-list-filter.js +0 -48
@@ -4,6 +4,7 @@ import CrossIcon from "@gdsicon/vue/cross";
4
4
  import QuestionIcon from "@gdsicon/vue/question";
5
5
  import { computed, shallowReactive, shallowRef, watch } from "vue";
6
6
  import { useDetailsCollapse } from "../../composables/_internal/use-details-collapse.js";
7
+ import { useTailwindVariant } from "../../composables/_internal/use-tailwind-variant.js";
7
8
  import { useConfigProvider } from "../../contexts/config-provider.js";
8
9
  import { toArray } from "../../utils/format.js";
9
10
  import PButton from "../button/index.vue";
@@ -14,11 +15,15 @@ defineOptions({
14
15
  inheritAttrs: false
15
16
  });
16
17
  const props = defineProps({
17
- questions: {
18
+ data: {
18
19
  type: Array,
19
20
  required: false,
20
21
  default: () => []
21
22
  },
23
+ size: {
24
+ type: String,
25
+ required: false
26
+ },
22
27
  expand: {
23
28
  type: Boolean,
24
29
  required: false,
@@ -26,12 +31,35 @@ const props = defineProps({
26
31
  }
27
32
  });
28
33
  const emits = defineEmits(["submit"]);
34
+ const SIZE_CLASSES = {
35
+ sm: {
36
+ header: "p-2",
37
+ item: "min-h-7",
38
+ footer: "p-2",
39
+ answers: "px-3! py-2!",
40
+ skipped: "h-10 px-2.5"
41
+ },
42
+ md: {
43
+ header: "px-2.5 py-2",
44
+ item: "min-h-8",
45
+ footer: "px-2.5 py-2",
46
+ answers: "px-3.5! py-2.5!",
47
+ skipped: "h-11 px-3"
48
+ },
49
+ lg: {
50
+ header: "px-3 py-2.5",
51
+ item: "min-h-9",
52
+ footer: "px-3 py-2.5",
53
+ answers: "px-4! py-3!",
54
+ skipped: "h-12 px-3"
55
+ }
56
+ };
29
57
  const contentRef = shallowRef();
30
58
  const totalAnswers = shallowReactive({});
31
59
  const currentState = shallowRef("choosing");
32
60
  const currentIndex = shallowRef(0);
33
61
  const currentQuestion = computed(() => {
34
- const question = props.questions[currentIndex.value];
62
+ const question = props.data[currentIndex.value];
35
63
  return question ? getQuestionOptions(question) : null;
36
64
  });
37
65
  const currentAnswer = computed(() => {
@@ -39,7 +67,7 @@ const currentAnswer = computed(() => {
39
67
  return question ? totalAnswers[question.header] : null;
40
68
  });
41
69
  const showSubmitButton = computed(() => {
42
- const questionsCount = props.questions.length;
70
+ const questionsCount = props.data.length;
43
71
  const question = currentQuestion.value;
44
72
  if (!question) {
45
73
  return false;
@@ -50,6 +78,15 @@ const showSubmitButton = computed(() => {
50
78
  return currentIndex.value === questionsCount - 1 && question.allowFreeformInput;
51
79
  });
52
80
  const configProvider = useConfigProvider();
81
+ const computedSize = computed(() => props.size || configProvider.size);
82
+ const { attrs, classes } = useTailwindVariant({
83
+ base: "pxd-questionnaire w-full max-w-full rounded-xl border bg-background-100 empty:hidden",
84
+ variants: { size: {
85
+ sm: "text-xs",
86
+ md: "text-sm",
87
+ lg: "text-base"
88
+ } }
89
+ }, { selection: () => ({ size: computedSize.value }) });
53
90
  const { isOpen, detailsOpen, onToggleClick, onDetailsToggle } = useDetailsCollapse(contentRef, () => props.expand);
54
91
  function createInitialAnswers(questions) {
55
92
  return questions.reduce((answers, question) => {
@@ -98,14 +135,14 @@ function buildInitAnswers() {
98
135
  Object.keys(totalAnswers).forEach((header) => {
99
136
  delete totalAnswers[header];
100
137
  });
101
- Object.assign(totalAnswers, createInitialAnswers(props.questions));
138
+ Object.assign(totalAnswers, createInitialAnswers(props.data));
102
139
  }
103
140
  function toggleCurrentIndex(offset) {
104
- if (!props.questions.length) {
141
+ if (!props.data.length) {
105
142
  currentIndex.value = 0;
106
143
  return;
107
144
  }
108
- currentIndex.value = Math.min(Math.max(currentIndex.value + offset, 0), props.questions.length - 1);
145
+ currentIndex.value = Math.min(Math.max(currentIndex.value + offset, 0), props.data.length - 1);
109
146
  }
110
147
  function updateCurrentAnswer(update) {
111
148
  const question = currentQuestion.value;
@@ -128,7 +165,7 @@ function onAnswerItemSelect(item) {
128
165
  }));
129
166
  return;
130
167
  }
131
- if (currentIndex.value === props.questions.length - 1 && !question.multiSelect && !question.allowFreeformInput) {
168
+ if (currentIndex.value === props.data.length - 1 && !question.multiSelect && !question.allowFreeformInput) {
132
169
  onSubmitAnswers();
133
170
  return;
134
171
  }
@@ -180,9 +217,13 @@ function getFinalAnswers() {
180
217
  return answers;
181
218
  }, {});
182
219
  }
220
+ function getToggleLabel() {
221
+ return isOpen.value ? configProvider.locale.questionnaire.collapse : configProvider.locale.questionnaire.expand;
222
+ }
183
223
  function skipAllQuestions() {
184
224
  Object.assign(totalAnswers, createSkippedAnswers(totalAnswers));
185
225
  currentState.value = "skipped";
226
+ emits("submit", getFinalAnswers());
186
227
  }
187
228
  function skipCurrentQuestion() {
188
229
  updateCurrentAnswer(() => ({
@@ -190,7 +231,7 @@ function skipCurrentQuestion() {
190
231
  freeText: null,
191
232
  skipped: true
192
233
  }));
193
- if (currentIndex.value >= props.questions.length - 1) {
234
+ if (currentIndex.value >= props.data.length - 1) {
194
235
  onSubmitAnswers();
195
236
  return;
196
237
  }
@@ -200,7 +241,7 @@ function onSubmitAnswers() {
200
241
  currentState.value = "submitted";
201
242
  emits("submit", getFinalAnswers());
202
243
  }
203
- watch(() => props.questions, () => {
244
+ watch(() => props.data, () => {
204
245
  currentState.value = "choosing";
205
246
  currentIndex.value = 0;
206
247
  buildInitAnswers();
@@ -208,26 +249,20 @@ watch(() => props.questions, () => {
208
249
  </script>
209
250
 
210
251
  <template>
211
- <div
212
- data-questionnaire
213
- class="pxd-questionnaire w-full max-w-full rounded-xl border bg-background-100 empty:hidden"
214
- v-bind="$attrs"
215
- >
252
+ <div data-questionnaire :class="classes" v-bind="attrs">
216
253
  <template v-if="currentState === 'choosing' && currentQuestion && currentAnswer">
217
254
  <details class="pxd-questionnaire--details" :open="detailsOpen" @toggle="onDetailsToggle">
218
255
  <summary
219
- class="pxd-questionnaire--title py-2 ps-3 pe-2 gap-2 text-sm flex w-full cursor-pointer touch-manipulation list-none appearance-none items-center border-none bg-transparent font-inherit text-inherit self-focus-ring outline-none select-none"
220
- :class="{ 'border-b': detailsOpen }"
256
+ class="pxd-questionnaire--title gap-2 flex w-full cursor-pointer touch-manipulation list-none appearance-none items-center border-none bg-transparent font-inherit text-inherit self-focus-ring outline-none select-none"
257
+ :class="[SIZE_CLASSES[computedSize].header, { 'border-b': detailsOpen }]"
221
258
  @click.prevent="onToggleClick"
222
259
  >
223
- <QuestionIcon class="size-3 font-medium shrink-0" />
260
+ <QuestionIcon class="font-medium size-em shrink-0" />
224
261
 
225
262
  <span class="pxd-questionnaire--question min-w-0 font-medium flex-1 truncate">
226
263
  {{ currentQuestion.question }}
227
264
  </span>
228
265
 
229
- <!-- preventDefault is load-bearing: stopping propagation alone would leave
230
- the summary's native disclosure default action free to run. -->
231
266
  <PButton
232
267
  icon
233
268
  size="xs"
@@ -238,6 +273,22 @@ watch(() => props.questions, () => {
238
273
  >
239
274
  <CrossIcon aria-hidden="true" />
240
275
  </PButton>
276
+
277
+ <PButton
278
+ icon
279
+ size="xs"
280
+ variant="ghost"
281
+ :title="getToggleLabel()"
282
+ :aria-label="getToggleLabel()"
283
+ :aria-expanded="isOpen"
284
+ @click.prevent.stop="onToggleClick"
285
+ >
286
+ <ChevronRightIcon
287
+ aria-hidden="true"
288
+ class="motion-safe:transition-transform"
289
+ :class="{ 'rotate-90': isOpen }"
290
+ />
291
+ </PButton>
241
292
  </summary>
242
293
 
243
294
  <div
@@ -247,23 +298,28 @@ watch(() => props.questions, () => {
247
298
  >
248
299
  <div class="pxd-questionnaire--content border-t">
249
300
  <PList
301
+ class="max-h-60"
250
302
  :model-value="currentAnswer.selected"
251
303
  :multiple="currentQuestion.multiSelect"
252
304
  :options="currentQuestion.options"
305
+ :item-class="SIZE_CLASSES[computedSize].item"
253
306
  @update:model-value="onListModelUpdate"
254
307
  @change="onAnswerItemSelect"
255
308
  >
256
309
  <template #item="{ item }">
257
310
  <div v-if="item.label" class="flex flex-col">
258
- <span>{{ item.label }}</span>
259
- <span class="text-foreground-secondary">{{ item.description }}</span>
311
+ <span class="text-sm">{{ item.label }}</span>
312
+ <span class="text-xs mbs-0.5 text-foreground-secondary">{{
313
+ item.description
314
+ }}</span>
260
315
  </div>
261
316
 
262
317
  <PInput
263
318
  v-else
264
319
  :model-value="currentAnswer.freeText"
265
320
  :placeholder="item.description"
266
- class="-me-6 my-0.5 w-[calc(100%+1.5rem)] max-w-none"
321
+ :size="computedSize"
322
+ class="-me-8 my-0.5 w-[calc(100%+2rem)] max-w-none"
267
323
  @update:model-value="onFreeformInput"
268
324
  @change="onFreeformInputChange"
269
325
  @click.stop
@@ -272,10 +328,11 @@ watch(() => props.questions, () => {
272
328
  </PList>
273
329
 
274
330
  <div
275
- v-if="questions.length > 1 || showSubmitButton"
276
- class="p-2 flex items-center justify-between border-t"
331
+ v-if="data.length > 1 || showSubmitButton"
332
+ class="flex items-center justify-between border-t"
333
+ :class="SIZE_CLASSES[computedSize].footer"
277
334
  >
278
- <div v-if="questions.length > 1" class="gap-1 flex items-center">
335
+ <div v-if="data.length > 1" class="gap-1 flex items-center">
279
336
  <PButton
280
337
  icon
281
338
  size="xs"
@@ -294,18 +351,18 @@ watch(() => props.questions, () => {
294
351
  size="xs"
295
352
  variant="ghost"
296
353
  :class="{
297
- 'pointer-events-none opacity-50': currentIndex >= questions.length - 1
354
+ 'pointer-events-none opacity-50': currentIndex >= data.length - 1
298
355
  }"
299
356
  :title="configProvider.locale.questionnaire.next"
300
357
  :aria-label="configProvider.locale.questionnaire.next"
301
- :aria-disabled="currentIndex >= questions.length - 1"
358
+ :aria-disabled="currentIndex >= data.length - 1"
302
359
  @click="toggleCurrentIndex(1)"
303
360
  >
304
361
  <ChevronRightIcon aria-hidden="true" />
305
362
  </PButton>
306
363
 
307
- <span class="text-sm ms-2 text-foreground-secondary tabular-nums select-none">
308
- {{ currentIndex + 1 }}/{{ questions.length }}
364
+ <span class="ms-2 text-foreground-secondary tabular-nums select-none">
365
+ {{ currentIndex + 1 }}/{{ data.length }}
309
366
  </span>
310
367
  </div>
311
368
 
@@ -330,12 +387,11 @@ watch(() => props.questions, () => {
330
387
  </template>
331
388
 
332
389
  <template v-else-if="currentState === 'submitted'">
333
- <ul class="px-4! py-3! m-0! pxd-questionnaire--answers gap-2 flex list-none flex-col">
334
- <li
335
- v-for="(question, index) of questions"
336
- :key="index"
337
- class="pxd-questionnaire--item m-0! text-sm"
338
- >
390
+ <ul
391
+ class="m-0! pxd-questionnaire--answers gap-2 flex list-none flex-col"
392
+ :class="SIZE_CLASSES[computedSize].answers"
393
+ >
394
+ <li v-for="(question, index) of data" :key="index" class="pxd-questionnaire--item m-0!">
339
395
  <p class="m-0! text-foreground-secondary">
340
396
  {{ configProvider.locale.questionnaire.question }}: {{ question.question }}
341
397
  </p>
@@ -349,7 +405,8 @@ watch(() => props.questions, () => {
349
405
 
350
406
  <template v-else-if="currentState === 'skipped'">
351
407
  <p
352
- class="pxd-questionnaire--skipped text-sm h-12 px-3 flex cursor-default items-center text-foreground-secondary italic"
408
+ class="pxd-questionnaire--skipped flex cursor-default items-center text-foreground-secondary italic"
409
+ :class="SIZE_CLASSES[computedSize].skipped"
353
410
  >
354
411
  Skipped questions
355
412
  </p>
@@ -1,3 +1,5 @@
1
+ import type { ComponentSize } from '../../types/shared/props'
2
+
1
3
  export type QuestionnaireState = 'choosing' | 'skipped' | 'submitted'
2
4
 
3
5
  export interface QuestionnaireQuestion {
@@ -19,7 +21,9 @@ export interface QuestionnaireAnswers {
19
21
  }
20
22
 
21
23
  export interface QuestionnaireProps {
22
- questions?: QuestionnaireQuestion[]
24
+ data?: QuestionnaireQuestion[]
25
+ /** Padding and font size; falls back to the config provider size. */
26
+ size?: ComponentSize
23
27
  expand?: boolean
24
28
  }
25
29
 
@@ -1,7 +1,7 @@
1
- import type { ComponentLabel, ComponentValue } from '../../types/shared/props'
1
+ import type { ComponentText, ComponentValue } from '../../types/shared/props'
2
2
 
3
3
  export interface RadioProps {
4
- label?: ComponentLabel
4
+ label?: ComponentText
5
5
  value: ComponentValue
6
6
  disabled?: boolean
7
7
  modelValue?: ComponentValue
@@ -8,9 +8,9 @@ declare const __VLS_export: import("vue").DefineComponent<RatingProps, {}, {}, {
8
8
  }>, {
9
9
  disabled: boolean;
10
10
  modelValue: number;
11
- count: number;
12
11
  readonly: boolean;
13
12
  clearable: boolean;
13
+ count: number;
14
14
  allowHalf: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
@@ -93,6 +93,7 @@ const { attrs, classes } = useTailwindVariant({
93
93
  base: "pxd-rating inline-flex cursor-pointer touch-none items-center rounded-sm self-focus-ring select-none",
94
94
  variants: {
95
95
  size: {
96
+ xs: "text-xs",
96
97
  sm: "text-sm",
97
98
  md: "text-base",
98
99
  lg: "text-xl"
@@ -1,9 +1,9 @@
1
- import type { ComponentSize } from '../../types/shared/props'
1
+ import type { ComponentSizeWithXs } from '../../types/shared/props'
2
2
 
3
3
  export interface RatingProps {
4
4
  modelValue?: number
5
5
  count?: number
6
- size?: ComponentSize
6
+ size?: ComponentSizeWithXs
7
7
  color?: string
8
8
  voidColor?: string
9
9
  allowHalf?: boolean
@@ -52,14 +52,14 @@ const { isOpen, detailsOpen, onToggleClick, onDetailsToggle } = useDetailsCollap
52
52
  }"
53
53
  @click.prevent="onToggleClick"
54
54
  >
55
- <BrainIcon class="size-3 shrink-0" />
55
+ <BrainIcon class="size-em shrink-0" />
56
56
 
57
- <PShimmerText class="pxd-reasoning--title" :disabled="!streaming">
57
+ <PShimmerText class="pxd-reasoning--title leading-inherit" :disabled="!streaming">
58
58
  {{ title ?? configProvider.locale.reasoning[streaming ? "thinking" : "thought"] }}
59
59
  </PShimmerText>
60
60
 
61
61
  <ChevronRightIcon
62
- class="size-3 shrink-0 text-foreground-secondary motion-safe:transition-transform-opacity"
62
+ class="size-em shrink-0 text-foreground-secondary motion-safe:transition-transform-opacity"
63
63
  :class="{
64
64
  'rotate-90 opacity-100': isOpen,
65
65
  'ml-auto': variant === 'default',
@@ -77,7 +77,7 @@ const { isOpen, detailsOpen, onToggleClick, onDetailsToggle } = useDetailsCollap
77
77
  class="pxd-reasoning--content"
78
78
  :class="{
79
79
  'p-3 text-sm border-t text-foreground-secondary': variant === 'default',
80
- 'mbs-1.5 text-sm ms-1.5 ps-3 border-l text-foreground-secondary': variant === 'simple'
80
+ 'mbs-1.5 text-sm ms-1.5 py-1 ps-3 border-l text-foreground-secondary': variant === 'simple'
81
81
  }"
82
82
  >
83
83
  <slot />
@@ -1,4 +1,4 @@
1
- import type { ComponentLabel } from '../../types/shared/props'
1
+ import type { ComponentText } from '../../types/shared/props'
2
2
 
3
3
  export type ReasoningVariant = 'default' | 'simple'
4
4
 
@@ -8,5 +8,5 @@ export interface ReasoningProps {
8
8
  /** Expanded state, applied whenever the value changes. */
9
9
  expand?: boolean
10
10
  /** Title text; falls back to `locale.reasoning.thinking` / `thought`. */
11
- title?: ComponentLabel
11
+ title?: ComponentText
12
12
  }
@@ -28,8 +28,8 @@ declare const __VLS_base: import("vue").DefineComponent<ResizableProps, {
28
28
  unit: "percent" | "px";
29
29
  disabled: boolean;
30
30
  modelValue: number[] | null;
31
- defaultValue: number[];
32
31
  direction: import("../../types/shared/props.js").ComponentDirection;
32
+ defaultValue: number[];
33
33
  minSize: number[];
34
34
  collapsed: boolean | null;
35
35
  dblclickAction: import("./types").ResizableDblclickAction;
@@ -86,18 +86,19 @@ const handleRef = shallowRef();
86
86
  const containerSize = shallowRef(0);
87
87
  const innerSizes = shallowRef(toPair(props.defaultValue));
88
88
  const innerCollapsed = shallowRef(false);
89
- /** Pointer position in `unit` during a drag; unclamped so a leftward overshoot is not swallowed. */
89
+ // Pointer position in `unit` during a drag; unclamped so a leftward overshoot is not swallowed.
90
90
  const dragPointer = shallowRef(null);
91
91
  const dragCollapsed = shallowRef(false);
92
- /** Leading size to restore when a folded panel is expanded without dragging. */
92
+ // Leading size to restore when a folded panel is expanded without dragging.
93
93
  const foldedFrom = shallowRef(null);
94
94
  const isControlled = computed(() => !isNil(props.modelValue));
95
95
  const isPixel = computed(() => props.unit === "px");
96
- /** `reverse` only means anything where a panel fills the rest, i.e. under `px`. */
96
+ const isHorizontal = computed(() => props.direction === "horizontal");
97
+ // `reverse` only means anything where a panel fills the rest, i.e. under `px`.
97
98
  const isReversed = computed(() => isPixel.value && props.reverse);
98
- /** Percent sizes are measured against 100; pixel sizes fill the measured container. */
99
+ // Percent sizes are measured against 100; pixel sizes fill the measured container.
99
100
  const totalSize = computed(() => isPixel.value ? containerSize.value : PERCENT_TOTAL);
100
- /** Under `px` only the pinned panel's size comes from the caller. */
101
+ // Under `px` only the pinned panel's size comes from the caller.
101
102
  const sizes = computed(() => {
102
103
  const [leading, trailing] = toPair(isControlled.value ? props.modelValue : innerSizes.value);
103
104
  const total = totalSize.value;
@@ -127,9 +128,9 @@ const bounds = computed(() => {
127
128
  };
128
129
  });
129
130
  const collapsed = computed(() => dragPointer.value === null ? props.collapsed ?? innerCollapsed.value : dragCollapsed.value);
130
- /** The bound the divider parks against while folded. */
131
+ // The bound the divider parks against while folded.
131
132
  const foldedLeading = computed(() => isReversed.value ? bounds.value.max : bounds.value.min);
132
- /** Half of the pinned floor; a panel without a floor has nothing to fold past. */
133
+ // Half of the pinned floor; a panel without a floor has nothing to fold past.
133
134
  const foldThreshold = computed(() => (isReversed.value ? totalSize.value - bounds.value.max : bounds.value.min) / 2);
134
135
  const renderedSizes = computed(() => {
135
136
  if (collapsed.value) {
@@ -142,26 +143,25 @@ const renderedSizes = computed(() => {
142
143
  const pointer = isReversed.value ? Math.min(dragPointer.value, max) : Math.max(dragPointer.value, min);
143
144
  return pairFrom(pointer);
144
145
  });
145
- /** The pair the panel slots are handed, updated only when a change settles. */
146
+ // The pair the panel slots are handed, updated only when a change settles.
146
147
  const settledSizes = shallowRef(renderedSizes.value);
147
148
  const unitSuffix = computed(() => isPixel.value ? "px" : "%");
148
- /** An empty panel puts the divider on a container edge, where a line is just residue. */
149
+ // An empty panel puts the divider on a container edge, where a line is just residue.
149
150
  const isFlush = computed(() => renderedSizes.value[0] <= 0 || renderedSizes.value[1] <= 0);
150
151
  const ariaValueNow = computed(() => roundSize(renderedSizes.value[0]));
151
- const ariaValueText = computed(() => `${ariaValueNow.value}${unitSuffix.value}`);
152
- /** Folded, the divider is out of the tab order and cannot move, so it exposes no value range. */
152
+ // Folded, the divider is out of the tab order and cannot move, so it exposes no value range.
153
153
  const separatorRange = computed(() => collapsed.value ? {} : {
154
154
  "aria-valuenow": ariaValueNow.value,
155
155
  "aria-valuemin": bounds.value.min,
156
156
  "aria-valuemax": bounds.value.max,
157
- "aria-valuetext": ariaValueText.value
157
+ "aria-valuetext": `${ariaValueNow.value}${unitSuffix.value}`
158
158
  });
159
159
  const modelValue = useModelValue(props, emits, { withChange: false });
160
160
  useResizeObserver(containerRef, syncContainerSize);
161
161
  function roundSize(value) {
162
162
  return Math.round(value * 100) / 100;
163
163
  }
164
- /** Pixel distance as the group's `unit`. */
164
+ // Pixel distance as the group's `unit`.
165
165
  function toUnit(px) {
166
166
  if (isPixel.value) {
167
167
  return px;
@@ -227,10 +227,10 @@ function reset() {
227
227
  const next = pairFrom(clampValue(target, min, max));
228
228
  const changed = setSizes(next);
229
229
  clearFold(wasCollapsed);
230
- if (!changed && !wasCollapsed) {
231
- return;
232
- }
233
230
  if (!changed) {
231
+ if (!wasCollapsed) {
232
+ return;
233
+ }
234
234
  writeSizes(next);
235
235
  }
236
236
  emits("reset", next);
@@ -257,7 +257,7 @@ function syncContainerSize() {
257
257
  containerSize.value = 0;
258
258
  return;
259
259
  }
260
- containerSize.value = props.direction === "horizontal" ? container.offsetWidth : container.offsetHeight;
260
+ containerSize.value = isHorizontal.value ? container.offsetWidth : container.offsetHeight;
261
261
  }
262
262
  function flushPointer() {
263
263
  const current = dragPointer.value;
@@ -286,7 +286,7 @@ function flushPointer() {
286
286
  modelValue.value = renderedSizes.value.slice();
287
287
  }
288
288
  function axisOf(event) {
289
- return props.direction === "horizontal" ? event.clientX : event.clientY;
289
+ return isHorizontal.value ? event.clientX : event.clientY;
290
290
  }
291
291
  function resetDragging() {
292
292
  const pointerId = drag?.pointerId;
@@ -388,9 +388,8 @@ function handleKeydown(event) {
388
388
  if (props.disabled) {
389
389
  return;
390
390
  }
391
- const horizontal = props.direction === "horizontal";
392
- const back = horizontal ? "ArrowLeft" : "ArrowUp";
393
- const forward = horizontal ? "ArrowRight" : "ArrowDown";
391
+ const back = isHorizontal.value ? "ArrowLeft" : "ArrowUp";
392
+ const forward = isHorizontal.value ? "ArrowRight" : "ArrowDown";
394
393
  if (![
395
394
  back,
396
395
  forward,
@@ -416,18 +415,18 @@ function handleKeydown(event) {
416
415
  emits("change", sizes.value.slice());
417
416
  }
418
417
  }
419
- /** Only the pinned panel of a pixel group gets a basis; the other one fills. */
418
+ // Only the pinned panel of a pixel group gets a basis; the other one fills.
420
419
  function panelStyle(index) {
421
420
  if (isPixel.value && index === (isReversed.value ? 0 : 1)) {
422
421
  return {};
423
422
  }
424
423
  return { flexBasis: `${renderedSizes.value[index]}${unitSuffix.value}` };
425
424
  }
426
- /** A panel clipped to nothing is gone for focus and AT, not just for the eye. */
425
+ // A panel clipped to nothing is gone for focus and AT, not just for the eye.
427
426
  function isPanelEmpty(index) {
428
427
  return renderedSizes.value[index] <= 0 || undefined;
429
428
  }
430
- watch(renderedSizes, (value) => {
429
+ watch(() => renderedSizes.value, (value) => {
431
430
  if (dragPointer.value === null) {
432
431
  settledSizes.value = value;
433
432
  }
@@ -461,7 +460,7 @@ defineExpose({
461
460
  >
462
461
  <div
463
462
  :id="leadingId"
464
- class="pxd-resizable-panel min-w-0 min-h-0 overflow-hidden"
463
+ class="pxd-resizable--panel min-w-0 min-h-0 overflow-hidden"
465
464
  :style="panelStyle(0)"
466
465
  :inert="isPanelEmpty(0)"
467
466
  >
@@ -479,9 +478,8 @@ defineExpose({
479
478
  :aria-disabled="disabled || void 0"
480
479
  :data-collapsed="collapsed || void 0"
481
480
  :data-flush="isFlush || void 0"
482
- :data-handler="handle"
483
481
  :data-orientation="direction"
484
- class="pxd-resizable-handle relative shrink-0 touch-none self-focus-ring select-none hover:after:delay-200 aria-disabled:cursor-default after:motion-safe:transition-colors"
482
+ class="pxd-resizable--handle group relative shrink-0 touch-none self-focus-ring select-none hover:after:delay-200 aria-disabled:cursor-default after:motion-safe:transition-colors"
485
483
  @pointerdown="handlePointerDown"
486
484
  @pointermove="handlePointerMove"
487
485
  @pointerup="handlePointerUp"
@@ -489,11 +487,17 @@ defineExpose({
489
487
  @lostpointercapture="handleLostCapture"
490
488
  @keydown="handleKeydown"
491
489
  @dblclick.prevent.stop="handleDblclick"
492
- />
490
+ >
491
+ <span
492
+ v-if="handle"
493
+ class="pxd-resizable--handle-thumb pointer-events-none absolute z-1 block -translate-x-1/2 -translate-y-1/2 rounded-full bg-gray-300 group-hover:bg-primary group-hover:delay-200"
494
+ :class="isHorizontal ? 'w-1 h-6 left-0 top-1/2' : 'w-6 h-1 top-0 left-1/2'"
495
+ />
496
+ </div>
493
497
 
494
498
  <div
495
499
  :id="trailingId"
496
- class="pxd-resizable-panel min-w-0 min-h-0 overflow-hidden"
500
+ class="pxd-resizable--panel min-w-0 min-h-0 overflow-hidden"
497
501
  :style="panelStyle(1)"
498
502
  :inert="isPanelEmpty(1)"
499
503
  >
@@ -503,5 +507,5 @@ defineExpose({
503
507
  </template>
504
508
 
505
509
  <style>
506
- .pxd-resizable-panel{flex-grow:0;flex-shrink:1}.pxd-resizable-panel[inert]{visibility:hidden}.pxd-resizable[data-unit=px] .pxd-resizable-panel:first-child{flex-shrink:0}.pxd-resizable[data-unit=px] .pxd-resizable-panel:last-child{flex-basis:0;flex-grow:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable-panel:first-child{flex-basis:0;flex-grow:1;flex-shrink:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable-panel:last-child{flex-grow:0;flex-shrink:0}.pxd-resizable-handle[data-handler=true]:before{background-color:var(--color-gray-300);border-radius:.5rem;content:"";left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:1}.pxd-resizable-handle:after{background-color:transparent;content:"";position:absolute}.pxd-resizable-handle:hover:after{background-color:var(--color-primary)}.pxd-resizable-handle[data-orientation=horizontal]{border-left-width:1px;cursor:col-resize;height:100%;margin-right:-1px}.pxd-resizable-handle[data-orientation=horizontal]:before{height:1.5rem;width:.375rem}.pxd-resizable-handle[data-orientation=horizontal]:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:.25rem}.pxd-resizable-handle[data-orientation=vertical]{border-bottom-width:1px;cursor:row-resize;margin-bottom:-1px;width:100%}.pxd-resizable-handle[data-orientation=vertical]:before{height:.375rem;width:1.5rem}.pxd-resizable-handle[data-orientation=vertical]:after{height:.25rem;left:0;top:50%;transform:translateY(-50%);width:100%}.pxd-resizable-handle[data-collapsed=true],.pxd-resizable-handle[data-flush=true]{background-color:transparent}.pxd-resizable-handle[data-collapsed=true]:before{opacity:.4}
510
+ .pxd-resizable--panel{flex-grow:0;flex-shrink:1}.pxd-resizable--panel[inert]{visibility:hidden}.pxd-resizable[data-unit=px] .pxd-resizable--panel:first-child{flex-shrink:0}.pxd-resizable[data-unit=px] .pxd-resizable--panel:last-child{flex-basis:0;flex-grow:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable--panel:first-child{flex-basis:0;flex-grow:1;flex-shrink:1}.pxd-resizable[data-unit=px][data-reverse] .pxd-resizable--panel:last-child{flex-grow:0;flex-shrink:0}.pxd-resizable--handle:after,.pxd-resizable--handle:before{background-color:transparent;content:"";position:absolute}.pxd-resizable--handle:hover:after{background-color:var(--color-primary)}.pxd-resizable--handle[data-orientation=horizontal]{border-left-width:1px;cursor:col-resize;height:100%}.pxd-resizable--handle[data-orientation=horizontal]:after,.pxd-resizable--handle[data-orientation=horizontal]:before{height:100%;left:50%;top:0;transform:translateX(-50%)}.pxd-resizable--handle[data-orientation=horizontal]:before{width:.5rem}.pxd-resizable--handle[data-orientation=horizontal]:after{width:.25rem}.pxd-resizable--handle[data-orientation=vertical]{border-bottom-width:1px;cursor:row-resize;width:100%}.pxd-resizable--handle[data-orientation=vertical]:after,.pxd-resizable--handle[data-orientation=vertical]:before{left:0;top:50%;transform:translateY(-50%);width:100%}.pxd-resizable--handle[data-orientation=vertical]:before{height:.5rem}.pxd-resizable--handle[data-orientation=vertical]:after{height:.25rem}.pxd-resizable--handle[data-collapsed=true],.pxd-resizable--handle[data-flush=true]{border-color:transparent}.pxd-resizable--handle[data-collapsed=true] .pxd-resizable--handle-thumb{opacity:.4}
507
511
  </style>
@@ -20,7 +20,7 @@ const props = defineProps({
20
20
  distance: {
21
21
  type: [Number, String],
22
22
  required: false,
23
- default: 16
23
+ default: "1rem"
24
24
  },
25
25
  direction: {
26
26
  type: String,
@@ -96,5 +96,5 @@ function getTimeUnitValue(value) {
96
96
  </template>
97
97
 
98
98
  <style>
99
- .pxd-reveal{--reveal-duration:0.5s;--reveal-delay:0s;--reveal-distance:16px;--reveal-x:0px;--reveal-y:0px;animation-delay:var(--reveal-delay);animation-duration:var(--reveal-duration);animation-fill-mode:backwards;animation-name:pxd-reveal-in;animation-timing-function:var(--default-transition-timing-function)}.pxd-reveal[data-play-state=paused]{animation-play-state:paused}.pxd-reveal[data-direction=top]{--reveal-y:calc(var(--reveal-distance)*-1)}.pxd-reveal[data-direction=bottom]{--reveal-y:var(--reveal-distance)}.pxd-reveal[data-direction=left]{--reveal-x:calc(var(--reveal-distance)*-1)}.pxd-reveal[data-direction=right]{--reveal-x:var(--reveal-distance)}@keyframes pxd-reveal-in{0%{opacity:0;transform:translate(var(--reveal-x),var(--reveal-y))}}
99
+ .pxd-reveal{--reveal-duration:0.5s;--reveal-delay:0s;--reveal-distance:1rem;--reveal-x:0px;--reveal-y:0px;animation-delay:var(--reveal-delay);animation-duration:var(--reveal-duration);animation-fill-mode:backwards;animation-name:pxd-reveal-in;animation-timing-function:var(--default-transition-timing-function)}.pxd-reveal[data-play-state=paused]{animation-play-state:paused}.pxd-reveal[data-direction=top]{--reveal-y:calc(var(--reveal-distance)*-1)}.pxd-reveal[data-direction=bottom]{--reveal-y:var(--reveal-distance)}.pxd-reveal[data-direction=left]{--reveal-x:calc(var(--reveal-distance)*-1)}.pxd-reveal[data-direction=right]{--reveal-x:var(--reveal-distance)}@keyframes pxd-reveal-in{0%{opacity:0;transform:translate(var(--reveal-x),var(--reveal-y))}}
100
100
  </style>
@@ -9,7 +9,7 @@ declare const __VLS_export: import("vue").DefineComponent<RollingNumberProps, {
9
9
  }>, {
10
10
  value: string | number;
11
11
  mode: "scroll" | "tween";
12
- durations: number;
12
+ duration: number;
13
13
  thousands: boolean;
14
14
  animateOnMount: boolean;
15
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;