@react-md/core 7.0.0 → 7.0.2

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 (47) hide show
  1. package/dist/_base.scss +10 -4
  2. package/dist/form/utils.js +1 -1
  3. package/dist/form/utils.js.map +1 -1
  4. package/dist/icon/_icon.scss +19 -0
  5. package/dist/icon/configureMaterialSymbols.d.ts +1 -0
  6. package/dist/icon/configureMaterialSymbols.js +64 -0
  7. package/dist/icon/configureMaterialSymbols.js.map +1 -0
  8. package/dist/icon/getMaterialSymbolOption.d.ts +6 -0
  9. package/dist/icon/getMaterialSymbolOption.js +14 -0
  10. package/dist/icon/getMaterialSymbolOption.js.map +1 -0
  11. package/dist/icon/getMaterialSymbolsUrl.d.ts +58 -0
  12. package/dist/icon/getMaterialSymbolsUrl.js +32 -0
  13. package/dist/icon/getMaterialSymbolsUrl.js.map +1 -0
  14. package/dist/icon/symbols.d.ts +4 -0
  15. package/dist/icon/symbols.js +25 -0
  16. package/dist/icon/symbols.js.map +1 -0
  17. package/dist/layout/useExpandableLayout.d.ts +2 -2
  18. package/dist/layout/useExpandableLayout.js.map +1 -1
  19. package/dist/menu/MenuItemButton.js +1 -0
  20. package/dist/menu/MenuItemButton.js.map +1 -1
  21. package/dist/menu/MenuItemFileInput.js +1 -2
  22. package/dist/menu/MenuItemFileInput.js.map +1 -1
  23. package/dist/menu/MenuItemInputToggle.js +1 -1
  24. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  25. package/dist/positioning/utils.js +0 -4
  26. package/dist/positioning/utils.js.map +1 -1
  27. package/dist/theme/_theme.scss +42 -3
  28. package/dist/transition/useMaxWidthTransition.d.ts +1 -1
  29. package/dist/transition/useMaxWidthTransition.js.map +1 -1
  30. package/dist/types.d.ts +5 -0
  31. package/dist/types.js.map +1 -1
  32. package/dist/window-splitter/styles.d.ts +2 -2
  33. package/dist/window-splitter/styles.js.map +1 -1
  34. package/package.json +51 -42
  35. package/src/form/utils.ts +1 -1
  36. package/src/icon/configureMaterialSymbols.tsx +25 -0
  37. package/src/icon/getMaterialSymbolOption.ts +20 -0
  38. package/src/icon/getMaterialSymbolsUrl.ts +112 -0
  39. package/src/icon/symbols.ts +26 -0
  40. package/src/layout/useExpandableLayout.ts +6 -2
  41. package/src/menu/MenuItemButton.tsx +1 -0
  42. package/src/menu/MenuItemFileInput.tsx +1 -2
  43. package/src/menu/MenuItemInputToggle.tsx +1 -1
  44. package/src/positioning/utils.ts +0 -4
  45. package/src/transition/useMaxWidthTransition.ts +1 -1
  46. package/src/types.ts +6 -0
  47. package/src/window-splitter/styles.ts +2 -2
@@ -9,7 +9,11 @@ import { type AppSize } from "../media-queries/appSize.js";
9
9
  import { MEDIA_QUERY_CONFIG } from "../media-queries/config.js";
10
10
  import { useMediaQuery } from "../media-queries/useMediaQuery.js";
11
11
  import { type CSSTransitionElementProps } from "../transition/types.js";
12
- import { type CssPosition, type UseStateInitializer } from "../types.js";
12
+ import {
13
+ type CssPosition,
14
+ type LiteralStringUnion,
15
+ type UseStateInitializer,
16
+ } from "../types.js";
13
17
  import { useToggle } from "../useToggle.js";
14
18
  import { useDevEffect } from "../utils/useDevEffect.js";
15
19
  import { type LayoutNavProps } from "./LayoutNav.js";
