@quaffui/quaff 0.1.0-prealpha16 → 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 -60
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- 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 -9
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +64 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- 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 +88 -48
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- 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 +25 -16
- 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 +8 -6
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +8 -3
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- 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 +95 -70
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +64 -42
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -20
- 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.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 -91
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -32
- 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 +62 -23
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- 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.props.js +3 -3
- package/dist/components/icon/props.d.ts +4 -4
- 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.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.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 +48 -33
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +25 -14
- package/dist/components/list/QList.svelte.d.ts +2 -28
- 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 +117 -103
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -48
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -14
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -19
- 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.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.props.js +1 -1
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +1 -3
- 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.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.js +7 -0
- 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.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.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 +74 -90
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +110 -58
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- 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/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.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.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 +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/composables/useSize.d.ts +10 -9
- package/dist/composables/useSize.js +32 -20
- package/dist/composables/useSizeLegacy.d.ts +9 -0
- package/dist/composables/useSizeLegacy.js +25 -0
- 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/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/helpers/clickOutside.js +2 -1
- package/dist/helpers/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +13 -4
- 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/colors.d.ts +71 -0
- package/dist/utils/colors.js +101 -14
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +6 -0
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.js +3 -1
- 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 +3 -0
- package/dist/utils/types.d.ts +6 -1
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/package.json +40 -37
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -103
- 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 -59
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
1
3
|
@import "$css/shared/q-field.scss";
|
|
2
4
|
|
|
3
5
|
.q-select {
|
|
@@ -11,22 +13,22 @@
|
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
&__menu {
|
|
14
|
-
@include menu;
|
|
16
|
+
@include mixins.menu;
|
|
15
17
|
opacity: 0;
|
|
16
18
|
visibility: hidden;
|
|
17
19
|
transform: scale(0.8) translateY(120%);
|
|
18
20
|
transition:
|
|
19
|
-
opacity
|
|
20
|
-
transform
|
|
21
|
-
visibility 0s
|
|
21
|
+
opacity variables.$speed2,
|
|
22
|
+
transform variables.$speed2,
|
|
23
|
+
visibility 0s variables.$speed2;
|
|
22
24
|
|
|
23
25
|
&--active {
|
|
24
26
|
opacity: 1;
|
|
25
27
|
visibility: visible;
|
|
26
28
|
transform: scale(1) translateY(100%);
|
|
27
29
|
transition:
|
|
28
|
-
opacity
|
|
29
|
-
transform
|
|
30
|
+
opacity variables.$speed2,
|
|
31
|
+
transform variables.$speed2,
|
|
30
32
|
visibility 0s 0s;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { NativeProps } from "../../utils";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
2
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
4
|
export type QSelectOption = string | {
|
|
4
5
|
label: string;
|
|
@@ -20,16 +21,9 @@ export interface QSelectProps extends NativeProps, HTMLAttributes<HTMLDivElement
|
|
|
20
21
|
label?: string;
|
|
21
22
|
outlined?: boolean;
|
|
22
23
|
rounded?: boolean;
|
|
24
|
+
displayValue?: string;
|
|
25
|
+
before?: Snippet;
|
|
26
|
+
prepend?: Snippet;
|
|
27
|
+
append?: Snippet;
|
|
28
|
+
after?: Snippet;
|
|
23
29
|
}
|
|
24
|
-
export declare const QSelectPropsDefaults: {
|
|
25
|
-
dense: boolean;
|
|
26
|
-
disable: boolean;
|
|
27
|
-
error: boolean;
|
|
28
|
-
errorMessage: undefined;
|
|
29
|
-
filled: boolean;
|
|
30
|
-
hint: undefined;
|
|
31
|
-
label: undefined;
|
|
32
|
-
outlined: boolean;
|
|
33
|
-
rounded: boolean;
|
|
34
|
-
value: string;
|
|
35
|
-
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@use "$css/variables";
|
|
2
|
+
|
|
3
|
+
.q-separator__wrapper {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
opacity: 0.75;
|
|
8
|
+
|
|
9
|
+
&--inset {
|
|
10
|
+
padding: 0 1rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--vertical {
|
|
14
|
+
height: 100%;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
|
|
17
|
+
&.q-separator__wrapper--inset {
|
|
18
|
+
padding: 1rem 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:not(.vertical) {
|
|
23
|
+
width: 100%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.q-separator {
|
|
28
|
+
border: none;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
|
|
31
|
+
&--vertical {
|
|
32
|
+
width: var(--q-separator--size, 0.0625rem);
|
|
33
|
+
|
|
34
|
+
@each $space, $val in variables.$spaces {
|
|
35
|
+
@if $space != "none" and $space != "auto" {
|
|
36
|
+
&.q-separator__spacing--#{$space} {
|
|
37
|
+
margin-inline: $val;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:not(&--vertical) {
|
|
44
|
+
height: var(--q-separator--size, 0.0625rem);
|
|
45
|
+
|
|
46
|
+
@each $space, $val in variables.$spaces {
|
|
47
|
+
@if $space != "auto" {
|
|
48
|
+
&.q-separator__spacing--#{$space} {
|
|
49
|
+
margin-block: $val;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useSize } from "../../composables/useSize";
|
|
3
|
+
let {
|
|
4
|
+
spacing = "none",
|
|
5
|
+
inset = false,
|
|
6
|
+
vertical = false,
|
|
7
|
+
color = "outline",
|
|
8
|
+
size,
|
|
9
|
+
text,
|
|
10
|
+
textAlign = vertical ? "middle" : "center",
|
|
11
|
+
...props
|
|
12
|
+
} = $props();
|
|
13
|
+
const orientation = $derived(vertical ? "vertical" : "horizontal");
|
|
14
|
+
const qSize = $derived(useSize(spacing, "q-separator__spacing"));
|
|
11
15
|
</script>
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
<div
|
|
18
|
+
{...props}
|
|
19
|
+
class="q-separator__wrapper{props.class ? ` ${props.class}` : ''}"
|
|
20
|
+
class:q-separator__wrapper--vertical={vertical}
|
|
21
|
+
class:q-separator__wrapper--inset={inset}
|
|
22
|
+
>
|
|
23
|
+
{#if text}
|
|
20
24
|
{#if (vertical && textAlign !== "top") || (!vertical && textAlign !== "left")}
|
|
21
|
-
|
|
22
|
-
class="q-separator {spacingClass} {colorClass}"
|
|
23
|
-
class:q-separator--vertical={vertical}
|
|
24
|
-
style:--q-separator--size={size}
|
|
25
|
-
aria-orientation={orientation}
|
|
26
|
-
/>
|
|
25
|
+
{@render hr()}
|
|
27
26
|
{/if}
|
|
27
|
+
|
|
28
28
|
<div class={vertical ? "q-py-sm" : "q-px-sm"}>{text}</div>
|
|
29
|
+
|
|
29
30
|
{#if (vertical && textAlign !== "bottom") || (!vertical && textAlign !== "right")}
|
|
30
|
-
|
|
31
|
-
class="q-separator {spacingClass} {colorClass}"
|
|
32
|
-
class:q-separator--vertical={vertical}
|
|
33
|
-
style:--q-separator--size={size}
|
|
34
|
-
aria-orientation={orientation}
|
|
35
|
-
/>
|
|
31
|
+
{@render hr()}
|
|
36
32
|
{/if}
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
{/if}
|
|
33
|
+
{:else}
|
|
34
|
+
{@render hr()}
|
|
35
|
+
{/if}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
{#snippet hr()}
|
|
39
|
+
<hr
|
|
40
|
+
class="q-separator bg-{color}{qSize.class ? ` ${qSize.class}` : ''}"
|
|
41
|
+
class:q-separator--vertical={vertical}
|
|
42
|
+
style:--q-separator-size={size}
|
|
43
|
+
aria-orientation={orientation}
|
|
44
|
+
/>
|
|
45
|
+
{/snippet}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QSeparatorProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
spacing?: QSeparatorProps["spacing"];
|
|
7
|
-
inset?: QSeparatorProps["inset"];
|
|
8
|
-
vertical?: QSeparatorProps["vertical"];
|
|
9
|
-
color?: QSeparatorProps["color"];
|
|
10
|
-
size?: QSeparatorProps["size"];
|
|
11
|
-
text?: QSeparatorProps["text"];
|
|
12
|
-
textAlign?: QSeparatorProps["textAlign"];
|
|
13
|
-
class?: string | null | undefined;
|
|
14
|
-
};
|
|
15
|
-
events: {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {};
|
|
19
|
-
};
|
|
20
|
-
type QSeparatorProps_ = typeof __propDef.props;
|
|
21
|
-
export { QSeparatorProps_ as QSeparatorProps };
|
|
22
|
-
export type QSeparatorEvents = typeof __propDef.events;
|
|
23
|
-
export type QSeparatorSlots = typeof __propDef.slots;
|
|
24
|
-
export default class QSeparator extends SvelteComponent<QSeparatorProps, QSeparatorEvents, QSeparatorSlots> {
|
|
25
|
-
}
|
|
2
|
+
declare const QSeparator: import("svelte").Component<QSeparatorProps, {}, "">;
|
|
3
|
+
export default QSeparator;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
2
|
+
// @quaffHash c1abfb6f47a067eca5b1a3da885e61e2
|
|
3
3
|
export const QSeparatorPropsVertical = [
|
|
4
4
|
{
|
|
5
5
|
name: "spacing",
|
|
6
|
-
type: "
|
|
6
|
+
type: "Q.Size",
|
|
7
7
|
optional: true,
|
|
8
8
|
clickableType: true,
|
|
9
9
|
description: "",
|
|
@@ -36,7 +36,7 @@ export const QSeparatorPropsVertical = [
|
|
|
36
36
|
{
|
|
37
37
|
name: "size",
|
|
38
38
|
type: "string",
|
|
39
|
-
optional:
|
|
39
|
+
optional: true,
|
|
40
40
|
clickableType: false,
|
|
41
41
|
description: "",
|
|
42
42
|
default: "",
|
|
@@ -61,7 +61,7 @@ export const QSeparatorPropsVertical = [
|
|
|
61
61
|
export const QSeparatorPropsHorizontal = [
|
|
62
62
|
{
|
|
63
63
|
name: "spacing",
|
|
64
|
-
type: "
|
|
64
|
+
type: "Q.Size",
|
|
65
65
|
optional: true,
|
|
66
66
|
clickableType: true,
|
|
67
67
|
description: "",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import type { NativeProps, QuaffSizes } from "../../utils";
|
|
2
1
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
interface QSeparatorPropsVertical extends
|
|
4
|
-
spacing?:
|
|
2
|
+
interface QSeparatorPropsVertical extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
spacing?: Q.Size;
|
|
5
4
|
inset?: boolean;
|
|
6
5
|
vertical?: true;
|
|
7
6
|
color?: string;
|
|
8
|
-
size
|
|
7
|
+
size?: string;
|
|
9
8
|
text?: string;
|
|
10
9
|
textAlign?: "top" | "middle" | "bottom";
|
|
11
10
|
}
|
|
12
|
-
interface QSeparatorPropsHorizontal extends
|
|
13
|
-
spacing?:
|
|
11
|
+
interface QSeparatorPropsHorizontal extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
spacing?: Q.Size;
|
|
14
13
|
inset?: boolean;
|
|
15
14
|
vertical?: false;
|
|
16
15
|
color?: string;
|
|
@@ -19,5 +18,4 @@ interface QSeparatorPropsHorizontal extends NativeProps, HTMLAttributes<HTMLDivE
|
|
|
19
18
|
textAlign?: "left" | "center" | "right";
|
|
20
19
|
}
|
|
21
20
|
export type QSeparatorProps = QSeparatorPropsHorizontal | QSeparatorPropsVertical;
|
|
22
|
-
export declare const QSeparatorPropsDefaults: QSeparatorProps;
|
|
23
21
|
export {};
|
|
@@ -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
|
+
}
|