Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fc5a9f624 | ||
|
|
b49ba6bdfe | ||
|
|
58d9445139 | ||
|
|
86751985e9 | ||
|
|
b57a7c1d49 | ||
|
|
ac6968cc10 | ||
|
|
92ad4ca511 | ||
|
|
1899b49d25 | ||
|
|
aadf06c493 | ||
|
|
e9e6605862 | ||
|
|
ed13318209 | ||
|
|
e5ed8a10ed | ||
|
|
8b0769ce75 | ||
|
|
2229c24bf5 | ||
|
|
a6b19f40b2 | ||
|
|
d91edcffdf | ||
|
|
4c1d0127b6 | ||
|
|
7075808ba8 | ||
|
|
67a1800094 | ||
|
|
895ef4798e | ||
|
|
f1e6a4bb71 | ||
|
|
a671b74756 | ||
|
|
b9013c9457 | ||
|
|
dc764e45e9 | ||
|
|
1cd81b9230 | ||
|
|
05026c5a48 | ||
|
|
a2e803a553 | ||
|
|
56265e35d1 | ||
|
|
95a7d710e7 | ||
|
|
a00a389df7 | ||
|
|
a62d382171 | ||
|
|
8d39ea0c6e | ||
|
|
e4c042834c | ||
|
|
6203b88b9f | ||
|
|
fdb77960ad | ||
|
|
227d637998 | ||
|
|
cbb4ad5683 | ||
|
|
75f6c05fb9 | ||
|
|
d5627c7368 | ||
|
|
74cd71af24 | ||
|
|
30d1910d6e | ||
|
|
b154f4ed09 | ||
|
|
d25b8a34f2 | ||
|
|
244f9a1dd6 | ||
|
|
ffcf5d0268 | ||
|
|
759147fab6 | ||
|
|
dc713167f9 | ||
|
|
0f7dd51767 | ||
|
|
31c5416a51 | ||
|
|
baed34722b | ||
|
|
708d5845b9 | ||
|
|
5780a95a9c | ||
|
|
dd68369338 |
67
.github/ionic-issue-bot.yml
vendored
@@ -56,14 +56,6 @@ closeAndLock:
|
||||
bug reports and feature requests. Please use our [forum](https://forum.ionicframework.com) for questions about the framework.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: appflow"
|
||||
message: >
|
||||
Thanks for the issue! This issue appears to be related to Ionic Appflow. We use this issue tracker exclusively for
|
||||
bug reports and feature requests. Please use the [Ionic Appflow Support Forum](https://ionic.zendesk.com/hc/en-us/requests/new)
|
||||
to report this issue.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: missing template"
|
||||
message: >
|
||||
@@ -145,65 +137,6 @@ noReproduction:
|
||||
lock: true
|
||||
dryRun: false
|
||||
|
||||
wrongRepo:
|
||||
repos:
|
||||
- label: "ionitron: capacitor"
|
||||
repo: capacitor
|
||||
message: >
|
||||
Thanks for the issue! We use this issue tracker exclusively for bug reports and feature requests
|
||||
associated with the Ionic Framework. It appears that this issue is associated with Capacitor.
|
||||
I am moving this issue to the Capacitor repository. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: v3"
|
||||
repo: ionic-v3
|
||||
message: >
|
||||
Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository.
|
||||
I am moving this issue to the repository for Ionic 3. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: cli"
|
||||
repo: ionic-cli
|
||||
message: >
|
||||
Thanks for the issue! We use this issue tracker exclusively for bug reports and feature requests
|
||||
associated with the Ionic Framework. It appears that this issue is associated with the Ionic CLI.
|
||||
I am moving this issue to the Ionic CLI repository. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: docs"
|
||||
repo: ionic-docs
|
||||
message: >
|
||||
Thanks for the issue! We use this issue tracker exclusively for bug reports and feature requests
|
||||
associated with the Ionic Framework. It appears that this issue is associated with the Ionic Documentation.
|
||||
I am moving this issue to the Ionic Docs repository. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: stencil"
|
||||
repo: stencil
|
||||
message: >
|
||||
Thanks for the issue! We use this issue tracker exclusively for bug reports and feature requests
|
||||
associated with the Ionic Framework. It appears that this issue is associated with Stencil.
|
||||
I am moving this issue to the Stencil repository. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
- label: "ionitron: native"
|
||||
repo: ionic-native
|
||||
message: >
|
||||
Thanks for the issue! We use this issue tracker exclusively for bug reports and feature requests
|
||||
associated with the Ionic Framework. It appears that this issue is associated with Ionic Native.
|
||||
I am moving this issue to the Ionic Native repository. Please track this issue over there.
|
||||
|
||||
|
||||
Thank you for using Ionic!
|
||||
close: true
|
||||
lock: true
|
||||
dryRun: false
|
||||
|
||||
screenshot:
|
||||
appId: 18001
|
||||
checkName: "build"
|
||||
|
||||
@@ -8,7 +8,7 @@ inputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
@@ -29,4 +29,4 @@ runs:
|
||||
with:
|
||||
name: ionic-core
|
||||
output: core/CoreBuild.zip
|
||||
paths: core/dist core/components core/src/foundations core/css core/hydrate core/loader core/src/components.d.ts
|
||||
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts
|
||||
|
||||
@@ -8,7 +8,7 @@ inputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
@@ -31,4 +31,6 @@ runs:
|
||||
with:
|
||||
name: ionic-core
|
||||
output: core/CoreBuild.zip
|
||||
paths: core/dist core/components core/src/foundations core/css core/hydrate core/loader core/src/components.d.ts core/api.txt
|
||||
# Include generated proxy files from Stencil output targets so
|
||||
# framework builds can detect when they need to be updated
|
||||
paths: core/dist core/components core/css core/hydrate core/loader core/src/components.d.ts core/api.txt packages/angular/src/directives/proxies.ts packages/angular/src/directives/proxies-list.ts packages/angular/standalone/src/directives/proxies.ts packages/vue/src/proxies.ts packages/react/src/components/proxies.ts packages/react/src/components/inner-proxies.ts packages/react/src/components/routing-proxies.ts
|
||||
|
||||
@@ -10,7 +10,7 @@ inputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: ${{ inputs.name }}
|
||||
path: ${{ inputs.path }}
|
||||
|
||||
@@ -32,6 +32,10 @@ runs:
|
||||
run: npm install
|
||||
shell: bash
|
||||
working-directory: ./packages/angular/test/build/${{ inputs.app }}
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install
|
||||
shell: bash
|
||||
working-directory: ./packages/angular/test/build/${{ inputs.app }}
|
||||
- name: Sync Built Changes
|
||||
run: npm run sync
|
||||
shell: bash
|
||||
|
||||
@@ -10,7 +10,7 @@ runs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
path: ./artifacts
|
||||
- name: Extract Archives
|
||||
|
||||
30
.github/workflows/build.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
build-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-core
|
||||
with:
|
||||
ionicons-version: ${{ inputs.ionicons_npm_release_tag }}
|
||||
@@ -31,21 +31,21 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-clean-build
|
||||
|
||||
test-core-lint:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-lint
|
||||
|
||||
test-core-spec:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-spec
|
||||
|
||||
test-core-screenshot:
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-screenshot
|
||||
with:
|
||||
shard: ${{ matrix.shard }}
|
||||
@@ -90,14 +90,14 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-vue
|
||||
|
||||
build-vue-router:
|
||||
needs: [build-vue]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-vue-router
|
||||
|
||||
test-vue-e2e:
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
needs: [build-vue, build-vue-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-vue-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -126,14 +126,14 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-angular
|
||||
|
||||
build-angular-server:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-angular-server
|
||||
|
||||
test-angular-e2e:
|
||||
@@ -144,7 +144,7 @@ jobs:
|
||||
needs: [build-angular, build-angular-server]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-angular-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -162,14 +162,14 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-react
|
||||
|
||||
build-react-router:
|
||||
needs: [build-react]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-react-router
|
||||
|
||||
test-react-router-e2e:
|
||||
@@ -180,7 +180,7 @@ jobs:
|
||||
needs: [build-react, build-react-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-react-router-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -202,7 +202,7 @@ jobs:
|
||||
needs: [build-react, build-react-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-react-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
permissions:
|
||||
security-events: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: javascript
|
||||
|
||||
2
.github/workflows/conventional-commit.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
if: |
|
||||
!contains(github.event.pull_request.title, 'release') &&
|
||||
!contains(github.event.pull_request.title, 'chore')
|
||||
uses: amannn/action-semantic-pull-request@v5
|
||||
uses: amannn/action-semantic-pull-request@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
2
.github/workflows/dev-build.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
outputs:
|
||||
dev-hash: ${{ steps.create-dev-hash.outputs.DEV_HASH }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
# A 1 is required before the timestamp
|
||||
# as lerna will fail when there is a leading 0
|
||||
# See https://github.com/lerna/lerna/issues/2840
|
||||
|
||||
2
.github/workflows/nightly.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
outputs:
|
||||
nightly-hash: ${{ steps.create-nightly-hash.outputs.NIGHTLY_HASH }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
# A 1 is required before the timestamp
|
||||
# as lerna will fail when there is a leading 0
|
||||
# See https://github.com/lerna/lerna/issues/2840
|
||||
|
||||
16
.github/workflows/release-ionic.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
release-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/publish-npm
|
||||
with:
|
||||
scope: '@ionic/core'
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
needs: [release-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/docs built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
needs: [release-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
needs: [release-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
needs: [release-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -147,7 +147,7 @@ jobs:
|
||||
needs: [release-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -168,7 +168,7 @@ jobs:
|
||||
needs: [release-react]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
@@ -194,7 +194,7 @@ jobs:
|
||||
needs: [release-vue]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Restore @ionic/core built cache
|
||||
uses: ./.github/workflows/actions/download-archive
|
||||
with:
|
||||
|
||||
4
.github/workflows/release.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
needs: [release-ionic]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
token: ${{ secrets.IONITRON_TOKEN }}
|
||||
fetch-depth: 0
|
||||
@@ -76,7 +76,7 @@ jobs:
|
||||
needs: [finalize-release]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
# Pull the latest version of the reference
|
||||
# branch instead of the revision that triggered
|
||||
# the workflow otherwise we won't get the commit
|
||||
|
||||
30
.github/workflows/stencil-nightly.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
build-core-with-stencil-nightly:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-core-stencil-prerelease
|
||||
with:
|
||||
stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}
|
||||
@@ -35,21 +35,21 @@ jobs:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-clean-build
|
||||
|
||||
test-core-lint:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-lint
|
||||
|
||||
test-core-spec:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-spec
|
||||
with:
|
||||
stencil-version: ${{ inputs.npm_release_tag || 'nightly' }}
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-screenshot
|
||||
with:
|
||||
shard: ${{ matrix.shard }}
|
||||
@@ -100,14 +100,14 @@ jobs:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-vue
|
||||
|
||||
build-vue-router:
|
||||
needs: [build-vue]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-vue-router
|
||||
|
||||
test-vue-e2e:
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
needs: [build-vue, build-vue-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-vue-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -136,14 +136,14 @@ jobs:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-angular
|
||||
|
||||
build-angular-server:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-angular-server
|
||||
|
||||
test-angular-e2e:
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
needs: [build-angular, build-angular-server]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-angular-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -172,14 +172,14 @@ jobs:
|
||||
needs: [build-core-with-stencil-nightly]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-react
|
||||
|
||||
build-react-router:
|
||||
needs: [build-react]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-react-router
|
||||
|
||||
test-react-router-e2e:
|
||||
@@ -190,7 +190,7 @@ jobs:
|
||||
needs: [build-react, build-react-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-react-router-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
@@ -212,7 +212,7 @@ jobs:
|
||||
needs: [build-react, build-react-router]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-react-e2e
|
||||
with:
|
||||
app: ${{ matrix.apps }}
|
||||
|
||||
6
.github/workflows/update-screenshots.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
||||
build-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/build-core
|
||||
|
||||
test-core-screenshot:
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
needs: [build-core]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- uses: ./.github/workflows/actions/test-core-screenshot
|
||||
with:
|
||||
shard: ${{ matrix.shard }}
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-core-screenshot]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
# Normally, we could just push with the
|
||||
# default GITHUB_TOKEN, but that will
|
||||
# not cause the build workflow
|
||||
|
||||
287
BREAKING.md
@@ -4,31 +4,290 @@ This is a comprehensive list of the breaking changes introduced in the major ver
|
||||
|
||||
## Versions
|
||||
|
||||
- [Version 9.x](#version-9x)
|
||||
- [Version 8.x](./BREAKING_ARCHIVE/v8.md)
|
||||
- [Version 8.x](#version-8x)
|
||||
- [Version 7.x](./BREAKING_ARCHIVE/v7.md)
|
||||
- [Version 6.x](./BREAKING_ARCHIVE/v6.md)
|
||||
- [Version 5.x](./BREAKING_ARCHIVE/v5.md)
|
||||
- [Version 4.x](./BREAKING_ARCHIVE/v4.md)
|
||||
- [Legacy](https://github.com/ionic-team/ionic-v3/blob/master/CHANGELOG.md)
|
||||
|
||||
## Version 9.x
|
||||
## Version 8.x
|
||||
|
||||
- [Components](#version-9x-components)
|
||||
- [Button](#version-9x-button)
|
||||
- [Card](#version-9x-card)
|
||||
- [Chip](#version-9x-chip)
|
||||
- [Browser and Platform Support](#version-8x-browser-platform-support)
|
||||
- [Dark Mode](#version-8x-dark-mode)
|
||||
- [Global Styles](#version-8x-global-styles)
|
||||
- [Haptics](#version-8x-haptics)
|
||||
- [Components](#version-8x-components)
|
||||
- [Button](#version-8x-button)
|
||||
- [Checkbox](#version-8x-checkbox)
|
||||
- [Content](#version-8x-content)
|
||||
- [Datetime](#version-8x-datetime)
|
||||
- [Input](#version-8x-input)
|
||||
- [Item](#version-8x-item)
|
||||
- [Modal](#version-8x-modal)
|
||||
- [Nav](#version-8x-nav)
|
||||
- [Picker](#version-8x-picker)
|
||||
- [Progress bar](#version-8x-progress-bar)
|
||||
- [Radio](#version-8x-radio)
|
||||
- [Range](#version-8x-range)
|
||||
- [Searchbar](#version-8x-searchbar)
|
||||
- [Select](#version-8x-select)
|
||||
- [Textarea](#version-8x-textarea)
|
||||
- [Toggle](#version-8x-toggle)
|
||||
- [Framework Specific](#version-8x-framework-specific)
|
||||
- [Angular](#version-8x-angular)
|
||||
|
||||
<h2 id="version-9x-components">Components</h2>
|
||||
<h2 id="version-8x-browser-platform-support">Browser and Platform Support</h2>
|
||||
|
||||
<h4 id="version-9x-button">Button</h4>
|
||||
This section details the desktop browser, JavaScript framework, and mobile platform versions that are supported by Ionic 8.
|
||||
|
||||
- The `border-radius` of the `ios` and `md` button now defaults to `6px` and `999px` instead of `14px` and `4px`, respectively, in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"soft"` for `md` and override the `--border-radius` CSS variable for `ios` to `14px`, or set it to a different value entirely.
|
||||
**Minimum Browser Versions**
|
||||
| Desktop Browser | Supported Versions |
|
||||
| --------------- | ----------------- |
|
||||
| Chrome | 89+ |
|
||||
| Safari | 15+ |
|
||||
| Firefox | 75+ |
|
||||
| Edge | 89+ |
|
||||
|
||||
<h4 id="version-9x-card">Card</h4>
|
||||
**Minimum JavaScript Framework Versions**
|
||||
| Framework | Supported Version |
|
||||
| --------- | --------------------- |
|
||||
| Angular | 16+ |
|
||||
| React | 17+ |
|
||||
| Vue | 3.0.6+ |
|
||||
|
||||
- The `border-radius` of the `ios` and `md` card now defaults to `14px` and `12px` instead of `8px` and `4px`, respectively, in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"soft"`, or override the `--border-radius` CSS variable to specify a different value.
|
||||
**Minimum Mobile Platform Versions**
|
||||
| Platform | Supported Version |
|
||||
| -------- | ---------------------- |
|
||||
| iOS | 15+ |
|
||||
| Android | 5.1+ with Chromium 89+ |
|
||||
|
||||
<h4 id="version-9x-chip">Chip</h4>
|
||||
Ionic Framework v8 removes backwards support for CSS Animations in favor of the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). All minimum browser versions listed above support the Web Animations API.
|
||||
|
||||
- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `--border-radius` CSS variable to specify a different value.
|
||||
<h2 id="version-8x-dark-mode">Dark Mode</h2>
|
||||
|
||||
|
||||
In previous versions, it was recommended to define the dark palette in the following way:
|
||||
|
||||
```css
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
/* global app variables */
|
||||
}
|
||||
|
||||
.ios body {
|
||||
/* global ios app variables */
|
||||
}
|
||||
|
||||
.md body {
|
||||
/* global md app variables */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In Ionic Framework version 8, the dark palette is being distributed via css files that can be imported. Below is an example of importing a dark palette file in Angular:
|
||||
|
||||
```css
|
||||
/* @import '@ionic/angular/css/palettes/dark.always.css'; */
|
||||
/* @import "@ionic/angular/css/palettes/dark.class.css"; */
|
||||
@import "@ionic/angular/css/palettes/dark.system.css";
|
||||
```
|
||||
|
||||
By importing the `dark.system.css` file, the dark palette variables will be defined like the following:
|
||||
|
||||
```css
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
/* global app variables */
|
||||
}
|
||||
|
||||
:root.ios {
|
||||
/* global ios app variables */
|
||||
}
|
||||
|
||||
:root.md {
|
||||
/* global md app variables */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Notice that the dark palette is now applied to the `:root` selector instead of the `body` selector. The [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) selector represents the `<html>` element and is identical to the selector `html`, except that its specificity is higher.
|
||||
|
||||
While migrating to include the new dark palette files is unlikely to cause breaking changes, these new selectors can lead to unexpected overrides if custom CSS variables are being set on the `body` element. We recommend updating any instances where global application variables are set to target the `:root` selector instead.
|
||||
|
||||
For more information on the new dark palette files, refer to the [Dark Mode documentation](https://ionicframework.com/docs/theming/dark-mode).
|
||||
|
||||
<h2 id="version-8x-global-styles">Global Styles</h2>
|
||||
|
||||
<h4 id="version-8x-text-color">Text Color</h4>
|
||||
|
||||
The `core.css` file has been updated to set the text color on the `body` element:
|
||||
|
||||
```diff
|
||||
body {
|
||||
+ color: var(--ion-text-color);
|
||||
}
|
||||
```
|
||||
|
||||
This allows components to inherit the color properly when used outside of Ionic Framework and is required for custom themes to work properly. However, it may have unintentional side effects in apps if the color was not expected to inherit.
|
||||
|
||||
<h4 id="version-8x-dynamic-font">Dynamic Font</h4>
|
||||
|
||||
The `core.css` file has been updated to enable dynamic font scaling by default.
|
||||
|
||||
The `--ion-default-dynamic-font` variable has been removed and replaced with `--ion-dynamic-font`.
|
||||
|
||||
Developers who had previously chosen dynamic font scaling by activating it in their global stylesheets can revert to the default setting by removing their custom CSS. In doing so, their application will seamlessly continue utilizing dynamic font scaling as it did before. It's essential to note that altering the font-size of the html element should be avoided, as it may disrupt the proper functioning of dynamic font scaling.
|
||||
|
||||
Developers who want to disable dynamic font scaling can set `--ion-dynamic-font: initial;` in their global stylesheets. However, this is not recommended because it may introduce accessibility challenges for users who depend on enlarged font sizes.
|
||||
|
||||
For more information on the dynamic font, refer to the [Dynamic Font Scaling documentation](https://ionicframework.com/docs/layout/dynamic-font-scaling).
|
||||
|
||||
<h2 id="version-8x-haptics">Haptics</h2>
|
||||
|
||||
- Support for the Cordova Haptics plugin has been removed. Components that integrate with haptics, such as `ion-picker` and `ion-toggle`, will continue to function but will no longer play haptics in Cordova environments. Developers should migrate to Capacitor to continue to have haptics in these components.
|
||||
|
||||
<h2 id="version-8x-components">Components</h2>
|
||||
|
||||
<h4 id="version-8x-button">Button</h4>
|
||||
|
||||
- Button text now wraps by default. If this behavior is not desired, add the `ion-text-nowrap` class from the [CSS Utilities](https://ionicframework.com/docs/layout/css-utilities).
|
||||
|
||||
<h4 id="version-8x-checkbox">Checkbox</h4>
|
||||
|
||||
The `legacy` property and support for the legacy syntax, which involved placing an `ion-checkbox` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy checkbox syntax, refer to the [Checkbox documentation](https://ionicframework.com/docs/api/checkbox#migrating-from-legacy-checkbox-syntax).
|
||||
|
||||
<h4 id="version-8x-content">Content</h4>
|
||||
|
||||
- Content no longer sets the `--background` custom property when the `.outer-content` class is set on the host.
|
||||
|
||||
<h4 id="version-8x-datetime">Datetime</h4>
|
||||
|
||||
- The CSS shadow part for `month-year-button` has been changed to target a `button` element instead of `ion-item`. Developers should verify their UI renders as expected for the month/year toggle button inside of `ion-datetime`.
|
||||
- Developers using the CSS variables available on `ion-item` will need to migrate their CSS to use CSS properties. For example:
|
||||
```diff
|
||||
ion-datetime::part(month-year-button) {
|
||||
- --background: red;
|
||||
|
||||
+ background: red;
|
||||
}
|
||||
```
|
||||
|
||||
<h4 id="version-8x-input">Input</h4>
|
||||
|
||||
- `size` has been removed from the `ion-input` component. Developers should use CSS to specify the visible width of the input.
|
||||
- `accept` has been removed from the `ion-input` component. This was previously used in conjunction with the `type="file"`. However, the `file` value for `type` is not a valid value in Ionic Framework.
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-input` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy input syntax, refer to the [Input documentation](https://ionicframework.com/docs/api/input#migrating-from-legacy-input-syntax).
|
||||
|
||||
<h4 id="version-8x-item">Item</h4>
|
||||
|
||||
- The `helper` slot has been removed. Developers should use the `helperText` property on `ion-input` and `ion-textarea`.
|
||||
- The `error` slot has been removed. Developers should use the `errorText` property on `ion-input` and `ion-textarea`.
|
||||
- Counter functionality has been removed including the `counter` and `counterFormatter` properties. Developers should use the properties of the same name on `ion-input` and `ion-textarea`.
|
||||
- The `fill` property has been removed. Developers should use the property of the same name on `ion-input`, `ion-select`, and `ion-textarea`.
|
||||
- The `shape` property has been removed. Developers should use the property of the same name on `ion-input`, `ion-select`, and `ion-textarea`.
|
||||
- Item no longer automatically delegates focus to the first focusable element. While most developers should not need to make any changes to account for this update, usages of `ion-item` with interactive elements such as form controls (inputs, textareas, etc) should be evaluated to verify that interactions still work as expected.
|
||||
|
||||
<h5>CSS variables</h4>
|
||||
|
||||
The following deprecated CSS variables have been removed: `--highlight-height`, `--highlight-color-focused`, `--highlight-color-valid`, and `--highlight-color-invalid`. These variables were used on the bottom border highlight of an item when the form control inside of that item was focused. The form control syntax was [simplified in v7](https://ionic.io/blog/ionic-7-is-here#simplified-form-control-syntax) so that inputs, selects, and textareas would no longer be required to be used inside of an item.
|
||||
|
||||
If you have not yet migrated to the modern form control syntax, migration guides for each of the form controls that added a highlight to item can be found below:
|
||||
- [Input migration documentation](https://ionicframework.com/docs/api/input#migrating-from-legacy-input-syntax)
|
||||
- [Select migration documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax)
|
||||
- [Textarea migration documentation](https://ionicframework.com/docs/api/textarea#migrating-from-legacy-textarea-syntax)
|
||||
|
||||
Once all form controls are using the modern syntax, the same variables can be used to customize them from the form control itself:
|
||||
|
||||
| Name | Description |
|
||||
| ----------------------------| ----------------------------------------|
|
||||
| `--highlight-color-focused` | The color of the highlight when focused |
|
||||
| `--highlight-color-invalid` | The color of the highlight when invalid |
|
||||
| `--highlight-color-valid` | The color of the highlight when valid |
|
||||
| `--highlight-height` | The height of the highlight indicator |
|
||||
|
||||
The following styles for item:
|
||||
|
||||
```css
|
||||
ion-item {
|
||||
--highlight-color-focused: purple;
|
||||
--highlight-color-valid: blue;
|
||||
--highlight-color-invalid: orange;
|
||||
--highlight-height: 6px;
|
||||
}
|
||||
```
|
||||
|
||||
will instead be applied on the form controls:
|
||||
|
||||
```css
|
||||
ion-input,
|
||||
ion-textarea,
|
||||
ion-select {
|
||||
--highlight-color-focused: purple;
|
||||
--highlight-color-valid: blue;
|
||||
--highlight-color-invalid: orange;
|
||||
--highlight-height: 6px;
|
||||
}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The input and textarea components are scoped, which means they will automatically scope their CSS by appending each of the styles with an additional class at runtime. Overriding scoped selectors in CSS requires a [higher specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) selector. Targeting the `ion-input` or `ion-textarea` for customization will not work; therefore we recommend adding a class and customizing it that way.
|
||||
|
||||
<h4 id="version-8x-modal">Modal</h4>
|
||||
|
||||
- Detection for Capacitor <= 2 with applying status bar styles has been removed. Developers should ensure they are using Capacitor 3 or later when using the card modal presentation.
|
||||
|
||||
<h4 id="version-8x-nav">Nav</h4>
|
||||
|
||||
- `getLength` returns `Promise<number>` instead of `<number>`. This method was not previously available in Nav's TypeScript interface, but developers could still access it by casting Nav as `any`. Developers should ensure they `await` their `getLength` call before accessing the returned value.
|
||||
|
||||
<h4 id="version-8x-picker">Picker</h4>
|
||||
|
||||
- `ion-picker` and `ion-picker-column` have been renamed to `ion-picker-legacy` and `ion-picker-legacy-column`, respectively. This change was made to accommodate the new inline picker component while allowing developers to continue to use the legacy picker during this migration period.
|
||||
- Only the component names have been changed. Usages such as `ion-picker` or `IonPicker` should be changed to `ion-picker-legacy` and `IonPickerLegacy`, respectively.
|
||||
- Non-component usages such as `pickerController` or `useIonPicker` remain unchanged. The new picker displays inline with your page content and does not have equivalents for these non-component usages.
|
||||
|
||||
<h4 id="version-8x-progress-bar">Progress bar</h4>
|
||||
|
||||
- The `--buffer-background` CSS variable has been removed. Use `--background` instead.
|
||||
|
||||
<h4 id="version-8x-toast">Toast</h4>
|
||||
|
||||
- `cssClass` has been removed from the `ToastButton` interface. This was previously used to apply a custom class to the toast buttons. Developers can use the "button" shadow part to style the buttons.
|
||||
|
||||
For more information on styling toast buttons, refer to the [Toast Theming documentation](https://ionicframework.com/docs/api/toast#theming).
|
||||
|
||||
<h4 id="version-8x-radio">Radio</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-radio` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy radio syntax, refer to the [Radio documentation](https://ionicframework.com/docs/api/radio#migrating-from-legacy-radio-syntax).
|
||||
|
||||
<h4 id="version-8x-range">Range</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-range` inside of an `ion-item` with an `ion-label`, have been removed. Ionic will also no longer attempt to automatically associate form controls with sibling `<label>` elements as these label elements are now used inside the form control. Developers should provide a label (either visible text or `aria-label`) directly to the form control. For more information on migrating from the legacy range syntax, refer to the [Range documentation](https://ionicframework.com/docs/api/range#migrating-from-legacy-range-syntax).
|
||||
|
||||
<h4 id="version-8x-searchbar">Searchbar</h4>
|
||||
|
||||
- The `autocapitalize` property now defaults to `'off'`.
|
||||
|
||||
<h4 id="version-8x-select">Select</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-select` inside of an `ion-item` with an `ion-label`, have been removed. Ionic will also no longer attempt to automatically associate form controls with sibling `<label>` elements as these label elements are now used inside the form control. Developers should provide a label (either visible text or `aria-label`) directly to the form control. For more information on migrating from the legacy select syntax, refer to the [Select documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax).
|
||||
|
||||
<h4 id="version-8x-textarea">Textarea</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-textarea` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy textarea syntax, refer to the [Textarea documentation](https://ionicframework.com/docs/api/textarea#migrating-from-legacy-textarea-syntax).
|
||||
|
||||
<h4 id="version-8x-toggle">Toggle</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-toggle` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy toggle syntax, refer to the [Toggle documentation](https://ionicframework.com/docs/api/toggle#migrating-from-legacy-toggle-syntax).
|
||||
|
||||
<h2 id="version-8x-framework-specific">Framework Specific</h2>
|
||||
|
||||
<h4 id="version-8x-angular">Angular</h4>
|
||||
|
||||
- The `IonBackButtonDelegate` class has been removed in favor of `IonBackButton`.
|
||||
|
||||
```diff
|
||||
- import { IonBackButtonDelegate } from '@ionic/angular';
|
||||
+ import { IonBackButton } from '@ionic/angular';
|
||||
```
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
# Breaking Changes
|
||||
|
||||
## Version 8.x
|
||||
|
||||
- [Browser and Platform Support](#version-8x-browser-platform-support)
|
||||
- [Dark Mode](#version-8x-dark-mode)
|
||||
- [Global Styles](#version-8x-global-styles)
|
||||
- [Haptics](#version-8x-haptics)
|
||||
- [Components](#version-8x-components)
|
||||
- [Button](#version-8x-button)
|
||||
- [Checkbox](#version-8x-checkbox)
|
||||
- [Content](#version-8x-content)
|
||||
- [Datetime](#version-8x-datetime)
|
||||
- [Input](#version-8x-input)
|
||||
- [Item](#version-8x-item)
|
||||
- [Modal](#version-8x-modal)
|
||||
- [Nav](#version-8x-nav)
|
||||
- [Picker](#version-8x-picker)
|
||||
- [Progress bar](#version-8x-progress-bar)
|
||||
- [Radio](#version-8x-radio)
|
||||
- [Range](#version-8x-range)
|
||||
- [Searchbar](#version-8x-searchbar)
|
||||
- [Select](#version-8x-select)
|
||||
- [Textarea](#version-8x-textarea)
|
||||
- [Toggle](#version-8x-toggle)
|
||||
- [Framework Specific](#version-8x-framework-specific)
|
||||
- [Angular](#version-8x-angular)
|
||||
|
||||
<h2 id="version-8x-browser-platform-support">Browser and Platform Support</h2>
|
||||
|
||||
This section details the desktop browser, JavaScript framework, and mobile platform versions that are supported by Ionic 8.
|
||||
|
||||
**Minimum Browser Versions**
|
||||
| Desktop Browser | Supported Versions |
|
||||
| --------------- | ----------------- |
|
||||
| Chrome | 89+ |
|
||||
| Safari | 15+ |
|
||||
| Firefox | 75+ |
|
||||
| Edge | 89+ |
|
||||
|
||||
**Minimum JavaScript Framework Versions**
|
||||
| Framework | Supported Version |
|
||||
| --------- | --------------------- |
|
||||
| Angular | 16+ |
|
||||
| React | 17+ |
|
||||
| Vue | 3.0.6+ |
|
||||
|
||||
**Minimum Mobile Platform Versions**
|
||||
| Platform | Supported Version |
|
||||
| -------- | ---------------------- |
|
||||
| iOS | 15+ |
|
||||
| Android | 5.1+ with Chromium 89+ |
|
||||
|
||||
Ionic Framework v8 removes backwards support for CSS Animations in favor of the [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). All minimum browser versions listed above support the Web Animations API.
|
||||
|
||||
<h2 id="version-8x-dark-mode">Dark Mode</h2>
|
||||
|
||||
|
||||
In previous versions, it was recommended to define the dark palette in the following way:
|
||||
|
||||
```css
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
/* global app variables */
|
||||
}
|
||||
|
||||
.ios body {
|
||||
/* global ios app variables */
|
||||
}
|
||||
|
||||
.md body {
|
||||
/* global md app variables */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In Ionic Framework version 8, the dark palette is being distributed via css files that can be imported. Below is an example of importing a dark palette file in Angular:
|
||||
|
||||
```css
|
||||
/* @import '@ionic/angular/css/palettes/dark.always.css'; */
|
||||
/* @import "@ionic/angular/css/palettes/dark.class.css"; */
|
||||
@import "@ionic/angular/css/palettes/dark.system.css";
|
||||
```
|
||||
|
||||
By importing the `dark.system.css` file, the dark palette variables will be defined like the following:
|
||||
|
||||
```css
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
/* global app variables */
|
||||
}
|
||||
|
||||
:root.ios {
|
||||
/* global ios app variables */
|
||||
}
|
||||
|
||||
:root.md {
|
||||
/* global md app variables */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Notice that the dark palette is now applied to the `:root` selector instead of the `body` selector. The [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root) selector represents the `<html>` element and is identical to the selector `html`, except that its specificity is higher.
|
||||
|
||||
While migrating to include the new dark palette files is unlikely to cause breaking changes, these new selectors can lead to unexpected overrides if custom CSS variables are being set on the `body` element. We recommend updating any instances where global application variables are set to target the `:root` selector instead.
|
||||
|
||||
For more information on the new dark palette files, refer to the [Dark Mode documentation](https://ionicframework.com/docs/theming/dark-mode).
|
||||
|
||||
<h2 id="version-8x-global-styles">Global Styles</h2>
|
||||
|
||||
<h4 id="version-8x-text-color">Text Color</h4>
|
||||
|
||||
The `core.css` file has been updated to set the text color on the `body` element:
|
||||
|
||||
```diff
|
||||
body {
|
||||
+ color: var(--ion-text-color);
|
||||
}
|
||||
```
|
||||
|
||||
This allows components to inherit the color properly when used outside of Ionic Framework and is required for custom themes to work properly. However, it may have unintentional side effects in apps if the color was not expected to inherit.
|
||||
|
||||
<h4 id="version-8x-dynamic-font">Dynamic Font</h4>
|
||||
|
||||
The `core.css` file has been updated to enable dynamic font scaling by default.
|
||||
|
||||
The `--ion-default-dynamic-font` variable has been removed and replaced with `--ion-dynamic-font`.
|
||||
|
||||
Developers who had previously chosen dynamic font scaling by activating it in their global stylesheets can revert to the default setting by removing their custom CSS. In doing so, their application will seamlessly continue utilizing dynamic font scaling as it did before. It's essential to note that altering the font-size of the html element should be avoided, as it may disrupt the proper functioning of dynamic font scaling.
|
||||
|
||||
Developers who want to disable dynamic font scaling can set `--ion-dynamic-font: initial;` in their global stylesheets. However, this is not recommended because it may introduce accessibility challenges for users who depend on enlarged font sizes.
|
||||
|
||||
For more information on the dynamic font, refer to the [Dynamic Font Scaling documentation](https://ionicframework.com/docs/layout/dynamic-font-scaling).
|
||||
|
||||
<h2 id="version-8x-haptics">Haptics</h2>
|
||||
|
||||
- Support for the Cordova Haptics plugin has been removed. Components that integrate with haptics, such as `ion-picker` and `ion-toggle`, will continue to function but will no longer play haptics in Cordova environments. Developers should migrate to Capacitor to continue to have haptics in these components.
|
||||
|
||||
<h2 id="version-8x-components">Components</h2>
|
||||
|
||||
<h4 id="version-8x-button">Button</h4>
|
||||
|
||||
- Button text now wraps by default. If this behavior is not desired, add the `ion-text-nowrap` class from the [CSS Utilities](https://ionicframework.com/docs/layout/css-utilities).
|
||||
|
||||
<h4 id="version-8x-checkbox">Checkbox</h4>
|
||||
|
||||
The `legacy` property and support for the legacy syntax, which involved placing an `ion-checkbox` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy checkbox syntax, refer to the [Checkbox documentation](https://ionicframework.com/docs/api/checkbox#migrating-from-legacy-checkbox-syntax).
|
||||
|
||||
<h4 id="version-8x-content">Content</h4>
|
||||
|
||||
- Content no longer sets the `--background` custom property when the `.outer-content` class is set on the host.
|
||||
|
||||
<h4 id="version-8x-datetime">Datetime</h4>
|
||||
|
||||
- The CSS shadow part for `month-year-button` has been changed to target a `button` element instead of `ion-item`. Developers should verify their UI renders as expected for the month/year toggle button inside of `ion-datetime`.
|
||||
- Developers using the CSS variables available on `ion-item` will need to migrate their CSS to use CSS properties. For example:
|
||||
```diff
|
||||
ion-datetime::part(month-year-button) {
|
||||
- --background: red;
|
||||
|
||||
+ background: red;
|
||||
}
|
||||
```
|
||||
|
||||
<h4 id="version-8x-input">Input</h4>
|
||||
|
||||
- `size` has been removed from the `ion-input` component. Developers should use CSS to specify the visible width of the input.
|
||||
- `accept` has been removed from the `ion-input` component. This was previously used in conjunction with the `type="file"`. However, the `file` value for `type` is not a valid value in Ionic Framework.
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-input` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy input syntax, refer to the [Input documentation](https://ionicframework.com/docs/api/input#migrating-from-legacy-input-syntax).
|
||||
|
||||
<h4 id="version-8x-item">Item</h4>
|
||||
|
||||
- The `helper` slot has been removed. Developers should use the `helperText` property on `ion-input` and `ion-textarea`.
|
||||
- The `error` slot has been removed. Developers should use the `errorText` property on `ion-input` and `ion-textarea`.
|
||||
- Counter functionality has been removed including the `counter` and `counterFormatter` properties. Developers should use the properties of the same name on `ion-input` and `ion-textarea`.
|
||||
- The `fill` property has been removed. Developers should use the property of the same name on `ion-input`, `ion-select`, and `ion-textarea`.
|
||||
- The `shape` property has been removed. Developers should use the property of the same name on `ion-input`, `ion-select`, and `ion-textarea`.
|
||||
- Item no longer automatically delegates focus to the first focusable element. While most developers should not need to make any changes to account for this update, usages of `ion-item` with interactive elements such as form controls (inputs, textareas, etc) should be evaluated to verify that interactions still work as expected.
|
||||
|
||||
<h5>CSS variables</h4>
|
||||
|
||||
The following deprecated CSS variables have been removed: `--highlight-height`, `--highlight-color-focused`, `--highlight-color-valid`, and `--highlight-color-invalid`. These variables were used on the bottom border highlight of an item when the form control inside of that item was focused. The form control syntax was [simplified in v7](https://ionic.io/blog/ionic-7-is-here#simplified-form-control-syntax) so that inputs, selects, and textareas would no longer be required to be used inside of an item.
|
||||
|
||||
If you have not yet migrated to the modern form control syntax, migration guides for each of the form controls that added a highlight to item can be found below:
|
||||
- [Input migration documentation](https://ionicframework.com/docs/api/input#migrating-from-legacy-input-syntax)
|
||||
- [Select migration documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax)
|
||||
- [Textarea migration documentation](https://ionicframework.com/docs/api/textarea#migrating-from-legacy-textarea-syntax)
|
||||
|
||||
Once all form controls are using the modern syntax, the same variables can be used to customize them from the form control itself:
|
||||
|
||||
| Name | Description |
|
||||
| ----------------------------| ----------------------------------------|
|
||||
| `--highlight-color-focused` | The color of the highlight when focused |
|
||||
| `--highlight-color-invalid` | The color of the highlight when invalid |
|
||||
| `--highlight-color-valid` | The color of the highlight when valid |
|
||||
| `--highlight-height` | The height of the highlight indicator |
|
||||
|
||||
The following styles for item:
|
||||
|
||||
```css
|
||||
ion-item {
|
||||
--highlight-color-focused: purple;
|
||||
--highlight-color-valid: blue;
|
||||
--highlight-color-invalid: orange;
|
||||
--highlight-height: 6px;
|
||||
}
|
||||
```
|
||||
|
||||
will instead be applied on the form controls:
|
||||
|
||||
```css
|
||||
ion-input,
|
||||
ion-textarea,
|
||||
ion-select {
|
||||
--highlight-color-focused: purple;
|
||||
--highlight-color-valid: blue;
|
||||
--highlight-color-invalid: orange;
|
||||
--highlight-height: 6px;
|
||||
}
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The input and textarea components are scoped, which means they will automatically scope their CSS by appending each of the styles with an additional class at runtime. Overriding scoped selectors in CSS requires a [higher specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) selector. Targeting the `ion-input` or `ion-textarea` for customization will not work; therefore we recommend adding a class and customizing it that way.
|
||||
|
||||
<h4 id="version-8x-modal">Modal</h4>
|
||||
|
||||
- Detection for Capacitor <= 2 with applying status bar styles has been removed. Developers should ensure they are using Capacitor 3 or later when using the card modal presentation.
|
||||
|
||||
<h4 id="version-8x-nav">Nav</h4>
|
||||
|
||||
- `getLength` returns `Promise<number>` instead of `<number>`. This method was not previously available in Nav's TypeScript interface, but developers could still access it by casting Nav as `any`. Developers should ensure they `await` their `getLength` call before accessing the returned value.
|
||||
|
||||
<h4 id="version-8x-picker">Picker</h4>
|
||||
|
||||
- `ion-picker` and `ion-picker-column` have been renamed to `ion-picker-legacy` and `ion-picker-legacy-column`, respectively. This change was made to accommodate the new inline picker component while allowing developers to continue to use the legacy picker during this migration period.
|
||||
- Only the component names have been changed. Usages such as `ion-picker` or `IonPicker` should be changed to `ion-picker-legacy` and `IonPickerLegacy`, respectively.
|
||||
- Non-component usages such as `pickerController` or `useIonPicker` remain unchanged. The new picker displays inline with your page content and does not have equivalents for these non-component usages.
|
||||
|
||||
<h4 id="version-8x-progress-bar">Progress bar</h4>
|
||||
|
||||
- The `--buffer-background` CSS variable has been removed. Use `--background` instead.
|
||||
|
||||
<h4 id="version-8x-toast">Toast</h4>
|
||||
|
||||
- `cssClass` has been removed from the `ToastButton` interface. This was previously used to apply a custom class to the toast buttons. Developers can use the "button" shadow part to style the buttons.
|
||||
|
||||
For more information on styling toast buttons, refer to the [Toast Theming documentation](https://ionicframework.com/docs/api/toast#theming).
|
||||
|
||||
<h4 id="version-8x-radio">Radio</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-radio` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy radio syntax, refer to the [Radio documentation](https://ionicframework.com/docs/api/radio#migrating-from-legacy-radio-syntax).
|
||||
|
||||
<h4 id="version-8x-range">Range</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-range` inside of an `ion-item` with an `ion-label`, have been removed. Ionic will also no longer attempt to automatically associate form controls with sibling `<label>` elements as these label elements are now used inside the form control. Developers should provide a label (either visible text or `aria-label`) directly to the form control. For more information on migrating from the legacy range syntax, refer to the [Range documentation](https://ionicframework.com/docs/api/range#migrating-from-legacy-range-syntax).
|
||||
|
||||
<h4 id="version-8x-searchbar">Searchbar</h4>
|
||||
|
||||
- The `autocapitalize` property now defaults to `'off'`.
|
||||
|
||||
<h4 id="version-8x-select">Select</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-select` inside of an `ion-item` with an `ion-label`, have been removed. Ionic will also no longer attempt to automatically associate form controls with sibling `<label>` elements as these label elements are now used inside the form control. Developers should provide a label (either visible text or `aria-label`) directly to the form control. For more information on migrating from the legacy select syntax, refer to the [Select documentation](https://ionicframework.com/docs/api/select#migrating-from-legacy-select-syntax).
|
||||
|
||||
<h4 id="version-8x-textarea">Textarea</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-textarea` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy textarea syntax, refer to the [Textarea documentation](https://ionicframework.com/docs/api/textarea#migrating-from-legacy-textarea-syntax).
|
||||
|
||||
<h4 id="version-8x-toggle">Toggle</h4>
|
||||
|
||||
- The `legacy` property and support for the legacy syntax, which involved placing an `ion-toggle` inside of an `ion-item` with an `ion-label`, have been removed. For more information on migrating from the legacy toggle syntax, refer to the [Toggle documentation](https://ionicframework.com/docs/api/toggle#migrating-from-legacy-toggle-syntax).
|
||||
|
||||
<h2 id="version-8x-framework-specific">Framework Specific</h2>
|
||||
|
||||
<h4 id="version-8x-angular">Angular</h4>
|
||||
|
||||
- The `IonBackButtonDelegate` class has been removed in favor of `IonBackButton`.
|
||||
|
||||
```diff
|
||||
- import { IonBackButtonDelegate } from '@ionic/angular';
|
||||
+ import { IonBackButton } from '@ionic/angular';
|
||||
```
|
||||
71
CHANGELOG.md
@@ -3,6 +3,77 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [8.7.3](https://github.com/ionic-team/ionic-framework/compare/v8.7.2...v8.7.3) (2025-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **checkbox:** add aria attributes to ignore checkbox icon ([#30633](https://github.com/ionic-team/ionic-framework/issues/30633)) ([e9e6605](https://github.com/ionic-team/ionic-framework/commit/e9e6605862a05a46d26c26a144ed1cf22133a2b7)), closes [#30231](https://github.com/ionic-team/ionic-framework/issues/30231)
|
||||
* **refresher:** prevent focus-related scroll jumps on refresh ([#30636](https://github.com/ionic-team/ionic-framework/issues/30636)) ([1899b49](https://github.com/ionic-team/ionic-framework/commit/1899b49d252abc6003f763cea8db2a51efa941ec))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.7.2](https://github.com/ionic-team/ionic-framework/compare/v8.7.1...v8.7.2) (2025-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **reorder-group:** add children fallback for framework compatibility ([#30593](https://github.com/ionic-team/ionic-framework/issues/30593)) ([1cd81b9](https://github.com/ionic-team/ionic-framework/commit/1cd81b92301378d55bce63a01dfcf95a91c92652)), closes [#30592](https://github.com/ionic-team/ionic-framework/issues/30592)
|
||||
* **tabs:** add fallback to select tab if router integration fails ([#30599](https://github.com/ionic-team/ionic-framework/issues/30599)) ([a2e803a](https://github.com/ionic-team/ionic-framework/commit/a2e803a553dc58fc0e1599e515a56180a7ab263a)), closes [#30552](https://github.com/ionic-team/ionic-framework/issues/30552)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.7.1](https://github.com/ionic-team/ionic-framework/compare/v8.7.0...v8.7.1) (2025-07-31)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** upgrade `@stencil/core` to version 4.36.2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [8.7.0](https://github.com/ionic-team/ionic-framework/compare/v8.6.7...v8.7.0) (2025-07-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **css:** add new css utility classes for display and flex utils ([#30567](https://github.com/ionic-team/ionic-framework/issues/30567)) ([75f6c05](https://github.com/ionic-team/ionic-framework/commit/75f6c05fb96313ef890cc80a229a3a3ed3d57460)), closes [#22469](https://github.com/ionic-team/ionic-framework/issues/22469)
|
||||
* **datetime:** add border property to highlightedDates ([#30534](https://github.com/ionic-team/ionic-framework/issues/30534)) ([d5627c7](https://github.com/ionic-team/ionic-framework/commit/d5627c73681faf658ea3b869f3fb04d708391eb9)), closes [#29833](https://github.com/ionic-team/ionic-framework/issues/29833)
|
||||
* **deps:** update ionicons to v8 ([#30390](https://github.com/ionic-team/ionic-framework/issues/30390)) ([74cd71a](https://github.com/ionic-team/ionic-framework/commit/74cd71af243183aa738d11b280e155bdfd652126)), closes [#30445](https://github.com/ionic-team/ionic-framework/issues/30445)
|
||||
* **modal:** add IonModalToken for injecting modal elements in Angular components ([#30474](https://github.com/ionic-team/ionic-framework/issues/30474)) ([30d1910](https://github.com/ionic-team/ionic-framework/commit/30d1910d6ea5428b414d0e127e7681f59426c538))
|
||||
* **reorder-group:** add ionReorderStart, ionReorderMove, ionReorderEnd events ([#30471](https://github.com/ionic-team/ionic-framework/issues/30471)) ([b154f4e](https://github.com/ionic-team/ionic-framework/commit/b154f4ed095890f57ccab539fd9217976a5466e5)), closes [#23148](https://github.com/ionic-team/ionic-framework/issues/23148) [#27614](https://github.com/ionic-team/ionic-framework/issues/27614)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.7](https://github.com/ionic-team/ionic-framework/compare/v8.6.6...v8.6.7) (2025-07-30)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** downgrade `@stencil/core` to version 4.33.1
|
||||
|
||||
_Stencil has been downgraded due to an uncaught regression in Reorder._
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.6](https://github.com/ionic-team/ionic-framework/compare/v8.6.5...v8.6.6) (2025-07-30)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** upgrade `@stencil/core` to version 4.36.2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.5](https://github.com/ionic-team/ionic-framework/compare/v8.6.4...v8.6.5) (2025-07-16)
|
||||
|
||||
|
||||
|
||||
@@ -3,19 +3,16 @@
|
||||
# See documentation at https://stylelint.io/
|
||||
|
||||
ignoreFiles:
|
||||
- src/foundations/*.scss
|
||||
- src/css/ionic/*.scss
|
||||
- src/css/core.scss
|
||||
- src/css/flex-utils.scss
|
||||
- src/css/normalize.scss
|
||||
- src/css/text-alignment.scss
|
||||
- src/css/display.scss
|
||||
- src/themes/mixins.scss
|
||||
- src/themes/functions.color.scss
|
||||
- src/themes/functions.string.scss
|
||||
- src/themes/native.theme.default.scss
|
||||
- src/themes/ionic.mixins.scss
|
||||
- src/themes/ionic.functions.color.scss
|
||||
- src/themes/ionic.functions.string.scss
|
||||
- src/themes/ionic.theme.default.scss
|
||||
- src/css/themes/*.scss
|
||||
- scripts/tokens/*.css
|
||||
|
||||
indentation: 2
|
||||
|
||||
@@ -26,10 +23,10 @@ rules:
|
||||
at-rule-empty-line-before:
|
||||
- always
|
||||
- except:
|
||||
- blockless-after-blockless
|
||||
- first-nested
|
||||
- blockless-after-blockless
|
||||
- first-nested
|
||||
ignore:
|
||||
- after-comment
|
||||
- after-comment
|
||||
|
||||
block-closing-brace-newline-before:
|
||||
- always
|
||||
@@ -43,13 +40,14 @@ rules:
|
||||
custom-property-empty-line-before:
|
||||
- always
|
||||
- except:
|
||||
- after-comment
|
||||
- after-custom-property
|
||||
- first-nested
|
||||
- after-comment
|
||||
- after-custom-property
|
||||
- first-nested
|
||||
|
||||
declaration-no-important:
|
||||
- true
|
||||
|
||||
|
||||
order/order:
|
||||
- custom-properties
|
||||
- dollar-variables
|
||||
@@ -59,202 +57,203 @@ rules:
|
||||
|
||||
# https://github.com/sasstools/sass-lint/blob/develop/lib/config/property-sort-orders/smacss.yml
|
||||
order/properties-order:
|
||||
|
||||
# Box
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- display
|
||||
- position
|
||||
- top
|
||||
- right
|
||||
- bottom
|
||||
- left
|
||||
- display
|
||||
- position
|
||||
- top
|
||||
- right
|
||||
- bottom
|
||||
- left
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- flex
|
||||
- flex-basis
|
||||
- flex-direction
|
||||
- flex-flow
|
||||
- flex-grow
|
||||
- flex-shrink
|
||||
- flex-wrap
|
||||
- align-content
|
||||
- align-items
|
||||
- align-self
|
||||
- justify-content
|
||||
- order
|
||||
- flex
|
||||
- flex-basis
|
||||
- flex-direction
|
||||
- flex-flow
|
||||
- flex-grow
|
||||
- flex-shrink
|
||||
- flex-wrap
|
||||
- align-content
|
||||
- align-items
|
||||
- align-self
|
||||
- justify-content
|
||||
- order
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- width
|
||||
- min-width
|
||||
- max-width
|
||||
- width
|
||||
- min-width
|
||||
- max-width
|
||||
|
||||
- height
|
||||
- min-height
|
||||
- max-height
|
||||
- height
|
||||
- min-height
|
||||
- max-height
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- margin
|
||||
- margin-top
|
||||
- margin-right
|
||||
- margin-bottom
|
||||
- margin-left
|
||||
- margin
|
||||
- margin-top
|
||||
- margin-right
|
||||
- margin-bottom
|
||||
- margin-left
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- padding
|
||||
- padding-top
|
||||
- padding-right
|
||||
- padding-bottom
|
||||
- padding-left
|
||||
- padding
|
||||
- padding-top
|
||||
- padding-right
|
||||
- padding-bottom
|
||||
- padding-left
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- float
|
||||
- clear
|
||||
- float
|
||||
- clear
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- columns
|
||||
- column-gap
|
||||
- column-fill
|
||||
- column-rule
|
||||
- column-span
|
||||
- column-count
|
||||
- column-width
|
||||
- columns
|
||||
- column-gap
|
||||
- column-fill
|
||||
- column-rule
|
||||
- column-span
|
||||
- column-count
|
||||
- column-width
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- transform
|
||||
- transform-box
|
||||
- transform-origin
|
||||
- transform-style
|
||||
- transform
|
||||
- transform-box
|
||||
- transform-origin
|
||||
- transform-style
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- transition
|
||||
- transition-delay
|
||||
- transition-duration
|
||||
- transition-property
|
||||
- transition-timing-function
|
||||
- transition
|
||||
- transition-delay
|
||||
- transition-duration
|
||||
- transition-property
|
||||
- transition-timing-function
|
||||
|
||||
# Border
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- border
|
||||
- border-top
|
||||
- border-right
|
||||
- border-bottom
|
||||
- border-left
|
||||
- border-width
|
||||
- border-top-width
|
||||
- border-right-width
|
||||
- border-bottom-width
|
||||
- border-left-width
|
||||
- border
|
||||
- border-top
|
||||
- border-right
|
||||
- border-bottom
|
||||
- border-left
|
||||
- border-width
|
||||
- border-top-width
|
||||
- border-right-width
|
||||
- border-bottom-width
|
||||
- border-left-width
|
||||
|
||||
- border-style
|
||||
- border-top-style
|
||||
- border-right-style
|
||||
- border-bottom-style
|
||||
- border-left-style
|
||||
- border-style
|
||||
- border-top-style
|
||||
- border-right-style
|
||||
- border-bottom-style
|
||||
- border-left-style
|
||||
|
||||
- border-radius
|
||||
- border-top-left-radius
|
||||
- border-top-right-radius
|
||||
- border-bottom-left-radius
|
||||
- border-bottom-right-radius
|
||||
- border-radius
|
||||
- border-top-left-radius
|
||||
- border-top-right-radius
|
||||
- border-bottom-left-radius
|
||||
- border-bottom-right-radius
|
||||
|
||||
- border-color
|
||||
- border-top-color
|
||||
- border-right-color
|
||||
- border-bottom-color
|
||||
- border-left-color
|
||||
- border-color
|
||||
- border-top-color
|
||||
- border-right-color
|
||||
- border-bottom-color
|
||||
- border-left-color
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- outline
|
||||
- outline-color
|
||||
- outline-offset
|
||||
- outline-style
|
||||
- outline-width
|
||||
- outline
|
||||
- outline-color
|
||||
- outline-offset
|
||||
- outline-style
|
||||
- outline-width
|
||||
|
||||
# Background
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- background
|
||||
- background-attachment
|
||||
- background-clip
|
||||
- background-color
|
||||
- background-image
|
||||
- background-repeat
|
||||
- background-position
|
||||
- background-size
|
||||
- background
|
||||
- background-attachment
|
||||
- background-clip
|
||||
- background-color
|
||||
- background-image
|
||||
- background-repeat
|
||||
- background-position
|
||||
- background-size
|
||||
|
||||
# Text
|
||||
# Text
|
||||
|
||||
- color
|
||||
- color
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- font
|
||||
- font-family
|
||||
- font-size
|
||||
- font-smoothing
|
||||
- font-style
|
||||
- font-variant
|
||||
- font-weight
|
||||
- font
|
||||
- font-family
|
||||
- font-size
|
||||
- font-smoothing
|
||||
- font-style
|
||||
- font-variant
|
||||
- font-weight
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- letter-spacing
|
||||
- line-height
|
||||
- list-style
|
||||
- letter-spacing
|
||||
- line-height
|
||||
- list-style
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- text-align
|
||||
- text-decoration
|
||||
- text-indent
|
||||
- text-overflow
|
||||
- text-rendering
|
||||
- text-shadow
|
||||
- text-transform
|
||||
- text-wrap
|
||||
- text-align
|
||||
- text-decoration
|
||||
- text-indent
|
||||
- text-overflow
|
||||
- text-rendering
|
||||
- text-shadow
|
||||
- text-transform
|
||||
- text-wrap
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- white-space
|
||||
- word-spacing
|
||||
- white-space
|
||||
- word-spacing
|
||||
|
||||
# Other
|
||||
|
||||
- emptyLineBefore: always
|
||||
properties:
|
||||
- border-collapse
|
||||
- border-spacing
|
||||
- box-shadow
|
||||
- caption-side
|
||||
- contain
|
||||
- content
|
||||
- cursor
|
||||
- direction
|
||||
- empty-cells
|
||||
- object-fit
|
||||
- opacity
|
||||
- overflow
|
||||
- quotes
|
||||
- speak
|
||||
- table-layout
|
||||
- touch-action
|
||||
- user-select
|
||||
- vertical-align
|
||||
- visibility
|
||||
- z-index
|
||||
- border-collapse
|
||||
- border-spacing
|
||||
- box-shadow
|
||||
- caption-side
|
||||
- contain
|
||||
- content
|
||||
- cursor
|
||||
- direction
|
||||
- empty-cells
|
||||
- object-fit
|
||||
- opacity
|
||||
- overflow
|
||||
- quotes
|
||||
- speak
|
||||
- table-layout
|
||||
- touch-action
|
||||
- user-select
|
||||
- vertical-align
|
||||
- visibility
|
||||
- z-index
|
||||
|
||||
property-disallowed-list:
|
||||
- background-position
|
||||
|
||||
@@ -3,6 +3,76 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [8.7.3](https://github.com/ionic-team/ionic-framework/compare/v8.7.2...v8.7.3) (2025-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **checkbox:** add aria attributes to ignore checkbox icon ([#30633](https://github.com/ionic-team/ionic-framework/issues/30633)) ([e9e6605](https://github.com/ionic-team/ionic-framework/commit/e9e6605862a05a46d26c26a144ed1cf22133a2b7)), closes [#30231](https://github.com/ionic-team/ionic-framework/issues/30231)
|
||||
* **refresher:** prevent focus-related scroll jumps on refresh ([#30636](https://github.com/ionic-team/ionic-framework/issues/30636)) ([1899b49](https://github.com/ionic-team/ionic-framework/commit/1899b49d252abc6003f763cea8db2a51efa941ec))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.7.2](https://github.com/ionic-team/ionic-framework/compare/v8.7.1...v8.7.2) (2025-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **reorder-group:** add children fallback for framework compatibility ([#30593](https://github.com/ionic-team/ionic-framework/issues/30593)) ([1cd81b9](https://github.com/ionic-team/ionic-framework/commit/1cd81b92301378d55bce63a01dfcf95a91c92652)), closes [#30592](https://github.com/ionic-team/ionic-framework/issues/30592)
|
||||
* **tabs:** add fallback to select tab if router integration fails ([#30599](https://github.com/ionic-team/ionic-framework/issues/30599)) ([a2e803a](https://github.com/ionic-team/ionic-framework/commit/a2e803a553dc58fc0e1599e515a56180a7ab263a)), closes [#30552](https://github.com/ionic-team/ionic-framework/issues/30552)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.7.1](https://github.com/ionic-team/ionic-framework/compare/v8.7.0...v8.7.1) (2025-07-31)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** upgrade `@stencil/core` to version 4.36.2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [8.7.0](https://github.com/ionic-team/ionic-framework/compare/v8.6.7...v8.7.0) (2025-07-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **css:** add new css utility classes for display and flex utils ([#30567](https://github.com/ionic-team/ionic-framework/issues/30567)) ([75f6c05](https://github.com/ionic-team/ionic-framework/commit/75f6c05fb96313ef890cc80a229a3a3ed3d57460)), closes [#22469](https://github.com/ionic-team/ionic-framework/issues/22469)
|
||||
* **datetime:** add border property to highlightedDates ([#30534](https://github.com/ionic-team/ionic-framework/issues/30534)) ([d5627c7](https://github.com/ionic-team/ionic-framework/commit/d5627c73681faf658ea3b869f3fb04d708391eb9)), closes [#29833](https://github.com/ionic-team/ionic-framework/issues/29833)
|
||||
* **deps:** update ionicons to v8 ([#30390](https://github.com/ionic-team/ionic-framework/issues/30390)) ([74cd71a](https://github.com/ionic-team/ionic-framework/commit/74cd71af243183aa738d11b280e155bdfd652126)), closes [#30445](https://github.com/ionic-team/ionic-framework/issues/30445)
|
||||
* **reorder-group:** add ionReorderStart, ionReorderMove, ionReorderEnd events ([#30471](https://github.com/ionic-team/ionic-framework/issues/30471)) ([b154f4e](https://github.com/ionic-team/ionic-framework/commit/b154f4ed095890f57ccab539fd9217976a5466e5)), closes [#23148](https://github.com/ionic-team/ionic-framework/issues/23148) [#27614](https://github.com/ionic-team/ionic-framework/issues/27614)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.7](https://github.com/ionic-team/ionic-framework/compare/v8.6.6...v8.6.7) (2025-07-30)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** downgrade `@stencil/core` to version 4.33.1
|
||||
|
||||
_Stencil has been downgraded due to an uncaught regression in Reorder._
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.6](https://github.com/ionic-team/ionic-framework/compare/v8.6.5...v8.6.6) (2025-07-30)
|
||||
|
||||
### Dependencies
|
||||
|
||||
* **stencil:** upgrade `@stencil/core` to version 4.36.2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [8.6.5](https://github.com/ionic-team/ionic-framework/compare/v8.6.4...v8.6.5) (2025-07-16)
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Get Playwright
|
||||
FROM mcr.microsoft.com/playwright:v1.54.1
|
||||
FROM mcr.microsoft.com/playwright:v1.55.0
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /ionic
|
||||
|
||||
652
core/api.txt
9388
core/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ionic/core",
|
||||
"version": "8.6.5",
|
||||
"version": "8.7.3",
|
||||
"description": "Base components for Ionic",
|
||||
"keywords": [
|
||||
"ionic",
|
||||
@@ -31,9 +31,8 @@
|
||||
"loader/"
|
||||
],
|
||||
"dependencies": {
|
||||
"@phosphor-icons/core": "^2.1.1",
|
||||
"@stencil/core": "4.33.1",
|
||||
"ionicons": "^7.2.2",
|
||||
"@stencil/core": "4.36.2",
|
||||
"ionicons": "^8.0.13",
|
||||
"tslib": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -45,7 +44,7 @@
|
||||
"@clack/prompts": "^0.11.0",
|
||||
"@ionic/eslint-config": "^0.3.0",
|
||||
"@ionic/prettier-config": "^2.0.0",
|
||||
"@playwright/test": "^1.54.1",
|
||||
"@playwright/test": "^1.55.0",
|
||||
"@rollup/plugin-node-resolve": "^8.4.0",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
"@stencil/angular-output-target": "^0.10.0",
|
||||
@@ -53,7 +52,7 @@
|
||||
"@stencil/sass": "^3.0.9",
|
||||
"@stencil/vue-output-target": "0.10.8",
|
||||
"@types/jest": "^29.5.6",
|
||||
"@types/node": "^18.19.47",
|
||||
"@types/node": "^14.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"chalk": "^5.3.0",
|
||||
@@ -66,12 +65,10 @@
|
||||
"fs-extra": "^9.0.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-cli": "^29.7.0",
|
||||
"outsystems-design-tokens": "^1.2.6",
|
||||
"prettier": "^2.8.8",
|
||||
"prettier": "^2.6.1",
|
||||
"rollup": "^2.26.4",
|
||||
"sass": "^1.33.0",
|
||||
"serve": "^14.0.1",
|
||||
"style-dictionary": "^4.1.3",
|
||||
"stylelint": "^13.13.1",
|
||||
"stylelint-order": "^4.1.0"
|
||||
},
|
||||
@@ -80,7 +77,6 @@
|
||||
"build.css": "npm run css.sass && npm run css.minify",
|
||||
"build.debug": "npm run clean && stencil build --debug",
|
||||
"build.docs.json": "stencil build --docs-json dist/docs.json",
|
||||
"build.tokens": "npx build.tokens --config scripts/tokens/index.js && npm run prettier.tokens",
|
||||
"clean": "node scripts/clean.js",
|
||||
"css.minify": "cleancss -O2 -o ./css/ionic.bundle.css ./css/ionic.bundle.css",
|
||||
"css.sass": "sass --embed-sources --style compressed src/css:./css",
|
||||
@@ -92,8 +88,7 @@
|
||||
"lint.ts": "npm run eslint",
|
||||
"lint.ts.fix": "npm run eslint -- --fix",
|
||||
"prerender.e2e": "node scripts/testing/prerender.js",
|
||||
"prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx,scss}\"",
|
||||
"prettier.tokens": "prettier \"./src/foundations/*.{scss, html}\" --write --cache",
|
||||
"prettier": "prettier \"./src/**/*.{html,ts,tsx,js,jsx}\"",
|
||||
"start": "npm run build.css && stencil build --dev --watch --serve",
|
||||
"test": "npm run test.spec && npm run test.e2e",
|
||||
"test.spec": "stencil test --spec --max-workers=2",
|
||||
|
||||
@@ -28,32 +28,6 @@
|
||||
document.head.appendChild(linkTag);
|
||||
}
|
||||
|
||||
/**
|
||||
* The `ionic` theme uses a different stylesheet than the `iOS` and `md` themes.
|
||||
* This is to ensure that the `ionic` theme is loaded when the `ionic:theme=ionic`
|
||||
* or when the HTML tag has the `theme="ionic"` attribute. This is useful for
|
||||
* the snapshot tests, where the `ionic` theme is not loaded by default.
|
||||
*/
|
||||
const themeQuery = window.location.search.match(/ionic:theme=([a-z]+)/);
|
||||
const themeAttr = document.documentElement.getAttribute('theme');
|
||||
|
||||
if ((themeQuery && themeQuery[1] === 'ionic') || themeAttr === 'ionic') {
|
||||
const ionicThemeLinkTag = document.querySelector('link[href*="css/ionic/bundle.ionic.css"]');
|
||||
|
||||
if (!ionicThemeLinkTag) {
|
||||
const linkTag = document.createElement('link');
|
||||
linkTag.setAttribute('rel', 'stylesheet');
|
||||
linkTag.setAttribute('type', 'text/css');
|
||||
linkTag.setAttribute('href', '/css/ionic/bundle.ionic.css');
|
||||
document.head.appendChild(linkTag);
|
||||
}
|
||||
|
||||
const defaultThemeLinkTag = document.querySelector('link[href*="css/ionic.bundle.css"]');
|
||||
if (defaultThemeLinkTag) {
|
||||
defaultThemeLinkTag.remove();
|
||||
}
|
||||
}
|
||||
|
||||
window.Ionic = window.Ionic || {};
|
||||
window.Ionic.config = window.Ionic.config || {};
|
||||
|
||||
|
||||
@@ -49,17 +49,6 @@ html.ios.ios {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "iosTestingFont", sans-serif;
|
||||
}
|
||||
|
||||
/* Override above styles for testing scopes */
|
||||
:root.ionic,
|
||||
:root.ionic.ios,
|
||||
:root.ionic.md,
|
||||
html.ionic,
|
||||
html.ionic.ios,
|
||||
html.ionic.md {
|
||||
--ion-background-color: var(--background);
|
||||
--ion-font-family: initial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Button styles should only be applied
|
||||
* to native buttons that are not part of the
|
||||
|
||||
@@ -1,201 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
// For generating Design Tokens, we use Style Dictionary for several reasons:
|
||||
// - It's prepared to easily generate tokens for multiple types of outputs (CSS, SCSS, iOS, Android, documentation, etc.).
|
||||
// - It also works very well out of the box with any kind of Design Tokens formats, like Figma Tokens, as well as APIs to adjust to more custom ones.
|
||||
// - It is probably the most well-known and widely used Design Tokens tool. It has also been regularly maintained for a long time.
|
||||
// - It can easily scale to different necessities we might have in the future.
|
||||
(async () => {
|
||||
const {
|
||||
generateShadowValue,
|
||||
generateFontSizeValue,
|
||||
generateFontFamilyValue,
|
||||
generateTypographyOutput,
|
||||
generateValue,
|
||||
generateColorUtilityClasses,
|
||||
generateDefaultSpaceUtilityClasses,
|
||||
generateSpaceUtilityClasses,
|
||||
removeConsecutiveRepeatedWords,
|
||||
setPrefixValue,
|
||||
generateRadiusUtilityClasses,
|
||||
generateBorderUtilityClasses,
|
||||
generateFontUtilityClasses,
|
||||
generateShadowUtilityClasses,
|
||||
generateUtilityClasses
|
||||
} = require('./utils.js');
|
||||
|
||||
const StyleDictionary = (await import('style-dictionary')).default;
|
||||
|
||||
// Set the prefix for variables and classes
|
||||
setPrefixValue('ion');
|
||||
|
||||
// Register a custom file header
|
||||
StyleDictionary.registerFileHeader({
|
||||
name: 'custom-header',
|
||||
fileHeader: async (defaultMessages = []) => {
|
||||
return [...defaultMessages, 'Do not edit directly, this file was auto-generated.'];
|
||||
},
|
||||
});
|
||||
|
||||
// SCSS variables format
|
||||
StyleDictionary.registerFormat({
|
||||
name: 'scssVariablesFormat',
|
||||
format: async function ({ dictionary, file }) {
|
||||
|
||||
console.log('Generating SCSS variables...');
|
||||
|
||||
const primitiveProperties = dictionary.allTokens.filter((prop) => prop.path[0] === 'primitives');
|
||||
const scaleProperties = dictionary.allTokens.filter((prop) => prop.path[0] === 'scale');
|
||||
const borderProperties = dictionary.allTokens.filter((prop) => prop.path[0] === 'border');
|
||||
const semanticsProperties = dictionary.allTokens.filter((prop) => prop.path[0] === 'semantics');
|
||||
const nonPrimitiveScaleBorderSemanticsProperties = dictionary.allTokens.filter(
|
||||
(prop) => !['primitives', 'scale', 'border', 'semantics'].includes(prop.path[0])
|
||||
);
|
||||
const typographyProperties = nonPrimitiveScaleBorderSemanticsProperties.filter((prop) => prop.$type === 'typography');
|
||||
const otherProperties = nonPrimitiveScaleBorderSemanticsProperties.filter((prop) => prop.$type !== 'typography');
|
||||
|
||||
// Order: primitives → semantics → scale → border → other → typography
|
||||
const sortedProperties = [
|
||||
...primitiveProperties,
|
||||
...semanticsProperties,
|
||||
...scaleProperties,
|
||||
...borderProperties,
|
||||
...otherProperties,
|
||||
...typographyProperties
|
||||
];
|
||||
|
||||
const prefixedVariables = sortedProperties.map((prop) => {
|
||||
// Remove consecutive repeated words from the token name, like border-border-color
|
||||
const propName = removeConsecutiveRepeatedWords(prop.name);
|
||||
|
||||
switch (prop.$type) {
|
||||
case 'boxShadow':
|
||||
return generateShadowValue(prop, propName);
|
||||
case 'fontFamilies':
|
||||
return generateFontFamilyValue(prop, propName, 'scss');
|
||||
case 'fontSizes':
|
||||
return generateFontSizeValue(prop, propName, 'scss');
|
||||
case 'typography':
|
||||
return generateTypographyOutput(prop, propName, true);
|
||||
default:
|
||||
return generateValue(prop, propName);
|
||||
}
|
||||
});
|
||||
|
||||
const fileHeader = await file.options.fileHeader();
|
||||
|
||||
return [
|
||||
`/*\n${fileHeader.join('\n')}\n*/`,
|
||||
'@use "../themes/functions.sizes" as font;\n',
|
||||
prefixedVariables.join('\n') + '\n',
|
||||
].join('\n');
|
||||
},
|
||||
});
|
||||
|
||||
// Create utility-classes
|
||||
StyleDictionary.registerFormat({
|
||||
name: 'cssUtilityClassesFormat',
|
||||
format: async function ({ dictionary, file }) {
|
||||
|
||||
console.log('Generating Utility-Classes...');
|
||||
|
||||
// Arrays to store specific utility classes
|
||||
const typographyUtilityClasses = [];
|
||||
const otherUtilityClasses = [];
|
||||
|
||||
// Generate utility classes for each token
|
||||
dictionary.allTokens.map((prop) => {
|
||||
|
||||
const tokenCategory = prop.attributes.category;
|
||||
|
||||
if (prop.$type === 'fontFamilies' || tokenCategory === 'scale' || tokenCategory === 'backdrop') {
|
||||
// Not creating for the tokens below, as they make no sense to exist as utility-classes.
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove consecutive repeated words from the token name, like border-border-color
|
||||
const propName = removeConsecutiveRepeatedWords(prop.name);
|
||||
|
||||
if (prop.$type === 'typography') {
|
||||
// Typography tokens are handled differently, as each might have a different tokenType
|
||||
return typographyUtilityClasses.push(generateTypographyOutput(prop, propName, false));
|
||||
|
||||
} else if (tokenCategory.startsWith('round') || tokenCategory.startsWith('rectangular') || tokenCategory.startsWith('soft')) {
|
||||
// Generate utility classes for border-radius shape tokens, as they have their own token json file, based on primitive tokens
|
||||
return otherUtilityClasses.push(generateRadiusUtilityClasses(propName));
|
||||
}
|
||||
|
||||
let utilityClass = '';
|
||||
switch (tokenCategory) {
|
||||
case 'color':
|
||||
case 'primitives':
|
||||
case 'semantics':
|
||||
case 'text':
|
||||
case 'bg':
|
||||
case 'icon':
|
||||
case 'state':
|
||||
utilityClass = generateColorUtilityClasses(prop, propName);
|
||||
break;
|
||||
case 'border':
|
||||
utilityClass = generateBorderUtilityClasses(prop, propName);
|
||||
break;
|
||||
case 'font':
|
||||
utilityClass = generateFontUtilityClasses(prop, propName);
|
||||
break;
|
||||
case 'space':
|
||||
utilityClass = generateSpaceUtilityClasses(prop, propName);
|
||||
break;
|
||||
case 'shadow':
|
||||
case 'elevation':
|
||||
utilityClass = generateShadowUtilityClasses(propName);
|
||||
break;
|
||||
default:
|
||||
utilityClass = generateUtilityClasses(tokenCategory, propName);
|
||||
}
|
||||
|
||||
return otherUtilityClasses.push(utilityClass);
|
||||
});
|
||||
|
||||
const defaultSpaceUtilityClasses = generateDefaultSpaceUtilityClasses();
|
||||
otherUtilityClasses.push(defaultSpaceUtilityClasses);
|
||||
|
||||
// Concatenate typography utility classes at the beginning
|
||||
const finalOutput = typographyUtilityClasses.concat(otherUtilityClasses).join('\n');
|
||||
|
||||
const fileHeader = await file.options.fileHeader();
|
||||
|
||||
return [
|
||||
`/*\n${fileHeader.join('\n')}\n*/`,
|
||||
'@import "./ionic.vars";\n@import "../themes/mixins";\n',
|
||||
finalOutput,
|
||||
].join('\n');
|
||||
},
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
// APPLY THE CONFIGURATION
|
||||
module.exports = {
|
||||
source: ["node_modules/outsystems-design-tokens/tokens/**/*.json"],
|
||||
platforms: {
|
||||
scss: {
|
||||
transformGroup: "scss",
|
||||
buildPath: './src/foundations/',
|
||||
files: [
|
||||
{
|
||||
destination: "ionic.vars.scss",
|
||||
format: "scssVariablesFormat",
|
||||
options: {
|
||||
fileHeader: `custom-header`,
|
||||
},
|
||||
},
|
||||
{
|
||||
destination: "ionic.utility.scss",
|
||||
format: "cssUtilityClassesFormat",
|
||||
options: {
|
||||
fileHeader: `custom-header`
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,335 +0,0 @@
|
||||
let variablesPrefix; // Variable that holds the prefix used on all css and scss variables generated
|
||||
|
||||
// Set the variable prefix value
|
||||
function setPrefixValue(prefix) {
|
||||
variablesPrefix = prefix;
|
||||
return variablesPrefix;
|
||||
}
|
||||
|
||||
// Generates a valid rgba() color
|
||||
function getRgbaValue(propValue) {
|
||||
// Check if its rgba color
|
||||
const isRgba = hexToRgba(propValue);
|
||||
// If it is, then compose rgba() color, otherwise use the normal color
|
||||
if (isRgba !== null) {
|
||||
return (propValue = `rgba(${isRgba.r}, ${isRgba.g}, ${isRgba.b},${isRgba.a})`);
|
||||
} else {
|
||||
return propValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Translates an hex color value to rgb
|
||||
function hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result
|
||||
? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16),
|
||||
}
|
||||
: null;
|
||||
}
|
||||
|
||||
// Translates an hex color value to rgba
|
||||
function hexToRgba(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result
|
||||
? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16),
|
||||
a: Math.round((parseInt(result[4], 16) * 100) / 255) / 100,
|
||||
}
|
||||
: null;
|
||||
}
|
||||
|
||||
// Utility function to remove consecutive repeated words
|
||||
function removeConsecutiveRepeatedWords(str) {
|
||||
return str.replace(/(\b\w+\b)(-\1)+/g, '$1');
|
||||
}
|
||||
|
||||
// Generates a reference variable for an alias token type
|
||||
// (e.g., $ion-border-default: var(--ion-border-default, #d5d5d5) → $ion-border-default: var(--ion-border-default, $ion-primitives-neutral-400))
|
||||
function getAliasReferenceVariable(prop) {
|
||||
if (typeof prop.$value === 'string' && prop.$value.startsWith('{') && prop.$value.endsWith('}')) {
|
||||
// Remove curly braces and replace dots with dashes
|
||||
let ref = prop.$value.slice(1, -1).replace(/\./g, '-');
|
||||
// Remove consecutive repeated words (e.g., border-border-radius-0 → border-radius-0)
|
||||
ref = removeConsecutiveRepeatedWords(ref);
|
||||
return `$${variablesPrefix}-${ref}`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Generates a valid box-shadow value from a shadow Design Token structure
|
||||
function generateShadowValue(prop, propName) {
|
||||
const cssShadow = prop.$value.map(shadow => {
|
||||
// Assuming shadow is an object with properties like offsetX, offsetY, blurRadius, spreadRadius, color
|
||||
const color = getRgbaValue(shadow.color);
|
||||
return `${shadow.x}px ${shadow.y}px ${shadow.blur}px ${shadow.spread}px ${color}`;
|
||||
}).join(', ');
|
||||
|
||||
return `$${variablesPrefix}-${propName}: var(--${variablesPrefix}-${propName}, ${cssShadow});`;
|
||||
}
|
||||
|
||||
// Generates a valid font-size value from a font-size Design Token structure, while transforming the pixels to rem
|
||||
function generateFontSizeValue(prop, propName, variableType = 'css') {
|
||||
return variableType === 'scss'
|
||||
? `$${variablesPrefix}-${propName}: var(--${variablesPrefix}-${propName}, font.px-to-rem(${parseInt(
|
||||
prop.$value
|
||||
)}));`
|
||||
: `--${propName}: #{font.px-to-rem(${parseInt(prop.$value)})};`;
|
||||
}
|
||||
|
||||
// Generates a valid font-family value from a font-family Design Token structure
|
||||
function generateFontFamilyValue(prop, propName, variableType = 'css') {
|
||||
// Remove the last word from the token, as it contains the name of the font, which we don't want to be included on the generated variables
|
||||
const _propName = propName.split('-').slice(0, -1).join('-');
|
||||
|
||||
return variableType === 'scss'
|
||||
? `$${variablesPrefix}-${_propName}: var(--${variablesPrefix}-${_propName}, "${prop.$value}", sans-serif);`
|
||||
: `--${variablesPrefix}-${_propName}: "${prop.$value}", sans-serif;`;
|
||||
}
|
||||
|
||||
// Generates a final value, based if the Design Token is of type color or not
|
||||
function generateValue(prop, propName) {
|
||||
// Use the original value to detect aliases
|
||||
const aliasVar = getAliasReferenceVariable({ $value: prop.original.$value });
|
||||
|
||||
// Always generate the main variable
|
||||
let mainValue;
|
||||
if (aliasVar) {
|
||||
mainValue = `$${variablesPrefix}-${propName}: var(--${variablesPrefix}-${propName}, ${aliasVar});`;
|
||||
} else {
|
||||
mainValue = `$${variablesPrefix}-${propName}: var(--${variablesPrefix}-${propName}, ${prop.$value});`;
|
||||
}
|
||||
|
||||
// Always generate the -rgb variable if it's a color
|
||||
const rgb = hexToRgb(prop.$value);
|
||||
let rgbDeclaration = '';
|
||||
if (rgb) {
|
||||
rgbDeclaration = `\n$${variablesPrefix}-${propName}-rgb: var(--${variablesPrefix}-${propName}-rgb, ${rgb.r}, ${rgb.g}, ${rgb.b});`;
|
||||
}
|
||||
|
||||
return `${mainValue}${rgbDeclaration}`;
|
||||
}
|
||||
|
||||
// Generates a typography based css utility-class or scss variable from a typography token structure
|
||||
function generateTypographyOutput(prop, propName, isVariable) {
|
||||
const typography = prop.original.$value;
|
||||
|
||||
// Extract the part after the last dot and trim any extraneous characters
|
||||
const extractLastPart = (str) => str.split('.').pop().replace(/[^\w-]/g, '');
|
||||
|
||||
const _initialWrapper = isVariable ? ': (' : ` {`;
|
||||
const _endWrapper = isVariable ? ')' : `}`;
|
||||
const _prefix = isVariable ? '$' : `.`;
|
||||
const _endChar = isVariable ? ',' : ';';
|
||||
|
||||
// This exact format is needed so that it compiles the tokens with the expected lint rules
|
||||
return `
|
||||
${_prefix}${variablesPrefix}-${propName}${_initialWrapper}
|
||||
font-size: $${variablesPrefix}-font-size-${extractLastPart(typography.fontSize)}${_endChar}
|
||||
font-style: ${prop.attributes.item?.toLowerCase() === 'italic' ? 'italic' : 'normal'}${_endChar}
|
||||
font-weight: $${variablesPrefix}-font-weight-${extractLastPart(typography.fontWeight)}${_endChar}
|
||||
letter-spacing: $${variablesPrefix}-font-letter-spacing-${extractLastPart(typography.letterSpacing) || 0}${_endChar}
|
||||
line-height: $${variablesPrefix}-font-line-height-${extractLastPart(typography.lineHeight)}${_endChar}
|
||||
text-transform: ${typography.textCase}${_endChar}
|
||||
text-decoration: ${typography.textDecoration}${_endChar}
|
||||
${_endWrapper};
|
||||
`;
|
||||
}
|
||||
|
||||
// Generates a color based css utility-class from a color Design Token structure
|
||||
function generateColorUtilityClasses(prop, className) {
|
||||
const isBg = className.includes('bg');
|
||||
const cssProp = isBg ? 'background-color' : 'color';
|
||||
return `.${variablesPrefix}-${className} {
|
||||
--${cssProp}: $${variablesPrefix}-${prop.name};
|
||||
${cssProp}: $${variablesPrefix}-${prop.name};
|
||||
}`;
|
||||
}
|
||||
|
||||
// Generates margin and padding utility classes to match the token-agnostic
|
||||
// utilities provided by the Ionic Framework
|
||||
function generateDefaultSpaceUtilityClasses() {
|
||||
const zeroMarginPaddingToken = 'space-0';
|
||||
const defaultMarginPaddingToken = 'space-400';
|
||||
|
||||
const marginPaddingTemplate = (type) => `
|
||||
.${variablesPrefix}-no-${type} {
|
||||
--${type}-top: #{$${variablesPrefix}-${zeroMarginPaddingToken}};
|
||||
--${type}-end: #{$${variablesPrefix}-${zeroMarginPaddingToken}};
|
||||
--${type}-bottom: #{$${variablesPrefix}-${zeroMarginPaddingToken}};
|
||||
--${type}-start: #{$${variablesPrefix}-${zeroMarginPaddingToken}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${zeroMarginPaddingToken});
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type} {
|
||||
--${type}-top: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
--${type}-end: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
--${type}-bottom: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
--${type}-start: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${defaultMarginPaddingToken});
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-top {
|
||||
--${type}-top: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${defaultMarginPaddingToken}, null, null, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-end {
|
||||
--${type}-end: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}(null, $${variablesPrefix}-${defaultMarginPaddingToken}, null, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-bottom {
|
||||
--${type}-bottom: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}(null, null, $${variablesPrefix}-${defaultMarginPaddingToken}, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-start {
|
||||
--${type}-start: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}(null, null, null, $${variablesPrefix}-${defaultMarginPaddingToken});
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-vertical {
|
||||
--${type}-top: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
--${type}-bottom: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${defaultMarginPaddingToken}, null, $${variablesPrefix}-${defaultMarginPaddingToken}, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-horizontal {
|
||||
--${type}-start: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
--${type}-end: #{$${variablesPrefix}-${defaultMarginPaddingToken}};
|
||||
|
||||
@include ${type}(null, $${variablesPrefix}-${defaultMarginPaddingToken}, null, $${variablesPrefix}-${defaultMarginPaddingToken});
|
||||
};
|
||||
`;
|
||||
|
||||
return `${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
|
||||
}
|
||||
|
||||
// Generates a margin or padding based css utility-class from a space Design Token structure
|
||||
function generateSpaceUtilityClasses(prop, className) {
|
||||
// This exact format is needed so that it compiles the tokens with the expected lint rules
|
||||
// It will generate classes for margin and padding, for equal sizing on all side and each direction
|
||||
const marginPaddingTemplate = (type) => `
|
||||
.${variablesPrefix}-${type}-${className} {
|
||||
--${type}-top: #{$${variablesPrefix}-${prop.name}};
|
||||
--${type}-end: #{$${variablesPrefix}-${prop.name}};
|
||||
--${type}-bottom: #{$${variablesPrefix}-${prop.name}};
|
||||
--${type}-start: #{$${variablesPrefix}-${prop.name}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${prop.name});
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-top-${className} {
|
||||
--${type}-top: #{$${variablesPrefix}-${prop.name}};
|
||||
|
||||
@include ${type}($${variablesPrefix}-${prop.name}, null, null, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-end-${className} {
|
||||
--${type}-end: #{$${variablesPrefix}-${prop.name}};
|
||||
|
||||
@include ${type}(null, $${variablesPrefix}-${prop.name}, null, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-bottom-${className} {
|
||||
--${type}-bottom: #{$${variablesPrefix}-${prop.name}};
|
||||
|
||||
@include ${type}(null, null, $${variablesPrefix}-${prop.name}, null);
|
||||
};
|
||||
|
||||
.${variablesPrefix}-${type}-start-${className} {
|
||||
--${type}-start: #{$${variablesPrefix}-${prop.name}};
|
||||
|
||||
@include ${type}(null, null, null, $${variablesPrefix}-${prop.name});
|
||||
};
|
||||
`;
|
||||
|
||||
// Add gap utility classes for gap tokens
|
||||
const generateGapUtilityClasses = () =>`
|
||||
.${variablesPrefix}-gap-${prop.name} {
|
||||
gap: #{$${variablesPrefix}-${prop.name}};
|
||||
};
|
||||
`;
|
||||
|
||||
return `${generateGapUtilityClasses()}\n${marginPaddingTemplate('margin')}\n${marginPaddingTemplate('padding')}`;
|
||||
}
|
||||
|
||||
// Generates a valid box-shadow value from a shadow Design Token structure
|
||||
function generateRadiusUtilityClasses(propName) {
|
||||
return `.${variablesPrefix}-${propName} {
|
||||
--border-radius: $${variablesPrefix}-${propName};
|
||||
border-radius: $${variablesPrefix}-${propName};
|
||||
}`;
|
||||
}
|
||||
|
||||
// Generates a border based css utility-class from a font Design Token structure
|
||||
function generateBorderUtilityClasses(prop, propName) {
|
||||
let attribute;
|
||||
|
||||
switch (prop.attributes.type) {
|
||||
case 'border-radius':
|
||||
case 'border-style':
|
||||
attribute = prop.attributes.type;
|
||||
break;
|
||||
case 'border-size':
|
||||
attribute = 'border-width';
|
||||
break;
|
||||
default:
|
||||
attribute = 'border-color';
|
||||
}
|
||||
return `.${variablesPrefix}-${propName} {
|
||||
--${attribute}: $${variablesPrefix}-${propName};
|
||||
${attribute}: $${variablesPrefix}-${propName};
|
||||
}`;
|
||||
}
|
||||
|
||||
// Generates a font based css utility-class from a font Design Token structure
|
||||
function generateFontUtilityClasses(prop, propName) {
|
||||
return `.${variablesPrefix}-${propName} {\n ${prop.attributes.type}: $${variablesPrefix}-${propName};\n}`;
|
||||
}
|
||||
|
||||
// Generates a valid box-shadow value from a shadow Design Token structure
|
||||
function generateShadowUtilityClasses(propName) {
|
||||
return `.${variablesPrefix}-${propName} {
|
||||
--box-shadow: $${variablesPrefix}-${propName};
|
||||
box-shadow: $${variablesPrefix}-${propName};
|
||||
}`;
|
||||
}
|
||||
|
||||
// Generates a utility class for a given token category and name
|
||||
function generateUtilityClasses(tokenCategory, propName){
|
||||
return `.${variablesPrefix}-${propName} {\n ${tokenCategory}: $${variablesPrefix}-${propName};\n}`;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getRgbaValue,
|
||||
hexToRgb,
|
||||
generateShadowValue,
|
||||
generateFontSizeValue,
|
||||
generateFontFamilyValue,
|
||||
generateTypographyOutput,
|
||||
generateValue,
|
||||
getAliasReferenceVariable,
|
||||
setPrefixValue,
|
||||
generateRadiusUtilityClasses,
|
||||
generateColorUtilityClasses,
|
||||
generateDefaultSpaceUtilityClasses,
|
||||
generateSpaceUtilityClasses,
|
||||
removeConsecutiveRepeatedWords,
|
||||
generateBorderUtilityClasses,
|
||||
generateFontUtilityClasses,
|
||||
generateShadowUtilityClasses,
|
||||
generateUtilityClasses
|
||||
};
|
||||
1727
core/src/components.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
// Accordion Group: Common
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
@use "../../themes/ionic/ionic.globals.scss" as globals;
|
||||
@use "./accordion-group.common";
|
||||
|
||||
// Ionic Accordion Group
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
min-width: calc(#{globals.$ion-scale-6200} + #{globals.$ion-space-600});
|
||||
|
||||
background-color: globals.$ion-bg-neutral-subtlest-default;
|
||||
}
|
||||
|
||||
// Inset Accordion Group
|
||||
// --------------------------------------------------
|
||||
// Shape and padding only apply if the group is inset
|
||||
|
||||
:host(.accordion-group-expand-inset) {
|
||||
@include globals.padding(globals.$ion-space-100);
|
||||
}
|
||||
|
||||
:host(.accordion-group-expand-inset.accordion-group-shape-round) {
|
||||
--border-radius: #{globals.$ion-border-radius-400};
|
||||
|
||||
@include globals.border-radius(globals.$ion-border-radius-400);
|
||||
}
|
||||
|
||||
:host(.accordion-group-expand-inset.accordion-group-shape-soft) {
|
||||
--border-radius: #{globals.$ion-border-radius-200};
|
||||
|
||||
@include globals.border-radius(globals.$ion-border-radius-200);
|
||||
}
|
||||
|
||||
:host(.accordion-group-expand-inset.accordion-group-shape-rectangular) {
|
||||
--border-radius: #{globals.$ion-border-radius-0};
|
||||
|
||||
@include globals.border-radius(globals.$ion-border-radius-0);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./accordion-group.native";
|
||||
@import "./accordion-group";
|
||||
|
||||
// iOS Accordion Group
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./accordion-group.native";
|
||||
@import "./accordion-group";
|
||||
@import "../accordion/accordion.md.vars";
|
||||
|
||||
// Material Design Accordion Group
|
||||
@@ -11,12 +11,7 @@
|
||||
:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanding),
|
||||
:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-expanded) {
|
||||
@include margin($accordion-md-expanded-margin, 0, $accordion-md-expanded-margin, 0);
|
||||
@include border-radius(
|
||||
$accordion-md-border-radius,
|
||||
$accordion-md-border-radius,
|
||||
$accordion-md-border-radius,
|
||||
$accordion-md-border-radius
|
||||
);
|
||||
@include border-radius($accordion-md-border-radius, $accordion-md-border-radius, $accordion-md-border-radius, $accordion-md-border-radius);
|
||||
}
|
||||
|
||||
:host(.accordion-group-expand-inset) ::slotted(ion-accordion.accordion-previous) {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
@import "./accordion-group.common";
|
||||
@import "../../themes/native/native.globals";
|
||||
@import "../../themes/ionic.globals";
|
||||
@import "../accordion/accordion.vars";
|
||||
|
||||
// Accordion Group: Native
|
||||
// Accordion Group
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
:host(.accordion-group-expand-inset) {
|
||||
@include margin($accordion-inset-margin, $accordion-inset-margin, $accordion-inset-margin, $accordion-inset-margin);
|
||||
}
|
||||
@@ -2,20 +2,18 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
|
||||
import { Component, Element, Event, Host, Listen, Method, Prop, Watch, h } from '@stencil/core';
|
||||
import { printIonWarning } from '@utils/logging';
|
||||
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
import type { AccordionGroupChangeEventDetail } from './accordion-group-interface';
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*/
|
||||
@Component({
|
||||
tag: 'ion-accordion-group',
|
||||
styleUrls: {
|
||||
ios: 'accordion-group.ios.scss',
|
||||
md: 'accordion-group.md.scss',
|
||||
ionic: 'accordion-group.ionic.scss',
|
||||
},
|
||||
shadow: true,
|
||||
})
|
||||
@@ -60,16 +58,6 @@ export class AccordionGroup implements ComponentInterface {
|
||||
*/
|
||||
@Prop() expand: 'compact' | 'inset' = 'compact';
|
||||
|
||||
/**
|
||||
* Set to `"soft"` for an accordion group with slightly rounded corners,
|
||||
* `"round"` for an accordion group with fully rounded corners, or
|
||||
* `"rectangular"` for an accordion group without rounded corners.
|
||||
*
|
||||
* Defaults to `"round"` for the `ionic` theme, undefined for all other themes.
|
||||
* Only applies when `expand` is set to `"inset"`.
|
||||
*/
|
||||
@Prop() shape?: 'soft' | 'round' | 'rectangular';
|
||||
|
||||
/**
|
||||
* Emitted when the value property has changed as a result of a user action such as a click.
|
||||
*
|
||||
@@ -288,35 +276,17 @@ export class AccordionGroup implements ComponentInterface {
|
||||
return Array.from(this.el.querySelectorAll(':scope > ion-accordion')) as HTMLIonAccordionElement[];
|
||||
}
|
||||
|
||||
private getShape(): string | undefined {
|
||||
const theme = getIonTheme(this);
|
||||
const { shape } = this;
|
||||
|
||||
// TODO(ROU-11328): Remove theme check when shapes are defined for all themes.
|
||||
if (theme !== 'ionic') {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (shape === undefined) {
|
||||
return 'round';
|
||||
}
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { disabled, readonly, expand } = this;
|
||||
const theme = getIonTheme(this);
|
||||
const shape = this.getShape();
|
||||
const mode = getIonMode(this);
|
||||
|
||||
return (
|
||||
<Host
|
||||
class={{
|
||||
[theme]: true,
|
||||
[mode]: true,
|
||||
'accordion-group-disabled': disabled,
|
||||
'accordion-group-readonly': readonly,
|
||||
[`accordion-group-expand-${expand}`]: true,
|
||||
[`accordion-group-shape-${shape}`]: shape !== undefined,
|
||||
}}
|
||||
role="presentation"
|
||||
>
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion-group: expand'), () => {
|
||||
test.describe(title('compact'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #ccc7c7;
|
||||
}
|
||||
</style>
|
||||
<ion-accordion-group>
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-compact'));
|
||||
});
|
||||
|
||||
test('should not have visual regressions when expanded', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #ccc7c7;
|
||||
}
|
||||
</style>
|
||||
<ion-accordion-group value="first">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-compact-expanded'));
|
||||
});
|
||||
});
|
||||
|
||||
test.describe(title('inset'), () => {
|
||||
test('should not have visual regressions', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #ccc7c7;
|
||||
}
|
||||
</style>
|
||||
<ion-accordion-group expand="inset">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-inset'));
|
||||
});
|
||||
|
||||
test('should not have visual regressions when expanded', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #ccc7c7;
|
||||
}
|
||||
</style>
|
||||
<ion-accordion-group value="first" expand="inset">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-expand-inset-expanded'));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -1,135 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Accordion Group - Expand</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
<style>
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-row-gap: 20px;
|
||||
grid-column-gap: 20px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
|
||||
color: #6f7378;
|
||||
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
<ion-header translucent="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>Accordion Group - Expand</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content fullscreen="true" color="light">
|
||||
<div class="grid ion-padding">
|
||||
<div class="grid-item">
|
||||
<h2>Default</h2>
|
||||
<ion-accordion-group>
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Default: Expanded</h2>
|
||||
<ion-accordion-group value="first">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Inset</h2>
|
||||
<ion-accordion-group expand="inset">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Inset: Expanded</h2>
|
||||
<ion-accordion-group value="first" expand="inset">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,47 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion-group: shape'), () => {
|
||||
['round', 'soft', 'rectangular'].forEach((shape) => {
|
||||
test(`${shape} - should not have visual regressions`, async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #222;
|
||||
}
|
||||
</style>
|
||||
|
||||
<ion-accordion-group value="first" expand="inset" shape="${shape}">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot(`accordion-group-shape-${shape}`));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
@@ -1,135 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Accordion Group - Shape</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
<style>
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-row-gap: 20px;
|
||||
grid-column-gap: 20px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
|
||||
color: #6f7378;
|
||||
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
<ion-header translucent="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>Accordion Group - Shape</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content fullscreen="true" color="light">
|
||||
<div class="grid ion-padding">
|
||||
<div class="grid-item">
|
||||
<h2>Default</h2>
|
||||
<ion-accordion-group expand="inset" value="first">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Round</h2>
|
||||
<ion-accordion-group expand="inset" value="first" shape="round">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Soft</h2>
|
||||
<ion-accordion-group expand="inset" value="first" shape="soft">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Rectangular</h2>
|
||||
<ion-accordion-group expand="inset" value="first" shape="rectangular">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,38 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion-group: states'), () => {
|
||||
test('should render disabled state', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-accordion-group value="first" disabled="true">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot('accordion-group-disabled'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,89 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Accordion Group - States</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
|
||||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
|
||||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
|
||||
<script src="../../../../../scripts/testing/scripts.js"></script>
|
||||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
|
||||
<style>
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-row-gap: 20px;
|
||||
grid-column-gap: 20px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
|
||||
color: #6f7378;
|
||||
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ion-app>
|
||||
<ion-header translucent="true">
|
||||
<ion-toolbar>
|
||||
<ion-title>Accordion Group - States</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content fullscreen="true" color="light">
|
||||
<div class="grid ion-padding">
|
||||
<div class="grid-item">
|
||||
<h2>Default</h2>
|
||||
<ion-accordion-group value="first">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
<div class="grid-item">
|
||||
<h2>Disabled</h2>
|
||||
<ion-accordion-group value="first" disabled="true">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,76 +0,0 @@
|
||||
@use "../../themes/ionic/ionic.globals.scss" as globals;
|
||||
@use "./accordion.common";
|
||||
|
||||
// Ionic Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
// The border is added to the ::after element
|
||||
// to properly inset the border relative to the entire
|
||||
// accordion, rather than just the header.
|
||||
:host::after {
|
||||
@include globals.margin(null, globals.$ion-space-400, null, globals.$ion-space-400);
|
||||
@include globals.position(null, 0, 0, 0);
|
||||
|
||||
display: block;
|
||||
|
||||
position: absolute;
|
||||
|
||||
height: globals.$ion-border-size-025;
|
||||
|
||||
background-color: globals.$ion-border-default;
|
||||
|
||||
content: "";
|
||||
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
:host(.accordion-animated) {
|
||||
transition: all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);
|
||||
}
|
||||
|
||||
:host(.accordion-animated) #content {
|
||||
transition: max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);
|
||||
}
|
||||
|
||||
// Accordion Header
|
||||
// --------------------------------------------------
|
||||
|
||||
// The border is removed from the item in the header because
|
||||
// we are adding a border to the ::after element of the accordion.
|
||||
::slotted(ion-item[slot="header"]) {
|
||||
--border-radius: inherit;
|
||||
--color: #{globals.$ion-text-default};
|
||||
--border-width: #{globals.$ion-border-size-0};
|
||||
--inner-border-width: #{globals.$ion-scale-0};
|
||||
--min-height: #{globals.$ion-scale-700};
|
||||
--padding-top: #{globals.$ion-space-300};
|
||||
--padding-end: #{globals.$ion-space-400};
|
||||
--padding-bottom: #{globals.$ion-space-300};
|
||||
--padding-start: #{globals.$ion-space-400};
|
||||
|
||||
@include globals.typography(globals.$ion-heading-h6-medium);
|
||||
}
|
||||
|
||||
// Accordion Content
|
||||
// --------------------------------------------------
|
||||
|
||||
#content-wrapper {
|
||||
@include globals.padding(null, globals.$ion-space-400, globals.$ion-space-300, globals.$ion-space-400);
|
||||
@include globals.typography(globals.$ion-body-md-regular);
|
||||
|
||||
color: globals.$ion-text-default;
|
||||
}
|
||||
|
||||
// Disabled Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
:host(.accordion-disabled)::before {
|
||||
@include globals.border-radius(inherit);
|
||||
@include globals.disabled-state();
|
||||
|
||||
z-index: 2;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./accordion.native";
|
||||
@import "./accordion.scss";
|
||||
@import "../item/item.ios.vars";
|
||||
|
||||
// iOS Accordion
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./accordion.native";
|
||||
@import "./accordion.scss";
|
||||
|
||||
// Material Design Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
@import "../../themes/native/native.globals.md";
|
||||
@import "../../themes/ionic.globals.md";
|
||||
|
||||
// Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Border radius applied to the accordion
|
||||
$accordion-md-border-radius: 6px;
|
||||
$accordion-md-border-radius: 6px;
|
||||
|
||||
/// @prop - Box shadow of the accordion
|
||||
$accordion-md-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14),
|
||||
0px 1px 5px 0px rgba(0, 0, 0, 0.12);
|
||||
$accordion-md-box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
|
||||
|
||||
/// @prop - Margin of the expanded accordion
|
||||
$accordion-md-expanded-margin: 16px;
|
||||
$accordion-md-expanded-margin: 16px;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
@import "./accordion.common";
|
||||
@import "./accordion.vars.scss";
|
||||
|
||||
// Accordion: Native
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
background-color: $accordion-background-color;
|
||||
}
|
||||
|
||||
:host(.accordion-animated) {
|
||||
transition: all $accordion-transition-duration $accordion-transition-easing;
|
||||
}
|
||||
|
||||
:host(.accordion-animated) #content {
|
||||
transition: max-height $accordion-transition-duration $accordion-transition-easing;
|
||||
}
|
||||
|
||||
/**
|
||||
* We do not set the opacity on the
|
||||
* host otherwise you would see the
|
||||
* box-shadow behind it.
|
||||
*/
|
||||
:host(.accordion-disabled) #header,
|
||||
:host(.accordion-disabled) #content {
|
||||
opacity: $accordion-disabled-opacity;
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
// Accordion: Common
|
||||
@import "./accordion.vars.scss";
|
||||
|
||||
// Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
:host {
|
||||
@@ -8,6 +10,8 @@
|
||||
|
||||
width: 100%;
|
||||
|
||||
background-color: $accordion-background-color;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
/**
|
||||
@@ -26,6 +30,14 @@
|
||||
--border-width: 0px;
|
||||
}
|
||||
|
||||
:host(.accordion-animated) {
|
||||
transition: all $accordion-transition-duration $accordion-transition-easing;
|
||||
}
|
||||
|
||||
:host(.accordion-animated) #content {
|
||||
transition: max-height $accordion-transition-duration $accordion-transition-easing;
|
||||
}
|
||||
|
||||
#content {
|
||||
overflow: hidden;
|
||||
|
||||
@@ -60,6 +72,16 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* We do not set the opacity on the
|
||||
* host otherwise you would see the
|
||||
* box-shadow behind it.
|
||||
*/
|
||||
:host(.accordion-disabled) #header,
|
||||
:host(.accordion-disabled) #content {
|
||||
opacity: $accordion-disabled-opacity;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
:host,
|
||||
#content {
|
||||
@@ -1,12 +1,10 @@
|
||||
import caretDownRegular from '@phosphor-icons/core/assets/regular/caret-down.svg';
|
||||
import type { ComponentInterface } from '@stencil/core';
|
||||
import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';
|
||||
import { addEventListener, getElementRoot, raf, removeEventListener, transitionEndAsync } from '@utils/helpers';
|
||||
import { hostContext } from '@utils/theme';
|
||||
import { chevronDown } from 'ionicons/icons';
|
||||
|
||||
import { config } from '../../global/config';
|
||||
import { getIonTheme } from '../../global/ionic-global';
|
||||
import { getIonMode } from '../../global/ionic-global';
|
||||
|
||||
const enum AccordionState {
|
||||
Collapsed = 1 << 0,
|
||||
@@ -16,8 +14,7 @@ const enum AccordionState {
|
||||
}
|
||||
|
||||
/**
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
||||
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
||||
* @virtualProp {"ios" | "md"} mode - The mode determines which platform styles to use.
|
||||
*
|
||||
* @slot header - Content is placed at the top and is used to
|
||||
* expand or collapse the accordion item.
|
||||
@@ -34,7 +31,6 @@ const enum AccordionState {
|
||||
styleUrls: {
|
||||
ios: 'accordion.ios.scss',
|
||||
md: 'accordion.md.scss',
|
||||
ionic: 'accordion.ionic.scss',
|
||||
},
|
||||
shadow: {
|
||||
delegatesFocus: true,
|
||||
@@ -49,7 +45,7 @@ export class Accordion implements ComponentInterface {
|
||||
|
||||
private currentRaf: number | undefined;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
@Element() el?: HTMLElement;
|
||||
|
||||
@State() state: AccordionState = AccordionState.Collapsed;
|
||||
@State() isNext = false;
|
||||
@@ -81,7 +77,7 @@ export class Accordion implements ComponentInterface {
|
||||
* rotated when the accordion is expanded
|
||||
* or collapsed.
|
||||
*/
|
||||
@Prop() toggleIcon?: string;
|
||||
@Prop() toggleIcon = chevronDown;
|
||||
|
||||
/**
|
||||
* The slot inside of `ion-item` to
|
||||
@@ -189,34 +185,13 @@ export class Accordion implements ComponentInterface {
|
||||
button.setAttribute('aria-expanded', `${expanded}`);
|
||||
};
|
||||
|
||||
get accordionToggleIcon() {
|
||||
// Return the icon if it is explicitly set
|
||||
if (this.toggleIcon != null) {
|
||||
return this.toggleIcon;
|
||||
}
|
||||
|
||||
// Determine the theme and map to default icons
|
||||
const theme = getIonTheme(this);
|
||||
const defaultIcons = {
|
||||
ios: chevronDown,
|
||||
ionic: caretDownRegular,
|
||||
md: chevronDown,
|
||||
};
|
||||
|
||||
// Get the default icon based on the theme, falling back to 'md' icon if necessary
|
||||
const defaultIcon = defaultIcons[theme] || defaultIcons.md;
|
||||
|
||||
// Return the configured accordion toggle icon or the default icon
|
||||
return config.get('accordionToggleIcon', defaultIcon);
|
||||
}
|
||||
|
||||
private slotToggleIcon = () => {
|
||||
const ionItem = this.getSlottedHeaderIonItem();
|
||||
if (!ionItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { accordionToggleIcon, toggleIconSlot } = this;
|
||||
const { toggleIconSlot, toggleIcon } = this;
|
||||
|
||||
/**
|
||||
* Check if there already is a toggle icon.
|
||||
@@ -231,7 +206,7 @@ export class Accordion implements ComponentInterface {
|
||||
iconEl.slot = toggleIconSlot;
|
||||
iconEl.lazy = false;
|
||||
iconEl.classList.add('ion-accordion-toggle-icon');
|
||||
iconEl.icon = accordionToggleIcon;
|
||||
iconEl.icon = toggleIcon;
|
||||
iconEl.setAttribute('aria-hidden', 'true');
|
||||
|
||||
ionItem.appendChild(iconEl);
|
||||
@@ -379,6 +354,10 @@ export class Accordion implements ComponentInterface {
|
||||
};
|
||||
|
||||
private getNextSibling = () => {
|
||||
if (!this.el) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextSibling = this.el.nextElementSibling;
|
||||
|
||||
if (nextSibling?.tagName !== 'ION-ACCORDION') {
|
||||
@@ -389,6 +368,10 @@ export class Accordion implements ComponentInterface {
|
||||
};
|
||||
|
||||
private getPreviousSibling = () => {
|
||||
if (!this.el) {
|
||||
return;
|
||||
}
|
||||
|
||||
const previousSibling = this.el.previousElementSibling;
|
||||
|
||||
if (previousSibling?.tagName !== 'ION-ACCORDION') {
|
||||
@@ -419,7 +402,7 @@ export class Accordion implements ComponentInterface {
|
||||
|
||||
render() {
|
||||
const { disabled, readonly } = this;
|
||||
const theme = getIonTheme(this);
|
||||
const mode = getIonMode(this);
|
||||
const expanded = this.state === AccordionState.Expanded || this.state === AccordionState.Expanding;
|
||||
const headerPart = expanded ? 'header expanded' : 'header';
|
||||
const contentPart = expanded ? 'content expanded' : 'content';
|
||||
@@ -429,7 +412,7 @@ export class Accordion implements ComponentInterface {
|
||||
return (
|
||||
<Host
|
||||
class={{
|
||||
[theme]: true,
|
||||
[mode]: true,
|
||||
'accordion-expanding': this.state === AccordionState.Expanding,
|
||||
'accordion-expanded': this.state === AccordionState.Expanded,
|
||||
'accordion-collapsing': this.state === AccordionState.Collapsing,
|
||||
@@ -442,8 +425,6 @@ export class Accordion implements ComponentInterface {
|
||||
'accordion-readonly': readonly,
|
||||
|
||||
'accordion-animated': this.shouldAnimate(),
|
||||
|
||||
'in-accordion-group-expand-inset': hostContext('.accordion-group-expand-inset', this.el),
|
||||
}}
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
@import "../../themes/native/native.globals";
|
||||
@import "../../themes/ionic.globals";
|
||||
|
||||
// Accordion
|
||||
// --------------------------------------------------
|
||||
|
||||
/// @prop - Background color of the accordion
|
||||
$accordion-background-color: var(--ion-background-color, #ffffff);
|
||||
$accordion-background-color: var(--ion-background-color, #ffffff);
|
||||
|
||||
/// @prop - Duration of the accordion transition
|
||||
$accordion-transition-duration: 300ms;
|
||||
$accordion-transition-duration: 300ms;
|
||||
|
||||
/// @prop - Timing function of the accordion transition
|
||||
$accordion-transition-easing: cubic-bezier(0.25, 0.8, 0.5, 1);
|
||||
$accordion-transition-easing: cubic-bezier(0.25, 0.8, 0.5, 1);
|
||||
|
||||
/// @prop - Opacity of the disabled accordion
|
||||
$accordion-disabled-opacity: 0.4;
|
||||
$accordion-disabled-opacity: 0.4;
|
||||
|
||||
/// @prop - Margin of the inset accordion
|
||||
$accordion-inset-margin: 16px;
|
||||
$accordion-inset-margin: 16px;
|
||||
|
||||
@@ -12,7 +12,6 @@ configs().forEach(({ config, screenshot, title }) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
|
||||
test.describe(title('accordion: ionChange'), () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -59,39 +58,3 @@ configs({ directions: ['ltr'] }).forEach(({ config, title }) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
configs({ modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion: basic'), () => {
|
||||
test('should not have visual regressions with text content', async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<ion-accordion-group value="first">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordion = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordion).toHaveScreenshot(screenshot('accordion-basic-text'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB |
@@ -1,7 +1,7 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md', 'md', 'ios'] }).forEach(({ config, screenshot, title }) => {
|
||||
configs({ directions: ['ltr'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion: multiple'), () => {
|
||||
test('should update value and visually expand items', async ({ page }) => {
|
||||
await page.goto(`/src/components/accordion/test/multiple`, config);
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,48 +0,0 @@
|
||||
import { expect } from '@playwright/test';
|
||||
import { configs, test } from '@utils/test/playwright';
|
||||
|
||||
configs({ directions: ['ltr'], modes: ['ionic-md'] }).forEach(({ config, screenshot, title }) => {
|
||||
test.describe(title('accordion: shape'), () => {
|
||||
['round', 'soft', 'rectangular'].forEach((shape) => {
|
||||
test(`${shape} - should not have visual regressions`, async ({ page }) => {
|
||||
await page.setContent(
|
||||
`
|
||||
<style>
|
||||
/* Background styles to show the border radius */
|
||||
:root {
|
||||
--background: #222;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Focused accordion to show the border radius -->
|
||||
<ion-accordion-group value="first" expand="inset" shape="${shape}">
|
||||
<ion-accordion value="first">
|
||||
<ion-item slot="header" class="ion-focused">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="second">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
<ion-accordion value="third">
|
||||
<ion-item slot="header">
|
||||
<ion-label>Accordion title</ion-label>
|
||||
</ion-item>
|
||||
<div slot="content">This is the body of the accordion.</div>
|
||||
</ion-accordion>
|
||||
</ion-accordion-group>
|
||||
`,
|
||||
config
|
||||
);
|
||||
|
||||
const accordionGroup = page.locator('ion-accordion-group');
|
||||
|
||||
await expect(accordionGroup).toHaveScreenshot(screenshot(`accordion-shape-${shape}`));
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 14 KiB |