@api-client/ui 0.2.13 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -0
- package/build/src/core/ModalActivity.d.ts +1 -1
- package/build/src/core/ModalActivity.d.ts.map +1 -1
- package/build/src/core/ModalActivity.js +6 -5
- package/build/src/core/ModalActivity.js.map +1 -1
- package/build/src/core/ThemeManager.d.ts +4 -2
- package/build/src/core/ThemeManager.d.ts.map +1 -1
- package/build/src/core/ThemeManager.js.map +1 -1
- package/build/src/demo/DemoPage.d.ts +1 -4
- package/build/src/demo/DemoPage.d.ts.map +1 -1
- package/build/src/demo/DemoPage.js +2 -5
- package/build/src/demo/DemoPage.js.map +1 -1
- package/build/src/elements/authorization/ui/CcAuthorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/CcAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/CcAuthorization.js +2 -2
- package/build/src/elements/authorization/ui/CcAuthorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/OAuth2Authorization.js +11 -5
- package/build/src/elements/authorization/ui/OAuth2Authorization.js.map +1 -1
- package/build/src/elements/authorization/ui/OidcAuthorization.d.ts +1 -2
- package/build/src/elements/authorization/ui/OidcAuthorization.d.ts.map +1 -1
- package/build/src/elements/authorization/ui/OidcAuthorization.js +10 -8
- package/build/src/elements/authorization/ui/OidcAuthorization.js.map +1 -1
- package/build/src/elements/code/HttpSnippets.d.ts +1 -1
- package/build/src/elements/code/HttpSnippets.d.ts.map +1 -1
- package/build/src/elements/code/HttpSnippets.js +5 -5
- package/build/src/elements/code/HttpSnippets.js.map +1 -1
- package/build/src/elements/dialog/internals/ConfirmDelete.d.ts +1 -1
- package/build/src/elements/dialog/internals/ConfirmDelete.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/ConfirmDelete.js +5 -5
- package/build/src/elements/dialog/internals/ConfirmDelete.js.map +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts +1 -1
- package/build/src/elements/dialog/internals/Rename.d.ts.map +1 -1
- package/build/src/elements/dialog/internals/Rename.js +6 -5
- package/build/src/elements/dialog/internals/Rename.js.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts +1 -1
- package/build/src/elements/environment/EnvironmentEditor.d.ts.map +1 -1
- package/build/src/elements/environment/EnvironmentEditor.js +5 -4
- package/build/src/elements/environment/EnvironmentEditor.js.map +1 -1
- package/build/src/elements/http/BodyEditor.d.ts +1 -3
- package/build/src/elements/http/BodyEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyEditor.js +25 -20
- package/build/src/elements/http/BodyEditor.js.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.d.ts +1 -1
- package/build/src/elements/http/BodyMultipartEditor.d.ts.map +1 -1
- package/build/src/elements/http/BodyMultipartEditor.js +3 -3
- package/build/src/elements/http/BodyMultipartEditor.js.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.d.ts +1 -3
- package/build/src/elements/http/CertificateAdd.element.d.ts.map +1 -1
- package/build/src/elements/http/CertificateAdd.element.js +6 -10
- package/build/src/elements/http/CertificateAdd.element.js.map +1 -1
- package/build/src/elements/http/HeadersForm.d.ts +1 -1
- package/build/src/elements/http/HeadersForm.d.ts.map +1 -1
- package/build/src/elements/http/HeadersForm.js +3 -3
- package/build/src/elements/http/HeadersForm.js.map +1 -1
- package/build/src/elements/http/HttpAssertions.element.d.ts +1 -1
- package/build/src/elements/http/HttpAssertions.element.d.ts.map +1 -1
- package/build/src/elements/http/HttpAssertions.element.js +2 -2
- package/build/src/elements/http/HttpAssertions.element.js.map +1 -1
- package/build/src/elements/http/HttpFlows.element.d.ts +1 -1
- package/build/src/elements/http/HttpFlows.element.d.ts.map +1 -1
- package/build/src/elements/http/HttpFlows.element.js +6 -6
- package/build/src/elements/http/HttpFlows.element.js.map +1 -1
- package/build/src/elements/http/RequestEditor.d.ts +1 -3
- package/build/src/elements/http/RequestEditor.d.ts.map +1 -1
- package/build/src/elements/http/RequestEditor.js +10 -11
- package/build/src/elements/http/RequestEditor.js.map +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts +1 -1
- package/build/src/elements/http/UrlParamsForm.d.ts.map +1 -1
- package/build/src/elements/http/UrlParamsForm.js +4 -4
- package/build/src/elements/http/UrlParamsForm.js.map +1 -1
- package/build/src/elements/project/HttpProjectRequest.d.ts +1 -1
- package/build/src/elements/project/HttpProjectRequest.d.ts.map +1 -1
- package/build/src/elements/project/HttpProjectRequest.js +3 -3
- package/build/src/elements/project/HttpProjectRequest.js.map +1 -1
- package/build/src/elements/project/HttpProjectRequestHistory.d.ts +1 -2
- package/build/src/elements/project/HttpProjectRequestHistory.d.ts.map +1 -1
- package/build/src/elements/project/HttpProjectRequestHistory.js +5 -6
- package/build/src/elements/project/HttpProjectRequestHistory.js.map +1 -1
- package/build/src/elements/project/ProjectRunReport.d.ts +1 -1
- package/build/src/elements/project/ProjectRunReport.d.ts.map +1 -1
- package/build/src/elements/project/ProjectRunReport.js +7 -7
- package/build/src/elements/project/ProjectRunReport.js.map +1 -1
- package/build/src/elements/project/ProjectRunner.d.ts +1 -2
- package/build/src/elements/project/ProjectRunner.d.ts.map +1 -1
- package/build/src/elements/project/ProjectRunner.js +4 -5
- package/build/src/elements/project/ProjectRunner.js.map +1 -1
- package/build/src/md/button/internals/base.d.ts +98 -0
- package/build/src/md/button/internals/base.d.ts.map +1 -0
- package/build/src/md/button/internals/base.js +353 -0
- package/build/src/md/button/internals/base.js.map +1 -0
- package/build/src/md/button/internals/button.d.ts +7 -75
- package/build/src/md/button/internals/button.d.ts.map +1 -1
- package/build/src/md/button/internals/button.js +18 -247
- package/build/src/md/button/internals/button.js.map +1 -1
- package/build/src/md/button/internals/{button-styles.d.ts → button.styles.d.ts} +1 -1
- package/build/src/md/button/internals/button.styles.d.ts.map +1 -0
- package/build/src/md/button/internals/button.styles.js +319 -0
- package/build/src/md/button/internals/button.styles.js.map +1 -0
- package/build/src/md/button/internals/group.d.ts +54 -0
- package/build/src/md/button/internals/group.d.ts.map +1 -0
- package/build/src/md/button/internals/group.js +157 -0
- package/build/src/md/button/internals/group.js.map +1 -0
- package/build/src/md/button/internals/{text-button.styles.d.ts → group.styles.d.ts} +1 -1
- package/build/src/md/button/internals/group.styles.d.ts.map +1 -0
- package/build/src/md/button/internals/group.styles.js +102 -0
- package/build/src/md/button/internals/group.styles.js.map +1 -0
- package/build/src/md/button/ui-button-group.d.ts +11 -0
- package/build/src/md/button/ui-button-group.d.ts.map +1 -0
- package/build/src/md/{icon-button/ui-filled-icon-button.js → button/ui-button-group.js} +10 -11
- package/build/src/md/button/ui-button-group.js.map +1 -0
- package/build/src/md/button/ui-button.d.ts +14 -0
- package/build/src/md/button/ui-button.d.ts.map +1 -0
- package/build/src/md/button/{ui-text-button.js → ui-button.js} +10 -11
- package/build/src/md/button/ui-button.js.map +1 -0
- package/build/src/md/dialog/internals/Dialog.d.ts +5 -5
- package/build/src/md/dialog/internals/Dialog.d.ts.map +1 -1
- package/build/src/md/dialog/internals/Dialog.js +14 -9
- package/build/src/md/dialog/internals/Dialog.js.map +1 -1
- package/build/src/md/dropdown-list/internals/UiDropdownList.d.ts +1 -1
- package/build/src/md/dropdown-list/internals/UiDropdownList.js +1 -1
- package/build/src/md/dropdown-list/internals/UiDropdownList.js.map +1 -1
- package/build/src/md/icon-button/internals/IconButton.d.ts +12 -36
- package/build/src/md/icon-button/internals/IconButton.d.ts.map +1 -1
- package/build/src/md/icon-button/internals/IconButton.js +32 -144
- package/build/src/md/icon-button/internals/IconButton.js.map +1 -1
- package/build/src/md/{button/internals/filled-button.styles.d.ts → icon-button/internals/IconButton.styles.d.ts} +1 -1
- package/build/src/md/icon-button/internals/IconButton.styles.d.ts.map +1 -0
- package/build/src/md/icon-button/internals/IconButton.styles.js +286 -0
- package/build/src/md/icon-button/internals/IconButton.styles.js.map +1 -0
- package/build/src/md/icon-button/ui-icon-button.d.ts.map +1 -1
- package/build/src/md/icon-button/ui-icon-button.js +2 -3
- package/build/src/md/icon-button/ui-icon-button.js.map +1 -1
- package/build/src/md/ripple/internals/ripple.d.ts +2 -0
- package/build/src/md/ripple/internals/ripple.d.ts.map +1 -1
- package/build/src/md/ripple/internals/ripple.js +20 -10
- package/build/src/md/ripple/internals/ripple.js.map +1 -1
- package/build/src/md/ripple/internals/ripple.styles.d.ts.map +1 -1
- package/build/src/md/ripple/internals/ripple.styles.js +8 -20
- package/build/src/md/ripple/internals/ripple.styles.js.map +1 -1
- package/build/src/md/snackbar/internals/Snackbar.d.ts +1 -1
- package/build/src/md/snackbar/internals/Snackbar.d.ts.map +1 -1
- package/build/src/md/snackbar/internals/Snackbar.js +4 -2
- package/build/src/md/snackbar/internals/Snackbar.js.map +1 -1
- package/build/src/md/text-field/internals/filled.styles.d.ts.map +1 -1
- package/build/src/md/text-field/internals/filled.styles.js +3 -0
- package/build/src/md/text-field/internals/filled.styles.js.map +1 -1
- package/build/src/styles/m3/dialog.module.d.ts +2 -2
- package/build/src/styles/m3/dialog.module.js +2 -2
- package/build/src/styles/m3/dialog.module.js.map +1 -1
- package/build/src/styles/m3/tokens.d.ts.map +1 -1
- package/build/src/styles/m3/tokens.js +208 -182
- package/build/src/styles/m3/tokens.js.map +1 -1
- package/demo/elements/authorization/oauth-authorize.html +1 -1
- package/demo/elements/authorization/oauth-authorize.ts +1 -1
- package/demo/elements/environment/variables-editor.ts +2 -2
- package/demo/elements/http/url-editing.ts +3 -3
- package/demo/elements/project/request-editor.ts +4 -4
- package/demo/layout/index.ts +5 -5
- package/demo/md/buttons/button.html +121 -0
- package/demo/md/buttons/button.ts +246 -0
- package/demo/md/buttons/{index.html → group.html} +15 -2
- package/demo/md/buttons/group.ts +171 -0
- package/demo/md/checkbox/index.ts +1 -1
- package/demo/md/dialog/dialog.ts +8 -9
- package/demo/md/dropdown-list/index.ts +68 -71
- package/demo/md/icon-button/index.html +97 -7
- package/demo/md/icon-button/index.ts +97 -201
- package/demo/md/index.html +3 -1
- package/demo/md/inputs/input.ts +1 -1
- package/demo/md/inputs/radio.ts +1 -1
- package/demo/md/inputs/switch.ts +1 -1
- package/demo/md/notification/snack.ts +5 -5
- package/demo/md/progress/progress.ts +4 -3
- package/package.json +2 -2
- package/src/core/ModalActivity.ts +6 -5
- package/src/core/ThemeManager.ts +5 -4
- package/src/demo/DemoPage.ts +2 -5
- package/src/elements/authorization/ui/CcAuthorization.ts +2 -2
- package/src/elements/authorization/ui/OAuth2Authorization.ts +11 -5
- package/src/elements/authorization/ui/OidcAuthorization.ts +10 -8
- package/src/elements/code/HttpSnippets.ts +5 -5
- package/src/elements/dialog/internals/ConfirmDelete.ts +5 -5
- package/src/elements/dialog/internals/Rename.ts +6 -5
- package/src/elements/environment/EnvironmentEditor.ts +5 -4
- package/src/elements/http/BodyEditor.ts +25 -20
- package/src/elements/http/BodyMultipartEditor.ts +3 -3
- package/src/elements/http/CertificateAdd.element.ts +6 -10
- package/src/elements/http/HeadersForm.ts +3 -3
- package/src/elements/http/HttpAssertions.element.ts +2 -2
- package/src/elements/http/HttpFlows.element.ts +6 -6
- package/src/elements/http/RequestEditor.ts +10 -11
- package/src/elements/http/UrlParamsForm.ts +4 -4
- package/src/elements/project/HttpProjectRequest.ts +3 -3
- package/src/elements/project/HttpProjectRequestHistory.ts +5 -6
- package/src/elements/project/ProjectRunReport.ts +7 -7
- package/src/elements/project/ProjectRunner.ts +4 -5
- package/src/md/button/internals/base.ts +299 -0
- package/src/md/button/internals/button.styles.ts +319 -0
- package/src/md/button/internals/button.ts +8 -234
- package/src/md/button/internals/group.styles.ts +102 -0
- package/src/md/button/internals/group.ts +121 -0
- package/src/md/button/ui-button-group.ts +15 -0
- package/src/md/button/ui-button.ts +18 -0
- package/src/md/dialog/internals/Dialog.ts +14 -9
- package/src/md/dropdown-list/internals/UiDropdownList.ts +1 -1
- package/src/md/icon-button/internals/IconButton.styles.ts +286 -0
- package/src/md/icon-button/internals/IconButton.ts +15 -139
- package/src/md/icon-button/ui-icon-button.ts +2 -3
- package/src/md/ripple/internals/ripple.styles.ts +8 -20
- package/src/md/ripple/internals/ripple.ts +21 -13
- package/src/md/snackbar/internals/Snackbar.ts +4 -2
- package/src/md/text-field/internals/filled.styles.ts +3 -0
- package/src/styles/m3/dialog.module.ts +2 -2
- package/src/styles/m3/native.css +270 -0
- package/src/styles/m3/tokens.css +208 -182
- package/src/styles/m3/tokens.ts +208 -182
- package/test/ui/button/UiButton.test.ts +51 -29
- package/test/ui/button/UiIconButton.test.ts +25 -19
- package/test/ui/dialog/UiDialog.test.ts +10 -10
- package/build/src/md/button/internals/button-styles.d.ts.map +0 -1
- package/build/src/md/button/internals/button-styles.js +0 -143
- package/build/src/md/button/internals/button-styles.js.map +0 -1
- package/build/src/md/button/internals/elevated-button.d.ts +0 -4
- package/build/src/md/button/internals/elevated-button.d.ts.map +0 -1
- package/build/src/md/button/internals/elevated-button.js +0 -4
- package/build/src/md/button/internals/elevated-button.js.map +0 -1
- package/build/src/md/button/internals/elevated-button.styles.d.ts +0 -3
- package/build/src/md/button/internals/elevated-button.styles.d.ts.map +0 -1
- package/build/src/md/button/internals/elevated-button.styles.js +0 -38
- package/build/src/md/button/internals/elevated-button.styles.js.map +0 -1
- package/build/src/md/button/internals/filled-button.d.ts +0 -4
- package/build/src/md/button/internals/filled-button.d.ts.map +0 -1
- package/build/src/md/button/internals/filled-button.js +0 -4
- package/build/src/md/button/internals/filled-button.js.map +0 -1
- package/build/src/md/button/internals/filled-button.styles.d.ts.map +0 -1
- package/build/src/md/button/internals/filled-button.styles.js +0 -30
- package/build/src/md/button/internals/filled-button.styles.js.map +0 -1
- package/build/src/md/button/internals/filled-tonal-button.d.ts +0 -4
- package/build/src/md/button/internals/filled-tonal-button.d.ts.map +0 -1
- package/build/src/md/button/internals/filled-tonal-button.js +0 -4
- package/build/src/md/button/internals/filled-tonal-button.js.map +0 -1
- package/build/src/md/button/internals/filled-tonal-button.styles.d.ts +0 -3
- package/build/src/md/button/internals/filled-tonal-button.styles.d.ts.map +0 -1
- package/build/src/md/button/internals/filled-tonal-button.styles.js +0 -30
- package/build/src/md/button/internals/filled-tonal-button.styles.js.map +0 -1
- package/build/src/md/button/internals/outlined-button.d.ts +0 -4
- package/build/src/md/button/internals/outlined-button.d.ts.map +0 -1
- package/build/src/md/button/internals/outlined-button.js +0 -4
- package/build/src/md/button/internals/outlined-button.js.map +0 -1
- package/build/src/md/button/internals/outlined-button.styles.d.ts +0 -3
- package/build/src/md/button/internals/outlined-button.styles.d.ts.map +0 -1
- package/build/src/md/button/internals/outlined-button.styles.js +0 -31
- package/build/src/md/button/internals/outlined-button.styles.js.map +0 -1
- package/build/src/md/button/internals/text-button.d.ts +0 -4
- package/build/src/md/button/internals/text-button.d.ts.map +0 -1
- package/build/src/md/button/internals/text-button.js +0 -4
- package/build/src/md/button/internals/text-button.js.map +0 -1
- package/build/src/md/button/internals/text-button.styles.d.ts.map +0 -1
- package/build/src/md/button/internals/text-button.styles.js +0 -30
- package/build/src/md/button/internals/text-button.styles.js.map +0 -1
- package/build/src/md/button/ui-elevated-button.d.ts +0 -14
- package/build/src/md/button/ui-elevated-button.d.ts.map +0 -1
- package/build/src/md/button/ui-elevated-button.js +0 -31
- package/build/src/md/button/ui-elevated-button.js.map +0 -1
- package/build/src/md/button/ui-filled-button.d.ts +0 -14
- package/build/src/md/button/ui-filled-button.d.ts.map +0 -1
- package/build/src/md/button/ui-filled-button.js +0 -31
- package/build/src/md/button/ui-filled-button.js.map +0 -1
- package/build/src/md/button/ui-filled-tonal-button.d.ts +0 -14
- package/build/src/md/button/ui-filled-tonal-button.d.ts.map +0 -1
- package/build/src/md/button/ui-filled-tonal-button.js +0 -31
- package/build/src/md/button/ui-filled-tonal-button.js.map +0 -1
- package/build/src/md/button/ui-outlined-button.d.ts +0 -14
- package/build/src/md/button/ui-outlined-button.d.ts.map +0 -1
- package/build/src/md/button/ui-outlined-button.js +0 -31
- package/build/src/md/button/ui-outlined-button.js.map +0 -1
- package/build/src/md/button/ui-text-button.d.ts +0 -14
- package/build/src/md/button/ui-text-button.d.ts.map +0 -1
- package/build/src/md/button/ui-text-button.js.map +0 -1
- package/build/src/md/icon-button/ui-filled-icon-button.d.ts +0 -11
- package/build/src/md/icon-button/ui-filled-icon-button.d.ts.map +0 -1
- package/build/src/md/icon-button/ui-filled-icon-button.js.map +0 -1
- package/build/src/md/icon-button/ui-filled-tonal-icon-button.d.ts +0 -11
- package/build/src/md/icon-button/ui-filled-tonal-icon-button.d.ts.map +0 -1
- package/build/src/md/icon-button/ui-filled-tonal-icon-button.js +0 -28
- package/build/src/md/icon-button/ui-filled-tonal-icon-button.js.map +0 -1
- package/build/src/md/icon-button/ui-outlined-icon-button.d.ts +0 -11
- package/build/src/md/icon-button/ui-outlined-icon-button.d.ts.map +0 -1
- package/build/src/md/icon-button/ui-outlined-icon-button.js +0 -28
- package/build/src/md/icon-button/ui-outlined-icon-button.js.map +0 -1
- package/demo/md/buttons/index.ts +0 -279
- package/src/md/button/internals/button-styles.ts +0 -143
- package/src/md/button/internals/elevated-button.styles.ts +0 -38
- package/src/md/button/internals/elevated-button.ts +0 -3
- package/src/md/button/internals/filled-button.styles.ts +0 -30
- package/src/md/button/internals/filled-button.ts +0 -3
- package/src/md/button/internals/filled-tonal-button.styles.ts +0 -30
- package/src/md/button/internals/filled-tonal-button.ts +0 -3
- package/src/md/button/internals/outlined-button.styles.ts +0 -31
- package/src/md/button/internals/outlined-button.ts +0 -3
- package/src/md/button/internals/text-button.styles.ts +0 -30
- package/src/md/button/internals/text-button.ts +0 -3
- package/src/md/button/ui-elevated-button.ts +0 -19
- package/src/md/button/ui-filled-button.ts +0 -19
- package/src/md/button/ui-filled-tonal-button.ts +0 -19
- package/src/md/button/ui-outlined-button.ts +0 -19
- package/src/md/button/ui-text-button.ts +0 -19
- package/src/md/icon-button/ui-filled-icon-button.ts +0 -16
- package/src/md/icon-button/ui-filled-tonal-icon-button.ts +0 -16
- package/src/md/icon-button/ui-outlined-icon-button.ts +0 -16
|
@@ -1,47 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import '../../ripple/ui-ripple.js';
|
|
6
|
-
import '@material/web/focus/md-focus-ring.js';
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import BaseButton from '../../button/internals/base.js';
|
|
3
|
+
export type MdIconButtonColor = 'filled' | 'outlined' | 'standard' | 'tonal';
|
|
4
|
+
export type MdIconButtonWidth = 'default' | 'narrow' | 'wide';
|
|
7
5
|
/**
|
|
8
|
-
*
|
|
6
|
+
* An icon button component that extends the functionality of a standard button,
|
|
7
|
+
* but is specifically designed to hold an icon.
|
|
8
|
+
* @slot - The default slot for the icon.
|
|
9
9
|
*/
|
|
10
|
-
export default class IconButton extends
|
|
10
|
+
export default class IconButton extends BaseButton {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* A toggle button behaves different as it gets the `aria-pressed` attribute
|
|
14
|
-
* which changes depending on the pressed state.
|
|
15
|
-
* A toggle button is activated until it is clicked/pressed again.
|
|
16
|
-
* A toggle button dispatched `active` event when the press state change.
|
|
17
|
-
* The host can check the `active` property to know the state.
|
|
18
|
-
*
|
|
12
|
+
* The color of the button.
|
|
19
13
|
* @attribute
|
|
20
14
|
*/
|
|
21
|
-
accessor
|
|
15
|
+
accessor color: MdIconButtonColor;
|
|
22
16
|
/**
|
|
23
|
-
*
|
|
24
|
-
* It is `undefined` and makes no effect when `toggle` is not set.
|
|
25
|
-
*
|
|
17
|
+
* The width of the button.
|
|
26
18
|
* @attribute
|
|
27
19
|
*/
|
|
28
|
-
accessor
|
|
29
|
-
get disabled(): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* When set, the button is a disabled state.
|
|
32
|
-
* @attribute
|
|
33
|
-
*/
|
|
34
|
-
set disabled(value: boolean);
|
|
35
|
-
protected accessor ripple: UiRipple | null;
|
|
36
|
-
constructor();
|
|
37
|
-
connectedCallback(): void;
|
|
38
|
-
protected update(changedProperties: PropertyValues<this>): void;
|
|
39
|
-
protected pressRipple(options: BeginPressConfig): void;
|
|
40
|
-
protected endRipple(): void;
|
|
41
|
-
beginPress(options: BeginPressConfig): void;
|
|
42
|
-
endPress(config: EndPressConfig): void;
|
|
43
|
-
handlePointerEnter(e: PointerEvent): void;
|
|
44
|
-
handlePointerLeave(e: PointerEvent): void;
|
|
20
|
+
accessor width: MdIconButtonWidth;
|
|
45
21
|
protected render(): TemplateResult;
|
|
46
22
|
}
|
|
47
23
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,UAAU,MAAM,gCAAgC,CAAA;AAGvD,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAA;AAC5E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE7D;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAChD;;;OAGG;IACwC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAa;IACzF;;;OAGG;IACwC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAY;cAErE,MAAM,IAAI,cAAc;CAM5C"}
|
|
@@ -1,171 +1,59 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
2
|
import { html } from 'lit';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { UiElement } from '../../UiElement.js';
|
|
7
|
-
import { isDisabled, setDisabled } from '../../../lib/disabled.js';
|
|
8
|
-
import '../../ripple/ui-ripple.js';
|
|
9
|
-
import '@material/web/focus/md-focus-ring.js';
|
|
3
|
+
import BaseButton from '../../button/internals/base.js';
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
10
5
|
let IconButton = (() => {
|
|
11
|
-
let _classSuper =
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
let
|
|
18
|
-
let _active_extraInitializers = [];
|
|
19
|
-
let _set_disabled_decorators;
|
|
20
|
-
let _ripple_decorators;
|
|
21
|
-
let _ripple_initializers = [];
|
|
22
|
-
let _ripple_extraInitializers = [];
|
|
6
|
+
let _classSuper = BaseButton;
|
|
7
|
+
let _color_decorators;
|
|
8
|
+
let _color_initializers = [];
|
|
9
|
+
let _color_extraInitializers = [];
|
|
10
|
+
let _width_decorators;
|
|
11
|
+
let _width_initializers = [];
|
|
12
|
+
let _width_extraInitializers = [];
|
|
23
13
|
return class IconButton extends _classSuper {
|
|
24
14
|
static {
|
|
25
15
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
__esDecorate(this, null, _toggle_decorators, { kind: "accessor", name: "toggle", static: false, private: false, access: { has: obj => "toggle" in obj, get: obj => obj.toggle, set: (obj, value) => { obj.toggle = value; } }, metadata: _metadata }, _toggle_initializers, _toggle_extraInitializers);
|
|
31
|
-
__esDecorate(this, null, _active_decorators, { kind: "accessor", name: "active", static: false, private: false, access: { has: obj => "active" in obj, get: obj => obj.active, set: (obj, value) => { obj.active = value; } }, metadata: _metadata }, _active_initializers, _active_extraInitializers);
|
|
32
|
-
__esDecorate(this, null, _set_disabled_decorators, { kind: "setter", name: "disabled", static: false, private: false, access: { has: obj => "disabled" in obj, set: (obj, value) => { obj.disabled = value; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
33
|
-
__esDecorate(this, null, _ripple_decorators, { kind: "accessor", name: "ripple", static: false, private: false, access: { has: obj => "ripple" in obj, get: obj => obj.ripple, set: (obj, value) => { obj.ripple = value; } }, metadata: _metadata }, _ripple_initializers, _ripple_extraInitializers);
|
|
16
|
+
_color_decorators = [property({ type: String, reflect: true })];
|
|
17
|
+
_width_decorators = [property({ type: String, reflect: true })];
|
|
18
|
+
__esDecorate(this, null, _color_decorators, { kind: "accessor", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
19
|
+
__esDecorate(this, null, _width_decorators, { kind: "accessor", name: "width", static: false, private: false, access: { has: obj => "width" in obj, get: obj => obj.width, set: (obj, value) => { obj.width = value; } }, metadata: _metadata }, _width_initializers, _width_extraInitializers);
|
|
34
20
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
35
21
|
}
|
|
36
|
-
#
|
|
22
|
+
#color_accessor_storage = __runInitializers(this, _color_initializers, 'standard'
|
|
37
23
|
/**
|
|
38
|
-
*
|
|
39
|
-
* A toggle button behaves different as it gets the `aria-pressed` attribute
|
|
40
|
-
* which changes depending on the pressed state.
|
|
41
|
-
* A toggle button is activated until it is clicked/pressed again.
|
|
42
|
-
* A toggle button dispatched `active` event when the press state change.
|
|
43
|
-
* The host can check the `active` property to know the state.
|
|
44
|
-
*
|
|
24
|
+
* The width of the button.
|
|
45
25
|
* @attribute
|
|
46
26
|
*/
|
|
47
|
-
|
|
48
|
-
set toggle(value) { this.#toggle_accessor_storage = value; }
|
|
49
|
-
#active_accessor_storage = (__runInitializers(this, _toggle_extraInitializers), __runInitializers(this, _active_initializers, void 0));
|
|
27
|
+
);
|
|
50
28
|
/**
|
|
51
|
-
*
|
|
52
|
-
* It is `undefined` and makes no effect when `toggle` is not set.
|
|
53
|
-
*
|
|
29
|
+
* The color of the button.
|
|
54
30
|
* @attribute
|
|
55
31
|
*/
|
|
56
|
-
get
|
|
57
|
-
set
|
|
58
|
-
|
|
59
|
-
return isDisabled(this);
|
|
60
|
-
}
|
|
32
|
+
get color() { return this.#color_accessor_storage; }
|
|
33
|
+
set color(value) { this.#color_accessor_storage = value; }
|
|
34
|
+
#width_accessor_storage = (__runInitializers(this, _color_extraInitializers), __runInitializers(this, _width_initializers, 'default'));
|
|
61
35
|
/**
|
|
62
|
-
*
|
|
36
|
+
* The width of the button.
|
|
63
37
|
* @attribute
|
|
64
38
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
setDisabled(this, value);
|
|
68
|
-
this.requestUpdate('disabled', old);
|
|
69
|
-
}
|
|
70
|
-
#ripple_accessor_storage = (__runInitializers(this, _active_extraInitializers), __runInitializers(this, _ripple_initializers, void 0));
|
|
71
|
-
get ripple() { return this.#ripple_accessor_storage; }
|
|
72
|
-
set ripple(value) { this.#ripple_accessor_storage = value; }
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
__runInitializers(this, _ripple_extraInitializers);
|
|
76
|
-
this.actionController.cancelKeyboardEvents = true;
|
|
77
|
-
this.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
78
|
-
this.addEventListener('keyup', this.handleKeyUp.bind(this));
|
|
79
|
-
this.addEventListener('click', this.handleClick.bind(this));
|
|
80
|
-
this.addEventListener('pointerdown', this.handlePointerDown.bind(this));
|
|
81
|
-
this.addEventListener('pointerup', this.handlePointerUp.bind(this));
|
|
82
|
-
this.addEventListener('pointercancel', this.handlePointerCancel.bind(this));
|
|
83
|
-
this.addEventListener('pointerleave', this.handlePointerLeave.bind(this));
|
|
84
|
-
this.addEventListener('pointerenter', this.handlePointerEnter.bind(this));
|
|
85
|
-
this.addEventListener('contextmenu', this.handleContextMenu.bind(this));
|
|
86
|
-
}
|
|
87
|
-
connectedCallback() {
|
|
88
|
-
super.connectedCallback();
|
|
89
|
-
if (!this.hasAttribute('role')) {
|
|
90
|
-
this.setAttribute('role', 'button');
|
|
91
|
-
}
|
|
92
|
-
if (!this.hasAttribute('tabindex') && !this.disabled) {
|
|
93
|
-
this.setAttribute('tabindex', '0');
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
update(changedProperties) {
|
|
97
|
-
if (changedProperties.has('active')) {
|
|
98
|
-
this.setAttribute('aria-pressed', String(this.active));
|
|
99
|
-
}
|
|
100
|
-
super.update(changedProperties);
|
|
101
|
-
}
|
|
102
|
-
pressRipple(options) {
|
|
103
|
-
const element = this.ripple;
|
|
104
|
-
if (element && !element.isPressed) {
|
|
105
|
-
element.beginPress(options.positionEvent);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
endRipple() {
|
|
109
|
-
this.ripple?.endPress();
|
|
110
|
-
}
|
|
111
|
-
beginPress(options) {
|
|
112
|
-
super.beginPress(options);
|
|
113
|
-
this.pressRipple(options);
|
|
114
|
-
}
|
|
115
|
-
endPress(config) {
|
|
116
|
-
super.endPress(config);
|
|
117
|
-
this.endRipple();
|
|
118
|
-
const { cancelled, reason } = config;
|
|
119
|
-
if (cancelled) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (!reason || reason === 'enter' || reason === 'space') {
|
|
123
|
-
if (this.toggle) {
|
|
124
|
-
this.active = !this.active;
|
|
125
|
-
// note, only dispatch events when user interacting with the UI.
|
|
126
|
-
this.dispatchEvent(new Event('active'));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (reason === 'enter' || reason === 'space') {
|
|
130
|
-
if (!this.toggle) {
|
|
131
|
-
this.click();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
handlePointerEnter(e) {
|
|
136
|
-
super.handlePointerEnter(e);
|
|
137
|
-
if (this.ripple) {
|
|
138
|
-
this.ripple.beginHover(e);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
handlePointerLeave(e) {
|
|
142
|
-
super.handlePointerLeave(e);
|
|
143
|
-
if (this.ripple) {
|
|
144
|
-
this.ripple.endHover();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
39
|
+
get width() { return this.#width_accessor_storage; }
|
|
40
|
+
set width(value) { this.#width_accessor_storage = value; }
|
|
147
41
|
render() {
|
|
148
|
-
const { pressed = false } = this;
|
|
149
|
-
const containerClasses = classMap({
|
|
150
|
-
surface: true,
|
|
151
|
-
pressed,
|
|
152
|
-
});
|
|
153
42
|
return html `
|
|
154
|
-
|
|
155
|
-
<
|
|
156
|
-
<div class="${containerClasses}">
|
|
157
|
-
<div class="container"></div>
|
|
158
|
-
<div class="state"></div>
|
|
159
|
-
<div class="content">
|
|
160
|
-
<slot></slot>
|
|
161
|
-
</div>
|
|
162
|
-
</div>
|
|
43
|
+
${this.renderFocusRing()} ${this.renderRipple()}
|
|
44
|
+
<slot></slot>
|
|
163
45
|
`;
|
|
164
46
|
}
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
__runInitializers(this, _width_extraInitializers);
|
|
50
|
+
}
|
|
165
51
|
};
|
|
166
52
|
})();
|
|
167
53
|
/**
|
|
168
|
-
*
|
|
54
|
+
* An icon button component that extends the functionality of a standard button,
|
|
55
|
+
* but is specifically designed to hold an icon.
|
|
56
|
+
* @slot - The default slot for the icon.
|
|
169
57
|
*/
|
|
170
58
|
export default IconButton;
|
|
171
59
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAA;AAC/C,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;;sBAUJ,UAAU;;;;;;;iBAA7B,UAAW,SAAQ,WAAU;;;iCAK/C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iCAKzC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YALC,oKAAS,KAAK,6BAAL,KAAK,qFAAgC;YAK9C,oKAAS,KAAK,6BAAL,KAAK,qFAA+B;;;QAL7C,uEAAoC,UAAU;QACzF;;;WAGG;UAJsF;QAJzF;;;WAGG;QACwC,IAAS,KAAK,2CAAgC;QAA9C,IAAS,KAAK,iDAAgC;QAK9C,2HAAoC,SAAS,GAAA;QAJxF;;;WAGG;QACwC,IAAS,KAAK,2CAA+B;QAA7C,IAAS,KAAK,iDAA+B;QAErE,MAAM;YACvB,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,eAAe,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE;;KAEhD,CAAA;QACH,CAAC;;;;;;;AAtBH;;;;GAIG;AACH,0BAkBC","sourcesContent":["import { html, type TemplateResult } from 'lit'\nimport BaseButton from '../../button/internals/base.js'\nimport { property } from 'lit/decorators.js'\n\nexport type MdIconButtonColor = 'filled' | 'outlined' | 'standard' | 'tonal'\nexport type MdIconButtonWidth = 'default' | 'narrow' | 'wide'\n\n/**\n * An icon button component that extends the functionality of a standard button,\n * but is specifically designed to hold an icon.\n * @slot - The default slot for the icon.\n */\nexport default class IconButton extends BaseButton {\n /**\n * The color of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor color: MdIconButtonColor = 'standard'\n /**\n * The width of the button.\n * @attribute\n */\n @property({ type: String, reflect: true }) accessor width: MdIconButtonWidth = 'default'\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderFocusRing()} ${this.renderRipple()}\n <slot></slot>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.styles.d.ts","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.styles.ts"],"names":[],"mappings":";AAEA,wBA2RC"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export default css `
|
|
3
|
+
:host {
|
|
4
|
+
all: unset;
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
position: relative;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
|
|
13
|
+
--md-ripple-hover-state-layer-color: currentColor;
|
|
14
|
+
--md-ripple-focus-state-layer-color: currentColor;
|
|
15
|
+
--md-ripple-pressed-state-layer-color: currentColor;
|
|
16
|
+
|
|
17
|
+
--_color: inherit;
|
|
18
|
+
--_background-color: transparent;
|
|
19
|
+
--_icon-size: var(--md-button-icon-size, 20px);
|
|
20
|
+
--_container-height: inherit;
|
|
21
|
+
--_leading-space: 0;
|
|
22
|
+
--_trailing-space: 0;
|
|
23
|
+
--_radius: 0;
|
|
24
|
+
--_outline-width: 0;
|
|
25
|
+
|
|
26
|
+
--_xs-radius: 16px;
|
|
27
|
+
--_s-radius: 20px;
|
|
28
|
+
--_m-radius: 28px;
|
|
29
|
+
--_l-radius: 48px;
|
|
30
|
+
--_xl-radius: 68px;
|
|
31
|
+
|
|
32
|
+
background-color: var(--_background-color);
|
|
33
|
+
color: var(--_color);
|
|
34
|
+
fill: var(--_color);
|
|
35
|
+
height: var(--_container-height);
|
|
36
|
+
padding-inline-start: var(--_leading-space);
|
|
37
|
+
padding-inline-end: var(--_trailing-space);
|
|
38
|
+
border: var(--_outline-width) var(--md-sys-color-outline-variant) solid;
|
|
39
|
+
border-end-end-radius: var(--ui-button-shape-end-end, var(--_radius));
|
|
40
|
+
border-end-start-radius: var(--ui-button-shape-end-start, var(--_radius));
|
|
41
|
+
border-start-end-radius: var(--ui-button-shape-start-end, var(--_radius));
|
|
42
|
+
border-start-start-radius: var(--ui-button-shape-start-start, var(--_radius));
|
|
43
|
+
|
|
44
|
+
/* Interaction styles */
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
user-select: none;
|
|
47
|
+
-webkit-tap-highlight-color: transparent;
|
|
48
|
+
outline: none;
|
|
49
|
+
|
|
50
|
+
transition:
|
|
51
|
+
background-color var(--md-sys-motion-duration-short2, 200ms)
|
|
52
|
+
var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
53
|
+
color var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
54
|
+
border-color var(--md-sys-motion-duration-short2, 200ms)
|
|
55
|
+
var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
56
|
+
border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::slotted(*) {
|
|
60
|
+
width: var(--_icon-size) !important;
|
|
61
|
+
height: var(--_icon-size) !important;
|
|
62
|
+
color: var(--_color);
|
|
63
|
+
fill: var(--_color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ripple {
|
|
67
|
+
border-radius: inherit;
|
|
68
|
+
transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.focus-ring {
|
|
72
|
+
--md-focus-ring-shape-end-end: var(--ui-button-shape-end-end, var(--_radius));
|
|
73
|
+
--md-focus-ring-shape-end-start: var(--ui-button-shape-end-start, var(--_radius));
|
|
74
|
+
--md-focus-ring-shape-start-end: var(--ui-button-shape-start-end, var(--_radius));
|
|
75
|
+
--md-focus-ring-shape-start-start: var(--ui-button-shape-start-start, var(--_radius));
|
|
76
|
+
transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ripple.activated {
|
|
80
|
+
z-index: 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Filled Button */
|
|
84
|
+
:host([color='filled']) {
|
|
85
|
+
--_background-color: var(--md-sys-color-primary);
|
|
86
|
+
--_color: var(--md-sys-color-on-primary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([color='filled'][toggle]) {
|
|
90
|
+
--_background-color: var(--md-sys-color-surface-container);
|
|
91
|
+
--_color: var(--md-sys-color-on-surface-variant);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([color='filled'][toggle][selected]) {
|
|
95
|
+
--_background-color: var(--md-sys-color-primary);
|
|
96
|
+
--_color: var(--md-sys-color-on-primary);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([color='filled'][disabled]) {
|
|
100
|
+
--_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
|
|
101
|
+
--_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Filled Tonal Button */
|
|
105
|
+
:host([color='tonal']) {
|
|
106
|
+
--_background-color: var(--md-sys-color-secondary-container);
|
|
107
|
+
--_color: var(--md-sys-color-on-secondary-container);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([color='tonal'][toggle]) {
|
|
111
|
+
--_background-color: var(--md-sys-color-secondary-container);
|
|
112
|
+
--_color: var(--md-sys-color-on-secondary-container);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([color='tonal'][toggle][selected]) {
|
|
116
|
+
--_background-color: var(--md-sys-color-secondary);
|
|
117
|
+
--_color: var(--md-sys-color-on-secondary);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
:host([color='tonal']:hover:not([disabled])) {
|
|
121
|
+
--_shadow: var(--md-sys-elevation-1);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:host([color='tonal'][disabled]) {
|
|
125
|
+
--_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
|
|
126
|
+
--_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Outlined Button */
|
|
130
|
+
:host([color='outlined']) {
|
|
131
|
+
--_outline-width: 1px;
|
|
132
|
+
--_color: var(--md-sys-color-on-surface-variant);
|
|
133
|
+
}
|
|
134
|
+
:host([color='outlined'][size='l']),
|
|
135
|
+
:host([color='outlined'][size='xl']) {
|
|
136
|
+
--_outline-width: 3px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host([color='outlined'][toggle][selected]) {
|
|
140
|
+
--_background-color: var(--md-sys-color-inverse-surface);
|
|
141
|
+
--_color: var(--md-sys-color-inverse-on-surface);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:host([color='outlined'][disabled]) {
|
|
145
|
+
border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
|
|
146
|
+
--_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Standard Button */
|
|
150
|
+
:host([color='standard']) {
|
|
151
|
+
--_color: var(--md-sys-color-on-surface-variant);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host([color='standard'][toggle][selected]) {
|
|
155
|
+
--_color: var(--md-sys-color-primary);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:host([color='standard'][disabled]) {
|
|
159
|
+
color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Sizes */
|
|
163
|
+
:host([size='xs']) {
|
|
164
|
+
--_container-height: 32px;
|
|
165
|
+
--_icon-size: 20px;
|
|
166
|
+
}
|
|
167
|
+
:host([size='s']) {
|
|
168
|
+
--_container-height: 40px;
|
|
169
|
+
--_icon-size: 24px;
|
|
170
|
+
}
|
|
171
|
+
:host([size='m']) {
|
|
172
|
+
--_container-height: 56px;
|
|
173
|
+
--_icon-size: 24px;
|
|
174
|
+
}
|
|
175
|
+
:host([size='l']) {
|
|
176
|
+
--_container-height: 96px;
|
|
177
|
+
--_icon-size: 32px;
|
|
178
|
+
}
|
|
179
|
+
:host([size='xl']) {
|
|
180
|
+
--_container-height: 136px;
|
|
181
|
+
--_icon-size: 40px;
|
|
182
|
+
}
|
|
183
|
+
:host([size='xs'][width='narrow']) {
|
|
184
|
+
--_leading-space: 4px;
|
|
185
|
+
--_trailing-space: 4px;
|
|
186
|
+
}
|
|
187
|
+
:host([size='xs'][width='default']) {
|
|
188
|
+
--_leading-space: 6px;
|
|
189
|
+
--_trailing-space: 6px;
|
|
190
|
+
}
|
|
191
|
+
:host([size='xs'][width='wide']) {
|
|
192
|
+
--_leading-space: 10px;
|
|
193
|
+
--_trailing-space: 10px;
|
|
194
|
+
}
|
|
195
|
+
:host([size='s'][width='narrow']) {
|
|
196
|
+
--_leading-space: 4px;
|
|
197
|
+
--_trailing-space: 4px;
|
|
198
|
+
}
|
|
199
|
+
:host([size='s'][width='default']) {
|
|
200
|
+
--_leading-space: 8px;
|
|
201
|
+
--_trailing-space: 8px;
|
|
202
|
+
}
|
|
203
|
+
:host([size='s'][width='wide']) {
|
|
204
|
+
--_leading-space: 14px;
|
|
205
|
+
--_trailing-space: 14px;
|
|
206
|
+
}
|
|
207
|
+
:host([size='m'][width='narrow']) {
|
|
208
|
+
--_leading-space: 12px;
|
|
209
|
+
--_trailing-space: 12px;
|
|
210
|
+
}
|
|
211
|
+
:host([size='m'][width='default']) {
|
|
212
|
+
--_leading-space: 16px;
|
|
213
|
+
--_trailing-space: 16px;
|
|
214
|
+
}
|
|
215
|
+
:host([size='m'][width='wide']) {
|
|
216
|
+
--_leading-space: 24px;
|
|
217
|
+
--_trailing-space: 24px;
|
|
218
|
+
}
|
|
219
|
+
:host([size='l'][width='narrow']) {
|
|
220
|
+
--_leading-space: 16px;
|
|
221
|
+
--_trailing-space: 16px;
|
|
222
|
+
}
|
|
223
|
+
:host([size='l'][width='default']) {
|
|
224
|
+
--_leading-space: 32px;
|
|
225
|
+
--_trailing-space: 32px;
|
|
226
|
+
}
|
|
227
|
+
:host([size='l'][width='wide']) {
|
|
228
|
+
--_leading-space: 48px;
|
|
229
|
+
--_trailing-space: 48px;
|
|
230
|
+
}
|
|
231
|
+
:host([size='xl'][width='narrow']) {
|
|
232
|
+
--_leading-space: 32px;
|
|
233
|
+
--_trailing-space: 32px;
|
|
234
|
+
}
|
|
235
|
+
:host([size='xl'][width='default']) {
|
|
236
|
+
--_leading-space: 48px;
|
|
237
|
+
--_trailing-space: 48px;
|
|
238
|
+
}
|
|
239
|
+
:host([size='xl'][width='wide']) {
|
|
240
|
+
--_leading-space: 72px;
|
|
241
|
+
--_trailing-space: 72px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* Shape setup */
|
|
245
|
+
/* For the round shape, we can't use the "--md-sys-shape-corner-full" value as it has a value of 999px and it would make animations impossible so see. */
|
|
246
|
+
:host([shape='round'][size='xs']) {
|
|
247
|
+
--_radius: var(--_xs-radius);
|
|
248
|
+
}
|
|
249
|
+
:host([shape='round'][size='s']) {
|
|
250
|
+
--_radius: var(--_s-radius);
|
|
251
|
+
}
|
|
252
|
+
:host([shape='square'][size='xs']),
|
|
253
|
+
:host([shape='square'][size='s']) {
|
|
254
|
+
--_radius: var(--md-sys-shape-corner-medium);
|
|
255
|
+
}
|
|
256
|
+
:host([shape='round'][size='m']) {
|
|
257
|
+
--_radius: var(--_m-radius);
|
|
258
|
+
}
|
|
259
|
+
:host([shape='square'][size='m']) {
|
|
260
|
+
--_radius: var(--md-sys-shape-corner-large);
|
|
261
|
+
}
|
|
262
|
+
:host([shape='round'][size='l']) {
|
|
263
|
+
--_radius: var(--_l-radius);
|
|
264
|
+
}
|
|
265
|
+
:host([shape='round'][size='xl']) {
|
|
266
|
+
--_radius: var(--_xl-radius);
|
|
267
|
+
}
|
|
268
|
+
:host([shape='square'][size='l']),
|
|
269
|
+
:host([shape='square'][size='xl']) {
|
|
270
|
+
--_radius: var(--md-sys-shape-corner-extra-large);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* Pressed shapes */
|
|
274
|
+
:host([size='xs'].pressed),
|
|
275
|
+
:host([size='s'].pressed) {
|
|
276
|
+
--_radius: var(--md-sys-shape-corner-small);
|
|
277
|
+
}
|
|
278
|
+
:host([size='m'].pressed) {
|
|
279
|
+
--_radius: var(--md-sys-shape-corner-medium);
|
|
280
|
+
}
|
|
281
|
+
:host([size='l'].pressed),
|
|
282
|
+
:host([size='xl'].pressed) {
|
|
283
|
+
--_radius: var(--md-sys-shape-corner-large);
|
|
284
|
+
}
|
|
285
|
+
`;
|
|
286
|
+
//# sourceMappingURL=IconButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.styles.js","sourceRoot":"","sources":["../../../../../src/md/icon-button/internals/IconButton.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2RjB,CAAA","sourcesContent":["import { css } from 'lit'\n\nexport default css`\n :host {\n all: unset;\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n position: relative;\n box-sizing: border-box;\n white-space: nowrap;\n\n --md-ripple-hover-state-layer-color: currentColor;\n --md-ripple-focus-state-layer-color: currentColor;\n --md-ripple-pressed-state-layer-color: currentColor;\n\n --_color: inherit;\n --_background-color: transparent;\n --_icon-size: var(--md-button-icon-size, 20px);\n --_container-height: inherit;\n --_leading-space: 0;\n --_trailing-space: 0;\n --_radius: 0;\n --_outline-width: 0;\n\n --_xs-radius: 16px;\n --_s-radius: 20px;\n --_m-radius: 28px;\n --_l-radius: 48px;\n --_xl-radius: 68px;\n\n background-color: var(--_background-color);\n color: var(--_color);\n fill: var(--_color);\n height: var(--_container-height);\n padding-inline-start: var(--_leading-space);\n padding-inline-end: var(--_trailing-space);\n border: var(--_outline-width) var(--md-sys-color-outline-variant) solid;\n border-end-end-radius: var(--ui-button-shape-end-end, var(--_radius));\n border-end-start-radius: var(--ui-button-shape-end-start, var(--_radius));\n border-start-end-radius: var(--ui-button-shape-start-end, var(--_radius));\n border-start-start-radius: var(--ui-button-shape-start-start, var(--_radius));\n\n /* Interaction styles */\n cursor: pointer;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n outline: none;\n\n transition:\n background-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n color var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-color var(--md-sys-motion-duration-short2, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)),\n border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n ::slotted(*) {\n width: var(--_icon-size) !important;\n height: var(--_icon-size) !important;\n color: var(--_color);\n fill: var(--_color);\n }\n\n .ripple {\n border-radius: inherit;\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n .focus-ring {\n --md-focus-ring-shape-end-end: var(--ui-button-shape-end-end, var(--_radius));\n --md-focus-ring-shape-end-start: var(--ui-button-shape-end-start, var(--_radius));\n --md-focus-ring-shape-start-end: var(--ui-button-shape-start-end, var(--_radius));\n --md-focus-ring-shape-start-start: var(--ui-button-shape-start-start, var(--_radius));\n transition: border-radius var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-standard);\n }\n\n .ripple.activated {\n z-index: 1;\n }\n\n /* Filled Button */\n :host([color='filled']) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled'][toggle]) {\n --_background-color: var(--md-sys-color-surface-container);\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='filled'][toggle][selected]) {\n --_background-color: var(--md-sys-color-primary);\n --_color: var(--md-sys-color-on-primary);\n }\n\n :host([color='filled'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Filled Tonal Button */\n :host([color='tonal']) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle]) {\n --_background-color: var(--md-sys-color-secondary-container);\n --_color: var(--md-sys-color-on-secondary-container);\n }\n\n :host([color='tonal'][toggle][selected]) {\n --_background-color: var(--md-sys-color-secondary);\n --_color: var(--md-sys-color-on-secondary);\n }\n\n :host([color='tonal']:hover:not([disabled])) {\n --_shadow: var(--md-sys-elevation-1);\n }\n\n :host([color='tonal'][disabled]) {\n --_background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Outlined Button */\n :host([color='outlined']) {\n --_outline-width: 1px;\n --_color: var(--md-sys-color-on-surface-variant);\n }\n :host([color='outlined'][size='l']),\n :host([color='outlined'][size='xl']) {\n --_outline-width: 3px;\n }\n\n :host([color='outlined'][toggle][selected]) {\n --_background-color: var(--md-sys-color-inverse-surface);\n --_color: var(--md-sys-color-inverse-on-surface);\n }\n\n :host([color='outlined'][disabled]) {\n border-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);\n --_color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Standard Button */\n :host([color='standard']) {\n --_color: var(--md-sys-color-on-surface-variant);\n }\n\n :host([color='standard'][toggle][selected]) {\n --_color: var(--md-sys-color-primary);\n }\n\n :host([color='standard'][disabled]) {\n color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);\n }\n\n /* Sizes */\n :host([size='xs']) {\n --_container-height: 32px;\n --_icon-size: 20px;\n }\n :host([size='s']) {\n --_container-height: 40px;\n --_icon-size: 24px;\n }\n :host([size='m']) {\n --_container-height: 56px;\n --_icon-size: 24px;\n }\n :host([size='l']) {\n --_container-height: 96px;\n --_icon-size: 32px;\n }\n :host([size='xl']) {\n --_container-height: 136px;\n --_icon-size: 40px;\n }\n :host([size='xs'][width='narrow']) {\n --_leading-space: 4px;\n --_trailing-space: 4px;\n }\n :host([size='xs'][width='default']) {\n --_leading-space: 6px;\n --_trailing-space: 6px;\n }\n :host([size='xs'][width='wide']) {\n --_leading-space: 10px;\n --_trailing-space: 10px;\n }\n :host([size='s'][width='narrow']) {\n --_leading-space: 4px;\n --_trailing-space: 4px;\n }\n :host([size='s'][width='default']) {\n --_leading-space: 8px;\n --_trailing-space: 8px;\n }\n :host([size='s'][width='wide']) {\n --_leading-space: 14px;\n --_trailing-space: 14px;\n }\n :host([size='m'][width='narrow']) {\n --_leading-space: 12px;\n --_trailing-space: 12px;\n }\n :host([size='m'][width='default']) {\n --_leading-space: 16px;\n --_trailing-space: 16px;\n }\n :host([size='m'][width='wide']) {\n --_leading-space: 24px;\n --_trailing-space: 24px;\n }\n :host([size='l'][width='narrow']) {\n --_leading-space: 16px;\n --_trailing-space: 16px;\n }\n :host([size='l'][width='default']) {\n --_leading-space: 32px;\n --_trailing-space: 32px;\n }\n :host([size='l'][width='wide']) {\n --_leading-space: 48px;\n --_trailing-space: 48px;\n }\n :host([size='xl'][width='narrow']) {\n --_leading-space: 32px;\n --_trailing-space: 32px;\n }\n :host([size='xl'][width='default']) {\n --_leading-space: 48px;\n --_trailing-space: 48px;\n }\n :host([size='xl'][width='wide']) {\n --_leading-space: 72px;\n --_trailing-space: 72px;\n }\n\n /* Shape setup */\n /* For the round shape, we can't use the \"--md-sys-shape-corner-full\" value as it has a value of 999px and it would make animations impossible so see. */\n :host([shape='round'][size='xs']) {\n --_radius: var(--_xs-radius);\n }\n :host([shape='round'][size='s']) {\n --_radius: var(--_s-radius);\n }\n :host([shape='square'][size='xs']),\n :host([shape='square'][size='s']) {\n --_radius: var(--md-sys-shape-corner-medium);\n }\n :host([shape='round'][size='m']) {\n --_radius: var(--_m-radius);\n }\n :host([shape='square'][size='m']) {\n --_radius: var(--md-sys-shape-corner-large);\n }\n :host([shape='round'][size='l']) {\n --_radius: var(--_l-radius);\n }\n :host([shape='round'][size='xl']) {\n --_radius: var(--_xl-radius);\n }\n :host([shape='square'][size='l']),\n :host([shape='square'][size='xl']) {\n --_radius: var(--md-sys-shape-corner-extra-large);\n }\n\n /* Pressed shapes */\n :host([size='xs'].pressed),\n :host([size='s'].pressed) {\n --_radius: var(--md-sys-shape-corner-small);\n }\n :host([size='m'].pressed) {\n --_radius: var(--md-sys-shape-corner-medium);\n }\n :host([size='l'].pressed),\n :host([size='xl'].pressed) {\n --_radius: var(--md-sys-shape-corner-large);\n }\n`\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-icon-button.d.ts","sourceRoot":"","sources":["../../../../src/md/icon-button/ui-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAE5C,OAAO,OAAO,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"ui-icon-button.d.ts","sourceRoot":"","sources":["../../../../src/md/icon-button/ui-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAE5C,OAAO,OAAO,MAAM,2BAA2B,CAAA;AAG/C,qBACa,mBAAoB,SAAQ,OAAO;IAC9C,OAAgB,MAAM,EAAE,iBAAiB,EAAE,CAAW;CACvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,mBAAmB,CAAA;KACtC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
2
|
import { customElement } from 'lit/decorators.js';
|
|
3
3
|
import Element from './internals/IconButton.js';
|
|
4
|
-
import
|
|
5
|
-
import styles from './internals/standard.styles.js';
|
|
4
|
+
import styles from './internals/IconButton.styles.js';
|
|
6
5
|
let UiIconButtonElement = (() => {
|
|
7
6
|
let _classDecorators = [customElement('ui-icon-button')];
|
|
8
7
|
let _classDescriptor;
|
|
@@ -17,7 +16,7 @@ let UiIconButtonElement = (() => {
|
|
|
17
16
|
UiIconButtonElement = _classThis = _classDescriptor.value;
|
|
18
17
|
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
19
18
|
}
|
|
20
|
-
static styles = [
|
|
19
|
+
static styles = [styles];
|
|
21
20
|
static {
|
|
22
21
|
__runInitializers(_classThis, _classExtraInitializers);
|
|
23
22
|
}
|