@shwfed/nuxt 0.10.15 → 0.11.0

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 (60) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/button.d.vue.ts +6 -2
  3. package/dist/runtime/components/button.vue +18 -3
  4. package/dist/runtime/components/button.vue.d.ts +6 -2
  5. package/dist/runtime/components/component-config.d.ts +12 -0
  6. package/dist/runtime/components/component-config.js +22 -0
  7. package/dist/runtime/components/fields.d.vue.ts +9 -5
  8. package/dist/runtime/components/fields.vue +14 -5
  9. package/dist/runtime/components/fields.vue.d.ts +9 -5
  10. package/dist/runtime/components/markdown.d.vue.ts +19 -9
  11. package/dist/runtime/components/markdown.vue +15 -3
  12. package/dist/runtime/components/markdown.vue.d.ts +19 -9
  13. package/dist/runtime/components/menu-tabs.d.vue.ts +14 -4
  14. package/dist/runtime/components/menu-tabs.vue +15 -3
  15. package/dist/runtime/components/menu-tabs.vue.d.ts +14 -4
  16. package/dist/runtime/components/table.d.vue.ts +8 -3
  17. package/dist/runtime/components/table.vue +28 -2
  18. package/dist/runtime/components/table.vue.d.ts +8 -3
  19. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +4 -0
  20. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +12 -4
  21. package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +4 -0
  22. package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +9 -4
  23. package/dist/runtime/components/ui/buttons/Buttons.vue +15 -4
  24. package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +9 -4
  25. package/dist/runtime/components/ui/buttons/schema.d.ts +255 -2
  26. package/dist/runtime/components/ui/buttons/schema.js +13 -21
  27. package/dist/runtime/components/ui/fields/Fields.d.vue.ts +10 -2
  28. package/dist/runtime/components/ui/fields/Fields.vue +12 -3
  29. package/dist/runtime/components/ui/fields/Fields.vue.d.ts +10 -2
  30. package/dist/runtime/components/ui/fields/schema.d.ts +464 -0
  31. package/dist/runtime/components/ui/fields/schema.js +15 -2
  32. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +4 -0
  33. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +10 -4
  34. package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +4 -0
  35. package/dist/runtime/components/ui/markdown/Markdown.d.vue.ts +18 -8
  36. package/dist/runtime/components/ui/markdown/Markdown.vue +13 -3
  37. package/dist/runtime/components/ui/markdown/Markdown.vue.d.ts +18 -8
  38. package/dist/runtime/components/ui/markdown/schema.d.ts +51 -6
  39. package/dist/runtime/components/ui/markdown/schema.js +15 -2
  40. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.d.vue.ts +16 -7
  41. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue +12 -7
  42. package/dist/runtime/components/ui/markdown-configurator/MarkdownConfiguratorDialog.vue.d.ts +16 -7
  43. package/dist/runtime/components/ui/menu-tabs/MenuTabs.d.vue.ts +14 -4
  44. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue +16 -5
  45. package/dist/runtime/components/ui/menu-tabs/MenuTabs.vue.d.ts +14 -4
  46. package/dist/runtime/components/ui/menu-tabs/schema.d.ts +42 -5
  47. package/dist/runtime/components/ui/menu-tabs/schema.js +13 -12
  48. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.d.vue.ts +12 -3
  49. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue +9 -5
  50. package/dist/runtime/components/ui/menu-tabs-configurator/MenuTabsConfiguratorDialog.vue.d.ts +12 -3
  51. package/dist/runtime/components/ui/table/Table.d.vue.ts +6 -2
  52. package/dist/runtime/components/ui/table/Table.vue +18 -2
  53. package/dist/runtime/components/ui/table/Table.vue.d.ts +6 -2
  54. package/dist/runtime/components/ui/table/schema.d.ts +239 -2
  55. package/dist/runtime/components/ui/table/schema.js +15 -6
  56. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.d.vue.ts +4 -0
  57. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue +2 -1
  58. package/dist/runtime/components/ui/table-configurator/TableConfiguratorDialog.vue.d.ts +4 -0
  59. package/dist/runtime/plugins/toast/index.d.ts +2 -2
  60. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
