Skip to content

Commit e8d1ecd

Browse files
mimarzCopilot
andauthored
docs: change default <story> language to html (#4798)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1fbb968 commit e8d1ecd

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

apps/www/app/_components/mdx-components/mdx-components.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export const MDXComponents = ({
168168
);
169169
};
170170

171-
const Story = ({ story, ...rest }: LiveComponentProps) => {
171+
const Story = ({ story, language = 'html', ...rest }: LiveComponentProps) => {
172172
const { stories } = useLoaderData();
173173
if (!stories) return null;
174174

@@ -179,6 +179,7 @@ const Story = ({ story, ...rest }: LiveComponentProps) => {
179179
return (
180180
<LiveComponent
181181
story={`${foundStory.code}\n\nrender(<${foundStory.name} />)`}
182+
language={language}
182183
{...rest}
183184
/>
184185
);

apps/www/app/content/components/dropdown/en/code.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Story story="Preview" language="html"/>
1+
<Story story="Preview" />
22

33
## Usage
44

@@ -57,15 +57,15 @@ When using `@digdir/designsystemet-react` we extend `@types/react-dom` to accept
5757

5858
You must then add `popovertarget={id}` to `Dropdown`, and `id` to `Dropdown`.
5959

60-
<Story story="WithoutTrigger" />
60+
<Story story="WithoutTrigger" language="react"/>
6161

6262
### Controlled
6363

6464
If you submit `open`, then you use `Dropdown` controlled. You can use `onClose` to get notified when `Dropdown` wants to close.
6565

6666
Note that we do not use `onClick` on the trigger, the dropdown handles this internally and sends to `onOpen` and `onClose`.
6767

68-
<Story story="ControlledEn" />
68+
<Story story="ControlledEn" language="react"/>
6969

7070
### Props
7171

apps/www/app/content/components/dropdown/no/code.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Story story="Preview" language="html" />
1+
<Story story="Preview" />
22

33
## Bruk
44

apps/www/app/content/components/dropdown/no/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
search_terms: nedtrekksmeny, rullegardinmeny, valgmeny, valmeny, veljar, popup, select, menu, listbox, popup, dropdownmenu, options
33
---
44

5-
<Story story="Preview" language="html" />
5+
<Story story="Preview" />
66

77
**Bruk dropdown når**
88
- du vil tilby flere alternativer uten at de tar mye plass i grensesnittet

apps/www/app/content/components/table/no/code.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Merk at vi legger på `type="button"` for å unngå at knappen oppfører seg som
8282
### Klikkbar rad
8383
Du kan legge på `data-clickdelegatefor` på en `<tr>` for å delegere klikk-hendelser til et element i raden, for eksempel en `<a>`-tag.
8484

85-
<Story story="HTMLClickableRows" language="html" />
85+
<Story story="HTMLClickableRows" />
8686

8787

8888
## CSS variabler og data-attributter

0 commit comments

Comments
 (0)