@synerise/ds-field-set 0.4.2 → 1.0.1
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 +11 -0
- package/dist/FieldSet.js +10 -2
- package/dist/FieldSet.styles.d.ts +3 -1
- package/dist/FieldSet.styles.js +8 -4
- package/package.json +5 -4
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
|
+
## [1.0.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-field-set@1.0.0...@synerise/ds-field-set@1.0.1) (2025-03-18)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* **field-set:** clipping in dynamic height fieldset content fixed ([5a8f3a0](https://github.com/Synerise/synerise-design/commit/5a8f3a0fedc67ffd2e7f9674d473ef47c3e921e3))
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
## [0.4.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-field-set@0.4.1...@synerise/ds-field-set@0.4.2) (2025-03-10)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @synerise/ds-field-set
|
package/dist/FieldSet.js
CHANGED
@@ -4,6 +4,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
4
4
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
5
5
|
import Divider from '@synerise/ds-divider';
|
6
6
|
import Button from '@synerise/ds-button';
|
7
|
+
import { useResizeObserver } from '@synerise/ds-utils';
|
7
8
|
import * as S from './FieldSet.styles';
|
8
9
|
var FieldSet = function FieldSet(_ref) {
|
9
10
|
var className = _ref.className,
|
@@ -25,6 +26,10 @@ var FieldSet = function FieldSet(_ref) {
|
|
25
26
|
maxHeight = _useState2[0],
|
26
27
|
setMaxHeight = _useState2[1];
|
27
28
|
var containerRef = useRef(null);
|
29
|
+
var measureMaxHeightRef = useRef(null);
|
30
|
+
useResizeObserver(measureMaxHeightRef, function (dimensions) {
|
31
|
+
return setMaxHeight(dimensions.height);
|
32
|
+
});
|
28
33
|
useEffect(function () {
|
29
34
|
var _containerRef$current, _containerRef$current2;
|
30
35
|
((_containerRef$current = containerRef.current) == null ? void 0 : _containerRef$current.scrollHeight) && setMaxHeight((_containerRef$current2 = containerRef.current) == null ? void 0 : _containerRef$current2.scrollHeight);
|
@@ -60,9 +65,12 @@ var FieldSet = function FieldSet(_ref) {
|
|
60
65
|
}, title), /*#__PURE__*/React.createElement(S.Description, null, description))), divider && /*#__PURE__*/React.createElement(Divider, null), (component || button) && /*#__PURE__*/React.createElement(S.CollapsibleContent, {
|
61
66
|
"data-testid": "field-set-collapsible",
|
62
67
|
ref: containerRef,
|
63
|
-
|
68
|
+
expandable: expandable,
|
69
|
+
expanded: expandable && expanded,
|
64
70
|
"aria-hidden": expandable && !expanded,
|
65
71
|
maxHeight: maxHeight
|
66
|
-
},
|
72
|
+
}, /*#__PURE__*/React.createElement(S.CollapsibleContentInner, {
|
73
|
+
ref: measureMaxHeightRef
|
74
|
+
}, component && /*#__PURE__*/React.createElement(S.ComponentWrapper, null, component), button && /*#__PURE__*/React.createElement(S.ActionButton, null, button))));
|
67
75
|
};
|
68
76
|
export default FieldSet;
|
@@ -15,6 +15,8 @@ export declare const FieldSetTitle: import("styled-components").StyledComponent<
|
|
15
15
|
export declare const ComponentWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
16
16
|
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
17
17
|
export declare const CollapsibleContent: import("styled-components").StyledComponent<"div", any, {
|
18
|
-
|
18
|
+
expandable?: boolean | undefined;
|
19
|
+
expanded?: boolean | undefined;
|
19
20
|
maxHeight?: number | undefined;
|
20
21
|
}, never>;
|
22
|
+
export declare const CollapsibleContentInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/dist/FieldSet.styles.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import styled from 'styled-components';
|
1
|
+
import styled, { css } from 'styled-components';
|
2
2
|
export var Title = styled.div.withConfig({
|
3
3
|
displayName: "FieldSetstyles__Title",
|
4
4
|
componentId: "sc-1hezedi-0"
|
@@ -50,6 +50,10 @@ export var Description = styled.div.withConfig({
|
|
50
50
|
export var CollapsibleContent = styled.div.withConfig({
|
51
51
|
displayName: "FieldSetstyles__CollapsibleContent",
|
52
52
|
componentId: "sc-1hezedi-9"
|
53
|
-
})(["
|
54
|
-
return props.expanded ? "\n max-height: " + (props.maxHeight || 9999) + "px;\n " : "\n max-height: 0;\n ";
|
55
|
-
});
|
53
|
+
})(["position:relative;", ""], function (props) {
|
54
|
+
return props.expandable && css(["transition:max-height 0.7s ease-in-out;overflow:hidden;", ""], props.expanded ? "\n max-height: " + (props.maxHeight || 9999) + "px;\n " : "\n max-height: 0;\n ");
|
55
|
+
});
|
56
|
+
export var CollapsibleContentInner = styled.div.withConfig({
|
57
|
+
displayName: "FieldSetstyles__CollapsibleContentInner",
|
58
|
+
componentId: "sc-1hezedi-10"
|
59
|
+
})([""]);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@synerise/ds-field-set",
|
3
|
-
"version": "0.
|
3
|
+
"version": "1.0.1",
|
4
4
|
"description": "FieldSet UI Component for the Synerise Design System",
|
5
5
|
"license": "ISC",
|
6
6
|
"repository": "Synerise/synerise-design",
|
@@ -34,8 +34,9 @@
|
|
34
34
|
],
|
35
35
|
"types": "dist/index.d.ts",
|
36
36
|
"dependencies": {
|
37
|
-
"@synerise/ds-
|
38
|
-
"@synerise/ds-
|
37
|
+
"@synerise/ds-button": "^1.1.0",
|
38
|
+
"@synerise/ds-divider": "^1.0.1",
|
39
|
+
"@synerise/ds-utils": "^1.0.1"
|
39
40
|
},
|
40
41
|
"peerDependencies": {
|
41
42
|
"@synerise/ds-core": "*",
|
@@ -43,5 +44,5 @@
|
|
43
44
|
"react": ">=16.9.0 <= 18.3.1",
|
44
45
|
"styled-components": "^5.3.3"
|
45
46
|
},
|
46
|
-
"gitHead": "
|
47
|
+
"gitHead": "218110f61f4371bc04d793b2b976b71d14e99e76"
|
47
48
|
}
|