+ import { Effect } from 'effect';
1
2
  import type { TableConfigInput } from './ui/table/schema.js';
2
3
  export type { Accessor, Column, Expression, Markdown, Render, TableConfig, TableConfigInput } from './ui/table/schema.js';
3
4
  export type { TableInstance } from './ui/table/Table.vue.js';
4
- export { AccessorC, ColumnC, RenderC, TableConfigC } from './ui/table/schema.js';
5
+ export { AccessorC, ColumnC, CURRENT_COMPATIBILITY_DATE, KIND, RenderC, SUPPORTED_COMPATIBILITY_DATES, TableBodyC, TableBodyInputC, TableConfigC, TableConfigInputC, createTableConfig, } from './ui/table/schema.js';
5
6
  declare module '@tanstack/vue-table' {
6
7
  interface ColumnMeta<TData extends import('@tanstack/vue-table').RowData, TValue> {
7
8
  tooltip?: string;
@@ -13,11 +14,13 @@ declare module '@tanstack/vue-table' {
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
15
16
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
16
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
17
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
17
18
  data: Array<unknown>;
18
19
  rowCount?: number;
19
20
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
21
  "update:config": (args_0: Readonly<{
22
+ kind: string;
23
+ compatibilityDate: string;
21
24
  getRowId?: import("./table.vue.js").Expression;
22
25
  getSubRows?: import("./table.vue.js").Expression;
23
26
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -74,11 +77,13 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
74
77
  paginationPageSizes?: ReadonlyArray<number>;
75
78
  }>) => any;
76
79
  }, string, import("vue").PublicProps, Readonly<{
77
- config?: TableConfigInput | import("effect").Effect.Effect<TableConfigInput | undefined>;
80
+ config?: TableConfigInput | Effect.Effect<TableConfigInput | undefined>;
78
81
  data: Array<unknown>;
79
82
  rowCount?: number;
80
83
  }> & Readonly<{
81
84
  "onUpdate:config"?: ((args_0: Readonly<{
85
+ kind: string;
86
+ compatibilityDate: string;
82
87
  getRowId?: import("./table.vue.js").Expression;
83
88
  getSubRows?: import("./table.vue.js").Expression;
84
89
  enableRowSelection?: import("./table.vue.js").Expression;
@@ -72,6 +72,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
72
72
  icon?: string | undefined;
73
73
  }>)[];
74
74
  }>[];
75
+ kind: string;
76
+ compatibilityDate: string;
75
77
  gap?: number | undefined;
76
78
  style?: string | undefined;
77
79
  }>) => any;
@@ -141,6 +143,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
141
143
  icon?: string | undefined;
142
144
  }>)[];
143
145
  }>[];
146
+ kind: string;
147
+ compatibilityDate: string;
144
148
  gap?: number | undefined;
145
149
  style?: string | undefined;
146
150
  }>) => any) | undefined;
@@ -7,7 +7,11 @@ import { computed, nextTick, ref, watch } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import { cn } from "../../../utils/cn";
9
9
  import { Button } from "../button";
10
- import { ButtonConfigC, ButtonsStyleC } from "../buttons/schema";
10
+ import {
11
+ ButtonBodyC,
12
+ ButtonConfigC,
13
+ ButtonsStyleC
14
+ } from "../buttons/schema";
11
15
  import { Checkbox } from "../checkbox";
12
16
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../dialog";
13
17
  import { IconPicker } from "../icon-picker";
@@ -492,15 +496,19 @@ function buildDraftConfig() {
492
496
  selectedItemId.value = "general";
493
497
  return;
494
498
  }
495
- const result = ButtonConfigC.safeParse({
499
+ const bodyResult = ButtonBodyC.safeParse({
496
500
  gap: draftGap.value,
497
501
  style: generalStyleResult.data,
498
502
  groups: materializeButtonConfiguratorTree(draftTree.value)
499
503
  });
500
- if (!result.success) {
504
+ if (!bodyResult.success) {
501
505
  return;
502
506
  }
503
- return result.data;
507
+ return ButtonConfigC.parse({
508
+ ...bodyResult.data,
509
+ kind: props.config.kind,
510
+ compatibilityDate: props.config.compatibilityDate
511
+ });
504
512
  }
505
513
  function getValidDraftConfig(errorMessage) {
506
514
  const config = buildDraftConfig();
@@ -72,6 +72,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
72
72
  icon?: string | undefined;
73
73
  }>)[];
74
74
  }>[];
