@firecms/ui 3.0.0-canary.13 → 3.0.0-canary.130

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 (103) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Avatar.d.ts +1 -0
  3. package/dist/components/BooleanSwitch.d.ts +1 -1
  4. package/dist/components/CenteredView.d.ts +4 -2
  5. package/dist/components/Checkbox.d.ts +3 -2
  6. package/dist/components/Chip.d.ts +3 -2
  7. package/dist/components/DateTimeField.d.ts +5 -7
  8. package/dist/components/Dialog.d.ts +4 -1
  9. package/dist/components/InputLabel.d.ts +2 -2
  10. package/dist/components/Label.d.ts +4 -1
  11. package/dist/components/Markdown.d.ts +1 -0
  12. package/dist/components/Menu.d.ts +6 -2
  13. package/dist/components/Menubar.d.ts +79 -0
  14. package/dist/components/MultiSelect.d.ts +31 -16
  15. package/dist/components/Popover.d.ts +2 -1
  16. package/dist/components/RadioGroup.d.ts +26 -3
  17. package/dist/components/Select.d.ts +6 -10
  18. package/dist/components/Separator.d.ts +2 -1
  19. package/dist/components/Sheet.d.ts +4 -0
  20. package/dist/components/Table.d.ts +10 -10
  21. package/dist/components/TextField.d.ts +1 -1
  22. package/dist/components/TextareaAutosize.d.ts +3 -34
  23. package/dist/components/Tooltip.d.ts +6 -2
  24. package/dist/components/_MultiSelect.d.ts +0 -0
  25. package/dist/components/index.d.ts +1 -1
  26. package/dist/hooks/index.d.ts +4 -0
  27. package/dist/hooks/useLocaleConfig.d.ts +1 -0
  28. package/dist/icons/Icon.d.ts +3 -3
  29. package/dist/index.css +77 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.es.js +13178 -13542
  32. package/dist/index.es.js.map +1 -1
  33. package/dist/index.umd.js +19685 -49
  34. package/dist/index.umd.js.map +1 -1
  35. package/dist/styles.d.ts +7 -7
  36. package/dist/util/{cn.d.ts → cls.d.ts} +4 -0
  37. package/dist/util/index.d.ts +1 -3
  38. package/package.json +109 -118
  39. package/src/components/Alert.tsx +2 -2
  40. package/src/components/Autocomplete.tsx +4 -3
  41. package/src/components/Avatar.tsx +7 -6
  42. package/src/components/Badge.tsx +1 -1
  43. package/src/components/BooleanSwitch.tsx +15 -15
  44. package/src/components/BooleanSwitchWithLabel.tsx +8 -8
  45. package/src/components/Button.tsx +18 -20
  46. package/src/components/Card.tsx +3 -3
  47. package/src/components/CenteredView.tsx +25 -15
  48. package/src/components/Checkbox.tsx +11 -9
  49. package/src/components/Chip.tsx +8 -5
  50. package/src/components/CircularProgress.tsx +2 -2
  51. package/src/components/Collapse.tsx +3 -2
  52. package/src/components/Container.tsx +2 -2
  53. package/src/components/DateTimeField.tsx +45 -50
  54. package/src/components/Dialog.tsx +15 -6
  55. package/src/components/DialogActions.tsx +2 -2
  56. package/src/components/DialogContent.tsx +2 -2
  57. package/src/components/ExpandablePanel.tsx +10 -8
  58. package/src/components/FileUpload.tsx +6 -9
  59. package/src/components/IconButton.tsx +4 -6
  60. package/src/components/InfoLabel.tsx +2 -2
  61. package/src/components/InputLabel.tsx +12 -9
  62. package/src/components/Label.tsx +17 -4
  63. package/src/components/Markdown.tsx +14 -3
  64. package/src/components/Menu.tsx +49 -31
  65. package/src/components/Menubar.tsx +322 -0
  66. package/src/components/MultiSelect.tsx +335 -165
  67. package/src/components/Paper.tsx +2 -2
  68. package/src/components/Popover.tsx +17 -14
  69. package/src/components/RadioGroup.tsx +41 -9
  70. package/src/components/SearchBar.tsx +8 -9
  71. package/src/components/Select.tsx +105 -125
  72. package/src/components/Separator.tsx +10 -4
  73. package/src/components/Sheet.tsx +45 -28
  74. package/src/components/Skeleton.tsx +9 -6
  75. package/src/components/Table.tsx +50 -33
  76. package/src/components/Tabs.tsx +6 -7
  77. package/src/components/TextField.tsx +10 -13
  78. package/src/components/TextareaAutosize.tsx +3 -3
  79. package/src/components/Tooltip.tsx +30 -14
  80. package/src/components/Typography.tsx +34 -19
  81. package/src/components/_MultiSelect.tsx +222 -0
  82. package/src/components/common/SelectInputLabel.tsx +2 -2
  83. package/src/components/index.tsx +1 -1
  84. package/src/hooks/index.ts +4 -0
  85. package/src/hooks/useLocaleConfig.tsx +18 -0
  86. package/src/icons/Icon.tsx +46 -43
  87. package/src/icons/icon_keys.ts +114 -1301
  88. package/src/index.css +77 -0
  89. package/src/index.ts +1 -0
  90. package/src/scripts/generateIconKeys.ts +20 -11
  91. package/src/styles.ts +7 -7
  92. package/src/util/cls.ts +14 -0
  93. package/src/util/index.ts +1 -3
  94. package/tailwind.config.js +8 -6
  95. package/dist/components/Spinner.d.ts +0 -1
  96. package/src/components/Spinner.tsx +0 -18
  97. package/src/util/cn.ts +0 -6
  98. /package/dist/{util → hooks}/useDebounceValue.d.ts +0 -0
  99. /package/dist/{util → hooks}/useInjectStyles.d.ts +0 -0
  100. /package/dist/{util → hooks}/useOutsideAlerter.d.ts +0 -0
  101. /package/src/{util → hooks}/useDebounceValue.tsx +0 -0
  102. /package/src/{util → hooks}/useInjectStyles.tsx +0 -0
  103. /package/src/{util → hooks}/useOutsideAlerter.tsx +0 -0
