Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bd94618
Add Dialog 4-layer component spec
lukasoppermann Apr 27, 2026
e3e8fdf
Move Dialog spec to experimental/Dialog/Dialog.spec.md
lukasoppermann Apr 27, 2026
696c70c
Update spec to prop-getters (L3), add architecture decisions file
lukasoppermann Apr 27, 2026
b658628
Implement 4-layer Dialog: hooks, foundation, parts, exports
lukasoppermann Apr 27, 2026
741f7f0
Fix: merge forwardRef in Dialog.Root, guard native close event
lukasoppermann Apr 27, 2026
8009b18
Fix CloseButton TypeScript error, simplify props interface
lukasoppermann Apr 27, 2026
4856197
Add tests for useScrollLock and useDialogFoundation
lukasoppermann Apr 27, 2026
1dcab8f
Add Layer 1 ReadyMadeDialog and Storybook stories for all layers
lukasoppermann Apr 27, 2026
87742f1
Fix dialog shadow clipping by setting overflow: visible on Root
lukasoppermann Apr 27, 2026
442b695
Fix backdrop color: use :where() in foundation reset for zero specifi…
lukasoppermann Apr 27, 2026
2403fe2
Rename: ReadyMadeDialog → Dialog, Dialog → DialogParts
lukasoppermann Apr 27, 2026
220512d
Fix sheet positioning: override native dialog centering for left/right
lukasoppermann Apr 27, 2026
8cf7677
Move architecture decisions to ADR-024
lukasoppermann Apr 27, 2026
3aaee1f
chore: auto-fix lint and formatting issues
lukasoppermann Apr 27, 2026
cb24f6c
Add data-component stable selectors to Dialog (ADR-023)
lukasoppermann Apr 27, 2026
6c8e98e
chore: auto-fix lint and formatting issues
lukasoppermann Apr 27, 2026
aecd3f2
Add hook inspector stories for useDialogFoundation
joshfarrant Apr 29, 2026
413409f
Fix previousFocusRef placement, move tests alongside hook
joshfarrant Apr 29, 2026
4be8dd7
Add missing tests for useDialogFoundation
joshfarrant Apr 29, 2026
8b1a340
Update ADR-024: Layer 3 unstyled components, a11y contract, open ques…
joshfarrant Apr 30, 2026
26e532f
ADR-024: flat exports decision, L1 not mandatory, update examples
joshfarrant Apr 30, 2026
a5e5b64
update and tweak formatting
joshfarrant Apr 30, 2026
8964d48
chore: auto-fix lint and formatting issues
joshfarrant Apr 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
348 changes: 348 additions & 0 deletions contributor-docs/adrs/adr-024-modular-component-architecture.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
"types": "./dist/utils/test-helpers.d.ts",
"default": "./dist/test-helpers.js"
},
"./foundations/experimental": {
"types": "./dist/foundations/experimental/index.d.ts",
"default": "./dist/foundations/experimental/index.js"
},
"./hooks/experimental": {
"types": "./dist/hooks/experimental/index.d.ts",
"default": "./dist/hooks/experimental/index.js"
},
"./generated/components.json": "./generated/components.json",
"./generated/hooks.json": "./generated/hooks.json"
},
Expand Down
231 changes: 231 additions & 0 deletions packages/react/src/experimental/Dialog/Dialog.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
/* Layer 2: Parts — Primer-styled Dialog */

@keyframes dialog-backdrop-appear {
0% {
opacity: 0;
}

100% {
opacity: 1;
}
}

@keyframes dialog-content-scaleFade {
0% {
opacity: 0;
transform: scale(0.5);
}

100% {
opacity: 1;
transform: scale(1);
}
}

@keyframes dialog-content-slideUp {
from {
transform: translateY(100%);
}
}

@keyframes dialog-content-slideInRight {
from {
transform: translateX(-100%);
}
}

@keyframes dialog-content-slideInLeft {
from {
transform: translateX(100%);
}
}

/* --- Root (native <dialog>) --- */

