@galaxy-io/dls 1.5.8 → 1.5.10
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/buttons/Button.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Icon as PhosphorIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { DropdownPosition } from "../dropdown/Dropdown";
|
|
2
3
|
export interface ButtonProps {
|
|
3
4
|
/** Button text. Omit for an icon-only button and set `ariaLabel` instead. */
|
|
4
5
|
label?: string;
|
|
@@ -31,6 +32,8 @@ export interface ButtonProps {
|
|
|
31
32
|
contentWhenDropdown?: React.ReactNode | ((args: {
|
|
32
33
|
close: () => void;
|
|
33
34
|
}) => React.ReactNode);
|
|
35
|
+
/** Placement of the caret dropdown. @default DropdownPosition.BOTTOM_END */
|
|
36
|
+
dropdownPosition?: DropdownPosition;
|
|
34
37
|
/** Accessible name for the caret segment. @default "More actions" */
|
|
35
38
|
dropdownAriaLabel?: string;
|
|
36
39
|
/** Accessible name — required when the button renders an icon with no label. */
|
|
@@ -64,5 +67,5 @@ export declare enum ButtonSize {
|
|
|
64
67
|
* With `contentWhenDropdown`, renders as a split button: a caret segment after
|
|
65
68
|
* a hairline divider opens an anchored dropdown of advanced actions.
|
|
66
69
|
*/
|
|
67
|
-
declare const Button: ({ label, icon, variant, size, onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, contentWhenDropdown, dropdownAriaLabel, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup, }: ButtonProps) => import("react").JSX.Element;
|
|
70
|
+
declare const Button: ({ label, icon, variant, size, onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, contentWhenDropdown, dropdownPosition, dropdownAriaLabel, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup, }: ButtonProps) => import("react").JSX.Element;
|
|
68
71
|
export default Button;
|
package/dist/buttons/Button.js
CHANGED
|
@@ -140,7 +140,7 @@ var BUTTON_SIZE_TO_ICON_SIZE_MAP = {
|
|
|
140
140
|
* With `contentWhenDropdown`, renders as a split button: a caret segment after
|
|
141
141
|
* a hairline divider opens an anchored dropdown of advanced actions.
|
|
142
142
|
*/
|
|
143
|
-
var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, contentWhenDropdown, dropdownAriaLabel, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup }) => {
|
|
143
|
+
var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMouseEnter, onMouseLeave, fillWidth, isLoading, isDisabled, isIconTrailing, isIconFilled, isEllipsis, cursor, contentWhenDropdown, dropdownPosition = DropdownPosition.BOTTOM_END, dropdownAriaLabel, ariaLabel, ariaExpanded, ariaControls, ariaHasPopup }) => {
|
|
144
144
|
const { activeTheme } = useGalaxyTheme();
|
|
145
145
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
146
146
|
const handleClick = useCallback((e) => {
|
|
@@ -241,7 +241,8 @@ var Button = ({ label, icon, variant = "PRIMARY", size = "MEDIUM", onClick, onMo
|
|
|
241
241
|
body: dropdownBody,
|
|
242
242
|
isOpen: isDropdownOpen,
|
|
243
243
|
onClose: closeDropdown,
|
|
244
|
-
position:
|
|
244
|
+
position: dropdownPosition,
|
|
245
|
+
noPadding: true,
|
|
245
246
|
children: /* @__PURE__ */ jsx(StyledButton, {
|
|
246
247
|
$variant: variant,
|
|
247
248
|
$size: size,
|
|
@@ -133,6 +133,7 @@ var Dropdown = ({ children, variant = "BASE", header, body, footer, position = "
|
|
|
133
133
|
appendTo: () => document.body,
|
|
134
134
|
disabled: isDisabled,
|
|
135
135
|
zIndex: 1e4,
|
|
136
|
+
maxWidth: "none",
|
|
136
137
|
children: /* @__PURE__ */ jsx(DropdownTriggerWrapper, {
|
|
137
138
|
onClick: handleClick,
|
|
138
139
|
$isOpen: visible,
|