@databricks/design-system 1.4.0 → 1.5.0

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 (40) hide show
  1. package/dist/design-system/Button/Button.d.ts +2 -1
  2. package/dist/design-system/Button/Button.d.ts.map +1 -1
  3. package/dist/design-system/Button/styles.d.ts +1 -0
  4. package/dist/design-system/Button/styles.d.ts.map +1 -1
  5. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts +3 -2
  6. package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -1
  7. package/dist/design-system/Dropdown/Dropdown.d.ts +3 -0
  8. package/dist/design-system/Dropdown/Dropdown.d.ts.map +1 -1
  9. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts +11 -1
  10. package/dist/design-system/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  11. package/dist/design-system/FormMessage/FormMessage.d.ts.map +1 -1
  12. package/dist/design-system/FormV2/FormV2.d.ts +6 -0
  13. package/dist/design-system/FormV2/FormV2.d.ts.map +1 -1
  14. package/dist/design-system/Hint/Hint.d.ts +2 -0
  15. package/dist/design-system/Hint/Hint.d.ts.map +1 -0
  16. package/dist/design-system/Input/Input.d.ts.map +1 -1
  17. package/dist/design-system/Label/Label.d.ts +6 -0
  18. package/dist/design-system/Label/Label.d.ts.map +1 -0
  19. package/dist/design-system/Menu/Menu.d.ts +6 -1
  20. package/dist/design-system/Menu/Menu.d.ts.map +1 -1
  21. package/dist/design-system/Select/Select.d.ts +21 -15
  22. package/dist/design-system/Select/Select.d.ts.map +1 -1
  23. package/dist/design-system/Spinner/Spinner.d.ts +7 -3
  24. package/dist/design-system/Spinner/Spinner.d.ts.map +1 -1
  25. package/dist/design-system/Tree/Tree.d.ts.map +1 -1
  26. package/dist/design-system/Typography/Link.d.ts.map +1 -1
  27. package/dist/design-system/utils/css-utils.d.ts +14 -1
  28. package/dist/design-system/utils/css-utils.d.ts.map +1 -1
  29. package/dist/flags.d.ts +3 -1
  30. package/dist/flags.d.ts.map +1 -1
  31. package/dist/index-dark.css +89 -89
  32. package/dist/index.css +89 -89
  33. package/dist/index.js +405 -248
  34. package/dist/index.js.map +1 -1
  35. package/dist/theme/spacing.d.ts +8 -0
  36. package/dist/theme/spacing.d.ts.map +1 -1
  37. package/dist/theme-dark.json +1 -0
  38. package/dist/theme-default.json +1 -0
  39. package/dist/tsconfig.build.tsbuildinfo +1 -0
  40. package/package.json +8 -7
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import React__default, { createContext, useRef, useState, useEffect, useLayoutEffect as useLayoutEffect$1, Component, useMemo as useMemo$1, useCallback, forwardRef, useImperativeHandle, useContext, isValidElement as isValidElement$1, cloneElement as cloneElement$1 } from 'react';
3
3
  import AntDIcon from '@ant-design/icons';
4
4
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
5
- import { useTheme, ThemeProvider, css as css$1, keyframes, ClassNames } from '@emotion/react';
5
+ import { useTheme, ThemeProvider, css as css$1, ClassNames, keyframes } from '@emotion/react';
6
6
  import classNames from 'classnames';
7
7
  import chroma from 'chroma-js';
8
8
  import _extends$1 from '@babel/runtime/helpers/esm/extends';
