@wistia/ui 0.14.36 → 0.14.37-beta.e51eca76.58dee09

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.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.14.36
3
+ * @license @wistia/ui v0.14.37-beta.e51eca76.58dee09
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -142,6 +142,7 @@ __export(index_exports, {
142
142
  SelectOption: () => SelectOption,
143
143
  SelectOptionGroup: () => SelectOptionGroup,
144
144
  Slider: () => Slider,
145
+ SplitButton: () => SplitButton,
145
146
  Stack: () => Stack,
146
147
  SubMenu: () => SubMenu,
147
148
  Switch: () => Switch,
@@ -7559,6 +7560,7 @@ var Button = (0, import_react23.forwardRef)(
7559
7560
  type: "button",
7560
7561
  ...props,
7561
7562
  ...commonProps,
7563
+ "data-wui-button": true,
7562
7564
  children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(
7563
7565
  ButtonContent,
7564
7566
  {
@@ -11343,14 +11345,14 @@ var Input = (0, import_react47.forwardRef)(
11343
11345
  if ((0, import_type_guards35.isNil)(leftIcon) && type === "search") {
11344
11346
  leftIconToDisplay = /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(Icon, { type: "search" });
11345
11347
  }
11346
- if ((0, import_type_guards35.isNotNil)(leftIconToDisplay)) {
11348
+ if ((0, import_type_guards35.isNotNil)(leftIconToDisplay) && (0, import_react47.isValidElement)(leftIconToDisplay)) {
11347
11349
  leftIconToDisplay = (0, import_react47.cloneElement)(leftIconToDisplay, {
11348
11350
  size: "md",
11349
11351
  className: "wui-input-left-icon"
11350
11352
  });
11351
11353
  }
11352
11354
  let rightIconToDisplay = rightIcon;
11353
- if ((0, import_type_guards35.isNotNil)(rightIconToDisplay)) {
11355
+ if ((0, import_type_guards35.isNotNil)(rightIconToDisplay) && (0, import_react47.isValidElement)(rightIconToDisplay)) {
11354
11356
  rightIconToDisplay = (0, import_react47.cloneElement)(rightIconToDisplay, {
11355
11357
  size: "md",
11356
11358
  className: "wui-input-right-icon"
@@ -12823,10 +12825,10 @@ var MenuItemButton = (0, import_react57.forwardRef)(({ children, appearance, com
12823
12825
  fullWidth: true,
12824
12826
  unstyled: true,
12825
12827
  children: [
12826
- props.leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
12828
+ (0, import_type_guards38.isNotNil)(props.leftIcon) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLeftIconContainer, { children: props.leftIcon }) : null,
12827
12829
  /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledLabelAndDescriptionContainer, { children }),
12828
12830
  (0, import_type_guards38.isNotNil)(badge) || (0, import_type_guards38.isNotNil)(command) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledBadgeContainer, { children: badge ?? command }) : null,
12829
- props.rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
12831
+ (0, import_type_guards38.isNotNil)(props.rightIcon) ? /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(StyledRightIconContainer, { children: props.rightIcon }) : null
12830
12832
  ]
12831
12833
  }
12832
12834
  );
@@ -14123,7 +14125,10 @@ var EditableTextLabel = ({ ...props }) => {
14123
14125
  if (!context) {
14124
14126
  throw new Error("EditableTextLabel must be used within an EditableTextRoot context");
14125
14127
  }
14126
- const { id, label } = context;
14128
+ const { id, label, isEditing } = context;
14129
+ if (!isEditing) {
14130
+ return null;
14131
+ }
14127
14132
  return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(
14128
14133
  Label,
14129
14134
  {
@@ -17743,6 +17748,76 @@ var WistiaLogo = ({
17743
17748
  return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("a", { href, children: Logo }) : Logo;
17744
17749
  };
17745
17750
  WistiaLogo.displayName = "WistiaLogo_UI";
17751
+
17752
+ // src/components/SplitButton/SplitButton.tsx
17753
+ var import_styled_components128 = __toESM(require("styled-components"));
17754
+ var import_type_guards75 = require("@wistia/type-guards");
17755
+ var import_jsx_runtime327 = require("react/jsx-runtime");
17756
+ var StyledSplitButton = import_styled_components128.default.span`
17757
+ white-space: nowrap;
17758
+
17759
+ > [data-wui-button='true']:first-child {
17760
+ border-top-right-radius: 0;
17761
+ border-bottom-right-radius: 0;
17762
+ }
17763
+
17764
+ > [data-wui-button='true']:last-child {
17765
+ border-top-left-radius: 0;
17766
+ border-bottom-left-radius: 0;
17767
+ display: inline-flex;
17768
+ }
17769
+ `;
17770
+ var SplitButton = ({
17771
+ children,
17772
+ menuLabel = "Select an option",
17773
+ menuIcon = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Icon, { type: "caret-down" }),
17774
+ menuItems,
17775
+ disabled = false,
17776
+ colorScheme = "default",
17777
+ variant = "solid",
17778
+ secondaryAction,
17779
+ size = "md",
17780
+ unstyled = false,
17781
+ menuProps = {},
17782
+ ...props
17783
+ }) => {
17784
+ return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(StyledSplitButton, { children: [
17785
+ /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
17786
+ Button,
17787
+ {
17788
+ colorScheme,
17789
+ disabled,
17790
+ size,
17791
+ unstyled,
17792
+ variant,
17793
+ ...props,
17794
+ children
17795
+ }
17796
+ ),
17797
+ (0, import_type_guards75.isNotNil)(menuItems) && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
17798
+ Menu,
17799
+ {
17800
+ ...menuProps,
17801
+ disabled,
17802
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(
17803
+ IconButton,
17804
+ {
17805
+ colorScheme,
17806
+ disabled,
17807
+ label: menuLabel,
17808
+ size,
17809
+ unstyled,
17810
+ variant,
17811
+ children: menuIcon
17812
+ }
17813
+ ),
17814
+ children: menuItems
17815
+ }
17816
+ ),
17817
+ (0, import_type_guards75.isNotNil)(secondaryAction) && secondaryAction
17818
+ ] });
17819
+ };
17820
+ SplitButton.displayName = "SplitButton_UI";
17746
17821
  // Annotate the CommonJS export names for ESM import in node:
17747
17822
  0 && (module.exports = {
17748
17823
  ActionButton,
@@ -17848,6 +17923,7 @@ WistiaLogo.displayName = "WistiaLogo_UI";
17848
17923
  SelectOption,
17849
17924
  SelectOptionGroup,
17850
17925
  Slider,
17926
+ SplitButton,
17851
17927
  Stack,
17852
17928
  SubMenu,
17853
17929
  Switch,