@viewstem/ui 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/README.ko.md +47 -0
- package/README.md +60 -2
- package/dist/BASECOAT-LICENSE.md +21 -0
- package/dist/basecoat-contracts.d.ts +2 -0
- package/dist/basecoat-contracts.js +358 -0
- package/dist/basecoat-controllers.js +1612 -0
- package/dist/behaviors.d.ts +29 -0
- package/dist/behaviors.js +1475 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +2 -0
- package/dist/catalog-meta.d.ts +26 -0
- package/dist/catalog-meta.js +130 -0
- package/dist/component-context.d.ts +7 -0
- package/dist/component-context.js +10 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +536 -0
- package/dist/data-table.d.ts +2 -0
- package/dist/data-table.js +260 -0
- package/dist/date-calendar.d.ts +4 -0
- package/dist/date-calendar.js +512 -0
- package/dist/dynamic-catalog.d.ts +2 -0
- package/dist/dynamic-catalog.js +118 -0
- package/dist/form-scroll-families.d.ts +7 -0
- package/dist/form-scroll-families.js +895 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -0
- package/dist/markup-families.d.ts +10 -0
- package/dist/markup-families.js +492 -0
- package/dist/menus.d.ts +8 -0
- package/dist/menus.js +427 -0
- package/dist/shadcn.d.ts +13 -0
- package/dist/shadcn.js +8 -0
- package/dist/slider-values.d.ts +9 -0
- package/dist/slider-values.js +43 -0
- package/dist/slider.d.ts +2 -0
- package/dist/slider.js +148 -0
- package/dist/static-catalog.d.ts +2 -0
- package/dist/static-catalog.js +87 -0
- package/dist/style-scope.d.ts +2 -0
- package/dist/style-scope.js +3 -0
- package/dist/styles.css +9573 -0
- package/dist/styles.css.d.ts +1 -0
- package/dist/support.json +1 -0
- package/dist/widget-families.d.ts +6 -0
- package/dist/widget-families.js +739 -0
- package/package.json +59 -4
package/dist/browser.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Markup } from './dynamic-catalog.js';
|
|
2
|
+
export declare const components: Map<string, Markup>;
|
|
3
|
+
export declare const attributes: Set<string>;
|
|
4
|
+
export declare const domEvents: {
|
|
5
|
+
readonly click: "click";
|
|
6
|
+
readonly input: "input";
|
|
7
|
+
readonly change: "change";
|
|
8
|
+
readonly keyDown: "keydown";
|
|
9
|
+
readonly keyUp: "keyup";
|
|
10
|
+
readonly focus: "focus";
|
|
11
|
+
readonly blur: "blur";
|
|
12
|
+
readonly focusIn: "focusin";
|
|
13
|
+
readonly focusOut: "focusout";
|
|
14
|
+
readonly load: "load";
|
|
15
|
+
readonly error: "error";
|
|
16
|
+
readonly scroll: "scroll";
|
|
17
|
+
readonly mouseEnter: "mouseenter";
|
|
18
|
+
readonly mouseLeave: "mouseleave";
|
|
19
|
+
readonly select: "select";
|
|
20
|
+
readonly beforeInput: "beforeinput";
|
|
21
|
+
readonly submit: "submit";
|
|
22
|
+
readonly reset: "reset";
|
|
23
|
+
};
|
|
24
|
+
export declare function portNames(name: string): Set<string>;
|
|
25
|
+
export declare function eventNames(name: string): Set<string>;
|
|
26
|
+
export declare function slotNames(name: string): Set<string>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { staticCatalog } from './static-catalog.js';
|
|
2
|
+
import { dynamicCatalog } from './dynamic-catalog.js';
|
|
3
|
+
import { menuCatalog, menuPorts, menuEvents } from './menus.js';
|
|
4
|
+
import { markupCatalog, markupPorts, markupEvents } from './markup-families.js';
|
|
5
|
+
import { widgetCatalog, widgetPorts, widgetEvents } from './widget-families.js';
|
|
6
|
+
import { formScrollCatalog, formScrollPorts, formScrollEvents } from './form-scroll-families.js';
|
|
7
|
+
export const components = new Map(Object.entries({
|
|
8
|
+
...staticCatalog, ...dynamicCatalog, ...menuCatalog, ...markupCatalog, ...widgetCatalog, ...formScrollCatalog,
|
|
9
|
+
}));
|
|
10
|
+
export const attributes = new Set([
|
|
11
|
+
'id', 'class', 'style', 'title', 'role', 'dir', 'lang', 'tabindex', 'hidden', 'inert',
|
|
12
|
+
'name', 'for', 'label', 'alt', 'src', 'href', 'target', 'rel', 'placeholder', 'rows', 'cols', 'colspan', 'rowspan',
|
|
13
|
+
'disabled', 'required', 'readonly', 'multiple', 'autocomplete', 'maxlength', 'minlength', 'inputmode', 'pattern',
|
|
14
|
+
'data-icon', 'data-invalid', 'data-disabled', 'aria-label', 'aria-labelledby', 'aria-describedby',
|
|
15
|
+
'aria-current', 'aria-hidden', 'aria-invalid', 'aria-busy', 'aria-disabled', 'aria-live',
|
|
16
|
+
]);
|
|
17
|
+
const calendarInputs = 'buttonVariant captionLayout calendarLabel disableDaysOutsideMonth locale weekdayFormat yearFormat disabled fixedWeeks id initialFocus maxDays minValue maxValue monthFormat months numberOfMonths pagedNavigation placeholder preventDeselect readonly value weekStartsOn years';
|
|
18
|
+
const inputs = {
|
|
19
|
+
'Calendar.Root': calendarInputs + ' type',
|
|
20
|
+
'RangeCalendar.Root': calendarInputs + ' minDays excludeDisabled',
|
|
21
|
+
DatePicker: 'value range mode locale min max disabled placeholder',
|
|
22
|
+
DataTable: 'data columns sorting pageIndex pageSize filter selectedIds rowId labels',
|
|
23
|
+
'Accordion.Root': 'type value',
|
|
24
|
+
'Accordion.Item': 'value',
|
|
25
|
+
'Alert.Root': 'variant',
|
|
26
|
+
Badge: 'variant',
|
|
27
|
+
Button: 'variant size type',
|
|
28
|
+
'ButtonGroup.Root': 'orientation',
|
|
29
|
+
Checkbox: 'checked indeterminate value',
|
|
30
|
+
Switch: 'checked value',
|
|
31
|
+
'Collapsible.Root': 'open',
|
|
32
|
+
Combobox: 'value options emptyText searchPlaceholder',
|
|
33
|
+
'Command.Root': 'value',
|
|
34
|
+
'Command.Dialog': 'open title description',
|
|
35
|
+
'Command.Group': 'heading',
|
|
36
|
+
'Command.Item': 'value keywords',
|
|
37
|
+
'Command.LinkItem': 'value keywords',
|
|
38
|
+
'Dialog.Root': 'open',
|
|
39
|
+
'Dialog.Content': 'showCloseButton',
|
|
40
|
+
'AlertDialog.Root': 'open',
|
|
41
|
+
'AlertDialog.Content': 'size',
|
|
42
|
+
'Drawer.Root': 'open dismissible',
|
|
43
|
+
'Drawer.NestedRoot': 'open dismissible',
|
|
44
|
+
'Sheet.Root': 'open',
|
|
45
|
+
'Sheet.Content': 'side showCloseButton escapeKeydownBehavior interactOutsideBehavior',
|
|
46
|
+
'Empty.Media': 'variant',
|
|
47
|
+
'Field.Field': 'orientation',
|
|
48
|
+
'InputGroup.Addon': 'align',
|
|
49
|
+
'InputGroup.Button': 'variant size type',
|
|
50
|
+
'InputGroup.Input': 'type value',
|
|
51
|
+
'InputGroup.Textarea': 'value',
|
|
52
|
+
Input: 'type value',
|
|
53
|
+
Textarea: 'value',
|
|
54
|
+
'Item.Root': 'variant size',
|
|
55
|
+
'Item.Media': 'variant',
|
|
56
|
+
'NativeSelect.Root': 'value',
|
|
57
|
+
'NativeSelect.Option': 'value selected',
|
|
58
|
+
'Pagination.Root': 'count perPage page',
|
|
59
|
+
'Pagination.Link': 'page isActive',
|
|
60
|
+
'Popover.Root': 'open',
|
|
61
|
+
Progress: 'value max',
|
|
62
|
+
'RadioGroup.Root': 'value',
|
|
63
|
+
'RadioGroup.Item': 'value',
|
|
64
|
+
'Select.Root': 'type value items',
|
|
65
|
+
'Select.Item': 'value label',
|
|
66
|
+
'Sidebar.Provider': 'open',
|
|
67
|
+
'Sidebar.Root': 'collapsible',
|
|
68
|
+
'Sidebar.MenuButton': 'isActive',
|
|
69
|
+
'Sidebar.MenuSubButton': 'isActive',
|
|
70
|
+
Slider: 'type value min max step',
|
|
71
|
+
'Tooltip.Provider': 'delayDuration disabled',
|
|
72
|
+
'Tooltip.Root': 'delayDuration disabled open',
|
|
73
|
+
'Tabs.Root': 'value orientation',
|
|
74
|
+
'Tabs.Trigger': 'value',
|
|
75
|
+
'Tabs.Content': 'value',
|
|
76
|
+
Separator: 'decorative',
|
|
77
|
+
Notifications: 'notifications closeButton closeButtonAriaLabel containerAriaLabel position',
|
|
78
|
+
Sonner: 'position closeButton closeButtonAriaLabel containerAriaLabel',
|
|
79
|
+
'Chart.Container': 'config',
|
|
80
|
+
Chart: 'kind data x series label',
|
|
81
|
+
};
|
|
82
|
+
const behaviors = {
|
|
83
|
+
'Avatar.Root': 'loadingStatusChange',
|
|
84
|
+
'Calendar.Root': 'valueChange placeholderChange',
|
|
85
|
+
'RangeCalendar.Root': 'valueChange placeholderChange startValueChange endValueChange',
|
|
86
|
+
DatePicker: 'valueChange rangeChange',
|
|
87
|
+
DataTable: 'sortingChange pageIndexChange pageSizeChange filterChange selectedIdsChange',
|
|
88
|
+
'Accordion.Root': 'valueChange',
|
|
89
|
+
'Collapsible.Root': 'openChange openChangeComplete',
|
|
90
|
+
Combobox: 'valueChange',
|
|
91
|
+
'Command.Root': 'valueChange',
|
|
92
|
+
'Command.Item': 'select',
|
|
93
|
+
'Command.LinkItem': 'select',
|
|
94
|
+
'Dialog.Root': 'openChange openChangeComplete',
|
|
95
|
+
'AlertDialog.Root': 'openChange openChangeComplete',
|
|
96
|
+
'Drawer.Root': 'openChange openChangeComplete close animationEnd',
|
|
97
|
+
'Drawer.NestedRoot': 'openChange openChangeComplete animationEnd',
|
|
98
|
+
'Sheet.Root': 'openChange openChangeComplete',
|
|
99
|
+
'Pagination.Root': 'pageChange',
|
|
100
|
+
'Popover.Root': 'openChange openChangeComplete',
|
|
101
|
+
'Tooltip.Root': 'openChange openChangeComplete',
|
|
102
|
+
'RadioGroup.Root': 'valueChange',
|
|
103
|
+
'Select.Root': 'valueChange openChange openChangeComplete',
|
|
104
|
+
'Select.Item': 'highlight unhighlight',
|
|
105
|
+
'Sidebar.Provider': 'openChange',
|
|
106
|
+
'Tabs.Root': 'valueChange',
|
|
107
|
+
Checkbox: 'checkedChange indeterminateChange',
|
|
108
|
+
Switch: 'checkedChange',
|
|
109
|
+
Slider: 'valueChange valueCommit',
|
|
110
|
+
Notifications: 'dismiss',
|
|
111
|
+
};
|
|
112
|
+
export const domEvents = {
|
|
113
|
+
click: 'click', input: 'input', change: 'change', keyDown: 'keydown', keyUp: 'keyup',
|
|
114
|
+
focus: 'focus', blur: 'blur', focusIn: 'focusin', focusOut: 'focusout', load: 'load', error: 'error',
|
|
115
|
+
scroll: 'scroll', mouseEnter: 'mouseenter', mouseLeave: 'mouseleave',
|
|
116
|
+
select: 'select', beforeInput: 'beforeinput',
|
|
117
|
+
submit: 'submit', reset: 'reset',
|
|
118
|
+
};
|
|
119
|
+
export function portNames(name) {
|
|
120
|
+
return new Set([...attributes, 'text', ...[inputs, menuPorts, markupPorts, widgetPorts, formScrollPorts]
|
|
121
|
+
.flatMap(table => table[name]?.split(' ') ?? [])]);
|
|
122
|
+
}
|
|
123
|
+
export function eventNames(name) {
|
|
124
|
+
return new Set([...Object.keys(domEvents), ...[behaviors, menuEvents, markupEvents, widgetEvents, formScrollEvents]
|
|
125
|
+
.flatMap(table => table[name]?.split(' ') ?? [])]);
|
|
126
|
+
}
|
|
127
|
+
export function slotNames(name) {
|
|
128
|
+
const child = /^(?:Dialog|AlertDialog|Drawer|Sheet)\.(?:Trigger|Close|Action|Cancel)$/.test(name) || /^(?:Collapsible|DropdownMenu|HoverCard|Popover|Tooltip)\.Trigger$/.test(name) || name === 'Popover.Close';
|
|
129
|
+
return new Set(child ? ['default', 'child'] : ['default']);
|
|
130
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NodeSnapshot } from '@viewstem/core';
|
|
2
|
+
import type { Send } from './behaviors.js';
|
|
3
|
+
type Inputs = NodeSnapshot['inputs'];
|
|
4
|
+
export declare function bindComponent(element: HTMLElement, inputs: () => Inputs, send: Send): void;
|
|
5
|
+
export declare function readInputs(element: HTMLElement | null): Inputs;
|
|
6
|
+
export declare function emitFrom(element: HTMLElement, event: string, payload: unknown): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const entries = new WeakMap();
|
|
2
|
+
export function bindComponent(element, inputs, send) {
|
|
3
|
+
entries.set(element, { inputs, send });
|
|
4
|
+
}
|
|
5
|
+
export function readInputs(element) {
|
|
6
|
+
return (element && entries.get(element)?.inputs()) || {};
|
|
7
|
+
}
|
|
8
|
+
export function emitFrom(element, event, payload) {
|
|
9
|
+
entries.get(element)?.send(event, payload);
|
|
10
|
+
}
|