dash-ui-kit 1.0.8 → 1.0.92

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.
@@ -25,5 +25,5 @@ export { Dialog, type DialogProps } from './components/dialog';
25
25
  export { Tabs, type TabsProps, type TabItem } from './components/tabs';
26
26
  export type { TimeDeltaFormat } from './utils/datetime';
27
27
  export { ThemeProvider, useTheme, type Theme, type ThemeContextValue, type ThemeProviderProps } from './contexts/ThemeContext';
28
- 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 './components/icons';
28
+ 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 './components/icons';
29
29
  export type { IconProps } from './components/icons';
@@ -1991,6 +1991,83 @@ const SearchIcon = ({
1991
1991
  fill: 'currentColor'
1992
1992
  })
1993
1993
  });
1994
+ const AirplaneIcon = ({
1995
+ color = '#0C1C33',
1996
+ size = 16,
1997
+ className = '',
1998
+ onClick
1999
+ }) => jsx("svg", {
2000
+ width: size,
2001
+ height: size,
2002
+ viewBox: '0 0 16 16',
2003
+ fill: 'none',
2004
+ xmlns: 'http://www.w3.org/2000/svg',
2005
+ className: className,
2006
+ onClick: onClick,
2007
+ color: color,
2008
+ children: jsx("path", {
2009
+ 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',
2010
+ stroke: 'currentColor',
2011
+ strokeLinecap: 'round',
2012
+ strokeLinejoin: 'round'
2013
+ })
2014
+ });
2015
+ const ExternalLinkIcon = ({
2016
+ color = '#0C1C33',
2017
+ size = 16,
2018
+ className = '',
2019
+ onClick
2020
+ }) => jsx("svg", {
2021
+ width: size,
2022
+ height: size,
2023
+ viewBox: '0 0 16 16',
2024
+ fill: 'none',
2025
+ xmlns: 'http://www.w3.org/2000/svg',
2026
+ className: className,
2027
+ onClick: onClick,
2028
+ color: color,
2029
+ children: jsx("path", {
2030
+ 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',
2031
+ stroke: 'currentColor',
2032
+ strokeLinecap: 'round',
2033
+ strokeLinejoin: 'round'
2034
+ })
2035
+ });
2036
+ const InfoCircleIcon = ({
2037
+ color = '#4C7EFF',
2038
+ size = 19,
2039
+ className = '',
2040
+ onClick
2041
+ }) => jsxs("svg", {
2042
+ width: size,
2043
+ height: size,
2044
+ viewBox: '0 0 19 19',
2045
+ fill: 'none',
2046
+ xmlns: 'http://www.w3.org/2000/svg',
2047
+ className: className,
2048
+ onClick: onClick,
2049
+ color: color,
2050
+ children: [jsxs("g", {
2051
+ clipPath: 'url(#clip0_1166_258)',
2052
+ children: [jsx("path", {
2053
+ 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',
2054
+ fill: 'currentColor',
2055
+ fillOpacity: '0.05'
2056
+ }), jsx("path", {
2057
+ 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',
2058
+ fill: 'currentColor'
2059
+ })]
2060
+ }), jsx("defs", {
2061
+ children: jsx("clipPath", {
2062
+ id: 'clip0_1166_258',
2063
+ children: jsx("rect", {
2064
+ width: '19',
2065
+ height: '19',
2066
+ fill: 'white'
2067
+ })
2068
+ })
2069
+ })]
2070
+ });
1994
2071
 
1995
2072
  const accordionRootStyles = cva(`
1996
2073
  w-full
@@ -2996,7 +3073,7 @@ const textStyles = cva('', {
2996
3073
  },
2997
3074
  weight: {
2998
3075
  normal: 'font-normal',
2999
- 500: 'font-medium',
3076
+ medium: 'font-medium',
3000
3077
  bold: 'font-bold'
3001
3078
  },
3002
3079
  italic: {
@@ -6242,7 +6319,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
6242
6319
  wordWrap: "normal"
6243
6320
  });
6244
6321
  var NAME = "VisuallyHidden";
6245
- var VisuallyHidden = React.forwardRef(
6322
+ var VisuallyHidden$1 = React.forwardRef(
6246
6323
  (props, forwardedRef) => {
6247
6324
  return /* @__PURE__ */ jsx(
6248
6325
  Primitive.span,
@@ -6254,7 +6331,7 @@ var VisuallyHidden = React.forwardRef(
6254
6331
  );
6255
6332
  }
6256
6333
  );
6257
- VisuallyHidden.displayName = NAME;
6334
+ VisuallyHidden$1.displayName = NAME;
6258
6335
 
6259
6336
  var getDefaultParent = function (originalTarget) {
6260
6337
  if (typeof document === 'undefined') {
@@ -8265,7 +8342,7 @@ const selectTrigger = cva('w-full transition-all font-inter appearance-none curs
8265
8342
  disabled: false
8266
8343
  }
8267
8344
  });
8268
- const selectContent = cva('overflow-hidden z-50 rounded-md shadow-lg min-w-[var(--radix-select-trigger-width)] w-full', {
8345
+ const selectContent = 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)]', {
8269
8346
  variants: {
8270
8347
  theme: {
8271
8348
  light: 'bg-white border border-gray-200',
@@ -8273,6 +8350,7 @@ const selectContent = cva('overflow-hidden z-50 rounded-md shadow-lg min-w-[var(
8273
8350
  }
8274
8351
  }
8275
8352
  });
8353
+ const selectViewport = cva('overflow-y-auto max-h-[inherit]');
8276
8354
  const selectItem = cva('relative flex cursor-pointer select-none items-center outline-none focus:bg-gray-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50', {
8277
8355
  variants: {
8278
8356
  theme: {
@@ -8361,6 +8439,7 @@ const Select = _a => {
8361
8439
  const contentClasses = selectContent({
8362
8440
  theme
8363
8441
  });
8442
+ const viewportClasses = selectViewport({});
8364
8443
  const itemClasses = selectItem({
8365
8444
  theme,
8366
8445
  size
@@ -8393,6 +8472,7 @@ const Select = _a => {
8393
8472
  position: 'popper',
8394
8473
  sideOffset: 5,
8395
8474
  children: jsx(Viewport, {
8475
+ className: viewportClasses,
8396
8476
  children: options.map(option => jsx(Item$1, {
8397
8477
  value: option.value,
8398
8478
  className: itemClasses,
@@ -8912,7 +8992,7 @@ const overlayMenuTrigger = cva('w-full transition-all font-inter appearance-none
8912
8992
  filled: false
8913
8993
  }
8914
8994
  });
8915
- const overlayContent = cva('absolute z-50 min-w-full overflow-hidden shadow-lg', {
8995
+ const overlayContent = cva('absolute z-50 overflow-hidden', {
8916
8996
  variants: {
8917
8997
  theme: {
8918
8998
  light: 'bg-white border border-[rgba(12,28,51,0.05)]',
@@ -8920,22 +9000,55 @@ const overlayContent = cva('absolute z-50 min-w-full overflow-hidden shadow-lg',
8920
9000
  },
8921
9001
  size: {
8922
9002
  sm: 'rounded-[0.625rem]',
8923
- md: 'rounded-[0.875rem]',
8924
- xl: 'rounded-[1rem]'
9003
+ md: 'rounded-[0.75rem]',
9004
+ xl: 'rounded-[0.9375rem]'
9005
+ },
9006
+ variant: {
9007
+ dropdown: 'min-w-full',
9008
+ 'context-menu': 'w-[200px]'
9009
+ },
9010
+ hasShadow: {
9011
+ true: 'shadow-[0px_0px_75px_0px_rgba(0,0,0,0.15)]',
9012
+ false: 'shadow-lg'
9013
+ }
9014
+ },
9015
+ defaultVariants: {
9016
+ variant: 'dropdown',
9017
+ hasShadow: false
9018
+ }
9019
+ });
9020
+ const overlayHeader = cva('flex items-center justify-between border-b gap-2', {
9021
+ variants: {
9022
+ theme: {
9023
+ light: 'border-[rgba(12,28,51,0.05)]',
9024
+ dark: 'border-[rgba(255,255,255,0.15)]'
9025
+ },
9026
+ size: {
9027
+ sm: 'px-[0.875rem] py-[0.375rem]',
9028
+ md: 'px-[1rem] py-[0.5rem]',
9029
+ xl: 'px-[1.125rem] py-[0.5rem]'
8925
9030
  }
9031
+ },
9032
+ defaultVariants: {
9033
+ theme: 'light',
9034
+ size: 'xl'
8926
9035
  }
8927
9036
  });
8928
- const overlayItem = cva('relative flex cursor-pointer select-none items-center outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 rounded-none', {
9037
+ const overlayItem = 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]', {
8929
9038
  variants: {
8930
9039
  theme: {
8931
9040
  light: 'text-[#0C1C33] hover:bg-gray-50',
8932
9041
  dark: 'text-white hover:bg-[rgba(255,255,255,0.1)]'
8933
9042
  },
8934
9043
  size: {
8935
- sm: 'dash-block-sm',
8936
- md: 'dash-block-md',
8937
- xl: 'dash-block-xl'
9044
+ sm: 'px-[0.875rem] py-[0.625rem]',
9045
+ md: 'px-[1rem] py-[0.6875rem]',
9046
+ xl: 'px-[1.125rem] py-[0.75rem]'
8938
9047
  }
9048
+ },
9049
+ defaultVariants: {
9050
+ theme: 'light',
9051
+ size: 'xl'
8939
9052
  }
8940
9053
  });
8941
9054
  // Arrow icon
@@ -8958,10 +9071,17 @@ const ChevronDownIcon = ({
8958
9071
  /**
8959
9072
  * Overlay menu component that opens above the trigger with overlay positioning.
8960
9073
  * Supports custom content items with onClick handlers.
9074
+ *
9075
+ * @param variant - 'dropdown' (default) or 'context-menu'
9076
+ * @param headerContent - Custom header content (for context-menu variant)
9077
+ * @param showCloseButton - Show close button in header
9078
+ * @param position - Position object for context-menu variant
9079
+ * @param width - Custom width (default: 200px for context-menu)
8961
9080
  */
8962
9081
  const OverlayMenu = _a => {
8963
9082
  var {
8964
9083
  className = '',
9084
+ contentClassName = '',
8965
9085
  colorScheme,
8966
9086
  size,
8967
9087
  error = false,
@@ -8976,9 +9096,15 @@ const OverlayMenu = _a => {
8976
9096
  maxHeight = '200px',
8977
9097
  triggerContent,
8978
9098
  placeholder = 'Menu',
8979
- showItemBorders = true
9099
+ showItemBorders = true,
9100
+ variant = 'dropdown',
9101
+ headerContent,
9102
+ showCloseButton = false,
9103
+ position,
9104
+ width,
9105
+ onClose
8980
9106
  } = _a,
8981
- props = __rest(_a, ["className", "colorScheme", "size", "error", "success", "border", "filled", "disabled", "items", "showArrow", "name", "overlayLabel", "maxHeight", "triggerContent", "placeholder", "showItemBorders"]);
9107
+ props = __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"]);
8982
9108
  const {
8983
9109
  theme
8984
9110
  } = useTheme();
@@ -8987,6 +9113,22 @@ const OverlayMenu = _a => {
8987
9113
  // Determine color scheme based on state
8988
9114
  let finalColorScheme = colorScheme;
8989
9115
  if (error) finalColorScheme = 'error';else if (success) finalColorScheme = 'success';
9116
+ const isContextMenu = variant === 'context-menu';
9117
+ // Handle Escape key
9118
+ useEffect(() => {
9119
+ if (!isOpen) return;
9120
+ const handleEscape = e => {
9121
+ if (e.key === 'Escape') {
9122
+ handleClose();
9123
+ }
9124
+ };
9125
+ document.addEventListener('keydown', handleEscape);
9126
+ return () => document.removeEventListener('keydown', handleEscape);
9127
+ }, [isOpen]);
9128
+ const handleClose = () => {
9129
+ setIsOpen(false);
9130
+ onClose === null || onClose === void 0 ? void 0 : onClose();
9131
+ };
8990
9132
  const triggerClasses = overlayMenuTrigger({
8991
9133
  theme,
8992
9134
  colorScheme: finalColorScheme,
@@ -8996,6 +9138,12 @@ const OverlayMenu = _a => {
8996
9138
  disabled
8997
9139
  }) + ' ' + className;
8998
9140
  const contentClasses = overlayContent({
9141
+ theme,
9142
+ size,
9143
+ variant,
9144
+ hasShadow: isContextMenu
9145
+ });
9146
+ const headerClasses = overlayHeader({
8999
9147
  theme,
9000
9148
  size
9001
9149
  });
@@ -9007,11 +9155,28 @@ const OverlayMenu = _a => {
9007
9155
  if (!item.disabled && item.onClick) {
9008
9156
  item.onClick();
9009
9157
  }
9010
- setIsOpen(false);
9158
+ handleClose();
9159
+ };
9160
+ // For context-menu variant, show menu immediately if position is provided
9161
+ useEffect(() => {
9162
+ if (isContextMenu && position) {
9163
+ setIsOpen(true);
9164
+ }
9165
+ }, [isContextMenu, position]);
9166
+ // Calculate position styles for context-menu
9167
+ const getPositionStyles = () => {
9168
+ if (!isContextMenu || !position) return {};
9169
+ const styles = {};
9170
+ if (position.top !== undefined) styles.top = position.top;
9171
+ if (position.left !== undefined) styles.left = position.left;
9172
+ if (position.right !== undefined) styles.right = position.right;
9173
+ if (position.bottom !== undefined) styles.bottom = position.bottom;
9174
+ if (width) styles.width = typeof width === 'number' ? `${width}px` : width;
9175
+ return styles;
9011
9176
  };
9012
9177
  return jsxs("div", {
9013
- className: 'relative',
9014
- children: [jsxs("button", Object.assign({
9178
+ className: isContextMenu ? '' : 'relative',
9179
+ children: [!isContextMenu && jsxs("button", Object.assign({
9015
9180
  ref: triggerRef,
9016
9181
  type: 'button',
9017
9182
  className: triggerClasses,
@@ -9030,35 +9195,33 @@ const OverlayMenu = _a => {
9030
9195
  })]
9031
9196
  })), isOpen && jsxs(Fragment, {
9032
9197
  children: [jsx("div", {
9033
- className: 'fixed inset-0 z-40',
9034
- onClick: () => setIsOpen(false)
9198
+ className: `${isContextMenu ? 'fixed' : 'fixed'} inset-0 z-40`,
9199
+ onClick: handleClose
9035
9200
  }), jsxs("div", {
9036
- className: `${contentClasses} top-0 left-0 right-0 overflow-y-auto`,
9037
- style: {
9201
+ className: `${contentClasses} ${isContextMenu ? 'fixed' : ''} ${!isContextMenu ? 'top-0 left-0 right-0' : ''} overflow-y-auto ${contentClassName}`,
9202
+ style: Object.assign({
9038
9203
  maxHeight
9039
- },
9040
- children: [overlayLabel && jsxs("div", {
9041
- className: `${itemClasses} font-medium border-b rounded-b-none cursor-pointer ${theme === 'dark' ? 'border-[rgba(255,255,255,0.15)]' : 'border-[rgba(12,28,51,0.05)]'}`,
9042
- onClick: () => setIsOpen(false),
9204
+ }, getPositionStyles()),
9205
+ children: [(headerContent || overlayLabel) && jsxs("div", {
9206
+ className: `${headerClasses} ${!showCloseButton && !isContextMenu ? 'cursor-pointer' : ''}`,
9207
+ onClick: !showCloseButton && !isContextMenu ? handleClose : undefined,
9043
9208
  children: [jsx("div", {
9044
9209
  className: 'w-full flex-1',
9045
- children: overlayLabel
9046
- }), jsx("div", {
9047
- className: 'flex items-center pl-1',
9210
+ children: headerContent || overlayLabel
9211
+ }), (showCloseButton || isContextMenu && headerContent) && jsx("button", {
9212
+ className: 'flex items-center cursor-pointer hover:opacity-70 transition-opacity',
9213
+ onClick: handleClose,
9214
+ "aria-label": 'Close menu',
9048
9215
  children: jsx(CrossIcon, {
9049
9216
  size: 16,
9050
- color: theme === 'dark' ? '#FFFFFF' : '#0C1C33',
9051
- className: 'cursor-pointer'
9217
+ color: theme === 'dark' ? '#FFFFFF' : '#0C1C33'
9052
9218
  })
9053
9219
  })]
9054
9220
  }), jsx("div", {
9055
9221
  children: items.map((item, index) => jsx("div", {
9056
- 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)]'}` : ''}`,
9222
+ 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)]'}` : ''}`,
9057
9223
  onClick: () => handleItemClick(item),
9058
- children: jsx("div", {
9059
- className: 'w-full flex-1',
9060
- children: item.content
9061
- })
9224
+ children: item.content
9062
9225
  }, item.id))
9063
9226
  })]
9064
9227
  })]
@@ -9350,7 +9513,7 @@ const List$1 = ({
9350
9513
  className: 'flex flex-col gap-1',
9351
9514
  children: [jsx(Text, {
9352
9515
  size: size,
9353
- weight: 500,
9516
+ weight: "medium",
9354
9517
  children: item.text
9355
9518
  }), item.description && jsx(Text, {
9356
9519
  size: 'xs',
@@ -9384,27 +9547,41 @@ const bigNumberStyles = cva('inline-flex whitespace-nowrap gap-1', {
9384
9547
  const BigNumber = ({
9385
9548
  children,
9386
9549
  variant = 'space',
9387
- className = ''
9550
+ className = '',
9551
+ decimalPointSpacing = -2
9388
9552
  }) => {
9389
9553
  const {
9390
9554
  theme
9391
9555
  } = useTheme();
9556
+ const decimalPointStyle = {
9557
+ marginLeft: `${decimalPointSpacing}px`,
9558
+ marginRight: `${decimalPointSpacing}px`
9559
+ };
9392
9560
  if (children === undefined || children === null) return null;
9393
9561
  const str = children.toString();
9394
9562
  if (variant === 'space') {
9395
- // group digits every 3, right to left
9396
- const groups = str.split('').reverse().reduce((acc, char, idx) => {
9563
+ // Split into integer and decimal parts
9564
+ const [intPart, fracPart] = str.split('.');
9565
+ // group digits every 3, right to left (only for integer part)
9566
+ const groups = intPart.split('').reverse().reduce((acc, char, idx) => {
9397
9567
  if (idx % 3 === 0) acc.unshift('');
9398
9568
  acc[0] = char + acc[0];
9399
9569
  return acc;
9400
9570
  }, []);
9401
- return jsx("span", {
9571
+ return jsxs("span", {
9402
9572
  className: `${bigNumberStyles({
9403
9573
  theme
9404
9574
  })} ${className}`,
9405
- children: groups.map((grp, i) => jsx("span", {
9575
+ children: [groups.map((grp, i) => jsx("span", {
9406
9576
  children: grp
9407
- }, i))
9577
+ }, i)), fracPart != null && jsxs(Fragment, {
9578
+ children: [jsx("span", {
9579
+ style: decimalPointStyle,
9580
+ children: "."
9581
+ }), jsx("span", {
9582
+ children: fracPart
9583
+ })]
9584
+ })]
9408
9585
  });
9409
9586
  } else {
9410
9587
  // comma variant
@@ -9426,6 +9603,7 @@ const BigNumber = ({
9426
9603
  })]
9427
9604
  }, i)), fracPart != null && jsxs(Fragment, {
9428
9605
  children: [jsx("span", {
9606
+ style: decimalPointStyle,
9429
9607
  children: "."
9430
9608
  }), jsx("span", {
9431
9609
  children: fracPart
@@ -11726,6 +11904,24 @@ var Content$1 = DialogContent;
11726
11904
  var Title = DialogTitle;
11727
11905
  var Close = DialogClose;
11728
11906
 
11907
+ // Visually hidden component for accessibility
11908
+ const VisuallyHidden = ({
11909
+ children
11910
+ }) => jsx("span", {
11911
+ style: {
11912
+ position: 'absolute',
11913
+ border: 0,
11914
+ width: 1,
11915
+ height: 1,
11916
+ padding: 0,
11917
+ margin: -1,
11918
+ overflow: 'hidden',
11919
+ clip: 'rect(0, 0, 0, 0)',
11920
+ whiteSpace: 'nowrap',
11921
+ wordWrap: 'normal'
11922
+ },
11923
+ children: children
11924
+ });
11729
11925
  const overlayStyles = cva(`
11730
11926
  fixed
11731
11927
  inset-0
@@ -11746,11 +11942,9 @@ const overlayStyles = cva(`
11746
11942
  const contentStyles = cva(`
11747
11943
  fixed
11748
11944
  left-[50%]
11749
- top-[50%]
11750
11945
  z-50
11751
11946
  w-full
11752
11947
  translate-x-[-50%]
11753
- translate-y-[-50%]
11754
11948
  flex
11755
11949
  flex-col
11756
11950
  gap-4
@@ -11763,10 +11957,6 @@ const contentStyles = cva(`
11763
11957
  data-[state=open]:fade-in-0
11764
11958
  data-[state=closed]:zoom-out-95
11765
11959
  data-[state=open]:zoom-in-95
11766
- data-[state=closed]:slide-out-to-left-1/2
11767
- data-[state=closed]:slide-out-to-top-[48%]
11768
- data-[state=open]:slide-in-from-left-1/2
11769
- data-[state=open]:slide-in-from-top-[48%]
11770
11960
  sm:rounded-lg
11771
11961
  font-dash-main
11772
11962
  `, {
@@ -11779,10 +11969,27 @@ const contentStyles = cva(`
11779
11969
  sm: 'dash-block-sm',
11780
11970
  md: 'dash-block-md',
11781
11971
  xl: 'dash-block-xl'
11972
+ },
11973
+ position: {
11974
+ center: `
11975
+ top-[50%]
11976
+ translate-y-[-50%]
11977
+ data-[state=closed]:slide-out-to-left-1/2
11978
+ data-[state=closed]:slide-out-to-top-[48%]
11979
+ data-[state=open]:slide-in-from-left-1/2
11980
+ data-[state=open]:slide-in-from-top-[48%]
11981
+ `,
11982
+ bottom: `
11983
+ data-[state=closed]:slide-out-to-left-1/2
11984
+ data-[state=closed]:slide-out-to-bottom-full
11985
+ data-[state=open]:slide-in-from-left-1/2
11986
+ data-[state=open]:slide-in-from-bottom-full
11987
+ `
11782
11988
  }
11783
11989
  },
11784
11990
  defaultVariants: {
11785
- size: 'md'
11991
+ size: 'md',
11992
+ position: 'center'
11786
11993
  }
11787
11994
  });
11788
11995
  const headerStyles = cva(`
@@ -11831,6 +12038,10 @@ const DashDialog = ({
11831
12038
  title,
11832
12039
  showCloseButton = true,
11833
12040
  size = 'md',
12041
+ position = 'center',
12042
+ bottomOffset = 24,
12043
+ maxWidth,
12044
+ horizontalMargin,
11834
12045
  children,
11835
12046
  className = '',
11836
12047
  trigger
@@ -11838,6 +12049,40 @@ const DashDialog = ({
11838
12049
  const {
11839
12050
  theme
11840
12051
  } = useTheme();
12052
+ // Calculate position and sizing styles
12053
+ const customStyles = {};
12054
+ if (position === 'bottom') {
12055
+ customStyles.bottom = `${bottomOffset}px`;
12056
+ }
12057
+ if (maxWidth) {
12058
+ // Check if it's a Tailwind size (sm, md, lg, xl, 2xl, etc.) or a CSS value
12059
+ const tailwindSizes = {
12060
+ 'xs': '320px',
12061
+ 'sm': '384px',
12062
+ 'md': '448px',
12063
+ 'lg': '512px',
12064
+ 'xl': '576px',
12065
+ '2xl': '672px',
12066
+ '3xl': '768px',
12067
+ '4xl': '896px',
12068
+ '5xl': '1024px',
12069
+ '6xl': '1152px',
12070
+ '7xl': '1280px'
12071
+ };
12072
+ customStyles.maxWidth = tailwindSizes[maxWidth] || maxWidth;
12073
+ }
12074
+ if (horizontalMargin !== undefined) {
12075
+ // Set max width to viewport width minus margins on both sides
12076
+ const marginConstraint = `calc(100vw - ${horizontalMargin * 2}px)`;
12077
+ if (customStyles.maxWidth) {
12078
+ // If maxWidth is already set, use the smaller of the two
12079
+ customStyles.maxWidth = `min(${customStyles.maxWidth}, ${marginConstraint})`;
12080
+ } else {
12081
+ customStyles.maxWidth = marginConstraint;
12082
+ }
12083
+ // Keep the dialog centered but constrained by the calculated maxWidth
12084
+ // The existing left-[50%] translate-x-[-50%] will handle centering
12085
+ }
11841
12086
  const DialogContent = jsxs(Portal, {
11842
12087
  children: [jsx(Overlay, {
11843
12088
  className: overlayStyles({
@@ -11847,11 +12092,15 @@ const DashDialog = ({
11847
12092
  "aria-describedby": undefined,
11848
12093
  className: `${contentStyles({
11849
12094
  theme,
11850
- size
12095
+ size,
12096
+ position
11851
12097
  })} ${className}`,
11852
- children: [(title || showCloseButton) && jsxs("div", {
12098
+ style: customStyles,
12099
+ children: [title ?
12100
+ // Render visible title in header if provided
12101
+ jsxs("div", {
11853
12102
  className: headerStyles(),
11854
- children: [title && jsx(Title, {
12103
+ children: [jsx(Title, {
11855
12104
  className: titleStyles({
11856
12105
  theme
11857
12106
  }),
@@ -11870,6 +12119,30 @@ const DashDialog = ({
11870
12119
  children: "Close"
11871
12120
  })]
11872
12121
  })]
12122
+ }) :
12123
+ // No title provided - render visually hidden title for accessibility
12124
+ jsxs(Fragment, {
12125
+ children: [jsx(Title, {
12126
+ children: jsx(VisuallyHidden, {
12127
+ children: "Dialog"
12128
+ })
12129
+ }), showCloseButton && jsx("div", {
12130
+ className: headerStyles(),
12131
+ children: jsxs(Close, {
12132
+ className: closeButtonStyles({
12133
+ theme
12134
+ }),
12135
+ children: [jsx("div", {
12136
+ className: 'w-8 h-8 flex items-center justify-center',
12137
+ children: jsx(CrossIcon, {
12138
+ size: 16
12139
+ })
12140
+ }), jsx("span", {
12141
+ className: 'sr-only',
12142
+ children: "Close"
12143
+ })]
12144
+ })
12145
+ })]
11873
12146
  }), children]
11874
12147
  })]
11875
12148
  });
@@ -12420,5 +12693,5 @@ const Tabs = ({
12420
12693
  });
12421
12694
  };
12422
12695
 
12423
- export { Accordion, ArrowIcon, Avatar, Badge, BigNumber, BroadcastedIcon, BurgerMenuIcon, Button, CalendarIcon, ChainSmallIcon, CheckIcon, CheckmarkIcon, ChevronIcon, CircleProcessIcon, CopyButton, CopyIcon, CreditsIcon, CrossIcon, DashLogo, DateBlock, DeleteIcon, DashDialog as Dialog, EditIcon, ErrorIcon, EyeClosedIcon, EyeOpenIcon, FaceIcon, FilterIcon, FingerprintIcon, Heading, Identifier, Input, KebabMenuIcon, KeyIcon, List$1 as List, LockIcon, NotActive, OverlayMenu, OverlaySelect, PendingIcon, PlusIcon, PooledIcon, ProgressStepBar, ProtectedMessageIcon, QuestionMessageIcon, QueuedIcon, SearchIcon, Select, SettingsIcon, ShieldSmallIcon, SignIcon, SignLockIcon, SmartphoneIcon, SuccessIcon, Switch, Tabs, Text, Textarea, ThemeProvider, TimeDelta, TransactionStatusIcon, ValueCard, WalletIcon, WebIcon, useTheme };
12696
+ export { Accordion, AirplaneIcon, ArrowIcon, Avatar, Badge, BigNumber, BroadcastedIcon, BurgerMenuIcon, Button, CalendarIcon, ChainSmallIcon, CheckIcon, CheckmarkIcon, ChevronIcon, CircleProcessIcon, CopyButton, CopyIcon, CreditsIcon, CrossIcon, DashLogo, DateBlock, DeleteIcon, DashDialog as Dialog, EditIcon, ErrorIcon, ExternalLinkIcon, EyeClosedIcon, EyeOpenIcon, FaceIcon, FilterIcon, FingerprintIcon, Heading, Identifier, InfoCircleIcon, Input, KebabMenuIcon, KeyIcon, List$1 as List, LockIcon, NotActive, OverlayMenu, OverlaySelect, PendingIcon, PlusIcon, PooledIcon, ProgressStepBar, ProtectedMessageIcon, QuestionMessageIcon, QueuedIcon, SearchIcon, Select, SettingsIcon, ShieldSmallIcon, SignIcon, SignLockIcon, SmartphoneIcon, SuccessIcon, Switch, Tabs, Text, Textarea, ThemeProvider, TimeDelta, TransactionStatusIcon, ValueCard, WalletIcon, WebIcon, useTheme };
12424
12697
  //# sourceMappingURL=index.esm.js.map