@moda/om 18.0.0 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs.js +206 -97
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +206 -97
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/Select/SelectOptions.d.ts +1 -1
- package/dist/src/components/Text/Text.d.ts +2 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/src/components/Badge/Badge.scss +3 -3
- package/src/components/Breakpoint/Breakpoint.scss +2 -1
- package/src/components/Button/Button.scss +6 -6
- package/src/components/Checkbox/Checkbox.scss +2 -2
- package/src/components/Checkbox/Checkbox.tsx +5 -3
- package/src/components/ColorSwatch/ColorSwatch.scss +3 -3
- package/src/components/Divider/Divider.scss +1 -1
- package/src/components/Expandable/Expandable.scss +3 -3
- package/src/components/LoadingShapes/LoadingShapes.scss +1 -1
- package/src/components/Popover/Popover.scss +4 -4
- package/src/components/RadioButton/RadioButton.scss +3 -3
- package/src/components/Select/Select.scss +1 -1
- package/src/components/Select/Select.tsx +3 -3
- package/src/components/Select/SelectOption.scss +1 -1
- package/src/components/Select/SelectOptions.scss +1 -1
- package/src/components/Select/SelectOptions.tsx +4 -4
- package/src/components/SlidingPane/SlidingPane.scss +3 -1
- package/src/components/SlidingPane/SlidingPane.tsx +1 -1
- package/src/components/Text/Text.tsx +5 -3
- package/src/components/Toast/Toast.scss +1 -1
- package/src/mixins/input-styles/_input-styles.scss +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactHTML } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { typography, colors } from '@moda/tokens';
|
|
4
4
|
import './Text.scss';
|
|
@@ -8,12 +8,14 @@ export type TextColor = keyof typeof colors.all;
|
|
|
8
8
|
export type TextFontFamily = keyof typeof typography.fonts;
|
|
9
9
|
|
|
10
10
|
export type TextProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
11
|
+
as?: keyof ReactHTML;
|
|
11
12
|
treatment?: TextTreatment;
|
|
12
13
|
color?: TextColor;
|
|
13
14
|
family?: TextFontFamily;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export const Text: React.FC<TextProps> = ({
|
|
18
|
+
as: Component = 'span',
|
|
17
19
|
className,
|
|
18
20
|
treatment = 'body1',
|
|
19
21
|
color = 'ink',
|
|
@@ -22,11 +24,11 @@ export const Text: React.FC<TextProps> = ({
|
|
|
22
24
|
style,
|
|
23
25
|
...rest
|
|
24
26
|
}) => (
|
|
25
|
-
<
|
|
27
|
+
<Component
|
|
26
28
|
className={classNames(`Text Text--${treatment} ${family ? `Text--${family}` : ''}`, className)}
|
|
27
29
|
style={{ color: colors.all[color], ...style }}
|
|
28
30
|
{...rest}
|
|
29
31
|
>
|
|
30
32
|
{children}
|
|
31
|
-
</
|
|
33
|
+
</Component>
|
|
32
34
|
);
|