Skip to content

Commit 348d67f

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/dependabot/npm_and_yarn/prettier-3.5.3'
2 parents b87912b + ad1b92f commit 348d67f

35 files changed

+764
-743
lines changed

Diff for: apps/nest/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@nanogiants/nestjs-swagger-api-exception-decorator": "1.7.0",
1717
"@nestjs/common": "10.4.6",
1818
"@nestjs/core": "11.0.11",
19-
"@nestjs/platform-express": "10.4.4",
19+
"@nestjs/platform-express": "11.0.11",
2020
"@nestjs/swagger": "11.0.6",
2121
"@spuxx/js-utils": "workspace:@spuxx/js-utils@*",
2222
"@spuxx/nest-utils": "workspace:@spuxx/nest-utils@*",
@@ -36,7 +36,7 @@
3636
"typescript": "5.7.3",
3737
"unplugin-swc": "1.5.1",
3838
"vite": "6.1.0",
39-
"vite-tsconfig-paths": "5.1.2",
40-
"vitest": "3.0.5"
39+
"vite-tsconfig-paths": "5.1.4",
40+
"vitest": "3.0.7"
4141
}
4242
}

Diff for: apps/react/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"@spuxx/browser-utils": "workspace:@spuxx/browser-utils@*",
1212
"@spuxx/js-utils": "workspace:@spuxx/js-utils@*",
1313
"react": "18.3.1",
14-
"react-dom": "18.2.0"
14+
"react-dom": "19.0.0"
1515
},
1616
"devDependencies": {
1717
"@modyfi/vite-plugin-yaml": "1.1.0",
1818
"@types/react": "18.3.5",
19-
"@types/react-dom": "18.3.0",
19+
"@types/react-dom": "19.0.4",
2020
"@vitejs/plugin-react": "4.3.4",
2121
"typescript": "5.7.3",
2222
"vite": "6.1.0",
23-
"vite-tsconfig-paths": "5.1.2"
23+
"vite-tsconfig-paths": "5.1.4"
2424
}
2525
}

Diff for: apps/starlight/astro.config.mjs

+6-37
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,25 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
3+
import solidJs from '@astrojs/solid-js';
34
import starlight from '@astrojs/starlight';
5+
import { sidebar } from './src/assets/sidebar.ts';
46

57
// https://astro.build/config
68
export default defineConfig({
79
base: '/jslibs/',
810
site: 'https://spuxx-dev.github.io',
11+
912
integrations: [
13+
solidJs(),
1014
starlight({
1115
title: '@spuxx/jslibs',
1216
favicon: '/favicon.png',
1317
social: {
1418
github: 'https://github.com/spuxx-dev/jslibs',
1519
blueSky: 'https://bsky.app/profile/spuxx.bsky.social',
1620
},
17-
sidebar: [
18-
{
19-
label: 'js-utils',
20-
items: [
21-
{ label: 'Introduction', slug: 'js-utils' },
22-
{
23-
label: 'Types',
24-
slug: 'js-utils/types',
25-
},
26-
{
27-
label: 'Services',
28-
autogenerate: { directory: 'js-utils/services' },
29-
},
30-
{
31-
label: 'Utilities',
32-
autogenerate: { directory: 'js-utils/utils' },
33-
},
34-
],
35-
},
36-
{
37-
label: 'browser-utils',
38-
items: [
39-
{
40-
label: 'Introduction',
41-
slug: 'browser-utils',
42-
},
43-
{
44-
label: 'Styles and Themes',
45-
slug: 'browser-utils/styles-and-themes',
46-
},
47-
{
48-
label: 'Services',
49-
autogenerate: { directory: 'browser-utils/services' },
50-
},
51-
],
52-
},
53-
],
21+
customCss: ['./src/styles/global.css'],
22+
sidebar,
5423
}),
5524
],
5625
});

Diff for: apps/starlight/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"@astrojs/mdx": "4.0.8",
1616
"@astrojs/solid-js": "5.0.5",
1717
"@astrojs/starlight": "0.32.1",
18+
"@spuxx/browser-utils": "workspace:@spuxx/browser-utils@*",
19+
"@spuxx/js-utils": "workspace:@spuxx/js-utils@*",
20+
"@spuxx/solid": "workspace:@spuxx/solid@*",
1821
"astro": "5.4.1",
1922
"sharp": "0.33.5",
2023
"solid-js": "1.9.4",

Diff for: apps/starlight/src/assets/houston.webp

-96.2 KB
Binary file not shown.

