@shwfed/nuxt 0.1.19 → 0.1.21

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 (56) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +6 -0
  3. package/dist/runtime/components/app.d.vue.ts +2 -2
  4. package/dist/runtime/components/app.vue +7 -3
  5. package/dist/runtime/components/app.vue.d.ts +2 -2
  6. package/dist/runtime/components/table.d.vue.ts +1 -1
  7. package/dist/runtime/components/table.vue +69 -30
  8. package/dist/runtime/components/table.vue.d.ts +1 -1
  9. package/dist/runtime/components/ui/button/Button.d.vue.ts +27 -0
  10. package/dist/runtime/components/ui/button/Button.vue +24 -0
  11. package/dist/runtime/components/ui/button/Button.vue.d.ts +27 -0
  12. package/dist/runtime/components/ui/button/index.d.ts +7 -0
  13. package/dist/runtime/components/ui/button/index.js +24 -0
  14. package/dist/runtime/components/ui/button-group/ButtonGroup.d.vue.ts +19 -0
  15. package/dist/runtime/components/ui/button-group/ButtonGroup.vue +19 -0
  16. package/dist/runtime/components/ui/button-group/ButtonGroup.vue.d.ts +19 -0
  17. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.d.vue.ts +10 -0
  18. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue +25 -0
  19. package/dist/runtime/components/ui/button-group/ButtonGroupSeparator.vue.d.ts +10 -0
  20. package/dist/runtime/components/ui/button-group/ButtonGroupText.d.vue.ts +22 -0
  21. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue +23 -0
  22. package/dist/runtime/components/ui/button-group/ButtonGroupText.vue.d.ts +22 -0
  23. package/dist/runtime/components/ui/button-group/index.d.ts +8 -0
  24. package/dist/runtime/components/ui/button-group/index.js +18 -0
  25. package/dist/runtime/components/ui/separator/Separator.d.vue.ts +11 -0
  26. package/dist/runtime/components/ui/separator/Separator.vue +26 -0
  27. package/dist/runtime/components/ui/separator/Separator.vue.d.ts +11 -0
  28. package/dist/runtime/components/ui/separator/index.d.ts +1 -0
  29. package/dist/runtime/components/ui/separator/index.js +1 -0
  30. package/dist/runtime/components/ui/tooltip/Tooltip.d.vue.ts +20 -0
  31. package/dist/runtime/components/ui/tooltip/Tooltip.vue +24 -0
  32. package/dist/runtime/components/ui/tooltip/Tooltip.vue.d.ts +20 -0
  33. package/dist/runtime/components/{tooltip.d.vue.ts → ui/tooltip/TooltipContent.d.vue.ts} +11 -6
  34. package/dist/runtime/components/ui/tooltip/TooltipContent.vue +58 -0
  35. package/dist/runtime/components/{tooltip.vue.d.ts → ui/tooltip/TooltipContent.vue.d.ts} +11 -6
  36. package/dist/runtime/components/ui/tooltip/TooltipProvider.d.vue.ts +16 -0
  37. package/dist/runtime/components/ui/tooltip/TooltipProvider.vue +17 -0
  38. package/dist/runtime/components/ui/tooltip/TooltipProvider.vue.d.ts +16 -0
  39. package/dist/runtime/components/ui/tooltip/TooltipTrigger.d.vue.ts +14 -0
  40. package/dist/runtime/components/ui/tooltip/TooltipTrigger.vue +17 -0
  41. package/dist/runtime/components/ui/tooltip/TooltipTrigger.vue.d.ts +14 -0
  42. package/dist/runtime/components/ui/tooltip/index.d.ts +4 -0
  43. package/dist/runtime/components/ui/tooltip/index.js +4 -0
  44. package/dist/runtime/plugins/cel/env.d.ts +7 -0
  45. package/dist/runtime/plugins/cel/env.js +11 -0
  46. package/dist/runtime/plugins/cel/index.d.ts +12 -4
  47. package/dist/runtime/plugins/cel/index.js +4 -4
  48. package/dist/runtime/plugins/markdown/index.js +4 -1
  49. package/dist/runtime/plugins/markdown/md.js +2 -1
  50. package/dist/runtime/plugins/toast/index.d.ts +108 -0
  51. package/dist/runtime/plugins/toast/index.js +12 -0
  52. package/dist/runtime/table-renderers/builtins.js +18 -21
  53. package/dist/runtime/utils/cn.d.ts +2 -0
  54. package/dist/runtime/utils/cn.js +3 -0
  55. package/package.json +5 -5
  56. package/dist/runtime/components/tooltip.vue +0 -48
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.1.19",
4
+ "version": "0.1.21",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
- "unbuild": "unknown"
7
+ "unbuild": "3.6.1"
8
8
  }