75
+ kind: string;
76
+ compatibilityDate: string;
75
77
  gap?: number | undefined;
76
78
  style?: string | undefined;
77
79
  }>) => any;
@@ -141,6 +143,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
141
143
  icon?: string | undefined;
142
144
  }>)[];
143
145
  }>[];
146
+ kind: string;
147
+ compatibilityDate: string;
144
148
  gap?: number | undefined;
145
149
  style?: string | undefined;
146
150
  }>) => any) | undefined;
@@ -1,11 +1,12 @@
1
1
  import { Effect } from 'effect';
2
- import { type ButtonConfig } from './schema.js';
2
+ import { type ButtonConfigInput } from './schema.js';
3
3
  export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './schema.js';
4
- export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal } from './schema.js';
4
+ export { ButtonBodyC, ButtonBodyInputC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './schema.js';
5
+ export type { ButtonAction, ButtonBody, ButtonBodyInput, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal, } from './schema.js';
5
6
  declare const _default: typeof __VLS_export;
6
7
  export default _default;
7
8
  declare const __VLS_export: import("vue").DefineComponent<{
8
- config: Effect.Effect<ButtonConfig | import("./schema.js").ButtonConfigInput | undefined>;
9
+ config: Effect.Effect<ButtonConfigInput | undefined>;
9
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
11
  "update:config": (args_0: Readonly<{
11
12
  groups: readonly Readonly<{
@@ -71,11 +72,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
71
72
  icon?: string | undefined;
72
73
  }>)[];
73
74
  }>[];
75
+ kind: string;
76
+ compatibilityDate: string;
74
77
  gap?: number | undefined;
75
78
  style?: string | undefined;
76
79
  }>) => any;
77
80
  }, string, import("vue").PublicProps, Readonly<{
78
- config: Effect.Effect<ButtonConfig | import("./schema.js").ButtonConfigInput | undefined>;
81
+ config: Effect.Effect<ButtonConfigInput | undefined>;
79
82
  }> & Readonly<{
80
83
  "onUpdate:config"?: ((args_0: Readonly<{
81
84
  groups: readonly Readonly<{
@@ -141,6 +144,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
141
144
  icon?: string | undefined;
142
145
  }>)[];
143
146
  }>[];
147
+ kind: string;
148
+ compatibilityDate: string;
144
149
  gap?: number | undefined;
145
150
  style?: string | undefined;
146
151
  }>) => any) | undefined;
@@ -15,7 +15,10 @@ import { ButtonGroup } from "../button-group";
15
15
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu";
16
16
  import { Skeleton } from "../skeleton";
17
17
  import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip";
18
- import { ButtonConfigC, normalizeButtonConfigInput } from "./schema";
18
+ import {
19
+ ButtonConfigC,
20
+ createButtonConfig
21
+ } from "./schema";
19
22
  defineOptions({
20
23
  inheritAttrs: false
21
24
  });
@@ -23,10 +26,10 @@ const props = defineProps({
23
26
  config: { type: null, required: true }
24
27
  });
25
28
  const emit = defineEmits(["update:config"]);
26
- const defaultConfig = {
29
+ const defaultConfig = createButtonConfig({
27
30
  gap: 4,
28
31
  groups: []
29
- };
32
+ });
30
33
  const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
31
34
  const attrs = useAttrs();
32
35
  const slots = useSlots();
@@ -38,7 +41,7 @@ const isConfiguratorOpen = ref(false);
38
41
  const pendingIds = ref([]);
39
42
  const overlayOwnerId = crypto.randomUUID();
40
43
  const currentConfig = computedAsync(
41
- async () => ButtonConfigC.parse(normalizeButtonConfigInput(await props.config.pipe(Effect.runPromise)))
44
+ async () => ButtonConfigC.parse(await props.config.pipe(Effect.runPromise) ?? defaultConfig)
42
45
  );
43
46
  const displayConfig = ref(defaultConfig);
