@atomic-ui/ui-vue 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/index.d.ts +210 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -4
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @atomic-ui/ui-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Vue components for the `@atomic-ui/ui` custom elements. Props are bound as DOM properties, and events are typed.
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import '@atomic-ui/ui';
|
|
8
|
+
import { ImpktButton, ImpktHeading } from '@atomic-ui/ui-vue';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<ImpktHeading :level="1">Your quote</ImpktHeading>
|
|
13
|
+
<ImpktButton variant="primary">Continue</ImpktButton>
|
|
14
|
+
</template>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Import `@atomic-ui/ui` once, so the custom elements are defined before Vue mounts them.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue bindings for `@impkt/ui`.
|
|
3
|
+
*
|
|
4
|
+
* ## What Vue needs, and what it does not
|
|
5
|
+
*
|
|
6
|
+
* Vue 3 renders unknown tags as custom elements once the compiler is told to
|
|
7
|
+
* leave them alone, and it is better at this than React was: given a render
|
|
8
|
+
* function, the `.` prefix binds a value as a DOM **property** rather than an
|
|
9
|
+
* attribute, so an array of options arrives as an array.
|
|
10
|
+
*
|
|
11
|
+
* So the wrapper is thin on purpose. Its job is to spare every consumer from
|
|
12
|
+
* remembering the `.` and from typing `@impkt-change` by hand, and to give
|
|
13
|
+
* editors real prop types. It is not a reimplementation, and it adds no
|
|
14
|
+
* behaviour — a Vue app that would rather write `<impkt-text-input>` directly
|
|
15
|
+
* can, and only needs the build config below.
|
|
16
|
+
*
|
|
17
|
+
* ## One piece of configuration the wrapper cannot do for you
|
|
18
|
+
*
|
|
19
|
+
* In `vite.config.ts`:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('impkt-') } } })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Without it Vue warns about an unresolved component on every element, and
|
|
26
|
+
* binds everything as attributes — which is the array problem again.
|
|
27
|
+
*/
|
|
28
|
+
import { type PropType, type SlotsType, type VNode } from 'vue';
|
|
29
|
+
import '@atomic-ui/ui';
|
|
30
|
+
import type { RadioOption, SelectOption, CheckboxOption, SummaryRow, TableColumn, AccordionItem, ProgressStep, HelpKind } from '@atomic-ui/ui';
|
|
31
|
+
/** What a control reports when its value changes. */
|
|
32
|
+
export type ImpktChangeEvent = CustomEvent<{
|
|
33
|
+
value: string;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const ImpktButton: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
38
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
39
|
+
}>, {}, SlotsType<{
|
|
40
|
+
default?: () => VNode[];
|
|
41
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
42
|
+
export declare const ImpktLink: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
45
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
46
|
+
}>, {}, SlotsType<{
|
|
47
|
+
default?: () => VNode[];
|
|
48
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
49
|
+
export declare const ImpktAlert: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
52
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
53
|
+
}>, {}, SlotsType<{
|
|
54
|
+
default?: () => VNode[];
|
|
55
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
56
|
+
export declare const ImpktStack: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
59
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
60
|
+
}>, {}, SlotsType<{
|
|
61
|
+
default?: () => VNode[];
|
|
62
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
63
|
+
export declare const ImpktCard: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
66
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
67
|
+
}>, {}, SlotsType<{
|
|
68
|
+
default?: () => VNode[];
|
|
69
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
|
+
export declare const ImpktHeading: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
73
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
74
|
+
}>, {}, SlotsType<{
|
|
75
|
+
default?: () => VNode[];
|
|
76
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
77
|
+
export declare const ImpktText: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
80
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
81
|
+
}>, {}, SlotsType<{
|
|
82
|
+
default?: () => VNode[];
|
|
83
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
84
|
+
export declare const ImpktImage: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
87
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
88
|
+
}>, {}, SlotsType<{
|
|
89
|
+
default?: () => VNode[];
|
|
90
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
91
|
+
export declare const ImpktLogo: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
94
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
95
|
+
}>, {}, SlotsType<{
|
|
96
|
+
default?: () => VNode[];
|
|
97
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
98
|
+
export declare const ImpktDocumentLink: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
101
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
102
|
+
}>, {}, SlotsType<{
|
|
103
|
+
default?: () => VNode[];
|
|
104
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
105
|
+
export declare const ImpktPrice: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
108
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
109
|
+
}>, {}, SlotsType<{
|
|
110
|
+
default?: () => VNode[];
|
|
111
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
112
|
+
export declare const ImpktDialog: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
115
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
116
|
+
}>, {}, SlotsType<{
|
|
117
|
+
default?: () => VNode[];
|
|
118
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
119
|
+
export declare const ImpktTextInput: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
122
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
123
|
+
}>, {}, SlotsType<{
|
|
124
|
+
default?: () => VNode[];
|
|
125
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
126
|
+
export declare const ImpktTextarea: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
129
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
130
|
+
}>, {}, SlotsType<{
|
|
131
|
+
default?: () => VNode[];
|
|
132
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
133
|
+
export declare const ImpktCheckbox: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
134
|
+
[key: string]: any;
|
|
135
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
136
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
137
|
+
}>, {}, SlotsType<{
|
|
138
|
+
default?: () => VNode[];
|
|
139
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
140
|
+
export declare const ImpktSelect: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
143
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
144
|
+
}>, {}, SlotsType<{
|
|
145
|
+
default?: () => VNode[];
|
|
146
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
147
|
+
export declare const ImpktRadioGroup: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
150
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
151
|
+
}>, {}, SlotsType<{
|
|
152
|
+
default?: () => VNode[];
|
|
153
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
154
|
+
export declare const ImpktCheckboxGroup: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
157
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
158
|
+
}>, {}, SlotsType<{
|
|
159
|
+
default?: () => VNode[];
|
|
160
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
161
|
+
export declare const ImpktDateInput: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
164
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
165
|
+
}>, {}, SlotsType<{
|
|
166
|
+
default?: () => VNode[];
|
|
167
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
168
|
+
export declare const ImpktSummaryList: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
169
|
+
[key: string]: any;
|
|
170
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
171
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
172
|
+
}>, {}, SlotsType<{
|
|
173
|
+
default?: () => VNode[];
|
|
174
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
175
|
+
export declare const ImpktTable: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
176
|
+
[key: string]: any;
|
|
177
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
178
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
179
|
+
}>, {}, SlotsType<{
|
|
180
|
+
default?: () => VNode[];
|
|
181
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
182
|
+
export declare const ImpktAccordion: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
183
|
+
[key: string]: any;
|
|
184
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
185
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
186
|
+
}>, {}, SlotsType<{
|
|
187
|
+
default?: () => VNode[];
|
|
188
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
189
|
+
export declare const ImpktProgress: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
190
|
+
[key: string]: any;
|
|
191
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
192
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
193
|
+
}>, {}, SlotsType<{
|
|
194
|
+
default?: () => VNode[];
|
|
195
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
196
|
+
export type { RadioOption, SelectOption, CheckboxOption, SummaryRow, TableColumn, AccordionItem, ProgressStep, HelpKind, PropType, };
|
|
197
|
+
export declare const ImpktGrid: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
198
|
+
[key: string]: any;
|
|
199
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
200
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
201
|
+
}>, {}, SlotsType<{
|
|
202
|
+
default?: () => VNode[];
|
|
203
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
204
|
+
export declare const ImpktHelp: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
205
|
+
[key: string]: any;
|
|
206
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
207
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
208
|
+
}>, {}, SlotsType<{
|
|
209
|
+
default?: () => VNode[];
|
|
210
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// packages/ui-vue/src/index.ts
|
|
2
|
+
import { defineComponent, h } from "vue";
|
|
3
|
+
import "@atomic-ui/ui";
|
|
4
|
+
function wrap(tag, domProps = [], events = {}) {
|
|
5
|
+
return defineComponent({
|
|
6
|
+
name: tag.replace(/(^|-)(\w)/g, (_, __, c) => c.toUpperCase()),
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
slots: Object,
|
|
9
|
+
setup(_, { attrs, slots, emit }) {
|
|
10
|
+
return () => {
|
|
11
|
+
const bound = {};
|
|
12
|
+
for (const [key, value] of Object.entries(attrs)) {
|
|
13
|
+
bound[domProps.includes(key) ? `.${key}` : key] = value;
|
|
14
|
+
}
|
|
15
|
+
for (const [eventName, vueName] of Object.entries(events)) {
|
|
16
|
+
bound[`on${eventName.replace(/(^|-)(\w)/g, (_2, __, c) => c.toUpperCase())}`] = (e) => emit(vueName, e);
|
|
17
|
+
}
|
|
18
|
+
return h(tag, bound, slots.default?.());
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
emits: Object.values(events)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var CHANGE = { "impkt-change": "change" };
|
|
25
|
+
var ImpktButton = wrap("impkt-button");
|
|
26
|
+
var ImpktLink = wrap("impkt-link");
|
|
27
|
+
var ImpktAlert = wrap("impkt-alert");
|
|
28
|
+
var ImpktStack = wrap("impkt-stack");
|
|
29
|
+
var ImpktCard = wrap("impkt-card");
|
|
30
|
+
var ImpktHeading = wrap("impkt-heading");
|
|
31
|
+
var ImpktText = wrap("impkt-text");
|
|
32
|
+
var ImpktImage = wrap("impkt-image");
|
|
33
|
+
var ImpktLogo = wrap("impkt-logo");
|
|
34
|
+
var ImpktDocumentLink = wrap("impkt-document-link");
|
|
35
|
+
var ImpktPrice = wrap("impkt-price");
|
|
36
|
+
var ImpktDialog = wrap("impkt-dialog", [], { "impkt-close": "close" });
|
|
37
|
+
var ImpktTextInput = wrap("impkt-text-input", [], CHANGE);
|
|
38
|
+
var ImpktTextarea = wrap("impkt-textarea", [], CHANGE);
|
|
39
|
+
var ImpktCheckbox = wrap("impkt-checkbox", [], CHANGE);
|
|
40
|
+
var ImpktSelect = wrap("impkt-select", ["options"], CHANGE);
|
|
41
|
+
var ImpktRadioGroup = wrap("impkt-radio-group", ["options"], CHANGE);
|
|
42
|
+
var ImpktCheckboxGroup = wrap("impkt-checkbox-group", ["options", "values"], CHANGE);
|
|
43
|
+
var ImpktDateInput = wrap("impkt-date-input", [], CHANGE);
|
|
44
|
+
var ImpktSummaryList = wrap("impkt-summary-list", ["rows"]);
|
|
45
|
+
var ImpktTable = wrap("impkt-table", ["columns", "rows"]);
|
|
46
|
+
var ImpktAccordion = wrap("impkt-accordion", ["items", "open"]);
|
|
47
|
+
var ImpktProgress = wrap("impkt-progress", ["steps"]);
|
|
48
|
+
var ImpktGrid = wrap("impkt-grid");
|
|
49
|
+
var ImpktHelp = wrap("impkt-help");
|
|
50
|
+
export {
|
|
51
|
+
ImpktAccordion,
|
|
52
|
+
ImpktAlert,
|
|
53
|
+
ImpktButton,
|
|
54
|
+
ImpktCard,
|
|
55
|
+
ImpktCheckbox,
|
|
56
|
+
ImpktCheckboxGroup,
|
|
57
|
+
ImpktDateInput,
|
|
58
|
+
ImpktDialog,
|
|
59
|
+
ImpktDocumentLink,
|
|
60
|
+
ImpktGrid,
|
|
61
|
+
ImpktHeading,
|
|
62
|
+
ImpktHelp,
|
|
63
|
+
ImpktImage,
|
|
64
|
+
ImpktLink,
|
|
65
|
+
ImpktLogo,
|
|
66
|
+
ImpktPrice,
|
|
67
|
+
ImpktProgress,
|
|
68
|
+
ImpktRadioGroup,
|
|
69
|
+
ImpktSelect,
|
|
70
|
+
ImpktStack,
|
|
71
|
+
ImpktSummaryList,
|
|
72
|
+
ImpktTable,
|
|
73
|
+
ImpktText,
|
|
74
|
+
ImpktTextInput,
|
|
75
|
+
ImpktTextarea
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Vue bindings for `@impkt/ui`.\n *\n * ## What Vue needs, and what it does not\n *\n * Vue 3 renders unknown tags as custom elements once the compiler is told to\n * leave them alone, and it is better at this than React was: given a render\n * function, the `.` prefix binds a value as a DOM **property** rather than an\n * attribute, so an array of options arrives as an array.\n *\n * So the wrapper is thin on purpose. Its job is to spare every consumer from\n * remembering the `.` and from typing `@impkt-change` by hand, and to give\n * editors real prop types. It is not a reimplementation, and it adds no\n * behaviour — a Vue app that would rather write `<impkt-text-input>` directly\n * can, and only needs the build config below.\n *\n * ## One piece of configuration the wrapper cannot do for you\n *\n * In `vite.config.ts`:\n *\n * ```ts\n * vue({ template: { compilerOptions: { isCustomElement: (tag) => tag.startsWith('impkt-') } } })\n * ```\n *\n * Without it Vue warns about an unresolved component on every element, and\n * binds everything as attributes — which is the array problem again.\n */\nimport { defineComponent, h, type PropType, type SlotsType, type VNode } from 'vue';\nimport '@impkt/ui';\nimport type { RadioOption, SelectOption, CheckboxOption, SummaryRow, TableColumn, AccordionItem, ProgressStep, HelpKind } from '@impkt/ui';\n\n/** What a control reports when its value changes. */\nexport type ImpktChangeEvent = CustomEvent<{ value: string }>;\n\ntype Props = Record<string, unknown>;\n\n/**\n * Build a Vue component around one element.\n *\n * `domProps` names the props that must be bound as properties rather than\n * attributes — anything that is not a string or a boolean. Everything else\n * goes through as an attribute, which is what a custom element expects and\n * what keeps the rendered markup readable.\n */\nfunction wrap(tag: string, domProps: string[] = [], events: Record<string, string> = {}) {\n return defineComponent({\n name: tag.replace(/(^|-)(\\w)/g, (_, __, c: string) => c.toUpperCase()),\n inheritAttrs: false,\n slots: Object as SlotsType<{ default?: () => VNode[] }>,\n setup(_, { attrs, slots, emit }) {\n return () => {\n const bound: Props = {};\n for (const [key, value] of Object.entries(attrs)) {\n bound[domProps.includes(key) ? `.${key}` : key] = value;\n }\n for (const [eventName, vueName] of Object.entries(events)) {\n bound[`on${eventName.replace(/(^|-)(\\w)/g, (_, __, c: string) => c.toUpperCase())}`] =\n (e: Event) => emit(vueName, e);\n }\n return h(tag, bound, slots.default?.());\n };\n },\n emits: Object.values(events),\n });\n}\n\nconst CHANGE = { 'impkt-change': 'change' };\n\nexport const ImpktButton = wrap('impkt-button');\nexport const ImpktLink = wrap('impkt-link');\nexport const ImpktAlert = wrap('impkt-alert');\nexport const ImpktStack = wrap('impkt-stack');\nexport const ImpktCard = wrap('impkt-card');\nexport const ImpktHeading = wrap('impkt-heading');\nexport const ImpktText = wrap('impkt-text');\nexport const ImpktImage = wrap('impkt-image');\nexport const ImpktLogo = wrap('impkt-logo');\nexport const ImpktDocumentLink = wrap('impkt-document-link');\nexport const ImpktPrice = wrap('impkt-price');\nexport const ImpktDialog = wrap('impkt-dialog', [], { 'impkt-close': 'close' });\n\nexport const ImpktTextInput = wrap('impkt-text-input', [], CHANGE);\nexport const ImpktTextarea = wrap('impkt-textarea', [], CHANGE);\nexport const ImpktCheckbox = wrap('impkt-checkbox', [], CHANGE);\nexport const ImpktSelect = wrap('impkt-select', ['options'], CHANGE);\nexport const ImpktRadioGroup = wrap('impkt-radio-group', ['options'], CHANGE);\nexport const ImpktCheckboxGroup = wrap('impkt-checkbox-group', ['options', 'values'], CHANGE);\nexport const ImpktDateInput = wrap('impkt-date-input', [], CHANGE);\n\nexport const ImpktSummaryList = wrap('impkt-summary-list', ['rows']);\nexport const ImpktTable = wrap('impkt-table', ['columns', 'rows']);\nexport const ImpktAccordion = wrap('impkt-accordion', ['items', 'open']);\nexport const ImpktProgress = wrap('impkt-progress', ['steps']);\n\nexport type {\n RadioOption, SelectOption, CheckboxOption, SummaryRow, TableColumn, AccordionItem, ProgressStep, HelpKind,\n PropType,\n};\n\nexport const ImpktGrid = wrap('impkt-grid');\n\n// Every help prop is a string, so none has to be bound as a DOM property. A\n// `kind` of phone or email builds its own link from `detail`, so `href` is\n// only passed for a link (see `HelpKind`).\nexport const ImpktHelp = wrap('impkt-help');\n"],"mappings":";AA2BA,SAAS,iBAAiB,SAAoD;AAC9E,OAAO;AAgBP,SAAS,KAAK,KAAa,WAAqB,CAAC,GAAG,SAAiC,CAAC,GAAG;AACvF,SAAO,gBAAgB;AAAA,IACrB,MAAM,IAAI,QAAQ,cAAc,CAAC,GAAG,IAAI,MAAc,EAAE,YAAY,CAAC;AAAA,IACrE,cAAc;AAAA,IACd,OAAO;AAAA,IACP,MAAM,GAAG,EAAE,OAAO,OAAO,KAAK,GAAG;AAC/B,aAAO,MAAM;AACX,cAAM,QAAe,CAAC;AACtB,mBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,gBAAM,SAAS,SAAS,GAAG,IAAI,IAAI,GAAG,KAAK,GAAG,IAAI;AAAA,QACpD;AACA,mBAAW,CAAC,WAAW,OAAO,KAAK,OAAO,QAAQ,MAAM,GAAG;AACzD,gBAAM,KAAK,UAAU,QAAQ,cAAc,CAACA,IAAG,IAAI,MAAc,EAAE,YAAY,CAAC,CAAC,EAAE,IACjF,CAAC,MAAa,KAAK,SAAS,CAAC;AAAA,QACjC;AACA,eAAO,EAAE,KAAK,OAAO,MAAM,UAAU,CAAC;AAAA,MACxC;AAAA,IACF;AAAA,IACA,OAAO,OAAO,OAAO,MAAM;AAAA,EAC7B,CAAC;AACH;AAEA,IAAM,SAAS,EAAE,gBAAgB,SAAS;AAEnC,IAAM,cAAc,KAAK,cAAc;AACvC,IAAM,YAAY,KAAK,YAAY;AACnC,IAAM,aAAa,KAAK,aAAa;AACrC,IAAM,aAAa,KAAK,aAAa;AACrC,IAAM,YAAY,KAAK,YAAY;AACnC,IAAM,eAAe,KAAK,eAAe;AACzC,IAAM,YAAY,KAAK,YAAY;AACnC,IAAM,aAAa,KAAK,aAAa;AACrC,IAAM,YAAY,KAAK,YAAY;AACnC,IAAM,oBAAoB,KAAK,qBAAqB;AACpD,IAAM,aAAa,KAAK,aAAa;AACrC,IAAM,cAAc,KAAK,gBAAgB,CAAC,GAAG,EAAE,eAAe,QAAQ,CAAC;AAEvE,IAAM,iBAAiB,KAAK,oBAAoB,CAAC,GAAG,MAAM;AAC1D,IAAM,gBAAgB,KAAK,kBAAkB,CAAC,GAAG,MAAM;AACvD,IAAM,gBAAgB,KAAK,kBAAkB,CAAC,GAAG,MAAM;AACvD,IAAM,cAAc,KAAK,gBAAgB,CAAC,SAAS,GAAG,MAAM;AAC5D,IAAM,kBAAkB,KAAK,qBAAqB,CAAC,SAAS,GAAG,MAAM;AACrE,IAAM,qBAAqB,KAAK,wBAAwB,CAAC,WAAW,QAAQ,GAAG,MAAM;AACrF,IAAM,iBAAiB,KAAK,oBAAoB,CAAC,GAAG,MAAM;AAE1D,IAAM,mBAAmB,KAAK,sBAAsB,CAAC,MAAM,CAAC;AAC5D,IAAM,aAAa,KAAK,eAAe,CAAC,WAAW,MAAM,CAAC;AAC1D,IAAM,iBAAiB,KAAK,mBAAmB,CAAC,SAAS,MAAM,CAAC;AAChE,IAAM,gBAAgB,KAAK,kBAAkB,CAAC,OAAO,CAAC;AAOtD,IAAM,YAAY,KAAK,YAAY;AAKnC,IAAM,YAAY,KAAK,YAAY;","names":["_"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomic-ui/ui-vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Vue bindings for @atomic-ui/ui: typed props bound as DOM properties, and typed custom events.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@atomic-ui/ui": "0.1.1"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"vue": "^3.4.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"typescript": "^5.5.0",
|
|
22
|
+
"vue": "^3.4.0"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc -p tsconfig.json",
|
|
33
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
34
|
+
"test": "echo \"(behaviour is covered by @impkt/ui; these are binding shims)\""
|
|
35
|
+
}
|
|
36
|
+
}
|