@jomae/catalog 0.1.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/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/baseline.d.ts +51 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +123 -0
- package/dist/baseline.js.map +1 -0
- package/dist/detect.d.ts +81 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +155 -0
- package/dist/detect.js.map +1 -0
- package/dist/format.d.ts +20 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +45 -0
- package/dist/format.js.map +1 -0
- package/dist/generated/baseline.d.ts +22 -0
- package/dist/generated/baseline.d.ts.map +1 -0
- package/dist/generated/baseline.js +240 -0
- package/dist/generated/baseline.js.map +1 -0
- package/dist/generated/sizes.d.ts +18 -0
- package/dist/generated/sizes.d.ts.map +1 -0
- package/dist/generated/sizes.js +474 -0
- package/dist/generated/sizes.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/accordion.d.ts +3 -0
- package/dist/rules/accordion.d.ts.map +1 -0
- package/dist/rules/accordion.js +50 -0
- package/dist/rules/accordion.js.map +1 -0
- package/dist/rules/aspect-ratio.d.ts +3 -0
- package/dist/rules/aspect-ratio.d.ts.map +1 -0
- package/dist/rules/aspect-ratio.js +33 -0
- package/dist/rules/aspect-ratio.js.map +1 -0
- package/dist/rules/carousel.d.ts +3 -0
- package/dist/rules/carousel.d.ts.map +1 -0
- package/dist/rules/carousel.js +78 -0
- package/dist/rules/carousel.js.map +1 -0
- package/dist/rules/color-functions.d.ts +3 -0
- package/dist/rules/color-functions.d.ts.map +1 -0
- package/dist/rules/color-functions.js +42 -0
- package/dist/rules/color-functions.js.map +1 -0
- package/dist/rules/container-queries.d.ts +3 -0
- package/dist/rules/container-queries.d.ts.map +1 -0
- package/dist/rules/container-queries.js +53 -0
- package/dist/rules/container-queries.js.map +1 -0
- package/dist/rules/dialog.d.ts +3 -0
- package/dist/rules/dialog.d.ts.map +1 -0
- package/dist/rules/dialog.js +51 -0
- package/dist/rules/dialog.js.map +1 -0
- package/dist/rules/discrete-transitions.d.ts +3 -0
- package/dist/rules/discrete-transitions.d.ts.map +1 -0
- package/dist/rules/discrete-transitions.js +57 -0
- package/dist/rules/discrete-transitions.js.map +1 -0
- package/dist/rules/field-sizing.d.ts +3 -0
- package/dist/rules/field-sizing.d.ts.map +1 -0
- package/dist/rules/field-sizing.js +37 -0
- package/dist/rules/field-sizing.js.map +1 -0
- package/dist/rules/fluid-type.d.ts +3 -0
- package/dist/rules/fluid-type.d.ts.map +1 -0
- package/dist/rules/fluid-type.js +30 -0
- package/dist/rules/fluid-type.js.map +1 -0
- package/dist/rules/height-animation.d.ts +3 -0
- package/dist/rules/height-animation.d.ts.map +1 -0
- package/dist/rules/height-animation.js +46 -0
- package/dist/rules/height-animation.js.map +1 -0
- package/dist/rules/index.d.ts +14 -0
- package/dist/rules/index.d.ts.map +1 -0
- package/dist/rules/index.js +56 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/masonry.d.ts +3 -0
- package/dist/rules/masonry.d.ts.map +1 -0
- package/dist/rules/masonry.js +56 -0
- package/dist/rules/masonry.js.map +1 -0
- package/dist/rules/popover.d.ts +3 -0
- package/dist/rules/popover.d.ts.map +1 -0
- package/dist/rules/popover.js +62 -0
- package/dist/rules/popover.js.map +1 -0
- package/dist/rules/scroll-animations.d.ts +3 -0
- package/dist/rules/scroll-animations.d.ts.map +1 -0
- package/dist/rules/scroll-animations.js +58 -0
- package/dist/rules/scroll-animations.js.map +1 -0
- package/dist/rules/scroll-lock.d.ts +3 -0
- package/dist/rules/scroll-lock.d.ts.map +1 -0
- package/dist/rules/scroll-lock.js +40 -0
- package/dist/rules/scroll-lock.js.map +1 -0
- package/dist/rules/scrollbars.d.ts +3 -0
- package/dist/rules/scrollbars.d.ts.map +1 -0
- package/dist/rules/scrollbars.js +44 -0
- package/dist/rules/scrollbars.js.map +1 -0
- package/dist/rules/select.d.ts +3 -0
- package/dist/rules/select.d.ts.map +1 -0
- package/dist/rules/select.js +54 -0
- package/dist/rules/select.js.map +1 -0
- package/dist/rules/smooth-scroll.d.ts +3 -0
- package/dist/rules/smooth-scroll.d.ts.map +1 -0
- package/dist/rules/smooth-scroll.js +41 -0
- package/dist/rules/smooth-scroll.js.map +1 -0
- package/dist/rules/sticky.d.ts +3 -0
- package/dist/rules/sticky.d.ts.map +1 -0
- package/dist/rules/sticky.js +39 -0
- package/dist/rules/sticky.js.map +1 -0
- package/dist/rules/text-box-trim.d.ts +3 -0
- package/dist/rules/text-box-trim.d.ts.map +1 -0
- package/dist/rules/text-box-trim.js +32 -0
- package/dist/rules/text-box-trim.js.map +1 -0
- package/dist/rules/text-wrap-balance.d.ts +3 -0
- package/dist/rules/text-wrap-balance.d.ts.map +1 -0
- package/dist/rules/text-wrap-balance.js +34 -0
- package/dist/rules/text-wrap-balance.js.map +1 -0
- package/dist/rules/view-transitions.d.ts +3 -0
- package/dist/rules/view-transitions.d.ts.map +1 -0
- package/dist/rules/view-transitions.js +53 -0
- package/dist/rules/view-transitions.js.map +1 -0
- package/dist/schema.d.ts +91 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +124 -0
- package/dist/schema.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const carousel = {
|
|
2
|
+
id: "carousel-scroll-markers",
|
|
3
|
+
title: "Carousels",
|
|
4
|
+
replaces: [
|
|
5
|
+
"swiper",
|
|
6
|
+
"embla-carousel",
|
|
7
|
+
"embla-carousel-react",
|
|
8
|
+
"react-slick",
|
|
9
|
+
"slick-carousel",
|
|
10
|
+
"keen-slider",
|
|
11
|
+
"flickity",
|
|
12
|
+
],
|
|
13
|
+
featureIds: ["scroll-snap", "scroll-buttons", "scroll-markers"],
|
|
14
|
+
native: "CSS scroll-snap with ::scroll-button() and ::scroll-marker()",
|
|
15
|
+
human: {
|
|
16
|
+
explainer: "A scroll container with scroll-snap has covered the swiping half of a carousel for years. What was missing was the chrome around it: previous and next buttons, and a row of dots that tracks the current slide. ::scroll-button() and ::scroll-marker() generate both from CSS, and the browser wires up the scrolling, the focus order and the accessible names. The markers are real tab stops, so keyboard and screen reader support comes for free rather than being something you have to add back.",
|
|
17
|
+
snippet: `.carousel {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-auto-flow: column;
|
|
20
|
+
grid-auto-columns: 80%;
|
|
21
|
+
gap: 1rem;
|
|
22
|
+
overflow-x: auto;
|
|
23
|
+
scroll-snap-type: x mandatory;
|
|
24
|
+
scroll-behavior: smooth;
|
|
25
|
+
/* Put the dot row after the scroller. */
|
|
26
|
+
scroll-marker-group: after;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.carousel > * {
|
|
30
|
+
scroll-snap-align: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Prev / next, generated and wired up by the browser. */
|
|
34
|
+
.carousel::scroll-button(inline-start) {
|
|
35
|
+
content: "\\2190";
|
|
36
|
+
}
|
|
37
|
+
.carousel::scroll-button(inline-end) {
|
|
38
|
+
content: "\\2192";
|
|
39
|
+
}
|
|
40
|
+
.carousel::scroll-button(*):disabled {
|
|
41
|
+
opacity: 0.4;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* One dot per slide. */
|
|
45
|
+
.carousel > *::scroll-marker {
|
|
46
|
+
content: "";
|
|
47
|
+
width: 0.5rem;
|
|
48
|
+
height: 0.5rem;
|
|
49
|
+
border-radius: 50%;
|
|
50
|
+
background: currentColor;
|
|
51
|
+
opacity: 0.3;
|
|
52
|
+
}
|
|
53
|
+
.carousel > *::scroll-marker:target-current {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}`,
|
|
56
|
+
demoUrl: "https://www.jomaendle.com/blog/css-carousel",
|
|
57
|
+
},
|
|
58
|
+
agent: {
|
|
59
|
+
when: "building a horizontal gallery with prev/next buttons and dot indicators",
|
|
60
|
+
unless: [
|
|
61
|
+
"You need Safari or Firefox support today. Both ship scroll-snap but not ::scroll-button() or ::scroll-marker(), so they fall back to a bare scroll container with no buttons and no dots.",
|
|
62
|
+
"You need autoplay, infinite looping, or a coverflow-style 3D effect. None of these have a CSS equivalent.",
|
|
63
|
+
"You render hundreds of slides and rely on the library to virtualise them.",
|
|
64
|
+
"Slides animate as a function of scroll position, for example parallax or a scaling centre slide.",
|
|
65
|
+
"You need programmatic control from JavaScript beyond scrollIntoView, such as pause on hover or a progress bar tied to a timer.",
|
|
66
|
+
],
|
|
67
|
+
snippet: `.carousel {
|
|
68
|
+
overflow-x: auto;
|
|
69
|
+
scroll-snap-type: x mandatory;
|
|
70
|
+
scroll-marker-group: after;
|
|
71
|
+
}
|
|
72
|
+
.carousel > * { scroll-snap-align: center; }
|
|
73
|
+
.carousel::scroll-button(inline-end) { content: "\\2192"; }
|
|
74
|
+
.carousel > *::scroll-marker { content: ""; }
|
|
75
|
+
.carousel > *::scroll-marker:target-current { opacity: 1; }`,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel.js","sourceRoot":"","sources":["../../src/rules/carousel.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,EAAE,EAAE,yBAAyB;IAC7B,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE;QACR,QAAQ;QACR,gBAAgB;QAChB,sBAAsB;QACtB,aAAa;QACb,gBAAgB;QAChB,aAAa;QACb,UAAU;KACX;IACD,UAAU,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;IAC/D,MAAM,EAAE,8DAA8D;IACtE,KAAK,EAAE;QACL,SAAS,EACP,2eAA2e;QAC7e,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCX;QACE,OAAO,EAAE,6CAA6C;KACvD;IACD,KAAK,EAAE;QACL,IAAI,EAAE,yEAAyE;QAC/E,MAAM,EAAE;YACN,2LAA2L;YAC3L,2GAA2G;YAC3G,2EAA2E;YAC3E,kGAAkG;YAClG,gIAAgI;SACjI;QACD,OAAO,EAAE;;;;;;;;4DAQ+C;KACzD;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-functions.d.ts","sourceRoot":"","sources":["../../src/rules/color-functions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IAyC5B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const colorFunctions = {
|
|
2
|
+
id: "css-color-functions",
|
|
3
|
+
title: "Colour manipulation",
|
|
4
|
+
replaces: ["polished", "color2k", "chroma-js", "tinycolor2", "color"],
|
|
5
|
+
featureIds: ["color-mix", "oklab"],
|
|
6
|
+
native: "color-mix(), oklch() and relative colour syntax",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "Lightening, darkening, mixing and adding transparency were the reasons to ship a colour library, and CSS now does all four. color-mix() blends two colours in a chosen space, and relative colour syntax reads a channel off an existing colour so you can shift one part of it. Working in oklch() matters here: mixing in a perceptual space keeps a hue from drifting grey through the middle of a gradient, which is the usual complaint about mixing in sRGB. Because these run on custom properties, one theme token can generate its own hover and border shades at runtime.",
|
|
9
|
+
snippet: `:root {
|
|
10
|
+
--brand: oklch(62% 0.19 256);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.button {
|
|
14
|
+
background: var(--brand);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Darken by mixing toward black. */
|
|
18
|
+
.button:hover {
|
|
19
|
+
background: color-mix(in oklch, var(--brand) 85%, black);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Read the channels off --brand and change only alpha. */
|
|
23
|
+
.button-ghost {
|
|
24
|
+
background: oklch(from var(--brand) l c h / 0.15);
|
|
25
|
+
border: 1px solid color-mix(in oklch, var(--brand) 40%, transparent);
|
|
26
|
+
}`,
|
|
27
|
+
},
|
|
28
|
+
agent: {
|
|
29
|
+
when: "deriving hover, border or muted shades from a single brand colour",
|
|
30
|
+
unless: [
|
|
31
|
+
"You need the computed colour value as a string in JavaScript, for a canvas fill, a chart library or an email template. CSS colours only resolve in the browser at paint time.",
|
|
32
|
+
"You need contrast-ratio calculation or WCAG checking, which these functions do not provide.",
|
|
33
|
+
"You need colour-blindness simulation, palette generation or interpolation across more than two stops.",
|
|
34
|
+
"You are generating colours at build time in Node rather than in the browser.",
|
|
35
|
+
"You rely on the relative colour syntax shown above, oklch(from ...). color-mix() and oklch() are Baseline widely available, but reading channels off an existing colour is newer, so check it before shipping.",
|
|
36
|
+
],
|
|
37
|
+
snippet: `:root { --brand: oklch(62% 0.19 256); }
|
|
38
|
+
.btn:hover { background: color-mix(in oklch, var(--brand) 85%, black); }
|
|
39
|
+
.ghost { background: oklch(from var(--brand) l c h / 0.15); }`,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=color-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-functions.js","sourceRoot":"","sources":["../../src/rules/color-functions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC;IACrE,UAAU,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;IAClC,MAAM,EAAE,iDAAiD;IACzD,KAAK,EAAE;QACL,SAAS,EACP,qjBAAqjB;QACvjB,OAAO,EAAE;;;;;;;;;;;;;;;;;EAiBX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,mEAAmE;QACzE,MAAM,EAAE;YACN,+KAA+K;YAC/K,6FAA6F;YAC7F,uGAAuG;YACvG,8EAA8E;YAC9E,gNAAgN;SACjN;QACD,OAAO,EAAE;;8DAEiD;KAC3D;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-queries.d.ts","sourceRoot":"","sources":["../../src/rules/container-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,gBAAgB,EAAE,IAoD9B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const containerQueries = {
|
|
2
|
+
id: "container-queries",
|
|
3
|
+
title: "Element size queries",
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-resize-detector",
|
|
6
|
+
"react-use-measure",
|
|
7
|
+
"react-sizeme",
|
|
8
|
+
"react-container-query",
|
|
9
|
+
"element-resize-detector",
|
|
10
|
+
],
|
|
11
|
+
featureIds: ["container-queries"],
|
|
12
|
+
native: "Container queries",
|
|
13
|
+
human: {
|
|
14
|
+
explainer: "Measuring an element with ResizeObserver to decide how it should look means layout, then JavaScript, then a re-render, and a visible flash on first paint. A container query does the same branch in CSS during layout, so the card is already correct when it first paints. Container query units are the other half of this: cqi lets padding and type scale with the container rather than the viewport.",
|
|
15
|
+
snippet: `.card-wrapper {
|
|
16
|
+
container-type: inline-size;
|
|
17
|
+
container-name: card;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Stack below 400px of container width, side by side above. */
|
|
21
|
+
.card {
|
|
22
|
+
display: grid;
|
|
23
|
+
gap: 1rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@container card (width >= 400px) {
|
|
27
|
+
.card {
|
|
28
|
+
grid-template-columns: 8rem 1fr;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Scale with the container instead of the viewport. */
|
|
33
|
+
@container card (width >= 400px) {
|
|
34
|
+
.card h3 {
|
|
35
|
+
font-size: clamp(1rem, 4cqi, 1.5rem);
|
|
36
|
+
}
|
|
37
|
+
}`,
|
|
38
|
+
},
|
|
39
|
+
agent: {
|
|
40
|
+
when: "a component needs to change layout based on its own width rather than the viewport",
|
|
41
|
+
unless: [
|
|
42
|
+
"You need the measured pixel value in JavaScript, for example to pass a width to a canvas, a virtualised list or a charting library.",
|
|
43
|
+
"You need to react to height. container-type: size requires the container's block size to be independent of its content, which often means giving it an explicit height.",
|
|
44
|
+
"You need to observe an element that is not an ancestor of the thing being styled. Container queries only look up the tree.",
|
|
45
|
+
"You are querying the element itself rather than a wrapper. A container cannot query its own size, so this needs an extra element.",
|
|
46
|
+
],
|
|
47
|
+
snippet: `.wrapper { container-type: inline-size; container-name: card; }
|
|
48
|
+
@container card (width >= 400px) {
|
|
49
|
+
.card { grid-template-columns: 8rem 1fr; }
|
|
50
|
+
}`,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=container-queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-queries.js","sourceRoot":"","sources":["../../src/rules/container-queries.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,sBAAsB;IAC7B,QAAQ,EAAE;QACR,uBAAuB;QACvB,mBAAmB;QACnB,cAAc;QACd,uBAAuB;QACvB,yBAAyB;KAC1B;IACD,UAAU,EAAE,CAAC,mBAAmB,CAAC;IACjC,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,6YAA6Y;QAC/Y,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,oFAAoF;QAC1F,MAAM,EAAE;YACN,qIAAqI;YACrI,yKAAyK;YACzK,4HAA4H;YAC5H,mIAAmI;SACpI;QACD,OAAO,EAAE;;;EAGX;KACC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/rules/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IAkDpB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const dialog = {
|
|
2
|
+
id: "dialog-element",
|
|
3
|
+
title: "Modal dialogs",
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-modal",
|
|
6
|
+
"react-responsive-modal",
|
|
7
|
+
"react-aria-modal",
|
|
8
|
+
"@reach/dialog",
|
|
9
|
+
"micromodal",
|
|
10
|
+
"a11y-dialog",
|
|
11
|
+
],
|
|
12
|
+
featureIds: ["dialog"],
|
|
13
|
+
native: "<dialog> with showModal()",
|
|
14
|
+
human: {
|
|
15
|
+
explainer: "showModal() gives you the things a modal library exists to provide: the top layer, so no z-index fights, a real backdrop you style with ::backdrop, focus moved into the dialog and restored on close, a focus trap while it is open, Escape to dismiss, and inert content behind it. The parts still worth writing yourself are click-outside-to-close and the open and close transitions.",
|
|
16
|
+
snippet: `<dialog id="confirm">
|
|
17
|
+
<form method="dialog">
|
|
18
|
+
<h2>Delete this project?</h2>
|
|
19
|
+
<button value="cancel">Cancel</button>
|
|
20
|
+
<button value="confirm">Delete</button>
|
|
21
|
+
</form>
|
|
22
|
+
</dialog>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
document.querySelector("#confirm").showModal();
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
dialog::backdrop {
|
|
30
|
+
background: rgb(0 0 0 / 0.5);
|
|
31
|
+
backdrop-filter: blur(2px);
|
|
32
|
+
}
|
|
33
|
+
</style>`,
|
|
34
|
+
},
|
|
35
|
+
agent: {
|
|
36
|
+
when: "building a modal dialog, confirmation prompt or alert",
|
|
37
|
+
unless: [
|
|
38
|
+
"You need click-on-the-backdrop to close. <dialog> does not do this, so you still write a small click handler that compares the event target.",
|
|
39
|
+
"You need enter and exit transitions and must support browsers without @starting-style and transition-behavior: allow-discrete.",
|
|
40
|
+
"You need a non-modal overlay that leaves the page interactive. Use popover instead of showModal().",
|
|
41
|
+
"You render the dialog through a portal into a container that is itself inside a transform or filter, which creates a containing block and breaks top-layer assumptions.",
|
|
42
|
+
"Your framework's dialog component is already handling scroll locking and route-driven open state, and the migration is not worth the churn.",
|
|
43
|
+
],
|
|
44
|
+
snippet: `<dialog id="d">
|
|
45
|
+
<form method="dialog"><button>Close</button></form>
|
|
46
|
+
</dialog>
|
|
47
|
+
<script>document.querySelector("#d").showModal();</script>
|
|
48
|
+
<style>dialog::backdrop { background: rgb(0 0 0 / 0.5); }</style>`,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/rules/dialog.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,gBAAgB;IACpB,KAAK,EAAE,eAAe;IACtB,QAAQ,EAAE;QACR,aAAa;QACb,wBAAwB;QACxB,kBAAkB;QAClB,eAAe;QACf,YAAY;QACZ,aAAa;KACd;IACD,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,2BAA2B;IACnC,KAAK,EAAE;QACL,SAAS,EACP,6XAA6X;QAC/X,OAAO,EAAE;;;;;;;;;;;;;;;;;SAiBJ;KACN;IACD,KAAK,EAAE;QACL,IAAI,EAAE,uDAAuD;QAC7D,MAAM,EAAE;YACN,8IAA8I;YAC9I,gIAAgI;YAChI,oGAAoG;YACpG,yKAAyK;YACzK,6IAA6I;SAC9I;QACD,OAAO,EAAE;;;;kEAIqD;KAC/D;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discrete-transitions.d.ts","sourceRoot":"","sources":["../../src/rules/discrete-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,IAwDjC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const discreteTransitions = {
|
|
2
|
+
id: "discrete-transitions",
|
|
3
|
+
title: "Enter and exit transitions",
|
|
4
|
+
replaces: [
|
|
5
|
+
"framer-motion",
|
|
6
|
+
"motion",
|
|
7
|
+
"react-transition-group",
|
|
8
|
+
"react-spring",
|
|
9
|
+
],
|
|
10
|
+
featureIds: ["starting-style", "transition-behavior"],
|
|
11
|
+
native: "@starting-style with transition-behavior: allow-discrete",
|
|
12
|
+
human: {
|
|
13
|
+
explainer: "Animating an element as it appears used to need JavaScript for one reason: there was no way to give the browser a starting value for an element that was not in the DOM a frame ago, and no way to transition display or overlay. @starting-style supplies the first, and transition-behavior: allow-discrete the second, so a popover or dialog can fade and slide both in and out with CSS only. This covers simple enter and exit. It is not a replacement for an animation library in general, and the list below is longer than usual for that reason.",
|
|
14
|
+
snippet: `.toast {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
translate: 0 0;
|
|
17
|
+
transition:
|
|
18
|
+
opacity 0.3s,
|
|
19
|
+
translate 0.3s,
|
|
20
|
+
display 0.3s allow-discrete;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* The state to animate FROM on first paint. */
|
|
24
|
+
@starting-style {
|
|
25
|
+
.toast {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
translate: 0 1rem;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* The state to animate TO on the way out. */
|
|
32
|
+
.toast[hidden] {
|
|
33
|
+
display: none;
|
|
34
|
+
opacity: 0;
|
|
35
|
+
translate: 0 1rem;
|
|
36
|
+
}`,
|
|
37
|
+
},
|
|
38
|
+
agent: {
|
|
39
|
+
when: "fading or sliding an element in and out as it is added to or removed from the DOM",
|
|
40
|
+
unless: [
|
|
41
|
+
"The library is doing layout animation. FLIP-style transitions between positions, shared element transitions and Framer Motion's layout prop have no CSS equivalent. Reach for View Transitions instead, and check its support.",
|
|
42
|
+
"You need spring physics or velocity-aware easing. CSS easing functions are fixed curves, and linear() approximates a spring without responding to interruption velocity.",
|
|
43
|
+
"You need gestures: drag, pan, pinch or swipe-to-dismiss.",
|
|
44
|
+
"You need to orchestrate a sequence, such as staggered children or a timeline where one animation waits for another.",
|
|
45
|
+
"You need scroll-linked animation. That is scroll-driven animations, which is a separate feature and less supported.",
|
|
46
|
+
"You need to interrupt and reverse mid-flight from application state, or read animation progress in JavaScript.",
|
|
47
|
+
"You still support browsers without @starting-style. Without it the element appears with no transition, which is a reasonable degradation but a visible difference.",
|
|
48
|
+
],
|
|
49
|
+
snippet: `.el {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
transition: opacity 0.3s, display 0.3s allow-discrete;
|
|
52
|
+
}
|
|
53
|
+
@starting-style { .el { opacity: 0; } }
|
|
54
|
+
.el[hidden] { display: none; opacity: 0; }`,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=discrete-transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discrete-transitions.js","sourceRoot":"","sources":["../../src/rules/discrete-transitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,sBAAsB;IAC1B,KAAK,EAAE,4BAA4B;IACnC,QAAQ,EAAE;QACR,eAAe;QACf,QAAQ;QACR,wBAAwB;QACxB,cAAc;KACf;IACD,UAAU,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IACrD,MAAM,EAAE,0DAA0D;IAClE,KAAK,EAAE;QACL,SAAS,EACP,6hBAA6hB;QAC/hB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,mFAAmF;QACzF,MAAM,EAAE;YACN,gOAAgO;YAChO,0KAA0K;YAC1K,0DAA0D;YAC1D,qHAAqH;YACrH,qHAAqH;YACrH,gHAAgH;YAChH,oKAAoK;SACrK;QACD,OAAO,EAAE;;;;;2CAK8B;KACxC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-sizing.d.ts","sourceRoot":"","sources":["../../src/rules/field-sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,IAoCzB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const fieldSizing = {
|
|
2
|
+
id: "field-sizing",
|
|
3
|
+
title: "Auto-growing textareas",
|
|
4
|
+
replaces: ["react-textarea-autosize", "autosize", "react-autosize-textarea"],
|
|
5
|
+
featureIds: ["field-sizing"],
|
|
6
|
+
native: "field-sizing: content",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "The usual approach copies the textarea's value into a hidden mirror element, measures it, and writes the height back on every keystroke. field-sizing: content tells the control to size itself to its own value, so the growing happens during layout with no measuring and no re-render. Pair it with rows and max-height so it starts at a sensible size and stops before it eats the viewport.",
|
|
9
|
+
snippet: `textarea {
|
|
10
|
+
field-sizing: content;
|
|
11
|
+
/* Where it starts. */
|
|
12
|
+
min-height: 3lh;
|
|
13
|
+
/* Where it stops growing. */
|
|
14
|
+
max-height: 12lh;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Works on inputs and selects too. */
|
|
18
|
+
input[type="text"] {
|
|
19
|
+
field-sizing: content;
|
|
20
|
+
min-width: 8ch;
|
|
21
|
+
}`,
|
|
22
|
+
},
|
|
23
|
+
agent: {
|
|
24
|
+
when: "a textarea or input should grow to fit what the user has typed",
|
|
25
|
+
unless: [
|
|
26
|
+
"You need Safari or Firefox support today. field-sizing reached Baseline newly available only in mid-2026, so verify against your support target and keep a fallback if you cannot afford a fixed-height textarea.",
|
|
27
|
+
"You need the measured height in JavaScript, for example to sync a neighbouring element.",
|
|
28
|
+
"You need to animate the height change. field-sizing resizes without a transition.",
|
|
29
|
+
],
|
|
30
|
+
snippet: `textarea {
|
|
31
|
+
field-sizing: content;
|
|
32
|
+
min-height: 3lh;
|
|
33
|
+
max-height: 12lh;
|
|
34
|
+
}`,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=field-sizing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-sizing.js","sourceRoot":"","sources":["../../src/rules/field-sizing.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,wBAAwB;IAC/B,QAAQ,EAAE,CAAC,yBAAyB,EAAE,UAAU,EAAE,yBAAyB,CAAC;IAC5E,UAAU,EAAE,CAAC,cAAc,CAAC;IAC5B,MAAM,EAAE,uBAAuB;IAC/B,KAAK,EAAE;QACL,SAAS,EACP,oYAAoY;QACtY,OAAO,EAAE;;;;;;;;;;;;EAYX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gEAAgE;QACtE,MAAM,EAAE;YACN,mNAAmN;YACnN,yFAAyF;YACzF,mFAAmF;SACpF;QACD,OAAO,EAAE;;;;EAIX;KACC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-type.d.ts","sourceRoot":"","sources":["../../src/rules/fluid-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,SAAS,EAAE,IA6BvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const fluidType = {
|
|
2
|
+
id: "fluid-type-clamp",
|
|
3
|
+
title: "Fluid type scales",
|
|
4
|
+
replaces: ["fitty", "fittext.js", "textfit", "react-textfit"],
|
|
5
|
+
featureIds: ["min-max-clamp"],
|
|
6
|
+
native: "clamp() with a viewport-relative middle value",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "clamp() takes a minimum, a preferred value and a maximum, so a heading can scale with the viewport and still stop before it becomes unreadable at either end. Mixing rem into the preferred value, rather than using vw alone, keeps the text responsive to the user's font size, so zooming still works. Container query units swap the viewport for the component's own width when a card needs to scale independently of the page.",
|
|
9
|
+
snippet: `h1 {
|
|
10
|
+
/* min 2rem, max 4rem, scaling with the viewport between. */
|
|
11
|
+
font-size: clamp(2rem, 1.5rem + 2.5vw, 4rem);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Scale with the container instead of the viewport. */
|
|
15
|
+
.card h2 {
|
|
16
|
+
font-size: clamp(1.25rem, 0.9rem + 2cqi, 2rem);
|
|
17
|
+
}`,
|
|
18
|
+
},
|
|
19
|
+
agent: {
|
|
20
|
+
when: "a heading or display type should scale between a minimum and maximum size with the viewport",
|
|
21
|
+
unless: [
|
|
22
|
+
"You need text to fit an exact box on one line, which is what fitty and textfit actually do. clamp() scales against the viewport or container, and knows nothing about the string's rendered width.",
|
|
23
|
+
"The text is user-generated and of unpredictable length, so no fixed scale will fit every case.",
|
|
24
|
+
"You need to fit text to a shape or along a path.",
|
|
25
|
+
],
|
|
26
|
+
snippet: `h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 4rem); }
|
|
27
|
+
.card h2 { font-size: clamp(1.25rem, 0.9rem + 2cqi, 2rem); }`,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=fluid-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid-type.js","sourceRoot":"","sources":["../../src/rules/fluid-type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,CAAC;IAC7D,UAAU,EAAE,CAAC,eAAe,CAAC;IAC7B,MAAM,EAAE,+CAA+C;IACvD,KAAK,EAAE;QACL,SAAS,EACP,uaAAua;QACza,OAAO,EAAE;;;;;;;;EAQX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6FAA6F;QACnG,MAAM,EAAE;YACN,oMAAoM;YACpM,gGAAgG;YAChG,kDAAkD;SACnD;QACD,OAAO,EAAE;6DACgD;KAC1D;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"height-animation.d.ts","sourceRoot":"","sources":["../../src/rules/height-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IA6C7B,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const heightAnimation = {
|
|
2
|
+
id: "height-auto-animation",
|
|
3
|
+
title: "Animating to height auto",
|
|
4
|
+
replaces: ["react-collapse", "react-animate-height", "react-smooth-collapse"],
|
|
5
|
+
featureIds: ["interpolate-size", "calc-size"],
|
|
6
|
+
native: "interpolate-size: allow-keywords, or calc-size()",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "You cannot transition to height: auto, which is why every collapse library measures the content and animates to a pixel value instead. interpolate-size: allow-keywords opts a subtree into interpolating intrinsic keywords, so height: auto and width: max-content become animatable. calc-size() does the same for a single value when you would rather not opt in globally. Set it once on the root and existing transitions to auto start working.",
|
|
9
|
+
snippet: `/* Opt in once, near the root. */
|
|
10
|
+
:root {
|
|
11
|
+
interpolate-size: allow-keywords;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.panel {
|
|
15
|
+
height: 0;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
transition: height 0.3s ease;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.panel[data-open] {
|
|
21
|
+
height: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Or, without the global opt-in: */
|
|
25
|
+
.panel-alt {
|
|
26
|
+
transition: height 0.3s;
|
|
27
|
+
height: calc-size(0, size);
|
|
28
|
+
}
|
|
29
|
+
.panel-alt[data-open] {
|
|
30
|
+
height: calc-size(auto, size);
|
|
31
|
+
}`,
|
|
32
|
+
},
|
|
33
|
+
agent: {
|
|
34
|
+
when: "animating a collapsible panel open and closed to its natural height",
|
|
35
|
+
unless: [
|
|
36
|
+
"You need anything beyond Chromium today. interpolate-size and calc-size() are both limited availability, so Safari and Firefox will snap rather than animate. That degrades acceptably, but it is not the same experience.",
|
|
37
|
+
"You need the transition to work on a <details> element in browsers that do not support it, where the content is display: none while closed.",
|
|
38
|
+
"You need the measured content height in JavaScript for anything else, such as a scroll offset.",
|
|
39
|
+
"The panel contains content that loads or reflows during the transition, which the browser cannot anticipate.",
|
|
40
|
+
],
|
|
41
|
+
snippet: `:root { interpolate-size: allow-keywords; }
|
|
42
|
+
.panel { height: 0; overflow: hidden; transition: height 0.3s; }
|
|
43
|
+
.panel[data-open] { height: auto; }`,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=height-animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"height-animation.js","sourceRoot":"","sources":["../../src/rules/height-animation.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,uBAAuB;IAC3B,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,uBAAuB,CAAC;IAC7E,UAAU,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAC7C,MAAM,EAAE,kDAAkD;IAC1D,KAAK,EAAE;QACL,SAAS,EACP,ybAAyb;QAC3b,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBX;KACC;IACD,KAAK,EAAE;QACL,IAAI,EAAE,qEAAqE;QAC3E,MAAM,EAAE;YACN,4NAA4N;YAC5N,6IAA6I;YAC7I,gGAAgG;YAChG,8GAA8G;SAC/G;QACD,OAAO,EAAE;;oCAEuB;KACjC;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Rule } from "../schema.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Every rule in the catalog. Order is not significant: surfaces sort by
|
|
4
|
+
* replaceable weight or support tier, not by position here.
|
|
5
|
+
*/
|
|
6
|
+
export declare const rules: readonly Rule[];
|
|
7
|
+
/** Lookup by rule id. */
|
|
8
|
+
export declare const rulesById: ReadonlyMap<string, Rule>;
|
|
9
|
+
/**
|
|
10
|
+
* Package name to rule. The schema guarantees a package is claimed by at most
|
|
11
|
+
* one rule, so this is unambiguous.
|
|
12
|
+
*/
|
|
13
|
+
export declare const rulesByPackage: ReadonlyMap<string, Rule>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAuBzC;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,EAsBhC,CAAC;AAEF,yBAAyB;AACzB,eAAO,MAAM,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAE/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,IAAI,CAEpD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { accordion } from "./accordion.js";
|
|
2
|
+
import { aspectRatio } from "./aspect-ratio.js";
|
|
3
|
+
import { carousel } from "./carousel.js";
|
|
4
|
+
import { colorFunctions } from "./color-functions.js";
|
|
5
|
+
import { containerQueries } from "./container-queries.js";
|
|
6
|
+
import { dialog } from "./dialog.js";
|
|
7
|
+
import { discreteTransitions } from "./discrete-transitions.js";
|
|
8
|
+
import { fieldSizing } from "./field-sizing.js";
|
|
9
|
+
import { fluidType } from "./fluid-type.js";
|
|
10
|
+
import { heightAnimation } from "./height-animation.js";
|
|
11
|
+
import { masonry } from "./masonry.js";
|
|
12
|
+
import { popover } from "./popover.js";
|
|
13
|
+
import { scrollAnimations } from "./scroll-animations.js";
|
|
14
|
+
import { scrollLock } from "./scroll-lock.js";
|
|
15
|
+
import { scrollbars } from "./scrollbars.js";
|
|
16
|
+
import { select } from "./select.js";
|
|
17
|
+
import { smoothScroll } from "./smooth-scroll.js";
|
|
18
|
+
import { sticky } from "./sticky.js";
|
|
19
|
+
import { textBoxTrim } from "./text-box-trim.js";
|
|
20
|
+
import { textWrapBalance } from "./text-wrap-balance.js";
|
|
21
|
+
import { viewTransitions } from "./view-transitions.js";
|
|
22
|
+
/**
|
|
23
|
+
* Every rule in the catalog. Order is not significant: surfaces sort by
|
|
24
|
+
* replaceable weight or support tier, not by position here.
|
|
25
|
+
*/
|
|
26
|
+
export const rules = [
|
|
27
|
+
accordion,
|
|
28
|
+
aspectRatio,
|
|
29
|
+
carousel,
|
|
30
|
+
colorFunctions,
|
|
31
|
+
containerQueries,
|
|
32
|
+
dialog,
|
|
33
|
+
discreteTransitions,
|
|
34
|
+
fieldSizing,
|
|
35
|
+
fluidType,
|
|
36
|
+
heightAnimation,
|
|
37
|
+
masonry,
|
|
38
|
+
popover,
|
|
39
|
+
scrollAnimations,
|
|
40
|
+
scrollLock,
|
|
41
|
+
scrollbars,
|
|
42
|
+
select,
|
|
43
|
+
smoothScroll,
|
|
44
|
+
sticky,
|
|
45
|
+
textBoxTrim,
|
|
46
|
+
textWrapBalance,
|
|
47
|
+
viewTransitions,
|
|
48
|
+
];
|
|
49
|
+
/** Lookup by rule id. */
|
|
50
|
+
export const rulesById = new Map(rules.map((rule) => [rule.id, rule]));
|
|
51
|
+
/**
|
|
52
|
+
* Package name to rule. The schema guarantees a package is claimed by at most
|
|
53
|
+
* one rule, so this is unambiguous.
|
|
54
|
+
*/
|
|
55
|
+
export const rulesByPackage = new Map(rules.flatMap((rule) => rule.replaces.map((pkg) => [pkg, rule])));
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAoB;IACpC,SAAS;IACT,WAAW;IACX,QAAQ;IACR,cAAc;IACd,gBAAgB;IAChB,MAAM;IACN,mBAAmB;IACnB,WAAW;IACX,SAAS;IACT,eAAe;IACf,OAAO;IACP,OAAO;IACP,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,MAAM;IACN,YAAY;IACZ,MAAM;IACN,WAAW;IACX,eAAe;IACf,eAAe;CAChB,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,SAAS,GAA8B,IAAI,GAAG,CACzD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CACrC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA8B,IAAI,GAAG,CAC9D,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC,CAAC,CAC1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../src/rules/masonry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,IAuDrB,CAAC"}
|