foldkit-mixins 0.3.0 → 0.5.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 +459 -10
- package/dist/app.d.mts +46 -0
- package/dist/app.d.mts.map +1 -0
- package/dist/app.mjs +45 -0
- package/dist/app.mjs.map +1 -0
- package/dist/core-Bxj0UQDF.mjs +53 -0
- package/dist/core-Bxj0UQDF.mjs.map +1 -0
- package/dist/core-CUw_n1Nd.d.mts +40 -0
- package/dist/core-CUw_n1Nd.d.mts.map +1 -0
- package/dist/defaults.d.mts +31 -0
- package/dist/defaults.d.mts.map +1 -0
- package/dist/defaults.mjs +75 -0
- package/dist/defaults.mjs.map +1 -0
- package/dist/foundations.d.mts +30 -0
- package/dist/foundations.d.mts.map +1 -0
- package/dist/foundations.mjs +71 -0
- package/dist/foundations.mjs.map +1 -0
- package/dist/index.d.mts +137 -536
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +261 -1017
- package/dist/index.mjs.map +1 -1
- package/dist/layers-B31M0tDi.mjs +193 -0
- package/dist/layers-B31M0tDi.mjs.map +1 -0
- package/dist/layers.d.mts +47 -0
- package/dist/layers.d.mts.map +1 -0
- package/dist/layers.mjs +2 -0
- package/dist/layout.d.mts +114 -0
- package/dist/layout.d.mts.map +1 -0
- package/dist/layout.mjs +154 -0
- package/dist/layout.mjs.map +1 -0
- package/dist/oklch-BxvCD0oi.d.mts +135 -0
- package/dist/oklch-BxvCD0oi.d.mts.map +1 -0
- package/dist/prose.d.mts +30 -0
- package/dist/prose.d.mts.map +1 -0
- package/dist/prose.mjs +61 -0
- package/dist/prose.mjs.map +1 -0
- package/dist/root-C1u12YMD.mjs +37 -0
- package/dist/root-C1u12YMD.mjs.map +1 -0
- package/dist/root-xyWS6geK.d.mts +25 -0
- package/dist/root-xyWS6geK.d.mts.map +1 -0
- package/dist/slotItem-D6_m6IqP.d.mts +18 -0
- package/dist/slotItem-D6_m6IqP.d.mts.map +1 -0
- package/dist/slotMark-Rdsjb7XI.mjs +135 -0
- package/dist/slotMark-Rdsjb7XI.mjs.map +1 -0
- package/dist/slotView-BtIF2pHo.d.mts +476 -0
- package/dist/slotView-BtIF2pHo.d.mts.map +1 -0
- package/dist/style-CKjLee4e.mjs +1266 -0
- package/dist/style-CKjLee4e.mjs.map +1 -0
- package/dist/style-CtCqaL0l.d.mts +182 -0
- package/dist/style-CtCqaL0l.d.mts.map +1 -0
- package/dist/styleValue-BavTe9MZ.d.mts +72 -0
- package/dist/styleValue-BavTe9MZ.d.mts.map +1 -0
- package/dist/styleValue-_G9jwb17.mjs +248 -0
- package/dist/styleValue-_G9jwb17.mjs.map +1 -0
- package/dist/testing.d.mts +30 -0
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +167 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/theme.d.mts +193 -0
- package/dist/theme.d.mts.map +1 -0
- package/dist/theme.mjs +146 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/tokens-BR_qxDR7.d.mts +91 -0
- package/dist/tokens-BR_qxDR7.d.mts.map +1 -0
- package/dist/tokens-DteBJVN-.mjs +117 -0
- package/dist/tokens-DteBJVN-.mjs.map +1 -0
- package/dist/utilities.d.mts +73 -0
- package/dist/utilities.d.mts.map +1 -0
- package/dist/utilities.mjs +90 -0
- package/dist/utilities.mjs.map +1 -0
- package/package.json +59 -7
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { o as StyleValue } from "./styleValue-BavTe9MZ.mjs";
|
|
2
|
+
//#region src/layers.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* One layer of one order, for `Style.forSlots(S)(pieces, { layer })`: every
|
|
5
|
+
* piece is placed before it is compiled, so the style a view attaches and the
|
|
6
|
+
* style a sheet ships are the same value with the same classes. A piece
|
|
7
|
+
* already in another layer keeps it and is not refused, because a slot piece
|
|
8
|
+
* that is only a layered layout or recipe is ordinary.
|
|
9
|
+
*/
|
|
10
|
+
export interface Placement<Name extends string = string> {
|
|
11
|
+
readonly layer: Name;
|
|
12
|
+
readonly place: (piece: StyleValue) => StyleValue;
|
|
13
|
+
}
|
|
14
|
+
export interface Layers<Name extends string> {
|
|
15
|
+
readonly names: ReadonlyArray<Name>;
|
|
16
|
+
/** The `@layer a, b, c;` statement as a global piece; `Style.stylesheet` hoists it first. */
|
|
17
|
+
readonly declare: StyleValue;
|
|
18
|
+
/**
|
|
19
|
+
* The piece's unlayered rules and global CSS emitted inside `@layer name`,
|
|
20
|
+
* including rules under `whenInput` and per-item pieces. A rule or block
|
|
21
|
+
* already in a layer keeps it, so a design system's layered layout composed
|
|
22
|
+
* into an application style stays in `layouts`. A piece with nothing
|
|
23
|
+
* unlayered but something in another layer is refused with
|
|
24
|
+
* `style:relayered`, since the call would move nothing. A slot style is
|
|
25
|
+
* layered where it is defined, with `layer`, not here: placing a finished
|
|
26
|
+
* style would copy it under new classes that no view attaches.
|
|
27
|
+
*/
|
|
28
|
+
readonly in: (name: Name, piece: StyleValue) => StyleValue;
|
|
29
|
+
/** The placement `Style.forSlots` takes as its `layer` option. */
|
|
30
|
+
readonly layer: (name: Name) => Placement<Name>;
|
|
31
|
+
}
|
|
32
|
+
export declare const define: <const Name extends string>(names: ReadonlyArray<Name>) => Layers<Name>;
|
|
33
|
+
/**
|
|
34
|
+
* The shipped order. `reset` normalizes; `tokens` holds the scales that do
|
|
35
|
+
* not change per theme; `theme` the knobs and what derives from them, plus
|
|
36
|
+
* scoped overrides; `defaults` element defaults; then a design system's
|
|
37
|
+
* `components`, `layouts` (after components, so a wrapper never beats a
|
|
38
|
+
* component's inner rule), a recipe's `variants`, `utilities`, and the
|
|
39
|
+
* application's `app`, always last.
|
|
40
|
+
*/
|
|
41
|
+
export declare const standard: Layers<"reset" | "tokens" | "theme" | "defaults" | "components" | "layouts" | "variants" | "utilities" | "app">;
|
|
42
|
+
export declare const Layers: {
|
|
43
|
+
readonly define: <const Name extends string>(names: ReadonlyArray<Name>) => Layers<Name>;
|
|
44
|
+
readonly standard: Layers<"reset" | "tokens" | "theme" | "defaults" | "components" | "layouts" | "variants" | "utilities" | "app">;
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//# sourceMappingURL=layers.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layers.d.mts","names":[],"sources":["../src/layers.ts"],"mappings":";;;;;;;;;iBAqBiB,UAAU;WAChB,OAAO;WACP,QAAQ,OAAO,eAAe;;iBAGxB,OAAO;WACb,OAAO,cAAc;;WAErB,SAAS;;;;;;;;;;;WAWT,KAAK,MAAM,MAAM,OAAO,eAAe;;WAEvC,QAAQ,MAAM,SAAS,UAAU;;qBAiG/B,eAAgB,qBAAqB,OAAO,cAAc,UAAQ,OAAO;;;;;;;;;qBA8BzE,UAAQ;qBAYR;WA1CgB,eAAA,qBAAmB,OAAS,cAAc,UAAQ,OAAO"}
|
package/dist/layers.mjs
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { o as StyleValue } from "./styleValue-BavTe9MZ.mjs";
|
|
2
|
+
//#region src/layout.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A child of `stack` that keeps its intrinsic width instead of the stack's
|
|
5
|
+
* full-width default. The stack's child rule excludes this piece's class.
|
|
6
|
+
*/
|
|
7
|
+
export declare const intrinsic: StyleValue;
|
|
8
|
+
export interface StackOptions {
|
|
9
|
+
readonly gap?: string;
|
|
10
|
+
/** `align-items`; children are full width unless they compose `intrinsic`. */
|
|
11
|
+
readonly align?: string;
|
|
12
|
+
/** Children after this one-based index are pushed to the end (`margin-block-start: auto`). */
|
|
13
|
+
readonly split?: number;
|
|
14
|
+
}
|
|
15
|
+
/** A vertical stack that owns its children's block rhythm. */
|
|
16
|
+
export declare const stack: (options?: StackOptions) => StyleValue;
|
|
17
|
+
export interface ClusterOptions {
|
|
18
|
+
readonly gap?: string;
|
|
19
|
+
readonly justify?: string;
|
|
20
|
+
readonly align?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Items that wrap onto new lines: tags, toolbar buttons, metadata. */
|
|
23
|
+
export declare const cluster: (options?: ClusterOptions) => StyleValue;
|
|
24
|
+
export interface SplitOptions {
|
|
25
|
+
/** The column template above the breakpoint, e.g. `'1fr 2fr'`. */
|
|
26
|
+
readonly fraction?: string;
|
|
27
|
+
/** The container (or, with `contain: false`, viewport) width the columns appear at. */
|
|
28
|
+
readonly breakpoint?: string;
|
|
29
|
+
readonly gap?: string;
|
|
30
|
+
/** `false` adapts on the viewport with `@media` and sets no containment. */
|
|
31
|
+
readonly contain?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Two columns above a breakpoint, one below. */
|
|
34
|
+
export declare const split: (options?: SplitOptions) => StyleValue;
|
|
35
|
+
/**
|
|
36
|
+
* The aside of a `sidebar`: composed by the child that is the sidebar. The
|
|
37
|
+
* other children are the content.
|
|
38
|
+
*/
|
|
39
|
+
export declare const aside: StyleValue;
|
|
40
|
+
export interface SidebarOptions {
|
|
41
|
+
/** Which side the `aside` child sits on when the row fits. */
|
|
42
|
+
readonly side?: 'start' | 'end';
|
|
43
|
+
/** The aside's preferred width. */
|
|
44
|
+
readonly width?: string;
|
|
45
|
+
/** The content's minimum share; below it the aside wraps under. */
|
|
46
|
+
readonly contentMin?: string;
|
|
47
|
+
readonly gap?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A sidebar beside content that wraps under it when the content would get
|
|
51
|
+
* less than `contentMin`. Flex math, no query, so it needs no containment.
|
|
52
|
+
*/
|
|
53
|
+
export declare const sidebar: (options?: SidebarOptions) => StyleValue;
|
|
54
|
+
export interface SwitcherOptions {
|
|
55
|
+
/** The container width below which the items stack. */
|
|
56
|
+
readonly threshold?: string;
|
|
57
|
+
readonly gap?: string;
|
|
58
|
+
}
|
|
59
|
+
/** A row that becomes a stack when narrower than `threshold`. Flex math, no query. */
|
|
60
|
+
export declare const switcher: (options?: SwitcherOptions) => StyleValue;
|
|
61
|
+
export interface ReelOptions {
|
|
62
|
+
/** Each item's inline size; `auto` sizes to content. */
|
|
63
|
+
readonly itemSize?: string;
|
|
64
|
+
readonly gap?: string;
|
|
65
|
+
/** Snap items to the start edge while scrolling. */
|
|
66
|
+
readonly snap?: boolean;
|
|
67
|
+
readonly scrollbar?: 'auto' | 'thin' | 'hidden';
|
|
68
|
+
}
|
|
69
|
+
/** A horizontally scrolling row. */
|
|
70
|
+
export declare const reel: (options?: ReelOptions) => StyleValue;
|
|
71
|
+
export interface CenterOptions {
|
|
72
|
+
/** The measure; default `65ch`. */
|
|
73
|
+
readonly max?: string;
|
|
74
|
+
readonly gutters?: string;
|
|
75
|
+
/** Also center the children by their intrinsic width. */
|
|
76
|
+
readonly intrinsic?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/** Content centered inline with a maximum measure and gutters. */
|
|
79
|
+
export declare const center: (options?: CenterOptions) => StyleValue;
|
|
80
|
+
export interface FrameOptions {
|
|
81
|
+
/** An `aspect-ratio`, e.g. `'16 / 9'`. */
|
|
82
|
+
readonly ratio?: string;
|
|
83
|
+
}
|
|
84
|
+
/** A media frame with a fixed aspect ratio; an `img` or `video` child covers it. */
|
|
85
|
+
export declare const frame: (options?: FrameOptions) => StyleValue;
|
|
86
|
+
export interface PadOptions {
|
|
87
|
+
readonly inline?: string;
|
|
88
|
+
readonly block?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Consistent padding from the space tokens. */
|
|
91
|
+
export declare const pad: (options?: PadOptions) => StyleValue;
|
|
92
|
+
export interface AutoGridOptions {
|
|
93
|
+
/** The narrowest an item may be before the grid drops a column. */
|
|
94
|
+
readonly minItemSize?: string;
|
|
95
|
+
readonly gap?: string;
|
|
96
|
+
}
|
|
97
|
+
/** A grid that fits as many `minItemSize` columns as the width allows. */
|
|
98
|
+
export declare const autoGrid: (options?: AutoGridOptions) => StyleValue;
|
|
99
|
+
export declare const Layout: {
|
|
100
|
+
readonly stack: (options?: StackOptions) => StyleValue;
|
|
101
|
+
readonly intrinsic: StyleValue;
|
|
102
|
+
readonly cluster: (options?: ClusterOptions) => StyleValue;
|
|
103
|
+
readonly split: (options?: SplitOptions) => StyleValue;
|
|
104
|
+
readonly sidebar: (options?: SidebarOptions) => StyleValue;
|
|
105
|
+
readonly aside: StyleValue;
|
|
106
|
+
readonly switcher: (options?: SwitcherOptions) => StyleValue;
|
|
107
|
+
readonly reel: (options?: ReelOptions) => StyleValue;
|
|
108
|
+
readonly center: (options?: CenterOptions) => StyleValue;
|
|
109
|
+
readonly frame: (options?: FrameOptions) => StyleValue;
|
|
110
|
+
readonly pad: (options?: PadOptions) => StyleValue;
|
|
111
|
+
readonly autoGrid: (options?: AutoGridOptions) => StyleValue;
|
|
112
|
+
};
|
|
113
|
+
//#endregion
|
|
114
|
+
//# sourceMappingURL=layout.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.mts","names":[],"sources":["../src/layout.ts"],"mappings":";;;;;;qBAuCa,WAAW;iBAOP;WACN;;WAEA;;WAEA;;;qBAIE,QAAS,UAAS,iBAAoB;iBAgBlC;WACN;WACA;WACA;;;qBAIE,UAAW,UAAS,mBAAsB;iBActC;;WAEN;;WAEA;WACA;;WAEA;;;qBAIE,QAAS,UAAS,iBAAoB;;;;;qBAkBtC,OAAO;iBAKH;;WAEN;;WAEA;;WAEA;WACA;;;;;;qBAOE,UAAW,UAAS,mBAAsB;iBAatC;;WAEN;WACA;;;qBAIE,WAAY,UAAS,oBAAuB;iBAWxC;;WAEN;WACA;;WAEA;WACA;;;qBAaE,OAAQ,UAAS,gBAAmB;iBAwBhC;;WAEN;WACA;;WAEA;;;qBAIE,SAAU,UAAS,kBAAqB;iBAepC;;WAEN;;;qBAIE,QAAS,UAAS,iBAAoB;iBAalC;WACN;WACA;;;qBAIE,MAAO,UAAS,eAAkB;iBAU9B;;WAEN;WACA;;;qBAIE,WAAY,UAAS,oBAAuB;qBAc5C;WA/OkB,QAAA,UAAA,iBAAoB;;WAuBlB,UAAA,UAAA,mBAAsB;WAyBxB,QAAA,UAAA,iBAAoB;WAqClB,UAAA,UAAA,mBAAsB;;WAoBrB,WAAA,UAAA,oBAAuB;WA8B3B,OAAA,UAAA,gBAAmB;WAiCjB,SAAA,UAAA,kBAAqB;WAqBtB,QAAA,UAAA,iBAAoB;WAmBtB,MAAA,UAAA,eAAkB;WAiBb,WAAA,UAAA,oBAAuB"}
|
package/dist/layout.mjs
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { C as className, _ as self, a as container, h as pseudo, i as compose, m as nest, o as empty, p as media, x as vars } from "./styleValue-_G9jwb17.mjs";
|
|
2
|
+
//#region src/layout.ts
|
|
3
|
+
/**
|
|
4
|
+
* `foldkit-mixins/layout`: layout pieces (stack, cluster, sidebar, …) as
|
|
5
|
+
* `StyleValue`s. Each entry's rule text is the same for every caller: the
|
|
6
|
+
* rules read `--fk-l-*` custom properties with token fallbacks, and the
|
|
7
|
+
* options only write those properties inline. Ten stacks with ten gaps are
|
|
8
|
+
* one rule and ten inline variables. The pieces are unlayered; a page puts
|
|
9
|
+
* them in `layouts` with `Layers.standard.in`.
|
|
10
|
+
*
|
|
11
|
+
* Two things a query cannot read from a variable are structural instead:
|
|
12
|
+
* `split`'s breakpoint (a `@container` or `@media` query) and `stack`'s
|
|
13
|
+
* `split` index (an `:nth-child`). Those are part of the rule text, so each
|
|
14
|
+
* distinct value is its own class.
|
|
15
|
+
*/
|
|
16
|
+
/** The generated class of a rule-only piece, for another piece's selector. */
|
|
17
|
+
const classOf = (piece) => className(piece.rules ?? []);
|
|
18
|
+
const GAP = "var(--fk-l-gap, var(--fk-space-md, 1rem))";
|
|
19
|
+
const gapVar = (gap) => gap === void 0 ? empty : vars({ "--fk-l-gap": gap });
|
|
20
|
+
/**
|
|
21
|
+
* A child of `stack` that keeps its intrinsic width instead of the stack's
|
|
22
|
+
* full-width default. The stack's child rule excludes this piece's class.
|
|
23
|
+
*/
|
|
24
|
+
const intrinsic = self({
|
|
25
|
+
flexGrow: "0",
|
|
26
|
+
inlineSize: "fit-content",
|
|
27
|
+
maxInlineSize: "max-content",
|
|
28
|
+
alignSelf: "var(--fk-l-intrinsic-align, flex-start)"
|
|
29
|
+
});
|
|
30
|
+
/** A vertical stack that owns its children's block rhythm. */
|
|
31
|
+
const stack = (options = {}) => compose(self({
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
alignItems: "var(--fk-l-align, stretch)",
|
|
35
|
+
gap: GAP
|
|
36
|
+
}), nest(`> :not(.${classOf(intrinsic)})`, {
|
|
37
|
+
inlineSize: "100%",
|
|
38
|
+
marginBlock: "0"
|
|
39
|
+
}), options.split === void 0 ? empty : nest(`> :nth-child(${options.split})`, { marginBlockEnd: "auto" }), gapVar(options.gap), options.align === void 0 ? empty : vars({ "--fk-l-align": options.align }));
|
|
40
|
+
/** Items that wrap onto new lines: tags, toolbar buttons, metadata. */
|
|
41
|
+
const cluster = (options = {}) => compose(self({
|
|
42
|
+
display: "flex",
|
|
43
|
+
flexWrap: "wrap",
|
|
44
|
+
gap: "var(--fk-l-gap, var(--fk-space-sm, 0.75rem))",
|
|
45
|
+
justifyContent: "var(--fk-l-justify, flex-start)",
|
|
46
|
+
alignItems: "var(--fk-l-align, center)"
|
|
47
|
+
}), gapVar(options.gap), options.justify === void 0 ? empty : vars({ "--fk-l-justify": options.justify }), options.align === void 0 ? empty : vars({ "--fk-l-align": options.align }));
|
|
48
|
+
/** Two columns above a breakpoint, one below. */
|
|
49
|
+
const split = (options = {}) => {
|
|
50
|
+
const query = `(min-width: ${options.breakpoint ?? "30rem"})`;
|
|
51
|
+
const columns = { gridTemplateColumns: "var(--fk-l-fraction, 1fr 1fr)" };
|
|
52
|
+
return compose(self({
|
|
53
|
+
display: "grid",
|
|
54
|
+
gap: GAP,
|
|
55
|
+
gridTemplateColumns: "1fr"
|
|
56
|
+
}), options.contain === false ? media(query, columns) : compose(self({ containerType: "inline-size" }), container(query, columns)), gapVar(options.gap), options.fraction === void 0 ? empty : vars({ "--fk-l-fraction": options.fraction }));
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The aside of a `sidebar`: composed by the child that is the sidebar. The
|
|
60
|
+
* other children are the content.
|
|
61
|
+
*/
|
|
62
|
+
const aside = self({
|
|
63
|
+
flexGrow: "1",
|
|
64
|
+
flexBasis: "var(--fk-l-side-width, 20rem)"
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* A sidebar beside content that wraps under it when the content would get
|
|
68
|
+
* less than `contentMin`. Flex math, no query, so it needs no containment.
|
|
69
|
+
*/
|
|
70
|
+
const sidebar = (options = {}) => compose(self({
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexWrap: "wrap",
|
|
73
|
+
gap: GAP
|
|
74
|
+
}), nest(`> :not(.${classOf(aside)})`, {
|
|
75
|
+
flexGrow: "9999",
|
|
76
|
+
flexBasis: "var(--fk-l-content-min, 50%)"
|
|
77
|
+
}), options.side === "end" ? nest(`> .${classOf(aside)}`, { order: "1" }) : empty, gapVar(options.gap), options.width === void 0 ? empty : vars({ "--fk-l-side-width": options.width }), options.contentMin === void 0 ? empty : vars({ "--fk-l-content-min": options.contentMin }));
|
|
78
|
+
/** A row that becomes a stack when narrower than `threshold`. Flex math, no query. */
|
|
79
|
+
const switcher = (options = {}) => compose(self({
|
|
80
|
+
display: "flex",
|
|
81
|
+
flexWrap: "wrap",
|
|
82
|
+
gap: GAP
|
|
83
|
+
}), nest("> *", {
|
|
84
|
+
flexGrow: "1",
|
|
85
|
+
flexBasis: "calc((var(--fk-l-threshold, 30rem) - 100%) * 999)"
|
|
86
|
+
}), gapVar(options.gap), options.threshold === void 0 ? empty : vars({ "--fk-l-threshold": options.threshold }));
|
|
87
|
+
const scrollbars = {
|
|
88
|
+
auto: empty,
|
|
89
|
+
thin: self({ scrollbarWidth: "thin" }),
|
|
90
|
+
hidden: compose(self({ scrollbarWidth: "none" }), pseudo("::-webkit-scrollbar", { display: "none" }))
|
|
91
|
+
};
|
|
92
|
+
/** A horizontally scrolling row. */
|
|
93
|
+
const reel = (options = {}) => compose(self({
|
|
94
|
+
display: "flex",
|
|
95
|
+
inlineSize: "100%",
|
|
96
|
+
minInlineSize: "0",
|
|
97
|
+
maxInlineSize: "100%",
|
|
98
|
+
gap: GAP,
|
|
99
|
+
overflowX: "auto",
|
|
100
|
+
overflowY: "hidden",
|
|
101
|
+
overscrollBehaviorInline: "contain"
|
|
102
|
+
}), nest("> *", { flex: "0 0 var(--fk-l-item-size, auto)" }), options.snap === true ? compose(self({ scrollSnapType: "inline proximity" }), nest("> *", { scrollSnapAlign: "start" })) : empty, scrollbars[options.scrollbar ?? "auto"], gapVar(options.gap), options.itemSize === void 0 ? empty : vars({ "--fk-l-item-size": options.itemSize }));
|
|
103
|
+
/** Content centered inline with a maximum measure and gutters. */
|
|
104
|
+
const center = (options = {}) => compose(self({
|
|
105
|
+
boxSizing: "border-box",
|
|
106
|
+
marginInline: "auto",
|
|
107
|
+
maxInlineSize: "var(--fk-l-max, 65ch)",
|
|
108
|
+
paddingInline: "var(--fk-l-gutters, var(--fk-space-md, 1rem))"
|
|
109
|
+
}), options.intrinsic === true ? self({
|
|
110
|
+
display: "flex",
|
|
111
|
+
flexDirection: "column",
|
|
112
|
+
alignItems: "center"
|
|
113
|
+
}) : empty, options.max === void 0 ? empty : vars({ "--fk-l-max": options.max }), options.gutters === void 0 ? empty : vars({ "--fk-l-gutters": options.gutters }));
|
|
114
|
+
/** A media frame with a fixed aspect ratio; an `img` or `video` child covers it. */
|
|
115
|
+
const frame = (options = {}) => compose(self({
|
|
116
|
+
position: "relative",
|
|
117
|
+
overflow: "hidden",
|
|
118
|
+
aspectRatio: "var(--fk-l-ratio, 16 / 9)"
|
|
119
|
+
}), nest("> :is(img, video)", {
|
|
120
|
+
position: "absolute",
|
|
121
|
+
inset: "0",
|
|
122
|
+
inlineSize: "100%",
|
|
123
|
+
blockSize: "100%",
|
|
124
|
+
objectFit: "cover"
|
|
125
|
+
}), options.ratio === void 0 ? empty : vars({ "--fk-l-ratio": options.ratio }));
|
|
126
|
+
/** Consistent padding from the space tokens. */
|
|
127
|
+
const pad = (options = {}) => compose(self({
|
|
128
|
+
paddingInline: "var(--fk-l-pad-inline, var(--fk-space-md, 1rem))",
|
|
129
|
+
paddingBlock: "var(--fk-l-pad-block, var(--fk-space-md, 1rem))"
|
|
130
|
+
}), options.inline === void 0 ? empty : vars({ "--fk-l-pad-inline": options.inline }), options.block === void 0 ? empty : vars({ "--fk-l-pad-block": options.block }));
|
|
131
|
+
/** A grid that fits as many `minItemSize` columns as the width allows. */
|
|
132
|
+
const autoGrid = (options = {}) => compose(self({
|
|
133
|
+
display: "grid",
|
|
134
|
+
gap: GAP,
|
|
135
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, var(--fk-l-min-item-size, 16rem)), 1fr))"
|
|
136
|
+
}), gapVar(options.gap), options.minItemSize === void 0 ? empty : vars({ "--fk-l-min-item-size": options.minItemSize }));
|
|
137
|
+
const Layout = {
|
|
138
|
+
stack,
|
|
139
|
+
intrinsic,
|
|
140
|
+
cluster,
|
|
141
|
+
split,
|
|
142
|
+
sidebar,
|
|
143
|
+
aside,
|
|
144
|
+
switcher,
|
|
145
|
+
reel,
|
|
146
|
+
center,
|
|
147
|
+
frame,
|
|
148
|
+
pad,
|
|
149
|
+
autoGrid
|
|
150
|
+
};
|
|
151
|
+
//#endregion
|
|
152
|
+
export { Layout, aside, autoGrid, center, cluster, frame, intrinsic, pad, reel, sidebar, split, stack, switcher };
|
|
153
|
+
|
|
154
|
+
//# sourceMappingURL=layout.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.mjs","names":["Rules.className"],"sources":["../src/layout.ts"],"sourcesContent":["/**\n * `foldkit-mixins/layout`: layout pieces (stack, cluster, sidebar, …) as\n * `StyleValue`s. Each entry's rule text is the same for every caller: the\n * rules read `--fk-l-*` custom properties with token fallbacks, and the\n * options only write those properties inline. Ten stacks with ten gaps are\n * one rule and ten inline variables. The pieces are unlayered; a page puts\n * them in `layouts` with `Layers.standard.in`.\n *\n * Two things a query cannot read from a variable are structural instead:\n * `split`'s breakpoint (a `@container` or `@media` query) and `stack`'s\n * `split` index (an `:nth-child`). Those are part of the rule text, so each\n * distinct value is its own class.\n */\nimport * as Rules from './styleRules.js'\nimport {\n compose,\n container,\n empty,\n media,\n nest,\n pseudo,\n self,\n vars,\n type Declarations,\n type StyleValue,\n} from './styleValue.js'\n\n/** The generated class of a rule-only piece, for another piece's selector. */\nconst classOf = (piece: StyleValue): string => Rules.className(piece.rules ?? [])\n\nconst GAP = 'var(--fk-l-gap, var(--fk-space-md, 1rem))'\n\nconst gapVar = (gap: string | undefined): StyleValue =>\n gap === undefined ? empty : vars({ '--fk-l-gap': gap })\n\n/**\n * A child of `stack` that keeps its intrinsic width instead of the stack's\n * full-width default. The stack's child rule excludes this piece's class.\n */\nexport const intrinsic: StyleValue = self({\n flexGrow: '0',\n inlineSize: 'fit-content',\n maxInlineSize: 'max-content',\n alignSelf: 'var(--fk-l-intrinsic-align, flex-start)',\n})\n\nexport interface StackOptions {\n readonly gap?: string\n /** `align-items`; children are full width unless they compose `intrinsic`. */\n readonly align?: string\n /** Children after this one-based index are pushed to the end (`margin-block-start: auto`). */\n readonly split?: number\n}\n\n/** A vertical stack that owns its children's block rhythm. */\nexport const stack = (options: StackOptions = {}): StyleValue =>\n compose(\n self({\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'var(--fk-l-align, stretch)',\n gap: GAP,\n }),\n nest(`> :not(.${classOf(intrinsic)})`, { inlineSize: '100%', marginBlock: '0' }),\n options.split === undefined\n ? empty\n : nest(`> :nth-child(${options.split})`, { marginBlockEnd: 'auto' }),\n gapVar(options.gap),\n options.align === undefined ? empty : vars({ '--fk-l-align': options.align }),\n )\n\nexport interface ClusterOptions {\n readonly gap?: string\n readonly justify?: string\n readonly align?: string\n}\n\n/** Items that wrap onto new lines: tags, toolbar buttons, metadata. */\nexport const cluster = (options: ClusterOptions = {}): StyleValue =>\n compose(\n self({\n display: 'flex',\n flexWrap: 'wrap',\n gap: 'var(--fk-l-gap, var(--fk-space-sm, 0.75rem))',\n justifyContent: 'var(--fk-l-justify, flex-start)',\n alignItems: 'var(--fk-l-align, center)',\n }),\n gapVar(options.gap),\n options.justify === undefined ? empty : vars({ '--fk-l-justify': options.justify }),\n options.align === undefined ? empty : vars({ '--fk-l-align': options.align }),\n )\n\nexport interface SplitOptions {\n /** The column template above the breakpoint, e.g. `'1fr 2fr'`. */\n readonly fraction?: string\n /** The container (or, with `contain: false`, viewport) width the columns appear at. */\n readonly breakpoint?: string\n readonly gap?: string\n /** `false` adapts on the viewport with `@media` and sets no containment. */\n readonly contain?: boolean\n}\n\n/** Two columns above a breakpoint, one below. */\nexport const split = (options: SplitOptions = {}): StyleValue => {\n const breakpoint = options.breakpoint ?? '30rem'\n const query = `(min-width: ${breakpoint})`\n const columns = { gridTemplateColumns: 'var(--fk-l-fraction, 1fr 1fr)' }\n return compose(\n self({ display: 'grid', gap: GAP, gridTemplateColumns: '1fr' }),\n options.contain === false\n ? media(query, columns)\n : compose(self({ containerType: 'inline-size' }), container(query, columns)),\n gapVar(options.gap),\n options.fraction === undefined ? empty : vars({ '--fk-l-fraction': options.fraction }),\n )\n}\n\n/**\n * The aside of a `sidebar`: composed by the child that is the sidebar. The\n * other children are the content.\n */\nexport const aside: StyleValue = self({\n flexGrow: '1',\n flexBasis: 'var(--fk-l-side-width, 20rem)',\n})\n\nexport interface SidebarOptions {\n /** Which side the `aside` child sits on when the row fits. */\n readonly side?: 'start' | 'end'\n /** The aside's preferred width. */\n readonly width?: string\n /** The content's minimum share; below it the aside wraps under. */\n readonly contentMin?: string\n readonly gap?: string\n}\n\n/**\n * A sidebar beside content that wraps under it when the content would get\n * less than `contentMin`. Flex math, no query, so it needs no containment.\n */\nexport const sidebar = (options: SidebarOptions = {}): StyleValue =>\n compose(\n self({ display: 'flex', flexWrap: 'wrap', gap: GAP }),\n nest(`> :not(.${classOf(aside)})`, {\n flexGrow: '9999',\n flexBasis: 'var(--fk-l-content-min, 50%)',\n }),\n options.side === 'end' ? nest(`> .${classOf(aside)}`, { order: '1' }) : empty,\n gapVar(options.gap),\n options.width === undefined ? empty : vars({ '--fk-l-side-width': options.width }),\n options.contentMin === undefined ? empty : vars({ '--fk-l-content-min': options.contentMin }),\n )\n\nexport interface SwitcherOptions {\n /** The container width below which the items stack. */\n readonly threshold?: string\n readonly gap?: string\n}\n\n/** A row that becomes a stack when narrower than `threshold`. Flex math, no query. */\nexport const switcher = (options: SwitcherOptions = {}): StyleValue =>\n compose(\n self({ display: 'flex', flexWrap: 'wrap', gap: GAP }),\n nest('> *', {\n flexGrow: '1',\n flexBasis: 'calc((var(--fk-l-threshold, 30rem) - 100%) * 999)',\n }),\n gapVar(options.gap),\n options.threshold === undefined ? empty : vars({ '--fk-l-threshold': options.threshold }),\n )\n\nexport interface ReelOptions {\n /** Each item's inline size; `auto` sizes to content. */\n readonly itemSize?: string\n readonly gap?: string\n /** Snap items to the start edge while scrolling. */\n readonly snap?: boolean\n readonly scrollbar?: 'auto' | 'thin' | 'hidden'\n}\n\nconst scrollbars: Readonly<Record<NonNullable<ReelOptions['scrollbar']>, StyleValue>> = {\n auto: empty,\n thin: self({ scrollbarWidth: 'thin' }),\n hidden: compose(\n self({ scrollbarWidth: 'none' }),\n pseudo('::-webkit-scrollbar', { display: 'none' }),\n ),\n}\n\n/** A horizontally scrolling row. */\nexport const reel = (options: ReelOptions = {}): StyleValue =>\n compose(\n self({\n display: 'flex',\n inlineSize: '100%',\n minInlineSize: '0',\n maxInlineSize: '100%',\n gap: GAP,\n overflowX: 'auto',\n overflowY: 'hidden',\n overscrollBehaviorInline: 'contain',\n }),\n nest('> *', { flex: '0 0 var(--fk-l-item-size, auto)' }),\n options.snap === true\n ? compose(\n self({ scrollSnapType: 'inline proximity' }),\n nest('> *', { scrollSnapAlign: 'start' }),\n )\n : empty,\n scrollbars[options.scrollbar ?? 'auto'],\n gapVar(options.gap),\n options.itemSize === undefined ? empty : vars({ '--fk-l-item-size': options.itemSize }),\n )\n\nexport interface CenterOptions {\n /** The measure; default `65ch`. */\n readonly max?: string\n readonly gutters?: string\n /** Also center the children by their intrinsic width. */\n readonly intrinsic?: boolean\n}\n\n/** Content centered inline with a maximum measure and gutters. */\nexport const center = (options: CenterOptions = {}): StyleValue =>\n compose(\n self({\n boxSizing: 'border-box',\n marginInline: 'auto',\n maxInlineSize: 'var(--fk-l-max, 65ch)',\n paddingInline: 'var(--fk-l-gutters, var(--fk-space-md, 1rem))',\n }),\n options.intrinsic === true\n ? self({ display: 'flex', flexDirection: 'column', alignItems: 'center' })\n : empty,\n options.max === undefined ? empty : vars({ '--fk-l-max': options.max }),\n options.gutters === undefined ? empty : vars({ '--fk-l-gutters': options.gutters }),\n )\n\nexport interface FrameOptions {\n /** An `aspect-ratio`, e.g. `'16 / 9'`. */\n readonly ratio?: string\n}\n\n/** A media frame with a fixed aspect ratio; an `img` or `video` child covers it. */\nexport const frame = (options: FrameOptions = {}): StyleValue =>\n compose(\n self({ position: 'relative', overflow: 'hidden', aspectRatio: 'var(--fk-l-ratio, 16 / 9)' }),\n nest('> :is(img, video)', {\n position: 'absolute',\n inset: '0',\n inlineSize: '100%',\n blockSize: '100%',\n objectFit: 'cover',\n }),\n options.ratio === undefined ? empty : vars({ '--fk-l-ratio': options.ratio }),\n )\n\nexport interface PadOptions {\n readonly inline?: string\n readonly block?: string\n}\n\n/** Consistent padding from the space tokens. */\nexport const pad = (options: PadOptions = {}): StyleValue =>\n compose(\n self({\n paddingInline: 'var(--fk-l-pad-inline, var(--fk-space-md, 1rem))',\n paddingBlock: 'var(--fk-l-pad-block, var(--fk-space-md, 1rem))',\n }),\n options.inline === undefined ? empty : vars({ '--fk-l-pad-inline': options.inline }),\n options.block === undefined ? empty : vars({ '--fk-l-pad-block': options.block }),\n )\n\nexport interface AutoGridOptions {\n /** The narrowest an item may be before the grid drops a column. */\n readonly minItemSize?: string\n readonly gap?: string\n}\n\n/** A grid that fits as many `minItemSize` columns as the width allows. */\nexport const autoGrid = (options: AutoGridOptions = {}): StyleValue =>\n compose(\n self({\n display: 'grid',\n gap: GAP,\n gridTemplateColumns:\n 'repeat(auto-fit, minmax(min(100%, var(--fk-l-min-item-size, 16rem)), 1fr))',\n }),\n gapVar(options.gap),\n options.minItemSize === undefined\n ? empty\n : vars({ '--fk-l-min-item-size': options.minItemSize }),\n )\n\nexport const Layout = {\n stack,\n intrinsic,\n cluster,\n split,\n sidebar,\n aside,\n switcher,\n reel,\n center,\n frame,\n pad,\n autoGrid,\n} as const\n"],"mappings":"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"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//#region src/theme/oklch.d.ts
|
|
2
|
+
interface OklchKnobs {
|
|
3
|
+
/** The brand color: hue in degrees, chroma 0–0.4, lightness as a percentage. */
|
|
4
|
+
readonly accent: {
|
|
5
|
+
readonly h: number;
|
|
6
|
+
readonly c: number;
|
|
7
|
+
readonly l: string;
|
|
8
|
+
/** Lighter and stronger on dark surfaces; defaults `70%` and `c + 0.03`. */
|
|
9
|
+
readonly dark?: {
|
|
10
|
+
readonly l?: string;
|
|
11
|
+
readonly c?: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/** Degrees added to the accent hue for the secondary and tertiary families. */
|
|
15
|
+
readonly secondaryHueShift?: number;
|
|
16
|
+
readonly tertiaryHueShift?: number;
|
|
17
|
+
/** Chroma of neutral surfaces; 0 is gray. */
|
|
18
|
+
readonly surfaceSaturation?: number;
|
|
19
|
+
/** How far apart the surface steps are, 0–100%. */
|
|
20
|
+
readonly surfaceContrast?: string;
|
|
21
|
+
/** Multiplies text chroma. */
|
|
22
|
+
readonly contrastFactor?: number;
|
|
23
|
+
/** Hues of the feedback families. */
|
|
24
|
+
readonly feedback?: {
|
|
25
|
+
readonly success?: number;
|
|
26
|
+
readonly warning?: number;
|
|
27
|
+
readonly error?: number;
|
|
28
|
+
readonly info?: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare const oklch: (knobs: OklchKnobs) => Readonly<{
|
|
32
|
+
knob: {
|
|
33
|
+
'accent-h': string;
|
|
34
|
+
'accent-c': string;
|
|
35
|
+
'accent-l': string;
|
|
36
|
+
'accent-c-dark': string;
|
|
37
|
+
'accent-l-dark': string;
|
|
38
|
+
'secondary-shift': string;
|
|
39
|
+
'tertiary-shift': string;
|
|
40
|
+
'surface-c': string;
|
|
41
|
+
'surface-c-dark': string;
|
|
42
|
+
'surface-contrast': string;
|
|
43
|
+
'contrast-factor': string;
|
|
44
|
+
'base-l': string;
|
|
45
|
+
'base-l-dark': string;
|
|
46
|
+
'success-h': string;
|
|
47
|
+
'warning-h': string;
|
|
48
|
+
'error-h': string;
|
|
49
|
+
'info-h': string;
|
|
50
|
+
};
|
|
51
|
+
hue: {
|
|
52
|
+
accent: string;
|
|
53
|
+
secondary: string;
|
|
54
|
+
tertiary: string;
|
|
55
|
+
neutral: string;
|
|
56
|
+
};
|
|
57
|
+
surface: {
|
|
58
|
+
base: string;
|
|
59
|
+
muted: string;
|
|
60
|
+
subtle: string;
|
|
61
|
+
default: string;
|
|
62
|
+
overt: string;
|
|
63
|
+
bedrock: string;
|
|
64
|
+
};
|
|
65
|
+
text: {
|
|
66
|
+
default: string;
|
|
67
|
+
muted: string;
|
|
68
|
+
subtle: string;
|
|
69
|
+
overt: string;
|
|
70
|
+
link: string;
|
|
71
|
+
'link-hover': string;
|
|
72
|
+
};
|
|
73
|
+
outline: {
|
|
74
|
+
subtle: string;
|
|
75
|
+
default: string;
|
|
76
|
+
overt: string;
|
|
77
|
+
focus: string;
|
|
78
|
+
};
|
|
79
|
+
accent: {
|
|
80
|
+
default: string;
|
|
81
|
+
hover: string;
|
|
82
|
+
active: string;
|
|
83
|
+
subtle: string;
|
|
84
|
+
'on-fill': string;
|
|
85
|
+
ink: string;
|
|
86
|
+
};
|
|
87
|
+
secondary: {
|
|
88
|
+
default: string;
|
|
89
|
+
hover: string;
|
|
90
|
+
active: string;
|
|
91
|
+
subtle: string;
|
|
92
|
+
'on-fill': string;
|
|
93
|
+
ink: string;
|
|
94
|
+
};
|
|
95
|
+
tertiary: {
|
|
96
|
+
default: string;
|
|
97
|
+
hover: string;
|
|
98
|
+
active: string;
|
|
99
|
+
subtle: string;
|
|
100
|
+
'on-fill': string;
|
|
101
|
+
ink: string;
|
|
102
|
+
};
|
|
103
|
+
success: {
|
|
104
|
+
default: string;
|
|
105
|
+
subtle: string;
|
|
106
|
+
'on-fill': string;
|
|
107
|
+
ink: string;
|
|
108
|
+
outline: string;
|
|
109
|
+
};
|
|
110
|
+
warning: {
|
|
111
|
+
default: string;
|
|
112
|
+
subtle: string;
|
|
113
|
+
'on-fill': string;
|
|
114
|
+
ink: string;
|
|
115
|
+
outline: string;
|
|
116
|
+
};
|
|
117
|
+
error: {
|
|
118
|
+
default: string;
|
|
119
|
+
subtle: string;
|
|
120
|
+
'on-fill': string;
|
|
121
|
+
ink: string;
|
|
122
|
+
outline: string;
|
|
123
|
+
};
|
|
124
|
+
info: {
|
|
125
|
+
default: string;
|
|
126
|
+
subtle: string;
|
|
127
|
+
'on-fill': string;
|
|
128
|
+
ink: string;
|
|
129
|
+
outline: string;
|
|
130
|
+
};
|
|
131
|
+
}>;
|
|
132
|
+
type OklchTheme = ReturnType<typeof oklch>;
|
|
133
|
+
//#endregion
|
|
134
|
+
export { OklchTheme as n, oklch as r, OklchKnobs as t };
|
|
135
|
+
//# sourceMappingURL=oklch-BxvCD0oi.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklch-BxvCD0oi.d.mts","names":[],"sources":["../src/theme/oklch.ts"],"mappings":";UAUiB;;WAEN;aACE;aACA;aACA;;aAEA;eAAkB;eAAqB;;;;WAGzC;WACA;;WAEA;;WAEA;;WAEA;;WAEA;aACE;aACA;aACA;aACA;;;cA2EA,QAAS,OAAO,eAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2E3B,aAAa,kBAAkB"}
|
package/dist/prose.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { o as StyleValue } from "./styleValue-BavTe9MZ.mjs";
|
|
2
|
+
//#region src/prose.d.ts
|
|
3
|
+
export interface ProseOptions {
|
|
4
|
+
/** The line length, e.g. `'65ch'`. */
|
|
5
|
+
readonly measure?: string;
|
|
6
|
+
/** The line height, e.g. `'1.75'`. Default: the theme's relaxed leading. */
|
|
7
|
+
readonly leading?: string;
|
|
8
|
+
/** The space before an element, by what it follows. */
|
|
9
|
+
readonly rhythm?: Partial<{
|
|
10
|
+
/** Between flowing blocks: paragraph after paragraph, list after paragraph. */
|
|
11
|
+
readonly paragraph: string;
|
|
12
|
+
/** Before a heading; the content after a heading sits tight. */
|
|
13
|
+
readonly heading: string;
|
|
14
|
+
/** Between list items and before a nested list. */
|
|
15
|
+
readonly list: string;
|
|
16
|
+
/** Around figures, blockquotes, code blocks, tables, and rules. */
|
|
17
|
+
readonly figure: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The prose container: one class for every caller, options as variables on it.
|
|
22
|
+
* The measure and leading are a rule reading those variables, not inline
|
|
23
|
+
* declarations, so a later layer can override either.
|
|
24
|
+
*/
|
|
25
|
+
export declare const style: (options?: ProseOptions) => StyleValue;
|
|
26
|
+
export declare const Prose: {
|
|
27
|
+
readonly style: (options?: ProseOptions) => StyleValue;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//# sourceMappingURL=prose.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.d.mts","names":[],"sources":["../src/prose.ts"],"mappings":";;iBAUiB;;WAEN;;WAEA;;WAEA,SAAS;;aAEP;;aAEA;;aAEA;;aAEA;;;;;;;;qBAuEA,QAAS,UAAS,iBAAoB;qBAUtC;WAVkB,QAAA,UAAA,iBAAoB"}
|
package/dist/prose.mjs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { _ as self, i as compose, m as nest, u as inline } from "./styleValue-_G9jwb17.mjs";
|
|
2
|
+
//#region src/prose.ts
|
|
3
|
+
/**
|
|
4
|
+
* `foldkit-mixins/prose`: the longform-content contract. One class carries
|
|
5
|
+
* the rhythm between unlike elements (a heading and the paragraph after it,
|
|
6
|
+
* a list and the paragraph before it); the measure and each rhythm step are
|
|
7
|
+
* `--fk-prose-*` variables, so every prose container shares the class and
|
|
8
|
+
* options only write variables. Belongs in the `components` layer.
|
|
9
|
+
*/
|
|
10
|
+
const flow = "var(--fk-prose-paragraph, var(--fk-space-md, 1em))";
|
|
11
|
+
const heading = "var(--fk-prose-heading, var(--fk-space-xl, 1.8em))";
|
|
12
|
+
const list = "var(--fk-prose-list, var(--fk-space-2xs, 0.35em))";
|
|
13
|
+
const rules = compose(nest("> *", { marginBlock: "0" }), nest("> * + *", { marginBlockStart: flow }), nest("> :is(h2, h3, h4, h5, h6)", { marginBlockStart: heading }), nest("> :is(h1, h2, h3, h4, h5, h6) + *", { marginBlockStart: "var(--fk-space-xs, 0.5em)" }), nest("> :is(figure, blockquote, pre, table, hr)", { marginBlock: "var(--fk-prose-figure, var(--fk-space-lg, 1.5em))" }), nest(":is(ul, ol)", { paddingInlineStart: "var(--fk-space-lg, 1.5em)" }), nest("li + li", { marginBlockStart: list }), nest(":is(li > ul, li > ol)", { marginBlockStart: list }), nest("blockquote", {
|
|
14
|
+
paddingInlineStart: "var(--fk-space-md, 1em)",
|
|
15
|
+
borderInlineStart: "var(--fk-border-heavy, 3px) solid var(--fk-outline-default, currentColor)",
|
|
16
|
+
color: "var(--fk-text-subtle, inherit)"
|
|
17
|
+
}), nest("figcaption", {
|
|
18
|
+
marginBlockStart: "var(--fk-space-xs, 0.5em)",
|
|
19
|
+
color: "var(--fk-text-muted, inherit)",
|
|
20
|
+
fontSize: "var(--fk-size-sm, 0.875em)"
|
|
21
|
+
}), nest("hr", {
|
|
22
|
+
border: "0",
|
|
23
|
+
borderBlockStart: "var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)"
|
|
24
|
+
}), nest("table", {
|
|
25
|
+
inlineSize: "100%",
|
|
26
|
+
borderCollapse: "collapse",
|
|
27
|
+
fontSize: "var(--fk-size-sm, 0.875em)"
|
|
28
|
+
}), nest(":is(th, td)", {
|
|
29
|
+
padding: "var(--fk-space-xs, 0.5em) var(--fk-space-sm, 0.75em)",
|
|
30
|
+
borderBlockEnd: "var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)",
|
|
31
|
+
textAlign: "start"
|
|
32
|
+
}), nest("mark", {
|
|
33
|
+
padding: "0 0.2em",
|
|
34
|
+
background: "var(--fk-accent-subtle, Mark)",
|
|
35
|
+
color: "var(--fk-accent-ink, MarkText)"
|
|
36
|
+
}), nest("abbr[title]", {
|
|
37
|
+
textDecorationStyle: "dotted",
|
|
38
|
+
cursor: "help"
|
|
39
|
+
}), nest(":not(pre) > code", { overflowWrap: "anywhere" }), nest("pre", { overflowX: "auto" }), nest("a", { overflowWrap: "anywhere" }));
|
|
40
|
+
const variables = (options) => ({
|
|
41
|
+
...options.measure === void 0 ? {} : { "--fk-prose-measure": options.measure },
|
|
42
|
+
...options.leading === void 0 ? {} : { "--fk-prose-leading": options.leading },
|
|
43
|
+
...options.rhythm?.paragraph === void 0 ? {} : { "--fk-prose-paragraph": options.rhythm.paragraph },
|
|
44
|
+
...options.rhythm?.heading === void 0 ? {} : { "--fk-prose-heading": options.rhythm.heading },
|
|
45
|
+
...options.rhythm?.list === void 0 ? {} : { "--fk-prose-list": options.rhythm.list },
|
|
46
|
+
...options.rhythm?.figure === void 0 ? {} : { "--fk-prose-figure": options.rhythm.figure }
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* The prose container: one class for every caller, options as variables on it.
|
|
50
|
+
* The measure and leading are a rule reading those variables, not inline
|
|
51
|
+
* declarations, so a later layer can override either.
|
|
52
|
+
*/
|
|
53
|
+
const style = (options = {}) => compose(self({
|
|
54
|
+
maxInlineSize: "var(--fk-prose-measure, 65ch)",
|
|
55
|
+
lineHeight: "var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))"
|
|
56
|
+
}), inline(variables(options)), rules);
|
|
57
|
+
const Prose = { style };
|
|
58
|
+
//#endregion
|
|
59
|
+
export { Prose, style };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=prose.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prose.mjs","names":[],"sources":["../src/prose.ts"],"sourcesContent":["/**\n * `foldkit-mixins/prose`: the longform-content contract. One class carries\n * the rhythm between unlike elements (a heading and the paragraph after it,\n * a list and the paragraph before it); the measure and each rhythm step are\n * `--fk-prose-*` variables, so every prose container shares the class and\n * options only write variables. Belongs in the `components` layer.\n */\nimport { compose, inline, nest, self } from './styleValue.js'\nimport type { StyleValue } from './styleValue.js'\n\nexport interface ProseOptions {\n /** The line length, e.g. `'65ch'`. */\n readonly measure?: string\n /** The line height, e.g. `'1.75'`. Default: the theme's relaxed leading. */\n readonly leading?: string\n /** The space before an element, by what it follows. */\n readonly rhythm?: Partial<{\n /** Between flowing blocks: paragraph after paragraph, list after paragraph. */\n readonly paragraph: string\n /** Before a heading; the content after a heading sits tight. */\n readonly heading: string\n /** Between list items and before a nested list. */\n readonly list: string\n /** Around figures, blockquotes, code blocks, tables, and rules. */\n readonly figure: string\n }>\n}\n\nconst flow = 'var(--fk-prose-paragraph, var(--fk-space-md, 1em))'\nconst heading = 'var(--fk-prose-heading, var(--fk-space-xl, 1.8em))'\nconst list = 'var(--fk-prose-list, var(--fk-space-2xs, 0.35em))'\nconst figure = 'var(--fk-prose-figure, var(--fk-space-lg, 1.5em))'\n\nconst rules: StyleValue = compose(\n nest('> *', { marginBlock: '0' }),\n nest('> * + *', { marginBlockStart: flow }),\n nest('> :is(h2, h3, h4, h5, h6)', { marginBlockStart: heading }),\n nest('> :is(h1, h2, h3, h4, h5, h6) + *', { marginBlockStart: 'var(--fk-space-xs, 0.5em)' }),\n nest('> :is(figure, blockquote, pre, table, hr)', { marginBlock: figure }),\n nest(':is(ul, ol)', { paddingInlineStart: 'var(--fk-space-lg, 1.5em)' }),\n nest('li + li', { marginBlockStart: list }),\n nest(':is(li > ul, li > ol)', { marginBlockStart: list }),\n nest('blockquote', {\n paddingInlineStart: 'var(--fk-space-md, 1em)',\n borderInlineStart: 'var(--fk-border-heavy, 3px) solid var(--fk-outline-default, currentColor)',\n color: 'var(--fk-text-subtle, inherit)',\n }),\n nest('figcaption', {\n marginBlockStart: 'var(--fk-space-xs, 0.5em)',\n color: 'var(--fk-text-muted, inherit)',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest('hr', {\n border: '0',\n borderBlockStart: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n }),\n nest('table', {\n inlineSize: '100%',\n borderCollapse: 'collapse',\n fontSize: 'var(--fk-size-sm, 0.875em)',\n }),\n nest(':is(th, td)', {\n padding: 'var(--fk-space-xs, 0.5em) var(--fk-space-sm, 0.75em)',\n borderBlockEnd: 'var(--fk-border-thin, 1px) solid var(--fk-outline-subtle, currentColor)',\n textAlign: 'start',\n }),\n nest('mark', {\n padding: '0 0.2em',\n background: 'var(--fk-accent-subtle, Mark)',\n color: 'var(--fk-accent-ink, MarkText)',\n }),\n nest('abbr[title]', { textDecorationStyle: 'dotted', cursor: 'help' }),\n nest(':not(pre) > code', { overflowWrap: 'anywhere' }),\n nest('pre', { overflowX: 'auto' }),\n nest('a', { overflowWrap: 'anywhere' }),\n)\n\nconst variables = (options: ProseOptions): Readonly<Record<`--${string}`, string>> => ({\n ...(options.measure === undefined ? {} : { '--fk-prose-measure': options.measure }),\n ...(options.leading === undefined ? {} : { '--fk-prose-leading': options.leading }),\n ...(options.rhythm?.paragraph === undefined\n ? {}\n : { '--fk-prose-paragraph': options.rhythm.paragraph }),\n ...(options.rhythm?.heading === undefined\n ? {}\n : { '--fk-prose-heading': options.rhythm.heading }),\n ...(options.rhythm?.list === undefined ? {} : { '--fk-prose-list': options.rhythm.list }),\n ...(options.rhythm?.figure === undefined ? {} : { '--fk-prose-figure': options.rhythm.figure }),\n})\n\n/**\n * The prose container: one class for every caller, options as variables on it.\n * The measure and leading are a rule reading those variables, not inline\n * declarations, so a later layer can override either.\n */\nexport const style = (options: ProseOptions = {}): StyleValue =>\n compose(\n self({\n maxInlineSize: 'var(--fk-prose-measure, 65ch)',\n lineHeight: 'var(--fk-prose-leading, var(--fk-leading-relaxed, 1.6))',\n }),\n inline(variables(options)),\n rules,\n )\n\nexport const Prose = { style } as const\n"],"mappings":";;;;;;;;;AA4BA,MAAM,OAAO;AACb,MAAM,UAAU;AAChB,MAAM,OAAO;AAGb,MAAM,QAAoB,QACxB,KAAK,OAAO,EAAE,aAAa,IAAI,CAAC,GAChC,KAAK,WAAW,EAAE,kBAAkB,KAAK,CAAC,GAC1C,KAAK,6BAA6B,EAAE,kBAAkB,QAAQ,CAAC,GAC/D,KAAK,qCAAqC,EAAE,kBAAkB,4BAA4B,CAAC,GAC3F,KAAK,6CAA6C,EAAE,aAAa,oDAAO,CAAC,GACzE,KAAK,eAAe,EAAE,oBAAoB,4BAA4B,CAAC,GACvE,KAAK,WAAW,EAAE,kBAAkB,KAAK,CAAC,GAC1C,KAAK,yBAAyB,EAAE,kBAAkB,KAAK,CAAC,GACxD,KAAK,cAAc;CACjB,oBAAoB;CACpB,mBAAmB;CACnB,OAAO;AACT,CAAC,GACD,KAAK,cAAc;CACjB,kBAAkB;CAClB,OAAO;CACP,UAAU;AACZ,CAAC,GACD,KAAK,MAAM;CACT,QAAQ;CACR,kBAAkB;AACpB,CAAC,GACD,KAAK,SAAS;CACZ,YAAY;CACZ,gBAAgB;CAChB,UAAU;AACZ,CAAC,GACD,KAAK,eAAe;CAClB,SAAS;CACT,gBAAgB;CAChB,WAAW;AACb,CAAC,GACD,KAAK,QAAQ;CACX,SAAS;CACT,YAAY;CACZ,OAAO;AACT,CAAC,GACD,KAAK,eAAe;CAAE,qBAAqB;CAAU,QAAQ;AAAO,CAAC,GACrE,KAAK,oBAAoB,EAAE,cAAc,WAAW,CAAC,GACrD,KAAK,OAAO,EAAE,WAAW,OAAO,CAAC,GACjC,KAAK,KAAK,EAAE,cAAc,WAAW,CAAC,CACxC;AAEA,MAAM,aAAa,aAAoE;CACrF,GAAI,QAAQ,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,sBAAsB,QAAQ,QAAQ;CACjF,GAAI,QAAQ,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,sBAAsB,QAAQ,QAAQ;CACjF,GAAI,QAAQ,QAAQ,cAAc,KAAA,IAC9B,CAAC,IACD,EAAE,wBAAwB,QAAQ,OAAO,UAAU;CACvD,GAAI,QAAQ,QAAQ,YAAY,KAAA,IAC5B,CAAC,IACD,EAAE,sBAAsB,QAAQ,OAAO,QAAQ;CACnD,GAAI,QAAQ,QAAQ,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,mBAAmB,QAAQ,OAAO,KAAK;CACvF,GAAI,QAAQ,QAAQ,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,qBAAqB,QAAQ,OAAO,OAAO;AAC/F;;;;;;AAOA,MAAa,SAAS,UAAwB,CAAC,MAC7C,QACE,KAAK;CACH,eAAe;CACf,YAAY;AACd,CAAC,GACD,OAAO,UAAU,OAAO,CAAC,GACzB,KACF;AAEF,MAAa,QAAQ,EAAE,MAAM"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { c as global } from "./styleValue-_G9jwb17.mjs";
|
|
2
|
+
import { n as VAR_PREFIX } from "./core-Bxj0UQDF.mjs";
|
|
3
|
+
//#region src/theme/root.ts
|
|
4
|
+
/**
|
|
5
|
+
* A theme's tokens as `:root` custom properties, for the page stylesheet.
|
|
6
|
+
* Unlayered: the page decides which layer with `Layers.in`.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Every token as `--fk-group-name:value`, in authored order. `omit` is
|
|
10
|
+
* matched token by token, not group by group: two themes can both carry a
|
|
11
|
+
* `knob` group (the scales' density beside a palette's hues) and only the
|
|
12
|
+
* names `omit` has are skipped.
|
|
13
|
+
*/
|
|
14
|
+
const declarations = (theme, omit) => Object.entries(theme).flatMap(([group, names]) => Object.entries(names).flatMap(([name, value]) => omit !== void 0 && Object.hasOwn(omit[group] ?? {}, name) ? [] : [`${VAR_PREFIX}-${group}-${name}:${value}`]));
|
|
15
|
+
const root = (theme, options) => global(`:root{${[...declarations(theme, options?.omit), `color-scheme:${options?.colorScheme ?? "light dark"}`].join(";")}}`);
|
|
16
|
+
/**
|
|
17
|
+
* Token overrides under `selector`: a named theme the Model selects with a
|
|
18
|
+
* root attribute (`:root[data-theme="ocean"]`), a scheme the user chose
|
|
19
|
+
* (`:root[data-color-scheme="dark"]`), or a subtree (`.marketing`). Which
|
|
20
|
+
* one is active is the Model's fact; this only says what it means.
|
|
21
|
+
*
|
|
22
|
+
* `theme` is the theme being overridden and is read only for its type, so a
|
|
23
|
+
* group or token it lacks is a type error rather than a variable nothing reads.
|
|
24
|
+
*/
|
|
25
|
+
const scoped = (_theme, selector, overrides) => {
|
|
26
|
+
const tokens = {};
|
|
27
|
+
for (const [group, names] of Object.entries(overrides)) {
|
|
28
|
+
const defined = {};
|
|
29
|
+
for (const [name, value] of Object.entries(names ?? {})) if (typeof value === "string") defined[name] = value;
|
|
30
|
+
tokens[group] = defined;
|
|
31
|
+
}
|
|
32
|
+
return global(`${selector}{${declarations(tokens).join(";")}}`);
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { scoped as n, root as t };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=root-C1u12YMD.mjs.map
|