@quaffui/quaff 0.1.0-prealpha8 → 1.0.0-alpha1
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/LICENSE +1 -1
- package/README.md +47 -14
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +48 -0
- package/dist/classes/QScrollObserver.svelte.js +107 -0
- package/dist/classes/QTheme.svelte.d.ts +13 -0
- package/dist/classes/QTheme.svelte.js +62 -0
- package/dist/classes/Quaff.svelte.d.ts +15 -0
- package/dist/classes/Quaff.svelte.js +45 -0
- package/dist/components/avatar/QAvatar.scss +101 -0
- package/dist/components/avatar/QAvatar.svelte +42 -42
- package/dist/components/avatar/QAvatar.svelte.d.ts +4 -17
- package/dist/components/avatar/docs.d.ts +2 -2
- package/dist/components/avatar/docs.js +3 -8
- package/dist/components/avatar/docs.props.d.ts +3 -8
- package/dist/components/avatar/docs.props.js +68 -15
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +51 -8
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +32 -14
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +4 -13
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +65 -48
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +4 -16
- package/dist/components/breadcrumbs/docs.d.ts +2 -2
- package/dist/components/breadcrumbs/docs.js +3 -8
- package/dist/components/breadcrumbs/docs.props.d.ts +5 -16
- package/dist/components/breadcrumbs/docs.props.js +105 -45
- package/dist/components/breadcrumbs/props.d.ts +26 -24
- package/dist/components/button/QBtn.scss +136 -0
- package/dist/components/button/QBtn.svelte +157 -43
- package/dist/components/button/QBtn.svelte.d.ts +4 -24
- package/dist/components/button/docs.d.ts +2 -2
- package/dist/components/button/docs.js +3 -8
- package/dist/components/button/docs.props.d.ts +3 -8
- package/dist/components/button/docs.props.js +174 -37
- package/dist/components/button/props.d.ts +48 -11
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +34 -19
- package/dist/components/card/QCard.svelte.d.ts +4 -16
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +23 -15
- package/dist/components/card/QCardActions.svelte.d.ts +4 -12
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +15 -11
- package/dist/components/card/QCardSection.svelte.d.ts +4 -13
- package/dist/components/card/docs.d.ts +4 -4
- package/dist/components/card/docs.js +7 -22
- package/dist/components/card/docs.props.d.ts +7 -24
- package/dist/components/card/docs.props.js +57 -30
- package/dist/components/card/props.d.ts +11 -16
- package/dist/components/checkbox/QCheckbox.svelte +15 -9
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +3 -10
- package/dist/components/checkbox/docs.d.ts +2 -2
- package/dist/components/checkbox/docs.js +3 -3
- package/dist/components/checkbox/docs.props.d.ts +3 -8
- package/dist/components/checkbox/docs.props.js +24 -9
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +2 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +130 -60
- package/dist/components/chip/QChip.svelte.d.ts +4 -25
- package/dist/components/chip/docs.d.ts +2 -2
- package/dist/components/chip/docs.js +3 -16
- package/dist/components/chip/docs.props.d.ts +3 -8
- package/dist/components/chip/docs.props.js +96 -49
- package/dist/components/chip/props.d.ts +27 -29
- package/dist/components/codeBlock/QCodeBlock.svelte +90 -44
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +3 -10
- package/dist/components/codeBlock/docs.props.d.ts +3 -8
- package/dist/components/codeBlock/docs.props.js +61 -12
- package/dist/components/codeBlock/props.d.ts +12 -2
- package/dist/components/dialog/{index.scss → QDialog.scss} +12 -14
- package/dist/components/dialog/QDialog.svelte +90 -68
- package/dist/components/dialog/QDialog.svelte.d.ts +9 -25
- package/dist/components/dialog/docs.d.ts +2 -2
- package/dist/components/dialog/docs.js +3 -3
- package/dist/components/dialog/docs.props.d.ts +3 -16
- package/dist/components/dialog/docs.props.js +37 -128
- package/dist/components/dialog/props.d.ts +4 -19
- package/dist/components/drawer/QDrawer.scss +39 -0
- package/dist/components/drawer/QDrawer.svelte +142 -83
- package/dist/components/drawer/QDrawer.svelte.d.ts +9 -28
- package/dist/components/drawer/docs.d.ts +2 -2
- package/dist/components/drawer/docs.js +3 -3
- package/dist/components/drawer/docs.props.d.ts +3 -8
- package/dist/components/drawer/docs.props.js +94 -39
- package/dist/components/drawer/props.d.ts +4 -3
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +100 -21
- package/dist/components/footer/QFooter.svelte.d.ts +4 -14
- package/dist/components/footer/docs.d.ts +2 -2
- package/dist/components/footer/docs.js +3 -3
- package/dist/components/footer/docs.props.d.ts +3 -8
- package/dist/components/footer/docs.props.js +47 -16
- package/dist/components/footer/props.d.ts +14 -8
- package/dist/components/header/QHeader.scss +53 -0
- package/dist/components/header/QHeader.svelte +95 -0
- package/dist/components/header/QHeader.svelte.d.ts +14 -0
- package/dist/components/header/docs.d.ts +2 -0
- package/dist/components/header/docs.js +11 -0
- package/dist/components/header/docs.props.d.ts +7 -0
- package/dist/components/header/docs.props.js +131 -0
- package/dist/components/header/props.d.ts +23 -0
- package/dist/components/header/props.js +1 -0
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +44 -28
- package/dist/components/icon/QIcon.svelte.d.ts +4 -18
- package/dist/components/icon/docs.d.ts +2 -2
- package/dist/components/icon/docs.js +3 -3
- package/dist/components/icon/docs.props.d.ts +3 -8
- package/dist/components/icon/docs.props.js +65 -24
- package/dist/components/icon/props.d.ts +9 -8
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.js +6 -2
- package/dist/components/input/QInput.svelte +106 -72
- package/dist/components/input/QInput.svelte.d.ts +4 -22
- package/dist/components/input/docs.d.ts +2 -2
- package/dist/components/input/docs.js +5 -71
- package/dist/components/input/docs.props.d.ts +3 -8
- package/dist/components/input/docs.props.js +129 -57
- package/dist/components/input/index.scss +1 -3
- package/dist/components/input/props.d.ts +81 -21
- package/dist/components/input/props.js +1 -13
- package/dist/components/layout/QLayout.scss +174 -0
- package/dist/components/layout/QLayout.svelte +178 -79
- package/dist/components/layout/QLayout.svelte.d.ts +12 -45
- package/dist/components/layout/docs.d.ts +2 -2
- package/dist/components/layout/docs.js +3 -3
- package/dist/components/layout/docs.props.d.ts +3 -8
- package/dist/components/layout/docs.props.js +62 -39
- package/dist/components/layout/props.d.ts +29 -21
- package/dist/components/list/QItem.scss +69 -0
- package/dist/components/list/QItem.svelte +99 -51
- package/dist/components/list/QItem.svelte.d.ts +4 -24
- package/dist/components/list/QItemSection.scss +59 -0
- package/dist/components/list/QItemSection.svelte +63 -37
- package/dist/components/list/QItemSection.svelte.d.ts +4 -15
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +43 -20
- package/dist/components/list/QList.svelte.d.ts +4 -26
- package/dist/components/list/docs.d.ts +4 -2
- package/dist/components/list/docs.js +23 -3
- package/dist/components/list/docs.props.d.ts +11 -40
- package/dist/components/list/docs.props.js +344 -136
- package/dist/components/list/props.d.ts +126 -28
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +15 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +4 -8
- package/dist/components/private/QApi.svelte +264 -111
- package/dist/components/private/QApi.svelte.d.ts +3 -6
- package/dist/components/private/QDocs.svelte +119 -68
- package/dist/components/private/QDocs.svelte.d.ts +4 -11
- package/dist/components/private/QDocsSection.svelte +48 -18
- package/dist/components/private/QDocsSection.svelte.d.ts +9 -24
- package/dist/components/private/QIconSnippet.svelte +22 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +14 -0
- package/dist/components/private/index.d.ts +6 -0
- package/dist/components/private/index.js +6 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +134 -21
- package/dist/components/progress/QCircularProgress.svelte.d.ts +3 -11
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +80 -23
- package/dist/components/progress/QLinearProgress.svelte.d.ts +3 -11
- package/dist/components/progress/docs.d.ts +3 -2
- package/dist/components/progress/docs.js +15 -5
- package/dist/components/progress/docs.props.d.ts +5 -16
- package/dist/components/progress/docs.props.js +287 -41
- package/dist/components/progress/props.d.ts +126 -14
- package/dist/components/radio/QRadio.svelte +16 -9
- package/dist/components/radio/QRadio.svelte.d.ts +3 -11
- package/dist/components/radio/docs.d.ts +2 -2
- package/dist/components/radio/docs.js +4 -26
- package/dist/components/radio/docs.props.d.ts +3 -8
- package/dist/components/radio/docs.props.js +39 -20
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +26 -6
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +72 -48
- package/dist/components/railbar/QRailbar.svelte.d.ts +4 -13
- package/dist/components/railbar/docs.d.ts +2 -2
- package/dist/components/railbar/docs.js +3 -3
- package/dist/components/railbar/docs.props.d.ts +3 -8
- package/dist/components/railbar/docs.props.js +36 -15
- package/dist/components/railbar/props.d.ts +13 -6
- package/dist/components/select/QSelect.svelte +222 -146
- package/dist/components/select/QSelect.svelte.d.ts +4 -24
- package/dist/components/select/docs.d.ts +2 -2
- package/dist/components/select/docs.js +5 -83
- package/dist/components/select/docs.props.d.ts +3 -8
- package/dist/components/select/docs.props.js +156 -64
- package/dist/components/select/index.scss +25 -10
- package/dist/components/select/props.d.ts +100 -20
- package/dist/components/select/props.js +1 -14
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +50 -57
- package/dist/components/separator/QSeparator.svelte.d.ts +3 -14
- package/dist/components/separator/docs.d.ts +3 -2
- package/dist/components/separator/docs.js +14 -4
- package/dist/components/separator/docs.props.d.ts +5 -16
- package/dist/components/separator/docs.props.js +152 -72
- package/dist/components/separator/props.d.ts +84 -16
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +115 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +14 -0
- package/dist/components/switch/docs.d.ts +2 -0
- package/dist/components/switch/docs.js +17 -0
- package/dist/components/switch/docs.props.d.ts +3 -0
- package/dist/components/switch/docs.props.js +119 -0
- package/dist/components/switch/props.d.ts +53 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +133 -97
- package/dist/components/table/QTable.svelte.d.ts +4 -19
- package/dist/components/table/docs.d.ts +2 -2
- package/dist/components/table/docs.js +3 -3
- package/dist/components/table/docs.props.d.ts +3 -8
- package/dist/components/table/docs.props.js +67 -15
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +14 -3
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +107 -66
- package/dist/components/tabs/QTab.svelte.d.ts +4 -18
- package/dist/components/tabs/QTabs.scss +53 -0
- package/dist/components/tabs/QTabs.svelte +164 -51
- package/dist/components/tabs/QTabs.svelte.d.ts +9 -13
- package/dist/components/tabs/docs.d.ts +3 -2
- package/dist/components/tabs/docs.js +13 -3
- package/dist/components/tabs/docs.props.d.ts +5 -16
- package/dist/components/tabs/docs.props.js +64 -30
- package/dist/components/tabs/index.scss +71 -28
- package/dist/components/tabs/props.d.ts +38 -9
- package/dist/components/tabs/props.js +1 -13
- package/dist/components/toolbar/QToolbar.scss +36 -0
- package/dist/components/toolbar/QToolbar.svelte +26 -38
- package/dist/components/toolbar/QToolbar.svelte.d.ts +4 -13
- package/dist/components/toolbar/QToolbarTitle.svelte +10 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +4 -12
- package/dist/components/toolbar/docs.d.ts +3 -2
- package/dist/components/toolbar/docs.js +13 -3
- package/dist/components/toolbar/docs.props.d.ts +5 -16
- package/dist/components/toolbar/docs.props.js +55 -15
- package/dist/components/toolbar/props.d.ts +25 -7
- package/dist/components/tooltip/QTooltip.scss +40 -0
- package/dist/components/tooltip/QTooltip.svelte +200 -10
- package/dist/components/tooltip/QTooltip.svelte.d.ts +17 -18
- package/dist/components/tooltip/QTooltipBase.svelte +86 -0
- package/dist/components/tooltip/QTooltipBase.svelte.d.ts +14 -0
- package/dist/components/tooltip/docs.d.ts +2 -2
- package/dist/components/tooltip/docs.js +3 -2
- package/dist/components/tooltip/docs.props.d.ts +3 -8
- package/dist/components/tooltip/docs.props.js +69 -10
- package/dist/components/tooltip/props.d.ts +36 -4
- package/dist/components/tooltip/props.js +1 -6
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +3 -1
- package/dist/composables/{use-align.d.ts → useAlign.d.ts} +1 -1
- package/dist/composables/{use-align.js → useAlign.js} +1 -1
- package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +3 -3
- package/dist/composables/{use-router-link.js → useRouterLink.js} +4 -4
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/_ripple.scss +49 -0
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/{flex.scss → classes/_flex.scss} +23 -2
- package/dist/css/classes/_grid.scss +35 -0
- package/dist/css/classes/_index.scss +7 -0
- package/dist/css/classes/_overflow.scss +7 -0
- package/dist/css/classes/_position.scss +7 -0
- package/dist/css/classes/_select.scss +6 -0
- package/dist/css/classes/_spaces.scss +23 -0
- package/dist/css/fonts.scss +18 -4
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +16 -91
- package/dist/css/mixins/_design.scss +64 -0
- package/dist/css/mixins/_field.scss +64 -0
- package/dist/css/mixins/_image.scss +64 -0
- package/dist/css/mixins/_index.scss +10 -0
- package/dist/css/mixins/_layout.scss +20 -0
- package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
- package/dist/css/mixins/{selection.scss → _selection.scss} +10 -70
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_toolbar.scss +7 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +348 -0
- package/dist/css/theme/_color-classes.scss +332 -0
- package/dist/css/theme/_colors.scss +205 -0
- package/dist/css/theme/_css-variables.scss +5 -0
- package/dist/css/theme/_index.scss +12 -0
- package/dist/css/theme/_page.scss +17 -0
- package/dist/css/theme/{palette.scss → _palette.scss} +27 -5
- package/dist/css/theme/{reset.scss → _reset.scss} +11 -2
- package/dist/css/theme/_typography-variables.scss +107 -0
- package/dist/global.d.ts +1 -1
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.js +2 -1
- package/dist/helpers/pageTitle.d.ts +1 -0
- package/dist/helpers/pageTitle.js +3 -0
- package/dist/helpers/ripple.d.ts +11 -0
- package/dist/helpers/ripple.js +90 -0
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/stores/index.d.ts +0 -0
- package/dist/stores/index.js +1 -0
- package/dist/utils/clipboard.d.ts +1 -1
- package/dist/utils/clipboard.js +3 -4
- package/dist/utils/colors.d.ts +69 -0
- package/dist/utils/colors.js +141 -15
- package/dist/utils/context.d.ts +33 -0
- package/dist/utils/context.js +33 -0
- package/dist/utils/dom.d.ts +11 -0
- package/dist/utils/dom.js +81 -0
- package/dist/utils/events.d.ts +37 -0
- package/dist/utils/events.js +37 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +11 -1
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +4 -4
- package/dist/utils/props.js +9 -7
- package/dist/utils/router.d.ts +16 -0
- package/dist/utils/router.js +20 -0
- package/dist/utils/string.d.ts +2 -0
- package/dist/utils/string.js +12 -1
- package/dist/utils/types.d.ts +12 -18
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +31 -1
- package/package.json +44 -39
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -81
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -86
- package/dist/components/drawer/index.scss +0 -56
- package/dist/components/footer/index.scss +0 -5
- package/dist/components/layout/index.scss +0 -373
- package/dist/components/list/index.scss +0 -120
- package/dist/components/progress/index.scss +0 -65
- package/dist/components/toggle/QToggle.svelte +0 -35
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/docs.d.ts +0 -2
- package/dist/components/toggle/docs.js +0 -47
- package/dist/components/toggle/docs.props.d.ts +0 -8
- package/dist/components/toggle/docs.props.js +0 -42
- package/dist/components/toggle/index.scss +0 -31
- package/dist/components/toggle/props.d.ts +0 -9
- package/dist/components/toggle/props.js +0 -9
- package/dist/components/toolbar/index.scss +0 -34
- package/dist/components/tooltip/index.scss +0 -82
- package/dist/composables/use-index.d.ts +0 -2
- package/dist/composables/use-index.js +0 -17
- package/dist/composables/use-size.d.ts +0 -9
- package/dist/composables/use-size.js +0 -25
- package/dist/css/grid.scss +0 -50
- package/dist/css/mixins/field.scss +0 -432
- package/dist/css/mixins.scss +0 -138
- package/dist/css/states.scss +0 -71
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/colors.module.scss +0 -180
- package/dist/css/theme/page.scss +0 -16
- package/dist/css/theme/theme.dark.scss +0 -37
- package/dist/css/theme/theme.light.scss +0 -37
- package/dist/css/theme/theme.scss +0 -11
- package/dist/css/theme/tokens.scss +0 -266
- package/dist/css/variables-sass.scss +0 -16
- package/dist/helpers/activationHandler.d.ts +0 -9
- package/dist/helpers/activationHandler.js +0 -23
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -53
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -53
- package/dist/utils/fields.d.ts +0 -1
- package/dist/utils/fields.js +0 -14
- package/dist/utils/watchable.d.ts +0 -3
- package/dist/utils/watchable.js +0 -22
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
- /package/dist/css/theme/{elevate.scss → _elevate.scss} +0 -0
- /package/dist/css/theme/{typography.module.scss → _typography-classes.scss} +0 -0
- /package/dist/css/theme/{typography.scss → _typography.scss} +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
@use "sass:list";
|
|
2
|
+
@use "$css/mixins";
|
|
3
|
+
@use "$css/disabled";
|
|
4
|
+
|
|
5
|
+
$root: ".q-switch";
|
|
6
|
+
$track: "#{$root}__track";
|
|
7
|
+
$handle: "#{$root}__handle";
|
|
8
|
+
$icon: "#{$root}__icon";
|
|
9
|
+
|
|
10
|
+
$checked: "[aria-checked]";
|
|
11
|
+
$unchecked: ":not([aria-checked])";
|
|
12
|
+
|
|
13
|
+
$check-map: (
|
|
14
|
+
"checked": "[aria-checked]",
|
|
15
|
+
"unchecked": ":not([aria-checked])",
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
@function getColor($el, $checked: false, $hovered: null) {
|
|
19
|
+
@if $el == "track" {
|
|
20
|
+
@return if($checked, var(--primary), var(--surface-container-highest));
|
|
21
|
+
} @else if $el == "icon" {
|
|
22
|
+
@return if($checked, var(--on-primary-container), var(--surface-container-highest));
|
|
23
|
+
} @else if $el == "handle" {
|
|
24
|
+
@if ($checked) {
|
|
25
|
+
@return if($hovered, var(--primary-container), var(--on-primary));
|
|
26
|
+
} @else {
|
|
27
|
+
@return if($hovered, var(--on-surface-variant), var(--outline));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@error "The given element #{$el} is not supported.";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@layer q-switch {
|
|
35
|
+
.q-switch {
|
|
36
|
+
position: relative;
|
|
37
|
+
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
flex-shrink: 0; // Stop from collapsing in flex containers
|
|
41
|
+
gap: 0.8rem;
|
|
42
|
+
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
|
|
45
|
+
outline: none;
|
|
46
|
+
|
|
47
|
+
&--reversed {
|
|
48
|
+
flex-direction: row-reverse;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__inner {
|
|
52
|
+
width: 3.25rem;
|
|
53
|
+
height: 2rem;
|
|
54
|
+
border-radius: 10rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
& input {
|
|
58
|
+
appearance: none;
|
|
59
|
+
outline: none;
|
|
60
|
+
margin: 0;
|
|
61
|
+
position: absolute;
|
|
62
|
+
width: 100%;
|
|
63
|
+
z-index: 1;
|
|
64
|
+
cursor: inherit;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Track
|
|
69
|
+
.q-switch {
|
|
70
|
+
& #{$track} {
|
|
71
|
+
position: absolute;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
|
|
80
|
+
border-radius: 10rem;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
|
|
83
|
+
&::before {
|
|
84
|
+
content: "";
|
|
85
|
+
position: absolute;
|
|
86
|
+
height: 100%;
|
|
87
|
+
width: 100%;
|
|
88
|
+
|
|
89
|
+
display: flex;
|
|
90
|
+
|
|
91
|
+
border-radius: inherit;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
transition-property: opacity, background-color;
|
|
94
|
+
transition-timing-function: linear;
|
|
95
|
+
transition-duration: 67ms;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@each $state, $selector in $check-map {
|
|
100
|
+
&#{$selector} #{$track}::before {
|
|
101
|
+
background-color: getColor("track", $state == "checked");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&#{$checked} #{$track} {
|
|
106
|
+
background-color: transparent;
|
|
107
|
+
border-color: transparent;
|
|
108
|
+
|
|
109
|
+
&::before {
|
|
110
|
+
background-clip: content-box;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&#{$unchecked} #{$track}::before {
|
|
115
|
+
border-color: var(--outline);
|
|
116
|
+
border-style: solid;
|
|
117
|
+
border-width: 0.125rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&[aria-disabled] #{$track}:is(::before, ::after) {
|
|
121
|
+
transition: none;
|
|
122
|
+
opacity: 38%;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Handle container
|
|
127
|
+
.q-switch {
|
|
128
|
+
& #{$handle}-container {
|
|
129
|
+
position: relative;
|
|
130
|
+
|
|
131
|
+
display: flex;
|
|
132
|
+
place-content: center;
|
|
133
|
+
place-items: center;
|
|
134
|
+
|
|
135
|
+
// cubic-bezier(0.13, 0.78, 0.33, 1.15) for little bounce
|
|
136
|
+
transition: margin 200ms ease;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&#{$checked} #{$handle}-container {
|
|
140
|
+
margin-inline-start: 1.25rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&#{$unchecked} #{$handle}-container {
|
|
144
|
+
margin-inline-end: 1.25rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&[aria-disabled] #{$handle}-container {
|
|
148
|
+
transition: none;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Handle
|
|
153
|
+
.q-switch {
|
|
154
|
+
& #{$handle} {
|
|
155
|
+
height: 1rem;
|
|
156
|
+
width: 1rem;
|
|
157
|
+
|
|
158
|
+
border-radius: 100%;
|
|
159
|
+
|
|
160
|
+
transform-origin: center;
|
|
161
|
+
transition-property: height, width;
|
|
162
|
+
transition-duration: 250ms, 250ms;
|
|
163
|
+
transition-timing-function: cubic-bezier(0.2, 0, 0, 1), cubic-bezier(0.2, 0, 0, 1);
|
|
164
|
+
z-index: 0;
|
|
165
|
+
|
|
166
|
+
&::before {
|
|
167
|
+
content: "";
|
|
168
|
+
position: absolute;
|
|
169
|
+
inset: 0;
|
|
170
|
+
|
|
171
|
+
display: flex;
|
|
172
|
+
border-radius: inherit;
|
|
173
|
+
box-sizing: border-box;
|
|
174
|
+
transition: background-color 67ms linear;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&::after {
|
|
178
|
+
content: "";
|
|
179
|
+
position: absolute;
|
|
180
|
+
inset: -0.5rem;
|
|
181
|
+
border-radius: inherit;
|
|
182
|
+
|
|
183
|
+
background-color: transparent;
|
|
184
|
+
opacity: 0.08;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&:not([aria-disabled])#{$checked}:is(:hover, :focus-within) #{$handle}::after {
|
|
189
|
+
background-color: var(--primary);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&:not([aria-disabled])#{$unchecked}:is(:hover, :focus-within) #{$handle}::after {
|
|
193
|
+
background-color: var(--on-surface);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
& #{$handle}--with-icon,
|
|
197
|
+
&#{$checked} #{$handle} {
|
|
198
|
+
height: 1.5rem;
|
|
199
|
+
width: 1.5rem;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
&:not([aria-disabled]):active #{$handle} {
|
|
203
|
+
height: 1.75rem;
|
|
204
|
+
width: 1.75rem;
|
|
205
|
+
transition-timing-function: linear;
|
|
206
|
+
transition-duration: 100ms;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@each $state, $selector in $check-map {
|
|
210
|
+
&#{$selector}:not([aria-disabled]) {
|
|
211
|
+
& #{$handle}::before {
|
|
212
|
+
background-color: getColor("handle", $state == "checked", false);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&:is(:hover, :focus-within, :active) #{$handle}::before {
|
|
216
|
+
background-color: getColor("handle", $state == "checked", true);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Icon
|
|
223
|
+
.q-switch {
|
|
224
|
+
& #{$icon} {
|
|
225
|
+
position: absolute;
|
|
226
|
+
// Equivalent to top, right, bottom and left set to 0
|
|
227
|
+
inset: 0;
|
|
228
|
+
margin: auto;
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: center;
|
|
232
|
+
color: currentColor;
|
|
233
|
+
|
|
234
|
+
transition:
|
|
235
|
+
opacity 33ms linear,
|
|
236
|
+
transform 167ms cubic-bezier(0.2, 0, 0, 1);
|
|
237
|
+
opacity: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&[aria-checked] #{$icon}--checked,
|
|
241
|
+
&:not([aria-checked]) #{$icon}--unchecked {
|
|
242
|
+
opacity: 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// rotate checked icon into view when there is no unchecked icon
|
|
246
|
+
&:not([aria-checked]) #{$handle}:not(#{$handle}--with-icon) #{icon}--checked {
|
|
247
|
+
transform: rotate(-45deg);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&#{$checked} {
|
|
251
|
+
& #{$icon} {
|
|
252
|
+
transition: none;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@each $state, $selector in $check-map {
|
|
257
|
+
&#{$selector} {
|
|
258
|
+
& #{$icon}--#{$state} {
|
|
259
|
+
color: getColor("icon", $state == "checked");
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Disabled
|
|
267
|
+
@layer q-switch--disabled {
|
|
268
|
+
.q-switch[aria-disabled] {
|
|
269
|
+
&,
|
|
270
|
+
& * {
|
|
271
|
+
@include disabled.base();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
& #{$track}::before {
|
|
275
|
+
background-color: disabled.rest-color("surface-container-high");
|
|
276
|
+
border-color: disabled.rest-color("on-surface");
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
& #{$handle} {
|
|
280
|
+
background-color: disabled.font-color();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
& #{$icon} {
|
|
284
|
+
color: disabled.font-color("surface-container-high");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&#{$checked} {
|
|
288
|
+
& #{$track}::before {
|
|
289
|
+
background-color: disabled.rest-color();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
& #{$handle} {
|
|
293
|
+
background-color: var(--surface);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
& #{$icon} {
|
|
297
|
+
color: disabled.font-color();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
& :is(#{$handle}, #{$handle}::before) {
|
|
302
|
+
transition: none;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { ripple } from "../../helpers";
|
|
3
|
+
import { QIconSnippet } from "../private";
|
|
4
|
+
import { isActivationKey, type QEvent } from "../../utils";
|
|
5
|
+
import type { QSwitchProps } from "./props";
|
|
6
|
+
|
|
7
|
+
type QSwitchEvent<T> = QEvent<T, HTMLDivElement>;
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
value = $bindable(),
|
|
11
|
+
label = undefined,
|
|
12
|
+
labelPosition = "right",
|
|
13
|
+
disabled = false,
|
|
14
|
+
icons = false,
|
|
15
|
+
showOnlyCheckedIcon = false,
|
|
16
|
+
checkedIcon,
|
|
17
|
+
uncheckedIcon,
|
|
18
|
+
...props
|
|
19
|
+
}: QSwitchProps = $props();
|
|
20
|
+
|
|
21
|
+
let qSwitch: HTMLDivElement;
|
|
22
|
+
let qSwitchInput: HTMLInputElement;
|
|
23
|
+
|
|
24
|
+
function toggle() {
|
|
25
|
+
value = !value;
|
|
26
|
+
|
|
27
|
+
qSwitch.dispatchEvent(new Event("change", { bubbles: true }));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function onclick(event: QSwitchEvent<MouseEvent>) {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
if (!qSwitchInput || disabled) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
props.onclick?.(event);
|
|
37
|
+
|
|
38
|
+
qSwitchInput.focus();
|
|
39
|
+
toggle();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function onkeydown(event: QSwitchEvent<KeyboardEvent>) {
|
|
43
|
+
if (!qSwitch || disabled || !isActivationKey(event)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
props.onkeydown?.(event);
|
|
48
|
+
|
|
49
|
+
if (event.defaultPrevented) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
qSwitch.click();
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
bind:this={qSwitch}
|
|
60
|
+
{...props}
|
|
61
|
+
class={[
|
|
62
|
+
"q-switch",
|
|
63
|
+
props.class,
|
|
64
|
+
disabled && "q-switch--disabled",
|
|
65
|
+
labelPosition === "left" && "q-switch--reversed",
|
|
66
|
+
]}
|
|
67
|
+
{onclick}
|
|
68
|
+
{onkeydown}
|
|
69
|
+
aria-disabled={disabled || undefined}
|
|
70
|
+
role="switch"
|
|
71
|
+
aria-checked={value || undefined}
|
|
72
|
+
data-quaff
|
|
73
|
+
>
|
|
74
|
+
<label class="q-switch__inner">
|
|
75
|
+
<input
|
|
76
|
+
bind:checked={value}
|
|
77
|
+
bind:this={qSwitchInput}
|
|
78
|
+
type="checkbox"
|
|
79
|
+
disabled={disabled || undefined}
|
|
80
|
+
/>
|
|
81
|
+
<span class="q-switch__track">
|
|
82
|
+
<span class="q-switch__touch"></span>
|
|
83
|
+
<span class="q-switch__handle-container" use:ripple={{ disabled }}>
|
|
84
|
+
<span
|
|
85
|
+
class={[
|
|
86
|
+
"q-switch__handle",
|
|
87
|
+
(showOnlyCheckedIcon ? !!value : icons || uncheckedIcon) &&
|
|
88
|
+
"q-switch__handle--with-icon",
|
|
89
|
+
]}
|
|
90
|
+
>
|
|
91
|
+
{#if (uncheckedIcon || icons) && !showOnlyCheckedIcon}
|
|
92
|
+
{@render icon("unchecked")}
|
|
93
|
+
{/if}
|
|
94
|
+
{#if checkedIcon || icons || showOnlyCheckedIcon}
|
|
95
|
+
{@render icon("checked")}
|
|
96
|
+
{/if}
|
|
97
|
+
</span>
|
|
98
|
+
</span>
|
|
99
|
+
</span>
|
|
100
|
+
</label>
|
|
101
|
+
{#if label}
|
|
102
|
+
<span class="q-switch__label">
|
|
103
|
+
{label}
|
|
104
|
+
</span>
|
|
105
|
+
{/if}
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{#snippet icon(type: "unchecked" | "checked")}
|
|
109
|
+
<QIconSnippet
|
|
110
|
+
icon={type === "unchecked" ? uncheckedIcon : checkedIcon}
|
|
111
|
+
defaultIcon={type === "unchecked" ? "close" : "check"}
|
|
112
|
+
size="1rem"
|
|
113
|
+
class="q-switch__icon q-switch__icon--{type}"
|
|
114
|
+
/>
|
|
115
|
+
{/snippet}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
type QSwitchProps_ = typeof __propDef.props;
|
|
10
|
+
export { QSwitchProps_ as QSwitchProps };
|
|
11
|
+
export type QSwitchEvents = typeof __propDef.events;
|
|
12
|
+
export type QSwitchSlots = typeof __propDef.slots;
|
|
13
|
+
export default class QSwitch extends SvelteComponentTyped<QSwitchProps_, QSwitchEvents, QSwitchSlots> {
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QSwitchDocsProps, QSwitchDocsSnippets } from "./docs.props";
|
|
2
|
+
export const QSwitchDocs = {
|
|
3
|
+
name: "QSwitch",
|
|
4
|
+
description: "QSwitch is a switch-like checkbox which offers binary choices. It supports labels, icons and different positioning of the labels.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QSwitchDocsProps,
|
|
7
|
+
snippets: QSwitchDocsSnippets,
|
|
8
|
+
methods: [],
|
|
9
|
+
events: [
|
|
10
|
+
{
|
|
11
|
+
name: "input",
|
|
12
|
+
type: "(value: boolean) => void",
|
|
13
|
+
description: "Emitted when the user changes the value of the toggle.",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
+
// @quaffHash 759a896310c5a7db6adc0840a9c47349
|
|
3
|
+
export const QSwitchDocsProps = [
|
|
4
|
+
{
|
|
5
|
+
isArray: false,
|
|
6
|
+
optional: true,
|
|
7
|
+
isSnippet: false,
|
|
8
|
+
name: "value",
|
|
9
|
+
type: {
|
|
10
|
+
name: "boolean",
|
|
11
|
+
isClickable: false,
|
|
12
|
+
},
|
|
13
|
+
description: "Current on/off state of the switch. This property is bindable.",
|
|
14
|
+
default: "undefined",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
isArray: false,
|
|
18
|
+
optional: true,
|
|
19
|
+
isSnippet: false,
|
|
20
|
+
name: "label",
|
|
21
|
+
type: {
|
|
22
|
+
name: "string",
|
|
23
|
+
isClickable: false,
|
|
24
|
+
},
|
|
25
|
+
description: "Text label to display next to the switch.",
|
|
26
|
+
default: "undefined",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
isArray: false,
|
|
30
|
+
optional: true,
|
|
31
|
+
isSnippet: false,
|
|
32
|
+
name: "labelPosition",
|
|
33
|
+
type: [
|
|
34
|
+
{
|
|
35
|
+
name: '"left"',
|
|
36
|
+
isClickable: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: '"right"',
|
|
40
|
+
isClickable: false,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
description: "Position of the label relative to the switch.",
|
|
44
|
+
default: '"right"',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
isArray: false,
|
|
48
|
+
optional: true,
|
|
49
|
+
isSnippet: false,
|
|
50
|
+
name: "icons",
|
|
51
|
+
type: {
|
|
52
|
+
name: "boolean",
|
|
53
|
+
isClickable: false,
|
|
54
|
+
},
|
|
55
|
+
description: "Shows default check/close icons in the switch handle.",
|
|
56
|
+
default: "false",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
isArray: false,
|
|
60
|
+
optional: true,
|
|
61
|
+
isSnippet: false,
|
|
62
|
+
name: "showOnlyCheckedIcon",
|
|
63
|
+
type: {
|
|
64
|
+
name: "boolean",
|
|
65
|
+
isClickable: false,
|
|
66
|
+
},
|
|
67
|
+
description: "When true, only shows the check icon (when the switch is on).",
|
|
68
|
+
default: "false",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
isArray: false,
|
|
72
|
+
optional: true,
|
|
73
|
+
isSnippet: false,
|
|
74
|
+
name: "checkedIcon",
|
|
75
|
+
type: [
|
|
76
|
+
{
|
|
77
|
+
name: "MaterialSymbol",
|
|
78
|
+
isClickable: false,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Snippet",
|
|
82
|
+
isClickable: false,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
description: "Custom icon to show when the switch is on. Can be a Material Symbol name or a custom snippet.",
|
|
86
|
+
default: '"check"',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
isArray: false,
|
|
90
|
+
optional: true,
|
|
91
|
+
isSnippet: false,
|
|
92
|
+
name: "uncheckedIcon",
|
|
93
|
+
type: [
|
|
94
|
+
{
|
|
95
|
+
name: "MaterialSymbol",
|
|
96
|
+
isClickable: false,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "Snippet",
|
|
100
|
+
isClickable: false,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
description: "Custom icon to show when the switch is off. Can be a Material Symbol name or a custom snippet.",
|
|
104
|
+
default: '"close"',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
isArray: false,
|
|
108
|
+
optional: true,
|
|
109
|
+
isSnippet: false,
|
|
110
|
+
name: "disabled",
|
|
111
|
+
type: {
|
|
112
|
+
name: "boolean",
|
|
113
|
+
isClickable: false,
|
|
114
|
+
},
|
|
115
|
+
description: "Disables the switch, preventing user interaction.",
|
|
116
|
+
default: "false",
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
export const QSwitchDocsSnippets = [];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
export interface QSwitchProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/**
|
|
6
|
+
* Current on/off state of the switch. This property is bindable.
|
|
7
|
+
*
|
|
8
|
+
* @default undefined
|
|
9
|
+
*/
|
|
10
|
+
value?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Text label to display next to the switch.
|
|
13
|
+
*
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Position of the label relative to the switch.
|
|
19
|
+
*
|
|
20
|
+
* @default "right"
|
|
21
|
+
*/
|
|
22
|
+
labelPosition?: "left" | "right";
|
|
23
|
+
/**
|
|
24
|
+
* Shows default check/close icons in the switch handle.
|
|
25
|
+
*
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
icons?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* When true, only shows the check icon (when the switch is on).
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
showOnlyCheckedIcon?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Custom icon to show when the switch is on. Can be a Material Symbol name or a custom snippet.
|
|
37
|
+
*
|
|
38
|
+
* @default "check"
|
|
39
|
+
*/
|
|
40
|
+
checkedIcon?: MaterialSymbol | Snippet;
|
|
41
|
+
/**
|
|
42
|
+
* Custom icon to show when the switch is off. Can be a Material Symbol name or a custom snippet.
|
|
43
|
+
*
|
|
44
|
+
* @default "close"
|
|
45
|
+
*/
|
|
46
|
+
uncheckedIcon?: MaterialSymbol | Snippet;
|
|
47
|
+
/**
|
|
48
|
+
* Disables the switch, preventing user interaction.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|