moey-ui 0.1.0 → 0.3.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.
@@ -1,28 +1,69 @@
1
1
  /* ==========================================================================
2
- Gallery — masonry, filter & sort, infinite scroll and the lightbox (moey.js).
2
+ Gallery: griddy, filter & sort, infinite scroll and the lightbox (moey.js).
3
3
  ========================================================================== */
4
4
 
5
- /* Masonry: columns from the grid utilities (or automatic), heights packed by moey.js */
6
- .masonry {
7
- --mo-masonry-min: 14rem;
5
+ /* Griddy: a grid whose items of different heights pack into columns with no holes. Columns come
6
+ from the grid utilities (or automatic), moey.js places each item. The old names (.masonry,
7
+ .masonry-dense, --mo-masonry-min, data-moey-masonry) still work. */
8
+ :is(.griddy, .masonry) {
8
9
  display: grid;
9
- grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--mo-masonry-min)), 1fr));
10
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--mo-griddy-min, var(--mo-masonry-min, 14rem))), 1fr));
10
11
  gap: 1rem;
11
12
  align-items: start;
12
13
  }
13
14
  /* the grid-cols-* utilities set --mo-columns (phone first: grid-cols-2 md:grid-cols-4) */
14
- .masonry[class*="grid-cols-"] { grid-template-columns: repeat(var(--mo-columns, 3), minmax(0, 1fr)); }
15
- .masonry.is-ready { grid-auto-rows: 1px; row-gap: 0 !important; } /* (beats a gap-* utility: the gap is measured first and built into each span) */
16
- .masonry > * { min-width: 0; margin: 0; }
17
- .masonry > .span-2 { grid-column: span 2; }
18
- .masonry > .span-3 { grid-column: span 3; }
19
- .masonry-dense { grid-auto-flow: row dense; }
15
+ :is(.griddy, .masonry)[class*="grid-cols-"] { grid-template-columns: repeat(var(--mo-columns, 3), minmax(0, 1fr)); }
16
+ /* moey.js gives each item its exact place (is-ready): the grid only supplies the columns and gaps */
17
+ :is(.griddy, .masonry).is-ready { position: relative; }
18
+ :is(.griddy, .masonry).is-ready > * { position: absolute; box-sizing: border-box; }
19
+ :is(.griddy, .masonry) > * { min-width: 0; margin: 0; }
20
+ :is(.griddy, .masonry) > .span-2 { grid-column: span 2; }
21
+ :is(.griddy, .masonry) > .span-3 { grid-column: span 3; }
22
+ :is(.griddy-dense, .masonry-dense) { grid-auto-flow: row dense; }
20
23
  @supports (grid-template-rows: masonry) {
21
- .masonry { grid-template-rows: masonry; }
22
- .masonry.is-ready { grid-auto-rows: auto; row-gap: revert-layer; }
24
+ :is(.griddy, .masonry) { grid-template-rows: masonry; }
23
25
  }
