diff --git a/.changeset/weak-dogs-promise.md b/.changeset/weak-dogs-promise.md new file mode 100644 index 0000000..1b2a5e6 --- /dev/null +++ b/.changeset/weak-dogs-promise.md @@ -0,0 +1,5 @@ +--- +"@codeui/kit": patch +--- + +Dialog improve styles diff --git a/packages/kit/src/components/Dialog/Dialog.css.ts b/packages/kit/src/components/Dialog/Dialog.css.ts index 1453f3b..c6bcaaf 100644 --- a/packages/kit/src/components/Dialog/Dialog.css.ts +++ b/packages/kit/src/components/Dialog/Dialog.css.ts @@ -11,6 +11,7 @@ export const [dialogTheme, dialogThemeVars] = createTheme({ contentBoxShadow: tokens.dialogBoxShadow, contentTextColor: tokens.dialogTextColor, contentPadding: themeTokens.spacing["6"], + titleHeight: "56px", panelRadius: themeTokens.radii.lg, dividerColor: tokens.separator, titleFontSize: themeTokens.fontSize.lg, @@ -55,9 +56,9 @@ export const overlay = style([ export const panelContent = style([ { padding: `${dialogThemeVars.contentPadding}`, + overflow: "auto", selectors: { - "[data-full-screen=true] &": { - overflow: "auto", + "[data-panel-size=full] &": { flex: 1, }, }, @@ -67,7 +68,7 @@ export const panelContent = style([ export const panelFooter = style({ padding: `${dialogThemeVars.contentPadding}`, selectors: { - "[data-full-screen=true] &": { + "[data-panel-size=full] &": { marginTop: "auto", marginBottom: "env(safe-area-inset-bottom, 20px)", }, @@ -82,12 +83,14 @@ export const positioner = style({ display: "flex", alignItems: "center", justifyContent: "center", + paddingTop: themeTokens.spacing['2'], + paddingBottom: themeTokens.spacing['2'] }); export const title = style([ { color: dialogThemeVars.contentTextColor, - height: "52px", + height: dialogThemeVars.titleHeight, borderBottom: `1px solid ${dialogThemeVars.dividerColor}`, padding: `0 ${dialogThemeVars.contentPadding}`, display: "flex", @@ -95,6 +98,7 @@ export const title = style([ fontSize: dialogThemeVars.titleFontSize, fontWeight: themeTokens.fontWeight.medium, justifyContent: "space-between", + flexShrink: 0 }, ]); @@ -104,6 +108,7 @@ export const panel = recipe({ display: "inline-flex", flexDirection: "column", width: "100%", + height: "100%", padding: 0, overflow: "hidden", textAlign: "left", diff --git a/packages/kit/src/components/Dialog/Dialog.tsx b/packages/kit/src/components/Dialog/Dialog.tsx index 3c340ef..a013890 100644 --- a/packages/kit/src/components/Dialog/Dialog.tsx +++ b/packages/kit/src/components/Dialog/Dialog.tsx @@ -11,11 +11,11 @@ export type DialogProps = KDialog.DialogRootOptions & }; export function DialogPanelContent(props: ParentProps): JSXElement { - return
{props.children}
; + return
{props.children}
; } export function DialogPanelFooter(props: ParentProps): JSXElement { - return
{props.children}
; + return
{props.children}
; } type DialogPanelProps = styles.DialogPanelVariants & @@ -37,13 +37,13 @@ export function DialogPanel(props: ParentProps): JSXElement { export function Dialog(props: ParentProps) { const [local, others] = splitProps(props, ["size", "children", "title"]); return ( - + -
+
-
+
{props.title} @@ -47,6 +49,70 @@ export default function DialogDemo() { )} + +

Oveflow content

+ + + + + setDialogState('mdOverflow', value)} + > + + {new Array(20).fill("").map(value => { + return ( +

+ + Kobalte is a UI toolkit for building accessible web apps and design + systems with SolidJS. It provides a set of low-level UI components and + primitives which can be the foundation for your design system + implementation. + +

+ ) + })} +
+ + + + +
+ + + setDialogState('fullOverflow', value)} + > + + {new Array(100).fill("").map(value => { + return ( +

+ + Kobalte is a UI toolkit for building accessible web apps and design + systems with SolidJS. It provides a set of low-level UI components and + primitives which can be the foundation for your design system + implementation. + +

+ ) + })} +
+ + + + +
+ +
); }