aha-components 1.8.3 → 1.8.5
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/dist/Avatar.esm.js +1 -1
- package/dist/Avatar.esm.js.map +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Badge.esm.js +1 -1
- package/dist/Badge.esm.js.map +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Button.esm.js +1 -1
- package/dist/Button.esm.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.esm.js +1 -1
- package/dist/Checkbox.esm.js.map +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/DatePicker.esm.js.map +1 -1
- package/dist/DatePicker.js.map +1 -1
- package/dist/Drawer.esm.js.map +1 -1
- package/dist/Drawer.js.map +1 -1
- package/dist/Form.esm.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/Input.esm.js +1 -1
- package/dist/Input.esm.js.map +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/Loading.esm.js +1 -1
- package/dist/Loading.esm.js.map +1 -1
- package/dist/Loading.js +1 -1
- package/dist/Loading.js.map +1 -1
- package/dist/MenuList.esm.js.map +1 -1
- package/dist/MenuList.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Popover.esm.js +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Progress.esm.js.map +1 -1
- package/dist/Progress.js.map +1 -1
- package/dist/Radio.esm.js +1 -1
- package/dist/Radio.esm.js.map +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Select.esm.js.map +1 -1
- package/dist/Select.js.map +1 -1
- package/dist/Switch.esm.js.map +1 -1
- package/dist/Switch.js.map +1 -1
- package/dist/Tab.esm.js.map +1 -1
- package/dist/Tab.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Tag.esm.js.map +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/Textarea.esm.js +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/Toast.esm.js.map +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.esm.js.map +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/components/Alert/icon.d.ts +5 -5
- package/dist/components/Badge/index.d.ts +2 -1
- package/dist/components/Button/index.d.ts +2 -2
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Toast/icon.d.ts +5 -5
- package/dist/components/shared/badgeColors.d.ts +25 -0
- package/dist/components/shared/buttonStyles.d.ts +18 -0
- package/dist/components/shared/colorUtils.d.ts +6 -0
- package/dist/components/shared/controlStyles.d.ts +27 -0
- package/dist/components/shared/fieldStyles.d.ts +37 -0
- package/dist/index.css +3848 -0
- package/dist/index.d.ts +29 -5
- package/dist/index.esm.css +3848 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +14 -14
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MouseEventHandler, ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
import { type BadgeColorKey } from '../shared/badgeColors';
|
|
4
|
+
export type BadgeColor = BadgeColorKey;
|
|
4
5
|
export type BadgeVariant = 'pill' | 'badge' | 'modern';
|
|
5
6
|
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
6
7
|
export type BadgeIconComponent = React.FC<{
|
|
@@ -7,12 +7,12 @@ import React from 'react';
|
|
|
7
7
|
* State: default / hover / focused / disabled / loading
|
|
8
8
|
* Icon only: boolean
|
|
9
9
|
*/
|
|
10
|
-
export type ButtonHierarchy = 'primary' | 'secondary' | 'tertiary' | 'link-color' | 'link-gray' | 'destructive-primary' | 'destructive-secondary' | 'destructive-tertiary' | 'destructive-link'
|
|
10
|
+
export type ButtonHierarchy = 'default' | 'primary' | 'secondary' | 'tertiary' | 'link-color' | 'link-gray' | 'destructive-primary' | 'destructive-secondary' | 'destructive-tertiary' | 'destructive-link';
|
|
11
11
|
export type ButtonSize = 'sm' | 'md' | 'lg' | 'xl' | 'small' | 'mediumSmall' | 'medium' | 'large';
|
|
12
12
|
export type ButtonType = ButtonHierarchy;
|
|
13
13
|
export interface ButtonProps {
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
/**
|
|
15
|
+
/** 按钮层级。`default` 为带边框白底(对齐 antd);`secondary` 为 Figma 无边框 skeuomorphic 样式 */
|
|
16
16
|
type?: ButtonHierarchy;
|
|
17
17
|
/** 按钮尺寸(对应 Figma Size)。旧名会映射到新尺寸 */
|
|
18
18
|
size?: ButtonSize;
|
|
@@ -163,5 +163,5 @@ export interface TableProps<T = any> {
|
|
|
163
163
|
getContainer?: () => HTMLElement;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
declare const Table: <T extends Record<string, any> = any>({ columns, dataSource, rowKey, rowSelection, pagination, size, bordered, loading, locale, showHeader, title, footer, summary, scroll, tableLayout, onChange, onSorterChange, onPaginationChange, onRow, className, innerClassName, style, expandable, rowClassName, onHeaderRow, sticky, ...rest }: TableProps<T>) =>
|
|
166
|
+
declare const Table: <T extends Record<string, any> = any>({ columns, dataSource, rowKey, rowSelection, pagination, size, bordered, loading, locale, showHeader, title, footer, summary, scroll, tableLayout, onChange, onSorterChange, onPaginationChange, onRow, className, innerClassName, style, expandable, rowClassName, onHeaderRow, sticky, ...rest }: TableProps<T>) => React.JSX.Element;
|
|
167
167
|
export default Table;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const ToastIcon: {
|
|
2
|
-
success: import("react
|
|
3
|
-
error: import("react
|
|
4
|
-
question: import("react
|
|
5
|
-
info: import("react
|
|
2
|
+
success: import("react").JSX.Element;
|
|
3
|
+
error: import("react").JSX.Element;
|
|
4
|
+
question: import("react").JSX.Element;
|
|
5
|
+
info: import("react").JSX.Element;
|
|
6
6
|
};
|
|
7
|
-
export declare const CloseIcon: ({ className }: any) => import("react
|
|
7
|
+
export declare const CloseIcon: ({ className }: any) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface BadgeColorTokens {
|
|
2
|
+
bg: string;
|
|
3
|
+
text: string;
|
|
4
|
+
ring: string;
|
|
5
|
+
dot: string;
|
|
6
|
+
btnText: string;
|
|
7
|
+
btnHoverBg: string;
|
|
8
|
+
btnHoverText: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const badgeColorTokens: {
|
|
11
|
+
readonly gray: BadgeColorTokens;
|
|
12
|
+
readonly brand: BadgeColorTokens;
|
|
13
|
+
readonly error: BadgeColorTokens;
|
|
14
|
+
readonly warning: BadgeColorTokens;
|
|
15
|
+
readonly success: BadgeColorTokens;
|
|
16
|
+
readonly grayBlue: BadgeColorTokens;
|
|
17
|
+
readonly blueLight: BadgeColorTokens;
|
|
18
|
+
readonly blue: BadgeColorTokens;
|
|
19
|
+
readonly indigo: BadgeColorTokens;
|
|
20
|
+
readonly purple: BadgeColorTokens;
|
|
21
|
+
readonly pink: BadgeColorTokens;
|
|
22
|
+
readonly orange: BadgeColorTokens;
|
|
23
|
+
};
|
|
24
|
+
export type BadgeColorKey = keyof typeof badgeColorTokens;
|
|
25
|
+
export declare function getBadgeColorTokens(variant: 'pill' | 'badge' | 'modern', color: BadgeColorKey): BadgeColorTokens;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ButtonNormalizedHierarchy = 'default' | 'primary' | 'secondary' | 'tertiary' | 'link-color' | 'link-gray' | 'destructive-primary' | 'destructive-secondary' | 'destructive-tertiary' | 'destructive-link';
|
|
2
|
+
export interface ButtonVisuals {
|
|
3
|
+
bg: string;
|
|
4
|
+
color: string;
|
|
5
|
+
iconColor: string;
|
|
6
|
+
border: string;
|
|
7
|
+
boxShadow: string;
|
|
8
|
+
textDecoration?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getButtonVisuals(options: {
|
|
11
|
+
hierarchy: ButtonNormalizedHierarchy;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
interactive: boolean;
|
|
14
|
+
brandColor?: string;
|
|
15
|
+
}): ButtonVisuals;
|
|
16
|
+
export declare function getButtonFocusShadow(hierarchy: ButtonNormalizedHierarchy, showFocusRing: boolean, brandColor?: string): string | undefined;
|
|
17
|
+
export declare const buttonFontFamily: "\"DM Sans\", system-ui, -apple-system, sans-serif";
|
|
18
|
+
export declare const buttonRadiusMd: "8px";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** 默认品牌色(与 ThemeProvider 默认值一致,忽略大小写) */
|
|
2
|
+
export declare const DEFAULT_BRAND_COLOR: "#fb6011";
|
|
3
|
+
export declare function isDefaultBrandColor(color?: string): boolean;
|
|
4
|
+
export declare function resolveBrandColor(color?: string): string;
|
|
5
|
+
/** 品牌 hover 色:与旧版 CSS 变量 fallback `--color-bg-brand-solid_hover` 保持一致 */
|
|
6
|
+
export declare const BRAND_HOVER_COLOR: "#ec470a";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const controlFontFamily: "\"DM Sans\", system-ui, -apple-system, sans-serif";
|
|
3
|
+
export declare const controlFontWeightMedium: 500;
|
|
4
|
+
export declare const controlFontWeightRegular: 400;
|
|
5
|
+
export declare function getControlTypography(size: 'sm' | 'md'): {
|
|
6
|
+
fontSize: "14px" | "16px";
|
|
7
|
+
lineHeight: "20px" | "24px";
|
|
8
|
+
gap: "12px" | "8px";
|
|
9
|
+
hintGap: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function getCheckboxBorderRadius(size: 'sm' | 'md'): "4px" | "6px";
|
|
12
|
+
export declare function getControlBoxStyles(options: {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
hovered: boolean;
|
|
16
|
+
brandColor?: string;
|
|
17
|
+
}): {
|
|
18
|
+
bg: string;
|
|
19
|
+
border: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function getControlFocusShadow(showFocus: boolean, brandColor?: string): string;
|
|
22
|
+
export declare function getControlLabelStyle(options: {
|
|
23
|
+
size: 'sm' | 'md';
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
}): React.CSSProperties;
|
|
26
|
+
export declare function getControlHintStyle(size: 'sm' | 'md'): React.CSSProperties;
|
|
27
|
+
export declare function getControlActiveIconColor(disabled: boolean, active: boolean): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const fieldFontFamily: "\"DM Sans\", system-ui, -apple-system, sans-serif";
|
|
3
|
+
export declare const fieldFontSizeMd: "16px";
|
|
4
|
+
export declare const fieldFontSizeSm: "14px";
|
|
5
|
+
export declare const fieldFontSizeXs: "12px";
|
|
6
|
+
export declare const fieldLineHeightMd: "24px";
|
|
7
|
+
export declare const fieldLineHeightSm: "20px";
|
|
8
|
+
export declare const fieldLineHeightXs: "18px";
|
|
9
|
+
export declare const fieldRadiusMd: "8px";
|
|
10
|
+
export declare const fieldShadowXs: "0px 1px 2px 0px #0a0d120d";
|
|
11
|
+
export declare const fieldSpacingXs: "4px";
|
|
12
|
+
export declare const fieldColors: {
|
|
13
|
+
readonly textPrimary: "#1c1917";
|
|
14
|
+
readonly textSecondary: "#44403c";
|
|
15
|
+
readonly textTertiary: "#57534e";
|
|
16
|
+
readonly textDisabled: "#79716b";
|
|
17
|
+
readonly textPlaceholder: "#79716b";
|
|
18
|
+
readonly borderPrimary: "#d7d3d0";
|
|
19
|
+
readonly borderDisabled: "#d7d3d0";
|
|
20
|
+
readonly borderBrand: "#fb6011";
|
|
21
|
+
readonly borderError: "#f04438";
|
|
22
|
+
readonly borderErrorSubtle: "#fda29b";
|
|
23
|
+
readonly bgPrimary: "#ffffff";
|
|
24
|
+
readonly bgDisabledSubtle: "#fafaf9";
|
|
25
|
+
readonly fgDisabled: "#a9a29d";
|
|
26
|
+
readonly fgQuaternary: "#a9a29d";
|
|
27
|
+
readonly error600: "#d92d20";
|
|
28
|
+
};
|
|
29
|
+
export declare function getFieldFocusStyles(options: {
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
error?: boolean;
|
|
32
|
+
focused?: boolean;
|
|
33
|
+
brandColor?: string;
|
|
34
|
+
}): React.CSSProperties;
|
|
35
|
+
export declare function getFieldLabelStyle(): React.CSSProperties;
|
|
36
|
+
export declare function getFieldHintStyle(error?: boolean): React.CSSProperties;
|
|
37
|
+
export declare function getPlaceholderCss(selector: string, extraRules?: string, placeholderColor?: "#79716b"): string;
|