Skip to content

Commit ec2208a

Browse files
committed
chore: add mods type
1 parent 8b2abc8 commit ec2208a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/components/content/Layout/LayoutContent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
filterBaseProps,
99
INNER_STYLES,
1010
mergeStyles,
11+
Mods,
1112
OUTER_STYLES,
1213
tasty,
1314
} from '../../../tasty';
@@ -90,7 +91,7 @@ export interface CubeLayoutContentProps extends BaseProps, ContainerStyleProps {
9091
scrollbar?: ScrollbarType;
9192
children?: ReactNode;
9293
/** Additional modifiers to apply */
93-
mods?: Record<string, boolean | undefined>;
94+
mods?: Mods;
9495
}
9596

9697
function LayoutContent(

src/tasty/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export type {
3535
ShortGridStyles,
3636
GlobalStyledProps,
3737
TagName,
38+
Mods,
3839
} from './types';
3940
export type {
4041
StylesInterface,

src/tasty/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export interface GlobalStyledProps {
1919
breakpoints?: number[];
2020
}
2121

22+
/** Type for element modifiers (mods prop) */
23+
export type Mods = {
24+
[key: string]: boolean | string | number | undefined | null;
25+
};
26+
2227
type Caps =
2328
| 'A'
2429
| 'B'
@@ -65,7 +70,7 @@ export interface BasePropsWithoutChildren<K extends TagName = TagName>
6570
/** Whether the element has the inline layout outside */
6671
inline?: boolean;
6772
/** The list of element modifiers **/
68-
mods?: { [key: string]: boolean | string | number | undefined | null };
73+
mods?: Mods;
6974
/** Whether the element is hidden (`hidden` attribute is set) */
7075
isHidden?: boolean;
7176
/** Whether the element is disabled (`disabled` attribute is set) */

0 commit comments

Comments
 (0)