moey-ui 0.0.0-stage → 0.2.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.
Files changed (157) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -2
  4. package/brand/moey-icon.svg +1 -0
  5. package/dist/ai-rules.md +243 -0
  6. package/dist/fonts/Inter-OFL.txt +93 -0
  7. package/dist/fonts/JetBrainsMono-OFL.txt +93 -0
  8. package/dist/fonts/inter-cyrillic-ext-opsz-italic.woff2 +0 -0
  9. package/dist/fonts/inter-cyrillic-ext-opsz-normal.woff2 +0 -0
  10. package/dist/fonts/inter-cyrillic-opsz-italic.woff2 +0 -0
  11. package/dist/fonts/inter-cyrillic-opsz-normal.woff2 +0 -0
  12. package/dist/fonts/inter-greek-ext-opsz-italic.woff2 +0 -0
  13. package/dist/fonts/inter-greek-ext-opsz-normal.woff2 +0 -0
  14. package/dist/fonts/inter-greek-opsz-italic.woff2 +0 -0
  15. package/dist/fonts/inter-greek-opsz-normal.woff2 +0 -0
  16. package/dist/fonts/inter-latin-ext-opsz-italic.woff2 +0 -0
  17. package/dist/fonts/inter-latin-ext-opsz-normal.woff2 +0 -0
  18. package/dist/fonts/inter-latin-opsz-italic.woff2 +0 -0
  19. package/dist/fonts/inter-latin-opsz-normal.woff2 +0 -0
  20. package/dist/fonts/inter-vietnamese-opsz-italic.woff2 +0 -0
  21. package/dist/fonts/inter-vietnamese-opsz-normal.woff2 +0 -0
  22. package/dist/fonts/jetbrains-mono-cyrillic-ext-wght-italic.woff2 +0 -0
  23. package/dist/fonts/jetbrains-mono-cyrillic-ext-wght-normal.woff2 +0 -0
  24. package/dist/fonts/jetbrains-mono-cyrillic-wght-italic.woff2 +0 -0
  25. package/dist/fonts/jetbrains-mono-cyrillic-wght-normal.woff2 +0 -0
  26. package/dist/fonts/jetbrains-mono-greek-wght-italic.woff2 +0 -0
  27. package/dist/fonts/jetbrains-mono-greek-wght-normal.woff2 +0 -0
  28. package/dist/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
  29. package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  30. package/dist/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  31. package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  32. package/dist/fonts/jetbrains-mono-vietnamese-wght-italic.woff2 +0 -0
  33. package/dist/fonts/jetbrains-mono-vietnamese-wght-normal.woff2 +0 -0
  34. package/dist/llms-full.txt +13088 -0
  35. package/dist/moey.css +20861 -0
  36. package/dist/moey.js +9762 -0
  37. package/dist/moey.min.css +1 -0
  38. package/dist/moey.min.js +8614 -0
  39. package/package.json +53 -4
  40. package/src/css/accordion.css +94 -0
  41. package/src/css/adapt.css +81 -0
  42. package/src/css/alert.css +171 -0
  43. package/src/css/animate.css +71 -0
  44. package/src/css/app.css +332 -0
  45. package/src/css/avatar.css +106 -0
  46. package/src/css/badge.css +129 -0
  47. package/src/css/breadcrumb.css +78 -0
  48. package/src/css/button-group.css +116 -0
  49. package/src/css/button.css +191 -0
  50. package/src/css/calendar.css +214 -0
  51. package/src/css/card.css +210 -0
  52. package/src/css/carousel.css +137 -0
  53. package/src/css/chart.css +204 -0
  54. package/src/css/chat.css +342 -0
  55. package/src/css/chip.css +145 -0
  56. package/src/css/close-button.css +52 -0
  57. package/src/css/code-copy.css +45 -0
  58. package/src/css/collapse.css +24 -0
  59. package/src/css/color.css +180 -0
  60. package/src/css/combobox.css +48 -0
  61. package/src/css/datatable.css +233 -0
  62. package/src/css/datepicker.css +251 -0
  63. package/src/css/description-list.css +55 -0
  64. package/src/css/dialog.css +312 -0
  65. package/src/css/divider.css +58 -0
  66. package/src/css/dropzone.css +146 -0
  67. package/src/css/empty.css +44 -0
  68. package/src/css/floating-labels.css +128 -0
  69. package/src/css/form-adorn.css +35 -0
  70. package/src/css/form-layout.css +92 -0
  71. package/src/css/forms.css +455 -0
  72. package/src/css/gallery.css +133 -0
  73. package/src/css/helpers.css +71 -0
  74. package/src/css/images.css +21 -0
  75. package/src/css/input-group.css +165 -0
  76. package/src/css/kanban.css +156 -0
  77. package/src/css/kbd.css +38 -0
  78. package/src/css/keyboard.css +59 -0
  79. package/src/css/layout.css +80 -0
  80. package/src/css/list-group.css +97 -0
  81. package/src/css/marquee.css +80 -0
  82. package/src/css/media.css +74 -0
  83. package/src/css/menu.css +244 -0
  84. package/src/css/nav.css +134 -0
  85. package/src/css/navbar.css +426 -0
  86. package/src/css/notifications.css +173 -0
  87. package/src/css/otp.css +129 -0
  88. package/src/css/pagination.css +119 -0
  89. package/src/css/palette.css +170 -0
  90. package/src/css/password.css +75 -0
  91. package/src/css/player.css +154 -0
  92. package/src/css/popover.css +106 -0
  93. package/src/css/progress.css +150 -0
  94. package/src/css/prose.css +101 -0
  95. package/src/css/rating.css +96 -0
  96. package/src/css/reboot.css +139 -0
  97. package/src/css/refresh.css +55 -0
  98. package/src/css/reveal.css +52 -0
  99. package/src/css/rich-text.css +40 -0
  100. package/src/css/scrollbar.css +63 -0
  101. package/src/css/scrollspy.css +39 -0
  102. package/src/css/sections.css +139 -0
  103. package/src/css/select.css +88 -0
  104. package/src/css/shortcuts.css +15 -0
  105. package/src/css/skeleton.css +66 -0
  106. package/src/css/sortable.css +66 -0
  107. package/src/css/spinner.css +58 -0
  108. package/src/css/split.css +158 -0
  109. package/src/css/steps.css +124 -0
  110. package/src/css/stretched-link.css +7 -0
  111. package/src/css/surface.css +79 -0
  112. package/src/css/swipe.css +78 -0
  113. package/src/css/tabbar.css +113 -0
  114. package/src/css/table.css +143 -0
  115. package/src/css/tabs.css +180 -0
  116. package/src/css/tag-input.css +49 -0
  117. package/src/css/timeline.css +88 -0
  118. package/src/css/timepicker.css +45 -0
  119. package/src/css/toast.css +179 -0
  120. package/src/css/toggler.css +59 -0
  121. package/src/css/tokens.css +164 -0
  122. package/src/css/tooltip.css +105 -0
  123. package/src/css/tour.css +52 -0
  124. package/src/css/tree.css +112 -0
  125. package/src/css/typography.css +61 -0
  126. package/src/css/utilities.css +35 -0
  127. package/src/fonts/inter/OFL.txt +93 -0
  128. package/src/fonts/inter/fonts.json +77 -0
  129. package/src/fonts/inter/inter-cyrillic-ext-opsz-italic.woff2 +0 -0
  130. package/src/fonts/inter/inter-cyrillic-ext-opsz-normal.woff2 +0 -0
  131. package/src/fonts/inter/inter-cyrillic-opsz-italic.woff2 +0 -0
  132. package/src/fonts/inter/inter-cyrillic-opsz-normal.woff2 +0 -0
  133. package/src/fonts/inter/inter-greek-ext-opsz-italic.woff2 +0 -0
  134. package/src/fonts/inter/inter-greek-ext-opsz-normal.woff2 +0 -0
  135. package/src/fonts/inter/inter-greek-opsz-italic.woff2 +0 -0
  136. package/src/fonts/inter/inter-greek-opsz-normal.woff2 +0 -0
  137. package/src/fonts/inter/inter-latin-ext-opsz-italic.woff2 +0 -0
  138. package/src/fonts/inter/inter-latin-ext-opsz-normal.woff2 +0 -0
  139. package/src/fonts/inter/inter-latin-opsz-italic.woff2 +0 -0
  140. package/src/fonts/inter/inter-latin-opsz-normal.woff2 +0 -0
  141. package/src/fonts/inter/inter-vietnamese-opsz-italic.woff2 +0 -0
  142. package/src/fonts/inter/inter-vietnamese-opsz-normal.woff2 +0 -0
  143. package/src/fonts/jetbrains-mono/OFL.txt +93 -0
  144. package/src/fonts/jetbrains-mono/fonts.json +67 -0
  145. package/src/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-wght-italic.woff2 +0 -0
  146. package/src/fonts/jetbrains-mono/jetbrains-mono-cyrillic-ext-wght-normal.woff2 +0 -0
  147. package/src/fonts/jetbrains-mono/jetbrains-mono-cyrillic-wght-italic.woff2 +0 -0
  148. package/src/fonts/jetbrains-mono/jetbrains-mono-cyrillic-wght-normal.woff2 +0 -0
  149. package/src/fonts/jetbrains-mono/jetbrains-mono-greek-wght-italic.woff2 +0 -0
  150. package/src/fonts/jetbrains-mono/jetbrains-mono-greek-wght-normal.woff2 +0 -0
  151. package/src/fonts/jetbrains-mono/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
  152. package/src/fonts/jetbrains-mono/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  153. package/src/fonts/jetbrains-mono/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  154. package/src/fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  155. package/src/fonts/jetbrains-mono/jetbrains-mono-vietnamese-wght-italic.woff2 +0 -0
  156. package/src/fonts/jetbrains-mono/jetbrains-mono-vietnamese-wght-normal.woff2 +0 -0
  157. package/src/js/moey.js +9762 -0
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "moey-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "A clean, mobile-first front-end framework for admin dashboards, productivity apps and websites — one stylesheet, one script, no dependencies.",
5
+ "keywords": [
6
+ "css",
7
+ "framework",
8
+ "ui",
9
+ "components",
10
+ "mobile-first",
11
+ "dashboard",
12
+ "admin",
13
+ "dark-mode",
14
+ "rtl",
15
+ "utilities",
16
+ "oklch",
17
+ "no-dependencies"
18
+ ],
19
+ "homepage": "https://nakedtuxedo.com",
20
+ "license": "MIT",
21
+ "type": "module",
22
+ "main": "dist/moey.js",
23
+ "style": "dist/moey.css",
24
+ "unpkg": "dist/moey.min.css",
25
+ "jsdelivr": "dist/moey.min.css",
26
+ "exports": {
27
+ ".": {
28
+ "style": "./dist/moey.css",
29
+ "default": "./dist/moey.js"
30
+ },
31
+ "./dist/*": "./dist/*",
32
+ "./src/*": "./src/*",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "src",
38
+ "LICENSE",
39
+ "README.md",
40
+ "CHANGELOG.md",
41
+ "brand/moey-icon.svg"
42
+ ],
43
+ "sideEffects": [
44
+ "*.css",
45
+ "dist/moey.js",
46
+ "dist/moey.min.js"
47
+ ],
48
+ "scripts": {
49
+ "build": "node build.mjs",
50
+ "build:icons": "node icons/build.mjs",
51
+ "build:all": "node build.mjs && node icons/build.mjs",
52
+ "deploy:icons": "node icons/build.mjs && node icons/deploy.mjs && npx wrangler pages deploy icons/site-dist --project-name moey-icons --branch main --commit-dirty=true",
53
+ "build:live": "node build.mjs && node build-live.mjs"
54
+ }
55
+ }
@@ -0,0 +1,94 @@
1
+ /* ==========================================================================
2
+ Accordion — native <details>: works without JavaScript, the browser's
3
+ find-in-page opens matching sections, and it animates smoothly where supported.
4
+
5
+ <div class="accordion">
6
+ <details class="accordion-item" name="faq" open>
7
+ <summary class="accordion-header">How do refunds work?</summary>
8
+ <div class="accordion-body">…</div>
9
+ </details>
10
+ <details class="accordion-item" name="faq">…</details>
11
+ </div>
12
+
13
+ Same name="…" on the items = only one open at a time. Leave it out = any number open.
14
+ Styles: default (one surface with dividers) · .accordion-flush (inside cards) ·
15
+ .accordion-separated (each item its own card) · .accordion-sm
16
+ ========================================================================== */
17
+
18
+ .accordion {
19
+ --mo-accordion-padding-x: 1.25rem;
20
+ --mo-accordion-padding-y: 1rem;
21
+ --mo-accordion-bg: var(--mo-bg-surface);
22
+ --mo-accordion-radius: var(--mo-radius-card);
23
+ display: flex;
24
+ flex-direction: column;
25
+ overflow: clip;
26
+ background: var(--mo-accordion-bg);
27
+ border-radius: var(--mo-accordion-radius);
28
+ }
29
+ .accordion-item + .accordion-item { border-top: var(--mo-border-width) solid var(--mo-border-color); }
30
+
31
+ .accordion-header {
32
+ display: flex;
33
+ gap: .75rem;
34
+ align-items: center;
35
+ padding: var(--mo-accordion-padding-y) var(--mo-accordion-padding-x);
36
+ font-weight: var(--mo-font-weight-medium);
37
+ list-style: none;
38
+ cursor: pointer;
39
+ user-select: none;
40
+ transition: background-color var(--mo-duration) var(--mo-ease);
41
+ }
42
+ .accordion-header::-webkit-details-marker { display: none; }
43
+ .accordion-header:hover { background-color: color-mix(in oklab, var(--mo-fg-body) 3%, transparent); }
44
+ .accordion-header:focus-visible { outline: var(--mo-focus-ring-width) solid var(--mo-theme-focus-ring); outline-offset: -3px; }
45
+ .accordion-header > .mi { flex-shrink: 0; font-size: 1.125rem; color: var(--mo-fg-3); }
46
+ /* Chevron */
47
+ .accordion-header::after {
48
+ flex-shrink: 0;
49
+ width: 1rem;
50
+ height: 1rem;
51
+ margin-inline-start: auto;
52
+ content: "";
53
+ background-color: var(--mo-fg-3);
54
+ mask: var(--mo-icon-chevron) center / contain no-repeat;
55
+ transition: rotate .25s var(--mo-ease);
56
+ }
57
+ .accordion-item[open] > .accordion-header::after { rotate: 180deg; }
58
+ /* Optional second line / meta in the header */
59
+ .accordion-title { flex: 1; min-width: 0; }
60
+ .accordion-subtitle { display: block; font-size: .8125rem; font-weight: var(--mo-font-weight-normal, 400); color: var(--mo-fg-3); }
61
+ .accordion-header > .badge { flex-shrink: 0; }
62
+
63
+ .accordion-body {
64
+ padding: 0 var(--mo-accordion-padding-x) var(--mo-accordion-padding-y);
65
+ font-size: .9375rem;
66
+ color: var(--mo-fg-2);
67
+ }
68
+ .accordion-body > :last-child { margin-bottom: 0; }
69
+ .accordion-header:has(> .mi:first-child) + .accordion-body { padding-inline-start: calc(var(--mo-accordion-padding-x) + 1.125rem + .75rem); } /* lines up with the title */
70
+
71
+ /* Smooth open & close (browsers with ::details-content; others just open instantly) */
72
+ @media (prefers-reduced-motion: no-preference) {
73
+ @supports selector(::details-content) {
74
+ .accordion-item::details-content {
75
+ block-size: 0;
76
+ overflow: clip;
77
+ transition: block-size .28s var(--mo-ease), content-visibility .28s allow-discrete;
78
+ }
79
+ .accordion-item[open]::details-content { block-size: auto; }
80
+ }
81
+ }
82
+
83
+ /* Flush: no surface of its own — for inside a card */
84
+ .accordion-flush { --mo-accordion-bg: transparent; --mo-accordion-radius: 0; --mo-accordion-padding-x: 0; overflow: visible; }
85
+ .accordion-flush .accordion-header:hover { background-color: transparent; color: var(--mo-fg-body); }
86
+ .card-flush > .accordion-flush, .card-body.card-flush > .accordion-flush { --mo-accordion-padding-x: var(--mo-card-padding); }
87
+
88
+ /* Separated: each item is its own card */
89
+ .accordion-separated { --mo-accordion-bg: transparent; gap: .5rem; overflow: visible; }
90
+ .accordion-separated .accordion-item { overflow: clip; background: var(--mo-bg-surface); border-radius: var(--mo-radius-card); }
91
+ .accordion-separated .accordion-item + .accordion-item { border-top: 0; }
92
+
93
+ .accordion-sm { --mo-accordion-padding-x: 1rem; --mo-accordion-padding-y: .75rem; font-size: .875rem; }
94
+ .accordion-sm .accordion-body { font-size: .875rem; }
@@ -0,0 +1,81 @@
1
+ /* ==========================================================================
2
+ Adapt — on phones, things that would pop up next to a button open as a
3
+ bottom sheet instead: dropdown menus, context menus, Moey dropdown lists
4
+ (.form-select) and datepicker calendars. Same markup; nothing to add.
5
+
6
+ Easier to reach with a thumb, never cut off at the screen edge, and you can
7
+ drag it down (or tap outside) to close.
8
+ data-moey-adapt="false" on the element, a parent or <html> keeps the pop-up.
9
+ moey.js adds .is-sheet when it opens on a screen under 576px wide.
10
+ ========================================================================== */
11
+
12
+ .is-sheet[popover] {
13
+ --mo-menu-max-height: min(80dvh, calc(100dvh - 3rem));
14
+ position: fixed;
15
+ inset: auto 0 0 !important;
16
+ width: 100%;
17
+ min-width: 0 !important;
18
+ max-width: none;
19
+ max-height: var(--mo-menu-max-height);
20
+ margin: 0;
21
+ padding: 0 .75rem calc(.75rem + env(safe-area-inset-bottom));
22
+ overflow-y: auto;
23
+ overscroll-behavior: contain;
24
+ background: var(--mo-bg-raised);
25
+ border: 0;
26
+ border-radius: var(--mo-radius-card) var(--mo-radius-card) 0 0;
27
+ box-shadow: 0 -.5rem 2rem rgb(0 0 0 / .18);
28
+ scale: none;
29
+ transform-origin: bottom center;
30
+ touch-action: pan-y;
31
+ }
32
+ .is-sheet[popover]::backdrop { background: rgb(0 0 0 / .4); }
33
+ html:has(.is-sheet:popover-open) { overflow: hidden; }
34
+
35
+ /* The handle (and the field's name, when it has one) — stays at the top while the list scrolls */
36
+ .is-sheet[popover]::before {
37
+ position: sticky;
38
+ top: 0;
39
+ z-index: 3;
40
+ display: block;
41
+ flex-shrink: 0;
42
+ min-height: 1.5rem;
43
+ padding: 1.375rem .5rem .5rem;
44
+ margin: 0 -.75rem .25rem;
45
+ font-size: .9375rem;
46
+ font-weight: var(--mo-font-weight-semibold, 600);
47
+ color: var(--mo-fg-body);
48
+ text-align: center;
49
+ content: attr(data-sheet-title);
50
+ background:
51
+ linear-gradient(var(--mo-border-color-strong), var(--mo-border-color-strong)) center .625rem / 2.25rem 4px no-repeat,
52
+ var(--mo-bg-raised);
53
+ border-radius: 2px;
54
+ cursor: grab;
55
+ }
56
+ .is-sheet[popover]:not([data-sheet-title])::before { padding-bottom: 0; min-height: 0; height: 1.5rem; }
57
+
58
+ /* Bigger targets for fingers */
59
+ .is-sheet .menu-item { min-height: 2.875rem; font-size: 1rem; }
60
+ .is-sheet .menu-header { padding-top: .75rem; }
61
+ .is-sheet .select-search { top: 3rem; margin-top: 0; padding-top: 0; }
62
+
63
+ /* A calendar in a sheet: centered, with larger days */
64
+ .datepicker.is-sheet { --mo-dp-cell: min(2.75rem, calc((100vw - 2rem) / 7)); }
65
+ .datepicker.is-sheet .datepicker-body,
66
+ .datepicker.is-sheet .datepicker-months { justify-content: center; }
67
+ .datepicker.is-sheet .datepicker-main { margin-inline: auto; }
68
+ .datepicker.is-sheet .datepicker-foot > .btn { min-height: 2.5rem; }
69
+
70
+ /* Slide up (the menu's own zoom is switched off) */
71
+ @media (prefers-reduced-motion: no-preference) {
72
+ .is-sheet[popover]:popover-open { animation: mo-adapt-up .24s cubic-bezier(.2, .8, .2, 1); }
73
+ .menu.is-sheet[popover] { transition: none; }
74
+ .is-sheet[popover].is-dragging { animation: none; }
75
+ @keyframes mo-adapt-up { from { translate: 0 100%; } }
76
+ }
77
+ .is-sheet[popover].is-dragging { transition: none; user-select: none; }
78
+ .is-sheet[popover].is-settling { transition: translate .2s ease; }
79
+
80
+ /* Touch: long-press opens a context menu, so don't let the phone's own callout take over */
81
+ @media (hover: none) { [data-moey-context] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }
@@ -0,0 +1,171 @@
1
+ /* ==========================================================================
2
+ Alert — inline messages. Flat; neutral until it gets a color.
3
+
4
+ <div class="alert alert-amber" role="status">
5
+ <i class="mi mi-triangle-alert alert-icon"></i>
6
+ <div class="alert-content">
7
+ <div class="alert-title">Trial ends in 3 days</div>
8
+ <p>Add a payment method to keep your workspace.</p>
9
+ <div class="alert-actions">…buttons…</div>
10
+ </div>
11
+ <button class="btn-close" aria-label="Dismiss"></button>
12
+ </div>
13
+
14
+ Strengths: .alert-subtle · .alert-soft · (default) · .alert-solid · .alert-vivid · .alert-deep · .alert-outline
15
+ .alert-sm · .alert-banner
16
+ Plain text works too: <div class="alert">Saved. <button class="btn-close"></button></div>
17
+ Close: moey.js closes it when its .btn-close is clicked (.alert-instant skips the fade)
18
+ ========================================================================== */
19
+
20
+ .alert {
21
+ --mo-alert-padding-x: 1rem;
22
+ --mo-alert-padding-y: .875rem;
23
+ --mo-alert-gap: .75rem;
24
+ --mo-alert-font-size: .875rem;
25
+ --mo-alert-icon-size: 1.125rem;
26
+ --mo-alert-color: var(--mo-fg-body); /* neutral until it gets a color */
27
+ --mo-alert-bg: color-mix(in oklab, var(--mo-fg-body) 6%, transparent);
28
+ --mo-alert-border: var(--mo-border-color);
29
+ --mo-alert-icon-color: var(--mo-fg-2);
30
+ --mo-alert-radius: var(--mo-radius-card);
31
+ position: relative;
32
+ display: block;
33
+ padding: var(--mo-alert-padding-y) var(--mo-alert-padding-x);
34
+ font-size: var(--mo-alert-font-size);
35
+ line-height: 1.5;
36
+ color: var(--mo-alert-color);
37
+ background-color: var(--mo-alert-bg);
38
+ border: var(--mo-surface-border-width) solid var(--mo-alert-border);
39
+ border-radius: var(--mo-alert-radius);
40
+ }
41
+
42
+ /* Flex layout only with Moey's structure (icon / content / actions).
43
+ Plain text and links placed directly inside flow normally. */
44
+ .alert:has(> .alert-icon, > .alert-content) {
45
+ display: flex;
46
+ align-items: flex-start;
47
+ gap: var(--mo-alert-gap);
48
+ }
49
+
50
+ /* Icon lines up with the first line of text */
51
+ .alert-icon {
52
+ flex-shrink: 0;
53
+ margin-top: calc((var(--mo-alert-font-size) * 1.5 - var(--mo-alert-icon-size)) / 2);
54
+ font-size: var(--mo-alert-icon-size);
55
+ line-height: 1;
56
+ color: var(--mo-alert-icon-color);
57
+ }
58
+ .alert-icon.mi { vertical-align: 0; }
59
+
60
+ .alert-content { flex: 1; min-width: 0; }
61
+ .alert-content > :last-child,
62
+ .alert > p:last-child { margin-bottom: 0; }
63
+ .alert p { margin: 0 0 .25rem; }
64
+ .alert ul, .alert ol { margin: .25rem 0; padding-inline-start: 1.25rem; }
65
+
66
+ .alert-title {
67
+ margin: 0 0 .125rem;
68
+ font-size: inherit;
69
+ font-weight: var(--mo-font-weight-semibold);
70
+ line-height: inherit;
71
+ }
72
+ /* A title on its own (no text under it) needs no gap */
73
+ .alert-title:last-child { margin-bottom: 0; }
74
+
75
+ .alert hr { margin: .75rem 0; border-color: color-mix(in oklab, currentcolor 20%, transparent); }
76
+
77
+ .alert-actions {
78
+ display: flex;
79
+ flex-wrap: wrap;
80
+ gap: .5rem;
81
+ margin-top: .75rem;
82
+ }
83
+
84
+ /* Links read as part of the message */
85
+ .alert a:not([class*="btn"]) {
86
+ font-weight: var(--mo-font-weight-semibold);
87
+ color: inherit;
88
+ text-decoration: underline;
89
+ text-decoration-color: color-mix(in oklab, currentcolor 45%, transparent);
90
+ }
91
+ .alert a:not([class*="btn"]):hover { text-decoration-color: currentcolor; }
92
+
93
+ /* Fade out on dismiss: add .hiding, remove the element after the transition */
94
+ @media (prefers-reduced-motion: no-preference) {
95
+ .alert:not(.alert-instant) { transition: opacity .15s linear, translate .15s var(--mo-ease); }
96
+ }
97
+ .alert.hiding { opacity: 0; translate: 0 -.25rem; pointer-events: none; }
98
+
99
+ /* Close button: top-right, aligned with the first line, pulled into the padding */
100
+ .alert > .btn-close {
101
+ --mo-close-size: 1.75rem;
102
+ --mo-close-icon: .875rem;
103
+ margin-block: calc((var(--mo-alert-font-size) * 1.5 - var(--mo-close-size)) / 2);
104
+ margin-inline: auto calc(var(--mo-alert-padding-x) * -.5);
105
+ }
106
+
107
+ /* Plain-text alert (no .alert-content): the close button pins itself top-right
108
+ and the text makes room for it — no extra class needed. */
109
+ .alert:not(:has(> .alert-content)):has(> .btn-close) { padding-inline-end: calc(var(--mo-alert-padding-x) + 2rem); }
110
+ .alert:not(:has(> .alert-content)) > .btn-close {
111
+ position: absolute;
112
+ top: calc(var(--mo-alert-padding-y) + (var(--mo-alert-font-size) * 1.5 - var(--mo-close-size)) / 2);
113
+ inset-inline-end: calc(var(--mo-alert-padding-x) * .5);
114
+ margin: 0;
115
+ }
116
+
117
+ /* Colors & strengths ---------------------------------------------------------
118
+ <div class="alert alert-amber"> (the soft default fill) · + .alert-subtle … .alert-deep */
119
+ :is(/*@colors alert*/), .alert:where(/*@themes*/) {
120
+ --mo-alert-color: var(--mo-theme-fill-text);
121
+ --mo-alert-bg: var(--mo-theme-fill);
122
+ --mo-alert-border: var(--mo-theme-border);
123
+ --mo-alert-icon-color: currentcolor;
124
+ }
125
+ /* Same as colored cards: accents inside a strong alert use its text color */
126
+ :is(/*@colors alert*/):not(.alert-outline),
127
+ .alert:where(/*@themes*/):not(.alert-outline) {
128
+ --mo-accent: var(--mo-alert-color);
129
+ --mo-accent-contrast: var(--mo-alert-bg);
130
+ --mo-track: color-mix(in oklab, var(--mo-alert-color) 22%, transparent);
131
+ --mo-check-mark: var(--mo-alert-mark, var(--mo-theme-fill-mark)); /* .alert-solid / -vivid / -deep set their own */
132
+ --mo-check-dash: var(--mo-alert-dash, var(--mo-theme-fill-dash));
133
+ }
134
+ .alert-subtle, .alert-soft { --mo-alert-mark: var(--mo-check-on-text); --mo-alert-dash: var(--mo-dash-on-text); }
135
+ .alert-solid { --mo-alert-mark: var(--mo-theme-solid-mark); --mo-alert-dash: var(--mo-theme-solid-dash); }
136
+ .alert-vivid { --mo-alert-mark: var(--mo-theme-vivid-mark); --mo-alert-dash: var(--mo-theme-vivid-dash); }
137
+ .alert-deep { --mo-alert-mark: var(--mo-theme-deep-mark); --mo-alert-dash: var(--mo-theme-deep-dash); }
138
+ .alert-subtle { --mo-alert-color: var(--mo-theme-subtle-text); --mo-alert-bg: var(--mo-theme-subtle); --mo-alert-icon-color: var(--mo-theme-fg); }
139
+ .alert-soft { --mo-alert-color: var(--mo-theme-soft-text); --mo-alert-bg: var(--mo-theme-soft); --mo-alert-icon-color: var(--mo-theme-fg); }
140
+ .alert-solid { --mo-alert-color: var(--mo-theme-solid-text); --mo-alert-bg: var(--mo-theme-solid); --mo-alert-icon-color: currentcolor; }
141
+ .alert-vivid { --mo-alert-color: var(--mo-theme-vivid-text); --mo-alert-bg: var(--mo-theme-vivid); --mo-alert-icon-color: currentcolor; }
142
+ .alert-deep { --mo-alert-color: var(--mo-theme-deep-text); --mo-alert-bg: var(--mo-theme-deep); --mo-alert-icon-color: currentcolor; }
143
+ /* Outline — a border, no fill; body-colored text */
144
+ .alert-outline {
145
+ --mo-alert-color: var(--mo-fg-body);
146
+ --mo-alert-bg: transparent;
147
+ --mo-alert-icon-color: var(--mo-theme-fg);
148
+ border-width: var(--mo-border-width);
149
+ }
150
+ .alert-outline .alert-title { color: var(--mo-theme-fg-emphasis); }
151
+
152
+ /* Sizes & shapes ------------------------------------------------------------- */
153
+ .alert-sm {
154
+ --mo-alert-padding-x: .75rem;
155
+ --mo-alert-padding-y: .5rem;
156
+ --mo-alert-gap: .5rem;
157
+ --mo-alert-font-size: .8125rem;
158
+ --mo-alert-icon-size: 1rem;
159
+ }
160
+ /* Full-width bar (top of a page or app): square corners, content centered */
161
+ .alert-banner {
162
+ --mo-alert-radius: 0;
163
+ align-items: center;
164
+ justify-content: center;
165
+ }
166
+ .alert-banner > .alert-content { flex: 0 1 auto; }
167
+ .alert-banner > .alert-icon { margin-top: 0; }
168
+ .alert-banner > .btn-close { position: absolute; inset-inline-end: var(--mo-alert-padding-x); margin: 0; }
169
+
170
+ /* Inline code inside an alert takes the alert's text color (readable on every strength) */
171
+ .alert :not(pre) > code { color: inherit; background-color: color-mix(in oklab, currentColor 12%, transparent); }
@@ -0,0 +1,71 @@
1
+ /* ==========================================================================
2
+ Entrance animations — things that arrive instead of popping in.
3
+
4
+ On load: <h1 class="animate-fade-up">…</h1>
5
+ One by one: <div class="stagger"> <div class="animate-fade-up">…</div> … </div>
6
+ Later: class="animate-fade-up delay-300"
7
+ On scroll: <section data-moey-animate="fade-up">…</section> (moey.js plays it when it
8
+ scrolls into view; data-moey-animate on a .stagger parent plays its children)
9
+
10
+ fade-in · fade-up · fade-down · fade-start · fade-end · zoom-in · slide-up
11
+ Content is never hidden without JavaScript, when printing, or for people who ask
12
+ their device for less motion (they simply see everything at once).
13
+ ========================================================================== */
14
+
15
+ @keyframes mo-fade-in { from { opacity: 0; } }
16
+ @keyframes mo-fade-up { from { opacity: 0; translate: 0 1.25rem; } }
17
+ @keyframes mo-fade-down { from { opacity: 0; translate: 0 -1.25rem; } }
18
+ @keyframes mo-fade-start { from { opacity: 0; translate: -1.25rem 0; } }
19
+ @keyframes mo-fade-end { from { opacity: 0; translate: 1.25rem 0; } }
20
+ @keyframes mo-zoom-in { from { opacity: 0; scale: .94; } }
21
+ @keyframes mo-slide-up { from { translate: 0 100%; } }
22
+
23
+ :root { --mo-enter-duration: .6s; --mo-enter-ease: cubic-bezier(.2, .7, .2, 1); --mo-stagger: 80ms; }
24
+
25
+ /* The names, for classes and for data-moey-animate */
26
+ :is(.animate-fade-in, [data-moey-animate="fade-in"]) { --_mo-enter: mo-fade-in; }
27
+ :is(.animate-fade-up, [data-moey-animate="fade-up"]) { --_mo-enter: mo-fade-up; }
28
+ :is(.animate-fade-down, [data-moey-animate="fade-down"]) { --_mo-enter: mo-fade-down; }
29
+ :is(.animate-fade-start, [data-moey-animate="fade-start"]) { --_mo-enter: mo-fade-start; }
30
+ :is(.animate-fade-end, [data-moey-animate="fade-end"]) { --_mo-enter: mo-fade-end; }
31
+ :is(.animate-zoom-in, [data-moey-animate="zoom-in"]) { --_mo-enter: mo-zoom-in; }
32
+ :is(.animate-slide-up, [data-moey-animate="slide-up"]) { --_mo-enter: mo-slide-up; }
33
+ /* Right-to-left: start and end swap sides */
34
+ :is(.animate-fade-start, [data-moey-animate="fade-start"]):dir(rtl) { --_mo-enter: mo-fade-end; }
35
+ :is(.animate-fade-end, [data-moey-animate="fade-end"]):dir(rtl) { --_mo-enter: mo-fade-start; }
36
+
37
+ /* Delays and one-by-one */
38
+ .delay-75 { --mo-delay: 75ms; } .delay-150 { --mo-delay: 150ms; } .delay-300 { --mo-delay: 300ms; }
39
+ .delay-500 { --mo-delay: 500ms; } .delay-700 { --mo-delay: 700ms; } .delay-1000 { --mo-delay: 1s; }
40
+ .stagger > :nth-child(1) { --mo-delay: 0ms; }
41
+ .stagger > :nth-child(2) { --mo-delay: calc(var(--mo-stagger) * 1); }
42
+ .stagger > :nth-child(3) { --mo-delay: calc(var(--mo-stagger) * 2); }
43
+ .stagger > :nth-child(4) { --mo-delay: calc(var(--mo-stagger) * 3); }
44
+ .stagger > :nth-child(5) { --mo-delay: calc(var(--mo-stagger) * 4); }
45
+ .stagger > :nth-child(6) { --mo-delay: calc(var(--mo-stagger) * 5); }
46
+ .stagger > :nth-child(7) { --mo-delay: calc(var(--mo-stagger) * 6); }
47
+ .stagger > :nth-child(8) { --mo-delay: calc(var(--mo-stagger) * 7); }
48
+ .stagger > :nth-child(9) { --mo-delay: calc(var(--mo-stagger) * 8); }
49
+ .stagger > :nth-child(10) { --mo-delay: calc(var(--mo-stagger) * 9); }
50
+ .stagger > :nth-child(11) { --mo-delay: calc(var(--mo-stagger) * 10); }
51
+ .stagger > :nth-child(n+12) { --mo-delay: calc(var(--mo-stagger) * 11); }
52
+
53
+ @media (prefers-reduced-motion: no-preference) {
54
+ /* On load */
55
+ :is(.animate-fade-in, .animate-fade-up, .animate-fade-down, .animate-fade-start, .animate-fade-end, .animate-zoom-in, .animate-slide-up) {
56
+ animation: var(--_mo-enter) var(--mo-enter-duration) var(--mo-enter-ease) var(--mo-delay, 0ms) both;
57
+ }
58
+ /* On scroll: hidden until moey.js sees it (only when moey.js is running — html.mo-js) */
59
+ .mo-js [data-moey-animate]:not(.stagger, .is-in),
60
+ .mo-js [data-moey-animate].stagger:not(.is-in) > * { opacity: 0; }
61
+ [data-moey-animate]:not(.stagger).is-in {
62
+ animation: var(--_mo-enter) var(--mo-enter-duration) var(--mo-enter-ease) var(--mo-delay, 0ms) both;
63
+ }
64
+ [data-moey-animate].stagger.is-in > * {
65
+ animation: var(--_mo-enter) var(--mo-enter-duration) var(--mo-enter-ease) var(--mo-delay, 0ms) both;
66
+ }
67
+ [data-moey-animate].stagger > * { --_mo-enter: inherit; }
68
+ }
69
+ @media print {
70
+ [data-moey-animate], [data-moey-animate] > * { opacity: 1 !important; animation: none !important; }
71
+ }