@scaleflex/ui-tw 0.0.52 → 0.0.53
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.
- package/combobox/combobox.component.js +7 -3
- package/combobox/combobox.types.d.ts +1 -0
- package/command/command.component.d.ts +1 -1
- package/command/command.component.js +13 -8
- package/command/command.utils.d.ts +3 -3
- package/command/command.utils.js +1 -1
- package/form/components/form-checkbox-field.component.d.ts +1 -1
- package/form/components/form-checkbox-field.component.js +4 -1
- package/form/components/form-checkbox-group-field.component.d.ts +1 -1
- package/form/components/form-checkbox-group-field.component.js +7 -2
- package/form/components/form-field-group.component.d.ts +1 -1
- package/form/components/form-field-group.component.js +4 -1
- package/form/components/form-radio-group-field.component.d.ts +1 -1
- package/form/components/form-radio-group-field.component.js +7 -2
- package/form/components/form-switch-field.component.d.ts +1 -1
- package/form/components/form-switch-field.component.js +7 -2
- package/form/form.types.d.ts +6 -1
- package/label/label.component.d.ts +1 -1
- package/label/label.component.js +7 -5
- package/label/label.types.d.ts +2 -0
- package/package.json +2 -2
- package/select/components/selector.js +35 -5
- package/select/select.component.d.ts +1 -1
- package/select/select.component.js +11 -8
- package/select/select.constants.d.ts +3 -3
- package/select/select.constants.js +1 -1
- package/select/select.types.d.ts +1 -0
|
@@ -97,6 +97,7 @@ export function ComboboxContent(_ref2) {
|
|
|
97
97
|
size: size,
|
|
98
98
|
placeholder: searchPlaceholder
|
|
99
99
|
}), /*#__PURE__*/React.createElement(CommandList, null, /*#__PURE__*/React.createElement(CommandEmpty, null, "No results found."), options === null || options === void 0 ? void 0 : options.map(function (option, groupIndex) {
|
|
100
|
+
var _option$optionLabel;
|
|
100
101
|
if (isOptionGroup(option)) {
|
|
101
102
|
return /*#__PURE__*/React.createElement(CommandGroup, {
|
|
102
103
|
key: groupIndex,
|
|
@@ -104,10 +105,12 @@ export function ComboboxContent(_ref2) {
|
|
|
104
105
|
size: size
|
|
105
106
|
}, option.options.map(function (_ref3) {
|
|
106
107
|
var label = _ref3.label,
|
|
108
|
+
optionLabel = _ref3.optionLabel,
|
|
107
109
|
value = _ref3.value,
|
|
108
110
|
disabled = _ref3.disabled,
|
|
109
111
|
icon = _ref3.icon,
|
|
110
|
-
tooltip = _ref3.tooltip
|
|
112
|
+
tooltip = _ref3.tooltip,
|
|
113
|
+
disabledTooltip = _ref3.disabledTooltip;
|
|
111
114
|
return /*#__PURE__*/React.createElement(CommandItem, {
|
|
112
115
|
size: size,
|
|
113
116
|
multiple: multiple,
|
|
@@ -116,12 +119,13 @@ export function ComboboxContent(_ref2) {
|
|
|
116
119
|
icon: icon,
|
|
117
120
|
value: value,
|
|
118
121
|
tooltip: tooltip,
|
|
122
|
+
disabledTooltip: disabledTooltip,
|
|
119
123
|
isGroup: !!option.label,
|
|
120
124
|
selectedValue: selectedValue,
|
|
121
125
|
onSelect: function onSelect() {
|
|
122
126
|
return _onSelect(value);
|
|
123
127
|
}
|
|
124
|
-
}, label);
|
|
128
|
+
}, optionLabel !== null && optionLabel !== void 0 ? optionLabel : label);
|
|
125
129
|
}), showGroupSeparator && groupIndex !== options.length - 1 && /*#__PURE__*/React.createElement(SelectSeparator, null));
|
|
126
130
|
}
|
|
127
131
|
return /*#__PURE__*/React.createElement(CommandGroup, {
|
|
@@ -138,6 +142,6 @@ export function ComboboxContent(_ref2) {
|
|
|
138
142
|
onSelect: function onSelect() {
|
|
139
143
|
return _onSelect(option.value);
|
|
140
144
|
}
|
|
141
|
-
}, option.label));
|
|
145
|
+
}, (_option$optionLabel = option.optionLabel) !== null && _option$optionLabel !== void 0 ? _option$optionLabel : option.label));
|
|
142
146
|
}))));
|
|
143
147
|
}
|
|
@@ -40,6 +40,7 @@ export interface CommandItemProps extends ComponentProps<typeof CommandPrimitive
|
|
|
40
40
|
icon?: ReactElement;
|
|
41
41
|
size?: FormSizeType;
|
|
42
42
|
tooltip?: ReactElement | string;
|
|
43
|
+
disabledTooltip?: ReactElement | string;
|
|
43
44
|
isGroup?: boolean;
|
|
44
45
|
shortcut?: ReactElement | string;
|
|
45
46
|
selectedValue?: string | string[];
|
|
@@ -13,6 +13,6 @@ declare function CommandList({ className, ...props }: ComponentProps<typeof Comm
|
|
|
13
13
|
declare function CommandEmpty({ className, ...rest }: ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
14
|
declare function CommandGroup({ className, size, ...props }: CommandGroupProps): React.JSX.Element;
|
|
15
15
|
declare function CommandSeparator({ className, ...props }: ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
|
|
16
|
-
declare function CommandItem({ className, size, isGroup, icon, tooltip, children, selectedValue, multiple, value, shortcut, ...props }: CommandItemProps): React.JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, size, isGroup, icon, tooltip, children, selectedValue, multiple, value, shortcut, disabledTooltip, disabled, ...props }: CommandItemProps): React.JSX.Element;
|
|
17
17
|
declare function CommandShortcut({ className, ...props }: ComponentProps<'span'>): React.JSX.Element;
|
|
18
18
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -7,7 +7,7 @@ var _excluded = ["className"],
|
|
|
7
7
|
_excluded5 = ["className"],
|
|
8
8
|
_excluded6 = ["className", "size"],
|
|
9
9
|
_excluded7 = ["className"],
|
|
10
|
-
_excluded8 = ["className", "size", "isGroup", "icon", "tooltip", "children", "selectedValue", "multiple", "value", "shortcut"],
|
|
10
|
+
_excluded8 = ["className", "size", "isGroup", "icon", "tooltip", "children", "selectedValue", "multiple", "value", "shortcut", "disabledTooltip", "disabled"],
|
|
11
11
|
_excluded9 = ["className"];
|
|
12
12
|
import { Dialog, DialogFormDescription, DialogFormHeader, DialogFormTitle, DialogWideContent } from '@scaleflex/ui-tw/dialog';
|
|
13
13
|
import { LabelIcon } from '@scaleflex/ui-tw/label/components/label-icon';
|
|
@@ -116,30 +116,35 @@ function CommandItem(_ref8) {
|
|
|
116
116
|
multiple = _ref8.multiple,
|
|
117
117
|
value = _ref8.value,
|
|
118
118
|
shortcut = _ref8.shortcut,
|
|
119
|
+
disabledTooltip = _ref8.disabledTooltip,
|
|
120
|
+
disabled = _ref8.disabled,
|
|
119
121
|
props = _objectWithoutProperties(_ref8, _excluded8);
|
|
120
122
|
var selected = value && (multiple ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.includes(value) : value === selectedValue);
|
|
121
123
|
return /*#__PURE__*/React.createElement(CommandPrimitive.Item, _extends({
|
|
122
124
|
"data-slot": "command-item",
|
|
123
|
-
className: cn('relative flex w-full cursor-pointer items-center justify-between gap-2 outline-hidden select-none', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground', '
|
|
125
|
+
className: cn('relative flex w-full cursor-pointer items-center justify-between gap-2 outline-hidden select-none', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground', '!opacity-100 data-[disabled=true]:cursor-not-allowed', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", selectItemVariants({
|
|
124
126
|
size: size,
|
|
125
127
|
className: className
|
|
126
|
-
}), isGroup && getOptionInGroupPaddingLeft(size), selected && 'text-primary pr-7', className)
|
|
128
|
+
}), isGroup && getOptionInGroupPaddingLeft(size), selected && 'text-primary pr-7', className),
|
|
129
|
+
disabled: disabled
|
|
127
130
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
128
131
|
className: "flex flex-1 items-center overflow-hidden"
|
|
129
132
|
}, icon && /*#__PURE__*/React.createElement(SelectIcon, {
|
|
130
133
|
size: size,
|
|
131
134
|
icon: icon,
|
|
132
|
-
className: cn('text-muted-foreground hover:text-primary shrink-0', selected && 'text-primary')
|
|
135
|
+
className: cn('text-muted-foreground hover:text-primary shrink-0', selected && 'text-primary', disabled && 'opacity-50')
|
|
133
136
|
}), /*#__PURE__*/React.createElement("div", {
|
|
134
137
|
className: "flex items-center gap-1 overflow-hidden"
|
|
135
138
|
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
-
className:
|
|
137
|
-
}, children), tooltip && /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: cn('line-clamp-2 overflow-hidden text-left break-words text-ellipsis', disabled && 'opacity-50')
|
|
140
|
+
}, children), (tooltip || disabledTooltip) && /*#__PURE__*/React.createElement("div", {
|
|
138
141
|
className: "flex shrink-0 items-center"
|
|
139
142
|
}, /*#__PURE__*/React.createElement(LabelIcon, {
|
|
140
143
|
size: size,
|
|
141
|
-
tooltip: tooltip
|
|
142
|
-
})))), shortcut && /*#__PURE__*/React.createElement(CommandShortcut,
|
|
144
|
+
tooltip: disabled ? disabledTooltip : tooltip
|
|
145
|
+
})))), shortcut && /*#__PURE__*/React.createElement(CommandShortcut, {
|
|
146
|
+
className: cn(disabled && 'opacity-50')
|
|
147
|
+
}, shortcut), /*#__PURE__*/React.createElement("span", {
|
|
143
148
|
className: "absolute right-2 flex size-3.5 items-center justify-center"
|
|
144
149
|
}, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
145
150
|
className: cn('text-primary ml-auto h-4 w-4', selected ? 'opacity-100' : 'opacity-0')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const selectCommandHeadingOptions: {
|
|
2
|
-
readonly sm: "[&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:h-8 [&_[cmdk-group-heading]]:text-xs";
|
|
3
|
-
readonly md: "[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:h-10 [&_[cmdk-group-heading]]:text-sm ";
|
|
4
|
-
readonly lg: "[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:h-12 [&_[cmdk-group-heading]]:text-base ";
|
|
2
|
+
readonly sm: "[&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:min-h-8 [&_[cmdk-group-heading]]:text-xs";
|
|
3
|
+
readonly md: "[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:min-h-10 [&_[cmdk-group-heading]]:text-sm ";
|
|
4
|
+
readonly lg: "[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:min-h-12 [&_[cmdk-group-heading]]:text-base ";
|
|
5
5
|
};
|
package/command/command.utils.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
3
|
-
export var selectCommandHeadingOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, '[&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:h-8 [&_[cmdk-group-heading]]:text-xs'), FormSize.Md, '[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:h-10 [&_[cmdk-group-heading]]:text-sm '), FormSize.Lg, '[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:h-12 [&_[cmdk-group-heading]]:text-base ');
|
|
3
|
+
export var selectCommandHeadingOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, '[&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:min-h-8 [&_[cmdk-group-heading]]:text-xs'), FormSize.Md, '[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:min-h-10 [&_[cmdk-group-heading]]:text-sm '), FormSize.Lg, '[&_[cmdk-group-heading]]:py-3 [&_[cmdk-group-heading]]:px-4 [&_[cmdk-group-heading]]:min-h-12 [&_[cmdk-group-heading]]:text-base ');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import type { FormCheckboxFieldProps } from '../form.types';
|
|
4
|
-
declare function FormCheckboxField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, disabled, tooltip, size, checkboxProps, }: FormCheckboxFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
4
|
+
declare function FormCheckboxField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, disabled, tooltip, disabledTooltip, size, checkboxProps, }: FormCheckboxFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormCheckboxField };
|
|
@@ -21,6 +21,7 @@ function FormCheckboxField(_ref) {
|
|
|
21
21
|
description = _ref.description,
|
|
22
22
|
disabled = _ref.disabled,
|
|
23
23
|
tooltip = _ref.tooltip,
|
|
24
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
24
25
|
_ref$size = _ref.size,
|
|
25
26
|
size = _ref$size === void 0 ? FormSize.Md : _ref$size,
|
|
26
27
|
checkboxProps = _ref.checkboxProps;
|
|
@@ -47,7 +48,9 @@ function FormCheckboxField(_ref) {
|
|
|
47
48
|
className: "text-foreground",
|
|
48
49
|
htmlFor: (_checkboxProps$id = checkboxProps === null || checkboxProps === void 0 ? void 0 : checkboxProps.id) !== null && _checkboxProps$id !== void 0 ? _checkboxProps$id : field.name,
|
|
49
50
|
tooltip: tooltip,
|
|
50
|
-
|
|
51
|
+
disabledTooltip: disabledTooltip,
|
|
52
|
+
size: size,
|
|
53
|
+
disabled: disabled
|
|
51
54
|
}, label)), description && /*#__PURE__*/React.createElement(FormDescription, {
|
|
52
55
|
size: size
|
|
53
56
|
}, description), /*#__PURE__*/React.createElement(FormMessage, null));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormCheckboxGroupFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
|
-
declare function FormCheckboxGroupField<TFieldValues extends FieldValues>({ control, name, label, description, options, className, tooltip, size, disabled, horizontal, horizontalLabelWidth, }: FormCheckboxGroupFieldProps<TFieldValues>): React.JSX.Element;
|
|
4
|
+
declare function FormCheckboxGroupField<TFieldValues extends FieldValues>({ control, name, label, description, options, className, tooltip, disabledTooltip, size, disabled, horizontal, horizontalLabelWidth, }: FormCheckboxGroupFieldProps<TFieldValues>): React.JSX.Element;
|
|
5
5
|
export { FormCheckboxGroupField };
|
|
@@ -22,6 +22,7 @@ function FormCheckboxGroupField(_ref) {
|
|
|
22
22
|
options = _ref.options,
|
|
23
23
|
className = _ref.className,
|
|
24
24
|
tooltip = _ref.tooltip,
|
|
25
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
25
26
|
_ref$size = _ref.size,
|
|
26
27
|
size = _ref$size === void 0 ? FormSize.Md : _ref$size,
|
|
27
28
|
_ref$disabled = _ref.disabled,
|
|
@@ -45,7 +46,9 @@ function FormCheckboxGroupField(_ref) {
|
|
|
45
46
|
size: size
|
|
46
47
|
})),
|
|
47
48
|
size: size,
|
|
48
|
-
tooltip: tooltip
|
|
49
|
+
tooltip: tooltip,
|
|
50
|
+
disabledTooltip: disabledTooltip,
|
|
51
|
+
disabled: disabled
|
|
49
52
|
}, label), description && !horizontal && /*#__PURE__*/React.createElement(FormDescription, {
|
|
50
53
|
size: size
|
|
51
54
|
}, description)), /*#__PURE__*/React.createElement("div", {
|
|
@@ -73,7 +76,9 @@ function FormCheckboxGroupField(_ref) {
|
|
|
73
76
|
}
|
|
74
77
|
})), /*#__PURE__*/React.createElement(FormLabel, {
|
|
75
78
|
size: size,
|
|
76
|
-
className: "text-sm font-normal"
|
|
79
|
+
className: "text-sm font-normal",
|
|
80
|
+
disabled: disabled,
|
|
81
|
+
disabledTooltip: disabledTooltip
|
|
77
82
|
}, option.label));
|
|
78
83
|
})), /*#__PURE__*/React.createElement(FormMessage, null));
|
|
79
84
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import type { FormFieldGroupProps } from '../form.types';
|
|
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;
|
|
4
|
+
declare function FormFieldGroup<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, size, readOnly, disabled, tooltip, disabledTooltip, highlight, horizontal, horizontalLabelWidth, children, }: FormFieldGroupProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormFieldGroup };
|
|
@@ -14,6 +14,7 @@ function FormFieldGroup(_ref) {
|
|
|
14
14
|
_ref$disabled = _ref.disabled,
|
|
15
15
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
16
16
|
tooltip = _ref.tooltip,
|
|
17
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
17
18
|
highlight = _ref.highlight,
|
|
18
19
|
_ref$horizontal = _ref.horizontal,
|
|
19
20
|
horizontal = _ref$horizontal === void 0 ? false : _ref$horizontal,
|
|
@@ -34,7 +35,9 @@ function FormFieldGroup(_ref) {
|
|
|
34
35
|
}, label && /*#__PURE__*/React.createElement(FormLabel, {
|
|
35
36
|
className: cn(horizontal && 'self-start', horizontal && labelHeightVariants[size]),
|
|
36
37
|
size: size,
|
|
37
|
-
tooltip: tooltip
|
|
38
|
+
tooltip: tooltip,
|
|
39
|
+
disabledTooltip: disabledTooltip,
|
|
40
|
+
disabled: disabled
|
|
38
41
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
39
42
|
className: "grid gap-1.5"
|
|
40
43
|
}, /*#__PURE__*/React.createElement(FormControl, null, children(field, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormRadioGroupFieldProps } from '@scaleflex/ui-tw/form/form.types';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
|
-
declare function FormRadioGroupField<TFieldValues extends FieldValues>({ control, name, label, description, options, className, tooltip, size, disabled, horizontal, horizontalLabelWidth, }: FormRadioGroupFieldProps<TFieldValues>): React.JSX.Element;
|
|
4
|
+
declare function FormRadioGroupField<TFieldValues extends FieldValues>({ control, name, label, description, options, className, tooltip, disabledTooltip, size, disabled, horizontal, horizontalLabelWidth, }: FormRadioGroupFieldProps<TFieldValues>): React.JSX.Element;
|
|
5
5
|
export { FormRadioGroupField };
|
|
@@ -21,6 +21,7 @@ function FormRadioGroupField(_ref) {
|
|
|
21
21
|
options = _ref.options,
|
|
22
22
|
className = _ref.className,
|
|
23
23
|
tooltip = _ref.tooltip,
|
|
24
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
24
25
|
_ref$size = _ref.size,
|
|
25
26
|
size = _ref$size === void 0 ? FormSize.Md : _ref$size,
|
|
26
27
|
_ref$disabled = _ref.disabled,
|
|
@@ -44,7 +45,9 @@ function FormRadioGroupField(_ref) {
|
|
|
44
45
|
size: size
|
|
45
46
|
})),
|
|
46
47
|
size: size,
|
|
47
|
-
tooltip: tooltip
|
|
48
|
+
tooltip: tooltip,
|
|
49
|
+
disabled: disabled,
|
|
50
|
+
disabledTooltip: disabledTooltip
|
|
48
51
|
}, label), description && !horizontal && /*#__PURE__*/React.createElement(FormDescription, {
|
|
49
52
|
size: size
|
|
50
53
|
}, description)), /*#__PURE__*/React.createElement(RadioGroup, {
|
|
@@ -71,7 +74,9 @@ function FormRadioGroupField(_ref) {
|
|
|
71
74
|
htmlFor: option.id,
|
|
72
75
|
size: size,
|
|
73
76
|
className: "text-sm font-normal",
|
|
74
|
-
tooltip: option.tooltip
|
|
77
|
+
tooltip: option.tooltip,
|
|
78
|
+
disabledTooltip: option.disabledTooltip,
|
|
79
|
+
disabled: disabled
|
|
75
80
|
}, option.label));
|
|
76
81
|
})), /*#__PURE__*/React.createElement(FormMessage, null));
|
|
77
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldValues, Path } from 'react-hook-form';
|
|
3
3
|
import type { FormSwitchFieldProps } from '../form.types';
|
|
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;
|
|
4
|
+
declare function FormSwitchField<TFieldValues extends FieldValues, TName extends Path<TFieldValues>>({ control, name, label, description, disabled, tooltip, disabledTooltip, size, layout, switchProps, }: FormSwitchFieldProps<TFieldValues, TName>): React.JSX.Element;
|
|
5
5
|
export { FormSwitchField };
|
|
@@ -21,6 +21,7 @@ function FormSwitchField(_ref) {
|
|
|
21
21
|
description = _ref.description,
|
|
22
22
|
disabled = _ref.disabled,
|
|
23
23
|
tooltip = _ref.tooltip,
|
|
24
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
24
25
|
_ref$size = _ref.size,
|
|
25
26
|
size = _ref$size === void 0 ? FormSize.Md : _ref$size,
|
|
26
27
|
_ref$layout = _ref.layout,
|
|
@@ -48,12 +49,16 @@ function FormSwitchField(_ref) {
|
|
|
48
49
|
className: "text-foreground",
|
|
49
50
|
htmlFor: (_switchProps$id = switchProps === null || switchProps === void 0 ? void 0 : switchProps.id) !== null && _switchProps$id !== void 0 ? _switchProps$id : field.name,
|
|
50
51
|
tooltip: tooltip,
|
|
51
|
-
|
|
52
|
+
disabledTooltip: disabledTooltip,
|
|
53
|
+
size: size,
|
|
54
|
+
disabled: disabled
|
|
52
55
|
}, label)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormLabel, {
|
|
53
56
|
className: "text-foreground",
|
|
54
57
|
htmlFor: (_switchProps$id2 = switchProps === null || switchProps === void 0 ? void 0 : switchProps.id) !== null && _switchProps$id2 !== void 0 ? _switchProps$id2 : field.name,
|
|
55
58
|
tooltip: tooltip,
|
|
56
|
-
|
|
59
|
+
disabledTooltip: disabledTooltip,
|
|
60
|
+
size: size,
|
|
61
|
+
disabled: disabled
|
|
57
62
|
}, label), /*#__PURE__*/React.createElement(FormControl, null, /*#__PURE__*/React.createElement(Switch, _extends({
|
|
58
63
|
id: field.name,
|
|
59
64
|
checked: field.value,
|
package/form/form.types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface FormBaseFieldProps {
|
|
|
32
32
|
description?: ReactElement | string;
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
tooltip?: ReactElement | string;
|
|
35
|
+
disabledTooltip?: ReactElement | string;
|
|
35
36
|
}
|
|
36
37
|
export interface FormFieldGroupProps<TFieldValues extends FieldValues, TName extends Path<TFieldValues>> extends UseControllerProps<TFieldValues, TName>, FormBaseFieldProps {
|
|
37
38
|
children: (field: ControllerRenderProps<TFieldValues, TName>, args?: FormFieldArgs) => ReactNode;
|
|
@@ -55,10 +56,12 @@ export type FormTextareaFieldProps<TFieldValues extends FieldValues, TName exten
|
|
|
55
56
|
};
|
|
56
57
|
export interface FlatOption {
|
|
57
58
|
label: ReactElement | string;
|
|
59
|
+
optionLabel?: ReactElement | string;
|
|
58
60
|
value: string;
|
|
59
61
|
disabled?: boolean;
|
|
60
62
|
icon?: ReactElement;
|
|
61
63
|
tooltip?: ReactElement | string;
|
|
64
|
+
disabledTooltip?: ReactElement | string;
|
|
62
65
|
}
|
|
63
66
|
export interface OptionGroup {
|
|
64
67
|
label?: ReactElement | string;
|
|
@@ -98,12 +101,14 @@ export type RadioOption = {
|
|
|
98
101
|
label: string;
|
|
99
102
|
id: string;
|
|
100
103
|
disabled?: RadioGroupItemProps['disabled'];
|
|
101
|
-
tooltip?: string;
|
|
104
|
+
tooltip?: ReactElement | string;
|
|
105
|
+
disabledTooltip?: ReactElement | string;
|
|
102
106
|
};
|
|
103
107
|
interface BaseFormGroupFieldProps<TFieldValues extends FieldValues> {
|
|
104
108
|
control: Control<TFieldValues>;
|
|
105
109
|
name: Path<TFieldValues>;
|
|
106
110
|
label?: ReactElement | string;
|
|
111
|
+
disabledTooltip?: ReactElement | string;
|
|
107
112
|
tooltip?: ReactElement | string;
|
|
108
113
|
description?: ReactElement | string;
|
|
109
114
|
className?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { LabelProps } from './label.types';
|
|
3
|
-
declare function Label({ className, size, children, icon, tooltip, ...props }: LabelProps): React.JSX.Element;
|
|
3
|
+
declare function Label({ className, size, children, icon, tooltip, disabledTooltip, disabled, ...props }: LabelProps): React.JSX.Element;
|
|
4
4
|
export { Label };
|
package/label/label.component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "size", "children", "icon", "tooltip"];
|
|
3
|
+
var _excluded = ["className", "size", "children", "icon", "tooltip", "disabledTooltip", "disabled"];
|
|
4
4
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
5
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
6
6
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
@@ -23,19 +23,21 @@ function Label(_ref) {
|
|
|
23
23
|
children = _ref.children,
|
|
24
24
|
icon = _ref.icon,
|
|
25
25
|
tooltip = _ref.tooltip,
|
|
26
|
+
disabledTooltip = _ref.disabledTooltip,
|
|
27
|
+
disabled = _ref.disabled,
|
|
26
28
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
29
|
return /*#__PURE__*/React.createElement(LabelPrimitive.Root, _extends({
|
|
28
30
|
"data-slot": "label",
|
|
29
|
-
className: cn('text-secondary-foreground flex cursor-pointer items-center leading-none font-normal select-none', 'peer-disabled:cursor-not-allowed peer-disabled:opacity-50', 'group-data-[disabled=true]:
|
|
31
|
+
className: cn('text-secondary-foreground flex cursor-pointer items-center leading-none font-normal select-none', 'peer-disabled:cursor-not-allowed peer-disabled:opacity-50', 'group-data-[disabled=true]:cursor-not-allowed group-data-[disabled=true]:opacity-50', 'group-data-[highlight=true]:text-warning-foreground', labelVariants({
|
|
30
32
|
size: size,
|
|
31
33
|
className: className
|
|
32
34
|
}))
|
|
33
35
|
}, props), /*#__PURE__*/React.createElement("span", {
|
|
34
|
-
className:
|
|
35
|
-
}, children), (icon || tooltip) && /*#__PURE__*/React.createElement(LabelIcon, {
|
|
36
|
+
className: cn('truncate')
|
|
37
|
+
}, children), (icon || tooltip || disabledTooltip) && /*#__PURE__*/React.createElement(LabelIcon, {
|
|
36
38
|
size: size,
|
|
37
39
|
icon: icon,
|
|
38
|
-
tooltip: tooltip
|
|
40
|
+
tooltip: disabled ? disabledTooltip : tooltip
|
|
39
41
|
}));
|
|
40
42
|
}
|
|
41
43
|
export { Label };
|
package/label/label.types.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export interface LabelProps extends Omit<ComponentProps<typeof LabelPrimitive.Ro
|
|
|
5
5
|
size?: FormSizeType;
|
|
6
6
|
icon?: ReactElement;
|
|
7
7
|
tooltip?: ReactElement | string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
disabledTooltip?: ReactElement | string;
|
|
8
10
|
}
|
|
9
11
|
export interface LabelIconProps extends ComponentProps<'span'>, Pick<LabelProps, 'size' | 'tooltip'> {
|
|
10
12
|
icon?: ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.53",
|
|
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.
|
|
26
|
+
"@scaleflex/icons-tw": "^0.0.53",
|
|
27
27
|
"@tanstack/react-table": "^8.21.3",
|
|
28
28
|
"@types/lodash.merge": "^4.6.9",
|
|
29
29
|
"class-variance-authority": "^0.7.1",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["value", "onChange", "placeholder", "disabled", "readOnly", "size", "className", "icon", "options", "showGroupSeparator", "formItemId", "popoverClassName", "selectorContentProps", "defaultOpen", "triggerProps"];
|
|
4
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
7
|
import { isOptionGroup } from '@scaleflex/ui-tw/form';
|
|
5
8
|
import React from 'react';
|
|
6
9
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from '../';
|
|
@@ -22,6 +25,28 @@ export function Selector(_ref) {
|
|
|
22
25
|
defaultOpen = _ref.defaultOpen,
|
|
23
26
|
triggerProps = _ref.triggerProps,
|
|
24
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
var getLabelByValue = function getLabelByValue(val) {
|
|
29
|
+
var _iterator = _createForOfIteratorHelper(options),
|
|
30
|
+
_step;
|
|
31
|
+
try {
|
|
32
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
33
|
+
var option = _step.value;
|
|
34
|
+
if (isOptionGroup(option)) {
|
|
35
|
+
var found = option.options.find(function (o) {
|
|
36
|
+
return o.value === val;
|
|
37
|
+
});
|
|
38
|
+
if (found) return found.label;
|
|
39
|
+
} else if (option.value === val) {
|
|
40
|
+
return option.label;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} catch (err) {
|
|
44
|
+
_iterator.e(err);
|
|
45
|
+
} finally {
|
|
46
|
+
_iterator.f();
|
|
47
|
+
}
|
|
48
|
+
return '';
|
|
49
|
+
};
|
|
25
50
|
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
26
51
|
value: value,
|
|
27
52
|
onValueChange: readOnly ? undefined : onChange,
|
|
@@ -36,9 +61,10 @@ export function Selector(_ref) {
|
|
|
36
61
|
icon: icon
|
|
37
62
|
}, triggerProps), /*#__PURE__*/React.createElement(SelectValue, {
|
|
38
63
|
placeholder: placeholder
|
|
39
|
-
})), /*#__PURE__*/React.createElement(SelectContent, _extends({
|
|
64
|
+
}, value ? getLabelByValue(value) : '')), /*#__PURE__*/React.createElement(SelectContent, _extends({
|
|
40
65
|
className: popoverClassName
|
|
41
66
|
}, selectorContentProps), options.map(function (option, groupIndex) {
|
|
67
|
+
var _option$optionLabel;
|
|
42
68
|
if (isOptionGroup(option)) {
|
|
43
69
|
return /*#__PURE__*/React.createElement(SelectGroup, {
|
|
44
70
|
key: groupIndex
|
|
@@ -46,10 +72,12 @@ export function Selector(_ref) {
|
|
|
46
72
|
size: size
|
|
47
73
|
}, option.label), option.options.map(function (_ref2) {
|
|
48
74
|
var label = _ref2.label,
|
|
75
|
+
optionLabel = _ref2.optionLabel,
|
|
49
76
|
value = _ref2.value,
|
|
50
77
|
disabled = _ref2.disabled,
|
|
51
78
|
icon = _ref2.icon,
|
|
52
|
-
tooltip = _ref2.tooltip
|
|
79
|
+
tooltip = _ref2.tooltip,
|
|
80
|
+
disabledTooltip = _ref2.disabledTooltip;
|
|
53
81
|
return /*#__PURE__*/React.createElement(SelectItem, {
|
|
54
82
|
key: value,
|
|
55
83
|
value: value,
|
|
@@ -57,8 +85,9 @@ export function Selector(_ref) {
|
|
|
57
85
|
size: size,
|
|
58
86
|
icon: icon,
|
|
59
87
|
tooltip: tooltip,
|
|
88
|
+
disabledTooltip: disabledTooltip,
|
|
60
89
|
isGroup: !!option.label
|
|
61
|
-
}, label);
|
|
90
|
+
}, optionLabel !== null && optionLabel !== void 0 ? optionLabel : label);
|
|
62
91
|
}), showGroupSeparator && groupIndex !== options.length - 1 && /*#__PURE__*/React.createElement(SelectSeparator, null));
|
|
63
92
|
}
|
|
64
93
|
return /*#__PURE__*/React.createElement(SelectGroup, {
|
|
@@ -68,7 +97,8 @@ export function Selector(_ref) {
|
|
|
68
97
|
disabled: option.disabled,
|
|
69
98
|
size: size,
|
|
70
99
|
icon: option.icon,
|
|
71
|
-
tooltip: option.tooltip
|
|
72
|
-
|
|
100
|
+
tooltip: option.tooltip,
|
|
101
|
+
disabledTooltip: option.disabledTooltip
|
|
102
|
+
}, (_option$optionLabel = option.optionLabel) !== null && _option$optionLabel !== void 0 ? _option$optionLabel : option.label));
|
|
73
103
|
})));
|
|
74
104
|
}
|
|
@@ -13,7 +13,7 @@ export declare const selectItemVariants: (props?: ({
|
|
|
13
13
|
declare function SelectTrigger({ className, size, children, readOnly, icon, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
14
14
|
declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
15
15
|
declare function SelectLabel({ className, size, ...props }: SelectLabelProps): React.JSX.Element;
|
|
16
|
-
declare function SelectItem({ className, children, size, icon, tooltip, isGroup, ...props }: SelectItemProps): React.JSX.Element;
|
|
16
|
+
declare function SelectItem({ className, children, size, icon, tooltip, isGroup, disabled, disabledTooltip, ...props }: SelectItemProps): React.JSX.Element;
|
|
17
17
|
declare function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
18
18
|
declare function SelectScrollUpButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
19
19
|
declare function SelectScrollDownButton({ className, ...props }: ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
|
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
5
5
|
var _excluded = ["className", "size", "children", "readOnly", "icon"],
|
|
6
6
|
_excluded2 = ["className", "children", "position"],
|
|
7
7
|
_excluded3 = ["className", "size"],
|
|
8
|
-
_excluded4 = ["className", "children", "size", "icon", "tooltip", "isGroup"],
|
|
8
|
+
_excluded4 = ["className", "children", "size", "icon", "tooltip", "isGroup", "disabled", "disabledTooltip"],
|
|
9
9
|
_excluded5 = ["className"],
|
|
10
10
|
_excluded6 = ["className"],
|
|
11
11
|
_excluded7 = ["className"];
|
|
@@ -124,12 +124,15 @@ function SelectItem(_ref7) {
|
|
|
124
124
|
icon = _ref7.icon,
|
|
125
125
|
tooltip = _ref7.tooltip,
|
|
126
126
|
isGroup = _ref7.isGroup,
|
|
127
|
+
disabled = _ref7.disabled,
|
|
128
|
+
disabledTooltip = _ref7.disabledTooltip,
|
|
127
129
|
props = _objectWithoutProperties(_ref7, _excluded4);
|
|
128
130
|
return /*#__PURE__*/React.createElement(SelectPrimitive.Item, _extends({
|
|
129
131
|
"data-slot": "select-item",
|
|
130
|
-
className: cn('relative flex cursor-pointer items-center gap-2 outline-hidden select-none', 'focus:bg-accent focus:text-accent-foreground', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', 'data-[state=checked]:text-accent-foreground', 'data-[disabled]:
|
|
132
|
+
className: cn('relative flex cursor-pointer items-center gap-2 outline-hidden select-none', 'focus:bg-accent focus:text-accent-foreground', '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2', 'data-[state=checked]:text-accent-foreground', 'data-[disabled]:cursor-not-allowed', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", selectItemVariants({
|
|
131
133
|
size: size
|
|
132
|
-
}), isGroup && getOptionInGroupPaddingLeft(size), className)
|
|
134
|
+
}), isGroup && getOptionInGroupPaddingLeft(size), className),
|
|
135
|
+
disabled: disabled
|
|
133
136
|
}, props), /*#__PURE__*/React.createElement("span", {
|
|
134
137
|
className: "absolute right-2 flex size-3.5 items-center justify-center"
|
|
135
138
|
}, /*#__PURE__*/React.createElement(SelectPrimitive.ItemIndicator, null, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
@@ -139,12 +142,12 @@ function SelectItem(_ref7) {
|
|
|
139
142
|
}, icon && /*#__PURE__*/React.createElement(SelectIcon, {
|
|
140
143
|
size: size,
|
|
141
144
|
icon: icon,
|
|
142
|
-
className:
|
|
143
|
-
}), /*#__PURE__*/React.createElement(SelectPrimitive.ItemText, {
|
|
144
|
-
className:
|
|
145
|
-
}, children), tooltip && /*#__PURE__*/React.createElement(LabelIcon, {
|
|
145
|
+
className: cn('text-muted-foreground data-[state=checked]:text-primary', disabled && 'opacity-50')
|
|
146
|
+
}), /*#__PURE__*/React.createElement(SelectPrimitive.ItemText, null, /*#__PURE__*/React.createElement("span", {
|
|
147
|
+
className: cn('line-clamp-2 overflow-hidden break-words text-ellipsis', disabled && 'opacity-50')
|
|
148
|
+
}, children)), (tooltip || disabledTooltip) && /*#__PURE__*/React.createElement(LabelIcon, {
|
|
146
149
|
size: size,
|
|
147
|
-
tooltip: tooltip
|
|
150
|
+
tooltip: disabled ? disabledTooltip : tooltip
|
|
148
151
|
})));
|
|
149
152
|
}
|
|
150
153
|
function SelectSeparator(_ref8) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const selectLabelSizeOptions: {
|
|
2
|
-
readonly sm: "py-2 px-3 h-8 text-xs";
|
|
3
|
-
readonly md: "py-3 px-4 h-10 text-sm ";
|
|
4
|
-
readonly lg: "py-3 px-4 h-12 text-base ";
|
|
2
|
+
readonly sm: "py-2 px-3 min-h-8 text-xs";
|
|
3
|
+
readonly md: "py-3 px-4 min-h-10 text-sm ";
|
|
4
|
+
readonly lg: "py-3 px-4 min-h-12 text-base ";
|
|
5
5
|
};
|
|
6
6
|
export declare const selectReadOnlyClassNames = "bg-secondary text-foreground pointer-events-none cursor-default disabled:opacity-100";
|
|
7
7
|
export declare const getBaseSelectClassNames: () => string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
3
|
-
export var selectLabelSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, 'py-2 px-3 h-8 text-xs'), FormSize.Md, 'py-3 px-4 h-10 text-sm '), FormSize.Lg, 'py-3 px-4 h-12 text-base ');
|
|
3
|
+
export var selectLabelSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, 'py-2 px-3 min-h-8 text-xs'), FormSize.Md, 'py-3 px-4 min-h-10 text-sm '), FormSize.Lg, 'py-3 px-4 min-h-12 text-base ');
|
|
4
4
|
export var selectReadOnlyClassNames = 'bg-secondary text-foreground pointer-events-none cursor-default disabled:opacity-100';
|
|
5
5
|
export var getBaseSelectClassNames = function getBaseSelectClassNames() {
|
|
6
6
|
return ['flex w-full cursor-pointer items-center justify-between gap-2 whitespace-nowrap', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"];
|
package/select/select.types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface SelectItemProps extends ComponentProps<typeof SelectPrimitive.I
|
|
|
14
14
|
icon?: ReactElement;
|
|
15
15
|
size?: FormSizeType;
|
|
16
16
|
tooltip?: ReactElement | string;
|
|
17
|
+
disabledTooltip?: ReactElement | string;
|
|
17
18
|
isGroup?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export interface SelectLabelProps extends ComponentProps<typeof SelectPrimitive.Label> {
|