@threadlabs/looma 0.10.9 → 0.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/components/ui-dialog/ui-dialog.html +17 -0
  2. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +17 -0
  3. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +17 -0
  4. package/components/ui-editor-toolbar/ui-editor-toolbar.html +24 -43
  5. package/components/ui-reel/ui-reel.html +24 -0
  6. package/components/ui-scroll-area/ui-scroll-area.html +56 -0
  7. package/components/ui-search-shell/ui-search-shell.html +17 -0
  8. package/components/ui-sidebar/ui-sidebar.html +18 -0
  9. package/dist/index.js +19 -20
  10. package/package.json +1 -1
  11. package/styles/ui-dialog.css +17 -0
  12. package/styles/ui-editor-mention-menu.css +17 -0
  13. package/styles/ui-editor-slash-menu.css +17 -0
  14. package/styles/ui-editor-toolbar.css +25 -42
  15. package/styles/ui-reel.css +27 -1
  16. package/styles/ui-scroll-area.css +57 -0
  17. package/styles/ui-search-shell.css +17 -0
  18. package/styles/ui-sidebar.css +22 -1
  19. package/tokens.css +44 -0
  20. package/vanilla/UiEditorToolbar.js +1 -3
  21. package/vanilla/UiScrollArea.d.ts +14 -0
  22. package/vanilla/UiScrollArea.js +28 -0
  23. package/vanilla/index.js +1 -0
  24. package/vue/UiDialog.vue +21 -0
  25. package/vue/UiEditorMentionMenu.vue +21 -0
  26. package/vue/UiEditorSlashMenu.vue +21 -0
  27. package/vue/UiEditorToolbar.vue +26 -57
  28. package/vue/UiReel.vue +28 -0
  29. package/vue/UiScrollArea.d.ts +18 -0
  30. package/vue/UiScrollArea.js +2 -0
  31. package/vue/UiScrollArea.vue +85 -0
  32. package/vue/UiSearchShell.vue +21 -0
  33. package/vue/UiSidebar.vue +22 -0
  34. package/vue/chunks/UiDialog.js +1 -1
  35. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  36. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  37. package/vue/chunks/UiEditorToolbar.js +5 -29
  38. package/vue/chunks/UiReel.js +1 -1
  39. package/vue/chunks/UiScrollArea.js +21 -0
  40. package/vue/chunks/UiSearchShell.js +1 -1
  41. package/vue/chunks/UiSidebar.js +1 -1
  42. package/vue/components.css +335 -161
  43. package/vue/index.d.ts +1 -0
  44. package/vue/index.js +2 -1
  45. package/components/ui-editor-toolbar/ui-editor-toolbar.js +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.10.9",
3
+ "version": "0.10.10",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -135,6 +135,23 @@
135
135
  overflow: auto;
136
136
  overscroll-behavior: contain;
137
137
  padding: var(--ui-space-5);
138
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
139
+ --_ui-scroll-fade-direction: to bottom;
140
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
141
+ mask-image: linear-gradient(
142
+ var(--_ui-scroll-fade-direction),
143
+ transparent,
144
+ #000 var(--_ui-scroll-fade-start),
145
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
146
+ transparent
147
+ );
148
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
149
+ animation-timeline: scroll(self block);
150
+ animation-range:
151
+ 0 var(--_ui-scroll-fade-size),
152
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
153
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
154
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
138
155
  }
139
156
 
140
157
  footer {
@@ -41,6 +41,23 @@
41
41
  overflow-y: auto;
42
42
  overscroll-behavior: contain;
43
43
  list-style: none;
44
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
45
+ --_ui-scroll-fade-direction: to bottom;
46
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
47
+ mask-image: linear-gradient(
48
+ var(--_ui-scroll-fade-direction),
49
+ transparent,
50
+ #000 var(--_ui-scroll-fade-start),
51
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
52
+ transparent
53
+ );
54
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
55
+ animation-timeline: scroll(self block);
56
+ animation-range:
57
+ 0 var(--_ui-scroll-fade-size),
58
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
59
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
60
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
44
61
  }
45
62
 
