tinywidgets 0.0.11 → 1.0.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/.eslintrc.json +2 -1
- package/bun.lockb +0 -0
- package/package.json +19 -14
- package/src/common/functions.tsx +54 -0
- package/src/components/App/index.css.ts +81 -0
- package/src/components/App/index.tsx +177 -0
- package/src/components/Button/index.css.ts +66 -0
- package/src/components/Button/index.tsx +206 -0
- package/src/components/Card/index.css.ts +12 -0
- package/src/components/Card/index.tsx +34 -0
- package/src/components/Code/index.css.ts +49 -0
- package/src/components/Code/index.tsx +89 -0
- package/src/components/Collapsible/index.css.ts +37 -0
- package/src/components/Collapsible/index.tsx +132 -0
- package/src/{Detail → components/Detail}/index.css.ts +3 -3
- package/src/components/Detail/index.tsx +48 -0
- package/src/{Hr → components/Hr}/index.css.ts +3 -2
- package/src/components/Hr/index.tsx +26 -0
- package/src/components/Image/index.css.ts +38 -0
- package/src/components/Image/index.tsx +85 -0
- package/src/components/Metric/index.tsx +59 -0
- package/src/components/Row/index.css.ts +30 -0
- package/src/components/Row/index.tsx +104 -0
- package/src/components/Summary/index.css.ts +16 -0
- package/src/components/Summary/index.tsx +59 -0
- package/src/{Tag → components/Tag}/index.css.ts +9 -6
- package/src/components/Tag/index.tsx +73 -0
- package/src/css/code.css.ts +112 -0
- package/src/css/colors.css.ts +124 -0
- package/src/css/dimensions.css.ts +67 -0
- package/src/css/global.css.ts +11 -0
- package/src/css/screens.ts +15 -0
- package/src/index.css.ts +4 -137
- package/src/index.ts +16 -24
- package/src/stores/LocalStore.tsx +52 -19
- package/src/stores/RouteStore.tsx +103 -0
- package/src/stores/SessionStore.tsx +40 -25
- package/src/stores/common.ts +6 -0
- package/tsconfig.json +19 -0
- package/.prettierrc +0 -5
- package/index.css.ts +0 -1
- package/index.ts +0 -12
- package/src/App/index.tsx +0 -18
- package/src/Avatar/index.css.ts +0 -17
- package/src/Avatar/index.tsx +0 -25
- package/src/Axis/index.css.ts +0 -19
- package/src/Axis/index.tsx +0 -36
- package/src/Button/index.css.ts +0 -57
- package/src/Button/index.tsx +0 -63
- package/src/Card/index.css.ts +0 -9
- package/src/Card/index.tsx +0 -13
- package/src/Collapsible/index.css.ts +0 -34
- package/src/Collapsible/index.tsx +0 -75
- package/src/Detail/index.tsx +0 -26
- package/src/Hr/index.tsx +0 -8
- package/src/Metric/index.tsx +0 -26
- package/src/Summary/index.css.ts +0 -17
- package/src/Summary/index.tsx +0 -32
- package/src/Tag/index.tsx +0 -26
- package/src/Ui/Header/DarkButton/index.tsx +0 -19
- package/src/Ui/Header/SideNav/index.css.ts +0 -23
- package/src/Ui/Header/SideNav/index.tsx +0 -14
- package/src/Ui/Header/SideNavButton/index.css.ts +0 -4
- package/src/Ui/Header/SideNavButton/index.tsx +0 -19
- package/src/Ui/Header/Title/index.css.ts +0 -10
- package/src/Ui/Header/Title/index.tsx +0 -9
- package/src/Ui/Header/TopNav/index.css.ts +0 -9
- package/src/Ui/Header/TopNav/index.tsx +0 -18
- package/src/Ui/Header/index.css.ts +0 -18
- package/src/Ui/Header/index.tsx +0 -32
- package/src/Ui/Main/Article/index.css.ts +0 -13
- package/src/Ui/Main/Article/index.tsx +0 -9
- package/src/Ui/Main/Footer/index.css.ts +0 -12
- package/src/Ui/Main/Footer/index.tsx +0 -9
- package/src/Ui/Main/index.css.ts +0 -16
- package/src/Ui/Main/index.tsx +0 -24
- package/src/Ui/index.css.ts +0 -9
- package/src/Ui/index.tsx +0 -50
- package/utils.ts +0 -1
- /package/src/{Metric → components/Metric}/index.css.ts +0 -0
package/src/Button/index.css.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {style, styleVariants} from '@vanilla-extract/css';
|
|
2
|
-
import {axisLike, borderLike, radiusLike, theme} from '../index.css';
|
|
3
|
-
|
|
4
|
-
const ghostLike = {
|
|
5
|
-
backgroundColor: 'transparent',
|
|
6
|
-
border: 0,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const button = style([
|
|
10
|
-
axisLike,
|
|
11
|
-
radiusLike,
|
|
12
|
-
{
|
|
13
|
-
textAlign: 'left',
|
|
14
|
-
cursor: 'pointer',
|
|
15
|
-
padding: '0.5rem 1rem',
|
|
16
|
-
outlineOffset: '-2px',
|
|
17
|
-
backgroundColor: theme.background,
|
|
18
|
-
color: 'inherit',
|
|
19
|
-
overflow: 'hidden',
|
|
20
|
-
whiteSpace: 'nowrap',
|
|
21
|
-
transition: 'background-color 0.2s,border-color 0.2s',
|
|
22
|
-
flexShrink: 0,
|
|
23
|
-
selectors: {
|
|
24
|
-
'&:hover': {
|
|
25
|
-
backgroundColor: theme.backgroundHover,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
]);
|
|
30
|
-
|
|
31
|
-
export const buttonVariant = styleVariants({
|
|
32
|
-
default: borderLike,
|
|
33
|
-
accent: {
|
|
34
|
-
...borderLike,
|
|
35
|
-
backgroundColor: theme.accent,
|
|
36
|
-
color: theme.accentContrast,
|
|
37
|
-
border: 0,
|
|
38
|
-
selectors: {
|
|
39
|
-
'&:hover': {
|
|
40
|
-
backgroundColor: theme.accentHover,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
ghost: ghostLike,
|
|
45
|
-
item: {...ghostLike, width: '100%'},
|
|
46
|
-
icon: {...ghostLike, padding: '0.25rem'},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export const highlight = style({
|
|
50
|
-
backgroundColor: theme.backgroundHover,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export const labelStyle = style({
|
|
54
|
-
flex: 1,
|
|
55
|
-
overflow: 'hidden',
|
|
56
|
-
textOverflow: 'ellipsis',
|
|
57
|
-
});
|
package/src/Button/index.tsx
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
/** @jsxFrag Fragment */
|
|
3
|
-
|
|
4
|
-
import type {ComponentType, ReactNode, Ref} from 'react';
|
|
5
|
-
import {iconSize} from '../index.css.ts';
|
|
6
|
-
import {classNames, createElement, forwardRef, useCallback} from '../index.ts';
|
|
7
|
-
import {button, buttonVariant, highlight, labelStyle} from './index.css.ts';
|
|
8
|
-
|
|
9
|
-
export const Button = forwardRef(
|
|
10
|
-
(
|
|
11
|
-
{
|
|
12
|
-
icon: Icon,
|
|
13
|
-
label,
|
|
14
|
-
labelRight,
|
|
15
|
-
iconRight: IconRight,
|
|
16
|
-
onClick,
|
|
17
|
-
variant = 'default',
|
|
18
|
-
className,
|
|
19
|
-
href,
|
|
20
|
-
title,
|
|
21
|
-
current,
|
|
22
|
-
}: {
|
|
23
|
-
icon?: ComponentType<{className?: string}>;
|
|
24
|
-
label?: ReactNode;
|
|
25
|
-
labelRight?: ReactNode;
|
|
26
|
-
iconRight?: ComponentType<{className?: string}>;
|
|
27
|
-
onClick?: () => void;
|
|
28
|
-
variant?: keyof typeof buttonVariant;
|
|
29
|
-
className?: string;
|
|
30
|
-
href?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
current?: boolean;
|
|
33
|
-
},
|
|
34
|
-
ref: Ref<HTMLButtonElement>,
|
|
35
|
-
) => {
|
|
36
|
-
const icon = Icon ? <Icon className={iconSize} /> : null;
|
|
37
|
-
const iconRight = IconRight ? <IconRight className={iconSize} /> : null;
|
|
38
|
-
|
|
39
|
-
const hrefClick = useCallback(
|
|
40
|
-
() => (href ? open(href, '_blank', 'noreferrer') : null),
|
|
41
|
-
[href],
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<button
|
|
46
|
-
className={classNames(
|
|
47
|
-
button,
|
|
48
|
-
buttonVariant[variant],
|
|
49
|
-
current && highlight,
|
|
50
|
-
className,
|
|
51
|
-
)}
|
|
52
|
-
onClick={onClick ?? hrefClick}
|
|
53
|
-
title={title}
|
|
54
|
-
ref={ref}
|
|
55
|
-
>
|
|
56
|
-
{icon}
|
|
57
|
-
{label ? <span className={labelStyle}>{label}</span> : null}
|
|
58
|
-
{labelRight}
|
|
59
|
-
{iconRight}
|
|
60
|
-
</button>
|
|
61
|
-
);
|
|
62
|
-
},
|
|
63
|
-
);
|
package/src/Card/index.css.ts
DELETED
package/src/Card/index.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import {classNames, createElement} from '../';
|
|
5
|
-
import {card} from './index.css';
|
|
6
|
-
|
|
7
|
-
export const Card = ({
|
|
8
|
-
children,
|
|
9
|
-
className,
|
|
10
|
-
}: {
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
}) => <div className={classNames(card, className)}>{children}</div>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {style} from '@vanilla-extract/css';
|
|
2
|
-
import {borderLike, dimensions, paddingLike, radiusLike} from '../index.css';
|
|
3
|
-
|
|
4
|
-
export const collapsible = style([
|
|
5
|
-
borderLike,
|
|
6
|
-
radiusLike,
|
|
7
|
-
{
|
|
8
|
-
display: 'grid',
|
|
9
|
-
gridTemplateRows: 'max-content minmax(0, 0fr)',
|
|
10
|
-
transition: '.2s grid-template-rows ease-in-out',
|
|
11
|
-
overflow: 'hidden',
|
|
12
|
-
marginBottom: dimensions.padding,
|
|
13
|
-
selectors: {
|
|
14
|
-
'&:last-child': {
|
|
15
|
-
marginBottom: 0,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
]);
|
|
20
|
-
|
|
21
|
-
export const collapsibleOpen = style({
|
|
22
|
-
gridTemplateRows: 'max-content minmax(0, 1fr)',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const button = style({
|
|
26
|
-
margin: '-1px',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const buttonOpen = style({
|
|
30
|
-
borderBottomLeftRadius: 0,
|
|
31
|
-
borderBottomRightRadius: 0,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const content = style([paddingLike, {overflow: 'hidden'}]);
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
4
|
-
import {ChevronDown, ChevronRight} from 'lucide-react';
|
|
5
|
-
import {Button} from '../Button/index.tsx';
|
|
6
|
-
import {
|
|
7
|
-
classNames,
|
|
8
|
-
createElement,
|
|
9
|
-
useCallback,
|
|
10
|
-
useRef,
|
|
11
|
-
useState,
|
|
12
|
-
} from '../index.ts';
|
|
13
|
-
import {
|
|
14
|
-
useCollapsibleOpen,
|
|
15
|
-
useSetCollapsibleOpen,
|
|
16
|
-
} from '../stores/SessionStore.tsx';
|
|
17
|
-
import {
|
|
18
|
-
button,
|
|
19
|
-
buttonOpen,
|
|
20
|
-
collapsible,
|
|
21
|
-
collapsibleOpen,
|
|
22
|
-
content,
|
|
23
|
-
} from './index.css.ts';
|
|
24
|
-
|
|
25
|
-
export const Collapsible = ({
|
|
26
|
-
id = '',
|
|
27
|
-
icon: Icon,
|
|
28
|
-
label = <div />,
|
|
29
|
-
labelRight = <div />,
|
|
30
|
-
startOpen = false,
|
|
31
|
-
className,
|
|
32
|
-
children,
|
|
33
|
-
}: {
|
|
34
|
-
id?: string;
|
|
35
|
-
icon?: ComponentType<{className?: string}>;
|
|
36
|
-
label?: ReactNode;
|
|
37
|
-
labelRight?: ReactNode;
|
|
38
|
-
startOpen?: boolean;
|
|
39
|
-
className?: string;
|
|
40
|
-
children: ReactNode;
|
|
41
|
-
}) => {
|
|
42
|
-
// State is in session Store if id is present, otherwise here in component.
|
|
43
|
-
const storedIsOpen = useCollapsibleOpen(id) ?? startOpen;
|
|
44
|
-
const setStoredIsOpen = useSetCollapsibleOpen(id);
|
|
45
|
-
const [stateIsOpen, setStateIsOpen] = useState(startOpen);
|
|
46
|
-
|
|
47
|
-
const isOpen = id ? storedIsOpen : stateIsOpen;
|
|
48
|
-
const setIsOpen = id ? setStoredIsOpen : setStateIsOpen;
|
|
49
|
-
|
|
50
|
-
const [render, setRender] = useState(isOpen);
|
|
51
|
-
const timer = useRef<Timer>();
|
|
52
|
-
|
|
53
|
-
const toggle = useCallback(() => {
|
|
54
|
-
setIsOpen(!isOpen);
|
|
55
|
-
clearTimeout(timer.current);
|
|
56
|
-
timer.current = setTimeout(() => setRender(!isOpen), isOpen ? 200 : 0);
|
|
57
|
-
}, [id, isOpen]);
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div className={classNames(collapsible, isOpen && collapsibleOpen)}>
|
|
61
|
-
<Button
|
|
62
|
-
onClick={toggle}
|
|
63
|
-
icon={Icon}
|
|
64
|
-
label={label}
|
|
65
|
-
labelRight={labelRight}
|
|
66
|
-
iconRight={isOpen ? ChevronDown : ChevronRight}
|
|
67
|
-
className={classNames(button, render && buttonOpen)}
|
|
68
|
-
current={render}
|
|
69
|
-
/>
|
|
70
|
-
{render ? (
|
|
71
|
-
<div className={classNames(content, className)}>{children}</div>
|
|
72
|
-
) : null}
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
};
|
package/src/Detail/index.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ReactNode} from 'react';
|
|
4
|
-
import {classNames, createElement} from '../';
|
|
5
|
-
import {detailCell, detailRow, detailTable} from './index.css';
|
|
6
|
-
|
|
7
|
-
export const Detail = ({
|
|
8
|
-
data,
|
|
9
|
-
className,
|
|
10
|
-
}: {
|
|
11
|
-
data: Record<string, ReactNode>;
|
|
12
|
-
className?: string;
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<table className={classNames(detailTable, className)}>
|
|
16
|
-
<tbody>
|
|
17
|
-
{Object.entries(data).map(([key, value]) => (
|
|
18
|
-
<tr key={key} className={detailRow}>
|
|
19
|
-
<th className={detailCell}>{key}:</th>
|
|
20
|
-
<td className={detailCell}>{value}</td>
|
|
21
|
-
</tr>
|
|
22
|
-
))}
|
|
23
|
-
</tbody>
|
|
24
|
-
</table>
|
|
25
|
-
);
|
|
26
|
-
};
|
package/src/Hr/index.tsx
DELETED
package/src/Metric/index.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
4
|
-
import {classNames, createElement} from '../';
|
|
5
|
-
import {iconSize} from '../index.css';
|
|
6
|
-
import {metric, metricLabel, metricNumber} from './index.css';
|
|
7
|
-
|
|
8
|
-
export const Metric = ({
|
|
9
|
-
icon: Icon,
|
|
10
|
-
label,
|
|
11
|
-
number,
|
|
12
|
-
className,
|
|
13
|
-
}: {
|
|
14
|
-
icon?: ComponentType<{className?: string}>;
|
|
15
|
-
label: ReactNode;
|
|
16
|
-
number: ReactNode;
|
|
17
|
-
className?: string;
|
|
18
|
-
}) => (
|
|
19
|
-
<div className={classNames(metric, className)}>
|
|
20
|
-
<div className={metricLabel}>
|
|
21
|
-
{Icon ? <Icon className={iconSize} /> : null}
|
|
22
|
-
{label}
|
|
23
|
-
</div>
|
|
24
|
-
<div className={metricNumber}>{number}</div>
|
|
25
|
-
</div>
|
|
26
|
-
);
|
package/src/Summary/index.css.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {style} from '@vanilla-extract/css';
|
|
2
|
-
|
|
3
|
-
export const summary = style({
|
|
4
|
-
display: 'flex',
|
|
5
|
-
flexDirection: 'row',
|
|
6
|
-
gap: '1rem',
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const summaryImage = style({
|
|
10
|
-
flex: '0 0 6rem',
|
|
11
|
-
width: '6rem',
|
|
12
|
-
height: '6rem',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export const summaryContent = style({
|
|
16
|
-
flex: 1,
|
|
17
|
-
});
|
package/src/Summary/index.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
4
|
-
import {classNames, createElement} from '../';
|
|
5
|
-
import {Avatar} from '../Avatar';
|
|
6
|
-
import {summary, summaryContent, summaryImage} from './index.css';
|
|
7
|
-
|
|
8
|
-
export const Summary = ({
|
|
9
|
-
icon: Icon,
|
|
10
|
-
src,
|
|
11
|
-
label,
|
|
12
|
-
children,
|
|
13
|
-
className,
|
|
14
|
-
}: {
|
|
15
|
-
icon?: ComponentType<{className?: string}>;
|
|
16
|
-
src?: string;
|
|
17
|
-
label: ReactNode;
|
|
18
|
-
children: ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
}) => (
|
|
21
|
-
<div className={classNames(summary, className)}>
|
|
22
|
-
{src ? (
|
|
23
|
-
<Avatar src={src} className={summaryImage} />
|
|
24
|
-
) : Icon ? (
|
|
25
|
-
<Icon className={summaryImage} />
|
|
26
|
-
) : null}
|
|
27
|
-
<div className={summaryContent}>
|
|
28
|
-
<h2>{label}</h2>
|
|
29
|
-
{children}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
);
|
package/src/Tag/index.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type {ComponentType, ReactNode} from 'react';
|
|
4
|
-
import {classNames, createElement} from '../';
|
|
5
|
-
import {Axis} from '../Axis';
|
|
6
|
-
import {tag, tagIcon, tagVariant} from './index.css';
|
|
7
|
-
|
|
8
|
-
export const Tag = ({
|
|
9
|
-
icon: Icon,
|
|
10
|
-
label,
|
|
11
|
-
title,
|
|
12
|
-
variant = 'default',
|
|
13
|
-
}: {
|
|
14
|
-
icon?: ComponentType<{className?: string}>;
|
|
15
|
-
label?: ReactNode;
|
|
16
|
-
title?: string;
|
|
17
|
-
variant?: keyof typeof tagVariant;
|
|
18
|
-
}) => {
|
|
19
|
-
const icon = Icon ? <Icon className={tagIcon} /> : null;
|
|
20
|
-
return (
|
|
21
|
-
<Axis className={classNames(tag, tagVariant[variant])} title={title}>
|
|
22
|
-
{icon}
|
|
23
|
-
{label}
|
|
24
|
-
</Axis>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import { Moon, Sun, SunMoon } from 'lucide-react';
|
|
4
|
-
import { Button } from '../../../Button/index.tsx';
|
|
5
|
-
import { createElement } from '../../../index.ts';
|
|
6
|
-
import {
|
|
7
|
-
useDarkChoice,
|
|
8
|
-
useToggleDarkChoiceCallback,
|
|
9
|
-
} from '../../../stores/LocalStore.tsx';
|
|
10
|
-
|
|
11
|
-
const icons = [Sun, Moon, SunMoon];
|
|
12
|
-
|
|
13
|
-
export const DarkButton = () => (
|
|
14
|
-
<Button
|
|
15
|
-
variant="icon"
|
|
16
|
-
onClick={useToggleDarkChoiceCallback()}
|
|
17
|
-
icon={icons[useDarkChoice()]}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {style} from '@vanilla-extract/css';
|
|
2
|
-
import {dimensions, paddingLike, theme} from '../../../index.css.ts';
|
|
3
|
-
import {large} from '../../../index.ts';
|
|
4
|
-
|
|
5
|
-
export const sideNav = style([
|
|
6
|
-
paddingLike,
|
|
7
|
-
{
|
|
8
|
-
position: 'fixed',
|
|
9
|
-
backgroundColor: theme.background2,
|
|
10
|
-
overflow: 'auto',
|
|
11
|
-
borderRight: `1px solid ${theme.border}`,
|
|
12
|
-
width: dimensions.sideNavWidth,
|
|
13
|
-
bottom: 0,
|
|
14
|
-
left: dimensions.sideNavWidthHidden,
|
|
15
|
-
top: dimensions.topNavHeight,
|
|
16
|
-
height: `calc(100dvh - ${dimensions.topNavHeight})`,
|
|
17
|
-
overscrollBehavior: 'contain',
|
|
18
|
-
transition: 'left .2s ease-in-out',
|
|
19
|
-
},
|
|
20
|
-
large({left: 0}),
|
|
21
|
-
]);
|
|
22
|
-
|
|
23
|
-
export const open = style({left: 0});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
import { classNames, createElement } from '../../../index.ts';
|
|
5
|
-
import { useSideNavOpen } from '../../../stores/SessionStore.tsx';
|
|
6
|
-
import { open, sideNav } from './index.css.ts';
|
|
7
|
-
|
|
8
|
-
export const SideNav = ({sideNav: sideNavComponents}: {sideNav: ReactNode}) => {
|
|
9
|
-
return (
|
|
10
|
-
<nav className={classNames(sideNav, useSideNavOpen() && open)}>
|
|
11
|
-
{sideNavComponents}
|
|
12
|
-
</nav>
|
|
13
|
-
);
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import { Menu, X } from 'lucide-react';
|
|
4
|
-
import { Button } from '../../../Button/index.tsx';
|
|
5
|
-
import { createElement } from '../../../index.ts';
|
|
6
|
-
import {
|
|
7
|
-
useSideNavOpen,
|
|
8
|
-
useToggleSideNavOpen,
|
|
9
|
-
} from '../../../stores/SessionStore.tsx';
|
|
10
|
-
import { sideNavButton } from './index.css.ts';
|
|
11
|
-
|
|
12
|
-
export const SideNavButton = () => (
|
|
13
|
-
<Button
|
|
14
|
-
variant="icon"
|
|
15
|
-
onClick={useToggleSideNavOpen()}
|
|
16
|
-
icon={useSideNavOpen() ? X : Menu}
|
|
17
|
-
className={sideNavButton}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { dimensions } from '../../../index.css.ts';
|
|
3
|
-
import { large } from '../../../index.ts';
|
|
4
|
-
|
|
5
|
-
export const title = style({
|
|
6
|
-
display: 'flex',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
gap: dimensions.padding,
|
|
9
|
-
...large({width: dimensions.titleWidth}),
|
|
10
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
import { createElement } from '../../../index.ts';
|
|
5
|
-
import { title } from './index.css.ts';
|
|
6
|
-
|
|
7
|
-
export const Title = ({title: titleComponents}: {title: ReactNode}) => {
|
|
8
|
-
return <nav className={title}>{titleComponents}</nav>;
|
|
9
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import { createElement } from '../../../index.ts';
|
|
5
|
-
import { topNav } from './index.css.ts';
|
|
6
|
-
|
|
7
|
-
export const TopNav = ({
|
|
8
|
-
topNavLeft = <div />,
|
|
9
|
-
topNavRight = <div />,
|
|
10
|
-
}: {
|
|
11
|
-
topNavLeft?: ReactNode;
|
|
12
|
-
topNavRight?: ReactNode;
|
|
13
|
-
}) => (
|
|
14
|
-
<nav className={topNav}>
|
|
15
|
-
{topNavLeft}
|
|
16
|
-
{topNavRight}
|
|
17
|
-
</nav>
|
|
18
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { axisLike, dimensions, paddingLike, theme } from '../../index.css';
|
|
3
|
-
|
|
4
|
-
export const header = style([
|
|
5
|
-
paddingLike,
|
|
6
|
-
axisLike,
|
|
7
|
-
{
|
|
8
|
-
position: 'fixed',
|
|
9
|
-
boxShadow: theme.shadow,
|
|
10
|
-
backdropFilter: 'blur(8px)',
|
|
11
|
-
backgroundColor: theme.backgroundHaze,
|
|
12
|
-
left: 0,
|
|
13
|
-
right: 0,
|
|
14
|
-
height: dimensions.topNavHeight,
|
|
15
|
-
borderBottom: `1px solid ${theme.border}`,
|
|
16
|
-
zIndex: 2,
|
|
17
|
-
},
|
|
18
|
-
]);
|
package/src/Ui/Header/index.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import { createElement } from '../../index.ts';
|
|
5
|
-
import { DarkButton } from './DarkButton/index.tsx';
|
|
6
|
-
import { header } from './index.css.ts';
|
|
7
|
-
import { SideNav } from './SideNav/index.tsx';
|
|
8
|
-
import { SideNavButton } from './SideNavButton/index.tsx';
|
|
9
|
-
import { Title } from './Title/index.tsx';
|
|
10
|
-
import { TopNav } from './TopNav/index.tsx';
|
|
11
|
-
|
|
12
|
-
export const Header = ({
|
|
13
|
-
title,
|
|
14
|
-
topNavLeft,
|
|
15
|
-
topNavRight,
|
|
16
|
-
sideNav,
|
|
17
|
-
}: {
|
|
18
|
-
title: ReactNode;
|
|
19
|
-
topNavLeft?: ReactNode;
|
|
20
|
-
topNavRight?: ReactNode;
|
|
21
|
-
sideNav?: ReactNode;
|
|
22
|
-
}) => {
|
|
23
|
-
return (
|
|
24
|
-
<header className={header}>
|
|
25
|
-
{sideNav ? <SideNavButton /> : null}
|
|
26
|
-
<Title title={title} />
|
|
27
|
-
<TopNav topNavLeft={topNavLeft} topNavRight={topNavRight} />
|
|
28
|
-
<DarkButton />
|
|
29
|
-
{sideNav ? <SideNav sideNav={sideNav} /> : null}
|
|
30
|
-
</header>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { dimensions, paddingLike } from '../../../index.css';
|
|
3
|
-
|
|
4
|
-
export const article = style([
|
|
5
|
-
paddingLike,
|
|
6
|
-
{
|
|
7
|
-
paddingTop: dimensions.padding,
|
|
8
|
-
flex: 1,
|
|
9
|
-
width: '100%',
|
|
10
|
-
// maxWidth: dimensions.articleWidth,
|
|
11
|
-
margin: '0 auto',
|
|
12
|
-
},
|
|
13
|
-
]);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import { createElement } from '../../../index.ts';
|
|
5
|
-
import { article } from './index.css.ts';
|
|
6
|
-
|
|
7
|
-
export const Article = ({article: articleComponents}: {article: ReactNode}) => {
|
|
8
|
-
return <article className={article}>{articleComponents}</article>;
|
|
9
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { axisLike, dimensions, paddingLike, theme } from '../../../index.css';
|
|
3
|
-
|
|
4
|
-
export const footer = style([
|
|
5
|
-
{
|
|
6
|
-
...axisLike,
|
|
7
|
-
...paddingLike,
|
|
8
|
-
background: theme.background,
|
|
9
|
-
height: dimensions.footerHeight,
|
|
10
|
-
borderTop: `1px solid ${theme.border}`,
|
|
11
|
-
},
|
|
12
|
-
]);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @jsx createElement */
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import { createElement } from '../../../index.ts';
|
|
5
|
-
import { footer } from './index.css.ts';
|
|
6
|
-
|
|
7
|
-
export const Footer = ({footer: footerComponents}: {footer: ReactNode}) => {
|
|
8
|
-
return <footer className={footer}>{footerComponents}</footer>;
|
|
9
|
-
};
|
package/src/Ui/Main/index.css.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import { dimensions, theme } from '../../index.css.ts';
|
|
3
|
-
import { large } from '../../index.ts';
|
|
4
|
-
|
|
5
|
-
export const main = style({
|
|
6
|
-
display: 'flex',
|
|
7
|
-
flex: 1,
|
|
8
|
-
flexDirection: 'column',
|
|
9
|
-
backgroundColor: theme.background,
|
|
10
|
-
overflow: 'auto',
|
|
11
|
-
paddingTop: dimensions.topNavHeight,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const mainHasSideNav = style(
|
|
15
|
-
large({paddingLeft: dimensions.sideNavWidth}),
|
|
16
|
-
);
|