44
47
  watch(currentConfig, (value) => {
@@ -200,6 +203,14 @@ function hasLeadingPrimaryGap(items, itemIndex) {
200
203
 
201
204
  <script>
202
205
  export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from "./schema";
206
+ export {
207
+ ButtonBodyC,
208
+ ButtonBodyInputC,
209
+ CURRENT_COMPATIBILITY_DATE,
210
+ KIND,
211
+ SUPPORTED_COMPATIBILITY_DATES,
212
+ createButtonConfig
213
+ } from "./schema";
203
214
  </script>
204
215
 
205
216
  <template>
@@ -1,11 +1,12 @@
1
1
  import { Effect } from 'effect';
2
- import { type ButtonConfig } from './schema.js';
2
+ import { type ButtonConfigInput } from './schema.js';
3
3
  export { ButtonActionC, ButtonConfigC, ButtonConfigInputC, ButtonDropdownC, ButtonGroupC, ButtonModalC, ButtonsStyleC } from './schema.js';
4
- export type { ButtonAction, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal } from './schema.js';
4
+ export { ButtonBodyC, ButtonBodyInputC, CURRENT_COMPATIBILITY_DATE, KIND, SUPPORTED_COMPATIBILITY_DATES, createButtonConfig, } from './schema.js';
5
+ export type { ButtonAction, ButtonBody, ButtonBodyInput, ButtonConfig, ButtonConfigInput, ButtonDropdown, ButtonDropdownAction, ButtonGroup, ButtonGroupItem, ButtonModal, } from './schema.js';
5
6
  declare const _default: typeof __VLS_export;
6
7
  export default _default;
7
8
  declare const __VLS_export: import("vue").DefineComponent<{
8
- config: Effect.Effect<ButtonConfig | import("./schema.js").ButtonConfigInput | undefined>;
9
+ config: Effect.Effect<ButtonConfigInput | undefined>;
9
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
11
  "update:config": (args_0: Readonly<{
11
12
  groups: readonly Readonly<{
@@ -71,11 +72,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
71
72
  icon?: string | undefined;
72
73
  }>)[];
73
74
  }>[];
75
+ kind: string;
76
+ compatibilityDate: string;
74
77
  gap?: number | undefined;
75
78
  style?: string | undefined;
76
79
  }>) => any;
77
80
  }, string, import("vue").PublicProps, Readonly<{
78
- config: Effect.Effect<ButtonConfig | import("./schema.js").ButtonConfigInput | undefined>;
81
+ config: Effect.Effect<ButtonConfigInput | undefined>;
79
82
  }> & Readonly<{
80
83
  "onUpdate:config"?: ((args_0: Readonly<{
81
84
  groups: readonly Readonly<{
@@ -141,6 +144,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
141
144
  icon?: string | undefined;
142
145
  }>)[];
143
146
  }>[];
147
+ kind: string;
148
+ compatibilityDate: string;
144
149
  gap?: number | undefined;
145
150
  style?: string | undefined;
146
151
  }>) => any) | undefined;
@@ -1,5 +1,8 @@
1
1
  import z from 'zod';
2
2
  import type { ButtonVariants } from '../button/index.js';
3
+ export declare const KIND = "shwfed.component.button";
4
+ export declare const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
5
+ export declare const SUPPORTED_COMPATIBILITY_DATES: string[];
3
6
  export declare const ButtonsStyleC: z.ZodOptional<z.ZodString>;
4
7
  export declare const ButtonModalC: z.ZodReadonly<z.ZodObject<{
5
8
  title: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
@@ -424,6 +427,250 @@ export declare const ButtonGroupC: z.ZodReadonly<z.ZodObject<{
424
427
  }, z.core.$strict>>>>;
425
428
  }, z.core.$strict>>]>>>;
426
429
  }, z.core.$strict>>;