.Root {
border: none;
padding: 0;
background: transparent;
max-width: unset;
max-height: unset;
overflow: visible;
color: inherit;

/* Sheet positions: override native <dialog> centering (margin: auto) */
&:has(> [data-component='Dialog.Content'][data-position-regular='right']) {
margin-right: 0;
}

&:has(> [data-component='Dialog.Content'][data-position-regular='left']) {
margin-left: 0;
}

&::backdrop {
background-color: var(--overlay-backdrop-bgColor);
animation: dialog-backdrop-appear 200ms cubic-bezier(0.33, 1, 0.68, 1);
}
}

/* --- Content --- */

.Content {
display: flex;
/* stylelint-disable-next-line primer/responsive-widths */
width: 640px;
min-width: 296px;
max-width: calc(100dvw - 64px);
height: auto;
max-height: calc(100dvh - 64px);
flex-direction: column;
background-color: var(--overlay-bgColor);
border-radius: var(--borderRadius-large);
box-shadow: var(--shadow-floating-small);
opacity: 1;

&:where([data-width='small']) {
width: 296px;
}

&:where([data-width='medium']) {
width: 320px;
}

&:where([data-width='large']) {
/* stylelint-disable-next-line primer/responsive-widths */
width: 480px;
}

&:where([data-height='small']) {
height: 480px;
}

&:where([data-height='large']) {
height: 640px;
}

@media screen and (prefers-reduced-motion: no-preference) {
animation: dialog-content-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;
}

&[data-position-regular='left'] {
height: 100dvh;
max-height: unset;
border-top-left-radius: 0;
border-bottom-left-radius: 0;

@media screen and (prefers-reduced-motion: no-preference) {
animation: dialog-content-slideInRight 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;
}
}

&[data-position-regular='right'] {
height: 100dvh;
max-height: unset;
border-top-right-radius: 0;
border-bottom-right-radius: 0;

@media screen and (prefers-reduced-motion: no-preference) {
animation: dialog-content-slideInLeft 0.25s cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running;
}
}

&[data-position-regular='center'] {
&[data-align='top'] {
margin-top: var(--base-size-64);
}

&[data-align='bottom'] {
margin-bottom: var(--base-size-64);
}
}

@media (max-width: 767px) {
&[data-position-narrow='bottom'] {
width: 100dvw;
max-width: 100dvw;
height: auto;
max-height: calc(100dvh - 64px);
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;

@media screen and (prefers-reduced-motion: no-preference) {
animation: dialog-content-slideUp 0.25s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;
}
}

&[data-position-narrow='fullscreen'] {
width: 100%;
max-width: 100dvw;
height: 100%;
max-height: 100dvh;
border-radius: unset !important;
flex-grow: 1;

@media screen and (prefers-reduced-motion: no-preference) {
animation: dialog-content-scaleFade 0.2s cubic-bezier(0.33, 1, 0.68, 1) 1ms 1 normal none running;
}
}
}
}

/* --- Header --- */

.Header {
z-index: 1;
display: flex;
max-height: 35vh;
padding: var(--base-size-8);
overflow-y: auto;
/* stylelint-disable-next-line primer/box-shadow */
box-shadow: 0 1px 0 var(--borderColor-default);
flex-shrink: 0;
}

/* --- Title --- */

.Title {
margin: 0;
padding-inline: var(--base-size-8);
padding-block: var(--base-size-6);
font-size: var(--text-body-size-medium);
font-weight: var(--text-title-weight-large);
flex-grow: 1;
}

/* --- Subtitle --- */

.Subtitle {
margin: 0;
margin-top: var(--base-size-4);
padding-inline: var(--base-size-8);
font-size: var(--text-body-size-small);
font-weight: var(--base-text-weight-normal);
color: var(--fgColor-muted);
}

/* --- Body --- */

.Body {
padding: var(--base-size-16);
overflow: auto;
flex-grow: 1;
}

/* --- Footer --- */

.Footer {
z-index: 1;
display: flex;
flex-flow: wrap;
justify-content: flex-end;
padding: var(--base-size-16);
gap: var(--base-size-8);
flex-shrink: 0;

@media (max-height: 325px) {
flex-wrap: nowrap;
overflow-x: scroll;
flex-direction: row;
justify-content: unset;
}
}
Loading
Loading