@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha19
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/README.md +6 -6
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
- package/dist/classes/QScrollObserver.svelte.js +95 -0
- package/dist/classes/QTheme.svelte.d.ts +11 -0
- package/dist/classes/QTheme.svelte.js +49 -0
- package/dist/classes/Quaff.svelte.d.ts +14 -0
- package/dist/classes/Quaff.svelte.js +35 -0
- package/dist/components/avatar/QAvatar.scss +97 -0
- package/dist/components/avatar/QAvatar.svelte +35 -50
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +21 -5
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +24 -7
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +27 -27
- package/dist/components/breadcrumbs/props.d.ts +25 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +89 -46
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +26 -18
- package/dist/components/button/props.d.ts +21 -15
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +26 -17
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +11 -8
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +9 -7
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +3 -3
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +6 -5
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +1 -1
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +1 -1
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +1 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +97 -69
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
- package/dist/components/codeBlock/docs.props.js +10 -2
- package/dist/components/codeBlock/props.d.ts +6 -1
- package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
- package/dist/components/dialog/QDialog.svelte +72 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.js +1 -1
- package/dist/components/dialog/docs.props.d.ts +0 -8
- package/dist/components/dialog/docs.props.js +1 -131
- package/dist/components/dialog/props.d.ts +0 -16
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +87 -94
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +3 -3
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +65 -24
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +1 -1
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +14 -6
- package/dist/components/footer/props.d.ts +8 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +52 -24
- package/dist/components/header/QHeader.svelte.d.ts +2 -23
- package/dist/components/header/docs.props.js +23 -7
- package/dist/components/header/props.d.ts +11 -3
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +29 -16
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +5 -5
- package/dist/components/icon/props.d.ts +6 -6
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/input/QInput.svelte +52 -25
- package/dist/components/input/QInput.svelte.d.ts +2 -32
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/docs.js +1 -1
- package/dist/components/input/docs.props.js +33 -1
- package/dist/components/input/props.d.ts +5 -12
- package/dist/components/input/props.js +1 -12
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +100 -80
- package/dist/components/layout/QLayout.svelte.d.ts +16 -43
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +57 -1
- package/dist/components/layout/props.d.ts +8 -0
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +65 -46
- package/dist/components/list/QItem.svelte.d.ts +2 -30
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +46 -34
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +28 -16
- package/dist/components/list/QList.svelte.d.ts +2 -28
- package/dist/components/list/docs.d.ts +1 -1
- package/dist/components/list/docs.js +1 -1
- package/dist/components/list/docs.props.js +36 -4
- package/dist/components/list/props.d.ts +9 -8
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +118 -97
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -58
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -22
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
- package/dist/components/private/QIconSnippet.svelte +12 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +104 -28
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +55 -13
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
- package/dist/components/progress/docs.d.ts +1 -1
- package/dist/components/progress/docs.js +1 -1
- package/dist/components/progress/docs.props.js +138 -10
- package/dist/components/progress/props.d.ts +75 -12
- package/dist/components/radio/QRadio.svelte +14 -3
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +1 -1
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +2 -2
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +2 -4
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +43 -66
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +1 -1
- package/dist/components/railbar/docs.js +1 -1
- package/dist/components/railbar/docs.props.js +4 -4
- package/dist/components/railbar/props.d.ts +3 -3
- package/dist/components/select/QSelect.svelte +121 -88
- package/dist/components/select/QSelect.svelte.d.ts +2 -34
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.js +8 -1
- package/dist/components/select/docs.props.js +41 -1
- package/dist/components/select/index.scss +8 -6
- package/dist/components/select/props.d.ts +6 -12
- package/dist/components/select/props.js +1 -12
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +38 -45
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +1 -1
- package/dist/components/separator/docs.js +1 -1
- package/dist/components/separator/docs.props.js +4 -4
- package/dist/components/separator/props.d.ts +5 -7
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +96 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
- package/dist/components/{toggle → switch}/docs.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.props.js +30 -6
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -85
- package/dist/components/table/QTable.svelte.d.ts +3 -29
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +9 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +10 -0
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +75 -96
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +107 -59
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- package/dist/components/tabs/docs.d.ts +1 -1
- package/dist/components/tabs/docs.js +1 -1
- package/dist/components/tabs/docs.props.js +3 -3
- package/dist/components/tabs/index.scss +4 -2
- package/dist/components/tabs/props.d.ts +5 -4
- package/dist/components/tabs/props.js +1 -1
- package/dist/components/toolbar/QToolbar.svelte +15 -12
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
- package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
- package/dist/components/toolbar/docs.d.ts +1 -1
- package/dist/components/toolbar/docs.js +1 -1
- package/dist/components/toolbar/docs.props.js +4 -4
- package/dist/components/toolbar/index.scss +12 -14
- package/dist/components/toolbar/props.d.ts +4 -5
- package/dist/components/tooltip/QTooltip.svelte +5 -9
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +1 -1
- package/dist/components/tooltip/docs.js +1 -1
- package/dist/components/tooltip/docs.props.js +1 -1
- package/dist/components/tooltip/index.scss +3 -1
- package/dist/components/tooltip/props.d.ts +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +3 -3
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
- package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/{ripple.scss → _ripple.scss} +1 -1
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/classes/_flex.scss +62 -0
- 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 +16 -3
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +15 -94
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
- package/dist/css/mixins/_image.scss +63 -0
- package/dist/css/mixins/_index.scss +9 -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} +7 -67
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +62 -32
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/page.scss +3 -3
- package/dist/css/theme/reset.scss +17 -1
- package/dist/css/theme/theme.scss +2 -3
- package/dist/css/theme/tokens.scss +0 -159
- 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/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +14 -5
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.js +1 -2
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +10 -4
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +2 -2
- package/dist/utils/props.js +8 -6
- package/dist/utils/router.d.ts +17 -0
- package/dist/utils/router.js +23 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +4 -1
- package/dist/utils/types.d.ts +7 -2
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +42 -39
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -98
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -103
- package/dist/components/drawer/index.scss +0 -59
- package/dist/components/footer/index.scss +0 -28
- package/dist/components/layout/index.scss +0 -387
- package/dist/components/list/index.scss +0 -144
- package/dist/components/progress/index.scss +0 -82
- package/dist/components/railbar/index.scss +0 -39
- package/dist/components/separator/index.scss +0 -52
- package/dist/components/toggle/QToggle.svelte +0 -34
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- 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/css/grid.scss +0 -50
- package/dist/css/mixins.scss +0 -137
- package/dist/css/states.scss +0 -75
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/theme.dark.scss +0 -39
- package/dist/css/theme/theme.light.scss +0 -39
- package/dist/css/variables-sass.scss +0 -16
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -60
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
- /package/dist/composables/{use-align.js → useAlign.js} +0 -0
- /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
- /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,69 +1,112 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import QCircularProgress from "../progress/QCircularProgress.svelte";
|
|
5
|
+
import { useSize } from "../../composables/useSize";
|
|
6
|
+
import { ripple } from "../../helpers";
|
|
7
|
+
import { isActivationKey } from "../../utils";
|
|
8
|
+
import { extractImgSrc } from "../../utils/string";
|
|
9
|
+
import QIcon from "../icon/QIcon.svelte";
|
|
10
|
+
let {
|
|
11
|
+
disabled = false,
|
|
12
|
+
design = "elevated",
|
|
13
|
+
icon,
|
|
14
|
+
label,
|
|
15
|
+
loading = false,
|
|
16
|
+
rectangle = false,
|
|
17
|
+
noRipple = false,
|
|
18
|
+
rippleColor,
|
|
19
|
+
round = false,
|
|
20
|
+
to,
|
|
21
|
+
unelevated = false,
|
|
22
|
+
size = "md",
|
|
23
|
+
target,
|
|
24
|
+
onclick,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
} = $props();
|
|
28
|
+
let qBtn;
|
|
29
|
+
const tag = $derived(to ? "a" : "button");
|
|
30
|
+
const qSize = $derived(useSize(size, "q-btn"));
|
|
31
|
+
const src = $derived(extractImgSrc(icon));
|
|
32
|
+
const color = $derived(
|
|
33
|
+
`var(--${design === "filled" ? "on-primary" : design === "tonal" ? "on-secondary-container" : "primary"})`,
|
|
34
|
+
);
|
|
35
|
+
const rippleColorVar = $derived(
|
|
36
|
+
rippleColor ? `var(--${rippleColor}, ${rippleColor})` : color,
|
|
37
|
+
);
|
|
38
|
+
function stopIfDisabled(e) {
|
|
39
|
+
if (disabled) {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
e.stopImmediatePropagation();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
onclick?.(e);
|
|
45
|
+
}
|
|
46
|
+
function onkeydown(e) {
|
|
47
|
+
if (e.key === "Escape") {
|
|
48
|
+
qBtn?.blur();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (!isActivationKey(e)) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
17
54
|
e.preventDefault();
|
|
18
|
-
|
|
55
|
+
const click = new MouseEvent("click", { relatedTarget: qBtn });
|
|
56
|
+
stopIfDisabled(click);
|
|
19
57
|
}
|
|
20
|
-
}
|
|
21
|
-
function onKeyDown(e) {
|
|
22
|
-
if (!isActivationKey(e))
|
|
23
|
-
return;
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
let click = new MouseEvent("click");
|
|
26
|
-
qBtn.dispatchEvent(click);
|
|
27
|
-
}
|
|
28
58
|
</script>
|
|
29
59
|
|
|
30
60
|
<svelte:element
|
|
31
61
|
this={tag}
|
|
32
|
-
use:ripple={{ disable: noRipple || disable }}
|
|
33
62
|
bind:this={qBtn}
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
use:ripple={{
|
|
64
|
+
disabled: noRipple || disabled,
|
|
65
|
+
color: rippleColorVar,
|
|
66
|
+
}}
|
|
67
|
+
{...props}
|
|
68
|
+
class="q-btn{qSize.class ? ` ${qSize.class}` : ''}{props.class
|
|
69
|
+
? ` ${props.class}`
|
|
70
|
+
: ''} q-btn--{design}"
|
|
36
71
|
class:q-btn--unelevated={unelevated}
|
|
37
|
-
class:q-btn--outlined={outline}
|
|
38
|
-
class:q-btn--flat={flat}
|
|
39
72
|
class:q-btn--rectangle={rectangle}
|
|
40
|
-
class:q-btn--round={(
|
|
41
|
-
|
|
73
|
+
class:q-btn--round={round || (!children && !label)}
|
|
74
|
+
style:--q-btn-size={qSize.style}
|
|
75
|
+
style:--ripple-color={color}
|
|
76
|
+
{target}
|
|
42
77
|
role={tag === "a" ? "button" : undefined}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{...$$restProps}
|
|
78
|
+
aria-disabled={disabled || undefined}
|
|
79
|
+
tabindex={disabled ? -1 : 0}
|
|
80
|
+
{onkeydown}
|
|
81
|
+
onclick={stopIfDisabled}
|
|
48
82
|
>
|
|
49
83
|
{#if icon && !loading}
|
|
50
|
-
{#if
|
|
84
|
+
{#if src}
|
|
51
85
|
<img
|
|
52
|
-
src
|
|
86
|
+
{src}
|
|
87
|
+
alt="q-btn leading icon"
|
|
53
88
|
class="q-btn__img q-btn__img--responsive"
|
|
54
|
-
alt="{label || 'Slotted'} button"
|
|
55
89
|
/>
|
|
56
90
|
{:else}
|
|
57
|
-
<QIcon name={icon} class="q-btn__icon" />
|
|
91
|
+
<QIcon name={icon as MaterialSymbol} {color} class="q-btn__icon" />
|
|
58
92
|
{/if}
|
|
59
93
|
{/if}
|
|
60
94
|
|
|
61
95
|
{#if loading}
|
|
62
|
-
<QCircularProgress
|
|
96
|
+
<QCircularProgress
|
|
97
|
+
indeterminate
|
|
98
|
+
trackColor="transparent"
|
|
99
|
+
{color}
|
|
100
|
+
size="1.5em"
|
|
101
|
+
class="q-btn__loader"
|
|
102
|
+
/>
|
|
63
103
|
{/if}
|
|
64
104
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
105
|
+
<span class="q-btn__label">
|
|
106
|
+
{#if label}
|
|
107
|
+
{label}
|
|
108
|
+
{:else}
|
|
109
|
+
{@render children?.()}
|
|
110
|
+
{/if}
|
|
111
|
+
</span>
|
|
69
112
|
</svelte:element>
|
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QBtnProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
icon?: QBtnProps["icon"];
|
|
7
|
-
label?: QBtnProps["label"];
|
|
8
|
-
disable?: QBtnProps["disable"];
|
|
9
|
-
loading?: QBtnProps["loading"];
|
|
10
|
-
unelevated?: QBtnProps["unelevated"];
|
|
11
|
-
outline?: QBtnProps["outline"];
|
|
12
|
-
round?: QBtnProps["round"];
|
|
13
|
-
rectangle?: QBtnProps["rectangle"];
|
|
14
|
-
noRipple?: QBtnProps["noRipple"];
|
|
15
|
-
flat?: QBtnProps["flat"];
|
|
16
|
-
to?: QBtnProps["to"];
|
|
17
|
-
size?: QBtnProps["size"];
|
|
18
|
-
class?: string | null | undefined;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
click: MouseEvent;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
type QBtnProps_ = typeof __propDef.props;
|
|
30
|
-
export { QBtnProps_ as QBtnProps };
|
|
31
|
-
export type QBtnEvents = typeof __propDef.events;
|
|
32
|
-
export type QBtnSlots = typeof __propDef.slots;
|
|
33
|
-
export default class QBtn extends SvelteComponent<QBtnProps, QBtnEvents, QBtnSlots> {
|
|
34
|
-
}
|
|
2
|
+
declare const QBtn: import("svelte").Component<QBtnProps, {}, "">;
|
|
3
|
+
export default QBtn;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { QComponentDocs } from "../../utils";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const QBtnDocs: QComponentDocs;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
2
|
+
// @quaffHash 8658ff9566d68f27112f5c6ff5b97a54
|
|
3
3
|
export const QBtnDocsProps = [
|
|
4
4
|
{
|
|
5
|
-
name: "
|
|
5
|
+
name: "disabled",
|
|
6
6
|
type: "boolean",
|
|
7
7
|
optional: true,
|
|
8
8
|
clickableType: false,
|
|
@@ -10,18 +10,18 @@ export const QBtnDocsProps = [
|
|
|
10
10
|
default: "false",
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
name: "
|
|
14
|
-
type: "
|
|
13
|
+
name: "design",
|
|
14
|
+
type: "QBtnDesignOptions",
|
|
15
15
|
optional: true,
|
|
16
|
-
clickableType:
|
|
17
|
-
description: "
|
|
18
|
-
default: "
|
|
16
|
+
clickableType: true,
|
|
17
|
+
description: "Choose the design for the button.",
|
|
18
|
+
default: '"elevated"',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: "icon",
|
|
22
|
-
type: "string",
|
|
22
|
+
type: "MaterialSymbol | `img:${string}`",
|
|
23
23
|
optional: true,
|
|
24
|
-
clickableType:
|
|
24
|
+
clickableType: true,
|
|
25
25
|
description: "Name of the leading icon to use for the button.",
|
|
26
26
|
default: "undefined",
|
|
27
27
|
},
|
|
@@ -41,14 +41,6 @@ export const QBtnDocsProps = [
|
|
|
41
41
|
description: "Puts the button in a loading state, adding a loader as the leading icon.",
|
|
42
42
|
default: "false",
|
|
43
43
|
},
|
|
44
|
-
{
|
|
45
|
-
name: "outline",
|
|
46
|
-
type: "boolean",
|
|
47
|
-
optional: true,
|
|
48
|
-
clickableType: false,
|
|
49
|
-
description: "Use outline design for the button, adding a border around it.",
|
|
50
|
-
default: "false",
|
|
51
|
-
},
|
|
52
44
|
{
|
|
53
45
|
name: "rectangle",
|
|
54
46
|
type: "boolean",
|
|
@@ -65,6 +57,14 @@ export const QBtnDocsProps = [
|
|
|
65
57
|
description: "Disable the ripple effect for the button.",
|
|
66
58
|
default: "false",
|
|
67
59
|
},
|
|
60
|
+
{
|
|
61
|
+
name: "rippleColor",
|
|
62
|
+
type: "string",
|
|
63
|
+
optional: true,
|
|
64
|
+
clickableType: false,
|
|
65
|
+
description: "Sets the ripple effect's color for the button.",
|
|
66
|
+
default: "undefined",
|
|
67
|
+
},
|
|
68
68
|
{
|
|
69
69
|
name: "round",
|
|
70
70
|
type: "boolean",
|
|
@@ -95,7 +95,7 @@ export const QBtnDocsProps = [
|
|
|
95
95
|
optional: true,
|
|
96
96
|
clickableType: true,
|
|
97
97
|
description: "Size of the button.",
|
|
98
|
-
default: "md",
|
|
98
|
+
default: '"md"',
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
name: "target",
|
|
@@ -105,4 +105,12 @@ export const QBtnDocsProps = [
|
|
|
105
105
|
description: 'For "a" (anchor) tag only, apply the target attribute.',
|
|
106
106
|
default: "undefined",
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
name: "onclick",
|
|
110
|
+
type: "MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>",
|
|
111
|
+
optional: true,
|
|
112
|
+
clickableType: true,
|
|
113
|
+
description: "This event is emitted when the button is clicked.",
|
|
114
|
+
default: "undefined",
|
|
115
|
+
},
|
|
108
116
|
];
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { HTMLAnchorAttributes,
|
|
3
|
-
export type QBtnSizeOptions = Exclude<
|
|
4
|
-
export
|
|
1
|
+
import type { MaterialSymbol } from "material-symbols";
|
|
2
|
+
import type { HTMLAttributes, HTMLAnchorAttributes, MouseEventHandler } from "svelte/elements";
|
|
3
|
+
export type QBtnSizeOptions = Exclude<Q.Size, "xs">;
|
|
4
|
+
export type QBtnDesignOptions = "elevated" | "filled" | "tonal" | "outlined" | "flat";
|
|
5
|
+
export interface QBtnProps extends HTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
/**
|
|
6
7
|
* Puts the button in a disabled state, making it unclickable.
|
|
7
8
|
* @default false
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
disabled?: boolean;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @default
|
|
12
|
+
* Choose the design for the button.
|
|
13
|
+
* @default "elevated"
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
design?: QBtnDesignOptions;
|
|
15
16
|
/**
|
|
16
17
|
* Name of the leading icon to use for the button.
|
|
17
18
|
* @default undefined
|
|
18
19
|
*/
|
|
19
|
-
icon?: string
|
|
20
|
+
icon?: MaterialSymbol | `img:${string}`;
|
|
20
21
|
/**
|
|
21
22
|
* Text to use for the button.
|
|
22
23
|
* @default undefined
|
|
@@ -27,11 +28,6 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
|
|
|
27
28
|
* @default false
|
|
28
29
|
*/
|
|
29
30
|
loading?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Use outline design for the button, adding a border around it.
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
outline?: boolean;
|
|
35
31
|
/**
|
|
36
32
|
* Use rectangle design for the button, removing the large border-radius.
|
|
37
33
|
* @default false
|
|
@@ -42,6 +38,11 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
|
|
|
42
38
|
* @default false
|
|
43
39
|
*/
|
|
44
40
|
noRipple?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the ripple effect's color for the button.
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
rippleColor?: string;
|
|
45
46
|
/**
|
|
46
47
|
* Use round design for the button, giving it a circular shape.
|
|
47
48
|
* @default false
|
|
@@ -59,7 +60,7 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
|
|
|
59
60
|
unelevated?: boolean;
|
|
60
61
|
/**
|
|
61
62
|
* Size of the button.
|
|
62
|
-
* @default md
|
|
63
|
+
* @default "md"
|
|
63
64
|
*/
|
|
64
65
|
size?: QBtnSizeOptions;
|
|
65
66
|
/**
|
|
@@ -67,4 +68,9 @@ export interface QBtnProps extends NativeProps, HTMLAttributes<HTMLElement> {
|
|
|
67
68
|
* @default undefined
|
|
68
69
|
*/
|
|
69
70
|
target?: HTMLAnchorAttributes["target"];
|
|
71
|
+
/**
|
|
72
|
+
* This event is emitted when the button is clicked.
|
|
73
|
+
* @default undefined
|
|
74
|
+
*/
|
|
75
|
+
onclick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
70
76
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
3
|
+
.q-card {
|
|
4
|
+
display: block;
|
|
5
|
+
border-radius: 0.75rem;
|
|
6
|
+
transition: transform var(--speed-3) padding var(--speed-3) border-radius var(--speed-3);
|
|
7
|
+
|
|
8
|
+
@include mixins.padding("a-md");
|
|
9
|
+
@include mixins.elevate(1, "bottom");
|
|
10
|
+
|
|
11
|
+
&--bordered {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
box-shadow: none;
|
|
14
|
+
|
|
15
|
+
@include mixins.border;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--flat {
|
|
19
|
+
box-shadow: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&--rounded {
|
|
23
|
+
border-radius: 2rem;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
let {
|
|
5
|
+
fill = false,
|
|
6
|
+
flat = false,
|
|
7
|
+
bordered = false,
|
|
8
|
+
rounded = false,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
} = $props();
|
|
12
|
+
const colorOptions = ["primary", "secondary", "tertiary"];
|
|
13
|
+
const color = $derived.by(() => {
|
|
14
|
+
if (fill) {
|
|
15
|
+
return colorOptions.includes(fill)
|
|
16
|
+
? `${fill}-container`
|
|
17
|
+
: "surface-variant";
|
|
18
|
+
}
|
|
19
|
+
return "surface";
|
|
20
|
+
});
|
|
6
21
|
</script>
|
|
7
22
|
|
|
8
|
-
<article
|
|
9
|
-
|
|
10
|
-
class
|
|
23
|
+
<article
|
|
24
|
+
{...props}
|
|
25
|
+
class="q-card{color ? ` ${color}` : ''}{props.class ? ` ${props.class}` : ''}"
|
|
11
26
|
class:q-card--flat={flat}
|
|
12
|
-
class:q-card--
|
|
13
|
-
{
|
|
27
|
+
class:q-card--bordered={bordered}
|
|
28
|
+
class:q-card--rounded={rounded}
|
|
14
29
|
>
|
|
15
|
-
{
|
|
16
|
-
<slot name="title" />
|
|
17
|
-
{:else if title !== undefined}
|
|
18
|
-
<h5 class="q-card__title">{title}</h5>
|
|
19
|
-
{/if}
|
|
20
|
-
|
|
21
|
-
<slot />
|
|
30
|
+
{@render children?.()}
|
|
22
31
|
</article>
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QCardProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
bordered?: QCardProps["bordered"];
|
|
7
|
-
fill?: QCardProps["fill"];
|
|
8
|
-
flat?: QCardProps["flat"];
|
|
9
|
-
round?: QCardProps["round"];
|
|
10
|
-
title?: QCardProps["title"];
|
|
11
|
-
class?: string | null | undefined;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {
|
|
17
|
-
title: {};
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
type QCardProps_ = typeof __propDef.props;
|
|
22
|
-
export { QCardProps_ as QCardProps };
|
|
23
|
-
export type QCardEvents = typeof __propDef.events;
|
|
24
|
-
export type QCardSlots = typeof __propDef.slots;
|
|
25
|
-
export default class QCard extends SvelteComponent<QCardProps, QCardEvents, QCardSlots> {
|
|
26
|
-
}
|
|
2
|
+
declare const QCard: import("svelte").Component<QCardProps, {}, "">;
|
|
3
|
+
export default QCard;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { useAlign } from "../../composables/useAlign";
|
|
5
|
+
let { align, vertical = false, children, ...props } = $props();
|
|
6
|
+
const alignClass = $derived(useAlign(align));
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<nav
|
|
9
|
-
|
|
10
|
+
{...props}
|
|
11
|
+
class="q-card__actions{alignClass ? ` ${alignClass}` : ''}{props.class
|
|
12
|
+
? ` ${props.class}`
|
|
13
|
+
: ''}"
|
|
10
14
|
class:q-card__actions--vertical={vertical}
|
|
11
|
-
{...$$restProps}
|
|
12
15
|
>
|
|
13
|
-
|
|
16
|
+
{@render children?.()}
|
|
14
17
|
</nav>
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QCardActionsProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
align?: QCardActionsProps["align"];
|
|
7
|
-
vertical?: QCardActionsProps["vertical"];
|
|
8
|
-
class?: string | null | undefined;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {
|
|
14
|
-
default: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
type QCardActionsProps_ = typeof __propDef.props;
|
|
18
|
-
export { QCardActionsProps_ as QCardActionsProps };
|
|
19
|
-
export type QCardActionsEvents = typeof __propDef.events;
|
|
20
|
-
export type QCardActionsSlots = typeof __propDef.slots;
|
|
21
|
-
export default class QCardActions extends SvelteComponent<QCardActionsProps, QCardActionsEvents, QCardActionsSlots> {
|
|
22
|
-
}
|
|
2
|
+
declare const QCardActions: import("svelte").Component<QCardActionsProps, {}, "">;
|
|
3
|
+
export default QCardActions;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
let { horizontal = false, children, ...props } = $props();
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
<div
|
|
6
|
-
|
|
8
|
+
{...props}
|
|
9
|
+
class="q-card__section{props.class ? ` ${props.class}` : ''}"
|
|
7
10
|
class:q-card__section--horizontal={horizontal}
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<slot />
|
|
11
|
+
class:row={horizontal}
|
|
12
|
+
>
|
|
13
|
+
{@render children?.()}
|
|
12
14
|
</div>
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QCardSectionProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
horizontal?: QCardSectionProps["horizontal"];
|
|
7
|
-
class?: string | null | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
scroll: Event;
|
|
11
|
-
} & {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
type QCardSectionProps_ = typeof __propDef.props;
|
|
19
|
-
export { QCardSectionProps_ as QCardSectionProps };
|
|
20
|
-
export type QCardSectionEvents = typeof __propDef.events;
|
|
21
|
-
export type QCardSectionSlots = typeof __propDef.slots;
|
|
22
|
-
export default class QCardSection extends SvelteComponent<QCardSectionProps, QCardSectionEvents, QCardSectionSlots> {
|
|
23
|
-
}
|
|
2
|
+
declare const QCardSection: import("svelte").Component<QCardSectionProps, {}, "">;
|
|
3
|
+
export default QCardSection;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { QComponentDocs } from "../../utils";
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
2
|
+
export declare const QCardDocs: QComponentDocs;
|
|
3
|
+
export declare const QCardSectionDocs: QComponentDocs;
|
|
4
|
+
export declare const QCardActionsDocs: QComponentDocs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QCardActionsDocsProps, QCardDocsProps, QCardSectionDocsProps } from "./docs.props";
|
|
2
|
-
export
|
|
2
|
+
export const QCardDocs = {
|
|
3
3
|
name: "QCard",
|
|
4
4
|
description: "Cards provide a clean, flexible, and convenient means of displaying a wide variety of content.",
|
|
5
5
|
docs: {
|
|
@@ -14,7 +14,7 @@ export let QCardDocs = {
|
|
|
14
14
|
events: [],
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export const QCardSectionDocs = {
|
|
18
18
|
name: "QCardSection",
|
|
19
19
|
description: "Sections are used to group similar content within a card.",
|
|
20
20
|
docs: {
|
|
@@ -29,7 +29,7 @@ export let QCardSectionDocs = {
|
|
|
29
29
|
events: [],
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export const QCardActionsDocs = {
|
|
33
33
|
name: "QCardActions",
|
|
34
34
|
description: "Actions hold actionable items like buttons within a card.",
|
|
35
35
|
docs: {
|