Skip to content

Commit 1376133

Browse files
authored
Switch to SolidBase callout syntax (#1131)
1 parent 4a1ee6b commit 1376133

File tree

17 files changed

+51
-69
lines changed

17 files changed

+51
-69
lines changed

src/routes/concepts/context.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ const Provider = (props) => (
6060
);
6161
```
6262

63-
<Callout type="tip" title="Complex Types">
63+
:::tip[Complex Types]
6464
When passing multiple values (as an `array` or `object`), it is recommended to use a [store](/reference/component-apis/create-context#usage).
65-
</Callout>
65+
:::
6666

6767
## Consuming context
6868

@@ -257,9 +257,9 @@ function Child() {
257257
258258
If no default value is passed to `createContext`, it is possible for `useContext` to return `undefined`.
259259
260-
<Callout type="info" title="More on default values">
260+
:::info[More on default values]
261261
Read more about default values in the [`createContext`](/reference/component-apis/create-context) entry.
262-
</Callout>
262+
:::
263263
264264
Because of this, if an initial value was not passed to `createContext`, the TS type signature of `useContext` will indicate that
265265
the value returned might be `undefined` (as mentioned above).

src/routes/guides/styling-components/tailwind.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ order: 5
44
mainNavExclude: true
55
---
66

7-
<Callout type="info" title="Note">
8-
7+
:::info[Note]
98
This guide is for Tailwind CSS v4. For **Tailwind CSS v3** refer to [Tailwind CSS v3](/guides/styling-components/tailwind-v3).
10-
11-
</Callout>
9+
:::
1210

1311
[Tailwind CSS](https://tailwindcss.com/) is an on-demand utility CSS library that integrates seamlessly with Solid as a built-in PostCSS plugin.
1412

src/routes/reference/component-apis/create-context.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ The default value is used when no Provider is found above in the hierarchy.
1313

1414
To avoid reinstatiating a new context when Hot-Module Replacement (HMR) occurs, it is recommended to use `createContext` in its own module (file).
1515

16-
<Callout type="danger" title="Hot-Module Replacement">
17-
When using HMR, the context is lost when the module is reloaded. Which will cause an error to be thrown as `useContext` will try to access it while it is still reloading.
18-
</Callout>
16+
:::danger[Hot-Module Replacement]
17+
When using HMR, the context is lost when the module is reloaded.
18+
Which will cause an error to be thrown as `useContext` will try to access it while it is still reloading.
19+
:::
1920

2021

2122
For example:

src/routes/reference/jsx-attributes/attr.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Useful for Web Components where you want to set attributes.
99
<my-element attr:status={props.status} />
1010
```
1111

12-
<Callout type="info" title="Strong-Typing Custom Attributes">
13-
Type definitions are required when using TypeScript.
14-
See the[TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
15-
</Callout>
12+
:::info[Strong-Typing Custom Attributes]
13+
Type definitions are required when using TypeScript.
14+
See the[TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
15+
:::

src/routes/reference/jsx-attributes/bool.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This attribute is most useful for Web Components.
2020

2121
```
2222

23-
<Callout type="info" title="Strong-Typing Custom Boolean Attributes">
24-
Type definitions are required when using TypeScript.
25-
See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
26-
</Callout>
23+
:::info[Strong-Typing Custom Boolean Attributes]
24+
Type definitions are required when using TypeScript.
25+
See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
26+
:::

src/routes/reference/jsx-attributes/prop.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Forces the prop to be treated as a property instead of an attribute.
99
<div prop:scrollTop={props.scrollPos + "px"} />
1010
```
1111

12-
<Callout type="info" title="Strong-Typing Custom Properties">
13-
Type definitions are required when using TypeScript.
14-
See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
15-
</Callout>
12+
:::info[Strong-Typing Custom Properties]
13+
Type definitions are required when using TypeScript.
14+
See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples.
15+
:::

src/routes/reference/jsx-attributes/use.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ declare module "solid-js" {
3535
}
3636
```
3737

38-
<Callout type="caution" title="Limitations">
38+
:::caution[Limitations]
3939
Directives only work with native HTML elements (HTML/SVG/MathML/Custom Elements).
4040
Directives are not forwarded and **won't work in user defined components**, such as `<MyComponent use:myinput={[..]}/>` [see also](https://github.com/solidjs/solid/discussions/722)
41-
</Callout>
41+
:::

src/routes/solid-router/concepts/actions.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,9 @@ In this example, the `echo` action simulates a fetch call with a 1 second delay
4343
The `echo` action will act as a backend, however, it can be substituted for any API provided it can be run on the client.
4444
Typically, route actions are used with some sort of solution like fetch or GraphQL.
4545

46-
<Callout type="tip">
47-
46+
:::tip
4847
In [SolidStart](/solid-start) apps, it's recommended to use the [`"use server"`](/solid-start/reference/server/use-server) directive to leverage server-side caching.
49-
50-
</Callout>
48+
:::
5149

5250
### Using actions
5351

src/routes/solid-router/reference/data-apis/action.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ const deleteTodo = action(async (id: number) => {
5959

6060
```
6161

62-
<Callout type="tip">
63-
62+
:::tip
6463
In [SolidStart](/solid-start) apps, it's recommended to use the [`"use server"`](/solid-start/reference/server/use-server) directive to leverage server-side caching.
65-
66-
</Callout>
64+
:::
6765

6866
## Notes of `<form>` implementation and SSR
6967

src/routes/solid-router/reference/data-apis/use-action.mdx

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ const updateName = useAction(updateNameAction);
1313
const result = updateName("John Wick");
1414
```
1515

16-
<Callout type="info" title="Note">
17-
`useAction` requires client-side JavaScript and is not progressively
18-
enhanceable.
19-
</Callout>
16+
:::info[Note]
17+
`useAction` requires client-side JavaScript and is not progressively enhanceable.
18+
:::
2019

2120
## Parameters
2221

src/routes/solid-router/reference/data-apis/use-submission.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ function Component() {
2424
}
2525
```
2626

27-
<Callout type="info">
28-
27+
:::info
2928
Learn more about actions in the [`action`](/solid-router/reference/data-apis/action) docs.
30-
31-
</Callout>
29+
:::
3230

3331
## Filtering Submissions
3432

src/routes/solid-router/reference/data-apis/use-submissions.mdx

+4-7
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ title: useSubmissions
55
This helper is used to handle form submissions and can provide optimistic updates while actions are in flight as well as pending state feedback.
66
This method will return an iterable of all submitted actions while its component is mounted. With an optional second parameter for a filter function.
77

8-
<Callout type="tip">
8+
:::tip
99
If you only care for the latest submission, you can use the [`useSubmission`](/solid-router/reference/data-apis/use-submission) helper.
10-
</Callout>
10+
:::
1111

1212
It's important to note that it requires the form method to be **post** otherwise it will trigger a browser navigation and will not work.
1313

@@ -42,12 +42,9 @@ function Component() {
4242
}
4343
```
4444

45-
<Callout type="info">
46-
45+
:::info
4746
To trigger a submission, [actions](https://docs.solidjs.com/) can be used.
48-
49-
50-
</Callout>
47+
:::
5148

5249
## Filtering Submissions
5350

src/routes/solid-router/reference/response-helpers/redirect.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ Other useful redirect codes:
1414
| `307` | Temporary Redirect |
1515
| `308` | Permanent redirect |
1616

17-
<Callout type="tip" name="Redirect Methods">
18-
307 and 308 won't allow the browser to change the method of the request. If you want to change the method, you should use 301 or 302.
19-
</Callout>
17+
:::tip[Redirect Methods]
18+
307 and 308 won't allow the browser to change the method of the request.
19+
If you want to change the method, you should use 301 or 302.
20+
:::
2021

2122
A common use-case for throwing a redirect is when a user is not authenticated and needs to be sent to the login page or another public route.
2223

src/routes/solid-router/reference/response-helpers/revalidate.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ title: revalidate
44

55
Revalidate will receive the either a cache key or an array of cache keys and invalidate those queries.
66

7-
<Callout type="tip" name="Firing Queries Again">
7+
:::tip[Firing Queries Again]
88
If you intend to re-fire the queries immediately, check the [reload](/solid-router/reference/response-helpers/reload) helper.
9-
</Callout>
9+
:::
1010

1111
The code below will revalidate the `getTodo` query with the cache key.
1212

src/routes/solid-start/guides/data-fetching.mdx

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ Since SolidStart itself provides minimal data-fetching APIs, most functionality
88

99
This guide provides practical examples of common data-fetching tasks using these primitives.
1010

11-
<Callout type="info" title="Note">
12-
11+
:::info[Note]
1312
For detailed API information, refer to the [Solid](/) and [Solid Router](/solid-router) documentation.
14-
15-
</Callout>
13+
:::
1614

1715
Here's a simple example:
1816

@@ -438,8 +436,6 @@ export default function Page() {
438436

439437
See the [`createResource`](/reference/basic-reactivity/create-resource) API reference for more information.
440438

441-
<Callout type="info" title="Advanced Data Handling">
442-
439+
:::info[Advanced Data Handling]
443440
For advanced features like automatic background re-fetching or infinite queries, you can use [Tanstack Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
444-
445-
</Callout>
441+
:::

src/routes/solid-start/guides/data-mutation.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,9 @@ export default function Page() {
423423
</div>
424424
</TabsCodeBlocks>
425425
426-
<Callout type="info" title="Multiple Submissions">
427-
426+
:::info[Multiple Submissions]
428427
If you want to display optimistic UI for multiple concurrent submissions, you can use the [`useSubmissions`](/solid-router/reference/data-apis/use-submissions) primitive.
429-
430-
</Callout>
428+
:::
431429
432430
## Redirecting
433431

src/routes/solid-start/reference/server/create-middleware.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ There are two lifecycle events available: `onRequest` and `onBeforeResponse`.
99
- The `onRequest` event is triggered at the beginning of the request lifecycle, before the request is handled by the route handler.
1010
- The `onBeforeResponse` event is triggered after a request has been processed by the route handler but before the response is sent to the client.
1111

12-
<Callout type="info" title="Note">
13-
12+
:::info[Note]
1413
SolidStart will only execute the middleware functions if the path to the middleware file is configured within `app.config.ts` using the `middleware` option.
1514
This file must export the configuration using `export default`.
16-
17-
</Callout>
15+
:::
1816

1917
Learn more about middleware in the [Middleware documentation](/solid-start/advanced/middleware).
2018

0 commit comments

Comments
 (0)