Skip to content

Commit 84a4d34

Browse files
committed
Merge branch 'main' into pkg.pr.new-compact
2 parents d647984 + 73cf7ae commit 84a4d34

File tree

78 files changed

+2334
-1699
lines changed

Some content is hidden

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

78 files changed

+2334
-1699
lines changed

.changeset/fast-actors-report.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
'@qwik-ui/headless': minor
33
---
44

5+
## 100% Lazy execution
6+
7+
The entire Qwik UI library does not execute code until interaction. Your components are HTML, until the user decides to interact with them.
8+
59
## Bundling improvements
610

711
We have reduced the bundle size significantly of the headless library. If you are a Qwik library author, please refer to [this issue](https://github.com/QwikDev/qwik/issues/5473) as it may impact your bundle size as well.
@@ -101,6 +105,10 @@ export default component$(() => {
101105

102106
- Programmatically toggling the popover is still possible, make sure to put the same id on the `<Popover.Root />` that is passed to the `usePopover` hook. Refer to the docs for more info.
103107

108+
- popover-showing and popover-closing classes have been deprecated. Please use the `data-open` and ``data-closing` attributes instead.
109+
110+
- The `data-open`, `data-closing`, and `data-closed` data attributes have been added to the popover.
111+
104112
#### <Popover.Root />
105113

106114
There is a new root compomnent. Configurable props have been moved to the root component.

.changeset/two-glasses-fix.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,48 @@
22
'@qwik-ui/headless': minor
33
---
44

5+
### Tooltip
6+
7+
The Tooltip component has been refactored from the ground up to be more accessible and performant.
8+
9+
It is now built on top of the popover primitive, and has a similar API.
10+
11+
It remains in `draft` status, and is not yet ready for production use. We will be working on it more deeply in the near future.
12+
13+
### Accordion
14+
15+
The Accordion has been refactored from the ground up to be more accessible and performant.
16+
17+
#### Accordion.Root
18+
19+
- The `behavior="multi"` prop has been deprecated with `multiple` on the `<Accordion.Root />` component.
20+
21+
- The default behavior is a single item open at a time.
22+
23+
- `onSelectIndexChange$` has been deprecated and removed in favor of `onChange$`.
24+
25+
- `onFocusIndexChange$` has been deprecated and removed. Let us know if you have a use case for this.
26+
27+
- Reactively control the accordion with the `bind:value` prop.
28+
29+
- Control the initial value with the `value` prop.
30+
31+
- Disable the entire accordion by using the `disabled` prop.
32+
33+
#### Accordion.Item
34+
35+
- Pass distinct values to the `<Accordion.Item />` component with the `value` prop.
36+
37+
- Disable Accordion items by setting the `disabled` prop to true on the `<Accordion.Item />` component.
38+
39+
For more information, please refer to the updated Accordion documentation.
40+
41+
### Collapsible
42+
43+
- The `onOpenChange$` prop has been deprecated. Use the `onChange$` prop instead.
44+
45+
For more information, please refer to the updated Collapsible documentation.
46+
547
### Deprecated Components
648

749
In 0.4, we have deprecated the following headless components:
@@ -11,7 +53,6 @@ In 0.4, we have deprecated the following headless components:
1153
- Action Button
1254
- Button Group
1355
- Toast
14-
- Tooltip
1556
- Card
1657
- Badge
1758
- Spinner

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
node_version: [20, 22]
13+
node_version: [18, 20, 22]
1414

1515
steps:
1616
- name: Cancel Previous Runs
-197 KB
Binary file not shown.
5.23 KB
Binary file not shown.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ export const statusByComponent: ComponentKitsStatuses = {
4646
Select: ComponentStatus.Beta,
4747
Separator: ComponentStatus.Beta,
4848
Tabs: ComponentStatus.Beta,
49+
Tooltip: ComponentStatus.Draft,
4950
},
5051
};
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1-
import { component$, useStyles$ } from '@builder.io/qwik';
1+
import { component$ } from '@builder.io/qwik';
22
import { Accordion } from '@qwik-ui/headless';
33
import { LuChevronDown } from '@qwikest/icons/lucide';
44

55
export default component$(() => {
6-
useStyles$(styles);
76
const items = [1, 2, 3];
87

98
return (
109
<Accordion.Root animated>
1110
{items.map((item) => (
12-
<Accordion.Item key={item}>
11+
<Accordion.Item class="collapsible" key={item}>
1312
<Accordion.Header>
14-
<Accordion.Trigger>
13+
<Accordion.Trigger class="collapsible-trigger">
1514
<span>Trigger {item}</span>
16-
<LuChevronDown />
15+
<LuChevronDown class="collapsible-transition" />
1716
</Accordion.Trigger>
1817
</Accordion.Header>
19-
<Accordion.Content class="accordion-animation">
20-
Inside Content {item}
18+
<Accordion.Content class="collapsible-animation collapsible-content">
19+
<p class="collapsible-content-outline">Inside Content {item}</p>
2120
</Accordion.Content>
2221
</Accordion.Item>
2322
))}
2423
</Accordion.Root>
2524
);
2625
});
27-
28-
// interal
29-
import styles from '../snippets/accordion.css?inline';
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
import { component$ } from '@builder.io/qwik';
1+
import { component$, useStyles$ } from '@builder.io/qwik';
22
import { Accordion } from '@qwik-ui/headless';
33
import { LuChevronDown } from '@qwikest/icons/lucide';
44

5-
// non-collapsible
65
export default component$(() => {
6+
useStyles$(styles);
77
const items = [1, 2, 3];
88

99
return (
1010
<Accordion.Root collapsible={false}>
1111
{items.map((item) => (
12-
<Accordion.Item class="accordion-item" key={item}>
12+
<Accordion.Item class="collapsible" key={item}>
1313
<Accordion.Header>
14-
<Accordion.Trigger class="accordion-trigger">
14+
<Accordion.Trigger class="collapsible-trigger">
1515
<span>Trigger {item}</span>
1616
<LuChevronDown />
1717
</Accordion.Trigger>
1818
</Accordion.Header>
19-
<Accordion.Content class="accordion-content">
19+
<Accordion.Content class="collapsible-content collapsible-content-outline">
2020
Inside Content {item}
2121
</Accordion.Content>
2222
</Accordion.Item>
2323
))}
2424
</Accordion.Root>
2525
);
2626
});
27+
28+
// interal
29+
import styles from '../snippets/accordion.css?inline';
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { component$, useStyles$, useSignal } from '@builder.io/qwik';
2+
import { Accordion } from '@qwik-ui/headless';
3+
import { LuChevronDown } from '@qwikest/icons/lucide';
4+
5+
export default component$(() => {
6+
useStyles$(styles);
7+
const items = [1, 2, 3];
8+
const isRendered = useSignal(false);
9+
10+
return (
11+
<>
12+
<button style={{ marginBottom: '1rem' }} onClick$={() => (isRendered.value = true)}>
13+
Render Accordion
14+
</button>
15+
{isRendered.value && (
16+
<Accordion.Root>
17+
{items.map((item) => (
18+
<Accordion.Item class="collapsible" key={item}>
19+
<Accordion.Header>
20+
<Accordion.Trigger class="collapsible-trigger">
21+
<span>Trigger {item}</span>
22+
<LuChevronDown />
23+
</Accordion.Trigger>
24+
</Accordion.Header>
25+
<Accordion.Content class="collapsible-content collapsible-content-outline">
26+
Inside Content {item}
27+
</Accordion.Content>
28+
</Accordion.Item>
29+
))}
30+
</Accordion.Root>
31+
)}
32+
</>
33+
);
34+
});
35+
36+
// interal
37+
import styles from '../snippets/accordion.css?inline';
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { component$ } from '@builder.io/qwik';
1+
import { component$, useStyles$ } from '@builder.io/qwik';
22
import { Accordion } from '@qwik-ui/headless';
3-
import { LuChevronDown } from '@qwikest/icons/lucide';
43

54
export default component$(() => {
6-
const items = [1, 2, 3];
5+
useStyles$(styles);
6+
const items = [1, 2, 3, 4];
77

88
return (
9-
<Accordion.Root>
10-
{items.map((item, index) => (
11-
<Accordion.Item
12-
defaultValue={index === 1 ? true : false}
13-
class="accordion-item"
14-
key={item}
15-
>
9+
<Accordion.Root disabled={true}>
10+
{items.map((item) => (
11+
<Accordion.Item class="collapsible" key={item}>
1612
<Accordion.Header>
17-
<Accordion.Trigger class="accordion-trigger">
13+
<Accordion.Trigger class="collapsible-trigger">
1814
<span>Trigger {item}</span>
1915
<LuChevronDown />
2016
</Accordion.Trigger>
2117
</Accordion.Header>
22-
<Accordion.Content class="accordion-content">
18+
<Accordion.Content class="collapsible-content collapsible-content-outline">
2319
Inside Content {item}
2420
</Accordion.Content>
2521
</Accordion.Item>
2622
))}
2723
</Accordion.Root>
2824
);
2925
});
26+
27+
// interal
28+
import styles from '../snippets/accordion.css?inline';
29+
import { LuChevronDown } from '@qwikest/icons/lucide';

0 commit comments

Comments
 (0)