@scaleflex/ui-tw 0.0.49 → 0.0.50
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-multi-tag/combobox-multi-tag.component.js +1 -0
- package/command/command.component.js +13 -7
- package/dialog/dialog.component.js +5 -4
- package/input/input.constants.d.ts +5 -0
- package/input/input.constants.js +1 -0
- package/input-tags/input-tags.component.js +7 -2
- package/package.json +2 -2
- package/pill/pill.component.js +1 -1
- package/select/select.component.d.ts +3 -0
- package/select/select.component.js +17 -5
|
@@ -12,7 +12,7 @@ var _excluded = ["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';
|
|
14
14
|
import { SelectIcon } from '@scaleflex/ui-tw/select/components/select-icon';
|
|
15
|
-
import { selectTriggerVariants } from '@scaleflex/ui-tw/select/select.component';
|
|
15
|
+
import { selectItemVariants, selectTriggerVariants } from '@scaleflex/ui-tw/select/select.component';
|
|
16
16
|
import { getOptionInGroupPaddingLeft } from '@scaleflex/ui-tw/select/select.utils';
|
|
17
17
|
import { switchThumbSizeOptions } from '@scaleflex/ui-tw/switch/switch.constants';
|
|
18
18
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
@@ -120,20 +120,26 @@ function CommandItem(_ref8) {
|
|
|
120
120
|
var selected = value && (multiple ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.includes(value) : value === selectedValue);
|
|
121
121
|
return /*#__PURE__*/React.createElement(CommandPrimitive.Item, _extends({
|
|
122
122
|
"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', 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
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', 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", selectItemVariants({
|
|
124
124
|
size: size,
|
|
125
125
|
className: className
|
|
126
|
-
}), isGroup && getOptionInGroupPaddingLeft(size), selected && 'text-primary', className)
|
|
126
|
+
}), isGroup && getOptionInGroupPaddingLeft(size), selected && 'text-primary pr-7', className)
|
|
127
127
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
128
|
-
className: "flex items-center"
|
|
128
|
+
className: "flex flex-1 items-center overflow-hidden"
|
|
129
129
|
}, icon && /*#__PURE__*/React.createElement(SelectIcon, {
|
|
130
130
|
size: size,
|
|
131
131
|
icon: icon,
|
|
132
|
-
className: cn('text-muted-foreground hover:text-primary', selected && 'text-primary')
|
|
133
|
-
}), /*#__PURE__*/React.createElement("
|
|
132
|
+
className: cn('text-muted-foreground hover:text-primary shrink-0', selected && 'text-primary')
|
|
133
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "flex items-center gap-1 overflow-hidden"
|
|
135
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: "line-clamp-2 overflow-hidden text-left break-words text-ellipsis"
|
|
137
|
+
}, children), tooltip && /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "flex shrink-0 items-center"
|
|
139
|
+
}, /*#__PURE__*/React.createElement(LabelIcon, {
|
|
134
140
|
size: size,
|
|
135
141
|
tooltip: tooltip
|
|
136
|
-
})), shortcut && /*#__PURE__*/React.createElement(CommandShortcut, null, shortcut), /*#__PURE__*/React.createElement("span", {
|
|
142
|
+
})))), shortcut && /*#__PURE__*/React.createElement(CommandShortcut, null, shortcut), /*#__PURE__*/React.createElement("span", {
|
|
137
143
|
className: "absolute right-2 flex size-3.5 items-center justify-center"
|
|
138
144
|
}, /*#__PURE__*/React.createElement(CheckIcon, {
|
|
139
145
|
className: cn('text-primary ml-auto h-4 w-4', selected ? 'opacity-100' : 'opacity-0')
|
|
@@ -70,9 +70,9 @@ function DialogWideContent(_ref6) {
|
|
|
70
70
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
71
71
|
variant: "ghost-secondary",
|
|
72
72
|
size: "icon-md"
|
|
73
|
-
}, /*#__PURE__*/React.createElement(XIcon, null)
|
|
73
|
+
}, /*#__PURE__*/React.createElement(XIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
74
74
|
className: "sr-only"
|
|
75
|
-
}, "Close"))));
|
|
75
|
+
}, "Close")))));
|
|
76
76
|
}
|
|
77
77
|
function DialogFormContent(_ref7) {
|
|
78
78
|
var className = _ref7.className,
|
|
@@ -85,13 +85,14 @@ function DialogFormContent(_ref7) {
|
|
|
85
85
|
className: cn('bg-background text-foreground border-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-md translate-x-[-50%] translate-y-[-50%] rounded-lg border shadow-lg duration-200', 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', className)
|
|
86
86
|
}, props), children, /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
|
|
87
87
|
"data-state": "open",
|
|
88
|
+
asChild: true,
|
|
88
89
|
className: cn('text-muted-foreground absolute top-3 right-3 cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6", focusRingClassNames)
|
|
89
90
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
90
91
|
variant: "ghost-secondary",
|
|
91
92
|
size: "icon-md"
|
|
92
|
-
}, /*#__PURE__*/React.createElement(XIcon, null)
|
|
93
|
+
}, /*#__PURE__*/React.createElement(XIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
93
94
|
className: "sr-only"
|
|
94
|
-
}, "Close"))));
|
|
95
|
+
}, "Close")))));
|
|
95
96
|
}
|
|
96
97
|
function DialogWideHeader(_ref8) {
|
|
97
98
|
var className = _ref8.className,
|
|
@@ -3,6 +3,11 @@ export declare const inputSizeOptions: {
|
|
|
3
3
|
readonly md: "py-3 px-4 h-10 text-base ";
|
|
4
4
|
readonly lg: "py-3 px-4 h-12 text-lg ";
|
|
5
5
|
};
|
|
6
|
+
export declare const inputItemSizeOptions: {
|
|
7
|
+
readonly sm: "py-2 px-3 min-h-[2rem] text-sm";
|
|
8
|
+
readonly md: "py-3 px-4 min-h-[2.5rem] text-base ";
|
|
9
|
+
readonly lg: "py-3 px-4 min-h-[3rem] text-lg ";
|
|
10
|
+
};
|
|
6
11
|
export declare const InputType: {
|
|
7
12
|
readonly Text: "text";
|
|
8
13
|
readonly Email: "email";
|
package/input/input.constants.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { FormSize } from '@scaleflex/ui-tw/types/form-size';
|
|
3
3
|
export var inputSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, 'py-2 px-3 h-8 text-sm'), FormSize.Md, 'py-3 px-4 h-10 text-base '), FormSize.Lg, 'py-3 px-4 h-12 text-lg ');
|
|
4
|
+
export var inputItemSizeOptions = _defineProperty(_defineProperty(_defineProperty({}, FormSize.Sm, 'py-2 px-3 min-h-[2rem] text-sm'), FormSize.Md, 'py-3 px-4 min-h-[2.5rem] text-base '), FormSize.Lg, 'py-3 px-4 min-h-[3rem] text-lg ');
|
|
4
5
|
export var InputType = {
|
|
5
6
|
Text: 'text',
|
|
6
7
|
Email: 'email',
|
|
@@ -146,6 +146,7 @@ export function InputTags(_ref) {
|
|
|
146
146
|
className: "text-muted-foreground"
|
|
147
147
|
}, placeholder) : value.map(function (tag) {
|
|
148
148
|
return /*#__PURE__*/React.createElement(Pill, {
|
|
149
|
+
className: "max-w-xs",
|
|
149
150
|
key: tag[valueProp],
|
|
150
151
|
size: size,
|
|
151
152
|
removable: true,
|
|
@@ -202,7 +203,9 @@ export function InputTags(_ref) {
|
|
|
202
203
|
return handleAddTag(tag);
|
|
203
204
|
},
|
|
204
205
|
isGroup: true
|
|
205
|
-
},
|
|
206
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
207
|
+
className: "block w-full truncate overflow-hidden text-ellipsis whitespace-nowrap"
|
|
208
|
+
}, tag.label));
|
|
206
209
|
})), filteredAll.length > 0 && /*#__PURE__*/React.createElement(CommandGroup, {
|
|
207
210
|
size: size,
|
|
208
211
|
heading: "All Tags"
|
|
@@ -214,7 +217,9 @@ export function InputTags(_ref) {
|
|
|
214
217
|
return handleAddTag(tag);
|
|
215
218
|
},
|
|
216
219
|
isGroup: true
|
|
217
|
-
},
|
|
220
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
221
|
+
className: "block w-full truncate overflow-hidden text-ellipsis whitespace-nowrap"
|
|
222
|
+
}, tag.label));
|
|
218
223
|
})), !canCreate && filteredSuggested.length === 0 && filteredAll.length === 0 && /*#__PURE__*/React.createElement(CommandEmpty, null, "No results found."), canCreate && /*#__PURE__*/React.createElement(CommandItem, {
|
|
219
224
|
size: size,
|
|
220
225
|
onSelect: function onSelect() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.50",
|
|
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.50",
|
|
27
27
|
"@tanstack/react-table": "^8.21.3",
|
|
28
28
|
"@types/lodash.merge": "^4.6.9",
|
|
29
29
|
"class-variance-authority": "^0.7.1",
|
package/pill/pill.component.js
CHANGED
|
@@ -42,7 +42,7 @@ function Pill(_ref) {
|
|
|
42
42
|
variant: variant
|
|
43
43
|
}), className)
|
|
44
44
|
}, props), /*#__PURE__*/React.createElement("span", {
|
|
45
|
-
className: "select-none"
|
|
45
|
+
className: "overflow-hidden text-ellipsis whitespace-nowrap select-none"
|
|
46
46
|
}, props.children), removable && /*#__PURE__*/React.createElement("button", {
|
|
47
47
|
type: "button",
|
|
48
48
|
onClick: onRemove,
|
|
@@ -7,6 +7,9 @@ declare function SelectValue({ ...props }: ComponentProps<typeof SelectPrimitive
|
|
|
7
7
|
export declare const selectTriggerVariants: (props?: ({
|
|
8
8
|
size?: "md" | "lg" | "sm" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const selectItemVariants: (props?: ({
|
|
11
|
+
size?: "md" | "lg" | "sm" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
10
13
|
declare function SelectTrigger({ className, size, children, readOnly, icon, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
11
14
|
declare function SelectContent({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
12
15
|
declare function SelectLabel({ className, size, ...props }: SelectLabelProps): React.JSX.Element;
|
|
@@ -10,7 +10,7 @@ var _excluded = ["className", "size", "children", "readOnly", "icon"],
|
|
|
10
10
|
_excluded6 = ["className"],
|
|
11
11
|
_excluded7 = ["className"];
|
|
12
12
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
13
|
-
import { inputSizeOptions } from '@scaleflex/ui-tw/input/input.constants';
|
|
13
|
+
import { inputItemSizeOptions, inputSizeOptions } from '@scaleflex/ui-tw/input/input.constants';
|
|
14
14
|
import { LabelIcon } from '@scaleflex/ui-tw/label/components/label-icon';
|
|
15
15
|
import { SelectIcon } from '@scaleflex/ui-tw/select/components/select-icon';
|
|
16
16
|
import { getOptionInGroupPaddingLeft } from '@scaleflex/ui-tw/select/select.utils';
|
|
@@ -47,6 +47,14 @@ export var selectTriggerVariants = cva('', {
|
|
|
47
47
|
size: FormSize.Md
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
+
export var selectItemVariants = cva('', {
|
|
51
|
+
variants: {
|
|
52
|
+
size: inputItemSizeOptions
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
size: FormSize.Md
|
|
56
|
+
}
|
|
57
|
+
});
|
|
50
58
|
var selectLabelVariants = cva('', {
|
|
51
59
|
variants: {
|
|
52
60
|
size: selectLabelSizeOptions
|
|
@@ -72,11 +80,13 @@ function SelectTrigger(_ref4) {
|
|
|
72
80
|
className: className
|
|
73
81
|
}), readOnly && selectReadOnlyClassNames, className]))
|
|
74
82
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "flex items-center"
|
|
83
|
+
className: "flex flex-1 items-center gap-2 overflow-hidden"
|
|
76
84
|
}, icon && /*#__PURE__*/React.createElement(SelectIcon, {
|
|
77
85
|
size: size,
|
|
78
86
|
icon: icon
|
|
79
|
-
}),
|
|
87
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "truncate overflow-hidden text-ellipsis whitespace-nowrap"
|
|
89
|
+
}, children)), /*#__PURE__*/React.createElement(SelectPrimitive.Icon, {
|
|
80
90
|
asChild: true
|
|
81
91
|
}, /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
82
92
|
className: cn('opacity-50', size === FormSize.Lg ? 'size-5' : 'size-4.5')
|
|
@@ -117,7 +127,7 @@ function SelectItem(_ref7) {
|
|
|
117
127
|
props = _objectWithoutProperties(_ref7, _excluded4);
|
|
118
128
|
return /*#__PURE__*/React.createElement(SelectPrimitive.Item, _extends({
|
|
119
129
|
"data-slot": "select-item",
|
|
120
|
-
className: cn('relative flex
|
|
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]:pointer-events-none data-[disabled]:opacity-50', "[&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", selectItemVariants({
|
|
121
131
|
size: size
|
|
122
132
|
}), isGroup && getOptionInGroupPaddingLeft(size), className)
|
|
123
133
|
}, props), /*#__PURE__*/React.createElement("span", {
|
|
@@ -130,7 +140,9 @@ function SelectItem(_ref7) {
|
|
|
130
140
|
size: size,
|
|
131
141
|
icon: icon,
|
|
132
142
|
className: "text-muted-foreground data-[state=checked]:text-primary"
|
|
133
|
-
}), /*#__PURE__*/React.createElement(SelectPrimitive.ItemText,
|
|
143
|
+
}), /*#__PURE__*/React.createElement(SelectPrimitive.ItemText, {
|
|
144
|
+
className: "line-clamp-2 overflow-hidden break-words text-ellipsis"
|
|
145
|
+
}, children), tooltip && /*#__PURE__*/React.createElement(LabelIcon, {
|
|
134
146
|
size: size,
|
|
135
147
|
tooltip: tooltip
|
|
136
148
|
})));
|