@react-md/core 1.0.0-next.1 → 1.0.0-next.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/DefaultToastRenderer.tsx.html +166 -112
- package/coverage/lcov-report/Snackbar.tsx.html +360 -402
- package/coverage/lcov-report/Toast.tsx.html +868 -0
- package/coverage/lcov-report/ToastManager.tsx.html +1783 -0
- package/coverage/lcov-report/ToastManagerProvider.tsx.html +216 -216
- package/coverage/lcov-report/icon/FontIcon.tsx.html +28 -28
- package/coverage/lcov-report/icon/index.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/snackbar/Snackbar.tsx.html +55 -97
- package/coverage/lcov-report/snackbar/Toast.tsx.html +546 -501
- package/coverage/lcov-report/snackbar/ToastManager.tsx.html +269 -269
- package/coverage/lcov-report/snackbar/ToastManagerProvider.tsx.html +23 -23
- package/coverage/lcov-report/snackbar/index.html +59 -14
- package/coverage/lcov-report/snackbar/snackbarStyles.ts.html +12 -87
- package/coverage/lcov-report/snackbar/toastStyles.ts.html +206 -146
- package/coverage/lcov-report/snackbar/useCurrentToastActions.ts.html +226 -0
- package/coverage/lcov-report/snackbarStyles.ts.html +46 -121
- package/coverage/lcov-report/transition/config.ts.html +5 -5
- package/coverage/lcov-report/transition/index.html +1 -1
- package/coverage/lcov-report/typography/Typography.tsx.html +108 -402
- package/coverage/lcov-report/typography/index.html +10 -10
- package/dist/_core.scss +34 -1
- package/dist/_utils.scss +57 -0
- package/dist/app-bar/_app-bar.scss +15 -23
- package/dist/avatar/_avatar.scss +25 -34
- package/dist/badge/_badge.scss +71 -44
- package/dist/box/_box.scss +18 -29
- package/dist/button/_button.scss +50 -62
- package/dist/card/_card.scss +14 -23
- package/dist/chip/_chip.scss +33 -46
- package/dist/dialog/_dialog.scss +95 -93
- package/dist/divider/Divider.d.ts +0 -1
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/_divider.scss +33 -43
- package/dist/form/Label.d.ts +5 -5
- package/dist/form/Label.js.map +1 -1
- package/dist/form/TextArea.js +1 -1
- package/dist/form/TextArea.js.map +1 -1
- package/dist/form/TextFieldContainerStyles.d.ts +7 -7
- package/dist/form/TextFieldContainerStyles.js.map +1 -1
- package/dist/form/_form.scss +200 -203
- package/dist/form/textAreaStyles.d.ts +2 -2
- package/dist/form/textAreaStyles.js.map +1 -1
- package/dist/form/types.d.ts +0 -2
- package/dist/form/types.js.map +1 -1
- package/dist/icon/_icon.scss +31 -47
- package/dist/interaction/_interaction.scss +47 -57
- package/dist/layout/_layout.scss +14 -19
- package/dist/link/_link.scss +15 -23
- package/dist/list/_list.scss +53 -63
- package/dist/menu/_menu.scss +16 -27
- package/dist/overlay/_overlay.scss +14 -19
- package/dist/progress/_progress.scss +25 -30
- package/dist/segmented-button/_segmented-button.scss +32 -43
- package/dist/sheet/_sheet.scss +24 -42
- package/dist/snackbar/DefaultToastRenderer.js +1 -1
- package/dist/snackbar/DefaultToastRenderer.js.map +1 -1
- package/dist/snackbar/Snackbar.d.ts +1 -3
- package/dist/snackbar/Snackbar.js +2 -3
- package/dist/snackbar/Snackbar.js.map +1 -1
- package/dist/snackbar/Toast.d.ts +1 -1
- package/dist/snackbar/Toast.js +5 -1
- package/dist/snackbar/Toast.js.map +1 -1
- package/dist/snackbar/ToastManager.d.ts +2 -1
- package/dist/snackbar/ToastManager.js +1 -1
- package/dist/snackbar/ToastManager.js.map +1 -1
- package/dist/snackbar/_snackbar.scss +15 -23
- package/dist/table/_table.scss +55 -70
- package/dist/tabs/_tabs.scss +25 -30
- package/dist/theme/_theme.scss +31 -89
- package/dist/tooltip/_tooltip.scss +16 -25
- package/dist/transition/_transition.scss +38 -37
- package/dist/tree/_tree.scss +102 -109
- package/dist/typography/_typography.scss +17 -22
- package/dist/window-splitter/_window-splitter.scss +19 -45
- package/package.json +1 -1
- package/src/_core.scss +34 -1
- package/src/_utils.scss +57 -0
- package/src/app-bar/_app-bar.scss +15 -23
- package/src/avatar/_avatar.scss +25 -34
- package/src/badge/_badge.scss +71 -44
- package/src/box/_box.scss +18 -29
- package/src/button/_button.scss +50 -62
- package/src/card/_card.scss +14 -23
- package/src/chip/_chip.scss +33 -46
- package/src/dialog/_dialog.scss +95 -93
- package/src/divider/Divider.tsx +0 -1
- package/src/divider/_divider.scss +33 -43
- package/src/form/Label.tsx +5 -5
- package/src/form/TextArea.tsx +1 -1
- package/src/form/TextFieldContainerStyles.ts +7 -7
- package/src/form/_form.scss +200 -203
- package/src/form/textAreaStyles.ts +2 -2
- package/src/form/types.ts +0 -2
- package/src/icon/_icon.scss +31 -47
- package/src/interaction/_interaction.scss +47 -57
- package/src/layout/_layout.scss +14 -19
- package/src/link/_link.scss +15 -23
- package/src/list/_list.scss +53 -63
- package/src/menu/_menu.scss +16 -27
- package/src/overlay/_overlay.scss +14 -19
- package/src/progress/_progress.scss +25 -30
- package/src/segmented-button/_segmented-button.scss +32 -43
- package/src/sheet/_sheet.scss +24 -42
- package/src/snackbar/DefaultToastRenderer.tsx +1 -1
- package/src/snackbar/Snackbar.tsx +17 -25
- package/src/snackbar/Toast.tsx +7 -2
- package/src/snackbar/ToastManager.tsx +3 -2
- package/src/snackbar/__tests__/Snackbar.tsx +12 -11
- package/src/snackbar/__tests__/ToastManagerProvider.tsx +20 -42
- package/src/snackbar/__tests__/__snapshots__/Snackbar.tsx.snap +127 -27
- package/src/snackbar/__tests__/__snapshots__/ToastManagerProvider.tsx.snap +23 -8
- package/src/snackbar/_snackbar.scss +15 -23
- package/src/table/_table.scss +55 -70
- package/src/tabs/_tabs.scss +25 -30
- package/src/theme/_theme.scss +31 -89
- package/src/tooltip/_tooltip.scss +16 -25
- package/src/transition/_transition.scss +38 -37
- package/src/tree/_tree.scss +102 -109
- package/src/typography/_typography.scss +17 -22
- package/src/window-splitter/_window-splitter.scss +19 -45
- package/.turbo/turbo-lint.log +0 -12
- package/.turbo/turbo-test.log +0 -166
- package/.turbo/turbo-typecheck.log +0 -4
- package/dist/divider/VerticalDivider.d.ts +0 -32
- package/dist/divider/useVerticalDividerHeight.d.ts +0 -37
- package/dist/icon/MaterialIconsProvider.d.ts +0 -12
- package/dist/icon/MaterialIconsProvider.js +0 -17
- package/dist/icon/MaterialIconsProvider.js.map +0 -1
- package/dist/icon/MaterialSymbolsProvider.d.ts +0 -145
- package/dist/icon/MaterialSymbolsProvider.js +0 -60
- package/dist/icon/MaterialSymbolsProvider.js.map +0 -1
- package/dist/link/LinkProvider.d.ts +0 -29
- package/dist/menu/menuConfig.d.ts +0 -60
- package/dist/tooltip/useOverflowTooltip.d.ts +0 -61
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { type SheetPosition, type SheetVerticalSize } from "../sheet/styles.js";
|
|
3
|
-
/**
|
|
4
|
-
* This allows the menu to be conditionally rendered as a `Sheet` instead of a
|
|
5
|
-
* menu.
|
|
6
|
-
*
|
|
7
|
-
* - `false` - always render as a `Menu`
|
|
8
|
-
* - `true` - always render as a `Sheet`
|
|
9
|
-
* - `"phone"` - render as a sheet only when the {@link AppSize} is considered
|
|
10
|
-
* phone (`isPhone === true`).
|
|
11
|
-
*
|
|
12
|
-
* @defaultValue `false`
|
|
13
|
-
* @remarks \@since 5.0.0
|
|
14
|
-
*/
|
|
15
|
-
export type RenderMenuAsSheet = boolean | "phone";
|
|
16
|
-
/**
|
|
17
|
-
* @remarks \@since 5.0.0
|
|
18
|
-
* @remarks \@since 6.0.0 No longer includes the `horizontal` flag and is no
|
|
19
|
-
* longer a context provider.
|
|
20
|
-
*/
|
|
21
|
-
export interface MenuConfiguration {
|
|
22
|
-
/** {@inheritDoc RenderMenuAsSheet} */
|
|
23
|
-
renderAsSheet?: RenderMenuAsSheet;
|
|
24
|
-
/**
|
|
25
|
-
* @see {@link SheetPosition}
|
|
26
|
-
* @defaultValue `"bottom"`
|
|
27
|
-
*/
|
|
28
|
-
sheetPosition?: SheetPosition;
|
|
29
|
-
/**
|
|
30
|
-
* @see {@link SheetVerticalSize}
|
|
31
|
-
* @defaultValue `"touch"`
|
|
32
|
-
*/
|
|
33
|
-
sheetVerticalSize?: SheetVerticalSize;
|
|
34
|
-
/**
|
|
35
|
-
* Any children to render above the sheet's menu implementation. This would
|
|
36
|
-
* normally be something like a `<DialogHeader>` or `AppBar`.
|
|
37
|
-
*
|
|
38
|
-
* @defaultValue `null`
|
|
39
|
-
*/
|
|
40
|
-
sheetHeader?: ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Any children to render below the sheet's menu implementation. This would
|
|
43
|
-
* normally be something like a `<DialogFooter>`.
|
|
44
|
-
*
|
|
45
|
-
* @defaultValue `null`
|
|
46
|
-
*/
|
|
47
|
-
sheetFooter?: ReactNode;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @remarks \@since 6.0.0
|
|
51
|
-
*/
|
|
52
|
-
export type MenuConfig = Required<MenuConfiguration>;
|
|
53
|
-
/**
|
|
54
|
-
* @remarks \@since 6.0.0
|
|
55
|
-
*/
|
|
56
|
-
export declare const MENU_CONFIG: MenuConfig;
|
|
57
|
-
/**
|
|
58
|
-
* @remarks \@since 6.0.0
|
|
59
|
-
*/
|
|
60
|
-
export declare function getMenuConfig<N extends keyof MenuConfig>(name: N, override?: MenuConfig[N]): MenuConfig[N];
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { type Ref, type RefCallback } from "react";
|
|
2
|
-
import { type TooltipImplementation, type TooltipOptions } from "./useTooltip.js";
|
|
3
|
-
/**
|
|
4
|
-
* @remarks \@since 6.0.0
|
|
5
|
-
*/
|
|
6
|
-
export interface OverflowTooltipOptions extends TooltipOptions {
|
|
7
|
-
elementRef?: Ref<HTMLElement>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* @remarks \@since 6.0.0
|
|
11
|
-
*/
|
|
12
|
-
export interface OverflowTooltipImplementation extends TooltipImplementation {
|
|
13
|
-
nodeRef: RefCallback<HTMLElement>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* This hook will ensure that a tooltip will only appear when text has
|
|
17
|
-
* overflown by checking the size with the {@link useResizeObserver}.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```tsx
|
|
21
|
-
* import {
|
|
22
|
-
* cssUtils,
|
|
23
|
-
* Link,
|
|
24
|
-
* Tooltip,
|
|
25
|
-
* useOverflowTooltip,
|
|
26
|
-
* type LinkProps,
|
|
27
|
-
* } from "@react-md/core";
|
|
28
|
-
* import { type ReactElement } from "react";
|
|
29
|
-
*
|
|
30
|
-
* function NavigationLink(props: LinkProps): ReactElement {
|
|
31
|
-
* const { children, ...remaining } = props;
|
|
32
|
-
* const { nodeRef, elementProps, tooltipProps } = useOverflowTooltip(remaining);
|
|
33
|
-
*
|
|
34
|
-
* return (
|
|
35
|
-
* <Link {...remaining} {...elementProps} style={{ width: "100%" }}>
|
|
36
|
-
* <span ref={nodeRef} className={cssUtils({ textOverflow: "ellipsis" })}>
|
|
37
|
-
* {children}
|
|
38
|
-
* </span>
|
|
39
|
-
* <Tooltip {...tooltipProps}>
|
|
40
|
-
* {children}
|
|
41
|
-
* </Tooltip>
|
|
42
|
-
* </Link>
|
|
43
|
-
* );
|
|
44
|
-
* }
|
|
45
|
-
*
|
|
46
|
-
* function Example(): ReactElement {
|
|
47
|
-
* return (
|
|
48
|
-
* <div style={{ width: "10rem", overflow: "auto" }}>
|
|
49
|
-
* <NavigationLink href="/">Home</NavigationLink>
|
|
50
|
-
* <NavigationLink href="/some-path">
|
|
51
|
-
* Super long text that will be truncated with ellipsis and
|
|
52
|
-
* have a tooltip appear
|
|
53
|
-
* </NavigationLink>
|
|
54
|
-
* </div>
|
|
55
|
-
* );
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @remarks \@since 6.0.0
|
|
60
|
-
*/
|
|
61
|
-
export declare function useOverflowTooltip(options?: OverflowTooltipOptions): OverflowTooltipImplementation;
|