9
9
  }
package/dist/module.mjs CHANGED
@@ -9,8 +9,14 @@ const module$1 = defineNuxtModule({
9
9
  setup(options, nuxt) {
10
10
  const resolver = createResolver(import.meta.url);
11
11
  nuxt.options.runtimeConfig.public.shwfed = options;
12
+ nuxt.options.css ||= [];
13
+ nuxt.options.css.push("vue-sonner/style.css");
12
14
  addPlugin(resolver.resolve("runtime/plugins/cel/index"));
13
15
  addPlugin(resolver.resolve("runtime/plugins/markdown/index"));
16
+ addPlugin({
17
+ src: resolver.resolve("runtime/plugins/toast/index"),
18
+ mode: "client"
19
+ });
14
20
  addImportsDir(resolver.resolve("runtime/composables"));
15
21
  addComponentsDir({
16
22
  path: resolver.resolve("runtime/components"),
@@ -1,6 +1,6 @@
1
- declare var __VLS_8: {};
1
+ declare var __VLS_19: {};
2
2
  type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_8) => any;
3
+ default?: (props: typeof __VLS_19) => any;
4
4
  };
5
5
  declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { useHead } from "#app";
3
- import { Tooltip } from "reka-ui/namespaced";
3
+ import { TooltipProvider } from "./ui/tooltip";
4
+ import { Toaster } from "vue-sonner";
4
5
  useHead({
5
6
  bodyAttrs: {
6
7
  style: {
@@ -11,7 +12,10 @@ useHead({
11
12
  </script>
12
13
 
13
14
  <template>
14
- <Tooltip.Provider>
15
+ <TooltipProvider>
16
+ <ClientOnly>
17
+ <Toaster />
18
+ </ClientOnly>
15
19
  <slot />
16
- </Tooltip.Provider>
20
+ </TooltipProvider>
17
21
  </template>
@@ -1,6 +1,6 @@
1
- declare var __VLS_8: {};
1
+ declare var __VLS_19: {};
2
2
  type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_8) => any;
3
+ default?: (props: typeof __VLS_19) => any;
4
4
  };
5
5
  declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -44,7 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<Readonly<{
44
44
  props?: Omit<TableOptions<unknown>, "columns" | "data" | "getRowId" | "getCoreRowModel">;
45
45
  paginationLeft?: Markdown;
46
46
  paginationRight?: Markdown;
47
- }>, import("@tanstack/vue-table").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Readonly<{
47
+ }>, import("@tanstack/table-core").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Readonly<{
48
48
  id: string;
49
49
  getRowId?: Expression;
50
50
  getSubRows?: Expression;
@@ -6,8 +6,10 @@ import { getProperty } from "dot-prop";
6
6
  import { Pagination } from "reka-ui/namespaced";
7
7
  import { computed, ref } from "vue";
8
8
  import { useNuxtApp } from "#app";
9
+ import { Button } from "./ui/button";
10
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
9
11
  import { useTableRenderers } from "../composables/useTableRenderers";
10
- import Tooltip from "./tooltip.vue";
12
+ import { useCheating } from "#imports";
11
13
  </script>
12
14
 
13
15
  <script setup>
@@ -25,6 +27,7 @@ const props = defineProps({
25
27
  paginationRight: { type: String, required: false }
26
28
  });
27
29
  const { $dsl } = useNuxtApp();
30
+ const isCheating = useCheating();
28
31
  const { resolveTableRenderer } = useTableRenderers();
29
32
  const containerRef = ref(null);
30
33
  function genColumnId(column) {
@@ -65,7 +68,7 @@ function translate(column) {
65
68
  return getProperty(row, key);
66
69
  } else if (key !== void 0) {
67
70
  try {
68
- return $dsl.evaluate(key.read, {
71
+ return $dsl.evaluate`${key.read}`({
69
72
  row,
70
73
  index: BigInt(index)
71
74
  });
@@ -103,8 +106,7 @@ const table = useVueTable({
103
106
  getPaginationRowModel: getPaginationRowModel(),
104
107
  getRowId: props.getRowId ? (originalRow, index, parent) => {
105
108
  try {
106
- const key = $dsl.evaluate(
107
- props.getRowId,
109
+ const key = $dsl.evaluate`${props.getRowId}`(
108
110
  {
109
111
  row: originalRow,
110
112
  index,
@@ -127,7 +129,7 @@ const table = useVueTable({
127
129
  if (!props.getSubRows)
128
130
  return void 0;
129
131
  try {
130
- const value = $dsl.evaluate(props.getSubRows, {
132
+ const value = $dsl.evaluate`${props.getSubRows}`({
131
133
  row,
132
134
  index
133
135
  });
@@ -141,7 +143,7 @@ const table = useVueTable({
141
143
  if (!props.enableRowSelection)
142
144
  return true;
143
145
  try {
144
- return Boolean($dsl.evaluate(props.enableRowSelection, {
146
+ return Boolean($dsl.evaluate`${props.enableRowSelection}`({
145
147
  row: row.original,
146
148
  index: BigInt(row.index),
147
149
  id: row.id
@@ -153,7 +155,7 @@ const table = useVueTable({
153
155
  },
154
156
  enableMultiRowSelection: props.enableMultiRowSelection ? (row) => {
155
157
  try {
156
- return Boolean($dsl.evaluate(props.enableMultiRowSelection, {
158
+ return Boolean($dsl.evaluate`${props.enableMultiRowSelection}`({
157
159
  row: row.original,
158
160
  index: BigInt(row.index),
159
161
  id: row.id
@@ -190,7 +192,7 @@ function getCellStyles(ctx) {
190
192
  if (!props.cellStyles)
191
193
  return {};
192
194
  try {
193
- const result = $dsl.evaluate(props.cellStyles, {
195
+ const result = $dsl.evaluate`${props.cellStyles}`({
194
196
  row: ctx.row.original,
195
197
  index: BigInt(ctx.row.index),
196
198
  id: ctx.column.id,
@@ -291,22 +293,27 @@ function getSortIcon(column) {
291
293
  <Tooltip
292
294
  v-if="!header.isPlaceholder && header.column.columnDef.meta?.tooltip"
293
295
  :delay-duration="180"
294
- :content="$md.inline`${header.column.columnDef.meta.tooltip}`()"
295
296
  >
296
- <Icon icon="fluent:info-20-regular" />
297
+ <TooltipTrigger as-child>
298
+ <Icon icon="fluent:info-20-regular" />
299
+ </TooltipTrigger>
300
+ <TooltipContent
301
+ align="center"
302
+ side="top"
303
+ >
304
+ <span v-html="$md.inline`${header.column.columnDef.meta.tooltip}`()" />
305
+ </TooltipContent>
297
306
  </Tooltip>
298
307
 
299
- <button
308
+ <Button
300
309
  v-if="!header.isPlaceholder && header.column.getCanSort()"
301
- type="button"
302
- :class="[
303
- 'p-1 cursor-pointer outline-none absolute right-1 top-1/2 -translate-y-1/2 transform-3d',
304
- 'group-hover:opacity-100 opacity-60 transition-opacity duration-180 bg-transparent'
305
- ]"
306
- @click="header.column.getToggleSortingHandler()?.($event)"
310
+ variant="ghost"
311
+ size="xs"
312
+ class="absolute hover:bg-transparent right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-60 transition-opacity duration-180"
313
+ @click="(event) => header.column.getToggleSortingHandler()?.(event)"
307
314
  >
308
315
  <Icon :icon="getSortIcon(header.column)" />
309
- </button>
316
+ </Button>
310
317
 
311
318
  <div
312
319
  v-if="!header.isPlaceholder && header.column.getCanResize() && (!header.column.getIsLastColumn('right') || !table.getIsSomeColumnsPinned('right') && !header.column.getIsLastColumn('center'))"
@@ -328,7 +335,7 @@ function getSortIcon(column) {
328
335
  ]"
329
336
  @mousedown="header.getResizeHandler()($event)"
330
337
  >
331
- <div :class="['w-2pt', 'translate-x-1pt', 'h-full', 'bg-blue-400']" />
338
+ <div :class="['w-2pt', 'h-full', 'translate-x-1pt', 'transform-3d', 'bg-[color-mix(in_srgb,var(--primary)_80%,white)]']" />
332
339
  </div>
333
340
  </th>
334
341
  </tr>
@@ -370,7 +377,7 @@ function getSortIcon(column) {
370
377
  </tr>
371
378
  </tbody>
372
379
 
373
- <tfoot class="hidden has-[[data-footer]]:grid sticky bottom-0 z-10 select-none border-t border-zinc-200">
380
+ <tfoot class="hidden has-data-footer:grid sticky bottom-0 z-10 select-none border-t border-zinc-200">
374
381
  <tr
375
382
  v-for="group in table.getFooterGroups()"
376
383
  :key="group.id"
@@ -406,9 +413,24 @@ function getSortIcon(column) {
406
413
  </div>
407
414
  </div>
408
415
 
409
- <div class="flex items-center justify-between w-full p-4 text-sm text-zinc-600">
410
- <div>
411
- <div />
416
+ <div class="flex items-center justify-between w-full py-2 gap-2 text-sm text-zinc-600">
417
+ <div
418
+ :class="[
419
+ 'relative p-1 flex-1 prose prose-zinc text-xs border border-dashed',
420
+ isCheating ? 'border-(--primary)/20 rounded hover:border-(--primary)/40 transition-colors duration-150 group cursor-pointer' : 'border-transparent'
421
+ ]"
422
+ >
423
+ <span
424
+ v-html="$md.inline`${props.paginationLeft}`({
425
+ selected: table.getSelectedRowModel().rows.map((row) => row.original)
426
+ })"
427
+ />
428
+ <Icon
429
+ v-if="isCheating"
430
+ icon="fluent:edit-20-regular"
431
+ class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
432
+ />
433
+ &nbsp;
412
434
  </div>
413
435
  <div class="flex items-center gap-4">
414
436
  <span class="text-xs">{{ `\u5171 ${props.data.length} \u6761` }}</span>
@@ -426,7 +448,7 @@ function getSortIcon(column) {
426
448
  <Pagination.First
427
449
  :class="[
428
450
  'w-7 h-7 flex items-center justify-center bg-transparent hover:bg-zinc-100 transition disabled:opacity-50 rounded text-zinc-600',
429
- 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed cursor-pointer'
451
+ 'data-disabled:opacity-50 data-disabled:cursor-not-allowed cursor-pointer'
430
452
  ]"
431
453
  >
432
454
  <Icon
@@ -437,7 +459,7 @@ function getSortIcon(column) {
437
459
  <Pagination.Prev
438
460
  :class="[
439
461
  'w-7 h-7 flex items-center justify-center bg-transparent hover:bg-zinc-100 transition disabled:opacity-50 rounded text-zinc-600',
440
- 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed cursor-pointer'
462
+ 'data-disabled:opacity-50 data-disabled:cursor-not-allowed cursor-pointer'
441
463
  ]"
442
464
  >
443
465
  <Icon
@@ -453,8 +475,8 @@ function getSortIcon(column) {
453
475
  <Pagination.ListItem
454
476
  v-if="page.type === 'page'"
455
477
  :class="[
456
- 'w-7 h-7 flex items-center justify-center border border-zinc-200 rounded text-xs bg-transparent',
457
- 'data-[selected]:text-[var(--primary)] data-[selected]:border-[var(--primary)] hover:bg-zinc-100 transition cursor-pointer'
478
+ 'w-7 h-7 flex items-center justify-center rounded text-xs bg-transparent',
479
+ 'data-selected:text-(--primary) data-selected:border-(--primary) hover:bg-zinc-100 transition cursor-pointer'
458
480
  ]"
459
481
  :value="page.value"
460
482
  >
@@ -471,7 +493,7 @@ function getSortIcon(column) {
471
493
  <Pagination.Next
472
494
  :class="[
473
495
  'w-7 h-7 flex items-center justify-center bg-transparent hover:bg-zinc-100 transition disabled:opacity-50 rounded text-zinc-600',
474
- 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed cursor-pointer'
496
+ 'data-disabled:opacity-50 data-disabled:cursor-not-allowed cursor-pointer'
475
497
  ]"
476
498
  >
477
499
  <Icon
@@ -482,7 +504,7 @@ function getSortIcon(column) {
482
504
  <Pagination.Last
483
505
  :class="[
484
506
  'w-7 h-7 flex items-center justify-center bg-transparent hover:bg-zinc-100 transition disabled:opacity-50 rounded text-zinc-600',
485
- 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed cursor-pointer'
507
+ 'data-disabled:opacity-50 data-disabled:cursor-not-allowed cursor-pointer'
486
508
  ]"
487
509
  >
488
510
  <Icon
@@ -494,7 +516,24 @@ function getSortIcon(column) {
494
516
  </Pagination.Root>
495
517
  <span class="text-xs">前往</span>
496
518
  </div>
497
- <div />
519
+ <div
520
+ :class="[
521
+ 'relative p-1 flex-1 prose prose-zinc text-xs border border-dashed',
522
+ isCheating ? 'border-(--primary)/20 rounded hover:border-(--primary)/40 transition-colors duration-150 group cursor-pointer' : 'border-transparent'
523
+ ]"
524
+ >
525
+ <span
526
+ v-html="$md.inline`${props.paginationRight}`({
527
+ selected: table.getSelectedRowModel().rows.map((row) => row.original)
528
+ })"
529
+ />
530
+ <Icon
531
+ v-if="isCheating"
532
+ icon="fluent:edit-20-regular"
533
+ class="w-4 h-4 text-(--primary) absolute right-1 top-1/2 -translate-y-1/2 transform-3d group-hover:opacity-100 opacity-50 transition-opacity duration-150"
534
+ />
535
+ &nbsp;
536
+ </div>
498
537
  </div>
499
538
  </div>
500
539
  </template>
@@ -44,7 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<Readonly<{
44
44
  props?: Omit<TableOptions<unknown>, "columns" | "data" | "getRowId" | "getCoreRowModel">;
45
45
  paginationLeft?: Markdown;
46
46
  paginationRight?: Markdown;
47
- }>, import("@tanstack/vue-table").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Readonly<{
47
+ }>, import("@tanstack/table-core").Table<unknown>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Readonly<{
48
48
  id: string;
49
49
  getRowId?: Expression;
50
50
  getSubRows?: Expression;
@@ -0,0 +1,27 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ variant?: ButtonVariants['variant'];
6
+ size?: ButtonVariants['size'];
7
+ class?: HTMLAttributes['class'];
8
+ }
9
+ declare var __VLS_8: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_8) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ click: (...args: any[]) => void;
15
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
16
+ onClick?: ((...args: any[]) => any) | undefined;
17
+ }>, {
18
+ as: import("reka-ui").AsTag | import("vue").Component;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,24 @@
1
+ <script setup>
2
+ import { cn } from "../../../utils/cn";
3
+ import { Primitive, useForwardPropsEmits } from "reka-ui";
4
+ import { buttonVariants } from ".";
5
+ const props = defineProps({
6
+ variant: { type: null, required: false },
7
+ size: { type: null, required: false },
8
+ class: { type: null, required: false },
9
+ asChild: { type: Boolean, required: false },
10
+ as: { type: null, required: false, default: "button" }
11
+ });
12
+ const emits = defineEmits(["click"]);
13
+ const forwarded = useForwardPropsEmits(props, emits);
14
+ </script>
15
+
16
+ <template>
17
+ <Primitive
18
+ data-slot="button"
19
+ v-bind="forwarded"
20
+ :class="cn(buttonVariants({ variant, size }), props.class)"
21
+ >
22
+ <slot />
23
+ </Primitive>
24
+ </template>
@@ -0,0 +1,27 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ variant?: ButtonVariants['variant'];
6
+ size?: ButtonVariants['size'];
7
+ class?: HTMLAttributes['class'];
8
+ }
9
+ declare var __VLS_8: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_8) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ click: (...args: any[]) => void;
15
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
16
+ onClick?: ((...args: any[]) => any) | undefined;
17
+ }>, {
18
+ as: import("reka-ui").AsTag | import("vue").Component;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,7 @@
1
+ import type { VariantProps } from 'class-variance-authority';
2
+ export { default as Button } from './Button.vue.js';
3
+ export declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "primary" | "destructive" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "xs" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export type ButtonVariants = VariantProps<typeof buttonVariants>;
@@ -0,0 +1,24 @@
1
+ import { cva } from "class-variance-authority";
2
+ export { default as Button } from "./Button.vue";
3
+ export const buttonVariants = cva(
4
+ "cursor-pointer tracking-wide inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all duration-180 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:border-red-200 select-none",
5
+ {
6
+ variants: {
7
+ variant: {
8
+ default: "border border-slate-200 bg-white text-slate-700 hover:bg-[color-mix(in_srgb,var(--primary)_20%,white)] hover:border-[color-mix(in_srgb,var(--primary)_60%,white)] hover:text-(--primary)",
9
+ destructive: "border border-red-200 text-red-600 bg-[color-mix(in_srgb,red_10%,white)] hover:bg-red-400 hover:border-red-400 hover:text-white",
10
+ primary: "bg-(--primary) text-white hover:bg-[color-mix(in_srgb,var(--primary)_70%,white)]",
11
+ ghost: "border-none bg-transparent text-slate-700 hover:bg-slate-100 hover:text-slate-900"
12
+ },
13
+ size: {
14
+ default: "h-8 px-4 py-2 has-[>svg]:px-3",
15
+ sm: "h-6 rounded gap-1.5 text-xs px-3 has-[>svg]:px-2.5",
16
+ xs: "h-4 rounded gap-1 text-xs px-2 has-[>svg]:px-1"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "default",
21
+ size: "default"
22
+ }
23
+ }
24
+ );
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ import type { ButtonGroupVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ orientation?: ButtonGroupVariants['orientation'];
6
+ };
7
+ declare var __VLS_1: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_1) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,19 @@
1
+ <script setup>
2
+ import { cn } from "../../../utils/cn";
3
+ import { buttonGroupVariants } from ".";
4
+ const props = defineProps({
5
+ class: { type: null, required: false },
6
+ orientation: { type: null, required: false }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <div
12
+ role="group"
13
+ data-slot="button-group"
14
+ :data-orientation="props.orientation"
15
+ :class="cn(buttonGroupVariants({ orientation: props.orientation }), props.class)"
16
+ >
17
+ <slot />
18
+ </div>
19
+ </template>
@@ -0,0 +1,19 @@
1
+ import type { HTMLAttributes } from 'vue';
2
+ import type { ButtonGroupVariants } from '.';
3
+ type __VLS_Props = {
4
+ class?: HTMLAttributes['class'];
5
+ orientation?: ButtonGroupVariants['orientation'];
6
+ };
7
+ declare var __VLS_1: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_1) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,10 @@
1
+ import type { SeparatorProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SeparatorProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ orientation: "horizontal" | "vertical";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,25 @@
1
+ <script setup>
2
+ import { reactiveOmit } from "@vueuse/core";
3
+ import { cn } from "../../../utils/cn";
4
+ import { Separator } from "../separator";
5
+ const props = defineProps({
6
+ orientation: { type: String, required: false, default: "vertical" },
7
+ decorative: { type: Boolean, required: false },
8
+ asChild: { type: Boolean, required: false },
9
+ as: { type: null, required: false },
10
+ class: { type: null, required: false }
11
+ });
12
+ const delegatedProps = reactiveOmit(props, "class");
13
+ </script>
14
+
15
+ <template>
16
+ <Separator
17
+ data-slot="button-group-separator"
18
+ v-bind="delegatedProps"
19
+ :orientation="props.orientation"
20
+ :class="cn(
21
+ 'bg-input relative m-0! self-stretch data-[orientation=vertical]:h-auto',
22
+ props.class
23
+ )"
24
+ />
25
+ </template>
@@ -0,0 +1,10 @@
1
+ import type { SeparatorProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ type __VLS_Props = SeparatorProps & {
4
+ class?: HTMLAttributes['class'];
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ orientation: "horizontal" | "vertical";
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonGroupVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ class?: HTMLAttributes['class'];
6
+ orientation?: ButtonGroupVariants['orientation'];
7
+ }
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
13
+ as: import("reka-ui").AsTag | import("vue").Component;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import { Primitive } from "reka-ui";
3
+ import { cn } from "../../../utils/cn";
4
+ const props = defineProps({
5
+ class: { type: null, required: false },
6
+ orientation: { type: null, required: false },
7
+ asChild: { type: Boolean, required: false },
8
+ as: { type: null, required: false, default: "div" }
9
+ });
10
+ </script>
11
+
12
+ <template>
13
+ <Primitive
14
+ role="group"
15
+ data-slot="button-group"
16
+ :data-orientation="props.orientation"
17
+ :as="as"
18
+ :as-child="asChild"
19
+ :class="cn('bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
20
+ >
21
+ <slot />
22
+ </Primitive>
23
+ </template>
@@ -0,0 +1,22 @@
1
+ import type { PrimitiveProps } from 'reka-ui';
2
+ import type { HTMLAttributes } from 'vue';
3
+ import type { ButtonGroupVariants } from '.';
4
+ interface Props extends PrimitiveProps {
5
+ class?: HTMLAttributes['class'];
6
+ orientation?: ButtonGroupVariants['orientation'];
7
+ }
8
+ declare var __VLS_8: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_8) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
13
+ as: import("reka-ui").AsTag | import("vue").Component;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,8 @@
1
+ import type { VariantProps } from 'class-variance-authority';
2
+ export { default as ButtonGroup } from './ButtonGroup.vue.js';
3
+ export { default as ButtonGroupSeparator } from './ButtonGroupSeparator.vue.js';
4
+ export { default as ButtonGroupText } from './ButtonGroupText.vue.js';
5
+ export declare const buttonGroupVariants: (props?: ({
6
+ orientation?: "horizontal" | "vertical" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type ButtonGroupVariants = VariantProps<typeof buttonGroupVariants>;
@@ -0,0 +1,18 @@
1
+ import { cva } from "class-variance-authority";
2
+ export { default as ButtonGroup } from "./ButtonGroup.vue";
3
+ export { default as ButtonGroupSeparator } from "./ButtonGroupSeparator.vue";
4
+ export { default as ButtonGroupText } from "./ButtonGroupText.vue";
5
+ export const buttonGroupVariants = cva(
6
+ "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
7
+ {
8
+ variants: {
9
+ orientation: {
10
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
11
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
12
+ }
13
+ },
14
+ defaultVariants: {
15
+ orientation: "horizontal"
16
+ }
17
+ }
18
+ );