46
63
  .item {
@@ -58,6 +58,23 @@
58
58
  overflow-y: auto;
59
59
  max-height: 280px;
60
60
  overscroll-behavior: contain;
61
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
62
+ --_ui-scroll-fade-direction: to bottom;
63
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
64
+ mask-image: linear-gradient(
65
+ var(--_ui-scroll-fade-direction),
66
+ transparent,
67
+ #000 var(--_ui-scroll-fade-start),
68
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
69
+ transparent
70
+ );
71
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
72
+ animation-timeline: scroll(self block);
73
+ animation-range:
74
+ 0 var(--_ui-scroll-fade-size),
75
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
76
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
77
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
61
78
  }
62
79
 
63
80
  @media (max-width: 767px) {
@@ -1,9 +1,6 @@
1
1
  /* Generated by HTML Next 1.0.0-alpha.5. Do not edit. */
2
2
  @scope ([data-component~="ui-editor-toolbar"]) to ([data-component], [data-slotted]) {
3
3
  :scope {
4
- /* The colour the edge fades blend into: whatever the toolbar is painted with. */
5
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
6
-
7
4
  position: sticky;
8
5
  top: 0;
9
6
  z-index: var(--ui-editor-toolbar-z-index, 10);
@@ -34,41 +31,29 @@
34
31
  display: none;
35
32
  }
36
33
 
37
- /* The fades are mattes laid over the strip in the toolbar's own colour, not a mask, so a floating
38
- toolbar's border and shadow stay whole. Each appears only while that edge hides controls. */
39
- :scope::before,
40
- :scope::after {
41
- position: absolute;
42
- z-index: 1;
43
- inset-block: 0;
44
- inline-size: var(--ui-editor-toolbar-fade-size, 32px);
45
- content: "";
46
- opacity: 0;
47
- pointer-events: none;
48
- transition: opacity var(--ui-motion-fast, 120ms) var(--ui-motion-ease, ease);
49
- }
50
-
51
- :scope::before {
52
- inset-inline-start: 0;
53
- background: linear-gradient(to right, var(--_matte), transparent);
54
- }
55
-
56
- :scope::after {
57
- inset-inline-end: 0;
58
- background: linear-gradient(to left, var(--_matte), transparent);
59
- }
60
-
61
- :scope:dir(rtl)::before {
62
- background: linear-gradient(to left, var(--_matte), transparent);
63
- }
64
-
65
- :scope:dir(rtl)::after {
66
- background: linear-gradient(to right, var(--_matte), transparent);
67
- }
68
-
69
- :scope[data-ui-editor-toolbar-state~="overflowStart"]::before,
70
- :scope[data-ui-editor-toolbar-state~="overflowEnd"]::after {
71
- opacity: 1;
34
+ /* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
35
+ strip, so a floating toolbar's border and shadow stay whole. */
36
+ .strip {
37
+ --_ui-scroll-fade-direction: to right;
38
+ --_ui-scroll-fade-size: var(--ui-editor-toolbar-fade-size, var(--ui-scroll-fade-size, 24px));
39
+ mask-image: linear-gradient(
40
+ var(--_ui-scroll-fade-direction),
41
+ transparent,
42
+ #000 var(--_ui-scroll-fade-start),
43
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
44
+ transparent
45
+ );
46
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
47
+ animation-timeline: scroll(self inline);
48
+ animation-range:
49
+ 0 var(--_ui-scroll-fade-size),
50
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
51
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
52
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
53
+ }
54
+
55
+ :scope:dir(rtl) .strip {
56
+ --_ui-scroll-fade-direction: to left;
72
57
  }
73
58
 
74
59
  :scope[data-ui-editor-toolbar-state~="floating"] {
@@ -110,8 +95,6 @@
110
95
 
111
96
  /* Inside LoomaEditor's sticky shell, the shell is the sticky surface. */
112
97
  .looma-editor__sticky-toolbar-shell :scope {
113
- --_matte: var(--ui-editor-toolbar-surface, var(--ui-surface));
114
-
115
98
  position: relative;
116
99
  min-height: var(--ui-editor-toolbar-min-height, 48px);
117
100
  background: transparent;
@@ -149,8 +132,8 @@
149
132
  flex: 0 0 auto;
150
133
  }
151
134
 
152
- /* The fades are mattes laid over the strip in the toolbar's own colour, not a mask, so a floating
153
- toolbar's border and shadow stay whole. Each appears only while that edge hides controls. */
135
+ /* The edge fades are the scroll fade every Looma scroller uses (see ui-scroll-area), a mask on the
136
+ strip, so a floating toolbar's border and shadow stay whole. */
154
137
 
155
138
  :where([data-slotted], [data-slotted] *):is(.divider) {
156
139
  width: 1px;
@@ -14,6 +14,30 @@
14
14
  overscroll-behavior-inline: contain;
15
15
  }
16
16
 
17
+ /* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
18
+ :scope {
19
+ --_ui-scroll-fade-direction: to right;
20
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
21
+ mask-image: linear-gradient(
22
+ var(--_ui-scroll-fade-direction),
23
+ transparent,
24
+ #000 var(--_ui-scroll-fade-start),
25
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
26
+ transparent
27
+ );
28
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
29
+ animation-timeline: scroll(self inline);
30
+ animation-range:
31
+ 0 var(--_ui-scroll-fade-size),
32
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
33
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
34
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
35
+ }
36
+
37
+ :scope:dir(rtl) {
38
+ --_ui-scroll-fade-direction: to left;
39
+ }
40
+
17
41
  :scope[data-ui-reel-state~="gap=xs"] {
18
42
  --_reel-gap: var(--ui-space-2);
19
43
  }
@@ -48,7 +72,9 @@
48
72
  }
49
73
  }
50
74
  @scope ([data-component~="ui-reel"]) to ([data-component]) {
51
- :scope > :where([data-slotted], [data-slotted] *):is(*) {
75
+ /* Each end that hides items fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
76
+
77
+ :scope > :where([data-slotted], [data-slotted] *):is(*) {
52
78
  min-inline-size: 0;
53
79
  flex: 0 0 var(--ui-reel-item-width, var(--_reel-item-width));
54
80
  }
@@ -0,0 +1,57 @@
1
+ /* Generated by HTML Next 1.0.0-alpha.5. Do not edit. */
2
+ @scope ([data-component~="ui-scroll-area"]) to ([data-component], [data-slotted]) {
3
+ /* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
4
+ in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
5
+ is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
6
+ fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
7
+ :scope {
8
+ display: block;
9
+ box-sizing: border-box;
10
+ min-block-size: 0;
11
+ min-inline-size: 0;
12
+ overflow-x: hidden;
13
+ overflow-y: auto;
14
+ overscroll-behavior: contain;
15
+ --_ui-scroll-fade-direction: to bottom;
16
+ --_ui-scroll-fade-inline: to right;
17
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
18
+ mask-image: linear-gradient(
19
+ var(--_ui-scroll-fade-direction),
20
+ transparent,
21
+ #000 var(--_ui-scroll-fade-start),
22
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
23
+ transparent
24
+ );
25
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
26
+ animation-timeline: scroll(self block);
27
+ animation-range:
28
+ 0 var(--_ui-scroll-fade-size),
29
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
30
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
31
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
32
+ }
33
+
34
+ :scope[data-ui-scroll-area-state~="orientation=horizontal"] {
35
+ overflow-x: auto;
36
+ overflow-y: hidden;
37
+ --_ui-scroll-fade-direction: var(--_ui-scroll-fade-inline);
38
+ animation-timeline: scroll(self inline);
39
+ }
40
+
41
+ :scope:dir(rtl) {
42
+ --_ui-scroll-fade-inline: to left;
43
+ }
44
+
45
+ /* A component that sets its display still honours the hidden attribute on its root. */
46
+ :scope[hidden] {
47
+ display: none;
48
+ }
49
+ }
50
+ @scope ([data-component~="ui-scroll-area"]) to ([data-component]) {
51
+ /* A region that scrolls when its content outgrows it. Each edge that hides content fades, growing
52
+ in as the content leaves that edge (the scroll fade in tokens.css), so the reader can tell there
53
+ is more; an edge with nothing past it stays crisp, and content that fits shows no fade. The
54
+ fade is a mask, so it blends into whatever is behind the area without knowing its colour. */
55
+
56
+ /* A component that sets its display still honours the hidden attribute on its root. */
57
+ }
@@ -85,6 +85,23 @@
85
85
  min-block-size: 0;
86
86
  overflow: auto;
87
87
  padding: var(--ui-space-2);
88
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
89
+ --_ui-scroll-fade-direction: to bottom;
90
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
91
+ mask-image: linear-gradient(
92
+ var(--_ui-scroll-fade-direction),
93
+ transparent,
94
+ #000 var(--_ui-scroll-fade-start),
95
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
96
+ transparent
97
+ );
98
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
99
+ animation-timeline: scroll(self block);
100
+ animation-range:
101
+ 0 var(--_ui-scroll-fade-size),
102
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
103
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
104
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
88
105
  }
89
106
 
90
107
  @media (max-width: 47.9375rem) {
@@ -18,10 +18,28 @@
18
18
  border-inline-start: 1px solid var(--ui-sidebar-border, var(--ui-border-default));
19
19
  }
20
20
 
21
+ /* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
22
+ Looma scroller uses (see ui-scroll-area). */
21
23
  .content {
22
24
  flex: 1;
23
25
  min-block-size: 0;
24
26
  overflow: auto;
27
+ --_ui-scroll-fade-direction: to bottom;
28
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
29
+ mask-image: linear-gradient(
30
+ var(--_ui-scroll-fade-direction),
31
+ transparent,
32
+ #000 var(--_ui-scroll-fade-start),
33
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
34
+ transparent
35
+ );
36
+ animation: ui-scroll-fade-start linear, ui-scroll-fade-start-hold linear, ui-scroll-fade-end-hold linear, ui-scroll-fade-end linear;
37
+ animation-timeline: scroll(self block);
38
+ animation-range:
39
+ 0 var(--_ui-scroll-fade-size),
40
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
41
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
42
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
25
43
  }
26
44
 
27
45
  /* Collapsed while docked. */
@@ -150,7 +168,10 @@
150
168
  }
151
169
  }
152
170
  @scope ([data-component~="ui-sidebar"]) to ([data-component]) {
153
- /* Collapsed while docked. */
171
+ /* The panel's content scrolls, and each edge that hides content fades: the scroll fade every
172
+ Looma scroller uses (see ui-scroll-area). */
173
+
174
+ /* Collapsed while docked. */
154
175
 
155
176
  /* Drawer: a popover in the top layer, sliding in from its edge. Closed popovers are hidden by the UA. */
156
177
 
package/tokens.css CHANGED
@@ -61,6 +61,9 @@
61
61
  --ui-motion-fast: 120ms;
62
62
  --ui-motion-ease: cubic-bezier(0.2, 0, 0.2, 1);
63
63
 
64
+ /* Scrolling: how far the fade reaches at each edge of a scroller that hides content. */
65
+ --ui-scroll-fade-size: 24px;
66
+
64
67
  /* Controls: the contract every button and field shares. */
65
68
  --ui-control-size: 2.5rem;
66
69
  --ui-control-size-sm: 2rem;
@@ -219,3 +222,44 @@
219
222
  }
220
223
  }
