@colletdev/vue 0.1.3

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 (108) hide show
  1. package/README.md +64 -0
  2. package/dist/accordion.d.ts +68 -0
  3. package/dist/accordion.js +68 -0
  4. package/dist/activity-group.d.ts +56 -0
  5. package/dist/activity-group.js +50 -0
  6. package/dist/alert.d.ts +94 -0
  7. package/dist/alert.js +76 -0
  8. package/dist/autocomplete.d.ts +161 -0
  9. package/dist/autocomplete.js +132 -0
  10. package/dist/avatar.d.ts +50 -0
  11. package/dist/avatar.js +47 -0
  12. package/dist/backdrop.d.ts +25 -0
  13. package/dist/backdrop.js +35 -0
  14. package/dist/badge.d.ts +74 -0
  15. package/dist/badge.js +59 -0
  16. package/dist/breadcrumb.d.ts +49 -0
  17. package/dist/breadcrumb.js +53 -0
  18. package/dist/button.d.ts +92 -0
  19. package/dist/button.js +68 -0
  20. package/dist/card.d.ts +60 -0
  21. package/dist/card.js +58 -0
  22. package/dist/carousel.d.ts +97 -0
  23. package/dist/carousel.js +77 -0
  24. package/dist/chat-input.d.ts +99 -0
  25. package/dist/chat-input.js +79 -0
  26. package/dist/checkbox.d.ts +93 -0
  27. package/dist/checkbox.js +75 -0
  28. package/dist/code-block.d.ts +77 -0
  29. package/dist/code-block.js +59 -0
  30. package/dist/collapsible.d.ts +73 -0
  31. package/dist/collapsible.js +62 -0
  32. package/dist/date-picker.d.ts +145 -0
  33. package/dist/date-picker.js +111 -0
  34. package/dist/dialog.d.ts +61 -0
  35. package/dist/dialog.js +63 -0
  36. package/dist/drawer.d.ts +61 -0
  37. package/dist/drawer.js +63 -0
  38. package/dist/fab.d.ts +81 -0
  39. package/dist/fab.js +62 -0
  40. package/dist/file-upload.d.ts +104 -0
  41. package/dist/file-upload.js +74 -0
  42. package/dist/index.d.ts +54 -0
  43. package/dist/index.js +54 -0
  44. package/dist/label.d.ts +66 -0
  45. package/dist/label.js +48 -0
  46. package/dist/listbox.d.ts +65 -0
  47. package/dist/listbox.js +77 -0
  48. package/dist/menu.d.ts +83 -0
  49. package/dist/menu.js +78 -0
  50. package/dist/message-bubble.d.ts +74 -0
  51. package/dist/message-bubble.js +67 -0
  52. package/dist/message-group.d.ts +51 -0
  53. package/dist/message-group.js +59 -0
  54. package/dist/message-part.d.ts +3 -0
  55. package/dist/message-part.js +25 -0
  56. package/dist/pagination.d.ts +81 -0
  57. package/dist/pagination.js +59 -0
  58. package/dist/popover.d.ts +104 -0
  59. package/dist/popover.js +92 -0
  60. package/dist/profile-menu.d.ts +77 -0
  61. package/dist/profile-menu.js +72 -0
  62. package/dist/progress.d.ts +50 -0
  63. package/dist/progress.js +48 -0
  64. package/dist/radio-group.d.ts +92 -0
  65. package/dist/radio-group.js +84 -0
  66. package/dist/scrollbar.d.ts +48 -0
  67. package/dist/scrollbar.js +55 -0
  68. package/dist/search-bar.d.ts +127 -0
  69. package/dist/search-bar.js +105 -0
  70. package/dist/select.d.ts +124 -0
  71. package/dist/select.js +114 -0
  72. package/dist/separator.d.ts +51 -0
  73. package/dist/separator.js +42 -0
  74. package/dist/sidebar.d.ts +69 -0
  75. package/dist/sidebar.js +68 -0
  76. package/dist/skeleton.d.ts +42 -0
  77. package/dist/skeleton.js +44 -0
  78. package/dist/slider.d.ts +133 -0
  79. package/dist/slider.js +98 -0
  80. package/dist/speed-dial.d.ts +103 -0
  81. package/dist/speed-dial.js +79 -0
  82. package/dist/spinner.d.ts +30 -0
  83. package/dist/spinner.js +38 -0
  84. package/dist/split-button.d.ts +101 -0
  85. package/dist/split-button.js +77 -0
  86. package/dist/stepper.d.ts +67 -0
  87. package/dist/stepper.js +62 -0
  88. package/dist/switch.d.ts +100 -0
  89. package/dist/switch.js +75 -0
  90. package/dist/table.d.ts +135 -0
  91. package/dist/table.js +147 -0
  92. package/dist/tabs.d.ts +65 -0
  93. package/dist/tabs.js +67 -0
  94. package/dist/text-input.d.ts +193 -0
  95. package/dist/text-input.js +134 -0
  96. package/dist/text.d.ts +99 -0
  97. package/dist/text.js +88 -0
  98. package/dist/thinking.d.ts +42 -0
  99. package/dist/thinking.js +44 -0
  100. package/dist/toast.d.ts +86 -0
  101. package/dist/toast.js +72 -0
  102. package/dist/toggle-group.d.ts +83 -0
  103. package/dist/toggle-group.js +77 -0
  104. package/dist/tooltip.d.ts +52 -0
  105. package/dist/tooltip.js +50 -0
  106. package/dist/types.d.ts +256 -0
  107. package/dist/types.js +4 -0
  108. package/package.json +44 -0
