diff --git a/.changeset/clean-walls-bake.md b/.changeset/clean-walls-bake.md new file mode 100644 index 0000000000..4f95a563a4 --- /dev/null +++ b/.changeset/clean-walls-bake.md @@ -0,0 +1,6 @@ +--- +"@siemens/ix": patch +"@siemens/ix-vue": patch +--- + +fix(core/date-dropdown): show year and month dropdown diff --git a/.changeset/config.json b/.changeset/config.json index 94989bf42b..d1c3955dbc 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -14,7 +14,7 @@ "@siemens/ix-vue" ] ], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [ diff --git a/.changeset/cyan-plums-build.md b/.changeset/cyan-plums-build.md new file mode 100644 index 0000000000..a3313cb397 --- /dev/null +++ b/.changeset/cyan-plums-build.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/event-list-item): add aria-disabled attribute to list element diff --git a/.changeset/dry-avocados-sneeze.md b/.changeset/dry-avocados-sneeze.md new file mode 100644 index 0000000000..41b44f0c6a --- /dev/null +++ b/.changeset/dry-avocados-sneeze.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': minor +--- + +feat(core/date-dropdown): add disabled property diff --git a/.changeset/dry-roses-brake.md b/.changeset/dry-roses-brake.md new file mode 100644 index 0000000000..7b0e72ee7f --- /dev/null +++ b/.changeset/dry-roses-brake.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix-angular': patch +--- + +fix(angular/modal): avoid overflow of modal content diff --git a/.changeset/empty-sloths-burn.md b/.changeset/empty-sloths-burn.md new file mode 100644 index 0000000000..65222a3807 --- /dev/null +++ b/.changeset/empty-sloths-burn.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/category-filter): open dropdown on text input and keep it open diff --git a/.changeset/giant-owls-explain.md b/.changeset/giant-owls-explain.md new file mode 100644 index 0000000000..63977ced81 --- /dev/null +++ b/.changeset/giant-owls-explain.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/blind): avoid unnecessary wrapping diff --git a/.changeset/giant-ways-wave.md b/.changeset/giant-ways-wave.md new file mode 100644 index 0000000000..1ca4d92d21 --- /dev/null +++ b/.changeset/giant-ways-wave.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/base-button): set aria disabled diff --git a/.changeset/gold-terms-develop.md b/.changeset/gold-terms-develop.md new file mode 100644 index 0000000000..6b81d8865a --- /dev/null +++ b/.changeset/gold-terms-develop.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/group): show expand-collapse icon diff --git a/.changeset/hot-sloths-fold.md b/.changeset/hot-sloths-fold.md new file mode 100644 index 0000000000..ece5a4c722 --- /dev/null +++ b/.changeset/hot-sloths-fold.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/group-context-menu): set default cursor diff --git a/.changeset/large-oranges-float.md b/.changeset/large-oranges-float.md new file mode 100644 index 0000000000..e79408b719 --- /dev/null +++ b/.changeset/large-oranges-float.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/event-list): event-list-items not selectabe in chrome diff --git a/.changeset/popular-crabs-reply.md b/.changeset/popular-crabs-reply.md new file mode 100644 index 0000000000..d407002c1b --- /dev/null +++ b/.changeset/popular-crabs-reply.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/tooltip): null check before event listener gets registered on trigger diff --git a/.changeset/quiet-pillows-jog.md b/.changeset/quiet-pillows-jog.md new file mode 100644 index 0000000000..69b045e4b2 --- /dev/null +++ b/.changeset/quiet-pillows-jog.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +docs(core/menu-about): update jsdocs for label property diff --git a/.changeset/rare-eagles-laugh.md b/.changeset/rare-eagles-laugh.md new file mode 100644 index 0000000000..587106aaf8 --- /dev/null +++ b/.changeset/rare-eagles-laugh.md @@ -0,0 +1,5 @@ +--- +"@siemens/ix": patch +--- + +fix(core/group): use correct cursors diff --git a/.changeset/silent-stingrays-pump.md b/.changeset/silent-stingrays-pump.md new file mode 100644 index 0000000000..26be6572e7 --- /dev/null +++ b/.changeset/silent-stingrays-pump.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': minor +--- + +feat(core/button|icon-button): add danger variant diff --git a/.changeset/wise-games-relate.md b/.changeset/wise-games-relate.md new file mode 100644 index 0000000000..d85c634d8c --- /dev/null +++ b/.changeset/wise-games-relate.md @@ -0,0 +1,5 @@ +--- +'@siemens/ix': patch +--- + +fix(core/workflow): add flexible layout diff --git a/.github/workflows/actions/turbo/action.yml b/.github/workflows/actions/turbo/action.yml index e204538108..a2274755d9 100644 --- a/.github/workflows/actions/turbo/action.yml +++ b/.github/workflows/actions/turbo/action.yml @@ -6,7 +6,7 @@ runs: - uses: pnpm/action-setup@v2 name: Install pnpm with: - version: 8 + version: 9 run_install: false - name: Setup Node.js environment diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 3171ec562a..cfc224c9ba 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -23,6 +23,7 @@ jobs: - name: Build run: pnpm build --cache-dir=.turbo --filter documentation --force env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FIGMA_API_TOKEN: ${{ secrets.FIGMA_API_TOKEN }} CSC: ${{ secrets.READ_CSC_TOKEN }} diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index d5d06a8999..c433793022 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -50,6 +50,7 @@ jobs: env: FIGMA_API_TOKEN: ${{ secrets.FIGMA_API_TOKEN }} CSC: ${{ secrets.READ_CSC_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish id: publish diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b253474c0e..671c3f5641 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -9,17 +9,19 @@ on: - reopened - synchronize -concurrency: pr-${{ github.ref }} +concurrency: + group: pr-${{ github.head_ref }} + cancel-in-progress: true jobs: changes: runs-on: ubuntu-latest outputs: core_any_changed: ${{ steps.changes.outputs.core_any_changed }} - angular_any_changed: ${{ steps.changes.outputs.angular_any_changed }} aggrid_any_changed: ${{ steps.changes.outputs.aggrid_any_changed }} echarts_any_changed: ${{ steps.changes.outputs.echarts_any_changed }} docs_any_changed: ${{ steps.changes.outputs.docs_any_changed }} + unittests_any_changed: ${{ steps.changes.outputs.unittests_any_changed }} steps: - uses: actions/checkout@v3 - name: Track changes between commits @@ -29,18 +31,21 @@ jobs: files_yaml: | core: - packages/core/** - angular: - - packages/angular/** aggrid: - packages/aggrid/** echarts: - packages/echarts/** docs: - packages/documentation/** + - packages/example-styles/** - packages/html-test-app/** - packages/angular-test-app/** - packages/react-test-app/** - packages/vue-test-app/** + unittests: + - packages/core/** + - packages/angular/** + - packages/react/** build: needs: changes @@ -165,7 +170,7 @@ jobs: retention-days: 2 unit: - if: ${{ needs.changes.outputs.core_any_changed == 'true' || needs.changes.outputs.angular_any_changed == 'true' }} + if: ${{ needs.changes.outputs.unittests_any_changed == 'true' }} needs: [build, changes] timeout-minutes: 10 runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 13e297a124..a478b3593e 100644 --- a/.gitignore +++ b/.gitignore @@ -170,6 +170,7 @@ packages/html-test-app/src/public/additional-theme # documentation ### +packages/documentation/docs/installation/CHANGELOG.md packages/documentation/docs/auto-generated/ packages/documentation/.build-temp packages/documentation/scripts/.typedoc/ diff --git a/.npmrc b/.npmrc index 1b0cbc39d9..12b38db197 100644 --- a/.npmrc +++ b/.npmrc @@ -4,3 +4,5 @@ shamefully-hoist=true puppeteer_skip_chromium_download=true puppeteer_skip_chrome_headless_shell_download=true puppeteer_skip_download=true +link-workspace-packages = deep +prefer-workspace-packages = true diff --git a/ix.code-workspace b/ix.code-workspace index 3a617b0d1b..c112a07a58 100644 --- a/ix.code-workspace +++ b/ix.code-workspace @@ -48,6 +48,10 @@ "name": "eslint-config", "path": "./packages/eslint-config-ix" }, + { + "name": "example-styles", + "path": "./packages/example-styles" + }, { "name": "figma-plugin", "path": "./packages/figma-plugin" diff --git a/package.json b/package.json index 6098e2067c..ef564293d2 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,9 @@ "bugs": { "url": "https://www.github.com/siemens/ix/issues" }, - "packageManager": "pnpm@8.9.2", "engines": { - "npm": ">=8.x.x", - "node": ">=16.16.x" + "pnpm": ">=9.x.x", + "node": ">=18.x.x" }, "scripts": { "docs": "dotenv -- turbo run start --filter=documentation", @@ -30,7 +29,7 @@ "test": "dotenv -- turbo run test", "prepare": "husky install", "ci:version": "pnpm changeset version && pnpm i --lockfile-only", - "ci:publish": "pnpm publish -r" + "ci:publish": "pnpm changeset publish" }, "dependencies": { "tslib": "^2.3.0" diff --git a/packages/angular-test-app/package.json b/packages/angular-test-app/package.json index a82c980b18..401c358873 100644 --- a/packages/angular-test-app/package.json +++ b/packages/angular-test-app/package.json @@ -23,6 +23,7 @@ "@siemens/ix-angular": "workspace:*", "@siemens/ix-aggrid": "workspace:*", "@siemens/ix-echarts": "workspace:*", + "example-styles": "workspace:*", "ag-grid-angular": "^30.0.0", "ag-grid-community": "^30.2.0", "ngx-echarts": "~14.0.0", diff --git a/packages/angular-test-app/src/preview-examples/button-danger-ghost.html b/packages/angular-test-app/src/preview-examples/button-danger-ghost.html new file mode 100644 index 0000000000..ec37d74c44 --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger-ghost.html @@ -0,0 +1,2 @@ + Button + Button diff --git a/packages/angular-test-app/src/preview-examples/button-danger-ghost.ts b/packages/angular-test-app/src/preview-examples/button-danger-ghost.ts new file mode 100644 index 0000000000..9f5c6008fe --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger-ghost.ts @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-example', + templateUrl: './button-danger-ghost.html', +}) +export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/button-danger-outline.html b/packages/angular-test-app/src/preview-examples/button-danger-outline.html new file mode 100644 index 0000000000..7ced5df648 --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger-outline.html @@ -0,0 +1,2 @@ + Button + Button diff --git a/packages/angular-test-app/src/preview-examples/button-danger-outline.ts b/packages/angular-test-app/src/preview-examples/button-danger-outline.ts new file mode 100644 index 0000000000..b1b0811cac --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger-outline.ts @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-example', + templateUrl: './button-danger-outline.html', +}) +export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/button-danger.html b/packages/angular-test-app/src/preview-examples/button-danger.html new file mode 100644 index 0000000000..b46cc6106d --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger.html @@ -0,0 +1,2 @@ + Button + Button diff --git a/packages/angular-test-app/src/preview-examples/button-danger.ts b/packages/angular-test-app/src/preview-examples/button-danger.ts new file mode 100644 index 0000000000..352ff4c71c --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-danger.ts @@ -0,0 +1,16 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-example', + templateUrl: './button-danger.html', +}) +export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/button-ghost.ts b/packages/angular-test-app/src/preview-examples/button-ghost.ts index 49bacaf840..b79a828706 100644 --- a/packages/angular-test-app/src/preview-examples/button-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/button-ghost.ts @@ -12,14 +12,15 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonGhost(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonGhost(): string | undefined { return ` - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-grey-ghost.ts b/packages/angular-test-app/src/preview-examples/button-grey-ghost.ts index bb4e15eadc..15be10ef45 100644 --- a/packages/angular-test-app/src/preview-examples/button-grey-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/button-grey-ghost.ts @@ -12,14 +12,15 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonGreyGhost(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonGreyGhost(): string | undefined { return ` - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-grey-secondary.ts b/packages/angular-test-app/src/preview-examples/button-grey-secondary.ts index a85de1e653..9fb32a2468 100644 --- a/packages/angular-test-app/src/preview-examples/button-grey-secondary.ts +++ b/packages/angular-test-app/src/preview-examples/button-grey-secondary.ts @@ -12,14 +12,15 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonGreySecondary(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonGreySecondary(): string | undefined { return ` - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-grey.ts b/packages/angular-test-app/src/preview-examples/button-grey.ts index 364c25505f..0a78f6684e 100644 --- a/packages/angular-test-app/src/preview-examples/button-grey.ts +++ b/packages/angular-test-app/src/preview-examples/button-grey.ts @@ -12,14 +12,15 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonGrey(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonGrey(): string | undefined { return ` - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-loading.html b/packages/angular-test-app/src/preview-examples/button-loading.html new file mode 100644 index 0000000000..29424702c4 --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-loading.html @@ -0,0 +1,26 @@ + + Button + + + + Button + + + + + + Button + + diff --git a/packages/angular-test-app/src/preview-examples/button-loading.ts b/packages/angular-test-app/src/preview-examples/button-loading.ts index d4909b66df..99e83e9705 100644 --- a/packages/angular-test-app/src/preview-examples/button-loading.ts +++ b/packages/angular-test-app/src/preview-examples/button-loading.ts @@ -11,50 +11,12 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', - template: ` - - Button - - - - Button - - - - - - - Button - - - - `, + template: './button-loading.html', + styles: [ + ` + @import 'example-styles/dist/buttons.css'; + `, + ], }) export default class ButtonLoading { loading = false; diff --git a/packages/angular-test-app/src/preview-examples/button-secondary.ts b/packages/angular-test-app/src/preview-examples/button-secondary.ts index 66d836eb02..67dc6dc660 100644 --- a/packages/angular-test-app/src/preview-examples/button-secondary.ts +++ b/packages/angular-test-app/src/preview-examples/button-secondary.ts @@ -12,14 +12,15 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonSecondary(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonSecondary(): string | undefined { return ` - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-text-icon.ts b/packages/angular-test-app/src/preview-examples/button-text-icon.ts index fc63a960bc..0613e585c5 100644 --- a/packages/angular-test-app/src/preview-examples/button-text-icon.ts +++ b/packages/angular-test-app/src/preview-examples/button-text-icon.ts @@ -12,20 +12,21 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: buttonTextIcon(), + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} function buttonTextIcon(): string | undefined { return ` - + Button - + Button - + Button - + Button `; diff --git a/packages/angular-test-app/src/preview-examples/button-with-icon.html b/packages/angular-test-app/src/preview-examples/button-with-icon.html new file mode 100644 index 0000000000..48e49302fa --- /dev/null +++ b/packages/angular-test-app/src/preview-examples/button-with-icon.html @@ -0,0 +1,22 @@ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + +
diff --git a/packages/angular-test-app/src/preview-examples/button-with-icon.ts b/packages/angular-test-app/src/preview-examples/button-with-icon.ts index a85e1be016..b1d6237ed9 100644 --- a/packages/angular-test-app/src/preview-examples/button-with-icon.ts +++ b/packages/angular-test-app/src/preview-examples/button-with-icon.ts @@ -11,45 +11,7 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', - template: ` -
- - - - -
- -
- - - - -
- -
- - - - -
- `, + templateUrl: './button-with-icon.html', + styles: [`@import 'example-styles/dist/icon-button.css';`], }) export default class ButtonWithIcon {} diff --git a/packages/angular-test-app/src/preview-examples/buttons.ts b/packages/angular-test-app/src/preview-examples/buttons.ts index 026125e827..1b991ce21d 100644 --- a/packages/angular-test-app/src/preview-examples/buttons.ts +++ b/packages/angular-test-app/src/preview-examples/buttons.ts @@ -12,8 +12,9 @@ import { Component } from '@angular/core'; @Component({ selector: 'app-example', template: ` - Button - Button + Button + Button `, + styles: [`@import 'example-styles/dist/buttons.css';`], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-ghost.ts b/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-ghost.ts index 1b50046308..aa66eacdaa 100644 --- a/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-ghost.ts @@ -30,5 +30,10 @@ import { Component } from '@angular/core'; loading > `, + styles: [ + ` + @import 'example-styles/dist/icon-toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-outline.ts b/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-outline.ts index d51940d9d2..aa7ebd8420 100644 --- a/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-outline.ts +++ b/packages/angular-test-app/src/preview-examples/icon-toggle-button-primary-outline.ts @@ -30,5 +30,10 @@ import { Component } from '@angular/core'; loading > `, + styles: [ + ` + @import 'example-styles/dist/icon-toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-ghost.ts b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-ghost.ts index 528f81f1fa..257cd16503 100644 --- a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-ghost.ts @@ -15,11 +15,12 @@ import { Component } from '@angular/core'; - + `, + styles: [ + ` + @import 'example-styles/dist/icon-toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-outline.ts b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-outline.ts index 4ce5240880..7516f86e46 100644 --- a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-outline.ts +++ b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary-outline.ts @@ -37,5 +37,10 @@ import { Component } from '@angular/core'; loading > `, + styles: [ + ` + @import 'example-styles/dist/icon-toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary.ts b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary.ts index 4d9bbe94a5..b8e7a4de92 100644 --- a/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary.ts +++ b/packages/angular-test-app/src/preview-examples/icon-toggle-button-secondary.ts @@ -17,5 +17,10 @@ import { Component } from '@angular/core'; `, + styles: [ + ` + @import 'example-styles/dist/icon-toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/modal-by-template.ts b/packages/angular-test-app/src/preview-examples/modal-by-template.ts index 09633767bf..5ab32f993e 100644 --- a/packages/angular-test-app/src/preview-examples/modal-by-template.ts +++ b/packages/angular-test-app/src/preview-examples/modal-by-template.ts @@ -16,7 +16,7 @@ import { ModalService } from '@siemens/ix-angular'; Show modal -
+ Message headline Message text lorem ipsum: {{ modal.data }} -
+
`, }) diff --git a/packages/angular-test-app/src/preview-examples/toggle-button-primary-ghost.ts b/packages/angular-test-app/src/preview-examples/toggle-button-primary-ghost.ts index 21828d8630..67aceab338 100644 --- a/packages/angular-test-app/src/preview-examples/toggle-button-primary-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/toggle-button-primary-ghost.ts @@ -23,5 +23,10 @@ import { Component } from '@angular/core'; Loading `, + styles: [ + ` + @import 'example-styles/dist/toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/toggle-button-primary-outline.ts b/packages/angular-test-app/src/preview-examples/toggle-button-primary-outline.ts index dd44bfaa40..18bb089cc9 100644 --- a/packages/angular-test-app/src/preview-examples/toggle-button-primary-outline.ts +++ b/packages/angular-test-app/src/preview-examples/toggle-button-primary-outline.ts @@ -23,5 +23,10 @@ import { Component } from '@angular/core'; Loading `, + styles: [ + ` + @import 'example-styles/dist/toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/toggle-button-secondary-ghost.ts b/packages/angular-test-app/src/preview-examples/toggle-button-secondary-ghost.ts index c0ea61e7b3..0bb5e6734e 100644 --- a/packages/angular-test-app/src/preview-examples/toggle-button-secondary-ghost.ts +++ b/packages/angular-test-app/src/preview-examples/toggle-button-secondary-ghost.ts @@ -17,5 +17,10 @@ import { Component } from '@angular/core'; Disabled Loading `, + styles: [ + ` + @import 'example-styles/dist/toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/toggle-button-secondary-outline.ts b/packages/angular-test-app/src/preview-examples/toggle-button-secondary-outline.ts index 24dc172b76..2e69fba946 100644 --- a/packages/angular-test-app/src/preview-examples/toggle-button-secondary-outline.ts +++ b/packages/angular-test-app/src/preview-examples/toggle-button-secondary-outline.ts @@ -17,5 +17,10 @@ import { Component } from '@angular/core'; Disabled Loading `, + styles: [ + ` + @import 'example-styles/dist/toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/preview-examples/toggle-button-secondary.ts b/packages/angular-test-app/src/preview-examples/toggle-button-secondary.ts index 518e5431ec..a52ab3721f 100644 --- a/packages/angular-test-app/src/preview-examples/toggle-button-secondary.ts +++ b/packages/angular-test-app/src/preview-examples/toggle-button-secondary.ts @@ -17,5 +17,10 @@ import { Component } from '@angular/core'; Disabled Loading `, + styles: [ + ` + @import 'example-styles/dist/toggle-buttons.css'; + `, + ], }) export default class Buttons {} diff --git a/packages/angular-test-app/src/styles.scss b/packages/angular-test-app/src/styles.scss index 394bded725..b2942d7173 100644 --- a/packages/angular-test-app/src/styles.scss +++ b/packages/angular-test-app/src/styles.scss @@ -7,17 +7,4 @@ * LICENSE file in the root directory of this source tree. */ -/* You can add global styles to this file, and also import other style files */ - -@import 'ag-grid-community/styles/ag-grid.css'; -@import 'ag-grid-community/styles/ag-theme-alpine.css'; - -@import '@siemens/ix-aggrid/dist/ix-aggrid/ix-aggrid.css'; -@import '@siemens/ix/dist/siemens-ix/siemens-ix.css'; - -@import './preview-examples/placeholder-logo.css'; - -body { - height: 100vh; - width: 100vw; -} +@import 'example-styles/dist/global.css'; diff --git a/packages/angular-test-app/tsconfig.json b/packages/angular-test-app/tsconfig.json index 66c6ad914d..bf4b8f39e5 100644 --- a/packages/angular-test-app/tsconfig.json +++ b/packages/angular-test-app/tsconfig.json @@ -21,7 +21,7 @@ "module": "es2020", "lib": ["es2020", "dom"], "preserveSymlinks": true, - "skipLibCheck": false, + "skipLibCheck": true, "paths": { "@angular/*": ["./node_modules/@angular"], "@siemens/ix-angular": ["./../angular/dist"], diff --git a/packages/angular/CHANGELOG.md b/packages/angular/CHANGELOG.md index dc0831e2f2..9095198da5 100644 --- a/packages/angular/CHANGELOG.md +++ b/packages/angular/CHANGELOG.md @@ -1,5 +1,12 @@ # @siemens/ix-angular +## 2.2.1 + +### Patch Changes + +- Updated dependencies [[`b38d2d3506`](https://github.com/siemens/ix/commit/b38d2d350656034ef1926fdcf5db2ca9d4251403), [`707252448c`](https://github.com/siemens/ix/commit/707252448c470b1cf8a78f696146fddd55050336)]: + - @siemens/ix@2.2.1 + ## 2.2.0 ### Minor Changes diff --git a/packages/angular/package.json b/packages/angular/package.json index 83d6a04f9a..590e43d7d0 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/siemens/ix", "directory": "packages/angular" }, - "version": "2.2.0", + "version": "2.2.1", "description": "Siemens iX for Angular", "scripts": { "build": "ng-packagr -c tsconfig.json", @@ -16,7 +16,7 @@ }, "license": "MIT", "dependencies": { - "@siemens/ix": "~2.2.0" + "@siemens/ix": "~2.2.1" }, "peerDependencies": { "@angular/core": ">=13.4.0", @@ -30,10 +30,11 @@ "@angular/core": "v13-lts", "@angular/forms": "v13-lts", "@jest/globals": "^29.3.1", - "@siemens/ix": "~2.2.0", + "@siemens/ix": "~2.2.1", "@types/jest": "^29.2.3", "fs-extra": "^10.1.0", "jest": "^29.3.1", + "rxjs": "^7.4.0", "jest-preset-angular": "^12.2.3", "ng-packagr": "^14.2.0", "ts-jest": "^29.0.3", diff --git a/packages/angular/src/components.ts b/packages/angular/src/components.ts index 964f1e9ba4..e11111c66b 100644 --- a/packages/angular/src/components.ts +++ b/packages/angular/src/components.ts @@ -482,7 +482,7 @@ export declare interface IxContentHeader extends Components.IxContentHeader { @ProxyCmp({ - inputs: ['customRangeAllowed', 'dateRangeId', 'dateRangeOptions', 'format', 'from', 'i18nCustomItem', 'i18nDone', 'i18nNoRange', 'maxDate', 'minDate', 'range', 'to'], + inputs: ['customRangeAllowed', 'dateRangeId', 'dateRangeOptions', 'disabled', 'format', 'from', 'i18nCustomItem', 'i18nDone', 'i18nNoRange', 'maxDate', 'minDate', 'range', 'to'], methods: ['getDateRange'] }) @Component({ @@ -490,7 +490,7 @@ export declare interface IxContentHeader extends Components.IxContentHeader { changeDetection: ChangeDetectionStrategy.OnPush, template: '', // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property - inputs: ['customRangeAllowed', 'dateRangeId', 'dateRangeOptions', 'format', 'from', 'i18nCustomItem', 'i18nDone', 'i18nNoRange', 'maxDate', 'minDate', 'range', 'to'], + inputs: ['customRangeAllowed', 'dateRangeId', 'dateRangeOptions', 'disabled', 'format', 'from', 'i18nCustomItem', 'i18nDone', 'i18nNoRange', 'maxDate', 'minDate', 'range', 'to'], }) export class IxDateDropdown { protected el: HTMLElement; diff --git a/packages/angular/src/modal/modal.service.spec.ts b/packages/angular/src/modal/modal.service.spec.ts index 97a760f4a8..b70c33dab4 100644 --- a/packages/angular/src/modal/modal.service.spec.ts +++ b/packages/angular/src/modal/modal.service.spec.ts @@ -68,7 +68,7 @@ test('should create modal by component typ', async () => { }, injector: { get: jest.fn(() => ({ - nativeElement: {} + nativeElement: { style: {} } })), }, })), diff --git a/packages/angular/src/modal/modal.service.ts b/packages/angular/src/modal/modal.service.ts index 7f73249833..7e1a7c0a41 100644 --- a/packages/angular/src/modal/modal.service.ts +++ b/packages/angular/src/modal/modal.service.ts @@ -85,6 +85,7 @@ export class ModalService { this.appRef.attachView(instance.hostView); const element = instance.injector.get(ElementRef); + element.nativeElement.style.display = 'contents'; const modalInstance = await this.createModalInstance( context, diff --git a/packages/core/.eslintignore b/packages/core/.eslintignore new file mode 100644 index 0000000000..6a2148d724 --- /dev/null +++ b/packages/core/.eslintignore @@ -0,0 +1,2 @@ +playwright-ct.config.ts +playwright.config.ts diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 6d916a9c27..3ed4694a7f 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,13 @@ # @siemens/ix +## 2.2.1 + +### Patch Changes + +- [#1241](https://github.com/siemens/ix/pull/1241) [`b38d2d3506`](https://github.com/siemens/ix/commit/b38d2d350656034ef1926fdcf5db2ca9d4251403) Thanks [@nuke-ellington](https://github.com/nuke-ellington)! - fix(core/dropdown): add null check for trigger element + +- [#1237](https://github.com/siemens/ix/pull/1237) [`707252448c`](https://github.com/siemens/ix/commit/707252448c470b1cf8a78f696146fddd55050336) Thanks [@nuke-ellington](https://github.com/nuke-ellington)! - fix(core/input): update autofill styling + ## 2.2.0 ### Minor Changes diff --git a/packages/core/component-doc.json b/packages/core/component-doc.json index c84991159e..42a0c6e3ee 100644 --- a/packages/core/component-doc.json +++ b/packages/core/component-doc.json @@ -1414,10 +1414,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "ButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "ButtonVariant": { "location": "local", @@ -1430,9 +1430,18 @@ "attr": "variant", "reflectToAttr": false, "docs": "Button variant", - "docsTags": [], + "docsTags": [ + { + "name": "since", + "text": "2.3.0 - variant danger" + } + ], "default": "'primary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -3333,6 +3342,33 @@ "optional": false, "required": false }, + { + "name": "disabled", + "type": "boolean", + "complexType": { + "original": "boolean", + "resolved": "boolean", + "references": {} + }, + "mutable": false, + "attr": "disabled", + "reflectToAttr": false, + "docs": "Disable the button that opens the dropdown containing the date picker.", + "docsTags": [ + { + "name": "since", + "text": "2.3.0" + } + ], + "default": "false", + "values": [ + { + "type": "boolean" + } + ], + "optional": false, + "required": false + }, { "name": "format", "type": "string", @@ -5638,10 +5674,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "DropdownButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "DropdownButtonVariant": { "location": "local", @@ -5657,6 +5693,10 @@ "docsTags": [], "default": "'primary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -7740,10 +7780,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "IconButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "IconButtonVariant": { "location": "local", @@ -7756,9 +7796,18 @@ "attr": "variant", "reflectToAttr": false, "docs": "Variant of button", - "docsTags": [], + "docsTags": [ + { + "name": "since", + "text": "2.3.0 - variant danger" + } + ], "default": "'secondary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -7970,10 +8019,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "ButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "ButtonVariant": { "location": "import", @@ -7989,6 +8038,10 @@ "docsTags": [], "default": "'secondary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -9741,7 +9794,7 @@ "mutable": false, "attr": "label", "reflectToAttr": false, - "docs": "Label of first tab", + "docs": "Content of the header", "docsTags": [], "default": "'About & legal information'", "values": [ @@ -14001,10 +14054,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "SplitButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "SplitButtonVariant": { "location": "local", @@ -14020,6 +14073,10 @@ "docsTags": [], "default": "'primary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -15801,10 +15858,10 @@ }, { "name": "variant", - "type": "\"primary\" | \"secondary\"", + "type": "\"danger\" | \"primary\" | \"secondary\"", "complexType": { "original": "ButtonVariant", - "resolved": "\"primary\" | \"secondary\"", + "resolved": "\"danger\" | \"primary\" | \"secondary\"", "references": { "ButtonVariant": { "location": "import", @@ -15820,6 +15877,10 @@ "docsTags": [], "default": "'secondary'", "values": [ + { + "value": "danger", + "type": "string" + }, { "value": "primary", "type": "string" @@ -17483,7 +17544,7 @@ "path": "src/components/blind/blind.tsx" }, "src/components/button/button.tsx::ButtonVariant": { - "declaration": "export type ButtonVariant = 'primary' | 'secondary';", + "declaration": "export type ButtonVariant = 'danger' | 'primary' | 'secondary';", "docstring": "", "path": "src/components/button/button.tsx" }, @@ -17538,7 +17599,7 @@ "path": "src/components/datetime-picker/datetime-picker.tsx" }, "src/components/dropdown-button/dropdown-button.tsx::DropdownButtonVariant": { - "declaration": "export type ButtonVariant = 'primary' | 'secondary';", + "declaration": "export type ButtonVariant = 'danger' | 'primary' | 'secondary';", "docstring": "", "path": "src/components/dropdown-button/dropdown-button.tsx" }, @@ -17553,7 +17614,7 @@ "path": "src/components/empty-state/empty-state.tsx" }, "src/components/icon-button/icon-button.tsx::IconButtonVariant": { - "declaration": "export type ButtonVariant = 'primary' | 'secondary';", + "declaration": "export type ButtonVariant = 'danger' | 'primary' | 'secondary';", "docstring": "", "path": "src/components/icon-button/icon-button.tsx" }, @@ -17613,7 +17674,7 @@ "path": "src/components/slider/slider.tsx" }, "src/components/split-button/split-button.tsx::SplitButtonVariant": { - "declaration": "export type ButtonVariant = 'primary' | 'secondary';", + "declaration": "export type ButtonVariant = 'danger' | 'primary' | 'secondary';", "docstring": "", "path": "src/components/split-button/split-button.tsx" }, diff --git a/packages/core/package.json b/packages/core/package.json index 2db31c99f3..dc9bad5dfb 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/siemens/ix", "directory": "packages/core" }, - "version": "2.2.0", + "version": "2.2.1", "license": "MIT", "description": "Siemens iX Web Components", "main": "dist/index.cjs.js", diff --git a/packages/core/playwright-ct.config.ts b/packages/core/playwright-ct.config.ts index 755d907210..59ba8c6da3 100644 --- a/packages/core/playwright-ct.config.ts +++ b/packages/core/playwright-ct.config.ts @@ -28,6 +28,7 @@ const config: PlaywrightTestConfig = { }, }, ], + retries: 2, }; export default config; diff --git a/packages/core/scss/components/form/_input.scss b/packages/core/scss/components/form/_input.scss index 61a59e5674..fb3e5f3292 100644 --- a/packages/core/scss/components/form/_input.scss +++ b/packages/core/scss/components/form/_input.scss @@ -10,8 +10,7 @@ @import 'mixins/fonts'; @mixin element-input($feature-read-only: true) { - &, - &:-webkit-autofill { + & { @include typography-body; min-height: 2rem; width: 100%; @@ -25,10 +24,14 @@ box-shadow: var(--theme-input--box-shadow); } - &:-webkit-autofill { - -webkit-box-shadow: 0 0 0 1000px var(--theme-input--background) inset !important; - -webkit-text-fill-color: var(--theme-input--color) !important; - border-color: var(--theme-input--border-color) !important; + &:-webkit-autofill, + &:autofill { + -webkit-box-shadow: 0 0 0 1000px var(--theme-color-component-info) inset !important; + -webkit-text-fill-color: var(--theme-input--color--autofill) !important; + background-color: var(--theme-input--background--autofill) !important; + border: var(--theme-input--border-thickness, 1px) solid + var(--theme-input--border-color--autofill) !important; + color: var(--theme-input--color--autofill) !important; } &::placeholder { @@ -37,7 +40,7 @@ &.hover, &:hover { - border-color: var(--theme-input--border-color--hover); + border-color: var(--theme-input--border-color--hover) !important; background-color: var(--theme-input--background--hover); } @@ -45,7 +48,7 @@ &:focus { outline: 1px solid var(--theme-color-focus-bdr); outline-offset: var(--theme-input--focus--outline-offset); - border-color: var(--theme-input--border-color--focus); + border-color: var(--theme-input--border-color--focus) !important; } @if $feature-read-only == true { diff --git a/packages/core/scss/theme/classic-dark/_color.scss b/packages/core/scss/theme/classic-dark/_color.scss index 3c454e16b2..34d503f991 100644 --- a/packages/core/scss/theme/classic-dark/_color.scss +++ b/packages/core/scss/theme/classic-dark/_color.scss @@ -863,5 +863,41 @@ --theme-btn-outline-primary--border-color--active: var(--theme-color-dynamic); --theme-btn-outline-primary--border-color--disabled: var(--theme-color-component-4); --theme-table-selection--border-color: var(--theme-color-0); + --theme-btn-danger--background: var(--theme-color-alarm); + --theme-btn-danger--background--hover: var(--theme-color-alarm--hover); + --theme-btn-danger--background--active: var(--theme-color-alarm--active); + --theme-btn-danger--background--disabled: var(--theme-color-component-4); + --theme-btn-danger--color: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--hover: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--active: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--disabled: var(--theme-color-primary--contrast); + --theme-btn-danger--border-color: var(--theme-color-0); + --theme-btn-danger--border-color--hover: var(--theme-color-0); + --theme-btn-danger--border-color--active: var(--theme-color-0); + --theme-btn-danger--border-color--disabled: var(--theme-color-0); + --theme-btn-outline-danger--background: var(--theme-color-1); + --theme-btn-outline-danger--background--hover: var(--theme-color-1--hover); + --theme-btn-outline-danger--background--active: var(--theme-color-1--active); + --theme-btn-outline-danger--background--disabled: var(--theme-color-ghost); + --theme-btn-outline-danger--color: var(--theme-color-alarm); + --theme-btn-outline-danger--color--hover: var(--theme-color-alarm--hover); + --theme-btn-outline-danger--color--active: var(--theme-color-alarm--active); + --theme-btn-outline-danger--color--disabled: var(--theme-color-weak-text); + --theme-btn-outline-danger--border-color: var(--theme-color-alarm); + --theme-btn-outline-danger--border-color--hover: var(--theme-color-alarm--hover); + --theme-btn-outline-danger--border-color--active: var(--theme-color-alarm--active); + --theme-btn-outline-danger--border-color--disabled: var(--theme-color-component-4); + --theme-btn-invisible-danger--background: var(--theme-color-ghost); + --theme-btn-invisible-danger--background--hover: var(--theme-color-ghost--hover); + --theme-btn-invisible-danger--background--active: var(--theme-color-ghost--active); + --theme-btn-invisible-danger--background--disabled: var(--theme-color-ghost); + --theme-btn-invisible-danger--color: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--hover: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--active: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--disabled: var(--theme-color-weak-text); + --theme-btn-invisible-danger--border-color: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--hover: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--active: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--disabled: var(--theme-color-0); } } \ No newline at end of file diff --git a/packages/core/scss/theme/classic-light/_color.scss b/packages/core/scss/theme/classic-light/_color.scss index 39c98d413a..084094930d 100644 --- a/packages/core/scss/theme/classic-light/_color.scss +++ b/packages/core/scss/theme/classic-light/_color.scss @@ -863,5 +863,41 @@ --theme-btn-outline-primary--border-color--active: var(--theme-color-dynamic); --theme-btn-outline-primary--border-color--disabled: var(--theme-color-component-4); --theme-table-selection--border-color: var(--theme-color-0); + --theme-btn-danger--background: var(--theme-color-alarm); + --theme-btn-danger--background--hover: var(--theme-color-alarm--hover); + --theme-btn-danger--background--active: var(--theme-color-alarm--active); + --theme-btn-danger--background--disabled: var(--theme-color-component-4); + --theme-btn-danger--color: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--hover: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--active: var(--theme-color-alarm--contrast); + --theme-btn-danger--color--disabled: var(--theme-color-primary--contrast); + --theme-btn-danger--border-color: var(--theme-color-0); + --theme-btn-danger--border-color--hover: var(--theme-color-0); + --theme-btn-danger--border-color--active: var(--theme-color-0); + --theme-btn-danger--border-color--disabled: var(--theme-color-0); + --theme-btn-outline-danger--background: var(--theme-color-1); + --theme-btn-outline-danger--background--hover: var(--theme-color-1--hover); + --theme-btn-outline-danger--background--active: var(--theme-color-1--active); + --theme-btn-outline-danger--background--disabled: var(--theme-color-ghost); + --theme-btn-outline-danger--color: var(--theme-color-alarm); + --theme-btn-outline-danger--color--hover: var(--theme-color-alarm--hover); + --theme-btn-outline-danger--color--active: var(--theme-color-alarm--active); + --theme-btn-outline-danger--color--disabled: var(--theme-color-weak-text); + --theme-btn-outline-danger--border-color: var(--theme-color-alarm); + --theme-btn-outline-danger--border-color--hover: var(--theme-color-alarm--hover); + --theme-btn-outline-danger--border-color--active: var(--theme-color-alarm--active); + --theme-btn-outline-danger--border-color--disabled: var(--theme-color-component-4); + --theme-btn-invisible-danger--background: var(--theme-color-ghost); + --theme-btn-invisible-danger--background--hover: var(--theme-color-ghost--hover); + --theme-btn-invisible-danger--background--active: var(--theme-color-ghost--active); + --theme-btn-invisible-danger--background--disabled: var(--theme-color-ghost); + --theme-btn-invisible-danger--color: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--hover: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--active: var(--theme-color-alarm-text); + --theme-btn-invisible-danger--color--disabled: var(--theme-color-weak-text); + --theme-btn-invisible-danger--border-color: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--hover: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--active: var(--theme-color-0); + --theme-btn-invisible-danger--border-color--disabled: var(--theme-color-0); } } \ No newline at end of file diff --git a/packages/core/src/components.d.ts b/packages/core/src/components.d.ts index 04a1592d23..b41ddcd773 100644 --- a/packages/core/src/components.d.ts +++ b/packages/core/src/components.d.ts @@ -276,6 +276,7 @@ export namespace Components { "type": 'button' | 'submit'; /** * Button variant + * @since 2.3.0 - variant danger */ "variant": ButtonVariant; } @@ -531,6 +532,11 @@ export namespace Components { * An array of predefined date range options for the date picker. Each option is an object with a label describing the range and a function that returns the start and end dates of the range as a DateRangeOption object. Example format: { id: 'some unique id', label: 'Name of the range', from: undefined, to: '2023/03/29' }, // ... other predefined date range options ... */ "dateRangeOptions": DateDropdownOption[]; + /** + * Disable the button that opens the dropdown containing the date picker. + * @since 2.3.0 + */ + "disabled": boolean; /** * Date format string. See * @link https://moment.github.io/luxon/#/formatting?id=table-of-tokens for all available tokens. @@ -797,6 +803,7 @@ export namespace Components { * An optional header shown at the top of the dropdown */ "header"?: string; + "ignoreRelatedSubmenu": boolean; /** * Move dropdown along main axis of alignment */ @@ -1156,6 +1163,7 @@ export namespace Components { "type": 'button' | 'submit'; /** * Variant of button + * @since 2.3.0 - variant danger */ "variant": IconButtonVariant; } @@ -1405,7 +1413,7 @@ export namespace Components { */ "activeTabLabel": string; /** - * Label of first tab + * Content of the header */ "label": string; /** @@ -4298,6 +4306,7 @@ declare namespace LocalJSX { "type"?: 'button' | 'submit'; /** * Button variant + * @since 2.3.0 - variant danger */ "variant"?: ButtonVariant; } @@ -4591,6 +4600,11 @@ declare namespace LocalJSX { * An array of predefined date range options for the date picker. Each option is an object with a label describing the range and a function that returns the start and end dates of the range as a DateRangeOption object. Example format: { id: 'some unique id', label: 'Name of the range', from: undefined, to: '2023/03/29' }, // ... other predefined date range options ... */ "dateRangeOptions"?: DateDropdownOption[]; + /** + * Disable the button that opens the dropdown containing the date picker. + * @since 2.3.0 + */ + "disabled"?: boolean; /** * Date format string. See * @link https://moment.github.io/luxon/#/formatting?id=table-of-tokens for all available tokens. @@ -4895,6 +4909,7 @@ declare namespace LocalJSX { * An optional header shown at the top of the dropdown */ "header"?: string; + "ignoreRelatedSubmenu"?: boolean; /** * Move dropdown along main axis of alignment */ @@ -5282,6 +5297,7 @@ declare namespace LocalJSX { "type"?: 'button' | 'submit'; /** * Variant of button + * @since 2.3.0 - variant danger */ "variant"?: IconButtonVariant; } @@ -5515,7 +5531,7 @@ declare namespace LocalJSX { */ "activeTabLabel"?: string; /** - * Label of first tab + * Content of the header */ "label"?: string; /** diff --git a/packages/core/src/components/blind/blind.scss b/packages/core/src/components/blind/blind.scss index 0e23d95c41..ab8051eb12 100644 --- a/packages/core/src/components/blind/blind.scss +++ b/packages/core/src/components/blind/blind.scss @@ -132,7 +132,7 @@ .blind-header-title-row { display: flex; - width: 100%; + flex-grow: 1; overflow: hidden; } diff --git a/packages/core/src/components/button/base-button.tsx b/packages/core/src/components/button/base-button.tsx index 6dcbe77406..d0d4e1e81a 100644 --- a/packages/core/src/components/button/base-button.tsx +++ b/packages/core/src/components/button/base-button.tsx @@ -12,6 +12,10 @@ import { ButtonVariant } from './button'; export type ButtonAlignment = 'center' | 'start'; +const isDanger = (variant: string) => { + return variant.toUpperCase() === 'Danger'.toUpperCase(); +}; + const isPrimary = (variant: string) => { return variant.toUpperCase() === 'Primary'.toUpperCase(); }; @@ -31,6 +35,9 @@ export const getButtonClasses = ( ) => { return { btn: true, + 'btn-danger': isDanger(variant) && !outline && !ghost, + 'btn-outline-danger': isDanger(variant) && outline && !ghost, + 'btn-invisible-danger': isDanger(variant) && !outline && ghost, 'btn-primary': isPrimary(variant) && !outline && !ghost, 'btn-outline-primary': isPrimary(variant) && outline && !ghost, 'btn-invisible-primary': isPrimary(variant) && !outline && ghost, @@ -65,12 +72,32 @@ export type BaseButtonProps = { afterContent?: any; }; +const getSpinnerSize = (btnProps: BaseButtonProps) => { + if (!btnProps.icon) { + return 'small'; + } + + switch (btnProps.iconSize) { + case '12': + return 'xx-small'; + case '16': + return 'x-small'; + default: + return 'small'; + } +}; + export function BaseButton(props: BaseButtonProps, children) { const extraClasses = props.extraClasses ?? {}; + const ariaAttributes = props.ariaAttributes ?? {}; + if (!ariaAttributes['aria-disabled'] && props.disabled) { + ariaAttributes['aria-disabled'] = 'true'; + } + return (