Skip to content

Commit f8ebba9

Browse files
committed
chore(Stack): update to 5.0.0
1 parent 0945247 commit f8ebba9

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/Modal/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import ModalLegacy from './ModalLegacy'
1212
export type ModalProps = React.DialogHTMLAttributes<HTMLDialogElement> &
1313
IComponentBaseProps & {
1414
open?: boolean
15-
position?: Exclude<ComponentPosition, 'left' | 'right'> | 'start' | 'end'
15+
position?: Exclude<ComponentPosition, 'left' | 'right'>
1616
responsive?: boolean
1717
backdrop?: boolean
1818
ariaHidden?: boolean

src/Stack/Stack.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
import React, { forwardRef } from 'react'
2+
import clsx from 'clsx'
23
import { twMerge } from 'tailwind-merge'
34

4-
import { IComponentBaseProps } from '../types'
5+
import { IComponentBaseProps, ComponentPosition } from '../types'
56

67
export type StackProps = React.HTMLAttributes<HTMLDivElement> &
7-
IComponentBaseProps
8+
IComponentBaseProps & {
9+
position?: Exclude<ComponentPosition, 'left' | 'right' | 'middle'>
10+
}
811

912
const Stack = forwardRef<HTMLDivElement, StackProps>(
10-
({ dataTheme, className, children, ...props }, ref): JSX.Element => {
11-
const classes = twMerge('stack', className)
13+
(
14+
{ position = 'bottom', dataTheme, className, children, ...props },
15+
ref
16+
): JSX.Element => {
17+
const classes = twMerge(
18+
'stack',
19+
className,
20+
clsx({
21+
'stack-end': position === 'end',
22+
'stack-start': position === 'start',
23+
'stack-top': position === 'top',
24+
'stack-bottom': position === 'bottom',
25+
})
26+
)
1227

1328
return (
1429
<div

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const componentLayouts = ['vertical', 'horizontal'] as const
2-
export const componentPositions = ['top', 'bottom', 'left', 'right'] as const
2+
export const componentPositions = ['top', 'bottom', 'left', 'right', 'start', 'end'] as const
33
export const componentShapes = ['circle', 'square'] as const
44
export const componentSizes = ['xl', 'lg', 'md', 'sm', 'xs'] as const
55
export const componentStatuses = [

0 commit comments

Comments
 (0)