@link-foundation/ui-components 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONFIGURATIONS.md +74 -0
- package/ICONS.md +76 -0
- package/LICENSE +24 -0
- package/README.md +1499 -2
- package/bin/lino-network.mjs +71 -0
- package/dist/icons/ATTRIBUTION.md +602 -0
- package/dist/icons/NOTICE.lino +1261 -0
- package/dist/icons/brand.js +31 -0
- package/dist/icons/brand.svg +3 -0
- package/dist/icons/licenses/brand/DISCLAIMER.md +51 -0
- package/dist/icons/licenses/brand/LICENSE.md +30 -0
- package/dist/icons/licenses/lucide/LICENSE +43 -0
- package/dist/icons/licenses/material-symbols/LICENSE +202 -0
- package/dist/icons/licenses/material-symbols/NOTICE +12 -0
- package/dist/icons/licenses/tabler/LICENSE +21 -0
- package/dist/icons/lucide.js +681 -0
- package/dist/icons/lucide.svg +34 -0
- package/dist/icons/material-symbols.js +681 -0
- package/dist/icons/material-symbols.svg +34 -0
- package/dist/icons/own.js +521 -0
- package/dist/icons/own.svg +34 -0
- package/dist/icons/tabler.js +681 -0
- package/dist/icons/tabler.svg +34 -0
- package/dist/network-layout-NOTICE.md +6 -0
- package/dist/network-layout-d3-dispatch-LICENSE.txt +13 -0
- package/dist/network-layout-d3-force-LICENSE.txt +13 -0
- package/dist/network-layout-d3-quadtree-LICENSE.txt +13 -0
- package/dist/network-layout-d3-timer-LICENSE.txt +13 -0
- package/dist/network-layout-dagre-LICENSE.txt +19 -0
- package/dist/network-layout.worker.mjs +2 -0
- package/package.json +246 -4
- package/src/a11y/announce.js +88 -0
- package/src/a11y/bind-machine.js +181 -0
- package/src/a11y/focus.js +169 -0
- package/src/a11y/index.d.ts +89 -0
- package/src/a11y/index.js +19 -0
- package/src/a11y/keys.js +182 -0
- package/src/a11y/roving.js +167 -0
- package/src/a11y/typeahead.js +82 -0
- package/src/behavior/actions.js +235 -0
- package/src/behavior/diagnostics.js +73 -0
- package/src/behavior/dom.d.ts +38 -0
- package/src/behavior/dom.js +420 -0
- package/src/behavior/index.d.ts +211 -0
- package/src/behavior/index.js +29 -0
- package/src/behavior/interpret.js +454 -0
- package/src/behavior/machines/disclosure.lino +46 -0
- package/src/behavior/machines/index.js +91 -0
- package/src/behavior/machines/toggle.lino +25 -0
- package/src/behavior/parse-machine.js +367 -0
- package/src/charts/README.md +78 -0
- package/src/charts/activity-layout.js +350 -0
- package/src/charts/activity-model.js +130 -0
- package/src/charts/activity-validation.js +31 -0
- package/src/charts/chart-model.js +667 -0
- package/src/charts/chart.js +518 -0
- package/src/charts/echarts-adapter.d.ts +23 -0
- package/src/charts/echarts-adapter.js +240 -0
- package/src/charts/element.js +330 -0
- package/src/charts/errors.js +62 -0
- package/src/charts/gauge.js +27 -0
- package/src/charts/index.d.ts +344 -0
- package/src/charts/index.js +59 -0
- package/src/charts/layout.js +542 -0
- package/src/charts/lino.js +158 -0
- package/src/charts/mark-options.js +78 -0
- package/src/charts/read.js +101 -0
- package/src/charts/renderer-features.js +8 -0
- package/src/charts/scales.js +223 -0
- package/src/charts/small-model.js +223 -0
- package/src/charts/small-svg.js +269 -0
- package/src/charts/sparkline.js +27 -0
- package/src/charts/stat-tile.js +37 -0
- package/src/charts/summary.js +193 -0
- package/src/charts/svg-renderer.js +226 -0
- package/src/charts/svg.js +69 -0
- package/src/charts/tag-cloud.js +129 -0
- package/src/charts/tokens.js +171 -0
- package/src/charts/tooltip.js +47 -0
- package/src/charts/values.js +146 -0
- package/src/chat/README.md +142 -0
- package/src/chat/actions.js +75 -0
- package/src/chat/chat-contract.js +95 -0
- package/src/chat/chat-list.js +42 -0
- package/src/chat/chat-model.js +125 -0
- package/src/chat/chat.css +228 -0
- package/src/chat/composer.js +131 -0
- package/src/chat/day-separator.js +12 -0
- package/src/chat/dom.js +33 -0
- package/src/chat/follow.js +49 -0
- package/src/chat/index.d.ts +142 -0
- package/src/chat/index.js +13 -0
- package/src/chat/message-bubble.js +191 -0
- package/src/chat/message-stream.js +331 -0
- package/src/chat/reasoning-trace.js +70 -0
- package/src/chat/selection.js +39 -0
- package/src/chat/skins/bubbles.lino +2 -0
- package/src/chat/skins/cards.lino +4 -0
- package/src/chat/skins/compact.lino +4 -0
- package/src/chat/skins/signal.lino +25 -0
- package/src/chat/skins/t3.lino +25 -0
- package/src/chat/skins/telegram.lino +31 -0
- package/src/chat/skins/whatsapp.lino +25 -0
- package/src/chat/stream-keys.js +57 -0
- package/src/chat/stream-window.js +159 -0
- package/src/chat/vocabulary.js +19 -0
- package/src/controls/accordion.js +160 -0
- package/src/controls/avatar.js +80 -0
- package/src/controls/badge.js +48 -0
- package/src/controls/button-template.js +32 -0
- package/src/controls/button.js +97 -0
- package/src/controls/catalog.lino +84 -0
- package/src/controls/checkbox.js +112 -0
- package/src/controls/chip.js +140 -0
- package/src/controls/choices.js +45 -0
- package/src/controls/color-field.js +217 -0
- package/src/controls/color-popover.js +135 -0
- package/src/controls/color-rgb.js +80 -0
- package/src/controls/color.js +67 -0
- package/src/controls/combobox.js +192 -0
- package/src/controls/dom.js +261 -0
- package/src/controls/icon-button.js +33 -0
- package/src/controls/index.d.ts +163 -0
- package/src/controls/index.js +182 -0
- package/src/controls/kinds-text.js +358 -0
- package/src/controls/kinds.lino +350 -0
- package/src/controls/label.js +52 -0
- package/src/controls/link.js +101 -0
- package/src/controls/listbox.js +144 -0
- package/src/controls/machines/button.lino +20 -0
- package/src/controls/machines/checkbox.lino +17 -0
- package/src/controls/machines/chip.lino +20 -0
- package/src/controls/machines/color-field.lino +23 -0
- package/src/controls/machines/combobox.lino +82 -0
- package/src/controls/machines/icon-button.lino +20 -0
- package/src/controls/machines/index.js +586 -0
- package/src/controls/machines/number-field.lino +71 -0
- package/src/controls/machines/radio-group.lino +17 -0
- package/src/controls/machines/select.lino +122 -0
- package/src/controls/machines/slider.lino +99 -0
- package/src/controls/machines/switch.lino +19 -0
- package/src/controls/machines/text-area.lino +26 -0
- package/src/controls/machines/text-field.lino +26 -0
- package/src/controls/number-field.js +239 -0
- package/src/controls/numeric-keys.js +125 -0
- package/src/controls/option.js +54 -0
- package/src/controls/progress.js +76 -0
- package/src/controls/radio-group.js +234 -0
- package/src/controls/select.js +229 -0
- package/src/controls/slider.js +234 -0
- package/src/controls/stories.js +172 -0
- package/src/controls/styles.css +1060 -0
- package/src/controls/switch.js +95 -0
- package/src/controls/text-area.js +39 -0
- package/src/controls/text-field.js +131 -0
- package/src/controls/vocabulary.js +164 -0
- package/src/data/data.css +95 -0
- package/src/data/index.d.ts +83 -0
- package/src/data/index.js +10 -0
- package/src/data/keyboard.js +189 -0
- package/src/data/list.js +215 -0
- package/src/data/render-data.js +116 -0
- package/src/data/selection-dom.js +39 -0
- package/src/data/selection-model.js +43 -0
- package/src/data/sort-model.js +42 -0
- package/src/data/source.js +45 -0
- package/src/data/table.js +160 -0
- package/src/data/tree-model.js +41 -0
- package/src/data/tree.js +55 -0
- package/src/data/viewport.js +216 -0
- package/src/data/virtual-range.js +92 -0
- package/src/data/vocabulary.js +67 -0
- package/src/diagrams/diagram-model.js +511 -0
- package/src/diagrams/diagram.js +204 -0
- package/src/diagrams/index.d.ts +225 -0
- package/src/diagrams/index.js +48 -0
- package/src/diagrams/layout-dagre.js +164 -0
- package/src/diagrams/layout-plugins.js +131 -0
- package/src/diagrams/mermaid-export.js +232 -0
- package/src/diagrams/mermaid-view.js +229 -0
- package/src/diagrams/svg-diagram.js +215 -0
- package/src/editor/code-editor.js +206 -0
- package/src/editor/documents-model.js +170 -0
- package/src/editor/documents-persistence.js +85 -0
- package/src/editor/editor-engine.js +22 -0
- package/src/editor/editor-ui.js +203 -0
- package/src/editor/editor.css +106 -0
- package/src/editor/engines/codemirror.js +227 -0
- package/src/editor/engines/monaco.js +219 -0
- package/src/editor/index.d.ts +111 -0
- package/src/editor/index.js +14 -0
- package/src/editor/lino-highlight.js +106 -0
- package/src/editor/lino-structure.js +85 -0
- package/src/editor/validate-lino.js +43 -0
- package/src/embed/README.md +161 -0
- package/src/embed/controller.js +223 -0
- package/src/embed/element.js +141 -0
- package/src/embed/index.d.ts +75 -0
- package/src/embed/index.js +9 -0
- package/src/embed/providers/telegram.d.ts +3 -0
- package/src/embed/providers/telegram.js +38 -0
- package/src/embed/providers/vk.d.ts +3 -0
- package/src/embed/providers/vk.js +42 -0
- package/src/embed/providers/x.d.ts +3 -0
- package/src/embed/providers/x.js +31 -0
- package/src/embed/registry.js +35 -0
- package/src/embed/script.js +73 -0
- package/src/embed/view.js +122 -0
- package/src/icons/adapters/lucide.d.ts +15 -0
- package/src/icons/adapters/lucide.js +142 -0
- package/src/icons/adapters/material-symbols.d.ts +13 -0
- package/src/icons/adapters/material-symbols.js +113 -0
- package/src/icons/adapters/shared.d.ts +38 -0
- package/src/icons/adapters/shared.js +157 -0
- package/src/icons/adapters/simple-icons.d.ts +9 -0
- package/src/icons/adapters/simple-icons.js +38 -0
- package/src/icons/adapters/tabler.d.ts +9 -0
- package/src/icons/adapters/tabler.js +86 -0
- package/src/icons/icon-registry.js +215 -0
- package/src/icons/icon.js +356 -0
- package/src/icons/index.d.ts +123 -0
- package/src/icons/index.js +30 -0
- package/src/icons/names.js +51 -0
- package/src/icons/own-icons.js +521 -0
- package/src/icons/presentation.js +55 -0
- package/src/icons/svg.js +136 -0
- package/src/index.d.ts +14 -0
- package/src/index.js +40 -0
- package/src/layout/README.md +102 -0
- package/src/layout/app-shell.js +150 -0
- package/src/layout/catalog.lino +27 -0
- package/src/layout/dock-model.js +576 -0
- package/src/layout/dock-view.js +312 -0
- package/src/layout/dock.js +352 -0
- package/src/layout/dom.js +312 -0
- package/src/layout/grid.js +192 -0
- package/src/layout/index.d.ts +267 -0
- package/src/layout/index.js +60 -0
- package/src/layout/layer-manager.js +120 -0
- package/src/layout/layout.css +760 -0
- package/src/layout/menu.js +141 -0
- package/src/layout/nav-strip.js +174 -0
- package/src/layout/page-links.js +166 -0
- package/src/layout/panel.js +26 -0
- package/src/layout/pref-switches.js +209 -0
- package/src/layout/split-model.js +270 -0
- package/src/layout/split.js +430 -0
- package/src/layout/stack.js +86 -0
- package/src/layout/surfaces.js +119 -0
- package/src/layout/tab-group.js +151 -0
- package/src/layout/tab-strip.js +277 -0
- package/src/layout/vocabulary.js +229 -0
- package/src/layout/window-frame.js +222 -0
- package/src/layout/window.js +146 -0
- package/src/links-view/animator.js +144 -0
- package/src/links-view/configuration-classes.js +150 -0
- package/src/links-view/configuration-model.js +191 -0
- package/src/links-view/configuration-notations.js +230 -0
- package/src/links-view/configurations.d.ts +73 -0
- package/src/links-view/configurations.js +33 -0
- package/src/links-view/create-layout-runner.js +79 -0
- package/src/links-view/doublet-curves.js +239 -0
- package/src/links-view/doublet-layout.js +148 -0
- package/src/links-view/doublet-markers.js +109 -0
- package/src/links-view/doublet-options.js +369 -0
- package/src/links-view/doublet-svg.js +156 -0
- package/src/links-view/doublet.js +230 -0
- package/src/links-view/export.js +146 -0
- package/src/links-view/geometry.js +409 -0
- package/src/links-view/index.d.ts +1029 -0
- package/src/links-view/index.js +140 -0
- package/src/links-view/labels.js +28 -0
- package/src/links-view/layout-worker-entry.mjs +2 -0
- package/src/links-view/layout-worker.js +28 -0
- package/src/links-view/layouts/circle.js +7 -0
- package/src/links-view/layouts/force.js +76 -0
- package/src/links-view/layouts/grid.js +7 -0
- package/src/links-view/layouts/hex.js +8 -0
- package/src/links-view/layouts/index.js +15 -0
- package/src/links-view/layouts/layered.js +29 -0
- package/src/links-view/layouts/regular.js +27 -0
- package/src/links-view/layouts/spiral.js +10 -0
- package/src/links-view/link-view.js +494 -0
- package/src/links-view/links-gallery.js +306 -0
- package/src/links-view/links-network.js +496 -0
- package/src/links-view/lino-network-source.js +122 -0
- package/src/links-view/lino-network.js +233 -0
- package/src/links-view/lino-to-network.js +252 -0
- package/src/links-view/markers.js +192 -0
- package/src/links-view/model.js +233 -0
- package/src/links-view/network-editor/dom.js +36 -0
- package/src/links-view/network-editor/editor.js +202 -0
- package/src/links-view/network-editor/model.js +163 -0
- package/src/links-view/network-editor/options.js +265 -0
- package/src/links-view/network-editor/panels.js +423 -0
- package/src/links-view/network-editor/presets.js +76 -0
- package/src/links-view/network-editor/provider.js +93 -0
- package/src/links-view/network-editor/remap.js +45 -0
- package/src/links-view/network-editor/schema.js +224 -0
- package/src/links-view/network-editor/share.js +232 -0
- package/src/links-view/network-editor/styles.js +19 -0
- package/src/links-view/network-editor/url-sync.js +131 -0
- package/src/links-view/network-interaction.js +228 -0
- package/src/links-view/network-model.js +85 -0
- package/src/links-view/network-renderer.js +259 -0
- package/src/links-view/network-scene.js +245 -0
- package/src/links-view/network-source.js +82 -0
- package/src/links-view/network-vocabulary.js +18 -0
- package/src/links-view/presentation.js +199 -0
- package/src/links-view/render-canvas.js +102 -0
- package/src/links-view/render-svg.js +118 -0
- package/src/links-view/scene.js +233 -0
- package/src/links-view/solver-job.js +106 -0
- package/src/links-view/tokens.js +114 -0
- package/src/links-view/zoom-pan.js +203 -0
- package/src/overlays/catalog.lino +89 -0
- package/src/overlays/context-menu.js +110 -0
- package/src/overlays/dialog.js +117 -0
- package/src/overlays/dom.js +168 -0
- package/src/overlays/drawer.js +8 -0
- package/src/overlays/index.d.ts +80 -0
- package/src/overlays/index.js +25 -0
- package/src/overlays/kinds.lino +137 -0
- package/src/overlays/list-popover.js +129 -0
- package/src/overlays/machines/index.js +71 -0
- package/src/overlays/machines/surface.lino +11 -0
- package/src/overlays/machines/tabs.lino +7 -0
- package/src/overlays/machines/toast.lino +16 -0
- package/src/overlays/machines/tooltip.lino +29 -0
- package/src/overlays/menu.js +240 -0
- package/src/overlays/popover.js +194 -0
- package/src/overlays/position.js +84 -0
- package/src/overlays/radial-geometry.js +38 -0
- package/src/overlays/radial-menu.js +50 -0
- package/src/overlays/styles.css +155 -0
- package/src/overlays/tabs.js +125 -0
- package/src/overlays/toast-queue.js +105 -0
- package/src/overlays/toast.js +163 -0
- package/src/overlays/tooltip.js +110 -0
- package/src/overlays/vocabulary.js +3 -0
- package/src/settings/conditions.js +44 -0
- package/src/settings/control-for.js +62 -0
- package/src/settings/field-control.js +201 -0
- package/src/settings/index.d.ts +201 -0
- package/src/settings/index.js +3 -0
- package/src/settings/messages.js +112 -0
- package/src/settings/miniature.js +26 -0
- package/src/settings/panel-actions.js +234 -0
- package/src/settings/panel-model.js +49 -0
- package/src/settings/panel-refresh.js +56 -0
- package/src/settings/panel-rows.js +200 -0
- package/src/settings/preset-cards.js +43 -0
- package/src/settings/saved-looks.js +227 -0
- package/src/settings/section-layout.js +95 -0
- package/src/settings/section-tabs.js +175 -0
- package/src/settings/settings-panel.js +192 -0
- package/src/settings/settings.css +178 -0
- package/stories/accordion.lino +14 -0
- package/stories/alert-dialog.lino +4 -0
- package/stories/app-bar.lino +10 -0
- package/stories/avatar.lino +7 -0
- package/stories/badge.lino +12 -0
- package/stories/button.lino +17 -0
- package/stories/card.lino +10 -0
- package/stories/checkbox.lino +14 -0
- package/stories/chip.lino +19 -0
- package/stories/color-field.lino +9 -0
- package/stories/combobox.lino +10 -0
- package/stories/container.lino +11 -0
- package/stories/context-menu.lino +15 -0
- package/stories/dialog.lino +16 -0
- package/stories/drawer.lino +12 -0
- package/stories/icon-button.lino +13 -0
- package/stories/label.lino +7 -0
- package/stories/link-cards.lino +9 -0
- package/stories/link.lino +9 -0
- package/stories/menu-item.lino +6 -0
- package/stories/menu-separator.lino +7 -0
- package/stories/menu.lino +30 -0
- package/stories/nav-strip.lino +11 -0
- package/stories/number-field.lino +16 -0
- package/stories/option.lino +10 -0
- package/stories/paper.lino +11 -0
- package/stories/popover.lino +4 -0
- package/stories/pref-switches.lino +4 -0
- package/stories/progress.lino +14 -0
- package/stories/radial-menu.lino +19 -0
- package/stories/radio-group.lino +22 -0
- package/stories/radio.lino +10 -0
- package/stories/section-nav.lino +9 -0
- package/stories/select.lino +16 -0
- package/stories/slider.lino +14 -0
- package/stories/switch.lino +10 -0
- package/stories/tab-panel.lino +7 -0
- package/stories/tab.lino +7 -0
- package/stories/tabs.lino +25 -0
- package/stories/text-area.lino +12 -0
- package/stories/text-field.lino +23 -0
- package/stories/titled-section.lino +7 -0
- package/stories/toast.lino +3 -0
- package/stories/toaster.lino +2 -0
- package/stories/tooltip.lino +3 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export interface VirtualAnchor {
|
|
2
|
+
getBoundingClientRect():
|
|
3
|
+
| DOMRect
|
|
4
|
+
| {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
};
|
|
14
|
+
contextElement?: Element;
|
|
15
|
+
}
|
|
16
|
+
export interface PositionOptions {
|
|
17
|
+
placement?: string;
|
|
18
|
+
offset?: number;
|
|
19
|
+
onUpdate?: (position: { x: number; y: number; placement: string }) => void;
|
|
20
|
+
}
|
|
21
|
+
export function positionFloating(
|
|
22
|
+
anchor: Element | VirtualAnchor,
|
|
23
|
+
floating: HTMLElement,
|
|
24
|
+
options?: PositionOptions
|
|
25
|
+
): () => void;
|
|
26
|
+
export function createPositioner(
|
|
27
|
+
dependencies?: object
|
|
28
|
+
): typeof positionFloating;
|
|
29
|
+
export function virtualAnchor(
|
|
30
|
+
x: number,
|
|
31
|
+
y: number,
|
|
32
|
+
contextElement?: Element
|
|
33
|
+
): VirtualAnchor;
|
|
34
|
+
export function radialLayout(
|
|
35
|
+
count: number,
|
|
36
|
+
options?: { radius?: number; startAngle?: number }
|
|
37
|
+
): { x: number; y: number; angle: number }[];
|
|
38
|
+
export function sectorAt(
|
|
39
|
+
dx: number,
|
|
40
|
+
dy: number,
|
|
41
|
+
count: number,
|
|
42
|
+
startAngle?: number
|
|
43
|
+
): number;
|
|
44
|
+
export interface OverlayController {
|
|
45
|
+
open(
|
|
46
|
+
anchor?: Element | VirtualAnchor,
|
|
47
|
+
context?: { target?: string; selection?: string[] }
|
|
48
|
+
): void;
|
|
49
|
+
close(restore?: boolean): void;
|
|
50
|
+
service?: import('@link-foundation/ui-components/behavior').Service;
|
|
51
|
+
queue?: ReturnType<typeof createToastQueue>;
|
|
52
|
+
}
|
|
53
|
+
export function overlayController(node: Element): OverlayController | undefined;
|
|
54
|
+
export function overlayVocabulary(): import('@link-foundation/ui-core').Vocabulary;
|
|
55
|
+
export function createToastQueue(options: {
|
|
56
|
+
max?: number;
|
|
57
|
+
duration?: number;
|
|
58
|
+
clock: { now?: number; setTimeout: Function; clearTimeout: Function };
|
|
59
|
+
onChange?: (entries: object[]) => void;
|
|
60
|
+
}): {
|
|
61
|
+
entries: Map<string, any>;
|
|
62
|
+
push(id: string, options?: object): void;
|
|
63
|
+
close(id: string): void;
|
|
64
|
+
pause(id: string, reason?: string): void;
|
|
65
|
+
resume(id: string, reason?: string): void;
|
|
66
|
+
disconnect(): void;
|
|
67
|
+
};
|
|
68
|
+
export const SURFACE_MACHINE: string;
|
|
69
|
+
export const TOOLTIP_MACHINE: string;
|
|
70
|
+
export const TABS_MACHINE: string;
|
|
71
|
+
export const TOAST_MACHINE: string;
|
|
72
|
+
|
|
73
|
+
declare module '@link-foundation/ui-dom' {
|
|
74
|
+
interface RenderOptions {
|
|
75
|
+
overlays?: {
|
|
76
|
+
clock?: import('@link-foundation/ui-components/behavior').Clock;
|
|
77
|
+
selection?: () => readonly string[];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Overlay and navigation kinds register with ui-dom on import. */
|
|
2
|
+
export {
|
|
3
|
+
positionFloating,
|
|
4
|
+
createPositioner,
|
|
5
|
+
virtualAnchor,
|
|
6
|
+
} from './position.js';
|
|
7
|
+
export { radialLayout, sectorAt } from './radial-geometry.js';
|
|
8
|
+
export { overlayController } from './dom.js';
|
|
9
|
+
export { overlayVocabulary } from './vocabulary.js';
|
|
10
|
+
export { createToastQueue } from './toast-queue.js';
|
|
11
|
+
export {
|
|
12
|
+
SURFACE_MACHINE,
|
|
13
|
+
TOOLTIP_MACHINE,
|
|
14
|
+
TABS_MACHINE,
|
|
15
|
+
TOAST_MACHINE,
|
|
16
|
+
} from './machines/index.js';
|
|
17
|
+
import './dialog.js';
|
|
18
|
+
import './popover.js';
|
|
19
|
+
import './tooltip.js';
|
|
20
|
+
import './menu.js';
|
|
21
|
+
import './context-menu.js';
|
|
22
|
+
import './radial-menu.js';
|
|
23
|
+
import './tabs.js';
|
|
24
|
+
import './toast.js';
|
|
25
|
+
import './drawer.js';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
dialog: kind
|
|
2
|
+
description 'The dialog overlay/navigation primitive.'
|
|
3
|
+
property title string
|
|
4
|
+
property body any
|
|
5
|
+
property actions any
|
|
6
|
+
property open
|
|
7
|
+
enum true false
|
|
8
|
+
property on action multi
|
|
9
|
+
children any
|
|
10
|
+
|
|
11
|
+
alert-dialog: kind
|
|
12
|
+
description 'The alert-dialog overlay/navigation primitive.'
|
|
13
|
+
property title string
|
|
14
|
+
property body any
|
|
15
|
+
property actions any
|
|
16
|
+
property open
|
|
17
|
+
enum true false
|
|
18
|
+
property on action multi
|
|
19
|
+
children any
|
|
20
|
+
|
|
21
|
+
popover: kind
|
|
22
|
+
description 'The popover overlay/navigation primitive.'
|
|
23
|
+
property anchor element-ref
|
|
24
|
+
property label string
|
|
25
|
+
property placement string
|
|
26
|
+
property offset number
|
|
27
|
+
property open
|
|
28
|
+
enum true false
|
|
29
|
+
property on action multi
|
|
30
|
+
children any
|
|
31
|
+
|
|
32
|
+
tooltip: kind
|
|
33
|
+
description 'The tooltip overlay/navigation primitive.'
|
|
34
|
+
property anchor element-ref
|
|
35
|
+
property label string
|
|
36
|
+
property value string
|
|
37
|
+
property on action multi
|
|
38
|
+
children none
|
|
39
|
+
|
|
40
|
+
menu: kind
|
|
41
|
+
description 'The menu overlay/navigation primitive.'
|
|
42
|
+
property anchor element-ref
|
|
43
|
+
property label string
|
|
44
|
+
property placement string
|
|
45
|
+
property open
|
|
46
|
+
enum true false
|
|
47
|
+
property on action multi
|
|
48
|
+
children any
|
|
49
|
+
|
|
50
|
+
menu-item: kind
|
|
51
|
+
description 'The menu-item overlay/navigation primitive.'
|
|
52
|
+
positional label
|
|
53
|
+
property label string
|
|
54
|
+
property icon string
|
|
55
|
+
property disabled
|
|
56
|
+
enum true false
|
|
57
|
+
property on action multi
|
|
58
|
+
children any
|
|
59
|
+
|
|
60
|
+
menu-separator: kind
|
|
61
|
+
description 'The menu-separator overlay/navigation primitive.'
|
|
62
|
+
property on action multi
|
|
63
|
+
children none
|
|
64
|
+
|
|
65
|
+
context-menu: kind
|
|
66
|
+
description 'The context-menu overlay/navigation primitive.'
|
|
67
|
+
property anchor element-ref
|
|
68
|
+
property label string
|
|
69
|
+
property long-press number
|
|
70
|
+
property on action multi
|
|
71
|
+
children any
|
|
72
|
+
|
|
73
|
+
radial-menu: kind
|
|
74
|
+
description 'The radial-menu overlay/navigation primitive.'
|
|
75
|
+
property anchor element-ref
|
|
76
|
+
property label string
|
|
77
|
+
property radius number
|
|
78
|
+
property start-angle number
|
|
79
|
+
property presentation
|
|
80
|
+
enum radial linear
|
|
81
|
+
property item any multi
|
|
82
|
+
property on action multi
|
|
83
|
+
children any
|
|
84
|
+
|
|
85
|
+
tabs: kind
|
|
86
|
+
description 'The tabs overlay/navigation primitive.'
|
|
87
|
+
property label string
|
|
88
|
+
property activation
|
|
89
|
+
enum automatic manual
|
|
90
|
+
property active element-ref
|
|
91
|
+
property on action multi
|
|
92
|
+
children any
|
|
93
|
+
|
|
94
|
+
tab: kind
|
|
95
|
+
description 'The tab overlay/navigation primitive.'
|
|
96
|
+
positional label
|
|
97
|
+
property label string
|
|
98
|
+
property panel element-ref
|
|
99
|
+
property disabled
|
|
100
|
+
enum true false
|
|
101
|
+
property on action multi
|
|
102
|
+
children any
|
|
103
|
+
|
|
104
|
+
tab-panel: kind
|
|
105
|
+
description 'The tab-panel overlay/navigation primitive.'
|
|
106
|
+
property on action multi
|
|
107
|
+
children any
|
|
108
|
+
|
|
109
|
+
toast: kind
|
|
110
|
+
description 'The toast overlay/navigation primitive.'
|
|
111
|
+
positional label
|
|
112
|
+
property label string
|
|
113
|
+
property duration number
|
|
114
|
+
property politeness
|
|
115
|
+
enum polite assertive
|
|
116
|
+
property on action multi
|
|
117
|
+
children none
|
|
118
|
+
|
|
119
|
+
toaster: kind
|
|
120
|
+
description 'The toaster overlay/navigation primitive.'
|
|
121
|
+
property max number
|
|
122
|
+
property on action multi
|
|
123
|
+
children any
|
|
124
|
+
|
|
125
|
+
drawer: kind
|
|
126
|
+
description 'The drawer overlay/navigation primitive.'
|
|
127
|
+
property title string
|
|
128
|
+
property body any
|
|
129
|
+
property actions any
|
|
130
|
+
property open
|
|
131
|
+
enum true false
|
|
132
|
+
property modal
|
|
133
|
+
enum true false
|
|
134
|
+
property side
|
|
135
|
+
enum left right top bottom
|
|
136
|
+
property on action multi
|
|
137
|
+
children any
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** Position lists in the top layer, or a body portal on older browsers. */
|
|
2
|
+
import { positionFloating } from './position.js';
|
|
3
|
+
|
|
4
|
+
export function connectListPopover(control) {
|
|
5
|
+
const { input, listbox } = control.parts;
|
|
6
|
+
const doc = listbox.ownerDocument;
|
|
7
|
+
const native = typeof listbox.showPopover === 'function';
|
|
8
|
+
if (native) {
|
|
9
|
+
listbox.setAttribute('popover', 'auto');
|
|
10
|
+
}
|
|
11
|
+
const marker = doc.createComment('listbox');
|
|
12
|
+
listbox.before(marker);
|
|
13
|
+
let shell;
|
|
14
|
+
let cleanup;
|
|
15
|
+
const portal = () => {
|
|
16
|
+
if (shell) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
shell = doc.createElement(control.node.localName);
|
|
20
|
+
shell.setAttribute('data-list-portal', '');
|
|
21
|
+
// Preserve theme scoping and control selectors outside clipped labels/panels.
|
|
22
|
+
for (const name of ['class', 'style', 'data-theme']) {
|
|
23
|
+
const value = control.node.getAttribute(name);
|
|
24
|
+
if (value !== null) {
|
|
25
|
+
shell.setAttribute(name, value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const style = doc.defaultView.getComputedStyle(control.node);
|
|
29
|
+
for (const property of Array.from({ length: style.length }, (_, i) =>
|
|
30
|
+
style.item(i)
|
|
31
|
+
)) {
|
|
32
|
+
if (property.startsWith('--')) {
|
|
33
|
+
shell.style.setProperty(property, style.getPropertyValue(property));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const theme = control.node
|
|
37
|
+
.closest('[data-theme]')
|
|
38
|
+
?.getAttribute('data-theme');
|
|
39
|
+
if (theme !== undefined) {
|
|
40
|
+
shell.setAttribute('data-theme', theme);
|
|
41
|
+
}
|
|
42
|
+
doc.body.appendChild(shell);
|
|
43
|
+
shell.appendChild(listbox);
|
|
44
|
+
};
|
|
45
|
+
const restore = () => {
|
|
46
|
+
if (shell) {
|
|
47
|
+
marker.after(listbox);
|
|
48
|
+
shell.remove();
|
|
49
|
+
shell = undefined;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const sync = () => {
|
|
53
|
+
const external =
|
|
54
|
+
control.node.localName === 'ui-select' &&
|
|
55
|
+
input.getAttribute('aria-labelledby') !== control.parts.label.id;
|
|
56
|
+
if (external) {
|
|
57
|
+
portal();
|
|
58
|
+
}
|
|
59
|
+
if (control.service.state === 'open') {
|
|
60
|
+
if (!cleanup) {
|
|
61
|
+
if (!native && input.getClientRects().length) {
|
|
62
|
+
portal();
|
|
63
|
+
}
|
|
64
|
+
if (native) {
|
|
65
|
+
listbox.showPopover();
|
|
66
|
+
}
|
|
67
|
+
Object.assign(listbox.style, {
|
|
68
|
+
margin: '0',
|
|
69
|
+
inset: 'auto',
|
|
70
|
+
zIndex: '1000',
|
|
71
|
+
});
|
|
72
|
+
cleanup = input.getClientRects().length
|
|
73
|
+
? positionFloating(input, listbox, {
|
|
74
|
+
offset: 4,
|
|
75
|
+
size: () => {
|
|
76
|
+
const style = doc.defaultView.getComputedStyle(control.node);
|
|
77
|
+
const pixels = (name) => {
|
|
78
|
+
const value = Number.parseFloat(style.getPropertyValue(name));
|
|
79
|
+
return Number.isFinite(value) ? value : undefined;
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
minWidth: pixels('--menu-min-width'),
|
|
83
|
+
maxHeight: pixels('--menu-max-height') ?? 320,
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
: () => {};
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
cleanup?.();
|
|
91
|
+
cleanup = undefined;
|
|
92
|
+
if (native && listbox.matches(':popover-open')) {
|
|
93
|
+
listbox.hidePopover();
|
|
94
|
+
}
|
|
95
|
+
if (!external) {
|
|
96
|
+
restore();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const onToggle = (event) => {
|
|
101
|
+
if (event.newState === 'closed' && !listbox.matches(':popover-open')) {
|
|
102
|
+
control.service.send('close');
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const outside = (event) => {
|
|
106
|
+
if (
|
|
107
|
+
!control.node.contains(event.target) &&
|
|
108
|
+
!listbox.contains(event.target)
|
|
109
|
+
) {
|
|
110
|
+
control.service.send('close');
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
listbox.addEventListener('toggle', onToggle);
|
|
114
|
+
doc.addEventListener('pointerdown', outside);
|
|
115
|
+
control.syncListPopover = sync;
|
|
116
|
+
const unsubscribe = control.service.subscribe(sync);
|
|
117
|
+
return () => {
|
|
118
|
+
delete control.syncListPopover;
|
|
119
|
+
unsubscribe();
|
|
120
|
+
listbox.removeEventListener('toggle', onToggle);
|
|
121
|
+
doc.removeEventListener('pointerdown', outside);
|
|
122
|
+
cleanup?.();
|
|
123
|
+
if (native && listbox.matches(':popover-open')) {
|
|
124
|
+
listbox.hidePopover();
|
|
125
|
+
}
|
|
126
|
+
restore();
|
|
127
|
+
marker.remove();
|
|
128
|
+
};
|
|
129
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** LiNo is the source of overlay state, independent of a renderer. */
|
|
2
|
+
export const SURFACE_MACHINE = `surface: machine
|
|
3
|
+
initial closed
|
|
4
|
+
state closed
|
|
5
|
+
on open
|
|
6
|
+
target open
|
|
7
|
+
state open
|
|
8
|
+
on close
|
|
9
|
+
target closed
|
|
10
|
+
part content
|
|
11
|
+
attr data-state
|
|
12
|
+
state
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const TOOLTIP_MACHINE = `tooltip: machine
|
|
16
|
+
initial closed
|
|
17
|
+
state closed
|
|
18
|
+
on enter
|
|
19
|
+
target waiting
|
|
20
|
+
state waiting
|
|
21
|
+
after 500ms
|
|
22
|
+
target open
|
|
23
|
+
on leave
|
|
24
|
+
target closed
|
|
25
|
+
on close
|
|
26
|
+
target closed
|
|
27
|
+
state open
|
|
28
|
+
on enter
|
|
29
|
+
target open
|
|
30
|
+
on leave
|
|
31
|
+
target closing
|
|
32
|
+
on close
|
|
33
|
+
target closed
|
|
34
|
+
state closing
|
|
35
|
+
after 100ms
|
|
36
|
+
target closed
|
|
37
|
+
on enter
|
|
38
|
+
target open
|
|
39
|
+
on close
|
|
40
|
+
target closed
|
|
41
|
+
part content
|
|
42
|
+
attr data-state
|
|
43
|
+
state
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export const TABS_MACHINE = `tabs: machine
|
|
47
|
+
initial active
|
|
48
|
+
context
|
|
49
|
+
active ''
|
|
50
|
+
state active
|
|
51
|
+
on select
|
|
52
|
+
do select-tab
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
export const TOAST_MACHINE = `toast: machine
|
|
56
|
+
initial queued
|
|
57
|
+
state queued
|
|
58
|
+
on show
|
|
59
|
+
target visible
|
|
60
|
+
state visible
|
|
61
|
+
on pause
|
|
62
|
+
target paused
|
|
63
|
+
on close
|
|
64
|
+
target closed
|
|
65
|
+
state paused
|
|
66
|
+
on resume
|
|
67
|
+
target visible
|
|
68
|
+
on close
|
|
69
|
+
target closed
|
|
70
|
+
state closed
|
|
71
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
tooltip: machine
|
|
2
|
+
initial closed
|
|
3
|
+
state closed
|
|
4
|
+
on enter
|
|
5
|
+
target waiting
|
|
6
|
+
state waiting
|
|
7
|
+
after 500ms
|
|
8
|
+
target open
|
|
9
|
+
on leave
|
|
10
|
+
target closed
|
|
11
|
+
on close
|
|
12
|
+
target closed
|
|
13
|
+
state open
|
|
14
|
+
on enter
|
|
15
|
+
target open
|
|
16
|
+
on leave
|
|
17
|
+
target closing
|
|
18
|
+
on close
|
|
19
|
+
target closed
|
|
20
|
+
state closing
|
|
21
|
+
after 100ms
|
|
22
|
+
target closed
|
|
23
|
+
on enter
|
|
24
|
+
target open
|
|
25
|
+
on close
|
|
26
|
+
target closed
|
|
27
|
+
part content
|
|
28
|
+
attr data-state
|
|
29
|
+
state
|