@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
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2023 Rubatissimo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Quaff
|
|
2
|
+
|
|
3
|
+
Quaff is an experimental project utilizing [Beer CSS](https://www.beercss.com/) and parts of [Quasar Framework](https://quasar.dev/) as the base for Svelte components. This independent project is not endorsed by or affiliated with Beer CSS or Quasar Framework.
|
|
4
|
+
|
|
5
|
+
**This is merely a playground right now, don't expect anything usable!**
|
|
6
|
+
|
|
7
|
+
## Developing
|
|
8
|
+
|
|
9
|
+
Once you've installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm run dev
|
|
13
|
+
|
|
14
|
+
# or start the server and open the app in a new browser tab
|
|
15
|
+
npm run dev -- --open
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Everything inside `src/lib` is part of the library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
19
|
+
|
|
20
|
+
## Building
|
|
21
|
+
|
|
22
|
+
To build the library:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm run package
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To create a production version of your showcase app:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
You can preview the production build with `npm run preview`.
|
|
35
|
+
|
|
36
|
+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
37
|
+
|
|
38
|
+
## Third-party Libraries
|
|
39
|
+
|
|
40
|
+
This project makes use of the following open source libraries:
|
|
41
|
+
|
|
42
|
+
- [Beer CSS](https://www.beercss.com/): Copyright (c) 2021 Beer css!. Licensed under the [MIT License](https://github.com/beercss/beercss/blob/main/LICENSE)
|
|
43
|
+
- [Quasar Framework](https://quasar.dev/): Copyright (c) 2015-present Razvan Stoenescu. Licensed under the [MIT License](https://github.com/quasarframework/quasar/blob/dev/LICENSE)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script>import { createClasses, createStyles } from "../../utils/props";
|
|
2
|
+
export let shape = "circle", size = "md", src = void 0, video = false, userClasses = void 0, userStyles = void 0;
|
|
3
|
+
export { userClasses as class };
|
|
4
|
+
export { userStyles as style };
|
|
5
|
+
$:
|
|
6
|
+
isBasicSize = ["xs", "sm", "md", "lg", "xl"].includes(size);
|
|
7
|
+
$:
|
|
8
|
+
shapeClass = createClasses([
|
|
9
|
+
shape === "circle" && "circle",
|
|
10
|
+
shape === "rounded" && "round",
|
|
11
|
+
shape.includes("top") && "top-round",
|
|
12
|
+
shape.includes("bottom") && "bottom-round",
|
|
13
|
+
shape.includes("left") && "left-round",
|
|
14
|
+
shape.includes("right") && "right-round"
|
|
15
|
+
]);
|
|
16
|
+
$:
|
|
17
|
+
classes = createClasses([shapeClass, isBasicSize && size], {
|
|
18
|
+
component: "q-avatar",
|
|
19
|
+
userClasses
|
|
20
|
+
});
|
|
21
|
+
$:
|
|
22
|
+
style = !isBasicSize ? createStyles(
|
|
23
|
+
{
|
|
24
|
+
width: size,
|
|
25
|
+
height: size
|
|
26
|
+
},
|
|
27
|
+
userStyles
|
|
28
|
+
) : userStyles;
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if video === true}
|
|
32
|
+
<!-- svelte-ignore a11y-media-has-caption -->
|
|
33
|
+
<video class={classes} {style} autoplay loop playsinline {...$$restProps} on:click>
|
|
34
|
+
<source {src} type="video/mp4" />
|
|
35
|
+
</video>
|
|
36
|
+
{:else if src !== undefined}
|
|
37
|
+
<!-- svelte-ignore a11y-missing-attribute -->
|
|
38
|
+
<img class={classes} {style} {src} {...$$restProps} on:click />
|
|
39
|
+
{:else}
|
|
40
|
+
<div class={classes} {style} {...$$restProps} on:click>
|
|
41
|
+
<slot />
|
|
42
|
+
</div>
|
|
43
|
+
{/if}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QAvatarProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
shape?: QAvatarProps["shape"];
|
|
7
|
+
size?: QAvatarProps["size"];
|
|
8
|
+
src?: QAvatarProps["src"];
|
|
9
|
+
video?: QAvatarProps["video"];
|
|
10
|
+
class?: string | undefined;
|
|
11
|
+
style?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
click: MouseEvent;
|
|
15
|
+
} & {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {
|
|
19
|
+
default: {};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type QAvatarProps = typeof __propDef.props;
|
|
23
|
+
export type QAvatarEvents = typeof __propDef.events;
|
|
24
|
+
export type QAvatarSlots = typeof __propDef.slots;
|
|
25
|
+
export default class QAvatar extends SvelteComponentTyped<QAvatarProps, QAvatarEvents, QAvatarSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { QAvatarDocsProps } from "./docs.props";
|
|
2
|
+
export let QAvatarDocs = {
|
|
3
|
+
name: "QAvatar",
|
|
4
|
+
description: "Avatars can be used in many different ways as with icons or for user profile images/videos, for example. They can have many different shapes, the default one being a circle.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QAvatarDocsProps,
|
|
7
|
+
slots: [
|
|
8
|
+
{
|
|
9
|
+
name: "default",
|
|
10
|
+
description: "The default slot can be used to display initials inside the avatar.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
methods: [],
|
|
14
|
+
events: [
|
|
15
|
+
{
|
|
16
|
+
name: "click",
|
|
17
|
+
type: "(e: MouseEvent) => void",
|
|
18
|
+
description: "Emitted when the user clicks on the avatar.",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const QAvatarDocsProps = [
|
|
2
|
+
{
|
|
3
|
+
name: "shape",
|
|
4
|
+
type: "QAvatarShapeOptions",
|
|
5
|
+
optional: true,
|
|
6
|
+
clickableType: true,
|
|
7
|
+
description: "Shape of the avatar.",
|
|
8
|
+
default: "circle",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "size",
|
|
12
|
+
type: "QAvatarSizeOptions",
|
|
13
|
+
optional: true,
|
|
14
|
+
clickableType: true,
|
|
15
|
+
description: 'Size of the avatar, can be a custom size using CSS units. If no unit is specified, "px" will be used.',
|
|
16
|
+
default: "md",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "src",
|
|
20
|
+
type: "string",
|
|
21
|
+
optional: true,
|
|
22
|
+
clickableType: false,
|
|
23
|
+
description: "Source of the image to use as the avatar. Can be a url or a path to a local file.",
|
|
24
|
+
default: "undefined",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "video",
|
|
28
|
+
type: "boolean",
|
|
29
|
+
optional: true,
|
|
30
|
+
clickableType: false,
|
|
31
|
+
description: 'If set to true, will use the "src" prop as a video source.',
|
|
32
|
+
default: "false",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//? Basic styles
|
|
2
|
+
.q-avatar {
|
|
3
|
+
object-fit: cover;
|
|
4
|
+
object-position: center;
|
|
5
|
+
aspect-ratio: 1;
|
|
6
|
+
transition: var(--speed3) transform, var(--speed3) border-radius, var(--speed3) padding;
|
|
7
|
+
border-radius: 0;
|
|
8
|
+
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
|
|
13
|
+
font-size: 1rem;
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
|
|
18
|
+
-webkit-user-select: none;
|
|
19
|
+
-moz-user-select: none;
|
|
20
|
+
-ms-user-select: none;
|
|
21
|
+
user-select: none;
|
|
22
|
+
|
|
23
|
+
&--circle {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//? Sizes
|
|
29
|
+
$sizes: (
|
|
30
|
+
"xs": 1,
|
|
31
|
+
"sm": 2,
|
|
32
|
+
"md": 3,
|
|
33
|
+
"lg": 4,
|
|
34
|
+
"xl": 5,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
.q-avatar {
|
|
38
|
+
@each $size, $val in $sizes {
|
|
39
|
+
&--#{$size} {
|
|
40
|
+
height: 2rem + ($val - 1) * 0.5rem;
|
|
41
|
+
width: 2rem + ($val - 1) * 0.5rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//? Border radius
|
|
47
|
+
$positions-y: "top", "bottom";
|
|
48
|
+
$positions-x: "right", "left";
|
|
49
|
+
|
|
50
|
+
.q-avatar {
|
|
51
|
+
&--top-right-round {
|
|
52
|
+
border-top-right-radius: 50%;
|
|
53
|
+
}
|
|
54
|
+
&--top-left-round {
|
|
55
|
+
border-top-left-radius: 50%;
|
|
56
|
+
}
|
|
57
|
+
&--bottom-right-round {
|
|
58
|
+
border-bottom-right-radius: 50%;
|
|
59
|
+
}
|
|
60
|
+
&--bottom-left-round {
|
|
61
|
+
border-bottom-left-radius: 50%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@each $pos-y in $positions-y {
|
|
65
|
+
&--#{$pos-y}-round {
|
|
66
|
+
@extend .q-avatar--#{$pos-y}-left-round;
|
|
67
|
+
@extend .q-avatar--#{$pos-y}-right-round;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@each $pos-x in $positions-x {
|
|
72
|
+
&--#{$pos-x}-round {
|
|
73
|
+
@extend .q-avatar--top-#{$pos-x}-round;
|
|
74
|
+
@extend .q-avatar--bottom-#{$pos-x}-round;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&--circle {
|
|
79
|
+
@extend .q-avatar--top-left-round;
|
|
80
|
+
@extend .q-avatar--top-right-round;
|
|
81
|
+
@extend .q-avatar--bottom-left-round;
|
|
82
|
+
@extend .q-avatar--bottom-right-round;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--round {
|
|
86
|
+
border-radius: 0.5rem;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { NativeProps } from "../../utils/types";
|
|
2
|
+
export type QAvatarShapeOptions = "circle" | "rounded" | "top-round" | "left-round" | "right-round" | "bottom-round" | "top-left-round" | "top-right-round" | "bottom-left-round" | "bottom-right-round";
|
|
3
|
+
export type QAvatarSizeOptions = "xs" | "sm" | "md" | "lg" | "xl" | string;
|
|
4
|
+
export interface QAvatarProps extends NativeProps {
|
|
5
|
+
/**
|
|
6
|
+
* Shape of the avatar.
|
|
7
|
+
* @default circle
|
|
8
|
+
*/
|
|
9
|
+
shape?: QAvatarShapeOptions;
|
|
10
|
+
/**
|
|
11
|
+
* Size of the avatar, can be a custom size using CSS units. If no unit is specified, "px" will be used.
|
|
12
|
+
* @default md
|
|
13
|
+
*/
|
|
14
|
+
size?: QAvatarSizeOptions;
|
|
15
|
+
/**
|
|
16
|
+
* Source of the image to use as the avatar. Can be a url or a path to a local file.
|
|
17
|
+
* @default undefined
|
|
18
|
+
*/
|
|
19
|
+
src?: string;
|
|
20
|
+
/**
|
|
21
|
+
* If set to true, will use the "src" prop as a video source.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
video?: boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "$lib/utils/types";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import { createClasses } from "../../utils/props";
|
|
2
|
+
import { onMount, setContext } from "svelte";
|
|
3
|
+
export let separator = "/", gutter = "sm", activeColor = "primary", separatorColor = "outline", userClasses = void 0;
|
|
4
|
+
export { userClasses as class };
|
|
5
|
+
let breadcrumbElement;
|
|
6
|
+
onMount(() => breadcrumbElement.firstChild?.remove());
|
|
7
|
+
setContext("activeColor", activeColor);
|
|
8
|
+
setContext("separator", { type: separator, color: separatorColor, gutter });
|
|
9
|
+
$:
|
|
10
|
+
classes = createClasses([], {
|
|
11
|
+
component: "q-breadcrumbs",
|
|
12
|
+
userClasses
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div class={classes} bind:this={breadcrumbElement}>
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QBreadcrumbsProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
separator?: QBreadcrumbsProps["separator"];
|
|
6
|
+
gutter?: QBreadcrumbsProps["gutter"];
|
|
7
|
+
activeColor?: QBreadcrumbsProps["activeColor"];
|
|
8
|
+
separatorColor?: QBreadcrumbsProps["separatorColor"];
|
|
9
|
+
class?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {
|
|
15
|
+
default: {};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type QBreadcrumbsProps = typeof __propDef.props;
|
|
19
|
+
export type QBreadcrumbsEvents = typeof __propDef.events;
|
|
20
|
+
export type QBreadcrumbsSlots = typeof __propDef.slots;
|
|
21
|
+
export default class QBreadcrumbs extends SvelteComponentTyped<QBreadcrumbsProps, QBreadcrumbsEvents, QBreadcrumbsSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
|
+
import QIcon from "../icon/QIcon.svelte";
|
|
3
|
+
import { createClasses } from "../../utils/props";
|
|
4
|
+
import { isRouteActive } from "../../composables/use-router-link";
|
|
5
|
+
import { Quaff } from "../../stores/Quaff";
|
|
6
|
+
export let label = "", icon = void 0, tag = "div", to = void 0, href = void 0, activeClass = "active", userClasses = void 0;
|
|
7
|
+
export { userClasses as class };
|
|
8
|
+
const activeColor = getContext("activeColor");
|
|
9
|
+
const separator = getContext("separator");
|
|
10
|
+
$:
|
|
11
|
+
isActive = isRouteActive($Quaff.router, href || to);
|
|
12
|
+
$:
|
|
13
|
+
classes = createClasses([isActive && activeClass], {
|
|
14
|
+
component: "q-breadcrumbs",
|
|
15
|
+
element: "el",
|
|
16
|
+
quaffClasses: [isActive && `${activeColor}-text`],
|
|
17
|
+
userClasses
|
|
18
|
+
});
|
|
19
|
+
$:
|
|
20
|
+
separatorClasses = createClasses([], {
|
|
21
|
+
component: "q-breadcrumbs",
|
|
22
|
+
element: "separator",
|
|
23
|
+
quaffClasses: [`q-px-${separator.gutter}`]
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div class={separatorClasses}>
|
|
28
|
+
{#if separator.type.startsWith("icon:")}
|
|
29
|
+
<QIcon name={separator.type.replace("icon:", "")} size="1rem" />
|
|
30
|
+
{:else}
|
|
31
|
+
{separator.type}
|
|
32
|
+
{/if}
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
{#if href !== undefined || to !== undefined}
|
|
36
|
+
<a href={href || to} class={classes}>
|
|
37
|
+
{#if icon !== undefined}
|
|
38
|
+
<QIcon name={icon} size="1rem" />
|
|
39
|
+
{:else if $$slots.icon}
|
|
40
|
+
<slot name="icon" />
|
|
41
|
+
{/if}
|
|
42
|
+
|
|
43
|
+
<slot>
|
|
44
|
+
{label}
|
|
45
|
+
</slot>
|
|
46
|
+
</a>
|
|
47
|
+
{:else}
|
|
48
|
+
<svelte:element this={tag} class={classes}>
|
|
49
|
+
{#if icon !== undefined}
|
|
50
|
+
<QIcon name={icon} size="1rem" />
|
|
51
|
+
{:else if $$slots.icon}
|
|
52
|
+
<slot name="icon" />
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
55
|
+
<slot>
|
|
56
|
+
{label}
|
|
57
|
+
</slot>
|
|
58
|
+
</svelte:element>
|
|
59
|
+
{/if}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { QBreadcrumbsElProps } from "./props";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
label?: QBreadcrumbsElProps["label"];
|
|
6
|
+
icon?: QBreadcrumbsElProps["icon"];
|
|
7
|
+
tag?: QBreadcrumbsElProps["tag"];
|
|
8
|
+
to?: QBreadcrumbsElProps["to"];
|
|
9
|
+
href?: QBreadcrumbsElProps["href"];
|
|
10
|
+
activeClass?: QBreadcrumbsElProps["activeClass"];
|
|
11
|
+
class?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
icon: {};
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type QBreadcrumbsElProps = typeof __propDef.props;
|
|
22
|
+
export type QBreadcrumbsElEvents = typeof __propDef.events;
|
|
23
|
+
export type QBreadcrumbsElSlots = typeof __propDef.slots;
|
|
24
|
+
export default class QBreadcrumbsEl extends SvelteComponentTyped<QBreadcrumbsElProps, QBreadcrumbsElEvents, QBreadcrumbsElSlots> {
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QBreadcrumbsDocsProps } from "./docs.props";
|
|
2
|
+
export let QBreadcrumbsDocs = {
|
|
3
|
+
name: "QBreadcrumbs",
|
|
4
|
+
description: "Breadcrumbs are mostly used as a navigation aid. They allow users to keep track of their location within the page.",
|
|
5
|
+
docs: {
|
|
6
|
+
props: QBreadcrumbsDocsProps,
|
|
7
|
+
slots: [
|
|
8
|
+
{
|
|
9
|
+
name: "default",
|
|
10
|
+
description: "The default slot is used to inserts breadcrumb elements. Use QBreadcrumbsEl to insert elements.",
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
methods: [],
|
|
14
|
+
events: [],
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const QBreadcrumbsDocsProps: {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
optional: boolean;
|
|
5
|
+
clickableType: boolean;
|
|
6
|
+
description: string;
|
|
7
|
+
default: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const QBreadcrumbsElDocsProps: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
optional: boolean;
|
|
13
|
+
clickableType: boolean;
|
|
14
|
+
description: string;
|
|
15
|
+
default: string;
|
|
16
|
+
}[];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export const QBreadcrumbsDocsProps = [
|
|
2
|
+
{
|
|
3
|
+
name: "separator",
|
|
4
|
+
type: "string",
|
|
5
|
+
optional: true,
|
|
6
|
+
clickableType: false,
|
|
7
|
+
description: 'Separator to use between the breadcrumb elements. To use an icon, prefix with "icon:" followed by the name of the icon.',
|
|
8
|
+
default: "/",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "gutter",
|
|
12
|
+
type: "QBreadcrumbsGutterOptions",
|
|
13
|
+
optional: true,
|
|
14
|
+
clickableType: true,
|
|
15
|
+
description: "Space around separators.",
|
|
16
|
+
default: "sm",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "activeColor",
|
|
20
|
+
type: "string",
|
|
21
|
+
optional: true,
|
|
22
|
+
clickableType: false,
|
|
23
|
+
description: "Color to use for the active breadcrumb element. See <link to colors docs> to see what colors can be used.",
|
|
24
|
+
default: "primary",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "separatorColor",
|
|
28
|
+
type: "string",
|
|
29
|
+
optional: true,
|
|
30
|
+
clickableType: false,
|
|
31
|
+
description: "Color to use for the separators. See <link to colors docs> to see what colors can be used.",
|
|
32
|
+
default: "outline",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
export const QBreadcrumbsElDocsProps = [
|
|
36
|
+
{
|
|
37
|
+
name: "label",
|
|
38
|
+
type: "string",
|
|
39
|
+
optional: true,
|
|
40
|
+
clickableType: false,
|
|
41
|
+
description: "Text to use for the breadcrumb element. If default slot is defined, the label will be overwritten by it.",
|
|
42
|
+
default: '""',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "icon",
|
|
46
|
+
type: "string",
|
|
47
|
+
optional: true,
|
|
48
|
+
clickableType: false,
|
|
49
|
+
description: "Name of the leading icon for the breadcrumb element. The icon prop overwrites to icon slot.",
|
|
50
|
+
default: "undefined",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "tag",
|
|
54
|
+
type: "string",
|
|
55
|
+
optional: true,
|
|
56
|
+
clickableType: false,
|
|
57
|
+
description: "Tag to use for the breadcrumb element.",
|
|
58
|
+
default: '"div"',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "to",
|
|
62
|
+
type: "string",
|
|
63
|
+
optional: true,
|
|
64
|
+
clickableType: false,
|
|
65
|
+
description: 'Makes the breadcrumb element navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id")',
|
|
66
|
+
default: "undefined",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "href",
|
|
70
|
+
type: "string",
|
|
71
|
+
optional: true,
|
|
72
|
+
clickableType: false,
|
|
73
|
+
description: 'Also makes the breadcrumb element navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id")',
|
|
74
|
+
default: "undefined",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "activeClass",
|
|
78
|
+
type: "string",
|
|
79
|
+
optional: true,
|
|
80
|
+
clickableType: false,
|
|
81
|
+
description: "Class to apply to the breadcrumb element when the route is active.",
|
|
82
|
+
default: '"active"',
|
|
83
|
+
},
|
|
84
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// QBreadcrumbs
|
|
2
|
+
.q-breadcrumbs {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
|
|
7
|
+
&__separator:first-child {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// QBreadcrumbsEl
|
|
13
|
+
.q-breadcrumbs.q-breadcrumbs__el {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
|
|
17
|
+
& > .q-icon {
|
|
18
|
+
@include margin("r");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { NativeProps } from "../../utils/types";
|
|
2
|
+
export type QBreadcrumbsGutterOptions = "none" | "sm" | "md" | "lg";
|
|
3
|
+
export interface QBreadcrumbsProps extends NativeProps {
|
|
4
|
+
/**
|
|
5
|
+
* Separator to use between the breadcrumb elements. To use an icon, prefix with "icon:" followed by the name of the icon.
|
|
6
|
+
* @default /
|
|
7
|
+
*/
|
|
8
|
+
separator?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Space around separators.
|
|
11
|
+
* @default sm
|
|
12
|
+
*/
|
|
13
|
+
gutter?: QBreadcrumbsGutterOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Color to use for the active breadcrumb element. See <link to colors docs> to see what colors can be used.
|
|
16
|
+
* @default primary
|
|
17
|
+
*/
|
|
18
|
+
activeColor?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Color to use for the separators. See <link to colors docs> to see what colors can be used.
|
|
21
|
+
* @default outline
|
|
22
|
+
*/
|
|
23
|
+
separatorColor?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface QBreadcrumbsElProps extends NativeProps {
|
|
26
|
+
/**
|
|
27
|
+
* Text to use for the breadcrumb element. If default slot is defined, the label will be overwritten by it.
|
|
28
|
+
* @default ""
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Name of the leading icon for the breadcrumb element. The icon prop overwrites to icon slot.
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
icon?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Tag to use for the breadcrumb element.
|
|
38
|
+
* @default "div"
|
|
39
|
+
*/
|
|
40
|
+
tag?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Makes the breadcrumb element navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id")
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
to?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Also makes the breadcrumb element navigational. Can be used with the router (e.g to="/home") or as a normal href attribute (e.g to="#section-id")
|
|
48
|
+
* @default undefined
|
|
49
|
+
*/
|
|
50
|
+
href?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Class to apply to the breadcrumb element when the route is active.
|
|
53
|
+
* @default "active"
|
|
54
|
+
*/
|
|
55
|
+
activeClass?: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|