@trackunit/react-components 0.0.194 → 0.0.195

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.
@@ -7,6 +7,7 @@ export interface StyledButtonProps {
7
7
  $square: boolean;
8
8
  $color: ButtonColor;
9
9
  $fullWidth: boolean;
10
+ $as: keyof JSX.IntrinsicElements | React.ComponentType<unknown>;
10
11
  }
11
12
  export interface ButtonProps extends ButtonCommonProps {
12
13
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
package/index.css CHANGED
@@ -185,6 +185,20 @@
185
185
  box-border;
186
186
  }
187
187
  }
188
+
189
+ &__disabled {
190
+ @apply cursor-not-allowed
191
+ pointer-events-none
192
+ bg-slate-200
193
+ hover:bg-slate-200
194
+ text-slate-400;
195
+ }
196
+
197
+ &__disabled--transparent {
198
+ @apply cursor-not-allowed
199
+ pointer-events-none
200
+ hover:bg-transparent;
201
+ }
188
202
  }
189
203
 
190
204
  /* CSS related to the LAbel component */
package/index.js CHANGED
@@ -262,8 +262,9 @@ const Button = React.forwardRef((_a, ref) => {
262
262
  });
263
263
  const StyledButton$1 = tw.button`
264
264
  tu-button
265
- ${p => p.$square ? tws`tu-button--square` : null}
266
- ${p => p.$fullWidth ? tws`tu-button--full-width` : null}
265
+ ${p => p.$square && tws`tu-button--square`}
266
+ ${p => p.$fullWidth && tws`tu-button--full-width`}
267
+ ${p => p.disabled && p.$as !== "button" && (p.$variant === "transparent" ? tws`tu-button__disabled--transparent` : tws`tu-button__disabled`)}
267
268
  ${getStyles()}
268
269
  ${getPadding()}
269
270
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.0.194",
3
+ "version": "0.0.195",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {