@ufoui/core 0.0.4 → 0.0.12
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/README.md +9 -3
- package/assets/icons.d.ts +11 -0
- package/assets/index.d.ts +1 -0
- package/components/accordion/accordion.d.ts +52 -0
- package/components/accordion/accordionItem.d.ts +65 -0
- package/components/accordion/accordionItem.guards.d.ts +15 -0
- package/components/accordion/index.d.ts +2 -0
- package/components/avatar/avatar.d.ts +26 -29
- package/components/avatar/avatar.guards.d.ts +15 -0
- package/components/avatar/avatarGroup.d.ts +29 -0
- package/components/avatar/index.d.ts +2 -0
- package/components/badge/badge.d.ts +1 -1
- package/components/base/{boxBase/boxBase.d.ts → boxBase.d.ts} +18 -11
- package/components/base/{buttonBase/buttonBase.d.ts → buttonBase.d.ts} +2 -3
- package/components/base/{checkboxBase/checkboxBase.d.ts → checkboxBase.d.ts} +2 -3
- package/components/base/dialogBase.d.ts +34 -0
- package/components/base/{fieldBase/fieldBase.d.ts → fieldBase.d.ts} +2 -3
- package/components/base/index.d.ts +6 -0
- package/components/base/textBase.d.ts +44 -0
- package/components/breadcrumbs/breadcrumbs.d.ts +48 -0
- package/components/button/button.d.ts +1 -1
- package/components/calendar/calendar.d.ts +23 -0
- package/components/calendar/calendarUtils.d.ts +18 -0
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/chip/chip.d.ts +1 -1
- package/components/collapse/collapse.d.ts +33 -0
- package/components/dialogs/bottomSheet.d.ts +23 -0
- package/components/dialogs/dialog.d.ts +21 -0
- package/components/{dialog → dialogs}/dialogActions.d.ts +1 -2
- package/components/{dialog → dialogs}/dialogTitle.d.ts +2 -3
- package/components/dialogs/drawer.d.ts +23 -0
- package/components/dialogs/index.d.ts +6 -0
- package/components/divider/divider.d.ts +1 -1
- package/components/divider/divider.guards.d.ts +1 -1
- package/components/fab/fab.d.ts +1 -1
- package/components/fields/dateField.d.ts +24 -0
- package/components/fields/dateTimeField.d.ts +24 -0
- package/components/fields/emailField.d.ts +24 -0
- package/components/fields/index.d.ts +11 -0
- package/components/fields/monthField.d.ts +24 -0
- package/components/fields/numberField.d.ts +24 -0
- package/components/fields/passwordField.d.ts +24 -0
- package/components/fields/phoneField.d.ts +24 -0
- package/components/fields/textField.d.ts +24 -0
- package/components/fields/timeField.d.ts +24 -0
- package/components/fields/urlField.d.ts +24 -0
- package/components/fields/weekField.d.ts +24 -0
- package/components/fieldset/fieldset.d.ts +2 -1
- package/components/iconButton/iconButton.d.ts +1 -1
- package/components/{article → layout}/article.d.ts +1 -1
- package/components/{aside → layout}/aside.d.ts +1 -1
- package/components/{content → layout}/content.d.ts +1 -1
- package/components/{div → layout}/div.d.ts +1 -1
- package/components/{flex → layout}/flex.d.ts +1 -1
- package/components/{footer → layout}/footer.d.ts +1 -1
- package/components/{grid → layout}/grid.d.ts +1 -1
- package/components/{header → layout}/header.d.ts +1 -1
- package/components/layout/index.d.ts +11 -0
- package/components/{main → layout}/main.d.ts +1 -1
- package/components/{nav → layout}/nav.d.ts +1 -1
- package/components/{section → layout}/section.d.ts +1 -1
- package/components/link/link.d.ts +58 -0
- package/components/list/list.d.ts +8 -0
- package/components/{listItem → list}/listItem.d.ts +2 -3
- package/components/{listItem → list}/listItem.guards.d.ts +1 -1
- package/components/menu/menu.d.ts +2 -4
- package/components/menu/menu.guards.d.ts +1 -1
- package/components/menuItem/menuItem.d.ts +2 -3
- package/components/menuItem/menuItem.guards.d.ts +1 -1
- package/components/option/option.d.ts +1 -1
- package/components/option/option.guards.d.ts +1 -1
- package/components/progress/progress.d.ts +27 -0
- package/components/radio/radio.d.ts +1 -1
- package/components/radiogroup/radioGroup.d.ts +1 -1
- package/components/rating/rating.d.ts +68 -0
- package/components/select/select.d.ts +1 -1
- package/components/slider/slider.d.ts +11 -0
- package/components/switch/switch.d.ts +1 -10
- package/components/tabs/index.d.ts +2 -0
- package/components/tabs/tab.d.ts +37 -0
- package/components/tabs/tab.guards.d.ts +15 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/toast/index.d.ts +2 -0
- package/components/toast/toast.d.ts +52 -0
- package/components/toast/toastViewport.d.ts +7 -0
- package/components/toggleButton/toggleButton.d.ts +1 -1
- package/components/toolbar/toolbar.d.ts +51 -0
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/typography/h1.d.ts +18 -0
- package/components/typography/h2.d.ts +18 -0
- package/components/typography/h3.d.ts +18 -0
- package/components/typography/h4.d.ts +18 -0
- package/components/typography/h5.d.ts +18 -0
- package/components/typography/h6.d.ts +18 -0
- package/components/typography/index.d.ts +9 -0
- package/components/typography/label.d.ts +18 -0
- package/components/typography/p.d.ts +18 -0
- package/components/typography/span.d.ts +18 -0
- package/context/index.d.ts +4 -0
- package/context/selectionContext.d.ts +32 -0
- package/context/themeContext.d.ts +2 -2
- package/hooks/index.d.ts +10 -0
- package/hooks/useAnimate.d.ts +38 -18
- package/hooks/useFocusTrap.d.ts +32 -0
- package/hooks/useFocusVisible.d.ts +16 -14
- package/hooks/useResizeObserver.d.ts +30 -0
- package/hooks/useRovingFocus.d.ts +30 -0
- package/hooks/useSelection.d.ts +16 -0
- package/hooks/useSelectionState.d.ts +29 -0
- package/hooks/useSliderKeys.d.ts +41 -0
- package/index.css +1 -1
- package/index.d.ts +22 -36
- package/index.js +4881 -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/index.d.ts +6 -0
- package/internal/inlineTooltip/index.d.ts +1 -0
- package/internal/inlineTooltip/inlineTooltipManager.d.ts +2 -2
- package/internal/slots/slot.d.ts +44 -0
- package/internal/stateLayer/stateLayer.d.ts +33 -0
- package/package.json +12 -3
- package/utils/calculateFloatingPosition.d.ts +1 -1
- package/utils/color.d.ts +2 -194
- package/utils/controlStyle.d.ts +67 -0
- package/utils/generateMaterialColors.d.ts +1 -1
- package/utils/generateSchemes.d.ts +1 -1
- package/utils/getWrapperStyle.d.ts +53 -0
- package/utils/index.d.ts +10 -0
- package/utils/{inputhMethod.d.ts → interactionMode.d.ts} +1 -1
- package/utils/toasts/ensureViewport.d.ts +7 -0
- package/utils/toasts/index.d.ts +1 -0
- package/utils/toasts/toast.d.ts +85 -0
- package/utils/toasts/toastStore.d.ts +65 -0
- package/utils/uniqueID.d.ts +14 -0
- package/utils/utils.d.ts +81 -81
- package/components/base/dialogBase/dialog.d.ts +0 -35
- package/components/base/inlineBase/inlineBase.d.ts +0 -62
- package/components/dateInput/dateInput.d.ts +0 -2
- package/components/dateTimeInput/dateTimeInput.d.ts +0 -2
- package/components/emailInput/emailInput.d.ts +0 -2
- package/components/numberInput/numberInput.d.ts +0 -2
- package/components/telInput/telInput.d.ts +0 -2
- package/components/textField/textField.d.ts +0 -9
- package/components/timeInput/timeInput.d.ts +0 -2
- package/components/urlInput/urlInput.d.ts +0 -2
- package/hooks/useFocusState.d.ts +0 -16
- package/index.mjs +0 -3832
- package/internal/inlineTooltip/inlineTooltip.d.ts +0 -11
- package/internal/inlineTooltip/inlineTooltip2.d.ts +0 -10
- /package/components/{dialog → dialogs}/dialogContent.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UFO UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
UFO UI is a React UI component library implementing Material Design 3.
|
|
4
4
|
It focuses on simplicity, low dependency count, and small bundle size.
|
|
5
5
|
|
|
6
6
|
The library is designed to be used as a single import, without additional required packages beyond React.
|
|
@@ -15,6 +15,12 @@ The library is designed to be used as a single import, without additional requir
|
|
|
15
15
|
This project is currently in early development (v0.x).
|
|
16
16
|
The API may change.
|
|
17
17
|
|
|
18
|
+
## Live preview
|
|
19
|
+
|
|
20
|
+
UFO UI Playground (preview):
|
|
21
|
+
https://ufoui.kgnet.eu
|
|
22
|
+
|
|
23
|
+
|
|
18
24
|
## Installation
|
|
19
25
|
```bash
|
|
20
26
|
pnpm add @ufoui/core
|
|
@@ -59,5 +65,5 @@ You can customize the theme by providing a seed color:
|
|
|
59
65
|
Apache License 2.0
|
|
60
66
|
|
|
61
67
|
## Trademark
|
|
62
|
-
“UFOUI” and the UFOUI logo are trademarks of the UFOUI project.
|
|
68
|
+
“UFOUI” (UFO UI) and the UFOUI logo are trademarks of the UFOUI project.
|
|
63
69
|
Use of the name or logo requires permission.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CheckmarkIcon: import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const IndeterminateIcon: import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const RadioIcon: import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const ArrowRightIcon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const CheckboxIcon: import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const RadioCheckedIcon: import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const RadioUncheckedIcon: import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const MenuCheckIcon: import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ExpandIcon: import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const StarIcon: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const StarFilledIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icons';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxBaseProps } from '../base';
|
|
3
|
+
import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFont, ElementShape, SurfaceColor } from '../../utils';
|
|
4
|
+
import { MotionAnimation, MotionStyle } from '../../types';
|
|
5
|
+
export type AccordionVariant = 'text' | 'pills' | 'grouped' | 'segmented';
|
|
6
|
+
export type AccordionConfig = {
|
|
7
|
+
variant?: AccordionVariant;
|
|
8
|
+
density?: ElementDensity;
|
|
9
|
+
elevation?: ElementElevation;
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
font?: ElementFont;
|
|
12
|
+
border?: ElementBorder;
|
|
13
|
+
borderColor?: BorderColor;
|
|
14
|
+
shape?: ElementShape;
|
|
15
|
+
animation?: MotionAnimation;
|
|
16
|
+
motionStyle?: MotionStyle;
|
|
17
|
+
duration?: number;
|
|
18
|
+
color?: SurfaceColor;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Props for {@link Accordion}.
|
|
23
|
+
*
|
|
24
|
+
* @category Accordion
|
|
25
|
+
*/
|
|
26
|
+
export interface AccordionProps extends Omit<BoxBaseProps, 'type' | 'gap' | 'gapY' | 'gapX'> {
|
|
27
|
+
/** Accordion behavior mode. Default: 'single'. */
|
|
28
|
+
type?: 'single' | 'multiple';
|
|
29
|
+
/** Accordion items. */
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
variant: AccordionVariant;
|
|
32
|
+
elevation?: ElementElevation;
|
|
33
|
+
density?: ElementDensity;
|
|
34
|
+
showIcon?: boolean;
|
|
35
|
+
border?: ElementBorder;
|
|
36
|
+
borderColor?: BorderColor;
|
|
37
|
+
font?: ElementFont;
|
|
38
|
+
animation?: MotionAnimation;
|
|
39
|
+
motionStyle?: MotionStyle;
|
|
40
|
+
duration?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Container component that manages accordion selection state.
|
|
44
|
+
*
|
|
45
|
+
* Uses shared selection behavior and provides it
|
|
46
|
+
* to child components through SelectionContext.
|
|
47
|
+
*
|
|
48
|
+
* @function
|
|
49
|
+
*
|
|
50
|
+
* @category Accordion
|
|
51
|
+
*/
|
|
52
|
+
export declare const Accordion: ({ type, variant, children, density, border, borderColor, elevation, showIcon, font, shape, animation, motionStyle, duration, color, disabled, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { IS_ACCORDION_ITEM } from './accordionItem.guards';
|
|
3
|
+
import { AccordionVariant } from './accordion';
|
|
4
|
+
import { ElementFocusEffect, ElementFont, ElementHoverEffect, ElementPressedEffect, ElementSelectedEffect, ElementTouchEffect, SurfaceColor } from '../../utils';
|
|
5
|
+
import { MotionAnimation, MotionStyle } from '../../types';
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link AccordionItem}.
|
|
8
|
+
*
|
|
9
|
+
* @category Accordion
|
|
10
|
+
*/
|
|
11
|
+
export interface AccordionItemProps {
|
|
12
|
+
/** Unique item value used to control selection state. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Item header content rendered inside the trigger button. */
|
|
15
|
+
label: ReactNode;
|
|
16
|
+
/** Panel content displayed when the item is expanded. */
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
leading?: ReactNode;
|
|
19
|
+
trailing?: ReactNode;
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
showIcon?: boolean;
|
|
22
|
+
variant?: AccordionVariant;
|
|
23
|
+
font?: ElementFont;
|
|
24
|
+
animation?: MotionAnimation;
|
|
25
|
+
motionStyle?: MotionStyle;
|
|
26
|
+
duration?: number;
|
|
27
|
+
flush?: boolean;
|
|
28
|
+
divided?: boolean;
|
|
29
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
|
|
30
|
+
onBlur?: React.FocusEventHandler<HTMLButtonElement>;
|
|
31
|
+
/** Hover visual effects. */
|
|
32
|
+
hoverEffects?: ElementHoverEffect[];
|
|
33
|
+
/** Focus visual effects. */
|
|
34
|
+
focusEffects?: ElementFocusEffect[];
|
|
35
|
+
/** Pressed visual effects. */
|
|
36
|
+
pressedEffects?: ElementPressedEffect[];
|
|
37
|
+
/** Touch and click visual effects. */
|
|
38
|
+
touchEffects?: ElementTouchEffect[];
|
|
39
|
+
/** Visual effects applied when selected. */
|
|
40
|
+
selectedEffects?: ElementSelectedEffect[];
|
|
41
|
+
color?: SurfaceColor;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Single accordion item consisting of a trigger and collapsible content.
|
|
46
|
+
*
|
|
47
|
+
* Integrates with shared selection behavior to determine
|
|
48
|
+
* whether the panel is expanded and to toggle its state.
|
|
49
|
+
*
|
|
50
|
+
* @function
|
|
51
|
+
*
|
|
52
|
+
* @category Accordion
|
|
53
|
+
*/
|
|
54
|
+
export declare const AccordionItem: {
|
|
55
|
+
({ value, label, children, leading, trailing, showIcon, icon, font, variant, animation, duration, motionStyle, flush, divided, onFocus, onBlur, color, disabled, hoverEffects, focusEffects, pressedEffects, touchEffects, selectedEffects, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Marks this component as an AccordionItem for runtime type guards.
|
|
58
|
+
*
|
|
59
|
+
* Used internally to identify Accordion elements via a shared Symbol.
|
|
60
|
+
* Not part of the public API.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
[IS_ACCORDION_ITEM]: boolean;
|
|
65
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { AccordionItemProps } from './accordionItem';
|
|
3
|
+
export declare const IS_ACCORDION_ITEM: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard that checks whether a React node is an AccordionItem component.
|
|
6
|
+
*
|
|
7
|
+
* Identifies AccordionItem elements by the internal {@link IS_ACCORDION_ITEM} symbol
|
|
8
|
+
* attached to the component type.
|
|
9
|
+
*
|
|
10
|
+
* @param el - React node to test.
|
|
11
|
+
* @returns `true` if the node is an AccordionItem element.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAccordionItem(el: React.ReactNode): el is ReactElement<AccordionItemProps>;
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxBaseProps } from '../base';
|
|
3
|
+
import { ElementSize } from '../../utils';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Properties for Avatar component.
|
|
6
6
|
*
|
|
7
|
-
* @
|
|
8
|
-
* Badge displays a status or value in a small decorative label.
|
|
9
|
-
* Supports customization of color, border, elevation, shape, size, and position.
|
|
10
|
-
*
|
|
11
|
-
* @category Component properties
|
|
7
|
+
* @category Avatar
|
|
12
8
|
*/
|
|
13
|
-
export interface AvatarProps extends Omit<
|
|
14
|
-
/**
|
|
15
|
-
label: string;
|
|
16
|
-
/** Semantic color of the badge background (e.g. `'error'`, `'info'`). */
|
|
17
|
-
color?: SemanticColor;
|
|
18
|
-
/** Border width, e.g. `1` or `2`. Ignored if `outlined` is not set.
|
|
19
|
-
* @default 1
|
|
20
|
-
* */
|
|
21
|
-
border?: ElementBorder;
|
|
22
|
-
/** Color of the border when `outlined` is true. */
|
|
23
|
-
borderColor?: BorderColor;
|
|
24
|
-
/** Elevation depth if `raised` is true. */
|
|
25
|
-
elevation?: ElementElevation;
|
|
26
|
-
/** Size of the badge (`small`, `medium`, `large`). */
|
|
9
|
+
export interface AvatarProps extends Omit<BoxBaseProps, 'component' | 'elementClass'> {
|
|
10
|
+
/** Size token controlling width and height. */
|
|
27
11
|
size?: ElementSize;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
12
|
+
/** Image source URL. */
|
|
13
|
+
src?: string;
|
|
14
|
+
/** Alternative text for image element. */
|
|
15
|
+
alt?: string;
|
|
16
|
+
/** Full name used for initials and auto color derivation. */
|
|
17
|
+
name?: string;
|
|
18
|
+
/** Custom fallback content rendered when no image and no name are provided. */
|
|
19
|
+
children?: ReactNode;
|
|
34
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Avatar identity component displaying image, initials, or custom content.
|
|
23
|
+
*
|
|
24
|
+
* Automatically derives a background color from name when no image
|
|
25
|
+
* and no explicit color are provided.
|
|
26
|
+
*
|
|
27
|
+
* @function
|
|
28
|
+
* @param props Component properties.
|
|
29
|
+
*
|
|
30
|
+
* @category Avatar
|
|
31
|
+
*/
|
|
35
32
|
export declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { AvatarProps } from './avatar';
|
|
3
|
+
export declare const IS_AVATAR: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard that checks whether a React node is an Avatar component.
|
|
6
|
+
*
|
|
7
|
+
* Identifies Avatar elements by the internal {@link IS_AVATAR} symbol
|
|
8
|
+
* attached to the component type.
|
|
9
|
+
*
|
|
10
|
+
* @param el - React node to test.
|
|
11
|
+
* @returns `true` if the node is an Avatar element.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function isAvatar(el: React.ReactNode): el is ReactElement<AvatarProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BoxBaseProps } from '../base';
|
|
3
|
+
import { BorderColor, ElementBorder, ElementShape, ElementSize } from '../../utils';
|
|
4
|
+
/**
|
|
5
|
+
* Props for AvatarGroup component.
|
|
6
|
+
*
|
|
7
|
+
* @category Avatar
|
|
8
|
+
*/
|
|
9
|
+
export interface AvatarGroupProps extends Omit<BoxBaseProps, 'type'> {
|
|
10
|
+
max?: number;
|
|
11
|
+
overlap?: number;
|
|
12
|
+
size?: ElementSize;
|
|
13
|
+
shape?: ElementShape;
|
|
14
|
+
border?: ElementBorder;
|
|
15
|
+
borderColor?: BorderColor;
|
|
16
|
+
overflow?: (count: number) => ReactNode;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Groups multiple Avatar components with optional overlap,
|
|
22
|
+
* size/shape override and overflow handling.
|
|
23
|
+
*
|
|
24
|
+
* @function
|
|
25
|
+
* @param props Component properties.
|
|
26
|
+
*
|
|
27
|
+
* @category Avatar
|
|
28
|
+
*/
|
|
29
|
+
export declare const AvatarGroup: import('react').ForwardRefExoticComponent<AvatarGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ElementAlign, ElementBorder, ElementElevation, ElementFont, ElementShape, ElementSize } from '../../utils/utils
|
|
2
|
+
import { ElementAlign, ElementBorder, ElementElevation, ElementFont, ElementShape, ElementSize } from '../../utils/utils';
|
|
3
3
|
import { BorderColor, SemanticColor } from '../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Badge component.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ElementBorder, ElementElevation, ElementShape } from '
|
|
3
|
-
import { BorderColor, SurfaceColor } from '../../../utils/color';
|
|
1
|
+
import { CSSProperties, ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape, SurfaceColor, WrapperProps } from '../../utils';
|
|
4
3
|
/**
|
|
5
4
|
* Layout mode for {@link BoxBase}.
|
|
6
5
|
*
|
|
@@ -28,11 +27,11 @@ export type BoxDirection = 'row' | 'col';
|
|
|
28
27
|
*
|
|
29
28
|
* @category Box
|
|
30
29
|
*/
|
|
31
|
-
export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'
|
|
30
|
+
export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color' | 'content'>, WrapperProps {
|
|
32
31
|
/** Maps to `align-content` (grid/flex-wrap content alignment). */
|
|
33
|
-
alignContent?:
|
|
32
|
+
alignContent?: CSSProperties['alignContent'];
|
|
34
33
|
/** Maps to `align-items` (cross-axis alignment). */
|
|
35
|
-
alignItems?:
|
|
34
|
+
alignItems?: CSSProperties['alignItems'];
|
|
36
35
|
/** Border width (0–5). */
|
|
37
36
|
border?: ElementBorder;
|
|
38
37
|
/** Border color token. */
|
|
@@ -46,7 +45,7 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
46
45
|
/** Grid template columns (`3` → `repeat(3, 1fr)`). */
|
|
47
46
|
cols?: number | string;
|
|
48
47
|
/** Custom HTML element/component. Default: `div`. */
|
|
49
|
-
component?:
|
|
48
|
+
component?: ElementType;
|
|
50
49
|
/** Layout direction (`row` or `col`) for flex. Ignored if `row` or `col` is set. */
|
|
51
50
|
direction?: BoxDirection;
|
|
52
51
|
/** Native disabled attribute. Applied when supported by the rendered element. */
|
|
@@ -57,8 +56,12 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
57
56
|
elevation?: ElementElevation;
|
|
58
57
|
/** Auto-placement flow direction for grid layouts. */
|
|
59
58
|
flow?: BoxDirection;
|
|
59
|
+
/** Font token controlling typography (size, weight, line-height). */
|
|
60
|
+
font?: ElementFont;
|
|
61
|
+
/** Forces full height (100%). */
|
|
62
|
+
hf?: boolean;
|
|
60
63
|
/** Forces full width (100%). */
|
|
61
|
-
|
|
64
|
+
wf?: boolean;
|
|
62
65
|
/** Gap between children (flex/grid). */
|
|
63
66
|
gap?: number | string;
|
|
64
67
|
/** Horizontal gap (`column-gap`). */
|
|
@@ -70,7 +73,7 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
70
73
|
/** Renders as `inline-flex`, `inline-grid` or `inline-block`. */
|
|
71
74
|
inline?: boolean;
|
|
72
75
|
/** Maps to `justify-content` (main-axis alignment). */
|
|
73
|
-
justifyContent?:
|
|
76
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
74
77
|
/** Padding (all sides). */
|
|
75
78
|
p?: number | string;
|
|
76
79
|
/** Padding bottom. */
|
|
@@ -78,7 +81,7 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
78
81
|
/** Padding left. */
|
|
79
82
|
pl?: number | string;
|
|
80
83
|
/** Maps to `place-items` (grid shortcut for align+justify items). */
|
|
81
|
-
placeItems?:
|
|
84
|
+
placeItems?: CSSProperties['placeItems'];
|
|
82
85
|
/** Padding right. */
|
|
83
86
|
pr?: number | string;
|
|
84
87
|
/** Padding top. */
|
|
@@ -97,6 +100,10 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
97
100
|
type?: BoxType;
|
|
98
101
|
/** Enables wrapping (`flex-wrap: wrap`). */
|
|
99
102
|
wrap?: boolean;
|
|
103
|
+
/** Width. */
|
|
104
|
+
w?: number | string;
|
|
105
|
+
/** Height. */
|
|
106
|
+
h?: number | string;
|
|
100
107
|
}
|
|
101
108
|
/**
|
|
102
109
|
* `BoxBase` — core layout primitive powering all semantic containers
|
|
@@ -123,4 +130,4 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'>
|
|
|
123
130
|
*
|
|
124
131
|
* @category Box
|
|
125
132
|
*/
|
|
126
|
-
export declare const BoxBase:
|
|
133
|
+
export declare const BoxBase: import('react').ForwardRefExoticComponent<BoxBaseProps & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTouchEffect } from '
|
|
3
|
-
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
2
|
+
import { BorderColor, ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
|
|
4
3
|
/**
|
|
5
4
|
* Props for the ButtonBase component.
|
|
6
5
|
*
|
|
@@ -38,7 +37,7 @@ export interface ButtonBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLBut
|
|
|
38
37
|
/** Font token for label and content. */
|
|
39
38
|
font?: ElementFont;
|
|
40
39
|
/** Expands button to full width. */
|
|
41
|
-
|
|
40
|
+
wf?: boolean;
|
|
42
41
|
/** Hover visual effects. */
|
|
43
42
|
hoverEffects?: ElementHoverEffect[];
|
|
44
43
|
/** Icon rendered at the start of the button. */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect } from '
|
|
3
|
-
import { MotionAnimation, MotionStyle } from '
|
|
4
|
-
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
2
|
+
import { BorderColor, ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
|
|
3
|
+
import { MotionAnimation, MotionStyle } from '../../types';
|
|
5
4
|
/**
|
|
6
5
|
* Props for the CheckboxBase component.
|
|
7
6
|
*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { BorderColor, ElementElevation, ElementOutline, ElementShape, ElementSize, SurfaceColor } from '../../utils';
|
|
3
|
+
import { MotionAnimation, MotionStyle } from '../../types';
|
|
4
|
+
export type DialogType = 'basic' | 'fullscreen' | 'dockRight' | 'dockLeft' | 'dockTop' | 'dockBottom';
|
|
5
|
+
export type DialogAnimation = 'none' | MotionAnimation;
|
|
6
|
+
export interface DialogBaseProps {
|
|
7
|
+
elementClass?: string;
|
|
8
|
+
open: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
type?: DialogType;
|
|
11
|
+
color?: SurfaceColor;
|
|
12
|
+
elevation?: ElementElevation;
|
|
13
|
+
size?: ElementSize;
|
|
14
|
+
shape?: ElementShape;
|
|
15
|
+
border?: ElementOutline;
|
|
16
|
+
borderColor?: BorderColor;
|
|
17
|
+
wf?: boolean;
|
|
18
|
+
hf?: boolean;
|
|
19
|
+
fit?: boolean;
|
|
20
|
+
detached?: boolean;
|
|
21
|
+
animation?: DialogAnimation;
|
|
22
|
+
duration?: number;
|
|
23
|
+
disableBackdropClose?: boolean;
|
|
24
|
+
disableEscapeKey?: boolean;
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
motionStyle?: MotionStyle;
|
|
28
|
+
modal?: boolean;
|
|
29
|
+
autoFocus?: boolean;
|
|
30
|
+
flush?: boolean;
|
|
31
|
+
docked?: boolean;
|
|
32
|
+
anchored?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const DialogBase: React.ForwardRefExoticComponent<DialogBaseProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ElementBorder, ElementDensity, ElementFont, ElementShape } from '
|
|
3
|
-
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
2
|
+
import { BorderColor, ElementBorder, ElementDensity, ElementFont, ElementShape, SemanticColor, SurfaceColor } from '../../utils';
|
|
4
3
|
type FieldVariant = 'filled' | 'outlined' | 'classic';
|
|
5
4
|
export interface FieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'children'> {
|
|
6
5
|
color?: SemanticColor;
|
|
@@ -22,7 +21,7 @@ export interface FieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
22
21
|
outlined?: boolean;
|
|
23
22
|
filled?: boolean;
|
|
24
23
|
classic?: boolean;
|
|
25
|
-
|
|
24
|
+
wFull?: boolean;
|
|
26
25
|
/** Control shape variant. */
|
|
27
26
|
shape?: ElementShape;
|
|
28
27
|
/** Text color override for the label. */
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape, SurfaceColor } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link TextBase}.
|
|
5
|
+
*
|
|
6
|
+
* Defines typography and visual styling for text-level elements
|
|
7
|
+
* without introducing layout behaviour.
|
|
8
|
+
*
|
|
9
|
+
* @category Text
|
|
10
|
+
*/
|
|
11
|
+
export interface TextBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'> {
|
|
12
|
+
/** Custom HTML element/component. Default: span. */
|
|
13
|
+
component?: React.ElementType;
|
|
14
|
+
/** Font token controlling typography (size, weight, line-height). */
|
|
15
|
+
font?: ElementFont;
|
|
16
|
+
/** Surface background token. */
|
|
17
|
+
color?: SurfaceColor;
|
|
18
|
+
/** Elevation level (0–5). */
|
|
19
|
+
elevation?: ElementElevation;
|
|
20
|
+
/** Shape/border-radius token. */
|
|
21
|
+
shape?: ElementShape;
|
|
22
|
+
/** Border width (0–5). */
|
|
23
|
+
border?: ElementBorder;
|
|
24
|
+
/** Border color token. */
|
|
25
|
+
borderColor?: BorderColor;
|
|
26
|
+
/** Semantic UUI element class (e.g. uui-text, uui-heading). */
|
|
27
|
+
elementClass?: string;
|
|
28
|
+
/** Text content. */
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* TextBase — core typography primitive powering semantic text components.
|
|
33
|
+
*
|
|
34
|
+
* Provides font tokens, color, border, shape and elevation styling
|
|
35
|
+
* for inline-level and text semantic elements.
|
|
36
|
+
*
|
|
37
|
+
* Intended as a foundation for components such as Text, Heading,
|
|
38
|
+
* Label or other typography-driven UI elements.
|
|
39
|
+
*
|
|
40
|
+
* @category Text
|
|
41
|
+
* @function
|
|
42
|
+
* @param props - Typography and visual styling props.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TextBase: React.ForwardRefExoticComponent<TextBaseProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { default as React, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { BoxBaseProps } from '../base';
|
|
3
|
+
import { ElementDensity, ElementFont, SurfaceColor } from '../../utils';
|
|
4
|
+
import { MotionAnimation, MotionStyle } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* Breadcrumb item.
|
|
7
|
+
*
|
|
8
|
+
* @function
|
|
9
|
+
* @param props - Item props.
|
|
10
|
+
*/
|
|
11
|
+
export interface BreadcrumbItem {
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
href?: string;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
current?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Props for Breadcrumbs component.
|
|
20
|
+
*
|
|
21
|
+
* @category Navigation
|
|
22
|
+
*/
|
|
23
|
+
export interface BreadcrumbsProps extends BoxBaseProps {
|
|
24
|
+
items?: BreadcrumbItem[];
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
separator?: ReactNode;
|
|
27
|
+
maxItems?: number;
|
|
28
|
+
itemsBeforeCollapse?: number;
|
|
29
|
+
itemsAfterCollapse?: number;
|
|
30
|
+
renderItem?: (item: BreadcrumbItem, index: number) => ReactNode;
|
|
31
|
+
renderSeparator?: (index: number) => ReactNode;
|
|
32
|
+
renderCollapse?: (items: BreadcrumbItem[]) => ReactNode;
|
|
33
|
+
component?: ElementType;
|
|
34
|
+
itemComponent?: ElementType;
|
|
35
|
+
density?: ElementDensity;
|
|
36
|
+
font?: ElementFont;
|
|
37
|
+
color?: SurfaceColor;
|
|
38
|
+
animation?: MotionAnimation;
|
|
39
|
+
motionStyle?: MotionStyle;
|
|
40
|
+
duration?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Breadcrumbs navigation component.
|
|
44
|
+
*
|
|
45
|
+
* @function
|
|
46
|
+
* @param props - Component props.
|
|
47
|
+
*/
|
|
48
|
+
export declare const Breadcrumbs: React.ForwardRefExoticComponent<BreadcrumbsProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BoxBaseProps } from '../base';
|
|
3
|
+
/**
|
|
4
|
+
* Props for Calendar component.
|
|
5
|
+
*
|
|
6
|
+
* @category Calendar
|
|
7
|
+
*/
|
|
8
|
+
export interface CalendarProps extends Omit<BoxBaseProps, 'onChange'> {
|
|
9
|
+
/** The currently selected date. */
|
|
10
|
+
value?: Date;
|
|
11
|
+
/** Callback fired when a date is selected. */
|
|
12
|
+
onChange?: (date: Date) => void;
|
|
13
|
+
/** The date that is currently visible in the calendar. */
|
|
14
|
+
viewDate?: Date;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Calendar component following MD3 guidelines.
|
|
18
|
+
*
|
|
19
|
+
* @function
|
|
20
|
+
* @param props Component properties.
|
|
21
|
+
* @category Calendar
|
|
22
|
+
*/
|
|
23
|
+
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface CalendarDay {
|
|
2
|
+
date: Date;
|
|
3
|
+
isCurrentMonth: boolean;
|
|
4
|
+
isToday: boolean;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const isSameDay: (d1: Date, d2: Date) => boolean;
|
|
8
|
+
export declare const isSameMonth: (d1: Date, d2: Date) => boolean;
|
|
9
|
+
export declare const isToday: (date: Date) => boolean;
|
|
10
|
+
export declare const startOfMonth: (date: Date) => Date;
|
|
11
|
+
export declare const endOfMonth: (date: Date) => Date;
|
|
12
|
+
export declare const startOfWeek: (date: Date, weekStartsOn?: number) => Date;
|
|
13
|
+
export declare const endOfWeek: (date: Date, weekStartsOn?: number) => Date;
|
|
14
|
+
export declare const addMonths: (date: Date, months: number) => Date;
|
|
15
|
+
export declare const addDays: (date: Date, days: number) => Date;
|
|
16
|
+
export declare const getMonthDays: (viewDate: Date, selectedDate?: Date) => CalendarDay[];
|
|
17
|
+
export declare const getWeekDaysShort: () => string[];
|
|
18
|
+
export declare const formatMonthYear: (date: Date) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonBaseProps } from '
|
|
1
|
+
import { ButtonBaseProps } from '../base/buttonBase';
|
|
2
2
|
export type ChipType = 'assist' | 'filter' | 'input' | 'suggestion';
|
|
3
3
|
export interface ChipProps extends Omit<ButtonBaseProps, 'elementClass' | 'iconClass' | 'labelClass'> {
|
|
4
4
|
/** Defines the visual style and behavior of the chip. @default 'assist' */
|