@ufoui/core 0.0.1 → 0.0.4
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 +29 -3
- package/components/article/article.d.ts +1 -1
- package/components/aside/aside.d.ts +1 -1
- package/components/avatar/avatar.d.ts +1 -1
- package/components/badge/badge.d.ts +1 -1
- package/components/base/boxBase/boxBase.d.ts +1 -1
- package/components/base/buttonBase/buttonBase.d.ts +1 -1
- package/components/base/checkboxBase/checkboxBase.d.ts +2 -2
- package/components/base/dialogBase/dialog.d.ts +2 -2
- package/components/base/fieldBase/fieldBase.d.ts +1 -1
- package/components/base/inlineBase/inlineBase.d.ts +1 -1
- package/components/button/button.d.ts +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/chip/chip.d.ts +1 -1
- package/components/content/content.d.ts +1 -1
- package/components/dateInput/dateInput.d.ts +1 -1
- package/components/dateTimeInput/dateTimeInput.d.ts +1 -1
- package/components/dialog/dialogActions.d.ts +1 -1
- package/components/dialog/dialogTitle.d.ts +2 -2
- package/components/div/div.d.ts +1 -1
- package/components/divider/divider.d.ts +1 -1
- package/components/divider/divider.guards.d.ts +1 -1
- package/components/emailInput/emailInput.d.ts +1 -1
- package/components/fab/fab.d.ts +1 -1
- package/components/fieldset/fieldset.d.ts +1 -1
- package/components/flex/flex.d.ts +1 -1
- package/components/footer/footer.d.ts +1 -1
- package/components/grid/grid.d.ts +1 -1
- package/components/header/header.d.ts +1 -1
- package/components/iconButton/iconButton.d.ts +1 -1
- package/components/listItem/listItem.d.ts +2 -2
- package/components/listItem/listItem.guards.d.ts +1 -1
- package/components/main/main.d.ts +1 -1
- package/components/menu/menu.d.ts +2 -2
- package/components/menu/menu.guards.d.ts +1 -1
- package/components/menuItem/menuItem.d.ts +2 -2
- package/components/menuItem/menuItem.guards.d.ts +1 -1
- package/components/nav/nav.d.ts +1 -1
- package/components/numberInput/numberInput.d.ts +1 -1
- package/components/option/option.d.ts +1 -1
- package/components/option/option.guards.d.ts +1 -1
- package/components/radio/radio.d.ts +1 -1
- package/components/radiogroup/radioGroup.d.ts +1 -1
- package/components/section/section.d.ts +1 -1
- package/components/select/select.d.ts +1 -1
- package/components/spinner/spinner.d.ts +1 -1
- package/components/switch/switch.d.ts +1 -1
- package/components/telInput/telInput.d.ts +1 -1
- package/components/textField/textField.d.ts +1 -1
- package/components/themeProvider/themeProvider.d.ts +1 -1
- package/components/timeInput/timeInput.d.ts +1 -1
- package/components/toggleButton/toggleButton.d.ts +1 -1
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/urlInput/urlInput.d.ts +1 -1
- package/context/themeContext.d.ts +2 -2
- package/hooks/useTheme.d.ts +1 -1
- package/index.css +1 -1
- package/index.d.ts +6 -1
- package/index.mjs +2386 -1854
- package/internal/inlineTooltip/inlineTooltip.d.ts +1 -1
- package/internal/inlineTooltip/inlineTooltipManager.d.ts +2 -2
- package/package.json +1 -1
- package/utils/calculateFloatingPosition.d.ts +1 -1
- package/utils/color.d.ts +1 -1
- package/utils/generateMaterialColors.d.ts +1 -1
- package/utils/generateSchemes.d.ts +1 -1
package/README.md
CHANGED
|
@@ -21,14 +21,40 @@ pnpm add @ufoui/core
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
24
|
+
|
|
25
|
+
Import the global styles **once** at your application entry point:
|
|
27
26
|
|
|
28
27
|
```ts
|
|
29
28
|
import '@ufoui/core/style.css';
|
|
30
29
|
```
|
|
31
30
|
|
|
31
|
+
Wrap your application with `ThemeProvider` and use components:
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import { ThemeProvider, Button } from '@ufoui/core';
|
|
35
|
+
|
|
36
|
+
function App() {
|
|
37
|
+
return (
|
|
38
|
+
<ThemeProvider>
|
|
39
|
+
<Button label="Save" filled />
|
|
40
|
+
</ThemeProvider>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`ThemeProvider` is responsible for providing theme tokens and color schemes.
|
|
46
|
+
All components rely on CSS variables defined in the global stylesheet.
|
|
47
|
+
|
|
48
|
+
### Theming
|
|
49
|
+
|
|
50
|
+
You can customize the theme by providing a seed color:
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<ThemeProvider seedColor="#6750A4">
|
|
54
|
+
<App />
|
|
55
|
+
</ThemeProvider>
|
|
56
|
+
```
|
|
57
|
+
|
|
32
58
|
## License
|
|
33
59
|
Apache License 2.0
|
|
34
60
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLProps } from 'react';
|
|
2
|
-
import { ElementBorder, ElementElevation, ElementShape, ElementSize } from '
|
|
2
|
+
import { ElementBorder, ElementElevation, ElementShape, ElementSize } from '../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SemanticColor } from '../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the {@link Badge} component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ElementAlign, ElementBorder, ElementElevation, ElementFont, ElementShape, ElementSize } from '
|
|
2
|
+
import { ElementAlign, ElementBorder, ElementElevation, ElementFont, ElementShape, ElementSize } from '../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SemanticColor } from '../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Badge component.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ElementBorder, ElementElevation, ElementShape } from '
|
|
2
|
+
import { ElementBorder, ElementElevation, ElementShape } from '../../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SurfaceColor } from '../../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Layout mode for {@link BoxBase}.
|
|
@@ -1,5 +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 '
|
|
2
|
+
import { ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTouchEffect } from '../../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the ButtonBase component.
|
|
@@ -1,6 +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 '
|
|
2
|
+
import { ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect } from '../../../utils/utils.ts';
|
|
3
|
+
import { MotionAnimation, MotionStyle } from '../../../types/index.ts';
|
|
4
4
|
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
5
5
|
/**
|
|
6
6
|
* Props for the CheckboxBase component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { ElementElevation, ElementOutline, ElementShape, ElementSize } from '
|
|
3
|
-
import { MotionAnimation, MotionStyle } from '
|
|
2
|
+
import { ElementElevation, ElementOutline, ElementShape, ElementSize } from '../../../utils/utils.ts';
|
|
3
|
+
import { MotionAnimation, MotionStyle } from '../../../types/index.ts';
|
|
4
4
|
import { BorderColor, SurfaceColor } from '../../../utils/color';
|
|
5
5
|
export type DialogType = 'basic' | 'fullscreen' | 'dockRight' | 'dockLeft' | 'dockTop' | 'dockBottom';
|
|
6
6
|
export type DialogAnimation = 'auto' | 'none' | MotionAnimation;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ElementBorder, ElementDensity, ElementFont, ElementShape } from '
|
|
2
|
+
import { ElementBorder, ElementDensity, ElementFont, ElementShape } from '../../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SemanticColor, SurfaceColor } from '../../../utils/color';
|
|
4
4
|
type FieldVariant = 'filled' | 'outlined' | 'classic';
|
|
5
5
|
export interface FieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'children'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ElementBorder, ElementElevation, ElementFont, ElementShape } from '
|
|
2
|
+
import { ElementBorder, ElementElevation, ElementFont, ElementShape } from '../../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SurfaceColor } from '../../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for {@link InlineBase}.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonBaseProps } from '
|
|
1
|
+
import { ButtonBaseProps } from '../../index.ts';
|
|
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' */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const DateInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const DateTimeInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ElementFont } from '
|
|
2
|
+
import { ElementFont } from '../../utils/utils.ts';
|
|
3
3
|
import { SurfaceColor } from '../../utils/color';
|
|
4
4
|
export interface DialogTitleProps {
|
|
5
5
|
icon?: ReactNode;
|
|
@@ -11,6 +11,6 @@ export interface DialogTitleProps {
|
|
|
11
11
|
textColor?: SurfaceColor;
|
|
12
12
|
}
|
|
13
13
|
export declare const DialogTitle: {
|
|
14
|
-
({ icon, label, children, className, font }: DialogTitleProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
({ icon, label, children, className, font, }: DialogTitleProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
package/components/div/div.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLProps } from 'react';
|
|
2
|
-
import { BorderColor, ElementBorder, ElementElevation, ElementInset, ElementShape } from '
|
|
2
|
+
import { BorderColor, ElementBorder, ElementElevation, ElementInset, ElementShape } from '../../index.ts';
|
|
3
3
|
import { IS_DIVIDER } from './divider.guards';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the {@link Divider} component.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const EmailInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
package/components/fab/fab.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { BoxBaseProps, ElementFont, SurfaceColor } from '
|
|
2
|
+
import { BoxBaseProps, ElementFont, SurfaceColor } from '../../index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Props for {@link Fieldset}.
|
|
5
5
|
* Extends {@link BoxBaseProps} except for `elementClass` and `component`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, HTMLProps, ReactNode } from 'react';
|
|
2
|
-
import { ElementDensity, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '
|
|
3
|
-
import { MenuVariant } from '../menu/menu';
|
|
2
|
+
import { ElementDensity, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '../../utils/utils.ts';
|
|
4
3
|
import { SurfaceColor } from '../../utils/color';
|
|
4
|
+
import { MenuVariant } from '../../index.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Visual variant of a ListItem.
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactElement } from 'react';
|
|
2
|
-
import { ListItemInternalProps, ListItemProps } from '
|
|
2
|
+
import { ListItemInternalProps, ListItemProps } from '../../index.ts';
|
|
3
3
|
export declare const IS_LIST_ITEM: unique symbol;
|
|
4
4
|
/**
|
|
5
5
|
* Type guard that checks whether a React node is a MenuItem component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '
|
|
3
|
-
import { MotionAnimation, MotionStyle } from '
|
|
2
|
+
import { ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '../../utils/utils.ts';
|
|
3
|
+
import { MotionAnimation, MotionStyle } from '../../types/index.ts';
|
|
4
4
|
import { BorderColor, SurfaceColor } from '../../utils/color';
|
|
5
5
|
import { ElementFloatingMode } from '../../utils/calculateFloatingPosition';
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactElement } from 'react';
|
|
2
|
-
import { MenuInternalProps, MenuProps } from '
|
|
2
|
+
import { MenuInternalProps, MenuProps } from '../../index.ts';
|
|
3
3
|
export declare const IS_MENU: unique symbol;
|
|
4
4
|
/**
|
|
5
5
|
* Type guard that checks whether a React node is a Menu component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, HTMLProps, ReactNode } from 'react';
|
|
2
|
-
import { ElementDensity, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '
|
|
3
|
-
import { MenuVariant } from '
|
|
2
|
+
import { ElementDensity, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect } from '../../utils/utils.ts';
|
|
3
|
+
import { MenuVariant } from '../../index.ts';
|
|
4
4
|
import { SurfaceColor } from '../../utils/color';
|
|
5
5
|
/**
|
|
6
6
|
* Visual variant of a MenuItem.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactElement } from 'react';
|
|
2
|
-
import { MenuItemInternalProps, MenuItemProps } from '
|
|
2
|
+
import { MenuItemInternalProps, MenuItemProps } from '../../index.ts';
|
|
3
3
|
export declare const IS_MENU_ITEM: unique symbol;
|
|
4
4
|
/**
|
|
5
5
|
* Type guard that checks whether a React node is a MenuItem component.
|
package/components/nav/nav.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const NumberInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import { MenuItemInternalProps, MenuItemProps } from '
|
|
2
|
+
import { MenuItemInternalProps, MenuItemProps } from '../../index.ts';
|
|
3
3
|
export interface OptionProps extends Omit<MenuItemProps, 'type' | 'checked'> {
|
|
4
4
|
selected?: boolean;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, ReactElement } from 'react';
|
|
2
2
|
import { OptionProps } from './option';
|
|
3
|
-
import { MenuItemInternalProps } from '
|
|
3
|
+
import { MenuItemInternalProps } from '../../index.ts';
|
|
4
4
|
export declare const IS_OPTION: unique symbol;
|
|
5
5
|
/**
|
|
6
6
|
* Type guard that checks whether a React node is an Option component.
|
|
@@ -4,4 +4,4 @@ export interface SpinnerProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
inline?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare function Spinner({ variant, inline, className }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Spinner({ variant, inline, className, }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect } from '
|
|
2
|
+
import { ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect } from '../../utils/utils.ts';
|
|
3
3
|
import { BorderColor, SemanticColor, SurfaceColor } from '../../utils/color';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Switch component.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const TelInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -51,4 +51,4 @@ export interface ThemeProviderProps {
|
|
|
51
51
|
* @category Components
|
|
52
52
|
* @group Theme
|
|
53
53
|
*/
|
|
54
|
-
export declare const ThemeProvider: ({ children, colorMode, seedColor, extraColors }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const ThemeProvider: ({ children, colorMode, seedColor, extraColors, }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const TimeInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FieldBaseProps } from '
|
|
1
|
+
import { FieldBaseProps } from '../../index.ts';
|
|
2
2
|
export declare const UrlInput: import('react').ForwardRefExoticComponent<FieldBaseProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Theme } from '../
|
|
2
|
-
import { ThemeColor } from '../
|
|
1
|
+
import { Theme } from '../types/index.ts';
|
|
2
|
+
import { ThemeColor } from '../index.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Provides shape for the theme context shared across the application.
|
|
5
5
|
* Allows reading and updating theme configuration and resolving token values.
|
package/hooks/useTheme.d.ts
CHANGED