Skip to content

Commit b64afb7

Browse files
v2: scroller refactor (#358)
* feat: features + anatomy table * refactor: replace HTML headings with custom H2 and H3 components for consistency in anatomy and API tables * feat: keyboard interactions * feat: enhance popover component with new UI attributes and styles * fix: carousel now stays on slide for both mobile and desktop * feat: better support for vertical carousal * fix: update carousel scroll area for improved drag functionality and style adjustments * refactor: update carousel autoplay functionality to use a unified autoplayValue signal * refactor: rename CarouselPlayer to CarouselPlayTrigger and update autoplay properties for clarity * feat: add based on velocity * refactor: streamline drag tracking and velocity-based navigation in carousel component * feat: perfect velocity based * velocity based tests * feat: reduced drag time * refactor out * safari workaround bug * fix: faster response times * refactor: enhance carousel drag handling and improve touch performance * fix: format * fix: build order * only build libs
1 parent 8a0fcaa commit b64afb7

File tree

30 files changed

+935
-450
lines changed

30 files changed

+935
-450
lines changed

.github/workflows/pkg-pr-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: pnpm install
2424

2525
- name: Build package
26-
run: pnpm run build
26+
run: pnpm run build.libs
2727

2828
- name: Publish preview packages
2929
run: pnpm dlx pkg-pr-new publish './libs/*'

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Changelog
22

33

4+
## v0.5.14...v2-docs-continued
5+
6+
[compare changes](https://github.com/kunai-consulting/qwik-design-system/compare/v0.5.14...v2-docs-continued)
7+
8+
### 🚀 Enhancements
9+
10+
- Features + anatomy table ([e9c7c876](https://github.com/kunai-consulting/qwik-design-system/commit/e9c7c876))
11+
- Keyboard interactions ([a162efda](https://github.com/kunai-consulting/qwik-design-system/commit/a162efda))
12+
- Enhance popover component with new UI attributes and styles ([398237db](https://github.com/kunai-consulting/qwik-design-system/commit/398237db))
13+
14+
### 💅 Refactors
15+
16+
- Replace HTML headings with custom H2 and H3 components for consistency in anatomy and API tables ([b92d4f4d](https://github.com/kunai-consulting/qwik-design-system/commit/b92d4f4d))
17+
18+
### ❤️ Contributors
19+
20+
- Thejackshelton-kunaico <[email protected]>
21+
422
## v0.5.13...v2-migration
523

624
[compare changes](https://github.com/kunai-consulting/qwik-design-system/compare/v0.5.13...v2-migration)

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"deploy": "wrangler pages deploy ./dist",
2020
"dev": "vite --mode ssr --host",
2121
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
22-
"preview": "qwik build preview && vite preview --open",
22+
"preview": "qwik build preview && vite preview --open --host",
2323
"serve": "wrangler pages dev ./dist --compatibility-flags=nodejs_als",
2424
"start": "vite --open --mode ssr",
2525
"qwik": "qwik",
@@ -31,8 +31,8 @@
3131
"@qds.dev/tools": "workspace:*",
3232
"@qds.dev/ui": "workspace:*",
3333
"@qds.dev/utils": "workspace:*",
34-
"@qwik.dev/core": "2.0.0-beta.13",
35-
"@qwik.dev/router": "2.0.0-beta.13",
34+
"@qwik.dev/core": "https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8144",
35+
"@qwik.dev/router": "https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8144",
3636
"@qwikest/icons": "^0.0.13",
3737
"@tailwindcss/vite": "^4.1.3",
3838
"@types/estree-jsx": "1.0.5",

docs/src/docs-widgets/anatomy-table/anatomy-table.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { AnatomyItem } from "@kunai-consulting/code-notate-core";
22
import { component$ } from "@qwik.dev/core";
3+
import { H2 } from "~/mdx/components";
34
import type { ComponentParts } from "../api-table/api-table";
45

56
export const AnatomyTable = component$<{ api: ComponentParts }>(({ api }) => {
@@ -11,34 +12,37 @@ export const AnatomyTable = component$<{ api: ComponentParts }>(({ api }) => {
1112

1213
return (
1314
<div>
14-
<div class="border-neutral-primary border overflow-hidden">
15+
<H2 class="mt-16 mb-6">Anatomy</H2>
16+
<div class="border-blue-500 border-[1.6px] overflow-hidden shadow-[6px_6px_0_0px_var(--color-blue-200)]">
1517
<table class="w-full border-collapse text-sm">
1618
<thead>
17-
<tr class="border-b border-neutral-primary bg-neutral-primary">
18-
<th class="py-4 px-4 text-left font-medium">Part</th>
19-
<th class="py-4 px-4 text-left font-medium">Description</th>
19+
<tr class="border-b-[1.6px] border-blue-500 bg-blue-200">
20+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
21+
Part
22+
</th>
23+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase">
24+
Description
25+
</th>
2026
</tr>
2127
</thead>
2228
<tbody>
2329
{anatomyItems.map((item) => (
2430
<tr
2531
key={item.name}
26-
class="border-b last-of-type:border-b-0 border-neutral-primary"
32+
class="border-b-[1.6px] last-of-type:border-b-0 border-blue-500"
2733
>
28-
<td class="py-4 px-4 text-sm">
29-
<span class="bg-neutral-primary rounded-sm block p-1 px-2 w-fit">
30-
<span class="text-neutral-foreground">{"<"}</span>
31-
<span class="text-white">{item.name.split(".")[0]}</span>
32-
{item.name.includes(".") && (
33-
<>
34-
<span class="text-neutral-foreground">{"."}</span>
35-
<span class="text-qwik-blue-300">{item.name.split(".")[1]}</span>
36-
</>
37-
)}
38-
<span class="text-neutral-foreground">{"\u003E"}</span>
39-
</span>
34+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500">
35+
<span>{"<"}</span>
36+
<span>{item.name.split(".")[0]}</span>
37+
{item.name.includes(".") && (
38+
<>
39+
<span>{"."}</span>
40+
<span class="text-blue-600">{item.name.split(".")[1]}</span>
41+
</>
42+
)}
43+
<span>{"\u003E"}</span>
4044
</td>
41-
<td class="py-4 px-4 text-[#b8c1cc]">{item.description || "—"}</td>
45+
<td class="py-[10px] px-4 text-light-700">{item.description || "—"}</td>
4246
</tr>
4347
))}
4448
</tbody>

docs/src/docs-widgets/api-table/api-table.tsx

Lines changed: 71 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type {
33
ComponentEntry,
44
ParsedProps
55
} from "@kunai-consulting/code-notate-core";
6+
import { Lucide, Popover } from "@qds.dev/ui";
67
import { component$, useContext, useTask$ } from "@qwik.dev/core";
7-
8-
import { Popover } from "@qds.dev/ui";
8+
import { H2, H3 } from "~/mdx/components";
99
import { rootContextId } from "~/routes/components/layout";
10-
import { MainHeading, SubHeading } from "../toc/toc";
10+
import { Spacer } from "../spacer/spacer";
1111

1212
type DataAttribute = {
1313
name: string;
@@ -105,9 +105,11 @@ export const APITable = component$(({ api }: { api: ComponentParts }) => {
105105
});
106106

107107
return (
108-
<div class="overflow-x-auto">
109-
<MainHeading id="api-reference">API Reference</MainHeading>
110-
{items.map((item, index) => {
108+
<div class="overflow-x-auto sm:overflow-x-visible">
109+
<H2 id="api-reference" class="mt-16 mb-6">
110+
API Reference
111+
</H2>
112+
{items.map((item) => {
111113
const componentData = Object.entries(item)[0];
112114
const [itemName, itemProps] = componentData;
113115

@@ -117,50 +119,58 @@ export const APITable = component$(({ api }: { api: ComponentParts }) => {
117119

118120
return (
119121
<div key={itemName}>
120-
<div
121-
class={`h-[1px] bg-neutral-primary ${index === 0 ? "mt-0" : "mt-8"}`}
122-
aria-hidden="true"
123-
/>
124-
<SubHeading id={itemName}>{itemName}</SubHeading>
122+
<H3 id={itemName}>{itemName}</H3>
125123
{itemProps.inheritsFrom && (
126-
<p class="mb-4 text-sm text-neutral-foreground mt-4">
127-
Inherits from:{" "}
128-
<code class="px-2 py-1 !bg-neutral-primary !text-qwik-blue-300">
129-
{`<${itemProps.inheritsFrom} />`}
130-
</code>
124+
<p class="text-sm my-6 font-semibold leading-[137.5%]">
125+
<span class="text-light-700">Inherits from: </span>
126+
<code class="text-blue-600 ml-1">{`<${itemProps.inheritsFrom} />`}</code>
131127
</p>
132128
)}
133129

134130
{/* Props Table */}
135131
{propsArray && propsArray.length > 0 && (
136132
<>
137-
<h4 class="mb-2 font-medium">Props</h4>
138-
<div class="border-neutral-primary border mb-6">
133+
<h4 class="mb-2 font-semibold">Props</h4>
134+
<div class="border-blue-500 border-[1.6px] overflow-hidden shadow-[6px_6px_0_0px_var(--color-blue-200)] mb-6">
139135
<table class="w-full border-collapse text-sm">
140136
<thead>
141-
<tr class="border-b border-neutral-primary bg-neutral-primary">
142-
<th class="py-4 px-4 text-left font-medium">Prop</th>
143-
<th class="py-4 px-4 text-left font-medium">Type</th>
144-
<th class="py-4 px-4 text-left font-medium">Default</th>
145-
<th class="py-4 px-4 text-left font-medium">Description</th>
137+
<tr class="border-b-[1.6px] border-blue-500 bg-blue-200">
138+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
139+
Prop
140+
</th>
141+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
142+
Type
143+
</th>
144+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
145+
Default
146+
</th>
147+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase">
148+
Description
149+
</th>
146150
</tr>
147151
</thead>
148152
<tbody>
149153
{propsArray.map((prop: ParsedProps) => (
150154
<tr
151155
key={prop.prop}
152-
class="border-b last-of-type:border-b-0 border-qwik-neutral-900"
156+
class="border-b-[1.6px] last-of-type:border-b-0 border-blue-500"
153157
>
154-
<td class="py-4 px-4 text-sm">{prop.prop}</td>
155-
<td class="py-4 px-4 text-sm">{prop.type}</td>
156-
<td class="py-4 px-4 text-sm">{prop.defaultValue || "-"}</td>
157-
<td class="py-4 px-4">
158+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500">
159+
{prop.prop}
160+
</td>
161+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500">
162+
{prop.type}
163+
</td>
164+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500">
165+
{prop.defaultValue || "-"}
166+
</td>
167+
<td class="py-[10px] px-4">
158168
{prop.comment && (
159169
<Popover.Root>
160-
<Popover.Trigger class="text-qwik-blue-500 hover:text-blue-300 cursor-pointer">
161-
Details
170+
<Popover.Trigger class="text-qwik-blue-500 hover:text-blue-300 cursor-pointer w-fit">
171+
<Lucide.Info class="size-5 text-lavender-600" />
162172
</Popover.Trigger>
163-
<Popover.Content class="p-4 max-w-xs bg-neutral-foreground rounded-md mt-1">
173+
<Popover.Content class="bg-neutral-foreground mt-1 w-fit max-w-[500px] rounded-full shadow-[4px_4px_0_0px_#6C2CC4] border-[1.6px] border-lavender-500 py-1.5 px-3">
164174
{prop.comment}
165175
</Popover.Content>
166176
</Popover.Root>
@@ -177,30 +187,35 @@ export const APITable = component$(({ api }: { api: ComponentParts }) => {
177187
{/* Data Attributes Table */}
178188
{itemProps.dataAttributes && itemProps.dataAttributes.length > 0 && (
179189
<>
180-
<h4 class="mb-2 font-medium">Data Attributes</h4>
181-
<div class="border-neutral-primary border">
190+
<h4 class="mb-2 font-semibold">Data Attributes</h4>
191+
<div class="border-blue-500 border-[1.6px] overflow-hidden shadow-[6px_6px_0_0px_var(--color-blue-200)]">
182192
<table class="w-full border-collapse text-sm">
183193
<thead>
184-
<tr class="border-b border-neutral-primary bg-neutral-primary">
185-
<th class="py-4 px-4 text-left font-medium">Attribute</th>
186-
<th class="py-4 px-4 text-left font-medium">Description</th>
194+
<tr class="border-b-[1.6px] border-blue-500 bg-blue-200">
195+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
196+
Attribute
197+
</th>
198+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase">
199+
Description
200+
</th>
187201
</tr>
188202
</thead>
189203
<tbody>
190204
{itemProps.dataAttributes.map((attr: DataAttribute) => (
191205
<tr
192206
key={attr.name}
193-
class="border-b last-of-type:border-b-0 border-neutral-primary"
207+
class="border-b-[1.6px] last-of-type:border-b-0 border-blue-500"
194208
>
195-
<td class="py-4 px-4 text-sm text-qwik-blue-200">
209+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500 text-blue-600">
196210
{attr.name}
197211
</td>
198-
<td class="py-4 px-4">{attr.comment}</td>
212+
<td class="py-[10px] px-4 text-light-700">{attr.comment}</td>
199213
</tr>
200214
))}
201215
</tbody>
202216
</table>
203217
</div>
218+
<Spacer class="h-12" />
204219
</>
205220
)}
206221
</div>
@@ -210,28 +225,34 @@ export const APITable = component$(({ api }: { api: ComponentParts }) => {
210225
{/* Add Keyboard Interactions Table */}
211226
{api.keyboardInteractions && api.keyboardInteractions.length > 0 && (
212227
<>
213-
<MainHeading id="accessibility">Accessibility</MainHeading>
214-
<SubHeading id="keyboard-interactions">Keyboard Interactions</SubHeading>
215-
<div class="border-neutral-primary border mt-6">
216-
<table class="w-full border-collapse border-spacing-1 text-sm">
228+
<H2 id="accessibility" class="mt-16 mb-6">
229+
Accessibility
230+
</H2>
231+
<H3 id="keyboard-interactions">Keyboard Interactions</H3>
232+
<div class="border-blue-500 border-[1.6px] overflow-hidden shadow-[6px_6px_0_0px_var(--color-blue-200)] mt-6">
233+
<table class="w-full border-collapse text-sm">
217234
<thead>
218-
<tr class="border-b border-neutral-primary bg-neutral-primary">
219-
<th class="py-4 px-4 text-left font-medium">Key</th>
220-
<th class="py-4 px-4 text-left font-medium">Description</th>
235+
<tr class="border-b-[1.6px] border-blue-500 bg-blue-200">
236+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase border-r-[1.6px] border-blue-500">
237+
Key
238+
</th>
239+
<th class="py-[10px] px-4 text-left font-bold text-blue-600 uppercase">
240+
Description
241+
</th>
221242
</tr>
222243
</thead>
223244
<tbody>
224245
{api.keyboardInteractions.map((interaction) => (
225246
<tr
226247
key={interaction.key}
227-
class="border-b last-of-type:border-b-0 border-neutral-primary"
248+
class="border-b-[1.6px] last-of-type:border-b-0 border-blue-500"
228249
>
229-
<td class="py-4 px-4 text-sm flex items-center">
230-
<span class="bg-neutral-interactive px-3 py-1 border-b-2 border-neutral-primary rounded-md">
250+
<td class="py-[10px] px-4 text-sm border-r-[1.6px] border-blue-500">
251+
<span class="bg-neutral-interactive px-4 py-1.5 border-b-4 border-[#6A7581] bg-light-700 rounded-md inline-flex items-center text-white">
231252
{interaction.key}
232253
</span>
233254
</td>
234-
<td class="py-4 px-4">{interaction.comment}</td>
255+
<td class="py-[10px] px-4 text-light-700">{interaction.comment}</td>
235256
</tr>
236257
))}
237258
</tbody>

docs/src/docs-widgets/features/features.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { Lucide } from "@qds.dev/ui";
12
import { component$ } from "@qwik.dev/core";
2-
import { LuBadgeCheck } from "@qwikest/icons/lucide";
3+
import { H2 } from "~/mdx/components";
34
import type { ComponentParts } from "../api-table/api-table";
45

56
export const Features = component$<{ api: ComponentParts }>(({ api }) => {
@@ -11,11 +12,15 @@ export const Features = component$<{ api: ComponentParts }>(({ api }) => {
1112

1213
return (
1314
<div>
15+
<H2 class="mt-16 mb-6">Features</H2>
1416
<ul class="list-disc list-inside space-y-4">
1517
{features.map((feature) => (
16-
<li class="flex items-center gap-2" key={feature}>
18+
<li
19+
class="flex items-center gap-2 font-semibold leading-[137.5%]"
20+
key={feature}
21+
>
1722
<span>
18-
<LuBadgeCheck class="text-qwik-blue-400" />
23+
<Lucide.BadgeCheck class="text-lavender-600" />
1924
</span>
2025
<span class="text-neutral-foreground">{feature}</span>
2126
</li>

docs/src/docs-widgets/header/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const DesktopNav = component$(() => {
165165
<span>{item.label}</span>
166166
</Navbar.ItemTrigger>
167167
<Navbar.ItemContent
168-
class="open:grid gap-4 shadow-[6px_6px_0_0px_var(--color-blue-200)] rounded-2xl p-4 border-[1.6px] border-blue-300 transition-discrete duration-[325ms] ease-in-out open:animate-to-visible not-open:animate-from-visible opacity-0"
168+
class="open:grid gap-4 shadow-[6px_6px_0_0px_var(--color-blue-200)] rounded-2xl p-4 border-[1.6px] border-blue-300 transition-[opacity,display,overlay] transition-discrete duration-[325ms] ease-in-out open:animate-to-visible not-open:animate-from-visible opacity-0"
169169
style={{ ...getContentGridTemplate(item.label), width: "650px" }}
170170
ui-mega-popover
171171
>

docs/src/docs-widgets/sidebar/sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Lucide, Tree } from "@qds.dev/ui";
2-
import { $, type PropsOf, Slot, component$, useSignal } from "@qwik.dev/core";
2+
import { $, component$, type PropsOf, Slot, useSignal } from "@qwik.dev/core";
33
import { Link, useNavigate } from "@qwik.dev/router";
44
import { Action } from "../action/action";
55
import { QwikLogo } from "../header/header";
@@ -130,7 +130,7 @@ export const Sidebar = component$((props: PropsOf<"nav">) => {
130130
type="button"
131131
class="p-2 -mx-2 hover:bg-light-100 transition-colors rounded-lg"
132132
>
133-
<Lucide.PanelLeftClose class="size-6" />
133+
<Lucide.PanelLeft class="size-6" />
134134
</button>
135135
</div>
136136

0 commit comments

Comments
 (0)