@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.
Files changed (111) hide show
  1. package/avatar/avatar.js +2 -2
  2. package/button/button.d.ts +4 -4
  3. package/button/button.js +4 -5
  4. package/button/button.module.css +22 -19
  5. package/card/card.d.ts +1 -1
  6. package/card/card.js +2 -2
  7. package/chip/chip.d.ts +10 -3
  8. package/chip/chip.js +2 -2
  9. package/circular-progress/circular-progress.js +2 -2
  10. package/clamp-text/clamp-text.d.ts +1 -1
  11. package/clamp-text/clamp-text.js +2 -3
  12. package/container/container.js +2 -3
  13. package/core/typography.css +1 -6
  14. package/core.css +5 -1
  15. package/disclosure/disclosure.js +3 -3
  16. package/dropdown/dropdown-item.d.ts +1 -1
  17. package/dropdown/dropdown-item.js +2 -2
  18. package/dropdown/dropdown-menu.d.ts +3 -3
  19. package/dropdown/dropdown-menu.js +11 -5
  20. package/dropdown/dropdown.d.ts +9 -19
  21. package/dropdown/dropdown.js +7 -5
  22. package/elevator/elevator.d.ts +2 -2
  23. package/grid/grid-item.d.ts +5 -1
  24. package/grid/grid-item.js +5 -4
  25. package/grid/grid.d.ts +5 -21
  26. package/grid/grid.js +3 -3
  27. package/grid/index.d.ts +1 -1
  28. package/grid/index.js +1 -1
  29. package/icon/icon.js +2 -2
  30. package/icon-button/icon-button.d.ts +1 -1
  31. package/icon-button/icon-button.js +1 -2
  32. package/icons/all.svg +15 -7
  33. package/icons/structure.json +2 -0
  34. package/icons/types.d.ts +4 -0
  35. package/index.d.ts +3 -3
  36. package/index.js +2 -2
  37. package/info-state/info-state.d.ts +12 -3
  38. package/info-state/info-state.js +2 -2
  39. package/input-group/input-group.js +3 -3
  40. package/input-group/input-group.module.css +0 -3
  41. package/linear-progress/linear-progress.d.ts +4 -4
  42. package/linear-progress/linear-progress.js +3 -3
  43. package/list/list.d.ts +2 -1
  44. package/list/list.js +2 -3
  45. package/list/list.module.css +7 -0
  46. package/masonry/masonry.d.ts +2 -2
  47. package/masonry/masonry.js +2 -2
  48. package/modal/{modal-content.d.ts → content/modal-content.d.ts} +0 -0
  49. package/modal/{modal-content.js → content/modal-content.js} +5 -5
  50. package/modal/{modal-content.module.css → content/modal-content.module.css} +1 -1
  51. package/modal/index.d.ts +1 -1
  52. package/modal/index.js +1 -1
  53. package/modal/modal-context.d.ts +5 -5
  54. package/modal/modal-context.js +10 -1
  55. package/modal/modal.d.ts +5 -8
  56. package/modal/modal.js +10 -24
  57. package/overlay-container/index.d.ts +2 -0
  58. package/overlay-container/index.js +1 -0
  59. package/overlay-container/overlay-container.d.ts +6 -0
  60. package/overlay-container/overlay-container.js +15 -0
  61. package/package.json +30 -30
  62. package/pagination/pagination.d.ts +2 -4
  63. package/pagination/pagination.js +2 -2
  64. package/prose/prose.js +2 -3
  65. package/select/select.js +2 -2
  66. package/selection-controls/checkbox.js +2 -2
  67. package/selection-controls/radio.js +2 -2
  68. package/selection-controls/toggle.js +2 -2
  69. package/separator/index.d.ts +1 -0
  70. package/separator/separator.d.ts +3 -2
  71. package/separator/separator.js +2 -2
  72. package/skeleton-block/skeleton-block.d.ts +1 -1
  73. package/skeleton-block/skeleton-block.js +2 -2
  74. package/slider/slider.js +2 -2
  75. package/snackbar/snackbar.js +2 -3
  76. package/spinner/spinner.d.ts +5 -2
  77. package/spinner/spinner.js +5 -4
  78. package/split-button/split-button.js +2 -3
  79. package/stack/stack.js +2 -3
  80. package/star-meter/star-meter.d.ts +1 -1
  81. package/star-meter/star-meter.js +2 -3
  82. package/tab/index.d.ts +1 -1
  83. package/tab/index.js +1 -1
  84. package/tab/tab-item.d.ts +3 -1
  85. package/tab/tab-item.js +5 -5
  86. package/tab/tab-list.d.ts +3 -2
  87. package/tab/tab-list.js +2 -1
  88. package/tab/tab-panel.d.ts +4 -1
  89. package/tab/tab-panel.js +3 -2
  90. package/tab/tab.d.ts +10 -8
  91. package/tab/tab.js +6 -7
  92. package/table/table.d.ts +3 -3
  93. package/table/table.js +8 -9
  94. package/table/table.module.css +0 -4
  95. package/text/text.d.ts +1 -1
  96. package/text/text.js +2 -3
  97. package/text/text.module.css +22 -24
  98. package/textfield/base-field/base-field.d.ts +1 -0
  99. package/textfield/base-field/base-field.js +2 -2
  100. package/textfield/base-field/index.d.ts +1 -1
  101. package/textfield/textfield.d.ts +4 -4
  102. package/textfield/textfield.js +3 -3
  103. package/themes/dark.css +1 -1
  104. package/themes/light.css +1 -1
  105. package/themes.css +3 -3
  106. package/title/title.d.ts +1 -1
  107. package/title/title.js +2 -3
  108. package/title/title.module.css +60 -35
  109. package/toggle-button/toggle-button.js +2 -3
  110. package/toggle-button/toggle-button.module.css +16 -2
  111. 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 { TableWrapper, SortIcon, ExpandWrapper, ExpandContent } from './table.module.css';
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', ...props }) => {
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("div", { className: clsx(TableWrapper, className) },
15
- React.createElement(ReactDataTable, { 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%' } },
16
- React.createElement(SkeletonBlock, { height: 40, count: 8 })), striped: striped, customStyles: customStyles || customStyle(minRowHeight), selectableRowsComponent: Checkbox, selectableRowsComponentProps: selectProps, expandableIcon: {
17
- collapsed: React.createElement(Icon, { name: collapsedRowIcon, fill: "var(--global-foreground)", dimension: 16 }),
18
- expanded: React.createElement(Icon, { name: expandedRowIcon, fill: "var(--global-foreground)", dimension: 16 })
19
- }, 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 },
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
  };
