@quaffui/quaff 0.1.0-prealpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +43 -0
- package/dist/components/avatar/QAvatar.svelte +43 -0
- package/dist/components/avatar/QAvatar.svelte.d.ts +27 -0
- package/dist/components/avatar/docs.d.ts +2 -0
- package/dist/components/avatar/docs.js +22 -0
- package/dist/components/avatar/docs.props.d.ts +8 -0
- package/dist/components/avatar/docs.props.js +34 -0
- package/dist/components/avatar/index.scss +88 -0
- package/dist/components/avatar/props.d.ts +25 -0
- package/dist/components/avatar/props.js +1 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +18 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +23 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +59 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +26 -0
- package/dist/components/breadcrumbs/docs.d.ts +2 -0
- package/dist/components/breadcrumbs/docs.js +16 -0
- package/dist/components/breadcrumbs/docs.props.d.ts +16 -0
- package/dist/components/breadcrumbs/docs.props.js +84 -0
- package/dist/components/breadcrumbs/index.scss +20 -0
- package/dist/components/breadcrumbs/props.d.ts +56 -0
- package/dist/components/breadcrumbs/props.js +1 -0
- package/dist/components/button/QBtn.svelte +59 -0
- package/dist/components/button/QBtn.svelte.d.ts +32 -0
- package/dist/components/button/docs.d.ts +2 -0
- package/dist/components/button/docs.js +22 -0
- package/dist/components/button/docs.props.d.ts +8 -0
- package/dist/components/button/docs.props.js +82 -0
- package/dist/components/button/index.scss +78 -0
- package/dist/components/button/props.d.ts +54 -0
- package/dist/components/button/props.js +1 -0
- package/dist/components/card/QCard.svelte +23 -0
- package/dist/components/card/QCard.svelte.d.ts +26 -0
- package/dist/components/card/QCardActions.svelte +18 -0
- package/dist/components/card/QCardActions.svelte.d.ts +22 -0
- package/dist/components/card/QCardSection.svelte +14 -0
- package/dist/components/card/QCardSection.svelte.d.ts +23 -0
- package/dist/components/card/docs.d.ts +4 -0
- package/dist/components/card/docs.js +46 -0
- package/dist/components/card/docs.props.d.ts +24 -0
- package/dist/components/card/docs.props.js +62 -0
- package/dist/components/card/index.scss +53 -0
- package/dist/components/card/props.d.ts +44 -0
- package/dist/components/card/props.js +1 -0
- package/dist/components/checkbox/QCheckbox.svelte +14 -0
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +21 -0
- package/dist/components/checkbox/docs.d.ts +2 -0
- package/dist/components/checkbox/docs.js +17 -0
- package/dist/components/checkbox/docs.props.d.ts +8 -0
- package/dist/components/checkbox/docs.props.js +26 -0
- package/dist/components/checkbox/index.scss +3 -0
- package/dist/components/checkbox/props.d.ts +17 -0
- package/dist/components/checkbox/props.js +1 -0
- package/dist/components/chip/QChip.svelte +62 -0
- package/dist/components/chip/QChip.svelte.d.ts +35 -0
- package/dist/components/chip/docs.d.ts +2 -0
- package/dist/components/chip/docs.js +30 -0
- package/dist/components/chip/docs.props.d.ts +8 -0
- package/dist/components/chip/docs.props.js +90 -0
- package/dist/components/chip/index.scss +83 -0
- package/dist/components/chip/props.d.ts +59 -0
- package/dist/components/chip/props.js +1 -0
- package/dist/components/codeBlock/QCodeBlock.svelte +71 -0
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +23 -0
- package/dist/components/codeBlock/docs.props.d.ts +8 -0
- package/dist/components/codeBlock/docs.props.js +34 -0
- package/dist/components/codeBlock/props.d.ts +20 -0
- package/dist/components/codeBlock/props.js +1 -0
- package/dist/components/dialog/QDialog.svelte +80 -0
- package/dist/components/dialog/QDialog.svelte.d.ts +37 -0
- package/dist/components/dialog/docs.d.ts +2 -0
- package/dist/components/dialog/docs.js +11 -0
- package/dist/components/dialog/docs.props.d.ts +16 -0
- package/dist/components/dialog/docs.props.js +148 -0
- package/dist/components/dialog/index.scss +27 -0
- package/dist/components/dialog/props.d.ts +45 -0
- package/dist/components/dialog/props.js +1 -0
- package/dist/components/drawer/QDrawer.svelte +87 -0
- package/dist/components/drawer/QDrawer.svelte.d.ts +39 -0
- package/dist/components/drawer/docs.d.ts +2 -0
- package/dist/components/drawer/docs.js +11 -0
- package/dist/components/drawer/docs.props.d.ts +8 -0
- package/dist/components/drawer/docs.props.js +106 -0
- package/dist/components/drawer/index.scss +54 -0
- package/dist/components/drawer/props.d.ts +70 -0
- package/dist/components/drawer/props.js +1 -0
- package/dist/components/footer/QFooter.svelte +14 -0
- package/dist/components/footer/QFooter.svelte.d.ts +24 -0
- package/dist/components/footer/docs.d.ts +2 -0
- package/dist/components/footer/docs.js +11 -0
- package/dist/components/footer/docs.props.d.ts +8 -0
- package/dist/components/footer/docs.props.js +34 -0
- package/dist/components/footer/index.scss +5 -0
- package/dist/components/footer/props.d.ts +23 -0
- package/dist/components/footer/props.js +1 -0
- package/dist/components/icon/QIcon.svelte +40 -0
- package/dist/components/icon/QIcon.svelte.d.ts +28 -0
- package/dist/components/icon/docs.d.ts +2 -0
- package/dist/components/icon/docs.js +11 -0
- package/dist/components/icon/docs.props.d.ts +8 -0
- package/dist/components/icon/docs.props.js +66 -0
- package/dist/components/icon/index.scss +18 -0
- package/dist/components/icon/props.d.ts +45 -0
- package/dist/components/icon/props.js +1 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +29 -0
- package/dist/components/input/QInput.svelte +81 -0
- package/dist/components/input/QInput.svelte.d.ts +32 -0
- package/dist/components/input/docs.d.ts +2 -0
- package/dist/components/input/docs.js +83 -0
- package/dist/components/input/docs.props.d.ts +8 -0
- package/dist/components/input/docs.props.js +90 -0
- package/dist/components/input/index.scss +3 -0
- package/dist/components/input/props.d.ts +27 -0
- package/dist/components/input/props.js +13 -0
- package/dist/components/layout/QLayout.svelte +88 -0
- package/dist/components/layout/QLayout.svelte.d.ts +57 -0
- package/dist/components/layout/docs.d.ts +2 -0
- package/dist/components/layout/docs.js +11 -0
- package/dist/components/layout/docs.props.d.ts +8 -0
- package/dist/components/layout/docs.props.js +58 -0
- package/dist/components/layout/index.scss +370 -0
- package/dist/components/layout/props.d.ts +41 -0
- package/dist/components/layout/props.js +1 -0
- package/dist/components/list/QItem.svelte +60 -0
- package/dist/components/list/QItem.svelte.d.ts +34 -0
- package/dist/components/list/QItemSection.svelte +47 -0
- package/dist/components/list/QItemSection.svelte.d.ts +25 -0
- package/dist/components/list/QList.svelte +23 -0
- package/dist/components/list/QList.svelte.d.ts +36 -0
- package/dist/components/list/docs.props.d.ts +40 -0
- package/dist/components/list/docs.props.js +226 -0
- package/dist/components/list/index.scss +114 -0
- package/dist/components/list/props.d.ts +33 -0
- package/dist/components/list/props.js +25 -0
- package/dist/components/private/ContextReseter.svelte +13 -0
- package/dist/components/private/ContextReseter.svelte.d.ts +18 -0
- package/dist/components/private/QApi.svelte +142 -0
- package/dist/components/private/QApi.svelte.d.ts +17 -0
- package/dist/components/private/QDocs.svelte +66 -0
- package/dist/components/private/QDocs.svelte.d.ts +21 -0
- package/dist/components/private/QDocsSection.svelte +32 -0
- package/dist/components/private/QDocsSection.svelte.d.ts +29 -0
- package/dist/components/progress/QCircularProgress.svelte +26 -0
- package/dist/components/progress/QCircularProgress.svelte.d.ts +22 -0
- package/dist/components/progress/QLinearProgress.svelte +20 -0
- package/dist/components/progress/QLinearProgress.svelte.d.ts +22 -0
- package/dist/components/progress/docs.props.d.ts +8 -0
- package/dist/components/progress/docs.props.js +26 -0
- package/dist/components/progress/index.scss +50 -0
- package/dist/components/progress/props.d.ts +20 -0
- package/dist/components/progress/props.js +7 -0
- package/dist/components/radio/QRadio.svelte +14 -0
- package/dist/components/radio/QRadio.svelte.d.ts +22 -0
- package/dist/components/radio/docs.d.ts +2 -0
- package/dist/components/radio/docs.js +39 -0
- package/dist/components/radio/docs.props.d.ts +8 -0
- package/dist/components/radio/docs.props.js +34 -0
- package/dist/components/radio/index.scss +3 -0
- package/dist/components/radio/props.d.ts +8 -0
- package/dist/components/radio/props.js +8 -0
- package/dist/components/railbar/QRailbar.svelte +52 -0
- package/dist/components/railbar/QRailbar.svelte.d.ts +23 -0
- package/dist/components/railbar/docs.props.d.ts +8 -0
- package/dist/components/railbar/docs.props.js +26 -0
- package/dist/components/railbar/props.d.ts +7 -0
- package/dist/components/railbar/props.js +7 -0
- package/dist/components/select/QSelect.svelte +159 -0
- package/dist/components/select/QSelect.svelte.d.ts +34 -0
- package/dist/components/select/docs.d.ts +2 -0
- package/dist/components/select/docs.js +95 -0
- package/dist/components/select/docs.props.d.ts +8 -0
- package/dist/components/select/docs.props.js +106 -0
- package/dist/components/select/index.scss +34 -0
- package/dist/components/select/props.d.ts +33 -0
- package/dist/components/select/props.js +14 -0
- package/dist/components/separator/QSeparator.svelte +63 -0
- package/dist/components/separator/QSeparator.svelte.d.ts +25 -0
- package/dist/components/separator/docs.props.d.ts +16 -0
- package/dist/components/separator/docs.props.js +116 -0
- package/dist/components/separator/props.d.ts +22 -0
- package/dist/components/separator/props.js +9 -0
- package/dist/components/table/QTable.svelte +154 -0
- package/dist/components/table/QTable.svelte.d.ts +29 -0
- package/dist/components/table/docs.d.ts +2 -0
- package/dist/components/table/docs.js +11 -0
- package/dist/components/table/docs.props.d.ts +8 -0
- package/dist/components/table/docs.props.js +42 -0
- package/dist/components/table/index.scss +77 -0
- package/dist/components/table/props.d.ts +45 -0
- package/dist/components/table/props.js +1 -0
- package/dist/components/tabs/QTab.svelte +78 -0
- package/dist/components/tabs/QTab.svelte.d.ts +28 -0
- package/dist/components/tabs/QTabs.svelte +55 -0
- package/dist/components/tabs/QTabs.svelte.d.ts +23 -0
- package/dist/components/tabs/docs.props.d.ts +16 -0
- package/dist/components/tabs/docs.props.js +60 -0
- package/dist/components/tabs/index.scss +75 -0
- package/dist/components/tabs/props.d.ts +14 -0
- package/dist/components/tabs/props.js +13 -0
- package/dist/components/toggle/QToggle.svelte +35 -0
- package/dist/components/toggle/QToggle.svelte.d.ts +23 -0
- package/dist/components/toggle/docs.d.ts +2 -0
- package/dist/components/toggle/docs.js +47 -0
- package/dist/components/toggle/docs.props.d.ts +8 -0
- package/dist/components/toggle/docs.props.js +42 -0
- package/dist/components/toggle/index.scss +31 -0
- package/dist/components/toggle/props.d.ts +9 -0
- package/dist/components/toggle/props.js +9 -0
- package/dist/components/toolbar/QToolbar.svelte +39 -0
- package/dist/components/toolbar/QToolbar.svelte.d.ts +23 -0
- package/dist/components/toolbar/docs.props.d.ts +8 -0
- package/dist/components/toolbar/docs.props.js +18 -0
- package/dist/components/toolbar/index.scss +7 -0
- package/dist/components/toolbar/props.d.ts +6 -0
- package/dist/components/toolbar/props.js +6 -0
- package/dist/components/tooltip/QTooltip.svelte +15 -0
- package/dist/components/tooltip/QTooltip.svelte.d.ts +22 -0
- package/dist/components/tooltip/docs.props.d.ts +8 -0
- package/dist/components/tooltip/docs.props.js +18 -0
- package/dist/components/tooltip/index.scss +7 -0
- package/dist/components/tooltip/props.d.ts +6 -0
- package/dist/components/tooltip/props.js +6 -0
- package/dist/composables/index.d.ts +0 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-align.d.ts +8 -0
- package/dist/composables/use-align.js +12 -0
- package/dist/composables/use-index.d.ts +2 -0
- package/dist/composables/use-index.js +17 -0
- package/dist/composables/use-router-link.d.ts +18 -0
- package/dist/composables/use-router-link.js +27 -0
- package/dist/composables/use-size.d.ts +11 -0
- package/dist/composables/use-size.js +13 -0
- package/dist/css/grid.scss +65 -0
- package/dist/css/index.scss +119 -0
- package/dist/css/mixins/field.scss +430 -0
- package/dist/css/mixins/menu.scss +70 -0
- package/dist/css/mixins/selection.scss +184 -0
- package/dist/css/mixins/table.scss +36 -0
- package/dist/css/mixins.scss +135 -0
- package/dist/css/states.scss +70 -0
- package/dist/css/theme/colors.module.scss +180 -0
- package/dist/css/theme/theme.dark.scss +36 -0
- package/dist/css/theme/theme.light.scss +36 -0
- package/dist/css/theme/theme.scss +5 -0
- package/dist/css/theme/tokens.scss +266 -0
- package/dist/css/theme/typography.module.scss +150 -0
- package/dist/global.d.ts +10 -0
- package/dist/helpers/activationHandler.d.ts +9 -0
- package/dist/helpers/activationHandler.js +23 -0
- package/dist/helpers/clickOutside.d.ts +6 -0
- package/dist/helpers/clickOutside.js +34 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/stores/QTheme.d.ts +41 -0
- package/dist/stores/QTheme.js +53 -0
- package/dist/stores/Quaff.d.ts +31 -0
- package/dist/stores/Quaff.js +52 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +11 -0
- package/dist/utils/colors.d.ts +10 -0
- package/dist/utils/colors.js +102 -0
- package/dist/utils/fields.d.ts +1 -0
- package/dist/utils/fields.js +14 -0
- package/dist/utils/index.d.ts +0 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/props.d.ts +9 -0
- package/dist/utils/props.js +31 -0
- package/dist/utils/string.d.ts +10 -0
- package/dist/utils/string.js +78 -0
- package/dist/utils/types.d.ts +42 -0
- package/dist/utils/types.js +7 -0
- package/dist/utils/types.json +1 -0
- package/dist/utils/watchable.d.ts +2 -0
- package/dist/utils/watchable.js +22 -0
- package/package.json +66 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script>import { createClasses } from "../../utils/props";
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
import QIcon from "../icon/QIcon.svelte";
|
|
4
|
+
import QCircularProgress from "../progress/QCircularProgress.svelte";
|
|
5
|
+
import { activationHandler } from "../../helpers/activationHandler";
|
|
6
|
+
export let icon = void 0, label = void 0, disable = false, loading = false, unelevated = false, outline = false, rectangle = false, flat = false, to = void 0, size = void 0, userClasses = void 0;
|
|
7
|
+
export { userClasses as class };
|
|
8
|
+
const emit = createEventDispatcher();
|
|
9
|
+
let tag;
|
|
10
|
+
$:
|
|
11
|
+
tag = to !== void 0 ? "a" : "div";
|
|
12
|
+
$:
|
|
13
|
+
classes = createClasses(
|
|
14
|
+
[
|
|
15
|
+
unelevated && "unelevated",
|
|
16
|
+
rectangle && "rectangle",
|
|
17
|
+
outline && "outlined",
|
|
18
|
+
flat && "flat",
|
|
19
|
+
!$$slots.default && !label && "circle",
|
|
20
|
+
size && size !== "md" && size
|
|
21
|
+
],
|
|
22
|
+
{
|
|
23
|
+
component: "q-btn",
|
|
24
|
+
userClasses
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<svelte:element
|
|
30
|
+
this={tag}
|
|
31
|
+
use:activationHandler={{ disable, callback: (e) => emit("activated", e) }}
|
|
32
|
+
role="button"
|
|
33
|
+
href={to}
|
|
34
|
+
class={classes}
|
|
35
|
+
aria-disabled={disable || undefined}
|
|
36
|
+
tabindex={disable ? -1 : 0}
|
|
37
|
+
{...$$restProps}
|
|
38
|
+
>
|
|
39
|
+
{#if icon && !loading}
|
|
40
|
+
{#if icon.startsWith("img:")}
|
|
41
|
+
<img
|
|
42
|
+
src={icon.replace("img:", "")}
|
|
43
|
+
class="q-btn__img q-btn__img--responsive"
|
|
44
|
+
alt="{label || 'Slotted'} button"
|
|
45
|
+
/>
|
|
46
|
+
{:else}
|
|
47
|
+
<QIcon name={icon} class="q-btn__icon" />
|
|
48
|
+
{/if}
|
|
49
|
+
{/if}
|
|
50
|
+
|
|
51
|
+
{#if loading}
|
|
52
|
+
<QCircularProgress indeterminate class="q-btn__loader" />
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
55
|
+
{#if label}
|
|
56
|
+
<span>{label}</span>
|
|
57
|
+
{/if}
|
|
58
|
+
<slot />
|
|
59
|
+
</svelte:element>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QBtnProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
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
|
+
rectangle?: QBtnProps["rectangle"];
|
|
13
|
+
flat?: QBtnProps["flat"];
|
|
14
|
+
to?: QBtnProps["to"];
|
|
15
|
+
size?: QBtnProps["size"];
|
|
16
|
+
class?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
activated: CustomEvent<any>;
|
|
20
|
+
} & {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
};
|
|
23
|
+
slots: {
|
|
24
|
+
default: {};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type QBtnProps = typeof __propDef.props;
|
|
28
|
+
export type QBtnEvents = typeof __propDef.events;
|
|
29
|
+
export type QBtnSlots = typeof __propDef.slots;
|
|
30
|
+
export default class QBtn extends SvelteComponentTyped<QBtnProps, QBtnEvents, QBtnSlots> {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { QBtnDocsProps } from "./docs.props";
|
|
2
|
+
export let QBtnDocs = {
|
|
3
|
+
name: "QBtn",
|
|
4
|
+
description: "Buttons help users take action, such as sending an email, sharing a document, or liking a comment.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QBtnDocsProps,
|
|
7
|
+
slots: [
|
|
8
|
+
{
|
|
9
|
+
name: "default",
|
|
10
|
+
description: "The default slot can be used to display the button's text. This slot doesn't overwrite the label prop but appends to it.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
methods: [],
|
|
14
|
+
events: [
|
|
15
|
+
{
|
|
16
|
+
name: "click",
|
|
17
|
+
type: "(e: MouseEvent) => void",
|
|
18
|
+
description: "Emitted when the user clicks on the button.",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const QBtnDocsProps = [
|
|
2
|
+
{
|
|
3
|
+
name: "disable",
|
|
4
|
+
type: "boolean",
|
|
5
|
+
optional: true,
|
|
6
|
+
clickableType: false,
|
|
7
|
+
description: "Puts the button in a disabled state, making it unclickable.",
|
|
8
|
+
default: "false",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "flat",
|
|
12
|
+
type: "boolean",
|
|
13
|
+
optional: true,
|
|
14
|
+
clickableType: false,
|
|
15
|
+
description: "Use flat design for the button, removing its elevation and background-color.",
|
|
16
|
+
default: "false",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "icon",
|
|
20
|
+
type: "string",
|
|
21
|
+
optional: true,
|
|
22
|
+
clickableType: false,
|
|
23
|
+
description: "Name of the leading icon to use for the button.",
|
|
24
|
+
default: "undefined",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "label",
|
|
28
|
+
type: "string",
|
|
29
|
+
optional: true,
|
|
30
|
+
clickableType: false,
|
|
31
|
+
description: "Text to use for the button.",
|
|
32
|
+
default: "undefined",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "loading",
|
|
36
|
+
type: "boolean",
|
|
37
|
+
optional: true,
|
|
38
|
+
clickableType: false,
|
|
39
|
+
description: "Puts the button in a loading state, adding a loader as the leading icon.",
|
|
40
|
+
default: "false",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "outline",
|
|
44
|
+
type: "boolean",
|
|
45
|
+
optional: true,
|
|
46
|
+
clickableType: false,
|
|
47
|
+
description: "Use outline design for the button, adding a border around it.",
|
|
48
|
+
default: "false",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "rectangle",
|
|
52
|
+
type: "boolean",
|
|
53
|
+
optional: true,
|
|
54
|
+
clickableType: false,
|
|
55
|
+
description: "Use rectangle design for the button, removing the large border-radius.",
|
|
56
|
+
default: "false",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "to",
|
|
60
|
+
type: "string",
|
|
61
|
+
optional: true,
|
|
62
|
+
clickableType: false,
|
|
63
|
+
description: 'Makes the button navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id").',
|
|
64
|
+
default: "undefined",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: "unelevated",
|
|
68
|
+
type: "boolean",
|
|
69
|
+
optional: true,
|
|
70
|
+
clickableType: false,
|
|
71
|
+
description: "Removes the button's elevation.",
|
|
72
|
+
default: "false",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "size",
|
|
76
|
+
type: "QBtnSizeOptions",
|
|
77
|
+
optional: true,
|
|
78
|
+
clickableType: true,
|
|
79
|
+
description: "Size of the button.",
|
|
80
|
+
default: "md",
|
|
81
|
+
},
|
|
82
|
+
];
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.q-btn {
|
|
2
|
+
position: relative;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
text-decoration: none;
|
|
5
|
+
border: none;
|
|
6
|
+
font-family: inherit;
|
|
7
|
+
outline: inherit;
|
|
8
|
+
box-sizing: content-box;
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
height: 2.5rem;
|
|
13
|
+
min-width: 2.5rem;
|
|
14
|
+
font-size: 0.875rem;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
color: var(--on-primary);
|
|
17
|
+
padding: 0 1.5rem;
|
|
18
|
+
background-color: var(--primary);
|
|
19
|
+
margin: 0 0.5rem;
|
|
20
|
+
border-radius: 1.25rem;
|
|
21
|
+
transition: var(--speed3) transform, var(--speed3) border-radius, var(--speed3) padding;
|
|
22
|
+
user-select: none;
|
|
23
|
+
gap: 1rem;
|
|
24
|
+
line-height: normal;
|
|
25
|
+
@extend .elevate-sm-bottom;
|
|
26
|
+
@extend .ripple;
|
|
27
|
+
|
|
28
|
+
$sizeMap: (
|
|
29
|
+
"sm": -1,
|
|
30
|
+
"lg": 1,
|
|
31
|
+
"xl": 2,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
@each $size, $val in $sizeMap {
|
|
35
|
+
&.q-btn--#{$size} {
|
|
36
|
+
height: 2.5rem + 0.5 * $val;
|
|
37
|
+
min-width: 2.5rem + 0.5 * $val;
|
|
38
|
+
border-radius: 1.25rem + 0.25 * $val;
|
|
39
|
+
font-size: 1rem + 0.125 * $val;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.q-btn[aria-disabled] {
|
|
44
|
+
@extend .disabled;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.q-btn--outlined {
|
|
48
|
+
@include transparent($ripple: true);
|
|
49
|
+
@include border(var(--primary));
|
|
50
|
+
color: var(--primary);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.q-btn--unelevated {
|
|
54
|
+
@extend .elevate-none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.q-btn--flat {
|
|
58
|
+
@include transparent($ripple: true);
|
|
59
|
+
@extend .elevate-none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.q-btn--rectangle {
|
|
63
|
+
border-radius: 0.5rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.q-btn--circle {
|
|
67
|
+
width: 2.5rem;
|
|
68
|
+
height: 2.5rem;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
padding: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
& > :is(.q-icon, .q-circular-progress) {
|
|
74
|
+
margin: 0 -0.5rem;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@include btn-image;
|
|
78
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { NativeProps } from "$utils/types";
|
|
2
|
+
export type QBtnSizeOptions = "sm" | "md" | "lg" | "xl";
|
|
3
|
+
export interface QBtnProps extends NativeProps {
|
|
4
|
+
/**
|
|
5
|
+
* Puts the button in a disabled state, making it unclickable.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
disable?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Use flat design for the button, removing its elevation and background-color.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
flat?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the leading icon to use for the button.
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
icon?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Text to use for the button.
|
|
21
|
+
* @default undefined
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Puts the button in a loading state, adding a loader as the leading icon.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Use outline design for the button, adding a border around it.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
outline?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Use rectangle design for the button, removing the large border-radius.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
rectangle?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Makes the button navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id").
|
|
41
|
+
* @default undefined
|
|
42
|
+
*/
|
|
43
|
+
to?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Removes the button's elevation.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
unelevated?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Size of the button.
|
|
51
|
+
* @default md
|
|
52
|
+
*/
|
|
53
|
+
size?: QBtnSizeOptions;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>import { createClasses } from "$utils/props";
|
|
2
|
+
export let bordered = false, fill = void 0, flat = false, round = false, title = void 0, userClasses = void 0;
|
|
3
|
+
export { userClasses as class };
|
|
4
|
+
const colorOptions = ["primary", "secondary", "tertiary"];
|
|
5
|
+
$:
|
|
6
|
+
color = !fill ? "surface" : colorOptions.includes(fill) ? `${fill}-container` : "surface-variant";
|
|
7
|
+
$:
|
|
8
|
+
classes = createClasses([bordered && "bordered", flat && "flat", round && "rounded"], {
|
|
9
|
+
component: "q-card",
|
|
10
|
+
quaffClasses: [`${color} on-${color}-text`],
|
|
11
|
+
userClasses
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<article class={classes} {...$$restProps}>
|
|
16
|
+
{#if $$slots.title}
|
|
17
|
+
<slot name="title" />
|
|
18
|
+
{:else if title !== undefined}
|
|
19
|
+
<h5 class="q-card__title">{title}</h5>
|
|
20
|
+
{/if}
|
|
21
|
+
|
|
22
|
+
<slot />
|
|
23
|
+
</article>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QCardProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
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 | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
title: {};
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type QCardProps = typeof __propDef.props;
|
|
22
|
+
export type QCardEvents = typeof __propDef.events;
|
|
23
|
+
export type QCardSlots = typeof __propDef.slots;
|
|
24
|
+
export default class QCard extends SvelteComponentTyped<QCardProps, QCardEvents, QCardSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import useAlign from "../../composables/use-align";
|
|
2
|
+
import { createClasses } from "$utils/props";
|
|
3
|
+
export let align = void 0, vertical = false, userClasses = void 0;
|
|
4
|
+
export { userClasses as class };
|
|
5
|
+
$:
|
|
6
|
+
alignClass = useAlign(align);
|
|
7
|
+
$:
|
|
8
|
+
classes = createClasses([vertical && "vertical"], {
|
|
9
|
+
component: "q-card",
|
|
10
|
+
element: "actions",
|
|
11
|
+
quaffClasses: [alignClass],
|
|
12
|
+
userClasses
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<nav class={classes} {...$$restProps}>
|
|
17
|
+
<slot />
|
|
18
|
+
</nav>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QCardActionsProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
align?: QCardActionsProps["align"];
|
|
7
|
+
vertical?: boolean | undefined;
|
|
8
|
+
class?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type QCardActionsProps = typeof __propDef.props;
|
|
18
|
+
export type QCardActionsEvents = typeof __propDef.events;
|
|
19
|
+
export type QCardActionsSlots = typeof __propDef.slots;
|
|
20
|
+
export default class QCardActions extends SvelteComponentTyped<QCardActionsProps, QCardActionsEvents, QCardActionsSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script>import { createClasses } from "$utils/props";
|
|
2
|
+
export let horizontal = false, userClasses = void 0;
|
|
3
|
+
export { userClasses as class };
|
|
4
|
+
$:
|
|
5
|
+
classes = createClasses([horizontal && "horizontal"], {
|
|
6
|
+
component: "q-card",
|
|
7
|
+
element: "section",
|
|
8
|
+
userClasses
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class={classes} {...$$restProps} on:scroll>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QCardSectionProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
horizontal?: QCardSectionProps["horizontal"];
|
|
7
|
+
class?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
scroll: Event;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
default: {};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type QCardSectionProps = typeof __propDef.props;
|
|
19
|
+
export type QCardSectionEvents = typeof __propDef.events;
|
|
20
|
+
export type QCardSectionSlots = typeof __propDef.slots;
|
|
21
|
+
export default class QCardSection extends SvelteComponentTyped<QCardSectionProps, QCardSectionEvents, QCardSectionSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { QCardActionsDocsProps, QCardDocsProps, QCardSectionDocsProps } from "./docs.props";
|
|
2
|
+
export let QCardDocs = {
|
|
3
|
+
name: "QCard",
|
|
4
|
+
description: "Cards provide a clean, flexible, and convenient means of displaying a wide variety of content.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QCardDocsProps,
|
|
7
|
+
slots: [
|
|
8
|
+
{
|
|
9
|
+
name: "default",
|
|
10
|
+
description: "Use this slot to add content to the card.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
methods: [],
|
|
14
|
+
events: [],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export let QCardSectionDocs = {
|
|
18
|
+
name: "QCardSection",
|
|
19
|
+
description: "Sections are used to group similar content within a card.",
|
|
20
|
+
docs: {
|
|
21
|
+
props: QCardSectionDocsProps,
|
|
22
|
+
slots: [
|
|
23
|
+
{
|
|
24
|
+
name: "default",
|
|
25
|
+
description: "Use this slot to add content to the card section.",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
methods: [],
|
|
29
|
+
events: [],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export let QCardActionsDocs = {
|
|
33
|
+
name: "QCardActions",
|
|
34
|
+
description: "Actions hold actionable items like buttons within a card.",
|
|
35
|
+
docs: {
|
|
36
|
+
props: QCardActionsDocsProps,
|
|
37
|
+
slots: [
|
|
38
|
+
{
|
|
39
|
+
name: "default",
|
|
40
|
+
description: "Use this slot to add action items to the card.",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
methods: [],
|
|
44
|
+
events: [],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const QCardDocsProps: {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
optional: boolean;
|
|
5
|
+
clickableType: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
default: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const QCardSectionDocsProps: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
optional: boolean;
|
|
13
|
+
clickableType: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
default: string;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const QCardActionsDocsProps: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
optional: boolean;
|
|
21
|
+
clickableType: boolean;
|
|
22
|
+
description: string;
|
|
23
|
+
default: string;
|
|
24
|
+
}[];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const QCardDocsProps = [
|
|
2
|
+
{
|
|
3
|
+
name: "bordered",
|
|
4
|
+
type: "boolean",
|
|
5
|
+
optional: true,
|
|
6
|
+
clickableType: false,
|
|
7
|
+
description: "Puts a border around the card.",
|
|
8
|
+
default: "false",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "fill",
|
|
12
|
+
type: "string | boolean",
|
|
13
|
+
optional: true,
|
|
14
|
+
clickableType: false,
|
|
15
|
+
description: "Defines the fill color of the card.",
|
|
16
|
+
default: "undefined",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "flat",
|
|
20
|
+
type: "boolean",
|
|
21
|
+
optional: true,
|
|
22
|
+
clickableType: false,
|
|
23
|
+
description: "Makes the card flat, removing its elevation.",
|
|
24
|
+
default: "false",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "round",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
optional: true,
|
|
30
|
+
clickableType: false,
|
|
31
|
+
description: "Adds rounded corners to the card.",
|
|
32
|
+
default: "false",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "title",
|
|
36
|
+
type: "string",
|
|
37
|
+
optional: true,
|
|
38
|
+
clickableType: false,
|
|
39
|
+
description: "Sets the title of the card.",
|
|
40
|
+
default: "undefined",
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
export const QCardSectionDocsProps = [
|
|
44
|
+
{
|
|
45
|
+
name: "horizontal",
|
|
46
|
+
type: "boolean",
|
|
47
|
+
optional: true,
|
|
48
|
+
clickableType: false,
|
|
49
|
+
description: "Lays out the section content horizontally.",
|
|
50
|
+
default: "false",
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
export const QCardActionsDocsProps = [
|
|
54
|
+
{
|
|
55
|
+
name: "vertical",
|
|
56
|
+
type: "boolean",
|
|
57
|
+
optional: false,
|
|
58
|
+
clickableType: false,
|
|
59
|
+
description: "Lays out the action items vertically.",
|
|
60
|
+
default: "false",
|
|
61
|
+
},
|
|
62
|
+
];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// QCard
|
|
2
|
+
.q-card {
|
|
3
|
+
display: block;
|
|
4
|
+
border-radius: 0.75rem;
|
|
5
|
+
transition: var(--speed-3) transform, var(--speed-3) padding, var(--speed-3) border-radius;
|
|
6
|
+
@include padding("a", "md");
|
|
7
|
+
@extend .elevate-sm-bottom;
|
|
8
|
+
|
|
9
|
+
&.q-card--bordered {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
@include border();
|
|
12
|
+
@extend .elevate-none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.q-card--flat {
|
|
16
|
+
@extend .elevate-none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.q-card--rounded {
|
|
20
|
+
border-radius: 2rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
& > .q-card__title {
|
|
24
|
+
@include margin("b");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// QCardSection
|
|
29
|
+
.q-card > .q-card__section {
|
|
30
|
+
@include padding;
|
|
31
|
+
|
|
32
|
+
&.q-card__section--horizontal {
|
|
33
|
+
@extend .row;
|
|
34
|
+
border-radius: 0;
|
|
35
|
+
|
|
36
|
+
&:not(.q-card__title + .q-card__section) {
|
|
37
|
+
@include margin("t");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// QCardActions
|
|
43
|
+
.q-card > .q-card__actions {
|
|
44
|
+
display: flex;
|
|
45
|
+
|
|
46
|
+
&.q-card__actions--vertical {
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:not(.q-card__title + .q-card__actions) {
|
|
51
|
+
@include margin("t");
|
|
52
|
+
}
|
|
53
|
+
}
|