@synerise/ds-button-group 1.1.51 → 1.1.53

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.53](https://github.com/Synerise/synerise-design/compare/@synerise/ds-button-group@1.1.52...@synerise/ds-button-group@1.1.53) (2026-05-13)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-button-group
9
+
10
+ ## [1.1.52](https://github.com/Synerise/synerise-design/compare/@synerise/ds-button-group@1.1.51...@synerise/ds-button-group@1.1.52) (2026-05-11)
11
+
12
+ **Note:** Version bump only for package @synerise/ds-button-group
13
+
6
14
  ## [1.1.51](https://github.com/Synerise/synerise-design/compare/@synerise/ds-button-group@1.1.50...@synerise/ds-button-group@1.1.51) (2026-05-04)
7
15
 
8
16
  ### Bug Fixes
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { ButtonGroupProps } from './ButtonGroup.types';
3
- declare const ButtonGroup: ({ className, children, title, description, size, fullWidth, buttonsPosition, disabled, splitMode, compact, error, }: ButtonGroupProps) => React.JSX.Element;
3
+ declare const ButtonGroup: ({ className, style, children, title, description, size, fullWidth, buttonsPosition, disabled, splitMode, compact, error, }: ButtonGroupProps) => React.JSX.Element;
4
4
  export default ButtonGroup;
@@ -1,8 +1,13 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { Button } from "antd";
2
+ import React from "react";
3
3
  import { Container, Title, Description } from "./ButtonGroup.styles.js";
4
+ const sizeClassMap = {
5
+ large: "lg",
6
+ small: "sm"
7
+ };
4
8
  const ButtonGroup = ({
5
9
  className,
10
+ style,
6
11
  children,
7
12
  title,
8
13
  description,
@@ -13,11 +18,18 @@ const ButtonGroup = ({
13
18
  splitMode,
14
19
  compact = true,
15
20
  error
16
- }) => /* @__PURE__ */ jsxs(Container, { className: `ds-button-group ${className || ""}`, fullWidth, buttonsPosition, disabled, splitMode, compact, error, children: [
17
- title && /* @__PURE__ */ jsx(Title, { children: title }),
18
- /* @__PURE__ */ jsx(Button.Group, { size, children }),
19
- description && /* @__PURE__ */ jsx(Description, { children: description })
20
- ] });
21
+ }) => {
22
+ const sizeCls = size ? sizeClassMap[size] || "" : "";
23
+ const groupClass = ["ant-btn-group", sizeCls && `ant-btn-group-${sizeCls}`].filter(Boolean).join(" ");
24
+ const sizedChildren = size ? React.Children.map(children, (child) => React.isValidElement(child) ? React.cloneElement(child, {
25
+ size
26
+ }) : child) : children;
27
+ return /* @__PURE__ */ jsxs(Container, { className: `ds-button-group ${className || ""}`, style, fullWidth, buttonsPosition, disabled, splitMode, compact, error, children: [
28
+ title && /* @__PURE__ */ jsx(Title, { children: title }),
29
+ /* @__PURE__ */ jsx("div", { className: groupClass, children: sizedChildren }),
30
+ description && /* @__PURE__ */ jsx(Description, { children: description })
31
+ ] });
32
+ };
21
33
  export {
22
34
  ButtonGroup as default
23
35
  };
@@ -20,7 +20,7 @@ const focusAnimation = ({
20
20
  const Container = /* @__PURE__ */ styled.div.withConfig({
21
21
  displayName: "ButtonGroupstyles__Container",
22
22
  componentId: "sc-1jzk068-0"
23
- })(["", ";.ant-btn-group{width:100%;display:flex;gap:", ";flex-direction:row;align-items:stretch;justify-content:", ";", ";", ";& > .ant-btn{width:auto;flex:", ";border-radius:", ";&.ant-btn-primary{&:focus{z-index:99999;}}}}"], (props) => props.fullWidth ? "width: 100%;" : "", (props) => props.compact ? "0px" : "8px", (props) => getButtonsPosition(props.buttonsPosition), (props) => !!props.splitMode && !props.error && css(["*:not(:first-child).ds-button.single-icon,.ds-button.single-icon.ant-btn-custom-color,.ds-button.single-icon.ant-btn-tertiary-white{border-left:1px solid rgba(255,255,255,0.15);&:disabled.ds-button.single-icon{&.ant-btn-tertiary-white{border-left:1px solid rgba(255,255,255,0.2) !important;}&.ant-btn-tertiary{border-left:1px solid rgba(106,117,128,0.1) !important;}&.ant-btn-custom-color{border-left:1px solid rgba(255,255,255,0.8) !important;}&.ant-btn-primary{border-left:1px solid rgba(255,255,255,0.5) !important;}}}*:not(:first-child).ds-button.single-icon.ant-btn-ghost-primary,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white,.ds-button.single-icon.ant-btn-secondary{border-left:0px;padding-left:1px;}*:not(:first-child).ds-button.single-icon.ant-btn-tertiary{border-left:1px solid rgba(106,117,128,0.2);}.ds-button.label.ant-btn-tertiary[disabled]{color:", " !important;}&:hover:not(:disabled){*:not(:first-child).ds-button.single-icon{&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-primary,&.ant-btn-custom-color{border-left:transparent !important;}}}.ds-button:focus{&.ant-btn-primary,&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-custom-color{border-color:transparent !important;&:active{border-color:transparent !important;}}}"], props.theme.palette["grey-500"]), (props) => !!props.splitMode && !!props.error && css(["*:not(:first-child).ds-button.single-icon,.ds-button.single-icon.ant-btn-custom-color,.ds-button.single-icon.ant-btn-tertiary-white,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white{border-left:1px solid ", ";}.ds-button:focus{&.ant-btn-primary,&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-custom-color,&.ant-btn-ghost-primary,&.ant-btn-ghost-white,&.ant-btn-ghost{border-left:0px;&:active{border-left:0px;}}}*:not(:first-child).ds-button.single-icon.ant-btn-ghost-primary,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white,.ds-button.single-icon.ant-btn-secondary,.ds-button.single-icon.ant-btn-tertiary,.ds-button.single-icon.ant-btn-tertiary-white,.ds-button.single-icon.ant-btn-primary,.ds-button.single-icon.ant-btn-custom-color{border-left:0px;padding-left:1px;}.ds-button:hover:not(:focus){&.ant-btn-tertiary,&.ant-btn-ghost,&.ant-btn-tertiary-white,&.ant-btn-ghost-white{box-shadow:inset 0 0 0 1px ", ";}}"], props.theme.palette["red-600"], props.theme.palette["red-600"]), (props) => props.fullWidth ? "1" : "none", (props) => props.compact ? "0px" : "3px");
23
+ })(["", ";.ant-btn-group{width:100%;display:flex;gap:", ";flex-direction:row;align-items:stretch;justify-content:", ";", ";", ";& > .ant-btn{width:auto;flex:", ";border-radius:", ";&.ant-btn-primary{&:focus{z-index:99999;}}}", "}"], (props) => props.fullWidth ? "width: 100%;" : "", (props) => props.compact ? "0px" : "8px", (props) => getButtonsPosition(props.buttonsPosition), (props) => !!props.splitMode && !props.error && css(["*:not(:first-child).ds-button.single-icon,.ds-button.single-icon.ant-btn-custom-color,.ds-button.single-icon.ant-btn-tertiary-white{border-left:1px solid rgba(255,255,255,0.15);&:disabled.ds-button.single-icon{&.ant-btn-tertiary-white{border-left:1px solid rgba(255,255,255,0.2) !important;}&.ant-btn-tertiary{border-left:1px solid rgba(106,117,128,0.1) !important;}&.ant-btn-custom-color{border-left:1px solid rgba(255,255,255,0.8) !important;}&.ant-btn-primary{border-left:1px solid rgba(255,255,255,0.5) !important;}}}*:not(:first-child).ds-button.single-icon.ant-btn-ghost-primary,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white,.ds-button.single-icon.ant-btn-secondary{border-left:0px;padding-left:1px;}*:not(:first-child).ds-button.single-icon.ant-btn-tertiary{border-left:1px solid rgba(106,117,128,0.2);}.ds-button.label.ant-btn-tertiary[disabled]{color:", " !important;}&:hover:not(:disabled){*:not(:first-child).ds-button.single-icon{&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-primary,&.ant-btn-custom-color{border-left:transparent !important;}}}.ds-button:focus{&.ant-btn-primary,&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-custom-color{border-color:transparent !important;&:active{border-color:transparent !important;}}}"], props.theme.palette["grey-500"]), (props) => !!props.splitMode && !!props.error && css(["*:not(:first-child).ds-button.single-icon,.ds-button.single-icon.ant-btn-custom-color,.ds-button.single-icon.ant-btn-tertiary-white,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white{border-left:1px solid ", ";}.ds-button:focus{&.ant-btn-primary,&.ant-btn-tertiary,&.ant-btn-tertiary-white,&.ant-btn-custom-color,&.ant-btn-ghost-primary,&.ant-btn-ghost-white,&.ant-btn-ghost{border-left:0px;&:active{border-left:0px;}}}*:not(:first-child).ds-button.single-icon.ant-btn-ghost-primary,.ds-button.single-icon.ant-btn-ghost,.ds-button.single-icon.ant-btn-ghost-white,.ds-button.single-icon.ant-btn-secondary,.ds-button.single-icon.ant-btn-tertiary,.ds-button.single-icon.ant-btn-tertiary-white,.ds-button.single-icon.ant-btn-primary,.ds-button.single-icon.ant-btn-custom-color{border-left:0px;padding-left:1px;}.ds-button:hover:not(:focus){&.ant-btn-tertiary,&.ant-btn-ghost,&.ant-btn-tertiary-white,&.ant-btn-ghost-white{box-shadow:inset 0 0 0 1px ", ";}}"], props.theme.palette["red-600"], props.theme.palette["red-600"]), (props) => props.fullWidth ? "1" : "none", (props) => props.compact ? "0px" : "3px", (props) => props.compact && css(["& > .ant-btn + .ant-btn{margin-left:-1px;}& > button.ant-btn:first-of-type{border-radius:3px 0 0 3px;}& > button.ant-btn:last-of-type{border-radius:0 3px 3px 0;}& > button.ant-btn:first-of-type:last-of-type{border-radius:3px;}"]));
24
24
  const Title = /* @__PURE__ */ styled.h4.withConfig({
25
25
  displayName: "ButtonGroupstyles__Title",
26
26
  componentId: "sc-1jzk068-1"
@@ -1,14 +1,32 @@
1
- import { ButtonGroupProps as AntButtonGroupProps } from 'antd/lib/button/button-group';
2
- import { ReactNode } from 'react';
1
+ import { CSSProperties, ReactNode } from 'react';
3
2
  import { LiteralStringUnion } from '@synerise/ds-utils';
4
- export type ButtonGroupProps = AntButtonGroupProps & {
3
+ export type ButtonGroupProps = {
4
+ /** Size class applied to the group container */
5
+ size?: 'small' | 'middle' | 'large';
6
+ /** Additional CSS class name */
7
+ className?: string;
8
+ /** overwrite with inline styles */
9
+ style?: CSSProperties;
10
+ /** Button elements to render inside the group */
5
11
  children?: ReactNode;
12
+ /** Heading displayed above the button row */
6
13
  title?: string;
14
+ /** Helper text displayed below the button row */
7
15
  description?: string;
16
+ /** Stretches the container and buttons to full width */
8
17
  fullWidth?: boolean;
18
+ /** Horizontal alignment of the button row
19
+ * @default center
20
+ */
9
21
  buttonsPosition?: LiteralStringUnion<'left' | 'center' | 'right'>;
22
+ /** CSS-only disabled state — suppresses hover effects in splitMode. Disable buttons individually for true disabled behavior. */
10
23
  disabled?: boolean;
24
+ /** Adds 1px borders between adjacent single-icon buttons */
11
25
  splitMode?: boolean;
26
+ /** In splitMode, switches borders to red error color */
12
27
  error?: boolean;
28
+ /** Zero gap with shared corners (true) or 8px gap with individual rounded corners (false)
29
+ * @default true
30
+ */
13
31
  compact?: boolean;
14
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-button-group",
3
- "version": "1.1.51",
3
+ "version": "1.1.53",
4
4
  "description": "Button-Group UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -35,22 +35,18 @@
35
35
  "check:circular-dependencies": "madge --circular --extensions ts,tsx,js,jsx --ts-config tsconfig.json src/ --exclude '/dist/'",
36
36
  "upgrade:ds": "ncu -f \"@synerise/ds-*\" -u"
37
37
  },
38
- "sideEffects": [
39
- "dist/style/*",
40
- "*.less"
41
- ],
38
+ "sideEffects": false,
42
39
  "types": "dist/index.d.ts",
43
40
  "dependencies": {
44
- "@synerise/ds-button": "^1.5.26",
45
- "@synerise/ds-divider": "^1.3.10",
41
+ "@synerise/ds-button": "^1.5.28",
42
+ "@synerise/ds-divider": "^1.3.11",
46
43
  "@synerise/ds-utils": "^1.8.1"
47
44
  },
48
45
  "peerDependencies": {
49
46
  "@synerise/ds-core": "*",
50
- "antd": "4.24.16",
51
47
  "react": ">=16.9.0 <= 18.3.1",
52
48
  "styled-components": "^5.3.3",
53
49
  "vitest": "4"
54
50
  },
55
- "gitHead": "c5eee882509cbeb4544cb45939620881b829d4d9"
51
+ "gitHead": "1132c21afce924c3e3b8e75e2ebd5e7b5db69bd2"
56
52
  }