diff --git a/CHANGELOG.md b/CHANGELOG.md index 9405f336d..21f0cd60d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [1.4.0-next.1](https://github.com/warp-ds/react/compare/v1.3.3-next.1...v1.4.0-next.1) (2024-02-05) + + +### Features + +* **modal:** add onLeftClick prop to control left button event-handling ([#200](https://github.com/warp-ds/react/issues/200)) ([96a750b](https://github.com/warp-ds/react/commit/96a750b1303cb8db7fb767f22c43d5dd3717e206)) + +## [1.3.3-next.1](https://github.com/warp-ds/react/compare/v1.3.2...v1.3.3-next.1) (2024-01-31) + + +### Bug Fixes + +* bump scroll-doctor lib to fix modal issue with scrollbars ([#199](https://github.com/warp-ds/react/issues/199)) ([e4bb6e9](https://github.com/warp-ds/react/commit/e4bb6e9f9d68d3eb2868a2c8822d4cbbb0600f91)) + ## [1.3.2](https://github.com/warp-ds/react/compare/v1.3.1...v1.3.2) (2024-01-25) diff --git a/package.json b/package.json index 4851cdbea..64468fd38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@warp-ds/react", - "version": "1.3.2", + "version": "1.4.0-next.1", "type": "module", "repository": "git@github.com:warp-ds/react.git", "license": "Apache-2.0", @@ -114,7 +114,7 @@ "@warp-ds/uno": "^1.6.0", "react-focus-lock": "^2.5.2", "resize-observer-polyfill": "^1.5.1", - "scroll-doctor": "^1.0.0" + "scroll-doctor": "^2.0.0" }, "eik": { "server": "https://assets.finn.no", diff --git a/packages/modal/src/component.tsx b/packages/modal/src/component.tsx index 9391aa646..d1672e425 100644 --- a/packages/modal/src/component.tsx +++ b/packages/modal/src/component.tsx @@ -91,7 +91,7 @@ export const Modal = ({ ccModal.titleButton, ccModal.titleButtonLeft )} - onClick={props.onDismiss} + onClick={props.onLeftClick ? props.onLeftClick : props.onDismiss} > void; + /** + * Handler that is called when the user clicks the left button + */ + onLeftClick?: () => void; + /** * Defines a string value that labels the current element. Must be set if neither `aria-labelledby` or `` is defined, */ diff --git a/packages/modal/stories/Modal.stories.tsx b/packages/modal/stories/Modal.stories.tsx index 2b2794fa5..0f4b336c0 100644 --- a/packages/modal/stories/Modal.stories.tsx +++ b/packages/modal/stories/Modal.stories.tsx @@ -70,6 +70,10 @@ export const WithBackAndCloseButton = () => { left right onDismiss={toggleModal} + onLeftClick={() => { + console.log('left clicked'); + toggleModal(); + }} title="Title of the content goes here" footer={ <> diff --git a/packages/pagination/src/locales/en/messages.po b/packages/pagination/src/locales/en/messages.po index 7e7167fc1..f997f1c85 100644 --- a/packages/pagination/src/locales/en/messages.po +++ b/packages/pagination/src/locales/en/messages.po @@ -12,6 +12,7 @@ msgstr "" "Last-Translator: \n" "Language-Team: \n" "Plural-Forms: \n" +"X-Crowdin-SourceKey: msgstr\n" #. Default screenreader message for first page button in the pagination component #. js-lingui-explicit-id @@ -54,3 +55,4 @@ msgstr "Pages" #: packages/pagination/src/react/PrevPage.tsx:36 msgid "pagination.aria.prev-page" msgstr "Previous page" + diff --git a/packages/pagination/src/locales/fi/messages.po b/packages/pagination/src/locales/fi/messages.po index 88ebde091..a0cf28a1f 100644 --- a/packages/pagination/src/locales/fi/messages.po +++ b/packages/pagination/src/locales/fi/messages.po @@ -2,16 +2,19 @@ msgid "" msgstr "" "POT-Creation-Date: 2023-11-28 09:50+0100\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: @lingui/cli\n" "Language: fi\n" -"Project-Id-Version: \n" +"Project-Id-Version: 2853b3c41d7b7a59e7cd64c0153b540a\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: \n" "Last-Translator: \n" -"Language-Team: \n" -"Plural-Forms: \n" +"Language-Team: Finnish\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: 2853b3c41d7b7a59e7cd64c0153b540a\n" +"X-Crowdin-Project-ID: 141\n" +"X-Crowdin-Language: fi\n" +"X-Crowdin-File-ID: 15506\n" #. Default screenreader message for first page button in the pagination component #. js-lingui-explicit-id @@ -54,3 +57,4 @@ msgstr "Sivut" #: packages/pagination/src/react/PrevPage.tsx:36 msgid "pagination.aria.prev-page" msgstr "Edellinen sivu" + diff --git a/packages/pagination/src/locales/nb/messages.po b/packages/pagination/src/locales/nb/messages.po index 730c70e9c..342331b89 100644 --- a/packages/pagination/src/locales/nb/messages.po +++ b/packages/pagination/src/locales/nb/messages.po @@ -2,16 +2,19 @@ msgid "" msgstr "" "POT-Creation-Date: 2023-11-28 09:50+0100\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: @lingui/cli\n" -"Language: nb\n" -"Project-Id-Version: \n" +"Language: nb_NO\n" +"Project-Id-Version: 2853b3c41d7b7a59e7cd64c0153b540a\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: \n" "Last-Translator: \n" -"Language-Team: \n" -"Plural-Forms: \n" +"Language-Team: Norwegian Bokmal\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Crowdin-Project: 2853b3c41d7b7a59e7cd64c0153b540a\n" +"X-Crowdin-Project-ID: 141\n" +"X-Crowdin-Language: nb\n" +"X-Crowdin-File-ID: 15506\n" #. Default screenreader message for first page button in the pagination component #. js-lingui-explicit-id @@ -54,3 +57,4 @@ msgstr "Sider" #: packages/pagination/src/react/PrevPage.tsx:36 msgid "pagination.aria.prev-page" msgstr "Forrige side" + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f9148c00..5bcfe73c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ dependencies: specifier: ^1.5.1 version: 1.5.1 scroll-doctor: - specifier: ^1.0.0 - version: 1.0.1 + specifier: ^2.0.0 + version: 2.0.0 devDependencies: '@babel/core': @@ -1423,7 +1423,7 @@ packages: '@babel/helper-module-imports': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.7) - '@babel/types': 7.23.6 + '@babel/types': 7.23.9 dev: true /@babel/plugin-transform-react-pure-annotations@7.18.6(@babel/core@7.23.7): @@ -1792,6 +1792,15 @@ packages: to-fast-properties: 2.0.0 dev: true + /@babel/types@7.23.9: + resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + dev: true + /@base2/pretty-print-object@1.0.1: resolution: {integrity: sha512-4iri8i1AqYHJE2DstZYkyEprg6Pq6sKx3xn5FpySk9sNhH7qN2LLlHJCfDTZRILNwQNPD7mATWM0TBui7uC1pA==} dev: true @@ -1811,12 +1820,12 @@ packages: dev: true optional: true - /@commitlint/config-validator@18.5.0: - resolution: {integrity: sha512-mDAA6WQPjh9Ida8ACdInDylBQcqeUD2gBHE+dQu+B3OIHiWiSSrq4F2+wg3nDU9EzfcQSwPwYL+QbMmiW5SmLA==} + /@commitlint/config-validator@18.6.0: + resolution: {integrity: sha512-Ptfa865arNozlkjxrYG3qt6wT9AlhNUHeuDyKEZiTL/l0ftncFhK/KN0t/EAMV2tec+0Mwxo0FmhbESj/bI+1g==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/types': 18.4.4 + '@commitlint/types': 18.6.0 ajv: 8.12.0 dev: true optional: true @@ -1828,15 +1837,15 @@ packages: dev: true optional: true - /@commitlint/load@18.5.0(@types/node@20.11.5)(typescript@5.3.3): - resolution: {integrity: sha512-vpyGgk7rzbFsU01NVwPNC/WetHFP0EwSYnQ1R833SJFHkEo+cWvqoVlw/VoZwBMoI6sF5/lwEdKzFDr1DHJ6+A==} + /@commitlint/load@18.6.0(@types/node@20.11.5)(typescript@5.3.3): + resolution: {integrity: sha512-RRssj7TmzT0bowoEKlgwg8uQ7ORXWkw7lYLsZZBMi9aInsJuGNLNWcMxJxRZbwxG3jkCidGUg85WmqJvRjsaDA==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/config-validator': 18.5.0 + '@commitlint/config-validator': 18.6.0 '@commitlint/execute-rule': 18.4.4 - '@commitlint/resolve-extends': 18.5.0 - '@commitlint/types': 18.4.4 + '@commitlint/resolve-extends': 18.6.0 + '@commitlint/types': 18.6.0 chalk: 4.1.2 cosmiconfig: 8.3.6(typescript@5.3.3) cosmiconfig-typescript-loader: 5.0.0(@types/node@20.11.5)(cosmiconfig@8.3.6)(typescript@5.3.3) @@ -1850,13 +1859,13 @@ packages: dev: true optional: true - /@commitlint/resolve-extends@18.5.0: - resolution: {integrity: sha512-OxCYOMnlkOEEIkwTaRiFjHyuWBq962WBZQVHfMHej8tr3d+SfjznvqZhPmW8/SuqtfmGEiJPGWUNOxgwH+O0MA==} + /@commitlint/resolve-extends@18.6.0: + resolution: {integrity: sha512-k2Xp+Fxeggki2i90vGrbiLDMefPius3zGSTFFlRAPKce/SWLbZtI+uqE9Mne23mHO5lmcSV8z5m6ziiJwGpOcg==} engines: {node: '>=v18'} requiresBuild: true dependencies: - '@commitlint/config-validator': 18.5.0 - '@commitlint/types': 18.4.4 + '@commitlint/config-validator': 18.6.0 + '@commitlint/types': 18.6.0 import-fresh: 3.3.0 lodash.mergewith: 4.6.2 resolve-from: 5.0.0 @@ -1864,8 +1873,8 @@ packages: dev: true optional: true - /@commitlint/types@18.4.4: - resolution: {integrity: sha512-/FykLtodD8gKs3+VNkAUwofu4LBHankclj+I8fB2jTRvG6PV7k/OUt4P+VbM7ip853qS4F0g7Z6hLNa6JeMcAQ==} + /@commitlint/types@18.6.0: + resolution: {integrity: sha512-oavoKLML/eJa2rJeyYSbyGAYzTxQ6voG5oeX3OrxpfrkRWhJfm4ACnhoRf5tgiybx2MZ+EVFqC1Lw3W8/uwpZA==} engines: {node: '>=v18'} requiresBuild: true dependencies: @@ -7840,7 +7849,7 @@ packages: longest: 2.0.1 word-wrap: 1.2.3 optionalDependencies: - '@commitlint/load': 18.5.0(@types/node@20.11.5)(typescript@5.3.3) + '@commitlint/load': 18.6.0(@types/node@20.11.5)(typescript@5.3.3) transitivePeerDependencies: - '@types/node' - typescript @@ -13962,8 +13971,8 @@ packages: loose-envify: 1.4.0 dev: true - /scroll-doctor@1.0.1: - resolution: {integrity: sha512-+9t0VawVYL2XligaxF609EWERjPjZn/jfcJK0glsE/tfsipubbWULksHtZQjuZ1LXF7rnqO7EJOihoRyVgqppg==} + /scroll-doctor@2.0.0: + resolution: {integrity: sha512-lBLUBKAFMLUdQoEAF7qhUAUCg+87OXH1rlIrYVhiyegdIA8/7pDWWjCkNlstLtFmMdtcJQtP5SunbumlpkBvrQ==} dev: false /semantic-release-slack-bot@4.0.2(semantic-release@23.0.0):