221
224
  }
225
+
226
+ /* The scroll fade every Looma scroller uses (see ui-scroll-area). Scroll-driven animations grow each
227
+ edge's fade in as content leaves that edge, up to the scroller's --_ui-scroll-fade-size, and take it
228
+ away as the last content arrives. A scroller whose content fits has no active scroll timeline, so it
229
+ shows no fade; a browser without scroll-driven animations shows none either.
230
+
231
+ Each edge is a ramp and a hold, neither with a fill, whose ranges never end inside the scroll range
232
+ with a value left over: an animation that finishes holding a value keeps it (in Chromium) after its
233
+ scroller stops overflowing, which would leave a fade over content that fits.
234
+
235
+ Registered here, at the top level, because a component's scoped styles cannot register properties
236
+ or declare keyframes. */
237
+ @property --_ui-scroll-fade-start {
238
+ syntax: "<length>";
239
+ inherits: false;
240
+ initial-value: 0px;
241
+ }
242
+
243
+ @property --_ui-scroll-fade-end {
244
+ syntax: "<length>";
245
+ inherits: false;
246
+ initial-value: 0px;
247
+ }
248
+
249
+ @keyframes ui-scroll-fade-start {
250
+ from { --_ui-scroll-fade-start: 0px; }
251
+ to { --_ui-scroll-fade-start: var(--_ui-scroll-fade-size, 24px); }
252
+ }
253
+
254
+ @keyframes ui-scroll-fade-start-hold {
255
+ from, to { --_ui-scroll-fade-start: var(--_ui-scroll-fade-size, 24px); }
256
+ }
257
+
258
+ @keyframes ui-scroll-fade-end-hold {
259
+ from, to { --_ui-scroll-fade-end: var(--_ui-scroll-fade-size, 24px); }
260
+ }
261
+
262
+ @keyframes ui-scroll-fade-end {
263
+ from { --_ui-scroll-fade-end: var(--_ui-scroll-fade-size, 24px); }
264
+ to { --_ui-scroll-fade-end: 0px; }
265
+ }
@@ -1,9 +1,8 @@
1
1
  // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
