@helpscout/ui-kit-react 1.1.0 → 2.0.0
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/lib/components/button/button.d.ts +46 -6
- package/dist/lib/components/button/button.d.ts.map +1 -1
- package/dist/lib/components/button/button.legacy.d.ts +47 -0
- package/dist/lib/components/button/button.legacy.d.ts.map +1 -0
- package/dist/lib/components/button/button.legacy.test.d.ts +2 -0
- package/dist/lib/components/button/button.legacy.test.d.ts.map +1 -0
- package/dist/lib/components/button/button.test.d.ts +16 -1
- package/dist/lib/components/button/button.test.d.ts.map +1 -1
- package/dist/lib/components/button/button.utils.d.ts +28 -0
- package/dist/lib/components/button/button.utils.d.ts.map +1 -0
- package/dist/lib/components/data-row/data-row.d.ts +9 -6
- package/dist/lib/components/data-row/data-row.d.ts.map +1 -1
- package/dist/lib/components/icon-button/icon-button.d.ts +19 -3
- package/dist/lib/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/lib/components/icon-button/icon-button.utils.d.ts +19 -0
- package/dist/lib/components/icon-button/icon-button.utils.d.ts.map +1 -0
- package/dist/lib/components/text/text.d.ts +1 -1
- package/dist/lib/components/text/text.d.ts.map +1 -1
- package/dist/lib/ui-kit-react.d.ts +4 -3
- package/dist/lib/ui-kit-react.d.ts.map +1 -1
- package/dist/prop-types.json +866 -9
- package/dist/ui-kit-react.css +1 -1
- package/dist/ui-kit-react.js +8598 -8469
- package/dist/ui-kit-react.umd.cjs +57 -57
- package/package.json +2 -2
|
@@ -1,15 +1,55 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { ButtonProps as RACButtonProps } from 'react-aria-components';
|
|
3
|
+
import { LegacyButtonProps } from './button.legacy';
|
|
3
4
|
|
|
4
5
|
declare const buttonStyles: (props?: ({
|
|
5
|
-
|
|
6
|
+
appearance?: "filled" | "outlined" | "linked" | null | undefined;
|
|
7
|
+
size?: "sm" | "xxs" | "xs" | "md" | "lg" | "xl" | "xxl" | null | undefined;
|
|
8
|
+
color?: "blue" | "red" | "grey" | null | undefined;
|
|
6
9
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
type ButtonVariantProps = VariantProps<typeof buttonStyles>;
|
|
11
|
+
/**
|
|
12
|
+
* Button component props.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Extends react-aria-components ButtonProps with custom variant system.
|
|
16
|
+
* Supports both new API (type/size/color) and legacy API (variant).
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export interface ButtonProps extends RACButtonProps, ButtonVariantProps, LegacyButtonProps {
|
|
11
21
|
}
|
|
12
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The appeance of the button (i.e. outlined, linked, etc.)
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export type ButtonAppearance = NonNullable<ButtonProps>["appearance"];
|
|
28
|
+
/**
|
|
29
|
+
* The color of the button.
|
|
30
|
+
*
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
export type ButtonColor = NonNullable<ButtonProps>["color"];
|
|
34
|
+
/**
|
|
35
|
+
* The size of the button.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export type ButtonSize = NonNullable<ButtonProps>["size"];
|
|
40
|
+
/**
|
|
41
|
+
* Button component.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Accessible button component built on react-aria-components.
|
|
45
|
+
* Supports both new API (type/size/color) and legacy API (variant).
|
|
46
|
+
*
|
|
47
|
+
* @param props - Button component props
|
|
48
|
+
* @returns Button element
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare function Button(props: ButtonProps): JSX.Element;
|
|
13
53
|
export declare namespace Button {
|
|
14
54
|
var displayName: string;
|
|
15
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAEL,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAQ/B,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAEL,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,QAAA,MAAM,YAAY;;;;8EAsChB,CAAC;AAEH,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,WACf,SAAQ,cAAc,EACpB,kBAAkB,EAClB,iBAAiB;CAAG;AAExB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAM1D;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAuBtD;yBAvBe,MAAM"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ButtonAppearance, ButtonColor, ButtonSize } from './button';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Legacy button variant (DEPRECATED).
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Maintained for backward compatibility only. New code should use
|
|
8
|
+
* `type`, `size`, and `color` props instead.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*
|
|
12
|
+
* @deprecated Use `type`, `size`, and `color` props instead.
|
|
13
|
+
*/
|
|
14
|
+
export type LegacyButtonVariant = "primary" | "secondary" | "tertiary" | "critical";
|
|
15
|
+
interface VariantMapping {
|
|
16
|
+
appearance: ButtonAppearance;
|
|
17
|
+
size: ButtonSize;
|
|
18
|
+
color: ButtonColor;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Legacy button props for backwards compatibility.
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export interface LegacyButtonProps {
|
|
26
|
+
/**
|
|
27
|
+
* Legacy button variant (DEPRECATED).
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Maintained for backward compatibility only. New code should use
|
|
31
|
+
* `type`, `size`, and `color` props instead.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Use `type`, `size`, and `color` props instead.
|
|
34
|
+
*/
|
|
35
|
+
variant?: LegacyButtonVariant;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Legacy variant to new props mapping table.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Defines the visual equivalence between legacy API and new API.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare const LEGACY_VARIANT_MAPPING: Record<LegacyButtonVariant, VariantMapping>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=button.legacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.legacy.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.legacy.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE1E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,WAAW,GACX,UAAU,GACV,UAAU,CAAC;AAEf,UAAU,cAAc;IACtB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,mBAAmB,EACnB,cAAc,CAsBN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.legacy.test.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.legacy.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { ButtonAppearance, ButtonColor, ButtonSize } from './button';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate all appearance-size-color combinations for comprehensive testing.
|
|
5
|
+
* Returns 63 combinations (3 appearances × 7 sizes × 3 colors).
|
|
6
|
+
*/
|
|
7
|
+
export declare function getAllButtonVariantCombinations(): Array<{
|
|
8
|
+
appearance: ButtonAppearance;
|
|
9
|
+
size: ButtonSize;
|
|
10
|
+
color: ButtonColor;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const DEFAULT_BUTTON_PROPS_FIXTURE: {
|
|
13
|
+
appearance: ButtonAppearance;
|
|
14
|
+
size: ButtonSize;
|
|
15
|
+
color: ButtonColor;
|
|
16
|
+
};
|
|
2
17
|
//# sourceMappingURL=button.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.test.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.test.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"button.test.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.test.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAEhB,KAAK,UAAU,EAChB,MAAM,UAAU,CAAC;AA+BlB;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,KAAK,CAAC;IACvD,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC,CAgBD;AAED,eAAO,MAAM,4BAA4B;gBACb,gBAAgB;UAC5B,UAAU;WACP,WAAW;CAC7B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ButtonProps } from './button';
|
|
2
|
+
|
|
3
|
+
type ButtonAppearance = NonNullable<ButtonProps["appearance"]>;
|
|
4
|
+
type ButtonColor = NonNullable<ButtonProps["color"]>;
|
|
5
|
+
type ButtonSize = NonNullable<ButtonProps["size"]>;
|
|
6
|
+
interface ResolvedButtonProps extends Omit<ButtonProps, "appearance" | "size" | "color" | "variant"> {
|
|
7
|
+
appearance: ButtonAppearance;
|
|
8
|
+
size: ButtonSize;
|
|
9
|
+
color: ButtonColor;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolves button props with precedence handling.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Resolution order:
|
|
16
|
+
* 1. Explicit new props (appearance, size, color) take highest precedence
|
|
17
|
+
* 2. Variant mapping provides defaults if new props undefined
|
|
18
|
+
* 3. Hard defaults if neither variant nor new props provided
|
|
19
|
+
*
|
|
20
|
+
* @param props - Raw button props from component usage
|
|
21
|
+
* @returns Resolved props with all defaults applied
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveButtonProps(props: ButtonProps): ResolvedButtonProps;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=button.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.utils.d.ts","sourceRoot":"","sources":["../../../../lib/components/button/button.utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,KAAK,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;AAC/D,KAAK,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;AACrD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnD,UAAU,mBACR,SAAQ,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACtE,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB;AAQD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,mBAAmB,CA2B1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
-
import { TextVariantProps } from '../text/text';
|
|
3
|
+
import { TextColor, TextVariantProps } from '../text/text';
|
|
4
4
|
|
|
5
5
|
declare const dataRowStyles: (props?: ({
|
|
6
6
|
clickable?: boolean | null | undefined;
|
|
@@ -8,18 +8,20 @@ declare const dataRowStyles: (props?: ({
|
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
export type DataRowVariant = "default" | "property";
|
|
10
10
|
export type DataRowVariantProps = VariantProps<typeof dataRowStyles>;
|
|
11
|
+
export type DataRowIcon = React.ComponentType<React.SVGProps<SVGSVGElement>> | React.ReactElement<React.SVGProps<SVGSVGElement>>;
|
|
11
12
|
export interface DataRowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
13
|
children: React.ReactNode;
|
|
13
14
|
onIconClick?: () => void;
|
|
14
|
-
icon?:
|
|
15
|
-
|
|
15
|
+
icon?: DataRowIcon;
|
|
16
|
+
buttonSize?: "sm" | "md";
|
|
17
|
+
iconSizePx?: number;
|
|
16
18
|
iconVariant?: "action" | "default";
|
|
17
19
|
hover?: boolean;
|
|
18
20
|
clickable?: boolean;
|
|
19
21
|
href?: string;
|
|
20
22
|
variant?: DataRowVariant;
|
|
21
23
|
}
|
|
22
|
-
declare function DataRowComponent({ className, children, onIconClick, icon,
|
|
24
|
+
declare function DataRowComponent({ className, children, onIconClick, icon, buttonSize, iconSizePx, iconVariant, hover, clickable, href, variant, ...props }: DataRowProps): JSX.Element;
|
|
23
25
|
declare namespace DataRowComponent {
|
|
24
26
|
var displayName: string;
|
|
25
27
|
}
|
|
@@ -31,13 +33,14 @@ declare function DataRowColumn({ className, children, isVisible, ...props }: Dat
|
|
|
31
33
|
declare namespace DataRowColumn {
|
|
32
34
|
var displayName: string;
|
|
33
35
|
}
|
|
34
|
-
export interface DataRowItemProps extends Omit<React.HTMLAttributes<HTMLElement>, "href" | "variant"> {
|
|
36
|
+
export interface DataRowItemProps extends Omit<React.HTMLAttributes<HTMLElement>, "href" | "variant" | "color"> {
|
|
35
37
|
children: React.ReactNode;
|
|
36
38
|
variant?: TextVariantProps["variant"];
|
|
39
|
+
color?: TextColor;
|
|
37
40
|
href?: string;
|
|
38
41
|
target?: string;
|
|
39
42
|
}
|
|
40
|
-
declare function DataRowItem({ className, children, variant, href, target, ...props }: DataRowItemProps): JSX.Element;
|
|
43
|
+
declare function DataRowItem({ className, children, variant, color, href, target, ...props }: DataRowItemProps): JSX.Element;
|
|
41
44
|
declare namespace DataRowItem {
|
|
42
45
|
var displayName: string;
|
|
43
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-row.d.ts","sourceRoot":"","sources":["../../../../lib/components/data-row/data-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"data-row.d.ts","sourceRoot":"","sources":["../../../../lib/components/data-row/data-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE3E,QAAA,MAAM,aAAa;;;8EAcjB,CAAC;AAuBH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,CAAC;AAOpD,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAErE,MAAM,MAAM,WAAW,GACnB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GAClD,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAEtD,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACxE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OA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aAAa,CAAC;IAC7B,IAAI,EAAE,OAAO,WAAW,CAAC;CAC1B,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
2
3
|
import { ButtonProps as RACButtonProps } from 'react-aria-components';
|
|
4
|
+
import { IconButtonIcon } from './icon-button.utils';
|
|
3
5
|
|
|
4
6
|
declare const iconButtonStyles: (props?: ({
|
|
5
7
|
size?: "sm" | "md" | null | undefined;
|
|
@@ -7,16 +9,30 @@ declare const iconButtonStyles: (props?: ({
|
|
|
7
9
|
seamless?: boolean | null | undefined;
|
|
8
10
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
11
|
export type IconButtonVariantProps = VariantProps<typeof iconButtonStyles>;
|
|
12
|
+
export type { IconButtonIcon } from './icon-button.utils';
|
|
13
|
+
export { renderIcon } from './icon-button.utils';
|
|
10
14
|
export interface IconButtonProps extends Omit<RACButtonProps, "children"> {
|
|
11
|
-
icon:
|
|
15
|
+
icon: IconButtonIcon;
|
|
12
16
|
size?: IconButtonVariantProps["size"];
|
|
13
17
|
variant?: IconButtonVariantProps["variant"];
|
|
14
18
|
seamless?: IconButtonVariantProps["seamless"];
|
|
19
|
+
iconSize?: number;
|
|
20
|
+
iconClassName?: string;
|
|
21
|
+
iconStyle?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Custom icon renderer function. Allows complete control over icon rendering.
|
|
24
|
+
* Receives the icon and options, should return a React element.
|
|
25
|
+
* If provided, overrides the default icon rendering logic.
|
|
26
|
+
*/
|
|
27
|
+
renderIcon?: (icon: IconButtonIcon, options: {
|
|
28
|
+
iconClassName?: string;
|
|
29
|
+
iconSize?: number;
|
|
30
|
+
iconStyle?: React.CSSProperties;
|
|
31
|
+
}) => React.ReactElement;
|
|
15
32
|
"aria-label": string;
|
|
16
33
|
}
|
|
17
|
-
export declare function IconButton({ className, icon
|
|
34
|
+
export declare function IconButton({ className, icon, size, variant, seamless, iconSize, iconClassName, iconStyle, renderIcon: customRenderIcon, ...props }: IconButtonProps): JSX.Element;
|
|
18
35
|
export declare namespace IconButton {
|
|
19
36
|
var displayName: string;
|
|
20
37
|
}
|
|
21
|
-
export {};
|
|
22
38
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../lib/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../lib/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAAM,gBAAgB;;;;8EAoBpB,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;IACvE,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE;QACP,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KACjC,KACE,KAAK,CAAC,YAAY,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,IAAI,EACJ,IAAW,EACX,OAAmB,EACnB,QAAgB,EAChB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EAAE,gBAAgB,EAC5B,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CA8B/B;yBAzCe,UAAU"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type IconButtonIcon = React.ComponentType<React.SVGProps<SVGSVGElement>> | React.ReactElement<React.SVGProps<SVGSVGElement>>;
|
|
4
|
+
export interface RenderIconOptions {
|
|
5
|
+
icon: IconButtonIcon;
|
|
6
|
+
iconClassName?: string;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
iconStyle?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Renders an icon element (React component or SVG element) with proper styling.
|
|
12
|
+
* This utility function handles both React components and raw SVG elements,
|
|
13
|
+
* ensuring consistent sizing and styling.
|
|
14
|
+
*
|
|
15
|
+
* @param options - Configuration options for rendering the icon
|
|
16
|
+
* @returns The rendered icon element
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderIcon({ icon, iconClassName, iconSize, iconStyle, }: RenderIconOptions): React.ReactElement;
|
|
19
|
+
//# sourceMappingURL=icon-button.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.utils.d.ts","sourceRoot":"","sources":["../../../../lib/components/icon-button/icon-button.utils.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GACtB,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GAClD,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACjC;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,SAAS,GACV,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAgDxC"}
|
|
@@ -9,7 +9,7 @@ export type TextVariantProps = VariantProps<typeof textStyles>;
|
|
|
9
9
|
export type Element = "dt" | "dd" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "legend" | "p" | "span" | "strong";
|
|
10
10
|
type BaseColor = "red" | "green" | "yellow" | "orange" | "purple" | "magenta" | "cobalt" | "charcoal" | "clay" | "slate";
|
|
11
11
|
type Shade = "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | "1000" | "1100" | "1200" | "accent";
|
|
12
|
-
type TextColor = `${BaseColor}-${Shade}`;
|
|
12
|
+
export type TextColor = `${BaseColor}-${Shade}`;
|
|
13
13
|
export interface TextProps {
|
|
14
14
|
/** Optional HTML element type to render as.
|
|
15
15
|
* @default 'span'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../lib/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AASlE,QAAA,MAAM,UAAU;;;;8EAyBd,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,MAAM,MAAM,OAAO,GACf,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,GAAG,GACH,MAAM,GACN,QAAQ,CAAC;AAEb,KAAK,SAAS,GACV,KAAK,GACL,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,CAAC;AAEZ,KAAK,KAAK,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;AAEb,
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../lib/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAC;AASlE,QAAA,MAAM,UAAU;;;;8EAyBd,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,MAAM,MAAM,OAAO,GACf,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,GAAG,GACH,MAAM,GACN,QAAQ,CAAC;AAEb,KAAK,SAAS,GACV,KAAK,GACL,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,OAAO,CAAC;AAEZ,KAAK,KAAK,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,SAAS,GAAG,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;AAEhD,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IAEb,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,2BAA2B;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,4BAA4B;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,iCAAiC;IACjC,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAEhC,kDAAkD;IAClD,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,oCAAoC;IACpC,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAEtC,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAID,eAAO,MAAM,IAAI,mGAoChB,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { Badge, type BadgeProps, type BadgeVariantProps, } from './components/badge/badge';
|
|
2
|
-
export { Button, type
|
|
2
|
+
export { Button, type ButtonAppearance, type ButtonColor, type ButtonSize, type ButtonProps, } from './components/button/button';
|
|
3
|
+
export { type LegacyButtonVariant } from './components/button/button.legacy';
|
|
3
4
|
export { ButtonGroup, ButtonGroupItem, type ButtonGroupProps, type ButtonGroupItemProps, } from './components/button-group/button-group';
|
|
4
5
|
export { Checkbox, type CheckboxProps } from './components/checkbox/checkbox';
|
|
5
6
|
export { Collapsible, type CollapsibleProps, type CollapsibleClassNames, } from './components/collapsible/collapsible';
|
|
6
7
|
export { ComboBox, type ComboBoxProps, type ComboBoxTriggerRenderArgs, } from './components/combobox/combobox';
|
|
7
8
|
export { Divider, type DividerProps } from './components/divider/divider';
|
|
8
9
|
export { Icon, type IconProps, type IconVariantProps, } from './components/icon/icon';
|
|
9
|
-
export { IconButton, type IconButtonProps, type IconButtonVariantProps, } from './components/icon-button/icon-button';
|
|
10
|
+
export { IconButton, type IconButtonProps, type IconButtonVariantProps, renderIcon, type IconButtonIcon, } from './components/icon-button/icon-button';
|
|
10
11
|
export { Input, type InputProps, type InputVariantProps, } from './components/input/input';
|
|
11
12
|
export { Label, LabelDescription, LabelGroup, type LabelProps, type LabelVariantProps, type LabelDescriptionProps, type LabelGroupProps, } from './components/label/label';
|
|
12
13
|
export { Link, type LinkProps, type LinkVariantProps, } from './components/link/link';
|
|
@@ -17,7 +18,7 @@ export { NumberField, type NumberFieldProps, } from './components/number-field/n
|
|
|
17
18
|
export { DataRow, type DataRowProps, type DataRowVariant, type DataRowColumnProps, type DataRowItemProps, } from './components/data-row/data-row';
|
|
18
19
|
export { Select, SelectItem, type SelectProps, type ListBoxRenderProps, } from './components/select/select';
|
|
19
20
|
export { SidePanel, type SidePanelProps } from './components/side-panel';
|
|
20
|
-
export { Text, type TextProps, type TextVariantProps, } from './components/text/text';
|
|
21
|
+
export { Text, type TextProps, type TextVariantProps, type TextColor, } from './components/text/text';
|
|
21
22
|
export { TextArea, type TextAreaProps, type TextAreaVariantProps, } from './components/text-area/text-area';
|
|
22
23
|
export { TextAreaField, type TextAreaFieldProps, } from './components/text-area-field/text-area-field';
|
|
23
24
|
export { TextField, type TextFieldProps, } from './components/text-field/text-field';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-kit-react.d.ts","sourceRoot":"","sources":["../../lib/ui-kit-react.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,GACvB,M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