@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,168 @@
|
|
|
1
|
+
/* components/chart-tooltip/chart-tooltip.css */
|
|
2
|
+
/* chart-tooltip — an overlay on the chart it wraps: a dotted guide, 10 px markers ringed in the surface colour and
|
|
3
|
+
a 12 px card in Melon Mind's inverse glass (label, rows with a swatch, value, change and share, a total). */
|
|
4
|
+
.mk-chart-tooltip,
|
|
5
|
+
mk-chart-tooltip {
|
|
6
|
+
/* The chart palette (same as chart.css), so series over any chart get their colours without it. */
|
|
7
|
+
--mk-chart-mono: var(--mk-text);
|
|
8
|
+
--mk-chart-1: #2a78d6;
|
|
9
|
+
--mk-chart-2: #eb6834;
|
|
10
|
+
--mk-chart-3: #1baf7a;
|
|
11
|
+
--mk-chart-4: #eda100;
|
|
12
|
+
--mk-chart-5: #e87ba4;
|
|
13
|
+
--mk-chart-6: #008300;
|
|
14
|
+
--mk-chart-7: #6250d6;
|
|
15
|
+
--mk-chart-8: #e34948;
|
|
16
|
+
position: relative;
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (prefers-color-scheme: dark) {
|
|
21
|
+
:where(:root:not([data-mk-mode='light'])) :is(.mk-chart-tooltip, mk-chart-tooltip) {
|
|
22
|
+
--mk-chart-1: #3987e5;
|
|
23
|
+
--mk-chart-2: #d95926;
|
|
24
|
+
--mk-chart-3: #199e70;
|
|
25
|
+
--mk-chart-4: #c98500;
|
|
26
|
+
--mk-chart-5: #d55181;
|
|
27
|
+
--mk-chart-6: #008300;
|
|
28
|
+
--mk-chart-7: #9085e9;
|
|
29
|
+
--mk-chart-8: #e66767;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(:root[data-mk-mode='dark']) :is(.mk-chart-tooltip, mk-chart-tooltip) {
|
|
34
|
+
--mk-chart-1: #3987e5;
|
|
35
|
+
--mk-chart-2: #d95926;
|
|
36
|
+
--mk-chart-3: #199e70;
|
|
37
|
+
--mk-chart-4: #c98500;
|
|
38
|
+
--mk-chart-5: #d55181;
|
|
39
|
+
--mk-chart-6: #008300;
|
|
40
|
+
--mk-chart-7: #9085e9;
|
|
41
|
+
--mk-chart-8: #e66767;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:is(.mk-chart-tooltip, mk-chart-tooltip):focus-visible {
|
|
45
|
+
border-radius: 12px;
|
|
46
|
+
outline: 2px solid var(--mk-accent);
|
|
47
|
+
outline-offset: 4px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-mk-ct-layer] {
|
|
51
|
+
position: absolute;
|
|
52
|
+
inset: 0;
|
|
53
|
+
z-index: 3;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[data-mk-ct-guide] {
|
|
58
|
+
position: absolute;
|
|
59
|
+
left: 0;
|
|
60
|
+
width: 0;
|
|
61
|
+
border-left: 1.5px dotted var(--mk-muted);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
[data-mk-ct-marker] {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: -5px;
|
|
67
|
+
left: -5px;
|
|
68
|
+
width: 10px;
|
|
69
|
+
height: 10px;
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
box-shadow: 0 0 0 2.5px var(--mk-surface-1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-mk-ct-card] {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
display: grid;
|
|
79
|
+
gap: 0.35rem;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
min-width: 11rem;
|
|
82
|
+
max-width: min(18rem, calc(100% - 8px));
|
|
83
|
+
padding: 0.65rem 0.8rem;
|
|
84
|
+
border-radius: 12px;
|
|
85
|
+
background: var(--mk-glass-inverse, rgb(24 24 24 / 0.9));
|
|
86
|
+
color: var(--mk-on-glass-inverse, #fff);
|
|
87
|
+
box-shadow: var(--mk-glass-bevel, 0 12px 32px -12px rgb(0 0 0 / 0.4));
|
|
88
|
+
font-size: 0.8125rem;
|
|
89
|
+
line-height: 1.3;
|
|
90
|
+
-webkit-backdrop-filter: blur(16px);
|
|
91
|
+
backdrop-filter: blur(16px);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[data-mk-ct-card][hidden],
|
|
95
|
+
[data-mk-ct-guide][hidden],
|
|
96
|
+
[data-mk-ct-marker][hidden],
|
|
97
|
+
[data-mk-ct-pin][hidden],
|
|
98
|
+
[data-mk-ct-delta][hidden] {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
[data-mk-ct-head] {
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
gap: 0.5rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-mk-ct-title] {
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
text-overflow: ellipsis;
|
|
113
|
+
white-space: nowrap;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-mk-ct-pin] {
|
|
117
|
+
display: inline-grid;
|
|
118
|
+
place-items: center;
|
|
119
|
+
opacity: 0.8;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-mk-ct-rows] {
|
|
123
|
+
display: grid;
|
|
124
|
+
gap: 0.3rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-mk-ct-row] {
|
|
128
|
+
display: grid;
|
|
129
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
130
|
+
align-items: center;
|
|
131
|
+
column-gap: 0.5rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-mk-ct-swatch] {
|
|
135
|
+
width: 0.6rem;
|
|
136
|
+
height: 0.6rem;
|
|
137
|
+
border-radius: 3px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-mk-ct-swatch][data-mk-mono] {
|
|
141
|
+
height: 2px;
|
|
142
|
+
border-radius: 1px;
|
|
143
|
+
background: currentColor;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-mk-ct-name] {
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
text-overflow: ellipsis;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[data-mk-ct-value] {
|
|
153
|
+
font-variant-numeric: tabular-nums;
|
|
154
|
+
font-weight: 600;
|
|
155
|
+
text-align: end;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-mk-ct-delta] {
|
|
159
|
+
grid-column: 2 / -1;
|
|
160
|
+
font-size: 0.75rem;
|
|
161
|
+
font-variant-numeric: tabular-nums;
|
|
162
|
+
opacity: 0.78;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
[data-mk-ct-row='total'] {
|
|
166
|
+
padding-top: 0.3rem;
|
|
167
|
+
border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
|
|
168
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/* components/chart/chart.css */
|
|
2
|
+
/* chart — Melon Mind's Indicadores: a monochrome line on the surface, the baseline only, the last value in a pill,
|
|
3
|
+
a dotted guide, the inverse glass tooltip and outlined legend pills.
|
|
4
|
+
Several series use --mk-chart-1…8 (a colour-blind-checked order, light and dark steps). */
|
|
5
|
+
.mk-chart,
|
|
6
|
+
mk-chart {
|
|
7
|
+
--mk-chart-mono: var(--mk-text);
|
|
8
|
+
--mk-chart-1: #2a78d6;
|
|
9
|
+
--mk-chart-2: #eb6834;
|
|
10
|
+
--mk-chart-3: #1baf7a;
|
|
11
|
+
--mk-chart-4: #eda100;
|
|
12
|
+
--mk-chart-5: #e87ba4;
|
|
13
|
+
--mk-chart-6: #008300;
|
|
14
|
+
--mk-chart-7: #6250d6;
|
|
15
|
+
--mk-chart-8: #e34948;
|
|
16
|
+
--mk-chart-other: var(--mk-muted);
|
|
17
|
+
--mk-chart-surface: var(--mk-surface-1);
|
|
18
|
+
--mk-chart-grid: color-mix(in srgb, var(--mk-text) 14%, transparent);
|
|
19
|
+
position: relative;
|
|
20
|
+
display: grid;
|
|
21
|
+
gap: 0.75rem;
|
|
22
|
+
min-width: 0;
|
|
23
|
+
color: var(--mk-text);
|
|
24
|
+
font-family: var(--mk-font);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (prefers-color-scheme: dark) {
|
|
28
|
+
:where(:root:not([data-mk-mode='light'])) :is(.mk-chart, mk-chart) {
|
|
29
|
+
--mk-chart-1: #3987e5;
|
|
30
|
+
--mk-chart-2: #d95926;
|
|
31
|
+
--mk-chart-3: #199e70;
|
|
32
|
+
--mk-chart-4: #c98500;
|
|
33
|
+
--mk-chart-5: #d55181;
|
|
34
|
+
--mk-chart-6: #008300;
|
|
35
|
+
--mk-chart-7: #9085e9;
|
|
36
|
+
--mk-chart-8: #e66767;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:where(:root[data-mk-mode='dark']) :is(.mk-chart, mk-chart) {
|
|
41
|
+
--mk-chart-1: #3987e5;
|
|
42
|
+
--mk-chart-2: #d95926;
|
|
43
|
+
--mk-chart-3: #199e70;
|
|
44
|
+
--mk-chart-4: #c98500;
|
|
45
|
+
--mk-chart-5: #d55181;
|
|
46
|
+
--mk-chart-6: #008300;
|
|
47
|
+
--mk-chart-7: #9085e9;
|
|
48
|
+
--mk-chart-8: #e66767;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-plot] {
|
|
52
|
+
position: relative;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-plot][hidden] {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-svg] {
|
|
61
|
+
display: block;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: auto;
|
|
64
|
+
overflow: visible;
|
|
65
|
+
touch-action: pan-y;
|
|
66
|
+
border-radius: 12px;
|
|
67
|
+
cursor: crosshair;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-svg]:focus {
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-svg]:focus-visible {
|
|
75
|
+
outline: 2px solid var(--mk-accent);
|
|
76
|
+
outline-offset: 4px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:is(.mk-chart, mk-chart) [data-mk-part='grid'] line {
|
|
80
|
+
stroke: var(--mk-chart-grid);
|
|
81
|
+
stroke-width: 1;
|
|
82
|
+
shape-rendering: crispEdges;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:is(.mk-chart, mk-chart) [data-mk-part='grid'] line[data-mk-zero] {
|
|
86
|
+
stroke: color-mix(in srgb, var(--mk-text) 22%, transparent);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:is(.mk-chart, mk-chart) text {
|
|
90
|
+
fill: var(--mk-muted);
|
|
91
|
+
font-size: 11px;
|
|
92
|
+
font-variant-numeric: tabular-nums;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:is(.mk-chart, mk-chart) [data-mk-part='total'] {
|
|
96
|
+
fill: var(--mk-text);
|
|
97
|
+
font-size: 10px;
|
|
98
|
+
font-weight: 500;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:is(.mk-chart, mk-chart) [data-mk-part='line'] {
|
|
102
|
+
fill: none;
|
|
103
|
+
stroke-linecap: round;
|
|
104
|
+
stroke-linejoin: round;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:is(.mk-chart, mk-chart) :is([data-mk-part='dot'], [data-mk-part='marker'], [data-mk-part='end']) {
|
|
108
|
+
stroke: var(--mk-chart-surface);
|
|
109
|
+
stroke-width: 2.5;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* The selection guide: Melonmind's dotted day line. */
|
|
113
|
+
:is(.mk-chart, mk-chart) [data-mk-part='guide'] {
|
|
114
|
+
stroke: color-mix(in srgb, var(--mk-text) 45%, transparent);
|
|
115
|
+
stroke-width: 1;
|
|
116
|
+
stroke-dasharray: 2 4;
|
|
117
|
+
shape-rendering: crispEdges;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:is(.mk-chart, mk-chart) [data-mk-part='band'] {
|
|
121
|
+
fill: color-mix(in srgb, var(--mk-text) 6%, transparent);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:is(.mk-chart, mk-chart) [data-mk-part='series'] path[data-mk-index] {
|
|
125
|
+
transition: opacity 0.2s ease;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:is(.mk-chart, mk-chart) [data-mk-part='series'] path[data-mk-dim] {
|
|
129
|
+
opacity: 0.35;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* The last value. */
|
|
133
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-end] {
|
|
134
|
+
position: absolute;
|
|
135
|
+
top: 0;
|
|
136
|
+
left: 0;
|
|
137
|
+
padding: 0.15rem 0.55rem;
|
|
138
|
+
border-radius: var(--mk-radius-full);
|
|
139
|
+
background: var(--mk-surface-3);
|
|
140
|
+
color: var(--mk-text);
|
|
141
|
+
font-size: 0.75rem;
|
|
142
|
+
font-weight: 500;
|
|
143
|
+
font-variant-numeric: tabular-nums;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
pointer-events: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-end][hidden] {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* Tooltip: the inverse glass, 12 px radius, 8 × 12 padding (Melonmind). */
|
|
153
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-tooltip] {
|
|
154
|
+
position: absolute;
|
|
155
|
+
top: 0;
|
|
156
|
+
left: 0;
|
|
157
|
+
z-index: 2;
|
|
158
|
+
display: grid;
|
|
159
|
+
gap: 0.2rem;
|
|
160
|
+
min-width: 8rem;
|
|
161
|
+
max-width: 16rem;
|
|
162
|
+
padding: 0.5rem 0.75rem;
|
|
163
|
+
border-radius: 12px;
|
|
164
|
+
background: var(--mk-glass-inverse);
|
|
165
|
+
box-shadow: var(--mk-glass-bevel);
|
|
166
|
+
backdrop-filter: blur(16px);
|
|
167
|
+
color: var(--mk-on-glass-inverse);
|
|
168
|
+
font-size: 0.8125rem;
|
|
169
|
+
line-height: 1.3;
|
|
170
|
+
pointer-events: none;
|
|
171
|
+
transform-origin: 50% 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-tooltip][hidden] {
|
|
175
|
+
display: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-tooltip] strong {
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row] {
|
|
183
|
+
display: grid;
|
|
184
|
+
grid-template-columns: 0.6rem minmax(0, 1fr) auto;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 0.5rem;
|
|
187
|
+
opacity: 0.9;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row] i {
|
|
191
|
+
width: 0.6rem;
|
|
192
|
+
height: 0.6rem;
|
|
193
|
+
border-radius: 3px;
|
|
194
|
+
box-shadow: 0 0 0 1px color-mix(in srgb, var(--mk-on-glass-inverse) 30%, transparent);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row] b {
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
font-variant-numeric: tabular-nums;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row] i[data-mk-mono] {
|
|
203
|
+
height: 2px;
|
|
204
|
+
border-radius: 2px;
|
|
205
|
+
background: currentColor;
|
|
206
|
+
box-shadow: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row] i[data-mk-dash] {
|
|
210
|
+
height: 0;
|
|
211
|
+
border-top: 2px dashed currentColor;
|
|
212
|
+
border-radius: 0;
|
|
213
|
+
background: none;
|
|
214
|
+
box-shadow: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row='total'] {
|
|
218
|
+
margin-top: 0.15rem;
|
|
219
|
+
padding-top: 0.25rem;
|
|
220
|
+
border-top: 1px solid color-mix(in srgb, var(--mk-on-glass-inverse) 25%, transparent);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-row='total'] i {
|
|
224
|
+
box-shadow: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Legend: outlined pills (Melonmind «— Ingresado»). */
|
|
228
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-legend] {
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-wrap: wrap;
|
|
231
|
+
gap: 0.4rem;
|
|
232
|
+
margin: 0;
|
|
233
|
+
padding: 0;
|
|
234
|
+
color: var(--mk-text);
|
|
235
|
+
font-size: 0.8125rem;
|
|
236
|
+
list-style: none;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-legend][hidden] {
|
|
240
|
+
display: none;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-legend] li {
|
|
244
|
+
display: inline-flex;
|
|
245
|
+
align-items: center;
|
|
246
|
+
gap: 0.45rem;
|
|
247
|
+
padding: 0.2rem 0.7rem;
|
|
248
|
+
border: 1px solid var(--mk-outline-soft);
|
|
249
|
+
border-radius: var(--mk-radius-full);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-swatch] {
|
|
253
|
+
width: 0.7rem;
|
|
254
|
+
height: 0.7rem;
|
|
255
|
+
border-radius: 3px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-swatch][data-mk-type='line'],
|
|
259
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-swatch][data-mk-type='area'] {
|
|
260
|
+
width: 0.9rem;
|
|
261
|
+
height: 2px;
|
|
262
|
+
border-radius: 2px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-swatch][data-mk-dash] {
|
|
266
|
+
height: 0;
|
|
267
|
+
background: none !important;
|
|
268
|
+
border-top: 2px dashed currentColor;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-empty] {
|
|
272
|
+
display: grid;
|
|
273
|
+
place-items: center;
|
|
274
|
+
min-height: 10rem;
|
|
275
|
+
margin: 0;
|
|
276
|
+
border-radius: 24px;
|
|
277
|
+
background: var(--mk-surface-2);
|
|
278
|
+
color: var(--mk-muted);
|
|
279
|
+
font-size: 0.875rem;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:is(.mk-chart, mk-chart) [data-mk-chart-empty][hidden] {
|
|
283
|
+
display: none;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@media (prefers-reduced-motion: reduce) {
|
|
287
|
+
:is(.mk-chart, mk-chart) [data-mk-part='series'] path {
|
|
288
|
+
transition: none;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@media (forced-colors: active) {
|
|
293
|
+
:is(.mk-chart, mk-chart) [data-mk-part='line'] {
|
|
294
|
+
stroke: CanvasText !important;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/* components/code-block/code-block.css */
|
|
2
|
+
/* code-block — an editor surface, dark in both modes: a bar with three quiet dots, the file name, the language and a
|
|
3
|
+
glass copy button; mono lines with syntax colours, optional numbers and marked lines. A squared surface (radius 12)
|
|
4
|
+
so long lines never run into a curved corner. */
|
|
5
|
+
.mk-code-block,
|
|
6
|
+
mk-code-block {
|
|
7
|
+
--mk-code-radius: var(--mk-radius-sm, 12px);
|
|
8
|
+
--mk-code-bg: #0e0f11;
|
|
9
|
+
--mk-code-bar: #16171a;
|
|
10
|
+
--mk-code-text: #e6e8ec;
|
|
11
|
+
--mk-code-muted: #8a909b;
|
|
12
|
+
--mk-code-line: rgb(255 255 255 / 0.035);
|
|
13
|
+
--mk-code-mark: rgb(196 165 255 / 0.1);
|
|
14
|
+
--mk-code-keyword: #c4a5ff;
|
|
15
|
+
--mk-code-string: #9fe0b0;
|
|
16
|
+
--mk-code-number: #ffb86b;
|
|
17
|
+
--mk-code-comment: #7d8390;
|
|
18
|
+
--mk-code-function: #82b4ff;
|
|
19
|
+
--mk-code-tag: #ff8f8f;
|
|
20
|
+
--mk-code-attr: #ffd479;
|
|
21
|
+
--mk-code-property: #8fd6ff;
|
|
22
|
+
--mk-code-punctuation: #9aa0aa;
|
|
23
|
+
--mk-code-operator: #c9ced6;
|
|
24
|
+
position: relative;
|
|
25
|
+
display: block;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
border-radius: var(--mk-code-radius);
|
|
28
|
+
background: var(--mk-code-bg);
|
|
29
|
+
box-shadow:
|
|
30
|
+
inset 0 0 0 1px rgb(255 255 255 / 0.06),
|
|
31
|
+
0 18px 40px -24px rgb(0 0 0 / 0.55);
|
|
32
|
+
color: var(--mk-code-text);
|
|
33
|
+
color-scheme: dark;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-header] {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 0.75rem;
|
|
40
|
+
min-height: 3rem;
|
|
41
|
+
padding: 0.4rem 0.45rem 0.4rem 1rem;
|
|
42
|
+
background: var(--mk-code-bar);
|
|
43
|
+
box-shadow: inset 0 -1px 0 rgb(255 255 255 / 0.05);
|
|
44
|
+
font-family: var(--mk-font);
|
|
45
|
+
font-size: 0.8125rem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-dots] {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
flex: none;
|
|
51
|
+
gap: 6px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-dots] i {
|
|
55
|
+
width: 10px;
|
|
56
|
+
height: 10px;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
background: rgb(255 255 255 / 0.14);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-title] {
|
|
62
|
+
flex: 1;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
color: var(--mk-code-text);
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-language] {
|
|
72
|
+
padding: 0.15rem 0.5rem;
|
|
73
|
+
border-radius: 6px;
|
|
74
|
+
background: rgb(255 255 255 / 0.07);
|
|
75
|
+
color: var(--mk-code-muted);
|
|
76
|
+
font-family: var(--mk-font-mono, ui-monospace, monospace);
|
|
77
|
+
font-size: 0.75rem;
|
|
78
|
+
text-transform: lowercase;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:is(.mk-code-block, mk-code-block) pre {
|
|
82
|
+
margin: 0;
|
|
83
|
+
padding: 1rem 0;
|
|
84
|
+
overflow-x: auto;
|
|
85
|
+
font-family: var(--mk-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
86
|
+
font-size: 0.875rem;
|
|
87
|
+
line-height: 1.7;
|
|
88
|
+
tab-size: 2;
|
|
89
|
+
scrollbar-color: rgb(255 255 255 / 0.2) transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:is(.mk-code-block, mk-code-block) pre:focus-visible {
|
|
93
|
+
outline: 2px solid var(--mk-code-keyword);
|
|
94
|
+
outline-offset: -4px;
|
|
95
|
+
border-radius: calc(var(--mk-code-radius) - 4px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:is(.mk-code-block, mk-code-block) code {
|
|
99
|
+
display: block;
|
|
100
|
+
min-width: max-content;
|
|
101
|
+
padding: 0 1.25rem;
|
|
102
|
+
font: inherit;
|
|
103
|
+
white-space: pre;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Highlighted code: block lines (the newlines between them are not rendered in a grid). */
|
|
107
|
+
:is(.mk-code-block, mk-code-block) code:has([data-mk-code-line]) {
|
|
108
|
+
display: grid;
|
|
109
|
+
padding: 0;
|
|
110
|
+
counter-reset: mk-line;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-line] {
|
|
114
|
+
display: block;
|
|
115
|
+
translate: 0 var(--mk-line-y, 0);
|
|
116
|
+
min-height: 1.7em;
|
|
117
|
+
padding: 0 1.25rem;
|
|
118
|
+
transition: background-color 0.15s ease;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-line]:hover {
|
|
122
|
+
background: var(--mk-code-line);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-line][data-mk-highlight] {
|
|
126
|
+
background: var(--mk-code-mark);
|
|
127
|
+
box-shadow: inset 2px 0 0 var(--mk-code-keyword);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:is(.mk-code-block, mk-code-block)[data-mk-line-numbers] [data-mk-code-line]::before {
|
|
131
|
+
counter-increment: mk-line;
|
|
132
|
+
content: counter(mk-line);
|
|
133
|
+
display: inline-block;
|
|
134
|
+
width: 2ch;
|
|
135
|
+
margin-right: 1.25rem;
|
|
136
|
+
color: var(--mk-code-muted);
|
|
137
|
+
opacity: 0.55;
|
|
138
|
+
text-align: right;
|
|
139
|
+
user-select: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='keyword'] { color: var(--mk-code-keyword); }
|
|
143
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='string'] { color: var(--mk-code-string); }
|
|
144
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='number'] { color: var(--mk-code-number); }
|
|
145
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='comment'] { color: var(--mk-code-comment); font-style: italic; }
|
|
146
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='function'] { color: var(--mk-code-function); }
|
|
147
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='tag'] { color: var(--mk-code-tag); }
|
|
148
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='attr'] { color: var(--mk-code-attr); }
|
|
149
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='property'] { color: var(--mk-code-property); }
|
|
150
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='punctuation'] { color: var(--mk-code-punctuation); }
|
|
151
|
+
:is(.mk-code-block, mk-code-block) [data-mk-token='operator'] { color: var(--mk-code-operator); }
|
|
152
|
+
|
|
153
|
+
/* The copy button: glass on the bar, or floating in the corner when authored outside it. */
|
|
154
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy] {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
flex: none;
|
|
157
|
+
align-items: center;
|
|
158
|
+
justify-content: center;
|
|
159
|
+
gap: 0.4rem;
|
|
160
|
+
min-height: 2.25rem;
|
|
161
|
+
padding: 0 0.9rem;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
border: 0;
|
|
164
|
+
border-radius: var(--mk-radius-xs, 8px);
|
|
165
|
+
background: rgb(255 255 255 / 0.08);
|
|
166
|
+
box-shadow:
|
|
167
|
+
inset 1px 1px 1px rgb(255 255 255 / 0.08),
|
|
168
|
+
inset -1px -1px 1px rgb(255 255 255 / 0.04);
|
|
169
|
+
color: var(--mk-code-text);
|
|
170
|
+
font-family: var(--mk-font);
|
|
171
|
+
font-size: 0.8125rem;
|
|
172
|
+
font-weight: 500;
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
transition:
|
|
176
|
+
background-color 0.2s ease,
|
|
177
|
+
color 0.2s ease;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:is(.mk-code-block, mk-code-block) > [data-mk-code-copy] {
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: 3.5rem;
|
|
183
|
+
right: 0.6rem;
|
|
184
|
+
z-index: 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy]:hover {
|
|
188
|
+
background: rgb(255 255 255 / 0.14);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy]:focus-visible {
|
|
192
|
+
outline: 2px solid var(--mk-code-keyword);
|
|
193
|
+
outline-offset: 2px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:is(.mk-code-block, mk-code-block)[data-mk-copied] [data-mk-code-copy] {
|
|
197
|
+
background: #e6e8ec;
|
|
198
|
+
color: #0e0f11;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
:is(.mk-code-block, mk-code-block)[data-mk-copy-error] [data-mk-code-copy] {
|
|
202
|
+
background: rgb(255 120 120 / 0.18);
|
|
203
|
+
color: #ffb4b4;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* The icon turns into a check (or a cross) with a blur. */
|
|
207
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy] svg {
|
|
208
|
+
flex: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:is(.mk-code-block, mk-code-block):is([data-mk-copied], [data-mk-copy-error]) [data-mk-code-copy] svg {
|
|
212
|
+
display: none;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
:is(.mk-code-block, mk-code-block):is([data-mk-copied], [data-mk-copy-error]) [data-mk-code-copy]::before {
|
|
216
|
+
content: '';
|
|
217
|
+
width: 16px;
|
|
218
|
+
height: 16px;
|
|
219
|
+
background: currentColor;
|
|
220
|
+
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.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
221
|
+
animation: mk-code-check 0.4s cubic-bezier(0.1, 0.8, 0, 1.1);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:is(.mk-code-block, mk-code-block)[data-mk-copy-error] [data-mk-code-copy]::before {
|
|
225
|
+
mask-image: 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.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* The button says what happened (the status says it to screen readers). */
|
|
229
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy-text][data-mk-feedback] {
|
|
230
|
+
font-size: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy-text][data-mk-feedback]::after {
|
|
234
|
+
content: attr(data-mk-feedback);
|
|
235
|
+
font-size: 0.8125rem;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@keyframes mk-code-check {
|
|
239
|
+
from {
|
|
240
|
+
opacity: 0;
|
|
241
|
+
filter: blur(6px);
|
|
242
|
+
transform: scale(0.4) rotate(-20deg);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@media (max-width: 520px) {
|
|
247
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-dots] {
|
|
248
|
+
display: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
:is(.mk-code-block, mk-code-block) pre {
|
|
252
|
+
font-size: 0.8125rem;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media (prefers-reduced-motion: reduce) {
|
|
257
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-copy]::before {
|
|
258
|
+
animation: none !important;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:is(.mk-code-block, mk-code-block) [data-mk-code-line] {
|
|
262
|
+
transition: none;
|
|
263
|
+
}
|
|
264
|
+
}
|