@chayns-components/core 5.0.58 → 5.0.59

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.
@@ -4,6 +4,7 @@ export declare const StyledMultiActionButton: import("styled-components/dist/typ
4
4
  }, never>> & string & Omit<import("motion/react").ForwardRefComponent<HTMLDivElement, import("motion/react").HTMLMotionProps<"div">>, keyof React.Component<any, {}, any>>;
5
5
  type StyledSeparatorProps = WithTheme<{
6
6
  $gapColor?: string;
7
+ $isHidden?: boolean;
7
8
  }>;
8
9
  export declare const StyledSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, StyledSeparatorProps>> & string;
9
10
  export {};
@@ -206,6 +206,14 @@ export type MultiActionButtonProps = {
206
206
  * @optional
207
207
  */
208
208
  secondaryContextMenu?: MultiActionButtonSecondaryContextMenu;
209
+ /**
210
+ * Whether the button should collapse automatically based on the available width.
211
+ * @description When enabled, the control switches from the default layout to an icon-only
212
+ * layout and finally to a primary-only icon layout as space becomes tighter.
213
+ * @default false
214
+ * @optional
215
+ */
216
+ shouldAutoCollapse?: boolean;
209
217
  /**
210
218
  * Whether the button should take the full width of its parent.
211
219
  * @description When true, the control stretches to 100% width unless `width` is provided.
@@ -1,4 +1,26 @@
1
1
  import type { CSSProperties } from 'react';
2
+ export declare enum MultiActionButtonAutoCollapseMode {
3
+ Expanded = "expanded",
4
+ IconsOnly = "icons-only",
5
+ PrimaryOnly = "primary-only"
6
+ }
7
+ export declare const MULTI_ACTION_BUTTON_LABEL_GAP_PX = 6;
8
+ export declare const MULTI_ACTION_BUTTON_LABEL_RIGHT_PADDING_PX = 18;
9
+ export declare const MULTI_ACTION_BUTTON_SEPARATOR_WIDTH_PX = 1;
10
+ export interface GetMultiActionButtonAutoCollapseModeOptions {
11
+ availableWidth?: number;
12
+ expandedWidth: number;
13
+ hasSecondaryAction: boolean;
14
+ height: number;
15
+ previousMode?: MultiActionButtonAutoCollapseMode;
16
+ }
17
+ export declare const getMinimumMultiActionButtonIconsWidth: ({ hasSecondaryAction, height, }: Pick<GetMultiActionButtonAutoCollapseModeOptions, "hasSecondaryAction" | "height">) => number;
18
+ export interface GetMinimumPrimaryLabelVisibleWidthOptions {
19
+ hasVisibleSecondaryAction: boolean;
20
+ height: number;
21
+ }
22
+ export declare const getMinimumPrimaryLabelVisibleWidth: ({ hasVisibleSecondaryAction, height, }: GetMinimumPrimaryLabelVisibleWidthOptions) => number;
23
+ export declare const getMultiActionButtonAutoCollapseMode: ({ availableWidth, expandedWidth, hasSecondaryAction, height, previousMode, }: GetMultiActionButtonAutoCollapseModeOptions) => MultiActionButtonAutoCollapseMode;
2
24
  export interface GetSecondaryContextMenuTriggerStyleOptions {
3
25
  height: number;
4
26
  isCollapsed: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/core",
3
- "version": "5.0.58",
3
+ "version": "5.0.59",
4
4
  "description": "A set of beautiful React components for developing your own applications with chayns.",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "03da47d802e7cfc6d035237fdd8d21dafe1cae7e"
90
+ "gitHead": "f7cf00d037b2431608164c98634c29951a738735"
91
91
  }