allaw-ui 0.0.326 → 0.0.328

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.
@@ -6,6 +6,7 @@ export interface OAuthProviderButtonProps {
6
6
  type: "login" | "signup";
7
7
  url: string;
8
8
  size: 14 | 16 | 18 | 20 | 22 | 24;
9
+ onClick?: () => void;
9
10
  }
10
11
  declare const OAuthProviderButton: React.FC<OAuthProviderButtonProps>;
11
12
  export default OAuthProviderButton;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import "./OAuthProviderButton.css";
3
3
  import "../../../styles/global.css";
4
4
  var OAuthProviderButton = function (_a) {
5
- var provider = _a.provider, type = _a.type, url = _a.url, size = _a.size;
5
+ var provider = _a.provider, type = _a.type, url = _a.url, size = _a.size, onClick = _a.onClick;
6
6
  var getLabel = function () {
7
7
  if (provider === "google") {
8
8
  return type === "login"
@@ -30,7 +30,12 @@ var OAuthProviderButton = function (_a) {
30
30
  }
31
31
  };
32
32
  var handleClick = function () {
33
- window.location.href = url;
33
+ if (onClick) {
34
+ onClick();
35
+ }
36
+ else {
37
+ window.location.href = url;
38
+ }
34
39
  };
35
40
  var getMaxWidth = function () {
36
41
  switch (size) {
@@ -10,6 +10,7 @@ export interface PrimaryButtonProps extends ButtonHTMLAttributes<HTMLButtonEleme
10
10
  disabled?: boolean;
11
11
  onClick?: () => void;
12
12
  fullWidth?: boolean;
13
+ type?: "button" | "submit" | "reset";
13
14
  }
14
15
  declare const PrimaryButton: React.FC<PrimaryButtonProps>;
15
16
  export default PrimaryButton;
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import "./PrimaryButton.css";
3
3
  import "../../../styles/global.css";
4
4
  var PrimaryButton = function (_a) {
5
- var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c;
6
- return (React.createElement("button", { className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : ""), disabled: disabled, onClick: onClick },
5
+ var startIcon = _a.startIcon, endIcon = _a.endIcon, startIconName = _a.startIconName, endIconName = _a.endIconName, label = _a.label, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, _c = _a.fullWidth, fullWidth = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? "button" : _d;
6
+ return (React.createElement("button", { className: "primary-button ".concat(disabled ? "primary-button-disabled" : "primary-button-enabled", " ").concat(fullWidth ? "primary-button-full-width" : ""), disabled: disabled, onClick: onClick, type: type },
7
7
  startIcon && React.createElement("span", { className: "primary-button-icon ".concat(startIconName) }),
8
8
  React.createElement("span", { className: "primary-button-label" }, label),
9
9
  endIcon && React.createElement("span", { className: "primary-button-icon ".concat(endIconName) })));
@@ -51,7 +51,6 @@
51
51
  width: 100%;
52
52
  flex-direction: column;
53
53
  align-items: flex-start;
54
-
55
54
  border-radius: 8px;
56
55
  border: 1px solid rgba(114, 142, 167, 1);
57
56
  background: var(--Primary-Blanc, #fff);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "0.0.326",
3
+ "version": "0.0.328",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -43,6 +43,7 @@
43
43
  "next": "14.2.5",
44
44
  "react": "^17.0.0 || ^18.0.0",
45
45
  "react-dom": "^17.0.0 || ^18.0.0",
46
+ "react-hook-form": "^7.53.0",
46
47
  "typeface-open-sans": "^1.1.13"
47
48
  },
48
49
  "devDependencies": {