@wistia/ui 0.24.0 → 0.25.0-beta.7b5455e5.819bdc8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.24.0
3
+ * @license @wistia/ui v0.25.0-beta.7b5455e5.819bdc8
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
7
7
  * This source code is unlicensed, all rights reserved.
8
8
  */
9
9
 
10
- import { Arrow, Content, Portal, Provider, Root, Trigger } from "@radix-ui/react-tooltip";
10
+ import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
11
11
  import { Children, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
12
12
  import { createGlobalStyle, css, keyframes, styled } from "styled-components";
13
13
  import { isArray, isBoolean, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined } from "@wistia/type-guards";
@@ -25,24 +25,24 @@ import { FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, ImageDi
25
25
  import { debounce, throttle } from "throttle-debounce";
26
26
  import { Link as Link$1, useInRouterContext } from "react-router";
27
27
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
28
- import { Item, Root as Root$1 } from "@radix-ui/react-radio-group";
28
+ import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
29
29
  import { differenceEuclidean, easingSmootherstep, formatHex, interpolate, modeHsv, modeLrgb, modeRgb, parseHex, useMode, wcagContrast } from "culori/fn";
30
- import { Item as Item$1, Root as Root$2 } from "@radix-ui/react-toggle-group";
31
- import { Anchor, Close, Content as Content$1, PopoverArrow as PopoverArrow$1, Portal as Portal$1, Root as Root$3, Trigger as Trigger$1 } from "@radix-ui/react-popover";
32
- import { Root as Root$4, Thumb, Track } from "@radix-ui/react-slider";
30
+ import { Radio as Radio$1 } from "@base-ui/react/radio";
31
+ import { ToggleGroup } from "@base-ui/react/toggle-group";
32
+ import { Toggle } from "@base-ui/react/toggle";
33
+ import { Popover as Popover$1 } from "@base-ui/react/popover";
34
+ import { Slider as Slider$1 } from "@base-ui/react/slider";
33
35
  import * as Ariakit from "@ariakit/react";
34
36
  import { matchSorter } from "match-sorter";
35
37
  import { createPortal } from "react-dom";
36
- import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu";
38
+ import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
39
+ import { Menu as Menu$1 } from "@base-ui/react/menu";
37
40
  import { ValidationError } from "yup";
38
41
  import { PreviewCard as PreviewCard$1 } from "@base-ui/react/preview-card";
39
42
  import ReactMarkdown from "react-markdown";
40
- import { Close as Close$1, Content as Content$2, Description, DialogOverlay, Portal as Portal$2, Root as Root$5, Title } from "@radix-ui/react-dialog";
43
+ import { Dialog } from "@base-ui/react/dialog";
41
44
  import { Progress } from "@base-ui/react/progress";
42
- import { ToggleGroup } from "@base-ui/react/toggle-group";
43
- import { Toggle } from "@base-ui/react/toggle";
44
- import { Content as Content$3, Group, Item as Item$2, ItemIndicator, ItemText, Label as Label$1, Portal as Portal$3, Root as Root$6, ScrollDownButton, ScrollUpButton, Trigger as Trigger$2, Value, Viewport } from "@radix-ui/react-select";
45
- import { Slider as Slider$1 } from "@base-ui/react/slider";
45
+ import { Select as Select$1 } from "@base-ui/react/select";
46
46
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
47
47
  //#region src/css/globalStyleAdjustmentsCss.tsx
48
48
  const globalStyleAdjustmentsCss = css`
@@ -453,7 +453,7 @@ const UIProvider = ({ children }) => {
453
453
  if (useContext(UIProviderNestingContext)) return /* @__PURE__ */ jsx(Fragment, { children });
454
454
  return /* @__PURE__ */ jsx(UIProviderNestingContext.Provider, {
455
455
  value: true,
456
- children: /* @__PURE__ */ jsx(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(Provider, { children: [
456
+ children: /* @__PURE__ */ jsx(AriaLiveProvider, { children: /* @__PURE__ */ jsxs(Tooltip$1.Provider, { children: [
457
457
  /* @__PURE__ */ jsx(GlobalStyle, {}),
458
458
  children,
459
459
  /* @__PURE__ */ jsx(ToastProvider, {})
@@ -7792,7 +7792,7 @@ const Container$9 = styled.div`
7792
7792
  const LabelContainer$1 = styled.div`
7793
7793
  padding-top: var(--wui-space-01);
7794
7794
  `;
7795
- const ItemsContainer$1 = styled(Root$1)`
7795
+ const ItemsContainer$1 = styled(RadioGroup$1)`
7796
7796
  display: flex;
7797
7797
  flex-wrap: wrap;
7798
7798
  align-items: center;
@@ -7807,7 +7807,7 @@ const ItemsContainer$1 = styled(Root$1)`
7807
7807
  const ColorGrid = ({ children, label }) => {
7808
7808
  const { valueAsHex, onChangeNonDerivedValueAsHsv } = useColorPickerState();
7809
7809
  const onValueChange = useCallback((value) => {
7810
- onChangeNonDerivedValueAsHsv(convertToHsv(value));
7810
+ if (typeof value === "string") onChangeNonDerivedValueAsHsv(convertToHsv(value));
7811
7811
  }, [onChangeNonDerivedValueAsHsv]);
7812
7812
  return /* @__PURE__ */ jsxs(Container$9, { children: [label != null && /* @__PURE__ */ jsx(LabelContainer$1, { children: /* @__PURE__ */ jsx(Label, { children: label }) }), /* @__PURE__ */ jsx(ItemsContainer$1, {
7813
7813
  onValueChange,
@@ -7905,7 +7905,7 @@ const slideRightAndFade = keyframes`
7905
7905
  transform: translateX(0);
7906
7906
  }
7907
7907
  `;
7908
- const StyledContent$2 = styled(Content)`
7908
+ const StyledPopup$5 = styled(Tooltip$1.Popup)`
7909
7909
  --tooltip-font-family: var(--wui-typography-family-default);
7910
7910
  --tooltip-border-radius: var(--wui-border-radius-05);
7911
7911
  --tooltip-bg: var(--wui-color-bg-tooltip);
@@ -7931,27 +7931,54 @@ const StyledContent$2 = styled(Content)`
7931
7931
  max-width: 30em;
7932
7932
  z-index: var(--wui-zindex-tooltip);
7933
7933
 
7934
- &[data-state='closed'] {
7934
+ &[data-closed] {
7935
7935
  animation-name: ${hide};
7936
7936
  }
7937
7937
 
7938
- &[data-state='delayed-open'][data-side='top'] {
7938
+ &[data-open][data-side='top'] {
7939
7939
  animation-name: ${slideUpAndFade};
7940
7940
  }
7941
7941
 
7942
- &[data-state='delayed-open'][data-side='right'] {
7942
+ &[data-open][data-side='right'] {
7943
7943
  animation-name: ${slideRightAndFade};
7944
7944
  }
7945
7945
 
7946
- &[data-state='delayed-open'][data-side='bottom'] {
7946
+ &[data-open][data-side='bottom'] {
7947
7947
  animation-name: ${slideDownAndFade};
7948
7948
  }
7949
7949
 
7950
- &[data-state='delayed-open'][data-side='left'] {
7950
+ &[data-open][data-side='left'] {
7951
7951
  animation-name: ${slideLeftAndFade};
7952
7952
  }
7953
+
7954
+ overflow: visible;
7955
+ `;
7956
+ const arrowEdgeCss = css`
7957
+ &[data-side='top'] {
7958
+ bottom: 0;
7959
+ transform: translateY(calc(100% - 2px));
7960
+ }
7961
+
7962
+ &[data-side='bottom'] {
7963
+ top: 0;
7964
+ transform: translateY(calc(-100% + 2px)) rotate(180deg);
7965
+ }
7966
+
7967
+ &[data-side='left'] {
7968
+ right: 0;
7969
+ transform: translateX(calc(100% - 4px)) rotate(-90deg);
7970
+ }
7971
+
7972
+ &[data-side='right'] {
7973
+ left: 0;
7974
+ transform: translateX(calc(-100% + 4px)) rotate(90deg);
7975
+ }
7976
+ `;
7977
+ const StyledTooltipArrow = styled.svg`
7978
+ ${arrowEdgeCss}
7953
7979
  `;
7954
7980
  const VISUAL_OFFSET = 6;
7981
+ const ARROW_EXTENSION = 6;
7955
7982
  /**
7956
7983
  * Tooltips are a way to provide additional information or context to a user when they hover or focus an element.
7957
7984
  * For elements that are not interactive, consider using a [Popover]() instead.
@@ -7961,29 +7988,27 @@ const Tooltip = ({ delay = 500, direction = "top", content, children, forceOpen,
7961
7988
  const rootProps = {};
7962
7989
  if (content === "" || content === null) rootProps.open = false;
7963
7990
  if (forceOpen === true) rootProps.open = true;
7964
- return /* @__PURE__ */ jsxs(Root, {
7965
- delayDuration: delay,
7991
+ return /* @__PURE__ */ jsxs(Tooltip$1.Root, {
7966
7992
  ...rootProps,
7967
- children: [/* @__PURE__ */ jsx(Trigger, {
7968
- asChild: true,
7969
- children
7970
- }), /* @__PURE__ */ jsx(Portal, {
7971
- container,
7972
- children: /* @__PURE__ */ jsxs(StyledContent$2, {
7993
+ children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, {
7994
+ delay,
7995
+ render: isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children })
7996
+ }), /* @__PURE__ */ jsx(Tooltip$1.Portal, {
7997
+ ...container != null ? { container } : {},
7998
+ children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
7973
7999
  side: direction,
7974
- sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET - 2,
7975
- children: [content, !hideArrow ? /* @__PURE__ */ jsx(Arrow, {
7976
- asChild: true,
7977
- children: /* @__PURE__ */ jsx("svg", {
8000
+ sideOffset: hideArrow ? VISUAL_OFFSET : VISUAL_OFFSET + ARROW_EXTENSION,
8001
+ children: /* @__PURE__ */ jsxs(StyledPopup$5, {
8002
+ role: "tooltip",
8003
+ children: [content, !hideArrow ? /* @__PURE__ */ jsx(Tooltip$1.Arrow, { render: /* @__PURE__ */ jsx(StyledTooltipArrow, {
7978
8004
  fill: "var(--tooltip-bg)",
7979
8005
  height: "8",
7980
- style: { transform: "translateY(-2px)" },
7981
8006
  viewBox: "0 0 12 8",
7982
8007
  width: "12",
7983
8008
  xmlns: "http://www.w3.org/2000/svg",
7984
8009
  children: /* @__PURE__ */ jsx("path", { d: "M6.8 6.93333C6.4 7.46667 5.6 7.46667 5.2 6.93333L-2.54292e-07 -1.04907e-06L12 0L6.8 6.93333Z" })
7985
- })
7986
- }) : null]
8010
+ }) }) : null]
8011
+ })
7987
8012
  })
7988
8013
  })]
7989
8014
  });
@@ -7991,7 +8016,7 @@ const Tooltip = ({ delay = 500, direction = "top", content, children, forceOpen,
7991
8016
  Tooltip.displayName = "Tooltip_UI";
7992
8017
  //#endregion
7993
8018
  //#region src/components/ColorPicker/ColorGridOption.tsx
7994
- const Container$8 = styled(Item)`
8019
+ const Container$8 = styled(Radio$1.Root)`
7995
8020
  border: none;
7996
8021
  appearance: none;
7997
8022
  outline: none;
@@ -8032,7 +8057,7 @@ const ColorGridOption = ({ value: rawValue, name }) => {
8032
8057
  ColorGridOption.displayName = "ColorGridOption_UI";
8033
8058
  //#endregion
8034
8059
  //#region src/components/ColorPicker/ColorList.tsx
8035
- const Container$7 = styled(Root$2)`
8060
+ const Container$7 = styled(ToggleGroup)`
8036
8061
  display: grid;
8037
8062
  grid-template-columns: minmax(0, 1fr);
8038
8063
  `;
@@ -8044,12 +8069,12 @@ const Container$7 = styled(Root$2)`
8044
8069
  const ColorList = ({ children }) => {
8045
8070
  const { valueAsHex, onChangeNonDerivedValueAsHsv } = useColorPickerState();
8046
8071
  return /* @__PURE__ */ jsx(Container$7, {
8047
- onValueChange: useCallback((value) => {
8048
- if (value === "") return;
8072
+ onValueChange: useCallback((newValue) => {
8073
+ const value = newValue[0];
8074
+ if (value === void 0 || value === "") return;
8049
8075
  onChangeNonDerivedValueAsHsv(convertToHsv(value));
8050
8076
  }, [onChangeNonDerivedValueAsHsv]),
8051
- type: "single",
8052
- value: valueAsHex,
8077
+ value: [valueAsHex],
8053
8078
  children
8054
8079
  });
8055
8080
  };
@@ -8101,7 +8126,7 @@ const ColorNameOrHexCode = ({ name, hexCode }) => {
8101
8126
  };
8102
8127
  //#endregion
8103
8128
  //#region src/components/ColorPicker/ColorListOption.tsx
8104
- const Container$5 = styled(Item$1)`
8129
+ const Container$5 = styled(Toggle)`
8105
8130
  border: none;
8106
8131
  appearance: none;
8107
8132
  outline: none;
@@ -8178,7 +8203,7 @@ const ColorPicker = ({ children, colorForComparison = DEFAULT_COLOR_FOR_COMPARIS
8178
8203
  const handleOpenChange = (isOpen) => {
8179
8204
  if (isFunction(onOpenChange)) onOpenChange(isOpen);
8180
8205
  };
8181
- return /* @__PURE__ */ jsx(Root$3, {
8206
+ return /* @__PURE__ */ jsx(Popover$1.Root, {
8182
8207
  modal: false,
8183
8208
  onOpenChange: handleOpenChange,
8184
8209
  children: /* @__PURE__ */ jsx(ColorPickerProvider, {
@@ -8194,7 +8219,7 @@ const ColorPicker = ({ children, colorForComparison = DEFAULT_COLOR_FOR_COMPARIS
8194
8219
  ColorPicker.displayName = "ColorPicker_UI";
8195
8220
  //#endregion
8196
8221
  //#region src/components/ColorPicker/ColorPickerPopoverContent.tsx
8197
- const StyledPopoverContent = styled(Content$1)`
8222
+ const StyledPopup$4 = styled(Popover$1.Popup)`
8198
8223
  background-color: var(--wui-color-bg-surface);
8199
8224
  border-radius: var(--wui-border-radius-02);
8200
8225
  border: 1px solid var(--wui-color-border);
@@ -8211,10 +8236,10 @@ const StyledPopoverContent = styled(Content$1)`
8211
8236
  * Use `ColorPickerSection` to organize content within it.
8212
8237
  */
8213
8238
  const ColorPickerPopoverContent = ({ children }) => {
8214
- return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(StyledPopoverContent, {
8239
+ return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
8215
8240
  align: "start",
8216
8241
  sideOffset: 4,
8217
- children
8242
+ children: /* @__PURE__ */ jsx(StyledPopup$4, { children })
8218
8243
  }) });
8219
8244
  };
8220
8245
  ColorPickerPopoverContent.displayName = "ColorPickerPopoverContent_UI";
@@ -8261,7 +8286,7 @@ const ValueNameOrHexCode = (props) => {
8261
8286
  ValueNameOrHexCode.displayName = "ValueNameOrHexCode_UI";
8262
8287
  //#endregion
8263
8288
  //#region src/components/ColorPicker/ColorPickerTrigger.tsx
8264
- const StyledPopoverTrigger = styled(Trigger$1)`
8289
+ const StyledPopoverTrigger = styled(Popover$1.Trigger)`
8265
8290
  background-color: var(--wui-color-bg-surface);
8266
8291
  border-radius: var(--wui-border-radius-rounded);
8267
8292
  border: none;
@@ -8914,7 +8939,7 @@ const Container$2 = styled.div`
8914
8939
  padding: 0 var(--wui-space-03);
8915
8940
  position: relative;
8916
8941
  `;
8917
- const Root$7 = styled(Root$4)`
8942
+ const Root = styled(Slider$1.Root)`
8918
8943
  align-items: center;
8919
8944
  display: flex;
8920
8945
  position: absolute;
@@ -8923,10 +8948,10 @@ const Root$7 = styled(Root$4)`
8923
8948
  width: calc(100% - var(--wui-space-05));
8924
8949
  height: 16px;
8925
8950
  `;
8926
- const Track$1 = styled(Track)`
8951
+ const Track = styled(Slider$1.Track)`
8927
8952
  width: 100%;
8928
8953
  `;
8929
- const Thumb$2 = styled(Thumb)`
8954
+ const Thumb$1 = styled(Slider$1.Thumb)`
8930
8955
  position: relative;
8931
8956
  `;
8932
8957
  const ThumbInner = styled.div`
@@ -8941,7 +8966,7 @@ const ThumbInner = styled.div`
8941
8966
  transform: translate(-50%, -50%);
8942
8967
  width: 16px;
8943
8968
 
8944
- ${Thumb$2}:focus-visible > & {
8969
+ ${Thumb$1}:focus-visible > & {
8945
8970
  box-shadow:
8946
8971
  inset 0 0 0 2px var(--wui-color-border),
8947
8972
  inset 0 0 0 3px black;
@@ -8966,7 +8991,7 @@ const HueSlider = (props) => {
8966
8991
  return { backgroundColor: formatHex(valueAsHsv) };
8967
8992
  }, [valueAsHsv]);
8968
8993
  const onHueChange = useCallback((values) => {
8969
- const newHue = values[0] ?? 0;
8994
+ const newHue = typeof values === "number" ? values : values[0] ?? 0;
8970
8995
  onChangeNonDerivedValueAsHsv({
8971
8996
  ...nonDerivedValueAsHsv,
8972
8997
  h: newHue
@@ -8975,17 +9000,17 @@ const HueSlider = (props) => {
8975
9000
  return /* @__PURE__ */ jsxs(Container$2, {
8976
9001
  ...props,
8977
9002
  style: containerStyle,
8978
- children: [/* @__PURE__ */ jsxs(Root$7, {
9003
+ children: [/* @__PURE__ */ jsx(Root, {
8979
9004
  max: 360,
8980
9005
  min: 0,
8981
9006
  onValueChange: onHueChange,
8982
9007
  orientation: "horizontal",
8983
9008
  step: 1,
8984
9009
  value: [nonDerivedValueAsHsv.h ?? 0],
8985
- children: [/* @__PURE__ */ jsx(Track$1, {}), /* @__PURE__ */ jsx(Thumb$2, {
9010
+ children: /* @__PURE__ */ jsxs(Slider$1.Control, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Thumb$1, {
8986
9011
  "aria-label": "Hue slider",
8987
9012
  children: /* @__PURE__ */ jsx(ThumbInner, { style: thumbInnerStyle })
8988
- })]
9013
+ })] })
8989
9014
  }), /* @__PURE__ */ jsx(HSVHueCanvas, { hsv: valueAsHsv })]
8990
9015
  });
8991
9016
  };
@@ -9115,7 +9140,7 @@ const Container$1 = styled.div`
9115
9140
  overflow: hidden;
9116
9141
  position: relative;
9117
9142
  `;
9118
- const Thumb$1 = styled.button.attrs({ type: "button" })`
9143
+ const Thumb = styled.button.attrs({ type: "button" })`
9119
9144
  appearance: none;
9120
9145
  border-radius: var(--wui-border-radius-rounded);
9121
9146
  border: none;
@@ -9250,7 +9275,7 @@ const SaturationAndValuePicker = ({ dataTestId }) => {
9250
9275
  "data-testid": dataTestId,
9251
9276
  onMouseDown: onContainerMouseDown,
9252
9277
  children: [
9253
- /* @__PURE__ */ jsx(Thumb$1, {
9278
+ /* @__PURE__ */ jsx(Thumb, {
9254
9279
  ref: thumbRef,
9255
9280
  "aria-describedby": instructionsId,
9256
9281
  "aria-label": "Saturation and value thumb",
@@ -9715,18 +9740,18 @@ const menuContentCss = css`
9715
9740
  font-family: var(--menu-font-family);
9716
9741
  background: var(--menu-bg);
9717
9742
  border-radius: var(--menu-border-radius);
9718
- box-shadow: var(--menu-shadow); /* TODO - Need a box-shadow token */
9719
- max-height: var(--radix-dropdown-menu-content-available-height);
9743
+ box-shadow: var(--menu-shadow);
9744
+ max-height: var(--available-height);
9720
9745
  min-width: var(--menu-min-width);
9721
9746
  max-width: var(--menu-max-width);
9722
9747
  overflow: auto;
9723
9748
  padding: var(--menu-padding);
9724
- transform-origin: var(--radix-dropdown-menu-content-transform-origin);
9749
+ transform-origin: var(--transform-origin);
9725
9750
  z-index: var(--wui-zindex-menu);
9726
9751
  border: 1px solid var(--wui-color-border);
9727
9752
 
9728
- &[data-state='closed'] {
9729
- animation: var(--menu-animation-duration) var(--wui-motion-ease-in) ${close}; /* TODO - need easing tokens */
9753
+ &[data-closed] {
9754
+ animation: var(--menu-animation-duration) var(--wui-motion-ease-in) ${close};
9730
9755
  }
9731
9756
 
9732
9757
  ${mq.smAndUp} {
@@ -9741,18 +9766,21 @@ const menuContentCss = css`
9741
9766
  margin: var(--menu-divider-margin) 0;
9742
9767
  }
9743
9768
  `;
9744
- const MenuContent = styled(DropdownMenuContent)`
9769
+ const MenuPopup = styled(Menu$1.Popup)`
9745
9770
  ${menuContentCss}
9746
- min-width: var(--radix-dropdown-menu-trigger-width);
9771
+ min-width: var(--anchor-width);
9747
9772
  `;
9748
9773
  /**
9749
9774
  * Displays a menu to the users with a set of actions.
9750
9775
  */
9751
9776
  const Menu = forwardRef(({ align = "start", children, disabled = false, compact = false, trigger, label, isOpen, side = "bottom", triggerProps = {}, onOpenChange, ...props }, ref) => {
9752
9777
  const contextValue = useMemo(() => ({ compact }), [compact]);
9778
+ const handleOpenChange = useCallback((nextOpen) => {
9779
+ if (nextOpen !== isOpen) onOpenChange?.(nextOpen);
9780
+ }, [isOpen, onOpenChange]);
9753
9781
  let controlProps = isNotNil(onOpenChange) && isNotNil(isOpen) ? {
9754
9782
  open: isOpen,
9755
- onOpenChange
9783
+ onOpenChange: handleOpenChange
9756
9784
  } : {};
9757
9785
  if (disabled) controlProps = {
9758
9786
  open: false,
@@ -9760,584 +9788,233 @@ const Menu = forwardRef(({ align = "start", children, disabled = false, compact
9760
9788
  };
9761
9789
  return /* @__PURE__ */ jsx(MenuContext.Provider, {
9762
9790
  value: contextValue,
9763
- children: /* @__PURE__ */ jsxs(DropdownMenu, {
9791
+ children: /* @__PURE__ */ jsxs(Menu$1.Root, {
9764
9792
  modal: false,
9765
9793
  ...controlProps,
9766
- children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
9767
- asChild: true,
9768
- children: isNotUndefined(trigger) ? trigger : /* @__PURE__ */ jsx(Button, {
9769
- ref,
9770
- "aria-expanded": isOpen,
9771
- disabled,
9772
- forceState: isOpen ? "active" : void 0,
9773
- rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-down" }),
9774
- ...triggerProps,
9775
- children: label
9776
- })
9777
- }), /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(MenuContent, {
9778
- ...props,
9779
- $compact: compact,
9794
+ children: [/* @__PURE__ */ jsx(Menu$1.Trigger, { render: isNotUndefined(trigger) ? trigger : /* @__PURE__ */ jsx(Button, {
9795
+ ref,
9796
+ disabled,
9797
+ forceState: isOpen ? "active" : void 0,
9798
+ rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-down" }),
9799
+ ...triggerProps,
9800
+ children: label
9801
+ }) }), /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
9780
9802
  align,
9781
9803
  collisionPadding: 8,
9782
- onFocusOutside: (event) => {
9783
- event.preventDefault();
9784
- },
9785
9804
  side,
9786
9805
  sideOffset: 6,
9787
- children
9806
+ children: /* @__PURE__ */ jsx(MenuPopup, {
9807
+ ...props,
9808
+ $compact: compact,
9809
+ children
9810
+ })
9788
9811
  }) })]
9789
9812
  })
9790
9813
  });
9791
9814
  });
9792
9815
  Menu.displayName = "Menu_UI";
9793
- Menu.displayName = "Menu_UI";
9794
9816
  //#endregion
9795
- //#region src/components/Menu/MenuLabel.tsx
9796
- const StyledMenuLabel = styled(DropdownMenuLabel)`
9797
- padding: var(--wui-space-02);
9817
+ //#region src/components/ContextMenu/ContextMenu.tsx
9818
+ const ContextMenuPopup = styled(Menu$1.Popup)`
9819
+ ${menuContentCss}
9820
+ outline: none;
9798
9821
  `;
9799
- const MenuLabel = ({ children, ...props }) => {
9800
- return /* @__PURE__ */ jsx(StyledMenuLabel, {
9801
- asChild: true,
9802
- ...props,
9803
- children: /* @__PURE__ */ jsx(Heading, {
9804
- renderAs: "span",
9805
- variant: "heading6",
9806
- ...props,
9807
- children
9822
+ /**
9823
+ * The ContextMenu is an extended implementation of the [Menu]() component that allows for right-click context menus.
9824
+ * It can be used in two ways:
9825
+ * 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
9826
+ * 2. By providing a `position` prop, which will render the menu at the specified coordinates.
9827
+ */
9828
+ const ContextMenu = ({ position, triggerRef, children, side = "bottom", onRequestClose = () => null, compact = false }) => {
9829
+ const [isRightClicked, setIsRightClicked] = useState(false);
9830
+ const [menuPosition, setMenuPosition] = useState(position ?? {
9831
+ x: 0,
9832
+ y: 0
9833
+ });
9834
+ const contextValue = useMemo(() => ({ compact }), [compact]);
9835
+ useEffect(() => {
9836
+ if (isNil(position)) {
9837
+ const onContextMenu = (event) => {
9838
+ event.preventDefault();
9839
+ setMenuPosition({
9840
+ x: event.clientX,
9841
+ y: event.clientY
9842
+ });
9843
+ setIsRightClicked(true);
9844
+ };
9845
+ const triggerEl = triggerRef?.current;
9846
+ triggerEl?.addEventListener("contextmenu", onContextMenu);
9847
+ return () => {
9848
+ triggerEl?.removeEventListener("contextmenu", onContextMenu);
9849
+ };
9850
+ }
9851
+ return () => null;
9852
+ }, [position, triggerRef]);
9853
+ const isOpen = isNotNil(position) || isRightClicked;
9854
+ const anchor = useMemo(() => ({ getBoundingClientRect: () => ({
9855
+ x: menuPosition.x,
9856
+ y: menuPosition.y,
9857
+ width: 0,
9858
+ height: 0,
9859
+ top: menuPosition.y,
9860
+ right: menuPosition.x,
9861
+ bottom: menuPosition.y,
9862
+ left: menuPosition.x
9863
+ }) }), [menuPosition.x, menuPosition.y]);
9864
+ const handleOpenChange = (next) => {
9865
+ setIsRightClicked(next);
9866
+ if (!next) onRequestClose();
9867
+ };
9868
+ const menu = /* @__PURE__ */ jsx(MenuContext.Provider, {
9869
+ value: contextValue,
9870
+ children: /* @__PURE__ */ jsx(ContextMenu$1.Root, {
9871
+ onOpenChange: handleOpenChange,
9872
+ open: isOpen,
9873
+ children: /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
9874
+ anchor,
9875
+ collisionPadding: 8,
9876
+ side,
9877
+ sideOffset: 6,
9878
+ children: /* @__PURE__ */ jsx(ContextMenuPopup, {
9879
+ $compact: compact,
9880
+ children
9881
+ })
9882
+ }) })
9808
9883
  })
9809
9884
  });
9885
+ if (isNotNil(triggerRef)) return createPortal(menu, document.body);
9886
+ return menu;
9810
9887
  };
9811
- MenuLabel.displayName = "MenuLabel_UI";
9812
9888
  //#endregion
9813
- //#region src/components/Menu/MenuItemButton.tsx
9814
- const StyledButton = styled(Button)`
9815
- ${({ colorScheme }) => getColorScheme(colorScheme)};
9889
+ //#region src/components/CustomizableThemeWrapper/CustomizableThemeWrapper.tsx
9890
+ const StyledCustomizableThemeWrapper = styled.div((props) => props.$overrides);
9891
+ /**
9892
+ * Used for overriding the default theme tokens with custom values.
9893
+ * This should only be used when the ui systems team has been consulted first.
9894
+ */
9895
+ const CustomizableThemeWrapper = ({ children, overrides, ...props }) => /* @__PURE__ */ jsx(StyledCustomizableThemeWrapper, {
9896
+ ...props,
9897
+ $overrides: overrides,
9898
+ "data-wui-theme": "true",
9899
+ children
9900
+ });
9901
+ CustomizableThemeWrapper.displayName = "CustomizableThemeWrapper_UI";
9902
+ //#endregion
9903
+ //#region src/components/DataCards/DataCard.tsx
9904
+ const pulse = keyframes`
9905
+ 0%,
9906
+ 100% {
9907
+ opacity: 1;
9908
+ }
9909
+ 50% {
9910
+ opacity: 0.5;
9911
+ }
9912
+ `;
9913
+ const StyledDataCard = styled.div`
9914
+ --wui-data-card-text: var(--wui-color-text-button);
9915
+ --wui-color-text: var(--wui-data-card-text);
9916
+ --wui-data-card-background: var(--wui-color-bg-surface-secondary);
9917
+ --wui-data-card-background-hover: var(--wui-color-bg-surface-secondary-hover);
9918
+ --wui-data-card-background-active: var(--wui-color-bg-surface-secondary-active);
9919
+ --wui-data-card-skeleton-color: var(--wui-color-bg-surface-tertiary);
9816
9920
 
9817
- display: flex;
9818
- flex-direction: row;
9819
- gap: var(--menu-item-inner-gap);
9820
- padding: var(--menu-item-padding);
9821
- border-radius: var(--wui-border-radius-01);
9822
- text-align: left;
9823
- color: var(--wui-color-text-button);
9824
- font-size: var(--menu-label-font-size);
9825
- font-weight: var(--menu-label-font-weight);
9826
- line-height: var(--menu-label-line-height);
9827
- transition: background-color var(--wui-motion-duration-01) var(--wui-motion-ease);
9921
+ display: grid;
9922
+ grid-template-areas: 'label slot' 'value value';
9923
+ grid-template-rows: auto auto;
9924
+ grid-template-columns: auto auto;
9925
+ gap: var(--wui-space-01);
9926
+ padding: var(--wui-space-03);
9927
+ background: var(--wui-data-card-background);
9928
+ flex: 1;
9929
+ border-radius: var(--wui-border-radius-02);
9930
+ position: relative;
9931
+ transition:
9932
+ background var(--wui-motion-duration-01) var(--wui-motion-ease),
9933
+ box-shadow var(--wui-motion-duration-01) var(--wui-motion-ease),
9934
+ color var(--wui-motion-duration-01) var(--wui-motion-ease);
9828
9935
 
9829
- &:active {
9830
- background-color: var(--wui-color-bg-surface-active);
9936
+ [data-wui-data-card-hover-icon] {
9937
+ opacity: 0;
9938
+ transform: translateX(-16px);
9939
+ transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-out);
9831
9940
  }
9832
9941
 
9833
- &[data-highlighted] {
9834
- outline: none;
9835
- ${({ $isGated }) => $isGated && getColorScheme("purple")};
9836
- background-color: var(--wui-color-bg-surface-hover);
9942
+ &:has([data-wui-data-card-subtitle]) {
9943
+ grid-template-areas: 'label slot' 'value value' 'subtitle subtitle';
9944
+ grid-template-rows: auto auto auto;
9837
9945
  }
9838
9946
 
9839
- &[aria-disabled='true'] {
9840
- --wui-color-text-button: var(--wui-color-text-disabled);
9841
- --wui-color-text-secondary: var(--wui-color-text-disabled);
9842
- --wui-color-icon: var(--wui-color-icon-disabled);
9947
+ [data-wui-data-card-skeleton='true'] {
9948
+ pointer-events: none;
9949
+ background-color: var(--wui-data-card-skeleton-color);
9950
+ animation: ${pulse} 1.5s var(--wui-motion-ease-in-out) 0.5s infinite;
9951
+ color: transparent;
9952
+ user-select: none;
9953
+ border-radius: var(--wui-border-radius-01);
9954
+ width: fit-content;
9955
+ }
9843
9956
 
9844
- &[data-highlighted] {
9845
- background-color: transparent;
9957
+ &[data-click-region] {
9958
+ &:not([disabled]) {
9959
+ cursor: pointer;
9960
+
9961
+ &:hover {
9962
+ --wui-data-card-text: var(--wui-color-text-button);
9963
+ --wui-data-card-background: var(--wui-color-bg-surface-secondary-hover);
9964
+
9965
+ [data-wui-data-card-hover-icon] {
9966
+ opacity: 1;
9967
+ transform: translateX(0);
9968
+ }
9969
+ }
9970
+
9971
+ &:active {
9972
+ --wui-data-card-background: var(--wui-color-bg-surface-secondary-active);
9973
+ }
9974
+
9975
+ &:has([data-click-region-target-button]:focus-visible),
9976
+ &:has([data-click-region-target-link]:focus-visible) {
9977
+ --wui-data-card-focus-ring: var(--wui-color-border);
9978
+
9979
+ box-shadow: inset 0 0 0 2px var(--wui-data-card-focus-ring);
9980
+ }
9981
+
9982
+ &:has([data-click-region-target-button][aria-pressed='true']) {
9983
+ --wui-data-card-text: var(--wui-color-text-selected);
9984
+ --wui-data-card-background: var(--wui-color-bg-surface-selected);
9985
+ --wui-data-card-background-hover: var(--wui-color-bg-surface-selected-hover);
9986
+ --wui-data-card-background-active: var(--wui-color-bg-surface-selected-active);
9987
+ --wui-data-card-focus-ring: var(--wui-color-border-selected);
9988
+ --wui-data-card-skeleton-color: var(--wui-color-bg-surface-selected-active);
9989
+ }
9990
+ }
9991
+
9992
+ &[disabled] {
9993
+ pointer-events: none;
9846
9994
  }
9995
+
9996
+ ${({ $colorScheme }) => getColorScheme($colorScheme)}
9847
9997
  }
9848
9998
  `;
9849
- const StyledLeftIconContainer = styled.div`
9850
- height: var(--menu-item-left-icon-size);
9851
- width: var(--menu-item-left-icon-size);
9999
+ const StyledLabel$1 = styled(Heading)`
10000
+ grid-area: label;
9852
10001
 
9853
- && {
9854
- svg {
9855
- height: var(--menu-item-left-icon-size);
9856
- width: var(--menu-item-left-icon-size);
9857
- flex: 0 0 var(--menu-item-left-icon-size);
9858
- }
10002
+ &[data-wui-data-card-skeleton='true'] {
10003
+ width: 80px;
10004
+ }
10005
+
10006
+ button {
10007
+ text-align: left;
9859
10008
  }
9860
10009
  `;
9861
- const StyledRightIconContainer = styled.div`
9862
- height: var(--menu-item-right-icon-size);
9863
- width: var(--menu-item-right-icon-size);
10010
+ const StyledValue = styled(Heading)`
10011
+ grid-area: value;
9864
10012
 
9865
- && {
9866
- svg {
9867
- height: var(--menu-item-right-icon-size);
9868
- width: var(--menu-item-right-icon-size);
9869
- flex: 0 0 var(--menu-item-right-icon-size);
9870
- }
10013
+ &[data-wui-data-card-skeleton='true'] {
10014
+ width: min(90%, 156px);
9871
10015
  }
9872
10016
  `;
9873
- const StyledLabelAndDescriptionContainer = styled.div`
9874
- display: flex;
9875
- flex-direction: column;
9876
- gap: var(--menu-label-description-gap);
9877
- flex-basis: 100%;
9878
- `;
9879
- const StyledBadgeContainer = styled.div`
9880
- align-self: start;
9881
- justify-self: end;
9882
- font-size: var(--wui-typography-label-4-size);
9883
- color: var(--wui-color-text-secondary);
9884
- `;
9885
- const MenuItemButton = forwardRef(({ children, appearance, command, icon, ...props }, ref) => {
9886
- let { colorScheme, badge } = props;
9887
- if (appearance === "dangerous") {
9888
- if (isNotUndefined(colorScheme)) console.warn("colorScheme prop is ignored when appearance is dangerous");
9889
- colorScheme = "error";
9890
- }
9891
- if (appearance === "gated") badge = /* @__PURE__ */ jsx(Icon, {
9892
- colorScheme: "purple",
9893
- style: {
9894
- height: "16px",
9895
- width: "16px"
9896
- },
9897
- type: "sparkle"
9898
- });
9899
- return /* @__PURE__ */ jsxs(StyledButton, {
9900
- ...props,
9901
- ref,
9902
- $isGated: appearance === "gated",
9903
- colorScheme: colorScheme ?? "inherit",
9904
- fullWidth: true,
9905
- unstyled: true,
9906
- children: [
9907
- isNotNil(props.leftIcon) ? /* @__PURE__ */ jsx(StyledLeftIconContainer, { children: props.leftIcon }) : null,
9908
- /* @__PURE__ */ jsx(StyledLabelAndDescriptionContainer, { children }),
9909
- isNotNil(badge) || isNotNil(command) ? /* @__PURE__ */ jsx(StyledBadgeContainer, { children: badge ?? command }) : null,
9910
- isNotNil(props.rightIcon) ? /* @__PURE__ */ jsx(StyledRightIconContainer, { children: props.rightIcon }) : null
9911
- ]
9912
- });
9913
- });
9914
- MenuItemButton.displayName = "MenuItemButton_UI";
9915
- //#endregion
9916
- //#region src/components/Menu/MenuItemLabel.tsx
9917
- const StyledMenuItemLabel = styled.span`
9918
- /* avoid no-empty-source rule */
9919
- `;
9920
- const MenuItemLabel = ({ children }) => {
9921
- return /* @__PURE__ */ jsx(StyledMenuItemLabel, { children });
9922
- };
9923
- //#endregion
9924
- //#region src/components/Menu/MenuItemDescription.tsx
9925
- const StyledMenuItemDescription = styled(Text)`
9926
- /* avoid no-empty-source rule */
9927
- `;
9928
- const MenuItemDescription = ({ children }) => {
9929
- return /* @__PURE__ */ jsx(StyledMenuItemDescription, {
9930
- prominence: "secondary",
9931
- variant: "body4",
9932
- children
9933
- });
9934
- };
9935
- //#endregion
9936
- //#region src/components/Menu/SubMenu.tsx
9937
- const SubMenuContent = styled(DropdownMenuSubContent)`
9938
- ${menuContentCss}
9939
-
9940
- ${mq.smAndDown} {
9941
- transform: translateX(-100%) !important;
9942
- }
9943
- `;
9944
- const StyledMobileSubMenuItems = styled.div`
9945
- margin-left: var(--wui-space-04);
9946
- `;
9947
- const StyledSubTrigger = styled(DropdownMenuSubTrigger)`
9948
- outline: none;
9949
-
9950
- &[data-state='open'],
9951
- &[data-highlighted] {
9952
- background-color: var(--wui-color-bg-surface-hover);
9953
- }
9954
- `;
9955
- const SubMenuTrigger = ({ icon, ...props }) => {
9956
- const { isSmAndUp } = useMq();
9957
- return /* @__PURE__ */ jsx(isSmAndUp ? StyledSubTrigger : DropdownMenuItem, {
9958
- asChild: true,
9959
- children: /* @__PURE__ */ jsx(MenuItemButton, {
9960
- ...props,
9961
- leftIcon: icon,
9962
- rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-right" })
9963
- })
9964
- });
9965
- };
9966
- const SubMenu = ({ label, description, children, onOpenChange = () => null, ...props }) => {
9967
- const { isSmAndUp } = useMq();
9968
- const [isExpanded, setIsExpanded] = useState(false);
9969
- const { compact } = useMenuContext();
9970
- return isSmAndUp ? /* @__PURE__ */ jsxs(DropdownMenuSub, {
9971
- onOpenChange,
9972
- children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
9973
- ...props,
9974
- children: [/* @__PURE__ */ jsx(MenuItemLabel, { children: label }), isNotNil(description) ? /* @__PURE__ */ jsx(MenuItemDescription, { children: description }) : null]
9975
- }), /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(SubMenuContent, {
9976
- $compact: compact,
9977
- children
9978
- }) })]
9979
- }) : /* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
9980
- ...props,
9981
- onClick: (event) => {
9982
- event.preventDefault();
9983
- setIsExpanded((prev) => !prev);
9984
- },
9985
- children: [/* @__PURE__ */ jsx(MenuItemLabel, { children: label }), /* @__PURE__ */ jsx(MenuItemDescription, { children: description })]
9986
- }), /* @__PURE__ */ jsx(StyledMobileSubMenuItems, { children: isExpanded ? children : null })] });
9987
- };
9988
- SubMenu.displayName = "SubMenu_UI";
9989
- //#endregion
9990
- //#region src/components/Menu/MenuItem.tsx
9991
- const MenuItem = forwardRef(({ onSelect = () => null, ...props }, ref) => {
9992
- return /* @__PURE__ */ jsx(DropdownMenuItem, {
9993
- asChild: true,
9994
- onSelect,
9995
- children: /* @__PURE__ */ jsx(MenuItemButton, {
9996
- ...props,
9997
- ref,
9998
- leftIcon: props.icon
9999
- })
10000
- });
10001
- });
10002
- MenuItem.displayName = "MenuItem_UI";
10003
- //#endregion
10004
- //#region src/components/Menu/MenuRadioGroup.tsx
10005
- const MenuRadioGroup = ({ children, ...props }) => {
10006
- return /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
10007
- ...props,
10008
- children
10009
- });
10010
- };
10011
- MenuRadioGroup.displayName = "MenuRadioGroup_UI";
10012
- //#endregion
10013
- //#region src/components/Menu/RadioMenuItem.tsx
10014
- const RadioMenuItem = ({ onSelect, value, indicator = /* @__PURE__ */ jsx(Icon, {
10015
- size: "sm",
10016
- type: "checkmark"
10017
- }), ...props }) => {
10018
- return /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
10019
- ...onSelect ? { onSelect } : {},
10020
- asChild: true,
10021
- value,
10022
- children: /* @__PURE__ */ jsx(MenuItemButton, {
10023
- ...props,
10024
- rightIcon: /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { children: indicator })
10025
- })
10026
- });
10027
- };
10028
- RadioMenuItem.displayName = "RadioMenuItem_UI";
10029
- //#endregion
10030
- //#region src/components/Menu/CheckboxMenuItem.tsx
10031
- const CheckboxIndicator = ({ checked, ...props }) => {
10032
- return checked ? /* @__PURE__ */ jsxs("svg", {
10033
- ...props,
10034
- fill: "none",
10035
- height: "24",
10036
- viewBox: "0 0 24 24",
10037
- width: "24",
10038
- xmlns: "http://www.w3.org/2000/svg",
10039
- children: [/* @__PURE__ */ jsx("path", {
10040
- d: "m4 8c0-2.20914 1.79086-4 4-4h8c2.2091 0 4 1.79086 4 4v8c0 2.2091-1.7909 4-4 4h-8c-2.20914 0-4-1.7909-4-4z",
10041
- fill: "#2949e5"
10042
- }), /* @__PURE__ */ jsx("path", {
10043
- d: "m10.4728 15.1931-3.09523-3.1131c-.18596-.187-.18596-.4902 0-.6773l.67341-.6773c.18596-.187.48749-.187.67344 0l2.08508 2.0971 4.4661-4.49174c.1859-.18703.4875-.18703.6734 0l.6734.67731c.186.18703.186.49027 0 .67731l-5.4762 5.50772c-.1859.187-.4874.187-.6734 0z",
10044
- fill: "#fff"
10045
- })]
10046
- }) : /* @__PURE__ */ jsxs("svg", {
10047
- ...props,
10048
- fill: "none",
10049
- height: "24",
10050
- viewBox: "0 0 24 24",
10051
- width: "24",
10052
- xmlns: "http://www.w3.org/2000/svg",
10053
- children: [/* @__PURE__ */ jsx("path", {
10054
- d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
10055
- fill: "#fcfcfd"
10056
- }), /* @__PURE__ */ jsx("path", {
10057
- d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
10058
- stroke: "#bbbbc4"
10059
- })]
10060
- });
10061
- };
10062
- const CheckboxMenuItem = ({ onSelect = () => null, checked, onCheckedChange, ...props }) => {
10063
- return /* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
10064
- asChild: true,
10065
- checked,
10066
- onCheckedChange,
10067
- onSelect,
10068
- children: /* @__PURE__ */ jsx(MenuItemButton, {
10069
- ...props,
10070
- leftIcon: isNotNil(props.icon) ? props.icon : /* @__PURE__ */ jsx(CheckboxIndicator, { checked }),
10071
- rightIcon: isNotNil(props.icon) ? /* @__PURE__ */ jsx(DropdownMenuItemIndicator, { children: /* @__PURE__ */ jsx(Icon, { type: "checkmark" }) }) : void 0
10072
- })
10073
- });
10074
- };
10075
- CheckboxMenuItem.displayName = "CheckboxMenuItem_UI";
10076
- //#endregion
10077
- //#region src/components/Menu/FilterMenu.tsx
10078
- const FilterMenuItem = CheckboxMenuItem;
10079
- const FilterMenu = forwardRef(({ value, onChange, searchValue, onSearchValueChange, children, ...props }, ref) => {
10080
- return /* @__PURE__ */ jsxs(Menu, {
10081
- ...props,
10082
- ref,
10083
- children: [
10084
- /* @__PURE__ */ jsx(Card, {
10085
- alignItems: "flex-end",
10086
- border: false,
10087
- borderRadius: "border-radius-02",
10088
- paddingSize: "space-01",
10089
- prominence: "primary",
10090
- style: {
10091
- position: "absolute",
10092
- top: 0,
10093
- left: 0,
10094
- right: 0,
10095
- margin: "1px"
10096
- },
10097
- children: /* @__PURE__ */ jsx(Input, {
10098
- autoFocus: true,
10099
- onChange: (event) => {
10100
- onSearchValueChange(event.target.value);
10101
- },
10102
- onKeyDown: (event) => {
10103
- if (event.key === "ArrowDown") {
10104
- event.preventDefault();
10105
- const firstMenuItem = document.querySelector("[role=\"menu\"]")?.querySelector("[role=\"menuitemcheckbox\"]");
10106
- if (firstMenuItem) firstMenuItem.focus();
10107
- }
10108
- event.stopPropagation();
10109
- },
10110
- placeholder: "Search...",
10111
- tabIndex: 0,
10112
- type: "search",
10113
- value: searchValue
10114
- })
10115
- }),
10116
- /* @__PURE__ */ jsx(MenuItem, {
10117
- disabled: true,
10118
- style: { padding: "16px" },
10119
- children: " "
10120
- }),
10121
- Children.toArray(children).length > 0 ? children : /* @__PURE__ */ jsx(MenuItem, {
10122
- disabled: true,
10123
- children: "No results found"
10124
- }),
10125
- value.length > 0 && /* @__PURE__ */ jsx(DropdownMenuItem, {
10126
- disabled: true,
10127
- style: { marginTop: "24px" },
10128
- children: /* @__PURE__ */ jsx(Card, {
10129
- alignItems: "flex-end",
10130
- border: false,
10131
- borderRadius: "border-radius-02",
10132
- paddingSize: "space-01",
10133
- prominence: "primary",
10134
- style: {
10135
- position: "absolute",
10136
- bottom: 0,
10137
- left: 0,
10138
- right: 0,
10139
- margin: "1px"
10140
- },
10141
- children: /* @__PURE__ */ jsx(Button, {
10142
- onClick: () => onChange([]),
10143
- size: "sm",
10144
- children: "Clear"
10145
- })
10146
- })
10147
- })
10148
- ]
10149
- });
10150
- });
10151
- FilterMenu.displayName = "FilterMenu_UI";
10152
- //#endregion
10153
- //#region src/components/ContextMenu/ContextMenu.tsx
10154
- /**
10155
- * The ContextMenu is an extended implementation of the [Menu]() component that allows for right-click context menus.
10156
- * It can be used in two ways:
10157
- * 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
10158
- * 2. By providing a `position` prop, which will render the menu at the specified coordinates.
10159
- */
10160
- const ContextMenu = ({ position, triggerRef, children, side = "bottom", onRequestClose = () => null, compact = false }) => {
10161
- const [isRightClicked, setIsRightClicked] = useState(false);
10162
- const [menuPosition, setMenuPosition] = useState(position ?? {
10163
- x: 0,
10164
- y: 0
10165
- });
10166
- useEffect(() => {
10167
- if (isNil(position)) {
10168
- const onContextMenu = (event) => {
10169
- event.preventDefault();
10170
- setMenuPosition({
10171
- x: event.clientX,
10172
- y: event.clientY
10173
- });
10174
- setIsRightClicked(true);
10175
- };
10176
- const triggerEl = triggerRef?.current;
10177
- triggerEl?.addEventListener("contextmenu", onContextMenu);
10178
- return () => {
10179
- triggerEl?.removeEventListener("contextmenu", onContextMenu);
10180
- };
10181
- }
10182
- return () => null;
10183
- }, [position, triggerRef]);
10184
- const isOpen = isNotNil(position) || isRightClicked;
10185
- if (!isOpen) return null;
10186
- const menu = /* @__PURE__ */ jsx(Menu, {
10187
- compact,
10188
- isOpen,
10189
- onOpenChange: (next) => {
10190
- setIsRightClicked(next);
10191
- if (!next) onRequestClose();
10192
- },
10193
- side,
10194
- trigger: /* @__PURE__ */ jsx("button", {
10195
- "aria-label": "context menu",
10196
- style: {
10197
- width: "1px",
10198
- height: "1px",
10199
- all: "unset",
10200
- position: "fixed",
10201
- top: menuPosition.y,
10202
- left: menuPosition.x
10203
- },
10204
- type: "button"
10205
- }),
10206
- children
10207
- });
10208
- if (isNotNil(triggerRef)) return createPortal(menu, document.body);
10209
- return menu;
10210
- };
10211
- //#endregion
10212
- //#region src/components/CustomizableThemeWrapper/CustomizableThemeWrapper.tsx
10213
- const StyledCustomizableThemeWrapper = styled.div((props) => props.$overrides);
10214
- /**
10215
- * Used for overriding the default theme tokens with custom values.
10216
- * This should only be used when the ui systems team has been consulted first.
10217
- */
10218
- const CustomizableThemeWrapper = ({ children, overrides, ...props }) => /* @__PURE__ */ jsx(StyledCustomizableThemeWrapper, {
10219
- ...props,
10220
- $overrides: overrides,
10221
- "data-wui-theme": "true",
10222
- children
10223
- });
10224
- CustomizableThemeWrapper.displayName = "CustomizableThemeWrapper_UI";
10225
- //#endregion
10226
- //#region src/components/DataCards/DataCard.tsx
10227
- const pulse = keyframes`
10228
- 0%,
10229
- 100% {
10230
- opacity: 1;
10231
- }
10232
- 50% {
10233
- opacity: 0.5;
10234
- }
10235
- `;
10236
- const StyledDataCard = styled.div`
10237
- --wui-data-card-text: var(--wui-color-text-button);
10238
- --wui-color-text: var(--wui-data-card-text);
10239
- --wui-data-card-background: var(--wui-color-bg-surface-secondary);
10240
- --wui-data-card-background-hover: var(--wui-color-bg-surface-secondary-hover);
10241
- --wui-data-card-background-active: var(--wui-color-bg-surface-secondary-active);
10242
- --wui-data-card-skeleton-color: var(--wui-color-bg-surface-tertiary);
10243
-
10244
- display: grid;
10245
- grid-template-areas: 'label slot' 'value value';
10246
- grid-template-rows: auto auto;
10247
- grid-template-columns: auto auto;
10248
- gap: var(--wui-space-01);
10249
- padding: var(--wui-space-03);
10250
- background: var(--wui-data-card-background);
10251
- flex: 1;
10252
- border-radius: var(--wui-border-radius-02);
10253
- position: relative;
10254
- transition:
10255
- background var(--wui-motion-duration-01) var(--wui-motion-ease),
10256
- box-shadow var(--wui-motion-duration-01) var(--wui-motion-ease),
10257
- color var(--wui-motion-duration-01) var(--wui-motion-ease);
10258
-
10259
- [data-wui-data-card-hover-icon] {
10260
- opacity: 0;
10261
- transform: translateX(-16px);
10262
- transition: all var(--wui-motion-duration-02) var(--wui-motion-ease-out);
10263
- }
10264
-
10265
- &:has([data-wui-data-card-subtitle]) {
10266
- grid-template-areas: 'label slot' 'value value' 'subtitle subtitle';
10267
- grid-template-rows: auto auto auto;
10268
- }
10269
-
10270
- [data-wui-data-card-skeleton='true'] {
10271
- pointer-events: none;
10272
- background-color: var(--wui-data-card-skeleton-color);
10273
- animation: ${pulse} 1.5s var(--wui-motion-ease-in-out) 0.5s infinite;
10274
- color: transparent;
10275
- user-select: none;
10276
- border-radius: var(--wui-border-radius-01);
10277
- width: fit-content;
10278
- }
10279
-
10280
- &[data-click-region] {
10281
- &:not([disabled]) {
10282
- cursor: pointer;
10283
-
10284
- &:hover {
10285
- --wui-data-card-text: var(--wui-color-text-button);
10286
- --wui-data-card-background: var(--wui-color-bg-surface-secondary-hover);
10287
-
10288
- [data-wui-data-card-hover-icon] {
10289
- opacity: 1;
10290
- transform: translateX(0);
10291
- }
10292
- }
10293
-
10294
- &:active {
10295
- --wui-data-card-background: var(--wui-color-bg-surface-secondary-active);
10296
- }
10297
-
10298
- &:has([data-click-region-target-button]:focus-visible),
10299
- &:has([data-click-region-target-link]:focus-visible) {
10300
- --wui-data-card-focus-ring: var(--wui-color-border);
10301
-
10302
- box-shadow: inset 0 0 0 2px var(--wui-data-card-focus-ring);
10303
- }
10304
-
10305
- &:has([data-click-region-target-button][aria-pressed='true']) {
10306
- --wui-data-card-text: var(--wui-color-text-selected);
10307
- --wui-data-card-background: var(--wui-color-bg-surface-selected);
10308
- --wui-data-card-background-hover: var(--wui-color-bg-surface-selected-hover);
10309
- --wui-data-card-background-active: var(--wui-color-bg-surface-selected-active);
10310
- --wui-data-card-focus-ring: var(--wui-color-border-selected);
10311
- --wui-data-card-skeleton-color: var(--wui-color-bg-surface-selected-active);
10312
- }
10313
- }
10314
-
10315
- &[disabled] {
10316
- pointer-events: none;
10317
- }
10318
-
10319
- ${({ $colorScheme }) => getColorScheme($colorScheme)}
10320
- }
10321
- `;
10322
- const StyledLabel$1 = styled(Heading)`
10323
- grid-area: label;
10324
-
10325
- &[data-wui-data-card-skeleton='true'] {
10326
- width: 80px;
10327
- }
10328
-
10329
- button {
10330
- text-align: left;
10331
- }
10332
- `;
10333
- const StyledValue = styled(Heading)`
10334
- grid-area: value;
10335
-
10336
- &[data-wui-data-card-skeleton='true'] {
10337
- width: min(90%, 156px);
10338
- }
10339
- `;
10340
- const StyledSlot = styled.div`
10017
+ const StyledSlot = styled.div`
10341
10018
  display: flex;
