Skip to content

Commit

Permalink
refactor: modal radix components
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrozagar committed Aug 30, 2024
1 parent 8dabdc2 commit c357d12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@renderui/core",
"version": "1.6.7",
"version": "1.6.8",
"private": false,
"sideEffects": false,
"description": "React UI library with highly modular and ready-out-of-the-box components",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Text } from '@/components/text/components/text'
import type { TextProps } from '@/components/text/types/text'
import { cx } from '@renderui/utils'

const ModalDescription = (props: TextProps) => {
const { className, size = 'sm', ...restProps } = props
import { DialogTitle } from '@radix-ui/react-dialog'
import type { ComponentPropsWithRef } from 'react'

const ModalDescription = (props: ComponentPropsWithRef<typeof DialogTitle>) => {
const { className, ...restProps } = props

return (
<Text
<DialogTitle
data-slot='description'
size={size}
className={cx('render-ui-modal-description text-muted', className)}
className={cx('render-ui-modal-description text-muted text-sm', className)}
{...restProps}
/>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Grid } from '@/components/grid/components/grid'
import type { GridProps } from '@/components/grid/types/grid'
import { cx } from '@renderui/utils'

const ModalHeader = (props: GridProps) => {
const { className, ...restProps } = props

return (
<Grid
<header
data-slot='header'
className={cx('render-ui-modal-header gap-0.5 pb-4', className)}
className={cx('render-ui-modal-header grid gap-0.5 pb-4', className)}
{...restProps}
/>
)
Expand Down
10 changes: 4 additions & 6 deletions src/components/_shared/components/modal-title/modal-title.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { cx } from '@renderui/utils'
import React, { type ComponentProps } from 'react'
import type { ComponentPropsWithRef } from 'react'

import { DialogTitle } from '@radix-ui/react-dialog'

const ModalTitle = (props: ComponentProps<typeof DialogTitle>) => {
const { ref, className, color = 'mode-contrast', ...restProps } = props
const ModalTitle = (props: ComponentPropsWithRef<typeof DialogTitle>) => {
const { className, ...restProps } = props

return (
<DialogTitle
ref={ref}
color={color}
data-slot='title'
className={cx('render-ui-modal-title font-semibold', className)}
className={cx('render-ui-modal-title font-semibold text-mode-contrast', className)}
{...restProps}
/>
)
Expand Down

0 comments on commit c357d12

Please sign in to comment.