Skip to content

Commit 0e334a0

Browse files
Merge branch 'main' into feat-headless-label
2 parents f5160f8 + e9bf6ce commit 0e334a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1098
-314
lines changed

.changeset/eleven-bulldogs-hug.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/headless': patch
3+
---
4+
5+
refactor: strip browser user agent styles relating to max-width

.changeset/lazy-eels-peel.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/lucky-carrots-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@qwik-ui/headless': patch
3+
---
4+
5+
fix: collapsible renders correctly on CSR

.changeset/sixty-moles-exercise.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ pnpm preview
8282
- Build the Cloudfare version of the qwik-ui documentation
8383

8484
```shell
85-
pnpm build.clouflare
85+
pnpm build.cloudflare
8686
```
8787

8888
- Preview the Cloudfare build of the qwik-ui documentation (no HMR)
8989

9090
```shell
91-
pnpm preview.clouflare
91+
pnpm preview.cloudflare
9292
```
9393

9494
### 5. Make sure you add / modify tests

apps/website/src/_state/component-statuses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const statusByComponent: ComponentKitsStatuses = {
3535
headless: {
3636
Accordion: ComponentStatus.Beta,
3737
Carousel: ComponentStatus.Draft,
38-
Collapsible: ComponentStatus.Draft,
38+
Collapsible: ComponentStatus.Beta,
3939
Combobox: ComponentStatus.Beta,
4040
Label: ComponentStatus.Draft,
4141
Modal: ComponentStatus.Beta,

apps/website/src/components/copy-css-config/copy-css-config.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default component$(() => {
3030
</Button>
3131
<Modal
3232
bind:show={showSig}
33-
class="my-animation bg-background text-foreground rounded-base max-w-2xl overflow-x-hidden p-8 shadow-md backdrop:backdrop-blur backdrop:backdrop-brightness-50 dark:backdrop:backdrop-brightness-100"
33+
class="my-animation bg-background text-foreground rounded-base h-full max-w-2xl overflow-x-hidden p-8 shadow-md backdrop:backdrop-blur backdrop:backdrop-brightness-50 dark:backdrop:backdrop-brightness-100"
3434
>
3535
<ModalHeader>
3636
<h2 class="text-lg font-bold">Copy config</h2>
Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
import { component$ } from '@builder.io/qwik';
22
import { CheckIcon } from '../icons/Check';
33
import { Roadmap } from '../icons/Roadmap';
4+
import { IssueIcon } from '../icons/Issues';
45

56
type FeatureListProps = {
67
features: string[];
78
roadmap?: string[];
9+
issues?: string[];
810
};
911

1012
export const FeatureList = component$((props: FeatureListProps) => {
1113
return (
1214
<ul class="mb-12 mt-[-16px] !px-0">
13-
{props.features.map((descriptor) => {
14-
return (
15-
<li
16-
key={descriptor}
17-
class="flex w-full list-none items-center gap-x-2 gap-y-4 border-b-[1px] border-slate-200 py-2 dark:border-slate-800"
18-
>
19-
<CheckIcon class="min-w-[21px]" />
20-
{descriptor}
21-
</li>
22-
);
23-
})}
15+
{props.features && (
16+
<>
17+
{props.features.map((descriptor) => {
18+
return (
19+
<li
20+
key={descriptor}
21+
class="flex w-full list-none items-center gap-x-2 gap-y-4 border-b-[1px] border-slate-200 py-2 dark:border-slate-800"
22+
>
23+
<CheckIcon class="min-w-[21px]" />
24+
{descriptor}
25+
</li>
26+
);
27+
})}
28+
</>
29+
)}
2430
{props.roadmap && (
2531
<>
2632
<h3 class="mb-6 mt-8 scroll-mt-20 text-xl font-semibold">Roadmap</h3>
@@ -39,6 +45,23 @@ export const FeatureList = component$((props: FeatureListProps) => {
3945
})}
4046
</>
4147
)}
48+
{props.issues && (
49+
<>
50+
{props.issues.map((descriptor) => {
51+
return (
52+
<>
53+
<li
54+
key={descriptor}
55+
class="flex w-full list-none items-center gap-x-2 gap-y-4 border-b-[1px] border-slate-200 py-2 dark:border-slate-800"
56+
>
57+
<IssueIcon class="min-w-[21px]" />
58+
{descriptor}
59+
</li>
60+
</>
61+
);
62+
})}
63+
</>
64+
)}
4265
</ul>
4366
);
4467
});

apps/website/src/components/highlight/highlight.tsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
import { ClassList, PropsOf, component$, useSignal, useTask$ } from '@builder.io/qwik';
1+
import {
2+
ClassList,
3+
PropsOf,
4+
component$,
5+
useSignal,
6+
useTask$,
7+
useVisibleTask$,
8+
$,
9+
} from '@builder.io/qwik';
210
import { CodeCopy } from '../code-copy/code-copy';
11+
import { getHighlighterCore } from 'shiki';
312
import { cn } from '@qwik-ui/utils';
4-
import { highlighter } from './highlighter';
13+
import { isDev } from '@builder.io/qwik/build';
514

615
export type HighlightProps = PropsOf<'div'> & {
716
code: string;
@@ -22,7 +31,7 @@ export const Highlight = component$(
2231
}: HighlightProps) => {
2332
const codeSig = useSignal('');
2433

25-
useTask$(async function createHighlightedCode() {
34+
const addShiki$ = $(async () => {
2635
let modifiedCode: string = code;
2736

2837
let partsOfCode = modifiedCode.split(splitCommentStart);
@@ -35,6 +44,19 @@ export const Highlight = component$(
3544
modifiedCode = partsOfCode[0];
3645
}
3746

47+
const highlighter = await getHighlighterCore({
48+
themes: [
49+
// or a dynamic import if you want to do chunk splitting
50+
import('shiki/themes/poimandres.mjs'),
51+
],
52+
langs: [
53+
import('shiki/langs/html.mjs'),
54+
import('shiki/langs/tsx.mjs'),
55+
import('shiki/langs/css.mjs'),
56+
],
57+
loadWasm: import('shiki/wasm'),
58+
});
59+
3860
const str = highlighter.codeToHtml(modifiedCode, {
3961
lang: language,
4062
themes: {
@@ -45,6 +67,22 @@ export const Highlight = component$(
4567
codeSig.value = str.toString();
4668
});
4769

70+
useTask$(async function createHighlightedCode() {
71+
if (!isDev) {
72+
await addShiki$();
73+
}
74+
});
75+
76+
// eslint-disable-next-line qwik/no-use-visible-task
77+
useVisibleTask$(
78+
async () => {
79+
if (isDev) {
80+
await addShiki$();
81+
}
82+
},
83+
{ strategy: 'document-ready' },
84+
);
85+
4886
return (
4987
<div class="code-example relative max-h-[31.25rem]">
5088
<CodeCopy

apps/website/src/components/highlight/highlighter.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)