@sproutsocial/seeds-react-menu 1.8.6 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -521,13 +521,14 @@ declare const SubmenuItem: {
521
521
 
522
522
  interface TypeListboxToggleButtonProps extends TypeMenuToggleButtonProps {
523
523
  invalid?: boolean;
524
+ size?: "small" | "default" | "large";
524
525
  }
525
526
  declare const StyledListboxToggleButton: styled_components.StyledComponent<(props: TypeMenuToggleButtonProps) => react_jsx_runtime.JSX.Element, styled_components.DefaultTheme, TypeListboxToggleButtonProps, never>;
526
527
  interface TypeStyledChevronProps {
527
528
  $isOpen?: boolean;
528
529
  invalid?: boolean;
529
530
  }
530
- declare const ListboxToggleButton: ({ children, ...buttonProps }: TypeListboxToggleButtonProps) => react_jsx_runtime.JSX.Element;
531
+ declare const ListboxToggleButton: ({ children, size, ...buttonProps }: TypeListboxToggleButtonProps) => react_jsx_runtime.JSX.Element;
531
532
 
532
533
  type TypeBaseAutocompleteProps = TypeHigherOrderComponentProps & TypeDownshiftComboboxProps & {
533
534
  /** A function that can be passed to override the default filtering logic */
package/dist/index.d.ts CHANGED
@@ -521,13 +521,14 @@ declare const SubmenuItem: {
521
521
 
522
522
  interface TypeListboxToggleButtonProps extends TypeMenuToggleButtonProps {
523
523
  invalid?: boolean;
524
+ size?: "small" | "default" | "large";
524
525
  }
525
526
  declare const StyledListboxToggleButton: styled_components.StyledComponent<(props: TypeMenuToggleButtonProps) => react_jsx_runtime.JSX.Element, styled_components.DefaultTheme, TypeListboxToggleButtonProps, never>;
526
527
  interface TypeStyledChevronProps {
527
528
  $isOpen?: boolean;
528
529
  invalid?: boolean;
529
530
  }
530
- declare const ListboxToggleButton: ({ children, ...buttonProps }: TypeListboxToggleButtonProps) => react_jsx_runtime.JSX.Element;
531
+ declare const ListboxToggleButton: ({ children, size, ...buttonProps }: TypeListboxToggleButtonProps) => react_jsx_runtime.JSX.Element;
531
532
 
532
533
  type TypeBaseAutocompleteProps = TypeHigherOrderComponentProps & TypeDownshiftComboboxProps & {
533
534
  /** A function that can be passed to override the default filtering logic */
package/dist/index.js CHANGED
@@ -1621,6 +1621,40 @@ var import_jsx_runtime17 = require("react/jsx-runtime");
1621
1621
  var StyledListboxToggleButton = (0, import_styled_components10.default)(
1622
1622
  MenuToggleButton
1623
1623
  )`
1624
+ background-color: ${(props) => props.theme.colors.form.background.base};
1625
+ border: 1px solid ${(props) => props.theme.colors.form.border.base};
1626
+ border-radius: ${(props) => props.theme.radii[500]};
1627
+ transition: border-color ${(props) => props.theme.duration.fast}
1628
+ ${(props) => props.theme.easing.ease_in},
1629
+ box-shadow ${(props) => props.theme.duration.fast}
1630
+ ${(props) => props.theme.easing.ease_in};
1631
+ font-weight: ${(props) => props.theme.fontWeights.normal};
1632
+ &:active {
1633
+ transform: none;
1634
+ }
1635
+
1636
+ padding: ${(props) => {
1637
+ switch (props.size) {
1638
+ case "large":
1639
+ return `${props.theme.space[400]} ${props.theme.space[400]} ${props.theme.space[400]} ${props.theme.space[400]}`;
1640
+ case "small":
1641
+ return `${props.theme.space[200]} ${props.theme.space[200]} ${props.theme.space[200]} ${props.theme.space[200]}`;
1642
+ case "default":
1643
+ default:
1644
+ return `${props.theme.space[300]} ${props.theme.space[300]} ${props.theme.space[300]} ${props.theme.space[300]}`;
1645
+ }
1646
+ }};
1647
+ font-size: ${(props) => {
1648
+ switch (props.size) {
1649
+ case "large":
1650
+ return props.theme.typography[300].fontSize;
1651
+ case "small":
1652
+ case "default":
1653
+ default:
1654
+ return props.theme.typography[200].fontSize;
1655
+ }
1656
+ }};
1657
+
1624
1658
  ${(props) => props.invalid && import_styled_components10.css`
1625
1659
  border-color: ${(props2) => props2.theme.colors.form.border.error};
1626
1660
  `}
@@ -1642,13 +1676,22 @@ var StyledInnerButton = import_styled_components10.default.div`
1642
1676
  `;
1643
1677
  var ListboxToggleButton = ({
1644
1678
  children,
1679
+ size = "default",
1645
1680
  ...buttonProps
1646
1681
  }) => {
1647
1682
  const { isOpen } = useMenuToggleContext();
1648
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StyledListboxToggleButton, { appearance: "secondary", ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(StyledInnerButton, { children: [
1649
- children,
1650
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StyledChevron, { $isOpen: isOpen, invalid: buttonProps.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_seeds_react_icon3.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true }) })
1651
- ] }) });
1683
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1684
+ StyledListboxToggleButton,
1685
+ {
1686
+ appearance: "unstyled",
1687
+ size,
1688
+ ...buttonProps,
1689
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(StyledInnerButton, { children: [
1690
+ children,
1691
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StyledChevron, { $isOpen: isOpen, invalid: buttonProps.invalid, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_seeds_react_icon3.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true }) })
1692
+ ] })
1693
+ }
1694
+ );
1652
1695
  };
1653
1696
 
1654
1697
  // src/ActionMenu/ActionMenu.tsx