@wonderflow/react-components 3.0.0-next.1 → 3.0.0-next.5
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/avatar/avatar.js +2 -2
- package/button/button.d.ts +4 -4
- package/button/button.js +4 -5
- package/button/button.module.css +22 -19
- package/card/card.d.ts +1 -1
- package/card/card.js +2 -2
- package/chip/chip.d.ts +10 -3
- package/chip/chip.js +2 -2
- package/circular-progress/circular-progress.js +2 -2
- package/clamp-text/clamp-text.d.ts +1 -1
- package/clamp-text/clamp-text.js +2 -3
- package/container/container.js +2 -3
- package/core/typography.css +1 -6
- package/core.css +5 -1
- package/disclosure/disclosure.js +3 -3
- package/dropdown/dropdown-item.d.ts +1 -1
- package/dropdown/dropdown-item.js +2 -2
- package/dropdown/dropdown-menu.d.ts +3 -3
- package/dropdown/dropdown-menu.js +11 -5
- package/dropdown/dropdown.d.ts +9 -19
- package/dropdown/dropdown.js +7 -5
- package/elevator/elevator.d.ts +2 -2
- package/grid/grid-item.d.ts +5 -1
- package/grid/grid-item.js +5 -4
- package/grid/grid.d.ts +5 -21
- package/grid/grid.js +3 -3
- package/grid/index.d.ts +1 -1
- package/grid/index.js +1 -1
- package/icon/icon.js +2 -2
- package/icon-button/icon-button.d.ts +1 -1
- package/icon-button/icon-button.js +1 -2
- package/icons/all.svg +15 -7
- package/icons/structure.json +2 -0
- package/icons/types.d.ts +4 -0
- package/index.d.ts +3 -3
- package/index.js +2 -2
- package/info-state/info-state.d.ts +12 -3
- package/info-state/info-state.js +2 -2
- package/input-group/input-group.js +3 -3
- package/input-group/input-group.module.css +0 -3
- package/linear-progress/linear-progress.d.ts +4 -4
- package/linear-progress/linear-progress.js +3 -3
- package/list/list.d.ts +2 -1
- package/list/list.js +2 -3
- package/list/list.module.css +7 -0
- package/masonry/masonry.d.ts +2 -2
- package/masonry/masonry.js +2 -2
- package/modal/{modal-content.d.ts → content/modal-content.d.ts} +0 -0
- package/modal/{modal-content.js → content/modal-content.js} +5 -5
- package/modal/{modal-content.module.css → content/modal-content.module.css} +1 -1
- package/modal/index.d.ts +1 -1
- package/modal/index.js +1 -1
- package/modal/modal-context.d.ts +5 -5
- package/modal/modal-context.js +10 -1
- package/modal/modal.d.ts +5 -8
- package/modal/modal.js +10 -24
- package/overlay-container/index.d.ts +2 -0
- package/overlay-container/index.js +1 -0
- package/overlay-container/overlay-container.d.ts +6 -0
- package/overlay-container/overlay-container.js +15 -0
- package/package.json +30 -30
- package/pagination/pagination.d.ts +2 -4
- package/pagination/pagination.js +2 -2
- package/prose/prose.js +2 -3
- package/select/select.js +2 -2
- package/selection-controls/checkbox.js +2 -2
- package/selection-controls/radio.js +2 -2
- package/selection-controls/toggle.js +2 -2
- package/separator/index.d.ts +1 -0
- package/separator/separator.d.ts +3 -2
- package/separator/separator.js +2 -2
- package/skeleton-block/skeleton-block.d.ts +1 -1
- package/skeleton-block/skeleton-block.js +2 -2
- package/slider/slider.js +2 -2
- package/snackbar/snackbar.js +2 -3
- package/spinner/spinner.d.ts +5 -2
- package/spinner/spinner.js +5 -4
- package/split-button/split-button.js +2 -3
- package/stack/stack.js +2 -3
- package/star-meter/star-meter.d.ts +1 -1
- package/star-meter/star-meter.js +2 -3
- package/tab/index.d.ts +1 -1
- package/tab/index.js +1 -1
- package/tab/tab-item.d.ts +3 -1
- package/tab/tab-item.js +5 -5
- package/tab/tab-list.d.ts +3 -2
- package/tab/tab-list.js +2 -1
- package/tab/tab-panel.d.ts +4 -1
- package/tab/tab-panel.js +3 -2
- package/tab/tab.d.ts +10 -8
- package/tab/tab.js +6 -7
- package/table/table.d.ts +3 -3
- package/table/table.js +8 -9
- package/table/table.module.css +0 -4
- package/text/text.d.ts +1 -1
- package/text/text.js +2 -3
- package/text/text.module.css +22 -24
- package/textfield/base-field/base-field.d.ts +1 -0
- package/textfield/base-field/base-field.js +2 -2
- package/textfield/base-field/index.d.ts +1 -1
- package/textfield/textfield.d.ts +4 -4
- package/textfield/textfield.js +3 -3
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/themes.css +3 -3
- package/title/title.d.ts +1 -1
- package/title/title.js +2 -3
- package/title/title.module.css +60 -35
- package/toggle-button/toggle-button.js +2 -3
- package/toggle-button/toggle-button.module.css +16 -2
- package/tooltip/tooltip.d.ts +2 -2
package/table/table.js
CHANGED
|
@@ -2,20 +2,19 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import ReactDataTable from 'react-data-table-component';
|
|
3
3
|
import { Icon, SkeletonBlock, Checkbox } from '..';
|
|
4
4
|
import { customStyle } from './theme';
|
|
5
|
-
import {
|
|
5
|
+
import { SortIcon, ExpandWrapper, ExpandContent } from './table.module.css';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
export const Table = ({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination = false, responsive = true, fixedHeader = false, noHeader = true, paginationPerPage = 8, striped = false, theme = 'default', collapsedRowIcon = 'chevron-right', expandedRowIcon = 'chevron-down', minRowHeight = '48px', ...
|
|
7
|
+
export const Table = ({ className, ExpandableRowsComponent, progressComponent, customStyles, pagination = false, responsive = true, fixedHeader = false, noHeader = true, paginationPerPage = 8, striped = false, theme = 'default', collapsedRowIcon = 'chevron-right', expandedRowIcon = 'chevron-down', minRowHeight = '48px', ...otherProps }) => {
|
|
8
8
|
const selectProps = {
|
|
9
9
|
indeterminate: (isIndeterminate) => isIndeterminate,
|
|
10
10
|
dimension: 'small'
|
|
11
11
|
};
|
|
12
12
|
const ExpandComponent = useMemo(() => ({ data: innerData }) => (React.createElement("div", { className: ExpandWrapper },
|
|
13
13
|
React.createElement("div", { className: ExpandContent }, ExpandableRowsComponent ? React.createElement(ExpandableRowsComponent, { data: innerData }) : null))), [ExpandableRowsComponent]);
|
|
14
|
-
return (React.createElement(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
React.createElement(Icon, { name: "arrow-up", dimension: 16 }))), ...props })));
|
|
14
|
+
return (React.createElement(ReactDataTable, { className: clsx(className), pagination: pagination, responsive: responsive, fixedHeader: fixedHeader, paginationPerPage: paginationPerPage, expandableRows: Boolean(ExpandableRowsComponent), expandOnRowClicked: Boolean(ExpandableRowsComponent), expandableRowsComponent: ExpandComponent, theme: theme, noHeader: noHeader, progressComponent: progressComponent || React.createElement("div", { style: { width: '100%' } },
|
|
15
|
+
React.createElement(SkeletonBlock, { height: 40, count: 8 })), striped: striped, customStyles: customStyles || customStyle(minRowHeight), selectableRowsComponent: Checkbox, selectableRowsComponentProps: selectProps, expandableIcon: {
|
|
16
|
+
collapsed: React.createElement(Icon, { name: collapsedRowIcon, fill: "var(--global-foreground)", dimension: 16 }),
|
|
17
|
+
expanded: React.createElement(Icon, { name: expandedRowIcon, fill: "var(--global-foreground)", dimension: 16 })
|
|
18
|
+
}, paginationIconFirstPage: React.createElement(Icon, { name: "backward-step", dimension: 24 }), paginationIconPrevious: React.createElement(Icon, { name: "chevron-left", dimension: 24 }), paginationIconNext: React.createElement(Icon, { name: "chevron-right", dimension: 24 }), paginationIconLastPage: React.createElement(Icon, { name: "forward-step", dimension: 24 }), sortIcon: (React.createElement("span", { className: SortIcon },
|
|
19
|
+
React.createElement(Icon, { name: "arrow-up" }))), ...otherProps }));
|
|
21
20
|
};
|
package/table/table.module.css
CHANGED
package/text/text.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare type TextProps = {
|
|
|
5
5
|
sentiment?: 'positive' | 'informative' | 'danger' | 'warning';
|
|
6
6
|
dimmed?: 5 | 6 | 7;
|
|
7
7
|
weight?: 'thin' | 'bold';
|
|
8
|
-
fluid?: boolean;
|
|
9
8
|
maxWidth?: string;
|
|
10
9
|
textAlign?: 'start' | 'center' | 'end';
|
|
10
|
+
responsive?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare type PolymorphicText = Polymorphic.ForwardRefComponent<'p', TextProps>;
|
|
13
13
|
export declare const Text: PolymorphicText;
|
package/text/text.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Text as TextClass } from './text.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p',
|
|
4
|
+
export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, style, ...otherProps }, forwardedRef) => {
|
|
5
5
|
const dynamicStyle = {
|
|
6
6
|
'--maxW': maxWidth,
|
|
7
7
|
'--tAlign': textAlign
|
|
8
8
|
};
|
|
9
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-
|
|
9
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-responsive": responsive, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
|
|
10
10
|
});
|
|
11
|
-
Text.displayName = 'Text';
|
package/text/text.module.css
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
+
@import '../core/media.css';
|
|
2
|
+
|
|
1
3
|
.Text {
|
|
2
4
|
line-height: 1.5;
|
|
3
5
|
min-block-size: 0.01vh;
|
|
4
|
-
font-size: var(--
|
|
6
|
+
font-size: var(--fs-max);
|
|
5
7
|
max-inline-size: var(--maxW, initial);
|
|
6
8
|
text-align: var(--tAlign);
|
|
7
9
|
|
|
8
|
-
&[data-text-is-fluid='true'] {
|
|
9
|
-
font-size:
|
|
10
|
-
clamp(
|
|
11
|
-
var(--fluid-type-min, env(--font-size-16)),
|
|
12
|
-
var(--fluid-type-factor, calc(0.6rem + 0.92vw)),
|
|
13
|
-
var(--fluid-type-max, 1rem)
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
10
|
/* Colors */
|
|
18
11
|
|
|
19
12
|
&[data-text-dimmed='5'] {
|
|
@@ -48,33 +41,29 @@
|
|
|
48
41
|
|
|
49
42
|
&[data-text-size='14'] {
|
|
50
43
|
font-size: env(--font-size-14);
|
|
51
|
-
line-height:
|
|
44
|
+
line-height: env(--font-lh-small);
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
&[data-text-size='16'] {
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--fluid-type-max: env(--font-size-16);
|
|
48
|
+
--fs-min: env(--font-size-14);
|
|
49
|
+
--fs-max: env(--font-size-16);
|
|
58
50
|
|
|
59
|
-
line-height:
|
|
51
|
+
line-height: env(--font-lh-small);
|
|
60
52
|
}
|
|
61
53
|
|
|
62
54
|
&[data-text-size='18'] {
|
|
63
|
-
--
|
|
64
|
-
--
|
|
65
|
-
--fluid-type-max: env(--font-size-18);
|
|
55
|
+
--fs-min: env(--font-size-16);
|
|
56
|
+
--fs-max: env(--font-size-18);
|
|
66
57
|
}
|
|
67
58
|
|
|
68
59
|
&[data-text-size='22'] {
|
|
69
|
-
--
|
|
70
|
-
--
|
|
71
|
-
--fluid-type-max: env(--font-size-22);
|
|
60
|
+
--fs-min: env(--font-size-18);
|
|
61
|
+
--fs-max: env(--font-size-22);
|
|
72
62
|
}
|
|
73
63
|
|
|
74
64
|
&[data-text-size='28'] {
|
|
75
|
-
--
|
|
76
|
-
--
|
|
77
|
-
--fluid-type-max: env(--font-size-28);
|
|
65
|
+
--fs-min: env(--font-size-22);
|
|
66
|
+
--fs-max: env(--font-size-28);
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
/* Weights */
|
|
@@ -86,4 +75,13 @@
|
|
|
86
75
|
&[data-text-weight='bold'] {
|
|
87
76
|
font-weight: 600;
|
|
88
77
|
}
|
|
78
|
+
|
|
79
|
+
/* Responsiveness */
|
|
80
|
+
&[data-text-responsive='true'] {
|
|
81
|
+
font-size: var(--fs-min);
|
|
82
|
+
|
|
83
|
+
@media (--from-small) {
|
|
84
|
+
font-size: var(--fs-max);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
89
87
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { Polymorphic } from '../../';
|
|
3
|
+
export declare type PrimitiveInputType = HTMLInputElement | HTMLTextAreaElement;
|
|
3
4
|
export declare type BaseFieldProps = InputHTMLAttributes<HTMLInputElement> & InputHTMLAttributes<HTMLTextAreaElement> & {
|
|
4
5
|
invalid?: boolean;
|
|
5
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { BaseField as BaseFieldClass } from './base-field.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
export const BaseField = forwardRef(({ as: Wrapper = 'input', invalid, className, ...
|
|
5
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(BaseFieldClass, className), ...
|
|
4
|
+
export const BaseField = forwardRef(({ as: Wrapper = 'input', invalid, className, ...otherProps }, forwardedRef) => {
|
|
5
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(BaseFieldClass, className), ...otherProps }));
|
|
6
6
|
});
|
|
7
7
|
BaseField.displayName = 'BaseField';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { BaseField } from './base-field';
|
|
2
|
-
export type { BaseFieldProps } from './base-field';
|
|
2
|
+
export type { BaseFieldProps, PrimitiveInputType } from './base-field';
|
package/textfield/textfield.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ChangeEvent } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
|
-
import { BaseFieldProps } from './base-field';
|
|
3
|
+
import { BaseFieldProps, PrimitiveInputType } from './base-field';
|
|
4
4
|
export declare type TextfieldProps = BaseFieldProps & {
|
|
5
5
|
icon?: IconNames;
|
|
6
6
|
label?: string;
|
|
@@ -10,7 +10,7 @@ export declare type TextfieldProps = BaseFieldProps & {
|
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
iconPosition?: 'left' | 'right';
|
|
12
12
|
disabled?: boolean;
|
|
13
|
-
onChange?: (event: ChangeEvent<
|
|
13
|
+
onChange?: (event: ChangeEvent<PrimitiveInputType>) => void;
|
|
14
14
|
};
|
|
15
15
|
export declare const Textfield: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLTextAreaElement> & {
|
|
16
16
|
invalid?: boolean | undefined;
|
|
@@ -23,5 +23,5 @@ export declare const Textfield: React.ForwardRefExoticComponent<React.InputHTMLA
|
|
|
23
23
|
readOnly?: boolean | undefined;
|
|
24
24
|
iconPosition?: "left" | "right" | undefined;
|
|
25
25
|
disabled?: boolean | undefined;
|
|
26
|
-
onChange?: ((event: ChangeEvent<
|
|
27
|
-
} & React.RefAttributes<
|
|
26
|
+
onChange?: ((event: ChangeEvent<PrimitiveInputType>) => void) | undefined;
|
|
27
|
+
} & React.RefAttributes<PrimitiveInputType>>;
|
package/textfield/textfield.js
CHANGED
|
@@ -4,7 +4,7 @@ import { BaseField } from './base-field';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useUIDSeed } from 'react-uid';
|
|
6
6
|
import { Textfield as TextfieldClass, FieldContainer, InputField, Icon as IconClass, IconButton as IconButtonClass } from './textfield.module.css';
|
|
7
|
-
export const Textfield = forwardRef(({ children, className, disabled = false, icon, label, textarea, readOnly, invalid, iconPosition = 'right', dimension = 'regular', type, onChange, ...
|
|
7
|
+
export const Textfield = forwardRef(({ children, className, disabled = false, icon, label, textarea, readOnly, invalid, iconPosition = 'right', dimension = 'regular', type, onChange, ...otherProps }, forwardedRef) => {
|
|
8
8
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
9
9
|
const uid = useUIDSeed();
|
|
10
10
|
const isPassword = type === 'password';
|
|
@@ -31,8 +31,8 @@ export const Textfield = forwardRef(({ children, className, disabled = false, ic
|
|
|
31
31
|
label && React.createElement(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('field') }, label),
|
|
32
32
|
React.createElement("div", { className: FieldContainer },
|
|
33
33
|
textarea
|
|
34
|
-
? (React.createElement(BaseField, { ref: forwardedRef, as: "textarea", id: uid('field'), ...commonProps, ...
|
|
35
|
-
: (React.createElement(BaseField, { className: InputField, id: uid('field'), ref: forwardedRef, type: passwordVisible ? 'text' : type, ...commonProps, ...
|
|
34
|
+
? (React.createElement(BaseField, { ref: forwardedRef, as: "textarea", id: uid('field'), ...commonProps, ...otherProps }))
|
|
35
|
+
: (React.createElement(BaseField, { className: InputField, id: uid('field'), ref: forwardedRef, type: passwordVisible ? 'text' : type, ...commonProps, ...otherProps })),
|
|
36
36
|
isPassword && (React.createElement(IconButton, { className: IconButtonClass, dimension: actionSizes[dimension], onClick: handlePasswordVisibility, kind: "flat", "aria-label": "Reveal password", icon: passwordVisible ? 'eye-slash' : 'eye' })),
|
|
37
37
|
!textarea && icon && type !== 'password' && (React.createElement(Icon, { className: IconClass, name: icon, dimension: iconSizes[dimension] })))));
|
|
38
38
|
});
|
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
package/themes.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
color: var(--global-foreground);
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Wed, 15 Dec 2021 18:33:15 GMT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
color: var(--global-foreground);
|
|
52
52
|
/**
|
|
53
53
|
* Do not edit directly
|
|
54
|
-
* Generated on
|
|
54
|
+
* Generated on Wed, 15 Dec 2021 18:33:15 GMT
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
57
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
color: var(--global-foreground);
|
|
100
100
|
/**
|
|
101
101
|
* Do not edit directly
|
|
102
|
-
* Generated on
|
|
102
|
+
* Generated on Wed, 15 Dec 2021 18:33:15 GMT
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
|
package/title/title.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare type TitleProps = {
|
|
|
4
4
|
lineHeight?: 'none' | 'small' | 'large';
|
|
5
5
|
textAlign?: 'start' | 'center' | 'end';
|
|
6
6
|
maxWidth?: string;
|
|
7
|
-
|
|
7
|
+
responsive?: boolean;
|
|
8
8
|
};
|
|
9
9
|
declare type PolymorphicTitle = Polymorphic.ForwardRefComponent<'span', TitleProps>;
|
|
10
10
|
export declare const Title: PolymorphicTitle;
|
package/title/title.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import * as styles from './title.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1',
|
|
4
|
+
export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1', textAlign = 'start', maxWidth, responsive = true, style, ...otherProps }, forwardedRef) => {
|
|
5
5
|
const computedLevel = level.match(/\d/g) ? `H${level}` : level.charAt(0).toUpperCase() + level.slice(1);
|
|
6
6
|
const dynamicStyle = {
|
|
7
7
|
'--maxW': maxWidth,
|
|
8
8
|
'--tAlign': textAlign
|
|
9
9
|
};
|
|
10
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, "data-title-
|
|
10
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, "data-title-responsive": responsive, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
|
|
11
11
|
});
|
|
12
|
-
Title.displayName = 'Title';
|
package/title/title.module.css
CHANGED
|
@@ -1,85 +1,110 @@
|
|
|
1
|
+
@import '../core/media.css';
|
|
2
|
+
|
|
1
3
|
.Title {
|
|
2
4
|
&:is(.H1, .H2, .H3, .H4, .H5, .H6, .Display) {
|
|
5
|
+
--lh: 0.3;
|
|
6
|
+
|
|
3
7
|
display: block;
|
|
4
8
|
line-height: env(--font-lh-small);
|
|
5
9
|
color: var(--heading-foreground);
|
|
6
10
|
min-block-size: 0.01vh;
|
|
7
|
-
font-size: var(--
|
|
11
|
+
font-size: var(--fs-max);
|
|
8
12
|
max-inline-size: var(--maxW, initial);
|
|
9
13
|
text-align: var(--tAlign);
|
|
10
14
|
overflow-wrap: break-word;
|
|
11
15
|
|
|
12
|
-
&[data-title-is-fluid='true'] {
|
|
13
|
-
font-size:
|
|
14
|
-
clamp(
|
|
15
|
-
var(--fluid-type-min, env(--font-size-16)),
|
|
16
|
-
var(--fluid-type-factor, calc(0.6rem + 0.92vw)),
|
|
17
|
-
var(--fluid-type-max, 1rem)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&[data-title-line-height='none'] {
|
|
22
|
-
line-height: 0.3;
|
|
23
|
-
}
|
|
24
16
|
|
|
25
17
|
&[data-title-line-height='small'] {
|
|
26
|
-
|
|
18
|
+
--lh: 1.33;
|
|
27
19
|
}
|
|
28
20
|
}
|
|
29
21
|
|
|
30
22
|
&:is(.H6) {
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--fluid-type-max: env(--font-size-18);
|
|
23
|
+
--fs-min: env(--font-size-14);
|
|
24
|
+
--fs-max: env(--font-size-18);
|
|
34
25
|
|
|
35
26
|
font-weight: 700;
|
|
36
27
|
}
|
|
37
28
|
|
|
38
29
|
&:is(.H5) {
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--fluid-type-max: 1.33rem;
|
|
30
|
+
--fs-min: 1rem;
|
|
31
|
+
--fs-max: 1.33rem;
|
|
42
32
|
|
|
43
33
|
font-weight: 700;
|
|
44
34
|
}
|
|
45
35
|
|
|
46
36
|
&:is(.H4) {
|
|
47
|
-
--
|
|
48
|
-
--
|
|
49
|
-
--fluid-type-max: 1.77rem;
|
|
37
|
+
--fs-min: 1.33rem;
|
|
38
|
+
--fs-max: 1.77rem;
|
|
50
39
|
|
|
51
40
|
font-weight: 700;
|
|
52
41
|
}
|
|
53
42
|
|
|
54
43
|
&:is(.H3) {
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--fluid-type-max: 2.37rem;
|
|
44
|
+
--fs-min: 1.77rem;
|
|
45
|
+
--fs-max: 2.37rem;
|
|
58
46
|
|
|
59
47
|
font-weight: 800;
|
|
48
|
+
|
|
49
|
+
&::before {
|
|
50
|
+
content: '';
|
|
51
|
+
display: block;
|
|
52
|
+
height: 0;
|
|
53
|
+
width: 0;
|
|
54
|
+
margin-top: calc((1 - var(--lh)) * 0.6em);
|
|
55
|
+
}
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
&:is(.H2) {
|
|
63
|
-
--
|
|
64
|
-
--
|
|
65
|
-
--fluid-type-max: 3.16rem;
|
|
59
|
+
--fs-min: 2.37rem;
|
|
60
|
+
--fs-max: 3.16rem;
|
|
66
61
|
|
|
67
62
|
font-weight: 800;
|
|
63
|
+
|
|
64
|
+
&::before {
|
|
65
|
+
content: '';
|
|
66
|
+
display: block;
|
|
67
|
+
height: 0;
|
|
68
|
+
width: 0;
|
|
69
|
+
margin-top: calc((1 - var(--lh)) * 0.6em);
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
&:is(.H1) {
|
|
71
|
-
--
|
|
72
|
-
--
|
|
73
|
-
--fluid-type-max: 4.2rem;
|
|
74
|
+
--fs-min: 3.16rem;
|
|
75
|
+
--fs-max: 4.2rem;
|
|
74
76
|
|
|
75
77
|
font-weight: 800;
|
|
78
|
+
|
|
79
|
+
&::before {
|
|
80
|
+
content: '';
|
|
81
|
+
display: block;
|
|
82
|
+
height: 0;
|
|
83
|
+
width: 0;
|
|
84
|
+
margin-top: calc((1 - var(--lh)) * 0.6em);
|
|
85
|
+
}
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
&.Display {
|
|
79
|
-
--
|
|
80
|
-
--
|
|
81
|
-
--fluid-type-max: 5.6rem;
|
|
89
|
+
--fs-min: 4.2rem;
|
|
90
|
+
--fs-max: 5.6rem;
|
|
82
91
|
|
|
83
92
|
font-weight: 800;
|
|
93
|
+
|
|
94
|
+
&::before {
|
|
95
|
+
content: '';
|
|
96
|
+
display: block;
|
|
97
|
+
height: 0;
|
|
98
|
+
width: 0;
|
|
99
|
+
margin-top: calc((1 - var(--lh)) * 0.6em);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&[data-title-responsive='true'] {
|
|
104
|
+
font-size: var(--fs-min);
|
|
105
|
+
|
|
106
|
+
@media (--from-small) {
|
|
107
|
+
font-size: var(--fs-max);
|
|
108
|
+
}
|
|
84
109
|
}
|
|
85
110
|
}
|
|
@@ -21,7 +21,7 @@ const scaleAnimation = {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
export const ToggleButton = forwardRef(({ className, restingIcon, pressedIcon, dimension, kind, disabled, pressed = false, onClick, ...
|
|
24
|
+
export const ToggleButton = forwardRef(({ className, restingIcon, pressedIcon, dimension, kind, disabled, iconColor, pressed = false, onClick, ...otherProps }, forwardedRef) => {
|
|
25
25
|
const [isPressed, setIsPressed] = useState(pressed);
|
|
26
26
|
const [firstRender, setFirstRender] = useState(true);
|
|
27
27
|
useEffect(() => {
|
|
@@ -39,8 +39,7 @@ export const ToggleButton = forwardRef(({ className, restingIcon, pressedIcon, d
|
|
|
39
39
|
};
|
|
40
40
|
return (React.createElement(Icon, { name: icon, dimension: iconSize[dimension] }));
|
|
41
41
|
}, []);
|
|
42
|
-
return (React.createElement(IconButton, { as: "button", ref: forwardedRef, dimension: dimension, "aria-pressed": isPressed, kind: kind, disabled: disabled, onClick: handleClick, className: clsx(ToggleButtonClass, className), ...
|
|
42
|
+
return (React.createElement(IconButton, { as: "button", ref: forwardedRef, dimension: dimension, "aria-pressed": isPressed, kind: kind, disabled: disabled, onClick: handleClick, className: clsx(ToggleButtonClass, className), ...otherProps }, isPressed && pressedIcon
|
|
43
43
|
? (React.createElement(motion.span, { key: "pressedIcon", variants: scaleAnimation, initial: firstRender && isPressed ? false : 'scaleOut', animate: "scaleIn" }, renderIcon(pressedIcon, dimension)))
|
|
44
44
|
: restingIcon && (React.createElement(motion.span, { key: "restingIcon", variants: scaleAnimation, initial: firstRender && !isPressed ? false : 'scaleOut', animate: "scaleIn" }, renderIcon(restingIcon, dimension)))));
|
|
45
45
|
});
|
|
46
|
-
ToggleButton.displayName = 'ToggleButton';
|
|
@@ -7,20 +7,34 @@
|
|
|
7
7
|
&[aria-pressed='true'] {
|
|
8
8
|
box-shadow:
|
|
9
9
|
0 0 0 var(--border-width) var(--border-color),
|
|
10
|
-
0 0 0 var(--border-width) var(--border-color)
|
|
11
|
-
inset 0 0 0 calc(var(--border-width) / 2) hsl(0deg 0% 0% / 20%);
|
|
10
|
+
0 0 0 var(--border-width) var(--border-color);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
&[data-button-kind='primary'] {
|
|
15
14
|
--border-color: hsl(env(--color-red-30) / 25%);
|
|
15
|
+
|
|
16
|
+
&[aria-pressed='true'] {
|
|
17
|
+
color: var(--cta-default);
|
|
18
|
+
background: none;
|
|
19
|
+
}
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
&[data-button-kind='secondary'] {
|
|
19
23
|
--border-color: var(--dimmed-2);
|
|
24
|
+
|
|
25
|
+
&[aria-pressed='true'] {
|
|
26
|
+
color: var(--global-vibrancy-foreground);
|
|
27
|
+
background: none;
|
|
28
|
+
}
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
&[data-button-kind='flat'] {
|
|
23
32
|
--border-color: var(--dimmed-2);
|
|
33
|
+
|
|
34
|
+
&[aria-pressed='true'] {
|
|
35
|
+
color: var(--global-vibrancy-foreground);
|
|
36
|
+
background: none;
|
|
37
|
+
}
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
&[data-button-dimension='small'] {
|
package/tooltip/tooltip.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { AutoPlacement, BasePlacement, VariationPlacement } from '@popperjs/core/lib';
|
|
3
3
|
export declare type TooltipProps = PropsWithClass & {
|
|
4
4
|
children: ReactNode;
|
|
@@ -9,4 +9,4 @@ export declare type TooltipProps = PropsWithClass & {
|
|
|
9
9
|
maxWidth?: string;
|
|
10
10
|
fill?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const Tooltip:
|
|
12
|
+
export declare const Tooltip: FC<TooltipProps>;
|