430
+ export declare const ButtonBodyC: z.ZodReadonly<z.ZodObject<{
431
+ gap: z.ZodOptional<z.ZodNumber>;
432
+ style: z.ZodOptional<z.ZodString>;
433
+ groups: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
434
+ id: z.ZodUUID;
435
+ items: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
436
+ id: z.ZodUUID;
437
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
438
+ locale: z.ZodEnum<{
439
+ zh: "zh";
440
+ ja: "ja";
441
+ en: "en";
442
+ ko: "ko";
443
+ }>;
444
+ message: z.ZodString;
445
+ }, z.core.$strip>>>;
446
+ tooltip: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
447
+ locale: z.ZodEnum<{
448
+ zh: "zh";
449
+ ja: "ja";
450
+ en: "en";
451
+ ko: "ko";
452
+ }>;
453
+ message: z.ZodString;
454
+ }, z.core.$strip>>>>;
455
+ icon: z.ZodOptional<z.ZodString>;
456
+ variant: z.ZodOptional<z.ZodEnum<{
457
+ default: "default";
458
+ destructive: "destructive";
459
+ primary: "primary";
460
+ ghost: "ghost";
461
+ }>>;
462
+ hideTitle: z.ZodOptional<z.ZodBoolean>;
463
+ modal: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
464
+ title: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
465
+ locale: z.ZodEnum<{
466
+ zh: "zh";
467
+ ja: "ja";
468
+ en: "en";
469
+ ko: "ko";
470
+ }>;
471
+ message: z.ZodString;
472
+ }, z.core.$strip>>>>;
473
+ description: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
474
+ locale: z.ZodEnum<{
475
+ zh: "zh";
476
+ ja: "ja";
477
+ en: "en";
478
+ ko: "ko";
479
+ }>;
480
+ message: z.ZodString;
481
+ }, z.core.$strip>>>>;
482
+ showCloseButton: z.ZodOptional<z.ZodBoolean>;
483
+ breakpoint: z.ZodOptional<z.ZodString>;
484
+ dismissible: z.ZodOptional<z.ZodBoolean>;
485
+ }, z.core.$strict>>>;
486
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
487
+ id: z.ZodUUID;
488
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
489
+ locale: z.ZodEnum<{
490
+ zh: "zh";
491
+ ja: "ja";
492
+ en: "en";
493
+ ko: "ko";
494
+ }>;
495
+ message: z.ZodString;
496
+ }, z.core.$strip>>>;
497
+ icon: z.ZodOptional<z.ZodString>;
498
+ items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
499
+ id: z.ZodUUID;
500
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
501
+ locale: z.ZodEnum<{
502
+ zh: "zh";
503
+ ja: "ja";
504
+ en: "en";
505
+ ko: "ko";
506
+ }>;
507
+ message: z.ZodString;
508
+ }, z.core.$strip>>>;
509
+ tooltip: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
510
+ locale: z.ZodEnum<{
511
+ zh: "zh";
512
+ ja: "ja";
513
+ en: "en";
514
+ ko: "ko";
515
+ }>;
516
+ message: z.ZodString;
517
+ }, z.core.$strip>>>>;
518
+ icon: z.ZodOptional<z.ZodString>;
519
+ variant: z.ZodOptional<z.ZodEnum<{
520
+ default: "default";
521
+ destructive: "destructive";
522
+ primary: "primary";
523
+ ghost: "ghost";
524
+ }>>;
525
+ modal: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
526
+ title: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
527
+ locale: z.ZodEnum<{
528
+ zh: "zh";
529
+ ja: "ja";
530
+ en: "en";
531
+ ko: "ko";
532
+ }>;
533
+ message: z.ZodString;
534
+ }, z.core.$strip>>>>;
535
+ description: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
536
+ locale: z.ZodEnum<{
537
+ zh: "zh";
538
+ ja: "ja";
539
+ en: "en";
540
+ ko: "ko";
541
+ }>;
542
+ message: z.ZodString;
543
+ }, z.core.$strip>>>>;
544
+ showCloseButton: z.ZodOptional<z.ZodBoolean>;
545
+ breakpoint: z.ZodOptional<z.ZodString>;
546
+ dismissible: z.ZodOptional<z.ZodBoolean>;
547
+ }, z.core.$strict>>>;
548
+ }, z.core.$strict>>>>;
549
+ }, z.core.$strict>>]>>>;
550
+ }, z.core.$strict>>>>;
551
+ }, z.core.$strict>>;
552
+ export declare const ButtonBodyInputC: z.ZodReadonly<z.ZodObject<{
553
+ gap: z.ZodOptional<z.ZodNumber>;
554
+ style: z.ZodOptional<z.ZodString>;
555
+ groups: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
556
+ id: z.ZodUUID;
557
+ items: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
558
+ id: z.ZodUUID;
559
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
560
+ locale: z.ZodEnum<{
561
+ zh: "zh";
562
+ ja: "ja";
563
+ en: "en";
564
+ ko: "ko";
565
+ }>;
566
+ message: z.ZodString;
567
+ }, z.core.$strip>>>;
568
+ tooltip: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
569
+ locale: z.ZodEnum<{
570
+ zh: "zh";
571
+ ja: "ja";
572
+ en: "en";
573
+ ko: "ko";
574
+ }>;
575
+ message: z.ZodString;
576
+ }, z.core.$strip>>>>;
577
+ icon: z.ZodOptional<z.ZodString>;
578
+ variant: z.ZodOptional<z.ZodEnum<{
579
+ default: "default";
580
+ destructive: "destructive";
581
+ primary: "primary";
582
+ ghost: "ghost";
583
+ }>>;
584
+ hideTitle: z.ZodOptional<z.ZodBoolean>;
585
+ modal: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
586
+ title: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
587
+ locale: z.ZodEnum<{
588
+ zh: "zh";
589
+ ja: "ja";
590
+ en: "en";
591
+ ko: "ko";
592
+ }>;
593
+ message: z.ZodString;
594
+ }, z.core.$strip>>>>;
595
+ description: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
596
+ locale: z.ZodEnum<{
597
+ zh: "zh";
598
+ ja: "ja";
599
+ en: "en";
600
+ ko: "ko";
601
+ }>;
602
+ message: z.ZodString;
603
+ }, z.core.$strip>>>>;
604
+ showCloseButton: z.ZodOptional<z.ZodBoolean>;
605
+ breakpoint: z.ZodOptional<z.ZodString>;
606
+ dismissible: z.ZodOptional<z.ZodBoolean>;
607
+ }, z.core.$strict>>>;
608
+ }, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
609
+ id: z.ZodUUID;
610
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
611
+ locale: z.ZodEnum<{
612
+ zh: "zh";
613
+ ja: "ja";
614
+ en: "en";
615
+ ko: "ko";
616
+ }>;
617
+ message: z.ZodString;
618
+ }, z.core.$strip>>>;
619
+ icon: z.ZodOptional<z.ZodString>;
620
+ items: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
621
+ id: z.ZodUUID;
622
+ title: z.ZodReadonly<z.ZodArray<z.ZodObject<{
623
+ locale: z.ZodEnum<{
624
+ zh: "zh";
625
+ ja: "ja";
626
+ en: "en";
627
+ ko: "ko";
628
+ }>;
629
+ message: z.ZodString;
630
+ }, z.core.$strip>>>;
631
+ tooltip: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
632
+ locale: z.ZodEnum<{
633
+ zh: "zh";
634
+ ja: "ja";
635
+ en: "en";
636
+ ko: "ko";
637
+ }>;
638
+ message: z.ZodString;
639
+ }, z.core.$strip>>>>;
640
+ icon: z.ZodOptional<z.ZodString>;
641
+ variant: z.ZodOptional<z.ZodEnum<{
642
+ default: "default";
643
+ destructive: "destructive";
644
+ primary: "primary";
645
+ ghost: "ghost";
646
+ }>>;
647
+ modal: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
648
+ title: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
649
+ locale: z.ZodEnum<{
650
+ zh: "zh";
651
+ ja: "ja";
652
+ en: "en";
653
+ ko: "ko";
654
+ }>;
655
+ message: z.ZodString;
656
+ }, z.core.$strip>>>>;
657
+ description: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
658
+ locale: z.ZodEnum<{
659
+ zh: "zh";
660
+ ja: "ja";
661
+ en: "en";
662
+ ko: "ko";
663
+ }>;
664
+ message: z.ZodString;
665
+ }, z.core.$strip>>>>;
666
+ showCloseButton: z.ZodOptional<z.ZodBoolean>;
667
+ breakpoint: z.ZodOptional<z.ZodString>;
668
+ dismissible: z.ZodOptional<z.ZodBoolean>;
669
+ }, z.core.$strict>>>;
670
+ }, z.core.$strict>>>>;
671
+ }, z.core.$strict>>]>>>;
672
+ }, z.core.$strict>>>>;
673
+ }, z.core.$strict>>;
427
674
  export declare const ButtonConfigC: z.ZodReadonly<z.ZodObject<{
428
675
  gap: z.ZodOptional<z.ZodNumber>;
429
676
  style: z.ZodOptional<z.ZodString>;
@@ -545,6 +792,8 @@ export declare const ButtonConfigC: z.ZodReadonly<z.ZodObject<{
545
792
  }, z.core.$strict>>>>;
546
793
  }, z.core.$strict>>]>>>;
