@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
|
@@ -1,16 +1,63 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setContext, type Snippet } from "svelte";
|
|
3
|
+
import { assets } from "$app/paths";
|
|
4
|
+
import { QCard, QCardSection, QTheme, Quaff } from "../..";
|
|
5
|
+
import { QColors, QDocsCtxName, type QComponentDocs } from "../../utils";
|
|
6
|
+
import QApi from "./QApi.svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
display,
|
|
11
|
+
pre,
|
|
12
|
+
usage,
|
|
13
|
+
snippets,
|
|
14
|
+
componentDocs,
|
|
15
|
+
docName,
|
|
16
|
+
docDescription,
|
|
17
|
+
}: {
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
display?: Snippet;
|
|
20
|
+
pre?: Snippet;
|
|
21
|
+
usage?: Snippet;
|
|
22
|
+
snippets?: Record<string, string>;
|
|
23
|
+
componentDocs?: QComponentDocs | QComponentDocs[];
|
|
24
|
+
docName?: string;
|
|
25
|
+
docDescription?: string;
|
|
26
|
+
} = $props();
|
|
27
|
+
|
|
28
|
+
const isDark = $derived(Quaff.darkMode.isActive);
|
|
29
|
+
|
|
30
|
+
const hueRotate = $derived(
|
|
31
|
+
QColors.calculateHueRotate(
|
|
32
|
+
"#ec6b08",
|
|
33
|
+
QTheme.themeColors[`primary-${isDark ? "dark" : "light"}`],
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (snippets) {
|
|
38
|
+
setContext(QDocsCtxName.snippets, () => snippets);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const image = $derived(`${assets}/cocktail-close-up.jpg`);
|
|
42
|
+
|
|
43
|
+
let principalDocument = Array.isArray(componentDocs)
|
|
44
|
+
? componentDocs[0]
|
|
45
|
+
: componentDocs;
|
|
8
46
|
</script>
|
|
9
47
|
|
|
10
|
-
<div class="q-docs" style="
|
|
11
|
-
<div class="row q-gutter-lg
|
|
12
|
-
<QCard
|
|
13
|
-
|
|
48
|
+
<div class="q-docs" style="padding: 1rem">
|
|
49
|
+
<div class="row q-gutter-lg" style="min-height: 400px">
|
|
50
|
+
<QCard
|
|
51
|
+
class="col-sm-12 col-lg-6 flex flex-center"
|
|
52
|
+
fill="primary"
|
|
53
|
+
style="min-height: 400px; align-content: center;"
|
|
54
|
+
>
|
|
55
|
+
<h1 class="large no-margin">{principalDocument?.name || docName}</h1>
|
|
56
|
+
<QCardSection class="q-docs__description flex flex-center">
|
|
57
|
+
<h3 class="q-docs__description-text">
|
|
58
|
+
{principalDocument?.description || docDescription}
|
|
59
|
+
</h3>
|
|
60
|
+
</QCardSection>
|
|
14
61
|
</QCard>
|
|
15
62
|
<QCard
|
|
16
63
|
class="q-docs__preview col-sm-12 col-lg-6 q-mt-none q-pa-none"
|
|
@@ -20,75 +67,79 @@ let principalDocument = Array.isArray(QComponentDocs) ? QComponentDocs[0] : QCom
|
|
|
20
67
|
<QCardSection class="q-pa-none">
|
|
21
68
|
<div
|
|
22
69
|
class="flex flex-center"
|
|
23
|
-
style="position: absolute; height: 100%; width: 100%; z-index: 1;"
|
|
70
|
+
style="position: absolute; height: 100%; width: 100%; z-index: 1; overflow: hidden;"
|
|
24
71
|
>
|
|
25
|
-
|
|
72
|
+
{@render display?.()}
|
|
26
73
|
</div>
|
|
27
74
|
<img
|
|
28
75
|
class="q-docs__image"
|
|
29
|
-
src=
|
|
30
|
-
alt="Close-up of the content of a
|
|
31
|
-
style={isDark ? "
|
|
76
|
+
src={image}
|
|
77
|
+
alt="Close-up of the content of a cocktail"
|
|
78
|
+
style={`filter: hue-rotate(${hueRotate}deg) ${isDark ? "brightness(0.7)" : "brightness(1.2)"}`}
|
|
32
79
|
/>
|
|
33
80
|
</QCardSection>
|
|
34
|
-
<QCardSection class="q-docs__description flex flex-center">
|
|
35
|
-
<h3 class="q-docs__description-text">
|
|
36
|
-
{principalDocument.description}
|
|
37
|
-
</h3>
|
|
38
|
-
</QCardSection>
|
|
39
81
|
</QCard>
|
|
40
82
|
</div>
|
|
41
83
|
|
|
42
|
-
<
|
|
84
|
+
<div class="q-page">
|
|
85
|
+
{#if componentDocs}
|
|
86
|
+
<QApi
|
|
87
|
+
componentDocs={Array.isArray(componentDocs)
|
|
88
|
+
? componentDocs
|
|
89
|
+
: [componentDocs]}
|
|
90
|
+
/>
|
|
91
|
+
{/if}
|
|
43
92
|
|
|
44
|
-
|
|
45
|
-
<div class="s12 q-pa-md">
|
|
46
|
-
<div class="heading-usage">
|
|
47
|
-
<h4 class="q-my-xl">Usage</h4>
|
|
48
|
-
</div>
|
|
93
|
+
{@render pre?.()}
|
|
49
94
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
95
|
+
{#if usage}
|
|
96
|
+
<div class="q-pa-md">
|
|
97
|
+
<div class="heading-usage">
|
|
98
|
+
<h4 class="q-my-xl">Usage</h4>
|
|
99
|
+
</div>
|
|
53
100
|
|
|
54
|
-
|
|
55
|
-
</div>
|
|
101
|
+
{@render usage()}
|
|
102
|
+
</div>
|
|
103
|
+
{/if}
|
|
56
104
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.q-docs__image {
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 12rem;
|
|
63
|
-
object-fit: cover;
|
|
64
|
-
border-bottom-left-radius: 0;
|
|
65
|
-
border-bottom-right-radius: 0;
|
|
66
|
-
}
|
|
67
|
-
.q-docs :global(.q-docs__preview) {
|
|
68
|
-
display: flex !important;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
}
|
|
71
|
-
.q-docs :global(.q-docs__description) {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-grow: 1;
|
|
74
|
-
justify-content: center;
|
|
75
|
-
align-items: center;
|
|
76
|
-
}
|
|
77
|
-
.q-docs :global(.q-docs__description-text) {
|
|
78
|
-
font-size: 1.75rem;
|
|
79
|
-
}
|
|
105
|
+
{@render children?.()}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
80
108
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
}
|
|
109
|
+
<style>
|
|
110
|
+
.q-docs :global(.q-pa-none) {
|
|
111
|
+
padding: 0 !important;
|
|
112
|
+
}
|
|
113
|
+
.q-docs :global(code:not(pre > code)) {
|
|
114
|
+
background-color: var(--surface-container);
|
|
115
|
+
padding: 0.25rem 0.5rem;
|
|
116
|
+
border-radius: 0.25rem;
|
|
117
|
+
}
|
|
118
|
+
.q-docs__image {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 25rem;
|
|
121
|
+
object-fit: cover;
|
|
122
|
+
}
|
|
123
|
+
.q-docs :global(.q-docs__preview) {
|
|
124
|
+
display: flex !important;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
}
|
|
127
|
+
.q-docs :global(.q-docs__description) {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-grow: 1;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
}
|
|
133
|
+
.q-docs :global(.q-docs__description-text) {
|
|
134
|
+
font-size: 1.75rem;
|
|
135
|
+
text-align: center;
|
|
136
|
+
}
|
|
137
|
+
.q-docs .q-page {
|
|
138
|
+
padding-top: 0.5rem;
|
|
139
|
+
}
|
|
90
140
|
|
|
91
|
-
.heading-usage {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
141
|
+
.heading-usage {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { QComponentDocs } from "../../utils/types";
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
3
2
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
5
|
-
QComponentDocs: QComponentDocs | QComponentDocs[];
|
|
6
|
-
};
|
|
3
|
+
props: Record<string, never>;
|
|
7
4
|
events: {
|
|
8
5
|
[evt: string]: CustomEvent<any>;
|
|
9
6
|
};
|
|
10
|
-
slots: {
|
|
11
|
-
display: {};
|
|
12
|
-
usage: {};
|
|
13
|
-
default: {};
|
|
14
|
-
};
|
|
7
|
+
slots: {};
|
|
15
8
|
};
|
|
16
9
|
export type QDocsProps = typeof __propDef.props;
|
|
17
10
|
export type QDocsEvents = typeof __propDef.events;
|
|
18
11
|
export type QDocsSlots = typeof __propDef.slots;
|
|
19
|
-
export default class QDocs extends
|
|
12
|
+
export default class QDocs extends SvelteComponentTyped<QDocsProps, QDocsEvents, QDocsSlots> {
|
|
20
13
|
}
|
|
21
14
|
export {};
|
|
@@ -1,32 +1,62 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
3
|
-
import QCodeBlock from "
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, type Snippet } from "svelte";
|
|
3
|
+
import { QBtn, QCodeBlock, QDialog } from "../..";
|
|
4
|
+
import { QDocsCtxName } from "../../utils";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type QDocsSectionProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
sectionDescription?: Snippet;
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
noCode?: boolean;
|
|
11
|
+
};
|
|
6
12
|
|
|
7
|
-
let
|
|
13
|
+
let {
|
|
14
|
+
title,
|
|
15
|
+
noCode = false,
|
|
16
|
+
sectionDescription,
|
|
17
|
+
children,
|
|
18
|
+
}: QDocsSectionProps = $props();
|
|
19
|
+
|
|
20
|
+
const snippets = getContext<undefined | (() => Record<string, string>)>(
|
|
21
|
+
QDocsCtxName.snippets,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const code = $derived(snippets && snippets()[title]);
|
|
25
|
+
|
|
26
|
+
let dialog = $state(false);
|
|
27
|
+
|
|
28
|
+
// Create a kebab-case id from the title to be able to link to this section
|
|
29
|
+
const id = $derived(title.toLowerCase().replaceAll(" ", "-"));
|
|
8
30
|
</script>
|
|
9
31
|
|
|
10
|
-
<div style="margin-bottom:48px">
|
|
11
|
-
<div class="flex justify-between q-mb-
|
|
32
|
+
<div {id} style="margin-bottom:48px">
|
|
33
|
+
<div class="flex justify-between q-mb-sm">
|
|
12
34
|
<h5>{title}</h5>
|
|
13
|
-
{#if
|
|
35
|
+
{#if code && !noCode}
|
|
36
|
+
<QBtn
|
|
37
|
+
icon="code"
|
|
38
|
+
variant="outlined"
|
|
39
|
+
round
|
|
40
|
+
onclick={() => (dialog = true)}
|
|
41
|
+
/>
|
|
14
42
|
<QDialog
|
|
15
43
|
class="snippet-dialog"
|
|
16
44
|
bind:value={dialog}
|
|
17
|
-
btnAttrs={{ outline: true, round: true, icon: "code" }}
|
|
18
|
-
on:btnClick={() => (dialog = true)}
|
|
19
45
|
modal
|
|
46
|
+
style="max-width: 75vw"
|
|
20
47
|
>
|
|
21
|
-
<QCodeBlock code
|
|
48
|
+
<QCodeBlock {code} language="svelte" {title} copiable />
|
|
22
49
|
</QDialog>
|
|
23
50
|
{/if}
|
|
24
51
|
</div>
|
|
25
|
-
<slot />
|
|
26
|
-
</div>
|
|
27
52
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
{#if sectionDescription}
|
|
54
|
+
<div class="q-mb-md" style="text-wrap: balance">
|
|
55
|
+
{@render sectionDescription()}
|
|
56
|
+
</div>
|
|
57
|
+
{/if}
|
|
58
|
+
|
|
59
|
+
<div class="q-ma-sm">
|
|
60
|
+
{@render children?.()}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
/** @typedef {typeof __propDef.events} QDocsSectionEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} QDocsSectionSlots */
|
|
4
|
-
export default class QDocsSection extends SvelteComponent<{
|
|
5
|
-
title: any;
|
|
6
|
-
snippets: any;
|
|
7
|
-
}, {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
}, {
|
|
10
|
-
default: {};
|
|
11
|
-
}> {
|
|
12
|
-
}
|
|
13
|
-
export type QDocsSectionProps = typeof __propDef.props;
|
|
14
|
-
export type QDocsSectionEvents = typeof __propDef.events;
|
|
15
|
-
export type QDocsSectionSlots = typeof __propDef.slots;
|
|
16
|
-
import { SvelteComponent } from "svelte";
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
17
2
|
declare const __propDef: {
|
|
18
|
-
props:
|
|
19
|
-
title: any;
|
|
20
|
-
snippets: any;
|
|
21
|
-
};
|
|
3
|
+
props: Record<string, never>;
|
|
22
4
|
events: {
|
|
23
5
|
[evt: string]: CustomEvent<any>;
|
|
24
6
|
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
7
|
+
slots: {};
|
|
28
8
|
};
|
|
29
|
-
|
|
9
|
+
type QDocsSectionProps_ = typeof __propDef.props;
|
|
10
|
+
export { QDocsSectionProps_ as QDocsSectionProps };
|
|
11
|
+
export type QDocsSectionEvents = typeof __propDef.events;
|
|
12
|
+
export type QDocsSectionSlots = typeof __propDef.slots;
|
|
13
|
+
export default class QDocsSection extends SvelteComponentTyped<QDocsSectionProps_, QDocsSectionEvents, QDocsSectionSlots> {
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- This component should be used when an icon can be set from props. The icon can either be undefined, a string or a Snippet so this componnet handles it all. -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import QIcon from "../icon/QIcon.svelte";
|
|
4
|
+
import type { QIconProps } from "../icon/props";
|
|
5
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
interface IconSnippetProps extends Omit<QIconProps, "name"> {
|
|
9
|
+
icon?: MaterialSymbol | Snippet;
|
|
10
|
+
defaultIcon?: MaterialSymbol | Snippet;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let { icon, defaultIcon, ...props }: IconSnippetProps = $props();
|
|
14
|
+
|
|
15
|
+
const iconToUse = $derived(icon ?? defaultIcon);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{#if typeof iconToUse === "string"}
|
|
19
|
+
<QIcon name={iconToUse} {...props} />
|
|
20
|
+
{:else}
|
|
21
|
+
{@render iconToUse?.()}
|
|
22
|
+
{/if}
|
|
@@ -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
|
+
export type QIconSnippetProps = typeof __propDef.props;
|
|
10
|
+
export type QIconSnippetEvents = typeof __propDef.events;
|
|
11
|
+
export type QIconSnippetSlots = typeof __propDef.slots;
|
|
12
|
+
export default class QIconSnippet extends SvelteComponentTyped<QIconSnippetProps, QIconSnippetEvents, QIconSnippetSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ContextReseter from "./ContextReseter.svelte";
|
|
2
|
+
import QApi from "./QApi.svelte";
|
|
3
|
+
import QDocs from "./QDocs.svelte";
|
|
4
|
+
import QDocsSection from "./QDocsSection.svelte";
|
|
5
|
+
import QIconSnippet from "./QIconSnippet.svelte";
|
|
6
|
+
export { ContextReseter, QApi, QDocs, QDocsSection, QIconSnippet };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ContextReseter from "./ContextReseter.svelte";
|
|
2
|
+
import QApi from "./QApi.svelte";
|
|
3
|
+
import QDocs from "./QDocs.svelte";
|
|
4
|
+
import QDocsSection from "./QDocsSection.svelte";
|
|
5
|
+
import QIconSnippet from "./QIconSnippet.svelte";
|
|
6
|
+
export { ContextReseter, QApi, QDocs, QDocsSection, QIconSnippet };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
3
|
+
.q-circular-progress {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
|
|
8
|
+
height: 1em;
|
|
9
|
+
width: 1em;
|
|
10
|
+
font-size: var(--size);
|
|
11
|
+
line-height: 0;
|
|
12
|
+
|
|
13
|
+
&__svg {
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--indeterminate {
|
|
19
|
+
& .q-circular-progress__svg {
|
|
20
|
+
transform-origin: 50% 50%;
|
|
21
|
+
animation: q-spin 2s linear infinite;
|
|
22
|
+
|
|
23
|
+
& .q-circular-progress__indicator {
|
|
24
|
+
stroke-dasharray: 1400;
|
|
25
|
+
stroke-dashoffset: 0;
|
|
26
|
+
animation: q-load 1.5s ease-in-out infinite;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@keyframes q-spin {
|
|
33
|
+
0% {
|
|
34
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
35
|
+
}
|
|
36
|
+
25% {
|
|
37
|
+
transform: rotate3d(0, 0, 1, 90deg);
|
|
38
|
+
}
|
|
39
|
+
50% {
|
|
40
|
+
transform: rotate3d(0, 0, 1, 180deg);
|
|
41
|
+
}
|
|
42
|
+
75% {
|
|
43
|
+
transform: rotate3d(0, 0, 1, 270deg);
|
|
44
|
+
}
|
|
45
|
+
100% {
|
|
46
|
+
transform: rotate3d(0, 0, 1, 359deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes q-load {
|
|
51
|
+
0% {
|
|
52
|
+
stroke-dasharray: 1, 400;
|
|
53
|
+
stroke-dashoffset: 0;
|
|
54
|
+
}
|
|
55
|
+
50% {
|
|
56
|
+
stroke-dasharray: 400, 400;
|
|
57
|
+
stroke-dashoffset: -100;
|
|
58
|
+
}
|
|
59
|
+
100% {
|
|
60
|
+
stroke-dasharray: 400, 400;
|
|
61
|
+
stroke-dashoffset: -300;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -1,27 +1,140 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useSize } from "../../composables";
|
|
3
|
+
import { between } from "../../utils";
|
|
4
|
+
import type { QCircularProgressProps } from "./props";
|
|
5
|
+
|
|
6
|
+
type CircleParams = {
|
|
7
|
+
cls: "track" | "indicator";
|
|
8
|
+
offset: number;
|
|
9
|
+
color: string;
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const radius = 50,
|
|
14
|
+
diameter = 2 * radius,
|
|
15
|
+
circumference = diameter * Math.PI,
|
|
16
|
+
strokeDashArray = Math.round(circumference * 1000) / 1000;
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
value = $bindable(0),
|
|
20
|
+
indeterminate = false,
|
|
21
|
+
size = "2em",
|
|
22
|
+
fontSize = "0.25em",
|
|
23
|
+
color = "primary",
|
|
24
|
+
trackColor = "secondary-container",
|
|
25
|
+
thickness = 0.2,
|
|
26
|
+
min = 0,
|
|
27
|
+
max = 100,
|
|
28
|
+
angle = 0,
|
|
29
|
+
noRound = false,
|
|
30
|
+
instantFeedback = false,
|
|
31
|
+
animationSpeed = 600,
|
|
32
|
+
showValue = false,
|
|
33
|
+
children = fallback,
|
|
34
|
+
...props
|
|
35
|
+
}: QCircularProgressProps = $props();
|
|
36
|
+
|
|
37
|
+
const qSize = $derived(useSize(size, "q-circular-progress"));
|
|
38
|
+
|
|
39
|
+
const parsedColor = $derived(
|
|
40
|
+
color.includes("#") ? color : `var(--${color}, ${color})`,
|
|
41
|
+
);
|
|
42
|
+
const parsedTrackColor = $derived(
|
|
43
|
+
trackColor.includes("#")
|
|
44
|
+
? trackColor
|
|
45
|
+
: `var(--${trackColor}, ${trackColor})`,
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const svgStyle = $derived(`rotate3d(0, 0, 1, ${angle - 90}deg)`);
|
|
49
|
+
const circleStyle = $derived(
|
|
50
|
+
instantFeedback || indeterminate
|
|
51
|
+
? undefined
|
|
52
|
+
: `stroke-dashoffset ${animationSpeed}ms ease 0s, stroke ${animationSpeed}ms ease`,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const viewBox = $derived(diameter / (1 - thickness / 2));
|
|
56
|
+
const viewBoxAttr = $derived(
|
|
57
|
+
`${viewBox / 2} ${viewBox / 2} ${viewBox} ${viewBox}`,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const normalized = $derived(between(value, min, max));
|
|
61
|
+
const range = $derived(max - min);
|
|
62
|
+
|
|
63
|
+
const strokeWidth = $derived((thickness / 2) * viewBox);
|
|
64
|
+
const strokeDashOffset = $derived.by(() => {
|
|
65
|
+
const dashRatio = (max - normalized) / range;
|
|
66
|
+
const dashGap =
|
|
67
|
+
!noRound && normalized < max && dashRatio < 0.25
|
|
68
|
+
? (strokeWidth / 2) * (1 - dashRatio / 0.25)
|
|
69
|
+
: 0;
|
|
70
|
+
|
|
71
|
+
return circumference * dashRatio + dashGap;
|
|
13
72
|
});
|
|
14
73
|
</script>
|
|
15
74
|
|
|
16
|
-
<
|
|
75
|
+
<div
|
|
76
|
+
{...props}
|
|
77
|
+
class={[
|
|
78
|
+
"q-circular-progress",
|
|
79
|
+
props.class,
|
|
80
|
+
indeterminate && "q-circular-progress--indeterminate",
|
|
81
|
+
]}
|
|
82
|
+
style:--size={qSize.style}
|
|
83
|
+
role="progressbar"
|
|
84
|
+
aria-valuemin={min}
|
|
85
|
+
aria-valuemax={max}
|
|
86
|
+
aria-valuenow={indeterminate ? undefined : normalized}
|
|
87
|
+
data-quaff
|
|
88
|
+
>
|
|
89
|
+
<svg
|
|
90
|
+
class="q-circular-progress__svg"
|
|
91
|
+
style:transform={svgStyle}
|
|
92
|
+
viewBox={viewBoxAttr}
|
|
93
|
+
aria-hidden="true"
|
|
94
|
+
>
|
|
95
|
+
{#if trackColor && trackColor !== "transparent"}
|
|
96
|
+
{@render circle({
|
|
97
|
+
cls: "track",
|
|
98
|
+
offset: 0,
|
|
99
|
+
color: parsedTrackColor,
|
|
100
|
+
})}
|
|
101
|
+
{/if}
|
|
102
|
+
|
|
103
|
+
{@render circle({
|
|
104
|
+
cls: "indicator",
|
|
105
|
+
offset: strokeDashOffset,
|
|
106
|
+
color: parsedColor,
|
|
107
|
+
rounded: !noRound,
|
|
108
|
+
})}
|
|
109
|
+
</svg>
|
|
110
|
+
|
|
111
|
+
{#if showValue}
|
|
112
|
+
<div
|
|
113
|
+
class="q-circular-progress__text absolute-full flex flex-center"
|
|
114
|
+
style:font-size={fontSize}
|
|
115
|
+
>
|
|
116
|
+
{@render children()}
|
|
117
|
+
</div>
|
|
118
|
+
{/if}
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{#snippet fallback()}
|
|
122
|
+
<div>{Math.round(normalized)}</div>
|
|
123
|
+
{/snippet}
|
|
124
|
+
|
|
125
|
+
{#snippet circle({ offset, color, cls, rounded }: CircleParams)}
|
|
17
126
|
<circle
|
|
18
|
-
class="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fill="none"
|
|
127
|
+
class="q-circular-progress__{cls}"
|
|
128
|
+
style:transition={circleStyle}
|
|
129
|
+
style:color
|
|
130
|
+
fill="transparent"
|
|
23
131
|
stroke="currentColor"
|
|
24
|
-
stroke-width={
|
|
25
|
-
stroke-
|
|
132
|
+
stroke-width={strokeWidth}
|
|
133
|
+
stroke-dasharray={strokeDashArray}
|
|
134
|
+
stroke-dashoffset={offset}
|
|
135
|
+
stroke-linecap={rounded ? "round" : undefined}
|
|
136
|
+
cx={viewBox}
|
|
137
|
+
cy={viewBox}
|
|
138
|
+
r={radius}
|
|
26
139
|
/>
|
|
27
|
-
|
|
140
|
+
{/snippet}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { QCircularProgressProps } from "./props";
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
3
2
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
5
|
-
value?: number | undefined;
|
|
6
|
-
indeterminate?: boolean | undefined;
|
|
7
|
-
size?: number | `${number}px` | `${number}%` | `${number}em` | `${number}ex` | `${number}ch` | `${number}rem` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | undefined;
|
|
8
|
-
color?: QCircularProgressProps["color"];
|
|
9
|
-
thickness?: number | undefined;
|
|
10
|
-
class?: string | undefined;
|
|
11
|
-
};
|
|
3
|
+
props: Record<string, never>;
|
|
12
4
|
events: {
|
|
13
5
|
[evt: string]: CustomEvent<any>;
|
|
14
6
|
};
|
|
@@ -18,5 +10,5 @@ type QCircularProgressProps_ = typeof __propDef.props;
|
|
|
18
10
|
export { QCircularProgressProps_ as QCircularProgressProps };
|
|
19
11
|
export type QCircularProgressEvents = typeof __propDef.events;
|
|
20
12
|
export type QCircularProgressSlots = typeof __propDef.slots;
|
|
21
|
-
export default class QCircularProgress extends
|
|
13
|
+
export default class QCircularProgress extends SvelteComponentTyped<QCircularProgressProps_, QCircularProgressEvents, QCircularProgressSlots> {
|
|
22
14
|
}
|