@digigov/react-core 0.26.0 → 0.27.0-ac772edc
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/AccordionSectionSummary/index.d.ts +8 -0
- package/AccordionSectionSummary/index.js +5 -3
- package/es/AccordionSectionSummary/index.js +5 -3
- package/esm/AccordionSectionSummary/index.js +5 -3
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/src/AccordionSectionSummary/index.tsx +12 -2
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseProps } from '@digigov/react-core/Base';
|
|
3
3
|
export interface AccordionSectionSummaryProps extends BaseProps<'summary'> {
|
|
4
|
+
/**
|
|
5
|
+
* color is optional.
|
|
6
|
+
* 'primary' color gives AccordionSectionSummary the default color.
|
|
7
|
+
* @value primary
|
|
8
|
+
* @value secondary
|
|
9
|
+
* @default primary
|
|
10
|
+
* */
|
|
11
|
+
color?: 'primary' | 'secondary';
|
|
4
12
|
}
|
|
5
13
|
/**
|
|
6
14
|
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
@@ -17,19 +17,21 @@ var _Base = _interopRequireDefault(require("@digigov/react-core/Base"));
|
|
|
17
17
|
|
|
18
18
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["className", "children"];
|
|
20
|
+
var _excluded = ["color", "className", "children"];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
24
24
|
*/
|
|
25
25
|
var AccordionSectionSummary = /*#__PURE__*/_react["default"].forwardRef(function AccordionSectionSummary(_ref, ref) {
|
|
26
|
-
var
|
|
26
|
+
var _ref$color = _ref.color,
|
|
27
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
28
|
+
className = _ref.className,
|
|
27
29
|
children = _ref.children,
|
|
28
30
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
29
31
|
return /*#__PURE__*/_react["default"].createElement(_Base["default"], (0, _extends2["default"])({
|
|
30
32
|
as: "summary",
|
|
31
33
|
ref: ref,
|
|
32
|
-
className: (0, _clsx["default"])(className, true && 'govgr-accordion__section-summary'),
|
|
34
|
+
className: (0, _clsx["default"])(className, color === 'secondary' && 'govgr-accordion__section-summary--secondary', true && 'govgr-accordion__section-summary'),
|
|
33
35
|
role: "heading"
|
|
34
36
|
}, props), children);
|
|
35
37
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["color", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -9,14 +9,16 @@ import clsx from 'clsx';
|
|
|
9
9
|
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
10
10
|
*/
|
|
11
11
|
export var AccordionSectionSummary = /*#__PURE__*/React.forwardRef(function AccordionSectionSummary(_ref, ref) {
|
|
12
|
-
var
|
|
12
|
+
var _ref$color = _ref.color,
|
|
13
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
14
|
+
className = _ref.className,
|
|
13
15
|
children = _ref.children,
|
|
14
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
17
|
|
|
16
18
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
17
19
|
as: "summary",
|
|
18
20
|
ref: ref,
|
|
19
|
-
className: clsx(className, true && 'govgr-accordion__section-summary'),
|
|
21
|
+
className: clsx(className, color === 'secondary' && 'govgr-accordion__section-summary--secondary', true && 'govgr-accordion__section-summary'),
|
|
20
22
|
role: "heading"
|
|
21
23
|
}, props), children);
|
|
22
24
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["color", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Base from '@digigov/react-core/Base';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -9,14 +9,16 @@ import clsx from 'clsx';
|
|
|
9
9
|
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
10
10
|
*/
|
|
11
11
|
export var AccordionSectionSummary = /*#__PURE__*/React.forwardRef(function AccordionSectionSummary(_ref, ref) {
|
|
12
|
-
var
|
|
12
|
+
var _ref$color = _ref.color,
|
|
13
|
+
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
14
|
+
className = _ref.className,
|
|
13
15
|
children = _ref.children,
|
|
14
16
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
17
|
|
|
16
18
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
17
19
|
as: "summary",
|
|
18
20
|
ref: ref,
|
|
19
|
-
className: clsx(className, true && 'govgr-accordion__section-summary'),
|
|
21
|
+
className: clsx(className, color === 'secondary' && 'govgr-accordion__section-summary--secondary', true && 'govgr-accordion__section-summary'),
|
|
20
22
|
role: "heading"
|
|
21
23
|
}, props), children);
|
|
22
24
|
});
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0-ac772edc",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "BSD-2-Clause",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@digigov/css": "0.
|
|
14
|
+
"@digigov/css": "0.39.0-ac772edc",
|
|
15
15
|
"clsx": "1.1.1",
|
|
16
16
|
"react": "^16.8.0 || ^17.0.0",
|
|
17
17
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
@@ -2,20 +2,30 @@ import React from 'react';
|
|
|
2
2
|
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
|
|
5
|
-
export interface AccordionSectionSummaryProps extends BaseProps<'summary'> {
|
|
5
|
+
export interface AccordionSectionSummaryProps extends BaseProps<'summary'> {
|
|
6
|
+
/**
|
|
7
|
+
* color is optional.
|
|
8
|
+
* 'primary' color gives AccordionSectionSummary the default color.
|
|
9
|
+
* @value primary
|
|
10
|
+
* @value secondary
|
|
11
|
+
* @default primary
|
|
12
|
+
* */
|
|
13
|
+
color?: 'primary' | 'secondary';
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
8
17
|
*/
|
|
9
18
|
export const AccordionSectionSummary = React.forwardRef<
|
|
10
19
|
HTMLDivElement,
|
|
11
20
|
AccordionSectionSummaryProps
|
|
12
|
-
>(function AccordionSectionSummary({ className, children, ...props }, ref) {
|
|
21
|
+
>(function AccordionSectionSummary({ color = 'primary', className, children, ...props }, ref) {
|
|
13
22
|
return (
|
|
14
23
|
<Base
|
|
15
24
|
as="summary"
|
|
16
25
|
ref={ref}
|
|
17
26
|
className={clsx(className, {
|
|
18
27
|
'govgr-accordion__section-summary': true,
|
|
28
|
+
'govgr-accordion__section-summary--secondary': color === 'secondary',
|
|
19
29
|
})}
|
|
20
30
|
role="heading"
|
|
21
31
|
{...props}
|