547
794
  }, z.core.$strict>>>>;
795
+ kind: z.ZodLiteral<string>;
796
+ compatibilityDate: z.ZodString;
548
797
  }, z.core.$strict>>;
549
798
  export declare const ButtonConfigInputC: z.ZodReadonly<z.ZodObject<{
550
799
  gap: z.ZodOptional<z.ZodNumber>;
@@ -667,6 +916,8 @@ export declare const ButtonConfigInputC: z.ZodReadonly<z.ZodObject<{
667
916
  }, z.core.$strict>>>>;
668
917
  }, z.core.$strict>>]>>>;
669
918
  }, z.core.$strict>>>>;
919
+ kind: z.ZodLiteral<string>;
920
+ compatibilityDate: z.ZodString;
670
921
  }, z.core.$strict>>;
671
922
  export type ButtonModal = z.infer<typeof ButtonModalC>;
672
923
  export type ButtonAction = z.infer<typeof ButtonActionC>;
@@ -674,8 +925,10 @@ export type ButtonDropdown = z.infer<typeof ButtonDropdownC>;
674
925
  export type ButtonDropdownAction = z.infer<typeof DropdownButtonActionC>;
675
926
  export type ButtonGroupItem = z.infer<typeof ButtonGroupItemC>;
676
927
  export type ButtonGroup = z.infer<typeof ButtonGroupC>;
