@synerise/ds-button 2.2.1 → 2.2.2

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,17 @@
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
+ ## [2.2.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@2.2.1...@synerise/ds-button@2.2.2) (2026-11-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **button:** render the ds-checkbox box in Button.Checkbox ([3ca18b1](https://github.com/synerise/synerise-design/commit/3ca18b12a4081f30c3be2ae1f9ff92838b3e9b7b))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [2.2.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@2.2.0...@synerise/ds-button@2.2.1) (2026-11-03)
7
18
 
8
19
  **Note:** Version bump only for package @synerise/ds-button
package/CLAUDE.md CHANGED
@@ -111,14 +111,14 @@ Chevron button for expand/collapse. Uses `BaseButton` directly.
111
111
 
112
112
  ### `Checkbox` (exported as `CheckboxButton`)
113
113
 
114
- Checkbox icon-button. Uses `Button` (needs ripple/focus ring).
114
+ Checkbox icon-button (the `ds-table-new` row and header selection). Uses `Button` (needs ripple/focus ring) with `type="ghost-primary"` and `mode="single-icon"`, and draws the box with `CheckboxIndicator` from `@synerise/ds-checkbox`, so it looks exactly like `ds-checkbox` in every state and theme. `IconWrapper` centres it in a 24px slot and adds the hover rules `CheckboxLabel` has in ds-checkbox: unchecked → `--ds-form-control-border-hover` border (no tick preview), indeterminate → `--ds-color-background-brand-solidhover` fill. Those rules select on the button's `aria-checked`, not on wrapper props: the hover selector needs `&` after `.ds-button:hover`, and a non-leading `&` compiles to the static component id shared by every instance, so a props-conditional rule there would leak to all checkboxes. `disabled` is not passed to the indicator — the button's own disabled opacity fades it, and passing it too would fade it twice.
115
115
 
116
116
  | Prop | Type | Default | Description |
117
117
  |------|------|---------|-------------|
118
118
  | `checked` | `boolean` | `undefined` | Controlled state |
119
119
  | `defaultChecked` | `boolean` | `false` | Uncontrolled initial state |
120
120
  | `indeterminate` | `boolean` | `undefined` | Indeterminate state |
121
- | `hasError` | `boolean` | `undefined` | Error styling |
121
+ | `hasError` | `boolean` | `undefined` | Error border on the box (the fill stays brand when checked) |
122
122
  | `onChange` | `(checked: boolean) => void` | `undefined` | Change callback |
123
123
 
124
124
  ### `Star` (exported as `StarButton`)
@@ -147,7 +147,8 @@ Star favourite toggle. Uses `Button`.
147
147
 
148
148
  ## Key dependencies
149
149
 
150
- - `@synerise/ds-icon` — `SpinnerM`, `AngleDownS`, `AddM`, `StarM`/`StarFillM`, `CheckboxSelectedFillM`/`CheckboxIndeterminateM`
150
+ - `@synerise/ds-checkbox` — `CheckboxIndicator`, the box `Checkbox` renders
151
+ - `@synerise/ds-icon` — `SpinnerM`, `AngleDownS`, `AddM`, `StarM`/`StarFillM`
151
152
  - `@synerise/ds-tag` — optional status tag inside button label
152
153
  - `@synerise/ds-tooltip` — optional tooltip wrapping button label
153
154
  - `classnames` — className composition in Creator and Expander
package/README.md CHANGED
@@ -114,6 +114,7 @@ Special type of Button, with two states: default and activated (selected). Inher
114
114
 
115
115
  This is special checkbox built on Button and inheriting its appereance.
116
116
  It behaves like checkbox input due to `role="checkbox"` and `aria-checked` attributes.
117
+ The box itself is `CheckboxIndicator` from `@synerise/ds-checkbox`, so it looks the same as `Checkbox` in every state and theme.
117
118
 
118
119
  ### Props
119
120
 
@@ -1,23 +1,7 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import Icon, { CheckboxIndeterminateM, CheckboxSelectedFillM } from "@synerise/ds-icon";
4
3
  import Button from "../Button.js";
