File tree Expand file tree Collapse file tree 3 files changed +53
-7
lines changed
packages/kit-headless/src/components/dialog Expand file tree Collapse file tree 3 files changed +53
-7
lines changed Original file line number Diff line number Diff line change 1+ import { Slot , component$ , useStyles$ } from '@builder.io/qwik' ;
2+
3+ export const Actions = component$ ( ( ) => {
4+ useStyles$ ( `
5+ .dialog-actions {
6+ position: sticky;
7+ bottom: 0;
8+ }
9+ ` ) ;
10+
11+ return (
12+ < div class = "dialog-actions" >
13+ < Slot />
14+ </ div >
15+ ) ;
16+ } ) ;
Original file line number Diff line number Diff line change @@ -5,13 +5,6 @@ import * as Dialog from './public_api';
55
66const meta : Meta = {
77 component : Dialog . Root ,
8- } ;
9-
10- type Story = StoryObj ;
11-
12- export default meta ;
13-
14- export const Primary : Story = {
158 args : {
169 dialogTrigger : {
1710 text : 'Open Dialog' ,
@@ -38,6 +31,13 @@ export const Primary: Story = {
3831 </ Dialog . Root >
3932 </ >
4033 ) ,
34+ } ;
35+
36+ type Story = StoryObj ;
37+
38+ export default meta ;
39+
40+ export const Primary : Story = {
4141 play : ( { canvasElement, args } ) => {
4242 /**
4343 *
@@ -54,3 +54,32 @@ export const Primary: Story = {
5454 userEvent . click ( canvas . getByText ( args . dialogClose . text ) ) ;
5555 } ,
5656} ;
57+
58+ export const ScrollingLongContent : Story = {
59+ args : {
60+ ...Primary . args ,
61+ dialogPortal : {
62+ text : Array ( 500 )
63+ . fill ( null )
64+ . map ( ( ) => 'Hello World' )
65+ . join ( ' ' ) ,
66+ } ,
67+ } ,
68+ render : ( args ) => (
69+ < >
70+ < Dialog . Root >
71+ < Dialog . Trigger >
72+ < button > { args . dialogTrigger . text } </ button >
73+ </ Dialog . Trigger >
74+ < Dialog . Portal >
75+ { args . dialogPortal . text }
76+ < Dialog . Actions >
77+ < Dialog . Close >
78+ < button > { args . dialogClose . text } </ button >
79+ </ Dialog . Close >
80+ </ Dialog . Actions >
81+ </ Dialog . Portal >
82+ </ Dialog . Root >
83+ </ >
84+ ) ,
85+ } ;
Original file line number Diff line number Diff line change 1+ export * from './dialog.actions' ;
12export * from './dialog.close' ;
23export * from './dialog.context' ;
34export * from './dialog.portal' ;
You can’t perform that action at this time.
0 commit comments