928
+ export type ButtonBody = z.infer<typeof ButtonBodyC>;
929
+ export type ButtonBodyInput = z.input<typeof ButtonBodyInputC>;
677
930
  export type ButtonConfig = z.infer<typeof ButtonConfigC>;
678
- export type ButtonConfigInput = z.infer<typeof ButtonConfigInputC>;
679
- export declare function normalizeButtonConfigInput(value: unknown): unknown;
931
+ export type ButtonConfigInput = z.input<typeof ButtonConfigInputC>;
932
+ export declare function createButtonConfig(body: ButtonBody): ButtonConfig;
680
933
  export type ButtonVariant = ButtonVariants['variant'];
681
934
  export {};
@@ -1,7 +1,11 @@
1
1
  import z from "zod";
2
+ import { createComponentConfig, createComponentConfigMetadataShape } from "../../component-config.js";
2
3
  import { expressionC, localeC } from "../../../utils/coders.js";
3
4
  const buttonIdC = z.uuid().describe("\u6309\u94AE\u552F\u4E00\u6807\u8BC6\uFF0C\u5FC5\u987B\u662F UUID");
4
5
  const buttonGroupIdC = z.uuid().describe("\u6309\u94AE\u7EC4\u552F\u4E00\u6807\u8BC6\uFF0C\u5FC5\u987B\u662F UUID");
6
+ export const KIND = "shwfed.component.button";
7
+ export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
8
+ export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
5
9
  const buttonVariantC = z.enum(["default", "primary", "destructive", "ghost"]).optional().describe("\u6309\u94AE\u53D8\u4F53");
6
10
  export const ButtonsStyleC = expressionC(/^map/).optional().describe("\u8FD4\u56DE\u6309\u94AE\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F");