- import * as controller from "../components/ui-editor-toolbar/ui-editor-toolbar.js";
4
3
  import "../styles/ui-editor-toolbar.css";
5
4
 
6
- const definition = {...{"contract":{"tag":"ui-editor-toolbar","props":{"floating":{"type":"boolean","required":false,"target":{"attribute":"floating"},"default":false}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"toolbar"},{"kind":"literal","name":"aria-label","value":"Editor toolbar"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"strip"}],"children":[{"kind":"slot"}],"ref":"strip"}]},"declarations":[{"kind":"state","name":"overflowStart","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"overflowEnd","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
5
+ const definition = {...{"contract":{"tag":"ui-editor-toolbar","props":{"floating":{"type":"boolean","required":false,"target":{"attribute":"floating"},"default":false}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"toolbar"},{"kind":"literal","name":"aria-label","value":"Editor toolbar"}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"strip"}],"children":[{"kind":"slot"}],"ref":"strip"}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
7
6
 
8
7
  export function createUiEditorToolbar(options = {}) {
9
8
  const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
@@ -28,7 +27,6 @@ export function createUiEditorToolbar(options = {}) {
28
27
  }
29
28
  element.append(element0);
30
29
  manageComponentLifecycle(element, definition, { props: componentProps, projected,
31
- controller,
32
30
  });
33
31
  return element;
34
32
  }
@@ -0,0 +1,14 @@
1
+ // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
2
+ export interface UiScrollAreaEventMap {
3
+ }
4
+ export interface UiScrollAreaElement extends HTMLDivElement {
5
+ addEventListener<K extends keyof UiScrollAreaEventMap>(type: K, listener: (this: UiScrollAreaElement, event: UiScrollAreaEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
6
+ removeEventListener<K extends keyof UiScrollAreaEventMap>(type: K, listener: (this: UiScrollAreaElement, event: UiScrollAreaEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
7
+ }
8
+ export interface UiScrollAreaProps {
9
+ orientation?: "vertical" | "horizontal" | null;
10
+ attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
11
+ children?: readonly (string | Node)[];
12
+ slots?: Readonly<Record<string, readonly (string | Node)[]>>;
13
+ }
14
+ export declare function createUiScrollArea(props?: UiScrollAreaProps): UiScrollAreaElement;
@@ -0,0 +1,28 @@
1
+ // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
2
+ import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
3
+ import "../styles/ui-scroll-area.css";
4
+
5
+ export function createUiScrollArea(options = {}) {
6
+ const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
7
+ const projected = [];
8
+ const prop0 = componentProps["orientation"] === undefined ? "vertical" : componentProps["orientation"];
9
+ const element = document.createElement("div");
10
+ for (const [name, value] of Object.entries(attributes)) {
11
+ if (value === null || value === undefined || value === false) continue;
12
+ element.setAttribute(name, value === true ? "" : String(value));
13
+ }
14
+ element.setAttribute("data-component", "ui-scroll-area");
15
+ if (children.length > 0) {
16
+ for (const child of children) {
17
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
18
+ projected.push([node, ""]);
19
+ element.append(node);
20
+ }
21
+ } else {
22
+ }
23
+ manageGeneratedProps(element, [
24
+ { name: "orientation", attribute: "data-orientation", value: componentProps["orientation"], default: "vertical", type: ["vertical","horizontal"], required: false },
25
+ ]);
26
+ return element;
27
+ }
28
+
package/vanilla/index.js CHANGED
@@ -31,6 +31,7 @@ export * from "./UiPopover.js";
31
31
  export * from "./UiRadio.js";
32
32
  export * from "./UiRadioGroup.js";
33
33
  export * from "./UiReel.js";
34
+ export * from "./UiScrollArea.js";
34
35
  export * from "./UiSearchResultRow.js";
35
36
  export * from "./UiSearchShell.js";
36
37
  export * from "./UiSelect.js";
package/vue/UiDialog.vue CHANGED
@@ -202,6 +202,27 @@ html[data-ui-input-modality="touch"] [data-component~="ui-dialog"] .close {
202
202
  overflow: auto;
203
203
  overscroll-behavior: contain;
204
204
  padding: var(--ui-space-5);
205
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
206
+ --_ui-scroll-fade-direction: to bottom;
207
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
208
+ mask-image: linear-gradient(
209
+ var(--_ui-scroll-fade-direction),
210
+ transparent,
211
+ #000 var(--_ui-scroll-fade-start),
212
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
213
+ transparent
214
+ );
215
+ animation:
216
+ ui-scroll-fade-start linear,
217
+ ui-scroll-fade-start-hold linear,
218
+ ui-scroll-fade-end-hold linear,
219
+ ui-scroll-fade-end linear;
220
+ animation-timeline: scroll(self block);
221
+ animation-range:
222
+ 0 var(--_ui-scroll-fade-size),
223
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
224
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
225
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
205
226
  }
206
227
 
207
228
  footer {
@@ -144,6 +144,27 @@ useComponentHost(controllerModule.default, {
144
144
  overflow-y: auto;
145
145
  overscroll-behavior: contain;
146
146
  list-style: none;
147
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
148
+ --_ui-scroll-fade-direction: to bottom;
149
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
150
+ mask-image: linear-gradient(
151
+ var(--_ui-scroll-fade-direction),
152
+ transparent,
153
+ #000 var(--_ui-scroll-fade-start),
154
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
155
+ transparent
156
+ );
157
+ animation:
158
+ ui-scroll-fade-start linear,
159
+ ui-scroll-fade-start-hold linear,
160
+ ui-scroll-fade-end-hold linear,
161
+ ui-scroll-fade-end linear;
162
+ animation-timeline: scroll(self block);
163
+ animation-range:
164
+ 0 var(--_ui-scroll-fade-size),
165
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
166
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
167
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
147
168
  }
148
169
 
149
170
  .item {
@@ -152,6 +152,27 @@ useComponentHost(controllerModule.default, {
152
152
  overflow-y: auto;
153
153
  max-height: 280px;
154
154
  overscroll-behavior: contain;
155
+ /* Each edge that hides content fades: the scroll fade every Looma scroller uses (see ui-scroll-area). */
156
+ --_ui-scroll-fade-direction: to bottom;
157
+ --_ui-scroll-fade-size: var(--ui-scroll-fade-size, 24px);
158
+ mask-image: linear-gradient(
159
+ var(--_ui-scroll-fade-direction),
160
+ transparent,
161
+ #000 var(--_ui-scroll-fade-start),
162
+ #000 calc(100% - var(--_ui-scroll-fade-end)),
163
+ transparent
164
+ );
165
+ animation:
166
+ ui-scroll-fade-start linear,
167
+ ui-scroll-fade-start-hold linear,
168
+ ui-scroll-fade-end-hold linear,
169
+ ui-scroll-fade-end linear;
170
+ animation-timeline: scroll(self block);
171
+ animation-range:
172
+ 0 var(--_ui-scroll-fade-size),
173
+ var(--_ui-scroll-fade-size) calc(100% + 1px),
174
+ -1px calc(100% - var(--_ui-scroll-fade-size)),
175
+ calc(100% - var(--_ui-scroll-fade-size)) 100%;
155
176
  }
156
177
 
157
178
  @media (max-width: 767px) {