26
+ /* Gliding: when the layout changes (a wider item, fewer columns, a new gap, the window), the items
27
+ already there slide to their new place. Not while one is being dragged (that has its own slide). */
28
+ @media (prefers-reduced-motion: no-preference) {
29
+ html:not(.mo-sorting) .griddy-glide.is-ready > * {
30
+ transition: left .4s var(--mo-ease), right .4s var(--mo-ease), top .4s var(--mo-ease), width .4s var(--mo-ease);
31
+ }
32
+ }
33
+
34
+ /* New items arrive: data-moey-enter on any list or grid (griddy, infinite scroll, a feed). Items
35
+ added later get .is-entering and --mo-enter-index (0, 1, 2… in each batch), one after another
36
+ (--mo-enter-stagger apart). The value picks the effect:
37
+ (empty) fade up · fade · rise · drop · zoom · pop · slide · flip · blur · none.
38
+ Your own: style [data-moey-enter] > .is-entering. */
39
+ @media (prefers-reduced-motion: no-preference) {
40
+ [data-moey-enter] > .is-entering {
41
+ animation: mo-enter-up .45s var(--mo-ease) both;
42
+ animation-delay: calc(min(var(--mo-enter-index, 0), 10) * var(--mo-enter-stagger, 60ms));
43
+ }
44
+ [data-moey-enter="fade"] > .is-entering { animation-name: mo-enter-fade; }
45
+ [data-moey-enter="zoom"] > .is-entering { animation-name: mo-enter-zoom; }
46
+ [data-moey-enter="rise"] > .is-entering { animation-name: mo-enter-rise; animation-duration: .5s; }
47
+ [data-moey-enter="drop"] > .is-entering { animation-name: mo-enter-drop; animation-duration: .5s; }
48
+ [data-moey-enter="pop"] > .is-entering { --mo-enter-stagger: 55ms; animation-name: mo-enter-pop; animation-duration: .45s; animation-delay: calc(min(var(--mo-enter-index, 0), 20) * var(--mo-enter-stagger)); }
49
+ [data-moey-enter="slide"] > .is-entering { animation-name: mo-enter-slide; animation-duration: .5s; }
50
+ [data-moey-enter="slide"]:dir(rtl) > .is-entering { animation-name: mo-enter-slide-rtl; }
51
+ [data-moey-enter="flip"] > .is-entering { animation-name: mo-enter-flip; animation-duration: .5s; transform-origin: 50% 0; }
52
+ [data-moey-enter="blur"] > .is-entering { animation-name: mo-enter-blur; animation-duration: .5s; }
53
+ [data-moey-enter="none"] > .is-entering { animation: none; }
54
+ }
55
+ @keyframes mo-enter-up { from { opacity: 0; translate: 0 1rem; } }
56
+ @keyframes mo-enter-fade { from { opacity: 0; } }
57
+ @keyframes mo-enter-zoom { from { opacity: 0; scale: .96; } }
58
+ @keyframes mo-enter-rise { from { opacity: 0; translate: 0 1.625rem; } }
59
+ @keyframes mo-enter-drop { from { opacity: 0; translate: 0 -1.625rem; } }
60
+ @keyframes mo-enter-pop { from { opacity: 0; scale: .001; } }
61
+ @keyframes mo-enter-slide { from { opacity: 0; translate: -1.625rem 0; } }
62
+ @keyframes mo-enter-slide-rtl { from { opacity: 0; translate: 1.625rem 0; } }
63
+ @keyframes mo-enter-flip { from { opacity: 0; transform: perspective(900px) rotateX(-28deg); } }
64
+ @keyframes mo-enter-blur { from { opacity: 0; filter: blur(14px); } }
24
65
  /* Picture tiles */
25
- .masonry img,
66
+ :is(.griddy, .masonry) img,
26
67
  .gallery-tile img { display: block; width: 100%; height: auto; border-radius: var(--mo-radius-card); }
27
68
  .gallery-tile { position: relative; display: block; overflow: hidden; color: inherit; text-decoration: none; border-radius: var(--mo-radius-card); }
28
69
  .gallery-tile:focus-visible { outline: var(--mo-focus-ring-width) solid var(--mo-theme-focus-ring); outline-offset: 2px; }
@@ -40,6 +81,7 @@
40
81
  .infinite-status { display: flex; gap: .625rem; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 0; font-size: .875rem; color: var(--mo-fg-3); }
41
82
  .infinite-status:has(.infinite-text:empty):has(.spinner[hidden]):has(.infinite-more[hidden]) { min-height: 0; padding: 0; }
42
83
  .infinite-sentinel { height: 1px; }
84
+ .infinite-more[aria-busy] { opacity: 1; cursor: progress; } /* loading in place: not faded like a disabled button */
43
85
 
44
86
  /* Lightbox — phone first: full bleed, controls float on soft gradients, one tap hides them */