7
11
  export const ButtonModalC = z.strictObject({
@@ -39,29 +43,17 @@ export const ButtonGroupC = z.strictObject({
39
43
  id: buttonGroupIdC,
40
44
  items: z.array(ButtonGroupItemC).readonly().describe("\u6309\u94AE\u7EC4\u5185\u7684\u6309\u94AE\u4E0E\u4E0B\u62C9\u6309\u94AE")
41
45
  }).readonly();
42
- export const ButtonConfigC = z.strictObject({
46
+ const ButtonBodyObjectC = z.strictObject({
43
47
  gap: z.number().finite().min(0).optional().describe("\u6309\u94AE\u7EC4\u4E4B\u95F4\u7684\u95F4\u8DDD\u500D\u7387\uFF0C\u8FD0\u884C\u65F6\u6309 0.25rem \u6B65\u8FDB\u6362\u7B97"),
44
48
  style: ButtonsStyleC,
45
49
  groups: z.array(ButtonGroupC).readonly().describe("\u6839\u7EA7\u6309\u94AE\u7EC4\u5217\u8868")
46
- }).readonly();
50
+ });
51
+ export const ButtonBodyC = ButtonBodyObjectC.readonly();
52
+ export const ButtonBodyInputC = ButtonBodyC;
53
+ export const ButtonConfigC = ButtonBodyObjectC.extend(
54
+ createComponentConfigMetadataShape(KIND, SUPPORTED_COMPATIBILITY_DATES)
55
+ ).readonly();
47
56
  export const ButtonConfigInputC = ButtonConfigC;
48
- export function normalizeButtonConfigInput(value) {
49
- if (typeof value !== "object" || value === null) {
50
- return {
51
- groups: []
52
- };
53
- }
54
- const groups = Reflect.get(value, "groups");
55
- const gap = Reflect.get(value, "gap");
56
- const style = Reflect.get(value, "style");
57
- const nextConfig = {
58
- groups: Array.isArray(groups) ? groups : []
59
- };
60
- if (typeof gap === "number" && Number.isFinite(gap) && gap >= 0) {
61
- nextConfig.gap = gap;
62
- }
63
- if (typeof style === "string") {
64
- nextConfig.style = style;
65
- }
66
- return nextConfig;
57
+ export function createButtonConfig(body) {
58
+ return createComponentConfig(KIND, CURRENT_COMPATIBILITY_DATE, body);
67
59
  }
@@ -1,7 +1,7 @@
1
1
  import { Effect } from 'effect';
2
2
  import type { CSSProperties } from 'vue';
3
- export { CalendarFieldC, EmptyFieldC, FieldC, FieldsConfigC, NumberFieldC, SelectFieldC, SlotFieldC, StringFieldC, ValidationRuleC, validationC, } from './schema.js';
4
- export type { EmptyField, Field, FieldsConfig, SlotField, ValidationRule } from './schema.js';
3
+ export { CalendarFieldC, CURRENT_COMPATIBILITY_DATE, EmptyFieldC, FieldC, FieldsBodyC, FieldsBodyInputC, FieldsConfigC, FieldsConfigInputC, KIND, NumberFieldC, SelectFieldC, SlotFieldC, SUPPORTED_COMPATIBILITY_DATES, StringFieldC, ValidationRuleC, createFieldsConfig, validationC, } from './schema.js';
4
+ export type { EmptyField, Field, FieldsBody, FieldsBodyInput, FieldsConfig, FieldsConfigInput, SlotField, ValidationRule, } from './schema.js';
5
5
  declare const _default: typeof __VLS_export;
6
6
  export default _default;
7
7
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
@@ -120,6 +120,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
120
120
  type: "empty";
121
121
  style?: string | undefined;
122
122
  })[];
123
+ kind: string;
124
+ compatibilityDate: string;
123
125
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
124
126
  style?: string | undefined;
125
127
  }> | undefined>;
@@ -242,6 +244,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
242
244
  type: "empty";
243
245
  style?: string | undefined;
244
246
  })[];
247
+ kind: string;
248
+ compatibilityDate: string;
245
249
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
246
250
  style?: string | undefined;
247
251
  }>) => any;
@@ -362,6 +366,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
362
366
  type: "empty";
363
367
  style?: string | undefined;
364
368
  })[];
369
+ kind: string;
370
+ compatibilityDate: string;
365
371
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
366
372
  style?: string | undefined;
367
373
  }> | undefined>;
@@ -484,6 +490,8 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
484
490
  type: "empty";
485
491
  style?: string | undefined;
486
492
  })[];
493
+ kind: string;
494
+ compatibilityDate: string;
487
495
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
488
496
  style?: string | undefined;
489
497
  }>) => any) | undefined;