@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,27 +1,25 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
@use "$css/variables";
|
|
3
|
+
|
|
1
4
|
.q-toolbar {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: flex-start;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
gap: 1rem;
|
|
10
|
+
|
|
2
11
|
width: 100%;
|
|
12
|
+
height: var(--toolbar-height);
|
|
3
13
|
padding: 0 1rem;
|
|
4
|
-
transition: all
|
|
14
|
+
transition: all variables.$speed3;
|
|
5
15
|
background-color: var(--surface);
|
|
6
16
|
|
|
7
|
-
nav {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: flex-start;
|
|
11
|
-
white-space: nowrap;
|
|
12
|
-
gap: 1rem;
|
|
13
|
-
|
|
14
|
-
> * {
|
|
15
|
-
margin: 0;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
17
|
&--inset {
|
|
20
18
|
padding-left: 58px;
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
&--elevated {
|
|
24
|
-
@include elevate(1, "bottom");
|
|
22
|
+
@include mixins.elevate(1, "bottom");
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
&--bordered {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { NativeProps, CssValue } from "../../utils";
|
|
2
1
|
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
-
export interface QToolbarProps extends
|
|
2
|
+
export interface QToolbarProps extends HTMLAttributes<HTMLElement> {
|
|
4
3
|
/**
|
|
5
4
|
* @default false
|
|
6
5
|
*/
|
|
@@ -14,11 +13,11 @@ export interface QToolbarProps extends NativeProps, HTMLAttributes<HTMLElement>
|
|
|
14
13
|
*/
|
|
15
14
|
elevate?: boolean;
|
|
16
15
|
/**
|
|
17
|
-
* @default
|
|
16
|
+
* @default 64
|
|
18
17
|
*/
|
|
19
|
-
height?:
|
|
18
|
+
height?: number;
|
|
20
19
|
}
|
|
21
|
-
export interface QToolbarTitleProps extends
|
|
20
|
+
export interface QToolbarTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
21
|
/**
|
|
23
22
|
* @default false
|
|
24
23
|
*/
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { value, position = "bottom", children, ...props } = $props();
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<div
|
|
6
|
-
|
|
7
|
-
class:q-tooltip--
|
|
8
|
-
class:q-tooltip--right={position === "right"}
|
|
9
|
-
class:q-tooltip--bottom={position === "bottom"}
|
|
10
|
-
class:q-tooltip--left={position === "left"}
|
|
6
|
+
{...props}
|
|
7
|
+
class="q-tooltip{props.class ? ` ${props.class}` : ''} q-tooltip--{position}"
|
|
11
8
|
class:q-tooltip--active={value}
|
|
12
|
-
{...$$restProps}
|
|
13
9
|
>
|
|
14
|
-
|
|
10
|
+
{@render children?.()}
|
|
15
11
|
</div>
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QTooltipProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
value?: QTooltipProps["value"];
|
|
7
|
-
position?: QTooltipProps["position"];
|
|
8
|
-
class?: string | null | undefined;
|
|
9
|
-
};
|
|
10
|
-
events: {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
};
|
|
13
|
-
slots: {
|
|
14
|
-
default: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
type QTooltipProps_ = typeof __propDef.props;
|
|
18
|
-
export { QTooltipProps_ as QTooltipProps };
|
|
19
|
-
export type QTooltipEvents = typeof __propDef.events;
|
|
20
|
-
export type QTooltipSlots = typeof __propDef.slots;
|
|
21
|
-
export default class QTooltip extends SvelteComponent<QTooltipProps, QTooltipEvents, QTooltipSlots> {
|
|
22
|
-
}
|
|
2
|
+
declare const QTooltip: import("svelte").Component<QTooltipProps, {}, "">;
|
|
3
|
+
export default QTooltip;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use "$css/variables";
|
|
2
|
+
|
|
1
3
|
.q-tooltip {
|
|
2
4
|
--space: -0.5rem;
|
|
3
5
|
visibility: hidden;
|
|
@@ -22,7 +24,7 @@
|
|
|
22
24
|
white-space: nowrap;
|
|
23
25
|
font-weight: 500;
|
|
24
26
|
opacity: 0;
|
|
25
|
-
transition:
|
|
27
|
+
transition: variables.$speed2 all;
|
|
26
28
|
z-index: 9999;
|
|
27
29
|
|
|
28
30
|
&--top {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HTMLAttributes } from "svelte/elements";
|
|
2
1
|
import type { NativeProps } from "../../utils";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
3
|
export interface QTooltipProps extends NativeProps, HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
value?: boolean;
|
|
5
5
|
position?: "top" | "right" | "bottom" | "left";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export declare const sizes: Q.Size[];
|
|
2
|
+
export declare const CssUnits: Q.CssUnit[];
|
|
3
|
+
/**
|
|
4
|
+
* Checks wether the input is a size like "sm" or "lg"
|
|
5
|
+
*/
|
|
6
|
+
export declare function isQuaffSize(size: number | string): size is Q.Size;
|
|
7
|
+
export declare function useSize(size: number | string, component?: `q-${string}`): {
|
|
8
|
+
class: string;
|
|
9
|
+
style: string | undefined;
|
|
10
|
+
};
|
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isNumeric } from "../utils/number.js";
|
|
2
2
|
export const sizes = ["none", "xs", "sm", "md", "lg", "xl"];
|
|
3
|
-
export const CssUnits = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export const CssUnits = [
|
|
4
|
+
"px",
|
|
5
|
+
"%",
|
|
6
|
+
"em",
|
|
7
|
+
"ex",
|
|
8
|
+
"ch",
|
|
9
|
+
"rem",
|
|
10
|
+
"vw",
|
|
11
|
+
"vh",
|
|
12
|
+
"vmin",
|
|
13
|
+
"vmax",
|
|
14
|
+
];
|
|
15
|
+
/**
|
|
16
|
+
* Checks wether the input is a size like "sm" or "lg"
|
|
17
|
+
*/
|
|
18
|
+
export function isQuaffSize(size) {
|
|
19
|
+
return sizes.includes(size);
|
|
20
|
+
}
|
|
21
|
+
export function useSize(size, component) {
|
|
22
|
+
const sizeClass = isQuaffSize(size) ? ` ${component}--${size}` : "";
|
|
23
|
+
const sizeStyle = () => {
|
|
24
|
+
if (isNumeric(size)) {
|
|
25
|
+
return +size > 0 ? `${size}px` : undefined;
|
|
26
|
+
}
|
|
11
27
|
for (const unit of CssUnits) {
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
14
|
-
style: sizeProp,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
else if (sizes.includes(sizeProp)) {
|
|
18
|
-
return {
|
|
19
|
-
class: sizeProp,
|
|
20
|
-
};
|
|
28
|
+
if (size.slice(-unit.length) === unit) {
|
|
29
|
+
return size;
|
|
21
30
|
}
|
|
22
31
|
}
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
class: sizeClass,
|
|
35
|
+
style: sizeStyle(),
|
|
36
|
+
};
|
|
25
37
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CssUnit, QuaffSizes } from "../utils";
|
|
2
|
+
export declare const sizes: QuaffSizes[];
|
|
3
|
+
export declare const CssUnits: CssUnit[];
|
|
4
|
+
interface UseSize {
|
|
5
|
+
class?: string;
|
|
6
|
+
style?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function useSize(sizeProp?: string | number): UseSize;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isNumeric } from "../utils/number";
|
|
2
|
+
export const sizes = ["none", "xs", "sm", "md", "lg", "xl"];
|
|
3
|
+
export const CssUnits = ["px", "%", "em", "ex", "ch", "rem", "vw", "vh", "vmin", "vmax"];
|
|
4
|
+
export function useSize(sizeProp) {
|
|
5
|
+
if (sizeProp !== undefined && isNumeric(sizeProp) && Number(sizeProp) > 0) {
|
|
6
|
+
return {
|
|
7
|
+
style: `${sizeProp}px`,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
if (typeof sizeProp === "string") {
|
|
11
|
+
for (const unit of CssUnits) {
|
|
12
|
+
if (sizeProp.slice(-unit.length) === unit) {
|
|
13
|
+
return {
|
|
14
|
+
style: sizeProp,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (sizes.includes(sizeProp)) {
|
|
18
|
+
return {
|
|
19
|
+
class: sizeProp,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@forward "$components/avatar/QAvatar.scss";
|
|
2
|
+
@forward "$components/breadcrumbs/QBreadcrumbs.scss";
|
|
3
|
+
@forward "$components/breadcrumbs/QBreadcrumbsEl.scss";
|
|
4
|
+
@forward "$components/button/QBtn.scss";
|
|
5
|
+
@forward "$components/card/QCard.scss";
|
|
6
|
+
@forward "$components/card/QCardActions.scss";
|
|
7
|
+
@forward "$components/card/QCardSection.scss";
|
|
8
|
+
@forward "$components/checkbox";
|
|
9
|
+
@forward "$components/chip/QChip.scss";
|
|
10
|
+
@forward "$components/dialog/QDialog.scss";
|
|
11
|
+
@forward "$components/drawer/QDrawer.scss";
|
|
12
|
+
@forward "$components/footer/QFooter.scss";
|
|
13
|
+
@forward "$components/header/QHeader.scss";
|
|
14
|
+
@forward "$components/icon/QIcon.scss";
|
|
15
|
+
@forward "$components/input";
|
|
16
|
+
@forward "$components/layout/QLayout.scss";
|
|
17
|
+
@forward "$components/list/QItem.scss";
|
|
18
|
+
@forward "$components/list/QItemSection.scss";
|
|
19
|
+
@forward "$components/list/QList.scss";
|
|
20
|
+
@forward "$components/progress/QCircularProgress.scss";
|
|
21
|
+
@forward "$components/progress/QLinearProgress.scss";
|
|
22
|
+
@forward "$components/radio";
|
|
23
|
+
@forward "$components/railbar/QRailbar.scss";
|
|
24
|
+
@forward "$components/select";
|
|
25
|
+
@forward "$components/separator/QSeparator.scss";
|
|
26
|
+
@forward "$components/switch/QSwitch.scss";
|
|
27
|
+
@forward "$components/table";
|
|
28
|
+
@forward "$components/tabs/QTab.scss";
|
|
29
|
+
@forward "$components/tabs/QTabs.scss";
|
|
30
|
+
@forward "$components/toolbar";
|
|
31
|
+
@forward "$components/tooltip";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use "$css/mixins";
|
|
2
|
+
|
|
3
|
+
@mixin base() {
|
|
4
|
+
cursor: not-allowed;
|
|
5
|
+
box-shadow: none;
|
|
6
|
+
user-select: none;
|
|
7
|
+
color: font-color();
|
|
8
|
+
background-color: transparent;
|
|
9
|
+
transition: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@function font-color($color: on-surface) {
|
|
13
|
+
@return mixins.with-alpha(var(--#{$color}), 38%);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@function rest-color($color: on-surface) {
|
|
17
|
+
@return mixins.with-alpha(var(--#{$color}), 12%);
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Responsive breakpoints
|
|
2
|
+
$breakpoints: (
|
|
3
|
+
xs: 0px,
|
|
4
|
+
sm: 600px,
|
|
5
|
+
md: 960px,
|
|
6
|
+
lg: 1280px,
|
|
7
|
+
xl: 1920px,
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
// Grid variables
|
|
11
|
+
$grid-columns: 12;
|
|
12
|
+
|
|
13
|
+
// Spaces
|
|
14
|
+
$space-base: 1rem !default;
|
|
15
|
+
$space-x-base: $space-base !default;
|
|
16
|
+
$space-y-base: $space-base !default;
|
|
17
|
+
|
|
18
|
+
$space-none: 0 !default;
|
|
19
|
+
$space-xs: 0.25rem !default;
|
|
20
|
+
$space-sm: 0.5rem !default;
|
|
21
|
+
$space-md: 1rem !default;
|
|
22
|
+
$space-lg: 1.5rem !default;
|
|
23
|
+
$space-xl: 3rem !default;
|
|
24
|
+
|
|
25
|
+
$spaces: (
|
|
26
|
+
"auto": auto,
|
|
27
|
+
"none": $space-none,
|
|
28
|
+
"xs": $space-xs,
|
|
29
|
+
"sm": $space-sm,
|
|
30
|
+
"md": $space-md,
|
|
31
|
+
"lg": $space-lg,
|
|
32
|
+
"xl": $space-xl,
|
|
33
|
+
) !default;
|
|
34
|
+
|
|
35
|
+
// Positions
|
|
36
|
+
$positions: (
|
|
37
|
+
"t": -top,
|
|
38
|
+
"r": -right,
|
|
39
|
+
"b": -bottom,
|
|
40
|
+
"l": -left,
|
|
41
|
+
"x": -inline,
|
|
42
|
+
"y": -block,
|
|
43
|
+
"a": "",
|
|
44
|
+
);
|
|
45
|
+
$border-positions: top, right, bottom, left;
|
|
46
|
+
|
|
47
|
+
// Speeds
|
|
48
|
+
$speed1: 0.1s;
|
|
49
|
+
$speed2: 0.2s;
|
|
50
|
+
$speed3: 0.3s;
|
|
51
|
+
$speed4: 0.4s;
|
|
52
|
+
|
|
53
|
+
// Layout offsets
|
|
54
|
+
$left-railbar: var(--left-railbar-width);
|
|
55
|
+
$right-railbar: var(--right-railbar-width);
|
|
56
|
+
$left-right-railbar: calc(#{$left-railbar} + #{$right-railbar});
|
|
57
|
+
|
|
58
|
+
$left-drawer: var(--left-drawer-width);
|
|
59
|
+
$right-drawer: var(--right-drawer-width);
|
|
60
|
+
$left-right-drawer: calc(#{$left-drawer} + #{$right-drawer});
|
|
61
|
+
|
|
62
|
+
$left-full: calc(#{$left-railbar} + #{$left-drawer});
|
|
63
|
+
$right-full: calc(#{$right-railbar} + #{$right-drawer});
|
|
64
|
+
|
|
65
|
+
$left-railbar-right-drawer: calc(#{$left-railbar} + #{$right-drawer});
|
|
66
|
+
$right-railbar-left-drawer: calc(#{$right-railbar} + #{$left-drawer});
|
|
67
|
+
|
|
68
|
+
$left-full-right-railbar: calc(#{$left-full} + #{$right-railbar});
|
|
69
|
+
$left-full-right-drawer: calc(#{$left-full} + #{$right-drawer});
|
|
70
|
+
$right-full-left-railbar: calc(#{$right-full} + #{$left-railbar});
|
|
71
|
+
$right-full-left-drawer: calc(#{$right-full} + #{$left-drawer});
|
|
72
|
+
|
|
73
|
+
$full: calc(#{$left-full} + #{$right-full});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@use "$css/disabled";
|
|
2
|
+
@use "../mixins" as *;
|
|
3
|
+
|
|
4
|
+
// Disabled
|
|
5
|
+
.disabled {
|
|
6
|
+
@include disabled.base();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Borders
|
|
10
|
+
.border {
|
|
11
|
+
@include border;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.border-top {
|
|
15
|
+
@include border(var(--outline), top);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.border-right {
|
|
19
|
+
@include border(var(--outline), right);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.border-bottom {
|
|
23
|
+
@include border(var(--outline), bottom);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.border-left {
|
|
27
|
+
@include border(var(--outline), left);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Elevation
|
|
31
|
+
.elevate {
|
|
32
|
+
&-none {
|
|
33
|
+
box-shadow: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$elevations: (
|
|
37
|
+
"sm": 1,
|
|
38
|
+
"md": 2,
|
|
39
|
+
"lg": 3,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
@each $elevation, $value in $elevations {
|
|
43
|
+
&-#{$elevation} {
|
|
44
|
+
&-top {
|
|
45
|
+
@include elevate($value, "top");
|
|
46
|
+
}
|
|
47
|
+
&-bottom {
|
|
48
|
+
@include elevate($value, "bottom");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Transparent
|
|
55
|
+
.transparent {
|
|
56
|
+
@include transparent;
|
|
57
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.flex {
|
|
2
|
+
display: flex !important;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.column {
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Horizontal alignment
|
|
11
|
+
.items-start {
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.items-center {
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.items-end {
|
|
20
|
+
align-items: flex-end;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Vertical alignment
|
|
24
|
+
.justify-start {
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.justify-center {
|
|
29
|
+
justify-content: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.justify-end {
|
|
33
|
+
justify-content: flex-end;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.justify-between {
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.justify-around {
|
|
41
|
+
justify-content: space-around;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.justify-evenly {
|
|
45
|
+
justify-content: space-evenly;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Shorthands
|
|
49
|
+
.flex-start {
|
|
50
|
+
@extend .items-start;
|
|
51
|
+
@extend .justify-start;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.flex-center {
|
|
55
|
+
@extend .items-center;
|
|
56
|
+
@extend .justify-center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flex-end {
|
|
60
|
+
@extend .items-end;
|
|
61
|
+
@extend .justify-end;
|
|
62
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@use "../variables";
|
|
2
|
+
@use "sass:map";
|
|
3
|
+
|
|
4
|
+
.row {
|
|
5
|
+
display: grid;
|
|
6
|
+
grid-template-columns: repeat(variables.$grid-columns, 1fr);
|
|
7
|
+
grid-gap: 0;
|
|
8
|
+
|
|
9
|
+
// Gutter classes
|
|
10
|
+
@each $spaceName, $spaceVal in variables.$spaces {
|
|
11
|
+
@if $spaceName != "auto" {
|
|
12
|
+
&.q-gutter-#{$spaceName} {
|
|
13
|
+
gap: $spaceVal;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Column classes for all sizes
|
|
19
|
+
@for $i from 1 through variables.$grid-columns {
|
|
20
|
+
& > .col-#{$i} {
|
|
21
|
+
grid-column: span #{$i};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Column classes for each breakpoint
|
|
26
|
+
@each $breakpoint, $min-width in variables.$breakpoints {
|
|
27
|
+
@media (min-width: #{$min-width}) {
|
|
28
|
+
@for $i from 1 through variables.$grid-columns {
|
|
29
|
+
& > .col-#{$breakpoint}-#{$i} {
|
|
30
|
+
grid-column: span #{$i};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@use "../mixins";
|
|
2
|
+
@use "../variables";
|
|
3
|
+
|
|
4
|
+
@each $spaceName, $spaceVal in variables.$spaces {
|
|
5
|
+
@each $posName, $_ in variables.$positions {
|
|
6
|
+
// Padding
|
|
7
|
+
.q-p#{$posName}-#{$spaceName} {
|
|
8
|
+
@include mixins.padding("#{$posName}-#{$spaceName}");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Margin
|
|
12
|
+
.q-m#{$posName}-#{$spaceName} {
|
|
13
|
+
@include mixins.margin("#{$posName}-#{$spaceName}");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Gap
|
|
18
|
+
@if $spaceName != "auto" {
|
|
19
|
+
.q-gap-#{$spaceName} {
|
|
20
|
+
gap: $spaceVal;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|