@yamada-ui/button 0.2.4 → 0.2.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.
@@ -0,0 +1,30 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps, ThemeProps, CSSUIProps } from '@yamada-ui/core';
3
+
4
+ type ButtonGroupOptions = {
5
+ /**
6
+ * The CSS `flex-direction` property.
7
+ */
8
+ direction?: CSSUIProps['flexDirection'];
9
+ /**
10
+ * If `true`, the borderRadius of button that are direct children will be altered to look flushed together.
11
+ *
12
+ * @default false
13
+ */
14
+ isAttached?: boolean;
15
+ /**
16
+ * If `true`, all wrapped button will be disabled.
17
+ *
18
+ * @default false
19
+ */
20
+ isDisabled?: boolean;
21
+ };
22
+ type ButtonGroupProps = HTMLUIProps<'div'> & ThemeProps<'Button'> & ButtonGroupOptions;
23
+ type ButtonGroupContext = ThemeProps<'Button'> & {
24
+ isDisabled?: boolean;
25
+ };
26
+ declare const useButtonGroup: () => ButtonGroupContext;
27
+
28
+ declare const ButtonGroup: _yamada_ui_core.Component<"div", ButtonGroupProps>;
29
+
30
+ export { ButtonGroup, ButtonGroupProps, useButtonGroup };
@@ -0,0 +1,61 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { HTMLUIProps, ThemeProps } from '@yamada-ui/core';
3
+ import { LoadingProps } from '@yamada-ui/loading';
4
+ import { ElementType, ReactElement } from 'react';
5
+
6
+ type ButtonOptions = {
7
+ /**
8
+ * The type of button. Accepts `button`, `reset`, or `submit`.
9
+ *
10
+ * @default 'button'
11
+ */
12
+ type?: 'button' | 'reset' | 'submit';
13
+ /**
14
+ * If `true`, the loading state of the button is represented.
15
+ *
16
+ * @default false
17
+ */
18
+ isLoading?: boolean;
19
+ /**
20
+ * If `true`, the button is represented as active.
21
+ *
22
+ * @default false
23
+ */
24
+ isActive?: boolean;
25
+ /**
26
+ * If `true`, the button is disabled.
27
+ *
28
+ * @default false
29
+ */
30
+ isDisabled?: boolean;
31
+ /**
32
+ * The icon to display at the left side of the button.
33
+ */
34
+ leftIcon?: ReactElement;
35
+ /**
36
+ * The icon to display at the right side of the button.
37
+ */
38
+ rightIcon?: ReactElement;
39
+ /**
40
+ * The icon to display when the button is loading.
41
+ */
42
+ loadingIcon?: ReactElement | LoadingProps['variant'];
43
+ /**
44
+ * The text to display when the button is loading.
45
+ */
46
+ loadingText?: string;
47
+ /**
48
+ * The placement of the loading indicator. Accepts `start` or `end`.
49
+ *
50
+ * @default 'start'
51
+ */
52
+ loadingPlacement?: 'start' | 'end';
53
+ };
54
+ type ButtonProps = HTMLUIProps<'button'> & ThemeProps<'Button'> & ButtonOptions;
55
+ declare const Button: _yamada_ui_core.Component<"button", ButtonProps>;
56
+ declare const useButtonType: (value?: ElementType) => {
57
+ readonly ref: (node: HTMLElement | null) => void;
58
+ readonly type: "button" | undefined;
59
+ };
60
+
61
+ export { Button, ButtonProps, useButtonType };
@@ -0,0 +1,21 @@
1
+ import * as _yamada_ui_core from '@yamada-ui/core';
2
+ import { ReactElement } from 'react';
3
+ import { ButtonProps } from './button.mjs';
4
+ import '@yamada-ui/loading';
5
+
6
+ type IconButtonOptions = {
7
+ /**
8
+ * The icon to be used in the button.
9
+ */
10
+ icon?: ReactElement;
11
+ /**
12
+ * If `true`, the button will be perfectly round. Else, it'll be slightly round.
13
+ *
14
+ * @default false
15
+ */
16
+ isRounded?: boolean;
17
+ };
18
+ type IconButtonProps = Omit<ButtonProps, 'leftIcon' | 'rightIcon' | 'loadingIcon' | 'loadingText' | 'loadingPlacement'> & IconButtonOptions;
19
+ declare const IconButton: _yamada_ui_core.Component<"button", IconButtonProps>;
20
+
21
+ export { IconButton, IconButtonProps };
@@ -0,0 +1,6 @@
1
+ export { Button, ButtonProps } from './button.mjs';
2
+ export { ButtonGroup, ButtonGroupProps } from './button-group.mjs';
3
+ export { IconButton, IconButtonProps } from './icon-button.mjs';
4
+ import '@yamada-ui/core';
5
+ import '@yamada-ui/loading';
6
+ import 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yamada-ui/button",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Yamada UI button components",
5
5
  "keywords": [
6
6
  "yamada",
@@ -37,9 +37,9 @@
37
37
  "url": "https://github.com/hirotomoyamada/yamada-ui/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@yamada-ui/core": "0.4.3",
41
- "@yamada-ui/utils": "0.1.2",
42
- "@yamada-ui/loading": "0.3.4"
40
+ "@yamada-ui/core": "0.5.0",
41
+ "@yamada-ui/utils": "0.1.3",
42
+ "@yamada-ui/loading": "0.3.5"
43
43
  },
44
44
  "devDependencies": {
45
45
  "react": "^18.0.0",