@yewdiel21/motion-kit 0.10.0 → 0.14.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/README.md +155 -93
- package/dist/auto/index.d.ts +53 -3
- package/dist/auto/index.js +101 -3
- package/dist/auto/index.js.map +1 -1
- package/dist/{chunk-IKQ5FODN.js → chunk-6P4P7NU6.js} +2 -218
- package/dist/chunk-6P4P7NU6.js.map +1 -0
- package/dist/chunk-CU6SXW3E.js +20334 -0
- package/dist/chunk-CU6SXW3E.js.map +1 -0
- package/dist/{chunk-XAKC2QY7.js → chunk-EY4BJKC4.js} +3 -28
- package/dist/chunk-EY4BJKC4.js.map +1 -0
- package/dist/chunk-QP4QJOEN.js +72 -0
- package/dist/chunk-QP4QJOEN.js.map +1 -0
- package/dist/css/components/activity-feed.css +240 -0
- package/dist/css/components/attachment.css +266 -0
- package/dist/css/components/breadcrumb.css +110 -0
- package/dist/css/components/chart-tooltip.css +168 -0
- package/dist/css/components/chart.css +296 -0
- package/dist/css/components/code-block.css +264 -0
- package/dist/css/components/color-area.css +82 -0
- package/dist/css/components/color-field.css +67 -0
- package/dist/css/components/color-picker.css +131 -0
- package/dist/css/components/color-slider.css +113 -0
- package/dist/css/components/command-search.css +252 -0
- package/dist/css/components/context-menu.css +23 -0
- package/dist/css/components/credit-card.css +288 -0
- package/dist/css/components/data-table.css +591 -0
- package/dist/css/components/date-range-picker.css +168 -0
- package/dist/css/components/date-time-picker.css +178 -0
- package/dist/css/components/drawer.css +58 -0
- package/dist/css/components/editable-table.css +201 -0
- package/dist/css/components/empty-state.css +61 -0
- package/dist/css/components/file-explorer.css +633 -0
- package/dist/css/components/filter-builder.css +232 -0
- package/dist/css/components/hold-confirm.css +87 -0
- package/dist/css/components/hover-card.css +13 -7
- package/dist/css/components/image-preview.css +195 -0
- package/dist/css/components/json-viewer.css +272 -0
- package/dist/css/components/like-button.css +78 -0
- package/dist/css/components/link-preview.css +275 -0
- package/dist/css/components/loading-button.css +77 -0
- package/dist/css/components/multi-select.css +267 -0
- package/dist/css/components/notification-bell.css +127 -0
- package/dist/css/components/password-strength.css +183 -0
- package/dist/css/components/popover.css +25 -0
- package/dist/css/components/progress.css +140 -0
- package/dist/css/components/questionnaire.css +217 -0
- package/dist/css/components/range-calendar.css +186 -0
- package/dist/css/components/range-slider.css +192 -0
- package/dist/css/components/resizable-panel.css +243 -0
- package/dist/css/components/rich-text-editor.css +284 -0
- package/dist/css/components/scratch-card.css +75 -0
- package/dist/css/components/skeleton.css +108 -0
- package/dist/css/components/split-view.css +19 -0
- package/dist/css/components/star-rating.css +80 -0
- package/dist/css/components/stat-card.css +164 -0
- package/dist/css/components/swipe-actions.css +105 -0
- package/dist/css/components/tag-input.css +244 -0
- package/dist/css/components/time-field.css +88 -0
- package/dist/css/components/timeline.css +219 -0
- package/dist/css/components/tooltip.css +79 -0
- package/dist/css/components/tree-view.css +210 -0
- package/dist/css/components/virtual-list.css +195 -0
- package/dist/css/tokens.css +185 -181
- package/dist/elements/index.d.ts +674 -5
- package/dist/elements/index.js +1361 -8
- package/dist/elements/index.js.map +1 -1
- package/dist/{engine-GDGwQnJE.d.ts → engine-Cn6IhE3z.d.ts} +1 -1
- package/dist/engine-QECQnGz1.d.ts +33 -0
- package/dist/index.css +9104 -189
- package/dist/index.d.ts +89 -5
- package/dist/index.js +243 -9
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +579 -23
- package/dist/react/index.js +2042 -7
- package/dist/react/index.js.map +1 -1
- package/dist/{reduced-BmBzKH94.d.ts → reduced-BBUusld6.d.ts} +9 -2
- package/dist/reveal-DEvp6U6T.d.ts +2381 -0
- package/dist/{store-DYb3tTsZ.d.ts → store-DjkTBX7f.d.ts} +2 -2
- package/package.json +1 -1
- package/registry.json +406 -1
- package/src/auto/auto-init.ts +98 -0
- package/src/components/activity-feed/README.md +56 -0
- package/src/components/activity-feed/activity-feed.css +239 -0
- package/src/components/activity-feed/element.ts +36 -0
- package/src/components/activity-feed/engine.ts +351 -0
- package/src/components/activity-feed/react.tsx +32 -0
- package/src/components/attachment/README.md +27 -0
- package/src/components/attachment/attachment.css +265 -0
- package/src/components/attachment/element.ts +50 -0
- package/src/components/attachment/engine.ts +469 -0
- package/src/components/attachment/react.tsx +65 -0
- package/src/components/breadcrumb/README.md +38 -0
- package/src/components/breadcrumb/breadcrumb.css +109 -0
- package/src/components/breadcrumb/element.ts +27 -0
- package/src/components/breadcrumb/engine.ts +249 -0
- package/src/components/breadcrumb/react.tsx +30 -0
- package/src/components/chart/README.md +24 -0
- package/src/components/chart/chart.css +295 -0
- package/src/components/chart/element.ts +41 -0
- package/src/components/chart/engine.ts +811 -0
- package/src/components/chart/react.tsx +50 -0
- package/src/components/chart-tooltip/README.md +53 -0
- package/src/components/chart-tooltip/chart-tooltip.css +167 -0
- package/src/components/chart-tooltip/element.ts +37 -0
- package/src/components/chart-tooltip/engine.ts +442 -0
- package/src/components/chart-tooltip/react.tsx +47 -0
- package/src/components/code-block/README.md +19 -0
- package/src/components/code-block/code-block.css +263 -0
- package/src/components/code-block/element.ts +34 -0
- package/src/components/code-block/engine.ts +254 -0
- package/src/components/code-block/highlight.ts +244 -0
- package/src/components/code-block/react.tsx +94 -0
- package/src/components/color-area/README.md +50 -0
- package/src/components/color-area/color-area.css +81 -0
- package/src/components/color-area/element.ts +26 -0
- package/src/components/color-area/engine.ts +246 -0
- package/src/components/color-area/react.tsx +42 -0
- package/src/components/color-field/README.md +43 -0
- package/src/components/color-field/color-field.css +66 -0
- package/src/components/color-field/element.ts +26 -0
- package/src/components/color-field/engine.ts +174 -0
- package/src/components/color-field/react.tsx +42 -0
- package/src/components/color-picker/README.md +45 -0
- package/src/components/color-picker/color-picker.css +130 -0
- package/src/components/color-picker/element.ts +45 -0
- package/src/components/color-picker/engine.ts +314 -0
- package/src/components/color-picker/react.tsx +47 -0
- package/src/components/color-slider/README.md +55 -0
- package/src/components/color-slider/color-slider.css +112 -0
- package/src/components/color-slider/element.ts +26 -0
- package/src/components/color-slider/engine.ts +234 -0
- package/src/components/color-slider/react.tsx +45 -0
- package/src/components/command-search/README.md +15 -0
- package/src/components/command-search/command-search.css +251 -0
- package/src/components/command-search/element.ts +36 -0
- package/src/components/command-search/engine.ts +356 -0
- package/src/components/command-search/match.ts +53 -0
- package/src/components/command-search/react.tsx +66 -0
- package/src/components/context-menu/README.md +31 -0
- package/src/components/context-menu/context-menu.css +22 -0
- package/src/components/context-menu/element.ts +40 -0
- package/src/components/context-menu/engine.ts +153 -0
- package/src/components/context-menu/react.tsx +57 -0
- package/src/components/credit-card/README.md +20 -0
- package/src/components/credit-card/card.ts +77 -0
- package/src/components/credit-card/credit-card.css +287 -0
- package/src/components/credit-card/element.ts +33 -0
- package/src/components/credit-card/engine.ts +410 -0
- package/src/components/credit-card/react.tsx +36 -0
- package/src/components/data-table/README.md +83 -0
- package/src/components/data-table/data-table.css +590 -0
- package/src/components/data-table/element.ts +54 -0
- package/src/components/data-table/engine.ts +1059 -0
- package/src/components/data-table/react.tsx +94 -0
- package/src/components/date-range-picker/README.md +51 -0
- package/src/components/date-range-picker/date-range-picker.css +167 -0
- package/src/components/date-range-picker/element.ts +52 -0
- package/src/components/date-range-picker/engine.ts +352 -0
- package/src/components/date-range-picker/react.tsx +57 -0
- package/src/components/date-time-picker/README.md +48 -0
- package/src/components/date-time-picker/date-time-picker.css +177 -0
- package/src/components/date-time-picker/element.ts +47 -0
- package/src/components/date-time-picker/engine.ts +350 -0
- package/src/components/date-time-picker/react.tsx +54 -0
- package/src/components/dialog/README.md +103 -102
- package/src/components/dialog/element.ts +123 -118
- package/src/components/dialog/engine.ts +449 -432
- package/src/components/drawer/README.md +28 -0
- package/src/components/drawer/drawer.css +57 -0
- package/src/components/drawer/element.ts +21 -0
- package/src/components/drawer/engine.ts +56 -0
- package/src/components/drawer/react.tsx +85 -0
- package/src/components/editable-table/README.md +67 -0
- package/src/components/editable-table/editable-table.css +200 -0
- package/src/components/editable-table/element.ts +45 -0
- package/src/components/editable-table/engine.ts +775 -0
- package/src/components/editable-table/react.tsx +79 -0
- package/src/components/empty-state/README.md +41 -0
- package/src/components/empty-state/element.ts +23 -0
- package/src/components/empty-state/empty-state.css +60 -0
- package/src/components/empty-state/engine.ts +232 -0
- package/src/components/empty-state/react.tsx +34 -0
- package/src/components/file-explorer/README.md +67 -0
- package/src/components/file-explorer/element.ts +39 -0
- package/src/components/file-explorer/engine.ts +1307 -0
- package/src/components/file-explorer/file-explorer.css +632 -0
- package/src/components/file-explorer/react.tsx +77 -0
- package/src/components/filter-builder/README.md +47 -0
- package/src/components/filter-builder/element.ts +34 -0
- package/src/components/filter-builder/engine.ts +365 -0
- package/src/components/filter-builder/filter-builder.css +231 -0
- package/src/components/filter-builder/react.tsx +36 -0
- package/src/components/hold-confirm/README.md +13 -0
- package/src/components/hold-confirm/element.ts +24 -0
- package/src/components/hold-confirm/engine.ts +216 -0
- package/src/components/hold-confirm/hold-confirm.css +86 -0
- package/src/components/hold-confirm/react.tsx +28 -0
- package/src/components/hover-card/README.md +6 -2
- package/src/components/hover-card/engine.ts +68 -6
- package/src/components/hover-card/hover-card.css +13 -7
- package/src/components/image-preview/README.md +16 -0
- package/src/components/image-preview/element.ts +26 -0
- package/src/components/image-preview/engine.ts +325 -0
- package/src/components/image-preview/image-preview.css +194 -0
- package/src/components/image-preview/react.tsx +43 -0
- package/src/components/json-viewer/README.md +56 -0
- package/src/components/json-viewer/element.ts +37 -0
- package/src/components/json-viewer/engine.ts +440 -0
- package/src/components/json-viewer/json-viewer.css +271 -0
- package/src/components/json-viewer/react.tsx +56 -0
- package/src/components/like-button/README.md +13 -0
- package/src/components/like-button/element.ts +47 -0
- package/src/components/like-button/engine.ts +145 -0
- package/src/components/like-button/like-button.css +77 -0
- package/src/components/like-button/react.tsx +39 -0
- package/src/components/link-preview/README.md +19 -0
- package/src/components/link-preview/element.ts +29 -0
- package/src/components/link-preview/engine.ts +192 -0
- package/src/components/link-preview/link-preview.css +274 -0
- package/src/components/link-preview/react.tsx +101 -0
- package/src/components/loading-button/README.md +45 -0
- package/src/components/loading-button/element.ts +34 -0
- package/src/components/loading-button/engine.ts +201 -0
- package/src/components/loading-button/loading-button.css +76 -0
- package/src/components/loading-button/react.tsx +43 -0
- package/src/components/multi-select/README.md +48 -0
- package/src/components/multi-select/element.ts +28 -0
- package/src/components/multi-select/engine.ts +294 -0
- package/src/components/multi-select/multi-select.css +266 -0
- package/src/components/multi-select/react.tsx +39 -0
- package/src/components/notification-bell/README.md +14 -0
- package/src/components/notification-bell/element.ts +48 -0
- package/src/components/notification-bell/engine.ts +202 -0
- package/src/components/notification-bell/notification-bell.css +126 -0
- package/src/components/notification-bell/react.tsx +57 -0
- package/src/components/password-strength/README.md +17 -0
- package/src/components/password-strength/element.ts +22 -0
- package/src/components/password-strength/engine.ts +212 -0
- package/src/components/password-strength/password-strength.css +182 -0
- package/src/components/password-strength/react.tsx +36 -0
- package/src/components/password-strength/score.ts +62 -0
- package/src/components/popover/README.md +44 -0
- package/src/components/popover/element.ts +31 -0
- package/src/components/popover/engine.ts +114 -0
- package/src/components/popover/popover.css +24 -0
- package/src/components/popover/react.tsx +50 -0
- package/src/components/progress/README.md +17 -0
- package/src/components/progress/element.ts +30 -0
- package/src/components/progress/engine.ts +173 -0
- package/src/components/progress/progress.css +139 -0
- package/src/components/progress/react.tsx +35 -0
- package/src/components/questionnaire/README.md +32 -0
- package/src/components/questionnaire/element.ts +118 -0
- package/src/components/questionnaire/engine.ts +255 -0
- package/src/components/questionnaire/questionnaire.css +216 -0
- package/src/components/questionnaire/react.tsx +140 -0
- package/src/components/range-calendar/README.md +58 -0
- package/src/components/range-calendar/element.ts +42 -0
- package/src/components/range-calendar/engine.ts +390 -0
- package/src/components/range-calendar/range-calendar.css +185 -0
- package/src/components/range-calendar/react.tsx +56 -0
- package/src/components/range-slider/README.md +23 -0
- package/src/components/range-slider/element.ts +53 -0
- package/src/components/range-slider/engine.ts +316 -0
- package/src/components/range-slider/range-slider.css +191 -0
- package/src/components/range-slider/react.tsx +66 -0
- package/src/components/resizable-panel/README.md +61 -0
- package/src/components/resizable-panel/element.ts +36 -0
- package/src/components/resizable-panel/engine.ts +551 -0
- package/src/components/resizable-panel/react.tsx +74 -0
- package/src/components/resizable-panel/resizable-panel.css +242 -0
- package/src/components/rich-text-editor/README.md +57 -0
- package/src/components/rich-text-editor/element.ts +34 -0
- package/src/components/rich-text-editor/engine.ts +673 -0
- package/src/components/rich-text-editor/react.tsx +60 -0
- package/src/components/rich-text-editor/rich-text-editor.css +283 -0
- package/src/components/scratch-card/README.md +15 -0
- package/src/components/scratch-card/element.ts +30 -0
- package/src/components/scratch-card/engine.ts +257 -0
- package/src/components/scratch-card/react.tsx +40 -0
- package/src/components/scratch-card/scratch-card.css +74 -0
- package/src/components/skeleton/README.md +15 -0
- package/src/components/skeleton/element.ts +32 -0
- package/src/components/skeleton/engine.ts +104 -0
- package/src/components/skeleton/react.tsx +41 -0
- package/src/components/skeleton/skeleton.css +107 -0
- package/src/components/split-view/README.md +50 -0
- package/src/components/split-view/element.ts +34 -0
- package/src/components/split-view/engine.ts +114 -0
- package/src/components/split-view/react.tsx +63 -0
- package/src/components/split-view/split-view.css +18 -0
- package/src/components/star-rating/README.md +14 -0
- package/src/components/star-rating/element.ts +26 -0
- package/src/components/star-rating/engine.ts +217 -0
- package/src/components/star-rating/react.tsx +33 -0
- package/src/components/star-rating/star-rating.css +79 -0
- package/src/components/stat-card/README.md +42 -0
- package/src/components/stat-card/element.ts +40 -0
- package/src/components/stat-card/engine.ts +283 -0
- package/src/components/stat-card/react.tsx +36 -0
- package/src/components/stat-card/stat-card.css +163 -0
- package/src/components/swipe-actions/README.md +19 -0
- package/src/components/swipe-actions/element.ts +26 -0
- package/src/components/swipe-actions/engine.ts +260 -0
- package/src/components/swipe-actions/react.tsx +80 -0
- package/src/components/swipe-actions/swipe-actions.css +104 -0
- package/src/components/tag-input/README.md +42 -0
- package/src/components/tag-input/element.ts +39 -0
- package/src/components/tag-input/engine.ts +313 -0
- package/src/components/tag-input/react.tsx +54 -0
- package/src/components/tag-input/tag-input.css +243 -0
- package/src/components/time-field/README.md +54 -0
- package/src/components/time-field/element.ts +38 -0
- package/src/components/time-field/engine.ts +110 -0
- package/src/components/time-field/react.tsx +45 -0
- package/src/components/time-field/time-field.css +87 -0
- package/src/components/timeline/README.md +57 -0
- package/src/components/timeline/element.ts +31 -0
- package/src/components/timeline/engine.ts +300 -0
- package/src/components/timeline/react.tsx +59 -0
- package/src/components/timeline/timeline.css +218 -0
- package/src/components/tooltip/README.md +46 -0
- package/src/components/tooltip/element.ts +22 -0
- package/src/components/tooltip/engine.ts +288 -0
- package/src/components/tooltip/react.tsx +30 -0
- package/src/components/tooltip/tooltip.css +78 -0
- package/src/components/tree-view/README.md +61 -0
- package/src/components/tree-view/element.ts +32 -0
- package/src/components/tree-view/engine.ts +569 -0
- package/src/components/tree-view/react.tsx +78 -0
- package/src/components/tree-view/tree-view.css +209 -0
- package/src/components/virtual-list/README.md +81 -0
- package/src/components/virtual-list/element.ts +42 -0
- package/src/components/virtual-list/engine.ts +678 -0
- package/src/components/virtual-list/react.tsx +101 -0
- package/src/components/virtual-list/virtual-list.css +194 -0
- package/src/core/chips.ts +196 -0
- package/src/core/color.ts +304 -0
- package/src/core/date-range.ts +67 -0
- package/src/core/dates.ts +11 -1
- package/src/core/files.ts +107 -0
- package/src/core/filter.ts +229 -0
- package/src/core/gsap.ts +80 -65
- package/src/core/listbox.ts +332 -0
- package/src/core/mark.ts +29 -0
- package/src/core/position.ts +89 -0
- package/src/core/relative-time.ts +77 -0
- package/src/core/segment-field.ts +373 -0
- package/src/core/segments.ts +153 -0
- package/src/core/tree.ts +116 -0
- package/src/core/virtual.ts +79 -0
- package/src/css/tokens.css +186 -182
- package/src/elements/index.ts +147 -0
- package/src/index.ts +72 -0
- package/src/motion/micro.ts +248 -0
- package/src/motion/sheet.ts +88 -65
- package/src/motion/surface.ts +9 -0
- package/src/react/index.ts +57 -0
- package/dist/chunk-IKQ5FODN.js.map +0 -1
- package/dist/chunk-J6OCFNGU.js +0 -177
- package/dist/chunk-J6OCFNGU.js.map +0 -1
- package/dist/chunk-TFNRIZHU.js +0 -3977
- package/dist/chunk-TFNRIZHU.js.map +0 -1
- package/dist/chunk-XAKC2QY7.js.map +0 -1
- package/dist/reveal-jsX-uwUz.d.ts +0 -625
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TIMING,
|
|
3
|
+
reduced
|
|
4
|
+
} from "./chunk-DOOMULVV.js";
|
|
5
|
+
import {
|
|
6
|
+
warnOnce
|
|
7
|
+
} from "./chunk-TGV27ZWM.js";
|
|
8
|
+
|
|
9
|
+
// src/motion/effects.ts
|
|
10
|
+
var ANIMATIONS = [
|
|
11
|
+
"out",
|
|
12
|
+
"out-left",
|
|
13
|
+
"out-bottom",
|
|
14
|
+
"collapse",
|
|
15
|
+
"highlight",
|
|
16
|
+
"shake",
|
|
17
|
+
"shake-strong",
|
|
18
|
+
"fade",
|
|
19
|
+
"wipe",
|
|
20
|
+
"progress-in"
|
|
21
|
+
];
|
|
22
|
+
var EXITS = /* @__PURE__ */ new Set(["out", "out-left", "out-bottom", "collapse"]);
|
|
23
|
+
function animate(el, name, { signal } = {}) {
|
|
24
|
+
const className = `mk-anim-${name}`;
|
|
25
|
+
if (!ANIMATIONS.includes(name)) {
|
|
26
|
+
warnOnce(`animate: unknown animation "${String(name)}" (use ${ANIMATIONS.join(", ")})`);
|
|
27
|
+
return Promise.resolve();
|
|
28
|
+
}
|
|
29
|
+
if (reduced()) return Promise.resolve();
|
|
30
|
+
const element = el;
|
|
31
|
+
if (name === "collapse") element.style.setProperty("--mk-collapse-from", `${element.offsetHeight}px`);
|
|
32
|
+
element.classList.remove(className);
|
|
33
|
+
void element.offsetWidth;
|
|
34
|
+
element.classList.add(className);
|
|
35
|
+
return new Promise((resolve) => {
|
|
36
|
+
const finish = (keep) => {
|
|
37
|
+
element.removeEventListener("animationend", onEnd);
|
|
38
|
+
signal?.removeEventListener("abort", onAbort);
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
if (!keep) element.classList.remove(className);
|
|
41
|
+
resolve();
|
|
42
|
+
};
|
|
43
|
+
const onEnd = (event) => {
|
|
44
|
+
if (event.animationName === `mk-${name}`) finish(EXITS.has(name));
|
|
45
|
+
};
|
|
46
|
+
const onAbort = () => finish(false);
|
|
47
|
+
element.addEventListener("animationend", onEnd);
|
|
48
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
49
|
+
const timer = setTimeout(() => finish(EXITS.has(name)), TIMING.effects[name] * 1e3 + 100);
|
|
50
|
+
if (signal?.aborted) onAbort();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async function leave(el, name, { remove = true } = {}) {
|
|
54
|
+
const focused = el.contains(document.activeElement) ? document.activeElement : null;
|
|
55
|
+
await animate(el, name);
|
|
56
|
+
focused?.blur();
|
|
57
|
+
if (remove) {
|
|
58
|
+
el.remove();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
el.hidden = true;
|
|
62
|
+
el.classList.remove(`mk-anim-${name}`);
|
|
63
|
+
el.style.removeProperty("--mk-collapse-from");
|
|
64
|
+
if (el.getAttribute("style") === "") el.removeAttribute("style");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
ANIMATIONS,
|
|
69
|
+
animate,
|
|
70
|
+
leave
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=chunk-QP4QJOEN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/motion/effects.ts"],"sourcesContent":["import { reduced } from '../core/reduced';\nimport { TIMING } from '../core/timing';\nimport { warnOnce } from '../core/types';\n\n/*\n * Play utility animations (css/effects/anim.css) from code: animate()\n * restarts one even when it is already playing and resolves when it ends;\n * leave() plays an exit and then removes (or hides) the element.\n */\n\nexport const ANIMATIONS = [\n 'out',\n 'out-left',\n 'out-bottom',\n 'collapse',\n 'highlight',\n 'shake',\n 'shake-strong',\n 'fade',\n 'wipe',\n 'progress-in',\n] as const;\nexport type AnimationName = (typeof ANIMATIONS)[number];\nexport type ExitName = 'out' | 'out-left' | 'out-bottom' | 'collapse';\n\nconst EXITS = new Set<AnimationName>(['out', 'out-left', 'out-bottom', 'collapse']);\n\nexport interface AnimateOptions {\n signal?: AbortSignal;\n}\n\nexport function animate(el: Element, name: AnimationName, { signal }: AnimateOptions = {}): Promise<void> {\n const className = `mk-anim-${name}`;\n if (!ANIMATIONS.includes(name)) {\n warnOnce(`animate: unknown animation \"${String(name)}\" (use ${ANIMATIONS.join(', ')})`);\n return Promise.resolve();\n }\n if (reduced()) return Promise.resolve();\n const element = el as HTMLElement;\n if (name === 'collapse') element.style.setProperty('--mk-collapse-from', `${element.offsetHeight}px`);\n // Off, reflow, on: the browser starts the animation over.\n element.classList.remove(className);\n void element.offsetWidth;\n element.classList.add(className);\n return new Promise((resolve) => {\n const finish = (keep: boolean) => {\n element.removeEventListener('animationend', onEnd);\n signal?.removeEventListener('abort', onAbort);\n clearTimeout(timer);\n if (!keep) element.classList.remove(className);\n resolve();\n };\n const onEnd = (event: Event) => {\n if ((event as AnimationEvent).animationName === `mk-${name}`) finish(EXITS.has(name));\n };\n const onAbort = () => finish(false);\n element.addEventListener('animationend', onEnd);\n signal?.addEventListener('abort', onAbort, { once: true });\n const timer = setTimeout(() => finish(EXITS.has(name)), TIMING.effects[name] * 1000 + 100);\n if (signal?.aborted) onAbort();\n });\n}\n\nexport interface LeaveOptions {\n /** Remove the element (default) or hide it. */\n remove?: boolean;\n}\n\nexport async function leave(el: Element, name: ExitName, { remove = true }: LeaveOptions = {}): Promise<void> {\n const focused = el.contains(document.activeElement) ? (document.activeElement as HTMLElement) : null;\n await animate(el, name);\n focused?.blur();\n if (remove) {\n el.remove();\n return;\n }\n (el as HTMLElement).hidden = true;\n el.classList.remove(`mk-anim-${name}`);\n (el as HTMLElement).style.removeProperty('--mk-collapse-from');\n if (el.getAttribute('style') === '') el.removeAttribute('style');\n}\n"],"mappings":";;;;;;;;;AAUO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,IAAM,QAAQ,oBAAI,IAAmB,CAAC,OAAO,YAAY,cAAc,UAAU,CAAC;AAM3E,SAAS,QAAQ,IAAa,MAAqB,EAAE,OAAO,IAAoB,CAAC,GAAkB;AACxG,QAAM,YAAY,WAAW,IAAI;AACjC,MAAI,CAAC,WAAW,SAAS,IAAI,GAAG;AAC9B,aAAS,+BAA+B,OAAO,IAAI,CAAC,UAAU,WAAW,KAAK,IAAI,CAAC,GAAG;AACtF,WAAO,QAAQ,QAAQ;AAAA,EACzB;AACA,MAAI,QAAQ,EAAG,QAAO,QAAQ,QAAQ;AACtC,QAAM,UAAU;AAChB,MAAI,SAAS,WAAY,SAAQ,MAAM,YAAY,sBAAsB,GAAG,QAAQ,YAAY,IAAI;AAEpG,UAAQ,UAAU,OAAO,SAAS;AAClC,OAAK,QAAQ;AACb,UAAQ,UAAU,IAAI,SAAS;AAC/B,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,SAAS,CAAC,SAAkB;AAChC,cAAQ,oBAAoB,gBAAgB,KAAK;AACjD,cAAQ,oBAAoB,SAAS,OAAO;AAC5C,mBAAa,KAAK;AAClB,UAAI,CAAC,KAAM,SAAQ,UAAU,OAAO,SAAS;AAC7C,cAAQ;AAAA,IACV;AACA,UAAM,QAAQ,CAAC,UAAiB;AAC9B,UAAK,MAAyB,kBAAkB,MAAM,IAAI,GAAI,QAAO,MAAM,IAAI,IAAI,CAAC;AAAA,IACtF;AACA,UAAM,UAAU,MAAM,OAAO,KAAK;AAClC,YAAQ,iBAAiB,gBAAgB,KAAK;AAC9C,YAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AACzD,UAAM,QAAQ,WAAW,MAAM,OAAO,MAAM,IAAI,IAAI,CAAC,GAAG,OAAO,QAAQ,IAAI,IAAI,MAAO,GAAG;AACzF,QAAI,QAAQ,QAAS,SAAQ;AAAA,EAC/B,CAAC;AACH;AAOA,eAAsB,MAAM,IAAa,MAAgB,EAAE,SAAS,KAAK,IAAkB,CAAC,GAAkB;AAC5G,QAAM,UAAU,GAAG,SAAS,SAAS,aAAa,IAAK,SAAS,gBAAgC;AAChG,QAAM,QAAQ,IAAI,IAAI;AACtB,WAAS,KAAK;AACd,MAAI,QAAQ;AACV,OAAG,OAAO;AACV;AAAA,EACF;AACA,EAAC,GAAmB,SAAS;AAC7B,KAAG,UAAU,OAAO,WAAW,IAAI,EAAE;AACrC,EAAC,GAAmB,MAAM,eAAe,oBAAoB;AAC7D,MAAI,GAAG,aAAa,OAAO,MAAM,GAAI,IAAG,gBAAgB,OAAO;AACjE;","names":[]}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/* components/activity-feed/activity-feed.css */
|
|
2
|
+
/* activity-feed — day headings in small caps, entries on 12 px rows: a 2.25rem avatar (a picture, or initials on a hue
|
|
3
|
+
from the name) with a badge for the kind of action, the sentence, a quote on surface-3, a muted time. New entries
|
|
4
|
+
keep an accent-soft highlight that fades; the "novedades" pill sticks to the top. Give the root a max-height (or
|
|
5
|
+
--mk-af-height) to scroll inside it. */
|
|
6
|
+
.mk-activity-feed,
|
|
7
|
+
mk-activity-feed {
|
|
8
|
+
--mk-af-height: none;
|
|
9
|
+
--mk-af-avatar-l: 86%;
|
|
10
|
+
--mk-af-avatar-ink-l: 28%;
|
|
11
|
+
position: relative;
|
|
12
|
+
display: block;
|
|
13
|
+
max-height: var(--mk-af-height);
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
overscroll-behavior: contain;
|
|
16
|
+
color: var(--mk-text);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
:where(:root:not([data-mk-mode='light'])) :is(.mk-activity-feed, mk-activity-feed) {
|
|
21
|
+
--mk-af-avatar-l: 28%;
|
|
22
|
+
--mk-af-avatar-ink-l: 86%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(:root[data-mk-mode='dark']) :is(.mk-activity-feed, mk-activity-feed) {
|
|
27
|
+
--mk-af-avatar-l: 28%;
|
|
28
|
+
--mk-af-avatar-ink-l: 86%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-mk-af-new] {
|
|
32
|
+
position: sticky;
|
|
33
|
+
top: 0.5rem;
|
|
34
|
+
z-index: 2;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 0.15rem;
|
|
38
|
+
width: max-content;
|
|
39
|
+
height: 2rem;
|
|
40
|
+
margin: 0 auto 0.5rem;
|
|
41
|
+
padding: 0 0.9rem;
|
|
42
|
+
border: 0;
|
|
43
|
+
border-radius: 999px;
|
|
44
|
+
background: var(--mk-accent);
|
|
45
|
+
color: var(--mk-on-accent);
|
|
46
|
+
box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--mk-shadow-color, #000) 45%, transparent);
|
|
47
|
+
font: inherit;
|
|
48
|
+
font-size: 0.8125rem;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-mk-af-new][hidden] {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-mk-af-day] + [data-mk-af-day] {
|
|
58
|
+
margin-top: 1rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Section > heading: strong enough for a page's own h3 rules (a card's `.card h3`, say). */
|
|
62
|
+
[data-mk-af-day] > [data-mk-af-heading] {
|
|
63
|
+
margin: 0 0 0.35rem;
|
|
64
|
+
padding: 0 0.5rem;
|
|
65
|
+
color: var(--mk-muted);
|
|
66
|
+
font-size: 0.75rem;
|
|
67
|
+
font-weight: 700;
|
|
68
|
+
letter-spacing: 0.04em;
|
|
69
|
+
text-transform: uppercase;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-mk-af-day] ul {
|
|
73
|
+
display: grid;
|
|
74
|
+
gap: 0.15rem;
|
|
75
|
+
margin: 0;
|
|
76
|
+
padding: 0;
|
|
77
|
+
list-style: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-mk-af-item] {
|
|
81
|
+
display: grid;
|
|
82
|
+
grid-template-columns: 2.25rem minmax(0, 1fr);
|
|
83
|
+
gap: 0.75rem;
|
|
84
|
+
padding: 0.6rem 0.5rem;
|
|
85
|
+
border-radius: 12px;
|
|
86
|
+
outline: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
[data-mk-af-item]:focus-visible {
|
|
90
|
+
box-shadow: inset 0 0 0 2px var(--mk-accent);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-mk-af-item][data-mk-fresh] {
|
|
94
|
+
animation: mk-af-fresh 2.4s ease-out both;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes mk-af-fresh {
|
|
98
|
+
from {
|
|
99
|
+
background: color-mix(in srgb, var(--mk-accent-soft) 90%, transparent);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
to {
|
|
103
|
+
background: transparent;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[data-mk-af-avatar] {
|
|
108
|
+
position: relative;
|
|
109
|
+
display: grid;
|
|
110
|
+
place-items: center;
|
|
111
|
+
width: 2.25rem;
|
|
112
|
+
height: 2.25rem;
|
|
113
|
+
border-radius: 50%;
|
|
114
|
+
background: hsl(var(--mk-af-hue, 210) 55% var(--mk-af-avatar-l));
|
|
115
|
+
color: hsl(var(--mk-af-hue, 210) 50% var(--mk-af-avatar-ink-l));
|
|
116
|
+
font-size: 0.8125rem;
|
|
117
|
+
font-weight: 700;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-mk-af-avatar] img {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 100%;
|
|
123
|
+
border-radius: 50%;
|
|
124
|
+
object-fit: cover;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-mk-af-badge] {
|
|
128
|
+
position: absolute;
|
|
129
|
+
right: -3px;
|
|
130
|
+
bottom: -3px;
|
|
131
|
+
display: grid;
|
|
132
|
+
place-items: center;
|
|
133
|
+
width: 1.05rem;
|
|
134
|
+
height: 1.05rem;
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
background: var(--mk-text);
|
|
137
|
+
color: var(--mk-surface-1, var(--mk-bg));
|
|
138
|
+
box-shadow: 0 0 0 2px var(--mk-surface-1, var(--mk-bg));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[data-mk-af-badge='comment'],
|
|
142
|
+
[data-mk-af-badge='mention'] {
|
|
143
|
+
background: var(--mk-accent);
|
|
144
|
+
color: var(--mk-on-accent);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-mk-af-badge='complete'] {
|
|
148
|
+
background: #1f9d5b;
|
|
149
|
+
color: #fff;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[data-mk-af-badge='delete'] {
|
|
153
|
+
background: var(--mk-error, #c62828);
|
|
154
|
+
color: var(--mk-on-error, #fff);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
[data-mk-af-line] {
|
|
158
|
+
margin: 0;
|
|
159
|
+
font-size: 0.9375rem;
|
|
160
|
+
line-height: 1.45;
|
|
161
|
+
overflow-wrap: anywhere;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
[data-mk-af-line] b {
|
|
165
|
+
font-weight: 600;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
[data-mk-af-target] {
|
|
169
|
+
color: inherit;
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
text-decoration: underline;
|
|
172
|
+
text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
|
|
173
|
+
text-underline-offset: 3px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
a[data-mk-af-target]:hover {
|
|
177
|
+
text-decoration-color: currentColor;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
[data-mk-af-detail] {
|
|
181
|
+
margin: 0.4rem 0 0;
|
|
182
|
+
padding: 0.5rem 0.75rem;
|
|
183
|
+
border-radius: 10px;
|
|
184
|
+
background: var(--mk-surface-3);
|
|
185
|
+
font-size: 0.875rem;
|
|
186
|
+
line-height: 1.5;
|
|
187
|
+
overflow-wrap: anywhere;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-mk-af-time] {
|
|
191
|
+
display: block;
|
|
192
|
+
margin-top: 0.2rem;
|
|
193
|
+
color: var(--mk-muted);
|
|
194
|
+
font-size: 0.75rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
[data-mk-af-more] {
|
|
198
|
+
display: block;
|
|
199
|
+
height: 2.25rem;
|
|
200
|
+
margin: 0.75rem auto 0;
|
|
201
|
+
padding: 0 1rem;
|
|
202
|
+
border: 0;
|
|
203
|
+
border-radius: 10px;
|
|
204
|
+
background: var(--mk-surface-3);
|
|
205
|
+
color: var(--mk-text);
|
|
206
|
+
font: inherit;
|
|
207
|
+
font-size: 0.875rem;
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[data-mk-af-more][hidden],
|
|
213
|
+
[data-mk-af-empty][hidden] {
|
|
214
|
+
display: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
[data-mk-af-more][aria-busy='true'] {
|
|
218
|
+
cursor: progress;
|
|
219
|
+
opacity: 0.7;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
[data-mk-af-more]:focus-visible,
|
|
223
|
+
[data-mk-af-new]:focus-visible {
|
|
224
|
+
outline: 2px solid var(--mk-accent);
|
|
225
|
+
outline-offset: 2px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
[data-mk-af-end],
|
|
229
|
+
[data-mk-af-empty] {
|
|
230
|
+
margin: 0.75rem 0 0;
|
|
231
|
+
color: var(--mk-muted);
|
|
232
|
+
font-size: 0.875rem;
|
|
233
|
+
text-align: center;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
@media (prefers-reduced-motion: reduce) {
|
|
237
|
+
[data-mk-af-item][data-mk-fresh] {
|
|
238
|
+
animation: none;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/* components/attachment/attachment.css */
|
|
2
|
+
/* attachment — a soft dashed drop zone and file cards with progress (Melon Mind surfaces: 16–24 px radius). */
|
|
3
|
+
.mk-attachment,
|
|
4
|
+
mk-attachment {
|
|
5
|
+
--mk-attachment-radius: var(--mk-radius-lg, 24px);
|
|
6
|
+
--mk-attachment-accent: var(--mk-accent);
|
|
7
|
+
display: grid;
|
|
8
|
+
gap: 0.75rem;
|
|
9
|
+
color: var(--mk-text);
|
|
10
|
+
font-family: var(--mk-font);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: grid;
|
|
16
|
+
justify-items: center;
|
|
17
|
+
gap: 0.35rem;
|
|
18
|
+
padding: 1.75rem 1.25rem;
|
|
19
|
+
border: 1.5px dashed var(--mk-outline-soft);
|
|
20
|
+
border-radius: var(--mk-attachment-radius);
|
|
21
|
+
background: var(--mk-surface-2);
|
|
22
|
+
text-align: center;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition:
|
|
25
|
+
background-color 0.2s ease,
|
|
26
|
+
border-color 0.2s ease,
|
|
27
|
+
transform 0.25s var(--mk-ease-press, ease);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop]:hover,
|
|
31
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop][data-mk-dragging] {
|
|
32
|
+
border-color: var(--mk-outline);
|
|
33
|
+
background: var(--mk-surface-3);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop][data-mk-dragging] {
|
|
37
|
+
transform: scale(1.015);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop]:active {
|
|
41
|
+
transform: scale(0.99);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop]:has(input:focus-visible) {
|
|
45
|
+
outline: 2px solid var(--mk-accent);
|
|
46
|
+
outline-offset: 3px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:is(.mk-attachment, mk-attachment)[data-mk-disabled] [data-mk-attachment-drop] {
|
|
50
|
+
opacity: 0.5;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
transform: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] input[type='file'] {
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 1px;
|
|
58
|
+
height: 1px;
|
|
59
|
+
opacity: 0;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] [data-mk-part='icon'] {
|
|
64
|
+
display: grid;
|
|
65
|
+
place-items: center;
|
|
66
|
+
width: 2.75rem;
|
|
67
|
+
height: 2.75rem;
|
|
68
|
+
margin-bottom: 0.25rem;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
background: var(--mk-text);
|
|
71
|
+
color: var(--mk-bg);
|
|
72
|
+
transition: translate 0.4s cubic-bezier(0.38, 0.49, 0, 2);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop]:is(:hover, [data-mk-dragging]) [data-mk-part='icon'] {
|
|
76
|
+
translate: 0 -4px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] [data-mk-part='icon']::before {
|
|
80
|
+
content: '';
|
|
81
|
+
width: 1.25rem;
|
|
82
|
+
height: 1.25rem;
|
|
83
|
+
background: currentColor;
|
|
84
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6.5 9.5 12 4l5.5 5.5M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] strong {
|
|
88
|
+
color: var(--mk-text);
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
text-decoration: underline;
|
|
91
|
+
text-underline-offset: 0.2em;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-drop] small {
|
|
95
|
+
color: var(--mk-muted);
|
|
96
|
+
font-size: 0.8125rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-list] {
|
|
100
|
+
display: grid;
|
|
101
|
+
gap: 0.5rem;
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding: 0;
|
|
104
|
+
list-style: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-list]:empty {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-item] {
|
|
112
|
+
display: grid;
|
|
113
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: 0.875rem;
|
|
116
|
+
padding: 0.625rem 0.625rem 0.625rem 0.75rem;
|
|
117
|
+
border-radius: calc(var(--mk-attachment-radius) - 8px);
|
|
118
|
+
background: var(--mk-surface-1);
|
|
119
|
+
box-shadow: inset 0 0 0 1px var(--mk-outline-soft);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-item][data-mk-status='error'] {
|
|
123
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mk-error) 45%, transparent);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-item] [data-mk-part='thumb'] {
|
|
127
|
+
display: grid;
|
|
128
|
+
place-items: center;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
width: 2.75rem;
|
|
131
|
+
height: 2.75rem;
|
|
132
|
+
border-radius: 0.875rem;
|
|
133
|
+
background: var(--mk-surface-3);
|
|
134
|
+
color: var(--mk-muted);
|
|
135
|
+
font-size: 0.6875rem;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
letter-spacing: 0.04em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:is(.mk-attachment, mk-attachment) [data-mk-part='thumb'] img {
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 100%;
|
|
143
|
+
object-fit: cover;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:is(.mk-attachment, mk-attachment) [data-mk-part='meta'] {
|
|
147
|
+
display: grid;
|
|
148
|
+
gap: 0.15rem;
|
|
149
|
+
min-width: 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:is(.mk-attachment, mk-attachment) [data-mk-part='name'] {
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
font-weight: 500;
|
|
155
|
+
text-overflow: ellipsis;
|
|
156
|
+
white-space: nowrap;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:is(.mk-attachment, mk-attachment) [data-mk-part='detail'] {
|
|
160
|
+
color: var(--mk-muted);
|
|
161
|
+
font-size: 0.8125rem;
|
|
162
|
+
font-variant-numeric: tabular-nums;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
:is(.mk-attachment, mk-attachment) [data-mk-status='complete'] [data-mk-part='detail'] {
|
|
166
|
+
color: var(--mk-accent);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:is(.mk-attachment, mk-attachment) [data-mk-status='error'] [data-mk-part='detail'] {
|
|
170
|
+
color: var(--mk-error);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
:is(.mk-attachment, mk-attachment) progress {
|
|
174
|
+
width: 100%;
|
|
175
|
+
height: 4px;
|
|
176
|
+
margin-top: 0.3rem;
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
border: 0;
|
|
179
|
+
border-radius: var(--mk-radius-full);
|
|
180
|
+
background: var(--mk-surface-4);
|
|
181
|
+
appearance: none;
|
|
182
|
+
accent-color: var(--mk-attachment-accent);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:is(.mk-attachment, mk-attachment) progress[hidden] {
|
|
186
|
+
display: none;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:is(.mk-attachment, mk-attachment) progress::-webkit-progress-bar {
|
|
190
|
+
background: transparent;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
:is(.mk-attachment, mk-attachment) progress::-webkit-progress-value {
|
|
194
|
+
border-radius: inherit;
|
|
195
|
+
background: var(--mk-attachment-accent);
|
|
196
|
+
transition: width 0.3s ease;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:is(.mk-attachment, mk-attachment) progress::-moz-progress-bar {
|
|
200
|
+
border-radius: inherit;
|
|
201
|
+
background: var(--mk-attachment-accent);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-remove] {
|
|
205
|
+
display: grid;
|
|
206
|
+
place-items: center;
|
|
207
|
+
width: 2.5rem;
|
|
208
|
+
height: 2.5rem;
|
|
209
|
+
padding: 0;
|
|
210
|
+
border: 0;
|
|
211
|
+
border-radius: 50%;
|
|
212
|
+
background: transparent;
|
|
213
|
+
color: var(--mk-muted);
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
transition:
|
|
216
|
+
background-color 0.2s ease,
|
|
217
|
+
color 0.2s ease,
|
|
218
|
+
transform 0.2s var(--mk-ease-press, ease);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-remove]:hover:not(:disabled) {
|
|
222
|
+
background: color-mix(in srgb, var(--mk-error) 12%, transparent);
|
|
223
|
+
color: var(--mk-error);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-remove]:active:not(:disabled) {
|
|
227
|
+
transform: scale(0.9);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-remove]:focus-visible {
|
|
231
|
+
outline: 2px solid var(--mk-accent);
|
|
232
|
+
outline-offset: 2px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-remove]:disabled {
|
|
236
|
+
opacity: 0.4;
|
|
237
|
+
cursor: not-allowed;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-error] {
|
|
241
|
+
margin: 0;
|
|
242
|
+
padding: 0.625rem 0.875rem;
|
|
243
|
+
border-radius: var(--mk-radius-lg);
|
|
244
|
+
background: var(--mk-error-soft);
|
|
245
|
+
color: var(--mk-on-error-soft);
|
|
246
|
+
font-size: 0.875rem;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:is(.mk-attachment, mk-attachment) [data-mk-attachment-error][hidden] {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@keyframes mk-attachment-in {
|
|
254
|
+
from {
|
|
255
|
+
opacity: 0;
|
|
256
|
+
transform: translateY(6px) scale(0.98);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@media (prefers-reduced-motion: reduce) {
|
|
261
|
+
:is(.mk-attachment, mk-attachment) :is([data-mk-attachment-drop], [data-mk-attachment-item], [data-mk-attachment-remove]) {
|
|
262
|
+
transition: none;
|
|
263
|
+
animation: none;
|
|
264
|
+
transform: none !important;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/* components/breadcrumb/breadcrumb.css */
|
|
2
|
+
/* breadcrumb — muted links separated by chevrons, the current page in the text colour; links underline from the left
|
|
3
|
+
on hover (.25 s, wipe curve); the folded middle is a small 8 px "…" button on surface-3. The row never scrolls: it
|
|
4
|
+
folds, and the current page ellipsizes as a last resort. */
|
|
5
|
+
.mk-breadcrumb,
|
|
6
|
+
mk-breadcrumb {
|
|
7
|
+
display: block;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-mk-breadcrumb-list] {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: 0.25rem;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
color: var(--mk-muted);
|
|
21
|
+
font-size: 0.875rem;
|
|
22
|
+
line-height: 1.4;
|
|
23
|
+
list-style: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[data-mk-breadcrumb-nav][data-mk-expanded] [data-mk-breadcrumb-list] {
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
overflow: visible;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-mk-crumb] {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
flex: none;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 0.25rem;
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-mk-crumb]:last-child {
|
|
40
|
+
flex: 0 1 auto;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* While the engine measures, the current page keeps its full width. */
|
|
44
|
+
[data-mk-breadcrumb-nav][data-mk-measuring] [data-mk-crumb]:last-child {
|
|
45
|
+
flex: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-mk-crumb] + [data-mk-crumb]::before {
|
|
49
|
+
content: '';
|
|
50
|
+
flex: none;
|
|
51
|
+
width: 1rem;
|
|
52
|
+
height: 1rem;
|
|
53
|
+
background: currentColor;
|
|
54
|
+
opacity: 0.6;
|
|
55
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1rem no-repeat;
|
|
56
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 1rem no-repeat;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-mk-crumb-link] {
|
|
60
|
+
padding: 0.15rem 0;
|
|
61
|
+
background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
|
|
62
|
+
color: inherit;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
transition: background-size 0.25s cubic-bezier(0.38, 0.49, 0, 1), color 0.2s ease;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[data-mk-crumb-link]:hover {
|
|
68
|
+
background-size: 100% 1px;
|
|
69
|
+
color: var(--mk-text);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-mk-crumb-link]:focus-visible,
|
|
73
|
+
[data-mk-crumb-more]:focus-visible {
|
|
74
|
+
border-radius: 6px;
|
|
75
|
+
outline: 2px solid var(--mk-accent);
|
|
76
|
+
outline-offset: 2px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
[data-mk-crumb-current] {
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
color: var(--mk-text);
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[data-mk-crumb-more] {
|
|
88
|
+
height: 1.5rem;
|
|
89
|
+
padding: 0 0.45rem;
|
|
90
|
+
border: 0;
|
|
91
|
+
border-radius: 8px;
|
|
92
|
+
background: var(--mk-surface-3);
|
|
93
|
+
color: inherit;
|
|
94
|
+
font: inherit;
|
|
95
|
+
line-height: 1;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[data-mk-crumb-more]:hover {
|
|
101
|
+
background: var(--mk-surface-4, var(--mk-surface-3));
|
|
102
|
+
color: var(--mk-text);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@media (prefers-reduced-motion: reduce) {
|
|
106
|
+
[data-mk-crumb-link],
|
|
107
|
+
[data-mk-crumb-more] {
|
|
108
|
+
transition: none;
|
|
109
|
+
}
|
|
110
|
+
}
|