@@ -0,0 +1,134 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-text-input>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const TextInput = defineComponent({
5
+ name: 'TextInput',
6
+ props: {
7
+ id: { type: String },
8
+ label: { type: String },
9
+ variant: { type: String },
10
+ shape: { type: String },
11
+ size: { type: String },
12
+ /** Input type. Use 'multiline' for textarea behavior with optional rows and autoGrow. */
13
+ kind: { type: String },
14
+ placeholder: { type: String },
15
+ /** Controlled value. Set via onInput callback. */
16
+ value: { type: String },
17
+ helperText: { type: String },
18
+ error: { type: String },
19
+ disabled: { type: Boolean },
20
+ readonly: { type: Boolean },
21
+ required: { type: Boolean },
22
+ clearable: { type: Boolean },
23
+ prefixIcon: { type: String },
24
+ suffixIcon: { type: String },
25
+ passwordToggle: { type: Boolean },
26
+ passwordVisible: { type: Boolean },
27
+ name: { type: String },
28
+ minLength: { type: Number },
29
+ maxLength: { type: Number },
30
+ pattern: { type: String },
31
+ autocomplete: { type: String },
32
+ rows: { type: Number },
33
+ autoGrow: { type: Boolean },
34
+ },
35
+ emits: {
36
+ 'cx-input': (event) => true,
37
+ 'cx-change': (event) => true,
38
+ 'cx-focus': (event) => true,
39
+ 'cx-blur': (event) => true,
40
+ 'cx-keydown': (event) => true,
41
+ 'cx-keyup': (event) => true,
42
+ },
43
+ setup(props, { emit, slots, expose }) {
44
+ const el = ref(null);
45
+ const listeners = [];
46
+ onMounted(() => {
47
+ if (!el.value)
48
+ return;
49
+ watch(() => props.value, (val) => {
50
+ if (!el.value)
51
+ return;
52
+ if (val != null)
53
+ el.value.setAttribute('value', String(val));
54
+ else
55
+ el.value.removeAttribute('value');
56
+ }, { immediate: true });
57
+ watch(() => props.name, (val) => {
58
+ if (!el.value)
59
+ return;
60
+ if (val != null)
61
+ el.value.setAttribute('name', String(val));
62
+ else
63
+ el.value.removeAttribute('name');
64
+ }, { immediate: true });
65
+ // Event listeners
66
+ el.value.addEventListener('cx-input', (ev) => emit('cx-input', ev));
67
+ el.value.addEventListener('cx-change', (ev) => emit('cx-change', ev));
68
+ el.value.addEventListener('cx-focus', (ev) => emit('cx-focus', ev));
69
+ el.value.addEventListener('cx-blur', (ev) => emit('cx-blur', ev));
70
+ el.value.addEventListener('cx-keydown', (ev) => emit('cx-keydown', ev));
71
+ el.value.addEventListener('cx-keyup', (ev) => emit('cx-keyup', ev));
72
+ });
73
+ expose({
74
+ /** Focuses the inner input or textarea. */
75
+ focus() { el.value?.focus(); },
76
+ /** Blurs the inner input or textarea. */
77
+ blur() { el.value?.blur(); },
78
+ /** Selects all text in the input. */
79
+ select() { el.value?.select(); },
80
+ /** The underlying Custom Element. */
81
+ el,
82
+ });
83
+ return () => {
84
+ const attrs = {};
85
+ if (props.id != null)
86
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
87
+ if (props.label != null)
88
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
89
+ if (props.variant != null)
90
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
91
+ if (props.shape != null)
92
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
93
+ if (props.size != null)
94
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
95
+ if (props.kind != null)
96
+ attrs['kind'] = typeof props.kind === 'object' ? JSON.stringify(props.kind) : String(props.kind);
97
+ if (props.placeholder != null)
98
+ attrs['placeholder'] = typeof props.placeholder === 'object' ? JSON.stringify(props.placeholder) : String(props.placeholder);
99
+ if (props.helperText != null)
100
+ attrs['helper-text'] = typeof props.helperText === 'object' ? JSON.stringify(props.helperText) : String(props.helperText);
101
+ if (props.error != null)
102
+ attrs['error'] = typeof props.error === 'object' ? JSON.stringify(props.error) : String(props.error);
103
+ if (props.disabled)
104
+ attrs['disabled'] = '';
105
+ if (props.readonly)
106
+ attrs['readonly'] = '';
107
+ if (props.required)
108
+ attrs['required'] = '';
109
+ if (props.clearable)
110
+ attrs['clearable'] = '';
111
+ if (props.prefixIcon != null)
112
+ attrs['prefix-icon'] = typeof props.prefixIcon === 'object' ? JSON.stringify(props.prefixIcon) : String(props.prefixIcon);
113
+ if (props.suffixIcon != null)
114
+ attrs['suffix-icon'] = typeof props.suffixIcon === 'object' ? JSON.stringify(props.suffixIcon) : String(props.suffixIcon);
115
+ if (props.passwordToggle)
116
+ attrs['password-toggle'] = '';
117
+ if (props.passwordVisible)
118
+ attrs['password-visible'] = '';
119
+ if (props.minLength != null)
120
+ attrs['min-length'] = typeof props.minLength === 'object' ? JSON.stringify(props.minLength) : String(props.minLength);
121
+ if (props.maxLength != null)
122
+ attrs['max-length'] = typeof props.maxLength === 'object' ? JSON.stringify(props.maxLength) : String(props.maxLength);
123
+ if (props.pattern != null)
124
+ attrs['pattern'] = typeof props.pattern === 'object' ? JSON.stringify(props.pattern) : String(props.pattern);
125
+ if (props.autocomplete != null)
126
+ attrs['autocomplete'] = typeof props.autocomplete === 'object' ? JSON.stringify(props.autocomplete) : String(props.autocomplete);
127
+ if (props.rows != null)
128
+ attrs['rows'] = typeof props.rows === 'object' ? JSON.stringify(props.rows) : String(props.rows);
129
+ if (props.autoGrow)
130
+ attrs['auto-grow'] = '';
131
+ return h('cx-text-input', { ref: el, ...attrs });
132
+ };
133
+ },
134
+ });
package/dist/text.d.ts ADDED
@@ -0,0 +1,99 @@
1
+ import { type PropType } from 'vue';
2
+ export declare const Text: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ id: {
4
+ type: StringConstructor;
5
+ };
6
+ role: {
7
+ type: PropType<"display" | "h1" | "h2" | "h3" | "label-lg" | "label-md" | "label-sm" | "body-lg" | "body-md" | "body-sm" | "overline" | "caption" | "code">;
8
+ };
9
+ align: {
10
+ type: PropType<"start" | "center" | "end">;
11
+ };
12
+ color: {
13
+ type: PropType<"primary" | "inverse" | "muted">;
14
+ };
15
+ muted: {
16
+ type: BooleanConstructor;
17
+ };
18
+ strong: {
19
+ type: BooleanConstructor;
20
+ };
21
+ italic: {
22
+ type: BooleanConstructor;
23
+ };
24
+ underline: {
25
+ type: BooleanConstructor;
26
+ };
27
+ underlineStrong: {
28
+ type: BooleanConstructor;
29
+ };
30
+ truncate: {
31
+ type: BooleanConstructor;
32
+ };
33
+ lineClamp: {
34
+ type: NumberConstructor;
35
+ };
36
+ balance: {
37
+ type: BooleanConstructor;
38
+ };
39
+ prose: {
40
+ type: BooleanConstructor;
41
+ };
42
+ elementAs: {
43
+ type: StringConstructor;
44
+ };
45
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
46
+ [key: string]: any;
47
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
48
+ id: {
49
+ type: StringConstructor;
50
+ };
51
+ role: {
52
+ type: PropType<"display" | "h1" | "h2" | "h3" | "label-lg" | "label-md" | "label-sm" | "body-lg" | "body-md" | "body-sm" | "overline" | "caption" | "code">;
53
+ };
54
+ align: {
55
+ type: PropType<"start" | "center" | "end">;
56
+ };
57
+ color: {
58
+ type: PropType<"primary" | "inverse" | "muted">;
59
+ };
60
+ muted: {
61
+ type: BooleanConstructor;
62
+ };
63
+ strong: {
64
+ type: BooleanConstructor;
65
+ };
66
+ italic: {
67
+ type: BooleanConstructor;
68
+ };
69
+ underline: {
70
+ type: BooleanConstructor;
71
+ };
72
+ underlineStrong: {
73
+ type: BooleanConstructor;
74
+ };
75
+ truncate: {
76
+ type: BooleanConstructor;
77
+ };
78
+ lineClamp: {
79
+ type: NumberConstructor;
80
+ };
81
+ balance: {
82
+ type: BooleanConstructor;
83
+ };
84
+ prose: {
85
+ type: BooleanConstructor;
86
+ };
87
+ elementAs: {
88
+ type: StringConstructor;
89
+ };
90
+ }>> & Readonly<{}>, {
91
+ strong: boolean;
92
+ underline: boolean;
93
+ muted: boolean;
94
+ italic: boolean;
95
+ underlineStrong: boolean;
96
+ truncate: boolean;
97
+ balance: boolean;
98
+ prose: boolean;
99
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/text.js ADDED
@@ -0,0 +1,88 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-text>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Text = defineComponent({
5
+ name: 'Text',
6
+ props: {
7
+ id: { type: String },
8
+ role: { type: String },
9
+ align: { type: String },
10
+ color: { type: String },
11
+ muted: { type: Boolean },
12
+ strong: { type: Boolean },
13
+ italic: { type: Boolean },
14
+ underline: { type: Boolean },
15
+ underlineStrong: { type: Boolean },
16
+ truncate: { type: Boolean },
17
+ lineClamp: { type: Number },
18
+ balance: { type: Boolean },
19
+ prose: { type: Boolean },
20
+ elementAs: { type: String },
21
+ },
22
+ emits: {},
23
+ setup(props, { emit, slots, expose }) {
24
+ const el = ref(null);
25
+ const listeners = [];
26
+ onMounted(() => {
27
+ if (!el.value)
28
+ return;
29
+ watch(() => props.role, (val) => {
30
+ if (!el.value)
31
+ return;
32
+ if (val != null)
33
+ el.value.setAttribute('role', String(val));
34
+ else
35
+ el.value.removeAttribute('role');
36
+ }, { immediate: true });
37
+ watch(() => props.align, (val) => {
38
+ if (!el.value)
39
+ return;
40
+ if (val != null)
41
+ el.value.setAttribute('align', String(val));
42
+ else
43
+ el.value.removeAttribute('align');
44
+ }, { immediate: true });
45
+ watch(() => props.color, (val) => {
46
+ if (!el.value)
47
+ return;
48
+ if (val != null)
49
+ el.value.setAttribute('color', String(val));
50
+ else
51
+ el.value.removeAttribute('color');
52
+ }, { immediate: true });
53
+ // Event listeners
54
+ });
55
+ expose({
56
+ /** The underlying Custom Element. */
57
+ el,
58
+ });
59
+ return () => {
60
+ const attrs = {};
61
+ if (props.id != null)
62
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
63
+ if (props.muted)
64
+ attrs['muted'] = '';
65
+ if (props.strong)
66
+ attrs['strong'] = '';
67
+ if (props.italic)
68
+ attrs['italic'] = '';
69
+ if (props.underline)
70
+ attrs['underline'] = '';
71
+ if (props.underlineStrong)
72
+ attrs['underline-strong'] = '';
73
+ if (props.truncate)
74
+ attrs['truncate'] = '';
75
+ if (props.lineClamp != null)
76
+ attrs['line-clamp'] = typeof props.lineClamp === 'object' ? JSON.stringify(props.lineClamp) : String(props.lineClamp);
77
+ if (props.balance)
78
+ attrs['balance'] = '';
79
+ if (props.prose)
80
+ attrs['prose'] = '';
81
+ if (props.elementAs != null)
82
+ attrs['element-as'] = typeof props.elementAs === 'object' ? JSON.stringify(props.elementAs) : String(props.elementAs);
83
+ return h('cx-text', { ref: el, ...attrs }, [
84
+ slots.default?.()
85
+ ]);
86
+ };
87
+ },
88
+ });
@@ -0,0 +1,42 @@
1
+ import { type PropType } from 'vue';
2
+ export declare const Thinking: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ id: {
4
+ type: StringConstructor;
5
+ };
6
+ variant: {
7
+ type: PropType<"ghost" | "filled">;
8
+ };
9
+ shape: {
10
+ type: PropType<"sharp" | "rounded" | "pill">;
11
+ };
12
+ label: {
13
+ type: StringConstructor;
14
+ };
15
+ size: {
16
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
17
+ };
18
+ speed: {
19
+ type: StringConstructor;
20
+ };
21
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
+ [key: string]: any;
23
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ id: {
25
+ type: StringConstructor;
26
+ };
27
+ variant: {
28
+ type: PropType<"ghost" | "filled">;
29
+ };
30
+ shape: {
31
+ type: PropType<"sharp" | "rounded" | "pill">;
32
+ };
33
+ label: {
34
+ type: StringConstructor;
35
+ };
36
+ size: {
37
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
38
+ };
39
+ speed: {
40
+ type: StringConstructor;
41
+ };
42
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,44 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-thinking>
3
+ import { defineComponent, ref, h, onMounted } from 'vue';
4
+ export const Thinking = defineComponent({
5
+ name: 'Thinking',
6
+ props: {
7
+ id: { type: String },
8
+ variant: { type: String },
9
+ shape: { type: String },
10
+ label: { type: String },
11
+ size: { type: String },
12
+ speed: { type: String },
13
+ },
14
+ emits: {},
15
+ setup(props, { emit, slots, expose }) {
16
+ const el = ref(null);
17
+ const listeners = [];
18
+ onMounted(() => {
19
+ if (!el.value)
20
+ return;
21
+ // Event listeners
22
+ });
23
+ expose({
24
+ /** The underlying Custom Element. */
25
+ el,
26
+ });
27
+ return () => {
28
+ const attrs = {};
29
+ if (props.id != null)
30
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
31
+ if (props.variant != null)
32
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
33
+ if (props.shape != null)
34
+ attrs['shape'] = typeof props.shape === 'object' ? JSON.stringify(props.shape) : String(props.shape);
35
+ if (props.label != null)
36
+ attrs['label'] = typeof props.label === 'object' ? JSON.stringify(props.label) : String(props.label);
37
+ if (props.size != null)
38
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
39
+ if (props.speed != null)
40
+ attrs['speed'] = typeof props.speed === 'object' ? JSON.stringify(props.speed) : String(props.speed);
41
+ return h('cx-thinking', { ref: el, ...attrs });
42
+ };
43
+ },
44
+ });
@@ -0,0 +1,86 @@
1
+ import { type PropType } from 'vue';
2
+ import type { DismissDetail } from './types.js';
3
+ export interface ToastRef {
4
+ /** Dismisses the toast with exit animation. */
5
+ dismiss(): void;
6
+ /** The underlying Custom Element. */
7
+ el: HTMLElement | null;
8
+ }
9
+ export declare const Toast: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ id: {
11
+ type: StringConstructor;
12
+ };
13
+ title: {
14
+ type: StringConstructor;
15
+ };
16
+ description: {
17
+ type: StringConstructor;
18
+ };
19
+ variant: {
20
+ type: PropType<"subtle" | "filled" | "outline">;
21
+ };
22
+ intent: {
23
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
24
+ };
25
+ size: {
26
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
27
+ };
28
+ showIcon: {
29
+ type: BooleanConstructor;
30
+ };
31
+ icon: {
32
+ type: StringConstructor;
33
+ };
34
+ dismissible: {
35
+ type: BooleanConstructor;
36
+ };
37
+ dismissLabel: {
38
+ type: StringConstructor;
39
+ };
40
+ duration: {
41
+ type: NumberConstructor;
42
+ };
43
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
44
+ [key: string]: any;
45
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
+ 'cx-dismiss': (event: CustomEvent<DismissDetail>) => true;
47
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
48
+ id: {
49
+ type: StringConstructor;
50
+ };
51
+ title: {
52
+ type: StringConstructor;
53
+ };
54
+ description: {
55
+ type: StringConstructor;
56
+ };
57
+ variant: {
58
+ type: PropType<"subtle" | "filled" | "outline">;
59
+ };
60
+ intent: {
61
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
62
+ };
63
+ size: {
64
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
65
+ };
66
+ showIcon: {
67
+ type: BooleanConstructor;
68
+ };
69
+ icon: {
70
+ type: StringConstructor;
71
+ };
72
+ dismissible: {
73
+ type: BooleanConstructor;
74
+ };
75
+ dismissLabel: {
76
+ type: StringConstructor;
77
+ };
78
+ duration: {
79
+ type: NumberConstructor;
80
+ };
81
+ }>> & Readonly<{
82
+ "onCx-dismiss"?: ((event: CustomEvent<DismissDetail>) => any) | undefined;
83
+ }>, {
84
+ showIcon: boolean;
85
+ dismissible: boolean;
86
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/toast.js ADDED
@@ -0,0 +1,72 @@
1
+ // Auto-generated by scripts/generate-vue.mjs — DO NOT EDIT
2
+ // Vue 3 wrapper for <cx-toast>
3
+ import { defineComponent, ref, h, onMounted, watch } from 'vue';
4
+ export const Toast = defineComponent({
5
+ name: 'Toast',
6
+ props: {
7
+ id: { type: String },
8
+ title: { type: String },
9
+ description: { type: String },
10
+ variant: { type: String },
11
+ intent: { type: String },
12
+ size: { type: String },
13
+ showIcon: { type: Boolean },
14
+ icon: { type: String },
15
+ dismissible: { type: Boolean },
16
+ dismissLabel: { type: String },
17
+ duration: { type: Number },
18
+ },
19
+ emits: {
20
+ 'cx-dismiss': (event) => true,
21
+ },
22
+ setup(props, { emit, slots, expose }) {
23
+ const el = ref(null);
24
+ const listeners = [];
25
+ onMounted(() => {
26
+ if (!el.value)
27
+ return;
28
+ watch(() => props.title, (val) => {
29
+ if (!el.value)
30
+ return;
31
+ if (val != null)
32
+ el.value.setAttribute('title', String(val));
33
+ else
34
+ el.value.removeAttribute('title');
35
+ }, { immediate: true });
36
+ // Event listeners
37
+ el.value.addEventListener('cx-dismiss', (ev) => emit('cx-dismiss', ev));
38
+ });
39
+ expose({
40
+ /** Dismisses the toast with exit animation. */
41
+ dismiss() { el.value?.dismiss(); },
42
+ /** The underlying Custom Element. */
43
+ el,
44
+ });
45
+ return () => {
46
+ const attrs = {};
47
+ if (props.id != null)
48
+ attrs['id'] = typeof props.id === 'object' ? JSON.stringify(props.id) : String(props.id);
49
+ if (props.description != null)
50
+ attrs['description'] = typeof props.description === 'object' ? JSON.stringify(props.description) : String(props.description);
51
+ if (props.variant != null)
52
+ attrs['variant'] = typeof props.variant === 'object' ? JSON.stringify(props.variant) : String(props.variant);
53
+ if (props.intent != null)
54
+ attrs['intent'] = typeof props.intent === 'object' ? JSON.stringify(props.intent) : String(props.intent);
55
+ if (props.size != null)
56
+ attrs['size'] = typeof props.size === 'object' ? JSON.stringify(props.size) : String(props.size);
57
+ if (props.showIcon)
58
+ attrs['show-icon'] = '';
59
+ if (props.icon != null)
60
+ attrs['icon'] = typeof props.icon === 'object' ? JSON.stringify(props.icon) : String(props.icon);
61
+ if (props.dismissible)
62
+ attrs['dismissible'] = '';
63
+ if (props.dismissLabel != null)
64
+ attrs['dismiss-label'] = typeof props.dismissLabel === 'object' ? JSON.stringify(props.dismissLabel) : String(props.dismissLabel);
65
+ if (props.duration != null)
66
+ attrs['duration'] = typeof props.duration === 'object' ? JSON.stringify(props.duration) : String(props.duration);
67
+ return h('cx-toast', { ref: el, ...attrs }, [
68
+ slots.action ? h('div', { slot: 'action', style: 'display:contents' }, slots.action()) : undefined
69
+ ]);
70
+ };
71
+ },
72
+ });
@@ -0,0 +1,83 @@
1
+ import { type PropType } from 'vue';
2
+ import type { ToggleDetail, ToggleItem } from './types.js';
3
+ export declare const ToggleGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ id: {
5
+ type: StringConstructor;
6
+ };
7
+ label: {
8
+ type: StringConstructor;
9
+ };
10
+ items: {
11
+ type: PropType<ToggleItem[] | string>;
12
+ };
13
+ variant: {
14
+ type: PropType<"outline" | "ghost" | "filled">;
15
+ };
16
+ shape: {
17
+ type: PropType<"sharp" | "rounded" | "pill">;
18
+ };
19
+ mode: {
20
+ type: PropType<"single" | "multiple">;
21
+ };
22
+ orientation: {
23
+ type: PropType<"horizontal" | "vertical">;
24
+ };
25
+ intent: {
26
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
27
+ };
28
+ size: {
29
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
30
+ };
31
+ disabled: {
32
+ type: BooleanConstructor;
33
+ };
34
+ /** Controlled pressed item IDs. Pass a single ID or an array. */
35
+ value: {
36
+ type: PropType<string | string[]>;
37
+ };
38
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
39
+ [key: string]: any;
40
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
41
+ 'cx-input': (event: CustomEvent) => true;
42
+ 'cx-change': (event: CustomEvent<ToggleDetail>) => true;
43
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
+ id: {
45
+ type: StringConstructor;
46
+ };
47
+ label: {
48
+ type: StringConstructor;
49
+ };
50
+ items: {
51
+ type: PropType<ToggleItem[] | string>;
52
+ };
53
+ variant: {
54
+ type: PropType<"outline" | "ghost" | "filled">;
55
+ };
56
+ shape: {
57
+ type: PropType<"sharp" | "rounded" | "pill">;
58
+ };
59
+ mode: {
60
+ type: PropType<"single" | "multiple">;
61
+ };
62
+ orientation: {
63
+ type: PropType<"horizontal" | "vertical">;
64
+ };
65
+ intent: {
66
+ type: PropType<"neutral" | "primary" | "info" | "success" | "warning" | "danger">;
67
+ };
68
+ size: {
69
+ type: PropType<"xs" | "sm" | "md" | "lg" | "xl">;
70
+ };
71
+ disabled: {
72
+ type: BooleanConstructor;
73
+ };
74
+ /** Controlled pressed item IDs. Pass a single ID or an array. */
75
+ value: {
76
+ type: PropType<string | string[]>;
77
+ };
78
+ }>> & Readonly<{
79
+ "onCx-change"?: ((event: CustomEvent<ToggleDetail>) => any) | undefined;
80
+ "onCx-input"?: ((event: CustomEvent<any>) => any) | undefined;
81
+ }>, {
82
+ disabled: boolean;
83
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;