45
87
  .lightbox {
@@ -117,4 +159,4 @@ video.lightbox-media { width: 100%; max-height: 100%; background: #000; }
117
159
  @media (prefers-reduced-motion: reduce) { .lightbox-top, .lightbox-bottom, .lightbox-prev, .lightbox-next { transition: none; } }
118
160
 
119
161
  /* Hidden items really go (tiles set their own display) */
120
- :where(.masonry, .filter-items) > [hidden] { display: none !important; }
162
+ :where(.griddy, .masonry, .filter-items) > [hidden] { display: none !important; }
@@ -36,6 +36,15 @@
36
36
  .hover-lift rises a little with a soft shadow .hover-grow grows a touch
37
37
  .hover-dim fades a little (image tiles)
38
38
  Only for a mouse (phones have no hover), and still for people who ask for less motion. */
39
+ /* Frosted glass: see-through with the page blurred behind it. Moey's floating bars are only slightly
40
+ see-through by default (cheaper to draw while scrolling); add .frosted to one of them (app header,
41
+ tab bar, sticky form buttons, chat day pill) or to anything with a background. */
42
+ .frosted {
43
+ --mo-glass: 78%;
44
+ -webkit-backdrop-filter: saturate(1.6) blur(14px);
45
+ backdrop-filter: saturate(1.6) blur(14px);
46
+ }
47
+
39
48
  @media (hover: hover) {
40
49
  .hover-lift:hover { translate: 0 -.1875rem; box-shadow: var(--mo-shadow-lg); }
41
50
  .hover-grow:hover { scale: 1.025; }
@@ -27,7 +27,8 @@ html.mo-keyboard .sheet-inset:modal { max-height: calc(var(--mo-vv-h) - var(--_t
27
27
  html.mo-keyboard .dialog:modal:not(.sheet) { max-height: calc(var(--mo-vv-h) - 1rem); }
28
28
  html.mo-keyboard .dialog-fullscreen:modal { height: var(--mo-vv-h); max-height: var(--mo-vv-h); padding-bottom: 0; }
29
29
  @media (width < 576px) {
30
- html.mo-keyboard .dialog:modal:not(.dialog-center, .dialog-fullscreen) { max-height: calc(var(--mo-vv-h) - 2.5rem); padding-bottom: 0; }
30
+ html.mo-keyboard .dialog-fullscreen-phone:modal { height: var(--mo-vv-h); max-height: var(--mo-vv-h); padding-bottom: 0; }
31
+ html.mo-keyboard .dialog:modal:not(.dialog-center, .dialog-fullscreen, .dialog-fullscreen-phone) { max-height: calc(var(--mo-vv-h) - 2.5rem); padding-bottom: 0; }
31
32
  }
32
33
 
33
34
  /* Drawers: as tall as what's visible */
@@ -91,7 +91,10 @@
91
91
  .card-body:not(.card-flush) > .list-group-flush:first-child { margin-top: calc(var(--mo-list-padding-y) * -1); }
92
92
  .card-body:not(.card-flush) > .list-group-flush:last-child { margin-bottom: calc(var(--mo-list-padding-y) * -1); }
93
93
  /* Edge-to-edge in a .card-flush body: rows get the card's side padding */
94
- .card-flush > .list-group-flush { --mo-list-padding-x: var(--mo-card-padding); }
94
+ .card-flush > .list-group-flush,
95
+ .card > .list-group-flush { --mo-list-padding-x: var(--mo-card-padding); }
96
+ /* Straight in a dialog, drawer or sheet (no .dialog-body around it): the same, with the dialog padding */
97
+ :is(.dialog, .drawer, .sheet) > .list-group-flush { --mo-list-padding-x: var(--mo-dialog-padding); }
95
98
  .dialog-flush > .list-group-flush { --mo-list-padding-x: var(--mo-dialog-padding); }
96
99
 
97
100
  .list-group-sm { --mo-list-padding-y: .5rem; }
@@ -37,13 +37,14 @@ html:has(.palette[open]:modal) { overflow: hidden; }
37
37
  border-radius: var(--mo-radius-dialog);
38
38
  box-shadow: var(--mo-shadow-overlay);
39
39
  }
40
- .palette[open] { display: flex; flex-direction: column; }
40
+ .palette { flex-direction: column; } /* also while closing: nothing reflows */
41
+ .palette[open] { display: flex; }
41
42
  .palette:focus-visible { outline: 0; }
42
43
  .palette::backdrop {
43
44
  inset-inline-end: auto;
44
45
  width: 100vw;
45
46
  background: oklch(14% .01 258 / .35);
46
- backdrop-filter: blur(2px);
47
+ /* (no backdrop blur: at 2px it was barely visible, but it stalled the first opening by ~0.1s and slowed every frame) */
47
48
  }
48
49
  @media (width < 576px) { .palette { margin-top: .5rem; } }
49
50
 
@@ -162,7 +163,7 @@ html:has(.palette[open]:modal) { overflow: hidden; }
162
163
  display var(--mo-dialog-duration) allow-discrete;
163
164
  }
164
165
  .palette:not([open]), .palette:not([open])::backdrop { opacity: 0; }
165
- .palette:not([open]) { scale: .98; }
166
+ /* (it opens with a small zoom and closes with a plain fade) */
166
167
  @starting-style {
167
168
  .palette[open], .palette[open]::backdrop { opacity: 0; }
168
169
  .palette[open] { scale: .98; }
@@ -90,11 +90,10 @@
90
90
  font-size: 1.75rem;
91
91
  color: #fff;
92
92
  cursor: pointer;
93
- background: rgb(0 0 0 / .55);
93
+ background: rgb(0 0 0 / .6);
94
94
  border: 0;
95
95
  border-radius: 999px;
96
- translate: -50% -50%;
97
- backdrop-filter: blur(6px);
96
+ translate: -50% -50%; /* (no blur: over a playing video it would be redrawn every frame) */
98
97
  }
99
98
  .player-big:hover { background: rgb(0 0 0 / .7); }
100
99
  .player-big:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@@ -16,9 +16,9 @@ html {
16
16
  /* Mobile first: nothing may push the page wider than the screen */
17
17
  body { overflow-wrap: break-word; }
18
18
  img, svg, video, canvas, iframe { max-width: 100%; }
19
- @media (prefers-reduced-motion: no-preference) {
20
- html { scroll-behavior: smooth; }
21
- }
19
+ /* Smooth scrolling only for in-page links (moey.js turns it on for that one jump), so scripts that
20
+ move the page (scrollTo, scrollIntoView, "jump to post") land at once, exactly where they aimed */
21
+ html.mo-smooth-scroll { scroll-behavior: smooth; }
22
22
 
23
23
  body {
24
24
  margin: 0;
@@ -1,7 +1,8 @@
1
1
  /* Stretched link, part 2 — other links and buttons in the same card stay clickable above the
2
2
  stretched link's cover. This sits in an early layer on purpose: components that position their
3
- own buttons (a close button pinned to a corner) keep their placement. */
4
- :has(> .stretched-link, > * .stretched-link, > * > * .stretched-link) :is(a, button, input, select, textarea, summary, label, .btn, [tabindex]):not(.stretched-link) {
3
+ own buttons (a close button pinned to a corner) keep their placement. Dialogs and popovers are left
4
+ out: an open dialog gets tabindex="-1", and position: relative would pin it to the page top. */
5
+ :has(> .stretched-link, > * .stretched-link, > * > * .stretched-link) :is(a, button, input, select, textarea, summary, label, .btn, [tabindex]):not(.stretched-link, dialog, [popover]) {
5
6
  position: relative;
6
7
  z-index: 2;
7
8
  }
@@ -22,9 +22,7 @@
22
22
  display: flex;
23
23
  align-items: stretch;
24
24
  padding-bottom: env(safe-area-inset-bottom);
25
- background: color-mix(in oklab, var(--mo-bg-surface) 88%, transparent);
26
- backdrop-filter: saturate(1.6) blur(14px);
27
- -webkit-backdrop-filter: saturate(1.6) blur(14px);
25
+ background: color-mix(in oklab, var(--mo-bg-surface) var(--mo-glass), transparent); /* .frosted: frosted glass */
28
26
  box-shadow: 0 -1px 0 var(--mo-border-color);
29
27
  transition: translate .25s var(--mo-ease);
30
28
  }
@@ -88,6 +86,10 @@
88
86
  background: var(--mo-default-base);
89
87
  border-radius: 999px;
90
88
  }
89
+ /* Moey Icons is unlayered, so its `.mi { display: inline-block; line-height: 1 }` beats the grid above.
90
+ Center the glyph on ::before instead (the icon CSS leaves its display and line-height alone). */
91
+ .tabbar-action > .mi { text-align: center; }
92
+ .tabbar-action > .mi::before { display: block; line-height: 2.75rem; }
91
93
  .tabbar-action > span:not(.tabbar-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
92
94
  /* A floating pill instead of a full-width bar */
93
95
  .tabbar-floating {
package/src/css/table.css CHANGED
@@ -95,6 +95,7 @@
95
95
  .table-sort {
96
96
  display: inline-flex;
97
97
  align-items: center;
98
+ vertical-align: top; /* lines up by its box, not by the arrow (which comes first in right-aligned columns) */
98
99
  gap: .25rem;
99
100
  padding: 0;
100
101
  margin: 0;
@@ -38,6 +38,9 @@
38
38
  --mo-paper: light-dark(oklch(95.6% .006 258), oklch(13.5% .007 258));
39
39
  --mo-ink: light-dark(oklch(22% .015 258), oklch(94% .005 258));
40
40
  --mo-bg-body: var(--mo-paper);
41
+ /* Bars that float over the page (app header, tab bar, sticky form buttons): slightly see-through,
42
+ no blur, so scrolling stays light. .frosted (helpers) turns on the frosted-glass look. */
43
+ --mo-glass: 97%;
41
44
  --mo-bg-surface: light-dark(var(--mo-white), oklch(19.5% .009 258));
42
45
  --mo-bg-raised: light-dark(var(--mo-white), oklch(25.5% .01 258)); /* overlays: lighter than cards in dark mode */
43
46
  /* Neutral fills, meant for use ON a surface (hover, headers, wells) */