@bolttech/atoms-button 0.2.7 → 0.2.9

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
@@ -1103,20 +1103,17 @@ var SizeVariant;
1103
1103
  const Container = /*#__PURE__*/styled__default["default"].div.withConfig({
1104
1104
  displayName: "atoms-buttonstyles__Container",
1105
1105
  componentId: "i4bzba-0"
1106
- })(["display:flex;align-items:center;gap:", ";.left-img-btn,.right-img-btn,svg{width:", ";height:", ";}"], ({
1106
+ })(["display:flex;align-items:center;gap:", ";.left-img-btn,.right-img-btn{display:flex;label{font-size:", ";}}"], ({
1107
1107
  theme,
1108
1108
  size
1109
1109
  }) => theme.components.button[size].generic.gap, ({
1110
1110
  theme,
1111
1111
  size
1112
- }) => theme.components.button[size].icon.size, ({
1113
- theme,
1114
- size
1115
1112
  }) => theme.components.button[size].icon.size);
1116
1113
  const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
1117
1114
  displayName: "atoms-buttonstyles__Button",
1118
1115
  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:", ";}"], ({
1116
+ })(["background-color:", ";border-radius:", ";border:1px solid ", ";box-shadow:", ";color:", ";padding:", ";label.material-symbols-sharp{color:", ";}:active:enabled{background-color:", ";border:1px solid ", ";color:", ";label.material-symbols-sharp{color:", ";}}:disabled{background-color:", ";border:1px solid ", ";color:", ";label.material-symbols-sharp{color:", ";}}:hover:enabled{background-color:", ";border:1px solid ", ";color:", ";label.material-symbols-sharp{color:", ";}}", ""], ({
1120
1117
  theme,
1121
1118
  variant
1122
1119
  }) => theme.components.button[variant].container.color.default, ({
@@ -1136,15 +1133,15 @@ const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
1136
1133
  theme,
1137
1134
  variant
1138
1135
  }) => theme.components.button[variant].text.color.default, ({
1139
- theme,
1140
- variant
1141
- }) => theme.components.button[variant].icon.color.default, ({
1142
1136
  theme,
1143
1137
  size,
1144
1138
  sizeVariant
1145
1139
  }) => `${theme.components.button[size][sizeVariant].paddingVertical} ${theme.components.button[size][sizeVariant].paddingHorizontal}`, ({
1146
1140
  theme,
1147
1141
  variant
1142
+ }) => theme.components.button[variant].icon.color.default, ({
1143
+ theme,
1144
+ variant
1148
1145
  }) => theme.components.button[variant].container.color.active, ({
1149
1146
  theme,
1150
1147
  variant
@@ -1178,7 +1175,9 @@ const Button$1 = /*#__PURE__*/styled__default["default"].button.withConfig({
1178
1175
  }) => theme.components.button[variant].text.color.hover, ({
1179
1176
  theme,
1180
1177
  variant
1181
- }) => theme.components.button[variant].icon.color.hover);
1178
+ }) => theme.components.button[variant].icon.color.hover, ({
1179
+ fullWidth
1180
+ }) => fullWidth && styled.css(["width:100%;", "{justify-content:center;}"], Container));
1182
1181
  const ButtonTitle = /*#__PURE__*/styled__default["default"].label.withConfig({
1183
1182
  displayName: "atoms-buttonstyles__ButtonTitle",
1184
1183
  componentId: "i4bzba-2"
@@ -1220,6 +1219,8 @@ function Button({
1220
1219
  size,
1221
1220
  iconRight,
1222
1221
  iconLeft,
1222
+ fullWidth = false,
1223
+ type = 'button',
1223
1224
  onClick
1224
1225
  }) {
1225
1226
  return jsxRuntime.jsx(Button$1, Object.assign({
@@ -1229,7 +1230,9 @@ function Button({
1229
1230
  sizeVariant: SizeVariant[variant],
1230
1231
  inverseColors: variant === 'alternative',
1231
1232
  disabled: disabled,
1232
- onClick: () => !disabled && onClick()
1233
+ type: type,
1234
+ fullWidth: fullWidth,
1235
+ onClick: () => !disabled && onClick && onClick()
1233
1236
  }, {
1234
1237
  children: jsxRuntime.jsxs(Container, Object.assign({
1235
1238
  size: size
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@bolttech/atoms-button",
3
- "version": "0.2.7",
4
- "peerDependencies": {
5
- "@bolttech/atoms-icon": "^0.1.6",
6
- "styled-components": "5.3.6"
3
+ "version": "0.2.9",
4
+ "dependencies": {
5
+ "@bolttech/atoms-icon": "^0.1.8"
7
6
  },
8
7
  "main": "./index.cjs",
9
8
  "type": "commonjs",
10
9
  "types": "./src/index.d.ts",
11
- "dependencies": {}
10
+ "peerDependencies": {
11
+ "@edirect/frontend-foundations": "0.0.36",
12
+ "styled-components": "5.3.6"
13
+ }
12
14
  }
@@ -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 = {