@scaleflex/ui-tw 0.0.69 → 0.0.71

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.
@@ -1,4 +1,4 @@
1
1
  import type { ColorPickerProps } from '@scaleflex/ui-tw/color-picker/color-picker.types';
2
2
  import React from 'react';
3
- declare function ColorPicker({ title, value, placeholder, onChange, onCancel, onSelect, onFocus, className, inputClassName, cancelLabel, selectLabel, children, presetColors, displayAsInput, }: ColorPickerProps): React.JSX.Element;
3
+ declare function ColorPicker({ title, value, placeholder, onChange, onCancel, onSelect, inputTriggerProps, className, inputClassName, cancelLabel, selectLabel, children, presetColors, displayAsInput, }: ColorPickerProps): React.JSX.Element;
4
4
  export { ColorPicker };
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
4
  import { Button } from '@scaleflex/ui-tw/button';
@@ -16,7 +17,7 @@ function ColorPicker(_ref) {
16
17
  _onChange = _ref.onChange,
17
18
  onCancel = _ref.onCancel,
18
19
  onSelect = _ref.onSelect,
19
- onFocus = _ref.onFocus,
20
+ inputTriggerProps = _ref.inputTriggerProps,
20
21
  className = _ref.className,
21
22
  inputClassName = _ref.inputClassName,
22
23
  cancelLabel = _ref.cancelLabel,
@@ -51,16 +52,15 @@ function ColorPicker(_ref) {
51
52
  "aria-label": "Open color picker"
52
53
  })), /*#__PURE__*/React.createElement("span", {
53
54
  className: "text-muted-foreground absolute left-11 h-10 leading-10"
54
- }, "#"), /*#__PURE__*/React.createElement(HexColorInput, {
55
+ }, "#"), /*#__PURE__*/React.createElement(HexColorInput, _extends({}, inputTriggerProps, {
55
56
  color: value,
56
- onFocus: onFocus,
57
57
  onChange: function onChange(color) {
58
58
  setTempValue(color);
59
59
  onSelect === null || onSelect === void 0 || onSelect(color);
60
60
  },
61
61
  placeholder: placeholder || 'Enter hex color',
62
62
  className: cn.apply(void 0, ['w-full bg-transparent font-mono outline-none', 'flex items-center gap-2'].concat(_toConsumableArray(getBaseInputClasses()), [readOnlyClassNames, selectionHighlightClassNames, inputVariants(), 'pl-14', inputClassName]))
63
- })) : /*#__PURE__*/React.createElement(DialogTrigger, {
63
+ }))) : /*#__PURE__*/React.createElement(DialogTrigger, {
64
64
  asChild: true
65
65
  }, /*#__PURE__*/React.createElement("button", {
66
66
  type: "button",
@@ -1,10 +1,10 @@
1
- import type { FocusEvent, ReactElement, ReactNode } from 'react';
1
+ import type { InputHTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  export type ColorPickerProps = {
3
3
  value: string;
4
4
  onSelect: (value: string) => void;
5
5
  onChange?: (value: string) => void;
6
6
  onCancel?: () => void;
7
- onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
7
+ inputTriggerProps?: InputHTMLAttributes<HTMLInputElement>;
8
8
  className?: string;
9
9
  title?: string | ReactElement;
10
10
  cancelLabel?: string | ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/ui-tw",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -23,7 +23,7 @@
23
23
  "@radix-ui/react-slot": "^1.1.2",
24
24
  "@radix-ui/react-switch": "^1.0.1",
25
25
  "@radix-ui/react-tooltip": "^1.2.6",
26
- "@scaleflex/icons-tw": "^0.0.69",
26
+ "@scaleflex/icons-tw": "^0.0.71",
27
27
  "@tanstack/react-table": "^8.21.3",
28
28
  "@types/lodash.merge": "^4.6.9",
29
29
  "class-variance-authority": "^0.7.1",