Diff for: apps/starlight/src/assets/sidebar.ts

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import type { StarlightUserConfigWithPlugins } from 'node_modules/@astrojs/starlight/utils/plugins';
2+
3+
export const sidebar: StarlightUserConfigWithPlugins['sidebar'] = [
4+
{
5+
label: 'js-utils',
6+
items: [
7+
{ label: 'Introduction', slug: 'js-utils' },
8+
{
9+
label: 'Types',
10+
slug: 'js-utils/types',
11+
},
12+
{
13+
label: 'Services',
14+
autogenerate: { directory: 'js-utils/services' },
15+
},
16+
{
17+
label: 'Utilities',
18+
autogenerate: { directory: 'js-utils/utils' },
19+
},
20+
],
21+
},
22+
{
23+
label: 'browser-utils',
24+
items: [
25+
{
26+
label: 'Introduction',
27+
slug: 'browser-utils',
28+
},
29+
{
30+
label: 'Styles and Themes',
31+
slug: 'browser-utils/styles-and-themes',
32+
},
33+
{
34+
label: 'Services',
35+
autogenerate: { directory: 'browser-utils/services' },
36+
},
37+
],
38+
},
39+
{
40+
label: 'solid',
41+
items: [
42+
{
43+
label: 'Introduction',
44+
slug: 'solid',
45+
},
46+
{
47+
label: 'Components',
48+
items: [
49+
{
50+
label: 'Layout',
51+
autogenerate: { directory: 'solid/components/layout' },
52+
},
53+
],
54+
},
55+
],
56+
},
57+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
import { InteractiveSolid } from './InteractiveSolid';
3+
import { type Argument } from './types';
4+
5+
interface Props {
6+
componentName: string;
7+
argDefinitions: Record<string, Argument<any>>;
8+
title?: string;
9+
}
10+
---
11+
12+
<InteractiveSolid client:only="solid-js" {...Astro.props} />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { Container } from '@packages/solid';
2+
import { createSignal, For, type Component } from 'solid-js';
3+
import { isEmptyOrWhitespace } from '@spuxx/js-utils';
4+
import type { Argument } from './types';
5+
6+
interface Props {
7+
argDefinitions: Record<string, Argument<unknown>>;
8+
onArgsChange: (args: Record<string, unknown>) => void;
9+
}
10+
11+
export const InteractiveControls: Component<Props> = (props) => {
12+
const { argDefinitions, onArgsChange } = props;
13+
const [args, setArgs] = createSignal<Record<string, unknown>>({});
14+
15+
const handleArgsChange = (event: Event) => {
16+
const target = event.target as HTMLInputElement;
17+
const newArgs = { ...args(), [target.name]: target.checked ?? target.value };
18+
for (const key in newArgs) {
19+
if (isEmptyOrWhitespace(newArgs[key])) delete newArgs[key];
20+
}
21+
setArgs(newArgs);
22+
onArgsChange(newArgs);
23+
};
24+
25+
const controls = Object.entries(argDefinitions).map(([key, def]) => (
26+
<label>
27+
{key}
28+
{': '}
29+
{def.type === 'boolean' && (
30+
<input
31+
type="checkbox"
32+
name={key}
33+
checked={args()[key] as boolean}
34+
on:change={handleArgsChange}
35+
/>
36+
)}
37+
{def.options && (
38+
<select name={key} on:change={handleArgsChange}>
39+
<option label="Use default value"></option>
40+
<For each={def.options}>{(option) => <option>{String(option)}</option>}</For>
41+
</select>
42+
)}
43+
</label>
44+
));
45+
46+
return (
47+
<Container noPadding style={{ display: 'flex', 'flex-direction': 'column' }}>
48+
<For each={controls}>{(control) => control}</For>
49+
</Container>
50+
);
51+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { createEffect, createSignal, Show, type Component } from 'solid-js';
2+
import { render } from 'solid-js/web';
3+
import { Container, Divider, Heading } from '@spuxx/solid';
4+
import { InteractiveControls } from './InteractiveControls';
5+
import type { Argument } from './types';
6+
7+
interface Props {
8+
componentName: string;
9+
argDefinitions: Record<string, Argument<unknown>>;
10+
title?: string;
11+
}
12+
13+
export const InteractiveSolid: Component<Props> = (props) => {
14+
const { title, componentName, argDefinitions } = props;
15+
16+
let dispose: (() => void) | undefined;
17+
// eslint-disable-next-line prefer-const
18+
let containerRef: HTMLDivElement | null = null;
19+
20+
const [state, setState] = createSignal<{
21+
component: Component | null;
22+
args: Record<string, unknown>;
23+
}>({ component: null, args: {} });
24+
25+
const importComponent = async () => {
26+
const module = await import(`@spuxx/solid`);
27+
const importedComponent = module[componentName as keyof typeof module] as Component;
28+
setState({ component: importedComponent, args: {} });
29+
};
30+
importComponent();
31+
32+
const handleArgsChange = (args: Record<string, unknown>) => {
33+
setState({ component: state().component!, args });
34+
};
35+
36+
createEffect(() => {
37+
const { component, args } = state();
38+
if (dispose) {
39+
dispose();
40+
}
41+
42+
if (containerRef && component) {
43+
dispose = render(() => component(args), containerRef);
44+
}
45+
});
46+
47+
return (
48+
<div>
49+
<Container variant="contained" color="gradient">
50+
<Heading level={4}>Interactive Example: {title ?? componentName}</Heading>
51+
<Divider />
52+
53+
<Show when={state().component}>
54+
<InteractiveControls argDefinitions={argDefinitions} onArgsChange={handleArgsChange} />
55+
<Container
56+
variant="contained"
57+
color="background"
58+
style={{
59+
padding: '2rem',
60+
}}
61+
>
62+
<div ref={containerRef!} />
63+
</Container>
64+
</Show>
65+
<Show when={!state().component}>
66+
<p>No component specified.</p>
67+
</Show>
68+
</Container>
69+
</div>
70+
);
71+
};

Diff for: apps/starlight/src/components/interactive/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Interactive from './Interactive.astro';
2+
export * from './types';
3+
export { Interactive };

Diff for: apps/starlight/src/components/interactive/types.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface Argument<T> {
2+
type: 'string' | 'number' | 'boolean';
3+
options?: T[];
4+
}

Diff for: apps/starlight/src/content/docs/index.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,8 @@ import { CardGrid, Card, LinkCard } from '@astrojs/starlight/components';
2828
`@spuxx/browser-utils` contains a selection of common utilities for use in browser applications.
2929
<LinkCard title="View Documentation" href="browser-utils" link />
3030
</Card>
31+
<Card title="@spuxx/solid" icon="seti:html">
32+
`@spuxx/solid` contains a selection of components for use in SolidJS applications.
33+
<LinkCard title="View Documentation" href="solid" link />
34+
</Card>
3135
</CardGrid>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: 'Divider'
3+
description: 'A library containing various production-ready components for SolidJS applications.'
4+
---
5+
6+
import TypeDoc from '@docs/solid/components/layout/divider.md';
7+
import { BaseColor, ContentColor } from '@packages/browser-utils/dist/main';
8+
import { Interactive } from '@src/components/interactive';
9+
10+
<Interactive
11+
componentName="Divider"
12+
argDefinitions={{
13+
color: {
14+
type: 'string',
15+
options: Object.values({ ...BaseColor, ...ContentColor }),
16+
},
17+
variant: {
18+
type: 'string',
19+
options: ['straight', 'sleek'],
20+
},
21+
vertical: {
22+
type: 'boolean',
23+
},
24+
}}
25+
/>
26+
27+
<TypeDoc />

Diff for: apps/starlight/src/content/docs/solid/index.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 'Solid'
3+
description: 'A library containing various production-ready components for SolidJS applications.'
4+
---
5+
6+
import README from '@packages/solid/README.md';
7+
8+
<README />

Diff for: apps/starlight/src/styles/global.css

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import '@spuxx/browser-utils/styles';
2+
@import '@spuxx/browser-utils/themes';

Diff for: packages/browser-utils/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@vitest/coverage-v8": "3.0.5",
5656
"vite": "6.1.0",
5757
"vite-plugin-dts": "4.5.0",
58-
"vite-tsconfig-paths": "5.1.2",
59-
"vitest": "3.0.5"
58+
"vite-tsconfig-paths": "5.1.4",
59+
"vitest": "3.0.7"
6060
}
6161
}

Diff for: packages/browser-utils/src/styles.css

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@import './styles/variables.css';
2+
@import './styles/variants.css';
3+
@import './styles/colors.css';
4+
@import './styles/animations.css';
5+
26
@import './styles/layout.css';
37
@import './styles/application.css';
8+
49
@import './styles/components.css';
510
@import './styles/modal.css';
6-
@import './styles/variants.css';
7-
@import './styles/colors.css';
8-
@import './styles/animations.css';

Diff for: packages/browser-utils/src/styles/components/layout/container.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
}
2020

2121
.spx-container[spx-variant='outlined'] {
22-
color: inherit;
22+
color: inherit !important;
2323
}

0 commit comments

Comments
 (0)