@ufoui/core 0.0.5 → 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/assets/icons.d.ts +3 -0
- package/components/accordion/accordion.d.ts +31 -3
- package/components/accordion/accordionItem.d.ts +31 -3
- package/components/base/boxBase.d.ts +15 -37
- package/components/base/buttonBase.d.ts +1 -1
- package/components/base/dialogBase.d.ts +9 -7
- package/components/base/fieldBase.d.ts +2 -3
- 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/collapse/collapse.d.ts +15 -20
- package/components/dialogs/dialog.d.ts +1 -1
- package/components/dialogs/dialogTitle.d.ts +1 -1
- package/components/dialogs/drawer.d.ts +1 -1
- 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/rating/rating.d.ts +68 -0
- package/components/slider/slider.d.ts +11 -0
- package/components/switch/switch.d.ts +1 -9
- package/components/toast/toast.d.ts +18 -4
- package/components/toast/toastViewport.d.ts +4 -3
- package/components/toolbar/toolbar.d.ts +1 -1
- 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 +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 +1 -1
- package/internal/slots/slot.d.ts +44 -0
- package/internal/stateLayer/stateLayer.d.ts +33 -0
- package/package.json +12 -3
- package/utils/color.d.ts +0 -102
- package/utils/getWrapperStyle.d.ts +53 -0
- package/utils/index.d.ts +1 -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 +65 -53
- 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/utils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
export type ElementSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge';
|
|
3
2
|
export type ElementInset = 'none' | 'left' | 'right' | 'top' | 'bottom' | 'middle';
|
|
4
3
|
export type ElementShape = 'square' | 'smooth' | 'rounded' | 'round';
|
|
@@ -84,9 +83,50 @@ export type ElementSelectedEffect = 'color' | 'morph' | 'border' | 'overlay';
|
|
|
84
83
|
export type ElementTouchEffect = 'ripple';
|
|
85
84
|
export type ElementFont = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'caption' | 'overline';
|
|
86
85
|
export type ElementTextPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
86
|
+
/**
|
|
87
|
+
* Converts a camelCase, PascalCase, or acronym-based string into kebab-case.
|
|
88
|
+
*
|
|
89
|
+
* @param str - Input string to convert.
|
|
90
|
+
* @returns The kebab-case version of the string.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* toKebabCase("myVariableName"); // "my-variable-name"
|
|
94
|
+
* toKebabCase("URLParser"); // "url-parser"
|
|
95
|
+
*
|
|
96
|
+
* @category Utils
|
|
97
|
+
*/
|
|
98
|
+
export declare function toKebabCase(str: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Clamps a numeric value to an integer range with a fallback.
|
|
101
|
+
*
|
|
102
|
+
* Converts the input to a number, rounds it to an integer,
|
|
103
|
+
* then clamps it between `min` and `max`.
|
|
104
|
+
* If the value is not a finite number, returns `fallback`.
|
|
105
|
+
*
|
|
106
|
+
* @param min - Minimum allowed value.
|
|
107
|
+
* @param max - Maximum allowed value.
|
|
108
|
+
* @param value - Input value to clamp. Can be any type.
|
|
109
|
+
* @param fallback - Value returned when input is invalid.
|
|
110
|
+
* @returns A clamped integer within the given range.
|
|
111
|
+
*
|
|
112
|
+
* @category Utils
|
|
113
|
+
*/
|
|
114
|
+
export declare function clampInt(min: number, max: number, value: unknown, fallback?: number): number | undefined;
|
|
87
115
|
export declare const getAlignClass: (position: ElementAlign) => string;
|
|
88
|
-
|
|
89
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Returns the appropriate CSS class for the given shape token.
|
|
118
|
+
*
|
|
119
|
+
* @param shape Shape token.
|
|
120
|
+
* @returns CSS class for shape variant.
|
|
121
|
+
*/
|
|
122
|
+
export declare const getShapeClass: (shape?: ElementShape) => string;
|
|
123
|
+
/**
|
|
124
|
+
* Returns the CSS class for the given size token.
|
|
125
|
+
*
|
|
126
|
+
* @param size Size token.
|
|
127
|
+
* @returns CSS class for size variant.
|
|
128
|
+
*/
|
|
129
|
+
export declare const getSizeClass: (size: ElementSize) => string;
|
|
90
130
|
/**
|
|
91
131
|
* Returns the appropriate CSS class for the given border size.
|
|
92
132
|
*
|
|
@@ -95,14 +135,25 @@ export declare const getSizeClass: (size: ElementSize) => "uui-extra-small" | "u
|
|
|
95
135
|
*/
|
|
96
136
|
export declare const getBorderClass: (border?: ElementBorder) => string;
|
|
97
137
|
/**
|
|
98
|
-
* Returns the appropriate CSS class for the given
|
|
138
|
+
* Returns the appropriate CSS class for the given elevation level.
|
|
139
|
+
*
|
|
140
|
+
* @param elevation Elevation token.
|
|
141
|
+
* @returns CSS class in the form uui-elevation-X.
|
|
142
|
+
*/
|
|
143
|
+
export declare const getElevationClass: (elevation?: ElementElevation) => string;
|
|
144
|
+
/**
|
|
145
|
+
* Returns the appropriate CSS class for the given density token.
|
|
146
|
+
*
|
|
147
|
+
* @param density Density token.
|
|
148
|
+
* @returns CSS class for density variant.
|
|
149
|
+
*/
|
|
150
|
+
export declare const getDensityClass: (density?: ElementDensity) => string;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the CSS class for the given typography token.
|
|
99
153
|
*
|
|
100
|
-
* @param
|
|
101
|
-
* @returns
|
|
154
|
+
* @param font Typography token.
|
|
155
|
+
* @returns CSS class in the form uui-font-<token>.
|
|
102
156
|
*/
|
|
103
|
-
export declare const getOutlineClass: (size: ElementBorder) => string;
|
|
104
|
-
export declare const getElevationClass: (elevation?: ElementElevation) => "" | "uui-elevation-0" | "uui-elevation-1" | "uui-elevation-2" | "uui-elevation-3" | "uui-elevation-4" | "uui-elevation-5";
|
|
105
|
-
export declare const getDensityClass: (density?: ElementDensity) => "" | "uui-compact" | "uui-dense";
|
|
106
157
|
export declare const getFontClass: (font: ElementFont) => string;
|
|
107
158
|
/**
|
|
108
159
|
* Merges multiple React refs into a single ref callback.
|
|
@@ -139,52 +190,13 @@ export declare function mergeRefs<T>(...refs: React.Ref<T>[]): React.RefCallback
|
|
|
139
190
|
*/
|
|
140
191
|
export declare const createRipple: (el: HTMLElement, event: React.MouseEvent<HTMLElement>, host?: HTMLElement) => void;
|
|
141
192
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* @param str - Input string to convert.
|
|
145
|
-
* @returns The kebab-case version of the string.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* toKebabCase("myVariableName"); // "my-variable-name"
|
|
149
|
-
* toKebabCase("URLParser"); // "url-parser"
|
|
150
|
-
*
|
|
151
|
-
* @category Utils
|
|
152
|
-
*/
|
|
153
|
-
export declare function toKebabCase(str: string): string;
|
|
154
|
-
/**
|
|
155
|
-
* Forces focus to behave like :focus-visible on all browsers,
|
|
156
|
-
* including Safari which loses :focus-visible heuristics when
|
|
157
|
-
* focus is set programmatically (e.g., in menus or lists).
|
|
193
|
+
* Joins class names into a single string.
|
|
158
194
|
*
|
|
159
|
-
*
|
|
160
|
-
* removes it automatically on blur.
|
|
195
|
+
* Accepts strings or arrays of strings and filters out falsy values.
|
|
161
196
|
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* - fallback class is ignored (lower specificity)
|
|
165
|
-
*
|
|
166
|
-
* Safari:
|
|
167
|
-
* - native :focus-visible is unreliable
|
|
168
|
-
* - fallback `.uui-focus-visible` replaces it
|
|
169
|
-
*
|
|
170
|
-
* @param el - HTMLElement to focus with visible highlighting.
|
|
171
|
-
*
|
|
172
|
-
* @category Utils
|
|
173
|
-
*/
|
|
174
|
-
export declare function setFocusVisible(el: HTMLElement | null): void;
|
|
175
|
-
/**
|
|
176
|
-
* Clamps a numeric value to an integer range with a fallback.
|
|
177
|
-
*
|
|
178
|
-
* Converts the input to a number, rounds it to an integer,
|
|
179
|
-
* then clamps it between `min` and `max`.
|
|
180
|
-
* If the value is not a finite number, returns `fallback`.
|
|
181
|
-
*
|
|
182
|
-
* @param min - Minimum allowed value.
|
|
183
|
-
* @param max - Maximum allowed value.
|
|
184
|
-
* @param value - Input value to clamp. Can be any type.
|
|
185
|
-
* @param fallback - Value returned when input is invalid.
|
|
186
|
-
* @returns A clamped integer within the given range.
|
|
197
|
+
* @function
|
|
198
|
+
* @param classes Class names to combine.
|
|
187
199
|
*
|
|
188
200
|
* @category Utils
|
|
189
201
|
*/
|
|
190
|
-
export declare function
|
|
202
|
+
export declare function cn(...classes: (string | false | null | undefined | string[])[]): string;
|
package/hooks/useFocusState.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks focus state for a DOM element.
|
|
3
|
-
*
|
|
4
|
-
* Provides technical focus state and visual focus visibility.
|
|
5
|
-
* Designed for components that need focus styling without
|
|
6
|
-
* interfering with user-provided focus handlers.
|
|
7
|
-
*
|
|
8
|
-
* @param ref Reference to the target DOM element.
|
|
9
|
-
* @returns Object containing focus state flags.
|
|
10
|
-
*
|
|
11
|
-
* @category Hooks
|
|
12
|
-
*/
|
|
13
|
-
export declare function useFocusState<T extends HTMLElement>(ref: React.RefObject<T>): {
|
|
14
|
-
isFocused: boolean;
|
|
15
|
-
focusVisible: boolean;
|
|
16
|
-
};
|