@rescui/button 0.24.0 → 0.24.1-RUI-293-Update-menu-component-7a032357e.20
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 +3 -1
- package/lib/_virtual/index.css.js +12 -12
- package/lib/button.d.ts +81 -81
- package/lib/button.p.module.css.js +31 -31
- package/lib/index.css +79 -79
- package/lib/index.d.ts +53 -54
- package/lib/index.js +2 -2
- package/llm/components/button.md +610 -0
- package/llm/index.md +2 -0
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"icon": "
|
|
3
|
-
"sizeXS": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"light": "
|
|
8
|
-
"dark": "
|
|
9
|
-
"allVariants": "
|
|
10
|
-
"variant16": "
|
|
11
|
-
"variant20": "
|
|
12
|
-
"variant24": "
|
|
13
|
-
"variant28": "
|
|
2
|
+
"icon": "_icon_11g9wvk_4",
|
|
3
|
+
"sizeXS": "_sizeXS_11g9wvk_14",
|
|
4
|
+
"sizeS": "_sizeS_11g9wvk_18",
|
|
5
|
+
"sizeM": "_sizeM_11g9wvk_22",
|
|
6
|
+
"sizeL": "_sizeL_11g9wvk_26",
|
|
7
|
+
"light": "_light_11g9wvk_30",
|
|
8
|
+
"dark": "_dark_11g9wvk_34",
|
|
9
|
+
"allVariants": "_allVariants_11g9wvk_48",
|
|
10
|
+
"variant16": "_variant16_11g9wvk_53",
|
|
11
|
+
"variant20": "_variant20_11g9wvk_54",
|
|
12
|
+
"variant24": "_variant24_11g9wvk_55",
|
|
13
|
+
"variant28": "_variant28_11g9wvk_58"
|
|
14
14
|
};
|
|
15
15
|
export { styles as default };
|
package/lib/button.d.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Theme } from '@rescui/ui-contexts';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
/** Additional class-name */
|
|
13
|
-
className?: string;
|
|
14
|
-
/** Child element */
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
/** Disabled state */
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
/** Button size */
|
|
19
|
-
size?: ButtonSize;
|
|
20
|
-
/** Appearance theme */
|
|
21
|
-
theme?: Theme;
|
|
22
|
-
/** Shows loading icon, use when some action related to button is in progress */
|
|
23
|
-
busy?: boolean;
|
|
24
|
-
/** @ignore */
|
|
25
|
-
highlighted?: boolean;
|
|
26
|
-
/** @ignore */
|
|
27
|
-
flat?: ButtonFlat;
|
|
28
|
-
/**
|
|
29
|
-
* Allow wrapping inside the button.
|
|
30
|
-
* Do not allow a multiline Button to be placed next to another Button on the same line.
|
|
31
|
-
* */
|
|
32
|
-
allowMultiline?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Multiline default state. Use for optimising rerenders of always multiline buttons.
|
|
35
|
-
* @ignore
|
|
36
|
-
* */
|
|
37
|
-
defaultMultiline?: boolean;
|
|
38
|
-
tabIndex?: number;
|
|
39
|
-
title?: string;
|
|
40
|
-
/** Button appearance */
|
|
41
|
-
mode?: ButtonModeGeneric | ButtonModeClear;
|
|
42
|
-
/** **Works only with `mode="clear"`.** Offsets a clear button to one or more sides before the text. Button's background then extends beyond its container. */
|
|
43
|
-
shifted?: ButtonShifted;
|
|
44
|
-
/** Additional icon */
|
|
45
|
-
icon?: React.ReactNode;
|
|
46
|
-
/**
|
|
47
|
-
* **Works only if the `icon` is present.**
|
|
48
|
-
* Additional icon position.
|
|
49
|
-
* `-edge` variants are useful for aligning icons between multiple buttons in a column (some of which may be multiline).
|
|
50
|
-
* @see [RUI-228](https://youtrack.jetbrains.com/issue/RUI-228/Fix-button-icon-size-and-position)
|
|
51
|
-
* */
|
|
52
|
-
iconPosition?: ButtonIconPosition;
|
|
53
|
-
/** Url path for using component as a link. **Transform a Button into a link (`a` element).** */
|
|
54
|
-
href?: string;
|
|
55
|
-
/** [Link target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). **Works only for the link Button.** */
|
|
56
|
-
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
57
|
-
/** [Link rel](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#rel). **Works only for the link Button.** */
|
|
58
|
-
rel?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Completely removes focus ability.
|
|
61
|
-
* We use separate property instead of tabIndex
|
|
62
|
-
* because tabIndex doesn't remove all of the controls behavior.
|
|
63
|
-
* For example, 'space' button press support remains active.
|
|
64
|
-
* We can fix this with a special property.
|
|
65
|
-
* **Transform a Button into a `div` element. Do not use with link props (`href`, `rel`, `target`, etc).**
|
|
66
|
-
* @ignore
|
|
67
|
-
* */
|
|
68
|
-
notFocusable?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* [More about button types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
|
|
71
|
-
* @type "button" | "submit" | "reset"
|
|
72
|
-
* */
|
|
73
|
-
type?: ButtonType | string;
|
|
74
|
-
/** Click event handler */
|
|
75
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement> | React.MouseEventHandler<HTMLAnchorElement> | React.MouseEventHandler<HTMLDivElement>;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export
|
|
79
|
-
|
|
80
|
-
export declare const Button: React.ForwardRefExoticComponent<Omit<NativeProps, keyof ButtonIntrinsicProps> & ButtonIntrinsicProps & React.RefAttributes<ButtonPossibleHTMLType>>;
|
|
81
|
-
export default Button;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Theme } from '@rescui/ui-contexts';
|
|
3
|
+
export type ButtonShiftedSide = 'right' | 'left' | 'top' | 'bottom';
|
|
4
|
+
export type ButtonSize = 'l' | 'm' | 's' | 'xs';
|
|
5
|
+
export type ButtonModeGeneric = 'classic' | 'rock' | 'transparent' | 'outline';
|
|
6
|
+
export type ButtonModeClear = 'clear';
|
|
7
|
+
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
8
|
+
export type ButtonIconPosition = 'left' | 'left-edge' | 'right' | 'right-edge';
|
|
9
|
+
export type ButtonFlat = 'left' | 'right';
|
|
10
|
+
export type ButtonShifted = 'all' | ButtonShiftedSide | ButtonShiftedSide[];
|
|
11
|
+
type ButtonIntrinsicProps = {
|
|
12
|
+
/** Additional class-name */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Child element */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
/** Disabled state */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Button size */
|
|
19
|
+
size?: ButtonSize;
|
|
20
|
+
/** Appearance theme */
|
|
21
|
+
theme?: Theme;
|
|
22
|
+
/** Shows loading icon, use when some action related to button is in progress */
|
|
23
|
+
busy?: boolean;
|
|
24
|
+
/** @ignore */
|
|
25
|
+
highlighted?: boolean;
|
|
26
|
+
/** @ignore */
|
|
27
|
+
flat?: ButtonFlat;
|
|
28
|
+
/**
|
|
29
|
+
* Allow wrapping inside the button.
|
|
30
|
+
* Do not allow a multiline Button to be placed next to another Button on the same line.
|
|
31
|
+
* */
|
|
32
|
+
allowMultiline?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Multiline default state. Use for optimising rerenders of always multiline buttons.
|
|
35
|
+
* @ignore
|
|
36
|
+
* */
|
|
37
|
+
defaultMultiline?: boolean;
|
|
38
|
+
tabIndex?: number;
|
|
39
|
+
title?: string;
|
|
40
|
+
/** Button appearance */
|
|
41
|
+
mode?: ButtonModeGeneric | ButtonModeClear;
|
|
42
|
+
/** **Works only with `mode="clear"`.** Offsets a clear button to one or more sides before the text. Button's background then extends beyond its container. */
|
|
43
|
+
shifted?: ButtonShifted;
|
|
44
|
+
/** Additional icon */
|
|
45
|
+
icon?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* **Works only if the `icon` is present.**
|
|
48
|
+
* Additional icon position.
|
|
49
|
+
* `-edge` variants are useful for aligning icons between multiple buttons in a column (some of which may be multiline).
|
|
50
|
+
* @see [RUI-228](https://youtrack.jetbrains.com/issue/RUI-228/Fix-button-icon-size-and-position)
|
|
51
|
+
* */
|
|
52
|
+
iconPosition?: ButtonIconPosition;
|
|
53
|
+
/** Url path for using component as a link. **Transform a Button into a link (`a` element).** */
|
|
54
|
+
href?: string;
|
|
55
|
+
/** [Link target](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). **Works only for the link Button.** */
|
|
56
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
57
|
+
/** [Link rel](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#rel). **Works only for the link Button.** */
|
|
58
|
+
rel?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Completely removes focus ability.
|
|
61
|
+
* We use separate property instead of tabIndex
|
|
62
|
+
* because tabIndex doesn't remove all of the controls behavior.
|
|
63
|
+
* For example, 'space' button press support remains active.
|
|
64
|
+
* We can fix this with a special property.
|
|
65
|
+
* **Transform a Button into a `div` element. Do not use with link props (`href`, `rel`, `target`, etc).**
|
|
66
|
+
* @ignore
|
|
67
|
+
* */
|
|
68
|
+
notFocusable?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* [More about button types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
|
|
71
|
+
* @type "button" | "submit" | "reset"
|
|
72
|
+
* */
|
|
73
|
+
type?: ButtonType | string;
|
|
74
|
+
/** Click event handler */
|
|
75
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement> | React.MouseEventHandler<HTMLAnchorElement> | React.MouseEventHandler<HTMLDivElement>;
|
|
76
|
+
};
|
|
77
|
+
type NativeProps = React.ButtonHTMLAttributes<HTMLButtonElement> | React.AnchorHTMLAttributes<HTMLAnchorElement> | React.BaseHTMLAttributes<HTMLDivElement>;
|
|
78
|
+
export type ButtonProps = Omit<NativeProps, keyof ButtonIntrinsicProps> & ButtonIntrinsicProps;
|
|
79
|
+
type ButtonPossibleHTMLType = HTMLAnchorElement | HTMLButtonElement | HTMLDivElement;
|
|
80
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<NativeProps, keyof ButtonIntrinsicProps> & ButtonIntrinsicProps & React.RefAttributes<ButtonPossibleHTMLType>>;
|
|
81
|
+
export default Button;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"light": "
|
|
3
|
-
"dark": "
|
|
4
|
-
"flatRight": "
|
|
5
|
-
"flatLeft": "
|
|
6
|
-
"sizeXs": "
|
|
7
|
-
"sizeS": "
|
|
8
|
-
"sizeM": "
|
|
9
|
-
"sizeL": "
|
|
10
|
-
"modeClassic": "
|
|
11
|
-
"modeRock": "
|
|
12
|
-
"modeTransparent": "
|
|
13
|
-
"modeOutline": "
|
|
14
|
-
"modeClear": "
|
|
15
|
-
"alignIconLeft": "
|
|
16
|
-
"alignIconLeftEdge": "
|
|
17
|
-
"alignIconRight": "
|
|
18
|
-
"alignIconRightEdge": "
|
|
19
|
-
"main": "
|
|
20
|
-
"disabled": "
|
|
21
|
-
"busy": "
|
|
22
|
-
"busyOverlay": "
|
|
23
|
-
"icon": "
|
|
24
|
-
"allowMultiline": "
|
|
25
|
-
"content": "
|
|
26
|
-
"multiline": "
|
|
27
|
-
"withoutText": "
|
|
28
|
-
"busyIcon": "
|
|
29
|
-
"shiftedLeft": "
|
|
30
|
-
"shiftedRight": "
|
|
31
|
-
"shiftedTop": "
|
|
32
|
-
"shiftedBottom": "
|
|
2
|
+
"light": "_light_icjzr4_6",
|
|
3
|
+
"dark": "_dark_icjzr4_9",
|
|
4
|
+
"flatRight": "_flatRight_icjzr4_13",
|
|
5
|
+
"flatLeft": "_flatLeft_icjzr4_16",
|
|
6
|
+
"sizeXs": "_sizeXs_icjzr4_20",
|
|
7
|
+
"sizeS": "_sizeS_icjzr4_23",
|
|
8
|
+
"sizeM": "_sizeM_icjzr4_26",
|
|
9
|
+
"sizeL": "_sizeL_icjzr4_29",
|
|
10
|
+
"modeClassic": "_modeClassic_icjzr4_33",
|
|
11
|
+
"modeRock": "_modeRock_icjzr4_36",
|
|
12
|
+
"modeTransparent": "_modeTransparent_icjzr4_39",
|
|
13
|
+
"modeOutline": "_modeOutline_icjzr4_42",
|
|
14
|
+
"modeClear": "_modeClear_icjzr4_45",
|
|
15
|
+
"alignIconLeft": "_alignIconLeft_icjzr4_49",
|
|
16
|
+
"alignIconLeftEdge": "_alignIconLeftEdge_icjzr4_52",
|
|
17
|
+
"alignIconRight": "_alignIconRight_icjzr4_55",
|
|
18
|
+
"alignIconRightEdge": "_alignIconRightEdge_icjzr4_58",
|
|
19
|
+
"main": "_main_icjzr4_62",
|
|
20
|
+
"disabled": "_disabled_icjzr4_139",
|
|
21
|
+
"busy": "_busy_icjzr4_149",
|
|
22
|
+
"busyOverlay": "_busyOverlay_icjzr4_153",
|
|
23
|
+
"icon": "_icon_icjzr4_188",
|
|
24
|
+
"allowMultiline": "_allowMultiline_icjzr4_203",
|
|
25
|
+
"content": "_content_icjzr4_207",
|
|
26
|
+
"multiline": "_multiline_icjzr4_213",
|
|
27
|
+
"withoutText": "_withoutText_icjzr4_217",
|
|
28
|
+
"busyIcon": "_busyIcon_icjzr4_222",
|
|
29
|
+
"shiftedLeft": "_shiftedLeft_icjzr4_243",
|
|
30
|
+
"shiftedRight": "_shiftedRight_icjzr4_246",
|
|
31
|
+
"shiftedTop": "_shiftedTop_icjzr4_249",
|
|
32
|
+
"shiftedBottom": "_shiftedBottom_icjzr4_252"
|
|
33
33
|
};
|
|
34
34
|
export { styles as default };
|