@tenphi/renderer 0.28.0 → 0.30.1
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 +6 -4
- package/dist/client/elements.d.ts +11 -0
- package/dist/client/elements.d.ts.map +1 -0
- package/dist/client/elements.js +16 -0
- package/dist/client/elements.js.map +1 -0
- package/dist/client/navigation.js +1 -1
- package/dist/client/navigation.js.map +1 -1
- package/dist/components/Banner.styles.js +1 -1
- package/dist/components/Button.styles.js +1 -1
- package/dist/components/Card.astro +3 -4
- package/dist/components/Card.styles.js +16 -25
- package/dist/components/Document.styles.js +19 -40
- package/dist/components/Footer.styles.js +5 -5
- package/dist/components/Header.styles.js +2 -2
- package/dist/components/HeaderFrame.styles.js +1 -1
- package/dist/components/HeaderLinks.styles.js +25 -15
- package/dist/components/Hero.styles.js +8 -8
- package/dist/components/LanguageSelect.styles.js +5 -6
- package/dist/components/MainContent.styles.js +6 -8
- package/dist/components/MainPane.styles.js +2 -2
- package/dist/components/MarkdownAlert.styles.js +13 -13
- package/dist/components/MarkdownCodeBlock.styles.js +7 -10
- package/dist/components/MarkdownContent.styles.js +11 -17
- package/dist/components/MarkdownHeading.styles.js +4 -6
- package/dist/components/MarkdownInlineCode.styles.js +1 -1
- package/dist/components/MarkdownTable.styles.js +7 -10
- package/dist/components/Mermaid.styles.js +2 -2
- package/dist/components/MermaidSource.styles.js +1 -1
- package/dist/components/MobileMenuFooter.styles.js +5 -5
- package/dist/components/MobileMenuToggle.styles.js +2 -2
- package/dist/components/MobileNavigationTabs.styles.js +9 -10
- package/dist/components/MobileTableOfContents.styles.js +7 -7
- package/dist/components/PackageVersion.styles.js +1 -1
- package/dist/components/PageActions.styles.js +3 -3
- package/dist/components/PageFrame.styles.js +1 -1
- package/dist/components/Pagination.styles.js +13 -18
- package/dist/components/Preview.styles.js +1 -1
- package/dist/components/Search.styles.js +7 -8
- package/dist/components/SearchButton.styles.js +13 -5
- package/dist/components/SearchResults.styles.js +20 -20
- package/dist/components/Sidebar.styles.js +17 -19
- package/dist/components/SkipLink.styles.js +4 -3
- package/dist/components/SocialIcons.styles.js +1 -1
- package/dist/components/Steps.styles.js +3 -3
- package/dist/components/TableOfContents.styles.js +3 -3
- package/dist/components/TableOfContentsLayout.styles.js +2 -2
- package/dist/components/ThemeSelect.styles.js +16 -16
- package/dist/components/TopNavigation.styles.js +1 -3
- package/dist/components/VersionSwitcher.styles.js +4 -4
- package/dist/components/select-popover-styles.js +14 -14
- package/dist/define-component.d.ts.map +1 -1
- package/dist/define-component.js +20 -1
- package/dist/define-component.js.map +1 -0
- package/dist/eslint-plugin.d.ts +0 -5
- package/dist/eslint-plugin.d.ts.map +1 -1
- package/dist/eslint-plugin.js +0 -5
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styling.js +2 -2
- package/dist/styling.js.map +1 -1
- package/package.json +6 -4
- package/dist/components/inherit-component-parts.d.ts +0 -1
- package/dist/components/inherit-component-parts.js +0 -7
- package/dist/define-component-BP4YwMak.js +0 -28
- package/dist/define-component-BP4YwMak.js.map +0 -1
package/dist/styling.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as resolveComponentStyles } from "./component-styles-DstqPFf3.js";
|
|
2
2
|
import { t as configureCookbookStates } from "./tasty-states-BIgiJQ3N.js";
|
|
3
|
-
import {
|
|
3
|
+
import { defineComponent, extendComponent } from "./define-component.js";
|
|
4
4
|
import { mergeStyles, tasty, useGlobalStyles } from "@tenphi/tasty";
|
|
5
5
|
//#region src/components/Button.styles.js
|
|
6
6
|
/** Shared button foundation; descendants own their layout and interaction anatomy. */
|
|
@@ -9,7 +9,7 @@ const Button = defineComponent("Button", {
|
|
|
9
9
|
styles: {
|
|
10
10
|
display: "flex",
|
|
11
11
|
alignItems: "center",
|
|
12
|
-
gap: "
|
|
12
|
+
gap: "1x",
|
|
13
13
|
blockSize: "min 0",
|
|
14
14
|
color: "#text-soft",
|
|
15
15
|
cursor: "pointer"
|
package/dist/styling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styling.js","names":[],"sources":["../src/components/Button.styles.js","../src/styling.ts"],"sourcesContent":["import { defineComponent } from \"../define-component.js\";\n\n/** Shared button foundation; descendants own their layout and interaction anatomy. */\nexport const Button = defineComponent(\"Button\", {\n as: \"button\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"
|
|
1
|
+
{"version":3,"file":"styling.js","names":[],"sources":["../src/components/Button.styles.js","../src/styling.ts"],"sourcesContent":["import { defineComponent } from \"../define-component.js\";\n\n/** Shared button foundation; descendants own their layout and interaction anatomy. */\nexport const Button = defineComponent(\"Button\", {\n as: \"button\",\n styles: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"1x\",\n blockSize: \"min 0\",\n color: \"#text-soft\",\n cursor: \"pointer\",\n },\n});\n","import { configureCookbookStates } from \"./components/tasty-states.js\";\n\n// Consumer components can be evaluated before Cookbook's own components.\nconfigureCookbookStates();\n\nexport { tasty, useGlobalStyles, mergeStyles } from \"@tenphi/tasty\";\nexport type { Styles } from \"@tenphi/tasty\";\nexport { defineComponent, extendComponent } from \"./define-component.js\";\nexport { Button } from \"./components/Button.styles.js\";\nexport { resolveComponentStyles } from \"./components/component-styles.js\";\n"],"mappings":";;;;;;AAGA,MAAa,SAAS,gBAAgB,UAAU;CAC9C,IAAI;CACJ,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,KAAK;EACL,WAAW;EACX,OAAO;EACP,QAAQ;CACV;AACF,CAAC;;;ACVD,wBAAwB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"description": "Astro renderer and Tasty theme for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -61,10 +61,12 @@
|
|
|
61
61
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
62
62
|
"@fontsource-variable/onest": "^5.3.0",
|
|
63
63
|
"@pagefind/default-ui": "1.5.2",
|
|
64
|
-
"@tenphi/docs": "0.
|
|
65
|
-
"@tenphi/eslint-plugin-tasty": "1.
|
|
64
|
+
"@tenphi/docs": "0.30.1",
|
|
65
|
+
"@tenphi/eslint-plugin-tasty": "1.12.0",
|
|
66
66
|
"@tenphi/glaze": "2.0.1",
|
|
67
|
-
"@tenphi/tasty": "3.
|
|
67
|
+
"@tenphi/tasty": "3.14.0",
|
|
68
|
+
"@uniaria/core": "0.3.0",
|
|
69
|
+
"@uniaria/elements": "0.3.0",
|
|
68
70
|
"beautiful-mermaid": "^1.1.3",
|
|
69
71
|
"hast-util-from-html": "^2.0.3",
|
|
70
72
|
"pagefind": "1.5.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function inheritComponentParts<T>(base: object, extended: T): T;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Tasty wrappers forward styles but do not copy compound component exports. */
|
|
2
|
-
export function inheritComponentParts(base, extended) {
|
|
3
|
-
for (const [name, part] of Object.entries(base)) {
|
|
4
|
-
if (/^[A-Z]/.test(name)) extended[name] = part;
|
|
5
|
-
}
|
|
6
|
-
return extended;
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { n as resolveComponentStyles } from "./component-styles-DstqPFf3.js";
|
|
2
|
-
import { tasty } from "@tenphi/tasty";
|
|
3
|
-
//#region src/components/inherit-component-parts.js
|
|
4
|
-
/** Tasty wrappers forward styles but do not copy compound component exports. */
|
|
5
|
-
function inheritComponentParts(base, extended) {
|
|
6
|
-
for (const [name, part] of Object.entries(base)) if (/^[A-Z]/.test(name)) extended[name] = part;
|
|
7
|
-
return extended;
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/define-component.ts
|
|
11
|
-
/** Extend a component's styles and defaults, preserving its props and compound parts. */
|
|
12
|
-
function extendComponent(name, base, options) {
|
|
13
|
-
return inheritComponentParts(base, tasty(base, {
|
|
14
|
-
...options,
|
|
15
|
-
styles: resolveComponentStyles(name, options.styles ?? {})
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
/** Create a named component with its built-in or custom theme styles merged into its defaults. */
|
|
19
|
-
function defineComponent(name, options) {
|
|
20
|
-
return tasty({
|
|
21
|
-
...options,
|
|
22
|
-
styles: resolveComponentStyles(name, options.styles ?? {})
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { extendComponent as n, defineComponent as t };
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=define-component-BP4YwMak.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-component-BP4YwMak.js","names":[],"sources":["../src/components/inherit-component-parts.js","../src/define-component.ts"],"sourcesContent":["/** Tasty wrappers forward styles but do not copy compound component exports. */\nexport function inheritComponentParts(base, extended) {\n for (const [name, part] of Object.entries(base)) {\n if (/^[A-Z]/.test(name)) extended[name] = part;\n }\n return extended;\n}\n","import {\n tasty,\n type ElementsDefinition,\n type ModPropsInput,\n type StylesInterface,\n type Styles,\n type SubElementProps,\n type TastyElementOptions,\n type TastyPolymorphicComponent,\n type TokenPropsInput,\n type VariantMap,\n} from \"@tenphi/tasty\";\nimport type {\n ComponentProps,\n ComponentType,\n ElementType,\n ForwardRefExoticComponent,\n JSX,\n PropsWithoutRef,\n RefAttributes,\n} from \"react\";\nimport { resolveComponentStyles } from \"./components/component-styles.js\";\nimport { inheritComponentParts } from \"./components/inherit-component-parts.js\";\n\ntype InheritedParts<C> = {\n [\n Name in keyof C as Name extends string\n ? Name extends Capitalize<Name>\n ? C[Name] extends ComponentType<any>\n ? Name\n : never\n : never\n : never\n ]: C[Name];\n};\n\ntype SubElementTag<Definition extends ElementsDefinition[string]> =\n Definition extends string\n ? Definition\n : Definition extends { as?: infer Tag }\n ? Tag extends keyof JSX.IntrinsicElements\n ? Tag\n : \"div\"\n : \"div\";\n\n// Use public Tasty types so declarations do not leak its private sub-element aliases.\ntype SubElements<E extends ElementsDefinition> = {\n [Name in keyof E]: ForwardRefExoticComponent<\n PropsWithoutRef<SubElementProps<SubElementTag<E[Name]>>> &\n RefAttributes<\n SubElementTag<E[Name]> extends keyof HTMLElementTagNameMap\n ? HTMLElementTagNameMap[SubElementTag<E[Name]>]\n : unknown\n >\n >;\n};\n\n/** Extend a component's styles and defaults, preserving its props and compound parts. */\nexport function extendComponent<C extends ComponentType<any>>(\n name: string,\n base: C,\n options: Partial<Omit<ComponentProps<C>, \"as\" | \"styles\">> & {\n styles?: Styles;\n },\n): ComponentType<ComponentProps<C>> & InheritedParts<C> {\n const extended = tasty(base, {\n ...options,\n styles: resolveComponentStyles(name, options.styles ?? {}),\n });\n // Tasty's wrapper type erases compound exports and makes every prop optional.\n // Restore the copied parts and conservatively keep the base's required props.\n return inheritComponentParts(base, extended) as unknown as ComponentType<\n ComponentProps<C>\n > &\n InheritedParts<C>;\n}\n\n/** Create a named component with its built-in or custom theme styles merged into its defaults. */\nexport function defineComponent<\n K extends readonly (keyof StylesInterface)[],\n V extends VariantMap,\n E extends ElementsDefinition = Record<string, never>,\n AsType extends ElementType = \"div\",\n M extends ModPropsInput = readonly never[],\n TP extends TokenPropsInput = readonly never[],\n>(\n name: string,\n options: TastyElementOptions<K, V, E, AsType, M, TP>,\n): TastyPolymorphicComponent<AsType, K, V, M, TP> & SubElements<E> {\n return tasty<K, V, E, AsType, M, TP>({\n ...options,\n styles: resolveComponentStyles(name, options.styles ?? {}),\n }) as TastyPolymorphicComponent<AsType, K, V, M, TP> & SubElements<E>;\n}\n"],"mappings":";;;;AACA,SAAgB,sBAAsB,MAAM,UAAU;CACpD,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,IAAI,GAC5C,IAAI,SAAS,KAAK,IAAI,GAAG,SAAS,QAAQ;CAE5C,OAAO;AACT;;;;ACoDA,SAAgB,gBACd,MACA,MACA,SAGsD;CAOtD,OAAO,sBAAsB,MANZ,MAAM,MAAM;EAC3B,GAAG;EACH,QAAQ,uBAAuB,MAAM,QAAQ,UAAU,CAAC,CAAC;CAC3D,CAGmC,CAAQ;AAI7C;;AAGA,SAAgB,gBAQd,MACA,SACiE;CACjE,OAAO,MAA8B;EACnC,GAAG;EACH,QAAQ,uBAAuB,MAAM,QAAQ,UAAU,CAAC,CAAC;CAC3D,CAAC;AACH"}
|