@synerise/ds-button 2.2.0 → 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 +19 -0
- package/CLAUDE.md +4 -3
- package/README.md +1 -0
- package/dist/Button.styles.d.ts +1 -19
- package/dist/Checkbox/Checkbox.js +3 -19
- package/dist/Checkbox/Checkbox.styles.d.ts +3 -10
- package/dist/Checkbox/Checkbox.styles.js +7 -20
- package/dist/Checkbox/Checkbox.types.d.ts +0 -4
- package/dist/index.d.ts +4 -4
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
|
|
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)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @synerise/ds-button
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [2.2.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-button@2.1.6...@synerise/ds-button@2.2.0) (2026-10-29)
|
|
7
26
|
|
|
8
27
|
|
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
|
|
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-
|
|
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
|
|
package/dist/Button.styles.d.ts
CHANGED
|
@@ -3,25 +3,7 @@ export declare const ACTIVE_DELAY = 200;
|
|
|
3
3
|
export declare const Spinner: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const RippleEffect: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
5
5
|
export declare const ButtonFocus: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
6
|
-
export declare const Tag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<{
|
|
7
|
-
id?: string | number;
|
|
8
|
-
name?: string;
|
|
9
|
-
textColor?: string;
|
|
10
|
-
color?: string;
|
|
11
|
-
image?: string;
|
|
12
|
-
shape?: import('@synerise/ds-tag').TagShape;
|
|
13
|
-
removable?: boolean;
|
|
14
|
-
className?: string;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
onRemove?: (tag: string | number) => void;
|
|
18
|
-
prefixel?: React.ReactNode;
|
|
19
|
-
suffixel?: React.ReactNode;
|
|
20
|
-
texts?: import('@synerise/ds-tag').TagTexts;
|
|
21
|
-
asPill?: boolean;
|
|
22
|
-
dashed?: boolean;
|
|
23
|
-
tooltipProps?: import('@synerise/ds-tooltip').TooltipProps;
|
|
24
|
-
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "image" | "name" | "className" | "color" | "id" | "onClick" | "shape" | "disabled" | "textColor" | "removable" | "onRemove" | "prefixel" | "suffixel" | "texts" | "asPill" | "dashed" | "tooltipProps"> & import('@synerise/ds-utils').DataAttributes & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
6
|
+
export declare const Tag: import('styled-components').StyledComponent<import('react').ForwardRefExoticComponent<import('@synerise/ds-tag').TagProps & import('react').RefAttributes<HTMLDivElement>>, any, {}, never>;
|
|
25
7
|
export declare const ButtonLabel: import('styled-components').StyledComponent<"div", any, {
|
|
26
8
|
withTooltip?: boolean;
|
|
27
9
|
}, never>;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import { jsx
|
|
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,
|
|
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, {
|
|
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
|
|
2
|
-
|
|
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 {
|
|
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:
|
|
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
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -40,12 +40,12 @@ declare const _default: import('react').ForwardRefExoticComponent<Omit<import('.
|
|
|
40
40
|
fluidMinWidth?: string | number;
|
|
41
41
|
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
42
42
|
/** @deprecated - use named export `Creator` */
|
|
43
|
-
Creator: import('react').ForwardRefExoticComponent<Omit<import('
|
|
43
|
+
Creator: import('react').ForwardRefExoticComponent<Omit<import('.').CreatorProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
44
44
|
/** @deprecated - use named export `Expander` */
|
|
45
|
-
Expander: ({ size, expanded, disabled, onClick, className, }: import('
|
|
45
|
+
Expander: ({ size, expanded, disabled, onClick, className, }: import('.').ExpanderProps) => import("react").JSX.Element;
|
|
46
46
|
/** @deprecated - use named export `Star` */
|
|
47
|
-
Star: (props: import('
|
|
47
|
+
Star: (props: import('.').StarButtonProps) => React.ReactElement;
|
|
48
48
|
/** @deprecated - use named export `Checkbox` */
|
|
49
|
-
Checkbox: (props: import('
|
|
49
|
+
Checkbox: (props: import('.').CheckboxButtonProps) => React.ReactElement;
|
|
50
50
|
};
|
|
51
51
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-button",
|
|
3
|
-
"version": "2.2.
|
|
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,10 +39,11 @@
|
|
|
39
39
|
"sideEffects": false,
|
|
40
40
|
"types": "dist/index.d.ts",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@synerise/ds-
|
|
43
|
-
"@synerise/ds-
|
|
44
|
-
"@synerise/ds-
|
|
45
|
-
"@synerise/ds-
|
|
42
|
+
"@synerise/ds-checkbox": "^2.1.2",
|
|
43
|
+
"@synerise/ds-icon": "^2.3.1",
|
|
44
|
+
"@synerise/ds-tag": "^2.1.1",
|
|
45
|
+
"@synerise/ds-tooltip": "^2.1.1",
|
|
46
|
+
"@synerise/ds-utils": "^2.3.1",
|
|
46
47
|
"classnames": "^2.5.1"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
@@ -53,5 +54,5 @@
|
|
|
53
54
|
"react": ">=16.9.0 <= 18.3.1",
|
|
54
55
|
"styled-components": "^5.3.3"
|
|
55
56
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "4547f33b8c9317ccc697f89a2b2c62bcf97fbec3"
|
|
57
58
|
}
|