@scaleflex/ui-tw 0.0.122 → 0.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  import * as DialogPrimitive from '@radix-ui/react-dialog';
2
2
  import React, { type ComponentProps } from 'react';
3
+ import type { DialogWideHeaderProps, DialogWideTitleProps } from './dialog.types';
3
4
  declare function Dialog({ ...props }: ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
5
  declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
6
  declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
@@ -11,11 +12,11 @@ declare function DialogWideContent({ className, children, overlayClassName, ...p
11
12
  declare function DialogFormContent({ className, children, overlayClassName, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
12
13
  overlayClassName?: string;
13
14
  }): React.JSX.Element;
14
- declare function DialogWideHeader({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
15
+ declare function DialogWideHeader({ className, size, ...props }: DialogWideHeaderProps): React.JSX.Element;
15
16
  declare function DialogFormHeader({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
16
17
  declare function DialogWideBody({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
17
18
  declare function DialogFormBody({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
18
- declare function DialogWideTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
19
+ declare function DialogWideTitle({ className, size, align, ...props }: DialogWideTitleProps): React.JSX.Element;
19
20
  declare function DialogFormTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
20
21
  declare function DialogFormDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
21
22
  declare function DialogFormIcon({ className, ...props }: ComponentProps<'div'>): React.JSX.Element;
@@ -4,11 +4,11 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  var _excluded = ["className"],
5
5
  _excluded2 = ["className", "children", "overlayClassName"],
6
6
  _excluded3 = ["className", "children", "overlayClassName"],
7
- _excluded4 = ["className"],
7
+ _excluded4 = ["className", "size"],
8
8
  _excluded5 = ["className"],
9
9
  _excluded6 = ["className"],
10
10
  _excluded7 = ["className"],
11
- _excluded8 = ["className"],
11
+ _excluded8 = ["className", "size", "align"],
12
12
  _excluded9 = ["className"],
13
13
  _excluded10 = ["className"],
14
14
  _excluded11 = ["className"],
@@ -22,6 +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 { dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
25
26
  function Dialog(_ref) {
26
27
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
27
28
  return /*#__PURE__*/React.createElement(DialogPrimitive.Root, _extends({
@@ -69,10 +70,10 @@ function DialogWideContent(_ref6) {
69
70
  }, props), children, /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
70
71
  "data-state": "open",
71
72
  asChild: true,
72
- className: cn('text-muted-foreground/70 hover:text-muted-foreground absolute top-3 right-3 cursor-pointer rounded-xs transition-opacity disabled:pointer-events-none', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6", focusRingClassNames)
73
+ className: cn('text-muted-foreground/70 hover:text-muted-foreground absolute top-3 right-3 cursor-pointer rounded-xs transition-opacity disabled:pointer-events-none', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5", focusRingClassNames)
73
74
  }, /*#__PURE__*/React.createElement(Button, {
74
75
  variant: "ghost-secondary",
75
- size: "icon-md"
76
+ size: "icon-sm"
76
77
  }, /*#__PURE__*/React.createElement(XIcon, null), /*#__PURE__*/React.createElement("span", {
77
78
  className: "sr-only"
78
79
  }, "Close")))));
@@ -92,20 +93,24 @@ function DialogFormContent(_ref7) {
92
93
  }, props), children, /*#__PURE__*/React.createElement(DialogPrimitive.Close, {
93
94
  "data-state": "open",
94
95
  asChild: true,
95
- className: cn('text-muted-foreground/70 hover:text-muted-foreground absolute top-3 right-3 cursor-pointer rounded-xs transition-opacity disabled:pointer-events-none', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-6", focusRingClassNames)
96
+ className: cn('text-muted-foreground/70 hover:text-muted-foreground absolute top-3 right-3 cursor-pointer rounded-xs transition-opacity disabled:pointer-events-none', "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5", focusRingClassNames)
96
97
  }, /*#__PURE__*/React.createElement(Button, {
97
98
  variant: "ghost-secondary",
98
- size: "icon-md"
99
+ size: "icon-sm"
99
100
  }, /*#__PURE__*/React.createElement(XIcon, null), /*#__PURE__*/React.createElement("span", {
100
101
  className: "sr-only"
101
102
  }, "Close")))));
102
103
  }
103
104
  function DialogWideHeader(_ref8) {
104
105
  var className = _ref8.className,
106
+ _ref8$size = _ref8.size,
107
+ size = _ref8$size === void 0 ? 'md' : _ref8$size,
105
108
  props = _objectWithoutProperties(_ref8, _excluded4);
106
109
  return /*#__PURE__*/React.createElement("div", _extends({
107
110
  "data-slot": "dialog-header",
108
- className: cn('border-border text-foreground flex h-16 items-center justify-center border-b', className)
111
+ className: cn(dialogWideHeaderVariants({
112
+ size: size
113
+ }), className)
109
114
  }, props));
110
115
  }
111
116
  function DialogFormHeader(_ref9) {
@@ -134,10 +139,17 @@ function DialogFormBody(_ref11) {
134
139
  }
135
140
  function DialogWideTitle(_ref12) {
136
141
  var className = _ref12.className,
142
+ _ref12$size = _ref12.size,
143
+ size = _ref12$size === void 0 ? 'md' : _ref12$size,
144
+ _ref12$align = _ref12.align,
145
+ align = _ref12$align === void 0 ? 'center' : _ref12$align,
137
146
  props = _objectWithoutProperties(_ref12, _excluded8);
138
147
  return /*#__PURE__*/React.createElement(DialogPrimitive.Title, _extends({
139
148
  "data-slot": "dialog-title",
140
- className: cn('text-lg leading-7', className)
149
+ className: cn(dialogWideTitleVariants({
150
+ size: size,
151
+ align: align
152
+ }), className)
141
153
  }, props));
142
154
  }
143
155
  function DialogFormTitle(_ref13) {
@@ -0,0 +1,7 @@
1
+ export declare const dialogWideHeaderVariants: (props?: ({
2
+ size?: "sm" | "md" | null | undefined;
3
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
4
+ export declare const dialogWideTitleVariants: (props?: ({
5
+ size?: "sm" | "md" | null | undefined;
6
+ align?: "center" | "left" | null | undefined;
7
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
@@ -0,0 +1,28 @@
1
+ import { cva } from 'class-variance-authority';
2
+ export var dialogWideHeaderVariants = cva('border-border text-foreground relative flex items-center border-b', {
3
+ variants: {
4
+ size: {
5
+ sm: 'h-14 justify-start py-3 pr-4 pl-6',
6
+ md: 'h-16 justify-center'
7
+ }
8
+ },
9
+ defaultVariants: {
10
+ size: 'md'
11
+ }
12
+ });
13
+ export var dialogWideTitleVariants = cva('', {
14
+ variants: {
15
+ size: {
16
+ sm: 'text-base leading-6 font-normal',
17
+ md: 'text-lg leading-7'
18
+ },
19
+ align: {
20
+ center: 'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2',
21
+ left: ''
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ size: 'md',
26
+ align: 'center'
27
+ }
28
+ });
@@ -0,0 +1,11 @@
1
+ import type * as DialogPrimitive from '@radix-ui/react-dialog';
2
+ import type { ComponentProps } from 'react';
3
+ export type DialogSize = 'sm' | 'md';
4
+ export type DialogAlign = 'center' | 'left';
5
+ export interface DialogWideHeaderProps extends ComponentProps<'div'> {
6
+ size?: DialogSize;
7
+ }
8
+ export interface DialogWideTitleProps extends ComponentProps<typeof DialogPrimitive.Title> {
9
+ size?: DialogSize;
10
+ align?: DialogAlign;
11
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dialog/index.d.ts CHANGED
@@ -1 +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 { dialogWideHeaderVariants, dialogWideTitleVariants } from './dialog.constants';
3
+ export type { DialogWideHeaderProps, DialogWideTitleProps, DialogSize, DialogAlign } from './dialog.types';
package/dialog/index.js CHANGED
@@ -1 +1,2 @@
1
- export { Dialog, DialogClose, DialogWideFooter, DialogOverlay, DialogPortal, DialogTrigger, DialogWideTitle, DialogWideHeader, DialogWideContent, DialogWideBody, DialogFormContent, DialogFormDescription, DialogFormIcon, DialogFormWarningIcon, DialogFormErrorIcon, DialogFormHeader, DialogFormTitle, DialogFormBody, DialogFormFooter } from './dialog.component';
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 { 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.122",
3
+ "version": "0.0.124",
4
4
  "author": "scaleflex",
5
5
  "repository": "github:scaleflex/ui",
6
6
  "homepage": "https://github.com/scaleflex/ui/blob/master/README.md",
@@ -28,7 +28,7 @@
28
28
  "@radix-ui/react-switch": "^1.0.1",
29
29
  "@radix-ui/react-tabs": "^1.1.13",
30
30
  "@radix-ui/react-tooltip": "^1.2.6",
31
- "@scaleflex/icons-tw": "^0.0.122",
31
+ "@scaleflex/icons-tw": "^0.0.124",
32
32
  "@tanstack/react-table": "^8.21.3",
33
33
  "@types/lodash.merge": "^4.6.9",
34
34
  "class-variance-authority": "^0.7.1",