@tanishqkancharla/maui 0.0.1 → 0.0.3
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 +51 -2
- package/dist/components/Button.js +1 -2
- package/dist/components/Code.d.ts +5 -0
- package/dist/components/Code.js +35 -0
- package/dist/components/CodeBlock.d.ts +4 -0
- package/dist/components/CodeBlock.js +58 -0
- package/dist/components/Icons.d.ts +10 -0
- package/dist/components/Icons.js +20 -0
- package/dist/components/Input.js +2 -0
- package/dist/components/Select.js +1 -0
- package/dist/maui.d.ts +7 -6
- package/dist/maui.js +7 -7
- package/dist/tokens/background.d.ts +0 -1
- package/dist/tokens/background.js +0 -1
- package/dist/tokens/motion.d.ts +5 -0
- package/dist/tokens/motion.js +7 -3
- package/dist/tokens/prose.d.ts +10 -0
- package/dist/tokens/prose.js +126 -0
- package/dist/tokens/sizing.d.ts +11 -0
- package/dist/tokens/sizing.js +21 -1
- package/dist/utils/mauiShikiTheme.d.ts +87 -0
- package/dist/utils/mauiShikiTheme.js +174 -0
- package/dist/utils/shiki.d.ts +7 -0
- package/dist/utils/shiki.js +69 -0
- package/package.json +35 -6
- package/skills/maui/SKILL.md +83 -0
- package/src/apps/AiChat/AiChat.tsx +418 -0
- package/src/apps/Calendar/Calendar.tsx +1774 -0
- package/src/components/Button.tsx +1 -2
- package/src/components/Code.tsx +61 -0
- package/src/components/CodeBlock.tsx +2 -0
- package/src/components/Icons.tsx +140 -0
- package/src/components/Input.tsx +2 -0
- package/src/components/Select.tsx +1 -0
- package/src/css-modules.d.ts +2 -0
- package/src/dev/AgentationDev.tsx +11 -0
- package/src/index.html +41 -6
- package/src/index.tsx +15 -2
- package/src/maui.ts +26 -8
- package/src/pages/AiChatPage.tsx +26 -0
- package/src/pages/AssistantMessagePage.tsx +98 -0
- package/src/pages/BackgroundColorTokenPage.tsx +8 -14
- package/src/pages/BordersTokenPage.tsx +17 -3
- package/src/pages/CalendarPage.tsx +37 -0
- package/src/pages/{CodeBlockPage.tsx → CodePage.tsx} +39 -9
- package/src/pages/EditorPage.tsx +32 -0
- package/src/pages/FlexTokenPage.tsx +14 -1
- package/src/pages/IconsPage.tsx +137 -30
- package/src/pages/Maui.tsx +54 -15
- package/src/pages/MotionTokenPage.tsx +2 -2
- package/src/pages/ShadowTokenPage.tsx +1 -1
- package/src/pages/SizingTokenPage.tsx +68 -25
- package/src/pages/TextTokenPage.tsx +23 -4
- package/src/patterns/AssistantMessage.tsx +220 -0
- package/src/patterns/Editor.tsx +183 -0
- package/src/patterns/Sidebar.tsx +2 -2
- package/src/public/apple-touch-icon.png +0 -0
- package/src/public/favicon-dark.png +0 -0
- package/src/public/favicon-light.png +0 -0
- package/src/public/favicon.svg +13 -0
- package/src/public/og-dark.png +0 -0
- package/src/public/og-light.png +0 -0
- package/src/public/og.html +471 -0
- package/src/public/og.png +0 -0
- package/src/tokens/background.ts +0 -1
- package/src/tokens/motion.ts +8 -3
- package/src/tokens/prose.ts +130 -0
- package/src/tokens/sizing.ts +29 -1
- package/src/utils/rehypeInlineCodeAnimate.ts +40 -0
- package/src/utils/shiki.ts +28 -4
- package/src/vite-env.d.ts +1 -0
- package/dist/patterns/Loader.d.ts +0 -9
- package/dist/patterns/Loader.js +0 -100
- package/dist/patterns/Sidebar.d.ts +0 -19
- package/dist/patterns/Sidebar.js +0 -96
- package/dist/patterns/Tree.d.ts +0 -32
- package/dist/patterns/Tree.js +0 -173
- package/src/pages/TreePage.tsx +0 -156
- package/src/patterns/Tree.tsx +0 -354
package/README.md
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
# Maui
|
|
2
2
|
|
|
3
|
+
TypeScript-first design system styled with [`purse-styles`](https://www.npmjs.com/package/purse-styles). This repo is the published package and a gallery of tokens, components, patterns, and demo apps.
|
|
4
|
+
|
|
5
|
+
**Gallery:** [maui.tanishqkancharla.dev](https://maui.tanishqkancharla.dev)
|
|
6
|
+
**Package:** [`@tanishqkancharla/maui`](https://www.npmjs.com/package/@tanishqkancharla/maui)
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @tanishqkancharla/maui
|
|
3
12
|
```
|
|
13
|
+
|
|
14
|
+
Wrap the app in `MauiProvider`, then import tokens and components:
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { MauiProvider, Button } from "@tanishqkancharla/maui"
|
|
18
|
+
|
|
19
|
+
function App() {
|
|
20
|
+
return (
|
|
21
|
+
<MauiProvider>
|
|
22
|
+
<Button>Hello</Button>
|
|
23
|
+
</MauiProvider>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Put the exported `themeFoucScript` in a classic inline `<script>` in `<head>` so `data-theme` is correct on first paint.
|
|
29
|
+
|
|
30
|
+
## Develop
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install
|
|
4
34
|
npm run dev
|
|
5
|
-
npm run build
|
|
6
35
|
```
|
|
36
|
+
|
|
37
|
+
Vite serves the gallery at [http://localhost:5173/](http://localhost:5173/).
|
|
38
|
+
|
|
39
|
+
| Script | What it does |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `npm run dev` | Gallery dev server |
|
|
42
|
+
| `npm run build` | Static gallery → `website/` |
|
|
43
|
+
| `npm run build:lib` | Package ESM + types → `dist/` |
|
|
44
|
+
| `npm run serve` | Preview the gallery build |
|
|
45
|
+
| `npx tsc --noEmit` | Type-check |
|
|
46
|
+
|
|
47
|
+
## Package
|
|
48
|
+
|
|
49
|
+
Published as [`@tanishqkancharla/maui`](https://www.npmjs.com/package/@tanishqkancharla/maui). The barrel exports the provider, theme, tokens, and components. Patterns and demo apps in this repo are reference implementations, not part of the package barrel.
|
|
50
|
+
|
|
51
|
+
Agent conventions for consuming Maui: [`skills/maui`](./skills/maui/SKILL.md).
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
|
@@ -18,13 +18,12 @@ const buttonBaseClass = style(text("xs", 400, "highContrast"), focusRing("&:focu
|
|
|
18
18
|
gap: spacing.value(3),
|
|
19
19
|
borderRadius: "4px",
|
|
20
20
|
width: "fit-content",
|
|
21
|
+
height: "28px",
|
|
21
22
|
border: "none",
|
|
22
23
|
textOverflow: "ellipsis",
|
|
23
24
|
overflow: "hidden",
|
|
24
25
|
whiteSpace: "nowrap",
|
|
25
26
|
"& > svg": {
|
|
26
|
-
width: "16px",
|
|
27
|
-
height: "16px",
|
|
28
27
|
flexShrink: 0,
|
|
29
28
|
},
|
|
30
29
|
"&:has(> svg)": {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
type CodeProps = React.HTMLAttributes<HTMLElement>;
|
|
3
|
+
export declare function Code({ className, children, ...props }: CodeProps): React.JSX.Element;
|
|
4
|
+
export declare function Kbd({ className, children, ...props }: CodeProps): React.JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { style, useStyles } from "purse-styles";
|
|
3
|
+
import { colors } from "../tokens/colors";
|
|
4
|
+
import { radius } from "../tokens/radius";
|
|
5
|
+
import { spacing } from "../tokens/spacing";
|
|
6
|
+
import { monospace, text } from "../tokens/text";
|
|
7
|
+
const codeClass = style(monospace, radius.sm, spacing.padding({ x: 2, y: 1 }), {
|
|
8
|
+
backgroundColor: colors.gray[3],
|
|
9
|
+
color: colors.gray[12],
|
|
10
|
+
display: "inline",
|
|
11
|
+
boxDecorationBreak: "clone",
|
|
12
|
+
fontSize: "0.875em",
|
|
13
|
+
whiteSpace: "nowrap",
|
|
14
|
+
});
|
|
15
|
+
const kbdClass = style(text("xs", 400, "lowContrast"), radius.sm, {
|
|
16
|
+
backgroundColor: colors.gray[3],
|
|
17
|
+
boxDecorationBreak: "clone",
|
|
18
|
+
display: "inline-flex",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
paddingInline: 3,
|
|
22
|
+
paddingBlock: 0,
|
|
23
|
+
whiteSpace: "nowrap",
|
|
24
|
+
});
|
|
25
|
+
export function Code({ className, children, ...props }) {
|
|
26
|
+
const codeClassName = useStyles(codeClass);
|
|
27
|
+
return (_jsx("code", { ...props, className: joinClassNames(codeClassName, className), children: children }));
|
|
28
|
+
}
|
|
29
|
+
export function Kbd({ className, children, ...props }) {
|
|
30
|
+
const kbdClassName = useStyles(kbdClass);
|
|
31
|
+
return (_jsx("kbd", { ...props, className: joinClassNames(kbdClassName, className), children: children }));
|
|
32
|
+
}
|
|
33
|
+
function joinClassNames(...classNames) {
|
|
34
|
+
return classNames.filter(Boolean).join(" ");
|
|
35
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { style, useStyles } from "purse-styles";
|
|
4
|
+
import { highlightCode, isSupportedCodeLang } from "../utils/shiki";
|
|
5
|
+
import { backgroundColor } from "../tokens/background";
|
|
6
|
+
import { colors } from "../tokens/colors";
|
|
7
|
+
import { shadow } from "../tokens/shadow";
|
|
8
|
+
import { monospace, text } from "../tokens/text";
|
|
9
|
+
import { useTheme } from "../theme/ThemeContext";
|
|
10
|
+
const codeBlockClass = style(text("xs", 400, "highContrast"), monospace, shadow.subtle, {
|
|
11
|
+
backgroundColor: backgroundColor.app,
|
|
12
|
+
borderRadius: "6px",
|
|
13
|
+
color: colors.gray[12],
|
|
14
|
+
lineHeight: 1.6,
|
|
15
|
+
margin: 0,
|
|
16
|
+
overflowX: "auto",
|
|
17
|
+
padding: "12px",
|
|
18
|
+
"& .shiki": {
|
|
19
|
+
backgroundColor: "transparent !important",
|
|
20
|
+
},
|
|
21
|
+
"& .shiki code": {
|
|
22
|
+
font: "inherit",
|
|
23
|
+
fontSize: "inherit",
|
|
24
|
+
lineHeight: "inherit",
|
|
25
|
+
tabSize: "inherit",
|
|
26
|
+
},
|
|
27
|
+
'& .shiki span[style*="font-weight"]': {
|
|
28
|
+
fontWeight: "500 !important",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const codeClass = style({
|
|
32
|
+
font: "inherit",
|
|
33
|
+
});
|
|
34
|
+
export function CodeBlock(props) {
|
|
35
|
+
const className = useStyles(codeBlockClass);
|
|
36
|
+
const codeClassName = useStyles(codeClass);
|
|
37
|
+
const [html, setHtml] = useState(null);
|
|
38
|
+
const { resolvedTheme } = useTheme();
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!isSupportedCodeLang(props.lang)) {
|
|
41
|
+
setHtml(null);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let cancelled = false;
|
|
45
|
+
highlightCode(props.children, props.lang, resolvedTheme).then((result) => {
|
|
46
|
+
if (!cancelled) {
|
|
47
|
+
setHtml(result);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return () => {
|
|
51
|
+
cancelled = true;
|
|
52
|
+
};
|
|
53
|
+
}, [props.children, props.lang, resolvedTheme]);
|
|
54
|
+
if (!html) {
|
|
55
|
+
return (_jsx("pre", { className: className, children: _jsx("code", { className: codeClassName, children: props.children }) }));
|
|
56
|
+
}
|
|
57
|
+
return (_jsx("div", { className: `maui-code-block ${className}`, dangerouslySetInnerHTML: { __html: html } }));
|
|
58
|
+
}
|
|
@@ -5,12 +5,17 @@ declare function Plus(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
|
5
5
|
declare function Minus(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
6
6
|
declare function DotsHorizontal(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
7
7
|
declare function ArrowDown(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
8
|
+
declare function ArrowUp(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
8
9
|
declare function Star(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
9
10
|
declare function Archive(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
10
11
|
declare function Trash(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
11
12
|
declare function Envelope(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
12
13
|
declare function Clock(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
13
14
|
declare function Pin(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
15
|
+
declare function ChevronLeft(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
16
|
+
declare function ChevronRight(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
17
|
+
declare function Eye(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
18
|
+
declare function Sidebar(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
|
|
14
19
|
export declare const Icons: {
|
|
15
20
|
Search: typeof Search;
|
|
16
21
|
CircleX: typeof CircleX;
|
|
@@ -18,11 +23,16 @@ export declare const Icons: {
|
|
|
18
23
|
Minus: typeof Minus;
|
|
19
24
|
DotsHorizontal: typeof DotsHorizontal;
|
|
20
25
|
ArrowDown: typeof ArrowDown;
|
|
26
|
+
ArrowUp: typeof ArrowUp;
|
|
21
27
|
Star: typeof Star;
|
|
22
28
|
Archive: typeof Archive;
|
|
23
29
|
Trash: typeof Trash;
|
|
24
30
|
Envelope: typeof Envelope;
|
|
25
31
|
Clock: typeof Clock;
|
|
26
32
|
Pin: typeof Pin;
|
|
33
|
+
ChevronLeft: typeof ChevronLeft;
|
|
34
|
+
ChevronRight: typeof ChevronRight;
|
|
35
|
+
Eye: typeof Eye;
|
|
36
|
+
Sidebar: typeof Sidebar;
|
|
27
37
|
};
|
|
28
38
|
export {};
|
package/dist/components/Icons.js
CHANGED
|
@@ -18,6 +18,9 @@ function DotsHorizontal(props) {
|
|
|
18
18
|
function ArrowDown(props) {
|
|
19
19
|
return (_jsxs("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M17.25 13.75L12 19.25L6.75 13.75" }), _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 18.25V4.75" })] }));
|
|
20
20
|
}
|
|
21
|
+
function ArrowUp(props) {
|
|
22
|
+
return (_jsxs("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M17.25 10.25L12 4.75L6.75 10.25" }), _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 19.25V5.75" })] }));
|
|
23
|
+
}
|
|
21
24
|
function Star(props) {
|
|
22
25
|
return (_jsx("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.8, d: "M12 4.75L14.16 9.13L19 9.83L15.5 13.24L16.33 18.06L12 15.78L7.67 18.06L8.5 13.24L5 9.83L9.84 9.13L12 4.75Z" }) }));
|
|
23
26
|
}
|
|
@@ -36,6 +39,18 @@ function Clock(props) {
|
|
|
36
39
|
function Pin(props) {
|
|
37
40
|
return (_jsxs("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.8, d: "M14.83 4.34L19.66 9.17C20.44 9.95 20.44 11.22 19.66 12L17.83 13.83L10.17 6.17L12 4.34C12.78 3.56 14.05 3.56 14.83 4.34Z" }), _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.8, d: "M13.5 10.5L6 18M9.5 14.5L4.75 19.25" })] }));
|
|
38
41
|
}
|
|
42
|
+
function ChevronLeft(props) {
|
|
43
|
+
return (_jsx("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M14.25 5.75L8.75 12L14.25 18.25" }) }));
|
|
44
|
+
}
|
|
45
|
+
function ChevronRight(props) {
|
|
46
|
+
return (_jsx("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9.75 5.75L15.25 12L9.75 18.25" }) }));
|
|
47
|
+
}
|
|
48
|
+
function Eye(props) {
|
|
49
|
+
return (_jsxs("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M3.75 12C5.5 8.75 8.4 6.75 12 6.75C15.6 6.75 18.5 8.75 20.25 12C18.5 15.25 15.6 17.25 12 17.25C8.4 17.25 5.5 15.25 3.75 12Z" }), _jsx("circle", { cx: "12", cy: "12", r: "2.25", stroke: "currentColor", strokeWidth: 1.5 })] }));
|
|
50
|
+
}
|
|
51
|
+
function Sidebar(props) {
|
|
52
|
+
return (_jsxs("svg", { focusable: "false", "aria-hidden": "true", role: "img", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M5.75 5.75H18.25V18.25H5.75V5.75Z" }), _jsx("path", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: 1.5, d: "M9.25 5.75V18.25" })] }));
|
|
53
|
+
}
|
|
39
54
|
export const Icons = {
|
|
40
55
|
Search,
|
|
41
56
|
CircleX,
|
|
@@ -43,10 +58,15 @@ export const Icons = {
|
|
|
43
58
|
Minus,
|
|
44
59
|
DotsHorizontal,
|
|
45
60
|
ArrowDown,
|
|
61
|
+
ArrowUp,
|
|
46
62
|
Star,
|
|
47
63
|
Archive,
|
|
48
64
|
Trash,
|
|
49
65
|
Envelope,
|
|
50
66
|
Clock,
|
|
51
67
|
Pin,
|
|
68
|
+
ChevronLeft,
|
|
69
|
+
ChevronRight,
|
|
70
|
+
Eye,
|
|
71
|
+
Sidebar,
|
|
52
72
|
};
|
package/dist/components/Input.js
CHANGED
|
@@ -17,6 +17,7 @@ const numberFieldDivider = `color-mix(in oklch, ${colors.gray[12]} 5%, ${backgro
|
|
|
17
17
|
const inputClass = style(inputText, focusRing("&:focus-visible", shadowVars.subtle), motion.standard("background", "border-color"), radius.sm, spacing.padding({ x: 4, y: 2 }), shadow.subtle, {
|
|
18
18
|
width: "100%",
|
|
19
19
|
minWidth: 0,
|
|
20
|
+
height: "28px",
|
|
20
21
|
color: colors.gray[12],
|
|
21
22
|
border: "none",
|
|
22
23
|
background: backgroundColor.element,
|
|
@@ -167,6 +168,7 @@ export function NumberField(props) {
|
|
|
167
168
|
const quietInputClass = style(inputText, focusRing(), motion.standard("background", "border-color"), radius.sm, spacing.padding({ x: 4, y: 2 }), {
|
|
168
169
|
width: "100%",
|
|
169
170
|
minWidth: 0,
|
|
171
|
+
height: "28px",
|
|
170
172
|
color: colors.gray[12],
|
|
171
173
|
background: "transparent",
|
|
172
174
|
border: "none",
|
|
@@ -21,6 +21,7 @@ const selectClass = style({
|
|
|
21
21
|
const triggerClass = style(text("sm", 400, "highContrast"), focusRing("&:focus-visible", shadowVars.subtle), motion.standard("background", "border-color"), radius.sm, spacing.padding({ x: 4, y: 2 }), shadow.subtle, {
|
|
22
22
|
display: "flex",
|
|
23
23
|
alignItems: "center",
|
|
24
|
+
height: "28px",
|
|
24
25
|
minWidth: 0,
|
|
25
26
|
color: colors.gray[12],
|
|
26
27
|
border: "none",
|
package/dist/maui.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ export { spacing, type Space } from "./tokens/spacing";
|
|
|
12
12
|
export { flex, flexItem, grid, gridItem } from "./tokens/layout";
|
|
13
13
|
export { text, monospace, baseTextStyle, fontFamily, type TextSize, type TextWeight, type TextColor, } from "./tokens/text";
|
|
14
14
|
export { avatar } from "./tokens/avatar";
|
|
15
|
-
export { motion } from "./tokens/motion";
|
|
16
|
-
export { sizingTokens as sizing } from "./tokens/sizing";
|
|
17
|
-
export { prose, proseRhythm, type ProseSize } from "./tokens/prose";
|
|
15
|
+
export { motion, motionDurationMs, motionEasing, motionStreamDurationMs, } from "./tokens/motion";
|
|
16
|
+
export { icon, iconSizeValues, sizingTokens as sizing, type IconSize, } from "./tokens/sizing";
|
|
17
|
+
export { prose, proseRhythm, proseHtml, proseStreamingMarkers, type ProseSize, } from "./tokens/prose";
|
|
18
18
|
export { visuallyHidden } from "./tokens/visuallyHidden";
|
|
19
19
|
export { Avatar } from "./components/Avatar";
|
|
20
20
|
export { Badge } from "./components/Badge";
|
|
@@ -37,6 +37,7 @@ export { MenuTrigger, Menu, MenuItem, type MenuTriggerProps, type MenuProps, typ
|
|
|
37
37
|
export { FuzzyString } from "./components/FuzzyString";
|
|
38
38
|
export { Flex, Padding, Gap, Spacer, Divider } from "./components/Utils";
|
|
39
39
|
export { H1, H2, H3, H4, P, Label, labelText, Blockquote, Ul, Ol, Li, Link, } from "./components/Typography";
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
40
|
+
export { CodeBlock } from "./components/CodeBlock";
|
|
41
|
+
export { Code, Kbd } from "./components/Code";
|
|
42
|
+
export { CollectionPopover, type CollectionPopoverProps, } from "./components/CollectionPopover";
|
|
43
|
+
export { navigationItem } from "./components/navigationItem";
|
package/dist/maui.js
CHANGED
|
@@ -14,9 +14,9 @@ export { spacing } from "./tokens/spacing";
|
|
|
14
14
|
export { flex, flexItem, grid, gridItem } from "./tokens/layout";
|
|
15
15
|
export { text, monospace, baseTextStyle, fontFamily, } from "./tokens/text";
|
|
16
16
|
export { avatar } from "./tokens/avatar";
|
|
17
|
-
export { motion } from "./tokens/motion";
|
|
18
|
-
export { sizingTokens as sizing } from "./tokens/sizing";
|
|
19
|
-
export { prose, proseRhythm } from "./tokens/prose";
|
|
17
|
+
export { motion, motionDurationMs, motionEasing, motionStreamDurationMs, } from "./tokens/motion";
|
|
18
|
+
export { icon, iconSizeValues, sizingTokens as sizing, } from "./tokens/sizing";
|
|
19
|
+
export { prose, proseRhythm, proseHtml, proseStreamingMarkers, } from "./tokens/prose";
|
|
20
20
|
export { visuallyHidden } from "./tokens/visuallyHidden";
|
|
21
21
|
// Components
|
|
22
22
|
export { Avatar } from "./components/Avatar";
|
|
@@ -40,7 +40,7 @@ export { MenuTrigger, Menu, MenuItem, } from "./components/Menu";
|
|
|
40
40
|
export { FuzzyString } from "./components/FuzzyString";
|
|
41
41
|
export { Flex, Padding, Gap, Spacer, Divider } from "./components/Utils";
|
|
42
42
|
export { H1, H2, H3, H4, P, Label, labelText, Blockquote, Ul, Ol, Li, Link, } from "./components/Typography";
|
|
43
|
-
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
43
|
+
export { CodeBlock } from "./components/CodeBlock";
|
|
44
|
+
export { Code, Kbd } from "./components/Code";
|
|
45
|
+
export { CollectionPopover, } from "./components/CollectionPopover";
|
|
46
|
+
export { navigationItem } from "./components/navigationItem";
|
|
@@ -6,7 +6,6 @@ export declare const backgroundColor: {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const background: {
|
|
8
8
|
app: import("purse-styles").StyleElement;
|
|
9
|
-
subtle: import("purse-styles").StyleElement;
|
|
10
9
|
element: import("purse-styles").StyleElement;
|
|
11
10
|
elementHover: import("purse-styles").StyleElement;
|
|
12
11
|
elementActive: import("purse-styles").StyleElement;
|
|
@@ -25,7 +25,6 @@ export const backgroundColor = {
|
|
|
25
25
|
};
|
|
26
26
|
export const background = {
|
|
27
27
|
app: style({ backgroundColor: backgroundColor.app }),
|
|
28
|
-
subtle: style({ backgroundColor: colors.gray[2] }),
|
|
29
28
|
element: style({ backgroundColor: backgroundColor.element }),
|
|
30
29
|
elementHover: style({ backgroundColor: backgroundColor.elementHover }),
|
|
31
30
|
elementActive: style({ backgroundColor: backgroundColor.elementActive }),
|
package/dist/tokens/motion.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** Maui standard interactive transition timing. */
|
|
2
|
+
export declare const motionDurationMs = 80;
|
|
3
|
+
/** Entrance duration for streaming token reveals (Streamdown word fade). */
|
|
4
|
+
export declare const motionStreamDurationMs = 80;
|
|
5
|
+
export declare const motionEasing = "ease-in-out";
|
|
1
6
|
export declare const motion: {
|
|
2
7
|
readonly standard: (...args: string[]) => import("purse-styles").StyleElement;
|
|
3
8
|
};
|
package/dist/tokens/motion.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { style } from "purse-styles";
|
|
2
2
|
import { memoize } from "../utils/memoize";
|
|
3
|
-
|
|
4
|
-
const
|
|
3
|
+
/** Maui standard interactive transition timing. */
|
|
4
|
+
export const motionDurationMs = 80;
|
|
5
|
+
/** Entrance duration for streaming token reveals (Streamdown word fade). */
|
|
6
|
+
export const motionStreamDurationMs = 80;
|
|
7
|
+
export const motionEasing = "ease-in-out";
|
|
8
|
+
const standardDuration = `${motionDurationMs}ms`;
|
|
5
9
|
export const motion = {
|
|
6
10
|
standard: memoize((...properties) => style({
|
|
7
11
|
transition: properties
|
|
8
|
-
.map((property) => `${property} ${standardDuration} ${
|
|
12
|
+
.map((property) => `${property} ${standardDuration} ${motionEasing}`)
|
|
9
13
|
.join(", "),
|
|
10
14
|
})),
|
|
11
15
|
};
|
package/dist/tokens/prose.d.ts
CHANGED
|
@@ -28,3 +28,13 @@ export declare const prose: (size: ProseSize) => {
|
|
|
28
28
|
* becomes the larger break before it.
|
|
29
29
|
*/
|
|
30
30
|
export declare const proseRhythm: (size: ProseSize) => import("purse-styles").StyleElement;
|
|
31
|
+
/**
|
|
32
|
+
* Element styles + vertical rhythm for HTML rendered outside React typography
|
|
33
|
+
* components (TipTap's ProseMirror tree, Streamdown markdown output).
|
|
34
|
+
*
|
|
35
|
+
* Uses a flex column + `gap` stack so spacing doesn't depend on fragile
|
|
36
|
+
* adjacent-sibling matching across Streamdown's memoized blocks.
|
|
37
|
+
*/
|
|
38
|
+
export declare const proseHtml: (size: ProseSize) => import("purse-styles").StyleElement;
|
|
39
|
+
/** Fade list markers in with Streamdown word animation while streaming. */
|
|
40
|
+
export declare const proseStreamingMarkers: import("purse-styles").StyleElement;
|
package/dist/tokens/prose.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { style } from "purse-styles";
|
|
2
2
|
import { memoize } from "../utils/memoize";
|
|
3
3
|
import { colors } from "./colors";
|
|
4
|
+
import { motionEasing, motionStreamDurationMs } from "./motion";
|
|
4
5
|
import { fontFamily } from "./text";
|
|
5
6
|
const metrics = {
|
|
6
7
|
sm: {
|
|
@@ -115,3 +116,128 @@ export const proseRhythm = memoize((size) => {
|
|
|
115
116
|
[`& > ${notHeading} + h4`]: { marginTop: px(m.h4.marginTop) },
|
|
116
117
|
});
|
|
117
118
|
});
|
|
119
|
+
/**
|
|
120
|
+
* Element styles + vertical rhythm for HTML rendered outside React typography
|
|
121
|
+
* components (TipTap's ProseMirror tree, Streamdown markdown output).
|
|
122
|
+
*
|
|
123
|
+
* Uses a flex column + `gap` stack so spacing doesn't depend on fragile
|
|
124
|
+
* adjacent-sibling matching across Streamdown's memoized blocks.
|
|
125
|
+
*/
|
|
126
|
+
export const proseHtml = memoize((size) => {
|
|
127
|
+
const m = metrics[size];
|
|
128
|
+
return style({
|
|
129
|
+
display: "flex",
|
|
130
|
+
flexDirection: "column",
|
|
131
|
+
gap: px(m.blockGap),
|
|
132
|
+
"& p": {
|
|
133
|
+
...block(m.paragraph),
|
|
134
|
+
fontWeight: 400,
|
|
135
|
+
color: bodyColor,
|
|
136
|
+
margin: 0,
|
|
137
|
+
},
|
|
138
|
+
"& h1": {
|
|
139
|
+
...block(m.h1),
|
|
140
|
+
fontWeight: 700,
|
|
141
|
+
color: headingColor,
|
|
142
|
+
margin: 0,
|
|
143
|
+
},
|
|
144
|
+
"& h2": {
|
|
145
|
+
...block(m.h2),
|
|
146
|
+
fontWeight: 700,
|
|
147
|
+
color: headingColor,
|
|
148
|
+
margin: 0,
|
|
149
|
+
},
|
|
150
|
+
"& h3": {
|
|
151
|
+
...block(m.h3),
|
|
152
|
+
fontWeight: 600,
|
|
153
|
+
color: headingColor,
|
|
154
|
+
margin: 0,
|
|
155
|
+
},
|
|
156
|
+
"& h4": {
|
|
157
|
+
...block(m.h4),
|
|
158
|
+
fontWeight: 600,
|
|
159
|
+
color: headingColor,
|
|
160
|
+
margin: 0,
|
|
161
|
+
},
|
|
162
|
+
"& a": {
|
|
163
|
+
fontWeight: 500,
|
|
164
|
+
color: headingColor,
|
|
165
|
+
textDecoration: "underline",
|
|
166
|
+
},
|
|
167
|
+
"& blockquote": {
|
|
168
|
+
...block(m.paragraph),
|
|
169
|
+
fontWeight: 500,
|
|
170
|
+
fontStyle: "italic",
|
|
171
|
+
color: quoteColor,
|
|
172
|
+
borderLeft: `2px solid ${colors.accent[10]}`,
|
|
173
|
+
paddingLeft: "12px",
|
|
174
|
+
margin: 0,
|
|
175
|
+
},
|
|
176
|
+
"& ul, & ol": {
|
|
177
|
+
...block(m.paragraph),
|
|
178
|
+
fontWeight: 400,
|
|
179
|
+
color: bodyColor,
|
|
180
|
+
paddingInlineStart: px(m.listPadding),
|
|
181
|
+
margin: 0,
|
|
182
|
+
listStyleType: "none",
|
|
183
|
+
},
|
|
184
|
+
"& ol": {
|
|
185
|
+
counterReset: "maui-ol",
|
|
186
|
+
},
|
|
187
|
+
"& ul > li, & ol > li": {
|
|
188
|
+
position: "relative",
|
|
189
|
+
},
|
|
190
|
+
"& ul > li::before": {
|
|
191
|
+
content: '"•"',
|
|
192
|
+
position: "absolute",
|
|
193
|
+
left: px(-m.listPadding),
|
|
194
|
+
width: px(m.listPadding),
|
|
195
|
+
color: colors.gray[11],
|
|
196
|
+
textAlign: "center",
|
|
197
|
+
},
|
|
198
|
+
"& ol > li": {
|
|
199
|
+
counterIncrement: "maui-ol",
|
|
200
|
+
},
|
|
201
|
+
"& ol > li::before": {
|
|
202
|
+
content: 'counter(maui-ol) "."',
|
|
203
|
+
position: "absolute",
|
|
204
|
+
left: px(-m.listPadding),
|
|
205
|
+
width: px(m.listPadding),
|
|
206
|
+
color: colors.gray[11],
|
|
207
|
+
textAlign: "right",
|
|
208
|
+
paddingRight: "0.4em",
|
|
209
|
+
boxSizing: "border-box",
|
|
210
|
+
},
|
|
211
|
+
"& ul > li + li, & ol > li + li": {
|
|
212
|
+
marginTop: px(m.listItemGap),
|
|
213
|
+
},
|
|
214
|
+
"& li > ul, & li > ol": {
|
|
215
|
+
marginTop: px(m.listNestedGap),
|
|
216
|
+
},
|
|
217
|
+
"& strong": { fontWeight: 600 },
|
|
218
|
+
"& em": { fontStyle: "italic" },
|
|
219
|
+
"& code": {
|
|
220
|
+
fontFamily: 'ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
|
|
221
|
+
fontSize: "0.875em",
|
|
222
|
+
},
|
|
223
|
+
"& pre, & .maui-code-block": {
|
|
224
|
+
margin: 0,
|
|
225
|
+
overflowX: "auto",
|
|
226
|
+
minWidth: 0,
|
|
227
|
+
},
|
|
228
|
+
"& hr": {
|
|
229
|
+
border: "none",
|
|
230
|
+
borderTop: `1px solid ${colors.gray[6]}`,
|
|
231
|
+
margin: 0,
|
|
232
|
+
},
|
|
233
|
+
"& table": {
|
|
234
|
+
margin: 0,
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
/** Fade list markers in with Streamdown word animation while streaming. */
|
|
239
|
+
export const proseStreamingMarkers = style({
|
|
240
|
+
"& li::before": {
|
|
241
|
+
animation: `sd-fadeIn ${motionStreamDurationMs}ms ${motionEasing} both`,
|
|
242
|
+
},
|
|
243
|
+
});
|
package/dist/tokens/sizing.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import type { TextSize } from "./text";
|
|
2
|
+
/** Same t-shirt scale as `text(...)`. */
|
|
3
|
+
export type IconSize = TextSize;
|
|
4
|
+
/**
|
|
5
|
+
* Icon box sizes paired with text sizes. Values sit slightly above the
|
|
6
|
+
* matching font-size so stroke icons balance optically next to type.
|
|
7
|
+
* Intrinsic SVG artwork is 24×24 (`xl`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const iconSizeValues: Record<IconSize, string>;
|
|
10
|
+
export declare const icon: (size: TextSize) => import("purse-styles").StyleElement;
|
|
1
11
|
export declare const sizingTokens: {
|
|
12
|
+
/** @deprecated Prefer `icon("sm")` — kept as the default inline icon size. */
|
|
2
13
|
readonly icon: import("purse-styles").StyleElement;
|
|
3
14
|
readonly fullWidth: import("purse-styles").StyleElement;
|
|
4
15
|
readonly contentWidth: import("purse-styles").StyleElement;
|
package/dist/tokens/sizing.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { style } from "purse-styles";
|
|
2
|
+
import { memoize } from "../utils/memoize";
|
|
3
|
+
/**
|
|
4
|
+
* Icon box sizes paired with text sizes. Values sit slightly above the
|
|
5
|
+
* matching font-size so stroke icons balance optically next to type.
|
|
6
|
+
* Intrinsic SVG artwork is 24×24 (`xl`).
|
|
7
|
+
*/
|
|
8
|
+
export const iconSizeValues = {
|
|
9
|
+
"2xs": "12px",
|
|
10
|
+
xs: "14px",
|
|
11
|
+
sm: "16px",
|
|
12
|
+
md: "18px",
|
|
13
|
+
lg: "20px",
|
|
14
|
+
xl: "24px",
|
|
15
|
+
};
|
|
16
|
+
export const icon = memoize((size) => style({
|
|
17
|
+
width: iconSizeValues[size],
|
|
18
|
+
height: iconSizeValues[size],
|
|
19
|
+
flexShrink: 0,
|
|
20
|
+
}));
|
|
2
21
|
export const sizingTokens = {
|
|
3
|
-
|
|
22
|
+
/** @deprecated Prefer `icon("sm")` — kept as the default inline icon size. */
|
|
23
|
+
icon: icon("sm"),
|
|
4
24
|
fullWidth: style({ width: "100%" }),
|
|
5
25
|
contentWidth: style({ maxWidth: "72ch" }),
|
|
6
26
|
};
|