@fastrd/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/LICENSE +21 -0
- package/NOTICE.md +23 -0
- package/README.md +50 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +242 -0
- package/dist/interactive.d.ts +67 -0
- package/dist/primitives.d.ts +69 -0
- package/dist/styles.css +2 -0
- package/package.json +15 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FastR-D contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Source and publication scope
|
|
2
|
+
|
|
3
|
+
The owner has authorized publication of the generic UI portions under MIT.
|
|
4
|
+
Vue semantic primitives and v-model adapters derive from the common
|
|
5
|
+
`primitives.ts` (203 lines) in FastPPT and FastFigure. Modal's public props and
|
|
6
|
+
the focus-lifecycle purpose derive from their common `use-dialog-focus.ts`
|
|
7
|
+
(58 lines) and Modal component. FastUI delegates focus trapping, inertness,
|
|
8
|
+
nesting and focus restoration to the browser's native modal dialog rather
|
|
9
|
+
than maintaining the original hand-written trap. Select retains the shared
|
|
10
|
+
value/options/change contract and delegates interaction to the native select.
|
|
11
|
+
|
|
12
|
+
The palette follows FastWrite's semantic colors and the approved FastTask
|
|
13
|
+
workbench design. Only generic UI code and semantic design values are included.
|
|
14
|
+
No private artwork, icons, logos, fonts, application data, product-specific
|
|
15
|
+
workflows or brand assets are distributed. Upstream product repositories
|
|
16
|
+
retain ownership of their application-specific code and assets.
|
|
17
|
+
|
|
18
|
+
Source reference revisions: FastPPT `f6bf21f13445c2507719928fa68550552a8fcab2`
|
|
19
|
+
(`packages/components/src/`) and FastFigure
|
|
20
|
+
`13dcc4179fd0073da76f7626264af8605d5e8c70` (`src/components/ui/`).
|
|
21
|
+
At both revisions, `primitives.ts` has Git blob
|
|
22
|
+
`c7123af5f8316bc0486bce5c99cfbb2e9ab3dc73` and `use-dialog-focus.ts` has
|
|
23
|
+
Git blob `3ffbb6c6c7bd5e3c96f2b8c05c5e008dcdfc4cab`.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fastrd/ui-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MIT · 0.1.1 · Vue ^3.5 peer · exact foundation 0.1.1 registry dependency.
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<script setup>
|
|
7
|
+
import { ref } from 'vue'
|
|
8
|
+
import { Button, TextField, Modal, ModalBody, Select } from '@fastrd/ui-vue'
|
|
9
|
+
import '@fastrd/ui-vue/styles.css'
|
|
10
|
+
const name = ref('')
|
|
11
|
+
const open = ref(false)
|
|
12
|
+
const format = ref('pdf')
|
|
13
|
+
</script>
|
|
14
|
+
<template>
|
|
15
|
+
<TextField v-model.trim="name" aria-label="Name" />
|
|
16
|
+
<Select :value="format" :options="[{value:'pdf',label:'PDF'}]" @change="format=$event" />
|
|
17
|
+
<Button variant="primary" @click="open=true">Settings</Button>
|
|
18
|
+
<Modal :open="open" label="Settings" @close="open=false">
|
|
19
|
+
<ModalBody><Button @click="open=false">Close</Button></ModalBody>
|
|
20
|
+
</Modal>
|
|
21
|
+
</template>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Button variants: primary, secondary (default), quiet, icon, navigation, danger.
|
|
25
|
+
Sizes: xs/sm/md; Button defaults sm, fields md. Loading buttons are busy and
|
|
26
|
+
disabled; icon buttons need an accessible label supplied by the caller.
|
|
27
|
+
TextField/TextArea/SelectField support Vue v-model and native events/attrs;
|
|
28
|
+
TextField supports trim, number, lazy and checkbox/radio models.
|
|
29
|
+
|
|
30
|
+
Modal has open, label/labelledby, md/lg/xl size and dismissible (default true).
|
|
31
|
+
close is a request; the caller sets open=false. The browser owns native dialog
|
|
32
|
+
focus, inertness and nesting. No body teleport: scoped tokens survive.
|
|
33
|
+
Native `method=dialog` forms are not the controlled close API.
|
|
34
|
+
|
|
35
|
+
Select accepts value, options [{value,label,disabled?}], placeholder, disabled,
|
|
36
|
+
size and emits change(string) only for a different value. It is a native select:
|
|
37
|
+
keyboard/typeahead/touch/form behavior follows the platform. In migration,
|
|
38
|
+
remove the original custom-listbox CSS and avoid handling preview shortcuts
|
|
39
|
+
when a native select has focus. Disabled options are skipped by the browser.
|
|
40
|
+
|
|
41
|
+
Semantic primitives preserve the shared names and native refs: Box, Text,
|
|
42
|
+
Heading, Panel, ModalBody, Header, Footer, Nav, Aside, Main, Article, Form, Field,
|
|
43
|
+
Fieldset, Legend, Disclosure, DisclosureTrigger, List, ListItem, DescriptionList,
|
|
44
|
+
Term, Description, Table/Head/Body/Row/Cell/Header/Caption, Frame, Image,
|
|
45
|
+
DialogSurface, Progress, Link, Svg, SvgPath, SelectField, SelectOption, RichText.
|
|
46
|
+
RichText renders caller-owned trusted HTML. `as` applies to element primitives.
|
|
47
|
+
useDialogFocus accepts a native dialog ref and returns onDialogCancel; native
|
|
48
|
+
modal behavior replaces the original custom focus trap.
|
|
49
|
+
|
|
50
|
+
Class names use fastui-*; no legacy fp-* aliases or application brands are
|
|
51
|
+
included. Application layouts and preview styles stay with the host.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// packages/vue/src/primitives.ts
|
|
2
|
+
import {
|
|
3
|
+
h,
|
|
4
|
+
mergeProps,
|
|
5
|
+
withDirectives,
|
|
6
|
+
vModelDynamic,
|
|
7
|
+
vModelText,
|
|
8
|
+
vModelSelect
|
|
9
|
+
} from "vue";
|
|
10
|
+
function element(name, tag, className = "") {
|
|
11
|
+
const component = (props, { attrs, slots }) => h(props.as ?? tag, mergeProps(attrs, { class: className }), slots.default?.());
|
|
12
|
+
component.displayName = name;
|
|
13
|
+
component.props = ["as"];
|
|
14
|
+
component.inheritAttrs = false;
|
|
15
|
+
return component;
|
|
16
|
+
}
|
|
17
|
+
var Box = element("Box", "div");
|
|
18
|
+
var Text = element("Text", "span");
|
|
19
|
+
var Heading = element("Heading", "h2", "fastui-heading");
|
|
20
|
+
var Panel = element("Panel", "section");
|
|
21
|
+
var ModalBody = element("ModalBody", "div", "fastui-modal-body");
|
|
22
|
+
var Header = element("Header", "header");
|
|
23
|
+
var Footer = element("Footer", "footer");
|
|
24
|
+
var Nav = element("Nav", "nav");
|
|
25
|
+
var Aside = element("Aside", "aside");
|
|
26
|
+
var Main = element("Main", "main");
|
|
27
|
+
var Article = element("Article", "article");
|
|
28
|
+
var Form = element("Form", "form");
|
|
29
|
+
var Field = element("Field", "label", "fastui-field");
|
|
30
|
+
var Fieldset = element("Fieldset", "fieldset", "fastui-fieldset");
|
|
31
|
+
var Legend = element("Legend", "legend", "fastui-legend");
|
|
32
|
+
var Disclosure = element("Disclosure", "details", "fastui-disclosure");
|
|
33
|
+
var DisclosureTrigger = (props, { attrs, slots }) => h(props.as ?? "summary", mergeProps(attrs, {
|
|
34
|
+
class: ["fastui-disclosure-trigger", `fastui-disclosure-trigger--${props.size ?? "sm"}`]
|
|
35
|
+
}), slots.default?.());
|
|
36
|
+
DisclosureTrigger.props = ["as", "size"];
|
|
37
|
+
DisclosureTrigger.inheritAttrs = false;
|
|
38
|
+
var List = element("List", "ul");
|
|
39
|
+
var ListItem = element("ListItem", "li");
|
|
40
|
+
var DescriptionList = element("DescriptionList", "dl");
|
|
41
|
+
var Term = element("Term", "dt");
|
|
42
|
+
var Description = element("Description", "dd");
|
|
43
|
+
var Table = element("Table", "table", "fastui-table");
|
|
44
|
+
var TableHead = element("TableHead", "thead");
|
|
45
|
+
var TableBody = element("TableBody", "tbody");
|
|
46
|
+
var TableRow = element("TableRow", "tr");
|
|
47
|
+
var TableCell = element("TableCell", "td");
|
|
48
|
+
var TableHeader = element("TableHeader", "th");
|
|
49
|
+
var TableCaption = element("TableCaption", "caption");
|
|
50
|
+
var Frame = element("Frame", "iframe");
|
|
51
|
+
var Image = element("Image", "img");
|
|
52
|
+
var DialogSurface = element("DialogSurface", "dialog", "fastui-dialog");
|
|
53
|
+
var Progress = element("Progress", "progress", "fastui-progress");
|
|
54
|
+
var Link = element("Link", "a", "fastui-link");
|
|
55
|
+
var Svg = (_props, { attrs, slots }) => h("svg", attrs, slots.default?.());
|
|
56
|
+
var SvgPath = (_props, { attrs }) => h("path", attrs);
|
|
57
|
+
var Button = (props, { attrs, slots }) => h("button", mergeProps(attrs, {
|
|
58
|
+
type: props.type ?? "button",
|
|
59
|
+
disabled: props.disabled || props.loading,
|
|
60
|
+
"aria-busy": props.loading || void 0,
|
|
61
|
+
class: ["fastui-button", `fastui-button--${props.variant ?? "secondary"}`, `fastui-button--${props.size ?? "sm"}`]
|
|
62
|
+
}), slots.default?.());
|
|
63
|
+
Button.props = {
|
|
64
|
+
variant: String,
|
|
65
|
+
size: String,
|
|
66
|
+
type: String,
|
|
67
|
+
disabled: Boolean,
|
|
68
|
+
loading: Boolean
|
|
69
|
+
};
|
|
70
|
+
Button.inheritAttrs = false;
|
|
71
|
+
var TextField = (props, { attrs }) => {
|
|
72
|
+
const kind = typeof attrs.type === "string" ? attrs.type : "text";
|
|
73
|
+
const vnode = h("input", mergeProps(attrs, {
|
|
74
|
+
class: ["fastui-input", `fastui-input--${kind}`, `fastui-input--${props.size ?? "md"}`],
|
|
75
|
+
"onUpdate:modelValue": props["onUpdate:modelValue"]
|
|
76
|
+
}));
|
|
77
|
+
return props["onUpdate:modelValue"] ? withDirectives(vnode, [
|
|
78
|
+
[vModelDynamic, props.modelValue, void 0, props.modelModifiers ?? {}]
|
|
79
|
+
]) : vnode;
|
|
80
|
+
};
|
|
81
|
+
TextField.props = ["size", "modelValue", "modelModifiers", "onUpdate:modelValue"];
|
|
82
|
+
TextField.inheritAttrs = false;
|
|
83
|
+
var TextArea = (props, { attrs }) => {
|
|
84
|
+
const vnode = h("textarea", mergeProps(attrs, {
|
|
85
|
+
class: "fastui-textarea",
|
|
86
|
+
"onUpdate:modelValue": props["onUpdate:modelValue"]
|
|
87
|
+
}));
|
|
88
|
+
return props["onUpdate:modelValue"] ? withDirectives(vnode, [
|
|
89
|
+
[vModelText, props.modelValue, void 0, props.modelModifiers ?? {}]
|
|
90
|
+
]) : vnode;
|
|
91
|
+
};
|
|
92
|
+
TextArea.props = ["modelValue", "modelModifiers", "onUpdate:modelValue"];
|
|
93
|
+
TextArea.inheritAttrs = false;
|
|
94
|
+
var SelectField = (props, { attrs, slots }) => {
|
|
95
|
+
const vnode = h("select", mergeProps(attrs, {
|
|
96
|
+
class: "fastui-select",
|
|
97
|
+
"onUpdate:modelValue": props["onUpdate:modelValue"]
|
|
98
|
+
}), slots.default?.());
|
|
99
|
+
return props["onUpdate:modelValue"] ? withDirectives(vnode, [
|
|
100
|
+
[vModelSelect, props.modelValue, void 0, props.modelModifiers ?? {}]
|
|
101
|
+
]) : vnode;
|
|
102
|
+
};
|
|
103
|
+
SelectField.props = ["modelValue", "modelModifiers", "onUpdate:modelValue"];
|
|
104
|
+
SelectField.inheritAttrs = false;
|
|
105
|
+
var SelectOption = element("SelectOption", "option");
|
|
106
|
+
var RichText = (props, { attrs }) => h("div", mergeProps(attrs, { innerHTML: props.html }));
|
|
107
|
+
RichText.props = ["html"];
|
|
108
|
+
RichText.inheritAttrs = false;
|
|
109
|
+
|
|
110
|
+
// packages/vue/src/interactive.ts
|
|
111
|
+
import {
|
|
112
|
+
defineComponent,
|
|
113
|
+
h as h2,
|
|
114
|
+
mergeProps as mergeProps2,
|
|
115
|
+
shallowRef,
|
|
116
|
+
watch,
|
|
117
|
+
onMounted,
|
|
118
|
+
onBeforeUnmount
|
|
119
|
+
} from "vue";
|
|
120
|
+
import { syncDialog } from "@fastrd/ui-foundation";
|
|
121
|
+
function useDialogFocus(dialog, isOpen, close) {
|
|
122
|
+
const sync = () => {
|
|
123
|
+
if (dialog.value) syncDialog(dialog.value, isOpen());
|
|
124
|
+
};
|
|
125
|
+
watch(isOpen, sync, { flush: "post" });
|
|
126
|
+
onMounted(sync);
|
|
127
|
+
onBeforeUnmount(() => {
|
|
128
|
+
if (dialog.value) syncDialog(dialog.value, false);
|
|
129
|
+
});
|
|
130
|
+
function onDialogCancel(event) {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
close();
|
|
133
|
+
}
|
|
134
|
+
return { onDialogCancel };
|
|
135
|
+
}
|
|
136
|
+
var Modal = defineComponent({
|
|
137
|
+
name: "Modal",
|
|
138
|
+
inheritAttrs: false,
|
|
139
|
+
props: {
|
|
140
|
+
open: { type: Boolean, required: true },
|
|
141
|
+
label: String,
|
|
142
|
+
labelledby: String,
|
|
143
|
+
size: { type: String, default: "md" },
|
|
144
|
+
dismissible: { type: Boolean, default: true }
|
|
145
|
+
},
|
|
146
|
+
emits: { close: () => true },
|
|
147
|
+
setup(props, { attrs, slots, emit }) {
|
|
148
|
+
const surface = shallowRef();
|
|
149
|
+
const close = () => {
|
|
150
|
+
if (props.dismissible) emit("close");
|
|
151
|
+
};
|
|
152
|
+
const { onDialogCancel } = useDialogFocus(surface, () => props.open, close);
|
|
153
|
+
let backdropDown = false;
|
|
154
|
+
const outside = (event) => {
|
|
155
|
+
if (event.target !== surface.value) return false;
|
|
156
|
+
const rect = surface.value.getBoundingClientRect();
|
|
157
|
+
return event.clientX < rect.left || event.clientX > rect.right || event.clientY < rect.top || event.clientY > rect.bottom;
|
|
158
|
+
};
|
|
159
|
+
return () => h2("dialog", mergeProps2(attrs, {
|
|
160
|
+
ref: surface,
|
|
161
|
+
class: ["fastui-dialog", `fastui-dialog--${props.size}`],
|
|
162
|
+
"aria-label": props.label ?? attrs["aria-label"],
|
|
163
|
+
"aria-labelledby": props.labelledby ?? attrs["aria-labelledby"],
|
|
164
|
+
onCancel: onDialogCancel,
|
|
165
|
+
onPointerdown: (event) => {
|
|
166
|
+
backdropDown = outside(event);
|
|
167
|
+
},
|
|
168
|
+
onClick: (event) => {
|
|
169
|
+
if (backdropDown && outside(event)) close();
|
|
170
|
+
backdropDown = false;
|
|
171
|
+
}
|
|
172
|
+
}), props.open ? slots.default?.() : void 0);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
var Select = (props, { attrs }) => h2("select", mergeProps2(attrs, {
|
|
176
|
+
class: ["fastui-select", `fastui-select--${props.size ?? "md"}`],
|
|
177
|
+
value: props.options.some((option) => option.value === props.value) ? props.value : "",
|
|
178
|
+
disabled: props.disabled,
|
|
179
|
+
onChange: (event) => {
|
|
180
|
+
const value = event.target.value;
|
|
181
|
+
if (value !== props.value) props.onChange?.(value);
|
|
182
|
+
}
|
|
183
|
+
}), [
|
|
184
|
+
...props.options.some((option) => option.value === props.value) ? [] : [h2("option", { value: "", disabled: true }, props.placeholder ?? "")],
|
|
185
|
+
...props.options.map((option) => h2("option", { key: option.value, value: option.value, disabled: option.disabled }, option.label))
|
|
186
|
+
]);
|
|
187
|
+
Select.props = {
|
|
188
|
+
value: String,
|
|
189
|
+
options: { type: Array, required: true },
|
|
190
|
+
placeholder: String,
|
|
191
|
+
size: String,
|
|
192
|
+
disabled: Boolean,
|
|
193
|
+
onChange: Function
|
|
194
|
+
};
|
|
195
|
+
Select.inheritAttrs = false;
|
|
196
|
+
export {
|
|
197
|
+
Article,
|
|
198
|
+
Aside,
|
|
199
|
+
Box,
|
|
200
|
+
Button,
|
|
201
|
+
Description,
|
|
202
|
+
DescriptionList,
|
|
203
|
+
DialogSurface,
|
|
204
|
+
Disclosure,
|
|
205
|
+
DisclosureTrigger,
|
|
206
|
+
Field,
|
|
207
|
+
Fieldset,
|
|
208
|
+
Footer,
|
|
209
|
+
Form,
|
|
210
|
+
Frame,
|
|
211
|
+
Header,
|
|
212
|
+
Heading,
|
|
213
|
+
Image,
|
|
214
|
+
Legend,
|
|
215
|
+
Link,
|
|
216
|
+
List,
|
|
217
|
+
ListItem,
|
|
218
|
+
Main,
|
|
219
|
+
Modal,
|
|
220
|
+
ModalBody,
|
|
221
|
+
Nav,
|
|
222
|
+
Panel,
|
|
223
|
+
Progress,
|
|
224
|
+
RichText,
|
|
225
|
+
Select,
|
|
226
|
+
SelectField,
|
|
227
|
+
SelectOption,
|
|
228
|
+
Svg,
|
|
229
|
+
SvgPath,
|
|
230
|
+
Table,
|
|
231
|
+
TableBody,
|
|
232
|
+
TableCaption,
|
|
233
|
+
TableCell,
|
|
234
|
+
TableHead,
|
|
235
|
+
TableHeader,
|
|
236
|
+
TableRow,
|
|
237
|
+
Term,
|
|
238
|
+
Text,
|
|
239
|
+
TextArea,
|
|
240
|
+
TextField,
|
|
241
|
+
useDialogFocus
|
|
242
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type ShallowRef, type PropType, type FunctionalComponent, type SelectHTMLAttributes } from 'vue';
|
|
2
|
+
import type { ControlSize } from './primitives.js';
|
|
3
|
+
/** Native dialog owns focus containment and restoration, including nested dialogs. */
|
|
4
|
+
export declare function useDialogFocus(dialog: ShallowRef<HTMLDialogElement | undefined>, isOpen: () => boolean, close: () => void): {
|
|
5
|
+
onDialogCancel: (event: Event) => void;
|
|
6
|
+
};
|
|
7
|
+
export interface ModalProps {
|
|
8
|
+
open: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
labelledby?: string;
|
|
11
|
+
size?: 'md' | 'lg' | 'xl';
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const Modal: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
open: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
label: StringConstructor;
|
|
20
|
+
labelledby: StringConstructor;
|
|
21
|
+
size: {
|
|
22
|
+
type: PropType<ModalProps["size"]>;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
dismissible: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
default: boolean;
|
|
28
|
+
};
|
|
29
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
close: () => true;
|
|
33
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
+
open: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
label: StringConstructor;
|
|
39
|
+
labelledby: StringConstructor;
|
|
40
|
+
size: {
|
|
41
|
+
type: PropType<ModalProps["size"]>;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
44
|
+
dismissible: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
}>> & Readonly<{
|
|
49
|
+
onClose?: (() => any) | undefined;
|
|
50
|
+
}>, {
|
|
51
|
+
size: "md" | "lg" | "xl" | undefined;
|
|
52
|
+
dismissible: boolean;
|
|
53
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
54
|
+
export interface SelectItem {
|
|
55
|
+
value: string;
|
|
56
|
+
label: string;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes, 'value' | 'size' | 'onChange' | 'multiple'> {
|
|
60
|
+
value: string | undefined;
|
|
61
|
+
options: readonly SelectItem[];
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
size?: ControlSize;
|
|
64
|
+
onChange?: (value: string) => void;
|
|
65
|
+
}
|
|
66
|
+
/** Native select provides keyboard navigation, typeahead and mobile pickers. */
|
|
67
|
+
export declare const Select: FunctionalComponent<SelectProps>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type FunctionalComponent, type HTMLAttributes, type ButtonHTMLAttributes, type InputHTMLAttributes, type TextareaHTMLAttributes, type SelectHTMLAttributes, type SVGAttributes } from 'vue';
|
|
2
|
+
export type ControlSize = 'xs' | 'sm' | 'md';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'quiet' | 'icon' | 'navigation' | 'danger';
|
|
4
|
+
export type ElementProps = HTMLAttributes & {
|
|
5
|
+
as?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const Box: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
8
|
+
export declare const Text: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
9
|
+
export declare const Heading: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
10
|
+
export declare const Panel: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
11
|
+
export declare const ModalBody: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
12
|
+
export declare const Header: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
13
|
+
export declare const Footer: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
14
|
+
export declare const Nav: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
15
|
+
export declare const Aside: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
16
|
+
export declare const Main: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
17
|
+
export declare const Article: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
18
|
+
export declare const Form: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
19
|
+
export declare const Field: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
20
|
+
export declare const Fieldset: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
21
|
+
export declare const Legend: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
22
|
+
export declare const Disclosure: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
23
|
+
export declare const DisclosureTrigger: FunctionalComponent<ElementProps & {
|
|
24
|
+
size?: 'xs' | 'sm';
|
|
25
|
+
}>;
|
|
26
|
+
export declare const List: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
27
|
+
export declare const ListItem: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
28
|
+
export declare const DescriptionList: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
29
|
+
export declare const Term: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
30
|
+
export declare const Description: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
31
|
+
export declare const Table: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
32
|
+
export declare const TableHead: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
33
|
+
export declare const TableBody: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
34
|
+
export declare const TableRow: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
35
|
+
export declare const TableCell: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
36
|
+
export declare const TableHeader: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
37
|
+
export declare const TableCaption: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
38
|
+
export declare const Frame: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
39
|
+
export declare const Image: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
40
|
+
export declare const DialogSurface: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
41
|
+
export declare const Progress: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
42
|
+
export declare const Link: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
43
|
+
export declare const Svg: FunctionalComponent<SVGAttributes>;
|
|
44
|
+
export declare const SvgPath: FunctionalComponent<SVGAttributes>;
|
|
45
|
+
export interface ButtonProps extends ButtonHTMLAttributes {
|
|
46
|
+
variant?: ButtonVariant;
|
|
47
|
+
size?: ControlSize;
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const Button: FunctionalComponent<ButtonProps>;
|
|
51
|
+
export interface ModelProps {
|
|
52
|
+
modelValue?: unknown;
|
|
53
|
+
modelModifiers?: {
|
|
54
|
+
number?: boolean;
|
|
55
|
+
trim?: boolean;
|
|
56
|
+
lazy?: boolean;
|
|
57
|
+
};
|
|
58
|
+
'onUpdate:modelValue'?: (value: any) => void;
|
|
59
|
+
}
|
|
60
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes, 'size'>, ModelProps {
|
|
61
|
+
size?: ControlSize;
|
|
62
|
+
}
|
|
63
|
+
export declare const TextField: FunctionalComponent<TextFieldProps>;
|
|
64
|
+
export declare const TextArea: FunctionalComponent<TextareaHTMLAttributes & ModelProps>;
|
|
65
|
+
export declare const SelectField: FunctionalComponent<SelectHTMLAttributes & ModelProps>;
|
|
66
|
+
export declare const SelectOption: FunctionalComponent<ElementProps, {}, any, {}>;
|
|
67
|
+
export declare const RichText: FunctionalComponent<HTMLAttributes & {
|
|
68
|
+
html: string;
|
|
69
|
+
}>;
|
package/dist/styles.css
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastrd/ui-vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Vue primitives and accessible native controls for FastUI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {"type":"git","url":"git+https://github.com/FastR-D/FastUI.git","directory":"packages/vue"},
|
|
8
|
+
"publishConfig": {"access":"public"},
|
|
9
|
+
"files": ["dist", "LICENSE", "README.md", "NOTICE.md"],
|
|
10
|
+
"sideEffects": ["**/*.css"],
|
|
11
|
+
"dependencies": {"@fastrd/ui-foundation":"0.1.1"},
|
|
12
|
+
"peerDependencies": {"vue":"^3.5.0"},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {"types":"./dist/index.d.ts","import":"./dist/index.js"},
|
|
15
|
+
"./styles.css": "./dist/styles.css"
|
|
16
|
+
}
|
|
17
|
+
}
|