dash-ui-kit 1.0.8 → 1.0.91
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/dist/react/components/dialog/index.d.ts +8 -0
- package/dist/react/components/icons/index.d.ts +3 -0
- package/dist/react/components/index.d.ts +1 -1
- package/dist/react/components/overlayMenu/index.d.ts +19 -0
- package/dist/react/components/text/index.d.ts +1 -1
- package/dist/react/index.cjs.js +306 -45
- package/dist/react/index.cjs.js.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.esm.js +304 -46
- package/dist/react/index.esm.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,14 @@ export interface DialogProps {
|
|
|
10
10
|
showCloseButton?: boolean;
|
|
11
11
|
/** Dialog size */
|
|
12
12
|
size?: 'sm' | 'md' | 'xl';
|
|
13
|
+
/** Vertical position of the dialog */
|
|
14
|
+
position?: 'center' | 'bottom';
|
|
15
|
+
/** Offset from bottom when position is 'bottom' (in pixels) */
|
|
16
|
+
bottomOffset?: number;
|
|
17
|
+
/** Maximum width of the dialog (e.g., '500px', '50%', '2xl'). Use Tailwind classes like 'sm', 'md', 'lg', 'xl', '2xl', etc. or CSS values */
|
|
18
|
+
maxWidth?: string;
|
|
19
|
+
/** Horizontal margin from screen edges (in pixels) */
|
|
20
|
+
horizontalMargin?: number;
|
|
13
21
|
/** Dialog content */
|
|
14
22
|
children: React.ReactNode;
|
|
15
23
|
/** Additional className for the content container */
|
|
@@ -43,3 +43,6 @@ export declare const SignLockIcon: React.FC<IconProps>;
|
|
|
43
43
|
export declare const LockIcon: React.FC<IconProps>;
|
|
44
44
|
export declare const PendingIcon: React.FC<IconProps>;
|
|
45
45
|
export declare const SearchIcon: React.FC<IconProps>;
|
|
46
|
+
export declare const AirplaneIcon: React.FC<IconProps>;
|
|
47
|
+
export declare const ExternalLinkIcon: React.FC<IconProps>;
|
|
48
|
+
export declare const InfoCircleIcon: React.FC<IconProps>;
|
|
@@ -24,4 +24,4 @@ export { DashLogo, type DashLogoProps } from './dashLogo';
|
|
|
24
24
|
export { Dialog, type DialogProps } from './dialog';
|
|
25
25
|
export { Tabs, type TabsProps, type TabItem } from './tabs';
|
|
26
26
|
export type { TimeDeltaFormat } from '../utils/datetime';
|
|
27
|
-
export { ArrowIcon, CopyIcon, SuccessIcon, ErrorIcon, QueuedIcon, PooledIcon, BroadcastedIcon, CalendarIcon, EyeOpenIcon, EyeClosedIcon, CheckIcon, KeyIcon, ProtectedMessageIcon, SmartphoneIcon, CrossIcon, WalletIcon, PlusIcon, FilterIcon, EditIcon, DeleteIcon, ChevronIcon, BurgerMenuIcon, KebabMenuIcon, CircleProcessIcon, CreditsIcon, WebIcon, ChainSmallIcon, SettingsIcon, ShieldSmallIcon, QuestionMessageIcon, CheckmarkIcon, FingerprintIcon, FaceIcon, SignIcon, SignLockIcon, LockIcon, PendingIcon, SearchIcon } from './icons';
|
|
27
|
+
export { ArrowIcon, CopyIcon, SuccessIcon, ErrorIcon, QueuedIcon, PooledIcon, BroadcastedIcon, CalendarIcon, EyeOpenIcon, EyeClosedIcon, CheckIcon, KeyIcon, ProtectedMessageIcon, SmartphoneIcon, CrossIcon, WalletIcon, PlusIcon, FilterIcon, EditIcon, DeleteIcon, ChevronIcon, BurgerMenuIcon, KebabMenuIcon, CircleProcessIcon, CreditsIcon, WebIcon, ChainSmallIcon, SettingsIcon, ShieldSmallIcon, QuestionMessageIcon, CheckmarkIcon, FingerprintIcon, FaceIcon, SignIcon, SignLockIcon, LockIcon, PendingIcon, SearchIcon, AirplaneIcon, ExternalLinkIcon, InfoCircleIcon } from './icons';
|
|
@@ -15,8 +15,15 @@ export interface OverlayMenuItem {
|
|
|
15
15
|
onClick?: () => void;
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
}
|
|
18
|
+
export interface OverlayMenuPosition {
|
|
19
|
+
top?: number;
|
|
20
|
+
left?: number;
|
|
21
|
+
right?: number;
|
|
22
|
+
bottom?: number;
|
|
23
|
+
}
|
|
18
24
|
export interface OverlayMenuProps extends Omit<OverlayMenuVariants, 'theme' | 'disabled'> {
|
|
19
25
|
className?: string;
|
|
26
|
+
contentClassName?: string;
|
|
20
27
|
error?: boolean;
|
|
21
28
|
success?: boolean;
|
|
22
29
|
border?: boolean;
|
|
@@ -30,10 +37,22 @@ export interface OverlayMenuProps extends Omit<OverlayMenuVariants, 'theme' | 'd
|
|
|
30
37
|
triggerContent?: React.ReactNode;
|
|
31
38
|
placeholder?: string;
|
|
32
39
|
showItemBorders?: boolean;
|
|
40
|
+
variant?: 'dropdown' | 'context-menu';
|
|
41
|
+
headerContent?: React.ReactNode;
|
|
42
|
+
showCloseButton?: boolean;
|
|
43
|
+
position?: OverlayMenuPosition;
|
|
44
|
+
width?: string | number;
|
|
45
|
+
onClose?: () => void;
|
|
33
46
|
}
|
|
34
47
|
/**
|
|
35
48
|
* Overlay menu component that opens above the trigger with overlay positioning.
|
|
36
49
|
* Supports custom content items with onClick handlers.
|
|
50
|
+
*
|
|
51
|
+
* @param variant - 'dropdown' (default) or 'context-menu'
|
|
52
|
+
* @param headerContent - Custom header content (for context-menu variant)
|
|
53
|
+
* @param showCloseButton - Show close button in header
|
|
54
|
+
* @param position - Position object for context-menu variant
|
|
55
|
+
* @param width - Custom width (default: 200px for context-menu)
|
|
37
56
|
*/
|
|
38
57
|
export declare const OverlayMenu: React.FC<OverlayMenuProps>;
|
|
39
58
|
export default OverlayMenu;
|
|
@@ -5,7 +5,7 @@ declare const textStyles: (props?: ({
|
|
|
5
5
|
theme?: "light" | "dark" | null | undefined;
|
|
6
6
|
color?: "default" | "blue" | "red" | "blue-dark" | null | undefined;
|
|
7
7
|
size?: "xs" | "sm" | "xl" | "md" | "lg" | null | undefined;
|
|
8
|
-
weight?: "bold" | "normal" |
|
|
8
|
+
weight?: "bold" | "normal" | "medium" | null | undefined;
|
|
9
9
|
italic?: boolean | null | undefined;
|
|
10
10
|
underline?: boolean | null | undefined;
|
|
11
11
|
lineThrough?: boolean | null | undefined;
|
package/dist/react/index.cjs.js
CHANGED
|
@@ -2011,6 +2011,83 @@ const SearchIcon = ({
|
|
|
2011
2011
|
fill: 'currentColor'
|
|
2012
2012
|
})
|
|
2013
2013
|
});
|
|
2014
|
+
const AirplaneIcon = ({
|
|
2015
|
+
color = '#0C1C33',
|
|
2016
|
+
size = 16,
|
|
2017
|
+
className = '',
|
|
2018
|
+
onClick
|
|
2019
|
+
}) => jsxRuntime.jsx("svg", {
|
|
2020
|
+
width: size,
|
|
2021
|
+
height: size,
|
|
2022
|
+
viewBox: '0 0 16 16',
|
|
2023
|
+
fill: 'none',
|
|
2024
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
2025
|
+
className: className,
|
|
2026
|
+
onClick: onClick,
|
|
2027
|
+
color: color,
|
|
2028
|
+
children: jsxRuntime.jsx("path", {
|
|
2029
|
+
d: 'M7.68459 8.00182H3.34214M3.21905 8.57088L2.50162 10.7134C2.10869 11.8867 1.91222 12.4734 2.05322 12.8347C2.17565 13.1485 2.43862 13.3863 2.76311 13.4769C3.13678 13.5811 3.70115 13.3272 4.82989 12.8195L12.0662 9.56409C13.1679 9.06841 13.7188 8.82064 13.889 8.47637C14.037 8.17727 14.037 7.82629 13.889 7.5272C13.7188 7.18299 13.1679 6.93515 12.0662 6.4395L4.81741 3.17853C3.69206 2.67227 3.1294 2.41914 2.75611 2.52298C2.43192 2.61316 2.16898 2.8504 2.04612 3.16358C1.90464 3.5242 2.09901 4.10962 2.48775 5.28048L3.22045 7.48736C3.28721 7.68845 3.3206 7.78903 3.33377 7.89182C3.34547 7.98311 3.34534 8.07548 3.33342 8.16671C3.31997 8.2695 3.28634 8.36994 3.21905 8.57088Z',
|
|
2030
|
+
stroke: 'currentColor',
|
|
2031
|
+
strokeLinecap: 'round',
|
|
2032
|
+
strokeLinejoin: 'round'
|
|
2033
|
+
})
|
|
2034
|
+
});
|
|
2035
|
+
const ExternalLinkIcon = ({
|
|
2036
|
+
color = '#0C1C33',
|
|
2037
|
+
size = 16,
|
|
2038
|
+
className = '',
|
|
2039
|
+
onClick
|
|
2040
|
+
}) => jsxRuntime.jsx("svg", {
|
|
2041
|
+
width: size,
|
|
2042
|
+
height: size,
|
|
2043
|
+
viewBox: '0 0 16 16',
|
|
2044
|
+
fill: 'none',
|
|
2045
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
2046
|
+
className: className,
|
|
2047
|
+
onClick: onClick,
|
|
2048
|
+
color: color,
|
|
2049
|
+
children: jsxRuntime.jsx("path", {
|
|
2050
|
+
d: 'M10.2499 9.125V5.75M10.2499 5.75H6.87491M10.2499 5.75L5.75001 10.2499M4.40001 14H11.6C12.4401 14 12.8601 14 13.181 13.8365C13.4632 13.6927 13.6927 13.4632 13.8366 13.181C14 12.8602 14 12.4401 14 11.6V4.4C14 3.55992 14 3.13988 13.8366 2.81902C13.6927 2.53677 13.4632 2.3073 13.181 2.16349C12.8601 2 12.4401 2 11.6 2H4.40001C3.55993 2 3.13989 2 2.81902 2.16349C2.53678 2.3073 2.30731 2.53677 2.16349 2.81902C2 3.13988 2 3.55992 2 4.4V11.6C2 12.4401 2 12.8602 2.16349 13.181C2.30731 13.4632 2.53678 13.6927 2.81902 13.8365C3.13989 14 3.55993 14 4.40001 14Z',
|
|
2051
|
+
stroke: 'currentColor',
|
|
2052
|
+
strokeLinecap: 'round',
|
|
2053
|
+
strokeLinejoin: 'round'
|
|
2054
|
+
})
|
|
2055
|
+
});
|
|
2056
|
+
const InfoCircleIcon = ({
|
|
2057
|
+
color = '#4C7EFF',
|
|
2058
|
+
size = 19,
|
|
2059
|
+
className = '',
|
|
2060
|
+
onClick
|
|
2061
|
+
}) => jsxRuntime.jsxs("svg", {
|
|
2062
|
+
width: size,
|
|
2063
|
+
height: size,
|
|
2064
|
+
viewBox: '0 0 19 19',
|
|
2065
|
+
fill: 'none',
|
|
2066
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
2067
|
+
className: className,
|
|
2068
|
+
onClick: onClick,
|
|
2069
|
+
color: color,
|
|
2070
|
+
children: [jsxRuntime.jsxs("g", {
|
|
2071
|
+
clipPath: 'url(#clip0_1166_258)',
|
|
2072
|
+
children: [jsxRuntime.jsx("path", {
|
|
2073
|
+
d: 'M9.5 5.5H9.51ZM9.5 8.5V13.5ZM18.5 9.5C18.5 14.4706 14.4706 18.5 9.5 18.5C4.52944 18.5 0.5 14.4706 0.5 9.5C0.5 4.52944 4.52944 0.5 9.5 0.5C14.4706 0.5 18.5 4.52944 18.5 9.5Z',
|
|
2074
|
+
fill: 'currentColor',
|
|
2075
|
+
fillOpacity: '0.05'
|
|
2076
|
+
}), jsxRuntime.jsx("path", {
|
|
2077
|
+
d: 'M18 9.5C18 4.80558 14.1945 1 9.5 1C4.80558 1 1 4.80558 1 9.5C1 14.1945 4.80558 18 9.5 18C14.1945 18 18 14.1945 18 9.5ZM9 13.5V8.5C9 8.22386 9.22386 8 9.5 8C9.77614 8 10 8.22386 10 8.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5ZM9.50977 5C9.78591 5 10.0098 5.22386 10.0098 5.5C10.0098 5.77614 9.78591 6 9.50977 6H9.5C9.22386 6 9 5.77614 9 5.5C9 5.22386 9.22386 5 9.5 5H9.50977ZM19 9.5C19 14.7467 14.7467 19 9.5 19C4.2533 19 0 14.7467 0 9.5C0 4.2533 4.2533 0 9.5 0C14.7467 0 19 4.2533 19 9.5Z',
|
|
2078
|
+
fill: 'currentColor'
|
|
2079
|
+
})]
|
|
2080
|
+
}), jsxRuntime.jsx("defs", {
|
|
2081
|
+
children: jsxRuntime.jsx("clipPath", {
|
|
2082
|
+
id: 'clip0_1166_258',
|
|
2083
|
+
children: jsxRuntime.jsx("rect", {
|
|
2084
|
+
width: '19',
|
|
2085
|
+
height: '19',
|
|
2086
|
+
fill: 'white'
|
|
2087
|
+
})
|
|
2088
|
+
})
|
|
2089
|
+
})]
|
|
2090
|
+
});
|
|
2014
2091
|
|
|
2015
2092
|
const accordionRootStyles = classVarianceAuthority.cva(`
|
|
2016
2093
|
w-full
|
|
@@ -3016,7 +3093,7 @@ const textStyles = classVarianceAuthority.cva('', {
|
|
|
3016
3093
|
},
|
|
3017
3094
|
weight: {
|
|
3018
3095
|
normal: 'font-normal',
|
|
3019
|
-
|
|
3096
|
+
medium: 'font-medium',
|
|
3020
3097
|
bold: 'font-bold'
|
|
3021
3098
|
},
|
|
3022
3099
|
italic: {
|
|
@@ -6262,7 +6339,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
6262
6339
|
wordWrap: "normal"
|
|
6263
6340
|
});
|
|
6264
6341
|
var NAME = "VisuallyHidden";
|
|
6265
|
-
var VisuallyHidden = React__namespace.forwardRef(
|
|
6342
|
+
var VisuallyHidden$1 = React__namespace.forwardRef(
|
|
6266
6343
|
(props, forwardedRef) => {
|
|
6267
6344
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6268
6345
|
Primitive.span,
|
|
@@ -6274,7 +6351,7 @@ var VisuallyHidden = React__namespace.forwardRef(
|
|
|
6274
6351
|
);
|
|
6275
6352
|
}
|
|
6276
6353
|
);
|
|
6277
|
-
VisuallyHidden.displayName = NAME;
|
|
6354
|
+
VisuallyHidden$1.displayName = NAME;
|
|
6278
6355
|
|
|
6279
6356
|
var getDefaultParent = function (originalTarget) {
|
|
6280
6357
|
if (typeof document === 'undefined') {
|
|
@@ -8285,7 +8362,7 @@ const selectTrigger = classVarianceAuthority.cva('w-full transition-all font-int
|
|
|
8285
8362
|
disabled: false
|
|
8286
8363
|
}
|
|
8287
8364
|
});
|
|
8288
|
-
const selectContent = classVarianceAuthority.cva('overflow-hidden z-50 rounded-md shadow-lg min-w-[var(--radix-select-trigger-width)] w-full', {
|
|
8365
|
+
const selectContent = classVarianceAuthority.cva('overflow-hidden z-50 rounded-md shadow-lg min-w-[var(--radix-select-trigger-width)] w-full max-h-[var(--radix-select-content-available-height)]', {
|
|
8289
8366
|
variants: {
|
|
8290
8367
|
theme: {
|
|
8291
8368
|
light: 'bg-white border border-gray-200',
|
|
@@ -8293,6 +8370,7 @@ const selectContent = classVarianceAuthority.cva('overflow-hidden z-50 rounded-m
|
|
|
8293
8370
|
}
|
|
8294
8371
|
}
|
|
8295
8372
|
});
|
|
8373
|
+
const selectViewport = classVarianceAuthority.cva('overflow-y-auto max-h-[inherit]');
|
|
8296
8374
|
const selectItem = classVarianceAuthority.cva('relative flex cursor-pointer select-none items-center outline-none focus:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50', {
|
|
8297
8375
|
variants: {
|
|
8298
8376
|
theme: {
|
|
@@ -8381,6 +8459,7 @@ const Select = _a => {
|
|
|
8381
8459
|
const contentClasses = selectContent({
|
|
8382
8460
|
theme
|
|
8383
8461
|
});
|
|
8462
|
+
const viewportClasses = selectViewport({});
|
|
8384
8463
|
const itemClasses = selectItem({
|
|
8385
8464
|
theme,
|
|
8386
8465
|
size
|
|
@@ -8413,6 +8492,7 @@ const Select = _a => {
|
|
|
8413
8492
|
position: 'popper',
|
|
8414
8493
|
sideOffset: 5,
|
|
8415
8494
|
children: jsxRuntime.jsx(Viewport, {
|
|
8495
|
+
className: viewportClasses,
|
|
8416
8496
|
children: options.map(option => jsxRuntime.jsx(Item$1, {
|
|
8417
8497
|
value: option.value,
|
|
8418
8498
|
className: itemClasses,
|
|
@@ -8932,7 +9012,7 @@ const overlayMenuTrigger = classVarianceAuthority.cva('w-full transition-all fon
|
|
|
8932
9012
|
filled: false
|
|
8933
9013
|
}
|
|
8934
9014
|
});
|
|
8935
|
-
const overlayContent = classVarianceAuthority.cva('absolute z-50
|
|
9015
|
+
const overlayContent = classVarianceAuthority.cva('absolute z-50 overflow-hidden', {
|
|
8936
9016
|
variants: {
|
|
8937
9017
|
theme: {
|
|
8938
9018
|
light: 'bg-white border border-[rgba(12,28,51,0.05)]',
|
|
@@ -8940,22 +9020,55 @@ const overlayContent = classVarianceAuthority.cva('absolute z-50 min-w-full over
|
|
|
8940
9020
|
},
|
|
8941
9021
|
size: {
|
|
8942
9022
|
sm: 'rounded-[0.625rem]',
|
|
8943
|
-
md: 'rounded-[0.
|
|
8944
|
-
xl: 'rounded-[
|
|
9023
|
+
md: 'rounded-[0.75rem]',
|
|
9024
|
+
xl: 'rounded-[0.9375rem]'
|
|
9025
|
+
},
|
|
9026
|
+
variant: {
|
|
9027
|
+
dropdown: 'min-w-full',
|
|
9028
|
+
'context-menu': 'w-[200px]'
|
|
9029
|
+
},
|
|
9030
|
+
hasShadow: {
|
|
9031
|
+
true: 'shadow-[0px_0px_75px_0px_rgba(0,0,0,0.15)]',
|
|
9032
|
+
false: 'shadow-lg'
|
|
8945
9033
|
}
|
|
9034
|
+
},
|
|
9035
|
+
defaultVariants: {
|
|
9036
|
+
variant: 'dropdown',
|
|
9037
|
+
hasShadow: false
|
|
8946
9038
|
}
|
|
8947
9039
|
});
|
|
8948
|
-
const
|
|
9040
|
+
const overlayHeader = classVarianceAuthority.cva('flex items-center justify-between border-b gap-2', {
|
|
9041
|
+
variants: {
|
|
9042
|
+
theme: {
|
|
9043
|
+
light: 'border-[rgba(12,28,51,0.05)]',
|
|
9044
|
+
dark: 'border-[rgba(255,255,255,0.15)]'
|
|
9045
|
+
},
|
|
9046
|
+
size: {
|
|
9047
|
+
sm: 'px-[0.875rem] py-[0.375rem]',
|
|
9048
|
+
md: 'px-[1rem] py-[0.5rem]',
|
|
9049
|
+
xl: 'px-[1.125rem] py-[0.5rem]'
|
|
9050
|
+
}
|
|
9051
|
+
},
|
|
9052
|
+
defaultVariants: {
|
|
9053
|
+
theme: 'light',
|
|
9054
|
+
size: 'xl'
|
|
9055
|
+
}
|
|
9056
|
+
});
|
|
9057
|
+
const overlayItem = classVarianceAuthority.cva('relative flex cursor-pointer select-none items-center outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 rounded-none font-medium text-[0.75rem] leading-[1.416em]', {
|
|
8949
9058
|
variants: {
|
|
8950
9059
|
theme: {
|
|
8951
9060
|
light: 'text-[#0C1C33] hover:bg-gray-50',
|
|
8952
9061
|
dark: 'text-white hover:bg-[rgba(255,255,255,0.1)]'
|
|
8953
9062
|
},
|
|
8954
9063
|
size: {
|
|
8955
|
-
sm: '
|
|
8956
|
-
md: '
|
|
8957
|
-
xl: '
|
|
9064
|
+
sm: 'px-[0.875rem] py-[0.625rem]',
|
|
9065
|
+
md: 'px-[1rem] py-[0.6875rem]',
|
|
9066
|
+
xl: 'px-[1.125rem] py-[0.75rem]'
|
|
8958
9067
|
}
|
|
9068
|
+
},
|
|
9069
|
+
defaultVariants: {
|
|
9070
|
+
theme: 'light',
|
|
9071
|
+
size: 'xl'
|
|
8959
9072
|
}
|
|
8960
9073
|
});
|
|
8961
9074
|
// Arrow icon
|
|
@@ -8978,10 +9091,17 @@ const ChevronDownIcon = ({
|
|
|
8978
9091
|
/**
|
|
8979
9092
|
* Overlay menu component that opens above the trigger with overlay positioning.
|
|
8980
9093
|
* Supports custom content items with onClick handlers.
|
|
9094
|
+
*
|
|
9095
|
+
* @param variant - 'dropdown' (default) or 'context-menu'
|
|
9096
|
+
* @param headerContent - Custom header content (for context-menu variant)
|
|
9097
|
+
* @param showCloseButton - Show close button in header
|
|
9098
|
+
* @param position - Position object for context-menu variant
|
|
9099
|
+
* @param width - Custom width (default: 200px for context-menu)
|
|
8981
9100
|
*/
|
|
8982
9101
|
const OverlayMenu = _a => {
|
|
8983
9102
|
var {
|
|
8984
9103
|
className = '',
|
|
9104
|
+
contentClassName = '',
|
|
8985
9105
|
colorScheme,
|
|
8986
9106
|
size,
|
|
8987
9107
|
error = false,
|
|
@@ -8996,9 +9116,15 @@ const OverlayMenu = _a => {
|
|
|
8996
9116
|
maxHeight = '200px',
|
|
8997
9117
|
triggerContent,
|
|
8998
9118
|
placeholder = 'Menu',
|
|
8999
|
-
showItemBorders = true
|
|
9119
|
+
showItemBorders = true,
|
|
9120
|
+
variant = 'dropdown',
|
|
9121
|
+
headerContent,
|
|
9122
|
+
showCloseButton = false,
|
|
9123
|
+
position,
|
|
9124
|
+
width,
|
|
9125
|
+
onClose
|
|
9000
9126
|
} = _a,
|
|
9001
|
-
props = tslib.__rest(_a, ["className", "colorScheme", "size", "error", "success", "border", "filled", "disabled", "items", "showArrow", "name", "overlayLabel", "maxHeight", "triggerContent", "placeholder", "showItemBorders"]);
|
|
9127
|
+
props = tslib.__rest(_a, ["className", "contentClassName", "colorScheme", "size", "error", "success", "border", "filled", "disabled", "items", "showArrow", "name", "overlayLabel", "maxHeight", "triggerContent", "placeholder", "showItemBorders", "variant", "headerContent", "showCloseButton", "position", "width", "onClose"]);
|
|
9002
9128
|
const {
|
|
9003
9129
|
theme
|
|
9004
9130
|
} = useTheme();
|
|
@@ -9007,6 +9133,22 @@ const OverlayMenu = _a => {
|
|
|
9007
9133
|
// Determine color scheme based on state
|
|
9008
9134
|
let finalColorScheme = colorScheme;
|
|
9009
9135
|
if (error) finalColorScheme = 'error';else if (success) finalColorScheme = 'success';
|
|
9136
|
+
const isContextMenu = variant === 'context-menu';
|
|
9137
|
+
// Handle Escape key
|
|
9138
|
+
React.useEffect(() => {
|
|
9139
|
+
if (!isOpen) return;
|
|
9140
|
+
const handleEscape = e => {
|
|
9141
|
+
if (e.key === 'Escape') {
|
|
9142
|
+
handleClose();
|
|
9143
|
+
}
|
|
9144
|
+
};
|
|
9145
|
+
document.addEventListener('keydown', handleEscape);
|
|
9146
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
9147
|
+
}, [isOpen]);
|
|
9148
|
+
const handleClose = () => {
|
|
9149
|
+
setIsOpen(false);
|
|
9150
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
9151
|
+
};
|
|
9010
9152
|
const triggerClasses = overlayMenuTrigger({
|
|
9011
9153
|
theme,
|
|
9012
9154
|
colorScheme: finalColorScheme,
|
|
@@ -9016,6 +9158,12 @@ const OverlayMenu = _a => {
|
|
|
9016
9158
|
disabled
|
|
9017
9159
|
}) + ' ' + className;
|
|
9018
9160
|
const contentClasses = overlayContent({
|
|
9161
|
+
theme,
|
|
9162
|
+
size,
|
|
9163
|
+
variant,
|
|
9164
|
+
hasShadow: isContextMenu
|
|
9165
|
+
});
|
|
9166
|
+
const headerClasses = overlayHeader({
|
|
9019
9167
|
theme,
|
|
9020
9168
|
size
|
|
9021
9169
|
});
|
|
@@ -9027,11 +9175,28 @@ const OverlayMenu = _a => {
|
|
|
9027
9175
|
if (!item.disabled && item.onClick) {
|
|
9028
9176
|
item.onClick();
|
|
9029
9177
|
}
|
|
9030
|
-
|
|
9178
|
+
handleClose();
|
|
9179
|
+
};
|
|
9180
|
+
// For context-menu variant, show menu immediately if position is provided
|
|
9181
|
+
React.useEffect(() => {
|
|
9182
|
+
if (isContextMenu && position) {
|
|
9183
|
+
setIsOpen(true);
|
|
9184
|
+
}
|
|
9185
|
+
}, [isContextMenu, position]);
|
|
9186
|
+
// Calculate position styles for context-menu
|
|
9187
|
+
const getPositionStyles = () => {
|
|
9188
|
+
if (!isContextMenu || !position) return {};
|
|
9189
|
+
const styles = {};
|
|
9190
|
+
if (position.top !== undefined) styles.top = position.top;
|
|
9191
|
+
if (position.left !== undefined) styles.left = position.left;
|
|
9192
|
+
if (position.right !== undefined) styles.right = position.right;
|
|
9193
|
+
if (position.bottom !== undefined) styles.bottom = position.bottom;
|
|
9194
|
+
if (width) styles.width = typeof width === 'number' ? `${width}px` : width;
|
|
9195
|
+
return styles;
|
|
9031
9196
|
};
|
|
9032
9197
|
return jsxRuntime.jsxs("div", {
|
|
9033
|
-
className: 'relative',
|
|
9034
|
-
children: [jsxRuntime.jsxs("button", Object.assign({
|
|
9198
|
+
className: isContextMenu ? '' : 'relative',
|
|
9199
|
+
children: [!isContextMenu && jsxRuntime.jsxs("button", Object.assign({
|
|
9035
9200
|
ref: triggerRef,
|
|
9036
9201
|
type: 'button',
|
|
9037
9202
|
className: triggerClasses,
|
|
@@ -9050,35 +9215,33 @@ const OverlayMenu = _a => {
|
|
|
9050
9215
|
})]
|
|
9051
9216
|
})), isOpen && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
9052
9217
|
children: [jsxRuntime.jsx("div", {
|
|
9053
|
-
className: 'fixed inset-0 z-40
|
|
9054
|
-
onClick:
|
|
9218
|
+
className: `${isContextMenu ? 'fixed' : 'fixed'} inset-0 z-40`,
|
|
9219
|
+
onClick: handleClose
|
|
9055
9220
|
}), jsxRuntime.jsxs("div", {
|
|
9056
|
-
className: `${contentClasses} top-0 left-0 right-0 overflow-y-auto`,
|
|
9057
|
-
style: {
|
|
9221
|
+
className: `${contentClasses} ${isContextMenu ? 'fixed' : ''} ${!isContextMenu ? 'top-0 left-0 right-0' : ''} overflow-y-auto ${contentClassName}`,
|
|
9222
|
+
style: Object.assign({
|
|
9058
9223
|
maxHeight
|
|
9059
|
-
},
|
|
9060
|
-
children: [overlayLabel && jsxRuntime.jsxs("div", {
|
|
9061
|
-
className: `${
|
|
9062
|
-
onClick:
|
|
9224
|
+
}, getPositionStyles()),
|
|
9225
|
+
children: [(headerContent || overlayLabel) && jsxRuntime.jsxs("div", {
|
|
9226
|
+
className: `${headerClasses} ${!showCloseButton && !isContextMenu ? 'cursor-pointer' : ''}`,
|
|
9227
|
+
onClick: !showCloseButton && !isContextMenu ? handleClose : undefined,
|
|
9063
9228
|
children: [jsxRuntime.jsx("div", {
|
|
9064
9229
|
className: 'w-full flex-1',
|
|
9065
|
-
children: overlayLabel
|
|
9066
|
-
}), jsxRuntime.jsx("
|
|
9067
|
-
className: 'flex items-center
|
|
9230
|
+
children: headerContent || overlayLabel
|
|
9231
|
+
}), (showCloseButton || isContextMenu && headerContent) && jsxRuntime.jsx("button", {
|
|
9232
|
+
className: 'flex items-center cursor-pointer hover:opacity-70 transition-opacity',
|
|
9233
|
+
onClick: handleClose,
|
|
9234
|
+
"aria-label": 'Close menu',
|
|
9068
9235
|
children: jsxRuntime.jsx(CrossIcon, {
|
|
9069
9236
|
size: 16,
|
|
9070
|
-
color: theme === 'dark' ? '#FFFFFF' : '#0C1C33'
|
|
9071
|
-
className: 'cursor-pointer'
|
|
9237
|
+
color: theme === 'dark' ? '#FFFFFF' : '#0C1C33'
|
|
9072
9238
|
})
|
|
9073
9239
|
})]
|
|
9074
9240
|
}), jsxRuntime.jsx("div", {
|
|
9075
9241
|
children: items.map((item, index) => jsxRuntime.jsx("div", {
|
|
9076
|
-
className: `${itemClasses} ${item.disabled ? 'opacity-50 cursor-not-allowed' : ''} ${index < items.length - 1 ? `border-b ${theme === 'dark' ? 'border-[rgba(255,255,255,0.15)]' : 'border-[rgba(12,28,51,0.05)]'}` : ''}`,
|
|
9242
|
+
className: `${itemClasses} ${item.disabled ? 'opacity-50 cursor-not-allowed' : ''} ${showItemBorders && index < items.length - 1 ? `border-b ${theme === 'dark' ? 'border-[rgba(255,255,255,0.15)]' : 'border-[rgba(12,28,51,0.05)]'}` : ''}`,
|
|
9077
9243
|
onClick: () => handleItemClick(item),
|
|
9078
|
-
children:
|
|
9079
|
-
className: 'w-full flex-1',
|
|
9080
|
-
children: item.content
|
|
9081
|
-
})
|
|
9244
|
+
children: item.content
|
|
9082
9245
|
}, item.id))
|
|
9083
9246
|
})]
|
|
9084
9247
|
})]
|
|
@@ -9370,7 +9533,7 @@ const List$1 = ({
|
|
|
9370
9533
|
className: 'flex flex-col gap-1',
|
|
9371
9534
|
children: [jsxRuntime.jsx(Text, {
|
|
9372
9535
|
size: size,
|
|
9373
|
-
weight:
|
|
9536
|
+
weight: "medium",
|
|
9374
9537
|
children: item.text
|
|
9375
9538
|
}), item.description && jsxRuntime.jsx(Text, {
|
|
9376
9539
|
size: 'xs',
|
|
@@ -11746,6 +11909,24 @@ var Content$1 = DialogContent;
|
|
|
11746
11909
|
var Title = DialogTitle;
|
|
11747
11910
|
var Close = DialogClose;
|
|
11748
11911
|
|
|
11912
|
+
// Visually hidden component for accessibility
|
|
11913
|
+
const VisuallyHidden = ({
|
|
11914
|
+
children
|
|
11915
|
+
}) => jsxRuntime.jsx("span", {
|
|
11916
|
+
style: {
|
|
11917
|
+
position: 'absolute',
|
|
11918
|
+
border: 0,
|
|
11919
|
+
width: 1,
|
|
11920
|
+
height: 1,
|
|
11921
|
+
padding: 0,
|
|
11922
|
+
margin: -1,
|
|
11923
|
+
overflow: 'hidden',
|
|
11924
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
11925
|
+
whiteSpace: 'nowrap',
|
|
11926
|
+
wordWrap: 'normal'
|
|
11927
|
+
},
|
|
11928
|
+
children: children
|
|
11929
|
+
});
|
|
11749
11930
|
const overlayStyles = classVarianceAuthority.cva(`
|
|
11750
11931
|
fixed
|
|
11751
11932
|
inset-0
|
|
@@ -11766,11 +11947,9 @@ const overlayStyles = classVarianceAuthority.cva(`
|
|
|
11766
11947
|
const contentStyles = classVarianceAuthority.cva(`
|
|
11767
11948
|
fixed
|
|
11768
11949
|
left-[50%]
|
|
11769
|
-
top-[50%]
|
|
11770
11950
|
z-50
|
|
11771
11951
|
w-full
|
|
11772
11952
|
translate-x-[-50%]
|
|
11773
|
-
translate-y-[-50%]
|
|
11774
11953
|
flex
|
|
11775
11954
|
flex-col
|
|
11776
11955
|
gap-4
|
|
@@ -11783,10 +11962,6 @@ const contentStyles = classVarianceAuthority.cva(`
|
|
|
11783
11962
|
data-[state=open]:fade-in-0
|
|
11784
11963
|
data-[state=closed]:zoom-out-95
|
|
11785
11964
|
data-[state=open]:zoom-in-95
|
|
11786
|
-
data-[state=closed]:slide-out-to-left-1/2
|
|
11787
|
-
data-[state=closed]:slide-out-to-top-[48%]
|
|
11788
|
-
data-[state=open]:slide-in-from-left-1/2
|
|
11789
|
-
data-[state=open]:slide-in-from-top-[48%]
|
|
11790
11965
|
sm:rounded-lg
|
|
11791
11966
|
font-dash-main
|
|
11792
11967
|
`, {
|
|
@@ -11799,10 +11974,27 @@ const contentStyles = classVarianceAuthority.cva(`
|
|
|
11799
11974
|
sm: 'dash-block-sm',
|
|
11800
11975
|
md: 'dash-block-md',
|
|
11801
11976
|
xl: 'dash-block-xl'
|
|
11977
|
+
},
|
|
11978
|
+
position: {
|
|
11979
|
+
center: `
|
|
11980
|
+
top-[50%]
|
|
11981
|
+
translate-y-[-50%]
|
|
11982
|
+
data-[state=closed]:slide-out-to-left-1/2
|
|
11983
|
+
data-[state=closed]:slide-out-to-top-[48%]
|
|
11984
|
+
data-[state=open]:slide-in-from-left-1/2
|
|
11985
|
+
data-[state=open]:slide-in-from-top-[48%]
|
|
11986
|
+
`,
|
|
11987
|
+
bottom: `
|
|
11988
|
+
data-[state=closed]:slide-out-to-left-1/2
|
|
11989
|
+
data-[state=closed]:slide-out-to-bottom-full
|
|
11990
|
+
data-[state=open]:slide-in-from-left-1/2
|
|
11991
|
+
data-[state=open]:slide-in-from-bottom-full
|
|
11992
|
+
`
|
|
11802
11993
|
}
|
|
11803
11994
|
},
|
|
11804
11995
|
defaultVariants: {
|
|
11805
|
-
size: 'md'
|
|
11996
|
+
size: 'md',
|
|
11997
|
+
position: 'center'
|
|
11806
11998
|
}
|
|
11807
11999
|
});
|
|
11808
12000
|
const headerStyles = classVarianceAuthority.cva(`
|
|
@@ -11851,6 +12043,10 @@ const DashDialog = ({
|
|
|
11851
12043
|
title,
|
|
11852
12044
|
showCloseButton = true,
|
|
11853
12045
|
size = 'md',
|
|
12046
|
+
position = 'center',
|
|
12047
|
+
bottomOffset = 24,
|
|
12048
|
+
maxWidth,
|
|
12049
|
+
horizontalMargin,
|
|
11854
12050
|
children,
|
|
11855
12051
|
className = '',
|
|
11856
12052
|
trigger
|
|
@@ -11858,6 +12054,40 @@ const DashDialog = ({
|
|
|
11858
12054
|
const {
|
|
11859
12055
|
theme
|
|
11860
12056
|
} = useTheme();
|
|
12057
|
+
// Calculate position and sizing styles
|
|
12058
|
+
const customStyles = {};
|
|
12059
|
+
if (position === 'bottom') {
|
|
12060
|
+
customStyles.bottom = `${bottomOffset}px`;
|
|
12061
|
+
}
|
|
12062
|
+
if (maxWidth) {
|
|
12063
|
+
// Check if it's a Tailwind size (sm, md, lg, xl, 2xl, etc.) or a CSS value
|
|
12064
|
+
const tailwindSizes = {
|
|
12065
|
+
'xs': '320px',
|
|
12066
|
+
'sm': '384px',
|
|
12067
|
+
'md': '448px',
|
|
12068
|
+
'lg': '512px',
|
|
12069
|
+
'xl': '576px',
|
|
12070
|
+
'2xl': '672px',
|
|
12071
|
+
'3xl': '768px',
|
|
12072
|
+
'4xl': '896px',
|
|
12073
|
+
'5xl': '1024px',
|
|
12074
|
+
'6xl': '1152px',
|
|
12075
|
+
'7xl': '1280px'
|
|
12076
|
+
};
|
|
12077
|
+
customStyles.maxWidth = tailwindSizes[maxWidth] || maxWidth;
|
|
12078
|
+
}
|
|
12079
|
+
if (horizontalMargin !== undefined) {
|
|
12080
|
+
// Set max width to viewport width minus margins on both sides
|
|
12081
|
+
const marginConstraint = `calc(100vw - ${horizontalMargin * 2}px)`;
|
|
12082
|
+
if (customStyles.maxWidth) {
|
|
12083
|
+
// If maxWidth is already set, use the smaller of the two
|
|
12084
|
+
customStyles.maxWidth = `min(${customStyles.maxWidth}, ${marginConstraint})`;
|
|
12085
|
+
} else {
|
|
12086
|
+
customStyles.maxWidth = marginConstraint;
|
|
12087
|
+
}
|
|
12088
|
+
// Keep the dialog centered but constrained by the calculated maxWidth
|
|
12089
|
+
// The existing left-[50%] translate-x-[-50%] will handle centering
|
|
12090
|
+
}
|
|
11861
12091
|
const DialogContent = jsxRuntime.jsxs(Portal, {
|
|
11862
12092
|
children: [jsxRuntime.jsx(Overlay, {
|
|
11863
12093
|
className: overlayStyles({
|
|
@@ -11867,11 +12097,15 @@ const DashDialog = ({
|
|
|
11867
12097
|
"aria-describedby": undefined,
|
|
11868
12098
|
className: `${contentStyles({
|
|
11869
12099
|
theme,
|
|
11870
|
-
size
|
|
12100
|
+
size,
|
|
12101
|
+
position
|
|
11871
12102
|
})} ${className}`,
|
|
11872
|
-
|
|
12103
|
+
style: customStyles,
|
|
12104
|
+
children: [title ?
|
|
12105
|
+
// Render visible title in header if provided
|
|
12106
|
+
jsxRuntime.jsxs("div", {
|
|
11873
12107
|
className: headerStyles(),
|
|
11874
|
-
children: [
|
|
12108
|
+
children: [jsxRuntime.jsx(Title, {
|
|
11875
12109
|
className: titleStyles({
|
|
11876
12110
|
theme
|
|
11877
12111
|
}),
|
|
@@ -11890,6 +12124,30 @@ const DashDialog = ({
|
|
|
11890
12124
|
children: "Close"
|
|
11891
12125
|
})]
|
|
11892
12126
|
})]
|
|
12127
|
+
}) :
|
|
12128
|
+
// No title provided - render visually hidden title for accessibility
|
|
12129
|
+
jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
12130
|
+
children: [jsxRuntime.jsx(Title, {
|
|
12131
|
+
children: jsxRuntime.jsx(VisuallyHidden, {
|
|
12132
|
+
children: "Dialog"
|
|
12133
|
+
})
|
|
12134
|
+
}), showCloseButton && jsxRuntime.jsx("div", {
|
|
12135
|
+
className: headerStyles(),
|
|
12136
|
+
children: jsxRuntime.jsxs(Close, {
|
|
12137
|
+
className: closeButtonStyles({
|
|
12138
|
+
theme
|
|
12139
|
+
}),
|
|
12140
|
+
children: [jsxRuntime.jsx("div", {
|
|
12141
|
+
className: 'w-8 h-8 flex items-center justify-center',
|
|
12142
|
+
children: jsxRuntime.jsx(CrossIcon, {
|
|
12143
|
+
size: 16
|
|
12144
|
+
})
|
|
12145
|
+
}), jsxRuntime.jsx("span", {
|
|
12146
|
+
className: 'sr-only',
|
|
12147
|
+
children: "Close"
|
|
12148
|
+
})]
|
|
12149
|
+
})
|
|
12150
|
+
})]
|
|
11893
12151
|
}), children]
|
|
11894
12152
|
})]
|
|
11895
12153
|
});
|
|
@@ -12441,6 +12699,7 @@ const Tabs = ({
|
|
|
12441
12699
|
};
|
|
12442
12700
|
|
|
12443
12701
|
exports.Accordion = Accordion;
|
|
12702
|
+
exports.AirplaneIcon = AirplaneIcon;
|
|
12444
12703
|
exports.ArrowIcon = ArrowIcon;
|
|
12445
12704
|
exports.Avatar = Avatar;
|
|
12446
12705
|
exports.Badge = Badge;
|
|
@@ -12464,6 +12723,7 @@ exports.DeleteIcon = DeleteIcon;
|
|
|
12464
12723
|
exports.Dialog = DashDialog;
|
|
12465
12724
|
exports.EditIcon = EditIcon;
|
|
12466
12725
|
exports.ErrorIcon = ErrorIcon;
|
|
12726
|
+
exports.ExternalLinkIcon = ExternalLinkIcon;
|
|
12467
12727
|
exports.EyeClosedIcon = EyeClosedIcon;
|
|
12468
12728
|
exports.EyeOpenIcon = EyeOpenIcon;
|
|
12469
12729
|
exports.FaceIcon = FaceIcon;
|
|
@@ -12471,6 +12731,7 @@ exports.FilterIcon = FilterIcon;
|
|
|
12471
12731
|
exports.FingerprintIcon = FingerprintIcon;
|
|
12472
12732
|
exports.Heading = Heading;
|
|
12473
12733
|
exports.Identifier = Identifier;
|
|
12734
|
+
exports.InfoCircleIcon = InfoCircleIcon;
|
|
12474
12735
|
exports.Input = Input;
|
|
12475
12736
|
exports.KebabMenuIcon = KebabMenuIcon;
|
|
12476
12737
|
exports.KeyIcon = KeyIcon;
|