@@ -75,7 +79,7 @@ export interface ExpandableLayoutOptions extends TemporaryLayoutOptions {
75
79
  *
76
80
  * @defaultValue `"tablet"`
77
81
  */
78
- temporaryUntil?: "tablet" | "desktop" | (string & {});
82
+ temporaryUntil?: LiteralStringUnion<"tablet" | "desktop">;
79
83
  }
80
84
 
81
85
  /**
@@ -120,6 +120,7 @@ export function MenuItemButton(props: MenuItemButtonProps): ReactElement {
120
120
  aria-expanded={visible || undefined}
121
121
  id={id}
122
122
  ref={ref}
123
+ height={height}
123
124
  rightAddon={rightAddon}
124
125
  onClick={(event) => {
125
126
  onClick(event);
@@ -98,7 +98,7 @@ export function MenuItemFileInput(props: MenuItemFileInputProps): ReactElement {
98
98
  // elements to be removed from the DOM, a normal `<input type="file" />`
99
99
  // can't be used. Instead, create a temporary file input element and
100
100
  // click it to trigger the file upload behavior.
101
- let input: HTMLInputElement | null = document.createElement("input");
101
+ const input = document.createElement("input");
102
102
  input.type = "file";
103
103
  if (accept) {
104
104
  input.accept = accept;
@@ -114,7 +114,6 @@ export function MenuItemFileInput(props: MenuItemFileInputProps): ReactElement {
114
114
  // @ts-expect-error
115
115
  input.addEventListener("change", onChange);
116
116
  input.click();
117
- input = null;
118
117
  }}
119
118
  >
120
119
  {children}
@@ -181,7 +181,7 @@ export function MenuItemInputToggle(
181
181
  MenuItemCheckboxProps & { type: "checkbox" | "radio" | "switch" };
182
182
  const id = useEnsuredId(propId, "menu-item");
183
183
 
184
- let icon = propIcon;
184
+ let icon: ReactElement;
185
185
  if (type === "switch") {
186
186
  icon = (
187
187
  <SwitchTrack
@@ -228,8 +228,6 @@ export function getTransformOrigin(options: TransformOriginOptions): string {
228
228
  case "inner-right":
229
229
  x = "100%";
230
230
  break;
231
- default:
232
- x = "0";
233
231
  }
234
232
 
235
233
  let y = "0";
@@ -248,8 +246,6 @@ export function getTransformOrigin(options: TransformOriginOptions): string {
248
246
  case "top":
249
247
  y = "0";
250
248
  break;
251
- default:
252
- y = "0";
253
249
  }
254
250
  }
255
251
 
@@ -7,7 +7,7 @@ import { Children, cloneElement, isValidElement } from "react";
7
7
  import { maxWidthTransition } from "./maxWidthTransition.js";
8
8
 
9
9
  declare module "react" {
10
- interface CSSProperites {
10
+ interface CSSProperties {
11
11
  "--rmd-max-width"?: string | number;
12
12
  "--rmd-max-width-gap"?: string | number;
13
13
  }
package/src/types.ts CHANGED
@@ -240,6 +240,12 @@ export type OverridableStringUnion<
240
240
  [K in keyof Overrides]: Overrides[K] extends false ? never : K;
241
241
  }[keyof Overrides];
242
242
 
243
+ /**
244
+ * @see https://github.com/microsoft/TypeScript/issues/29729#issuecomment-471566609
245
+ * @since 7.1.0
246
+ */
247
+ export type LiteralStringUnion<T extends U, U = string> = T | (U & {});
248
+
243
249
  /**
244
250
  * @since 6.2.0
245
251
  */
@@ -12,8 +12,8 @@ declare module "react" {
12
12
  "--rmd-window-splitter-y"?: string | number;
13
13
  "--rmd-window-splitter-z"?: string | number;
14
14
  "--rmd-window-splitter-position"?: string | number;
15
- "--rmd-window-splitter-backgrond-color"?: string;
16
- "--rmd-window-splitter-inactive-backgrond-color"?: string;
15
+ "--rmd-window-splitter-background-color"?: string;
16
+ "--rmd-window-splitter-inactive-background-color"?: string;
17
17
  "--rmd-window-splitter-opacity"?: string | number;
18
18
  }
19
19
  }