Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(quill): cleanup pass + 0.3.0-beta.1 (#57623)

Adam Leith137773c6d2f6
diff --git a/packages/quill/apps/storybook/.storybook/main.ts b/packages/quill/apps/storybook/.storybook/main.ts
index 7207a5535865..b00f91718453 100644
--- a/packages/quill/apps/storybook/.storybook/main.ts
+++ b/packages/quill/apps/storybook/.storybook/main.ts
@@ -91,7 +91,12 @@ const config: StorybookConfig = {
// Also pick up stories co-located in packages
'../../../packages/*/src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
],
- addons: ['@storybook/addon-docs', '@storybook/addon-toolbars', 'storybook-addon-pseudo-states'],
+ addons: [
+ '@storybook/addon-docs',
+ '@storybook/addon-toolbars',
+ 'storybook-addon-pseudo-states',
+ 'storybook-dark-mode',
+ ],
framework: {
name: '@storybook/react-vite',
options: {},
diff --git a/packages/quill/apps/storybook/.storybook/preview.tsx b/packages/quill/apps/storybook/.storybook/preview.tsx
index 20fe04a5dcc3..1ef882c0190a 100644
--- a/packages/quill/apps/storybook/.storybook/preview.tsx
+++ b/packages/quill/apps/storybook/.storybook/preview.tsx
@@ -2,6 +2,37 @@ import './storybook.css'
import React, { useEffect } from 'react'
import type { Preview } from '@storybook/react'
+import { themes } from '@storybook/theming'
+import { DocsContainer } from '@storybook/addon-docs'
+import { useDarkMode } from 'storybook-dark-mode'
+
+/**
+ * Reads the addon's dark-mode signal and syncs it to:
+ * - `<html>` class/attribute (so quill's `--background` etc. resolve to dark)
+ * - the inline story canvas wrapper.
+ *
+ * Works for both Story and Docs views — DocsContainer below covers the
+ * surrounding `.sbdocs-wrapper` chrome via Storybook's official theming.
+ */
+function ThemeSync({ children }: { children: React.ReactNode }): React.ReactElement {
+ const isDark = useDarkMode()
+
+ useEffect(() => {
+ document.documentElement.classList.toggle('dark', isDark)
+ if (isDark) {
+ document.documentElement.setAttribute('theme', 'dark')
+ } else {
+ document.documentElement.removeAttribute('theme')
+ }
+ }, [isDark])
+
+ return <>{children}</>
+}
+
+function ThemedDocsContainer(props: React.ComponentProps<typeof DocsContainer>): React.ReactElement {
+ const isDark = useDarkMode()
+ return <DocsContainer {...props} theme={isDark ? themes.dark : themes.light} />
+}
const preview: Preview = {
parameters: {
@@ -11,45 +42,33 @@ const preview: Preview = {
date: /Date$/i,
},
},
- },
- globalTypes: {
- theme: {
- description: 'Toggle light/dark theme',
- defaultValue: 'light',
- toolbar: {
- title: 'Theme',
- icon: 'paintbrush',
- items: [
- { value: 'light', title: 'Light', icon: 'sun' },
- { value: 'dark', title: 'Dark', icon: 'moon' },
- ],
- dynamicTitle: true,
+ // storybook-dark-mode: drives the toolbar toggle + autodocs container.
+ // `appBg` paints the inline story canvas behind the decorator wrapper
+ // so the entire iframe matches the active theme without per-element
+ // !important hacks.
+ darkMode: {
+ stylePreview: true,
+ light: {
+ ...themes.light,
+ appBg: '#ffffff',
+ },
+ dark: {
+ ...themes.dark,
+ appBg: '#0a0a0a',
},
},
+ docs: {
+ container: ThemedDocsContainer,
+ },
},
decorators: [
- (Story, context) => {
- const theme = context.globals.theme || 'light'
- const isDark = theme === 'dark'
-
- useEffect(() => {
- // Set both .dark class and theme="dark" attribute so the
- // toolbar toggle validates both dark mode selectors at once.
- document.documentElement.classList.toggle('dark', isDark)
- if (isDark) {
- document.documentElement.setAttribute('theme', 'dark')
- } else {
- document.documentElement.removeAttribute('theme')
- }
- document.body.style.backgroundColor = ''
- }, [isDark])
-
- return (
+ (Story) => (
+ <ThemeSync>
<div className="bg-background text-foreground" style={{ padding: '1rem' }}>
<Story />
</div>
- )
- },
+ </ThemeSync>
+ ),
],
}
diff --git a/packages/quill/apps/storybook/.storybook/storybook.css b/packages/quill/apps/storybook/.storybook/storybook.css
index 098b011b63c1..63d9bee7414c 100644
--- a/packages/quill/apps/storybook/.storybook/storybook.css
+++ b/packages/quill/apps/storybook/.storybook/storybook.css
@@ -32,6 +32,9 @@
@import 'tailwindcss';
@import '@fontsource-variable/inter';
+/* Edge-fade utilities (`scroll-mask-*`) for scrollable lists/popups. */
+@import 'tailwindcss-scroll-mask';
+
/* Design tokens — CSS custom property values + the @theme inline block. */
@import '@posthog/quill-tokens/color-system.css';
@import '@posthog/quill-tokens/tailwind-lib.css';
@@ -58,6 +61,10 @@
* {
@apply border-border outline-ring/50;
}
+
+ body {
+ @apply bg-background text-foreground;
+ }
}
/* Disable animations during visual regression tests */
diff --git a/packages/quill/apps/storybook/package.json b/packages/quill/apps/storybook/package.json
index bc532f17ed64..75ec25e44a4a 100644
--- a/packages/quill/apps/storybook/package.json
+++ b/packages/quill/apps/storybook/package.json
@@ -25,6 +25,7 @@
"@storybook/react": "catalog:",
"@storybook/react-vite": "^7.6.4",
"@storybook/test-runner": "^0.16.0",
+ "@storybook/theming": "^7.6.20",
"@tailwindcss/vite": "^4.1.17",
"@types/jest-image-snapshot": "^6.4.0",
"@types/react": "^19.2.14",
@@ -33,6 +34,7 @@
"jest-image-snapshot": "^6.4.0",
"storybook": "^7.6.4",
"storybook-addon-pseudo-states": "2.1.2",
+ "storybook-dark-mode": "3.0.3",
"typescript": "catalog:",
"vite": "^5.4.21"
}
diff --git a/packages/quill/apps/storybook/stories/colors-comparison.stories.tsx b/packages/quill/apps/storybook/stories/colors-comparison.stories.tsx
new file mode 100644
index 000000000000..f12452af4276
--- /dev/null
+++ b/packages/quill/apps/storybook/stories/colors-comparison.stories.tsx
@@ -0,0 +1,402 @@
+import type { Meta, StoryObj } from '@storybook/react'
+
+import { semanticColors } from '@posthog/quill-tokens'
+
+const meta = {
+ title: 'Tokens/Colors Comparison',
+ tags: ['autodocs'],
+} satisfies Meta
+
+export default meta
+type Story = StoryObj<typeof meta>
+
+/**
+ * PostHog color values — sourced from `frontend/src/styles/base.scss`.
+ * Hardcoded as static values so this story renders without loading
+ * PostHog's stylesheet. Update if `base.scss` changes.
+ */
+type PhValue = { light: string; dark: string }
+const ph: Record<string, PhValue> = {
+ // ── Backgrounds ────────────────────────────────────
+ 'bg-primary': { light: 'hsl(75 14% 95%)', dark: 'hsl(240 8% 8%)' },
+ 'bg-surface-primary': { light: '#fff', dark: 'hsl(235 8% 15%)' },
+ 'bg-surface-secondary': { light: 'hsl(70 16% 93%)', dark: 'hsl(240 8% 10%)' },
+ 'bg-surface-tertiary': { light: 'hsl(77 13% 89%)', dark: 'hsl(240 8% 8%)' },
+ // ── Text ────────────────────────────────────────────
+ 'text-primary': { light: 'hsl(0 0% 5%)', dark: 'hsl(0 0% 90%)' },
+ 'text-secondary': { light: 'hsl(0 0% 25%)', dark: 'hsl(0 0% 65%)' },
+ 'text-tertiary': { light: 'hsl(0 0% 40%)', dark: 'hsl(0 0% 60%)' },
+ // ── Brand ───────────────────────────────────────────
+ accent: { light: 'hsl(19 100% 48%)', dark: 'hsl(43 94% 57%)' },
+ // ── Status fills (secondary) ────────────────────────
+ 'bg-fill-error-secondary': {
+ light: 'oklch(0.936 0.032 17.717deg)',
+ dark: 'oklch(0.258 0.092 26.042deg)',
+ },
+ 'bg-fill-success-secondary': {
+ light: 'oklch(0.962 0.044 156.743deg)',
+ dark: 'oklch(0.266 0.065 152.934deg)',
+ },
+ 'bg-fill-warning-secondary': {
+ light: 'oklch(0.973 0.071 103.193deg)',
+ dark: 'oklch(0.286 0.066 53.813deg)',
+ },
+ 'bg-fill-info-secondary': {
+ light: 'oklch(0.932 0.032 255.585deg)',
+ dark: 'oklch(0.282 0.091 267.935deg)',
+ },
+ // ── Status text ─────────────────────────────────────
+ 'text-error': { light: 'oklch(0.577 0.245 27.325deg)', dark: 'oklch(0.704 0.191 22.216deg)' },
+ 'text-success': { light: 'oklch(0.627 0.194 149.214deg)', dark: 'oklch(0.792 0.209 151.711deg)' },
+ 'text-warning': { light: 'oklch(0.554 0.135 66.442deg)', dark: 'oklch(0.852 0.199 91.936deg)' },
+ // ── Borders ─────────────────────────────────────────
+ 'border-primary': { light: 'hsl(78 13% 85%)', dark: 'hsl(230 8% 20%)' },
+ 'border-secondary': { light: 'hsl(69 8% 65%)', dark: 'hsl(230 8% 40%)' },
+ // ── Input fills ─────────────────────────────────────
+ 'bg-fill-input': { light: '#fff', dark: 'hsl(240 8% 10%)' },
+ // ── Hover/active fills (relative-mix on black/white) ─
+ 'bg-fill-button-tertiary-hover': {
+ light: 'color-mix(in oklab, #000 7.5%, transparent)',
+ dark: 'color-mix(in oklab, #fff 7.5%, transparent)',
+ },
+ 'bg-fill-button-tertiary-active': {
+ light: 'color-mix(in oklab, #000 5%, transparent)',
+ dark: 'color-mix(in oklab, #fff 5%, transparent)',
+ },
+ 'bg-fill-button-panel-active': {
+ light: 'color-mix(in oklab, #000 7.5%, transparent)',
+ dark: 'color-mix(in oklab, #fff 7.5%, transparent)',
+ },
+}
+
+type Verdict = 'KEEP' | 'KILLED' | 'ADD' | 'RENAME' | 'DECIDE'
+type Row = {
+ label: string
+ note?: string
+ quill?: { token: string; light: string; dark: string }
+ posthog?: { token: string; light: string; dark: string }
+ verdict: Verdict
+ recommendation: string
+}
+
+const VERDICT_STYLE: Record<Verdict, string> = {
+ KEEP: 'bg-success text-success-foreground',
+ KILLED: 'bg-destructive text-destructive-foreground',
+ ADD: 'bg-info text-info-foreground',
+ RENAME: 'bg-warning text-warning-foreground',
+ DECIDE: 'bg-muted text-muted-foreground',
+}
+
+function quillRow(token: keyof typeof semanticColors): Row['quill'] {
+ const tuple = semanticColors[token]
+ return { token, light: tuple[0], dark: tuple[1] }
+}
+function phRow(name: keyof typeof ph): Row['posthog'] {
+ return { token: `--color-${name}`, light: ph[name].light, dark: ph[name].dark }
+}
+
+const rows: Row[] = [
+ // ── Surfaces ────────────────────────────────────────
+ {
+ label: 'App background (shell behind surfaces)',
+ quill: quillRow('background'),
+ posthog: phRow('bg-primary'),
+ verdict: 'KEEP',
+ recommendation: 'Direct drop-in. Quill light is slightly cooler than PostHog warm yellowish — within tolerance.',
+ },
+ {
+ label: 'Primary surface (cards, modals, tables)',
+ quill: quillRow('card'),
+ posthog: phRow('bg-surface-primary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in. Both effectively white in light mode.',
+ },
+ {
+ label: 'Secondary surface (subdued cards, list rows)',
+ quill: quillRow('muted'),
+ posthog: phRow('bg-surface-secondary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in. Use `bg-muted` wherever PostHog says `bg-surface-secondary`.',
+ },
+ {
+ label: 'Tertiary surface (toolbars)',
+ posthog: phRow('bg-surface-tertiary'),
+ verdict: 'DECIDE',
+ recommendation:
+ "Don't add yet. Quill has no toolbar primitive that needs a 3rd surface tier. Revisit if/when one lands.",
+ },
+ {
+ label: 'Popover surface',
+ verdict: 'KILLED',
+ recommendation: 'Folded into `card`. All consumers (popover, combobox, select, menus, command, toast, date-time-picker) now use `var(--card)` + `var(--foreground)`.',
+ },
+ {
+ label: 'Hover/focus surface (shadcn-style "accent")',
+ verdict: 'KILLED',
+ recommendation:
+ 'Replaced by `fill-hover` (hover/focus) and `fill-selected` (open/range). Surface uses (badge, skeleton, tabs) → `muted`; borders (checkbox, radio) → `border`.',
+ },
+ // ── Text ────────────────────────────────────────────
+ {
+ label: 'Primary text',
+ quill: quillRow('foreground'),
+ posthog: phRow('text-primary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'De-emphasized text',
+ quill: quillRow('muted-foreground'),
+ posthog: phRow('text-secondary'),
+ verdict: 'KEEP',
+ recommendation:
+ 'Drop-in. Quill light is slightly lower lightness — still passes contrast on muted bg. Re-check after surface alignment.',
+ },
+ {
+ label: 'Tertiary text',
+ posthog: phRow('text-tertiary'),
+ verdict: 'DECIDE',
+ recommendation:
+ 'Skip. 2 text tiers is enough; PostHog rarely uses tertiary. Add only if a primitive demands a 3rd weight.',
+ },
+ // ── Brand ───────────────────────────────────────────
+ {
+ label: 'Brand color',
+ quill: quillRow('primary'),
+ posthog: phRow('accent'),
+ verdict: 'KEEP',
+ recommendation:
+ "Keep `primary` name (shadcn portability > PostHog naming alignment). Brand surface area is small — translation cost is manageable. Document the alias in tokens README: 'quill `primary` ≡ PostHog `--color-accent`'.",
+ },
+ {
+ label: 'Brand foreground',
+ quill: quillRow('primary-foreground'),
+ verdict: 'KEEP',
+ recommendation:
+ 'Keep. PostHog has no exposed token; quill needs explicit contrast on brand bg. Same colour PostHog hardcodes (white in light, dark in dark).',
+ },
+ {
+ label: 'Secondary button (dark grey)',
+ verdict: 'KILLED',
+ recommendation: 'No active consumers — only `item.css` referenced `--secondary` for a pressable hover border, swapped to `--border`.',
+ },
+ // ── Status: backgrounds ─────────────────────────────
+ {
+ label: 'Destructive bg',
+ quill: quillRow('destructive'),
+ posthog: phRow('bg-fill-error-secondary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in. Both use ~red-100/red-900 equivalents.',
+ },
+ {
+ label: 'Success bg',
+ quill: quillRow('success'),
+ posthog: phRow('bg-fill-success-secondary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Warning bg',
+ quill: quillRow('warning'),
+ posthog: phRow('bg-fill-warning-secondary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Info bg',
+ quill: quillRow('info'),
+ posthog: phRow('bg-fill-info-secondary'),
+ verdict: 'KEEP',
+ recommendation:
+ 'Drop-in. Note quill dark uses 40% alpha; PostHog uses solid blue-950. Tweak quill dark to solid if range highlights look washed.',
+ },
+ // ── Status: foregrounds ─────────────────────────────
+ {
+ label: 'Destructive text',
+ quill: quillRow('destructive-foreground'),
+ posthog: phRow('text-error'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Success text',
+ quill: quillRow('success-foreground'),
+ posthog: phRow('text-success'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Warning text',
+ quill: quillRow('warning-foreground'),
+ posthog: phRow('text-warning'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Info text',
+ quill: quillRow('info-foreground'),
+ verdict: 'KEEP',
+ recommendation: 'Keep. PostHog has no `--color-text-info`; quill fills the gap.',
+ },
+ // ── Borders & rings ─────────────────────────────────
+ {
+ label: 'Default border',
+ quill: quillRow('border'),
+ posthog: phRow('border-primary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in.',
+ },
+ {
+ label: 'Input border',
+ quill: quillRow('input'),
+ posthog: phRow('border-secondary'),
+ verdict: 'KEEP',
+ recommendation: 'Drop-in. Both intentionally darker than default border for input affordance.',
+ },
+ {
+ label: 'Focus ring',
+ quill: quillRow('ring'),
+ verdict: 'DECIDE',
+ recommendation:
+ 'PostHog uses `--color-accent` (brand) for focus rings — quill uses neutral grey. Consider repointing quill `ring` to `var(--primary)` to match PostHog feel. Visual test required.',
+ },
+ // ── Interactive fills ───────────────────────────────
+ {
+ label: 'Hover fill',
+ quill: quillRow('fill-hover'),
+ posthog: phRow('bg-fill-button-tertiary-hover'),
+ verdict: 'KEEP',
+ recommendation:
+ "Quill's relative-mix on `--foreground` is *better* than PostHog's fixed black/white mix — works on any surface. PostHog should adopt this pattern, not the other way around.",
+ },
+ {
+ label: 'Selected fill',
+ quill: quillRow('fill-selected'),
+ posthog: phRow('bg-fill-button-tertiary-active'),
+ verdict: 'KEEP',
+ recommendation: 'Same as hover — keep quill pattern.',
+ },
+ {
+ label: 'Expanded fill',
+ quill: quillRow('fill-expanded'),
+ posthog: phRow('bg-fill-button-panel-active'),
+ verdict: 'KEEP',
+ recommendation: 'Same.',
+ },
+]
+
+function Swatch({ value }: { value: string }): React.ReactElement {
+ return (
+ <div
+ className="size-12 rounded-sm border border-border shrink-0"
+ style={{ backgroundColor: value }}
+ title={value}
+ />
+ )
+}
+
+function EmptyCell(): React.ReactElement {
+ return (
+ <div className="flex gap-1">
+ <div className="size-12 rounded-sm border border-dashed border-border/60 shrink-0 grid place-items-center text-[10px] text-muted-foreground">
+ —
+ </div>
+ <div className="size-12 rounded-sm border border-dashed border-border/60 shrink-0 grid place-items-center text-[10px] text-muted-foreground">
+ —
+ </div>
+ </div>
+ )
+}
+
+function SidePair({ light, dark }: { light: string; dark: string }): React.ReactElement {
+ return (
+ <div className="flex gap-1">
+ <Swatch value={light} />
+ <Swatch value={dark} />
+ </div>
+ )
+}
+
+function VerdictPill({ verdict }: { verdict: Verdict }): React.ReactElement {
+ return (
+ <span
+ className={`inline-block px-1.5 py-0.5 text-[10px] font-mono font-bold rounded-xs uppercase tracking-wide w-fit ${VERDICT_STYLE[verdict]}`}
+ >
+ {verdict}
+ </span>
+ )
+}
+
+function ComparisonRow({ row }: { row: Row }): React.ReactElement {
+ return (
+ <div className="grid grid-cols-[220px_180px_180px_1fr] gap-4 items-start py-3 border-b border-border/40">
+ <div className="flex flex-col gap-1">
+ <span className="text-sm font-medium">{row.label}</span>
+ {row.note && <span className="text-xs text-muted-foreground">{row.note}</span>}
+ </div>
+
+ <div className="flex flex-col gap-1">
+ {row.quill ? (
+ <>
+ <SidePair light={row.quill.light} dark={row.quill.dark} />
+ <span className="text-xs text-muted-foreground font-mono">{row.quill.token}</span>
+ </>
+ ) : (
+ <EmptyCell />
+ )}
+ </div>
+
+ <div className="flex flex-col gap-1">
+ {row.posthog ? (
+ <>
+ <SidePair light={row.posthog.light} dark={row.posthog.dark} />
+ <span className="text-xs text-muted-foreground font-mono">{row.posthog.token}</span>
+ </>
+ ) : (
+ <EmptyCell />
+ )}
+ </div>
+
+ <div className="flex flex-col gap-1.5">
+ <VerdictPill verdict={row.verdict} />
+ <span className="text-xs text-foreground leading-snug">{row.recommendation}</span>
+ </div>
+ </div>
+ )
+}
+
+export const QuillVsPostHog: Story = {
+ render: () => (
+ <div className="space-y-4 max-w-7xl">
+ <div className="space-y-1">
+ <h2 className="text-base font-semibold">Quill vs PostHog color tokens</h2>
+ <p className="text-sm text-muted-foreground">
+ Side-by-side comparison of quill semantic tokens and their PostHog `base.scss` equivalents. Each
+ pair shows light then dark. Empty cells mean no direct equivalent on that side.
+ </p>
+ <p className="text-xs text-muted-foreground">
+ Goal: make quill a near drop-in for PostHog. Small variance is OK; large variance flags a kill or
+ realign candidate.
+ </p>
+ <div className="flex gap-3 flex-wrap pt-2">
+ {(Object.keys(VERDICT_STYLE) as Verdict[]).map((v) => (
+ <VerdictPill key={v} verdict={v} />
+ ))}
+ </div>
+ </div>
+
+ <div className="grid grid-cols-[220px_180px_180px_1fr] gap-4 pb-2 border-b border-border text-xs font-mono uppercase tracking-wide text-muted-foreground">
+ <span>Purpose</span>
+ <span>Quill (light / dark)</span>
+ <span>PostHog (light / dark)</span>
+ <span>Recommendation</span>
+ </div>
+
+ <div>
+ {rows.map((row) => (
+ <ComparisonRow key={row.label} row={row} />
+ ))}
+ </div>
+ </div>
+ ),
+}
diff --git a/packages/quill/apps/storybook/stories/colors.stories.tsx b/packages/quill/apps/storybook/stories/colors.stories.tsx
index 03b2a0fd7600..071a8f5aac6e 100644
--- a/packages/quill/apps/storybook/stories/colors.stories.tsx
+++ b/packages/quill/apps/storybook/stories/colors.stories.tsx
@@ -104,25 +104,6 @@ export const AllColors: Story = {
]}
usages={['Background of cards and other surfaces like, modals, charts, etc.']}
/>
- <ColorSwatch
- name="Popover"
- items={[
- {
- className: 'bg-popover',
- name: 'popover',
- tailwindClass: 'bg-popover',
- value: semanticColors.popover[0],
- },
- {
- className: 'text-popover-foreground',
- name: 'popover-foreground',
- tailwindClass: 'text-popover-foreground',
- value: semanticColors['popover-foreground'][0],
- },
- ]}
- usages={['Background of popovers and other surfaces like, tooltips, dropdowns, etc.']}
- />
-
<ColorSwatch
name="Primary"
items={[
@@ -142,25 +123,6 @@ export const AllColors: Story = {
usages={['Main background of the app']}
/>
- <ColorSwatch
- name="Secondary"
- items={[
- {
- className: 'bg-secondary',
- name: 'secondary',
- tailwindClass: 'bg-secondary',
- value: semanticColors.secondary[0],
- },
- {
- className: 'text-secondary-foreground',
- name: 'secondary-foreground',
- tailwindClass: 'text-secondary-foreground',
- value: semanticColors['secondary-foreground'][0],
- },
- ]}
- usages={['Main button of the app']}
- />
-
<ColorSwatch
name="Muted"
items={[
@@ -180,25 +142,6 @@ export const AllColors: Story = {
usages={['Muted background of the app']}
/>
- <ColorSwatch
- name="Accent"
- items={[
- {
- className: 'bg-accent',
- name: 'accent',
- tailwindClass: 'bg-accent',
- value: semanticColors.accent[0],
- },
- {
- className: 'text-accent-foreground',
- name: 'accent-foreground',
- tailwindClass: 'text-accent-foreground',
- value: semanticColors['accent-foreground'][0],
- },
- ]}
- usages={['Accent (used for hover states, etc.)`']}
- />
-
<ColorSwatch
name="Destructive"
items={[
diff --git a/packages/quill/package.json b/packages/quill/package.json
index 1e6aeead2f5b..2361f5f268e4 100644
--- a/packages/quill/package.json
+++ b/packages/quill/package.json
@@ -10,6 +10,7 @@
"typecheck": "pnpm -r typecheck"
},
"devDependencies": {
+ "tailwindcss-scroll-mask": "^0.0.3",
"typescript": "catalog:"
}
}
diff --git a/packages/quill/packages/components/src/date-time-picker.tsx b/packages/quill/packages/components/src/date-time-picker.tsx
index 9f2e99f5bd33..af99929b5fc1 100644
--- a/packages/quill/packages/components/src/date-time-picker.tsx
+++ b/packages/quill/packages/components/src/date-time-picker.tsx
@@ -114,9 +114,9 @@ function DayItem({ day, startDate, endDate, viewing, minDate, maxDate, onClick }
data-is-same-day={sameDay}
className={cn(
'w-10 h-10 flex items-center justify-center',
- isBetween && 'bg-accent/30',
- isStart && !sameDay && 'bg-accent/30 rounded-l-full',
- isEnd && !sameDay && 'bg-accent/30 rounded-r-full'
+ isBetween && 'bg-fill-selected',
+ isStart && !sameDay && 'bg-fill-selected rounded-l-full',
+ isEnd && !sameDay && 'bg-fill-selected rounded-r-full'
)}
>
<button
@@ -514,7 +514,7 @@ export function DateTimePicker({
return (
<div
className={cn(
- 'bg-popover text-popover-foreground rounded-lg shadow-md ring-1 ring-foreground/10',
+ 'bg-card text-foreground rounded-lg shadow-md ring-1 ring-foreground/10',
compact ? 'w-[19rem]' : 'w-[19rem] lg:w-full max-w-[49rem]',
className
)}
diff --git a/packages/quill/packages/primitives/package.json b/packages/quill/packages/primitives/package.json
index f7752d3ffde2..cca8b9bd4ea4 100644
--- a/packages/quill/packages/primitives/package.json
+++ b/packages/quill/packages/primitives/package.json
@@ -1,6 +1,6 @@
{
"name": "@posthog/quill-primitives",
- "version": "0.3.0-beta.0",
+ "version": "0.3.0-beta.1",
"private": true,
"description": "Internal workspace package (private, not published). The lowest layer of the quill design system — unstyled Base UI primitives wrapped with quill's Tailwind classes (Button, Card, Dialog, Input, Popover, Combobox, etc.). Bundled into @posthog/quill at build time; consumers should import from @posthog/quill instead.",
"license": "MIT",
@@ -37,7 +37,6 @@
"@posthog/quill-tokens": "workspace:^",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
- "cmdk": "^1.1.1",
"lucide-react": "^0.577.0",
"react-resizable-panels": "^4.7.1",
"tailwind-merge": "^2.2.2"
diff --git a/packages/quill/packages/primitives/src/autocomplete.css b/packages/quill/packages/primitives/src/autocomplete.css
new file mode 100644
index 000000000000..6be55edee05d
--- /dev/null
+++ b/packages/quill/packages/primitives/src/autocomplete.css
@@ -0,0 +1,220 @@
+@layer components {
+ /*
+ * Outer chrome — owns border / shadow / radius / animation.
+ * Mirrors `.quill-combobox__content`. Scroll lives on the inner List.
+ */
+ .quill-autocomplete__content {
+ position: relative;
+
+ /*
+ * Default minimum width matches the trigger (`--anchor-width` is set
+ * by base-ui's Positioner from the anchor element). The popup grows
+ * with content but never shrinks below the trigger. Override per
+ * instance by setting `--quill-autocomplete-min-width` — works via
+ * inline style or Tailwind arbitrary-property syntax:
+ *
+ * <AutocompleteContent style={{ '--quill-autocomplete-min-width': '20rem' }} />
+ * <AutocompleteContent className="[--quill-autocomplete-min-width:20rem]" />
+ *
+ * `max-width: var(--available-width)` keeps it inside the viewport.
+ */
+ min-width: var(--quill-autocomplete-min-width, var(--anchor-width, 8rem));
+ max-width: var(--available-width);
+ max-height: var(--available-height);
+ overflow: hidden;
+ color: var(--foreground);
+ background-color: var(--card);
+ border: 1px solid var(--border);
+ border-radius: var(--radius-md);
+ box-shadow: var(--shadow-md);
+ transition:
+ opacity 150ms cubic-bezier(0.215, 0.61, 0.355, 1),
+ transform 150ms cubic-bezier(0.215, 0.61, 0.355, 1);
+ transform-origin: var(--transform-origin);
+ }
+
+ .quill-autocomplete__content[data-starting-style],
+ .quill-autocomplete__content[data-ending-style] {
+ opacity: 0;
+ transform: scale(0.97);
+ }
+
+ /*
+ * Input wrapper acts as the popup's search header — but ONLY when
+ * rendered inside a popover (`.quill-autocomplete__content`) or a
+ * dialog (`[data-slot='dialog-content']`). When used standalone on a
+ * page (e.g. the Combobox-style Grouped story where the input is a
+ * sibling of the popover), the wrapper stays bare so it reads as a
+ * normal page-level input.
+ *
+ * `:where()` keeps specificity at 0,1,0 so consumers can still
+ * override per-instance via className.
+ */
+ :where(.quill-autocomplete__content, [data-slot='dialog-content']) [data-slot='autocomplete-input-group-wrapper'] {
+ position: sticky;
+ top: 0;
+ z-index: 1;
+ padding: var(--spacing, 0.25rem);
+ background-color: var(--card);
+ border-bottom: 1px solid var(--border);
+ }
+
+ /* When AutocompleteStatus immediately follows the input wrapper, the
+ Status acts as the divider — drop the wrapper's border-bottom so we
+ don't double-up. */
+ :where(.quill-autocomplete__content, [data-slot='dialog-content'])
+ [data-slot='autocomplete-input-group-wrapper']:has(+ [data-slot='autocomplete-status']) {
+ padding-bottom: 0;
+ border-bottom: none;
+ }
+
+ :where(.quill-autocomplete__content, [data-slot='dialog-content'])
+ [data-slot='autocomplete-input-group-wrapper']
+ [data-slot='input-group'] {
+ height: 1.75rem;
+ background-color: color-mix(in oklab, var(--input) 20%, transparent);
+ box-shadow: none;
+ }
+
+ /* The separator that AutocompleteInput renders is redundant once the
+ wrapper has its own border-bottom, so hide it. Kept in the JSX so
+ inline use (input outside of popup) can still opt into it later. */
+ [data-slot='autocomplete-popover-separator'] {
+ display: none;
+ }
+
+ /*
+ * List — scroll lives here. Border on parent `.quill-autocomplete__content`.
+ * `--available-height` is set by base-ui's Positioner in popover mode.
+ * In inline mode (e.g. inside a Dialog) the variable is undefined, so we
+ * fall back to `100vh` which lets the list expand to whatever the parent
+ * (e.g. DialogContent) actually allows.
+ */
+ .quill-autocomplete__list {
+ min-height: 0;
+ max-height: min(
+ calc(var(--spacing, 0.25rem) * 72 - var(--spacing, 0.25rem) * 9),
+ calc(var(--available-height, 100vh) - var(--spacing, 0.25rem) * 9)
+ );
+ padding: var(--spacing, 0.25rem);
+
+ /* `hidden auto` = overflow-x: hidden, overflow-y: auto. Clips item
+ highlight rings at the list's right edge so they don't leak past
+ the popup/dialog's rounded corners (combobox uses a popup with
+ overflow:hidden, autocomplete-inline-in-Dialog has no such wrapper). */
+ overflow: hidden auto;
+ overscroll-behavior: contain;
+ scroll-padding-block: var(--spacing, 0.25rem);
+ }
+
+ /*
+ * Empty state visibility. Hide by default; show only when a sibling
+ * List has zero `[role='option']` descendants. Targets `[role='option']`
+ * rather than `[data-slot='autocomplete-item']` because base-ui's
+ * render-prop merging onto Button drops our slot attribute, but ARIA
+ * roles are always set by base-ui internally.
+ *
+ * Two selectors cover Empty placed before OR after the List in the
+ * DOM, without needing a common ancestor — works in popover mode
+ * (Default) and inline mode (CommandPalette inside Dialog).
+ *
+ * `MenuEmpty` is nested as a CHILD of `<Autocomplete.Empty>` (not
+ * passed via the `render` prop) so the parent's `display: none`
+ * collapses the whole subtree without needing `!important` to outrank
+ * `MenuEmpty`'s `inline-flex` from `buttonVariants`.
+ */
+ .quill-autocomplete__empty {
+ display: none;
+ }
+
+ .quill-autocomplete__empty:has(~ [data-slot='autocomplete-list']:not(:has([role='option']))),
+ [data-slot='autocomplete-list']:not(:has([role='option'])) ~ .quill-autocomplete__empty {
+ display: flex;
+ }
+
+ .quill-autocomplete__list[data-empty] {
+ padding: 0;
+ }
+
+ /* When AutocompleteStatus immediately precedes the list, the Status's
+ own padding already provides the inset above the first item — drop
+ the list's top padding to avoid stacking. */
+ [data-slot='autocomplete-status'] + .quill-autocomplete__list {
+ padding-top: 0;
+ }
+
+ .quill-autocomplete__item {
+ width: 100%;
+ }
+
+ .quill-autocomplete__item[data-disabled] {
+ pointer-events: none;
+ opacity: 0.5;
+ }
+
+ .quill-autocomplete__item:not([data-variant='destructive'])[data-highlighted] * {
+ color: var(--foreground);
+ }
+
+ /* Drop nested Item primitive borders inside autocomplete rows */
+ .quill-autocomplete__item > .item {
+ border: 0;
+ }
+
+ .quill-autocomplete__label {
+ position: sticky;
+ top: calc(var(--spacing, 0.25rem) * -1);
+ z-index: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 100%;
+ padding-block: 0 !important;
+
+ /*
+ * Pull the label flush with the list's outer top edge:
+ * - `margin-top: -spacing` consumes the list's `padding-top` in
+ * the normal flow (otherwise the label sits BELOW the padding
+ * on initial render).
+ * - `top: -spacing` keeps the sticky offset at the same place so
+ * the label doesn't jump when scrolling starts.
+ *
+ * When `[data-slot='autocomplete-status']` precedes the list, the
+ * list's `padding-top` is 0 (set elsewhere in this file), so the
+ * lift would punch the label into the Status. Override below.
+ */
+ margin-top: calc(var(--spacing, 0.25rem) * -1);
+ background-color: var(--card);
+ }
+
+ [data-slot='autocomplete-status'] + .quill-autocomplete__list .quill-autocomplete__label {
+ top: 0;
+ margin-top: 0;
+ }
+
+ .quill-autocomplete__separator {
+ height: 1px;
+ margin-block: 0.25rem;
+ margin-inline: -0.25rem;
+ background-color: color-mix(in oklab, var(--border) 50%, transparent);
+ }
+
+ .quill-autocomplete__separator:last-child {
+ display: none;
+ }
+
+ .quill-autocomplete__trigger svg:not([class*='size-']) {
+ width: 0.875rem;
+ height: 0.875rem;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .quill-autocomplete__content,
+ .quill-autocomplete__content[data-starting-style],
+ .quill-autocomplete__content[data-ending-style] {
+ opacity: 1;
+ transition: none;
+ transform: none;
+ }
+ }
+}
diff --git a/packages/quill/packages/primitives/src/autocomplete.stories.tsx b/packages/quill/packages/primitives/src/autocomplete.stories.tsx
new file mode 100644
index 000000000000..602b7ca52d8b
--- /dev/null
+++ b/packages/quill/packages/primitives/src/autocomplete.stories.tsx
@@ -0,0 +1,370 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { CalendarIcon, Cog, FileTextIcon, MoonIcon, SearchIcon, SunIcon, UserIcon } from 'lucide-react'
+import * as React from 'react'
+
+import {
+ Autocomplete,
+ AutocompleteCollection,
+ AutocompleteContent,
+ AutocompleteEmpty,
+ AutocompleteGroup,
+ AutocompleteInput,
+ AutocompleteItem,
+ AutocompleteLabel,
+ AutocompleteList,
+ AutocompleteStatus,
+} from './autocomplete'
+import { Button } from './button'
+import { Dialog, DialogContent } from './dialog'
+import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent } from './empty'
+
+const meta = {
+ title: 'Primitives/Autocomplete',
+ component: Autocomplete,
+ tags: ['autodocs'],
+} satisfies Meta<typeof Autocomplete>
+
+export default meta
+type Story = StoryObj<typeof meta>
+
+const FRAMEWORKS = [
+ 'Next.js',
+ 'SvelteKit',
+ 'Nuxt.js',
+ 'Remix',
+ 'Astro',
+ 'Gatsby',
+ 'Solid Start',
+ 'Qwik City',
+ 'Fresh',
+ 'Hono',
+ 'Redwood',
+] as const
+
+/*
+ * Default — search input + scrollable filtered list inside a popover
+ * anchored to a Button trigger. Items rendered via function-as-child so
+ * base-ui owns the filter pipeline. For sticky-footer "Create new" action
+ * patterns, use the Combobox primitive (which has `ComboboxListFooter`).
+ */
+export const Default: Story = {
+ render: () => {
+ const [open, setOpen] = React.useState(true)
+ const [value, setValue] = React.useState('')
+ const triggerRef = React.useRef<HTMLButtonElement>(null)
+ return (
+ <div className="max-w-xs">
+ <Autocomplete
+ items={FRAMEWORKS}
+ open={open}
+ onOpenChange={setOpen}
+ value={value}
+ onValueChange={setValue}
+ >
+ <Button ref={triggerRef} variant="outline" size="sm" onClick={() => setOpen((p) => !p)}>
+ Pick a framework
+ </Button>
+ <AutocompleteContent anchor={triggerRef}>
+ <AutocompleteInput placeholder="Search…" />
+ <AutocompleteEmpty>No frameworks match</AutocompleteEmpty>
+ <AutocompleteList>
+ {(item: (typeof FRAMEWORKS)[number]) => (
+ <AutocompleteItem key={item} value={item}>
+ {item}
+ </AutocompleteItem>
+ )}
+ </AutocompleteList>
+ </AutocompleteContent>
+ </Autocomplete>
+ </div>
+ )
+ },
+} satisfies Story
+
+type Group = { label: string; items: readonly string[] }
+const GROUPED: Group[] = [
+ { label: 'Frontend', items: ['Next.js', 'SvelteKit', 'Nuxt.js', 'Remix', 'Astro'] },
+ { label: 'Backend', items: ['Hono', 'Fastify', 'Express', 'NestJS', 'tRPC'] },
+]
+
+/*
+ * Grouped items via the function-as-child + Collection pattern. base-ui
+ * filters across all groups and prunes empty groups automatically. Each
+ * group's items go through `<AutocompleteCollection>` so the filter knows
+ * which leaf items to keep.
+ */
+export const Grouped: Story = {
+ render: () => {
+ const [open, setOpen] = React.useState(true)
+ const [value, setValue] = React.useState('')
+ return (
+ <div className="max-w-xs">
+ <Autocomplete items={GROUPED} open={open} onOpenChange={setOpen} value={value} onValueChange={setValue}>
+ <AutocompleteInput placeholder="Search…" />
+ <AutocompleteContent>
+ <AutocompleteEmpty>No matches</AutocompleteEmpty>
+ <AutocompleteList>
+ {(group: Group) => (
+ <AutocompleteGroup key={group.label} items={group.items}>
+ <AutocompleteLabel>{group.label}</AutocompleteLabel>
+ <AutocompleteCollection>
+ {(item: string) => (
+ <AutocompleteItem key={item} value={item}>
+ {item}
+ </AutocompleteItem>
+ )}
+ </AutocompleteCollection>
+ </AutocompleteGroup>
+ )}
+ </AutocompleteList>
+ </AutocompleteContent>
+ </Autocomplete>
+ </div>
+ )
+ },
+} satisfies Story
+
+export const EmptyState: Story = {
+ render: () => {
+ const [open, setOpen] = React.useState(true)
+ const [value, setValue] = React.useState('xxxxx')
+ return (
+ <div className="max-w-xs">
+ <Autocomplete
+ items={FRAMEWORKS}
+ open={open}
+ onOpenChange={setOpen}
+ value={value}
+ onValueChange={setValue}
+ >
+ <AutocompleteInput placeholder="Search frameworks…" />
+ <AutocompleteContent>
+ <AutocompleteEmpty>No frameworks match</AutocompleteEmpty>
+ <AutocompleteList>
+ {(item: (typeof FRAMEWORKS)[number]) => (
+ <AutocompleteItem key={item} value={item}>
+ {item}
+ </AutocompleteItem>
+ )}
+ </AutocompleteList>
+ </AutocompleteContent>
+ </Autocomplete>
+ </div>
+ )
+ },
+} satisfies Story
+
+/*
+ * Command palette — Autocomplete used to filter command items that fire
+ * actions on selection (Cmd+K pattern). Hosted inside a Dialog for the
+ * full-screen modal feel. Selection runs the command's `onRun` and
+ * closes the palette via `onValueChange`.
+ */
+type Command = {
+ id: string
+ label: string
+ section: 'General' | 'Theme' | 'Navigation'
+ icon: React.ReactNode
+ keywords?: string
+ onRun: () => void
+ endNode?: React.ReactNode
+}
+
+const COMMANDS: Command[] = [
+ { id: 'open-settings', label: 'Open settings', section: 'General', icon: <Cog />, onRun: () => alert('open settings'), endNode: '' },
+ { id: 'open-profile', label: 'Open profile', section: 'General', icon: <UserIcon />, onRun: () => alert('open profile'), endNode: '' },
+ { id: 'new-doc', label: 'New document', section: 'General', icon: <FileTextIcon />, keywords: 'create file', onRun: () => alert('new doc'), endNode: '' },
+ { id: 'theme-light', label: 'Switch to light theme', section: 'Theme', icon: <SunIcon />, onRun: () => alert('light theme'), endNode: '' },
+ { id: 'theme-dark', label: 'Switch to dark theme', section: 'Theme', icon: <MoonIcon />, onRun: () => alert('dark theme'), endNode: '' },
+ { id: 'go-calendar', label: 'Go to calendar', section: 'Navigation', icon: <CalendarIcon />, onRun: () => alert('calendar') },
+ { id: 'go-search', label: 'Search everywhere', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('search'), endNode: '' },
+ { id: 'go-x', label: 'Go to x', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('x') },
+ { id: 'go-y', label: 'Go to y', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('y') },
+ { id: 'go-z', label: 'Go to z', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('z') },
+ { id: 'go-a', label: 'Go to a', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('a') },
+ { id: 'go-b', label: 'Go to b', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('b') },
+ { id: 'go-c', label: 'Go to c', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('c') },
+ { id: 'go-d', label: 'Go to d', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('d') },
+ { id: 'go-e', label: 'Go to e', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('e') },
+ { id: 'go-f', label: 'Go to f', section: 'Navigation', icon: <SearchIcon />, onRun: () => alert('f') },
+]
+
+/*
+ * CommandPalette uses the grouped function-as-child + Collection pattern
+ * so base-ui can filter across sections. The sections array goes into
+ * `items={...}` on Root, then each Group renders a `<AutocompleteCollection>`
+ * over its commands. base-ui prunes commands and groups that don't match
+ * the input. Selection is intercepted by `onValueChange` to fire the
+ * command's `onRun` and dismiss the dialog.
+ */
+type CommandSection = { label: string; items: Command[] }
+
+const SECTIONS: CommandSection[] = [
+ { label: 'General', items: COMMANDS.filter((c) => c.section === 'General') },
+ { label: 'Theme', items: COMMANDS.filter((c) => c.section === 'Theme') },
+ { label: 'Navigation', items: COMMANDS.filter((c) => c.section === 'Navigation') },
+]
+
+export const CommandPalette: Story = {
+ render: () => {
+ const [open, setOpen] = React.useState(true)
+ const [query, setQuery] = React.useState('')
+
+ const handleSelect = (id: string | null): void => {
+ if (id === null) {return}
+ const cmd = COMMANDS.find((c) => c.id === id)
+ if (!cmd) {return}
+ cmd.onRun()
+ setOpen(false)
+ setQuery('')
+ }
+
+ return (
+ <>
+ <Button variant="outline" onClick={() => setOpen(true)}>
+ Open palette ⌘K
+ </Button>
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogContent className="p-0 gap-0 max-h-[40vh]" showCloseButton={false}>
+ <Autocomplete
+ inline
+ items={SECTIONS}
+ value={query}
+ onValueChange={(val) => {
+ if (typeof val === 'string') {
+ setQuery(val)
+ }
+ }}
+ onItemHighlighted={(item) => {
+ // hook for future analytics/preview
+ void item
+ }}
+ >
+ <AutocompleteInput placeholder="Type a command…" showClear>
+ <Button variant="outline" size="xs">Some more content</Button>
+ </AutocompleteInput>
+ <AutocompleteStatus emptyContent={<span>No commands match <strong>"{query}"</strong></span>}/>
+ <AutocompleteList>
+ {(section: CommandSection) => (
+ <AutocompleteGroup key={section.label} items={section.items}>
+ <AutocompleteLabel>{section.label}</AutocompleteLabel>
+ <AutocompleteCollection>
+ {(cmd: Command) => (
+ <AutocompleteItem
+ key={cmd.id}
+ value={cmd.id}
+ onClick={() => handleSelect(cmd.id)}
+ className="block"
+ >
+ {cmd.icon}
+ {cmd.label}
+ <span className="font-mono ml-auto text-xs text-muted-foreground/80">
+ 2 days ago
+ </span>
+
+ </AutocompleteItem>
+ )}
+ </AutocompleteCollection>
+ </AutocompleteGroup>
+ )}
+ </AutocompleteList>
+ <AutocompleteEmpty>
+ No commands match <strong>"{query}"</strong>
+ </AutocompleteEmpty>
+ </Autocomplete>
+ </DialogContent>
+ </Dialog>
+ </>
+ )
+ },
+} satisfies Story
+
+export const CommandPaletteCustomEmpty: Story = {
+ render: () => {
+ const [open, setOpen] = React.useState(true)
+ const [query, setQuery] = React.useState('asdfasdfasdf')
+
+ const handleSelect = (id: string | null): void => {
+ if (id === null) {return}
+ const cmd = COMMANDS.find((c) => c.id === id)
+ if (!cmd) {return}
+ cmd.onRun()
+ setOpen(false)
+ setQuery('')
+ }
+
+ return (
+ <>
+ <Button variant="outline" onClick={() => setOpen(true)}>
+ Open palette ⌘K
+ </Button>
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogContent className="p-0 gap-0 max-h-[40vh]" showCloseButton={false}>
+ <Autocomplete
+ inline
+ items={SECTIONS}
+ value={query}
+ onValueChange={(val) => {
+ if (typeof val === 'string') {
+ setQuery(val)
+ }
+ }}
+ onItemHighlighted={(item) => {
+ // hook for future analytics/preview
+ void item
+ }}
+ >
+ <AutocompleteInput placeholder="Type a command…" showClear>
+ <Button variant="outline" size="xs">Some more content</Button>
+ </AutocompleteInput>
+ <AutocompleteStatus emptyContent={
+ <Empty>
+ <EmptyHeader>
+ <EmptyMedia variant="icon">
+ <SearchIcon />
+ </EmptyMedia>
+ <EmptyTitle>Oops, we couldn't find that.</EmptyTitle>
+ <EmptyDescription>
+ Try searching for something else.
+ </EmptyDescription>
+ </EmptyHeader>
+ <EmptyContent className="flex-row justify-center gap-2">
+ <Button variant="primary">Call to action</Button>
+ <Button variant="outline">Secondary</Button>
+ </EmptyContent>
+ </Empty>
+ }/>
+ <AutocompleteList>
+ {(section: CommandSection) => (
+ <AutocompleteGroup key={section.label} items={section.items}>
+ <AutocompleteLabel>{section.label}</AutocompleteLabel>
+ <AutocompleteCollection>
+ {(cmd: Command) => (
+ <AutocompleteItem
+ key={cmd.id}
+ value={cmd.id}
+ onClick={() => handleSelect(cmd.id)}
+ className="block"
+ >
+ {cmd.icon}
+ {cmd.label}
+ <span className="font-mono ml-auto text-xs text-muted-foreground/80">
+ 2 days ago
+ </span>
+
+ </AutocompleteItem>
+ )}
+ </AutocompleteCollection>
+ </AutocompleteGroup>
+ )}
+ </AutocompleteList>
+ <AutocompleteEmpty>
+ No commands match <strong>"{query}"</strong>
+ </AutocompleteEmpty>
+ </Autocomplete>
+ </DialogContent>
+ </Dialog>
+ </>
+ )
+ },
+} satisfies Story
diff --git a/packages/quill/packages/primitives/src/autocomplete.tsx b/packages/quill/packages/primitives/src/autocomplete.tsx
new file mode 100644
index 000000000000..690ad3688de5
--- /dev/null
+++ b/packages/quill/packages/primitives/src/autocomplete.tsx
@@ -0,0 +1,332 @@
+import { Autocomplete as AutocompletePrimitive } from '@base-ui/react/autocomplete'
+import { ChevronDownIcon, SearchIcon, XIcon } from 'lucide-react'
+import * as React from 'react'
+
+import './autocomplete.css'
+import { Button } from './button'
+import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group'
+import { cn } from './lib/utils'
+import { MenuEmpty } from './menu-empty'
+import { MenuLabel } from './menu-label'
+import { Separator } from './separator'
+
+const AutocompleteAnchorContext = React.createContext<React.RefObject<HTMLDivElement> | null>(null)
+
+// AutocompletePrimitive.Root has two overloads (flat-items vs grouped-items) that
+// TypeScript can't disambiguate when we spread props through our wrapper. The
+// underlying runtime is the same; cast to a permissive component type so consumers
+// of `<Autocomplete>` still see the full Props<Value> surface from the public
+// signature on `Autocomplete` below.
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const AutocompleteRoot = AutocompletePrimitive.Root as unknown as React.FC<any>
+
+function Autocomplete<Value>({
+ children,
+ autoHighlight = true,
+ ...props
+}: AutocompletePrimitive.Root.Props<Value> & {
+ items?: readonly Value[] | readonly { items: readonly Value[] }[]
+}): React.ReactElement {
+ const anchorRef = React.useRef<HTMLDivElement>(null!)
+ return (
+ <AutocompleteAnchorContext.Provider value={anchorRef}>
+ <AutocompleteRoot {...props} autoHighlight={autoHighlight}>
+ {children}
+ </AutocompleteRoot>
+ </AutocompleteAnchorContext.Provider>
+ )
+}
+
+function AutocompleteValue({ ...props }: AutocompletePrimitive.Value.Props): React.ReactElement {
+ return <AutocompletePrimitive.Value data-slot="autocomplete-value" {...props} />
+}
+
+const AutocompleteTrigger = React.forwardRef<HTMLButtonElement, AutocompletePrimitive.Trigger.Props>(
+ ({ className, children, ...props }, ref) => (
+ <AutocompletePrimitive.Trigger
+ ref={ref}
+ data-slot="autocomplete-trigger"
+ className={cn('quill-autocomplete__trigger', className)}
+ {...props}
+ >
+ {children}
+ <ChevronDownIcon className="pointer-events-none size-3.5 text-muted-foreground" />
+ </AutocompletePrimitive.Trigger>
+ )
+)
+AutocompleteTrigger.displayName = 'AutocompleteTrigger'
+
+function AutocompleteClear({ className, ...props }: AutocompletePrimitive.Clear.Props): React.ReactElement {
+ return (
+ <AutocompletePrimitive.Clear
+ data-slot="autocomplete-clear"
+ render={<InputGroupButton size="icon-xs" />}
+ className={cn(className)}
+ {...props}
+ >
+ <XIcon className="pointer-events-none" />
+ </AutocompletePrimitive.Clear>
+ )
+}
+
+function AutocompleteInput({
+ className,
+ children,
+ disabled = false,
+ showSearchIcon = true,
+ showClear = false,
+ ...props
+}: AutocompletePrimitive.Input.Props & {
+ /** Render the leading search icon (default true). */
+ showSearchIcon?: boolean
+ /** Render the trailing clear button (default false). */
+ showClear?: boolean
+}): React.ReactElement {
+ const anchorRef = React.useContext(AutocompleteAnchorContext)
+ return (
+ <div data-slot="autocomplete-input-group-wrapper">
+ <InputGroup ref={anchorRef} className={cn('w-auto', className)}>
+ {showSearchIcon && (
+ <InputGroupAddon align="inline-start">
+ <SearchIcon />
+ </InputGroupAddon>
+ )}
+ <AutocompletePrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
+ {children ? (
+ <InputGroupAddon align="inline-end">
+ {children}
+ </InputGroupAddon>
+ ) : null}
+ {showClear && (
+ <InputGroupAddon align="inline-end">
+ <AutocompleteClear disabled={disabled} />
+ </InputGroupAddon>
+ )}
+ </InputGroup>
+ <Separator
+ orientation="horizontal"
+ data-slot="autocomplete-popover-separator"
+ className="w-[calc(100%+var(--spacing))]"
+ />
+ </div>
+ )
+}
+
+function AutocompleteContent({
+ className,
+ side = 'bottom',
+ sideOffset = 6,
+ align = 'start',
+ alignOffset = 0,
+ anchor: anchorProp,
+ ...props
+}: AutocompletePrimitive.Popup.Props &
+ Pick<
+ AutocompletePrimitive.Positioner.Props,
+ 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'
+ >): React.ReactElement {
+ const contextAnchor = React.useContext(AutocompleteAnchorContext)
+ const anchor = anchorProp ?? contextAnchor
+ return (
+ <AutocompletePrimitive.Portal>
+ <AutocompletePrimitive.Positioner
+ data-quill
+ data-quill-portal="popover"
+ side={side}
+ sideOffset={sideOffset}
+ align={align}
+ alignOffset={alignOffset}
+ anchor={anchor}
+ className="isolate"
+ >
+ <AutocompletePrimitive.Popup
+ data-slot="autocomplete-content"
+ className={cn('quill-autocomplete__content group/autocomplete-content', className)}
+ {...props}
+ />
+ </AutocompletePrimitive.Positioner>
+ </AutocompletePrimitive.Portal>
+ )
+}
+
+function AutocompleteList({ className, ...props }: AutocompletePrimitive.List.Props): React.ReactElement {
+ return (
+ <AutocompletePrimitive.List
+ data-slot="autocomplete-list"
+ className={cn('quill-autocomplete__list scroll-mask-t-2 scroll-mask-b-4 scroll-pb-4 scroll-pt-6 empty:hidden', className)}
+ {...props}
+ />
+ )
+}
+
+function AutocompleteItem({
+ className,
+ children,
+ title,
+ ...props
+}: AutocompletePrimitive.Item.Props & { title?: string }): React.ReactElement {
+ return (
+ <AutocompletePrimitive.Item
+ data-slot="autocomplete-item"
+ className={cn('quill-autocomplete__item', className)}
+ title={title ?? (typeof children === 'string' ? children : undefined)}
+ render={
+ <Button
+ left
+ className="font-normal min-w-0 aria-selected:bg-fill-selected data-highlighted:border-ring data-highlighted:ring-2 data-highlighted:ring-ring/30 ring-offset-1"
+ />
+ }
+ tabIndex={-1}
+ {...props}
+ >
+ <span className="flex items-center gap-1.5 min-w-0 truncate">{children}</span>
+ </AutocompletePrimitive.Item>
+ )
+}
+
+function AutocompleteGroup({ className, ...props }: AutocompletePrimitive.Group.Props): React.ReactElement {
+ return <AutocompletePrimitive.Group data-slot="autocomplete-group" className={cn('pb-1', className)} {...props} />
+}
+
+function AutocompleteLabel({ className, ...props }: AutocompletePrimitive.GroupLabel.Props): React.ReactElement {
+ return (
+ <AutocompletePrimitive.GroupLabel
+ data-slot="autocomplete-label"
+ className={cn('quill-autocomplete__label mb-1 -mx-1 w-[calc(100%+var(--spacing)*2)]', className)}
+ render={<MenuLabel />}
+ {...props}
+ />
+ )
+}
+
+function AutocompleteCollection({ ...props }: AutocompletePrimitive.Collection.Props): React.ReactElement {
+ return <AutocompletePrimitive.Collection data-slot="autocomplete-collection" {...props} />
+}
+
+function AutocompleteEmpty({ className, children, ...props }: AutocompletePrimitive.Empty.Props): React.ReactElement {
+ // Nest MenuEmpty as a child rather than passing it via `render`. With
+ // `render`, MenuEmpty's `buttonVariants` `inline-flex` would merge onto
+ // the SAME element as our `quill-autocomplete__empty`, conflicting with
+ // the `display: none` visibility rule. As a child, the parent's
+ // `display: none` collapses the whole subtree without needing
+ // `!important` to outrank the utility layer.
+ return (
+ <AutocompletePrimitive.Empty
+ data-slot="autocomplete-empty"
+ className={cn('quill-autocomplete__empty', className)}
+ {...props}
+ >
+ <MenuEmpty>{children}</MenuEmpty>
+ </AutocompletePrimitive.Empty>
+ )
+}
+
+function AutocompleteSeparator({
+ className,
+ ...props
+}: AutocompletePrimitive.Separator.Props): React.ReactElement {
+ return (
+ <AutocompletePrimitive.Separator
+ data-slot="autocomplete-separator"
+ className={cn('quill-autocomplete__separator my-0', className)}
+ {...props}
+ />
+ )
+}
+
+/**
+ * Walks `useFilteredItems` output and returns the total leaf count.
+ * Handles both flat arrays (returns `length`) and grouped arrays where
+ * each entry has an `items` property (returns sum of all `.items.length`).
+ */
+function countAutocompleteLeaves(items: unknown): number {
+ if (!Array.isArray(items)) {return 0}
+ return items.reduce<number>((acc, item) => {
+ if (item && typeof item === 'object' && 'items' in item && Array.isArray((item as { items: unknown[] }).items)) {
+ return acc + (item as { items: unknown[] }).items.length
+ }
+ return acc + 1
+ }, 0)
+}
+
+/**
+ * Live region announcer that also renders visible status text. Default
+ * content is "{count} results" pluralized; pass `emptyContent` to override
+ * the zero-count state, or `children` (string / node / function) to fully
+ * customize. `empty:hidden` collapses the element when there's nothing to
+ * render so it doesn't take a row of space.
+ *
+ * Counts are derived via `Autocomplete.useFilteredItems()` from the parent
+ * Root, so it works for flat *and* grouped item shapes.
+ *
+ * MUST be rendered inside `<Autocomplete>` — `useFilteredItems` reads from
+ * Autocomplete's Root context and will throw if no provider is mounted.
+ */
+function AutocompleteStatus({
+ className,
+ children,
+ emptyContent,
+ ...props
+}: Omit<AutocompletePrimitive.Status.Props, 'children'> & {
+ /**
+ * Override the default "{count} results" rendering. Pass a function to
+ * receive the count; pass a node to render statically.
+ */
+ children?: React.ReactNode | ((count: number) => React.ReactNode)
+ /** Rendered when the filtered count is zero. */
+ emptyContent?: React.ReactNode
+}): React.ReactElement {
+ const filtered = AutocompletePrimitive.useFilteredItems<unknown>()
+ const count = countAutocompleteLeaves(filtered)
+
+ let content: React.ReactNode
+ if (typeof children === 'function') {
+ content = children(count)
+ } else if (children !== undefined) {
+ content = children
+ } else if (count === 0) {
+ content = emptyContent
+ } else {
+ content = `${count} ${count === 1 ? 'result' : 'results'}`
+ }
+
+ return (
+ <AutocompletePrimitive.Status
+ data-slot="autocomplete-status"
+ className={cn('quill-autocomplete__status bg-card border-b border-border text-xs text-muted-foreground px-2 py-1.5 empty:hidden', className)}
+ {...props}
+ >
+ {content}
+ </AutocompletePrimitive.Status>
+ )
+}
+
+/**
+ * Hook returning the anchor ref so consumers (e.g. an external trigger)
+ * can position the popup against an arbitrary element.
+ */
+function useAutocompleteAnchor(): React.RefObject<HTMLDivElement> {
+ const contextRef = React.useContext(AutocompleteAnchorContext)
+ if (contextRef === null) {
+ throw new Error('useAutocompleteAnchor must be used within an Autocomplete')
+ }
+ return contextRef
+}
+
+export {
+ Autocomplete,
+ AutocompleteClear,
+ AutocompleteCollection,
+ AutocompleteContent,
+ AutocompleteEmpty,
+ AutocompleteGroup,
+ AutocompleteInput,
+ AutocompleteItem,
+ AutocompleteLabel,
+ AutocompleteList,
+ AutocompleteSeparator,
+ AutocompleteStatus,
+ AutocompleteTrigger,
+ AutocompleteValue,
+ useAutocompleteAnchor,
+}
diff --git a/packages/quill/packages/primitives/src/badge.css b/packages/quill/packages/primitives/src/badge.css
index 70a30a68065c..6a70a760b1ba 100644
--- a/packages/quill/packages/primitives/src/badge.css
+++ b/packages/quill/packages/primitives/src/badge.css
@@ -40,8 +40,8 @@
/* Variants */
.quill-badge--variant-default {
- color: var(--accent-foreground);
- background-color: var(--accent);
+ color: var(--foreground);
+ background-color: var(--muted);
}
.quill-badge--variant-info {
diff --git a/packages/quill/packages/primitives/src/button.css b/packages/quill/packages/primitives/src/button.css
index 064a55969cd0..31a1be6e6d7a 100644
--- a/packages/quill/packages/primitives/src/button.css
+++ b/packages/quill/packages/primitives/src/button.css
@@ -112,12 +112,13 @@
position: relative;
color: var(--primary-foreground);
background-color: var(--primary);
- box-shadow: 0 2px 0 -1px color-mix(in oklab, var(--primary) 80%, transparent);
+ box-shadow: 0 2px 0 -1px color-mix(in oklab, var(--primary) 50%, transparent);
+ translate: 0 -1px;
}
.quill-button--variant-primary::after {
position: absolute;
- top: 2px;
+ top: 3px;
bottom: 0;
left: 0;
width: 100%;
@@ -130,14 +131,15 @@
}
.quill-button--variant-primary:not(:disabled):active {
- box-shadow: 0 1px 0 -1px color-mix(in oklab, var(--primary) 80%, transparent);
+ box-shadow: 0 1px 0 -1px color-mix(in oklab, var(--primary) 50%, transparent);
+ translate: 0 0;
}
/* =========================================================================
Variant: outline
========================================================================= */
.quill-button--variant-outline {
- background-color: color-mix(in oklab, var(--accent) 30%, transparent);
+ background-color: color-mix(in oklab, var(--muted) 30%, transparent);
border-color: color-mix(in oklab, var(--foreground) 10%, transparent);
}
@@ -147,7 +149,7 @@
.quill-button--variant-outline:not(:disabled):hover {
color: var(--foreground);
- background-color: color-mix(in oklab, var(--accent) 50%, transparent);
+ background-color: color-mix(in oklab, var(--muted) 50%, transparent);
}
:is(.dark, [theme='dark']) .quill-button--variant-outline:hover {
diff --git a/packages/quill/packages/primitives/src/card.stories.tsx b/packages/quill/packages/primitives/src/card.stories.tsx
index 7e4ab8457e5d..d5dd9188d334 100644
--- a/packages/quill/packages/primitives/src/card.stories.tsx
+++ b/packages/quill/packages/primitives/src/card.stories.tsx
@@ -3,7 +3,6 @@ import { MoreVertical, UserIcon } from 'lucide-react'
import { Button } from './button'
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './card'
-import { Field } from './field'
import { Item, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from './item'
const meta = {
@@ -168,9 +167,8 @@ export const CardWithItems: Story = {
<CardHeader>
<CardTitle>Team members</CardTitle>
</CardHeader>
- <CardContent>
- <Field>
- <ItemGroup combined>
+ <CardContent className="py-0">
+ <ItemGroup>
<Item
variant="pressable"
render={
@@ -202,7 +200,6 @@ export const CardWithItems: Story = {
}
/>
</ItemGroup>
- </Field>
</CardContent>
</Card>
),
diff --git a/packages/quill/packages/primitives/src/checkbox.css b/packages/quill/packages/primitives/src/checkbox.css
index 9282c1ed0ab2..1fb22b56bffe 100644
--- a/packages/quill/packages/primitives/src/checkbox.css
+++ b/packages/quill/packages/primitives/src/checkbox.css
@@ -85,7 +85,7 @@
Checkbox indicator — standalone visual (inside Field/Item rows)
========================================================================= */
.quill-checkbox-indicator {
- border: 1px solid var(--accent);
+ border: 1px solid var(--border);
}
.quill-checkbox-indicator--checked {
diff --git a/packages/quill/packages/primitives/src/combobox.css b/packages/quill/packages/primitives/src/combobox.css
index bedcd80d8107..eddf934edeac 100644
--- a/packages/quill/packages/primitives/src/combobox.css
+++ b/packages/quill/packages/primitives/src/combobox.css
@@ -4,12 +4,11 @@
max-width: min(24rem, var(--available-width));
max-height: var(--available-height);
overflow: hidden;
- color: var(--popover-foreground);
- background-color: var(--popover);
+ color: var(--foreground);
+ background-color: var(--card);
+ border: 1px solid var(--border);
border-radius: var(--radius-md);
- box-shadow:
- 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent),
- 0 4px 6px -1px rgb(0 0 0 / 10%);
+ box-shadow: var(--shadow-md);
transition:
opacity 150ms cubic-bezier(0.215, 0.61, 0.355, 1),
transform 150ms cubic-bezier(0.215, 0.61, 0.355, 1);
@@ -23,7 +22,7 @@
}
:is(.dark, [theme='dark']) .quill-combobox__content {
- background-color: var(--popover);
+ background-color: var(--card);
}
/* Nested InputGroup inside popup: visually recede */
@@ -36,6 +35,39 @@
box-shadow: none;
}
+ /*
+ * When the combobox is rendered as a floating-UI popover (any
+ * `[data-quill-portal]` ancestor) — give the search input a divider
+ * and breathing room before the list. Inline comboboxes (no portal
+ * ancestor) keep the flush layout above. Detection is purely CSS so
+ * consumers don't need to pass a prop down.
+ */
+
+ /*
+ * Separator inside the input wrapper is rendered unconditionally by
+ * ComboboxInput. Hide it by default; only show it when the combobox
+ * is rendered as a floating-UI popover (any `[data-quill-portal]`
+ * ancestor). The wrapper padding + separator inset margin also only
+ * apply in that mode — inline comboboxes keep their flush layout.
+ */
+ [data-slot='combobox-popover-separator'] {
+ display: none;
+ }
+
+ [data-quill-portal] .quill-combobox__content > [data-slot='combobox-input-group-wrapper'] {
+ padding: var(--spacing);
+ border-bottom: 1px solid var(--border);
+ }
+
+ [data-quill-portal]
+ .quill-combobox__content
+ > [data-slot='combobox-input-group-wrapper']
+ > [data-slot='combobox-popover-separator'] {
+ display: block;
+ width: calc(100% + var(--spacing));
+ margin: var(--spacing) calc(var(--spacing) * -1) 0;
+ }
+
.quill-combobox__list {
min-height: 0;
max-height: min(
@@ -48,11 +80,37 @@
scroll-padding-block: 0.25rem;
}
+ /*
+ * When a sticky `combobox-list-footer` is present, items above it
+ * need a `scroll-margin-bottom` so that base-ui's keyboard navigation
+ * (`element.scrollIntoView({ block: 'nearest' })`) parks them ABOVE
+ * the footer + gradient zone instead of underneath.
+ *
+ * Why per-item `scroll-margin-bottom` instead of `scroll-padding-bottom`
+ * on the container OR `padding-bottom`:
+ * - `scroll-padding-bottom`: only works when scroll is invoked via
+ * `scrollIntoView` AND the browser honors padding. Some scroll code
+ * paths bypass it.
+ * - `padding-bottom`: pushes the footer's natural-flow position up,
+ * which in non-overflowing lists makes sticky inactive — footer
+ * floats 3.5rem above the bottom edge instead of pinning. Bad UX.
+ * - `scroll-margin-bottom` on the item itself: a per-element hint
+ * that travels with the item into the browser's scroll calculation,
+ * independent of container layout. Doesn't affect natural flow,
+ * so sticky still pins correctly.
+ *
+ * Targets `[role='option']` because base-ui's render-prop merging onto
+ * Button drops our `data-slot` on items, but the ARIA role is always
+ * set internally. Total: 3.5rem = ~2.5rem footer + 1rem gradient zone.
+ */
.quill-combobox__list:has([data-slot='combobox-list-footer']) {
- scroll-padding-bottom: 2.5rem;
padding-bottom: 0;
}
+ .quill-combobox__list:has([data-slot='combobox-list-footer']) [role='option'] {
+ scroll-margin-bottom: 2.5rem;
+ }
+
.quill-combobox__list[data-empty] {
padding: 0;
}
@@ -142,7 +200,69 @@
bottom: -1px;
margin-inline: -0.25rem;
margin-top: 0.25rem;
- background-color: var(--popover);
+ background-color: var(--card);
+ border-top: 1px solid var(--border);
+ }
+
+ /*
+ * Reusable utility: fakes a `scroll-mask` fade ABOVE a sticky-bottom
+ * element (e.g. the combobox list footer). Items appear to fade into
+ * the footer's background as they scroll past — without applying a
+ * real `mask-image` to the parent (which would also fade the footer
+ * itself, the issue we hit with `scroll-mask-b-4`).
+ *
+ * Visibility is driven by a scroll-driven animation tied to the
+ * nearest ancestor scroller (`scroll(nearest block)`). Keyframe shape:
+ * 0%, 99% → opacity 1 (top of scroll OR no-overflow, AND mid-scroll)
+ * 100% → opacity 0 (at scroll end: fade hidden, footer is solid)
+ *
+ * No explicit `0% → opacity 0` for the no-overflow case: the gradient
+ * is `var(--card) → transparent` and the popup background is also
+ * `var(--card)`, so when no item content sits under the pseudo, every
+ * stop of the gradient is `var(--card)` blending with `var(--card)` —
+ * effectively invisible. The fade only renders visibly when there's
+ * actual content behind it, which is exactly when scrolling is
+ * possible. Trade-off: one less keyframe stop, free no-overflow
+ * handling via color math.
+ *
+ * We avoid `container-type: scroll-state` because it establishes
+ * containment that breaks `position: sticky` on the consumer in
+ * current Chromium. Scroll-driven animations don't have that side
+ * effect and reach the right scroller via `scroll(nearest block)`.
+ *
+ * The gradient fades from `var(--card)` at the footer edge to
+ * `transparent` further away — same visual blend as the
+ * `tailwindcss-scroll-mask` plugin in both light and dark modes
+ * (`--card` is the popup background in both themes).
+ */
+
+ /*
+ * No `position: relative` on the utility itself — consumers like
+ * `.quill-combobox__list-footer` already use `position: sticky`, which
+ * establishes a containing block for the absolutely-positioned ::before.
+ * Adding `position: relative` here would override their sticky (same
+ * specificity, declared later) and break the pin.
+ *
+ * For consumers that aren't already positioned, set `position: relative`
+ * on the host element directly.
+ */
+ .quill-scroll-fade-top::before {
+ position: absolute;
+ inset-inline: 0;
+
+ /*
+ * `bottom: 100%` lands the pseudo's bottom at the padding-box top
+ * (inside the border) — the gradient's solid `var(--card)` would
+ * then paint over the consumer's `border-top`. `+ 1px` lifts it
+ * clear of a 1px border so the divider stays visible.
+ */
+ bottom: calc(100% + 1px);
+ height: 1rem;
+ pointer-events: none;
+ content: '';
+ background: linear-gradient(to top, var(--card), transparent);
+ animation: quill-scroll-fade-top__opacity linear both;
+ animation-timeline: scroll(nearest block);
}
.quill-combobox__trigger svg:not([class*='size-']) {
@@ -150,6 +270,17 @@
height: 0.875rem;
}
+ @keyframes quill-scroll-fade-top__opacity {
+ 0%,
+ 99% {
+ opacity: 1;
+ }
+
+ 100% {
+ opacity: 0;
+ }
+ }
+
@media (prefers-reduced-motion: reduce) {
.quill-combobox__content,
.quill-combobox__content[data-starting-style],
diff --git a/packages/quill/packages/primitives/src/combobox.tsx b/packages/quill/packages/primitives/src/combobox.tsx
index f66ecfd5338c..7be1ac3b5638 100644
--- a/packages/quill/packages/primitives/src/combobox.tsx
+++ b/packages/quill/packages/primitives/src/combobox.tsx
@@ -9,7 +9,6 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '
import { cn } from './lib/utils'
import { MenuEmpty } from './menu-empty'
import { MenuLabel } from './menu-label'
-import { Separator } from './separator'
const ComboboxAnchorContext = React.createContext<React.RefObject<HTMLDivElement> | null>(null)
@@ -72,22 +71,24 @@ function ComboboxInput({
}): React.ReactElement {
const anchorRef = React.useContext(ComboboxAnchorContext)
return (
- <InputGroup ref={anchorRef} className={cn('w-auto', className)}>
- <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
- <InputGroupAddon align="inline-end">
- {showTrigger && (
- <InputGroupButton
- size="icon-xs"
- render={<ComboboxTrigger />}
- data-slot="input-group-button"
- className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent rounded-xs"
- disabled={disabled}
- />
- )}
- {showClear && <ComboboxClear disabled={disabled} />}
- </InputGroupAddon>
- {children}
- </InputGroup>
+ <div data-slot="combobox-input-group-wrapper">
+ <InputGroup ref={anchorRef} className={cn('w-auto', className)}>
+ <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
+ <InputGroupAddon align="inline-end">
+ {showTrigger && (
+ <InputGroupButton
+ size="icon-xs"
+ render={<ComboboxTrigger />}
+ data-slot="input-group-button"
+ className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent rounded-xs"
+ disabled={disabled}
+ />
+ )}
+ {showClear && <ComboboxClear disabled={disabled} />}
+ </InputGroupAddon>
+ {children}
+ </InputGroup>
+ </div>
)
}
@@ -133,7 +134,23 @@ function ComboboxContent({
}
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): React.ReactElement {
- return <ComboboxPrimitive.List data-slot="combobox-list" className={cn('quill-combobox__list', className)} {...props} />
+ return (
+ <ComboboxPrimitive.List
+ data-slot="combobox-list"
+ // `scroll-mask-t-4` always (top fade for items scrolling out of view).
+ // Bottom fade is conditional: if a `ComboboxListFooter` is rendered,
+ // the footer's own `quill-scroll-fade-top` pseudo handles the bottom
+ // fade (and only when content is actually hidden below, via
+ // container scroll-state). Otherwise, fall back to plugin's
+ // `scroll-mask-b-4` for the same behavior on lists without a footer.
+ className={cn(
+ 'quill-combobox__list scroll-mask-t-4 scroll-py-4',
+ 'not-has-[[data-slot=combobox-list-footer]]:scroll-mask-b-4',
+ className,
+ )}
+ {...props}
+ />
+ )
}
function ComboboxItem({
@@ -244,8 +261,14 @@ function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Pro
function ComboboxListFooter({ className, ...props }: React.ComponentProps<'div'>): React.ReactElement {
return (
- <div data-slot="combobox-list-footer" className={cn('quill-combobox__list-footer', className)}>
- <Separator orientation="horizontal" className="w-[calc(100%+var(--spacing)*4)]" />
+ <div
+ data-slot="combobox-list-footer"
+ // `quill-scroll-fade-top` adds a `var(--card) → transparent` gradient
+ // pseudo-element above the footer, gated by container scroll-state on
+ // the parent list. Renders only when items are hidden below the visible
+ // area, mirroring `scroll-mask-b` without fading the footer itself.
+ className={cn('quill-combobox__list-footer quill-scroll-fade-top', className)}
+ >
<div className="p-1" {...props} />
</div>
)
diff --git a/packages/quill/packages/primitives/src/command.css b/packages/quill/packages/primitives/src/command.css
deleted file mode 100644
index c45dc3542548..000000000000
--- a/packages/quill/packages/primitives/src/command.css
+++ /dev/null
@@ -1,96 +0,0 @@
-@layer components {
- .quill-command {
- padding: 0.25rem;
- color: var(--popover-foreground);
- background-color: var(--popover);
- border-radius: var(--radius-xl);
- }
-
- .quill-command__list {
- max-height: 18rem;
- scroll-padding-block: 0.25rem;
- overflow: hidden auto;
- outline: none;
- scrollbar-width: none;
- }
-
- .quill-command__list::-webkit-scrollbar {
- display: none;
- }
-
- .quill-command__empty {
- padding-block: 1.5rem;
- font-size: var(--text-xs, 0.75rem);
- line-height: 1.625;
- text-align: center;
- }
-
- .quill-command__group {
- padding: 0.25rem;
- color: var(--foreground);
- }
-
- .quill-command__group [cmdk-group-heading] {
- padding-block: 0.375rem;
- padding-inline: 0.625rem;
- font-size: var(--text-xs, 0.75rem);
- font-weight: 500;
- color: var(--muted-foreground);
- }
-
- .quill-command__separator {
- height: 1px;
- margin-block: 0.25rem;
- margin-inline: -0.25rem;
- background-color: color-mix(in oklab, var(--border) 50%, transparent);
- }
-
- .quill-command__item {
- min-height: 1.75rem;
- padding-block: 0.375rem;
- padding-inline: 0.625rem;
- font-size: var(--text-xs, 0.75rem);
- line-height: 1.625;
- border-radius: var(--radius-sm);
- outline: none;
- }
-
- [data-slot='dialog-content'] .quill-command__item {
- border-radius: var(--radius-sm);
- }
-
- .quill-command__item[data-disabled='true'] {
- pointer-events: none;
- opacity: 0.5;
- }
-
- .quill-command__item[data-selected] {
- color: var(--foreground);
- background-color: var(--muted);
- }
-
- .quill-command__item[data-selected] svg {
- color: var(--foreground);
- }
-
- .quill-command__item svg {
- flex-shrink: 0;
- pointer-events: none;
- }
-
- .quill-command__item svg:not([class*='size-']) {
- width: 0.875rem;
- height: 0.875rem;
- }
-
- .quill-command__shortcut {
- margin-inline-start: auto;
- font-size: 0.625rem;
- color: var(--muted-foreground);
- letter-spacing: 0.1em;
- }
-
- .quill-command__item[data-selected] .quill-command__shortcut {
- color: var(--foreground);
- }
-}
diff --git a/packages/quill/packages/primitives/src/command.tsx b/packages/quill/packages/primitives/src/command.tsx
deleted file mode 100644
index 8f667b3c95a8..000000000000
--- a/packages/quill/packages/primitives/src/command.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-import { Command as CommandPrimitive } from 'cmdk'
-import { SearchIcon, CheckIcon } from 'lucide-react'
-import * as React from 'react'
-
-import './command.css'
-import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './dialog'
-import { InputGroup, InputGroupAddon } from './input-group'
-import { cn } from './lib/utils'
-
-function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.ReactElement {
- return (
- <CommandPrimitive
- data-quill
- data-slot="command"
- className={cn('quill-command flex size-full flex-col overflow-hidden', className)}
- {...props}
- />
- )
-}
-
-function CommandDialog({
- title = 'Command Palette',
- description = 'Search for a command to run...',
- children,
- className,
- showCloseButton = false,
- ...props
-}: Omit<React.ComponentProps<typeof Dialog>, 'children'> & {
- title?: string
- description?: string
- className?: string
- showCloseButton?: boolean
- children: React.ReactNode
-}): React.ReactElement {
- return (
- <Dialog {...props}>
- <DialogHeader className="sr-only">
- <DialogTitle>{title}</DialogTitle>
- <DialogDescription>{description}</DialogDescription>
- </DialogHeader>
- <DialogContent
- className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}
- showCloseButton={showCloseButton}
- >
- {children}
- </DialogContent>
- </Dialog>
- )
-}
-
-function CommandInput({
- className,
- ...props
-}: React.ComponentProps<typeof CommandPrimitive.Input>): React.ReactElement {
- return (
- <div data-slot="command-input-wrapper" className="p-1 pb-0">
- <InputGroup className="h-8!">
- <CommandPrimitive.Input
- data-slot="command-input"
- className={cn(
- 'w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
- className
- )}
- {...props}
- />
- <InputGroupAddon>
- <SearchIcon className="size-3.5 shrink-0 opacity-50" />
- </InputGroupAddon>
- </InputGroup>
- </div>
- )
-}
-
-function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.ReactElement {
- return <CommandPrimitive.List data-slot="command-list" className={cn('quill-command__list', className)} {...props} />
-}
-
-function CommandEmpty({
- className,
- ...props
-}: React.ComponentProps<typeof CommandPrimitive.Empty>): React.ReactElement {
- return <CommandPrimitive.Empty data-slot="command-empty" className={cn('quill-command__empty', className)} {...props} />
-}
-
-function CommandGroup({
- className,
- ...props
-}: React.ComponentProps<typeof CommandPrimitive.Group>): React.ReactElement {
- return <CommandPrimitive.Group data-slot="command-group" className={cn('quill-command__group overflow-hidden', className)} {...props} />
-}
-
-function CommandSeparator({
- className,
- ...props
-}: React.ComponentProps<typeof CommandPrimitive.Separator>): React.ReactElement {
- return <CommandPrimitive.Separator data-slot="command-separator" className={cn('quill-command__separator', className)} {...props} />
-}
-
-function CommandItem({
- className,
- children,
- ...props
-}: React.ComponentProps<typeof CommandPrimitive.Item>): React.ReactElement {
- return (
- <CommandPrimitive.Item
- data-slot="command-item"
- className={cn(
- 'quill-command__item group/command-item relative flex cursor-default items-center gap-2 select-none',
- className
- )}
- {...props}
- >
- {children}
- <CheckIcon className="ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
- </CommandPrimitive.Item>
- )
-}
-
-function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>): React.ReactElement {
- return <span data-slot="command-shortcut" className={cn('quill-command__shortcut', className)} {...props} />
-}
-
-export {
- Command,
- CommandDialog,
- CommandInput,
- CommandList,
- CommandEmpty,
- CommandGroup,
- CommandItem,
- CommandShortcut,
- CommandSeparator,
-}
diff --git a/packages/quill/packages/primitives/src/context-menu.stories.tsx b/packages/quill/packages/primitives/src/context-menu.stories.tsx
index 8bf598dff476..120dcc302949 100644
--- a/packages/quill/packages/primitives/src/context-menu.stories.tsx
+++ b/packages/quill/packages/primitives/src/context-menu.stories.tsx
@@ -120,3 +120,32 @@ export const Radios: Story = {
)
},
} satisfies Story
+
+const TIMEZONES = [
+ 'Pacific/Midway', 'Pacific/Honolulu', 'America/Anchorage', 'America/Los_Angeles',
+ 'America/Denver', 'America/Phoenix', 'America/Chicago', 'America/Mexico_City',
+ 'America/New_York', 'America/Toronto', 'America/Halifax', 'America/Sao_Paulo',
+ 'Atlantic/Azores', 'Europe/London', 'Europe/Dublin', 'Europe/Lisbon',
+ 'Europe/Paris', 'Europe/Berlin', 'Europe/Madrid', 'Europe/Rome',
+ 'Europe/Athens', 'Europe/Helsinki', 'Africa/Cairo', 'Europe/Moscow',
+ 'Asia/Dubai', 'Asia/Karachi', 'Asia/Kolkata', 'Asia/Bangkok',
+ 'Asia/Singapore', 'Asia/Hong_Kong', 'Asia/Shanghai', 'Asia/Tokyo',
+ 'Asia/Seoul', 'Australia/Perth', 'Australia/Sydney', 'Pacific/Auckland',
+] as const
+
+export const Overflow: Story = {
+ render: () => (
+ <ContextMenu>
+ <ContextMenuTrigger render={<Button variant="outline" size="sm" />}>
+ Side-click me
+ </ContextMenuTrigger>
+ <ContextMenuContent className="w-auto min-w-56">
+ <ContextMenuGroup>
+ {TIMEZONES.map((tz) => (
+ <ContextMenuItem key={tz}>{tz}</ContextMenuItem>
+ ))}
+ </ContextMenuGroup>
+ </ContextMenuContent>
+ </ContextMenu>
+ ),
+} satisfies Story
diff --git a/packages/quill/packages/primitives/src/context-menu.tsx b/packages/quill/packages/primitives/src/context-menu.tsx
index 1a2354192b7c..a8bcc6a5f59c 100644
--- a/packages/quill/packages/primitives/src/context-menu.tsx
+++ b/packages/quill/packages/primitives/src/context-menu.tsx
@@ -26,6 +26,7 @@ function ContextMenuContent({
alignOffset = 4,
side = 'inline-end',
sideOffset = 0,
+ children,
...props
}: ContextMenuPrimitive.Popup.Props &
Pick<ContextMenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>): React.ReactElement {
@@ -42,12 +43,11 @@ function ContextMenuContent({
>
<ContextMenuPrimitive.Popup
data-slot="context-menu-content"
- className={cn(
- 'quill-menu__content',
- className
- )}
+ className={cn('quill-menu__content', className)}
{...props}
- />
+ >
+ <div className="quill-menu__scroller scroll-mask-y-4 scroll-py-4">{children}</div>
+ </ContextMenuPrimitive.Popup>
</ContextMenuPrimitive.Positioner>
</ContextMenuPrimitive.Portal>
)
diff --git a/packages/quill/packages/primitives/src/dialog.css b/packages/quill/packages/primitives/src/dialog.css
index a6abc596f24d..2153504d692f 100644
--- a/packages/quill/packages/primitives/src/dialog.css
+++ b/packages/quill/packages/primitives/src/dialog.css
@@ -25,10 +25,11 @@
top: calc(max(1rem, 10vh + 1.25rem * var(--nested-dialogs, 0)));
width: 100%;
max-width: calc(100vw - 3rem);
+ overflow: hidden;
font-size: var(--text-xs, 0.75rem);
line-height: 1.625;
background-color: var(--background);
- border-radius: var(--radius-xl);
+ border-radius: var(--radius-lg);
outline: none;
box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent);
diff --git a/packages/quill/packages/primitives/src/dialog.tsx b/packages/quill/packages/primitives/src/dialog.tsx
index 02285e4ab289..f19ed7671b7f 100644
--- a/packages/quill/packages/primitives/src/dialog.tsx
+++ b/packages/quill/packages/primitives/src/dialog.tsx
@@ -22,7 +22,7 @@ function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.ReactEl
}
function DialogClose({ ...props }: DialogPrimitive.Close.Props): React.ReactElement {
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
+ return <DialogPrimitive.Close data-slot="dialog-close focus-visible:z-10" {...props} />
}
function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.ReactElement {
diff --git a/packages/quill/packages/primitives/src/dot.css b/packages/quill/packages/primitives/src/dot.css
index 60cd2dff9369..43dd0d7ad134 100644
--- a/packages/quill/packages/primitives/src/dot.css
+++ b/packages/quill/packages/primitives/src/dot.css
@@ -25,15 +25,15 @@
/* Variants — text = outer color ring, inner = solid fill, pulse = border color */
.quill-dot--variant-default {
- color: var(--accent);
+ color: var(--muted-foreground);
}
.quill-dot--variant-default .quill-dot__inner {
- background-color: color-mix(in oklab, var(--accent-foreground) 40%, transparent);
+ background-color: color-mix(in oklab, var(--foreground) 40%, transparent);
}
.quill-dot--variant-default .quill-dot__pulse {
- border-color: color-mix(in oklab, var(--accent-foreground) 40%, transparent);
+ border-color: color-mix(in oklab, var(--foreground) 40%, transparent);
}
.quill-dot--variant-info {
diff --git a/packages/quill/packages/primitives/src/drawer.css b/packages/quill/packages/primitives/src/drawer.css
index 429548a999ee..9e89441a6f8a 100644
--- a/packages/quill/packages/primitives/src/drawer.css
+++ b/packages/quill/packages/primitives/src/drawer.css
@@ -51,7 +51,7 @@
content: '';
background-color: var(--background);
border: 1px solid var(--border);
- border-radius: var(--radius-xl);
+ border-radius: var(--radius-lg);
}
/* =========================================================================
diff --git a/packages/quill/packages/primitives/src/dropdown-menu.stories.tsx b/packages/quill/packages/primitives/src/dropdown-menu.stories.tsx
index 8fff8f901f18..95bf58e7705f 100644
--- a/packages/quill/packages/primitives/src/dropdown-menu.stories.tsx
+++ b/packages/quill/packages/primitives/src/dropdown-menu.stories.tsx
@@ -9,6 +9,7 @@ import {
DropdownMenuContent,
DropdownMenuTrigger,
DropdownMenuItem,
+ DropdownMenuSelectAll,
DropdownMenuSeparator,
DropdownMenuSub,
DropdownMenuSubTrigger,
@@ -17,6 +18,7 @@ import {
DropdownMenuRadioItem,
DropdownMenuRadioGroup,
DropdownMenuLabel,
+ useDropdownMenuSelectAll,
} from './dropdown-menu'
import { Kbd } from './kbd'
@@ -180,3 +182,175 @@ export const Radios: Story = {
)
},
} satisfies Story
+
+const FRAMEWORKS = ['Next.js', 'Remix', 'SvelteKit', 'Nuxt'] as const
+
+export const SelectAll: Story = {
+ render: () => {
+ const [open, setOpen] = useState(true)
+ const [selected, setSelected] = useState<string[]>([])
+
+ const toggle = (value: string, checked: boolean): void => {
+ setSelected((prev) =>
+ checked ? [...prev, value] : prev.filter((v) => v !== value)
+ )
+ }
+
+ return (
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger render={<Button variant="outline" size="sm" />}>
+ {selected.length} selected
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-auto min-w-48">
+ <DropdownMenuGroup>
+ <DropdownMenuSelectAll
+ values={FRAMEWORKS}
+ selected={selected}
+ onChange={(next) => setSelected([...next])}
+ />
+ <DropdownMenuSeparator />
+ {FRAMEWORKS.map((value) => (
+ <DropdownMenuCheckboxItem
+ key={value}
+ checked={selected.includes(value)}
+ onCheckedChange={(checked) => toggle(value, !!checked)}
+ closeOnClick={false}
+ >
+ {value}
+ </DropdownMenuCheckboxItem>
+ ))}
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )
+ },
+} satisfies Story
+
+export const SelectAllWithRenderProp: Story = {
+ render: () => {
+ const [open, setOpen] = useState(true)
+ const [selected, setSelected] = useState<string[]>([FRAMEWORKS[0]])
+
+ const toggle = (value: string, checked: boolean): void => {
+ setSelected((prev) =>
+ checked ? [...prev, value] : prev.filter((v) => v !== value)
+ )
+ }
+
+ return (
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger render={<Button variant="outline" size="sm" />}>
+ {selected.length} / {FRAMEWORKS.length}
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-auto min-w-56">
+ <DropdownMenuGroup>
+ <DropdownMenuSelectAll
+ values={FRAMEWORKS}
+ selected={selected}
+ onChange={(next) => setSelected([...next])}
+ >
+ {({ state, toggle: toggleAll }) => (
+ <DropdownMenuItem closeOnClick={false} onClick={toggleAll}>
+ {state === 'all' && 'Clear selection'}
+ {state === 'some' &&
+ `Select remaining (${FRAMEWORKS.length - selected.length})`}
+ {state === 'none' && 'Select all'}
+ </DropdownMenuItem>
+ )}
+ </DropdownMenuSelectAll>
+ <DropdownMenuSeparator />
+ {FRAMEWORKS.map((value) => (
+ <DropdownMenuCheckboxItem
+ key={value}
+ checked={selected.includes(value)}
+ onCheckedChange={(checked) => toggle(value, !!checked)}
+ closeOnClick={false}
+ >
+ {value}
+ </DropdownMenuCheckboxItem>
+ ))}
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )
+ },
+} satisfies Story
+
+export const SelectAllWithHook: Story = {
+ render: () => {
+ const [open, setOpen] = useState(true)
+ const [selected, setSelected] = useState<string[]>([])
+ const { state, toggle: toggleAll } = useDropdownMenuSelectAll(
+ FRAMEWORKS,
+ selected,
+ (next) => setSelected([...next])
+ )
+
+ const toggle = (value: string, checked: boolean): void => {
+ setSelected((prev) =>
+ checked ? [...prev, value] : prev.filter((v) => v !== value)
+ )
+ }
+
+ return (
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger render={<Button variant="outline" size="sm" />}>
+ Frameworks
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-auto min-w-56">
+ <DropdownMenuGroup>
+ <DropdownMenuLabel>
+ Frameworks ({selected.length}/{FRAMEWORKS.length})
+ </DropdownMenuLabel>
+ <DropdownMenuItem closeOnClick={false} onClick={toggleAll}>
+ {state === 'all' ? 'Deselect all' : 'Select all'}
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ {FRAMEWORKS.map((value) => (
+ <DropdownMenuCheckboxItem
+ key={value}
+ checked={selected.includes(value)}
+ onCheckedChange={(checked) => toggle(value, !!checked)}
+ closeOnClick={false}
+ >
+ {value}
+ </DropdownMenuCheckboxItem>
+ ))}
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )
+ },
+} satisfies Story
+
+const TIMEZONES = [
+ 'Pacific/Midway', 'Pacific/Honolulu', 'America/Anchorage', 'America/Los_Angeles',
+ 'America/Denver', 'America/Phoenix', 'America/Chicago', 'America/Mexico_City',
+ 'America/New_York', 'America/Toronto', 'America/Halifax', 'America/Sao_Paulo',
+ 'Atlantic/Azores', 'Europe/London', 'Europe/Dublin', 'Europe/Lisbon',
+ 'Europe/Paris', 'Europe/Berlin', 'Europe/Madrid', 'Europe/Rome',
+ 'Europe/Athens', 'Europe/Helsinki', 'Africa/Cairo', 'Europe/Moscow',
+ 'Asia/Dubai', 'Asia/Karachi', 'Asia/Kolkata', 'Asia/Bangkok',
+ 'Asia/Singapore', 'Asia/Hong_Kong', 'Asia/Shanghai', 'Asia/Tokyo',
+ 'Asia/Seoul', 'Australia/Perth', 'Australia/Sydney', 'Pacific/Auckland',
+] as const
+
+export const Overflow: Story = {
+ render: () => {
+ const [open, setOpen] = useState(true)
+ return (
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger render={<Button variant="outline" size="sm" />}>
+ Pick a timezone
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-auto min-w-56">
+ <DropdownMenuGroup>
+ {TIMEZONES.map((tz) => (
+ <DropdownMenuItem key={tz}>{tz}</DropdownMenuItem>
+ ))}
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )
+ },
+} satisfies Story
diff --git a/packages/quill/packages/primitives/src/dropdown-menu.tsx b/packages/quill/packages/primitives/src/dropdown-menu.tsx
index 6e789990830a..577028e4049b 100644
--- a/packages/quill/packages/primitives/src/dropdown-menu.tsx
+++ b/packages/quill/packages/primitives/src/dropdown-menu.tsx
@@ -28,6 +28,7 @@ function DropdownMenuContent({
sideOffset = 4,
className,
anchor,
+ children,
...props
}: MenuPrimitive.Popup.Props &
Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'anchor'>): React.ReactElement {
@@ -50,7 +51,11 @@ function DropdownMenuContent({
className
)}
{...props}
- />
+ >
+ <div className="quill-menu__scroller scroll-mask-y-4 scroll-py-4">
+ {children}
+ </div>
+ </MenuPrimitive.Popup>
</MenuPrimitive.Positioner>
</MenuPrimitive.Portal>
)
@@ -233,6 +238,129 @@ function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.
return <MenuPrimitive.Separator data-slot="dropdown-menu-separator" className={cn('quill-menu__separator', className)} {...props} />
}
+/**
+ * Tri-state for a select-all action over a list of selectable values.
+ * - `none`: nothing selected
+ * - `some`: at least one but not all selected (indeterminate)
+ * - `all`: every value selected
+ */
+type SelectAllState = 'none' | 'some' | 'all'
+
+type UseSelectAllResult = {
+ state: SelectAllState
+ isAllSelected: boolean
+ toggle: () => void
+}
+
+/**
+ * Headless hook for a "select all / deselect all" action paired with a list
+ * of `DropdownMenuCheckboxItem`s. Consumer owns rendering and stays in
+ * control of the selection state.
+ *
+ * Comparison is reference equality unless `getKey` is supplied — pass a key
+ * extractor when `values` are objects whose identity isn't stable across
+ * renders (e.g. fetched from an API).
+ *
+ * @example
+ * const ALL = ['a', 'b', 'c']
+ * const [selected, setSelected] = useState<string[]>([])
+ * const { isAllSelected, toggle } = useDropdownMenuSelectAll(ALL, selected, setSelected)
+ *
+ * <DropdownMenuItem closeOnClick={false} onClick={toggle}>
+ * {isAllSelected ? 'Deselect all' : 'Select all'}
+ * </DropdownMenuItem>
+ */
+function useDropdownMenuSelectAll<T>(
+ values: readonly T[],
+ selected: readonly T[],
+ onChange: (next: T[]) => void,
+ getKey?: (value: T) => string | number
+): UseSelectAllResult {
+ const selectedKeys = React.useMemo(() => {
+ const keys = new Set<unknown>()
+ for (const v of selected) {
+ keys.add(getKey ? getKey(v) : v)
+ }
+ return keys
+ }, [selected, getKey])
+
+ const matched = values.reduce((count, v) => {
+ const key = getKey ? getKey(v) : v
+ return count + (selectedKeys.has(key) ? 1 : 0)
+ }, 0)
+
+ const state: SelectAllState =
+ matched === 0 ? 'none' : matched >= values.length ? 'all' : 'some'
+ const isAllSelected = state === 'all'
+
+ const toggle = React.useCallback(() => {
+ onChange(isAllSelected ? [] : values.slice())
+ }, [isAllSelected, onChange, values])
+
+ return { state, isAllSelected, toggle }
+}
+
+/**
+ * Convenience component that renders a `DropdownMenuItem` whose label flips
+ * between `selectLabel` ("Select all") and `deselectLabel` ("Deselect all")
+ * based on the current selection state. The menu stays open after toggle so
+ * users can keep adjusting items.
+ *
+ * For full control, use `useDropdownMenuSelectAll` directly and render your
+ * own item — or pass a render-prop child:
+ *
+ * @example
+ * <DropdownMenuSelectAll values={ALL} selected={selected} onChange={setSelected} />
+ *
+ * <DropdownMenuSelectAll values={ALL} selected={selected} onChange={setSelected}>
+ * {({ state, toggle }) => (
+ * <DropdownMenuItem closeOnClick={false} onClick={toggle}>
+ * {state === 'all' ? 'Clear' : 'Pick everything'}
+ * {state === 'some' && ' (partial)'}
+ * </DropdownMenuItem>
+ * )}
+ * </DropdownMenuSelectAll>
+ */
+function DropdownMenuSelectAll<T>({
+ values,
+ selected,
+ onChange,
+ getKey,
+ selectLabel = 'Select all',
+ deselectLabel = 'Deselect all',
+ children,
+ ...itemProps
+}: {
+ values: readonly T[]
+ selected: readonly T[]
+ onChange: (next: T[]) => void
+ getKey?: (value: T) => string | number
+ selectLabel?: React.ReactNode
+ deselectLabel?: React.ReactNode
+ children?: (result: UseSelectAllResult) => React.ReactNode
+} & Omit<
+ React.ComponentProps<typeof DropdownMenuItem>,
+ 'children' | 'onClick' | 'onChange' | 'closeOnClick' | 'data-state'
+>): React.ReactElement {
+ const result = useDropdownMenuSelectAll(values, selected, onChange, getKey)
+
+ if (children) {
+ return <>{children(result)}</>
+ }
+
+ return (
+ <DropdownMenuItem
+ {...itemProps}
+ data-slot="dropdown-menu-select-all"
+ data-state={result.state}
+ closeOnClick={false}
+ onClick={result.toggle}
+ >
+ {result.isAllSelected ? deselectLabel : selectLabel}
+ </DropdownMenuItem>
+ )
+}
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.ReactElement {
return <span data-slot="dropdown-menu-shortcut" className={cn('quill-menu__shortcut', className)} {...props} />
}
@@ -248,9 +376,12 @@ export {
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
+ DropdownMenuSelectAll,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubTrigger,
DropdownMenuSubContent,
+ useDropdownMenuSelectAll,
}
+export type { SelectAllState, UseSelectAllResult }
diff --git a/packages/quill/packages/primitives/src/empty.css b/packages/quill/packages/primitives/src/empty.css
index d7c5f2e6defb..213fae594be5 100644
--- a/packages/quill/packages/primitives/src/empty.css
+++ b/packages/quill/packages/primitives/src/empty.css
@@ -4,7 +4,7 @@
text-align: center;
text-wrap: balance;
border: 1px dashed var(--border);
- border-radius: var(--radius-xl);
+ border-radius: var(--radius-md);
}
.quill-empty__title {
diff --git a/packages/quill/packages/primitives/src/empty.stories.tsx b/packages/quill/packages/primitives/src/empty.stories.tsx
index 19163f3ababa..db2033c515c1 100644
--- a/packages/quill/packages/primitives/src/empty.stories.tsx
+++ b/packages/quill/packages/primitives/src/empty.stories.tsx
@@ -27,7 +27,7 @@ export const Default: Story = {
</EmptyDescription>
</EmptyHeader>
<EmptyContent className="flex-row justify-center gap-2">
- <Button>Create Project</Button>
+ <Button variant="primary">Create Project</Button>
<Button variant="outline">Import Project</Button>
</EmptyContent>
<Button
diff --git a/packages/quill/packages/primitives/src/index.ts b/packages/quill/packages/primitives/src/index.ts
index 689b347eea52..170a6f1f4074 100644
--- a/packages/quill/packages/primitives/src/index.ts
+++ b/packages/quill/packages/primitives/src/index.ts
@@ -1,6 +1,23 @@
import './styles/layers.css'
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from './accordion'
+export {
+ Autocomplete,
+ AutocompleteClear,
+ AutocompleteCollection,
+ AutocompleteContent,
+ AutocompleteEmpty,
+ AutocompleteGroup,
+ AutocompleteInput,
+ AutocompleteItem,
+ AutocompleteLabel,
+ AutocompleteList,
+ AutocompleteSeparator,
+ AutocompleteStatus,
+ AutocompleteTrigger,
+ AutocompleteValue,
+ useAutocompleteAnchor,
+} from './autocomplete'
export { Badge, badgeVariants } from './badge'
export { Button, buttonVariants, type ButtonProps } from './button'
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from './button-group'
@@ -29,17 +46,6 @@ export {
ComboboxValue,
useComboboxAnchor,
} from './combobox'
-export {
- Command,
- CommandDialog,
- CommandInput,
- CommandList,
- CommandEmpty,
- CommandGroup,
- CommandItem,
- CommandShortcut,
- CommandSeparator,
-} from './command'
export {
ContextMenu,
ContextMenuTrigger,
@@ -95,12 +101,15 @@ export {
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
+ DropdownMenuSelectAll,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubTrigger,
DropdownMenuSubContent,
+ useDropdownMenuSelectAll,
} from './dropdown-menu'
+export type { SelectAllState, UseSelectAllResult } from './dropdown-menu'
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia } from './empty'
export {
Field,
diff --git a/packages/quill/packages/primitives/src/input-group.tsx b/packages/quill/packages/primitives/src/input-group.tsx
index a7cf7e3e7330..067c512556fa 100644
--- a/packages/quill/packages/primitives/src/input-group.tsx
+++ b/packages/quill/packages/primitives/src/input-group.tsx
@@ -23,7 +23,7 @@ const InputGroup = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>
InputGroup.displayName = 'InputGroup'
const inputGroupAddonVariants = cva(
- 'quill-input-group__addon group/input-group-addon flex h-auto items-center justify-center gap-1 select-none whitespace-nowrap',
+ 'quill-input-group__addon group/input-group-addon empty:hidden flex h-auto items-center justify-center gap-1 select-none whitespace-nowrap',
{
variants: {
align: {
diff --git a/packages/quill/packages/primitives/src/item.css b/packages/quill/packages/primitives/src/item.css
index ef2dc8796393..03bc65b529e8 100644
--- a/packages/quill/packages/primitives/src/item.css
+++ b/packages/quill/packages/primitives/src/item.css
@@ -1,13 +1,5 @@
/* stylelint-disable selector-class-pattern -- escaped Tailwind group classes (.group\/item, .group\/item-group) fall outside strict BEM */
@layer components {
- .quill-item-group {
- /* combined mode collapses gaps */
- }
-
- .quill-item-group[data-combined] {
- gap: 0;
- }
-
.quill-item {
font-size: var(--text-xs, 0.75rem);
line-height: 1.625;
@@ -27,27 +19,18 @@
box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 30%, transparent);
}
- /* Combined item-group: collapse borders between siblings */
- [data-combined] > .quill-item {
- border-radius: 0;
- }
-
- [data-combined] > .quill-item:first-child {
- border-start-start-radius: var(--radius-sm);
- border-start-end-radius: var(--radius-sm);
- }
-
- [data-combined] > .quill-item:last-child {
- border-end-start-radius: var(--radius-sm);
- border-end-end-radius: var(--radius-sm);
- }
-
- [data-combined] > .quill-item:not(:last-child) {
- border-bottom: 0;
- }
-
- /* Inside combobox items drop the border */
- [data-slot='combobox-item'].quill-item {
+ /*
+ * Item nested inside a popover-style row (combobox option, select option,
+ * menu/menubar/dropdown/context-menu item, command palette item) should
+ * not paint its own border — the row owns the selection/highlight visual,
+ * and the Item's `--card` border becomes a visible halo as soon as the
+ * row gets `bg-fill-selected` or `bg-fill-hover`.
+ *
+ * Targeting by ARIA role rather than `data-slot` keeps this future-proof:
+ * any primitive that exposes its row as `role=option | menuitem | *` gets
+ * the reset for free, no per-primitive rule needed.
+ */
+ :is([role='option'], [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']) .quill-item {
border: none;
}
@@ -66,22 +49,20 @@
}
.quill-item--variant-pressable {
+ border-color: var(--border);
+ box-shadow: var(--shadow-md);
transition:
color 0.15s ease,
- background-color 0.15s ease,
- border-color 0.15s ease,
- box-shadow 0.15s ease;
+ background-color 0.15s ease;
}
.quill-item--variant-pressable:hover {
z-index: 1;
- border-color: color-mix(in oklab, var(--secondary) 20%, transparent);
- box-shadow: var(--shadow-md, 0 1px 2px 0 rgb(0 0 0 / 30%));
}
- .group\/item-group[data-combined='true'] .quill-item--variant-pressable:hover {
- border-color: var(--border);
- box-shadow: none;
+ .quill-item--variant-pressable:not(:disabled):active {
+ box-shadow: var(--shadow-sm);
+ translate: 0 1px;
}
.quill-item--variant-menu {
diff --git a/packages/quill/packages/primitives/src/item.stories.tsx b/packages/quill/packages/primitives/src/item.stories.tsx
index 47c956f0772b..34608b514bcd 100644
--- a/packages/quill/packages/primitives/src/item.stories.tsx
+++ b/packages/quill/packages/primitives/src/item.stories.tsx
@@ -13,6 +13,8 @@ import {
DropdownMenuCheckboxItem,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
+ DropdownMenuSelectAll,
+ DropdownMenuSeparator,
} from './dropdown-menu'
import {
Item,
@@ -85,7 +87,7 @@ export const Pressable: Story = {
export const Group: Story = {
render: () => (
<ItemGroup>
- <ItemGroup combined>
+ <ItemGroup>
<Item variant="outline">
<ItemContent>
<ItemTitle>Basic Item</ItemTitle>
@@ -120,7 +122,7 @@ export const Group: Story = {
export const GroupList: Story = {
render: () => (
- <ItemGroup combined>
+ <ItemGroup>
<Item
variant="pressable"
size="xs"
@@ -254,6 +256,67 @@ export const DropdownCheckboxesInItem: Story = {
},
} satisfies Story
+export const DropdownCheckboxesInItemWithSelectAll: Story = {
+ render: () => {
+ const [open, setOpen] = useState(true)
+ const [selected, setSelected] = useState<string[]>([people[0].username])
+
+ const usernames = people.map((p) => p.username)
+
+ const toggle = (username: string, checked: boolean): void => {
+ setSelected((prev) =>
+ checked ? [...prev, username] : prev.filter((u) => u !== username)
+ )
+ }
+
+ return (
+ <Item variant="outline" className="max-w-sm">
+ <ItemContent>
+ <ItemTitle>Basic Item</ItemTitle>
+ <ItemDescription>
+ Multi-select with a headless select-all action above the list.
+ </ItemDescription>
+ </ItemContent>
+ <ItemActions>
+ <DropdownMenu open={open} onOpenChange={setOpen}>
+ <DropdownMenuTrigger render={(props) => <Button variant="outline" {...props} />}>
+ {selected.length} / {people.length} selected
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-auto" align="end">
+ <DropdownMenuGroup>
+ <DropdownMenuSelectAll
+ values={usernames}
+ selected={selected}
+ onChange={(next) => setSelected([...next])}
+ />
+ <DropdownMenuSeparator />
+ {people.map((person) => (
+ <DropdownMenuCheckboxItem
+ key={person.username}
+ checked={selected.includes(person.username)}
+ onCheckedChange={(checked) => toggle(person.username, !!checked)}
+ closeOnClick={false}
+ render={(props) => (
+ <ItemCheckbox size="xs" {...props}>
+ <ItemContent variant="menuItem">
+ <ItemTitle>{person.username}</ItemTitle>
+ <ItemDescription className="leading-none">
+ {person.email}
+ </ItemDescription>
+ </ItemContent>
+ </ItemCheckbox>
+ )}
+ />
+ ))}
+ </DropdownMenuGroup>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </ItemActions>
+ </Item>
+ )
+ },
+} satisfies Story
+
export const DropdownRadiosInItem: Story = {
render: () => {
const [open, setOpen] = useState(true)
diff --git a/packages/quill/packages/primitives/src/item.tsx b/packages/quill/packages/primitives/src/item.tsx
index 2c70ea75714c..2526ddd09536 100644
--- a/packages/quill/packages/primitives/src/item.tsx
+++ b/packages/quill/packages/primitives/src/item.tsx
@@ -9,19 +9,13 @@ import { cn } from './lib/utils'
import { RadioIndicator } from './radio-group'
import { Separator } from './separator'
-function ItemGroup({
- className,
- combined = false,
- ...props
-}: React.ComponentProps<'div'> & { combined?: boolean }): React.ReactElement {
+function ItemGroup({ className, ...props }: React.ComponentProps<'div'>): React.ReactElement {
return (
<div
role="list"
data-slot="item-group"
- data-combined={combined || undefined}
className={cn(
'quill-item-group group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2',
- combined && 'has-data-[size=sm]:gap-0 has-data-[size=xs]:gap-0',
className
)}
{...props}
diff --git a/packages/quill/packages/primitives/src/menu.css b/packages/quill/packages/primitives/src/menu.css
index cd0c70497f17..cfa345a0a24c 100644
--- a/packages/quill/packages/primitives/src/menu.css
+++ b/packages/quill/packages/primitives/src/menu.css
@@ -3,19 +3,22 @@
/* =========================================================================
Shared menu visuals — dropdown-menu, context-menu, menubar, submenus
========================================================================= */
+
+ /*
+ * Menu chrome (outer). Owns border / shadow / radius / animation. NO
+ * scroll, NO padding — those live on `.quill-menu__scroller` so the
+ * border stays solid (not faded by `scroll-mask-*`) and the scrollbar
+ * sits inside the rounded corners.
+ */
.quill-menu__content {
z-index: var(--quill-z-popover, 50);
min-width: 8rem;
- max-height: var(--available-height);
- padding: 0.25rem;
- overflow: hidden auto;
- color: var(--popover-foreground);
- background-color: var(--popover);
+ color: var(--foreground);
+ background-color: var(--card);
+ border: 1px solid var(--border);
border-radius: var(--radius-md);
outline: none;
- box-shadow:
- 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent),
- 0 4px 6px -1px rgb(0 0 0 / 10%);
+ box-shadow: var(--shadow-md);
/* 150ms ease-out — menus are user-triggered; keep snappy. scale(0.97)
is intentionally subtle so the motion reads as settle-in, not pop. */
@@ -33,25 +36,35 @@
transform: scale(0.97);
}
- .quill-menu__content[data-closed] {
- overflow: hidden;
- }
-
.quill-menu__sub-content {
min-width: 8rem;
- padding: 0.25rem;
- color: var(--popover-foreground);
- background-color: var(--popover);
+ color: var(--foreground);
+ background-color: var(--card);
+ border: 1px solid var(--border);
border-radius: var(--radius-md);
- box-shadow:
- 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent),
- 0 4px 6px -1px rgb(0 0 0 / 10%);
+ box-shadow: var(--shadow-md);
transition:
opacity 150ms cubic-bezier(0.215, 0.61, 0.355, 1),
transform 150ms cubic-bezier(0.215, 0.61, 0.355, 1);
transform-origin: var(--transform-origin);
}
+ /*
+ * Inner scroller. Holds padding, overflow, max-height + the edge fade.
+ * Sized via `var(--available-height)` from base-ui's positioner — it
+ * cascades down so it resolves on the child here.
+ */
+ .quill-menu__scroller {
+ max-height: var(--available-height);
+ padding: 0.25rem;
+ overflow: hidden auto;
+ }
+
+ .quill-menu__content[data-closed] .quill-menu__scroller,
+ .quill-menu__sub-content[data-closed] .quill-menu__scroller {
+ overflow: hidden;
+ }
+
.quill-menu__separator {
height: 1px;
margin-block: 0.25rem;
@@ -69,7 +82,7 @@
.group\/dropdown-menu-item:focus .quill-menu__shortcut,
.group\/context-menu-item:focus .quill-menu__shortcut,
.group\/menubar-item:focus .quill-menu__shortcut {
- color: var(--accent-foreground);
+ color: var(--foreground);
}
/* Inset item (when data-inset=true, reserve space for indicator column) */
diff --git a/packages/quill/packages/primitives/src/menubar.stories.tsx b/packages/quill/packages/primitives/src/menubar.stories.tsx
new file mode 100644
index 000000000000..cdeb45472bde
--- /dev/null
+++ b/packages/quill/packages/primitives/src/menubar.stories.tsx
@@ -0,0 +1,130 @@
+import type { Meta, StoryObj } from '@storybook/react'
+import { Copy, Pencil, TrashIcon } from 'lucide-react'
+import { useState } from 'react'
+
+import { Kbd } from './kbd'
+import {
+ Menubar,
+ MenubarCheckboxItem,
+ MenubarContent,
+ MenubarItem,
+ MenubarLabel,
+ MenubarMenu,
+ MenubarRadioGroup,
+ MenubarRadioItem,
+ MenubarSeparator,
+ MenubarSub,
+ MenubarSubContent,
+ MenubarSubTrigger,
+ MenubarTrigger,
+} from './menubar'
+
+const meta = {
+ title: 'Primitives/Menubar',
+ component: Menubar,
+ tags: ['autodocs'],
+} satisfies Meta<typeof Menubar>
+
+export default meta
+type Story = StoryObj<typeof meta>
+
+export const Default: Story = {
+ render: () => (
+ <Menubar>
+ <MenubarMenu>
+ <MenubarTrigger>File</MenubarTrigger>
+ <MenubarContent>
+ <MenubarItem>
+ <Copy />
+ New file
+ <Kbd>⌘N</Kbd>
+ </MenubarItem>
+ <MenubarItem>
+ <Pencil />
+ Rename
+ </MenubarItem>
+ <MenubarSeparator />
+ <MenubarItem variant="destructive">
+ <TrashIcon />
+ Delete
+ </MenubarItem>
+ </MenubarContent>
+ </MenubarMenu>
+ <MenubarMenu>
+ <MenubarTrigger>Edit</MenubarTrigger>
+ <MenubarContent>
+ <MenubarItem>Undo</MenubarItem>
+ <MenubarItem>Redo</MenubarItem>
+ <MenubarSeparator />
+ <MenubarSub>
+ <MenubarSubTrigger>Find</MenubarSubTrigger>
+ <MenubarSubContent>
+ <MenubarItem>Find in file</MenubarItem>
+ <MenubarItem>Find in project</MenubarItem>
+ </MenubarSubContent>
+ </MenubarSub>
+ </MenubarContent>
+ </MenubarMenu>
+ </Menubar>
+ ),
+} satisfies Story
+
+export const WithCheckboxAndRadio: Story = {
+ render: () => {
+ const [bold, setBold] = useState(true)
+ const [size, setSize] = useState('medium')
+ return (
+ <Menubar>
+ <MenubarMenu>
+ <MenubarTrigger>Format</MenubarTrigger>
+ <MenubarContent>
+ <MenubarLabel>Style</MenubarLabel>
+ <MenubarCheckboxItem checked={bold} onCheckedChange={setBold}>
+ Bold
+ </MenubarCheckboxItem>
+ <MenubarSeparator />
+ <MenubarLabel>Size</MenubarLabel>
+ <MenubarRadioGroup value={size} onValueChange={setSize}>
+ <MenubarRadioItem value="small">Small</MenubarRadioItem>
+ <MenubarRadioItem value="medium">Medium</MenubarRadioItem>
+ <MenubarRadioItem value="large">Large</MenubarRadioItem>
+ </MenubarRadioGroup>
+ </MenubarContent>
+ </MenubarMenu>
+ </Menubar>
+ )
+ },
+} satisfies Story
+
+const TIMEZONES = [
+ 'Pacific/Midway', 'Pacific/Honolulu', 'America/Anchorage', 'America/Los_Angeles',
+ 'America/Denver', 'America/Phoenix', 'America/Chicago', 'America/Mexico_City',
+ 'America/New_York', 'America/Toronto', 'America/Halifax', 'America/Sao_Paulo',
+ 'Atlantic/Azores', 'Europe/London', 'Europe/Dublin', 'Europe/Lisbon',
+ 'Europe/Paris', 'Europe/Berlin', 'Europe/Madrid', 'Europe/Rome',
+ 'Europe/Athens', 'Europe/Helsinki', 'Africa/Cairo', 'Europe/Moscow',
+ 'Asia/Dubai', 'Asia/Karachi', 'Asia/Kolkata', 'Asia/Bangkok',
+ 'Asia/Singapore', 'Asia/Hong_Kong', 'Asia/Shanghai', 'Asia/Tokyo',
+ 'Asia/Seoul', 'Australia/Perth', 'Australia/Sydney', 'Pacific/Auckland',
+] as const
+
+export const Overflow: Story = {
+ render: () => (
+ <Menubar>
+ <MenubarMenu>
+ <MenubarTrigger>Timezone</MenubarTrigger>
+ <MenubarContent className="min-w-56">
+ {TIMEZONES.map((tz) => (
+ <MenubarItem key={tz}>{tz}</MenubarItem>
+ ))}
+ </MenubarContent>
+ </MenubarMenu>
+ <MenubarMenu>
+ <MenubarTrigger>Help</MenubarTrigger>
+ <MenubarContent>
+ <MenubarItem>About</MenubarItem>
+ </MenubarContent>
+ </MenubarMenu>
+ </Menubar>
+ ),
+} satisfies Story
diff --git a/packages/quill/packages/primitives/src/menubar.tsx b/packages/quill/packages/primitives/src/menubar.tsx
index 3910ab4d6e53..d799b995005f 100644
--- a/packages/quill/packages/primitives/src/menubar.tsx
+++ b/packages/quill/packages/primitives/src/menubar.tsx
@@ -86,7 +86,7 @@ function MenubarItem({
data-inset={inset}
data-variant={variant}
className={cn(
- "group/menubar-item min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive!",
+ "group/menubar-item min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed focus:bg-fill-hover data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive!",
className
)}
{...props}
@@ -108,7 +108,7 @@ function MenubarCheckboxItem({
data-slot="menubar-checkbox-item"
data-inset={inset}
className={cn(
- 'quill-menu-item--inset relative flex min-h-7 cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
+ 'quill-menu-item--inset relative flex min-h-7 cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 text-xs outline-hidden select-none focus:bg-fill-hover data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0',
className
)}
checked={checked}
@@ -142,7 +142,7 @@ function MenubarRadioItem({
data-slot="menubar-radio-item"
data-inset={inset}
className={cn(
- "quill-menu-item--inset relative flex min-h-7 cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
+ "quill-menu-item--inset relative flex min-h-7 cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 text-xs outline-hidden select-none focus:bg-fill-hover data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
className
)}
{...props}
@@ -205,7 +205,7 @@ function MenubarSubTrigger({
data-slot="menubar-sub-trigger"
data-inset={inset}
className={cn(
- "min-h-7 gap-2 rounded-sm px-2 py-1 text-xs focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-3.5",
+ "min-h-7 gap-2 rounded-sm px-2 py-1 text-xs focus:bg-fill-hover data-open:bg-fill-selected [&_svg:not([class*='size-'])]:size-3.5",
inset && 'quill-menu-item--inset',
className
)}
diff --git a/packages/quill/packages/primitives/src/popover.css b/packages/quill/packages/primitives/src/popover.css
index af4fe58a427a..b89a666c148d 100644
--- a/packages/quill/packages/primitives/src/popover.css
+++ b/packages/quill/packages/primitives/src/popover.css
@@ -4,14 +4,12 @@
width: 18rem;
padding: 0.625rem;
font-size: var(--text-xs, 0.75rem);
- color: var(--popover-foreground);
- background-color: var(--popover);
+ color: var(--foreground);
+ background-color: var(--card);
+ border: 1px solid var(--border);
border-radius: var(--radius-md);
outline: none;
- box-shadow: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 10%));
- box-shadow:
- 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent),
- 0 4px 6px -1px rgb(0 0 0 / 10%);
+ box-shadow: var(--shadow-md);
transition:
opacity 150ms cubic-bezier(0.215, 0.61, 0.355, 1),
transform 150ms cubic-bezier(0.215, 0.61, 0.355, 1);
diff --git a/packages/quill/packages/primitives/src/radio-group.css b/packages/quill/packages/primitives/src/radio-group.css
index 064db2b1e95f..217fe058c5eb 100644
--- a/packages/quill/packages/primitives/src/radio-group.css
+++ b/packages/quill/packages/primitives/src/radio-group.css
@@ -6,7 +6,7 @@
position: relative;
display: flex;
flex-shrink: 0;
- border: 1px solid var(--accent);
+ border: 1px solid var(--border);
border-radius: 9999px;
}
diff --git a/packages/quill/packages/primitives/src/scroll-area.tsx b/packages/quill/packages/primitives/src/scroll-area.tsx
index 087a497a73df..d2558908d4e8 100644
--- a/packages/quill/packages/primitives/src/scroll-area.tsx
+++ b/packages/quill/packages/primitives/src/scroll-area.tsx
@@ -100,7 +100,7 @@ function ScrollToEdgeButton({
aria-label={config.label}
onClick={handleClick}
className={cn(
- 'bg-background not-disabled:hover:bg-accent absolute z-10 grid place-items-center rounded-full shadow-md',
+ 'bg-background not-disabled:hover:bg-fill-hover absolute z-10 grid place-items-center rounded-full shadow-md',
'opacity-0 scale-95 pointer-events-none',
'transition-[opacity,transform,background-color] duration-150 ease-out',
'motion-reduce:transition-none',
diff --git a/packages/quill/packages/primitives/src/select.css b/packages/quill/packages/primitives/src/select.css
index 1eca981e2cac..9c99c7c7976e 100644
--- a/packages/quill/packages/primitives/src/select.css
+++ b/packages/quill/packages/primitives/src/select.css
@@ -57,13 +57,12 @@
min-width: 8rem;
max-height: var(--available-height);
overflow: hidden auto;
- color: var(--popover-foreground);
- background-color: var(--popover);
+ color: var(--foreground);
+ background-color: var(--card);
isolation: isolate;
+ border: 1px solid var(--border);
border-radius: var(--radius-md);
- box-shadow:
- 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent),
- 0 4px 6px -1px rgb(0 0 0 / 10%);
+ box-shadow: var(--shadow-md);
transition:
opacity 150ms cubic-bezier(0.215, 0.61, 0.355, 1),
transform 150ms cubic-bezier(0.215, 0.61, 0.355, 1);
@@ -104,7 +103,7 @@
}
.quill-select__item:focus {
- color: var(--accent-foreground);
+ color: var(--foreground);
background-color: var(--fill-hover);
}
@@ -148,11 +147,11 @@
.quill-select__scroll-button {
top: 0;
+ left: 50%;
z-index: 10;
- width: 100%;
- padding-block: 0.25rem;
- cursor: default;
- background-color: var(--popover);
+ background-color: var(--card);
+ border-radius: 9999px;
+ transform: translateX(-50%);
}
.quill-select__scroll-button svg:not([class*='size-']) {
@@ -162,7 +161,11 @@
.quill-select__scroll-button--down {
top: auto;
- bottom: 0;
+ bottom: var(--spacing);
+ }
+
+ .quill-select__scroll-button--up {
+ top: var(--spacing);
}
@media (prefers-reduced-motion: reduce) {
diff --git a/packages/quill/packages/primitives/src/select.tsx b/packages/quill/packages/primitives/src/select.tsx
index 5d9f0da7528e..490d70a9df49 100644
--- a/packages/quill/packages/primitives/src/select.tsx
+++ b/packages/quill/packages/primitives/src/select.tsx
@@ -71,14 +71,11 @@ function SelectContent({
<SelectPrimitive.Popup
data-slot="select-content"
data-align-trigger={alignItemWithTrigger}
- className={cn(
- 'quill-select__content',
- className
- )}
+ className={cn('quill-select__content', className)}
{...props}
>
- <SelectScrollUpButton />
- <SelectPrimitive.List>{children}</SelectPrimitive.List>
+ <SelectScrollUpButton className="quill-select__scroll-button flex items-center justify-center" />
+ <SelectPrimitive.List className="scroll-mask-y-4 scroll-py-4">{children}</SelectPrimitive.List>
<SelectScrollDownButton />
</SelectPrimitive.Popup>
</SelectPrimitive.Positioner>
@@ -123,7 +120,8 @@ function SelectScrollUpButton({
return (
<SelectPrimitive.ScrollUpArrow
data-slot="select-scroll-up-button"
- className={cn('quill-select__scroll-button flex items-center justify-center', className)}
+ className={cn('quill-select__scroll-button quill-select__scroll-button--up', className)}
+ render={<Button variant="outline" size="icon-sm"/>}
{...props}
>
<ChevronUpIcon />
@@ -138,7 +136,8 @@ function SelectScrollDownButton({
return (
<SelectPrimitive.ScrollDownArrow
data-slot="select-scroll-down-button"
- className={cn('quill-select__scroll-button quill-select__scroll-button--down flex items-center justify-center', className)}
+ className={cn('quill-select__scroll-button quill-select__scroll-button--down', className)}
+ render={<Button variant="outline" size="icon-sm"/>}
{...props}
>
<ChevronDownIcon />
diff --git a/packages/quill/packages/primitives/src/skeleton.css b/packages/quill/packages/primitives/src/skeleton.css
index 15d2357d5fc4..cdeff5c6c69b 100644
--- a/packages/quill/packages/primitives/src/skeleton.css
+++ b/packages/quill/packages/primitives/src/skeleton.css
@@ -1,6 +1,6 @@
@layer components {
.quill-skeleton {
- background-color: var(--accent);
+ background-color: var(--muted);
border-radius: var(--radius-md, 0.375rem);
animation: var(--animate-pulse, pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite);
}
diff --git a/packages/quill/packages/primitives/src/styles/layers.css b/packages/quill/packages/primitives/src/styles/layers.css
index 357b9b4e5b12..e0d0f80de336 100644
--- a/packages/quill/packages/primitives/src/styles/layers.css
+++ b/packages/quill/packages/primitives/src/styles/layers.css
@@ -15,18 +15,15 @@
* utility generation; it does NOT emit them on `:root`. Primitive CSS files
* reference them via `var()`, so we must materialize them here.
*
- * Radius vars are emitted by @posthog/quill-tokens directly (see
+ * Radius and shadow vars are emitted by @posthog/quill-tokens directly (see
* `generateStylesCSS` in packages/tokens/src/colors.ts). Do not re-declare
- * them here — tokens is the single source of truth for radius values.
+ * them here — tokens is the single source of truth for those values.
*/
:root {
--text-xxs: 0.625rem;
--text-xxs--line-height: 0.75rem;
--text-xs--line-height: 1rem;
--text-sm--line-height: 1.25rem;
- --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 30%);
- --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 30%), 0 2px 4px -2px rgb(0 0 0 / 30%);
- --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 30%), 0 4px 6px -4px rgb(0 0 0 / 30%);
--animate-spin: spin 1s linear infinite;
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
--animate-skeleton: skeleton 2s -1s infinite linear;
@@ -103,11 +100,11 @@
@keyframes pulse-glow {
0%,
100% {
- box-shadow: 0 0 2px 1px var(--pulse-glow-color, var(--color-accent));
+ box-shadow: 0 0 2px 1px var(--pulse-glow-color, var(--color-primary));
}
50% {
- box-shadow: 0 0 6px 2px var(--pulse-glow-color, var(--color-accent));
+ box-shadow: 0 0 6px 2px var(--pulse-glow-color, var(--color-primary));
}
}
diff --git a/packages/quill/packages/primitives/src/tabs.css b/packages/quill/packages/primitives/src/tabs.css
index 6721252338f8..7cf464ec9033 100644
--- a/packages/quill/packages/primitives/src/tabs.css
+++ b/packages/quill/packages/primitives/src/tabs.css
@@ -10,12 +10,14 @@
.quill-tabs__list {
z-index: 0;
padding: 3px;
+
+ /* padding: 2px 3px 4px 3px; */
color: var(--muted-foreground);
- border-radius: var(--radius-lg);
+ border-radius: var(--radius-md);
}
.quill-tabs__list--variant-default {
- background-color: var(--accent);
+ background-color: var(--card);
}
.quill-tabs__list--variant-line {
@@ -44,7 +46,9 @@
.quill-tabs__indicator--variant-default {
z-index: -1;
background-color: var(--background);
+ border: 1px solid var(--border);
border-radius: var(--radius-sm);
+ box-shadow: var(--shadow-sm);
}
.quill-tabs__indicator--variant-line {
@@ -53,15 +57,15 @@
}
.group\/tabs[data-orientation='horizontal'] .quill-tabs__indicator--variant-default {
- top: 50%;
+ top: calc(50% - 1px);
left: 0;
width: var(--active-tab-width);
- height: 1.75rem;
+ height: calc(var(--active-tab-height) - -2px);
transform: translateX(var(--active-tab-left)) translateY(-50%);
}
.group\/tabs[data-orientation='vertical'] .quill-tabs__indicator--variant-default {
- top: 0;
+ top: -1px;
left: 50%;
width: calc(100% - 6px);
height: var(--active-tab-height);
diff --git a/packages/quill/packages/primitives/src/toast.css b/packages/quill/packages/primitives/src/toast.css
index 744967f63364..0be3ef93ebee 100644
--- a/packages/quill/packages/primitives/src/toast.css
+++ b/packages/quill/packages/primitives/src/toast.css
@@ -4,13 +4,14 @@
box-sizing: border-box;
padding-block: 0.5rem;
padding-inline: 0.75rem;
- color: var(--popover-foreground);
+ color: var(--foreground);
cursor: default;
user-select: none;
- background-color: var(--popover);
+ background-color: var(--card);
background-clip: padding-box;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
+ box-shadow: var(--shadow-md);
}
.quill-toast-card__title {
@@ -30,14 +31,14 @@
padding-inline: 0.5rem;
font-size: var(--text-xs, 0.75rem);
font-weight: 500;
- background-color: var(--popover);
+ background-color: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
transition: background-color 0.15s ease;
}
.quill-toast-card__action:hover {
- background-color: var(--accent);
+ background-color: var(--fill-hover);
}
/* Toast icon tiles by type */
diff --git a/packages/quill/packages/primitives/src/toggle-group.css b/packages/quill/packages/primitives/src/toggle-group.css
index 2daba07682e1..42c5ec9a2c89 100644
--- a/packages/quill/packages/primitives/src/toggle-group.css
+++ b/packages/quill/packages/primitives/src/toggle-group.css
@@ -1,5 +1,6 @@
@layer components {
.quill-toggle-group {
+ height: fit-content;
border-radius: var(--radius-sm);
}
@@ -7,14 +8,30 @@
border-radius: min(var(--radius-sm), 6px);
}
- /* Items — shared */
+ /* Items — shared. Position relative for the z-index lifts below. */
.quill-toggle-group__item {
+ position: relative;
flex-shrink: 0;
}
- .quill-toggle-group__item:focus,
+ /*
+ * Each item keeps its full border. To avoid double-thick lines between
+ * adjacent items (data-spacing=0), the second-onwards items pull back
+ * by -1px on the leading edge so neighboring borders perfectly overlap.
+ * Interactive states raise z-index so the active item's border draws
+ * over its neighbors instead of being painted under them.
+ */
+ .quill-toggle-group__item:is(:hover, :active, [aria-pressed='true'], [data-state='on'], [data-pressed]) {
+ z-index: 1;
+ }
+
+ /*
+ * Only keyboard focus lifts above neighbors. Click focus would keep the
+ * item at z-index 10 even after mouse-up; combined with the toggle's
+ * translate snap-back, that left a frame where the item's border didn't
+ * paint over its neighbor cleanly until you blurred.
+ */
.quill-toggle-group__item:focus-visible {
- position: relative;
z-index: 10;
}
@@ -35,16 +52,20 @@
}
.quill-toggle-group[data-orientation='horizontal'][data-spacing='0']
- .quill-toggle-group__item[data-variant='outline'] {
- border-inline-start: 0;
+ .quill-toggle-group__item[data-variant='outline']:not(:first-child) {
+ margin-inline-start: -1px;
}
- .quill-toggle-group[data-orientation='horizontal'][data-spacing='0']
- .quill-toggle-group__item[data-variant='outline']:first-child {
- border-inline-start: 1px solid var(--input);
+ /* Vertical, spacing=0 */
+ .quill-toggle-group[data-orientation='vertical'][data-spacing='0'] {
+ box-shadow: var(--shadow-sm);
+ }
+
+ .quill-toggle-group[data-orientation='vertical'][data-spacing='0'] .quill-toggle-group__item {
+ box-shadow: none;
+ translate: 0 0;
}
- /* Vertical, spacing=0 */
.quill-toggle-group[data-orientation='vertical'][data-spacing='0'] .quill-toggle-group__item:first-child {
border-start-start-radius: var(--radius-sm);
border-start-end-radius: var(--radius-sm);
@@ -56,12 +77,7 @@
}
.quill-toggle-group[data-orientation='vertical'][data-spacing='0']
- .quill-toggle-group__item[data-variant='outline'] {
- border-block-start: 0;
- }
-
- .quill-toggle-group[data-orientation='vertical'][data-spacing='0']
- .quill-toggle-group__item[data-variant='outline']:first-child {
- border-block-start: 1px solid var(--input);
+ .quill-toggle-group__item[data-variant='outline']:not(:first-child) {
+ margin-block-start: -1px;
}
}
diff --git a/packages/quill/packages/primitives/src/toggle.css b/packages/quill/packages/primitives/src/toggle.css
index a11765b9e3f6..981d109e8013 100644
--- a/packages/quill/packages/primitives/src/toggle.css
+++ b/packages/quill/packages/primitives/src/toggle.css
@@ -2,14 +2,16 @@
.quill-toggle {
font-size: var(--text-xs, 0.75rem);
font-weight: 500;
+ cursor: pointer;
border-radius: var(--radius-sm);
outline: none;
+ box-shadow: 0 3px 0 color-mix(in oklab, var(--border), transparent 10%);
transition: all 0.15s ease;
}
.quill-toggle:hover {
color: var(--foreground);
- background-color: var(--muted);
+ background-color: color-mix(in oklab, var(--fill-hover) 50%, transparent);
}
.quill-toggle:focus-visible {
@@ -32,8 +34,11 @@
}
.quill-toggle[aria-pressed='true'],
- .quill-toggle[data-state='on'] {
- background-color: color-mix(in oklab, var(--accent) 80%, transparent);
+ .quill-toggle[data-state='on'],
+ .quill-toggle:not(:disabled):active {
+ background-color: color-mix(in oklab, var(--fill-selected) 50%, transparent);
+ box-shadow: 0 1px 0 color-mix(in oklab, var(--border), transparent 10%);
+ translate: 0 2px;
}
.quill-toggle svg {
diff --git a/packages/quill/packages/primitives/vite.config.ts b/packages/quill/packages/primitives/vite.config.ts
index dad53e0a7b9b..552adea141a4 100644
--- a/packages/quill/packages/primitives/vite.config.ts
+++ b/packages/quill/packages/primitives/vite.config.ts
@@ -28,7 +28,6 @@ export default defineConfig({
'@base-ui/react',
/^@base-ui\/react\//,
'lucide-react',
- 'cmdk',
'vaul',
'react-resizable-panels',
'class-variance-authority',
diff --git a/packages/quill/packages/quill/README.md b/packages/quill/packages/quill/README.md
new file mode 100644
index 000000000000..e45843422d82
--- /dev/null
+++ b/packages/quill/packages/quill/README.md
@@ -0,0 +1,167 @@
+# @posthog/quill
+
+PostHog's UI primitives, components, and design tokens, bundled as one
+publishable package. Built on [base-ui](https://base-ui.com/),
+[Tailwind v4](https://tailwindcss.com/), and a shared token layer.
+
+## Install
+
+```sh
+pnpm add @posthog/quill
+```
+
+Peer deps (already declared on this package, your package manager will
+pull them in): `react`, `react-dom`, `tailwindcss@^4`.
+
+## Required CSS imports
+
+Quill ships **four** CSS entry points. They all need to be imported in
+your Tailwind entry stylesheet, in order:
+
+```css
+@import 'tailwindcss';
+
+@import '@posthog/quill/tokens.css'; /* design tokens — :root + .dark CSS vars + @theme inline */
+@import '@posthog/quill/base.css'; /* one-line preflight reset (`* { @apply border-border outline-ring/50 }`) */
+@import '@posthog/quill/primitives.css'; /* BEM component styles (.quill-popover__content, .quill-menu__content, …) */
+@import '@posthog/quill/tailwind.css'; /* @source directive — tells Tailwind to scan quill's compiled JS */
+```
+
+Each file is small and load-bearing in a different way. Skipping any one
+of them will leave components rendering unstyled or with the wrong
+theme. **Do not** drop `primitives.css` thinking Tailwind will compile
+the BEM rules — it won't, those rules are pre-built CSS shipped with the
+package.
+
+### Why each file exists
+
+| File | Provides | What breaks without it |
+| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `tokens.css` | `:root { --background, --foreground, --card, …, --radius, --shadow-* }` and dark-mode overrides under `.dark`/`[theme="dark"]`. Plus `@theme inline { --color-background: var(--background); … }` so Tailwind utilities like `bg-background`, `text-foreground`, `rounded-md` resolve. | Components fall back to `currentColor` / `transparent`. Theme variants (`dark:`) don't switch. |
+| `base.css` | A single `@layer base { * { @apply border-border outline-ring/50 } }` rule. | Primitives that author plain `border` (no color modifier) end up with `currentColor` borders → most bordered components look broken. |
+| `primitives.css` | All BEM component styles — `.quill-popover__content`, `.quill-menu__content`, `.quill-tabs__indicator`, `.quill-combobox__item`, `.quill-toggle-group__item`, etc. About 80kb of pre-compiled CSS. | Components mount correct DOM but appear unstyled — popups have no border/shadow, menus have no padding, toggles have no pressed state, etc. |
+| `tailwind.css` | An `@source "./**/*.js"` directive (relative to its on-disk location in `node_modules/@posthog/quill/dist`) that tells your Tailwind v4 instance to scan quill's compiled JS for class-name strings (cva variants, `cn()` calls, etc.). | Tailwind utilities used inside quill primitives (e.g. `aria-selected:bg-fill-selected` on combobox items, `data-highlighted:ring-2` on autocomplete items) don't get generated → conditional states have no styling. |
+
+### Workaround for Tailwind v4 + `@config` legacy mode
+
+If you load a legacy `tailwind.config.js` via `@config "./tailwind.config.js"`
+in your CSS, Tailwind appears to ignore `@source` directives nested
+inside imported files. The `@source` in `tailwind.css` will not run.
+Add an explicit `@source` line in your own CSS pointing at quill's
+dist:
+
+```css
+/* Adjust the relative path so it resolves from THIS file's location to
+ * your app's `node_modules/@posthog/quill/dist`. */
+@source "../../../../node_modules/@posthog/quill/dist/**/*.js";
+```
+
+If you're not using `@config`, the `@source` inside `tailwind.css` runs
+normally and you don't need this line.
+
+### Cascade layer order
+
+Tailwind v4 declares `@layer theme, base, components, utilities;`
+internally. If you also use a third-party theme that uses `@import
+"…" layer(name)`, you may need to declare your own layer order _first_
+so the third-party layer doesn't get pushed to the front:
+
+```css
+@layer theme, base, radix, components, utilities;
+
+@import '@radix-ui/themes/styles.css' layer(radix);
+@import 'tailwindcss';
+
+@import '@posthog/quill/tokens.css';
+@import '@posthog/quill/base.css';
+@import '@posthog/quill/primitives.css';
+@import '@posthog/quill/tailwind.css';
+```
+
+This ensures Tailwind preflight (`base`) loads before radix's component
+defaults (`radix`), which load before consumer + quill utilities
+(`utilities`).
+
+## Dark mode
+
+Quill flips its CSS variables under either:
+
+- the `.dark` class on `<html>` (or any ancestor), or
+- the `[theme="dark"]` attribute
+
+Use whichever your app prefers. To activate Tailwind's `dark:` variant
+to track the same signal:
+
+```css
+@custom-variant dark (&:where(.dark, .dark *));
+```
+
+Drop this in your CSS entry after `@import "tailwindcss"`.
+
+## Scoped install
+
+If you can't load quill globally (e.g. embedding in a page that already
+has its own design system), import the `.scoped.css` variants instead:
+
+```css
+@import '@posthog/quill/tokens.scoped.css';
+@import '@posthog/quill/base.scoped.css';
+@import '@posthog/quill/color-system.scoped.css';
+```
+
+These variants gate every selector behind `[data-quill]` so quill's
+tokens and resets only apply inside subtrees marked with that
+attribute. Drop `data-quill` on your wrapper element. Note that
+`primitives.css` and `tailwind.css` are **not** scoped — primitives
+already carry `data-quill` on their roots so their styles are naturally
+locality-scoped via descendant selectors.
+
+## Usage
+
+```tsx
+import { Button, Combobox, Dialog, Tabs } from '@posthog/quill'
+
+function App() {
+ return <Button variant="outline">Click me</Button>
+}
+```
+
+All components are tree-shakeable named exports off the package root.
+
+## Components
+
+See [base-ui's docs](https://base-ui.com/) for the underlying primitive
+API. Quill's wrappers add styling and a `data-slot` attribute; the
+underlying props pass through.
+
+## Tokens
+
+`@posthog/quill-tokens` is published independently and re-exported from
+this package (under `tokens.css` and `color-system.css`). If you only
+need the design tokens (e.g. for a non-React renderer), depend on
+`@posthog/quill-tokens` directly.
+
+## Theming
+
+Override any of the theme knobs on `:root` (or on a subtree) in your
+own CSS:
+
+```css
+:root {
+ --radius: 0.375rem; /* default 0.58rem */
+ --theme-hue: 200; /* default 90 */
+ --theme-tint: 0.02; /* default 0.006 */
+ --primary-light: oklch(0.65 0.21 220); /* brand color, light */
+ --primary-dark: oklch(0.83 0.16 220); /* brand color, dark */
+}
+```
+
+`--theme-hue` and `--theme-tint` are inputs to the surface-color
+formula in `tokens.css`. The `--primary-*` pair is the brand color.
+
+## Versioning
+
+Quill follows semver, with `-beta.N` and `-alpha.N` prereleases. The
+public API (component props, exports) follows semver; CSS class names
+and `data-slot` attributes are best-effort but not guaranteed across
+minor versions — use the JSX API.
diff --git a/packages/quill/packages/quill/package.json b/packages/quill/packages/quill/package.json
index aa6ab4260d8d..3fa5aaf654b9 100644
--- a/packages/quill/packages/quill/package.json
+++ b/packages/quill/packages/quill/package.json
@@ -1,6 +1,6 @@
{
"name": "@posthog/quill",
- "version": "0.3.0-beta.0",
+ "version": "0.3.0-beta.1",
"description": "PostHog's unified design system — primitives, components, and blocks designed to be compiled by the consumer's Tailwind v4.",
"license": "MIT",
"repository": {
@@ -47,7 +47,6 @@
"@base-ui/react": "^1.3.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
- "cmdk": "^1.1.1",
"lucide-react": "^0.577.0",
"react-resizable-panels": "^4.7.1",
"tailwind-merge": "^2.2.2"
diff --git a/packages/quill/packages/quill/vite.config.ts b/packages/quill/packages/quill/vite.config.ts
index 71824f516ee3..ed69d2e9c748 100644
--- a/packages/quill/packages/quill/vite.config.ts
+++ b/packages/quill/packages/quill/vite.config.ts
@@ -18,8 +18,8 @@ import dts from 'vite-plugin-dts'
* and consumers would get ERR_MODULE_NOT_FOUND on first import.
*
* `@posthog/quill-tokens` stays external because it is independently
- * published. Actual runtime deps (@base-ui/react, cmdk, lucide-react,
- * etc.) are kept external too — they are redeclared as real
+ * published. Actual runtime deps (@base-ui/react, lucide-react, etc.)
+ * are kept external too — they are redeclared as real
* `dependencies` on the aggregate's package.json so pnpm/npm pulls
* them into the consumer's node_modules automatically.
*/
@@ -55,7 +55,6 @@ export default defineConfig({
/^@base-ui\/react\//,
'class-variance-authority',
'clsx',
- 'cmdk',
'lucide-react',
'react-resizable-panels',
'tailwind-merge',
diff --git a/packages/quill/packages/tokens/src/colors.ts b/packages/quill/packages/tokens/src/colors.ts
index bbf082287d91..f60870c666fb 100644
--- a/packages/quill/packages/tokens/src/colors.ts
+++ b/packages/quill/packages/tokens/src/colors.ts
@@ -11,7 +11,7 @@
*/
import { cssVarsFlat } from './css'
-import { generateShadowCSS } from './shadow'
+import { generateShadowCSS, shadow } from './shadow'
import { generateSpacingCSS } from './spacing'
import { generateFontSizeCSS, generateFontFamilyCSS } from './typography'
@@ -91,24 +91,17 @@ export function buildSemanticColors(): Record<string, ColorTuple> {
foreground: [oklch(0.13, 0.028, 262), oklch(0.967, 0.003, 265), 'text-foreground'],
card: [surface(0.995, 0.3, 'light'), surface(0.2, 1.2, 'dark'), 'bg-card'],
- 'card-foreground': [oklch(0.13, 0.028, 262), oklch(0.967, 0.003, 265), 'text-card-foreground'],
-
- popover: [surface(0.995, 0.3, 'light'), surface(0.21, 1.2, 'dark'), 'bg-popover'],
- 'popover-foreground': [oklch(0.13, 0.028, 262), oklch(0.967, 0.003, 265), 'text-popover-foreground'],
+ // Aliases `foreground` — kept for shadcn API compatibility. Drop once
+ // primitives migrate to plain `text-foreground`.
+ 'card-foreground': ['var(--foreground)', 'var(--foreground)', 'text-card-foreground'],
muted: [surface(0.94, 1.5, 'light'), surface(0.27, 1.5, 'dark'), 'bg-muted'],
'muted-foreground': [oklch(0.446, 0.03, 257), oklch(0.709, 0, 0), 'text-muted-foreground'],
- accent: [surface(0.87, 0.8, 'light'), surface(0.35, 1.2, 'dark'), 'bg-accent'],
- 'accent-foreground': [oklch(0.13, 0.028, 262), oklch(0.967, 0.003, 265), 'text-accent-foreground'],
-
// ── Brand (driven by --primary-light / --primary-dark) ─
primary: ['var(--primary-light)', 'var(--primary-dark)', 'bg-primary'],
'primary-foreground': [oklch(1, 0, 0), oklch(0.13, 0.028, 262), 'text-primary-foreground'],
- secondary: [oklch(0.31, 0, 0), oklch(0.86, 0, 0), 'bg-secondary'],
- 'secondary-foreground': [oklch(1, 0, 0), oklch(0.13, 0.028, 262), 'text-secondary-foreground'],
-
// ── Status (independent of theme hue) ─────────
destructive: [oklch(0.92, 0.03, 32.22), oklch(0.24, 0.03, 2.79), 'bg-destructive'],
'destructive-foreground': [
@@ -201,20 +194,18 @@ export function resolveTheme(mode: 'light' | 'dark'): Record<string, string> {
*
* Direct references to `--theme-hue`, `--theme-dark-hue`, `--theme-tint`,
* or `--primary-light` / `--primary-dark` are validated at module load
- * (see `assertThemeDerivedSyncedWithColors` below). The `fill-*` tokens are transitive — they reference
- * `var(--accent)` / `var(--muted)` rather than a theme var directly, so
- * they can't be auto-detected and must be listed explicitly.
+ * (see `assertThemeDerivedSyncedWithColors` below). The `fill-*` tokens are
+ * transitive — they reference `var(--foreground)` rather than a theme var
+ * directly, so they can't be auto-detected and must be listed explicitly.
*/
const THEME_DERIVED_TOKENS: ReadonlySet<string> = new Set([
'background',
'card',
- 'popover',
'muted',
- 'accent',
'primary',
'border',
'input',
- // Transitive: reference var(--accent) / var(--muted) — must also live
+ // Transitive: reference var(--foreground) / var(--muted) — must also live
// on `*` to re-evaluate on local overrides.
'fill-hover',
'fill-expanded',
@@ -228,7 +219,7 @@ const THEME_DERIVED_TOKENS: ReadonlySet<string> = new Set([
* (`[--theme-hue:X]`) would silently fail for it.
*
* This runs once at module load. It only catches direct references;
- * transitive references (e.g. `fill-*` → `var(--accent)`) must be kept
+ * transitive references (e.g. `fill-*` → `var(--foreground)`) must be kept
* in the set manually.
*/
function assertThemeDerivedSyncedWithColors(colors: Record<string, ColorTuple>): void {
@@ -331,7 +322,7 @@ ${cssVarsFlat(light.staticVars)}
${cssVarsFlat(light.dynamicVars)}
/* Override Tailwind --color-* theme tokens within scope so utilities
- * like bg-accent, text-foreground, border-border resolve to quill's
+ * like bg-card, text-foreground, border-border resolve to quill's
* values instead of the consumer's global theme. */
${generateColorMappingsCSS()}
}
@@ -466,8 +457,8 @@ export function generateStylesCSS(config: StylesConfig = {}): string {
lines.push(' }')
lines.push('')
lines.push(' @keyframes pulse-glow {')
- lines.push(' 0%, 100% { box-shadow: 0 0 2px 1px var(--pulse-glow-color, var(--color-accent)) }')
- lines.push(' 50% { box-shadow: 0 0 6px 2px var(--pulse-glow-color, var(--color-accent)) }')
+ lines.push(' 0%, 100% { box-shadow: 0 0 2px 1px var(--pulse-glow-color, var(--color-primary)) }')
+ lines.push(' 50% { box-shadow: 0 0 6px 2px var(--pulse-glow-color, var(--color-primary)) }')
lines.push(' }')
lines.push('')
lines.push(' @keyframes horizontal-shake {')
@@ -485,14 +476,17 @@ export function generateStylesCSS(config: StylesConfig = {}): string {
lines.push('}')
// Runtime materialization: `@theme inline` only feeds Tailwind's utility
- // generator, so BEM CSS that references `var(--radius-*)` directly needs a
- // real `:root` (or scoped) block at runtime.
+ // generator, so BEM CSS that references `var(--radius-*)` / `var(--shadow-*)`
+ // directly needs a real `:root` (or scoped) block at runtime.
lines.push('')
const runtimeSelector = scope ?? ':root'
lines.push(`${runtimeSelector} {`)
for (const [name, value] of RADIUS_VARS) {
lines.push(` ${name}: ${value};`)
}
+ for (const [name, value] of Object.entries(shadow)) {
+ lines.push(` --shadow-${name}: ${value};`)
+ }
lines.push('}')
if (includeBaseLayer) {
diff --git a/packages/quill/packages/tokens/src/shadow.ts b/packages/quill/packages/tokens/src/shadow.ts
index 2be1ed84f438..f19c19b9c2c5 100644
--- a/packages/quill/packages/tokens/src/shadow.ts
+++ b/packages/quill/packages/tokens/src/shadow.ts
@@ -5,9 +5,10 @@
import { cssVars } from './css'
export const shadow = {
- sm: '0 1px 2px 0 rgba(0, 0, 0, 0.3)',
- md: '0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3)',
- lg: '0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3)',
+ sm: '0 2px 0 color-mix(in oklab, var(--border), transparent 10%)',
+ md: '0 3px 0 color-mix(in oklab, var(--border), transparent 10%)',
+ lg: '0 6px 0 color-mix(in oklab, var(--border), transparent 10%)',
+ line: '0 -1px 0px 0px color-mix(in oklab, var(--border), transparent 10%)'
} as const
export type Shadow = typeof shadow
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 15f9f4cc3dc8..11ede7bcac72 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -275,7 +275,7 @@ importers:
version: 3.12.1
jest:
specifier: 'catalog:'
oxfmt:
specifier: 'catalog:'
version: 0.35.0
@@ -461,10 +461,10 @@ importers:
'@storybook/react-webpack5':
specifier: ^7.6.4
'@storybook/test-runner':
specifier: ^0.16.0
- version: 0.16.0(@types/[email protected])([email protected])
'@storybook/theming':
specifier: ^7.6.4
@@ -515,7 +515,7 @@ importers:
version: 2.0.0([email protected])
webpack:
specifier: ^5.88.2
- version: 5.88.2(@swc/[email protected])([email protected])
webpack-cli:
specifier: ^5.1.4
version: 5.1.4([email protected])
@@ -1313,7 +1313,7 @@ importers:
version: 29.7.0
jest-image-snapshot:
specifier: ^6.1.0
- version: 6.4.0([email protected](@types/[email protected]))
kea-typegen:
specifier: 3.6.2-leakfix.5
version: 3.6.2-leakfix.5([email protected])
@@ -1760,6 +1760,9 @@ importers:
packages/quill:
devDependencies:
+ tailwindcss-scroll-mask:
+ specifier: ^0.0.3
+ version: 0.0.3([email protected])
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -1802,7 +1805,10 @@ importers:
'@storybook/test-runner':
specifier: ^0.16.0
- version: 0.16.0(@types/[email protected])([email protected])
+ '@storybook/theming':
+ specifier: ^7.6.20
'@tailwindcss/vite':
specifier: ^4.1.17
@@ -1817,16 +1823,19 @@ importers:
version: 18.3.7(@types/[email protected])
'@vitejs/plugin-react':
specifier: ^4.3.4
jest-image-snapshot:
specifier: ^6.4.0
- version: 6.4.0([email protected](@types/[email protected]))
storybook:
specifier: ^7.6.4
version: 7.6.4([email protected])
storybook-addon-pseudo-states:
specifier: 2.1.2
+ storybook-dark-mode:
+ specifier: 3.0.3
typescript:
specifier: 5.9.3
version: 5.9.3
@@ -1913,9 +1922,6 @@ importers:
clsx:
specifier: ^2.1.1
version: 2.1.1
- cmdk:
- specifier: ^1.1.1
lucide-react:
specifier: ^0.577.0
version: 0.577.0([email protected])
@@ -1965,9 +1971,6 @@ importers:
clsx:
specifier: ^2.1.1
version: 2.1.1
- cmdk:
- specifier: ^1.1.1
lucide-react:
specifier: ^0.577.0
version: 0.577.0([email protected])
@@ -3460,7 +3463,7 @@ importers:
version: 18.3.7(@types/[email protected])
'@vitejs/plugin-react':
specifier: ^4.3.4
ajv:
specifier: ^8.17.1
version: 8.17.1
@@ -9093,19 +9096,6 @@ packages:
'@types/react':
optional: true
- '@radix-ui/[email protected]':
- resolution: {integrity: sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==}
- peerDependencies:
- '@types/react': 18.3.27
- '@types/react-dom': 18.3.7
- react: 18.3.1
- react-dom: 18.3.1
- peerDependenciesMeta:
- '@types/react':
- optional: true
- '@types/react-dom':
- optional: true
-
'@radix-ui/[email protected]':
resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==}
peerDependencies:
@@ -14019,12 +14009,6 @@ packages:
resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==}
engines: {node: '>=0.10.0'}
- resolution: {integrity: sha512-Vsv7kFaXm+ptHDMZ7izaRsP70GgrW9NBNGswt9OZaVBLlE0SNpDq8eu/VGXyF9r7M0azK3Wy7OlYXsuyYLFzHg==}
- peerDependencies:
- react: 18.3.1
- react-dom: 18.3.1
-
resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==}
engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
@@ -21686,6 +21670,17 @@ packages:
react-dom:
optional: true
+ resolution: {integrity: sha512-ZLBLVpkuKTdtUv3DTuOjeP/bE7DHhOxVpDROKc0NtEYq9JHLUu6z05LLZinE3v6QPXQZ9TMQPm3Xe/0BcLEZlw==}
+ peerDependencies:
+ react: 18.3.1
+ react-dom: 18.3.1
+ peerDependenciesMeta:
+ react:
+ optional: true
+ react-dom:
+ optional: true
+
resolution: {integrity: sha512-nQhs9XkrroxjqMoBnnToyc6M8ndbmpkOb1qmULO4chtfMy4k0p9Un3K4TJvDaP8c3wPUFGd4ZaJ1hZNVmIl56Q==}
hasBin: true
@@ -22019,6 +22014,11 @@ packages:
resolution: {integrity: sha512-tWANXsnmJzgw6mQ07nE3aCDkCK4QdT3ThPMCzawoYA2Pws7vSTCvz3Vrjg61jVUGfFZPJzxEP+NimbcW+EdaDw==}
+ resolution: {integrity: sha512-vPuacFs5yHJRZ8MFP/qqKKRbnWlVDPAJ5VfRzOwrmtEJQ4pHm5K1xw/dXdF4v6Sx1QdbtCWJuGs9ucSTc+YanQ==}
+ peerDependencies:
+ tailwindcss: ^4
+
resolution: {integrity: sha512-bT0hJo91FtncsAMSsMzUkoo/iEU0Xs5xgFgVC9XmdM9bw5MhZuQFjPNl6wxAE0SiQF/YTZJa+PndGWYSDtuxAg==}
@@ -29069,6 +29069,41 @@ snapshots:
- ts-node
- utf-8-validate
+ dependencies:
+ '@jest/console': 29.7.0
+ '@jest/reporters': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 22.18.8
+ ansi-escapes: 4.3.2
+ chalk: 4.1.2
+ ci-info: 3.8.0
+ exit: 0.1.2
+ graceful-fs: 4.2.11
+ jest-changed-files: 29.7.0
+ jest-haste-map: 29.7.0
+ jest-message-util: 29.7.0
+ jest-regex-util: 29.6.3
+ jest-resolve: 29.7.0
+ jest-resolve-dependencies: 29.7.0
+ jest-runner: 29.7.0
+ jest-runtime: 29.7.0
+ jest-snapshot: 29.7.0
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ jest-watcher: 29.7.0
+ micromatch: 4.0.8
+ pretty-format: 29.7.0
+ slash: 3.0.0
+ strip-ansi: 6.0.1
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+
dependencies:
'@jest/console': 29.7.0
@@ -31743,7 +31778,7 @@ snapshots:
react-refresh: 0.14.0
schema-utils: 3.3.0
source-map: 0.7.6
- webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
type-fest: 4.41.0
webpack-hot-middleware: 2.25.4
@@ -32027,28 +32062,6 @@ snapshots:
optionalDependencies:
'@types/react': 18.3.27
- dependencies:
- '@radix-ui/primitive': 1.1.3
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-context': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-dismissable-layer': 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
- '@radix-ui/react-focus-guards': 1.1.3(@types/[email protected])([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- '@radix-ui/react-slot': 1.2.3(@types/[email protected])([email protected])
- '@radix-ui/react-use-controllable-state': 1.2.2(@types/[email protected])([email protected])
- aria-hidden: 1.2.4
- react: 18.3.1
- react-dom: 18.3.1([email protected])
- react-remove-scroll: 2.6.3(@types/[email protected])([email protected])
- optionalDependencies:
- '@types/react': 18.3.27
- '@types/react-dom': 18.3.7(@types/[email protected])
-
dependencies:
'@babel/runtime': 7.29.2
@@ -33779,7 +33792,7 @@ snapshots:
- encoding
- supports-color
dependencies:
'@babel/core': 7.29.0
'@storybook/channels': 7.6.4
@@ -33809,12 +33822,12 @@ snapshots:
semver: 7.7.4
style-loader: 3.3.3([email protected])
swc-loader: 0.2.3(@swc/[email protected])([email protected])
- terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])
+ terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])([email protected])
ts-dedent: 2.2.0
url: 0.11.1
util: 0.12.5
util-deprecate: 1.0.2
- webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-dev-middleware: 6.1.1([email protected])
webpack-hot-middleware: 2.25.4
webpack-virtual-modules: 0.5.0
@@ -33885,7 +33898,7 @@ snapshots:
get-port: 5.1.1
giget: 1.1.2
globby: 11.1.0
- jscodeshift: 0.15.1(@babel/[email protected](@babel/[email protected]))
+ jscodeshift: 0.15.1(@babel/[email protected](@babel/[email protected]))
leven: 3.1.0
ora: 5.4.1
prettier: 2.8.8
@@ -33928,7 +33941,7 @@ snapshots:
'@types/cross-spawn': 6.0.2
cross-spawn: 7.0.6
globby: 11.1.0
- jscodeshift: 0.15.1(@babel/[email protected](@babel/[email protected]))
+ jscodeshift: 0.15.1(@babel/[email protected](@babel/[email protected]))
lodash: 4.18.1
prettier: 2.8.8
recast: 0.23.11
@@ -34220,7 +34233,7 @@ snapshots:
'@storybook/[email protected]': {}
dependencies:
'@babel/preset-flow': 7.23.3(@babel/[email protected])
'@babel/preset-react': 7.23.3(@babel/[email protected])
@@ -34240,7 +34253,7 @@ snapshots:
react-dom: 18.3.1([email protected])
react-refresh: 0.14.0
semver: 7.7.4
- webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
'@babel/core': 7.26.0
typescript: 5.9.3
@@ -34323,7 +34336,7 @@ snapshots:
react-docgen-typescript: 2.2.2([email protected])
tslib: 2.8.1
typescript: 5.9.3
- webpack: 5.88.2(@swc/[email protected])([email protected])
transitivePeerDependencies:
- supports-color
@@ -34357,10 +34370,10 @@ snapshots:
- typescript
- vite-plugin-glimmerx
dependencies:
- '@storybook/builder-webpack5': 7.6.4([email protected])([email protected])([email protected])
'@types/node': 18.19.130
react: 18.3.1
@@ -34479,7 +34492,7 @@ snapshots:
- encoding
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/generator': 7.29.1
@@ -34500,10 +34513,10 @@ snapshots:
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-junit: 16.0.0
jest-runner: 29.7.0
jest-serializer-html: 7.1.0
- jest-watch-typeahead: 2.2.2([email protected])
node-fetch: 2.7.0([email protected])
playwright: 1.45.0
read-pkg-up: 7.0.1
@@ -36539,7 +36552,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
'@babel/core': 7.29.0
'@babel/plugin-transform-react-jsx-self': 7.27.1(@babel/[email protected])
@@ -36819,17 +36832,17 @@ snapshots:
dependencies:
- webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
dependencies:
- webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
dependencies:
- webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-cli: 5.1.4([email protected])
'@xmldom/[email protected]': {}
@@ -37436,14 +37449,14 @@ snapshots:
loader-utils: 2.0.4
make-dir: 3.1.0
schema-utils: 2.7.1
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
'@babel/core': 7.29.0
find-cache-dir: 4.0.0
schema-utils: 4.2.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -38251,18 +38264,6 @@ snapshots:
- dependencies:
- '@radix-ui/react-compose-refs': 1.1.2(@types/[email protected])([email protected])
- '@radix-ui/react-id': 1.1.1(@types/[email protected])([email protected])
- react: 18.3.1
- react-dom: 18.3.1([email protected])
- transitivePeerDependencies:
- - '@types/react'
- - '@types/react-dom'
-
@@ -38517,6 +38518,21 @@ snapshots:
safe-buffer: 5.2.1
sha.js: 2.4.12
+ dependencies:
+ '@jest/types': 29.6.3
+ chalk: 4.1.2
+ exit: 0.1.2
+ graceful-fs: 4.2.11
+ jest-util: 29.7.0
+ prompts: 2.4.2
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+
dependencies:
'@jest/types': 29.6.3
@@ -38629,7 +38645,7 @@ snapshots:
postcss-value-parser: 4.2.0
schema-utils: 2.7.1
semver: 6.3.1
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -38641,7 +38657,7 @@ snapshots:
postcss-modules-values: 4.0.0([email protected])
postcss-value-parser: 4.2.0
semver: 7.7.4
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -40340,7 +40356,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -40484,7 +40500,7 @@ snapshots:
semver: 7.7.4
tapable: 2.3.0
typescript: 5.9.3
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -41159,7 +41175,7 @@ snapshots:
dependencies:
html-webpack-plugin: 5.5.3([email protected])
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -41168,7 +41184,7 @@ snapshots:
lodash: 4.17.21
pretty-error: 4.0.0
tapable: 2.2.1
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -41939,6 +41955,25 @@ snapshots:
- ts-node
- utf-8-validate
+ dependencies:
+ '@jest/test-result': 29.7.0
+ '@jest/types': 29.6.3
+ chalk: 4.1.2
+ exit: 0.1.2
+ import-local: 3.2.0
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ yargs: 17.7.2
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+
dependencies:
@@ -42011,6 +42046,37 @@ snapshots:
- supports-color
- utf-8-validate
+ dependencies:
+ '@babel/core': 7.29.0
+ '@jest/test-sequencer': 29.7.0
+ '@jest/types': 29.6.3
+ babel-jest: 29.7.0(@babel/[email protected])
+ chalk: 4.1.2
+ ci-info: 3.8.0
+ deepmerge: 4.3.1
+ glob: 7.2.3
+ graceful-fs: 4.2.11
+ jest-circus: 29.7.0
+ jest-environment-node: 29.7.0
+ jest-get-type: 29.6.3
+ jest-regex-util: 29.6.3
+ jest-resolve: 29.7.0
+ jest-runner: 29.7.0
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ micromatch: 4.0.8
+ parse-json: 5.2.0
+ pretty-format: 29.7.0
+ slash: 3.0.0
+ strip-json-comments: 3.1.1
+ optionalDependencies:
+ '@types/node': 22.18.8
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - supports-color
+
dependencies:
'@babel/core': 7.29.0
@@ -42261,7 +42327,7 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
dependencies:
chalk: 4.1.2
get-stdin: 5.0.1
@@ -42418,7 +42484,7 @@ snapshots:
'@types/node': 22.18.8
jest-util: 30.0.5
dependencies:
expect-playwright: 0.8.0
@@ -42841,7 +42907,7 @@ snapshots:
leven: 3.1.0
pretty-format: 30.0.5
dependencies:
ansi-escapes: 6.0.0
chalk: 5.6.2
@@ -42917,6 +42983,18 @@ snapshots:
- ts-node
- utf-8-validate
+ dependencies:
+ '@jest/types': 29.6.3
+ import-local: 3.2.0
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+
dependencies:
@@ -42987,7 +43065,7 @@ snapshots:
dependencies:
'@babel/core': 7.29.0
'@babel/parser': 7.29.2
@@ -43010,7 +43088,7 @@ snapshots:
temp: 0.8.4
write-file-atomic: 2.4.3
optionalDependencies:
- '@babel/preset-env': 7.23.5(@babel/[email protected])
+ '@babel/preset-env': 7.23.5(@babel/[email protected])
transitivePeerDependencies:
- supports-color
@@ -43278,7 +43356,7 @@ snapshots:
less: 4.2.2
loader-utils: 2.0.4
schema-utils: 3.3.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -45755,7 +45833,7 @@ snapshots:
postcss: 8.5.6
schema-utils: 3.3.0
semver: 7.7.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -46724,7 +46802,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -47844,7 +47922,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
semver: 7.7.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
sass: 1.56.0
@@ -48327,6 +48405,23 @@ snapshots:
react: 18.3.1
react-dom: 18.3.1([email protected])
+ dependencies:
+ '@storybook/core-events': 7.6.24
+ '@storybook/global': 5.0.0
+ '@storybook/manager-api': 7.6.20([email protected]([email protected]))([email protected])
+ '@storybook/theming': 7.6.20([email protected]([email protected]))([email protected])
+ fast-deep-equal: 3.1.3
+ memoizerific: 1.11.3
+ optionalDependencies:
+ react: 18.3.1
+ react-dom: 18.3.1([email protected])
+ transitivePeerDependencies:
+ - '@types/react'
+ - '@types/react-dom'
+
dependencies:
'@storybook/cli': 7.6.4([email protected])
@@ -48525,11 +48620,11 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
- webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -48733,7 +48828,7 @@ snapshots:
dependencies:
'@swc/core': 1.15.18
- webpack: 5.88.2(@swc/[email protected])([email protected])
@@ -48783,6 +48878,10 @@ snapshots:
dependencies:
'@babel/runtime': 7.28.6
+ dependencies:
+ tailwindcss: 4.2.2
+
@@ -48921,16 +49020,17 @@ snapshots:
'@swc/core': 1.15.18
esbuild: 0.27.3
dependencies:
'@jridgewell/trace-mapping': 0.3.29
jest-worker: 27.5.1
schema-utils: 3.3.0
serialize-javascript: 6.0.1
terser: 5.19.1
- webpack: 5.88.2(@swc/[email protected])([email protected])
optionalDependencies:
'@swc/core': 1.15.18
+ esbuild: 0.18.20
dependencies:
@@ -49168,6 +49268,27 @@ snapshots:
tslib: 2.8.1
typescript: 5.9.3
+ dependencies:
+ '@cspotcode/source-map-support': 0.8.1
+ '@tsconfig/node10': 1.0.9
+ '@tsconfig/node12': 1.0.11
+ '@tsconfig/node14': 1.0.3
+ '@tsconfig/node16': 1.0.3
+ '@types/node': 22.18.8
+ acorn: 8.15.0
+ acorn-walk: 8.3.2
+ arg: 4.1.3
+ create-require: 1.1.1
+ diff: 4.0.2
+ make-error: 1.3.6
+ typescript: 5.9.3
+ v8-compile-cache-lib: 3.0.1
+ yn: 3.1.1
+ optionalDependencies:
+ '@swc/core': 1.11.4
+ optional: true
+
dependencies:
'@cspotcode/source-map-support': 0.8.1
@@ -50016,7 +50137,7 @@ snapshots:
import-local: 3.1.0
interpret: 3.1.1
rechoir: 0.8.0
- webpack: 5.88.2(@swc/[email protected])([email protected])
webpack-merge: 5.8.0
@@ -50027,7 +50148,7 @@ snapshots:
range-parser: 1.2.1
schema-utils: 4.2.0
optionalDependencies:
- webpack: 5.88.2(@swc/[email protected])([email protected])
dependencies:
@@ -50078,7 +50199,7 @@ snapshots:
- esbuild
- uglify-js
dependencies:
'@types/eslint-scope': 3.7.4
'@types/estree': 1.0.1
@@ -50101,7 +50222,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
- terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])
+ terser-webpack-plugin: 5.3.9(@swc/[email protected])([email protected])([email protected])
watchpack: 2.4.0
webpack-sources: 3.2.3
optionalDependencies: