@databricks/design-system 1.12.13 → 1.12.14

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.
Files changed (105) hide show
  1. package/dist/{DropdownMenu-dbeef1b7.js → Stepper-839336b1.js} +367 -602
  2. package/dist/Stepper-839336b1.js.map +1 -0
  3. package/dist/design-system/AutoComplete/AutoComplete.d.ts +3 -0
  4. package/dist/design-system/AutoComplete/AutoComplete.d.ts.map +1 -1
  5. package/dist/design-system/Button/Button.d.ts +11 -2
  6. package/dist/design-system/Button/Button.d.ts.map +1 -1
  7. package/dist/design-system/Checkbox/Checkbox.d.ts.map +1 -1
  8. package/dist/design-system/ContextMenu/ContextMenu.d.ts.map +1 -0
  9. package/dist/design-system/ContextMenu/index.d.ts +2 -0
  10. package/dist/design-system/ContextMenu/index.d.ts.map +1 -0
  11. package/dist/design-system/DatePicker/DatePicker.d.ts.map +1 -1
  12. package/dist/design-system/DesignSystemEventProvider/DesignSystemEventProvider.d.ts +1 -0
  13. package/dist/design-system/DesignSystemEventProvider/DesignSystemEventProvider.d.ts.map +1 -1
  14. package/dist/design-system/DialogCombobox/DialogComboboxAddButton.d.ts +1 -1
  15. package/dist/design-system/DialogCombobox/DialogComboboxAddButton.d.ts.map +1 -1
  16. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSearch.d.ts +9 -5
  17. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSearch.d.ts.map +1 -1
  18. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts +1 -1
  19. package/dist/design-system/DialogCombobox/DialogComboboxOptionListSelectItem.d.ts.map +1 -1
  20. package/dist/design-system/DialogCombobox/DialogComboboxTrigger.d.ts.map +1 -1
  21. package/dist/design-system/Drawer/Drawer.d.ts.map +1 -1
  22. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts +1 -2
  23. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  24. package/dist/design-system/FormV2/RHFAdapters.d.ts +1 -1
  25. package/dist/design-system/FormV2/RHFAdapters.d.ts.map +1 -1
  26. package/dist/design-system/Header/Header.d.ts.map +1 -1
  27. package/dist/design-system/Input/Input.d.ts +9 -1
  28. package/dist/design-system/Input/Input.d.ts.map +1 -1
  29. package/dist/design-system/Input/index.d.ts +2 -1
  30. package/dist/design-system/Input/index.d.ts.map +1 -1
  31. package/dist/design-system/Modal/Modal.d.ts +2 -2
  32. package/dist/design-system/Modal/Modal.d.ts.map +1 -1
  33. package/dist/design-system/Notification/Notification.d.ts.map +1 -1
  34. package/dist/design-system/Pagination/index.d.ts +8 -1
  35. package/dist/design-system/Pagination/index.d.ts.map +1 -1
  36. package/dist/design-system/Popover/InfoPopover.d.ts +2 -1
  37. package/dist/design-system/Popover/InfoPopover.d.ts.map +1 -1
  38. package/dist/design-system/Select/Select.d.ts.map +1 -1
  39. package/dist/design-system/Sidebar/Sidebar.d.ts.map +1 -1
  40. package/dist/design-system/SplitButton/Dropdown/DropdownButton.d.ts.map +1 -1
  41. package/dist/design-system/SplitButton/SplitButton.d.ts.map +1 -1
  42. package/dist/design-system/Switch/Switch.d.ts.map +1 -1
  43. package/dist/design-system/TableUI/TableFilterInput.d.ts +2 -1
  44. package/dist/design-system/TableUI/TableFilterInput.d.ts.map +1 -1
  45. package/dist/design-system/TableUI/TableFilterLayout.d.ts.map +1 -1
  46. package/dist/design-system/Tooltip/Tooltip.d.ts +6 -0
  47. package/dist/design-system/Tooltip/Tooltip.d.ts.map +1 -1
  48. package/dist/design-system/Tree/Tree.d.ts.map +1 -1
  49. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxAddButton.d.ts +3 -0
  50. package/dist/design-system/TypeaheadCombobox/TypeaheadComboboxAddButton.d.ts.map +1 -0
  51. package/dist/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts +3 -1
  52. package/dist/design-system/TypeaheadCombobox/hooks/downshiftHookWrappers.d.ts.map +1 -1
  53. package/dist/design-system/TypeaheadCombobox/index.d.ts +1 -0
  54. package/dist/design-system/TypeaheadCombobox/index.d.ts.map +1 -1
  55. package/dist/design-system/Wizard/Wizard.d.ts +74 -0
  56. package/dist/design-system/Wizard/Wizard.d.ts.map +1 -0
  57. package/dist/design-system/Wizard/WizardFooter.d.ts +15 -0
  58. package/dist/design-system/Wizard/WizardFooter.d.ts.map +1 -0
  59. package/dist/design-system/Wizard/WizardModal.d.ts +7 -0
  60. package/dist/design-system/Wizard/WizardModal.d.ts.map +1 -0
  61. package/dist/design-system/Wizard/WizardStep.d.ts +71 -0
  62. package/dist/design-system/Wizard/WizardStep.d.ts.map +1 -0
  63. package/dist/design-system/Wizard/WizardStepsContent.d.ts +10 -0
  64. package/dist/design-system/Wizard/WizardStepsContent.d.ts.map +1 -0
  65. package/dist/design-system/Wizard/index.d.ts +5 -0
  66. package/dist/design-system/Wizard/index.d.ts.map +1 -0
  67. package/dist/design-system/Wizard/useWizardCurrentStep.d.ts +20 -0
  68. package/dist/design-system/Wizard/useWizardCurrentStep.d.ts.map +1 -0
  69. package/dist/design-system/_shared_/Combobox/styles.d.ts +9 -0
  70. package/dist/design-system/_shared_/Combobox/styles.d.ts.map +1 -1
  71. package/dist/design-system/index.d.ts +2 -0
  72. package/dist/design-system/index.d.ts.map +1 -1
  73. package/dist/design-system/utils/safex.d.ts +3 -2
  74. package/dist/design-system/utils/safex.d.ts.map +1 -1
  75. package/dist/design-system/utils/useNotifyOnFirstView.d.ts +15 -0
  76. package/dist/design-system/utils/useNotifyOnFirstView.d.ts.map +1 -0
  77. package/dist/development/Banner/Banner.d.ts +15 -4
  78. package/dist/development/Banner/Banner.d.ts.map +1 -1
  79. package/dist/development/ChatUI/ChatInput.d.ts.map +1 -1
  80. package/dist/development/ChatUI/Feedback.d.ts.map +1 -1
  81. package/dist/development/Stepper/Stepper.d.ts +62 -0
  82. package/dist/development/Stepper/Stepper.d.ts.map +1 -0
  83. package/dist/development/Stepper/index.d.ts +2 -0
  84. package/dist/development/Stepper/index.d.ts.map +1 -0
  85. package/dist/development/index.d.ts +1 -1
  86. package/dist/development/index.d.ts.map +1 -1
  87. package/dist/development.js +111 -228
  88. package/dist/development.js.map +1 -1
  89. package/dist/dubois-colors.less +54 -56
  90. package/dist/index-dark.css +193 -193
  91. package/dist/index.css +109 -109
  92. package/dist/index.js +1734 -511
  93. package/dist/index.js.map +1 -1
  94. package/dist/theme/_generated/SemanticColors-Dark.d.ts.map +1 -1
  95. package/dist/theme/_generated/SemanticColors-Light.d.ts.map +1 -1
  96. package/dist/theme/_generated/ValidSemanticColors.d.ts +0 -1
  97. package/dist/theme/_generated/ValidSemanticColors.d.ts.map +1 -1
  98. package/dist/theme/spacing.d.ts +1 -0
  99. package/dist/theme/spacing.d.ts.map +1 -1
  100. package/package.json +1 -1
  101. package/dist/DropdownMenu-dbeef1b7.js.map +0 -1
  102. package/dist/development/ContextMenu/ContextMenu.d.ts.map +0 -1
  103. package/dist/development/ContextMenu/index.d.ts +0 -2
  104. package/dist/development/ContextMenu/index.d.ts.map +0 -1
  105. /package/dist/{development → design-system}/ContextMenu/ContextMenu.d.ts +0 -0
@@ -1,8 +1,8 @@
1
- import React__default, { createContext, useContext, useMemo, useEffect, useState, forwardRef, useRef, useLayoutEffect, useImperativeHandle, Children } from 'react';
1
+ import React__default, { createContext, useContext, useMemo, useEffect, useState, forwardRef, useRef, useLayoutEffect, useImperativeHandle } from 'react';
2
2
  import { jsx, Fragment, jsxs } from '@emotion/react/jsx-runtime';
