@scaleflex/ui-tw 0.0.18 → 0.0.19

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.
@@ -34,9 +34,10 @@ function FormSwitchField(_ref) {
34
34
  render: function render(_ref2) {
35
35
  var field = _ref2.field;
36
36
  return /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement("div", {
37
- className: cn('flex items-center', isInlineLayout ? formSwitchFieldVariants({
37
+ className: cn('group flex items-center', isInlineLayout ? formSwitchFieldVariants({
38
38
  size: size
39
- }) : 'w-full justify-between gap-2')
39
+ }) : 'w-full justify-between gap-2'),
40
+ "data-disabled": disabled
40
41
  }, isInlineLayout ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormControl, null, /*#__PURE__*/React.createElement(Switch, _extends({
41
42
  id: field.name,
42
43
  checked: field.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/ui-tw",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -18,7 +18,7 @@
18
18
  "@radix-ui/react-slot": "^1.1.2",
19
19
  "@radix-ui/react-switch": "^1.0.1",
20
20
  "@radix-ui/react-tooltip": "^1.2.6",
21
- "@scaleflex/icons-tw": "^0.0.18",
21
+ "@scaleflex/icons-tw": "^0.0.19",
22
22
  "@types/lodash.merge": "^4.6.9",
23
23
  "class-variance-authority": "^0.7.1",
24
24
  "lodash.merge": "^4.6.2",
@@ -6,5 +6,5 @@ declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typ
6
6
  declare function Tooltip({ ...props }: ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
7
7
  declare function TooltipTrigger({ ...props }: ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
8
8
  declare function TooltipContent({ className, sideOffset, children, variant, ...props }: TooltipContentProps): React.JSX.Element;
9
- declare function WithTooltip({ variant, content, children }: WithTooltipProps): React.JSX.Element;
9
+ declare function WithTooltip({ variant, content, children, ...otherProps }: WithTooltipProps): React.JSX.Element;
10
10
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, WithTooltip };
@@ -2,7 +2,8 @@ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructurin
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["delayDuration"],
5
- _excluded2 = ["className", "sideOffset", "children", "variant"];
5
+ _excluded2 = ["className", "sideOffset", "children", "variant"],
6
+ _excluded3 = ["variant", "content", "children"];
6
7
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
7
8
  import { TooltipVariant, tooltipVariantOptions } from '@scaleflex/ui-tw/tooltip/tooltip.constants';
8
9
  import { cn } from '@scaleflex/ui-tw/utils/cn';
@@ -60,12 +61,13 @@ function TooltipContent(_ref4) {
60
61
  function WithTooltip(_ref5) {
61
62
  var variant = _ref5.variant,
62
63
  content = _ref5.content,
63
- children = _ref5.children;
64
+ children = _ref5.children,
65
+ otherProps = _objectWithoutProperties(_ref5, _excluded3);
64
66
  if (!content) return children;
65
67
  return /*#__PURE__*/React.createElement(Tooltip, null, /*#__PURE__*/React.createElement(TooltipTrigger, {
66
68
  asChild: true
67
- }, children), /*#__PURE__*/React.createElement(TooltipContent, {
69
+ }, children), /*#__PURE__*/React.createElement(TooltipContent, _extends({
68
70
  variant: variant
69
- }, content));
71
+ }, otherProps), content));
70
72
  }
71
73
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, WithTooltip };
@@ -2,7 +2,7 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
2
  import { TooltipVariant } from '@scaleflex/ui-tw/tooltip/tooltip.constants';
3
3
  import { ComponentProps, ReactElement } from 'react';
4
4
  export type TooltipVariantType = (typeof TooltipVariant)[keyof typeof TooltipVariant];
5
- export interface WithTooltipProps {
5
+ export interface WithTooltipProps extends Omit<ComponentProps<typeof TooltipPrimitive.Content>, 'content'> {
6
6
  content?: ReactElement | undefined | string;
7
7
  children: ReactElement;
8
8
  variant?: TooltipVariantType;