@scaleflex/ui-tw 0.0.31 → 0.0.33

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.
Files changed (57) hide show
  1. package/button/button.component.d.ts +1 -1
  2. package/button/button.types.d.ts +1 -1
  3. package/button/button.utils.d.ts +1 -1
  4. package/button/components/copy-to-clipboard-button.d.ts +1 -1
  5. package/button/components/end-icon.d.ts +1 -1
  6. package/button/components/start-icon.d.ts +1 -1
  7. package/card/card.component.d.ts +1 -1
  8. package/combobox/combobox-multi-inline/combobox-multi-inline.component.d.ts +2 -2
  9. package/combobox/combobox-multi-inline/combobox-multi-inline.component.js +6 -2
  10. package/combobox/combobox-multi-tag/combobox-multi-tag.component.d.ts +1 -1
  11. package/combobox/combobox-multi-tag/combobox-multi-tag.component.js +1 -1
  12. package/combobox/combobox-single/combobox-single.component.d.ts +2 -2
  13. package/combobox/combobox-single/combobox-single.component.js +4 -2
  14. package/combobox/combobox.component.d.ts +2 -2
  15. package/combobox/combobox.component.js +3 -1
  16. package/combobox/combobox.types.d.ts +3 -1
  17. package/command/command.component.d.ts +2 -2
  18. package/dialog/dialog.component.d.ts +1 -1
  19. package/form/components/form-combobox-field.component.d.ts +5 -0
  20. package/form/components/form-combobox-field.component.js +49 -0
  21. package/form/components/form-field-group.component.d.ts +1 -1
  22. package/form/components/form-input-field.component.d.ts +1 -1
  23. package/form/components/form-password-field.component.d.ts +1 -1
  24. package/form/components/form-select-field.component.d.ts +1 -1
  25. package/form/components/form-switch-field.component.d.ts +1 -1
  26. package/form/components/form-textarea-field.component.d.ts +1 -1
  27. package/form/form.component.d.ts +3 -3
  28. package/form/form.types.d.ts +13 -6
  29. package/form/index.d.ts +2 -1
  30. package/form/index.js +2 -2
  31. package/input/components/password-input.component.d.ts +1 -1
  32. package/input/input.component.d.ts +1 -1
  33. package/input/input.types.d.ts +1 -1
  34. package/label/components/info-outline-icon.d.ts +1 -1
  35. package/label/components/label-icon.d.ts +1 -1
  36. package/label/label.component.d.ts +1 -1
  37. package/label/label.types.d.ts +1 -1
  38. package/package.json +2 -2
  39. package/pill/pill.component.d.ts +1 -1
  40. package/pill/pill.types.d.ts +1 -1
  41. package/popover/popover.component.d.ts +1 -1
  42. package/select/components/select-icon.d.ts +1 -1
  43. package/select/components/selector.d.ts +1 -1
  44. package/select/select.component.d.ts +2 -2
  45. package/select/select.types.d.ts +1 -1
  46. package/separator/separator.component.d.ts +1 -1
  47. package/switch/switch.component.d.ts +1 -1
  48. package/switch/switch.types.d.ts +1 -1
  49. package/textarea/components/left-toolbar-buttons.d.ts +1 -1
  50. package/textarea/components/right-toolbar-buttons.d.ts +1 -1
  51. package/textarea/components/textarea-with-actions.d.ts +1 -1
  52. package/textarea/textarea.component.d.ts +1 -1
  53. package/textarea/textarea.types.d.ts +1 -1
  54. package/toaster/toaster.component.d.ts +1 -1
  55. package/toaster/toaster.types.d.ts +1 -1
  56. package/tooltip/tooltip.component.d.ts +2 -2
  57. package/tooltip/tooltip.types.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type ButtonProps } from './button.types';
2
+ import type { ButtonProps } from './button.types';
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "primary" | "secondary" | "outline" | "ghost-primary" | "ghost-secondary" | "error-primary" | "warning-primary" | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
@@ -1,7 +1,7 @@
1
1
  import { buttonVariants } from '@scaleflex/ui-tw/button/button.component';
2
2
  import { ButtonSize, ButtonVariant } from '@scaleflex/ui-tw/button/button.constants';
3
3
  import type { VariantProps } from 'class-variance-authority';
