@bolttech/atoms-button 0.2.7 → 0.2.8

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/index.cjs CHANGED
@@ -1116,7 +1116,7 @@ const Container = /*#__PURE__*/styled__default["default"].div.withConfig({
1116
1116
  const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
1117
1117
  displayName: "atoms-buttonstyles__Button",
1118
1118
  componentId: "i4bzba-1"
1119
- })(["background-color:", ";border-radius:", ";border:1px solid ", ";box-shadow:", ";color:", ";fill:", ";padding:", ";:active:enabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}:disabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}:hover:enabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}"], ({
1119
+ })(["background-color:", ";border-radius:", ";border:1px solid ", ";box-shadow:", ";color:", ";fill:", ";padding:", ";:active:enabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}:disabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}:hover:enabled{background-color:", ";border:1px solid ", ";color:", ";fill:", ";}", ""], ({
1120
1120
  theme,
1121
1121
  variant
1122
1122
  }) => theme.components.button[variant].container.color.default, ({
@@ -1178,7 +1178,9 @@ const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
1178
1178
  }) => theme.components.button[variant].text.color.hover, ({
1179
1179
  theme,
1180
1180
  variant
1181
- }) => theme.components.button[variant].icon.color.hover);
1181
+ }) => theme.components.button[variant].icon.color.hover, ({
1182
+ fullWidth
1183
+ }) => fullWidth && styled.css(["width:100%;", "{justify-content:center;}"], Container));
1182
1184
  const ButtonTitle = /*#__PURE__*/styled__default["default"].label.withConfig({
1183
1185
  displayName: "atoms-buttonstyles__ButtonTitle",
1184
1186
  componentId: "i4bzba-2"
@@ -1220,6 +1222,8 @@ function Button({
1220
1222
  size,
1221
1223
  iconRight,
1222
1224
  iconLeft,
1225
+ fullWidth = false,
1226
+ type = 'button',
1223
1227
  onClick
1224
1228
  }) {
1225
1229
  return jsxRuntime.jsx(Button$1, Object.assign({
@@ -1229,7 +1233,9 @@ function Button({
1229
1233
  sizeVariant: SizeVariant[variant],
1230
1234
  inverseColors: variant === 'alternative',
1231
1235
  disabled: disabled,
1232
- onClick: () => !disabled && onClick()
1236
+ type: type,
1237
+ fullWidth: fullWidth,
1238
+ onClick: () => !disabled && onClick && onClick()
1233
1239
  }, {
1234
1240
  children: jsxRuntime.jsxs(Container, Object.assign({
1235
1241
  size: size
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/atoms-button",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "peerDependencies": {
5
5
  "@bolttech/atoms-icon": "^0.1.6",
6
6
  "styled-components": "5.3.6"
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from './atoms-button.type';
3
- export declare function Button({ dataTestId, disabled, title, variant, size, iconRight, iconLeft, onClick, }: ButtonProps): JSX.Element;
3
+ export declare function Button({ dataTestId, disabled, title, variant, size, iconRight, iconLeft, fullWidth, type, onClick, }: ButtonProps): JSX.Element;
@@ -1,14 +1,17 @@
1
1
  export type ButtonVariants = 'transaction' | 'brand' | 'alternative' | 'outline' | 'ghost';
2
2
  export type ButtonSizes = 'sm' | 'md' | 'lg';
3
+ export type ButtonTypes = 'button' | 'submit';
3
4
  export type ButtonProps = {
4
5
  dataTestId?: string;
5
- disabled: boolean;
6
+ disabled?: boolean;
6
7
  title?: string;
7
8
  variant: ButtonVariants;
8
9
  size: ButtonSizes;
9
10
  iconRight?: string;
10
11
  iconLeft?: string;
11
- onClick: () => void;
12
+ type?: ButtonTypes;
13
+ fullWidth?: boolean;
14
+ onClick?: () => void;
12
15
  };
13
16
  export type ContainerProps = {
14
17
  size: string;
@@ -17,6 +20,7 @@ export type StyledButtonProps = {
17
20
  variant: string;
18
21
  size: ButtonSizes;
19
22
  sizeVariant: 'generic' | 'ghost';
23
+ fullWidth: boolean;
20
24
  inverseColors: boolean;
21
25
  };
22
26
  export type ButtonTitleProps = {