@trackunit/react-components 0.0.194 → 0.0.196

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.
@@ -18,6 +18,7 @@ interface TimeLineElementProps extends CommonProps {
18
18
  header?: React.ReactNode;
19
19
  children: React.ReactNode;
20
20
  dot?: React.ReactNode;
21
+ onClick?: () => void;
21
22
  }
22
23
  /**
23
24
  * TimelineElement - entry on a timeline - rendered with an icon on the timeline
@@ -26,5 +27,5 @@ interface TimeLineElementProps extends CommonProps {
26
27
  * @param {TimeLineElementProps} props the props
27
28
  * @returns {JSX.Element} component
28
29
  */
29
- export declare const TimelineElement: ({ date, children, className, dataTestId, dot, header, }: TimeLineElementProps) => JSX.Element;
30
+ export declare const TimelineElement: ({ date, children, className, dataTestId, dot, header, onClick, }: TimeLineElementProps) => JSX.Element;
30
31
  export {};
@@ -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
  `;
@@ -4849,14 +4850,16 @@ const TimelineElement = ({
4849
4850
  }),
4850
4851
  header = `${format(date, "MMM d, yyyy")} (${formatDistance(date, new Date(), {
4851
4852
  addSuffix: true
4852
- })})`
4853
+ })})`,
4854
+ onClick
4853
4855
  }) => {
4854
4856
  var _a;
4855
4857
 
4856
4858
  return jsxs("li", Object.assign({
4857
4859
  className: `${tws`tu-timeline-element`}${(_a = " " + className) !== null && _a !== void 0 ? _a : ""} `,
4858
4860
  "data-date": `${date}`,
4859
- "data-testid": `${dataTestId}`
4861
+ "data-testid": `${dataTestId}`,
4862
+ onClick: () => onClick && onClick()
4860
4863
  }, {
4861
4864
  children: [jsx("div", Object.assign({
4862
4865
  className: tws`tu-timeline-element__dot`
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.196",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "dependencies": {