10342
10019
  justify-content: flex-end;
10343
10020
  grid-area: slot;
@@ -11643,7 +11320,7 @@ const previewCardClose = keyframes`
11643
11320
  transform: scale(0.96);
11644
11321
  }
11645
11322
  `;
11646
- const StyledPopup = styled(PreviewCard$1.Popup)`
11323
+ const StyledPopup$3 = styled(PreviewCard$1.Popup)`
11647
11324
  --preview-card-animation-duration: var(--wui-motion-duration-03);
11648
11325
  --preview-card-animation-ease: var(--wui-motion-ease-out);
11649
11326
 
@@ -11693,7 +11370,7 @@ const PreviewCard = ({ children, trigger, maxWidth = "320px", maxHeight = "auto"
11693
11370
  align,
11694
11371
  side,
11695
11372
  sideOffset: 8,
11696
- children: /* @__PURE__ */ jsx(StyledPopup, {
11373
+ children: /* @__PURE__ */ jsx(StyledPopup$3, {
11697
11374
  $colorScheme: colorScheme,
11698
11375
  $paddingSize: paddingSize,
11699
11376
  ...props,
@@ -11893,7 +11570,7 @@ const StyledKey = styled.kbd`
11893
11570
  min-width: 20px;
11894
11571
  padding: 0 var(--wui-space-01);
11895
11572
  `;
11896
- const Label$2 = styled.span`
11573
+ const Label$1 = styled.span`
11897
11574
  color: var(--wui-color-text);
11898
11575
  font-size: 12px;
11899
11576
  `;
@@ -11929,7 +11606,7 @@ const keyToString = (key) => {
11929
11606
  const KeyboardShortcut = ({ label, keyboardKeys, fullWidth = false, ...otherProps }) => /* @__PURE__ */ jsxs(StyledKeyboardShortcut, {
11930
11607
  $fullWidth: fullWidth,
11931
11608
  ...otherProps,
11932
- children: [isNotNil(label) && /* @__PURE__ */ jsx(Label$2, { children: label }), /* @__PURE__ */ jsx(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ jsx(StyledKey, { children: keyToString(keyboardKey) }, index)) })]
11609
+ children: [isNotNil(label) && /* @__PURE__ */ jsx(Label$1, { children: label }), /* @__PURE__ */ jsx(KeysContainer, { children: (Array.isArray(keyboardKeys) ? keyboardKeys : [keyboardKeys]).map((keyboardKey, index) => /* @__PURE__ */ jsx(StyledKey, { children: keyToString(keyboardKey) }, index)) })]
11933
11610
  });
11934
11611
  KeyboardShortcut.displayName = "KeyboardShortcut_UI";
11935
11612
  //#endregion
@@ -12190,33 +11867,394 @@ const baseMarkdownCss = (textSize = "body2") => css`
12190
11867
  margin: 0;
12191
11868
  }
12192
11869
 
12193
- hr {
12194
- border: none;
12195
- border-top: 1px solid var(--wui-color-border);
12196
- margin-block: calc(var(--wui-markdown-base-unit) * 1.5);
11870
+ hr {
11871
+ border: none;
11872
+ border-top: 1px solid var(--wui-color-border);
11873
+ margin-block: calc(var(--wui-markdown-base-unit) * 1.5);
11874
+ }
11875
+
11876
+ img {
11877
+ max-width: 100%;
11878
+ height: auto;
11879
+ }
11880
+ `;
11881
+ //#endregion
11882
+ //#region src/components/Markdown/Markdown.tsx
11883
+ const StyledMarkdownWrapper = styled.div`
11884
+ ${({ $textSize }) => baseMarkdownCss($textSize)}
11885
+ `;
11886
+ /**
11887
+ * This is a simple wrapper around `react-markdown` that applies some basic styles.
11888
+ */
11889
+ const Markdown = ({ children, textSize = "body2", ...otherProps }) => {
11890
+ return /* @__PURE__ */ jsx(StyledMarkdownWrapper, {
11891
+ $textSize: useResponsiveProp(textSize),
11892
+ ...otherProps,
11893
+ children: /* @__PURE__ */ jsx(ReactMarkdown, { children })
11894
+ });
11895
+ };
11896
+ Markdown.displayName = "Markdown_UI";
11897
+ //#endregion
11898
+ //#region src/components/Menu/MenuLabel.tsx
11899
+ const StyledMenuLabel = styled.div`
11900
+ padding: var(--wui-space-02);
11901
+ `;
11902
+ const MenuLabel = ({ children, ...props }) => {
11903
+ return /* @__PURE__ */ jsx(StyledMenuLabel, {
11904
+ role: "group",
11905
+ ...props,
11906
+ children: /* @__PURE__ */ jsx(Heading, {
11907
+ renderAs: "span",
11908
+ variant: "heading6",
11909
+ children
11910
+ })
11911
+ });
11912
+ };
11913
+ MenuLabel.displayName = "MenuLabel_UI";
11914
+ //#endregion
11915
+ //#region src/components/Menu/MenuItemButton.tsx
11916
+ const StyledButton = styled(Button)`
11917
+ ${({ colorScheme }) => getColorScheme(colorScheme)};
11918
+
11919
+ display: flex;
11920
+ flex-direction: row;
11921
+ gap: var(--menu-item-inner-gap);
11922
+ padding: var(--menu-item-padding);
11923
+ border-radius: var(--wui-border-radius-01);
11924
+ text-align: left;
11925
+ color: var(--wui-color-text-button);
11926
+ font-size: var(--menu-label-font-size);
11927
+ font-weight: var(--menu-label-font-weight);
11928
+ line-height: var(--menu-label-line-height);
11929
+ transition: background-color var(--wui-motion-duration-01) var(--wui-motion-ease);
11930
+
11931
+ &:active {
11932
+ background-color: var(--wui-color-bg-surface-active);
11933
+ }
11934
+
11935
+ &[data-highlighted] {
11936
+ outline: none;
11937
+ ${({ $isGated }) => $isGated && getColorScheme("purple")};
11938
+ background-color: var(--wui-color-bg-surface-hover);
11939
+ }
11940
+
11941
+ &[aria-disabled='true'] {
11942
+ --wui-color-text-button: var(--wui-color-text-disabled);
11943
+ --wui-color-text-secondary: var(--wui-color-text-disabled);
11944
+ --wui-color-icon: var(--wui-color-icon-disabled);
11945
+
11946
+ &[data-highlighted] {
11947
+ background-color: transparent;
11948
+ }
11949
+ }
11950
+ `;
11951
+ const StyledLeftIconContainer = styled.div`
11952
+ height: var(--menu-item-left-icon-size);
11953
+ width: var(--menu-item-left-icon-size);
11954
+
11955
+ && {
11956
+ svg {
11957
+ height: var(--menu-item-left-icon-size);
11958
+ width: var(--menu-item-left-icon-size);
11959
+ flex: 0 0 var(--menu-item-left-icon-size);
11960
+ }
11961
+ }
11962
+ `;
11963
+ const StyledRightIconContainer = styled.div`
11964
+ height: var(--menu-item-right-icon-size);
11965
+ width: var(--menu-item-right-icon-size);
11966
+
11967
+ && {
11968
+ svg {
11969
+ height: var(--menu-item-right-icon-size);
11970
+ width: var(--menu-item-right-icon-size);
11971
+ flex: 0 0 var(--menu-item-right-icon-size);
11972
+ }
11973
+ }
11974
+ `;
11975
+ const StyledLabelAndDescriptionContainer = styled.div`
11976
+ display: flex;
11977
+ flex-direction: column;
11978
+ gap: var(--menu-label-description-gap);
11979
+ flex-basis: 100%;
11980
+ `;
11981
+ const StyledBadgeContainer = styled.div`
11982
+ align-self: start;
11983
+ justify-self: end;
11984
+ font-size: var(--wui-typography-label-4-size);
11985
+ color: var(--wui-color-text-secondary);
11986
+ `;
11987
+ const MenuItemButton = forwardRef(({ children, appearance, command, icon, ...props }, ref) => {
11988
+ let { colorScheme, badge } = props;
11989
+ if (appearance === "dangerous") {
11990
+ if (isNotUndefined(colorScheme)) console.warn("colorScheme prop is ignored when appearance is dangerous");
11991
+ colorScheme = "error";
11992
+ }
11993
+ if (appearance === "gated") badge = /* @__PURE__ */ jsx(Icon, {
11994
+ colorScheme: "purple",
11995
+ style: {
11996
+ height: "16px",
11997
+ width: "16px"
11998
+ },
11999
+ type: "sparkle"
12000
+ });
12001
+ return /* @__PURE__ */ jsxs(StyledButton, {
12002
+ ...props,
12003
+ ref,
12004
+ $isGated: appearance === "gated",
12005
+ colorScheme: colorScheme ?? "inherit",
12006
+ fullWidth: true,
12007
+ unstyled: true,
12008
+ children: [
12009
+ isNotNil(props.leftIcon) ? /* @__PURE__ */ jsx(StyledLeftIconContainer, { children: props.leftIcon }) : null,
12010
+ /* @__PURE__ */ jsx(StyledLabelAndDescriptionContainer, { children }),
12011
+ isNotNil(badge) || isNotNil(command) ? /* @__PURE__ */ jsx(StyledBadgeContainer, { children: badge ?? command }) : null,
12012
+ isNotNil(props.rightIcon) ? /* @__PURE__ */ jsx(StyledRightIconContainer, { children: props.rightIcon }) : null
12013
+ ]
12014
+ });
12015
+ });
12016
+ MenuItemButton.displayName = "MenuItemButton_UI";
12017
+ //#endregion
12018
+ //#region src/components/Menu/MenuItemLabel.tsx
12019
+ const StyledMenuItemLabel = styled.span`
12020
+ /* avoid no-empty-source rule */
12021
+ `;
12022
+ const MenuItemLabel = ({ children }) => {
12023
+ return /* @__PURE__ */ jsx(StyledMenuItemLabel, { children });
12024
+ };
12025
+ //#endregion
12026
+ //#region src/components/Menu/MenuItemDescription.tsx
12027
+ const StyledMenuItemDescription = styled(Text)`
12028
+ /* avoid no-empty-source rule */
12029
+ `;
12030
+ const MenuItemDescription = ({ children }) => {
12031
+ return /* @__PURE__ */ jsx(StyledMenuItemDescription, {
12032
+ prominence: "secondary",
12033
+ variant: "body4",
12034
+ children
12035
+ });
12036
+ };
12037
+ //#endregion
12038
+ //#region src/components/Menu/SubMenu.tsx
12039
+ const SubMenuPopup = styled(Menu$1.Popup)`
12040
+ ${menuContentCss}
12041
+
12042
+ ${mq.smAndDown} {
12043
+ transform: translateX(-100%) !important;
12197
12044
  }
12045
+ `;
12046
+ const StyledMobileSubMenuItems = styled.div`
12047
+ margin-left: var(--wui-space-04);
12048
+ `;
12049
+ const StyledSubTrigger = styled(Menu$1.SubmenuTrigger)`
12050
+ outline: none;
12198
12051
 
12199
- img {
12200
- max-width: 100%;
12201
- height: auto;
12052
+ &[data-popup-open],
12053
+ &[data-highlighted] {
12054
+ background-color: var(--wui-color-bg-surface-hover);
12202
12055
  }
12203
12056
  `;
12057
+ const SubMenuTrigger = ({ icon, ...props }) => {
12058
+ const { isSmAndUp } = useMq();
12059
+ return /* @__PURE__ */ jsx(isSmAndUp ? StyledSubTrigger : Menu$1.Item, {
12060
+ nativeButton: true,
12061
+ render: /* @__PURE__ */ jsx(MenuItemButton, {
12062
+ ...props,
12063
+ leftIcon: icon,
12064
+ rightIcon: /* @__PURE__ */ jsx(Icon, { type: "caret-right" })
12065
+ })
12066
+ });
12067
+ };
12068
+ const SubMenu = ({ label, description, children, onOpenChange = () => null, ...props }) => {
12069
+ const { isSmAndUp } = useMq();
12070
+ const [isExpanded, setIsExpanded] = useState(false);
12071
+ const { compact } = useMenuContext();
12072
+ return isSmAndUp ? /* @__PURE__ */ jsxs(Menu$1.SubmenuRoot, {
12073
+ onOpenChange,
12074
+ children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
12075
+ ...props,
12076
+ children: [/* @__PURE__ */ jsx(MenuItemLabel, { children: label }), isNotNil(description) ? /* @__PURE__ */ jsx(MenuItemDescription, { children: description }) : null]
12077
+ }), /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, { children: /* @__PURE__ */ jsx(SubMenuPopup, {
12078
+ $compact: compact,
12079
+ children
12080
+ }) }) })]
12081
+ }) : /* @__PURE__ */ jsxs(Menu$1.Group, { children: [/* @__PURE__ */ jsxs(SubMenuTrigger, {
12082
+ ...props,
12083
+ onClick: (event) => {
12084
+ event.preventDefault();
12085
+ setIsExpanded((prev) => !prev);
12086
+ },
12087
+ children: [/* @__PURE__ */ jsx(MenuItemLabel, { children: label }), isNotNil(description) ? /* @__PURE__ */ jsx(MenuItemDescription, { children: description }) : null]
12088
+ }), /* @__PURE__ */ jsx(StyledMobileSubMenuItems, { children: isExpanded ? children : null })] });
12089
+ };
12090
+ SubMenu.displayName = "SubMenu_UI";
12204
12091
  //#endregion
12205
- //#region src/components/Markdown/Markdown.tsx
12206
- const StyledMarkdownWrapper = styled.div`
12207
- ${({ $textSize }) => baseMarkdownCss($textSize)}
12208
- `;
12209
- /**
12210
- * This is a simple wrapper around `react-markdown` that applies some basic styles.
12211
- */
12212
- const Markdown = ({ children, textSize = "body2", ...otherProps }) => {
12213
- return /* @__PURE__ */ jsx(StyledMarkdownWrapper, {
12214
- $textSize: useResponsiveProp(textSize),
12215
- ...otherProps,
12216
- children: /* @__PURE__ */ jsx(ReactMarkdown, { children })
12092
+ //#region src/components/Menu/MenuItem.tsx
12093
+ const MenuItem = forwardRef(({ onSelect = () => null, closeOnClick = true, ...props }, ref) => {
12094
+ return /* @__PURE__ */ jsx(Menu$1.Item, {
12095
+ closeOnClick,
12096
+ nativeButton: isNil(props.href),
12097
+ onClick: onSelect,
12098
+ render: /* @__PURE__ */ jsx(MenuItemButton, {
12099
+ ...props,
12100
+ ref,
12101
+ leftIcon: props.icon
12102
+ })
12103
+ });
12104
+ });
12105
+ MenuItem.displayName = "MenuItem_UI";
12106
+ //#endregion
12107
+ //#region src/components/Menu/MenuRadioGroup.tsx
12108
+ const MenuRadioGroup = ({ children, ...props }) => {
12109
+ return /* @__PURE__ */ jsx(Menu$1.RadioGroup, {
12110
+ ...props,
12111
+ children
12217
12112
  });
12218
12113
  };
12219
- Markdown.displayName = "Markdown_UI";
12114
+ MenuRadioGroup.displayName = "MenuRadioGroup_UI";
12115
+ //#endregion
12116
+ //#region src/components/Menu/RadioMenuItem.tsx
12117
+ const RadioMenuItem = ({ onSelect, value, indicator = /* @__PURE__ */ jsx(Icon, {
12118
+ size: "sm",
12119
+ type: "checkmark"
12120
+ }), ...props }) => {
12121
+ const extraProps = onSelect ? { onClick: onSelect } : {};
12122
+ return /* @__PURE__ */ jsx(Menu$1.RadioItem, {
12123
+ closeOnClick: true,
12124
+ nativeButton: true,
12125
+ ...extraProps,
12126
+ render: /* @__PURE__ */ jsx(MenuItemButton, {
12127
+ ...props,
12128
+ rightIcon: /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, { children: indicator })
12129
+ }),
12130
+ value
12131
+ });
12132
+ };
12133
+ RadioMenuItem.displayName = "RadioMenuItem_UI";
12134
+ //#endregion
12135
+ //#region src/components/Menu/CheckboxMenuItem.tsx
12136
+ const CheckboxIndicator = ({ checked, ...props }) => {
12137
+ return checked ? /* @__PURE__ */ jsxs("svg", {
12138
+ ...props,
12139
+ fill: "none",
12140
+ height: "24",
12141
+ viewBox: "0 0 24 24",
12142
+ width: "24",
12143
+ xmlns: "http://www.w3.org/2000/svg",
12144
+ children: [/* @__PURE__ */ jsx("path", {
12145
+ d: "m4 8c0-2.20914 1.79086-4 4-4h8c2.2091 0 4 1.79086 4 4v8c0 2.2091-1.7909 4-4 4h-8c-2.20914 0-4-1.7909-4-4z",
12146
+ fill: "#2949e5"
12147
+ }), /* @__PURE__ */ jsx("path", {
12148
+ d: "m10.4728 15.1931-3.09523-3.1131c-.18596-.187-.18596-.4902 0-.6773l.67341-.6773c.18596-.187.48749-.187.67344 0l2.08508 2.0971 4.4661-4.49174c.1859-.18703.4875-.18703.6734 0l.6734.67731c.186.18703.186.49027 0 .67731l-5.4762 5.50772c-.1859.187-.4874.187-.6734 0z",
12149
+ fill: "#fff"
12150
+ })]
12151
+ }) : /* @__PURE__ */ jsxs("svg", {
12152
+ ...props,
12153
+ fill: "none",
12154
+ height: "24",
12155
+ viewBox: "0 0 24 24",
12156
+ width: "24",
12157
+ xmlns: "http://www.w3.org/2000/svg",
12158
+ children: [/* @__PURE__ */ jsx("path", {
12159
+ d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
12160
+ fill: "#fcfcfd"
12161
+ }), /* @__PURE__ */ jsx("path", {
12162
+ d: "m8 4.5h8c1.933 0 3.5 1.567 3.5 3.5v8c0 1.933-1.567 3.5-3.5 3.5h-8c-1.933 0-3.5-1.567-3.5-3.5v-8c0-1.933 1.567-3.5 3.5-3.5z",
12163
+ stroke: "#bbbbc4"
12164
+ })]
12165
+ });
12166
+ };
12167
+ const CheckboxMenuItem = ({ onSelect = () => null, checked, onCheckedChange, ...props }) => {
12168
+ return /* @__PURE__ */ jsx(Menu$1.CheckboxItem, {
12169
+ checked,
12170
+ closeOnClick: false,
12171
+ nativeButton: true,
12172
+ onCheckedChange,
12173
+ onClick: onSelect,
12174
+ render: /* @__PURE__ */ jsx(MenuItemButton, {
12175
+ ...props,
12176
+ leftIcon: isNotNil(props.icon) ? props.icon : /* @__PURE__ */ jsx(CheckboxIndicator, { checked }),
12177
+ rightIcon: isNotNil(props.icon) ? /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(Icon, { type: "checkmark" }) }) : void 0
12178
+ })
12179
+ });
12180
+ };
12181
+ CheckboxMenuItem.displayName = "CheckboxMenuItem_UI";
12182
+ //#endregion
12183
+ //#region src/components/Menu/FilterMenu.tsx
12184
+ const FilterMenuItem = CheckboxMenuItem;
12185
+ const FilterMenu = forwardRef(({ value, onChange, searchValue, onSearchValueChange, children, ...props }, ref) => {
12186
+ return /* @__PURE__ */ jsxs(Menu, {
12187
+ ...props,
12188
+ ref,
12189
+ children: [
12190
+ /* @__PURE__ */ jsx(Card, {
12191
+ alignItems: "flex-end",
12192
+ border: false,
12193
+ borderRadius: "border-radius-02",
12194
+ paddingSize: "space-01",
12195
+ prominence: "primary",
12196
+ style: {
12197
+ position: "absolute",
12198
+ top: 0,
12199
+ left: 0,
12200
+ right: 0,
12201
+ margin: "1px"
12202
+ },
12203
+ children: /* @__PURE__ */ jsx(Input, {
12204
+ autoFocus: true,
12205
+ onChange: (event) => {
12206
+ onSearchValueChange(event.target.value);
12207
+ },
12208
+ onKeyDown: (event) => {
12209
+ if (event.key === "ArrowDown") {
12210
+ event.preventDefault();
12211
+ const firstMenuItem = document.querySelector("[role=\"menu\"]")?.querySelector("[role=\"menuitemcheckbox\"]");
12212
+ if (firstMenuItem) firstMenuItem.focus();
12213
+ }
12214
+ event.stopPropagation();
12215
+ },
12216
+ placeholder: "Search...",
12217
+ tabIndex: 0,
12218
+ type: "search",
12219
+ value: searchValue
12220
+ })
12221
+ }),
12222
+ /* @__PURE__ */ jsx(MenuItem, {
12223
+ disabled: true,
12224
+ style: { padding: "16px" },
12225
+ children: " "
12226
+ }),
12227
+ Children.toArray(children).length > 0 ? children : /* @__PURE__ */ jsx(MenuItem, {
12228
+ disabled: true,
12229
+ children: "No results found"
12230
+ }),
12231
+ value.length > 0 && /* @__PURE__ */ jsx(Menu$1.Item, {
12232
+ disabled: true,
12233
+ style: { marginTop: "24px" },
12234
+ children: /* @__PURE__ */ jsx(Card, {
12235
+ alignItems: "flex-end",
12236
+ border: false,
12237
+ borderRadius: "border-radius-02",
12238
+ paddingSize: "space-01",
12239
+ prominence: "primary",
12240
+ style: {
12241
+ position: "absolute",
12242
+ bottom: 0,
12243
+ left: 0,
12244
+ right: 0,
12245
+ margin: "1px"
12246
+ },
12247
+ children: /* @__PURE__ */ jsx(Button, {
12248
+ onClick: () => onChange([]),
12249
+ size: "sm",
12250
+ children: "Clear"
12251
+ })
12252
+ })
12253
+ })
12254
+ ]
12255
+ });
12256
+ });
12257
+ FilterMenu.displayName = "FilterMenu_UI";
12220
12258
  //#endregion
12221
12259
  //#region src/components/Meter/Meter.tsx
12222
12260
  const MeterWrapper = styled.div`
@@ -12377,19 +12415,14 @@ const Meter = ({ segments, label, labelMeta, description, hideKey = false, max =
12377
12415
  Meter.displayName = "Meter_UI";
12378
12416
  //#endregion
12379
12417
  //#region src/components/Modal/ModalCloseButton.tsx
12380
- const CloseButton = styled(Close$1)`
12381
- align-self: start;
12382
- `;
12383
12418
  const ModalCloseButton = () => {
12384
- return /* @__PURE__ */ jsx(CloseButton, {
12385
- asChild: true,
12386
- children: /* @__PURE__ */ jsx(IconButton, {
12387
- label: "Dismiss modal",
12388
- size: "sm",
12389
- variant: "ghost",
12390
- children: /* @__PURE__ */ jsx(Icon, { type: "close" })
12391
- })
12392
- });
12419
+ return /* @__PURE__ */ jsx(Dialog.Close, { render: /* @__PURE__ */ jsx(IconButton, {
12420
+ label: "Dismiss modal",
12421
+ size: "sm",
12422
+ style: { alignSelf: "start" },
12423
+ variant: "ghost",
12424
+ children: /* @__PURE__ */ jsx(Icon, { type: "close" })
12425
+ }) });
12393
12426
  };
12394
12427
  //#endregion
12395
12428
  //#region src/components/Modal/ModalHeader.tsx
@@ -12401,7 +12434,7 @@ const Header = styled.header`
12401
12434
  gap: var(--wui-space-01);
12402
12435
  justify-content: ${({ $hideTitle }) => $hideTitle ? "flex-end" : "space-between"}; /* ensure ModalCloseButton is right-aligned */
12403
12436
 
12404
- /* DialogTitle creates an h2 element which inherits some margin */
12437
+ /* Dialog.Title creates an h2 element which inherits some margin */
12405
12438
  h2 {
12406
12439
  margin: 0;
12407
12440
  padding-right: ${({ $hideCloseButon }) => $hideCloseButon ? "0" : "var(--wui-space-03)"};
@@ -12413,7 +12446,7 @@ const Header = styled.header`
12413
12446
  top: var(--wui-space-03);
12414
12447
  }
12415
12448
  `;
12416
- const Title$1 = styled(Title)`
12449
+ const Title = styled(Dialog.Title)`
12417
12450
  font-family: var(--wui-typography-heading-2-family);
12418
12451
  line-height: var(--wui-typography-heading-2-line-height);
12419
12452
  font-size: var(--wui-typography-heading-2-size);
@@ -12422,32 +12455,15 @@ const Title$1 = styled(Title)`
12422
12455
  `;
12423
12456
  const ModalHeader = ({ title, hideTitle, hideCloseButton }) => {
12424
12457
  return /* @__PURE__ */ jsxs(Header, {
12425
- $hideCloseButon: hideCloseButton,
12426
- $hideTitle: hideTitle,
12427
- children: [hideTitle ? /* @__PURE__ */ jsx(ScreenReaderOnly, { children: /* @__PURE__ */ jsx(Title$1, { children: title }) }) : /* @__PURE__ */ jsx(Title$1, { children: title }), hideCloseButton ? null : /* @__PURE__ */ jsx(ModalCloseButton, {})]
12428
- });
12429
- };
12430
- //#endregion
12431
- //#region src/components/Modal/constants.ts
12432
- const DEFAULT_MODAL_WIDTH = "532px";
12433
- //#endregion
12434
- //#region src/private/hooks/useFocusRestore/useFocusRestore.ts
12435
- const useFocusRestore = () => {
12436
- const previouslyFocusedRef = useRef(null);
12437
- const timeoutRef = useRef(null);
12438
- useEffect(() => {
12439
- previouslyFocusedRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
12440
- }, []);
12441
- useEffect(() => {
12442
- return () => {
12443
- if (isNotNil(timeoutRef.current)) clearTimeout(timeoutRef.current);
12444
- if (isNotNil(previouslyFocusedRef.current)) timeoutRef.current = setTimeout(() => {
12445
- previouslyFocusedRef.current?.focus();
12446
- }, 0);
12447
- };
12448
- }, []);
12458
+ $hideCloseButon: hideCloseButton,
12459
+ $hideTitle: hideTitle,
12460
+ children: [hideTitle ? /* @__PURE__ */ jsx(ScreenReaderOnly, { children: /* @__PURE__ */ jsx(Title, { children: title }) }) : /* @__PURE__ */ jsx(Title, { children: title }), hideCloseButton ? null : /* @__PURE__ */ jsx(ModalCloseButton, {})]
12461
+ });
12449
12462
  };
12450
12463
  //#endregion
12464
+ //#region src/components/Modal/constants.ts
12465
+ const DEFAULT_MODAL_WIDTH = "532px";
12466
+ //#endregion
12451
12467
  //#region src/components/Modal/ModalContent.tsx
12452
12468
  const modalEnter = keyframes`
12453
12469
  from {
@@ -12484,8 +12500,8 @@ const positionStyleMap = {
12484
12500
  transform-origin: left center;
12485
12501
  animation: ${modalEnter} var(--wui-motion-duration-04) var(--wui-motion-ease-out);
12486
12502
 
12487
- &[data-state='closed'] {
12488
- animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out);
12503
+ &[data-closed] {
12504
+ animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out) forwards;
12489
12505
  }
12490
12506
  `,
12491
12507
  "fixed-top": css`
@@ -12503,8 +12519,8 @@ const positionStyleMap = {
12503
12519
  transform-origin: left center;
12504
12520
  animation: ${modalEnter} var(--wui-motion-duration-04) var(--wui-motion-ease-out);
12505
12521
 
12506
- &[data-state='closed'] {
12507
- animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out);
12522
+ &[data-closed] {
12523
+ animation: ${modalExit} var(--wui-motion-duration-03) var(--wui-motion-ease-out) forwards;
12508
12524
  }
12509
12525
  `,
12510
12526
  "right-side-panel": css`
@@ -12526,7 +12542,7 @@ const positionStyleMap = {
12526
12542
  `} var(--wui-motion-duration-05) var(--wui-motion-ease-out);
12527
12543
  transform-origin: right center;
12528
12544
 
12529
- &[data-state='closed'] {
12545
+ &[data-closed] {
12530
12546
  animation: ${keyframes`
12531
12547
  from {
12532
12548
  opacity: 1;
@@ -12537,11 +12553,11 @@ const positionStyleMap = {
12537
12553
  opacity: 0;
12538
12554
  transform: translateX(100%);
12539
12555
  }
12540
- `} var(--wui-motion-duration-03) var(--wui-motion-ease-in);
12556
+ `} var(--wui-motion-duration-03) var(--wui-motion-ease-in) forwards;
12541
12557
  }
12542
12558
  `
12543
12559
  };
12544
- const StyledModalContent = styled(Content$2)`
12560
+ const StyledModalContent = styled(Dialog.Popup)`
12545
12561
  position: fixed;
12546
12562
  display: flex;
12547
12563
  flex-direction: column;
@@ -12568,12 +12584,12 @@ const StyledModalContent = styled(Content$2)`
12568
12584
  ${({ $positionVariant }) => positionStyleMap[$positionVariant]}
12569
12585
  }
12570
12586
  `;
12571
- const ModalContent = forwardRef(({ width, positionVariant, children, ...props }, ref) => {
12572
- useFocusRestore();
12587
+ const ModalContent = forwardRef(({ width, positionVariant, initialFocusRef, children, ...props }, ref) => {
12573
12588
  return /* @__PURE__ */ jsx(StyledModalContent, {
12574
12589
  ref,
12575
12590
  $positionVariant: positionVariant,
12576
12591
  $width: width,
12592
+ ...isNotNil(initialFocusRef) ? { initialFocus: initialFocusRef } : {},
12577
12593
  ...props,
12578
12594
  children
12579
12595
  });
@@ -12599,20 +12615,20 @@ const backdropHide = keyframes`
12599
12615
  opacity: 0;
12600
12616
  }
12601
12617
  `;
12602
- const ModalOverlay = styled(DialogOverlay)`
12618
+ const ModalOverlay = styled(Dialog.Backdrop)`
12603
12619
  animation: ${backdropShow} var(--wui-motion-duration-02);
12604
12620
  background: var(--wui-color-backdrop);
12605
12621
  inset: 0;
12606
12622
  position: fixed;
12607
12623
  z-index: var(--wui-zindex-backdrop);
12608
12624
 
12609
- &[data-state='closed'] {
12610
- animation: ${backdropHide} var(--wui-motion-duration-02);
12625
+ &[data-closed] {
12626
+ animation: ${backdropHide} var(--wui-motion-duration-02) forwards;
12611
12627
  }
12612
12628
  `;
12613
12629
  //#endregion
12614
12630
  //#region src/components/Modal/Modal.tsx
12615
- const ModalHiddenDescription = styled(Description)({ ...visuallyHiddenStyle });
12631
+ const ModalHiddenDescription = styled(Dialog.Description)({ ...visuallyHiddenStyle });
12616
12632
  const ModalBody = styled.div`
12617
12633
  flex-direction: column;
12618
12634
  display: flex;
@@ -12634,21 +12650,14 @@ const ModalFooter = styled.footer`
12634
12650
  * user interaction or dismissal before returning to the underlying content.
12635
12651
  */
12636
12652
  const Modal = forwardRef(({ children, footer, hideCloseButton = false, hideTitle = false, initialFocusRef, isOpen, onRequestClose, positionVariant = "centered", title, width = DEFAULT_MODAL_WIDTH, ...props }, ref) => {
12637
- return /* @__PURE__ */ jsx(Root$5, {
12653
+ return /* @__PURE__ */ jsx(Dialog.Root, {
12638
12654
  onOpenChange: (open) => {
12639
12655
  if (!open && isNotNil(onRequestClose)) onRequestClose();
12640
12656
  },
12641
12657
  open: isOpen,
12642
- children: /* @__PURE__ */ jsxs(Portal$2, { children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent, {
12658
+ children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(ModalOverlay, {}), /* @__PURE__ */ jsxs(ModalContent, {
12643
12659
  ref,
12644
- onOpenAutoFocus: (event) => {
12645
- if (isNotNil(initialFocusRef) && initialFocusRef.current) {
12646
- event.preventDefault();
12647
- requestAnimationFrame(() => {
12648
- initialFocusRef.current?.focus();
12649
- });
12650
- }
12651
- },
12660
+ initialFocusRef,
12652
12661
  positionVariant,
12653
12662
  width,
12654
12663
  ...props,
@@ -12691,114 +12700,21 @@ const ModalCallout = ({ title, image, children }) => {
12691
12700
  };
12692
12701
  ModalCallout.displayName = "ModalCallout_UI";
12693
12702
  //#endregion
12694
- //#region src/components/Popover/PopoverRoot.tsx
12695
- /**
12696
- * The root of a composable popover. Wrap `PopoverTrigger` (or `PopoverAnchor`)
12697
- * and `PopoverContent` inside it.
12698
- *
12699
- * For the common "button opens a panel" case, prefer the bundled `Popover`.
12700
- */
12701
- const PopoverRoot = ({ isOpen, ...props }) => /* @__PURE__ */ jsx(Root$3, {
12702
- ...props,
12703
- ...isOpen !== void 0 ? { open: isOpen } : {}
12704
- });
12705
- PopoverRoot.displayName = "PopoverRoot_UI";
12706
- //#endregion
12707
- //#region src/components/Popover/PopoverTrigger.tsx
12708
- /**
12709
- * The button that toggles the popover open and closed. By default it renders a
12710
- * `<button>` wrapping its children; pass `asChild` to merge the trigger
12711
- * behavior onto a single child element (e.g. a `Button` or `IconButton`).
12712
- */
12713
- const PopoverTrigger = forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(Trigger$1, {
12714
- ref: forwardedRef,
12715
- ...props
12716
- }));
12717
- PopoverTrigger.displayName = "PopoverTrigger_UI";
12718
- //#endregion
12719
- //#region src/components/Popover/PopoverPortal.tsx
12720
- /**
12721
- * Portals the popover content out of the DOM hierarchy of its trigger so it can
12722
- * escape clipping ancestors (`overflow: hidden`, transformed containers, etc.).
12723
- */
12724
- const PopoverPortal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
12725
- PopoverPortal.displayName = "PopoverPortal_UI";
12726
- //#endregion
12727
- //#region src/components/Popover/PopoverContent.tsx
12728
- const StyledContent$1 = styled(Content$1)`
12729
- z-index: var(--wui-zindex-popover);
12730
- ${({ $colorScheme }) => getColorScheme($colorScheme)};
12731
- ${({ $unstyled }) => !$unstyled && css`
12732
- border-radius: var(--wui-border-radius-02);
12733
- padding: var(--wui-space-04);
12734
- max-width: var(--wui-popover-max-width);
12735
- max-height: var(--wui-popover-max-height);
12736
- background-color: var(--wui-color-bg-surface);
12737
- box-shadow: var(--wui-elevation-01);
12738
- border: 1px solid var(--wui-color-border);
12739
- overflow: auto;
12740
- `}
12741
-
12742
- [data-wui-popover-close] {
12743
- position: absolute;
12744
- top: var(--wui-space-02);
12745
- right: var(--wui-space-02);
12746
- }
12747
- `;
12748
- const DEFAULT_SIDE_OFFSET = 8;
12749
- const DEFAULT_MAX_WIDTH = "320px";
12750
- const DEFAULT_MAX_HEIGHT = "auto";
12751
- /**
12752
- * The styled popover surface. Place inside a `PopoverRoot` (typically wrapped
12753
- * in a `PopoverPortal`). Forwards all Radix Content props, including
12754
- * dismissal/focus event handlers such as `onPointerDownOutside`,
12755
- * `onOpenAutoFocus`, and `onCloseAutoFocus`.
12756
- */
12757
- const PopoverContent = forwardRef(({ colorScheme = "inherit", unstyled = false, maxWidth = DEFAULT_MAX_WIDTH, maxHeight = DEFAULT_MAX_HEIGHT, sideOffset = DEFAULT_SIDE_OFFSET, style, ...props }, forwardedRef) => {
12758
- return /* @__PURE__ */ jsx(StyledContent$1, {
12759
- ref: forwardedRef,
12760
- $colorScheme: colorScheme,
12761
- $unstyled: unstyled,
12762
- sideOffset,
12763
- style: {
12764
- "--wui-popover-max-width": maxWidth,
12765
- "--wui-popover-max-height": maxHeight,
12766
- ...style
12767
- },
12768
- ...props
12769
- });
12770
- });
12771
- PopoverContent.displayName = "PopoverContent_UI";
12772
- //#endregion
12773
- //#region src/components/Popover/PopoverClose.tsx
12774
- /**
12775
- * An element that closes the popover when activated. Defaults to a `<button>`;
12776
- * pass `asChild` to merge the close behavior onto a single child element. For
12777
- * a pre-styled icon close button, use `PopoverCloseButton`.
12778
- */
12779
- const PopoverClose = forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(Close, {
12780
- ref: forwardedRef,
12781
- ...props
12782
- }));
12783
- PopoverClose.displayName = "PopoverClose_UI";
12784
- //#endregion
12785
- //#region src/components/Popover/PopoverCloseButton.tsx
12786
- /**
12787
- * A pre-styled close button intended to be placed inside a `PopoverContent`.
12788
- * For a custom close control, use `PopoverClose` directly.
12789
- */
12790
- const PopoverCloseButton = ({ label = "Close" } = {}) => /* @__PURE__ */ jsx(PopoverClose, {
12791
- asChild: true,
12792
- children: /* @__PURE__ */ jsx(IconButton, {
12793
- "data-wui-popover-close": true,
12794
- label,
12795
- variant: "ghost",
12796
- children: /* @__PURE__ */ jsx(Icon, { type: "close" })
12797
- })
12798
- });
12799
- PopoverCloseButton.displayName = "PopoverCloseButton_UI";
12703
+ //#region src/private/helpers/getControls/getControlProps.tsx
12704
+ const getControlProps = (isOpen, onOpenChange) => {
12705
+ return isNotNil(onOpenChange) && isNotNil(isOpen) ? {
12706
+ open: isOpen,
12707
+ onOpenChange
12708
+ } : {};
12709
+ };
12800
12710
  //#endregion
12801
12711
  //#region src/components/Popover/PopoverArrow.tsx
12712
+ const StyledArrowSvg = styled.svg`
12713
+ /* Override inline top positioning and rotate the arrow so the circle sits near the trigger and the stalk extends down toward the popup. */
12714
+ top: 0 !important;
12715
+ transform: rotate(180deg);
12716
+ transform-origin: center 0;
12717
+ `;
12802
12718
  const StyledPath = styled.path`
12803
12719
  fill: var(--wui-color-border-secondary);
12804
12720
  `;
@@ -12837,86 +12753,259 @@ const StyledCircle = styled.circle`
12837
12753
  }
12838
12754
  `;
12839
12755
  const PopoverArrow = ({ isAnimated }) => {
12840
- return /* @__PURE__ */ jsx(PopoverArrow$1, {
12841
- asChild: true,
12842
- children: /* @__PURE__ */ jsxs("svg", {
12843
- fill: "none",
12844
- height: "56",
12845
- viewBox: "0 0 48 56",
12846
- width: "48",
12847
- xmlns: "http://www.w3.org/2000/svg",
12848
- children: [
12849
- /* @__PURE__ */ jsx(StyledPath, { d: "M24 26.6667C21.0545 26.6667 18.6667 29.0545 18.6667 32C18.6667 34.9455 21.0545 37.3333 24 37.3333C26.9455 37.3333 29.3333 34.9455 29.3333 32C29.3333 29.0545 26.9455 26.6667 24 26.6667ZM23 0V32H25V0H23Z" }),
12850
- /* @__PURE__ */ jsx(StyledCircle, {
12851
- $isAnimated: isAnimated,
12852
- cx: "24",
12853
- cy: "32",
12854
- "data-wui-popover-arrow-inner-circle": true,
12855
- r: "10",
12856
- strokeWidth: "4"
12857
- }),
12858
- /* @__PURE__ */ jsx(StyledCircle, {
12859
- $isAnimated: isAnimated,
12860
- cx: "24",
12861
- cy: "32",
12862
- "data-wui-popover-arrow-outer-circle": true,
12863
- r: "20",
12864
- strokeWidth: "8"
12865
- })
12866
- ]
12867
- })
12868
- });
12756
+ return /* @__PURE__ */ jsx(Popover$1.Arrow, { render: /* @__PURE__ */ jsxs(StyledArrowSvg, {
12757
+ fill: "none",
12758
+ height: "56",
12759
+ viewBox: "0 0 48 56",
12760
+ width: "48",
12761
+ xmlns: "http://www.w3.org/2000/svg",
12762
+ children: [
12763
+ /* @__PURE__ */ jsx(StyledPath, { d: "M24 26.6667C21.0545 26.6667 18.6667 29.0545 18.6667 32C18.6667 34.9455 21.0545 37.3333 24 37.3333C26.9455 37.3333 29.3333 34.9455 29.3333 32C29.3333 29.0545 26.9455 26.6667 24 26.6667ZM23 0V32H25V0H23Z" }),
12764
+ /* @__PURE__ */ jsx(StyledCircle, {
12765
+ $isAnimated: isAnimated,
12766
+ cx: "24",
12767
+ cy: "32",
12768
+ "data-wui-popover-arrow-inner-circle": true,
12769
+ r: "10",
12770
+ strokeWidth: "4"
12771
+ }),
12772
+ /* @__PURE__ */ jsx(StyledCircle, {
12773
+ $isAnimated: isAnimated,
12774
+ cx: "24",
12775
+ cy: "32",
12776
+ "data-wui-popover-arrow-outer-circle": true,
12777
+ r: "20",
12778
+ strokeWidth: "8"
12779
+ })
12780
+ ]
12781
+ }) });
12869
12782
  };
12870
12783
  PopoverArrow.displayName = "PopoverArrow_UI";
12871
12784
  //#endregion
12872
12785
  //#region src/components/Popover/Popover.tsx
12786
+ const StyledPopup$2 = styled(Popover$1.Popup)`
12787
+ z-index: var(--wui-zindex-popover);
12788
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
12789
+ ${({ $unstyled }) => !$unstyled && css`
12790
+ border-radius: var(--wui-border-radius-02);
12791
+ padding: var(--wui-space-04);
12792
+ max-width: var(--wui-popover-max-width, 320px);
12793
+ max-height: var(--wui-popover-max-height, auto);
12794
+ background-color: var(--wui-color-bg-surface);
12795
+ box-shadow: var(--wui-elevation-01);
12796
+ border: 1px solid var(--wui-color-border);
12797
+ overflow: auto;
12798
+ `}
12799
+
12800
+ ${({ $withArrow }) => $withArrow && css`
12801
+ overflow: visible;
12802
+ `}
12803
+
12804
+ [data-wui-popover-close] {
12805
+ position: absolute;
12806
+ top: var(--wui-space-02);
12807
+ right: var(--wui-space-02);
12808
+ }
12809
+ `;
12873
12810
  /**
12874
12811
  * Displays rich content in a portal, triggered by a button.
12875
12812
  *
12876
- * For more control — custom anchor, access to event handlers like
12877
- * `onPointerDownOutside`, no injected close button, etc. — compose the
12878
- * primitives directly: `PopoverRoot`, `PopoverTrigger`, `PopoverAnchor`,
12813
+ * For more control — custom anchor, no injected close button, etc. — compose
12814
+ * the primitives directly: `PopoverRoot`, `PopoverTrigger`, `PopoverAnchor`,
12879
12815
  * `PopoverPortal`, `PopoverContent`, `PopoverClose`.
12880
12816
  */
12881
- const Popover = ({ children, trigger, isOpen, hideCloseButton = false, maxWidth, maxHeight, onOpenChange, unstyled = false, withArrow = false, isAnimated = false, colorScheme = "inherit", style, ...props }) => {
12882
- const sideOffset = withArrow ? -24 : 8;
12883
- return /* @__PURE__ */ jsxs(PopoverRoot, {
12884
- ...isOpen !== void 0 ? {
12885
- isOpen,
12886
- onOpenChange
12887
- } : {},
12888
- children: [/* @__PURE__ */ jsx(PopoverTrigger, {
12889
- asChild: true,
12890
- children: trigger
12891
- }), /* @__PURE__ */ jsx(PopoverPortal, { children: /* @__PURE__ */ jsxs(PopoverContent, {
12892
- colorScheme,
12893
- ...maxHeight !== void 0 ? { maxHeight } : {},
12894
- ...maxWidth !== void 0 ? { maxWidth } : {},
12817
+ const Popover = ({ children, trigger, isOpen, hideCloseButton = false, maxWidth, maxHeight, onOpenChange, unstyled = false, withArrow = false, isAnimated = false, colorScheme = "inherit", style, side, align, nativeButton = true, ...props }) => {
12818
+ const sideOffset = withArrow ? 32 : 8;
12819
+ const mergedStyle = {
12820
+ "--wui-popover-max-width": maxWidth,
12821
+ "--wui-popover-max-height": maxHeight,
12822
+ ...style
12823
+ };
12824
+ return /* @__PURE__ */ jsxs(Popover$1.Root, {
12825
+ ...getControlProps(isOpen, onOpenChange),
12826
+ children: [/* @__PURE__ */ jsx(Popover$1.Trigger, {
12827
+ nativeButton,
12828
+ render: trigger
12829
+ }), /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
12830
+ align,
12831
+ collisionAvoidance: {
12832
+ side: "flip",
12833
+ align: "shift",
12834
+ fallbackAxisSide: "none"
12835
+ },
12836
+ side,
12895
12837
  sideOffset,
12896
- unstyled,
12897
- ...props,
12898
- style,
12899
- children: [
12900
- !hideCloseButton && /* @__PURE__ */ jsx(PopoverCloseButton, {}),
12901
- withArrow ? /* @__PURE__ */ jsx(PopoverArrow, { isAnimated }) : null,
12902
- /* @__PURE__ */ jsx("div", { children })
12903
- ]
12838
+ children: /* @__PURE__ */ jsxs(StyledPopup$2, {
12839
+ $colorScheme: colorScheme,
12840
+ ...props,
12841
+ $unstyled: unstyled,
12842
+ $withArrow: withArrow,
12843
+ role: "dialog",
12844
+ style: mergedStyle,
12845
+ children: [
12846
+ !hideCloseButton && /* @__PURE__ */ jsx(Popover$1.Close, { render: /* @__PURE__ */ jsx(IconButton, {
12847
+ "data-wui-popover-close": true,
12848
+ label: "Close",
12849
+ variant: "ghost",
12850
+ children: /* @__PURE__ */ jsx(Icon, { type: "close" })
12851
+ }) }),
12852
+ withArrow ? /* @__PURE__ */ jsx(PopoverArrow, { isAnimated }) : null,
12853
+ /* @__PURE__ */ jsx("div", { children })
12854
+ ]
12855
+ })
12904
12856
  }) })]
12905
12857
  });
12906
12858
  };
12907
12859
  Popover.displayName = "Popover_UI";
12908
12860
  //#endregion
12861
+ //#region src/components/Popover/PopoverAnchorContext.tsx
12862
+ const PopoverAnchorContext = createContext(null);
12863
+ const PopoverAnchorProvider = PopoverAnchorContext.Provider;
12864
+ const usePopoverAnchor = () => useContext(PopoverAnchorContext);
12865
+ const useCreatePopoverAnchorRef = () => useRef(null);
12866
+ //#endregion
12909
12867
  //#region src/components/Popover/PopoverAnchor.tsx
12910
12868
  /**
12911
12869
  * Positions the popover relative to an element other than the trigger. Useful
12912
12870
  * when the element the user interacts with (e.g. a text input) is separate
12913
12871
  * from what the popover attaches to.
12872
+ *
12873
+ * Wrap the anchor element and nest `PopoverTrigger` inside it.
12874
+ */
12875
+ const PopoverAnchor = ({ children }) => {
12876
+ const sharedRef = usePopoverAnchor();
12877
+ return /* @__PURE__ */ jsx("div", {
12878
+ ref: useCallback((node) => {
12879
+ if (sharedRef) sharedRef.current = node;
12880
+ }, [sharedRef]),
12881
+ children
12882
+ });
12883
+ };
12884
+ PopoverAnchor.displayName = "PopoverAnchor_UI";
12885
+ //#endregion
12886
+ //#region src/components/Popover/PopoverClose.tsx
12887
+ /**
12888
+ * An element that closes the popover when activated. Defaults to a `<button>`;
12889
+ * pass `render` to merge the close behavior onto a single child element. For
12890
+ * a pre-styled icon close button, use `PopoverCloseButton`.
12914
12891
  */
12915
- const PopoverAnchor = forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(Anchor, {
12892
+ const PopoverClose = forwardRef((props, forwardedRef) => /* @__PURE__ */ jsx(Popover$1.Close, {
12916
12893
  ref: forwardedRef,
12917
12894
  ...props
12918
12895
  }));
12919
- PopoverAnchor.displayName = "PopoverAnchor_UI";
12896
+ PopoverClose.displayName = "PopoverClose_UI";
12897
+ //#endregion
12898
+ //#region src/components/Popover/PopoverCloseButton.tsx
12899
+ /**
12900
+ * A pre-styled close button intended to be placed inside a `PopoverContent`.
12901
+ * For a custom close control, use `PopoverClose` directly.
12902
+ */
12903
+ const PopoverCloseButton = ({ label = "Close" } = {}) => /* @__PURE__ */ jsx(PopoverClose, { render: /* @__PURE__ */ jsx(IconButton, {
12904
+ "data-wui-popover-close": true,
12905
+ label,
12906
+ variant: "ghost",
12907
+ children: /* @__PURE__ */ jsx(Icon, { type: "close" })
12908
+ }) });
12909
+ PopoverCloseButton.displayName = "PopoverCloseButton_UI";
12910
+ //#endregion
12911
+ //#region src/components/Popover/PopoverContent.tsx
12912
+ const StyledPopup$1 = styled(Popover$1.Popup)`
12913
+ z-index: var(--wui-zindex-popover);
12914
+ ${({ $colorScheme }) => getColorScheme($colorScheme)};
12915
+ ${({ $unstyled }) => !$unstyled && css`
12916
+ border-radius: var(--wui-border-radius-02);
12917
+ padding: var(--wui-space-04);
12918
+ max-width: var(--wui-popover-max-width);
12919
+ max-height: var(--wui-popover-max-height);
12920
+ background-color: var(--wui-color-bg-surface);
12921
+ box-shadow: var(--wui-elevation-01);
12922
+ border: 1px solid var(--wui-color-border);
12923
+ overflow: auto;
12924
+ `}
12925
+
12926
+ [data-wui-popover-close] {
12927
+ position: absolute;
12928
+ top: var(--wui-space-02);
12929
+ right: var(--wui-space-02);
12930
+ }
12931
+ `;
12932
+ const DEFAULT_SIDE_OFFSET = 8;
12933
+ const DEFAULT_MAX_WIDTH = "320px";
12934
+ const DEFAULT_MAX_HEIGHT = "auto";
12935
+ /**
12936
+ * The styled popover surface. Place inside a `PopoverRoot` (typically wrapped
12937
+ * in a `PopoverPortal`). Wraps a `Positioner` and `Popup` internally.
12938
+ */
12939
+ const PopoverContent = forwardRef(({ colorScheme = "inherit", unstyled = false, maxWidth = DEFAULT_MAX_WIDTH, maxHeight = DEFAULT_MAX_HEIGHT, sideOffset = DEFAULT_SIDE_OFFSET, side, align, style, role = "dialog", children, ...props }, forwardedRef) => {
12940
+ const sharedAnchorRef = usePopoverAnchor();
12941
+ const hasAnchor = sharedAnchorRef?.current != null;
12942
+ const mergedStyle = {
12943
+ "--wui-popover-max-width": maxWidth,
12944
+ "--wui-popover-max-height": maxHeight,
12945
+ ...style
12946
+ };
12947
+ return /* @__PURE__ */ jsx(Popover$1.Positioner, {
12948
+ align,
12949
+ collisionAvoidance: {
12950
+ side: "flip",
12951
+ align: "shift",
12952
+ fallbackAxisSide: "none"
12953
+ },
12954
+ side,
12955
+ sideOffset,
12956
+ ...hasAnchor ? { anchor: sharedAnchorRef } : {},
12957
+ children: /* @__PURE__ */ jsx(StyledPopup$1, {
12958
+ ref: forwardedRef,
12959
+ $colorScheme: colorScheme,
12960
+ $unstyled: unstyled,
12961
+ role,
12962
+ style: mergedStyle,
12963
+ ...props,
12964
+ children
12965
+ })
12966
+ });
12967
+ });
12968
+ PopoverContent.displayName = "PopoverContent_UI";
12969
+ //#endregion
12970
+ //#region src/components/Popover/PopoverPortal.tsx
12971
+ /**
12972
+ * Portals the popover content out of the DOM hierarchy of its trigger so it can
12973
+ * escape clipping ancestors (`overflow: hidden`, transformed containers, etc.).
12974
+ */
12975
+ const PopoverPortal = ({ children }) => /* @__PURE__ */ jsx(Popover$1.Portal, { children });
12976
+ PopoverPortal.displayName = "PopoverPortal_UI";
12977
+ //#endregion
12978
+ //#region src/components/Popover/PopoverRoot.tsx
12979
+ /**
12980
+ * The root of a composable popover. Wrap `PopoverTrigger` (or `PopoverAnchor`)
12981
+ * and `PopoverContent` inside it.
12982
+ *
12983
+ * For the common "button opens a panel" case, prefer the bundled `Popover`.
12984
+ */
12985
+ const PopoverRoot = ({ isOpen, onOpenChange, children }) => {
12986
+ const anchorRef = useCreatePopoverAnchorRef();
12987
+ return /* @__PURE__ */ jsx(Popover$1.Root, {
12988
+ ...getControlProps(isOpen, onOpenChange),
12989
+ children: /* @__PURE__ */ jsx(PopoverAnchorProvider, {
12990
+ value: anchorRef,
12991
+ children
12992
+ })
12993
+ });
12994
+ };
12995
+ PopoverRoot.displayName = "PopoverRoot_UI";
12996
+ //#endregion
12997
+ //#region src/components/Popover/PopoverTrigger.tsx
12998
+ /**
12999
+ * The button that toggles the popover open and closed. By default it renders a
13000
+ * `<button>` wrapping its children; pass `render` to merge the trigger
13001
+ * behavior onto a single child element (e.g. a `Button` or `IconButton`).
13002
+ */
13003
+ const PopoverTrigger = forwardRef(({ nativeButton = true, ...props }, forwardedRef) => /* @__PURE__ */ jsx(Popover$1.Trigger, {
13004
+ ref: forwardedRef,
13005
+ nativeButton,
13006
+ ...props
13007
+ }));
13008
+ PopoverTrigger.displayName = "PopoverTrigger_UI";
12920
13009
  //#endregion
12921
13010
  //#region src/components/ProgressBar/ProgressBar.tsx
12922
13011
  const ProgressBarWrapper = styled.div`
@@ -13699,7 +13788,7 @@ const SegmentedControlItem = forwardRef(({ disabled, icon, label, "aria-label":
13699
13788
  SegmentedControlItem.displayName = "SegmentedControlItem_UI";
13700
13789
  //#endregion
13701
13790
  //#region src/components/Select/Select.tsx
13702
- const StyledTrigger = styled(Trigger$2)`
13791
+ const StyledTrigger = styled(Select$1.Trigger)`
13703
13792
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
13704
13793
  ${inputCss};
13705
13794
  padding: var(--wui-input-vertical-padding) var(--wui-input-horizontal-padding);
@@ -13745,7 +13834,7 @@ const StyledTrigger = styled(Trigger$2)`
13745
13834
  color: var(--wui-input-placeholder);
13746
13835
  }
13747
13836
  `;
13748
- const StyledContent = styled(Content$3)`
13837
+ const StyledPopup = styled(Select$1.Popup)`
13749
13838
  --wui-select-content-border: var(--wui-color-border);
13750
13839
  --wui-select-content-bg: var(--wui-color-bg-surface);
13751
13840
  --wui-select-content-border-radius: var(--wui-border-radius-02);
@@ -13759,8 +13848,8 @@ const StyledContent = styled(Content$3)`
13759
13848
  border-radius: var(--wui-select-content-border-radius);
13760
13849
  box-shadow: var(--wui-elevation-01);
13761
13850
  padding: var(--wui-select-option-padding);
13762
- min-width: var(--radix-select-trigger-width);
13763
- max-height: var(--radix-select-content-available-height);
13851
+ min-width: var(--anchor-width);
13852
+ max-height: var(--available-height);
13764
13853
  z-index: var(--wui-zindex-select);
13765
13854
 
13766
13855
  [role='separator'] {
@@ -13772,55 +13861,87 @@ const scrollButtonStyles = css`
13772
13861
  display: flex;
13773
13862
  justify-content: center;
13774
13863
  `;
13775
- const StyledScrollDownButton = styled(ScrollDownButton)`
13864
+ const StyledScrollDownArrow = styled(Select$1.ScrollDownArrow)`
13776
13865
  ${scrollButtonStyles}
13777
13866
  `;
13778
- const StyledScrollUpButton = styled(ScrollUpButton)`
13867
+ const StyledScrollUpArrow = styled(Select$1.ScrollUpArrow)`
13779
13868
  ${scrollButtonStyles}
13780
13869
  `;
13781
13870
  /**
13871
+ * Walks the React children tree to build a value→label mapping for Base UI's `items` prop.
13872
+ * This ensures `Select.Value` displays the label text instead of the raw value.
13873
+ */
13874
+ const collectItemLabels = (children) => {
13875
+ const items = [];
13876
+ Children.forEach(children, (child) => {
13877
+ if (!isValidElement(child)) return;
13878
+ const { value, selectedDisplayValue, children: childChildren, textValue } = child.props;
13879
+ if (typeof value === "string") {
13880
+ if (selectedDisplayValue !== void 0 && selectedDisplayValue !== null) items.push({
13881
+ value,
13882
+ label: selectedDisplayValue
13883
+ });
13884
+ else if (typeof childChildren === "string") items.push({
13885
+ value,
13886
+ label: childChildren
13887
+ });
13888
+ else if (typeof textValue === "string") items.push({
13889
+ value,
13890
+ label: textValue
13891
+ });
13892
+ return;
13893
+ }
13894
+ if (childChildren !== void 0 && childChildren !== null) items.push(...collectItemLabels(childChildren));
13895
+ });
13896
+ return items;
13897
+ };
13898
+ /**
13782
13899
  * Display a list of options and choose one of them. Replacement for the native Select HTML element.
13783
13900
  */
13784
- const Select = forwardRef(({ colorScheme = "inherit", children, onOpenChange = () => null, onChange = () => null, placeholder = "Select...", fullWidth = false, forceOpen = false, ...props }, forwardedRef) => {
13901
+ const Select = forwardRef(({ colorScheme = "inherit", children, onOpenChange = () => null, onChange = () => null, placeholder = "Select...", fullWidth = false, forceOpen = false, disabled, value, "aria-invalid": ariaInvalid, ...props }, forwardedRef) => {
13785
13902
  const responsiveFullWidth = useResponsiveProp(fullWidth);
13786
13903
  const rootProps = {
13787
- ...props,
13904
+ disabled,
13905
+ items: useMemo(() => collectItemLabels(children), [children]),
13788
13906
  onOpenChange,
13789
- onValueChange: onChange
13907
+ onValueChange: onChange,
13908
+ value
13790
13909
  };
13791
13910
  if (forceOpen) rootProps["open"] = true;
13792
- return /* @__PURE__ */ jsxs(Root$6, {
13911
+ return /* @__PURE__ */ jsxs(Select$1.Root, {
13793
13912
  ...rootProps,
13794
13913
  children: [/* @__PURE__ */ jsxs(StyledTrigger, {
13795
13914
  ref: forwardedRef,
13796
13915
  $colorScheme: colorScheme,
13797
13916
  $fullWidth: responsiveFullWidth,
13917
+ "aria-invalid": ariaInvalid,
13798
13918
  ...props,
13799
- children: [/* @__PURE__ */ jsx(Value, { placeholder }), /* @__PURE__ */ jsx(Icon, {
13919
+ children: [/* @__PURE__ */ jsx(Select$1.Value, { placeholder }), /* @__PURE__ */ jsx(Icon, {
13800
13920
  size: "md",
13801
13921
  type: "caret-down"
13802
13922
  })]
13803
- }), /* @__PURE__ */ jsx(Portal$3, { children: /* @__PURE__ */ jsxs(StyledContent, {
13804
- position: "popper",
13923
+ }), /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
13924
+ align: "start",
13925
+ alignItemWithTrigger: false,
13805
13926
  sideOffset: 8,
13806
- children: [
13807
- /* @__PURE__ */ jsx(StyledScrollUpButton, { children: /* @__PURE__ */ jsx(Icon, {
13927
+ children: /* @__PURE__ */ jsxs(StyledPopup, { children: [
13928
+ /* @__PURE__ */ jsx(StyledScrollUpArrow, { children: /* @__PURE__ */ jsx(Icon, {
13808
13929
  size: "sm",
13809
13930
  type: "caret-up"
13810
13931
  }) }),
13811
- /* @__PURE__ */ jsx(Viewport, { children }),
13812
- /* @__PURE__ */ jsx(StyledScrollDownButton, { children: /* @__PURE__ */ jsx(Icon, {
13932
+ children,
13933
+ /* @__PURE__ */ jsx(StyledScrollDownArrow, { children: /* @__PURE__ */ jsx(Icon, {
13813
13934
  size: "sm",
13814
13935
  type: "caret-down"
13815
13936
  }) })
13816
- ]
13937
+ ] })
13817
13938
  }) })]
13818
13939
  });
13819
13940
  });
13820
13941
  Select.displayName = "Select_UI";
13821
13942
  //#endregion
13822
13943
  //#region src/components/Select/SelectOption.tsx
13823
- const StyledItem = styled(Item$2)`
13944
+ const StyledItem = styled(Select$1.Item)`
13824
13945
  ${getTypographicStyles("label3")}
13825
13946
  align-items: ${({ $checkmarkVerticalAlign }) => $checkmarkVerticalAlign === "center" ? "center" : "flex-start"};
13826
13947
  background-color: transparent;
@@ -13846,15 +13967,17 @@ const StyledItem = styled(Item$2)`
13846
13967
  background-color: transparent;
13847
13968
  }
13848
13969
  `;
13849
- const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVerticalAlign = "center", ...props }, forwardedRef) => {
13970
+ const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVerticalAlign = "center", textValue, ...props }, forwardedRef) => {
13971
+ const label = typeof children === "string" ? children : textValue;
13850
13972
  return /* @__PURE__ */ jsxs(StyledItem, {
13851
13973
  ...props,
13852
13974
  ref: forwardedRef,
13853
13975
  $checkmarkVerticalAlign: checkmarkVerticalAlign,
13976
+ ...label != null ? { label } : {},
13854
13977
  children: [isNotNil(selectedDisplayValue) ? /* @__PURE__ */ jsxs("div", { children: [children, /* @__PURE__ */ jsx("div", {
13855
13978
  style: { display: "none" },
13856
- children: /* @__PURE__ */ jsx(ItemText, { children: selectedDisplayValue })
13857
- })] }) : /* @__PURE__ */ jsx(ItemText, { children }), /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
13979
+ children: /* @__PURE__ */ jsx(Select$1.ItemText, { children: selectedDisplayValue })
13980
+ })] }) : /* @__PURE__ */ jsx(Select$1.ItemText, { children }), /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, {
13858
13981
  size: "md",
13859
13982
  type: "checkmark"
13860
13983
  }) })]
@@ -13863,11 +13986,11 @@ const SelectOption = forwardRef(({ children, selectedDisplayValue, checkmarkVert
13863
13986
  SelectOption.displayName = "SelectOption_UI";
13864
13987
  //#endregion
13865
13988
  //#region src/components/Select/SelectOptionGroup.tsx
13866
- const StyledLabel = styled(Label$1)`
13989
+ const StyledLabel = styled(Select$1.GroupLabel)`
13867
13990
  padding: var(--wui-select-option-padding);
13868
13991
  `;
13869
13992
  const SelectOptionGroup = ({ children, label, ...props }) => {
13870
- return /* @__PURE__ */ jsxs(Group, {
13993
+ return /* @__PURE__ */ jsxs(Select$1.Group, {
13871
13994
  ...props,
13872
13995
  children: [/* @__PURE__ */ jsx(StyledLabel, { children: /* @__PURE__ */ jsx(Heading, {
13873
13996
  renderAs: "span",
@@ -13988,7 +14111,7 @@ const StyledSplitButton = styled.span`
13988
14111
  padding-right: 0;
13989
14112
  }
13990
14113
 
13991
- > [data-wui-button='true']:last-child {
14114
+ > [data-wui-button='true']:not(:first-child) {
13992
14115
  border-top-left-radius: 0;
13993
14116
  border-bottom-left-radius: 0;
13994
14117
  display: inline-flex;