@@ -1,21 +1,24 @@
1
1
  import React, { useRef } from "react";
2
2
  import { defaultBorderMixin } from "../styles";
3
- import { cn } from "../util";
3
+ import { cls } from "../util";
4
4
 
5
5
  export type TableProps = {
6
6
  children: React.ReactNode;
7
7
  className?: string;
8
8
  style?: React.CSSProperties;
9
- };
9
+ } & React.TableHTMLAttributes<HTMLTableElement>;
10
10
 
11
11
  export const Table = ({
12
12
  children,
13
13
  className,
14
- style
14
+ style,
15
+ ...rest
15
16
  }: TableProps) => (
16
- <table className={cn("w-full text-left text-gray-800 dark:text-white rounded-md overflow-x-auto",
17
- className)}
18
- style={style}>
17
+ <table
18
+ className={cls("text-left text-gray-800 dark:text-white rounded-md overflow-x-auto", className)}
19
+ style={style}
20
+ {...rest}
21
+ >
19
22
  {children}
20
23
  </table>
21
24
  );
@@ -23,13 +26,17 @@ export const Table = ({
23
26
  export type TableBodyProps = {
24
27
  children?: React.ReactNode;
25
28
  className?: string;
26
- };
29
+ } & React.HTMLAttributes<HTMLTableSectionElement>;
30
+
27
31
  export const TableBody = ({
28
32
  children,
29
- className
33
+ className,
34
+ ...rest
30
35
  }: TableBodyProps) => (
31
36
  <tbody
32
- className={cn("bg-white text-sm dark:bg-gray-800 divide-y divide-slate-200 dark:divide-gray-700", className)}>
37
+ className={cls("bg-white dark:bg-gray-950 text-sm divide-y divide-gray-100 dark:divide-gray-800 dark:divide-opacity-80", className)}
38
+ {...rest}
39
+ >
33
40
  {children}
34
41
  </tbody>
35
42
  );
@@ -37,17 +44,22 @@ export const TableBody = ({
37
44
  export type TableHeaderProps = {
38
45
  children?: React.ReactNode;
39
46
  className?: string;
40
- };
47
+ } & React.HTMLAttributes<HTMLTableSectionElement>;
41
48
 
42
49
  export const TableHeader = ({
43
50
  children,
44
- className
51
+ className,
52
+ ...rest
45
53
  }: TableHeaderProps) => (
46
- <thead>
47
- <tr className={cn(
48
- defaultBorderMixin,
49
- "text-sm font-medium text-gray-700 dark:text-slate-300",
50
- "bg-slate-50 border-b dark:bg-gray-900", className)}>
54
+ <thead {...rest}>
55
+ <tr
56
+ className={cls(
57
+ defaultBorderMixin,
58
+ "text-sm font-medium text-gray-700 dark:text-slate-300",
59
+ "bg-slate-50 border-b dark:bg-gray-900",
60
+ className
61
+ )}
62
+ >
51
63
  {children}
52
64
  </tr>
53
65
  </thead>
@@ -58,22 +70,24 @@ export type TableRowProps = {
58
70
  className?: string;
59
71
  onClick?: React.MouseEventHandler<any>;
60
72
  style?: React.CSSProperties;
61
- };
73
+ } & React.HTMLAttributes<HTMLTableRowElement>;
62
74
 
63
75
  export const TableRow = ({
64
76
  children,
65
77
  className,
66
78
  onClick,
67
- style
79
+ style,
80
+ ...rest
68
81
  }: TableRowProps) => (
69
82
  <tr
70
83
  onClick={onClick}
71
84
  style={style}
72
- className={cn(
73
- "divide-slate-100 dark:divide-gray-800",
85
+ className={cls(
74
86
  "bg-white dark:bg-gray-950",
75
87
  onClick ? "hover:bg-slate-100 dark:hover:bg-gray-800 cursor-pointer" : "",
76
- className)}
88
+ className
89
+ )}
90
+ {...rest}
77
91
  >
78
92
  {children}
79
93
  </tr>
@@ -87,7 +101,7 @@ export type TableCellProps = {
87
101
  style?: React.CSSProperties;
88
102
  align?: "left" | "center" | "right";
89
103
  colspan?: number;
90
- };
104
+ } & React.HTMLAttributes<HTMLTableCellElement>;
91
105
 
92
106
  export const TableCell = ({
93
107
  children,
@@ -96,20 +110,24 @@ export const TableCell = ({
96
110
  align,
97
111
  className,
98
112
  style,
99
- colspan
113
+ colspan,
114
+ ...rest
100
115
  }: TableCellProps) => {
101
-
102
116
  const ref = useRef<HTMLTableCellElement>(null);
103
-
104
117
  const Tag = header || getParentName(ref.current) === "TableHeader" ? "th" : "td";
105
118
  return (
106
- <Tag scope={scope}
107
- colSpan={colspan}
108
- ref={ref}
109
- style={style}
110
- className={cn("px-4 py-3 text-clip ",
111
- align === "center" ? "text-center" : (align === "right" ? "text-right" : "text-left"),
112
- className)}>
119
+ <Tag
120
+ scope={scope}
121
+ colSpan={colspan}
122
+ ref={ref}
123
+ style={style}
124
+ className={cls(
125
+ "px-4 py-3 text-clip ",
126
+ align === "center" ? "text-center" : (align === "right" ? "text-right" : "text-left"),
127
+ className
128
+ )}
129
+ {...rest}
130
+ >
113
131
  {children}
114
132
  </Tag>
115
133
  );
@@ -124,7 +142,6 @@ function getParentName(element: HTMLElement | null): string | undefined {
124
142
  key.startsWith("__reactInternalInstance$")
125
143
  );
126
144
  });
127
-
128
145
  // @ts-ignore
129
146
  const domFiber = element[key];
130
147
  // @ts-ignore
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import * as TabsPrimitive from "@radix-ui/react-tabs";
3
- import { focusedMixin } from "../styles";
4
- import { cn } from "../util";
3
+ import { cls } from "../util";
5
4
 
6
5
  export type TabsProps = {
7
6
  value: string,
@@ -18,7 +17,7 @@ export function Tabs({
18
17
  }: TabsProps) {
19
18
 
20
19
  return <TabsPrimitive.Root value={value} onValueChange={onValueChange}>
21
- <TabsPrimitive.List className={cn(
20
+ <TabsPrimitive.List className={cls(
22
21
  "flex text-sm font-medium text-center text-slate-800 dark:text-white max-w-full overflow-auto no-scrollbar",
23
22
  className)
24
23
  }>
@@ -42,19 +41,19 @@ export function Tab({
42
41
  }: TabProps) {
43
42
  return <TabsPrimitive.Trigger value={value}
44
43
  disabled={disabled}
45
- className={cn(focusedMixin,
44
+ className={cls(
46
45
  "border-b-2 border-transparent",
47
46
  "data-[state=active]:border-secondary",
48
47
  disabled
49
48
  ? "text-slate-400 dark:text-slate-500"
50
- : cn("text-slate-700 dark:text-slate-300",
49
+ : cls("text-slate-700 dark:text-slate-300",
51
50
  "data-[state=active]:text-slate-900 data-[state=active]:dark:text-white",
52
51
  "hover:text-slate-800 dark:hover:text-slate-200"),
53
52
  // disabled ? "text-slate-400 dark:text-slate-500" : "data-[state=active]:text-primary",
54
53
  // "data-[state=active]:bg-slate-50 data-[state=active]:dark:bg-slate-800",
55
54
  className)}>
56
- <div className={cn("uppercase inline-block p-2 px-4 m-2 rounded",
57
- "hover:bg-slate-100 dark:hover:bg-slate-800")}>
55
+ <div className={cls("uppercase inline-block p-2 px-4 m-2 rounded",
56
+ "hover:bg-slate-200 hover:bg-opacity-75 dark:hover:bg-slate-800")}>
58
57
  {children}
59
58
  </div>
60
59
  </TabsPrimitive.Trigger>;
@@ -7,10 +7,9 @@ import {
7
7
  fieldBackgroundInvisibleMixin,
8
8
  fieldBackgroundMixin,
9
9
  focusedInvisibleMixin,
10
- focusedMixin
11
10
  } from "../styles";
12
11
  import { InputLabel } from "./InputLabel";
13
- import { cn } from "../util";
12
+ import { cls } from "../util";
14
13
 
15
14
  export type InputType =
16
15
  "text"
@@ -40,7 +39,7 @@ export type TextFieldProps<T extends string | number> = {
40
39
  endAdornment?: React.ReactNode,
41
40
  autoFocus?: boolean,
42
41
  placeholder?: string,
43
- size?: "small" | "medium",
42
+ size?: "smallest" | "small" | "medium",
44
43
  className?: string,
45
44
  style?: React.CSSProperties,
46
45
  inputClassName?: string,
@@ -70,7 +69,6 @@ export function TextField<T extends string | number>({
70
69
  ...inputProps
71
70
  }: TextFieldProps<T>) {
72
71
 
73
- // eslint-disable-next-line react-hooks/rules-of-hooks
74
72
  const inputRef = inputRefProp ?? useRef(null);
75
73
 
76
74
  // @ts-ignore
@@ -106,13 +104,11 @@ export function TextField<T extends string | number>({
106
104
  placeholder={focused || hasValue || !label ? placeholder : undefined}
107
105
  autoFocus={autoFocus}
108
106
  rows={rows}
109
- // onFocus={() => setFocused(true)}
110
- // onBlur={() => setFocused(false)}
111
107
  value={value ?? ""}
112
108
  onChange={onChange}
113
109
  style={inputStyle}
114
- className={cn(
115
- invisible ? focusedInvisibleMixin : focusedMixin,
110
+ className={cls(
111
+ invisible ? focusedInvisibleMixin : "",
116
112
  "rounded-md resize-none w-full outline-none p-[32px] text-base bg-transparent min-h-[64px] px-3 pt-[28px]",
117
113
  disabled && "border border-transparent outline-none opacity-50 text-slate-600 dark:text-slate-500"
118
114
  )}
@@ -123,12 +119,12 @@ export function TextField<T extends string | number>({
123
119
  onWheel={type === "number" ? numberInputOnWheelPreventChange : undefined}
124
120
  disabled={disabled}
125
121
  style={inputStyle}
126
- className={cn(
122
+ className={cls(
127
123
  "w-full outline-none bg-transparent leading-normal px-3",
128
124
  "rounded-md",
129
- invisible ? focusedInvisibleMixin : focusedMixin,
125
+ invisible ? focusedInvisibleMixin : "",
130
126
  disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
131
- size === "small" ? "min-h-[48px]" : "min-h-[64px]",
127
+ size === "smallest" ? "min-h-[32px]" : (size === "small" ? "min-h-[48px]" : "min-h-[64px]"),
132
128
  label ? (size === "medium" ? "pt-[28px] pb-2" : "pt-4 pb-2") : "py-2",
133
129
  focused ? "text-text-primary dark:text-text-primary-dark" : "",
134
130
  endAdornment ? "pr-10" : "pr-3",
@@ -146,12 +142,13 @@ export function TextField<T extends string | number>({
146
142
 
147
143
  return (
148
144
  <div
149
- className={cn(
145
+ className={cls(
150
146
  "rounded-md relative max-w-full",
151
147
  invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin,
152
148
  disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin,
153
149
  error ? "border border-red-500 dark:border-red-600" : "",
154
150
  {
151
+ "min-h-[32px]": !invisible && size === "smallest",
155
152
  "min-h-[48px]": !invisible && size === "small",
156
153
  "min-h-[64px]": !invisible && size === "medium"
157
154
  },
@@ -160,7 +157,7 @@ export function TextField<T extends string | number>({
160
157
 
161
158
  {label && (
162
159
  <InputLabel
163
- className={cn(
160
+ className={cls(
164
161
  "pointer-events-none absolute",
165
162
  size === "medium" ? "top-1" : "-top-1",
166
163
  !error ? (focused ? "text-primary dark:text-primary" : "text-text-secondary dark:text-text-secondary-dark") : "text-red-500 dark:text-red-600",
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useLayoutEffect } from "react";
3
3
  import * as ReactDOM from "react-dom";
4
- import { cn, debounce } from "../util";
4
+ import { cls, debounce } from "../util";
5
5
 
6
6
  type State = {
7
7
  outerHeightStyle: number;
@@ -276,7 +276,7 @@ export const TextareaAutosize = React.forwardRef(function TextareaAutosize(
276
276
  />
277
277
  <textarea
278
278
  aria-hidden
279
- className={cn(props.className, props.shadowClassName)}
279
+ className={cls(props.className, props.shadowClassName)}
280
280
  readOnly
281
281
  ref={shadowRef}
282
282
  tabIndex={-1}
@@ -288,7 +288,7 @@ export const TextareaAutosize = React.forwardRef(function TextareaAutosize(
288
288
  />
289
289
  </React.Fragment>
290
290
  );
291
- });
291
+ }) as React.FC<TextareaAutosizeProps & { ref?: React.ForwardedRef<Element> }>;
292
292
 
293
293
  export type TextareaAutosizeProps = Omit<React.InputHTMLAttributes<HTMLTextAreaElement>, "onResize"> & {
294
294
 
@@ -1,34 +1,43 @@
1
1
  import React from "react";
2
2
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
3
 
4
- import { cn, useInjectStyles } from "../util";
4
+ import { cls } from "../util";
5
+ import { useInjectStyles } from "../hooks";
5
6
 
6
7
  export type TooltipProps = {
7
8
  open?: boolean,
9
+ defaultOpen?: boolean,
8
10
  onOpenChange?: (open: boolean) => void,
9
11
  side?: "top" | "bottom" | "left" | "right",
10
12
  align?: "start" | "center" | "end",
11
13
  sideOffset?: number,
12
14
  title?: string | React.ReactNode,
13
15
  delayDuration?: number;
14
- className?: string,
16
+ asChild?: boolean;
15
17
  tooltipClassName?: string,
18
+ tooltipStyle?: React.CSSProperties;
16
19
  children: React.ReactNode,
20
+ className?: string,
21
+ container?: HTMLElement,
17
22
  style?: React.CSSProperties;
18
23
  };
19
24
 
20
25
  export const Tooltip = ({
21
26
  open,
27
+ defaultOpen,
22
28
  side = "bottom",
23
- delayDuration = 250,
29
+ delayDuration = 200,
24
30
  sideOffset,
25
31
  align,
26
32
  onOpenChange,
27
33
  title,
28
- className,
29
- style,
30
34
  tooltipClassName,
31
- children
35
+ tooltipStyle,
36
+ children,
37
+ asChild = false,
38
+ container,
39
+ className,
40
+ style
32
41
  }: TooltipProps) => {
33
42
 
34
43
  useInjectStyles("Tooltip", styles);
@@ -36,20 +45,27 @@ export const Tooltip = ({
36
45
  if (!title)
37
46
  return <>{children}</>;
38
47
 
48
+ const trigger = asChild
49
+ ? <TooltipPrimitive.Trigger asChild={true}>
50
+ {children}
51
+ </TooltipPrimitive.Trigger>
52
+ : <TooltipPrimitive.Trigger asChild={true}>
53
+ <div style={style} className={className}>
54
+ {children}
55
+ </div>
56
+ </TooltipPrimitive.Trigger>;
57
+
39
58
  return (
40
59
  <TooltipPrimitive.Provider delayDuration={delayDuration}>
41
- <TooltipPrimitive.Root open={open} onOpenChange={onOpenChange}>
42
- <TooltipPrimitive.Trigger asChild>
43
- <div className={className} style={style}>
44
- {children}
45
- </div>
46
- </TooltipPrimitive.Trigger>
47
- <TooltipPrimitive.Portal>
60
+ <TooltipPrimitive.Root open={open} onOpenChange={onOpenChange} defaultOpen={defaultOpen}>
61
+ {trigger}
62
+ <TooltipPrimitive.Portal container={container}>
48
63
  <TooltipPrimitive.Content
49
- className={cn("TooltipContent",
64
+ className={cls("TooltipContent",
50
65
  "max-w-lg leading-relaxed",
51
66
  "z-50 rounded px-3 py-2 text-xs leading-none bg-slate-700 dark:bg-slate-800 bg-opacity-90 font-medium text-slate-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",
52
67
  tooltipClassName)}
68
+ style={tooltipStyle}
53
69
  sideOffset={sideOffset === undefined ? 4 : sideOffset}
54
70
  align={align}
55
71
  side={side}>
@@ -1,6 +1,5 @@
1
1
  import React, { ReactEventHandler } from "react";
2
- import { focusedMixin } from "../styles";
3
- import { cn } from "../util";
2
+ import { cls } from "../util";
4
3
 
5
4
  export type TextProps<C extends React.ElementType> = {
6
5
  align?: "center" | "inherit" | "justify" | "left" | "right";
@@ -43,21 +42,38 @@ const colorToClasses = {
43
42
  error: "text-red-600 dark:text-red-500"
44
43
  };
45
44
 
45
+ const gutterBottomClasses = {
46
+ h1: "mb-5",
47
+ h2: "mb-4",
48
+ h3: "mb-4",
49
+ h4: "mb-4",
50
+ h5: "mb-3",
51
+ h6: "mb-3",
52
+ subtitle1: "mb-3",
53
+ subtitle2: "mb-3",
54
+ body1: "mb-3",
55
+ body2: "mb-3",
56
+ inherit: "mb-3",
57
+ caption: "mb-2",
58
+ button: "mb-2",
59
+ label: "mb-2"
60
+ };
61
+
46
62
  const variantToClasses = {
47
- h1: "text-6xl font-headers font-light",
48
- h2: "text-5xl font-headers font-light",
49
- h3: "text-4xl font-headers font-normal",
50
- h4: "text-3xl font-headers font-normal",
51
- h5: "text-2xl font-headers font-normal",
52
- h6: "text-xl font-headers font-medium",
53
- subtitle1: "text-lg font-headers font-medium",
54
- subtitle2: "text-base font-headers font-medium",
55
- body1: "text-base",
56
- body2: "text-sm",
57
- label: "text-sm font-medium text-slate-500",
58
- inherit: "text-inherit",
59
- caption: "text-xs",
60
- button: "text-sm font-medium"
63
+ h1: "typography-h1",
64
+ h2: "typography-h2",
65
+ h3: "typography-h3",
66
+ h4: "typography-h4",
67
+ h5: "typography-h5",
68
+ h6: "typography-h6",
69
+ subtitle1: "typography-subtitle1",
70
+ subtitle2: "typography-subtitle2",
71
+ body1: "typography-body1",
72
+ body2: "typography-body2",
73
+ label: "typography-label",
74
+ inherit: "typography-inherit",
75
+ caption: "typography-caption",
76
+ button: "typography-button"
61
77
  };
62
78
 
63
79
  export function Typography<C extends React.ElementType>(
@@ -82,12 +98,11 @@ export function Typography<C extends React.ElementType>(
82
98
  (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) ||
83
99
  "span";
84
100
 
85
- const classes = cn(
86
- focusedMixin,
101
+ const classes = cls(
87
102
  variantToClasses[variant],
88
103
  color ? colorToClasses[color] : "",
89
104
  align !== "inherit" && `text-${align}`,
90
- gutterBottom && "mb-[0.35em]",
105
+ gutterBottom && gutterBottomClasses[variant],
91
106
  noWrap && "truncate",
92
107
  paragraph && "mb-3",
93
108
  className