4
- import { ComponentProps, ReactElement } from 'react';
4
+ import type { ComponentProps, ReactElement } from 'react';
5
5
  export type ButtonSizeType = (typeof ButtonSize)[keyof typeof ButtonSize];
6
6
  export type ButtonVariantType = (typeof ButtonVariant)[keyof typeof ButtonVariant];
7
7
  export interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {
@@ -1,5 +1,5 @@
1
1
  import { IconSize } from '@scaleflex/ui-tw/button/button.constants';
2
- import { ButtonSizeType } from '@scaleflex/ui-tw/button/button.types';
2
+ import type { ButtonSizeType } from '@scaleflex/ui-tw/button/button.types';
3
3
  import type { MouseEvent } from 'react';
4
4
  export declare const getIconSizeInRem: (sizeName?: ButtonSizeType | null) => string;
5
5
  export declare const createRipple: (event: MouseEvent, container: HTMLElement) => void;
@@ -1,4 +1,4 @@
1
- import { ButtonSizeType } from '@scaleflex/ui-tw/button/button.types';
1
+ import type { ButtonSizeType } from '@scaleflex/ui-tw/button/button.types';
2
2
  import React from 'react';
3
3
  export interface CopyToClipboardButtonProps {
4
4
  text: string;
@@ -1,3 +1,3 @@
1
- import { EndIconProps } from '@scaleflex/ui-tw/button/button.types';
1
+ import type { EndIconProps } from '@scaleflex/ui-tw/button/button.types';
2
2
  declare const EndIcon: (props: EndIconProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
3
3
  export { EndIcon };
@@ -1,4 +1,4 @@
1
- import { StartIconProps } from '@scaleflex/ui-tw/button/button.types';
1
+ import type { StartIconProps } from '@scaleflex/ui-tw/button/button.types';
2
2
  import React from 'react';
3
3
  declare const startIconVariants: (props?: ({
4
4
  variant?: "primary" | "secondary" | "outline" | "ghost-primary" | "ghost-secondary" | "error-primary" | "warning-primary" | null | undefined;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ComponentProps } from 'react';
2
+ import type { ComponentProps } from 'react';
3
3
  declare function Card({ className, ...rest }: ComponentProps<'div'>): React.JSX.Element;
4
4
  declare function CardHeader({ className, ...rest }: ComponentProps<'div'>): React.JSX.Element;
5
5
  declare function CardTitle({ className, ...rest }: ComponentProps<'div'>): React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { ComboboxMultiInlineProps } from '../combobox.types';
3
- export declare function ComboboxMultiInline({ options, value, onChange, placeholder, className, disabled, size, readOnly, showClear, popoverClassName, }: ComboboxMultiInlineProps): React.JSX.Element;
2
+ import type { ComboboxMultiInlineProps } from '../combobox.types';
3
+ export declare function ComboboxMultiInline({ options, value, onChange, placeholder, className, disabled, size, readOnly, showClear, popoverClassName, ...rest }: ComboboxMultiInlineProps): React.JSX.Element;
@@ -1,5 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["options", "value", "onChange", "placeholder", "className", "disabled", "size", "readOnly", "showClear", "popoverClassName"];
3
5
  import { Popover } from '@scaleflex/ui-tw/popover';
4
6
  import { FormSize } from '@scaleflex/ui-tw/types/form-size';
5
7
  import React from 'react';
@@ -21,7 +23,8 @@ export function ComboboxMultiInline(_ref) {
21
23
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
22
24
  _ref$showClear = _ref.showClear,
23
25
  showClear = _ref$showClear === void 0 ? true : _ref$showClear,
24
- popoverClassName = _ref.popoverClassName;
26
+ popoverClassName = _ref.popoverClassName,
27
+ rest = _objectWithoutProperties(_ref, _excluded);
25
28
  var _useState = useState(false),
26
29
  _useState2 = _slicedToArray(_useState, 2),
27
30
  open = _useState2[0],
@@ -56,7 +59,8 @@ export function ComboboxMultiInline(_ref) {
56
59
  selected: selectedLabels.length > 0,
57
60
  onClearAll: function onClearAll() {
58
61
  return onChange([]);
59
- }
62
+ },
63
+ "aria-invalid": rest['aria-invalid']
60
64
  }, displayValue), /*#__PURE__*/React.createElement(ComboboxContent, {
61
65
  className: popoverClassName,
62
66
  options: options,
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
- import { ComboboxMultiTagProps } from '../combobox.types';
2
+ import type { ComboboxMultiTagProps } from '../combobox.types';
3
3
  export declare function ComboboxMultiTag({ options, value, onChange, placeholder, className, disabled, size, readOnly, popoverClassName, ...rest }: ComboboxMultiTagProps): React.JSX.Element;
@@ -66,7 +66,7 @@ export function ComboboxMultiTag(_ref) {
66
66
  }, /*#__PURE__*/React.createElement("button", {
67
67
  role: "combobox",
68
68
  "aria-expanded": open,
69
- "area-invalid": rest['aria-invalid'],
69
+ "aria-invalid": rest['aria-invalid'],
70
70
  className: cn.apply(void 0, ['flex w-full', isSelected ? 'flex-col' : 'items-center'].concat(_toConsumableArray(getBaseInputClasses()), [readOnly && readOnlyClassNames, selectionHighlightClassNames, focusRingClassNames, !isSelected && textareaVariants({
71
71
  size: size
72
72
  }), !isSelected && comboboxMultiTagsDefaultSizeOptions[size], className])),
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
- import { ComboboxSingleProps } from '../combobox.types';
3
- export declare function ComboboxSingle({ options, value, onChange, placeholder, className, disabled, popoverClassName, size, readOnly, showClear, ...rest }: ComboboxSingleProps): React.JSX.Element;
2
+ import type { ComboboxSingleProps } from '../combobox.types';
3
+ export declare function ComboboxSingle({ options, value, onChange, placeholder, className, disabled, popoverClassName, size, readOnly, showClear, formItemId, ...rest }: ComboboxSingleProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["options", "value", "onChange", "placeholder", "className", "disabled", "popoverClassName", "size", "readOnly", "showClear"];
3
+ var _excluded = ["options", "value", "onChange", "placeholder", "className", "disabled", "popoverClassName", "size", "readOnly", "showClear", "formItemId"];
4
4
  import { Popover } from '@scaleflex/ui-tw/popover';
5
5
  import { FormSize } from '@scaleflex/ui-tw/types/form-size';
6
6
  import * as React from 'react';
@@ -25,6 +25,7 @@ export function ComboboxSingle(_ref) {
25
25
  readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
26
26
  _ref$showClear = _ref.showClear,
27
27
  showClear = _ref$showClear === void 0 ? true : _ref$showClear,
28
+ formItemId = _ref.formItemId,
28
29
  rest = _objectWithoutProperties(_ref, _excluded);
29
30
  var _useState = useState(false),
30
31
  _useState2 = _slicedToArray(_useState, 2),
@@ -47,7 +48,8 @@ export function ComboboxSingle(_ref) {
47
48
  },
48
49
  selected: !!selectedLabel,
49
50
  showClear: showClear,
50
- "aria-invalid": rest['aria-invalid']
51
+ "aria-invalid": rest['aria-invalid'],
52
+ formItemId: formItemId
51
53
  }, selectedLabel || placeholder), /*#__PURE__*/React.createElement(ComboboxContent, {
52
54
  className: popoverClassName,
53
55
  options: options,
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { ComboboxContentProps, ComboboxTriggerProps } from './combobox.types';
3
- export declare function ComboboxTrigger({ children, open, disabled, readOnly, size, className, selected, showClear, onClearAll, ...rest }: ComboboxTriggerProps): React.JSX.Element;
2
+ import type { ComboboxContentProps, ComboboxTriggerProps } from './combobox.types';
3
+ export declare function ComboboxTrigger({ children, open, disabled, readOnly, size, className, selected, showClear, onClearAll, formItemId, ...rest }: ComboboxTriggerProps): React.JSX.Element;
4
4
  export declare function ComboboxContent({ options, value: selectedValue, onSelect, size, multiple, className, }: ComboboxContentProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["children", "open", "disabled", "readOnly", "size", "className", "selected", "showClear", "onClearAll"];
3
+ var _excluded = ["children", "open", "disabled", "readOnly", "size", "className", "selected", "showClear", "onClearAll", "formItemId"];
4
4
  import { buttonVariants } from '@scaleflex/ui-tw/button';
5
5
  import { ButtonVariant, buttonBaseClassNames } from '@scaleflex/ui-tw/button/button.constants';
6
6
  import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '@scaleflex/ui-tw/command';
@@ -32,6 +32,7 @@ export function ComboboxTrigger(_ref) {
32
32
  _ref$showClear = _ref.showClear,
33
33
  showClear = _ref$showClear === void 0 ? false : _ref$showClear,
34
34
  onClearAll = _ref.onClearAll,
35
+ formItemId = _ref.formItemId,
35
36
  rest = _objectWithoutProperties(_ref, _excluded);
36
37
  var _getToolbarSizes = getToolbarSizes(size),
37
38
  iconSize = _getToolbarSizes.iconSize;
@@ -41,6 +42,7 @@ export function ComboboxTrigger(_ref) {
41
42
  return /*#__PURE__*/React.createElement(PopoverTrigger, {
42
43
  asChild: true
43
44
  }, /*#__PURE__*/React.createElement("button", {
45
+ id: formItemId,
44
46
  role: "combobox",
45
47
  "aria-expanded": open,
46
48
  "aria-invalid": rest['aria-invalid'],
@@ -1,11 +1,12 @@
1
1
  import { SelectOption } from '@scaleflex/ui-tw/form';
2
2
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
3
3
  import { Command as CommandPrimitive } from 'cmdk';
4
- import { ComponentProps, KeyboardEvent, MouseEvent, ReactElement, ReactNode } from 'react';
4
+ import type { ComponentProps, KeyboardEvent, MouseEvent, ReactElement, ReactNode } from 'react';
5
5
  export type ClearEvent = MouseEvent | KeyboardEvent;
6
6
  export type ComboboxTriggerProps = {
7
7
  children: ReactNode;
8
8
  open: boolean;
9
+ formItemId?: string;
9
10
  disabled?: boolean;
10
11
  readOnly?: boolean;
11
12
  size?: FormSizeType;
@@ -47,6 +48,7 @@ interface ComboboxCommonProps {
47
48
  size?: FormSizeType;
48
49
  popoverClassName?: string;
49
50
  'aria-invalid'?: boolean;
51
+ formItemId?: string;
50
52
  }
51
53
  export interface ComboboxSingleProps extends ComboboxCommonProps {
52
54
  value: string;
@@ -1,8 +1,8 @@
1
- import { CommandGroupProps, CommandInputProps, CommandItemProps } from '@scaleflex/ui-tw/combobox/combobox.types';
1
+ import type { CommandGroupProps, CommandInputProps, CommandItemProps } from '@scaleflex/ui-tw/combobox/combobox.types';
2
2
  import { Dialog } from '@scaleflex/ui-tw/dialog';
3
3
  import { Command as CommandPrimitive } from 'cmdk';
4
4
  import React from 'react';
5
- import { ComponentProps } from 'react';
5
+ import type { ComponentProps } from 'react';
6
6
  declare function Command({ className, ...props }: ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
7
7
  declare function CommandDialog({ title, description, children, ...props }: ComponentProps<typeof Dialog> & {
8
8
  title?: string;
@@ -1,5 +1,5 @@
1
1
  import * as DialogPrimitive from '@radix-ui/react-dialog';
2
- import React, { ComponentProps } from 'react';
2
+ import React, { type ComponentProps } from 'react';
3
3
  declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
4
  declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
5
  declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { FormComboboxFieldProps } from '@scaleflex/ui-tw/form/form.types';
2
+ import React from 'react';
3
+ import { FieldValues, Path } from 'react-hook-form';
4
+ declare function FormComboboxField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ variant, comboboxProps, ...rest }: FormComboboxFieldProps<TFieldValues, TName>): React.JSX.Element;
5
+ export { FormComboboxField };
@@ -0,0 +1,49 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["variant", "comboboxProps"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ import { ComboboxMultiInline, ComboboxMultiTag, ComboboxSingle } from '@scaleflex/ui-tw/combobox';
8
+ import { useFormField } from '@scaleflex/ui-tw/form';
9
+ import { FormFieldGroup } from '@scaleflex/ui-tw/form';
10
+ import React from 'react';
11
+ function FormComboboxField(_ref) {
12
+ var _ref$variant = _ref.variant,
13
+ variant = _ref$variant === void 0 ? 'single' : _ref$variant,
14
+ _ref$comboboxProps = _ref.comboboxProps,
15
+ comboboxProps = _ref$comboboxProps === void 0 ? {} : _ref$comboboxProps,
16
+ rest = _objectWithoutProperties(_ref, _excluded);
17
+ var readOnly = rest.readOnly,
18
+ disabled = rest.disabled;
19
+ return /*#__PURE__*/React.createElement(FormFieldGroup, rest, function (field, args) {
20
+ var _useFormField = useFormField(),
21
+ error = _useFormField.error,
22
+ formItemId = _useFormField.formItemId;
23
+ var commonProps = _objectSpread(_objectSpread({}, comboboxProps), {}, {
24
+ options: comboboxProps.options || [],
25
+ placeholder: comboboxProps.placeholder,
26
+ readOnly: readOnly,
27
+ disabled: disabled,
28
+ size: args === null || args === void 0 ? void 0 : args.size,
29
+ formItemId: formItemId,
30
+ value: field.value,
31
+ onChange: field.onChange,
32
+ 'aria-invalid': !!error
33
+ });
34
+ switch (variant) {
35
+ case 'multi-inline':
36
+ return /*#__PURE__*/React.createElement(ComboboxMultiInline, _extends({}, commonProps, {
37
+ showClear: comboboxProps.showClear
38
+ }));
39
+ case 'multi-tags':
40
+ return /*#__PURE__*/React.createElement(ComboboxMultiTag, commonProps);
41
+ case 'single':
42
+ default:
43
+ return /*#__PURE__*/React.createElement(ComboboxSingle, _extends({}, commonProps, {
44
+ showClear: comboboxProps.showClear
45
+ }));
46
+ }
47
+ });
48
+ }
49
+ export { FormComboboxField };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormFieldGroupProps } from '../form.types';
3
+ import type { FormFieldGroupProps } from '../form.types';
4
4
  declare function FormFieldGroup<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, size, readOnly, disabled, tooltip, highlight, horizontal, horizontalLabelWidth, children, }: FormFieldGroupProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormFieldGroup };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormInputFieldProps } from '../form.types';
3
+ import type { FormInputFieldProps } from '../form.types';
4
4
  declare function FormInputField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ inputProps, ...rest }: FormInputFieldProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormInputField };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormInputFieldProps } from '../form.types';
3
+ import type { FormInputFieldProps } from '../form.types';
4
4
  declare function FormPasswordField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ inputProps, ...rest }: FormInputFieldProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormPasswordField };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormSelectFieldProps } from '../form.types';
3
+ import type { FormSelectFieldProps } from '../form.types';
4
4
  declare function FormSelectField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ selectProps, showGroupSeparator, ...rest }: FormSelectFieldProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormSelectField };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormSwitchFieldProps } from '../form.types';
3
+ import type { FormSwitchFieldProps } from '../form.types';
4
4
  declare function FormSwitchField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, disabled, tooltip, size, layout, switchProps, }: FormSwitchFieldProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormSwitchField };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { FieldValues, Path } from 'react-hook-form';
3
- import { FormTextareaFieldProps } from '../form.types';
3
+ import type { FormTextareaFieldProps } from '../form.types';
4
4
  declare function FormTextareaField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ textareaProps, ...rest }: FormTextareaFieldProps<TFieldValues, TName>): React.JSX.Element;
5
5
  export { FormTextareaField };
@@ -1,9 +1,9 @@
1
1
  import { Slot } from '@radix-ui/react-slot';
2
- import { LabelProps } from '@scaleflex/ui-tw/label/label.types';
2
+ import type { LabelProps } from '@scaleflex/ui-tw/label/label.types';
3
3
  import * as React from 'react';
4
- import { ComponentProps } from 'react';
4
+ import { type ComponentProps } from 'react';
5
5
  import { type ControllerProps, type FieldPath, type FieldValues } from 'react-hook-form';
6
- import { FormMessageSizeType } from './form.types';
6
+ import type { FormMessageSizeType } from './form.types';
7
7
  declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
8
8
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => React.JSX.Element;
9
9
  declare const useFormField: () => {
@@ -1,11 +1,12 @@
1
- import { InputProps } from '@scaleflex/ui-tw/input';
2
- import { SelectProps } from '@scaleflex/ui-tw/select/select.types';
3
- import { SwitchProps } from '@scaleflex/ui-tw/switch/switch.types';
4
- import { TextareaProps } from '@scaleflex/ui-tw/textarea';
5
- import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
1
+ import type { ComboboxMultiInlineProps, ComboboxMultiTagProps, ComboboxSingleProps } from '@scaleflex/ui-tw/combobox/combobox.types';
2
+ import type { InputProps } from '@scaleflex/ui-tw/input';
3
+ import type { SelectProps } from '@scaleflex/ui-tw/select/select.types';
4
+ import type { SwitchProps } from '@scaleflex/ui-tw/switch/switch.types';
5
+ import type { TextareaProps } from '@scaleflex/ui-tw/textarea';
6
+ import type { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
6
7
  import type { Values } from '@scaleflex/ui-tw/types/values';
7
8
  import { ReactElement, ReactNode } from 'react';
8
- import { ControllerRenderProps, type FieldPath, FieldValues, Path, UseControllerProps } from 'react-hook-form';
9
+ import { type ControllerRenderProps, type FieldPath, FieldValues, Path, UseControllerProps } from 'react-hook-form';
9
10
  import { FormMessageSize, SwitchLayout } from './form.constants';
10
11
  export type FormMessageSizeType = Values<typeof FormMessageSize>;
11
12
  export type SwitchLayoutType = Values<typeof SwitchLayout>;
@@ -15,6 +16,7 @@ export type FormItemContextValue = {
15
16
  export type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
16
17
  name: TName;
17
18
  };
19
+ export type ComboboxVariant = 'single' | 'multi-inline' | 'multi-tags';
18
20
  export interface FormFieldArgs {
19
21
  size?: FormSizeType;
20
22
  readOnly?: boolean;
@@ -68,6 +70,11 @@ export type FormSelectFieldProps<TFieldValues extends FieldValues, TName extends
68
70
  showGroupSeparator?: boolean;
69
71
  selectProps?: FormSelectProps;
70
72
  };
73
+ export type FormComboboxFieldProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> = Omit<FormFieldGroupProps<TFieldValues, TName>, 'children'> & {
74
+ showGroupSeparator?: boolean;
75
+ variant?: ComboboxVariant;
76
+ comboboxProps?: Partial<ComboboxSingleProps & ComboboxMultiInlineProps & ComboboxMultiTagProps>;
77
+ };
71
78
  export interface FormSelectInnerProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> {
72
79
  field: ControllerRenderProps<TFieldValues, TName>;
73
80
  args: FormFieldArgs | undefined;
package/form/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, useFormField, } from './form.component';
2
2
  export { isOptionGroup } from './form.utils';
3
- export { SelectOption, FlatOption, OptionGroup } from './form.types';
3
+ export type { SelectOption, FlatOption, OptionGroup } from './form.types';
4
4
  export { FormFieldGroup } from './components/form-field-group.component';
5
5
  export { FormInputField } from './components/form-input-field.component';
6
6
  export { FormPasswordField } from './components/form-password-field.component';
7
7
  export { FormTextareaField } from './components/form-textarea-field.component';
8
8
  export { FormSwitchField } from './components/form-switch-field.component';
9
9
  export { FormSelectField } from './components/form-select-field.component';
10
+ export { FormComboboxField } from './components/form-combobox-field.component';
package/form/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, useFormField } from './form.component';
2
2
  export { isOptionGroup } from './form.utils';
3
- export { SelectOption, FlatOption, OptionGroup } from './form.types';
4
3
  export { FormFieldGroup } from './components/form-field-group.component';
5
4
  export { FormInputField } from './components/form-input-field.component';
6
5
  export { FormPasswordField } from './components/form-password-field.component';
7
6
  export { FormTextareaField } from './components/form-textarea-field.component';
8
7
  export { FormSwitchField } from './components/form-switch-field.component';
9
- export { FormSelectField } from './components/form-select-field.component';
8
+ export { FormSelectField } from './components/form-select-field.component';
9
+ export { FormComboboxField } from './components/form-combobox-field.component';
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { InputProps } from '../input.types';
2
+ import type { InputProps } from '../input.types';
3
3
  export declare function PasswordInput({ className, size, disabled, readOnly, ...props }: InputProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InputProps } from './input.types';
2
+ import type { InputProps } from './input.types';
3
3
  declare const inputVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
2
- import { ComponentProps } from 'react';
2
+ import type { ComponentProps } from 'react';
3
3
  export interface InputProps extends Omit<ComponentProps<'input'>, 'size'> {
4
4
  size?: FormSizeType;
5
5
  'aria-invalid'?: boolean;
@@ -1,3 +1,3 @@
1
- import { IconProps } from '@scaleflex/icons-tw/icon.props';
1
+ import type { IconProps } from '@scaleflex/icons-tw/icon.props';
2
2
  declare const InfoOutlineIcon: ({ color, size, ref, ...rest }: IconProps) => JSX.Element;
3
3
  export { InfoOutlineIcon };
@@ -1,4 +1,4 @@
1
- import { LabelIconProps } from '@scaleflex/ui-tw/label/label.types';
1
+ import type { LabelIconProps } from '@scaleflex/ui-tw/label/label.types';
2
2
  import React from 'react';
3
3
  declare const LabelIcon: (props: LabelIconProps) => React.JSX.Element | null;
4
4
  export { LabelIcon };
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { LabelProps } from './label.types';
2
+ import type { LabelProps } from './label.types';
3
3
  declare function Label({ className, size, children, icon, tooltip, ...props }: LabelProps): React.JSX.Element;
4
4
  export { Label };
@@ -1,6 +1,6 @@
1
1
  import * as LabelPrimitive from '@radix-ui/react-label';
2
2
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
3
- import { ComponentProps, ReactElement } from 'react';
3
+ import type { ComponentProps, ReactElement } from 'react';
4
4
  export interface LabelProps extends Omit<ComponentProps<typeof LabelPrimitive.Root>, 'size'> {
5
5
  size?: FormSizeType;
6
6
  icon?: ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleflex/ui-tw",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -20,7 +20,7 @@
20
20
  "@radix-ui/react-slot": "^1.1.2",
21
21
  "@radix-ui/react-switch": "^1.0.1",
22
22
  "@radix-ui/react-tooltip": "^1.2.6",
23
- "@scaleflex/icons-tw": "^0.0.31",
23
+ "@scaleflex/icons-tw": "^0.0.33",
24
24
  "@types/lodash.merge": "^4.6.9",
25
25
  "class-variance-authority": "^0.7.1",
26
26
  "cmdk": "^1.1.1",
@@ -1,4 +1,4 @@
1
- import { PillProps } from '@scaleflex/ui-tw/pill/pill.types';
1
+ import type { PillProps } from '@scaleflex/ui-tw/pill/pill.types';
2
2
  import React from 'react';
3
3
  declare const pillVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
@@ -1,6 +1,6 @@
1
1
  import { pillVariants } from '@scaleflex/ui-tw/pill/pill.component';
2
2
  import type { VariantProps } from 'class-variance-authority';
3
- import { ComponentProps, MouseEvent } from 'react';
3
+ import type { ComponentProps, MouseEvent } from 'react';
4
4
  export interface PillProps extends ComponentProps<'div'>, VariantProps<typeof pillVariants> {
5
5
  removable?: boolean;
6
6
  onRemove?: (event: MouseEvent<HTMLButtonElement>) => void;
@@ -1,5 +1,5 @@
1
1
  import * as PopoverPrimitive from '@radix-ui/react-popover';
2
- import React, { ComponentProps } from 'react';
2
+ import React, { type ComponentProps } from 'react';
3
3
  declare function Popover({ ...props }: ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
4
4
  declare function PopoverTrigger({ ...props }: ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
5
5
  declare function PopoverContent({ className, align, sideOffset, ...props }: ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- import { SelectIconProps } from '@scaleflex/ui-tw/select/select.types';
1
+ import type { SelectIconProps } from '@scaleflex/ui-tw/select/select.types';
2
2
  export declare const SelectIcon: (props: SelectIconProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { SelectorProps } from '../select.types';
2
+ import type { SelectorProps } from '../select.types';
3
3
  export declare function Selector({ value, onChange, placeholder, disabled, readOnly, size, className, icon, options, showGroupSeparator, formItemId, ...rest }: SelectorProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as SelectPrimitive from '@radix-ui/react-select';
2
- import { SelectItemProps, SelectLabelProps, SelectTriggerProps } from '@scaleflex/ui-tw/select/select.types';
3
- import React, { ComponentProps } from 'react';
2
+ import type { SelectItemProps, SelectLabelProps, SelectTriggerProps } from '@scaleflex/ui-tw/select/select.types';
3
+ import React, { type ComponentProps } from 'react';
4
4
  declare function Select({ ...props }: ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
5
5
  declare function SelectGroup({ ...props }: ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
6
6
  declare function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import * as SelectPrimitive from '@radix-ui/react-select';
2
2
  import { SelectOption } from '@scaleflex/ui-tw/form';
3
3
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
4
- import { ComponentProps, ReactElement } from 'react';
4
+ import type { ComponentProps, ReactElement } from 'react';
5
5
  export interface SelectProps extends ComponentProps<typeof SelectPrimitive.Root> {
6
6
  }
7
7
  export interface SelectTriggerProps extends ComponentProps<typeof SelectPrimitive.Trigger> {
@@ -1,5 +1,5 @@
1
1
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
2
2
  import * as React from 'react';
3
- import { ComponentProps } from 'react';
3
+ import type { ComponentProps } from 'react';
4
4
  declare function Separator({ className, orientation, decorative, ...props }: ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
5
5
  export { Separator };
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
- import { SwitchProps } from './switch.types';
2
+ import type { SwitchProps } from './switch.types';
3
3
  declare function Switch({ className, size, ...props }: SwitchProps): React.JSX.Element;
4
4
  export { Switch };
@@ -1,6 +1,6 @@
1
1
  import * as SwitchPrimitive from '@radix-ui/react-switch';
2
2
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
3
- import { ComponentProps } from 'react';
3
+ import type { ComponentProps } from 'react';
4
4
  export interface SwitchProps extends ComponentProps<typeof SwitchPrimitive.Root> {
5
5
  size?: FormSizeType;
6
6
  }
@@ -1,3 +1,3 @@
1
- import { LeftToolbarButtonsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
1
+ import type { LeftToolbarButtonsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
2
2
  import React from 'react';
3
3
  export declare const LeftToolbarButtons: (props: LeftToolbarButtonsProps) => React.JSX.Element;
@@ -1,3 +1,3 @@
1
- import { RightToolbarButtonsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
1
+ import type { RightToolbarButtonsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
2
2
  import React from 'react';
3
3
  export declare const RightToolbarButtons: (props: RightToolbarButtonsProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import { TextareaWithActionsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
1
+ import type { TextareaWithActionsProps } from '@scaleflex/ui-tw/textarea/textarea.types';
2
2
  import React from 'react';
3
3
  declare function TextareaWithActions({ leftToolbar, rightToolbar, className, ...textareaProps }: TextareaWithActionsProps): React.JSX.Element;
4
4
  export { TextareaWithActions };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TextareaProps } from './textarea.types';
2
+ import type { TextareaProps } from './textarea.types';
3
3
  declare const textareaVariants: (props?: ({
4
4
  size?: "sm" | "md" | "lg" | null | undefined;
5
5
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  import { FormSizeType } from '@scaleflex/ui-tw/types/form-size';
2
- import { ComponentProps, ReactElement } from 'react';
2
+ import type { ComponentProps, ReactElement } from 'react';
3
3
  export interface TextareaProps extends Omit<ComponentProps<'textarea'>, 'size'> {
4
4
  size?: FormSizeType;
5
5
  'aria-invalid'?: boolean;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { ToasterProps } from './toaster.types';
2
+ import type { ToasterProps } from './toaster.types';
3
3
  declare const Toaster: ({ ...props }: ToasterProps) => React.JSX.Element;
4
4
  export { Toaster };
@@ -1,3 +1,3 @@
1
- import { ToasterProps as SonnerToasterProps } from 'sonner';
1
+ import { type ToasterProps as SonnerToasterProps } from 'sonner';
2
2
  export interface ToasterProps extends SonnerToasterProps {
3
3
  }
@@ -1,7 +1,7 @@
1
1
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
2
  import * as React from 'react';
3
- import { ComponentProps } from 'react';
4
- import { TooltipContentProps, WithTooltipProps } from './tooltip.types';
3
+ import type { ComponentProps } from 'react';
4
+ import type { TooltipContentProps, WithTooltipProps } from './tooltip.types';
5
5
  declare function TooltipProvider({ delayDuration, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
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;
@@ -1,5 +1,5 @@
1
1
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
2
- import { ComponentProps, ReactElement } from 'react';
2
+ import type { ComponentProps, ReactElement } from 'react';
3
3
  import { TooltipVariant } from './tooltip.constants';
4
4
  export type TooltipVariantType = (typeof TooltipVariant)[keyof typeof TooltipVariant];
5
5
  export interface WithTooltipProps extends Omit<ComponentProps<typeof TooltipPrimitive.Content>, 'content'> {