mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-08-23 17:44:55 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
5e4e8406e6 | |||
b1913d223e | |||
cb93ae6387 | |||
35e45c3125 | |||
a7fe76056e | |||
3471a72b1e | |||
777ceb8e1a | |||
72443a758a |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -5,7 +5,19 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [5.1.3]
|
||||
## [[5.2.0](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/5.2.0)]
|
||||
|
||||
### added
|
||||
|
||||
Added aria labels for both the decline and accept button
|
||||
|
||||
## [[5.1.4](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/5.1.4)]
|
||||
|
||||
### changed
|
||||
|
||||
- set default SameSite attribute to "lax" because browsers are already implementing the cookie policy changes.
|
||||
|
||||
## [[5.1.3](https://github.com/Mastermindzh/react-cookie-consent/releases/tag/5.1.3)]
|
||||
|
||||
### changed
|
||||
|
||||
|
3
build/index.d.ts
vendored
3
build/index.d.ts
vendored
@@ -24,6 +24,7 @@ export interface CookieConsentProps {
|
||||
expires?: number;
|
||||
containerClasses?: string;
|
||||
contentClasses?: string;
|
||||
buttonWrapperClasses?: string;
|
||||
buttonClasses?: string;
|
||||
declineButtonClasses?: string;
|
||||
buttonId?: string;
|
||||
@@ -38,6 +39,8 @@ export interface CookieConsentProps {
|
||||
overlay?: boolean;
|
||||
overlayClasses?: string;
|
||||
overlayStyle?: object;
|
||||
ariaAcceptLabel?: string;
|
||||
ariaDeclineLabel?: string;
|
||||
}
|
||||
|
||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
||||
|
@@ -913,7 +913,9 @@ module.exports = /******/ (function (modules) {
|
||||
ButtonComponent = _props4.ButtonComponent,
|
||||
overlay = _props4.overlay,
|
||||
overlayClasses = _props4.overlayClasses,
|
||||
overlayStyle = _props4.overlayStyle;
|
||||
overlayStyle = _props4.overlayStyle,
|
||||
ariaAcceptLabel = _props4.ariaAcceptLabel,
|
||||
ariaDeclineLabel = _props4.ariaDeclineLabel;
|
||||
|
||||
var myStyle = {};
|
||||
var myButtonStyle = {};
|
||||
@@ -970,6 +972,7 @@ module.exports = /******/ (function (modules) {
|
||||
style: myDeclineButtonStyle,
|
||||
className: declineButtonClasses,
|
||||
id: declineButtonId,
|
||||
"aria-label": ariaDeclineLabel,
|
||||
onClick: function onClick() {
|
||||
_this2.decline();
|
||||
},
|
||||
@@ -987,6 +990,7 @@ module.exports = /******/ (function (modules) {
|
||||
style: myButtonStyle,
|
||||
className: buttonClasses,
|
||||
id: buttonId,
|
||||
"aria-label": ariaAcceptLabel,
|
||||
onClick: function onClick() {
|
||||
_this2.accept({ acceptedByScrolling: false });
|
||||
},
|
||||
@@ -1098,6 +1102,8 @@ module.exports = /******/ (function (modules) {
|
||||
overlay: _propTypes2.default.bool,
|
||||
overlayClasses: _propTypes2.default.string,
|
||||
overlayStyle: _propTypes2.default.object,
|
||||
ariaAcceptLabel: _propTypes2.default.string,
|
||||
ariaDeclineLabel: _propTypes2.default.string,
|
||||
};
|
||||
|
||||
CookieConsent.defaultProps = {
|
||||
@@ -1128,7 +1134,7 @@ module.exports = /******/ (function (modules) {
|
||||
disableButtonStyles: false,
|
||||
enableDeclineButton: false,
|
||||
flipButtons: false,
|
||||
sameSite: SAME_SITE_OPTIONS.NONE,
|
||||
sameSite: SAME_SITE_OPTIONS.LAX,
|
||||
ButtonComponent: function ButtonComponent(_ref3) {
|
||||
var children = _ref3.children,
|
||||
props = _objectWithoutProperties(_ref3, ["children"]);
|
||||
@@ -1137,6 +1143,8 @@ module.exports = /******/ (function (modules) {
|
||||
},
|
||||
overlay: false,
|
||||
overlayClasses: "",
|
||||
ariaAcceptLabel: "Accept cookies",
|
||||
ariaDeclineLabel: "Decline cookies",
|
||||
};
|
||||
|
||||
exports.default = CookieConsent;
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"name": "Rick van Lieshout",
|
||||
"email": "info@rickvanlieshout.com"
|
||||
},
|
||||
"version": "5.1.2",
|
||||
"version": "5.2.0",
|
||||
"description": "A small, simple and customizable cookie consent bar for use in React applications.",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
@@ -20,7 +20,7 @@
|
||||
"patch": "npm --no-git-tag-version version patch",
|
||||
"minor": "npm --no-git-tag-version version minor",
|
||||
"major": "npm --no-git-tag-version version major",
|
||||
"release": "npm run build && git add -A && git commit -m 'version bump and build' && git push && npm publish",
|
||||
"release": "npm run build && git add -A && PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag $PACKAGE_VERSION && git commit -m 'release $PACKAGE_VERSION' && git push && git push --tags && npm publish",
|
||||
"release-patch": "npm run patch && npm run release",
|
||||
"release-minor": "npm run minor && npm run release",
|
||||
"release-major": "npm run major && npm run release"
|
||||
|
10
src/index.d.ts
vendored
10
src/index.d.ts
vendored
@@ -24,7 +24,7 @@ export interface CookieConsentProps {
|
||||
expires?: number;
|
||||
containerClasses?: string;
|
||||
contentClasses?: string;
|
||||
buttonWrapperClasses?: string,
|
||||
buttonWrapperClasses?: string;
|
||||
buttonClasses?: string;
|
||||
declineButtonClasses?: string;
|
||||
buttonId?: string;
|
||||
@@ -36,9 +36,11 @@ export interface CookieConsentProps {
|
||||
enableDeclineButton?: boolean;
|
||||
flipButtons?: boolean;
|
||||
ButtonComponent?: React.ElementType;
|
||||
overlay?: boolean,
|
||||
overlayClasses?: string,
|
||||
overlayStyle?: object,
|
||||
overlay?: boolean;
|
||||
overlayClasses?: string;
|
||||
overlayStyle?: object;
|
||||
ariaAcceptLabel?: string;
|
||||
ariaDeclineLabel?: string;
|
||||
}
|
||||
|
||||
export default class CookieConsent extends React.Component<CookieConsentProps, {}> {}
|
||||
|
10
src/index.js
10
src/index.js
@@ -249,6 +249,8 @@ class CookieConsent extends Component {
|
||||
overlay,
|
||||
overlayClasses,
|
||||
overlayStyle,
|
||||
ariaAcceptLabel,
|
||||
ariaDeclineLabel,
|
||||
} = this.props;
|
||||
|
||||
let myStyle = {};
|
||||
@@ -304,6 +306,7 @@ class CookieConsent extends Component {
|
||||
style={myDeclineButtonStyle}
|
||||
className={declineButtonClasses}
|
||||
id={declineButtonId}
|
||||
aria-label={ariaDeclineLabel}
|
||||
onClick={() => {
|
||||
this.decline();
|
||||
}}
|
||||
@@ -319,6 +322,7 @@ class CookieConsent extends Component {
|
||||
style={myButtonStyle}
|
||||
className={buttonClasses}
|
||||
id={buttonId}
|
||||
aria-label={ariaAcceptLabel}
|
||||
onClick={() => {
|
||||
this.accept({ acceptedByScrolling: false });
|
||||
}}
|
||||
@@ -394,6 +398,8 @@ CookieConsent.propTypes = {
|
||||
overlay: PropTypes.bool,
|
||||
overlayClasses: PropTypes.string,
|
||||
overlayStyle: PropTypes.object,
|
||||
ariaAcceptLabel: PropTypes.string,
|
||||
ariaDeclineLabel: PropTypes.string,
|
||||
};
|
||||
|
||||
CookieConsent.defaultProps = {
|
||||
@@ -424,10 +430,12 @@ CookieConsent.defaultProps = {
|
||||
disableButtonStyles: false,
|
||||
enableDeclineButton: false,
|
||||
flipButtons: false,
|
||||
sameSite: SAME_SITE_OPTIONS.NONE,
|
||||
sameSite: SAME_SITE_OPTIONS.LAX,
|
||||
ButtonComponent: ({ children, ...props }) => <button {...props}>{children}</button>,
|
||||
overlay: false,
|
||||
overlayClasses: "",
|
||||
ariaAcceptLabel: "Accept cookies",
|
||||
ariaDeclineLabel: "Decline cookies",
|
||||
};
|
||||
|
||||
export default CookieConsent;
|
||||
|
17
stale.yml
Normal file
17
stale.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 2
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- good first issue
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
Reference in New Issue
Block a user