@@ -1,7 +1,3 @@
1
- .TableWrapper {
2
- position: relative;
3
- }
4
-
5
1
  .SortIcon {
6
2
  margin-left: 4px;
7
3
  transform: scale(0.7);
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', fluid = true, style, ...props }, forwardedRef) => {
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-is-fluid": fluid, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...props }, children));
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';
@@ -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(--fluid-type-max);
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: 1.2;
44
+ line-height: env(--font-lh-small);
52
45
  }
53
46
 
54
47
  &[data-text-size='16'] {
55
- --fluid-type-min: env(--font-size-14);
56
- --fluid-type-factor: calc(0.69rem + 0.44vw);
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: 1.2;
51
+ line-height: env(--font-lh-small);
60
52
  }
61
53
 
62
54
  &[data-text-size='18'] {
63
- --fluid-type-min: env(--font-size-16);
64
- --fluid-type-factor: calc(0.79rem + 0.48vw);
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
- --fluid-type-min: env(--font-size-18);
70
- --fluid-type-factor: calc(0.84rem + 0.88vw);
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
- --fluid-type-min: env(--font-size-22);
76
- --fluid-type-factor: calc(0.98rem + 1.32vw);
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, ...props }, forwardedRef) => {
5
- return (React.createElement(Wrapper, { ref: forwardedRef, "data-basefield-invalid": invalid, className: clsx(BaseFieldClass, className), ...props }));
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';
@@ -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<HTMLInputElement | HTMLTextAreaElement>) => void;
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<HTMLInputElement | HTMLTextAreaElement>) => void) | undefined;
27
- } & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
26
+ onChange?: ((event: ChangeEvent<PrimitiveInputType>) => void) | undefined;
27
+ } & React.RefAttributes<PrimitiveInputType>>;
@@ -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, ...props }, forwardedRef) => {
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, ...props }))
35
- : (React.createElement(BaseField, { className: InputField, id: uid('field'), ref: forwardedRef, type: passwordVisible ? 'text' : type, ...commonProps, ...props })),
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
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 29 Nov 2021 10:40:48 GMT
3
+ * Generated on Wed, 15 Dec 2021 18:33:15 GMT
4
4
  */
5
5
 
6
6
  :root {
package/themes/light.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 29 Nov 2021 10:40:48 GMT
3
+ * Generated on Wed, 15 Dec 2021 18:33:15 GMT
4
4
  */
5
5
 
6
6
  :root {
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 Mon, 29 Nov 2021 10:40:48 GMT
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 Mon, 29 Nov 2021 10:40:48 GMT
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 Mon, 29 Nov 2021 10:40:48 GMT
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
- fluid?: boolean;
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', fluid = true, textAlign = 'start', maxWidth, style, ...props }, forwardedRef) => {
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-is-fluid": fluid, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...props }, children));
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';
@@ -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(--fluid-type-max);
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
- line-height: 1;
18
+ --lh: 1.33;
27
19
  }
28
20
  }
29
21
 
30
22
  &:is(.H6) {
31
- --fluid-type-min: env(--font-size-14);
32
- --fluid-type-factor: calc(env(--font-size-16) + 0.44vw);
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
- --fluid-type-min: 1rem;
40
- --fluid-type-factor: calc(0.76rem + 1.32vw);
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
- --fluid-type-min: 1.33rem;
48
- --fluid-type-factor: calc(1.01rem + 1.76vw);
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
- --fluid-type-min: 1.77rem;
56
- --fluid-type-factor: calc(1.35rem + 2.37vw);
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
- --fluid-type-min: 2.37rem;
64
- --fluid-type-factor: calc(1.8rem + 3.17vw);
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
- --fluid-type-min: 3.16rem;
72
- --fluid-type-factor: calc(2.23rem + 4.17vw);
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
- --fluid-type-min: 4.2rem;
80
- --fluid-type-factor: calc(3.19rem + 5.66vw);
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, ...props }, forwardedRef) => {
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), ...props }, isPressed && pressedIcon
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'] {
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
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: React.FC<TooltipProps>;
12
+ export declare const Tooltip: FC<TooltipProps>;