5
- import { IconWrapper, DefaultIcon, HoverIcon } from "./Checkbox.styles.js";
6
- const CheckboxButtonIcon = ({
7
- checked,
8
- indeterminate
9
- }) => {
10
- if (indeterminate) {
11
- return /* @__PURE__ */ jsx(CheckboxIndeterminateM, {});
12
- }
13
- if (checked) {
14
- return /* @__PURE__ */ jsx(CheckboxSelectedFillM, {});
15
- }
16
- return /* @__PURE__ */ jsxs(Fragment, { children: [
17
- /* @__PURE__ */ jsx(DefaultIcon, {}),
18
- /* @__PURE__ */ jsx(HoverIcon, {})
19
- ] });
20
- };
4
+ import { IconWrapper, Indicator } from "./Checkbox.styles.js";
21
5
  const getNextCheckedState = (prevState, {
22
6
  checked,
23
7
  indeterminate
@@ -56,7 +40,7 @@ const CheckboxButton = (props) => {
56
40
  const isChecked = checked !== void 0 ? checked : isCheckedState;
57
41
  return /* @__PURE__ */ jsx(Button, { "aria-checked": indeterminate ? "mixed" : isChecked, mode: "single-icon", role: "checkbox", style: {
58
42
  transition: "none"
59
- }, tabIndex: 0, type: "ghost-primary", onClick: handleButtonClick, ...restProps, children: /* @__PURE__ */ jsx(IconWrapper, { active: indeterminate || isChecked, error: hasError, children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(CheckboxButtonIcon, { checked: isChecked, indeterminate }) }) }) });
43
+ }, tabIndex: 0, type: "ghost-primary", onClick: handleButtonClick, ...restProps, children: /* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Indicator, { checked: isChecked, indeterminate, hasError }) }) });
60
44
  };
61
45
  export {
62
46
  CheckboxButton as default
@@ -1,13 +1,6 @@
1
- export declare const IconWrapper: import('styled-components').StyledComponent<"span", any, {
2
- active?: boolean;
3
- error?: boolean;
4
- }, never>;
5
- export declare const DefaultIcon: import('styled-components').StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
6
- export declare const HoverIcon: import('styled-components').StyledComponent<(props: React.SVGProps<SVGSVGElement>) => JSX.Element, any, {}, never>;
1
+ export declare const Indicator: import('styled-components').StyledComponent<({ checked, indeterminate, disabled, hasError, className, }: import('@synerise/ds-checkbox').CheckboxIndicatorProps) => React.JSX.Element, any, {}, never>;
2
+ export declare const IconWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
7
3
  declare const _default: {
8
- IconWrapper: import('styled-components').StyledComponent<"span", any, {
9
- active?: boolean;
10
- error?: boolean;
11
- }, never>;
4
+ IconWrapper: import('styled-components').StyledComponent<"span", any, {}, never>;
12
5
  };
13
6
  export default _default;
@@ -1,31 +1,18 @@
1
1
  import styled from "styled-components";
2
- import { CheckboxDeafultM, CheckboxM } from "@synerise/ds-icon";
2
+ import { CheckboxIndicator } from "@synerise/ds-checkbox";
3
+ const Indicator = /* @__PURE__ */ styled(CheckboxIndicator).withConfig({
4
+ displayName: "Checkboxstyles__Indicator",
5
+ componentId: "sc-ssgaoj-0"
6
+ })([""]);
3
7
  const IconWrapper = /* @__PURE__ */ styled.span.withConfig({
4
8
  displayName: "Checkboxstyles__IconWrapper",
5
- componentId: "sc-ssgaoj-0"
6
- })(["&&{color:", ";}.ant-btn:hover & .ds-icon,.ant-btn:focus:hover & .ds-icon{color:var(--ds-color-icon-brand-default);}.ds-button.ant-btn &::before{content:'';display:'block';position:absolute;bottom:0;left:0;right:0;top:0;margin:5px;z-index:-1;}.ds-button.ant-btn &::before,.ds-button.ant-btn:hover &::before,.ds-button.ant-btn:focus:hover &::before{background:var(--ds-color-background-base-default);}"], ({
7
- active,
8
- error
9
- }) => {
10
- if (error) {
11
- return "var(--ds-color-icon-danger-default)";
12
- }
13
- return active ? "var(--ds-color-icon-brand-default)" : "var(--ds-color-border-base-strong)";
14
- });
15
- const DefaultIcon = /* @__PURE__ */ styled(CheckboxDeafultM).withConfig({
16
- displayName: "Checkboxstyles__DefaultIcon",
17
9
  componentId: "sc-ssgaoj-1"
18
- })(["display:block;.ds-button.ant-btn:not([disabled]):hover &{display:none;}"]);
19
- const HoverIcon = /* @__PURE__ */ styled(CheckboxM).withConfig({
20
- displayName: "Checkboxstyles__HoverIcon",
21
- componentId: "sc-ssgaoj-2"
22
- })(["display:none;.ds-button.ant-btn:not([disabled]):hover &{display:block;}"]);
10
+ })(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;.ds-button[aria-checked='false']:not([disabled]):hover & ", "{border-color:var(--ds-form-control-border-hover);}.ds-button[aria-checked='mixed']:not([disabled]):hover & ", "{background-color:var(--ds-color-background-brand-solidhover);}"], Indicator, Indicator);
23
11
  const Checkbox_styles = {
24
12
  IconWrapper
25
13
  };
26
14
  export {
27
- DefaultIcon,
28
- HoverIcon,
29
15
  IconWrapper,
16
+ Indicator,
30
17
  Checkbox_styles as default
31
18
  };
@@ -8,8 +8,4 @@ export type CheckboxButtonProps = ButtonPropsOmitted & {
8
8
  onChange?: (checked: boolean) => void;
9
9
  className?: string;
10
10
  };
11
- export type ButtonCheckboxIconProps = {
12
- checked?: boolean;
13
- indeterminate?: boolean;
14
- };
15
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-button",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Button UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -39,6 +39,7 @@
39
39
  "sideEffects": false,
40
40
  "types": "dist/index.d.ts",
41
41
  "dependencies": {
42
+ "@synerise/ds-checkbox": "^2.1.2",
42
43
  "@synerise/ds-icon": "^2.3.1",
43
44
  "@synerise/ds-tag": "^2.1.1",
44
45
  "@synerise/ds-tooltip": "^2.1.1",
@@ -53,5 +54,5 @@
53
54
  "react": ">=16.9.0 <= 18.3.1",
54
55
  "styled-components": "^5.3.3"
55
56
  },
56
- "gitHead": "2d2a540b35fddf8855da45f0dec2f4612c6d87b6"
57
+ "gitHead": "4547f33b8c9317ccc697f89a2b2c62bcf97fbec3"
57
58
  }