ehscan-react-components 0.1.55 → 0.1.56

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.
@@ -3,7 +3,7 @@ type Props = {
3
3
  index?: string | number;
4
4
  text?: string;
5
5
  selected?: boolean;
6
- addClass?: string;
6
+ injectCSS?: string;
7
7
  notimeout?: boolean;
8
8
  click?: (args?: any) => void;
9
9
  type?: "raw" | "pop" | "ripple";
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useRef, useCallback } from "react";
3
3
  import useRipple from "../tools/useRipple";
4
4
  import styles from '../style/button.module.css';
5
- export const Button = ({ index, text, selected, addClass, notimeout, click, type = "raw", children }) => {
5
+ export const Button = ({ index, text, selected, injectCSS, notimeout, click, type = "raw", children }) => {
6
6
  const buttonRef = useRef(null);
7
7
  const handleRipple = useRipple();
8
8
  const handleButtonClick = useCallback((event) => {
@@ -16,5 +16,5 @@ export const Button = ({ index, text, selected, addClass, notimeout, click, type
16
16
  click === null || click === void 0 ? void 0 : click(event);
17
17
  }, 200);
18
18
  }, [notimeout, click, handleRipple]);
19
- return (_jsx(_Fragment, { children: _jsxs("button", { type: "button", ref: buttonRef, onClick: handleButtonClick, className: `${styles.button} ${styles.ApplyRipple} ${addClass !== null && addClass !== void 0 ? addClass : styles.btnPrimary}${type === 'pop' ? ` ${styles.buttonPop}` : ''}`, "aria-pressed": selected, children: [children, text && _jsx("div", { className: styles.btnLabel, children: text })] }, index) }));
19
+ return (_jsx(_Fragment, { children: _jsxs("button", { type: "button", ref: buttonRef, onClick: handleButtonClick, className: `${styles.button} ${styles.ApplyRipple} ${injectCSS !== null && injectCSS !== void 0 ? injectCSS : styles.btnPrimary}${type === 'pop' ? ` ${styles.buttonPop}` : ''}`, "aria-pressed": selected, children: [children, text && _jsx("div", { className: styles.btnLabel, children: text })] }, index) }));
20
20
  };
@@ -19,7 +19,7 @@
19
19
  text-align: center;
20
20
  text-decoration: none;
21
21
  user-select: none;
22
- line-height: var(--ext-btn-colorbtn-line-height, 1.5);
22
+ line-height: var(--ext-btn-line-height, 1.5);
23
23
  }
24
24
 
25
25
  .button:focus-visible {
@@ -48,23 +48,23 @@
48
48
  }
49
49
 
50
50
  .ext-btn--secondary {
51
- --btn-bg: #e5e5ea;
52
- --btn-color: #111;
51
+ --ext-btn-bg: #e5e5ea;
52
+ --ext-btn-color: #111;
53
53
  }
54
54
 
55
55
  .ext-btn--outline {
56
- --btn-bg: transparent;
57
- --btn-color: #007aff;
56
+ --ext-btn-bg: transparent;
57
+ --ext-btn-color: #007aff;
58
58
  }
59
59
 
60
60
  .ext-btn--ghost {
61
- --btn-bg: transparent;
62
- --btn-color: #007aff;
61
+ --ext-btn-bg: transparent;
62
+ --ext-btn-color: #007aff;
63
63
  }
64
64
 
65
65
  .ext-btn--danger {
66
- --btn-bg: #ff3b30;
67
- --btn-color: #fff;
66
+ --ext-btn-bg: #ff3b30;
67
+ --ext-btn-color: #fff;
68
68
  }
69
69
 
70
70
  /* Loading state */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ehscan-react-components",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "description": "components",
5
5
  "main": "dist/Components.js",
6
6
  "types": "dist/Components.d.ts",