3
3
  import { useTheme, ThemeProvider, css, keyframes } from '@emotion/react';
4
- import { notification, ConfigProvider, Button as Button$1, Typography as Typography$1, Tooltip as Tooltip$1, Input as Input$2 } from 'antd';
5
- import * as DropdownMenu$1 from '@radix-ui/react-dropdown-menu';
4
+ import { notification, ConfigProvider, Button as Button$1, Typography as Typography$1, Input as Input$2 } from 'antd';
5
+ import AntDIcon from '@ant-design/icons';
6
6
  import _isNil from 'lodash/isNil';
7
7
  import _endsWith from 'lodash/endsWith';
8
8
  import _isBoolean from 'lodash/isBoolean';
@@ -11,7 +11,6 @@ import _isString from 'lodash/isString';
11
11
  import _mapValues from 'lodash/mapValues';
12
12
  import _memoize from 'lodash/memoize';
13
13
  import unitless from '@emotion/unitless';
14
- import AntDIcon from '@ant-design/icons';
15
14
 
16
15
  /**
17
16
  * Used to hide text visually, but still be readable by screen-readers
@@ -181,7 +180,6 @@ let ValidSemanticColors = /*#__PURE__*/function (ValidSemanticColors) {
181
180
  ValidSemanticColors["ActionTertiaryTextHover"] = "actionTertiaryTextHover";
182
181
  ValidSemanticColors["ActionTertiaryTextPress"] = "actionTertiaryTextPress";
183
182
  ValidSemanticColors["BackgroundDanger"] = "backgroundDanger";
184
- ValidSemanticColors["BackgroundInfo"] = "backgroundInfo";
185
183
  ValidSemanticColors["BackgroundPrimary"] = "backgroundPrimary";
186
184
  ValidSemanticColors["BackgroundSecondary"] = "backgroundSecondary";
187
185
  ValidSemanticColors["BackgroundSuccess"] = "backgroundSuccess";
@@ -490,15 +488,15 @@ const primitiveColors = {
490
488
  green600: '#277C43',
491
489
  green700: '#115026',
492
490
  green800: '#093919',
493
- grey050: '#F2F8F8',
494
- grey100: '#E4ECF1',
495
- grey200: '#CDDAE5',
496
- grey300: '#BDCDDB',
497
- grey350: '#90A4B5',
498
- grey400: '#8196A7',
499
- grey500: '#5D7283',
500
- grey600: '#44535F',
501
- grey650: '#354450',
491
+ grey050: '#F6F7F9',
492
+ grey100: '#E8ECF0',
493
+ grey200: '#D1D9E1',
494
+ grey300: '#C0CDD8',
495
+ grey350: '#92A4B3',
496
+ grey400: '#8396A5',
497
+ grey500: '#5F7281',
498
+ grey600: '#445461',
499
+ grey650: '#37444F',
502
500
  grey700: '#1F272D',
503
501
  grey800: '#11171C',
504
502
  indigo: '#434A93',
@@ -556,9 +554,9 @@ const darkColorList = {
556
554
  actionDefaultTextDefault: primitiveColors.grey100,
557
555
  actionDefaultTextHover: primitiveColors.blue400,
558
556
  actionDefaultTextPress: primitiveColors.blue300,
559
- actionDisabledBackground: primitiveColors.grey700,
560
- actionDisabledBorder: primitiveColors.grey650,
561
- actionDisabledText: primitiveColors.grey600,
557
+ actionDisabledBackground: primitiveColors.grey650,
558
+ actionDisabledBorder: primitiveColors.grey600,
559
+ actionDisabledText: primitiveColors.grey500,
562
560
  actionIconBackgroundDefault: 'rgba(255, 255, 255, 0.0000)',
563
561
  actionIconBackgroundHover: 'rgba(255, 255, 255, 0.0800)',
564
562
  actionIconBackgroundPress: 'rgba(255, 255, 255, 0.1600)',
@@ -585,7 +583,6 @@ const darkColorList = {
585
583
  actionTertiaryTextHover: primitiveColors.blue400,
586
584
  actionTertiaryTextPress: primitiveColors.blue300,
587
585
  backgroundDanger: 'rgba(200, 45, 76, 0.1600)',
588
- backgroundInfo: 'rgba(68, 83, 95, 0.1600)',
589
586
  backgroundPrimary: primitiveColors.grey800,
590
587
  backgroundSecondary: primitiveColors.grey700,
591
588
  backgroundSuccess: 'rgba(39, 124, 67, 0.1600)',
@@ -594,9 +591,9 @@ const darkColorList = {
594
591
  borderAccessible: primitiveColors.grey300,
595
592
  borderDanger: primitiveColors.red500,
596
593
  borderWarning: primitiveColors.yellow500,
597
- codeBackground: primitiveColors.grey700,
594
+ codeBackground: primitiveColors.grey650,
598
595
  overlayOverlay: 'rgba(31, 38, 45, 0.7200)',
599
- skeleton: 'rgba(228, 236, 241, 0.1000)',
596
+ skeleton: 'rgba(144, 164, 181, 0.1600)',
600
597
  tableBackgroundSelectedDefault: 'rgba(189, 205, 219, 0.0800)',
601
598
  tableBackgroundSelectedHover: 'rgba(189, 205, 219, 0.1200)',
602
599
  tableBackgroundUnselectedDefault: primitiveColors.grey800,
@@ -604,7 +601,7 @@ const darkColorList = {
604
601
  tagBrown: 'rgba(166, 99, 12, 0.8600)',
605
602
  tagCharcoal: 'rgba(68, 83, 95, 0.8600)',
606
603
  tagCoral: 'rgba(200, 50, 67, 0.8600)',
607
- tagDefault: primitiveColors.grey700,
604
+ tagDefault: primitiveColors.grey650,
608
605
  tagHover: 'rgba(138, 202, 255, 0.0800)',
609
606
  tagIconDefault: primitiveColors.grey350,
610
607
  tagIconHover: primitiveColors.grey350,
@@ -619,7 +616,7 @@ const darkColorList = {
619
616
  tagTeal: 'rgba(4, 134, 125, 0.8600)',
620
617
  tagText: primitiveColors.grey100,
621
618
  tagTurquoise: 'rgba(19, 125, 174, 0.8600)',
622
- textPlaceholder: primitiveColors.grey650,
619
+ textPlaceholder: primitiveColors.grey400,
623
620
  textPrimary: primitiveColors.grey100,
624
621
  textSecondary: primitiveColors.grey350,
625
622
  textValidationDanger: primitiveColors.red500,
@@ -657,9 +654,9 @@ const lightColorList = {
657
654
  actionDefaultTextDefault: primitiveColors.grey800,
658
655
  actionDefaultTextHover: primitiveColors.blue700,
659
656
  actionDefaultTextPress: primitiveColors.blue800,
660
- actionDisabledBackground: primitiveColors.grey050,
661
- actionDisabledBorder: primitiveColors.grey100,
662
- actionDisabledText: primitiveColors.grey300,
657
+ actionDisabledBackground: primitiveColors.grey100,
658
+ actionDisabledBorder: primitiveColors.grey200,
659
+ actionDisabledText: primitiveColors.grey350,
663
660
  actionIconBackgroundDefault: 'rgba(34, 114, 180, 0.0000)',
664
661
  actionIconBackgroundHover: 'rgba(34, 114, 180, 0.0800)',
665
662
  actionIconBackgroundPress: 'rgba(34, 114, 180, 0.1600)',
@@ -686,7 +683,6 @@ const lightColorList = {
686
683
  actionTertiaryTextHover: primitiveColors.blue700,
687
684
  actionTertiaryTextPress: primitiveColors.blue800,
688
685
  backgroundDanger: primitiveColors.red100,
689
- backgroundInfo: primitiveColors.grey100,
690
686
  backgroundPrimary: primitiveColors.white,
691
687
  backgroundSecondary: primitiveColors.grey050,
692
688
  backgroundSuccess: primitiveColors.green100,
@@ -697,7 +693,7 @@ const lightColorList = {
697
693
  borderWarning: primitiveColors.yellow300,
698
694
  codeBackground: 'rgba(68, 83, 95, 0.0800)',
699
695
  overlayOverlay: 'rgba(64, 63, 63, 0.7200)',
700
- skeleton: 'rgba(17, 23, 28, 0.1000)',
696
+ skeleton: 'rgba(144, 164, 181, 0.1600)',
701
697
  tableBackgroundSelectedDefault: 'rgba(68, 83, 95, 0.0800)',
702
698
  tableBackgroundSelectedHover: 'rgba(68, 83, 95, 0.1200)',
703
699
  tableBackgroundUnselectedDefault: primitiveColors.white,
@@ -705,7 +701,7 @@ const lightColorList = {
705
701
  tagBrown: primitiveColors.brown,
706
702
  tagCharcoal: primitiveColors.grey600,
707
703
  tagCoral: primitiveColors.coral,
708
- tagDefault: primitiveColors.grey050,
704
+ tagDefault: primitiveColors.grey100,
709
705
  tagHover: 'rgba(34, 114, 180, 0.0800)',
710
706
  tagIconDefault: primitiveColors.grey600,
711
707
  tagIconHover: primitiveColors.grey600,
@@ -1483,35 +1479,6 @@ const FaceSmileIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
1483
1479
  FaceSmileIcon.displayName = 'FaceSmileIcon';
1484
1480
  var FaceSmileIcon$1 = FaceSmileIcon;
1485
1481
 
1486
- function SvgInfoIcon(props) {
1487
- return jsxs("svg", {
1488
- xmlns: "http://www.w3.org/2000/svg",
1489
- width: "1em",
1490
- height: "1em",
1491
- fill: "none",
1492
- viewBox: "0 0 16 16",
1493
- ...props,
1494
- children: [jsx("path", {
1495
- fill: "currentColor",
1496
- d: "M7.25 11V7h1.5v4h-1.5ZM8 4.5A.75.75 0 1 1 8 6a.75.75 0 0 1 0-1.5Z"
1497
- }), jsx("path", {
1498
- fill: "currentColor",
1499
- fillRule: "evenodd",
1500
- d: "M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Z",
1501
- clipRule: "evenodd"
1502
- })]
1503
- });
1504
- }
1505
- const InfoIcon = /*#__PURE__*/forwardRef((props, forwardedRef) => {
1506
- return jsx(Icon, {
1507
- ref: forwardedRef,
1508
- ...props,
1509
- component: SvgInfoIcon
1510
- });
1511
- });
1512
- InfoIcon.displayName = 'InfoIcon';
1513
- var InfoIcon$1 = InfoIcon;
1514
-
1515
1482
  function SvgLoadingIcon(props) {
1516
1483
  return jsx("svg", {
1517
1484
  xmlns: "http://www.w3.org/2000/svg",
@@ -1776,6 +1743,7 @@ function getDisabledTertiaryStyles(theme) {
1776
1743
  }
1777
1744
 
1778
1745
  let DesignSystemEventProviderComponentTypes = /*#__PURE__*/function (DesignSystemEventProviderComponentTypes) {
1746
+ DesignSystemEventProviderComponentTypes["Banner"] = "banner";
1779
1747
  DesignSystemEventProviderComponentTypes["Button"] = "button";
1780
1748
  DesignSystemEventProviderComponentTypes["Input"] = "input";
1781
1749
  return DesignSystemEventProviderComponentTypes;
@@ -2043,7 +2011,8 @@ const getButtonEmotionStyles = _ref => {
2043
2011
  type,
2044
2012
  isFlex,
2045
2013
  useFocusPseudoClass,
2046
- forceIconStyles
2014
+ forceIconStyles,
2015
+ danger
2047
2016
  } = _ref;
2048
2017
  const clsIcon = `.${theme.general.iconfontCssPrefix}`;
2049
2018
  const clsEndIcon = `.${getEndIconClsName(theme)}`;
@@ -2220,10 +2189,10 @@ const getButtonEmotionStyles = _ref => {
2220
2189
  ...iconCss,
2221
2190
  marginLeft: theme.spacing.sm
2222
2191
  },
2223
- ...(!type && {
2192
+ ...(!type && !danger && {
2224
2193
  [`&:enabled:not(:hover):not(:active) > ${clsIcon}`]: inactiveIconCss
2225
2194
  }),
2226
- ...(!type && {
2195
+ ...(!type && !danger && {
2227
2196
  [`&:enabled:not(:hover):not(:active) > ${endIconCssSelector}`]: inactiveIconCss
2228
2197
  }),
2229
2198
  // Disable animations
@@ -2236,10 +2205,16 @@ const getButtonEmotionStyles = _ref => {
2236
2205
  ...tertiaryColors,
2237
2206
  color: theme.colors.textSecondary,
2238
2207
  '&:hover > .anticon': {
2239
- color: tertiaryColors['&:hover'].color
2208
+ color: tertiaryColors['&:hover'].color,
2209
+ ...(danger && {
2210
+ color: theme.colors.actionDangerDefaultTextHover
2211
+ })
2240
2212
  },
2241
2213
  '&:active > .anticon': {
2242
- color: tertiaryColors['&:active'].color
2214
+ color: tertiaryColors['&:active'].color,
2215
+ ...(danger && {
2216
+ color: theme.colors.actionDangerDefaultTextPress
2217
+ })
2243
2218
  },
2244
2219
  ...(loading && {
2245
2220
  '&&, &:hover, &:active': {
@@ -2248,7 +2223,10 @@ const getButtonEmotionStyles = _ref => {
2248
2223
  })
2249
2224
  },
2250
2225
  [`&:enabled:not(${classLink}) > .anticon`]: {
2251
- color: theme.colors.textSecondary
2226
+ color: theme.colors.textSecondary,
2227
+ ...(danger && {
2228
+ color: theme.colors.actionDangerDefaultTextDefault
2229
+ })
2252
2230
  },
2253
2231
  ...(isAnchor && {
2254
2232
  lineHeight: `${theme.general.heightSm}px`,
@@ -2853,84 +2831,6 @@ const Typography = /* #__PURE__ */(() => {
2853
2831
  return Typography;
2854
2832
  })();
2855
2833
 
2856
- const Tooltip = _ref => {
2857
- let {
2858
- children,
2859
- title,
2860
- placement = 'top',
2861
- dataTestId,
2862
- dangerouslySetAntdProps,
2863
- silenceScreenReader = false,
2864
- useAsLabel = false,
2865
- ...props
2866
- } = _ref;
2867
- const {
2868
- theme
2869
- } = useDesignSystemTheme();
2870
- const id = useUniqueId('dubois-tooltip-component-');
2871
- if (!title) {
2872
- return jsx(React__default.Fragment, {
2873
- children: children
2874
- });
2875
- }
2876
- const titleProps = silenceScreenReader ? {} : {
2877
- 'aria-live': 'polite',
2878
- 'aria-relevant': 'additions'
2879
- };
2880
- if (dataTestId) {
2881
- // TODO FEINF-1337 - this should turn into data-testid
2882
- titleProps['data-test-id'] = dataTestId;
2883
- }
2884
- const liveTitle = title && /*#__PURE__*/React__default.isValidElement(title) ? /*#__PURE__*/React__default.cloneElement(title, titleProps) : jsx("span", {
2885
- ...titleProps,
2886
- children: title
2887
- });
2888
- const ariaProps = {
2889
- [useAsLabel ? 'aria-labelledby' : 'aria-describedby']: id,
2890
- 'aria-hidden': false
2891
- };
2892
- const childWithProps = /*#__PURE__*/React__default.isValidElement(children) ? /*#__PURE__*/React__default.cloneElement(children, {
2893
- ...ariaProps,
2894
- ...children.props
2895
- }) : _isNil(children) ? children : jsx("span", {
2896
- ...ariaProps,
2897
- children: children
2898
- });
2899
- const {
2900
- overlayInnerStyle,
2901
- overlayStyle,
2902
- ...delegatedDangerouslySetAntdProps
2903
- } = dangerouslySetAntdProps || {};
2904
- return jsx(DesignSystemAntDConfigProvider, {
2905
- children: jsx(Tooltip$1, {
2906
- id: id,
2907
- title: liveTitle,
2908
- placement: placement
2909
- // Always trigger on hover and focus
2910
- ,
2911
- trigger: ['hover', 'focus'],
2912
- overlayInnerStyle: {
2913
- backgroundColor: '#2F3941',
2914
- lineHeight: '22px',
2915
- padding: '4px 8px',
2916
- boxShadow: theme.general.shadowLow,
2917
- ...overlayInnerStyle,
2918
- ...getDarkModePortalStyles(theme)
2919
- },
2920
- overlayStyle: {
2921
- zIndex: theme.options.zIndexBase + 70,
2922
- ...overlayStyle
2923
- },
2924
- css: /*#__PURE__*/css({
2925
- ...getAnimationCss(theme.options.enableAnimation)
2926
- }, process.env.NODE_ENV === "production" ? "" : ";label:Tooltip;"),
2927
- ...delegatedDangerouslySetAntdProps,
2928
- ...props,
2929
- children: childWithProps
2930
- })
2931
- });
2932
- };
2933
-
2934
2834
  const getInputGroupStyling = (clsPrefix, theme) => {
2935
2835
  const inputClass = `.${clsPrefix}-input`;
2936
2836
  const buttonClass = `.${clsPrefix}-btn`;
@@ -2954,7 +2854,7 @@ const getInputGroupStyling = (clsPrefix, theme) => {
2954
2854
  }
2955
2855
  }, process.env.NODE_ENV === "production" ? "" : ";label:getInputGroupStyling;");
2956
2856
  };
2957
- const Group$1 = _ref => {
2857
+ const Group = _ref => {
2958
2858
  let {
2959
2859
  dangerouslySetAntdProps,
2960
2860
  dangerouslyAppendEmotionCSS,
@@ -2975,10 +2875,14 @@ const Group$1 = _ref => {
2975
2875
  });
2976
2876
  };
2977
2877
 
2978
- const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
2878
+ const getInputStyles = (clsPrefix, theme, _ref, _ref2) => {
2979
2879
  let {
2980
2880
  validationState
2981
2881
  } = _ref;
2882
+ let {
2883
+ useTransparent = false,
2884
+ useFocusWithin = false
2885
+ } = _ref2;
2982
2886
  const inputClass = `.${clsPrefix}-input`;
2983
2887
  const affixClass = `.${clsPrefix}-input-affix-wrapper`;
2984
2888
  const affixClassFocused = `.${clsPrefix}-input-affix-wrapper-focused`;
@@ -2986,6 +2890,7 @@ const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
2986
2890
  const prefixIcon = `.${clsPrefix}-input-prefix`;
2987
2891
  const suffixIcon = `.${clsPrefix}-input-suffix`;
2988
2892
  const validationColor = getValidationStateColor(theme, validationState);
2893
+ const focusSpecifier = useFocusWithin ? 'focus-within' : 'focus';
2989
2894
  const styles = {
2990
2895
  '&&': {
2991
2896
  lineHeight: theme.typography.lineHeightBase,
@@ -2996,7 +2901,7 @@ const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
2996
2901
  '&:hover': {
2997
2902
  borderColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundHover
2998
2903
  },
2999
- '&:focus': {
2904
+ [`&:${focusSpecifier}`]: {
3000
2905
  outlineColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundDefault,
3001
2906
  outlineWidth: 2,
3002
2907
  outlineOffset: -2,
@@ -3037,7 +2942,7 @@ const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
3037
2942
  },
3038
2943
  [`&${affixClassFocused}`]: {
3039
2944
  boxShadow: 'none',
3040
- '&&, &:focus': {
2945
+ [`&&, &:${focusSpecifier}`]: {
3041
2946
  outlineColor: theme.colors.actionPrimaryBackgroundDefault,
3042
2947
  outlineWidth: 2,
3043
2948
  outlineOffset: -2,
@@ -3059,9 +2964,20 @@ const getInputEmotionStyles = (clsPrefix, theme, _ref, useTransparent) => {
3059
2964
  },
3060
2965
  ...getAnimationCss(theme.options.enableAnimation)
3061
2966
  };
2967
+ return styles;
2968
+ };
2969
+ const getInputEmotionStyles = (clsPrefix, theme, _ref3, useTransparent) => {
2970
+ let {
2971
+ validationState
2972
+ } = _ref3;
2973
+ const styles = getInputStyles(clsPrefix, theme, {
2974
+ validationState
2975
+ }, {
2976
+ useTransparent
2977
+ });
3062
2978
  return /*#__PURE__*/css(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:getInputEmotionStyles;");
3063
2979
  };
3064
- const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref2, ref) {
2980
+ const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
3065
2981
  let {
3066
2982
  validationState,
3067
2983
  autoComplete = 'off',
@@ -3070,7 +2986,7 @@ const Input$1 = /*#__PURE__*/forwardRef(function Input(_ref2, ref) {
3070
2986
  onChange,
3071
2987
  onClear,
3072
2988
  ...props
3073
- } = _ref2;
2989
+ } = _ref4;
3074
2990
  const {
3075
2991
  classNamePrefix,
3076
2992
  theme
@@ -3157,483 +3073,332 @@ const TextArea = /*#__PURE__*/forwardRef(function TextArea(_ref, ref) {
3157
3073
  const InputNamespace = /* #__PURE__ */Object.assign(Input$1, {
3158
3074
  TextArea,
3159
3075
  Password,
3160
- Group: Group$1
3076
+ Group
3161
3077
  });
3162
3078
  const Input = InputNamespace;
3163
3079
 
3164
- const Root = DropdownMenu$1.Root; // Behavioral component only
3165
-
3166
- const Content = /*#__PURE__*/forwardRef(function Content(_ref, ref) {
3080
+ function Stepper(_ref) {
3167
3081
  let {
3168
- children,
3169
- minWidth = 220,
3170
- isInsideModal,
3171
- onEscapeKeyDown,
3172
- onKeyDown,
3173
- ...props
3082
+ direction: requestedDirection,
3083
+ currentStepIndex: currentStep,
3084
+ steps,
3085
+ localizeStepNumber,
3086
+ responsive = true
3174
3087
  } = _ref;
3175
3088
  const {
3176
- getPopupContainer
3177
- } = useDesignSystemContext();
3178
- return jsx(DropdownMenu$1.Portal, {
3179
- container: getPopupContainer && getPopupContainer(),
3180
- children: jsx(DropdownMenu$1.Content, {
3181
- ref: ref,
3182
- loop: true,
3183
- css: [contentStyles, {
3184
- minWidth
3185
- }, process.env.NODE_ENV === "production" ? "" : ";label:Content;"],
3186
- sideOffset: 4,
3187
- align: "start",
3188
- onKeyDown: e => {
3189
- // This is a workaround for Radix's DropdownMenu.Content not receiving Escape key events
3190
- // when nested inside a modal. We need to stop propagation of the event so that the modal
3191
- // doesn't close when the DropdownMenu should.
3192
- if (e.key === 'Escape') {
3193
- if (isInsideModal) {
3194
- e.stopPropagation();
3195
- }
3196
- onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(e.nativeEvent);
3197
- }
3198
- onKeyDown === null || onKeyDown === void 0 || onKeyDown(e);
3199
- },
3200
- ...props,
3201
- children: children
3202
- })
3203
- });
3204
- });
3205
- const SubContent = /*#__PURE__*/forwardRef(function Content(_ref2, ref) {
3206
- let {
3207
- children,
3208
- minWidth = 220,
3209
- ...props
3210
- } = _ref2;
3089
+ theme
3090
+ } = useDesignSystemTheme();
3091
+ const ref = useRef(null);
3211
3092
  const {
3212
- getPopupContainer
3213
- } = useDesignSystemContext();
3214
- return jsx(DropdownMenu$1.Portal, {
3215
- container: getPopupContainer && getPopupContainer(),
3216
- children: jsx(DropdownMenu$1.SubContent, {
3217
- ref: ref,
3218
- loop: true,
3219
- css: [contentStyles, {
3220
- minWidth
3221
- }, process.env.NODE_ENV === "production" ? "" : ";label:SubContent;"],
3222
- sideOffset: -2,
3223
- alignOffset: -5,
3224
- ...props,
3225
- children: children
3226
- })
3227
- });
3228
- });
3229
- const Trigger = /*#__PURE__*/forwardRef(function Trigger(_ref3, ref) {
3230
- let {
3231
- children,
3232
- ...props
3233
- } = _ref3;
3234
- return jsx(DropdownMenu$1.Trigger, {
3235
- ref: ref,
3236
- ...props,
3237
- children: children
3238
- });
3239
- });
3240
- const Item = /*#__PURE__*/forwardRef(function Item(_ref4, ref) {
3241
- let {
3242
- children,
3243
- disabledReason,
3244
- danger,
3245
- onClick,
3246
- ...props
3247
- } = _ref4;
3248
- const itemRef = useRef(null);
3249
- useImperativeHandle(ref, () => itemRef.current);
3250
- return jsx(DropdownMenu$1.Item, {
3251
- css: theme => [dropdownItemStyles, danger && dangerItemStyles(theme)],
3252
- ref: itemRef,
3253
- onClick: e => {
3254
- if (props.disabled) {
3255
- e.preventDefault();
3256
- } else {
3257
- onClick === null || onClick === void 0 || onClick(e);
3258
- }
3259
- },
3260
- ...props,
3261
- children: getNewChildren(children, props, disabledReason, itemRef)
3262
- });
3263
- });
3264
- const Label = /*#__PURE__*/forwardRef(function Label(_ref5, ref) {
3265
- let {
3266
- children,
3267
- ...props
3268
- } = _ref5;
3269
- return jsx(DropdownMenu$1.Label, {
3270
- ref: ref,
3271
- css: [dropdownItemStyles, theme => ({
3272
- color: theme.colors.textSecondary,
3273
- '&:hover': {
3274
- cursor: 'default'
3275
- }
3276
- }), process.env.NODE_ENV === "production" ? "" : ";label:Label;"],
3277
- ...props,
3278
- children: children
3279
- });
3280
- });
3281
- const Separator = /*#__PURE__*/forwardRef(function Separator(_ref6, ref) {
3282
- let {
3283
- children,
3284
- ...props
3285
- } = _ref6;
3286
- return jsx(DropdownMenu$1.Separator, {
3093
+ direction
3094
+ } = useResponsiveDirection({
3095
+ ref,
3096
+ requestedDirection,
3097
+ responsive,
3098
+ enabled: steps.length > 0
3099
+ });
3100
+ if (steps.length === 0) {
3101
+ return null;
3102
+ }
3103
+ const isHorizontal = direction === 'horizontal';
3104
+ const currentStepIndex = currentStep ? Math.min(steps.length - 1, Math.max(0, currentStep)) : 0;
3105
+ return jsx("ol", {
3106
+ css: /*#__PURE__*/css(getStepsStyle(theme, isHorizontal), process.env.NODE_ENV === "production" ? "" : ";label:Stepper;"),
3287
3107
  ref: ref,
3288
- css: dropdownSeparatorStyles,
3289
- ...props,
3290
- children: children
3291
- });
3292
- });
3293
- const SubTrigger = /*#__PURE__*/forwardRef(function TriggerItem(_ref7, ref) {
3294
- let {
3295
- children,
3296
- disabledReason,
3297
- ...props
3298
- } = _ref7;
3299
- const subTriggerRef = useRef(null);
3300
- useImperativeHandle(ref, () => subTriggerRef.current);
3301
- return jsxs(DropdownMenu$1.SubTrigger, {
3302
- ref: subTriggerRef,
3303
- css: [dropdownItemStyles, theme => ({
3304
- '&[data-state="open"]': {
3305
- backgroundColor: theme.colors.actionTertiaryBackgroundHover
3306
- }
3307
- }), process.env.NODE_ENV === "production" ? "" : ";label:SubTrigger;"],
3308
- ...props,
3309
- children: [getNewChildren(children, props, disabledReason, subTriggerRef), jsx(HintColumn, {
3310
- css: theme => ({
3311
- margin: CONSTANTS.subMenuIconMargin(theme),
3312
- display: 'flex',
3313
- alignSelf: 'stretch',
3314
- alignItems: 'center'
3315
- }),
3316
- children: jsx(ChevronRightIcon$1, {
3317
- css: theme => ({
3318
- fontSize: CONSTANTS.subMenuIconSize(theme)
3108
+ children: steps.map((step, index) => {
3109
+ const isCurrentStep = index === currentStepIndex;
3110
+ const isLastStep = index === steps.length - 1;
3111
+ const displayEndingDivider = !isLastStep;
3112
+ const contentTitleLevel = isCurrentStep ? 3 : 4;
3113
+ const StepIcon = step.icon;
3114
+ const {
3115
+ icon,
3116
+ iconBackgroundColor,
3117
+ iconTextColor,
3118
+ titleTextColor,
3119
+ descriptionTextColor,
3120
+ hasStepItemIconBorder
3121
+ } = getStepContentStyleFields(theme, isCurrentStep, step.status, StepIcon);
3122
+ return jsx("li", {
3123
+ "aria-current": isCurrentStep,
3124
+ css: /*#__PURE__*/css(getStepItemStyle(theme, isHorizontal, isLastStep)),
3125
+ children: jsxs(StepContentGrid, {
3126
+ isHorizontal: isHorizontal,
3127
+ isCurrentStep: isCurrentStep,
3128
+ children: [jsx("div", {
3129
+ css: /*#__PURE__*/css(getStepItemIconParentStyle(theme, isCurrentStep, iconBackgroundColor, hasStepItemIconBorder)),
3130
+ children: StepIcon ? jsx(StepIcon, {
3131
+ statusColor: iconTextColor,
3132
+ status: step.status
3133
+ }) : icon ? jsx("span", {
3134
+ css: /*#__PURE__*/css({
3135
+ color: iconTextColor
3136
+ }),
3137
+ children: icon
3138
+ }) : jsx(Typography.Title, {
3139
+ level: contentTitleLevel,
3140
+ css: /*#__PURE__*/css({
3141
+ color: `${iconTextColor} !important`
3142
+ }),
3143
+ withoutMargins: true,
3144
+ children: localizeStepNumber(index + 1)
3145
+ })
3146
+ }), jsx(Typography.Title, {
3147
+ level: contentTitleLevel,
3148
+ withoutMargins: true,
3149
+ css: /*#__PURE__*/css({
3150
+ flexShrink: 0,
3151
+ color: `${titleTextColor} !important`
3152
+ }),
3153
+ children: step.title
3154
+ }), displayEndingDivider && jsx("div", {
3155
+ css: /*#__PURE__*/css(getStepEndingDividerStyles(theme, isHorizontal, isCurrentStep))
3156
+ }), step.description && jsx(Typography.Text, {
3157
+ css: /*#__PURE__*/css(getStepDescriptionStyles(theme, isHorizontal, isLastStep, descriptionTextColor)),
3158
+ withoutMargins: true,
3159
+ size: "sm",
3160
+ children: step.description
3161
+ })]
3319
3162
  })
3320
- })
3321
- })]
3322
- });
3323
- });
3324
-
3325
- /**
3326
- * Deprecated. Use `SubTrigger` instead.
3327
- * @deprecated
3328
- */
3329
- const TriggerItem = SubTrigger;
3330
- const CheckboxItem = /*#__PURE__*/forwardRef(function CheckboxItem(_ref8, ref) {
3331
- let {
3332
- children,
3333
- disabledReason,
3334
- ...props
3335
- } = _ref8;
3336
- const checkboxItemRef = useRef(null);
3337
- useImperativeHandle(ref, () => checkboxItemRef.current);
3338
- return jsx(DropdownMenu$1.CheckboxItem, {
3339
- ref: checkboxItemRef,
3340
- css: theme => [dropdownItemStyles, checkboxItemStyles(theme)],
3341
- ...props,
3342
- children: getNewChildren(children, props, disabledReason, checkboxItemRef)
3343
- });
3344
- });
3345
- const ItemIndicator = /*#__PURE__*/forwardRef(function ItemIndicator(_ref9, ref) {
3346
- let {
3347
- children,
3348
- ...props
3349
- } = _ref9;
3350
- return jsx(DropdownMenu$1.ItemIndicator, {
3351
- ref: ref,
3352
- css: theme => ({
3353
- marginLeft: -(CONSTANTS.checkboxIconWidth(theme) + CONSTANTS.checkboxPaddingRight(theme)),
3354
- position: 'absolute',
3355
- fontSize: theme.general.iconFontSize
3356
- }),
3357
- ...props,
3358
- children: children !== null && children !== void 0 ? children : jsx(CheckIcon$1, {
3359
- css: theme => ({
3360
- color: theme.colors.textSecondary
3361
- })
3163
+ }, index);
3362
3164
  })
3363
3165
  });
3364
- });
3365
- const Arrow = /*#__PURE__*/forwardRef(function Arrow(_ref10, ref) {
3166
+ }
3167
+ function getStepsStyle(theme, isHorizontal) {
3168
+ return /*#__PURE__*/css({
3169
+ listStyle: 'none',
3170
+ display: 'flex',
3171
+ flexDirection: isHorizontal ? 'row' : 'column',
3172
+ flexWrap: 'wrap',
3173
+ alignItems: 'flex-start',
3174
+ gap: isHorizontal ? theme.spacing.md : theme.spacing.sm,
3175
+ width: '100%',
3176
+ margin: '0',
3177
+ padding: '0'
3178
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepsStyle;");
3179
+ }
3180
+ function getStepItemStyle(theme, isHorizontal, isLastStep) {
3181
+ return /*#__PURE__*/css({
3182
+ display: 'flex',
3183
+ flexDirection: 'column',
3184
+ alignItems: 'center',
3185
+ justifyContent: 'flex-start',
3186
+ flexGrow: isLastStep ? 0 : 1,
3187
+ marginRight: isLastStep ? theme.spacing.lg + theme.spacing.md : 0,
3188
+ width: isHorizontal ? undefined : '100%'
3189
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepItemStyle;");
3190
+ }
3191
+ function getStepContentStyleFields(theme, isCurrentStep, status, icon) {
3192
+ const fields = getStepContentStyleFieldsFromStatus(theme, isCurrentStep, status);
3193
+ if (icon) {
3194
+ return {
3195
+ ...fields,
3196
+ icon: undefined,
3197
+ iconBackgroundColor: undefined,
3198
+ iconTextColor: getCustomIconColor(theme, isCurrentStep, status),
3199
+ hasStepItemIconBorder: false
3200
+ };
3201
+ }
3202
+ return fields;
3203
+ }
3204
+ function getCustomIconColor(theme, isCurrentStep, status) {
3205
+ switch (status) {
3206
+ case 'completed':
3207
+ return theme.colors.actionDefaultBackgroundPress;
3208
+ case 'loading':
3209
+ return theme.colors.textPlaceholder;
3210
+ case 'error':
3211
+ return theme.colors.textValidationDanger;
3212
+ default:
3213
+ case 'upcoming':
3214
+ return isCurrentStep ? theme.colors.actionLinkDefault : theme.colors.textPlaceholder;
3215
+ }
3216
+ }
3217
+ function getStepContentStyleFieldsFromStatus(theme, isCurrentStep, status) {
3218
+ switch (status) {
3219
+ case 'completed':
3220
+ return {
3221
+ icon: jsx(CheckIcon$1, {}),
3222
+ iconBackgroundColor: theme.colors.actionDefaultBackgroundPress,
3223
+ iconTextColor: theme.colors.textPlaceholder,
3224
+ titleTextColor: theme.colors.textPrimary,
3225
+ descriptionTextColor: theme.colors.textSecondary,
3226
+ hasStepItemIconBorder: true
3227
+ };
3228
+ case 'loading':
3229
+ return {
3230
+ icon: jsx(LoadingIcon$1, {
3231
+ spin: true,
3232
+ css: /*#__PURE__*/css({
3233
+ fontSize: isCurrentStep ? theme.typography.fontSizeXl : theme.typography.fontSizeLg
3234
+ }, process.env.NODE_ENV === "production" ? "" : ";label:icon;")
3235
+ }),
3236
+ iconBackgroundColor: undefined,
3237
+ iconTextColor: theme.colors.textPlaceholder,
3238
+ titleTextColor: isCurrentStep ? theme.colors.textPrimary : theme.colors.textSecondary,
3239
+ descriptionTextColor: theme.colors.textSecondary,
3240
+ hasStepItemIconBorder: false
3241
+ };
3242
+ case 'error':
3243
+ return {
3244
+ icon: jsx(CloseIcon$1, {
3245
+ css: /*#__PURE__*/css({
3246
+ marginBottom: theme.spacing.sm /* center icon in icon circle */
3247
+ }, process.env.NODE_ENV === "production" ? "" : ";label:icon;")
3248
+ }),
3249
+ iconBackgroundColor: theme.colors.textValidationDanger,
3250
+ iconTextColor: 'white',
3251
+ titleTextColor: theme.colors.textValidationDanger,
3252
+ descriptionTextColor: theme.colors.textValidationDanger,
3253
+ hasStepItemIconBorder: false
3254
+ };
3255
+ default:
3256
+ case 'upcoming':
3257
+ if (isCurrentStep) {
3258
+ return {
3259
+ icon: undefined,
3260
+ iconBackgroundColor: theme.colors.actionLinkDefault,
3261
+ iconTextColor: 'white',
3262
+ titleTextColor: theme.colors.textPrimary,
3263
+ descriptionTextColor: theme.colors.textPrimary,
3264
+ hasStepItemIconBorder: false
3265
+ };
3266
+ }
3267
+ return {
3268
+ icon: undefined,
3269
+ iconBackgroundColor: undefined,
3270
+ iconTextColor: theme.colors.textPlaceholder,
3271
+ titleTextColor: theme.colors.textSecondary,
3272
+ descriptionTextColor: theme.colors.textSecondary,
3273
+ hasStepItemIconBorder: true
3274
+ };
3275
+ }
3276
+ }
3277
+ const MaxHorizontalStepDescriptionWidth = 140;
3278
+ const CurrentStepIconSize = DEFAULT_SPACING_UNIT * 4;
3279
+ const NonCurrentStepIconSize = DEFAULT_SPACING_UNIT * 3;
3280
+ function getStepItemIconParentStyle(theme, isCurrentStep, iconBackgroundColor, hasStepItemIconBorder) {
3281
+ return /*#__PURE__*/css({
3282
+ width: isCurrentStep ? CurrentStepIconSize : NonCurrentStepIconSize,
3283
+ height: isCurrentStep ? CurrentStepIconSize : NonCurrentStepIconSize,
3284
+ backgroundColor: iconBackgroundColor,
3285
+ borderRadius: '50%',
3286
+ display: 'flex',
3287
+ justifyContent: 'center',
3288
+ alignItems: 'center',
3289
+ fontSize: '20px',
3290
+ flexShrink: 0,
3291
+ border: hasStepItemIconBorder ? `1px solid ${theme.colors.textPlaceholder}` : undefined
3292
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepItemIconParentStyle;");
3293
+ }
3294
+ function getStepEndingDividerStyles(theme, isHorizontal, isCurrentStep) {
3295
+ const backgroundColor = isCurrentStep ? theme.colors.actionLinkDefault : theme.colors.border;
3296
+ if (isHorizontal) {
3297
+ return /*#__PURE__*/css({
3298
+ backgroundColor,
3299
+ height: '1px',
3300
+ width: '100%',
3301
+ minWidth: theme.spacing.md
3302
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepEndingDividerStyles;");
3303
+ }
3304
+ return /*#__PURE__*/css({
3305
+ backgroundColor,
3306
+ height: '100%',
3307
+ minHeight: theme.spacing.md,
3308
+ width: '1px',
3309
+ alignSelf: 'flex-start',
3310
+ marginLeft: theme.spacing.md
3311
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepEndingDividerStyles;");
3312
+ }
3313
+ function getStepDescriptionStyles(theme, isHorizontal, isLastStep, textColor) {
3314
+ return /*#__PURE__*/css({
3315
+ alignSelf: 'flex-start',
3316
+ width: '100%',
3317
+ gridColumn: isHorizontal || isLastStep ? '2 / span 2' : undefined,
3318
+ maxWidth: isHorizontal ? MaxHorizontalStepDescriptionWidth : undefined,
3319
+ paddingBottom: isHorizontal ? undefined : theme.spacing.sm,
3320
+ color: `${textColor} !important`
3321
+ }, process.env.NODE_ENV === "production" ? "" : ";label:getStepDescriptionStyles;");
3322
+ }
3323
+ function StepContentGrid(_ref2) {
3366
3324
  let {
3367
3325
  children,
3368
- ...props
3369
- } = _ref10;
3326
+ isHorizontal,
3327
+ isCurrentStep
3328
+ } = _ref2;
3370
3329
  const {
3371
3330
  theme
3372
3331
  } = useDesignSystemTheme();
3373
- return jsx(DropdownMenu$1.Arrow, {
3332
+ if (isHorizontal) {
3333
+ return jsx("div", {
3334
+ css: /*#__PURE__*/css({
3335
+ display: 'grid',
3336
+ gridTemplateColumns: `${isCurrentStep ? CurrentStepIconSize : NonCurrentStepIconSize}px fit-content(100%) 1fr`,
3337
+ gridTemplateRows: `${CurrentStepIconSize}px auto`,
3338
+ alignItems: 'center',
3339
+ justifyItems: 'flex-start',
3340
+ gridColumnGap: theme.spacing.sm,
3341
+ gridRowGap: theme.spacing.sm,
3342
+ width: '100%'
3343
+ }, process.env.NODE_ENV === "production" ? "" : ";label:StepContentGrid;"),
3344
+ children: children
3345
+ });
3346
+ }
3347
+ return jsx("div", {
3374
3348
  css: /*#__PURE__*/css({
3375
- fill: theme.colors.backgroundPrimary,
3376
- stroke: theme.colors.borderDecorative,
3377
- strokeDashoffset: -CONSTANTS.arrowBottomLength(),
3378
- strokeDasharray: CONSTANTS.arrowBottomLength() + 2 * CONSTANTS.arrowSide(),
3379
- strokeWidth: CONSTANTS.arrowStrokeWidth(),
3380
- // TODO: This is a temporary fix for the alignment of the Arrow;
3381
- // Radix has changed the implementation for v1.0.0 (uses floating-ui)
3382
- // which has new behaviors for alignment that we don't want. Generally
3383
- // we need to fix the arrow to always be aligned to the left of the menu (with
3384
- // offset equal to border radius)
3385
- position: 'relative',
3386
- top: -1
3387
- }, process.env.NODE_ENV === "production" ? "" : ";label:Arrow;"),
3388
- ref: ref,
3389
- width: 12,
3390
- height: 6,
3391
- ...props,
3349
+ display: 'grid',
3350
+ gridTemplateColumns: `${CurrentStepIconSize}px auto`,
3351
+ alignItems: 'center',
3352
+ justifyItems: 'flex-start',
3353
+ gridColumnGap: theme.spacing.md,
3354
+ gridRowGap: theme.spacing.sm,
3355
+ width: '100%',
3356
+ '& > :first-child': {
3357
+ // horizontally center the first column (circle/icon)
3358
+ justifySelf: 'center'
3359
+ }
3360
+ }, process.env.NODE_ENV === "production" ? "" : ";label:StepContentGrid;"),
3392
3361
  children: children
3393
3362
  });
3394
- });
3395
- const RadioItem = /*#__PURE__*/forwardRef(function RadioItem(_ref11, ref) {
3396
- let {
3397
- children,
3398
- disabledReason,
3399
- ...props
3400
- } = _ref11;
3401
- const radioItemRef = useRef(null);
3402
- useImperativeHandle(ref, () => radioItemRef.current);
3403
- return jsx(DropdownMenu$1.RadioItem, {
3404
- ref: radioItemRef,
3405
- css: theme => [dropdownItemStyles, checkboxItemStyles(theme)],
3406
- ...props,
3407
- children: getNewChildren(children, props, disabledReason, radioItemRef)
3408
- });
3409
- });
3363
+ }
3410
3364
 
3411
- // UNWRAPPED RADIX-UI-COMPONENTS
3412
- const Group = DropdownMenu$1.Group;
3413
- const RadioGroup = DropdownMenu$1.RadioGroup;
3414
- const Sub = DropdownMenu$1.Sub;
3365
+ // Ant design uses the same value for their stepper and to works well for us as well.
3366
+ const MinimumHorizonalDirectionWidth = 532;
3415
3367
 
3416
- // EXTRA COMPONENTS
3417
- const HintColumn = /*#__PURE__*/forwardRef(function HintColumn(_ref12, ref) {
3418
- let {
3419
- children,
3420
- ...props
3421
- } = _ref12;
3422
- return jsx("div", {
3423
- ref: ref,
3424
- css: [metaTextStyles, "margin-left:auto;" + (process.env.NODE_ENV === "production" ? "" : ";label:HintColumn;")],
3425
- ...props,
3426
- children: children
3427
- });
3428
- });
3429
- const HintRow = /*#__PURE__*/forwardRef(function HintRow(_ref13, ref) {
3368
+ // exported for unit test
3369
+ function useResponsiveDirection(_ref3) {
3430
3370
  let {
3431
- children,
3432
- ...props
3433
- } = _ref13;
3434
- return jsx("div", {
3435
- ref: ref,
3436
- css: [metaTextStyles, "min-width:100%;" + (process.env.NODE_ENV === "production" ? "" : ";label:HintRow;")],
3437
- ...props,
3438
- children: children
3439
- });
3440
- });
3441
- const IconWrapper = /*#__PURE__*/forwardRef(function IconWrapper(_ref14, ref) {
3442
- let {
3443
- children,
3444
- ...props
3445
- } = _ref14;
3446
- return jsx("div", {
3447
- ref: ref,
3448
- css: theme => ({
3449
- fontSize: 16,
3450
- color: theme.colors.textSecondary,
3451
- paddingRight: theme.spacing.sm
3452
- }),
3453
- ...props,
3454
- children: children
3455
- });
3456
- });
3457
- const getNewChildren = (children, props, disabledReason, ref) => {
3458
- const childCount = Children.count(children);
3459
- const tooltip = jsx(Tooltip, {
3460
- title: disabledReason,
3461
- placement: "right",
3462
- dangerouslySetAntdProps: {
3463
- getPopupContainer: () => ref.current || document.body
3464
- },
3465
- children: jsx("span", {
3466
- css: theme => infoIconStyles(theme),
3467
- children: jsx(InfoIcon$1, {
3468
- role: "presentation",
3469
- alt: "Disabled state reason",
3470
- "aria-hidden": "false"
3471
- })
3472
- })
3473
- });
3474
- if (childCount === 1) {
3475
- return getChild(children, Boolean(props['disabled']), disabledReason, tooltip, 0, childCount);
3476
- }
3477
- return Children.map(children, (child, idx) => {
3478
- return getChild(child, Boolean(props['disabled']), disabledReason, tooltip, idx, childCount);
3479
- });
3480
- };
3481
- const getChild = (child, isDisabled, disabledReason, tooltip, index, siblingCount) => {
3482
- const HintColumnType = jsx(HintColumn, {}).type;
3483
- const isHintColumnType = Boolean(child && typeof child !== 'string' && typeof child !== 'number' && typeof child !== 'boolean' && 'type' in child && (child === null || child === void 0 ? void 0 : child.type) === HintColumnType);
3484
- if (isDisabled && disabledReason && child && isHintColumnType) {
3485
- return jsxs(Fragment, {
3486
- children: [tooltip, child]
3487
- });
3488
- } else if (index === siblingCount - 1 && isDisabled && disabledReason) {
3489
- return jsxs(Fragment, {
3490
- children: [child, tooltip]
3371
+ requestedDirection = 'horizontal',
3372
+ responsive,
3373
+ enabled,
3374
+ ref
3375
+ } = _ref3;
3376
+ const [direction, setDirection] = useState(requestedDirection);
3377
+ useEffect(() => {
3378
+ if (requestedDirection === 'vertical' || !enabled || !responsive || !ref.current) {
3379
+ return;
3380
+ }
3381
+ let timeoutId;
3382
+ const resizeObserver = new ResizeObserver(entries => {
3383
+ timeoutId = requestAnimationFrame(() => {
3384
+ if (entries.length === 1) {
3385
+ const width = entries[0].target.clientWidth || 0;
3386
+ setDirection(width < MinimumHorizonalDirectionWidth ? 'vertical' : 'horizontal');
3387
+ }
3388
+ });
3491
3389
  });
3492
- }
3493
- return child;
3494
- };
3495
-
3496
- // CONSTANTS
3497
- const CONSTANTS = {
3498
- itemPaddingVertical(theme) {
3499
- // The number from the mocks is the midpoint between constants
3500
- return 0.5 * theme.spacing.xs + 0.5 * theme.spacing.sm;
3501
- },
3502
- itemPaddingHorizontal(theme) {
3503
- return theme.spacing.sm;
3504
- },
3505
- checkboxIconWidth(theme) {
3506
- return theme.general.iconFontSize;
3507
- },
3508
- checkboxPaddingLeft(theme) {
3509
- return theme.spacing.sm + theme.spacing.xs;
3510
- },
3511
- checkboxPaddingRight(theme) {
3512
- return theme.spacing.sm;
3513
- },
3514
- subMenuIconMargin(theme) {
3515
- // Negative margin so the icons can be larger without increasing the overall item height
3516
- const iconMarginVertical = this.itemPaddingVertical(theme) / 2;
3517
- const iconMarginRight = -this.itemPaddingVertical(theme) + theme.spacing.sm * 1.5;
3518
- return `${-iconMarginVertical}px ${-iconMarginRight}px ${-iconMarginVertical}px auto`;
3519
- },
3520
- subMenuIconSize(theme) {
3521
- return theme.spacing.lg;
3522
- },
3523
- arrowBottomLength() {
3524
- // The built in arrow is a polygon: 0,0 30,0 15,10
3525
- return 30;
3526
- },
3527
- arrowHeight() {
3528
- return 10;
3529
- },
3530
- arrowSide() {
3531
- return 2 * (this.arrowHeight() ** 2 * 2) ** 0.5;
3532
- },
3533
- arrowStrokeWidth() {
3534
- // This is eyeballed b/c relative to the svg viewbox coordinate system
3535
- return 2;
3536
- }
3537
- };
3538
- const dropdownContentStyles = theme => ({
3539
- backgroundColor: theme.colors.backgroundPrimary,
3540
- color: theme.colors.textPrimary,
3541
- lineHeight: theme.typography.lineHeightBase,
3542
- border: `1px solid ${theme.colors.borderDecorative}`,
3543
- borderRadius: theme.borders.borderRadiusMd,
3544
- padding: `${theme.spacing.xs}px 0`,
3545
- boxShadow: theme.general.shadowLow,
3546
- userSelect: 'none',
3547
- ...getDarkModePortalStyles(theme),
3548
- // Ant Design uses 1000s for their zIndex space; this ensures Radix works with that, but
3549
- // we'll likely need to be sure that all Radix components are using the same zIndex going forward.
3550
- //
3551
- // Additionally, there is an issue where macOS overlay scrollbars in Chrome and Safari (sometimes!)
3552
- // overlap other elements with higher zIndex, because the scrollbars themselves have zIndex 9999,
3553
- // so we have to use a higher value than that: https://github.com/databricks/universe/pull/232825
3554
- zIndex: 10000,
3555
- a: importantify({
3556
- color: theme.colors.textPrimary,
3557
- '&:hover, &:focus': {
3558
- color: theme.colors.textPrimary,
3559
- textDecoration: 'none'
3390
+ if (ref.current) {
3391
+ resizeObserver.observe(ref.current);
3560
3392
  }
3561
- })
3562
- });
3563
- const contentStyles = theme => ({
3564
- ...dropdownContentStyles(theme)
3565
- });
3566
- const dropdownItemStyles = theme => ({
3567
- padding: `${CONSTANTS.itemPaddingVertical(theme)}px ${CONSTANTS.itemPaddingHorizontal(theme)}px`,
3568
- display: 'flex',
3569
- flexWrap: 'wrap',
3570
- alignItems: 'center',
3571
- outline: 'unset',
3572
- '&:hover': {
3573
- cursor: 'pointer'
3574
- },
3575
- '&:focus': {
3576
- backgroundColor: theme.colors.actionTertiaryBackgroundHover
3577
- },
3578
- '&[data-disabled]': {
3579
- pointerEvents: 'none',
3580
- color: theme.colors.actionDisabledText
3581
- }
3582
- });
3583
- const dangerItemStyles = theme => ({
3584
- color: theme.colors.textValidationDanger,
3585
- '&:hover, &:focus': {
3586
- backgroundColor: theme.colors.actionDangerDefaultBackgroundHover
3587
- }
3588
- });
3589
- const infoIconStyles = theme => ({
3590
- display: 'inline-flex',
3591
- paddingLeft: theme.spacing.xs,
3592
- color: theme.colors.textSecondary,
3593
- pointerEvents: 'all'
3594
- });
3595
- const checkboxItemStyles = theme => ({
3596
- position: 'relative',
3597
- paddingLeft: CONSTANTS.checkboxIconWidth(theme) + CONSTANTS.checkboxPaddingLeft(theme) + CONSTANTS.checkboxPaddingRight(theme)
3598
- });
3599
- const metaTextStyles = theme => ({
3600
- color: theme.colors.textSecondary,
3601
- fontSize: theme.typography.fontSizeSm,
3602
- '[data-disabled] &': {
3603
- color: theme.colors.actionDisabledText
3604
- }
3605
- });
3606
- const dropdownSeparatorStyles = theme => ({
3607
- height: 1,
3608
- margin: `${theme.spacing.xs}px ${theme.spacing.sm}px`,
3609
- backgroundColor: theme.colors.borderDecorative
3610
- });
3611
-
3612
- var DropdownMenu = /*#__PURE__*/Object.freeze({
3613
- __proto__: null,
3614
- Arrow: Arrow,
3615
- CheckboxItem: CheckboxItem,
3616
- Content: Content,
3617
- Group: Group,
3618
- HintColumn: HintColumn,
3619
- HintRow: HintRow,
3620
- IconWrapper: IconWrapper,
3621
- Item: Item,
3622
- ItemIndicator: ItemIndicator,
3623
- Label: Label,
3624
- RadioGroup: RadioGroup,
3625
- RadioItem: RadioItem,
3626
- Root: Root,
3627
- Separator: Separator,
3628
- Sub: Sub,
3629
- SubContent: SubContent,
3630
- SubTrigger: SubTrigger,
3631
- Trigger: Trigger,
3632
- TriggerItem: TriggerItem,
3633
- dropdownContentStyles: dropdownContentStyles,
3634
- dropdownItemStyles: dropdownItemStyles,
3635
- dropdownSeparatorStyles: dropdownSeparatorStyles
3636
- });
3393
+ return () => {
3394
+ resizeObserver.disconnect();
3395
+ cancelAnimationFrame(timeoutId);
3396
+ };
3397
+ }, [requestedDirection, enabled, ref, responsive]);
3398
+ return {
3399
+ direction
3400
+ };
3401
+ }
3637
3402
 
3638
- export { FaceFrownIcon$1 as $, ApplyDesignSystemContextOverrides as A, Button as B, CloseIcon$1 as C, DesignSystemAntDConfigProvider as D, getPrimaryStyles as E, getDisabledStyles as F, useDesignSystemFlags as G, getButtonEmotionStyles as H, Icon as I, DesignSystemEventProviderComponentTypes as J, DesignSystemEventProviderAnalyticsEventTypes as K, LoadingState as L, useDesignSystemEventComponentCallbacks as M, DesignSystemEventProvider as N, DesignSystemThemeContext as O, DesignSystemContext as P, DesignSystemThemeProvider as Q, RestoreAntDDefaultClsPrefix as R, Spinner as S, Typography as T, DesignSystemProvider as U, ApplyDesignSystemFlags as V, WarningIcon$1 as W, useAntDConfigProviderContext as X, DropdownMenu as Y, WithDesignSystemThemeHoc as Z, CursorIcon$1 as _, getDarkModePortalStyles as a, FaceNeutralIcon$1 as a0, FaceSmileIcon$1 as a1, MegaphoneIcon$1 as a2, NewWindowIcon$1 as a3, LoadingStateContext as a4, getTypographyColor as a5, getBottomOnlyShadowScrollStyles as a6, ColorVars as a7, primitiveColors as a8, dropdownItemStyles as a9, dropdownSeparatorStyles as aa, ChevronRightIcon$1 as b, useDesignSystemContext as c, Tooltip as d, InfoIcon$1 as e, Input as f, getAnimationCss as g, CheckIcon$1 as h, importantify as i, getValidationStateColor as j, getShadowScrollStyles as k, DangerIcon$1 as l, LoadingIcon$1 as m, dropdownContentStyles as n, useUniqueId as o, Title as p, AccessibleContainer as q, ChevronLeftIcon$1 as r, safex as s, DU_BOIS_ENABLE_ANIMATION_CLASSNAME as t, useDesignSystemTheme as u, visuallyHidden as v, lightColorList as w, Root as x, Trigger as y, getDefaultStyles as z };
3639
- //# sourceMappingURL=DropdownMenu-dbeef1b7.js.map
3403
+ export { getInputStyles as $, ApplyDesignSystemContextOverrides as A, Button as B, CloseIcon$1 as C, DesignSystemAntDConfigProvider as D, DesignSystemEventProviderComponentTypes as E, DesignSystemEventProviderAnalyticsEventTypes as F, useDesignSystemEventComponentCallbacks as G, DesignSystemEventProvider as H, Icon as I, DesignSystemThemeContext as J, DesignSystemContext as K, LoadingState as L, DesignSystemThemeProvider as M, DesignSystemProvider as N, ApplyDesignSystemFlags as O, useAntDConfigProviderContext as P, WithDesignSystemThemeHoc as Q, RestoreAntDDefaultClsPrefix as R, Spinner as S, Typography as T, CursorIcon$1 as U, FaceFrownIcon$1 as V, WarningIcon$1 as W, FaceNeutralIcon$1 as X, FaceSmileIcon$1 as Y, MegaphoneIcon$1 as Z, NewWindowIcon$1 as _, getDarkModePortalStyles as a, LoadingStateContext as a0, getTypographyColor as a1, getBottomOnlyShadowScrollStyles as a2, ColorVars as a3, primitiveColors as a4, ChevronRightIcon$1 as b, useUniqueId as c, useDesignSystemContext as d, CheckIcon$1 as e, Input as f, getAnimationCss as g, getValidationStateColor as h, importantify as i, getShadowScrollStyles as j, DangerIcon$1 as k, LoadingIcon$1 as l, Title as m, AccessibleContainer as n, ChevronLeftIcon$1 as o, DU_BOIS_ENABLE_ANIMATION_CLASSNAME as p, lightColorList as q, getDefaultStyles as r, safex as s, getPrimaryStyles as t, useDesignSystemTheme as u, visuallyHidden as v, getDisabledStyles as w, useDesignSystemFlags as x, Stepper as y, getButtonEmotionStyles as z };
3404
+ //# sourceMappingURL=Stepper-839336b1.js.map