@@ -11319,11 +11319,11 @@ var Option$2 = function Option() {
11319
11319
  Option$2.isSelectOption = true;
11320
11320
 
11321
11321
  /** This is a placeholder, not real render in dom */
11322
- var OptGroup = function OptGroup() {
11322
+ var OptGroup$1 = function OptGroup() {
11323
11323
  return null;
11324
11324
  };
11325
11325
 
11326
- OptGroup.isSelectOptGroup = true;
11326
+ OptGroup$1.isSelectOptGroup = true;
11327
11327
 
11328
11328
  function convertNodeToOption(node) {
11329
11329
  var key = node.key,
@@ -17073,7 +17073,7 @@ var Select$2 = /*#__PURE__*/function (_React$Component) {
17073
17073
  }(React.Component);
17074
17074
 
17075
17075
  Select$2.Option = Option$2;
17076
- Select$2.OptGroup = OptGroup;
17076
+ Select$2.OptGroup = OptGroup$1;
17077
17077
 
17078
17078
  function getIcons(_ref) {
17079
17079
  var suffixIcon = _ref.suffixIcon,
@@ -17300,7 +17300,7 @@ var SelectRef = /*#__PURE__*/React.forwardRef(InternalSelect);
17300
17300
  var Select$1 = SelectRef;
17301
17301
  Select$1.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
17302
17302
  Select$1.Option = Option$2;
17303
- Select$1.OptGroup = OptGroup;
17303
+ Select$1.OptGroup = OptGroup$1;
17304
17304
  var AntDSelect = Select$1;
17305
17305
 
17306
17306
  var isValidElement = React.isValidElement;
@@ -37737,7 +37737,7 @@ Spin.defaultProps = {
37737
37737
  size: 'default',
37738
37738
  wrapperClassName: ''
37739
37739
  };
37740
- var AntDSpin = Spin;
37740
+ var Spin$1 = Spin;
37741
37741
 
37742
37742
  var Pager = function Pager(props) {
37743
37743
  var _classNames;
@@ -46135,7 +46135,7 @@ function Table$1(props) {
46135
46135
  return /*#__PURE__*/React.createElement("div", {
46136
46136
  className: wrapperClassNames,
46137
46137
  style: style
46138
- }, /*#__PURE__*/React.createElement(AntDSpin, _extends$1({
46138
+ }, /*#__PURE__*/React.createElement(Spin$1, _extends$1({
46139
46139
  spinning: false
46140
46140
  }, spinProps), topPaginationNode, /*#__PURE__*/React.createElement(Table$2, _extends$1({}, tableProps, {
46141
46141
  columns: mergedColumns,
@@ -49694,6 +49694,15 @@ const spacing = {
49694
49694
  btnPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 2,
49695
49695
  btnPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 2,
49696
49696
  btnPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 2,
49697
+ // Input
49698
+ inputPaddingHorizontal: DEFAULT_SPACING_UNIT * 1.5,
49699
+ inputPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 1.5,
49700
+ inputPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 1.5,
49701
+ inputPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 1.5,
49702
+ inputPaddingVertical: spacing.xs + 1,
49703
+ inputPaddingVerticalBase: spacing.xs + 1,
49704
+ inputPaddingVerticalSm: spacing.xs + 1,
49705
+ inputPaddingVerticalLg: spacing.xs + 1,
49697
49706
  // Modal
49698
49707
  modalPadding: MODAL_PADDING,
49699
49708
  modalLessPadding: MODAL_PADDING - 20,
@@ -49811,6 +49820,7 @@ const DuboisContextDefaults = {
49811
49820
  flags: {}
49812
49821
  };
49813
49822
  const DesignSystemContext = /*#__PURE__*/createContext(DuboisContextDefaults);
49823
+ const DU_BOIS_ENABLE_ANIMATION_CLASSNAME = 'du-bois-enable-animation';
49814
49824
  function getAnimationCss(enableAnimation) {
49815
49825
  const disableAnimationCss = {
49816
49826
  animationDuration: '0s !important',
@@ -49821,7 +49831,7 @@ function getAnimationCss(enableAnimation) {
49821
49831
  '&::before': disableAnimationCss,
49822
49832
  '&::after': disableAnimationCss,
49823
49833
  // Also apply to all child elements with a class that starts with our prefix
49824
- '[class*=du-bois]': { ...disableAnimationCss,
49834
+ ["[class*=du-bois]:not(.".concat(DU_BOIS_ENABLE_ANIMATION_CLASSNAME, ", .").concat(DU_BOIS_ENABLE_ANIMATION_CLASSNAME, " *)")]: { ...disableAnimationCss,
49825
49835
  // Also target any pseudo-elements associated with those elements, since these can also be animated.
49826
49836
  '&::before': disableAnimationCss,
49827
49837
  '&::after': disableAnimationCss
@@ -54220,6 +54230,36 @@ function getTypographyColor(theme, key, fallbackColor) {
54220
54230
 
54221
54231
  return fallbackColor !== null && fallbackColor !== void 0 ? fallbackColor : theme.colors.textPrimary;
54222
54232
  }
54233
+ /**
54234
+ * Returns validation color based on state, has default validation colors if params are not provided
54235
+ * @param theme
54236
+ * @param validationState
54237
+ * @param errorColor
54238
+ * @param warningColor
54239
+ * @param successColor
54240
+ */
54241
+
54242
+ function getValidationStateColor(theme, validationState) {
54243
+ let {
54244
+ errorColor,
54245
+ warningColor,
54246
+ successColor
54247
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
54248
+
54249
+ switch (validationState) {
54250
+ case 'error':
54251
+ return errorColor || theme.colors.actionDangerPrimaryBackgroundDefault;
54252
+
54253
+ case 'warning':
54254
+ return warningColor || theme.colors.textValidationWarning;
54255
+
54256
+ case 'success':
54257
+ return successColor || theme.colors.textValidationSuccess;
54258
+
54259
+ default:
54260
+ return undefined;
54261
+ }
54262
+ }
54223
54263
 
54224
54264
  function getDefaultStyles(theme) {
54225
54265
  return {
@@ -54257,7 +54297,7 @@ function getPrimaryStyles(theme) {
54257
54297
  }
54258
54298
  };
54259
54299
  }
54260
- function getLinkStyles(theme) {
54300
+ function getLinkStyles$1(theme) {
54261
54301
  return {
54262
54302
  backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
54263
54303
  borderColor: theme.colors.actionTertiaryBackgroundDefault,
@@ -54334,6 +54374,23 @@ function getDisabledStyles(theme) {
54334
54374
  }
54335
54375
  };
54336
54376
  }
54377
+ function getDisabledTertiaryStyles(theme) {
54378
+ return {
54379
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
54380
+ borderColor: 'transparent',
54381
+ color: theme.colors.actionDisabledText,
54382
+ '&:hover': {
54383
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
54384
+ borderColor: 'transparent',
54385
+ color: theme.colors.actionDisabledText
54386
+ },
54387
+ '&:active': {
54388
+ backgroundColor: theme.colors.actionTertiaryBackgroundDefault,
54389
+ borderColor: 'transparent',
54390
+ color: theme.colors.actionDisabledText
54391
+ }
54392
+ };
54393
+ }
54337
54394
 
54338
54395
  function getEndIconClsName(theme) {
54339
54396
  return "".concat(theme.general.iconfontCssPrefix, "-btn-end-icon");
@@ -54348,7 +54405,8 @@ const getButtonEmotionStyles = _ref => {
54348
54405
  onlyIcon,
54349
54406
  enableAnimation,
54350
54407
  size,
54351
- type
54408
+ type,
54409
+ isFlex
54352
54410
  } = _ref;
54353
54411
  const clsIcon = ".".concat(theme.general.iconfontCssPrefix);
54354
54412
  const clsEndIcon = ".".concat(getEndIconClsName(theme));
@@ -54372,25 +54430,30 @@ const getButtonEmotionStyles = _ref => {
54372
54430
  };
54373
54431
  const iconCss = {
54374
54432
  fontSize: theme.general.buttonInnerHeight - 4,
54375
- // verticalAlign used by AntD to move icon and label to center
54376
- // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
54377
- // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
54378
- verticalAlign: -5,
54379
- lineHeight: 0,
54380
- ...(onlyIcon && {
54381
- verticalAlign: -3
54382
- }),
54383
- // verticalAlign used by AntD to move icon and label to center
54384
- // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
54385
- // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
54386
- // Need to make sure not to apply this to regular buttons as it will offset the icons
54387
- ...(!onlyIcon && {
54388
- verticalAlign: -4
54433
+ ...(!isFlex && {
54434
+ // verticalAlign used by AntD to move icon and label to center
54435
+ // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
54436
+ // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
54437
+ verticalAlign: -5,
54438
+ ...(onlyIcon && {
54439
+ verticalAlign: -3
54440
+ }),
54441
+ // verticalAlign used by AntD to move icon and label to center
54442
+ // TODO(schs): Try to move buttons to flexbox to solve this. Main problem is that flex-inline and inline-block
54443
+ // behave differently (vertically align of multiple buttons is off). See https://codepen.io/qfactor/pen/JXVzBe
54444
+ // Need to make sure not to apply this to regular buttons as it will offset the icons
54445
+ ...(!onlyIcon && {
54446
+ verticalAlign: -4
54447
+ })
54389
54448
  }),
54449
+ lineHeight: 0,
54390
54450
  ...(size === 'small' && {
54391
54451
  lineHeight: theme.typography.lineHeightSm,
54392
54452
  ...(onlyIcon && {
54393
- fontSize: 16
54453
+ fontSize: 16,
54454
+ ...(isFlex && {
54455
+ height: 16
54456
+ })
54394
54457
  })
54395
54458
  })
54396
54459
  };
@@ -54402,6 +54465,12 @@ const getButtonEmotionStyles = _ref => {
54402
54465
  lineHeight: theme.typography.lineHeightBase,
54403
54466
  boxShadow: 'none',
54404
54467
  height: theme.general.heightSm,
54468
+ ...(isFlex && {
54469
+ display: 'inline-flex',
54470
+ alignItems: 'center',
54471
+ justifyContent: 'center',
54472
+ verticalAlign: 'middle'
54473
+ }),
54405
54474
  ...(!onlyIcon && {
54406
54475
  '&&': {
54407
54476
  padding: '4px 12px',
@@ -54432,7 +54501,7 @@ const getButtonEmotionStyles = _ref => {
54432
54501
  ...getDefaultStyles(theme),
54433
54502
  ["&".concat(classPrimary)]: { ...getPrimaryStyles(theme)
54434
54503
  },
54435
- ["&".concat(classLink)]: { ...getLinkStyles(theme),
54504
+ ["&".concat(classLink)]: { ...getLinkStyles$1(theme),
54436
54505
  ...(type === 'link' && {
54437
54506
  padding: 'unset',
54438
54507
  height: 'auto',
@@ -54467,8 +54536,10 @@ const getButtonEmotionStyles = _ref => {
54467
54536
  // This would break vertical centering of loading circle when onlyIcon is true
54468
54537
  position: 'absolute'
54469
54538
  }),
54470
- // Normally we'd do `transform: translateX(-50%)` but `antd` crushes that with injected inline `style`.
54471
- left: 'calc(50% - 7px)',
54539
+ ...(!isFlex && {
54540
+ // Normally we'd do `transform: translateX(-50%)` but `antd` crushes that with injected inline `style`.
54541
+ left: 'calc(50% - 7px)'
54542
+ }),
54472
54543
  // Re-enable animation for the loading spinner, since it can be disabled by the global animation CSS.
54473
54544
  svg: {
54474
54545
  animationDuration: '1s !important'
@@ -54522,9 +54593,11 @@ const getButtonEmotionStyles = _ref => {
54522
54593
  ...getAnimationCss(enableAnimation)
54523
54594
  }; // Moved outside main style object because state & selector matching in the already existing object keys can create bugs and unwanted overwrites
54524
54595
 
54525
- const typeStyles = {
54526
- ["&:enabled:not(".concat(clsIconOnly, ")")]: { ...(type === 'tertiary' && tertiaryColors)
54527
- }
54596
+ const typeStyles = { ...(type === 'tertiary' && {
54597
+ ["&:enabled:not(".concat(clsIconOnly, ")")]: tertiaryColors,
54598
+ ["&".concat(classLink, "[disabled]")]: { ...getDisabledTertiaryStyles(theme)
54599
+ }
54600
+ })
54528
54601
  };
54529
54602
  const importantStyles = importantify(styles);
54530
54603
  const importantTypeStyles = importantify(typeStyles);
@@ -54544,6 +54617,9 @@ _ref2, ref) {
54544
54617
  theme,
54545
54618
  classNamePrefix
54546
54619
  } = useDesignSystemTheme();
54620
+ const {
54621
+ USE_FLEX_BUTTON: isFlex
54622
+ } = useDesignSystemFlags();
54547
54623
  const clsEndIcon = getEndIconClsName(theme);
54548
54624
  return jsx(Button$3, { ...props,
54549
54625
  css: getButtonEmotionStyles({
@@ -54555,7 +54631,8 @@ _ref2, ref) {
54555
54631
  danger: Boolean(props.danger),
54556
54632
  enableAnimation: theme.options.enableAnimation,
54557
54633
  size: size || 'middle',
54558
- type
54634
+ type,
54635
+ isFlex
54559
54636
  }),
54560
54637
  href: props.disabled ? undefined : props.href,
54561
54638
  ...dangerouslySetAntdProps,
@@ -54563,10 +54640,19 @@ _ref2, ref) {
54563
54640
  type: type === 'tertiary' ? 'link' : type,
54564
54641
  children: children && jsxs("span", {
54565
54642
  style: {
54566
- visibility: props !== null && props !== void 0 && props.loading ? 'hidden' : 'visible'
54643
+ visibility: props !== null && props !== void 0 && props.loading ? 'hidden' : 'visible',
54644
+ ...(isFlex && {
54645
+ display: 'inline-flex',
54646
+ alignItems: 'center'
54647
+ })
54567
54648
  },
54568
54649
  children: [children, endIcon && jsx("span", {
54569
54650
  className: clsEndIcon,
54651
+ style: { ...(isFlex && {
54652
+ display: 'inline-flex',
54653
+ alignItems: 'center'
54654
+ })
54655
+ },
54570
54656
  children: endIcon
54571
54657
  })]
54572
54658
  })
@@ -55044,6 +55130,9 @@ const LegacyDatePicker = Object.assign(DuboisDatePicker, {
55044
55130
  YearPicker
55045
55131
  });
55046
55132
 
55133
+ /**
55134
+ * @deprecated Use `DropdownMenu` instead.
55135
+ */
55047
55136
  const Dropdown = _ref => {
55048
55137
  let {
55049
55138
  dangerouslySetAntdProps,
@@ -55071,60 +55160,61 @@ const Content$1 = /*#__PURE__*/forwardRef(function Content(_ref, ref) {
55071
55160
  minWidth = 220,
55072
55161
  ...props
55073
55162
  } = _ref;
55074
- return jsx(DropdownMenu$1.Content, {
55075
- ref: ref,
55076
- css: theme => ({
55077
- backgroundColor: theme.colors.backgroundPrimary,
55078
- minWidth: minWidth,
55079
- color: theme.colors.textPrimary,
55080
- lineHeight: theme.typography.lineHeightBase,
55081
- border: "1px solid ".concat(theme.colors.borderDecorative),
55082
- borderRadius: theme.borders.borderRadiusMd,
55083
- padding: "".concat(theme.spacing.xs, "px 0"),
55084
- boxShadow: "0px 4px 16px 0px rgba(205, 218, 229, 1)",
55085
- userSelect: 'none',
55086
- '@media (prefers-reduced-motion: no-preference)': {
55087
- animationDuration: '400ms',
55088
- animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',
55089
- animationFillMode: 'forwards',
55090
- willChange: 'transform, opacity',
55091
- '&[data-state="open"]': {
55092
- '&[data-side="top"]': {
55093
- animationName: slideDownAndFade
55094
- },
55095
- '&[data-side="right"]': {
55096
- animationName: slideLeftAndFade
55097
- },
55098
- '&[data-side="bottom"]': {
55099
- animationName: slideUpAndFade
55100
- },
55101
- '&[data-side="left"]': {
55102
- animationName: slideRightAndFade
55103
- }
55104
- }
55105
- }
55106
- }),
55107
- sideOffset: 4,
55108
- ...props,
55109
- children: children
55163
+ const {
55164
+ getPopupContainer
55165
+ } = useDesignSystemContext();
55166
+ return jsx(DropdownMenu$1.Portal, {
55167
+ container: getPopupContainer && getPopupContainer(),
55168
+ children: jsx(DropdownMenu$1.Content, {
55169
+ ref: ref,
55170
+ css: [contentStyles, {
55171
+ minWidth
55172
+ }, process.env.NODE_ENV === "production" ? "" : ";label:Content;"],
55173
+ sideOffset: 4,
55174
+ ...props,
55175
+ children: children
55176
+ })
55110
55177
  });
55111
55178
  });
55112
- const Trigger = /*#__PURE__*/forwardRef(function Trigger(_ref2, ref) {
55179
+ const SubContent = /*#__PURE__*/forwardRef(function Content(_ref2, ref) {
55113
55180
  let {
55114
55181
  children,
55182
+ minWidth = 220,
55115
55183
  ...props
55116
55184
  } = _ref2;
55185
+ const {
55186
+ getPopupContainer
55187
+ } = useDesignSystemContext();
55188
+ return jsx(DropdownMenu$1.Portal, {
55189
+ container: getPopupContainer && getPopupContainer(),
55190
+ children: jsx(DropdownMenu$1.SubContent, {
55191
+ ref: ref,
55192
+ css: [contentStyles, {
55193
+ minWidth
55194
+ }, process.env.NODE_ENV === "production" ? "" : ";label:SubContent;"],
55195
+ sideOffset: -2,
55196
+ alignOffset: -5,
55197
+ ...props,
55198
+ children: children
55199
+ })
55200
+ });
55201
+ });
55202
+ const Trigger = /*#__PURE__*/forwardRef(function Trigger(_ref3, ref) {
55203
+ let {
55204
+ children,
55205
+ ...props
55206
+ } = _ref3;
55117
55207
  return jsx(DropdownMenu$1.Trigger, {
55118
55208
  ref: ref,
55119
55209
  ...props,
55120
55210
  children: children
55121
55211
  });
55122
55212
  });
55123
- const Item = /*#__PURE__*/forwardRef(function Item(_ref3, ref) {
55213
+ const Item = /*#__PURE__*/forwardRef(function Item(_ref4, ref) {
55124
55214
  let {
55125
55215
  children,
55126
55216
  ...props
55127
- } = _ref3;
55217
+ } = _ref4;
55128
55218
  return jsx(DropdownMenu$1.Item, {
55129
55219
  css: itemStyles,
55130
55220
  ref: ref,
@@ -55132,11 +55222,11 @@ const Item = /*#__PURE__*/forwardRef(function Item(_ref3, ref) {
55132
55222
  children: children
55133
55223
  });
55134
55224
  });
55135
- const Label = /*#__PURE__*/forwardRef(function Label(_ref4, ref) {
55225
+ const Label = /*#__PURE__*/forwardRef(function Label(_ref5, ref) {
55136
55226
  let {
55137
55227
  children,
55138
55228
  ...props
55139
- } = _ref4;
55229
+ } = _ref5;
55140
55230
  return jsx(DropdownMenu$1.Label, {
55141
55231
  ref: ref,
55142
55232
  css: [itemStyles, theme => ({
@@ -55146,11 +55236,11 @@ const Label = /*#__PURE__*/forwardRef(function Label(_ref4, ref) {
55146
55236
  children: children
55147
55237
  });
55148
55238
  });
55149
- const Separator = /*#__PURE__*/forwardRef(function Separator(_ref5, ref) {
55239
+ const Separator = /*#__PURE__*/forwardRef(function Separator(_ref6, ref) {
55150
55240
  let {
55151
55241
  children,
55152
55242
  ...props
55153
- } = _ref5;
55243
+ } = _ref6;
55154
55244
  return jsx(DropdownMenu$1.Separator, {
55155
55245
  ref: ref,
55156
55246
  css: theme => ({
@@ -55162,18 +55252,18 @@ const Separator = /*#__PURE__*/forwardRef(function Separator(_ref5, ref) {
55162
55252
  children: children
55163
55253
  });
55164
55254
  });
55165
- const TriggerItem = /*#__PURE__*/forwardRef(function TriggerItem(_ref6, ref) {
55255
+ const SubTrigger = /*#__PURE__*/forwardRef(function TriggerItem(_ref7, ref) {
55166
55256
  let {
55167
55257
  children,
55168
55258
  ...props
55169
- } = _ref6;
55170
- return jsxs(DropdownMenu$1.TriggerItem, {
55259
+ } = _ref7;
55260
+ return jsxs(DropdownMenu$1.SubTrigger, {
55171
55261
  ref: ref,
55172
55262
  css: [itemStyles, theme => ({
55173
55263
  '&[data-state="open"]': {
55174
55264
  backgroundColor: theme.colors.actionTertiaryBackgroundHover
55175
55265
  }
55176
- }), process.env.NODE_ENV === "production" ? "" : ";label:TriggerItem;"],
55266
+ }), process.env.NODE_ENV === "production" ? "" : ";label:SubTrigger;"],
55177
55267
  ...props,
55178
55268
  children: [children, jsx(HintColumn, {
55179
55269
  css: theme => ({
@@ -55190,11 +55280,17 @@ const TriggerItem = /*#__PURE__*/forwardRef(function TriggerItem(_ref6, ref) {
55190
55280
  })]
55191
55281
  });
55192
55282
  });
55193
- const CheckboxItem = /*#__PURE__*/forwardRef(function CheckboxItem(_ref7, ref) {
55283
+ /**
55284
+ * Deprecated. Use `SubTrigger` instead.
55285
+ * @deprecated
55286
+ */
55287
+
55288
+ const TriggerItem = SubTrigger;
55289
+ const CheckboxItem = /*#__PURE__*/forwardRef(function CheckboxItem(_ref8, ref) {
55194
55290
  let {
55195
55291
  children,
55196
55292
  ...props
55197
- } = _ref7;
55293
+ } = _ref8;
55198
55294
  return jsx(DropdownMenu$1.CheckboxItem, {
55199
55295
  ref: ref,
55200
55296
  css: [itemStyles, checkboxItemStyles, process.env.NODE_ENV === "production" ? "" : ";label:CheckboxItem;"],
@@ -55202,11 +55298,11 @@ const CheckboxItem = /*#__PURE__*/forwardRef(function CheckboxItem(_ref7, ref) {
55202
55298
  children: children
55203
55299
  });
55204
55300
  });
55205
- const ItemIndicator = /*#__PURE__*/forwardRef(function ItemIndicator(_ref8, ref) {
55301
+ const ItemIndicator = /*#__PURE__*/forwardRef(function ItemIndicator(_ref9, ref) {
55206
55302
  let {
55207
55303
  children,
55208
55304
  ...props
55209
- } = _ref8;
55305
+ } = _ref9;
55210
55306
  return jsx(DropdownMenu$1.ItemIndicator, {
55211
55307
  ref: ref,
55212
55308
  css: theme => ({
@@ -55222,11 +55318,11 @@ const ItemIndicator = /*#__PURE__*/forwardRef(function ItemIndicator(_ref8, ref)
55222
55318
  })
55223
55319
  });
55224
55320
  });
55225
- const Arrow = /*#__PURE__*/forwardRef(function Arrow(_ref9, ref) {
55321
+ const Arrow = /*#__PURE__*/forwardRef(function Arrow(_ref10, ref) {
55226
55322
  let {
55227
55323
  children,
55228
55324
  ...props
55229
- } = _ref9;
55325
+ } = _ref10;
55230
55326
  const {
55231
55327
  theme
55232
55328
  } = useDesignSystemTheme();
@@ -55236,21 +55332,27 @@ const Arrow = /*#__PURE__*/forwardRef(function Arrow(_ref9, ref) {
55236
55332
  stroke: theme.colors.borderDecorative,
55237
55333
  strokeDashoffset: -CONSTANTS.arrowBottomLength(),
55238
55334
  strokeDasharray: CONSTANTS.arrowBottomLength() + 2 * CONSTANTS.arrowSide(),
55239
- strokeWidth: CONSTANTS.arrowStrokeWidth()
55335
+ strokeWidth: CONSTANTS.arrowStrokeWidth(),
55336
+ // TODO: This is a temporary fix for the alignment of the Arrow;
55337
+ // Radix has changed the implementation for v1.0.0 (uses floating-ui)
55338
+ // which has new behaviors for alignment that we don't want. Generally
55339
+ // we need to fix the arrow to always be aligned to the left of the menu (with
55340
+ // offset equal to border radius)
55341
+ position: 'relative',
55342
+ top: -1
55240
55343
  }, process.env.NODE_ENV === "production" ? "" : ";label:Arrow;"),
55241
55344
  ref: ref,
55242
55345
  width: 12,
55243
55346
  height: 6,
55244
- offset: theme.borders.borderRadiusMd,
55245
55347
  ...props,
55246
55348
  children: children
55247
55349
  });
55248
55350
  });
55249
- const RadioItem = /*#__PURE__*/forwardRef(function RadioItem(_ref10, ref) {
55351
+ const RadioItem = /*#__PURE__*/forwardRef(function RadioItem(_ref11, ref) {
55250
55352
  let {
55251
55353
  children,
55252
55354
  ...props
55253
- } = _ref10;
55355
+ } = _ref11;
55254
55356
  return jsx(DropdownMenu$1.RadioItem, {
55255
55357
  ref: ref,
55256
55358
  css: [itemStyles, checkboxItemStyles, process.env.NODE_ENV === "production" ? "" : ";label:RadioItem;"],
@@ -55260,13 +55362,14 @@ const RadioItem = /*#__PURE__*/forwardRef(function RadioItem(_ref10, ref) {
55260
55362
  }); // UNWRAPPED RADIX-UI-COMPONENTS
55261
55363
 
55262
55364
  const Group = DropdownMenu$1.Group;
55263
- const RadioGroup = DropdownMenu$1.RadioGroup; // EXTRA COMPONENTS
55365
+ const RadioGroup = DropdownMenu$1.RadioGroup;
55366
+ const Sub = DropdownMenu$1.Sub; // EXTRA COMPONENTS
55264
55367
 
55265
- const HintColumn = /*#__PURE__*/forwardRef(function HintColumn(_ref11, ref) {
55368
+ const HintColumn = /*#__PURE__*/forwardRef(function HintColumn(_ref12, ref) {
55266
55369
  let {
55267
55370
  children,
55268
55371
  ...props
55269
- } = _ref11;
55372
+ } = _ref12;
55270
55373
  return jsx("div", {
55271
55374
  ref: ref,
55272
55375
  css: [metaTextStyles, "margin-left:auto;" + (process.env.NODE_ENV === "production" ? "" : ";label:HintColumn;")],
@@ -55274,11 +55377,11 @@ const HintColumn = /*#__PURE__*/forwardRef(function HintColumn(_ref11, ref) {
55274
55377
  children: children
55275
55378
  });
55276
55379
  });
55277
- const HintRow = /*#__PURE__*/forwardRef(function HintRow(_ref12, ref) {
55380
+ const HintRow = /*#__PURE__*/forwardRef(function HintRow(_ref13, ref) {
55278
55381
  let {
55279
55382
  children,
55280
55383
  ...props
55281
- } = _ref12;
55384
+ } = _ref13;
55282
55385
  return jsx("div", {
55283
55386
  ref: ref,
55284
55387
  css: [metaTextStyles, "min-width:100%;" + (process.env.NODE_ENV === "production" ? "" : ";label:HintRow;")],
@@ -55286,11 +55389,11 @@ const HintRow = /*#__PURE__*/forwardRef(function HintRow(_ref12, ref) {
55286
55389
  children: children
55287
55390
  });
55288
55391
  });
55289
- const IconWrapper = /*#__PURE__*/forwardRef(function IconWrapper(_ref13, ref) {
55392
+ const IconWrapper = /*#__PURE__*/forwardRef(function IconWrapper(_ref14, ref) {
55290
55393
  let {
55291
55394
  children,
55292
55395
  ...props
55293
- } = _ref13;
55396
+ } = _ref14;
55294
55397
  return jsx("div", {
55295
55398
  ref: ref,
55296
55399
  css: theme => ({
@@ -55355,6 +55458,29 @@ const CONSTANTS = {
55355
55458
  }
55356
55459
 
55357
55460
  };
55461
+ const dropdownContentStyles = theme => ({
55462
+ backgroundColor: theme.colors.backgroundPrimary,
55463
+ color: theme.colors.textPrimary,
55464
+ lineHeight: theme.typography.lineHeightBase,
55465
+ border: "1px solid ".concat(theme.colors.borderDecorative),
55466
+ borderRadius: theme.borders.borderRadiusMd,
55467
+ padding: "".concat(theme.spacing.xs, "px 0"),
55468
+ boxShadow: theme.themeName !== 'dark' ? "0px 4px 16px 0px rgba(205, 218, 229, 1)" : undefined,
55469
+ userSelect: 'none',
55470
+ // Ant Design uses 1000s for their zIndex space; this ensures Radix works with that, but
55471
+ // we'll likely need to be sure that all Radix components are using the same zIndex going forward.
55472
+ zIndex: 2000,
55473
+ a: importantify({
55474
+ color: theme.colors.textPrimary,
55475
+ cursor: 'default',
55476
+ '&:hover, &:focus': {
55477
+ color: theme.colors.textPrimary
55478
+ }
55479
+ })
55480
+ });
55481
+
55482
+ const contentStyles = theme => ({ ...dropdownContentStyles(theme)
55483
+ });
55358
55484
 
55359
55485
  const itemStyles = theme => ({
55360
55486
  padding: "".concat(CONSTANTS.itemPaddingVertical(theme), "px ").concat(CONSTANTS.itemPaddingHorizontal(theme), "px"),
@@ -55381,58 +55507,18 @@ const metaTextStyles = theme => ({
55381
55507
  '[data-disabled] &': {
55382
55508
  color: theme.colors.actionDisabledText
55383
55509
  }
55384
- }); // ANIMATIONS
55385
-
55386
-
55387
- const slideUpAndFade = keyframes({
55388
- '0%': {
55389
- opacity: 0,
55390
- transform: 'translateY(2px)'
55391
- },
55392
- '100%': {
55393
- opacity: 1,
55394
- transform: 'translateY(0)'
55395
- }
55396
- });
55397
- const slideRightAndFade = keyframes({
55398
- '0%': {
55399
- opacity: 0,
55400
- transform: 'translateX(-2px)'
55401
- },
55402
- '100%': {
55403
- opacity: 1,
55404
- transform: 'translateX(0)'
55405
- }
55406
- });
55407
- const slideDownAndFade = keyframes({
55408
- '0%': {
55409
- opacity: 0,
55410
- transform: 'translateY(-2px)'
55411
- },
55412
- '100%': {
55413
- opacity: 1,
55414
- transform: 'translateY(0)'
55415
- }
55416
- });
55417
- const slideLeftAndFade = keyframes({
55418
- '0%': {
55419
- opacity: 0,
55420
- transform: 'translateX(2px)'
55421
- },
55422
- '100%': {
55423
- opacity: 1,
55424
- transform: 'translateX(0)'
55425
- }
55426
55510
  });
55427
55511
 
55428
55512
  var DropdownMenu = /*#__PURE__*/Object.freeze({
55429
55513
  __proto__: null,
55430
55514
  Root: Root,
55431
55515
  Content: Content$1,
55516
+ SubContent: SubContent,
55432
55517
  Trigger: Trigger,
55433
55518
  Item: Item,
55434
55519
  Label: Label,
55435
55520
  Separator: Separator,
55521
+ SubTrigger: SubTrigger,
55436
55522
  TriggerItem: TriggerItem,
55437
55523
  CheckboxItem: CheckboxItem,
55438
55524
  ItemIndicator: ItemIndicator,
@@ -55440,9 +55526,11 @@ var DropdownMenu = /*#__PURE__*/Object.freeze({
55440
55526
  RadioItem: RadioItem,
55441
55527
  Group: Group,
55442
55528
  RadioGroup: RadioGroup,
55529
+ Sub: Sub,
55443
55530
  HintColumn: HintColumn,
55444
55531
  HintRow: HintRow,
55445
- IconWrapper: IconWrapper
55532
+ IconWrapper: IconWrapper,
55533
+ dropdownContentStyles: dropdownContentStyles
55446
55534
  });
55447
55535
 
55448
55536
  const getFormItemEmotionStyles = _ref => {
@@ -55723,34 +55811,25 @@ const Header$1 = props => {
55723
55811
  });
55724
55812
  };
55725
55813
 
55726
- const getStateClass = function (classNamePrefix, validationState) {
55727
- let className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
55728
- let stateClass = '';
55729
-
55730
- if (validationState) {
55731
- stateClass = "".concat(classNamePrefix, "-input-").concat(validationState);
55732
- }
55733
-
55734
- return "".concat(stateClass, " ").concat(className).trim();
55735
- };
55736
-
55737
- const getInputEmotionStyles = (clsPrefix, theme) => {
55814
+ const getInputEmotionStyles = (clsPrefix, theme, _ref) => {
55815
+ let {
55816
+ validationState
55817
+ } = _ref;
55738
55818
  const affixClass = ".".concat(clsPrefix, "-input-affix-wrapper");
55739
55819
  const affixClassFocused = ".".concat(clsPrefix, "-input-affix-wrapper-focused");
55740
- const errorClass = ".".concat(clsPrefix, "-input-error");
55741
- const successClass = ".".concat(clsPrefix, "-input-success");
55742
- const warningClass = ".".concat(clsPrefix, "-input-warning");
55820
+ const validationColor = getValidationStateColor(theme, validationState);
55743
55821
  const styles = {
55744
55822
  '&&': {
55745
55823
  lineHeight: theme.typography.lineHeightBase,
55746
- paddingTop: 5,
55747
- paddingBottom: 5,
55748
55824
  minHeight: theme.general.heightSm,
55825
+ ...(validationState && {
55826
+ borderColor: validationColor
55827
+ }),
55749
55828
  '&:hover': {
55750
- borderColor: theme.colors.actionPrimaryBackgroundHover
55829
+ borderColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundHover
55751
55830
  },
55752
55831
  '&:focus': {
55753
- outlineColor: theme.colors.actionPrimaryBackgroundDefault,
55832
+ outlineColor: validationState ? validationColor : theme.colors.actionPrimaryBackgroundDefault,
55754
55833
  outlineWidth: 2,
55755
55834
  outlineOffset: -2,
55756
55835
  outlineStyle: 'solid',
@@ -55785,107 +55864,74 @@ const getInputEmotionStyles = (clsPrefix, theme) => {
55785
55864
  borderColor: 'transparent'
55786
55865
  }
55787
55866
  },
55788
- ["&".concat(warningClass)]: {
55789
- borderColor: theme.colors.textValidationWarning,
55790
- '&:hover': {
55791
- borderColor: theme.colors.textValidationWarning
55792
- },
55793
- '&:focus': {
55794
- outlineColor: theme.colors.textValidationWarning,
55795
- outlineOffset: -2
55796
- }
55797
- },
55798
- ["&".concat(successClass)]: {
55799
- borderColor: theme.colors.textValidationSuccess,
55800
- '&:hover': {
55801
- borderColor: theme.colors.textValidationSuccess
55802
- },
55803
- '&:focus': {
55804
- outlineColor: theme.colors.textValidationSuccess,
55805
- outlineOffset: -2
55806
- }
55807
- },
55808
- ["&".concat(errorClass)]: {
55809
- borderColor: theme.colors.actionDangerPrimaryBackgroundDefault,
55810
- '&:hover': {
55811
- borderColor: theme.colors.actionDangerPrimaryBackgroundDefault
55812
- },
55813
- '&:focus': {
55814
- outlineColor: theme.colors.actionDangerPrimaryBackgroundDefault,
55815
- outlineOffset: -2
55816
- }
55817
- },
55818
55867
  ...getAnimationCss(theme.options.enableAnimation)
55819
55868
  };
55820
55869
  return /*#__PURE__*/css$1(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:getInputEmotionStyles;");
55821
55870
  };
55822
55871
 
55823
- const TextArea = /*#__PURE__*/forwardRef(function TextArea(_ref, ref) {
55872
+ const TextArea = /*#__PURE__*/forwardRef(function TextArea(_ref2, ref) {
55824
55873
  let {
55825
- className,
55826
55874
  validationState,
55827
55875
  autoComplete = 'off',
55828
55876
  dangerouslySetAntdProps,
55829
55877
  dangerouslyAppendEmotionCSS,
55830
55878
  ...props
55831
- } = _ref;
55879
+ } = _ref2;
55832
55880
  const {
55833
55881
  classNamePrefix,
55834
55882
  theme
55835
55883
  } = useDesignSystemTheme();
55836
- const wrapperClass = getStateClass(classNamePrefix, validationState, className);
55837
55884
  return jsx(Input$2.TextArea, {
55838
- className: wrapperClass,
55839
55885
  ref: ref,
55840
55886
  autoComplete: autoComplete,
55841
- css: [getInputEmotionStyles(classNamePrefix, theme), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:TextArea;"],
55887
+ css: [getInputEmotionStyles(classNamePrefix, theme, {
55888
+ validationState
55889
+ }), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:TextArea;"],
55842
55890
  ...props,
55843
55891
  ...dangerouslySetAntdProps
55844
55892
  });
55845
55893
  });
55846
- const Password = /*#__PURE__*/forwardRef(function Password(_ref2, ref) {
55894
+ const Password = /*#__PURE__*/forwardRef(function Password(_ref3, ref) {
55847
55895
  let {
55848
- className,
55849
55896
  validationState,
55850
55897
  autoComplete = 'off',
55851
55898
  dangerouslySetAntdProps,
55852
55899
  dangerouslyAppendEmotionCSS,
55853
55900
  ...props
55854
- } = _ref2;
55901
+ } = _ref3;
55855
55902
  const {
55856
55903
  classNamePrefix,
55857
55904
  theme
55858
55905
  } = useDesignSystemTheme();
55859
- const wrapperClass = getStateClass(classNamePrefix, validationState, className);
55860
55906
  return jsx(Input$2.Password, {
55861
- className: wrapperClass,
55862
55907
  visibilityToggle: false,
55863
55908
  ref: ref,
55864
55909
  autoComplete: autoComplete,
55865
- css: [getInputEmotionStyles(classNamePrefix, theme), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:Password;"],
55910
+ css: [getInputEmotionStyles(classNamePrefix, theme, {
55911
+ validationState
55912
+ }), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:Password;"],
55866
55913
  ...props,
55867
55914
  ...dangerouslySetAntdProps
55868
55915
  });
55869
55916
  });
55870
- const DuboisInput = /*#__PURE__*/forwardRef(function Input(_ref3, ref) {
55917
+ const DuboisInput = /*#__PURE__*/forwardRef(function Input(_ref4, ref) {
55871
55918
  let {
55872
- className,
55873
55919
  validationState,
55874
55920
  autoComplete = 'off',
55875
55921
  dangerouslySetAntdProps,
55876
55922
  dangerouslyAppendEmotionCSS,
55877
55923
  ...props
55878
- } = _ref3;
55924
+ } = _ref4;
55879
55925
  const {
55880
55926
  classNamePrefix,
55881
55927
  theme
55882
55928
  } = useDesignSystemTheme();
55883
- const wrapperClass = getStateClass(classNamePrefix, validationState, className);
55884
55929
  return jsx(Input$2, {
55885
- className: wrapperClass,
55886
55930
  autoComplete: autoComplete,
55887
55931
  ref: ref,
55888
- css: [getInputEmotionStyles(classNamePrefix, theme), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:DuboisInput;"],
55932
+ css: [getInputEmotionStyles(classNamePrefix, theme, {
55933
+ validationState
55934
+ }), dangerouslyAppendEmotionCSS, process.env.NODE_ENV === "production" ? "" : ";label:DuboisInput;"],
55889
55935
  ...props,
55890
55936
  ...dangerouslySetAntdProps
55891
55937
  });
@@ -55922,6 +55968,9 @@ Layout.Footer = Footer;
55922
55968
  Layout.Sider = Sider;
55923
55969
  Layout.Content = Content;
55924
55970
 
55971
+ /**
55972
+ * @deprecated Use `DropdownMenu` instead.
55973
+ */
55925
55974
  const Menu = _ref => {
55926
55975
  let {
55927
55976
  dangerouslySetAntdProps,
@@ -55951,6 +56000,7 @@ Menu.SubMenu = function SubMenu(_ref2) {
55951
56000
  popupClassName: css({
55952
56001
  zIndex: theme.options.zIndexBase + 50
55953
56002
  }),
56003
+ popupOffset: [-6, -10],
55954
56004
  ...props,
55955
56005
  ...dangerouslySetAntdProps
55956
56006
  });
@@ -56750,7 +56800,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__$3() { return "You have tried to string
56750
56800
  function getSelectEmotionStyles(_ref) {
56751
56801
  let {
56752
56802
  clsPrefix,
56753
- theme
56803
+ theme,
56804
+ validationState
56754
56805
  } = _ref;
56755
56806
  const classFocused = ".".concat(clsPrefix, "-focused");
56756
56807
  const classOpen = ".".concat(clsPrefix, "-open");
@@ -56771,6 +56822,7 @@ function getSelectEmotionStyles(_ref) {
56771
56822
  const classSearchClear = ".".concat(clsPrefix, "-clear");
56772
56823
  const classAllowClear = ".".concat(clsPrefix, "-allow-clear");
56773
56824
  const classSearchInput = ".".concat(clsPrefix, "-selection-search-input");
56825
+ const validationColor = getValidationStateColor(theme, validationState);
56774
56826
  const styles = {
56775
56827
  '&:hover': {
56776
56828
  [classSelector]: {
@@ -56978,6 +57030,18 @@ function getSelectEmotionStyles(_ref) {
56978
57030
  backgroundColor: theme.colors.tagPress
56979
57031
  }
56980
57032
  },
57033
+ ...(validationState && {
57034
+ ["& > ".concat(classSelector)]: {
57035
+ borderColor: validationColor,
57036
+ '&:hover': {
57037
+ borderColor: validationColor
57038
+ }
57039
+ },
57040
+ ["&".concat(classFocused, " > ").concat(classSelector)]: {
57041
+ outlineColor: validationColor,
57042
+ outlineOffset: -2
57043
+ }
57044
+ }),
56981
57045
  ...getAnimationCss(theme.options.enableAnimation)
56982
57046
  };
56983
57047
  const importantStyles = importantify(styles);
@@ -56985,18 +57049,32 @@ function getSelectEmotionStyles(_ref) {
56985
57049
  }
56986
57050
 
56987
57051
  function getDropdownStyles(clsPrefix, theme) {
57052
+ let useNewDropdownStyle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
56988
57053
  const classItem = ".".concat(clsPrefix, "-item-option");
56989
57054
  const classItemActive = ".".concat(clsPrefix, "-item-option-active");
56990
57055
  const classItemSelected = ".".concat(clsPrefix, "-item-option-selected");
56991
57056
  const classItemState = ".".concat(clsPrefix, "-item-option-state");
56992
- const styles = {
56993
- borderColor: theme.colors.borderDecorative,
56994
- borderWidth: 1,
56995
- borderStyle: 'solid',
56996
- zIndex: theme.options.zIndexBase + 50,
57057
+ const classItemContent = ".".concat(clsPrefix, "-item-option-content");
57058
+ const CONTENT_LEFT_PADDING = 28;
57059
+ const styles = { ...(useNewDropdownStyle ? dropdownContentStyles(theme) : {
57060
+ borderColor: theme.colors.borderDecorative,
57061
+ borderWidth: 1,
57062
+ borderStyle: 'solid',
57063
+ zIndex: theme.options.zIndexBase + 50
57064
+ }),
56997
57065
  [classItem]: {
56998
- height: theme.general.heightSm
57066
+ height: theme.general.heightSm,
57067
+ ...(useNewDropdownStyle && {
57068
+ padding: '4px 8px',
57069
+ alignItems: 'center',
57070
+ lineHeight: theme.typography.lineHeightBase
57071
+ })
56999
57072
  },
57073
+ ...(useNewDropdownStyle && {
57074
+ [classItemContent]: {
57075
+ paddingLeft: CONTENT_LEFT_PADDING
57076
+ }
57077
+ }),
57000
57078
  [classItemActive]: {
57001
57079
  backgroundColor: theme.colors.actionTertiaryBackgroundHover,
57002
57080
  height: theme.general.heightSm,
@@ -57012,13 +57090,19 @@ function getDropdownStyles(clsPrefix, theme) {
57012
57090
  }
57013
57091
  },
57014
57092
  [classItemState]: {
57015
- color: theme.colors.textSecondary
57093
+ color: theme.colors.textSecondary,
57094
+ ...(useNewDropdownStyle && {
57095
+ position: 'absolute'
57096
+ })
57016
57097
  },
57017
57098
  [".".concat(clsPrefix, "-loading-options")]: {
57018
57099
  pointerEvents: 'none',
57019
57100
  margin: '0 auto',
57020
57101
  height: theme.general.heightSm,
57021
- display: 'block'
57102
+ display: 'block',
57103
+ ...(useNewDropdownStyle && {
57104
+ left: -CONTENT_LEFT_PADDING / 2
57105
+ })
57022
57106
  },
57023
57107
  ...getAnimationCss(theme.options.enableAnimation)
57024
57108
  };
@@ -57049,8 +57133,12 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
57049
57133
  function DuboisSelect(_ref2, ref) {
57050
57134
  let {
57051
57135
  children,
57136
+ validationState,
57052
57137
  loading,
57053
57138
  mode,
57139
+ options,
57140
+ notFoundContent,
57141
+ optionFilterProp,
57054
57142
  dangerouslySetAntdProps,
57055
57143
  virtual,
57056
57144
  ...restProps
@@ -57059,6 +57147,9 @@ function DuboisSelect(_ref2, ref) {
57059
57147
  theme,
57060
57148
  getPrefixedClassName
57061
57149
  } = useDesignSystemTheme();
57150
+ const {
57151
+ USE_NEW_SELECT_DROPDOWN_STYLES
57152
+ } = useDesignSystemFlags();
57062
57153
  const clsPrefix = getPrefixedClassName('select');
57063
57154
  return jsx(ClassNames, {
57064
57155
  children: _ref3 => {
@@ -57068,7 +57159,8 @@ function DuboisSelect(_ref2, ref) {
57068
57159
  return jsx(AntDSelect, {
57069
57160
  css: getSelectEmotionStyles({
57070
57161
  clsPrefix,
57071
- theme
57162
+ theme,
57163
+ validationState
57072
57164
  }),
57073
57165
  removeIcon: jsx(CloseIcon, {
57074
57166
  css: _ref4
@@ -57089,22 +57181,23 @@ function DuboisSelect(_ref2, ref) {
57089
57181
  }),
57090
57182
  showArrow: true,
57091
57183
  dropdownMatchSelectWidth: true,
57092
- notFoundContent: jsx("div", {
57184
+ notFoundContent: notFoundContent !== null && notFoundContent !== void 0 ? notFoundContent : jsx("div", {
57093
57185
  css: /*#__PURE__*/css$1({
57094
57186
  color: theme.colors.textSecondary,
57095
57187
  textAlign: 'center'
57096
57188
  }),
57097
57189
  children: "No results found"
57098
57190
  }),
57099
- dropdownClassName: css(getDropdownStyles(clsPrefix, theme)),
57191
+ dropdownClassName: css(getDropdownStyles(clsPrefix, theme, USE_NEW_SELECT_DROPDOWN_STYLES)),
57100
57192
  maxTagPlaceholder: items => "+ ".concat(items.length, " more"),
57101
57193
  mode: mode,
57194
+ options: options,
57102
57195
  loading: loading,
57103
57196
  filterOption: true // This is needed to avoid ghost scrollbar that generates error when clicked on exactly 8 elements
57104
57197
  // Because by default AntD uses true for virtual, we want to replicate the same even if there are no children
57105
57198
  ,
57106
- virtual: virtual || !children || Array.isArray(children) && children.length !== scrollbarVisibleItemsCount,
57107
- optionFilterProp: 'children',
57199
+ virtual: virtual || children && Array.isArray(children) && children.length !== scrollbarVisibleItemsCount || options && options.length !== scrollbarVisibleItemsCount || !children && !options,
57200
+ optionFilterProp: optionFilterProp !== null && optionFilterProp !== void 0 ? optionFilterProp : 'children',
57108
57201
  ...restProps,
57109
57202
  ...dangerouslySetAntdProps,
57110
57203
  children: loading && mode !== 'tags' ? jsxs(Fragment, {
@@ -57124,22 +57217,29 @@ function DuboisSelect(_ref2, ref) {
57124
57217
  });
57125
57218
  }
57126
57219
 
57127
- const Option = /*#__PURE__*/forwardRef(function Option(_ref5, ref) {
57128
- let {
57220
+ const Option = /*#__PURE__*/forwardRef(function Option(props, ref) {
57221
+ const {
57129
57222
  dangerouslySetAntdProps,
57130
- ...props
57131
- } = _ref5;
57132
- return jsx(AntDSelect.Option, { ...props,
57223
+ ...restProps
57224
+ } = props;
57225
+ return jsx(AntDSelect.Option, { ...restProps,
57133
57226
  ref: ref,
57134
57227
  ...dangerouslySetAntdProps
57135
57228
  });
57136
- });
57137
- const SelectNamespace = Object.assign(DuboisRefForwardedSelect, {
57138
- Option,
57139
- OptGroup: AntDSelect.OptGroup
57140
- });
57141
- const Select = SelectNamespace;
57142
- const __INTERNAL_DO_NOT_USE__Option = Option;
57229
+ }); // Needed for rc-select to not throw warning about our component not being Select.Option
57230
+
57231
+ Option.isSelectOption = true;
57232
+ const OptGroup = /*#__PURE__*/forwardRef(function OptGroup(props, ref) {
57233
+ return jsx(AntDSelect.OptGroup, { ...props,
57234
+ isSelectOptGroup: true,
57235
+ ref: ref
57236
+ });
57237
+ }); // Needed for antd to work properly and for rc-select to not throw warning about our component not being Select.OptGroup
57238
+
57239
+ OptGroup.isSelectOptGroup = true;
57240
+ DuboisRefForwardedSelect.Option = Option;
57241
+ DuboisRefForwardedSelect.OptGroup = OptGroup;
57242
+ const Select = DuboisRefForwardedSelect;
57143
57243
 
57144
57244
  const Skeleton = _ref => {
57145
57245
  let {
@@ -57176,25 +57276,53 @@ const Spacer = _ref => {
57176
57276
  });
57177
57277
  };
57178
57278
 
57179
- const loadingIcon = jsx(LoadingIcon, {
57180
- spin: true
57279
+ const rotate = keyframes({
57280
+ '0%': {
57281
+ transform: 'rotate(0deg) translate3d(0, 0, 0)'
57282
+ },
57283
+ '100%': {
57284
+ transform: 'rotate(360deg) translate3d(0, 0, 0)'
57285
+ }
57181
57286
  });
57182
57287
 
57288
+ const cssSpinner = function (theme) {
57289
+ let frameRate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
57290
+ let delay = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
57291
+ const styles = {
57292
+ animation: "".concat(rotate, " 1s steps(").concat(frameRate, ", end) infinite"),
57293
+ color: theme.colors.textSecondary,
57294
+ animationDelay: "".concat(delay, "s")
57295
+ };
57296
+ return /*#__PURE__*/css$1(importantify(styles), process.env.NODE_ENV === "production" ? "" : ";label:cssSpinner;");
57297
+ };
57298
+
57183
57299
  const Spinner = _ref => {
57184
57300
  let {
57185
- dangerouslySetAntdProps,
57301
+ frameRate,
57302
+ size = 'default',
57303
+ delay,
57304
+ className: propClass,
57186
57305
  ...props
57187
57306
  } = _ref;
57188
57307
  const {
57308
+ classNamePrefix,
57189
57309
  theme
57190
- } = useDesignSystemTheme();
57191
- return jsx(AntDSpin, { ...props,
57192
- css: /*#__PURE__*/css$1({
57193
- color: theme.colors.textSecondary
57194
- }, process.env.NODE_ENV === "production" ? "" : ";label:Spinner;"),
57195
- indicator: loadingIcon,
57196
- ...dangerouslySetAntdProps
57197
- });
57310
+ } = useDesignSystemTheme(); // We use Antd classes to keep styling unchanged
57311
+ // TODO(FEINF-1407): We want to move away from Antd classes and use Emotion for styling in the future
57312
+
57313
+ const sizeSuffix = size === 'small' ? '-sm' : size === 'large' ? '-lg' : '';
57314
+ const sizeClass = sizeSuffix ? "".concat(classNamePrefix, "-spin").concat(sizeSuffix) : '';
57315
+ const wrapperClass = "".concat(propClass || '', " ").concat(classNamePrefix, "-spin ").concat(sizeClass, " ").concat(classNamePrefix, "-spin-spinning ").concat(DU_BOIS_ENABLE_ANIMATION_CLASSNAME).trim();
57316
+ const className = "".concat(classNamePrefix, "-spin-dot ").concat(DU_BOIS_ENABLE_ANIMATION_CLASSNAME).trim();
57317
+ return (// className has to follow {...props}, otherwise is `css` prop is passed down it will overwrite our className
57318
+ jsx("div", { ...props,
57319
+ className: wrapperClass,
57320
+ children: jsx(LoadingIcon, {
57321
+ css: cssSpinner(theme, frameRate, delay),
57322
+ className: className
57323
+ })
57324
+ })
57325
+ );
57198
57326
  };
57199
57327
 
57200
57328
  function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
@@ -57697,13 +57825,14 @@ function Tag(props) {
57697
57825
  color,
57698
57826
  children,
57699
57827
  closable,
57700
- onClose
57828
+ onClose,
57829
+ ...attributes
57701
57830
  } = props;
57702
57831
  const isClickable = Boolean(props.onClick);
57703
57832
  const styles = getTagEmotionStyles(theme, color, isClickable);
57704
57833
  return jsx("div", {
57705
57834
  role: "status",
57706
- ...props,
57835
+ ...attributes,
57707
57836
  css: styles.tag,
57708
57837
  children: jsxs("div", {
57709
57838
  css: styles.content,
@@ -57891,6 +58020,9 @@ function getTreeEmotionStyles(clsPrefix, theme) {
57891
58020
  backgroundColor: 'transparent'
57892
58021
  }
57893
58022
  },
58023
+ [classContent]: {
58024
+ cursor: 'default'
58025
+ },
57894
58026
  // Unselectable nodes don't have any background, so the switcher looks better with rounded corners.
57895
58027
  [classSwitcher]: {
57896
58028
  borderRadius: theme.borders.borderRadiusMd
@@ -58022,6 +58154,26 @@ function Tree(_ref) {
58022
58154
 
58023
58155
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
58024
58156
 
58157
+ const getLinkStyles = theme => {
58158
+ const styles = {
58159
+ '&&': {
58160
+ color: theme.colors.actionTertiaryTextDefault,
58161
+ '&:hover': {
58162
+ color: theme.colors.actionTertiaryTextHover,
58163
+ textDecoration: 'underline'
58164
+ },
58165
+ '&:active': {
58166
+ color: theme.colors.actionTertiaryTextPress,
58167
+ textDecoration: 'underline'
58168
+ },
58169
+ '&:focus': {
58170
+ outline: 'auto'
58171
+ }
58172
+ }
58173
+ };
58174
+ return /*#__PURE__*/css$1(styles, process.env.NODE_ENV === "production" ? "" : ";label:getLinkStyles;");
58175
+ };
58176
+
58025
58177
  var _ref2 = process.env.NODE_ENV === "production" ? {
58026
58178
  name: "mgrjgu",
58027
58179
  styles: "margin-left:2px"
@@ -58041,8 +58193,13 @@ function Link(_ref) {
58041
58193
  openInNewTab,
58042
58194
  ...restProps
58043
58195
  } = props;
58196
+ const {
58197
+ theme
58198
+ } = useDesignSystemTheme();
58044
58199
  const openInNewTabProps = getOpenInNewTabProps(openInNewTab);
58045
- return jsxs(AntDTypography.Link, { ...restProps,
58200
+ return jsxs(AntDTypography.Link, {
58201
+ css: getLinkStyles(theme),
58202
+ ...restProps,
58046
58203
  ...openInNewTabProps,
58047
58204
  ...dangerouslySetAntdProps,
58048
58205
  children: [children, openInNewTab ? jsx(NewWindowIcon, {
@@ -58212,5 +58369,5 @@ Typography.Title = Title;
58212
58369
  Typography.Paragraph = Paragraph;
58213
58370
  Typography.Link = Link;
58214
58371
 
58215
- export { AIcon, Alert, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ApplyDesignSystemFlags, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowsUpDownIcon, AutoComplete, BarChartIcon, BeakerIcon, BookIcon, BookmarkBorderIcon, BookmarkFillIcon, Breadcrumb, BriefcaseFillIcon, BriefcaseIcon, Button, CalendarEventIcon, CalendarIcon, CaretDownSquareIcon, CaretUpSquareIcon, CheckCircleBorderIcon, CheckCircleFillIcon, CheckIcon, CheckLineIcon, Checkbox, ChecklistIcon, ChevronDoubleDownIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon, ChevronDoubleUpIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardIcon, Clock1Icon, ClockIcon, CloseIcon, CloudDownloadIcon, CloudIcon, CloudOffIcon, CloudUploadIcon, ClusterIcon, ClustersIcon, CodeIcon, Col, Collapse, CollapsePanel, CopyIcon, DIcon, DangerModal, DashIcon, DashboardIcon, DataIcon, DatabaseIcon, DesignSystemContext, DesignSystemProvider, DownloadIcon, DragIcon, Dropdown, DropdownMenu, DuboisDatePicker, ErrorBorderIcon, ErrorFillIcon, ExpandLessIcon, ExpandMoreIcon, ExperimentIcon, FeatureStoreIcon, FileCodeIcon, FileDocumentIcon, FileIcon, FileImageIcon, FileModelIcon, FilterIcon, Folder1Icon, FolderIcon, ForkIcon, Form, FormDubois, FullscreenExitIcon, FullscreenIcon, Gear1Icon, GearIcon, GridDashIcon, GridIcon, H1Icon, H2Icon, H3Icon, Header$1 as Header, HistoryIcon, HomeIcon, Icon, ImageIcon, IndentDecreaseIcon, IndentIncreaseIcon, InfinityIcon, InfoBorderIcon, InfoFillIcon, Input, KeyboardIcon, LayerIcon, Layout, LegacyDatePicker, LifesaverIcon, LightningIcon, LinkIcon, LinkRemoveIcon, ListBorderIcon, ListIcon, LoadingIcon, LockBorderIcon, LockFillIcon, LockUnlockedIcon, MIcon, Menu, MinusBoxIcon, MinusCircleBorderIcon, MinusCircleFillIcon, Modal, ModelsIcon, NewWindowIcon, NoIcon, NotebookIcon, NotificationIcon, NotificationsIcon, OfficeIcon, Option, OverflowIcon, PageBottomIcon, PageFirstIcon, PageLastIcon, PageTopIcon, PageWrapper, Pagination, PencilIcon, PinBorderIcon, PinCancelIcon, PinFillIcon, PinXIcon, PlayCircleBorderIcon, PlayCircleFillIcon, PlayIcon, PlusCircleBorderIcon, PlusCircleFillIcon, PlusIcon, PlusSquareIcon, Popover, QueryEditorIcon, QueryIcon, QueryListViewIcon, QueryNavIcon, QuestionMarkBorderIcon, QuestionMarkFillIcon, ROW_GUTTER_SIZE, Radio, ReaderModeIcon, ReposIcon, Row, SchoolIcon, Search1Icon, SearchIcon, SecurityIcon, SegmentedControlButton, SegmentedControlGroup, Select, ShareIcon, SidebarAutoIcon, SidebarCollapseIcon, SidebarExpandIcon, SidebarIcon, Skeleton, Space, Spacer, SpeechBubbleIcon, SpeechBubblePlusIcon, Spinner, SplitButton, StarBorderIcon, StarFillIcon, StopCircleBorderIcon, StopCricleFillIcon, StopIcon, StreamIcon, Switch, SyncIcon, TabPane, Table, TableIcon, Tabs, Tag, Tooltip, TrashIcon, Tree, TreeIcon, Typography, UploadIcon, UsbIcon, UserBadgeIcon, UserCircleIcon, UserGroupIcon, UserIcon, VideosIcon, Visible, VisibleOff, WarningBorderIcon, WarningFillIcon, WithDesignSystemThemeHoc, XCircleBorderIcon, XCircleFillIcon, ZoomInIcon, ZoomOutIcon, __INTERNAL_DO_NOT_USE__FormItem, __INTERNAL_DO_NOT_USE__Group, __INTERNAL_DO_NOT_USE__HorizontalGroup, __INTERNAL_DO_NOT_USE__Option, __INTERNAL_DO_NOT_USE__Password, __INTERNAL_DO_NOT_USE__TextArea, __INTERNAL_DO_NOT_USE__VerticalGroup, getAnimationCss, getButtonEmotionStyles, getPaginationEmotionStyles, getTabEmotionStyles, useDesignSystemFlags, useDesignSystemTheme, useNotification, useThemedStyles };
58372
+ export { AIcon, Alert, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ApplyDesignSystemFlags, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowsUpDownIcon, AutoComplete, BarChartIcon, BeakerIcon, BookIcon, BookmarkBorderIcon, BookmarkFillIcon, Breadcrumb, BriefcaseFillIcon, BriefcaseIcon, Button, CalendarEventIcon, CalendarIcon, CaretDownSquareIcon, CaretUpSquareIcon, CheckCircleBorderIcon, CheckCircleFillIcon, CheckIcon, CheckLineIcon, Checkbox, ChecklistIcon, ChevronDoubleDownIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon, ChevronDoubleUpIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardIcon, Clock1Icon, ClockIcon, CloseIcon, CloudDownloadIcon, CloudIcon, CloudOffIcon, CloudUploadIcon, ClusterIcon, ClustersIcon, CodeIcon, Col, Collapse, CollapsePanel, CopyIcon, DIcon, DU_BOIS_ENABLE_ANIMATION_CLASSNAME, DangerModal, DashIcon, DashboardIcon, DataIcon, DatabaseIcon, DesignSystemContext, DesignSystemProvider, DownloadIcon, DragIcon, Dropdown, DropdownMenu, DuboisDatePicker, ErrorBorderIcon, ErrorFillIcon, ExpandLessIcon, ExpandMoreIcon, ExperimentIcon, FeatureStoreIcon, FileCodeIcon, FileDocumentIcon, FileIcon, FileImageIcon, FileModelIcon, FilterIcon, Folder1Icon, FolderIcon, ForkIcon, Form, FormDubois, FullscreenExitIcon, FullscreenIcon, Gear1Icon, GearIcon, GridDashIcon, GridIcon, H1Icon, H2Icon, H3Icon, Header$1 as Header, HistoryIcon, HomeIcon, Icon, ImageIcon, IndentDecreaseIcon, IndentIncreaseIcon, InfinityIcon, InfoBorderIcon, InfoFillIcon, Input, KeyboardIcon, LayerIcon, Layout, LegacyDatePicker, LifesaverIcon, LightningIcon, LinkIcon, LinkRemoveIcon, ListBorderIcon, ListIcon, LoadingIcon, LockBorderIcon, LockFillIcon, LockUnlockedIcon, MIcon, Menu, MinusBoxIcon, MinusCircleBorderIcon, MinusCircleFillIcon, Modal, ModelsIcon, NewWindowIcon, NoIcon, NotebookIcon, NotificationIcon, NotificationsIcon, OfficeIcon, OptGroup, Option, OverflowIcon, PageBottomIcon, PageFirstIcon, PageLastIcon, PageTopIcon, PageWrapper, Pagination, PencilIcon, PinBorderIcon, PinCancelIcon, PinFillIcon, PinXIcon, PlayCircleBorderIcon, PlayCircleFillIcon, PlayIcon, PlusCircleBorderIcon, PlusCircleFillIcon, PlusIcon, PlusSquareIcon, Popover, QueryEditorIcon, QueryIcon, QueryListViewIcon, QueryNavIcon, QuestionMarkBorderIcon, QuestionMarkFillIcon, ROW_GUTTER_SIZE, Radio, ReaderModeIcon, ReposIcon, Row, SchoolIcon, Search1Icon, SearchIcon, SecurityIcon, SegmentedControlButton, SegmentedControlGroup, Select, ShareIcon, SidebarAutoIcon, SidebarCollapseIcon, SidebarExpandIcon, SidebarIcon, Skeleton, Space, Spacer, SpeechBubbleIcon, SpeechBubblePlusIcon, Spinner, SplitButton, StarBorderIcon, StarFillIcon, StopCircleBorderIcon, StopCricleFillIcon, StopIcon, StreamIcon, Switch, SyncIcon, TabPane, Table, TableIcon, Tabs, Tag, Tooltip, TrashIcon, Tree, TreeIcon, Typography, UploadIcon, UsbIcon, UserBadgeIcon, UserCircleIcon, UserGroupIcon, UserIcon, VideosIcon, Visible, VisibleOff, WarningBorderIcon, WarningFillIcon, WithDesignSystemThemeHoc, XCircleBorderIcon, XCircleFillIcon, ZoomInIcon, ZoomOutIcon, __INTERNAL_DO_NOT_USE__FormItem, __INTERNAL_DO_NOT_USE__Group, __INTERNAL_DO_NOT_USE__HorizontalGroup, __INTERNAL_DO_NOT_USE__Password, __INTERNAL_DO_NOT_USE__TextArea, __INTERNAL_DO_NOT_USE__VerticalGroup, getAnimationCss, getButtonEmotionStyles, getPaginationEmotionStyles, getTabEmotionStyles, useDesignSystemFlags, useDesignSystemTheme, useNotification, useThemedStyles };
58216
58373
  //# sourceMappingURL=index.js.map