@ufoui/core 0.0.5 → 0.0.40
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/assets/icons.d.ts +8 -2
- package/components/accordion/accordion.d.ts +31 -3
- package/components/accordion/accordionItem.d.ts +31 -3
- package/components/badge/badge.d.ts +2 -2
- package/components/base/boxBase.d.ts +14 -36
- package/components/base/buttonBase.d.ts +4 -4
- package/components/base/checkboxBase.d.ts +2 -2
- package/components/base/dialogBase.d.ts +111 -13
- package/components/base/fieldBase.d.ts +1 -2
- package/components/base/textBase.d.ts +1 -2
- package/components/breadcrumbs/breadcrumbs.d.ts +48 -0
- package/components/calendar/calendar.d.ts +23 -0
- package/components/calendar/calendarUtils.d.ts +18 -0
- package/components/card/card.d.ts +2 -2
- package/components/collapse/collapse.d.ts +15 -20
- package/components/dialogs/dialog.d.ts +1 -1
- package/components/dialogs/dialogActions.d.ts +19 -7
- package/components/dialogs/dialogActions.guards.d.ts +15 -0
- package/components/dialogs/dialogContent.d.ts +7 -1
- package/components/dialogs/dialogHeader.d.ts +60 -0
- package/components/dialogs/dialogTitle.d.ts +9 -5
- package/components/dialogs/drawer.d.ts +1 -1
- package/components/dialogs/index.d.ts +1 -0
- package/components/fieldset/fieldset.d.ts +1 -1
- package/components/link/link.d.ts +58 -0
- package/components/list/list.d.ts +1 -1
- package/components/menu/menu.d.ts +2 -2
- package/components/rating/rating.d.ts +68 -0
- package/components/slider/slider.d.ts +11 -0
- package/components/switch/switch.d.ts +2 -10
- package/components/themeProvider/themeProvider.d.ts +10 -15
- package/components/toast/toast.d.ts +18 -4
- package/components/toast/toastViewport.d.ts +4 -3
- package/components/tooltip/tooltip.d.ts +2 -2
- package/context/selectionContext.d.ts +18 -17
- package/hooks/index.d.ts +3 -1
- package/hooks/useAnimate.d.ts +36 -16
- package/hooks/useFocusTrap.d.ts +32 -0
- package/hooks/useFocusVisible.d.ts +16 -14
- package/hooks/useResizeObserver.d.ts +7 -3
- package/hooks/useRovingFocus.d.ts +30 -0
- package/hooks/useSelection.d.ts +10 -7
- package/hooks/useSelectionState.d.ts +29 -0
- package/hooks/useSliderKeys.d.ts +41 -0
- package/index.css +1 -1
- package/index.d.ts +4 -8
- package/index.js +4782 -0
- package/internal/controlGrid/controlGrid.d.ts +32 -0
- package/internal/controlLabel/controlLabel.d.ts +31 -0
- package/internal/description/description.d.ts +18 -0
- package/internal/icon/icon.d.ts +28 -0
- package/internal/index.d.ts +7 -0
- package/internal/inlineTooltip/index.d.ts +1 -0
- package/internal/inlineTooltip/inlineTooltipManager.d.ts +3 -3
- package/internal/slots/slot.d.ts +44 -0
- package/internal/stateLayer/stateLayer.d.ts +33 -0
- package/package.json +12 -3
- package/types/dialog.d.ts +37 -0
- package/types/index.d.ts +1 -0
- package/types/motion.d.ts +2 -2
- package/types/theme.d.ts +0 -30
- package/utils/applyThemeTokens.d.ts +10 -0
- package/utils/calculateFloatingPosition.d.ts +3 -3
- package/utils/color.d.ts +61 -216
- package/utils/colorRegistry.d.ts +44 -0
- package/utils/controlStyle.d.ts +8 -8
- package/utils/flatChildren.d.ts +17 -0
- package/utils/generateMaterialColors.d.ts +7 -7
- package/utils/getWrapperStyle.d.ts +53 -0
- package/utils/index.d.ts +5 -1
- package/utils/renderPortal.d.ts +30 -0
- package/utils/toasts/ensureViewport.d.ts +6 -1
- package/utils/toasts/toast.d.ts +66 -10
- package/utils/toasts/toastStore.d.ts +55 -1
- package/utils/utils.d.ts +67 -55
- package/hooks/useFocusState.d.ts +0 -16
- package/index.mjs +0 -4649
- package/internal/inlineTooltip/inlineTooltip.d.ts +0 -11
- package/internal/inlineTooltip/inlineTooltip2.d.ts +0 -10
- package/utils/generateSchemes.d.ts +0 -32
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ElementTextPlacement } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the ControlGrid component.
|
|
5
|
+
*
|
|
6
|
+
* Layout container for form control, label and description.
|
|
7
|
+
*
|
|
8
|
+
* @category Slot
|
|
9
|
+
*/
|
|
10
|
+
export interface ControlGridProps {
|
|
11
|
+
/** Main control element such as checkbox, switch or slider. */
|
|
12
|
+
control?: ReactNode;
|
|
13
|
+
/** Label displayed next to the control. */
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
/** Supporting text such as description or error message. */
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
/** Placement of label relative to the control. */
|
|
18
|
+
textPlacement: ElementTextPlacement;
|
|
19
|
+
/** Additional root class name. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Spans description across all grid columns. */
|
|
22
|
+
spanDesc?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Layout helper that arranges control, label and description.
|
|
26
|
+
*
|
|
27
|
+
* @function
|
|
28
|
+
* @param props Component properties.
|
|
29
|
+
*
|
|
30
|
+
* @category Slot
|
|
31
|
+
*/
|
|
32
|
+
export declare const ControlGrid: import('react').ForwardRefExoticComponent<ControlGridProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ElementType, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { ElementFont } from '../../utils';
|
|
3
|
+
export interface ControlLabelProps {
|
|
4
|
+
/** Label content. */
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
/** ID of the associated control element. Used when tag is 'label'. */
|
|
7
|
+
htmlFor?: string;
|
|
8
|
+
/** DOM id applied to the label element. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Reference to a control element that should receive focus when the label is clicked. */
|
|
11
|
+
focusRef?: RefObject<HTMLElement>;
|
|
12
|
+
/** Displays a required indicator next to the label. */
|
|
13
|
+
required?: boolean;
|
|
14
|
+
/** Font applied to the label text. */
|
|
15
|
+
font?: ElementFont;
|
|
16
|
+
/** HTML tag used to render the label element. Default: 'label'. */
|
|
17
|
+
tag?: ElementType;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a label for form controls.
|
|
21
|
+
*
|
|
22
|
+
* Supports both native label behaviour and ARIA labeling for custom controls.
|
|
23
|
+
* When tag is 'label', htmlFor associates the label with a form element.
|
|
24
|
+
* When focusRef is provided, clicking the label focuses the referenced control.
|
|
25
|
+
*
|
|
26
|
+
* @function
|
|
27
|
+
* @param props Component properties.
|
|
28
|
+
*
|
|
29
|
+
* @category Slot
|
|
30
|
+
*/
|
|
31
|
+
export declare const ControlLabel: ({ label, htmlFor, id, required, font, focusRef, tag: Tag, }: ControlLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface DescriptionProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Supporting description text. */
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
/** Error message text. Overrides description when present. */
|
|
6
|
+
error?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders supporting text such as description or error message.
|
|
10
|
+
*
|
|
11
|
+
* Error message takes precedence over description.
|
|
12
|
+
*
|
|
13
|
+
* @function
|
|
14
|
+
* @param props Component properties.
|
|
15
|
+
*
|
|
16
|
+
* @category Slot
|
|
17
|
+
*/
|
|
18
|
+
export declare const Description: ({ description, error, ...rest }: DescriptionProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SurfaceColor } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link Icon} wrapper.
|
|
5
|
+
*
|
|
6
|
+
* @category Internal components
|
|
7
|
+
*/
|
|
8
|
+
export interface IconProps {
|
|
9
|
+
/** Icon graphic or element rendered inside the wrapper. */
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
/** Additional class names merged with the base `uui-icon` token. */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Theme surface token as CSS `color` (for `currentColor` SVG). */
|
|
14
|
+
color?: SurfaceColor;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders icon content with the shared `uui-icon` layout class.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @function
|
|
21
|
+
* @param props Component properties.
|
|
22
|
+
*
|
|
23
|
+
* @category Internal components
|
|
24
|
+
*/
|
|
25
|
+
export declare const Icon: {
|
|
26
|
+
({ icon, className, color }: IconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './inlineTooltip';
|
|
2
|
+
export * from './slots/slot';
|
|
3
|
+
export * from './stateLayer/stateLayer';
|
|
4
|
+
export * from './controlGrid/controlGrid';
|
|
5
|
+
export * from './controlLabel/controlLabel';
|
|
6
|
+
export * from './description/description';
|
|
7
|
+
export * from './icon/icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './inlineTooltipManager';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { default as React, HTMLProps, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementPlacement } from '../../utils';
|
|
3
3
|
interface InlineTooltipManagerProps extends HTMLProps<HTMLSpanElement> {
|
|
4
4
|
triggerRef: React.RefObject<HTMLElement>;
|
|
5
5
|
tooltip: ReactElement;
|
|
6
|
-
align:
|
|
6
|
+
align: ElementPlacement;
|
|
7
7
|
}
|
|
8
8
|
export declare const InlineTooltipManager: {
|
|
9
|
-
({ tooltip, align, triggerRef
|
|
9
|
+
({ tooltip, align, triggerRef }: InlineTooltipManagerProps): React.ReactPortal | null;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Slot component.
|
|
4
|
+
*
|
|
5
|
+
* @category Slot
|
|
6
|
+
*/
|
|
7
|
+
interface SlotProps {
|
|
8
|
+
/** Element rendered before the content. */
|
|
9
|
+
start?: ReactNode;
|
|
10
|
+
/** Element rendered after the content. */
|
|
11
|
+
end?: ReactNode;
|
|
12
|
+
/** Main slot content. */
|
|
13
|
+
content: ReactNode;
|
|
14
|
+
/** Root class name. */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Layout helper that renders start, content, and end regions.
|
|
19
|
+
*
|
|
20
|
+
* @function
|
|
21
|
+
* @param props Component properties.
|
|
22
|
+
*
|
|
23
|
+
* @category Slot
|
|
24
|
+
*/
|
|
25
|
+
export declare const Slot: ({ start, end, content, className }: SlotProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
/**
|
|
27
|
+
* Slot wrapper for leading content.
|
|
28
|
+
*
|
|
29
|
+
* @function
|
|
30
|
+
* @param props Component properties.
|
|
31
|
+
*
|
|
32
|
+
* @category Slot
|
|
33
|
+
*/
|
|
34
|
+
export declare const Leading: (props: SlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* Slot wrapper for trailing content.
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @param props Component properties.
|
|
40
|
+
*
|
|
41
|
+
* @category Slot
|
|
42
|
+
*/
|
|
43
|
+
export declare const Trailing: (props: SlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SurfaceColor } from '../../utils';
|
|
2
|
+
/**
|
|
3
|
+
* Props for StateLayer component.
|
|
4
|
+
*
|
|
5
|
+
* @category Internal components
|
|
6
|
+
*/
|
|
7
|
+
export interface StateLayerProps {
|
|
8
|
+
/** Background color token. */
|
|
9
|
+
color?: SurfaceColor;
|
|
10
|
+
/** Additional class name. */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* StateLayer component.
|
|
15
|
+
*
|
|
16
|
+
* Renders a visual state layer used for hover, focus, pressed and selected effects.
|
|
17
|
+
*
|
|
18
|
+
* @param color Background color token.
|
|
19
|
+
* @param className Additional class name.
|
|
20
|
+
*
|
|
21
|
+
* @function
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <Component>
|
|
25
|
+
* <StateLayer />
|
|
26
|
+
* </Component>
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <StateLayer color="primary" />
|
|
30
|
+
*
|
|
31
|
+
* @category Internal components
|
|
32
|
+
*/
|
|
33
|
+
export declare const StateLayer: ({ color, className }: StateLayerProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ufoui/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"description": "Lightweight Material Design 3 UI components for React",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
@@ -14,10 +14,19 @@
|
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
16
16
|
"react",
|
|
17
|
+
"react-components",
|
|
17
18
|
"components",
|
|
19
|
+
"material-design",
|
|
20
|
+
"material-design-3",
|
|
21
|
+
"md3",
|
|
22
|
+
"material-you",
|
|
18
23
|
"ui",
|
|
24
|
+
"ui-kit",
|
|
25
|
+
"component-library",
|
|
26
|
+
"typescript",
|
|
27
|
+
"esm",
|
|
19
28
|
"ufoui",
|
|
20
|
-
"
|
|
29
|
+
"ufo-ui"
|
|
21
30
|
],
|
|
22
31
|
"peerDependencies": {
|
|
23
32
|
"react": "^18.0.0",
|
|
@@ -35,4 +44,4 @@
|
|
|
35
44
|
"./style.css": "./index.css",
|
|
36
45
|
"./style": "./index.css"
|
|
37
46
|
}
|
|
38
|
-
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MotionAnimation } from './motion';
|
|
2
|
+
/**
|
|
3
|
+
* Layout mode for the DialogBase component.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Determines dialog placement and sizing:
|
|
7
|
+
* - `'basic'` - centered dialog
|
|
8
|
+
* - `'fullscreen'` - full viewport
|
|
9
|
+
* - `'dockLeft'` / `'dockRight'` / `'dockTop'` / `'dockBottom'` - edge-docked panels
|
|
10
|
+
*
|
|
11
|
+
* @category Dialog
|
|
12
|
+
*/
|
|
13
|
+
export type DialogType = 'basic' | 'fullscreen' | 'dockRight' | 'dockLeft' | 'dockTop' | 'dockBottom';
|
|
14
|
+
/**
|
|
15
|
+
* Animation preset for open and close transitions.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Use `'none'` to disable motion. Otherwise uses a {@link MotionAnimation} value.
|
|
19
|
+
* When omitted, a default animation is chosen for the current layout mode.
|
|
20
|
+
*
|
|
21
|
+
* @category Dialog
|
|
22
|
+
*/
|
|
23
|
+
export type DialogAnimation = 'none' | MotionAnimation;
|
|
24
|
+
/**
|
|
25
|
+
* Icon slot within dialog layout.
|
|
26
|
+
*
|
|
27
|
+
* Defines where the icon is rendered inside the dialog structure.
|
|
28
|
+
*
|
|
29
|
+
* Slots:
|
|
30
|
+
* - **leading** – inline with the title
|
|
31
|
+
* - **top** – placed above the title in the header
|
|
32
|
+
* - **contentLeft** – placed on the left side of the content area
|
|
33
|
+
* - **contentRight** – placed on the right side of the content area
|
|
34
|
+
*
|
|
35
|
+
* @category Dialog
|
|
36
|
+
*/
|
|
37
|
+
export type DialogIconSlot = 'leading' | 'top' | 'contentLeft' | 'contentRight';
|
package/types/index.d.ts
CHANGED
package/types/motion.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export type MotionAnimation = 'fade' | 'fadeBlur' | 'scale' | 'scaleBlur' | 'pop
|
|
|
2
2
|
export declare const motionClassMap: Record<MotionAnimation, string>;
|
|
3
3
|
/**
|
|
4
4
|
* Returns CSS class name for given motion animation.
|
|
5
|
-
* Returns empty string when animation is not defined.
|
|
5
|
+
* Returns empty string when animation is not defined or set to 'none'.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getAnimationClass(animation?: MotionAnimation): string;
|
|
7
|
+
export declare function getAnimationClass(animation?: MotionAnimation | 'none'): string;
|
|
8
8
|
/**
|
|
9
9
|
* Returns list of available motion animation names.
|
|
10
10
|
*/
|
package/types/theme.d.ts
CHANGED
|
@@ -166,12 +166,8 @@ export interface ThemeScheme {
|
|
|
166
166
|
surfaceDim: string;
|
|
167
167
|
/** Pure black color used for contrast or background. */
|
|
168
168
|
black: string;
|
|
169
|
-
/** Foreground color displayed on black (typically white). */
|
|
170
|
-
onBlack: string;
|
|
171
169
|
/** Pure white color used for contrast or foreground. */
|
|
172
170
|
white: string;
|
|
173
|
-
/** Foreground color displayed on white (typically black). */
|
|
174
|
-
onWhite: string;
|
|
175
171
|
/** Allows for additional custom tokens. */
|
|
176
172
|
[key: string]: string;
|
|
177
173
|
}
|
|
@@ -218,29 +214,3 @@ export interface Theme {
|
|
|
218
214
|
/** Collection of all available color schemes. */
|
|
219
215
|
schemes: ThemeSchemes;
|
|
220
216
|
}
|
|
221
|
-
/**
|
|
222
|
-
* Core subset of theme colors representing primary semantic intents
|
|
223
|
-
* (e.g., primary, error, success).
|
|
224
|
-
* Commonly referenced across UI components.
|
|
225
|
-
*
|
|
226
|
-
* Serves as the base for {@link SemanticColor} and {@link ThemeSchemeKeys}.
|
|
227
|
-
*
|
|
228
|
-
* @category Theme
|
|
229
|
-
*/
|
|
230
|
-
export declare const ThemeSemanticColorKeys: readonly ["primary", "secondary", "tertiary", "warning", "info", "success", "error"];
|
|
231
|
-
/**
|
|
232
|
-
* Extended set of semantic theme colors.
|
|
233
|
-
* @category Theme
|
|
234
|
-
*/
|
|
235
|
-
export declare const ThemeExtendedColorKeys: readonly ["primary", "secondary", "tertiary", "warning", "info", "success", "error", "primaryContainer", "primaryFixed", "primaryFixedDim", "secondaryContainer", "secondaryFixed", "secondaryFixedDim", "tertiaryContainer", "tertiaryFixed", "tertiaryFixedDim", "warningContainer", "warningFixed", "warningFixedDim", "infoContainer", "infoFixed", "infoFixedDim", "successContainer", "successFixed", "successFixedDim", "errorContainer", "errorFixed", "errorFixedDim", "black", "white"];
|
|
236
|
-
/**
|
|
237
|
-
* Surface-level theme colors including extended and neutral tones.
|
|
238
|
-
* @category Theme
|
|
239
|
-
*/
|
|
240
|
-
export declare const ThemeSurfaceColorKeys: readonly ["primary", "secondary", "tertiary", "warning", "info", "success", "error", "primaryContainer", "primaryFixed", "primaryFixedDim", "secondaryContainer", "secondaryFixed", "secondaryFixedDim", "tertiaryContainer", "tertiaryFixed", "tertiaryFixedDim", "warningContainer", "warningFixed", "warningFixedDim", "infoContainer", "infoFixed", "infoFixedDim", "successContainer", "successFixed", "successFixedDim", "errorContainer", "errorFixed", "errorFixedDim", "black", "white", "outline", "outlineVariant", "surface", "surfaceVariant", "background", "inverseSurface", "inversePrimary", "surfaceContainerHighest", "surfaceContainerHigh", "surfaceContainer", "surfaceContainerLow", "surfaceContainerLowest", "surfaceBright", "surfaceDim"];
|
|
241
|
-
/**
|
|
242
|
-
* Complete set of color tokens defined in {@link ThemeScheme}.
|
|
243
|
-
* Combines all semantic, extended, and surface color roles for full theme coverage.
|
|
244
|
-
* @category Theme
|
|
245
|
-
*/
|
|
246
|
-
export declare const ThemeSchemeKeys: readonly ["primary", "secondary", "tertiary", "warning", "info", "success", "error", "primaryContainer", "primaryFixed", "primaryFixedDim", "secondaryContainer", "secondaryFixed", "secondaryFixedDim", "tertiaryContainer", "tertiaryFixed", "tertiaryFixedDim", "warningContainer", "warningFixed", "warningFixedDim", "infoContainer", "infoFixed", "infoFixedDim", "successContainer", "successFixed", "successFixedDim", "errorContainer", "errorFixed", "errorFixedDim", "black", "white", "outline", "outlineVariant", "surface", "surfaceVariant", "background", "inverseSurface", "inversePrimary", "surfaceContainerHighest", "surfaceContainerHigh", "surfaceContainer", "surfaceContainerLow", "surfaceContainerLowest", "surfaceBright", "surfaceDim", "onPrimary", "onPrimaryContainer", "onPrimaryFixed", "onPrimaryFixedVariant", "onSecondary", "onSecondaryContainer", "onSecondaryFixed", "onSecondaryFixedVariant", "onTertiary", "onTertiaryContainer", "onTertiaryFixed", "onTertiaryFixedVariant", "onWarning", "onWarningContainer", "onWarningFixed", "onWarningFixedVariant", "onInfo", "onInfoContainer", "onInfoFixed", "onInfoFixedVariant", "onSuccess", "onSuccessContainer", "onSuccessFixed", "onSuccessFixedVariant", "onError", "onErrorContainer", "onErrorFixed", "onErrorFixedVariant", "onSurface", "onSurfaceVariant", "onBackground", "inverseOnSurface", "inversePrimary", "shadow", "surfaceTint", "scrim"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ThemeSchemes } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Applies resolved theme tokens as CSS custom properties.
|
|
4
|
+
*
|
|
5
|
+
* @param schemes - Fully resolved theme schemes.
|
|
6
|
+
* @returns The same input object for convenient chaining.
|
|
7
|
+
*
|
|
8
|
+
* @category Theme
|
|
9
|
+
*/
|
|
10
|
+
export declare function applyThemeTokens(schemes: ThemeSchemes): ThemeSchemes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementPlacement } from './utils';
|
|
3
3
|
/**
|
|
4
4
|
* Floating behavior presets used by `calculateFloatingPosition()`.
|
|
5
5
|
*
|
|
@@ -23,7 +23,7 @@ export type ElementFloatingMode = 'tooltip' | 'dropdown' | 'menu' | 'submenu';
|
|
|
23
23
|
* @category Utils
|
|
24
24
|
*/
|
|
25
25
|
export interface CalculateFloatingPositionOptions {
|
|
26
|
-
placement?:
|
|
26
|
+
placement?: ElementPlacement;
|
|
27
27
|
offset?: number;
|
|
28
28
|
mode?: ElementFloatingMode;
|
|
29
29
|
}
|
|
@@ -39,7 +39,7 @@ export interface CalculateFloatingPositionOptions {
|
|
|
39
39
|
export interface ElementFloatingPosition {
|
|
40
40
|
x: number;
|
|
41
41
|
y: number;
|
|
42
|
-
placement:
|
|
42
|
+
placement: ElementPlacement;
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Computes the optimal on-screen position for tooltips, dropdowns, menus and submenus.
|