@scaleflex/ui-tw 0.0.142 → 0.0.144
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 +2 -2
- package/dialog/dialog.component.d.ts +3 -5
- package/dialog/dialog.component.js +13 -5
- package/dialog/dialog.constants.d.ts +3 -0
- package/dialog/dialog.constants.js +12 -0
- package/dialog/dialog.types.d.ts +8 -0
- package/dialog/index.d.ts +2 -2
- package/dialog/index.js +1 -1
- package/package.json +2 -2
|
@@ -75,13 +75,13 @@ export function ComboboxTrigger(_ref2) {
|
|
|
75
75
|
disabled: disabled,
|
|
76
76
|
className: cn.apply(void 0, _toConsumableArray(getBaseSelectClassNames()).concat(_toConsumableArray(getBaseInputClasses()), [selectTriggerVariants({
|
|
77
77
|
size: size
|
|
78
|
-
}), !selected && 'text-muted-foreground/80 hover:border-secondary-foreground/50', readOnly && selectReadOnlyClassNames, className, 'min-w-0'])),
|
|
78
|
+
}), !selected && 'text-muted-foreground/80 hover:border-secondary-foreground/50', readOnly && selectReadOnlyClassNames, className, 'min-w-0 overflow-hidden'])),
|
|
79
79
|
onClick: handleOnTriggerClick,
|
|
80
80
|
onKeyDown: handleOnTriggerKeyDown
|
|
81
81
|
}, triggerProps), /*#__PURE__*/React.createElement("span", {
|
|
82
82
|
className: "min-w-0 truncate"
|
|
83
83
|
}, children), /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "ml-2 flex items-center gap-1 pl-1"
|
|
84
|
+
className: "ml-2 flex shrink-0 items-center gap-1 pl-1"
|
|
85
85
|
}, showClear && !!onClearAll && selected && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
86
86
|
role: "button",
|
|
87
87
|
tabIndex: 0,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
2
|
import React, { type ComponentProps } from 'react';
|
|
3
|
-
import type { DialogWideContentProps, DialogWideHeaderProps, DialogWideTitleProps } from './dialog.types';
|
|
3
|
+
import type { DialogFormContentProps, DialogWideContentProps, DialogWideHeaderProps, DialogWideTitleProps } from './dialog.types';
|
|
4
4
|
declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
5
5
|
declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
6
6
|
declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
7
7
|
declare function DialogClose({ ...props }: ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
8
8
|
declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
9
|
-
declare function DialogWideContent({ className, children, overlayClassName, headerSize, ...props }: DialogWideContentProps): React.JSX.Element;
|
|
10
|
-
declare function DialogFormContent({ className, children, overlayClassName, ...props }:
|
|
11
|
-
overlayClassName?: string;
|
|
12
|
-
}): React.JSX.Element;
|
|
9
|
+
declare function DialogWideContent({ className, children, overlayClassName, headerSize, maxWidth, ...props }: DialogWideContentProps): React.JSX.Element;
|
|
10
|
+
declare function DialogFormContent({ className, children, overlayClassName, maxWidth, ...props }: DialogFormContentProps): React.JSX.Element;
|
|
13
11
|
declare function DialogWideHeader({ className, size, ...props }: DialogWideHeaderProps): React.JSX.Element;
|
|
14
12
|
declare function DialogFormHeader({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
|
|
15
13
|
declare function DialogWideBody({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
|
|
@@ -2,8 +2,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
var _excluded = ["className"],
|
|
5
|
-
_excluded2 = ["className", "children", "overlayClassName", "headerSize"],
|
|
6
|
-
_excluded3 = ["className", "children", "overlayClassName"],
|
|
5
|
+
_excluded2 = ["className", "children", "overlayClassName", "headerSize", "maxWidth"],
|
|
6
|
+
_excluded3 = ["className", "children", "overlayClassName", "maxWidth"],
|
|
7
7
|
_excluded4 = ["className", "size"],
|
|
8
8
|
_excluded5 = ["className"],
|
|
9
9
|
_excluded6 = ["className"],
|
|
@@ -22,7 +22,7 @@ import { focusRingClassNames } from '@scaleflex/ui-tw/styles/shared-classes';
|
|
|
22
22
|
import { cn } from '@scaleflex/ui-tw/utils/cn';
|
|
23
23
|
import { CircleAlertIcon, XIcon } from 'lucide-react';
|
|
24
24
|
import React from 'react';
|
|
25
|
-
import { dialogCloseButtonPositionVariants, dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
|
|
25
|
+
import { dialogCloseButtonPositionVariants, dialogContentWidthVariants, dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
|
|
26
26
|
function Dialog(_ref) {
|
|
27
27
|
var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
28
28
|
return /*#__PURE__*/React.createElement(DialogPrimitive.Root, _extends({
|
|
@@ -61,6 +61,8 @@ function DialogWideContent(_ref6) {
|
|
|
61
61
|
overlayClassName = _ref6.overlayClassName,
|
|
62
62
|
_ref6$headerSize = _ref6.headerSize,
|
|
63
63
|
headerSize = _ref6$headerSize === void 0 ? 'md' : _ref6$headerSize,
|
|
64
|
+
_ref6$maxWidth = _ref6.maxWidth,
|
|
65
|
+
maxWidth = _ref6$maxWidth === void 0 ? '2xl' : _ref6$maxWidth,
|
|
64
66
|
props = _objectWithoutProperties(_ref6, _excluded2);
|
|
65
67
|
return /*#__PURE__*/React.createElement(DialogPortal, {
|
|
66
68
|
"data-slot": "dialog-portal"
|
|
@@ -68,7 +70,9 @@ function DialogWideContent(_ref6) {
|
|
|
68
70
|
className: overlayClassName
|
|
69
71
|
}), /*#__PURE__*/React.createElement(DialogPrimitive.Content, _extends({
|
|
70
72
|
"data-slot": "dialog-content",
|
|
71
|
-
className: cn('bg-background text-foreground border-border fixed top-[50%] left-[50%] z-50 grid w-full
|
|
73
|
+
className: cn('bg-background text-foreground border-border fixed top-[50%] left-[50%] z-50 grid w-full 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', maxWidth && dialogContentWidthVariants({
|
|
74
|
+
maxWidth: maxWidth
|
|
75
|
+
}), className)
|
|
72
76
|
}, props), children, /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
|
|
73
77
|
"data-state": "open",
|
|
74
78
|
asChild: true,
|
|
@@ -86,6 +90,8 @@ function DialogFormContent(_ref7) {
|
|
|
86
90
|
var className = _ref7.className,
|
|
87
91
|
children = _ref7.children,
|
|
88
92
|
overlayClassName = _ref7.overlayClassName,
|
|
93
|
+
_ref7$maxWidth = _ref7.maxWidth,
|
|
94
|
+
maxWidth = _ref7$maxWidth === void 0 ? 'md' : _ref7$maxWidth,
|
|
89
95
|
props = _objectWithoutProperties(_ref7, _excluded3);
|
|
90
96
|
return /*#__PURE__*/React.createElement(DialogPortal, {
|
|
91
97
|
"data-slot": "dialog-portal"
|
|
@@ -93,7 +99,9 @@ function DialogFormContent(_ref7) {
|
|
|
93
99
|
className: overlayClassName
|
|
94
100
|
}), /*#__PURE__*/React.createElement(DialogPrimitive.Content, _extends({
|
|
95
101
|
"data-slot": "dialog-content",
|
|
96
|
-
className: cn('bg-background text-foreground border-border fixed top-[50%] left-[50%] z-50 grid w-full
|
|
102
|
+
className: cn('bg-background text-foreground border-border fixed top-[50%] left-[50%] z-50 grid w-full 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', maxWidth && dialogContentWidthVariants({
|
|
103
|
+
maxWidth: maxWidth
|
|
104
|
+
}), className)
|
|
97
105
|
}, props), children, /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
|
|
98
106
|
"data-state": "open",
|
|
99
107
|
asChild: true,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const dialogContentWidthVariants: (props?: ({
|
|
2
|
+
maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
1
4
|
export declare const dialogWideHeaderVariants: (props?: ({
|
|
2
5
|
size?: "sm" | "md" | null | undefined;
|
|
3
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { cva } from 'class-variance-authority';
|
|
2
|
+
export var dialogContentWidthVariants = cva('', {
|
|
3
|
+
variants: {
|
|
4
|
+
maxWidth: {
|
|
5
|
+
sm: 'max-w-sm',
|
|
6
|
+
md: 'max-w-md',
|
|
7
|
+
lg: 'max-w-2xl',
|
|
8
|
+
xl: 'max-w-4xl',
|
|
9
|
+
'2xl': 'max-w-5xl',
|
|
10
|
+
full: 'max-w-[calc(100%-2rem)]'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
2
14
|
export var dialogWideHeaderVariants = cva('border-border text-foreground relative flex items-center border-b', {
|
|
3
15
|
variants: {
|
|
4
16
|
size: {
|
package/dialog/dialog.types.d.ts
CHANGED
|
@@ -2,9 +2,17 @@ import type * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
3
|
export type DialogSize = 'sm' | 'md';
|
|
4
4
|
export type DialogAlign = 'center' | 'left';
|
|
5
|
+
export type DialogContentWidth = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
|
|
5
6
|
export interface DialogWideContentProps extends ComponentProps<typeof DialogPrimitive.Content> {
|
|
6
7
|
overlayClassName?: string;
|
|
7
8
|
headerSize?: DialogSize;
|
|
9
|
+
/** Preset max-width. Pass `undefined` to use className for custom width. */
|
|
10
|
+
maxWidth?: DialogContentWidth;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogFormContentProps extends ComponentProps<typeof DialogPrimitive.Content> {
|
|
13
|
+
overlayClassName?: string;
|
|
14
|
+
/** Preset max-width. Pass `undefined` to use className for custom width. */
|
|
15
|
+
maxWidth?: DialogContentWidth;
|
|
8
16
|
}
|
|
9
17
|
export interface DialogWideHeaderProps extends ComponentProps<'div'> {
|
|
10
18
|
size?: DialogSize;
|
package/dialog/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Dialog, DialogClose, DialogWideFooter, DialogOverlay, DialogPortal, DialogTrigger, DialogWideTitle, DialogWideHeader, DialogWideContent, DialogWideBody, DialogFormContent, DialogFormDescription, DialogFormIcon, DialogFormWarningIcon, DialogFormErrorIcon, DialogFormHeader, DialogFormTitle, DialogFormBody, DialogFormFooter, } from './dialog.component';
|
|
2
|
-
export { dialogCloseButtonPositionVariants, dialogWideHeaderVariants, dialogWideTitleVariants, } from './dialog.constants';
|
|
3
|
-
export type {
|
|
2
|
+
export { dialogCloseButtonPositionVariants, dialogContentWidthVariants, dialogWideHeaderVariants, dialogWideTitleVariants, } from './dialog.constants';
|
|
3
|
+
export type { DialogAlign, DialogContentWidth, DialogFormContentProps, DialogSize, DialogWideContentProps, DialogWideHeaderProps, DialogWideTitleProps, } from './dialog.types';
|
package/dialog/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Dialog, DialogClose, DialogWideFooter, DialogOverlay, DialogPortal, DialogTrigger, DialogWideTitle, DialogWideHeader, DialogWideContent, DialogWideBody, DialogFormContent, DialogFormDescription, DialogFormIcon, DialogFormWarningIcon, DialogFormErrorIcon, DialogFormHeader, DialogFormTitle, DialogFormBody, DialogFormFooter } from './dialog.component';
|
|
2
|
-
export { dialogCloseButtonPositionVariants, dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
|
|
2
|
+
export { dialogCloseButtonPositionVariants, dialogContentWidthVariants, dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleflex/ui-tw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.144",
|
|
4
4
|
"author": "scaleflex",
|
|
5
5
|
"repository": "github:scaleflex/ui",
|
|
6
6
|
"homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@radix-ui/react-switch": "^1.0.1",
|
|
30
30
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
31
31
|
"@radix-ui/react-tooltip": "^1.2.6",
|
|
32
|
-
"@scaleflex/icons-tw": "^0.0.
|
|
32
|
+
"@scaleflex/icons-tw": "^0.0.144",
|
|
33
33
|
"@tanstack/react-table": "^8.21.3",
|
|
34
34
|
"@types/lodash.merge": "^4.6.9",
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|