@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/classes/QContext.svelte.d.ts +42 -0
- package/dist/classes/QContext.svelte.js +63 -0
- package/dist/classes/QScrollObserver.svelte.d.ts +44 -0
- package/dist/classes/QScrollObserver.svelte.js +95 -0
- package/dist/classes/QTheme.svelte.d.ts +11 -0
- package/dist/classes/QTheme.svelte.js +49 -0
- package/dist/classes/Quaff.svelte.d.ts +14 -0
- package/dist/classes/Quaff.svelte.js +35 -0
- package/dist/components/avatar/QAvatar.scss +97 -0
- package/dist/components/avatar/QAvatar.svelte +35 -50
- package/dist/components/avatar/QAvatar.svelte.d.ts +2 -25
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/avatar/docs.props.js +21 -5
- package/dist/components/avatar/index.scss +5 -3
- package/dist/components/avatar/props.d.ts +24 -7
- package/dist/components/breadcrumbs/QBreadcrumbs.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +24 -10
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte.d.ts +2 -22
- package/dist/components/breadcrumbs/QBreadcrumbsEl.scss +10 -0
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +62 -38
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte.d.ts +2 -25
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/breadcrumbs/docs.props.js +27 -27
- package/dist/components/breadcrumbs/props.d.ts +25 -24
- package/dist/components/button/QBtn.scss +133 -0
- package/dist/components/button/QBtn.svelte +89 -46
- package/dist/components/button/QBtn.svelte.d.ts +2 -33
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/docs.props.js +26 -18
- package/dist/components/button/props.d.ts +21 -15
- package/dist/components/card/QCard.scss +25 -0
- package/dist/components/card/QCard.svelte +26 -17
- package/dist/components/card/QCard.svelte.d.ts +2 -25
- package/dist/components/card/QCardActions.scss +10 -0
- package/dist/components/card/QCardActions.svelte +11 -8
- package/dist/components/card/QCardActions.svelte.d.ts +2 -21
- package/dist/components/card/QCardSection.scss +10 -0
- package/dist/components/card/QCardSection.svelte +9 -7
- package/dist/components/card/QCardSection.svelte.d.ts +2 -22
- package/dist/components/card/docs.d.ts +3 -3
- package/dist/components/card/docs.js +3 -3
- package/dist/components/card/docs.props.js +6 -14
- package/dist/components/card/props.d.ts +9 -15
- package/dist/components/checkbox/QCheckbox.svelte +6 -5
- package/dist/components/checkbox/QCheckbox.svelte.d.ts +2 -20
- package/dist/components/checkbox/docs.d.ts +1 -1
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/checkbox/docs.props.js +1 -1
- package/dist/components/checkbox/index.scss +3 -1
- package/dist/components/checkbox/props.d.ts +1 -2
- package/dist/components/chip/QChip.scss +179 -0
- package/dist/components/chip/QChip.svelte +97 -69
- package/dist/components/chip/QChip.svelte.d.ts +2 -35
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/chip/docs.props.js +23 -47
- package/dist/components/chip/props.d.ts +21 -34
- package/dist/components/codeBlock/QCodeBlock.svelte +63 -45
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +2 -19
- package/dist/components/codeBlock/docs.props.js +10 -2
- package/dist/components/codeBlock/props.d.ts +6 -1
- package/dist/components/dialog/{index.scss → QDialog.scss} +9 -7
- package/dist/components/dialog/QDialog.svelte +72 -70
- package/dist/components/dialog/QDialog.svelte.d.ts +6 -36
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.js +1 -1
- package/dist/components/dialog/docs.props.d.ts +0 -8
- package/dist/components/dialog/docs.props.js +1 -131
- package/dist/components/dialog/props.d.ts +0 -16
- package/dist/components/drawer/QDrawer.scss +45 -0
- package/dist/components/drawer/QDrawer.svelte +87 -94
- package/dist/components/drawer/QDrawer.svelte.d.ts +6 -39
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/drawer/docs.props.js +3 -3
- package/dist/components/drawer/props.d.ts +2 -2
- package/dist/components/footer/QFooter.scss +42 -0
- package/dist/components/footer/QFooter.svelte +65 -24
- package/dist/components/footer/QFooter.svelte.d.ts +2 -23
- package/dist/components/footer/docs.d.ts +1 -1
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/footer/docs.props.js +14 -6
- package/dist/components/footer/props.d.ts +8 -5
- package/dist/components/header/QHeader.scss +54 -0
- package/dist/components/header/QHeader.svelte +52 -24
- package/dist/components/header/QHeader.svelte.d.ts +2 -23
- package/dist/components/header/docs.props.js +23 -7
- package/dist/components/header/props.d.ts +11 -3
- package/dist/components/icon/{index.scss → QIcon.scss} +2 -4
- package/dist/components/icon/QIcon.svelte +29 -16
- package/dist/components/icon/QIcon.svelte.d.ts +2 -27
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +5 -5
- package/dist/components/icon/props.d.ts +6 -6
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/input/QInput.svelte +52 -25
- package/dist/components/input/QInput.svelte.d.ts +2 -32
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/docs.js +1 -1
- package/dist/components/input/docs.props.js +33 -1
- package/dist/components/input/props.d.ts +5 -12
- package/dist/components/input/props.js +1 -12
- package/dist/components/layout/QLayout.scss +178 -0
- package/dist/components/layout/QLayout.svelte +100 -80
- package/dist/components/layout/QLayout.svelte.d.ts +16 -43
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/layout/docs.props.js +57 -1
- package/dist/components/layout/props.d.ts +8 -0
- package/dist/components/list/QItem.scss +61 -0
- package/dist/components/list/QItem.svelte +65 -46
- package/dist/components/list/QItem.svelte.d.ts +2 -30
- package/dist/components/list/QItemSection.scss +45 -0
- package/dist/components/list/QItemSection.svelte +46 -34
- package/dist/components/list/QItemSection.svelte.d.ts +2 -24
- package/dist/components/list/QList.scss +30 -0
- package/dist/components/list/QList.svelte +28 -16
- package/dist/components/list/QList.svelte.d.ts +2 -28
- package/dist/components/list/docs.d.ts +1 -1
- package/dist/components/list/docs.js +1 -1
- package/dist/components/list/docs.props.js +36 -4
- package/dist/components/list/props.d.ts +9 -8
- package/dist/components/list/props.js +1 -25
- package/dist/components/private/ContextReseter.svelte +6 -11
- package/dist/components/private/ContextReseter.svelte.d.ts +6 -18
- package/dist/components/private/QApi.svelte +118 -97
- package/dist/components/private/QApi.svelte.d.ts +4 -16
- package/dist/components/private/QDocs.svelte +67 -58
- package/dist/components/private/QDocs.svelte.d.ts +9 -20
- package/dist/components/private/QDocsSection.svelte +15 -22
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -29
- package/dist/components/private/QIconSnippet.svelte +12 -0
- package/dist/components/private/QIconSnippet.svelte.d.ts +8 -0
- package/dist/components/progress/QCircularProgress.scss +63 -0
- package/dist/components/progress/QCircularProgress.svelte +104 -28
- package/dist/components/progress/QCircularProgress.svelte.d.ts +2 -22
- package/dist/components/progress/QLinearProgress.scss +75 -0
- package/dist/components/progress/QLinearProgress.svelte +55 -13
- package/dist/components/progress/QLinearProgress.svelte.d.ts +2 -20
- package/dist/components/progress/docs.d.ts +1 -1
- package/dist/components/progress/docs.js +1 -1
- package/dist/components/progress/docs.props.js +138 -10
- package/dist/components/progress/props.d.ts +75 -12
- package/dist/components/radio/QRadio.svelte +14 -3
- package/dist/components/radio/QRadio.svelte.d.ts +2 -21
- package/dist/components/radio/docs.d.ts +1 -1
- package/dist/components/radio/docs.js +1 -1
- package/dist/components/radio/docs.props.js +2 -2
- package/dist/components/radio/index.scss +3 -1
- package/dist/components/radio/props.d.ts +2 -4
- package/dist/components/radio/props.js +1 -8
- package/dist/components/railbar/QRailbar.scss +54 -0
- package/dist/components/railbar/QRailbar.svelte +43 -66
- package/dist/components/railbar/QRailbar.svelte.d.ts +2 -22
- package/dist/components/railbar/docs.d.ts +1 -1
- package/dist/components/railbar/docs.js +1 -1
- package/dist/components/railbar/docs.props.js +4 -4
- package/dist/components/railbar/props.d.ts +3 -3
- package/dist/components/select/QSelect.svelte +121 -88
- package/dist/components/select/QSelect.svelte.d.ts +2 -34
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.js +8 -1
- package/dist/components/select/docs.props.js +41 -1
- package/dist/components/select/index.scss +8 -6
- package/dist/components/select/props.d.ts +6 -12
- package/dist/components/select/props.js +1 -12
- package/dist/components/separator/QSeparator.scss +54 -0
- package/dist/components/separator/QSeparator.svelte +38 -45
- package/dist/components/separator/QSeparator.svelte.d.ts +2 -24
- package/dist/components/separator/docs.d.ts +1 -1
- package/dist/components/separator/docs.js +1 -1
- package/dist/components/separator/docs.props.js +4 -4
- package/dist/components/separator/props.d.ts +5 -7
- package/dist/components/separator/props.js +1 -9
- package/dist/components/switch/QSwitch.scss +305 -0
- package/dist/components/switch/QSwitch.svelte +96 -0
- package/dist/components/switch/QSwitch.svelte.d.ts +3 -0
- package/dist/components/{toggle → switch}/docs.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.js +3 -3
- package/dist/components/{toggle → switch}/docs.props.d.ts +1 -1
- package/dist/components/{toggle → switch}/docs.props.js +30 -6
- package/dist/components/switch/props.d.ts +13 -0
- package/dist/components/switch/props.js +1 -0
- package/dist/components/table/QTable.svelte +99 -85
- package/dist/components/table/QTable.svelte.d.ts +3 -29
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/table/docs.js +1 -1
- package/dist/components/table/docs.props.js +9 -1
- package/dist/components/table/index.scss +3 -1
- package/dist/components/table/props.d.ts +10 -0
- package/dist/components/tabs/QTab.scss +71 -0
- package/dist/components/tabs/QTab.svelte +75 -96
- package/dist/components/tabs/QTab.svelte.d.ts +2 -25
- package/dist/components/tabs/QTabs.scss +40 -0
- package/dist/components/tabs/QTabs.svelte +107 -59
- package/dist/components/tabs/QTabs.svelte.d.ts +6 -31
- package/dist/components/tabs/docs.d.ts +1 -1
- package/dist/components/tabs/docs.js +1 -1
- package/dist/components/tabs/docs.props.js +3 -3
- package/dist/components/tabs/index.scss +4 -2
- package/dist/components/tabs/props.d.ts +5 -4
- package/dist/components/tabs/props.js +1 -1
- package/dist/components/toolbar/QToolbar.svelte +15 -12
- package/dist/components/toolbar/QToolbar.svelte.d.ts +2 -23
- package/dist/components/toolbar/QToolbarTitle.svelte +8 -7
- package/dist/components/toolbar/QToolbarTitle.svelte.d.ts +2 -21
- package/dist/components/toolbar/docs.d.ts +1 -1
- package/dist/components/toolbar/docs.js +1 -1
- package/dist/components/toolbar/docs.props.js +4 -4
- package/dist/components/toolbar/index.scss +12 -14
- package/dist/components/toolbar/props.d.ts +4 -5
- package/dist/components/tooltip/QTooltip.svelte +5 -9
- package/dist/components/tooltip/QTooltip.svelte.d.ts +2 -21
- package/dist/components/tooltip/docs.d.ts +1 -1
- package/dist/components/tooltip/docs.js +1 -1
- package/dist/components/tooltip/docs.props.js +1 -1
- package/dist/components/tooltip/index.scss +3 -1
- package/dist/components/tooltip/props.d.ts +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +3 -3
- package/dist/composables/useSize.d.ts +10 -0
- package/dist/composables/useSize.js +37 -0
- package/dist/composables/{use-size.d.ts → useSizeLegacy.d.ts} +2 -2
- package/dist/composables/{use-size.js → useSizeLegacy.js} +5 -5
- package/dist/css/_components.scss +31 -0
- package/dist/css/_disabled.scss +18 -0
- package/dist/css/{ripple.scss → _ripple.scss} +1 -1
- package/dist/css/_variables.scss +73 -0
- package/dist/css/classes/_design.scss +57 -0
- package/dist/css/classes/_flex.scss +62 -0
- package/dist/css/classes/_grid.scss +35 -0
- package/dist/css/classes/_index.scss +7 -0
- package/dist/css/classes/_overflow.scss +7 -0
- package/dist/css/classes/_position.scss +7 -0
- package/dist/css/classes/_select.scss +6 -0
- package/dist/css/classes/_spaces.scss +23 -0
- package/dist/css/fonts.scss +16 -3
- package/dist/css/index.css +1 -1
- package/dist/css/index.scss +15 -94
- package/dist/css/mixins/_design.scss +63 -0
- package/dist/css/mixins/{field-mixins.scss → _field.scss} +16 -5
- package/dist/css/mixins/_image.scss +63 -0
- package/dist/css/mixins/_index.scss +9 -0
- package/dist/css/mixins/_layout.scss +20 -0
- package/dist/css/mixins/{menu.scss → _menu.scss} +4 -2
- package/dist/css/mixins/{selection.scss → _selection.scss} +7 -67
- package/dist/css/mixins/_spaces.scss +36 -0
- package/dist/css/mixins/_typography.scss +7 -0
- package/dist/css/shared/q-field.scss +62 -32
- package/dist/css/theme/_colors.scss +173 -0
- package/dist/css/theme/css-variables.scss +5 -0
- package/dist/css/theme/page.scss +3 -3
- package/dist/css/theme/reset.scss +17 -1
- package/dist/css/theme/theme.scss +2 -3
- package/dist/css/theme/tokens.scss +0 -159
- package/dist/global.d.ts +1 -1
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +5 -4
- package/dist/helpers/ripple.d.ts +1 -1
- package/dist/helpers/ripple.js +14 -5
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.js +1 -2
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/colors.d.ts +71 -0
- package/dist/utils/colors.js +103 -15
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +10 -4
- package/dist/utils/number.d.ts +2 -0
- package/dist/utils/number.js +9 -0
- package/dist/utils/props.d.ts +2 -2
- package/dist/utils/props.js +8 -6
- package/dist/utils/router.d.ts +17 -0
- package/dist/utils/router.js +23 -0
- package/dist/utils/string.d.ts +1 -0
- package/dist/utils/string.js +4 -1
- package/dist/utils/types.d.ts +7 -2
- package/dist/utils/types.js +0 -3
- package/dist/utils/types.json +8 -5
- package/dist/utils/watchable.d.ts +0 -1
- package/dist/utils/watchable.js +1 -1
- package/package.json +42 -39
- package/dist/components/breadcrumbs/index.scss +0 -20
- package/dist/components/button/index.scss +0 -98
- package/dist/components/card/index.scss +0 -56
- package/dist/components/chip/index.scss +0 -103
- package/dist/components/drawer/index.scss +0 -59
- package/dist/components/footer/index.scss +0 -28
- package/dist/components/layout/index.scss +0 -387
- package/dist/components/list/index.scss +0 -144
- package/dist/components/progress/index.scss +0 -82
- package/dist/components/railbar/index.scss +0 -39
- package/dist/components/separator/index.scss +0 -52
- package/dist/components/toggle/QToggle.svelte +0 -34
- package/dist/components/toggle/QToggle.svelte.d.ts +0 -23
- package/dist/components/toggle/index.scss +0 -31
- package/dist/components/toggle/props.d.ts +0 -9
- package/dist/components/toggle/props.js +0 -9
- package/dist/css/grid.scss +0 -50
- package/dist/css/mixins.scss +0 -137
- package/dist/css/states.scss +0 -75
- package/dist/css/theme/bridge.scss +0 -15
- package/dist/css/theme/theme.dark.scss +0 -39
- package/dist/css/theme/theme.light.scss +0 -39
- package/dist/css/variables-sass.scss +0 -16
- package/dist/stores/QTheme.d.ts +0 -42
- package/dist/stores/QTheme.js +0 -60
- package/dist/stores/Quaff.d.ts +0 -32
- package/dist/stores/Quaff.js +0 -58
- /package/dist/composables/{use-align.d.ts → useAlign.d.ts} +0 -0
- /package/dist/composables/{use-align.js → useAlign.js} +0 -0
- /package/dist/composables/{use-router-link.d.ts → useRouterLink.d.ts} +0 -0
- /package/dist/composables/{use-router-link.js → useRouterLink.js} +0 -0
- /package/dist/css/mixins/{table.scss → _table.scss} +0 -0
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ Quaff is an experimental project utilizing [Beer CSS](https://www.beercss.com/)
|
|
|
6
6
|
|
|
7
7
|
## Developing
|
|
8
8
|
|
|
9
|
-
Once you've installed dependencies with `
|
|
9
|
+
Once you've installed dependencies with `bun install`, start a development server:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
bun run dev
|
|
13
13
|
|
|
14
14
|
# or start the server and open the app in a new browser tab
|
|
15
|
-
|
|
15
|
+
bun run dev -- --open
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Everything inside `src/lib` is part of the library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
@@ -22,16 +22,16 @@ Everything inside `src/lib` is part of the library, everything inside `src/route
|
|
|
22
22
|
To build the library:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
|
|
25
|
+
bun run package
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
To create a production version of your showcase app:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
|
|
31
|
+
bun run build
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
You can preview the production build with `
|
|
34
|
+
You can preview the production build with `bun run preview`.
|
|
35
35
|
|
|
36
36
|
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
37
37
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class allows to manipulate reactive contexts more easily.
|
|
3
|
+
* It avoids having to pass a Svelte store down the components but rather use runes to keep the context reactive.
|
|
4
|
+
*
|
|
5
|
+
* This class should be used when the context has to be modified from a child component. Otherwise, using svelte's context API should be enough.
|
|
6
|
+
*/
|
|
7
|
+
export default class QContext<T> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(contextName: string, init: T);
|
|
10
|
+
/**
|
|
11
|
+
* Gets the value of context with id `contextName`
|
|
12
|
+
* @param contextName - Name of the context to get
|
|
13
|
+
* @returns The context's value
|
|
14
|
+
*/
|
|
15
|
+
static get<T>(contextName: string): QContext<T> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Prevents the propagation of the context further down
|
|
18
|
+
* @param contextName - Name of the context to get
|
|
19
|
+
* @returns The context result
|
|
20
|
+
*/
|
|
21
|
+
static reset(contextName: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Updates the context's inner value with `newVal`
|
|
24
|
+
* @param newVal - New value to update the context with
|
|
25
|
+
*/
|
|
26
|
+
update(newVal: T): void;
|
|
27
|
+
/**
|
|
28
|
+
* Updates the property of id `key` with `newVal` in the context's inner value
|
|
29
|
+
* @param key - Key to update
|
|
30
|
+
* @param newVal - New value to update the context's property with
|
|
31
|
+
*/
|
|
32
|
+
updateEntry(key: keyof T, newVal: NonNullable<T>[keyof T]): void;
|
|
33
|
+
/**
|
|
34
|
+
* Updates the given properties their corresponding values in the context's inner value
|
|
35
|
+
* @param from - Object containing keys to update with their respective value
|
|
36
|
+
*/
|
|
37
|
+
updateEntries(from: Record<keyof T, NonNullable<T>[keyof T]>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Inner value of the context
|
|
40
|
+
*/
|
|
41
|
+
get value(): T;
|
|
42
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getContext, setContext } from "svelte";
|
|
2
|
+
/**
|
|
3
|
+
* This class allows to manipulate reactive contexts more easily.
|
|
4
|
+
* It avoids having to pass a Svelte store down the components but rather use runes to keep the context reactive.
|
|
5
|
+
*
|
|
6
|
+
* This class should be used when the context has to be modified from a child component. Otherwise, using svelte's context API should be enough.
|
|
7
|
+
*/
|
|
8
|
+
export default class QContext {
|
|
9
|
+
#state = $state();
|
|
10
|
+
constructor(contextName, init) {
|
|
11
|
+
this.#state = init;
|
|
12
|
+
setContext(contextName, this);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Gets the value of context with id `contextName`
|
|
16
|
+
* @param contextName - Name of the context to get
|
|
17
|
+
* @returns The context's value
|
|
18
|
+
*/
|
|
19
|
+
static get(contextName) {
|
|
20
|
+
return getContext(contextName);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Prevents the propagation of the context further down
|
|
24
|
+
* @param contextName - Name of the context to get
|
|
25
|
+
* @returns The context result
|
|
26
|
+
*/
|
|
27
|
+
static reset(contextName) {
|
|
28
|
+
setContext(contextName, undefined);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Updates the context's inner value with `newVal`
|
|
32
|
+
* @param newVal - New value to update the context with
|
|
33
|
+
*/
|
|
34
|
+
update(newVal) {
|
|
35
|
+
this.#state = newVal;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates the property of id `key` with `newVal` in the context's inner value
|
|
39
|
+
* @param key - Key to update
|
|
40
|
+
* @param newVal - New value to update the context's property with
|
|
41
|
+
*/
|
|
42
|
+
updateEntry(key, newVal) {
|
|
43
|
+
if (!this.#state || typeof this.#state !== "object" || !Object.hasOwn(this.#state, key)) {
|
|
44
|
+
throw new Error(`${key.toString()} doesn't exist on ${this.#state}`);
|
|
45
|
+
}
|
|
46
|
+
this.#state[key] = newVal;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Updates the given properties their corresponding values in the context's inner value
|
|
50
|
+
* @param from - Object containing keys to update with their respective value
|
|
51
|
+
*/
|
|
52
|
+
updateEntries(from) {
|
|
53
|
+
for (const key in from) {
|
|
54
|
+
this.updateEntry(key, from[key]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Inner value of the context
|
|
59
|
+
*/
|
|
60
|
+
get value() {
|
|
61
|
+
return this.#state;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type Direction = "up" | "right" | "down" | "left";
|
|
2
|
+
type WindowScrollType = "scrollX" | "scrollY";
|
|
3
|
+
type DocumentScrollType = "scrollLeft" | "scrollTop";
|
|
4
|
+
type ScrollType = {
|
|
5
|
+
window: WindowScrollType;
|
|
6
|
+
document: DocumentScrollType;
|
|
7
|
+
};
|
|
8
|
+
type Target = HTMLDivElement | typeof window | Document | string;
|
|
9
|
+
type ScrollObserverOptions = {
|
|
10
|
+
debounce?: number;
|
|
11
|
+
horizontal?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A scroll observer utility.
|
|
15
|
+
* @example
|
|
16
|
+
* ```js
|
|
17
|
+
* // Inside the <script> tag
|
|
18
|
+
* const scroll = new QScrollObserver();
|
|
19
|
+
*
|
|
20
|
+
* $inspect(scroll.direction)
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param target - Element or selector of the element to add the scroll listener on
|
|
24
|
+
* @param options - Options of the observer
|
|
25
|
+
* @param options.horizontal - If set to `true`, observe horizontal scrolling rather than vertical
|
|
26
|
+
* @param options.debounce - Time in milliseconds between each observation update
|
|
27
|
+
*/
|
|
28
|
+
export default class QScrollObserver {
|
|
29
|
+
protected scrollType: ScrollType;
|
|
30
|
+
protected lastScroll: number;
|
|
31
|
+
protected horizontal: boolean;
|
|
32
|
+
protected clearTimer: (() => void) | null;
|
|
33
|
+
protected target: Exclude<Target, string> | null;
|
|
34
|
+
direction: Direction;
|
|
35
|
+
changedDirection: boolean;
|
|
36
|
+
delta: number;
|
|
37
|
+
inflectionPoint: number;
|
|
38
|
+
position: number;
|
|
39
|
+
constructor(target?: Target | null, { horizontal, debounce }?: ScrollObserverOptions);
|
|
40
|
+
protected getScrollPosition(target?: HTMLElement | typeof window | undefined): number;
|
|
41
|
+
protected updateDirection(target: HTMLElement): void;
|
|
42
|
+
protected handleDebounce(target: HTMLElement, debounce: number): void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { onMount } from "svelte";
|
|
2
|
+
import { elFromSelector } from "../utils";
|
|
3
|
+
/**
|
|
4
|
+
* A scroll observer utility.
|
|
5
|
+
* @example
|
|
6
|
+
* ```js
|
|
7
|
+
* // Inside the <script> tag
|
|
8
|
+
* const scroll = new QScrollObserver();
|
|
9
|
+
*
|
|
10
|
+
* $inspect(scroll.direction)
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @param target - Element or selector of the element to add the scroll listener on
|
|
14
|
+
* @param options - Options of the observer
|
|
15
|
+
* @param options.horizontal - If set to `true`, observe horizontal scrolling rather than vertical
|
|
16
|
+
* @param options.debounce - Time in milliseconds between each observation update
|
|
17
|
+
*/
|
|
18
|
+
export default class QScrollObserver {
|
|
19
|
+
scrollType = {
|
|
20
|
+
window: "scrollY",
|
|
21
|
+
document: "scrollTop",
|
|
22
|
+
};
|
|
23
|
+
lastScroll;
|
|
24
|
+
horizontal = false;
|
|
25
|
+
clearTimer = null;
|
|
26
|
+
target = null;
|
|
27
|
+
direction = $state("down");
|
|
28
|
+
changedDirection = $state(false);
|
|
29
|
+
delta = $state(0);
|
|
30
|
+
inflectionPoint = $state(0);
|
|
31
|
+
position = $state(0);
|
|
32
|
+
constructor(target, { horizontal, debounce } = { horizontal: false, debounce: 250 }) {
|
|
33
|
+
this.horizontal = horizontal ?? false;
|
|
34
|
+
this.scrollType = horizontal
|
|
35
|
+
? { window: "scrollX", document: "scrollLeft" }
|
|
36
|
+
: { window: "scrollY", document: "scrollTop" };
|
|
37
|
+
this.lastScroll = 0;
|
|
38
|
+
this.position = 0;
|
|
39
|
+
this.inflectionPoint = 0;
|
|
40
|
+
this.direction = horizontal ? "right" : "down";
|
|
41
|
+
const handler = (e) => {
|
|
42
|
+
const eventTarget = e.target;
|
|
43
|
+
if (!eventTarget || !this.target || eventTarget !== this.target) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (debounce) {
|
|
47
|
+
this.handleDebounce(this.target, debounce);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.updateDirection(this.target);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
onMount(() => {
|
|
54
|
+
let parsedTarget = elFromSelector(target ?? null);
|
|
55
|
+
if (parsedTarget === null) {
|
|
56
|
+
console.warn(`The given target (${target}) is null, observing window instead`);
|
|
57
|
+
parsedTarget = window;
|
|
58
|
+
}
|
|
59
|
+
this.target = parsedTarget;
|
|
60
|
+
parsedTarget.addEventListener("scroll", handler, { capture: true });
|
|
61
|
+
return () => {
|
|
62
|
+
this.clearTimer?.();
|
|
63
|
+
parsedTarget.removeEventListener("scroll", handler, true);
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
getScrollPosition(target = window) {
|
|
68
|
+
return Math.max(0, target === window
|
|
69
|
+
? target[this.scrollType.window]
|
|
70
|
+
: target[this.scrollType.document]);
|
|
71
|
+
}
|
|
72
|
+
updateDirection(target) {
|
|
73
|
+
this.clearTimer?.();
|
|
74
|
+
const newScrollPosition = this.getScrollPosition(target);
|
|
75
|
+
this.position = newScrollPosition;
|
|
76
|
+
this.delta = newScrollPosition - this.lastScroll;
|
|
77
|
+
const newDirection = this.delta > 0 ? (this.horizontal ? "right" : "down") : this.horizontal ? "left" : "up";
|
|
78
|
+
this.changedDirection = newDirection !== this.direction;
|
|
79
|
+
if (this.changedDirection) {
|
|
80
|
+
this.direction = newDirection;
|
|
81
|
+
this.inflectionPoint = newScrollPosition;
|
|
82
|
+
}
|
|
83
|
+
this.lastScroll = newScrollPosition <= 0 ? 0 : newScrollPosition;
|
|
84
|
+
}
|
|
85
|
+
handleDebounce(target, debounce) {
|
|
86
|
+
if (this.clearTimer) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const timer = setTimeout(this.updateDirection.bind(this, target), debounce);
|
|
90
|
+
this.clearTimer = () => {
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
this.clearTimer = null;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HexValue, QuaffColors, Mode } from "../utils/colors";
|
|
2
|
+
type ThemeColors = Record<`${keyof QuaffColors}-${Mode}`, HexValue>;
|
|
3
|
+
declare class QTheme {
|
|
4
|
+
themeColors: ThemeColors;
|
|
5
|
+
constructor();
|
|
6
|
+
private apply;
|
|
7
|
+
updateThemeColor(color: keyof ThemeColors, newVal: HexValue): void;
|
|
8
|
+
setTheme(from: string): void;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: QTheme;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { generateColors } from "../utils/colors";
|
|
2
|
+
function extractColorFromCssVar(cssVar) {
|
|
3
|
+
const rootStyles = getComputedStyle(document.documentElement);
|
|
4
|
+
// remove var(...) to get only the color
|
|
5
|
+
const varName = cssVar.replace(/var\(([a-z0-9-]+)\)/, "$1");
|
|
6
|
+
return rootStyles.getPropertyValue(varName).trim();
|
|
7
|
+
}
|
|
8
|
+
function prepareThemeColors(from) {
|
|
9
|
+
if (from.startsWith("var(")) {
|
|
10
|
+
from = extractColorFromCssVar(from);
|
|
11
|
+
}
|
|
12
|
+
const theme = generateColors(from);
|
|
13
|
+
//@ts-expect-error The properties are added in the next for loop
|
|
14
|
+
const themeColors = {};
|
|
15
|
+
let mode;
|
|
16
|
+
for (mode in theme) {
|
|
17
|
+
let color;
|
|
18
|
+
for (color in theme[mode]) {
|
|
19
|
+
const cssColor = `${color}-${mode}`;
|
|
20
|
+
themeColors[cssColor] = theme[mode][color];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return themeColors;
|
|
24
|
+
}
|
|
25
|
+
class QTheme {
|
|
26
|
+
themeColors = $state({});
|
|
27
|
+
constructor() {
|
|
28
|
+
this.themeColors = prepareThemeColors("#0039b4");
|
|
29
|
+
}
|
|
30
|
+
apply() {
|
|
31
|
+
const root = document.documentElement;
|
|
32
|
+
if (root === null) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let colorName;
|
|
36
|
+
for (colorName in this.themeColors) {
|
|
37
|
+
root.style.setProperty(`--${colorName}`, this.themeColors[colorName]);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
updateThemeColor(color, newVal) {
|
|
41
|
+
this.themeColors[color] = newVal;
|
|
42
|
+
}
|
|
43
|
+
setTheme(from) {
|
|
44
|
+
const newTheme = prepareThemeColors(from);
|
|
45
|
+
this.themeColors = newTheme;
|
|
46
|
+
this.apply();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default new QTheme();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class Quaff {
|
|
2
|
+
version: string;
|
|
3
|
+
protected dark: boolean;
|
|
4
|
+
private toggleDarkMode;
|
|
5
|
+
private setDarkMode;
|
|
6
|
+
get darkMode(): {
|
|
7
|
+
readonly isActive: boolean;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
set: (newVal: boolean) => void;
|
|
10
|
+
};
|
|
11
|
+
get router(): import("@sveltejs/kit").Page<Record<string, string>, string | null>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: Quaff;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { get } from "svelte/store";
|
|
2
|
+
import version from "../helpers/version";
|
|
3
|
+
import { page } from "$app/stores";
|
|
4
|
+
class Quaff {
|
|
5
|
+
version = version;
|
|
6
|
+
dark = $state(false);
|
|
7
|
+
toggleDarkMode() {
|
|
8
|
+
this.dark = !this.dark;
|
|
9
|
+
const mode = {
|
|
10
|
+
from: this.dark ? "light" : "dark",
|
|
11
|
+
to: this.dark ? "dark" : "light",
|
|
12
|
+
};
|
|
13
|
+
const body = document.querySelector("body");
|
|
14
|
+
body?.classList.replace(`body--${mode.from}`, `body--${mode.to}`);
|
|
15
|
+
document.cookie = `current_mode=${mode.to}; max-age=31536000; path="/"; SameSite=strict`;
|
|
16
|
+
}
|
|
17
|
+
setDarkMode(newVal) {
|
|
18
|
+
this.dark = newVal;
|
|
19
|
+
}
|
|
20
|
+
get darkMode() {
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22
|
+
const self = this;
|
|
23
|
+
return {
|
|
24
|
+
get isActive() {
|
|
25
|
+
return self.dark;
|
|
26
|
+
},
|
|
27
|
+
toggle: () => this.toggleDarkMode(),
|
|
28
|
+
set: (newVal) => this.setDarkMode(newVal),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
get router() {
|
|
32
|
+
return get(page);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export default new Quaff();
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@use "$css/variables";
|
|
2
|
+
|
|
3
|
+
@layer q-avatar {
|
|
4
|
+
// Basic styles
|
|
5
|
+
.q-avatar {
|
|
6
|
+
height: var(--size);
|
|
7
|
+
width: var(--size);
|
|
8
|
+
|
|
9
|
+
& > img,
|
|
10
|
+
& > video {
|
|
11
|
+
object-fit: cover;
|
|
12
|
+
object-position: center;
|
|
13
|
+
aspect-ratio: 1;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
transition:
|
|
18
|
+
variables.$speed3 transform,
|
|
19
|
+
variables.$speed3 border-radius,
|
|
20
|
+
variables.$speed3 padding;
|
|
21
|
+
border-radius: 0;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
text-transform: uppercase;
|
|
29
|
+
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
|
|
32
|
+
-webkit-user-select: none;
|
|
33
|
+
-moz-user-select: none;
|
|
34
|
+
-ms-user-select: none;
|
|
35
|
+
user-select: none;
|
|
36
|
+
|
|
37
|
+
&.circle {
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Sizes
|
|
43
|
+
$sizes: (
|
|
44
|
+
"xs": 0,
|
|
45
|
+
"sm": 1,
|
|
46
|
+
"md": 2,
|
|
47
|
+
"lg": 3,
|
|
48
|
+
"xl": 4,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
.q-avatar {
|
|
52
|
+
@each $size, $val in $sizes {
|
|
53
|
+
&--#{$size} {
|
|
54
|
+
--size: calc(2rem + #{$val} * 0.5rem);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Border radius
|
|
60
|
+
$positions-y: "top", "bottom";
|
|
61
|
+
$positions-x: "right", "left";
|
|
62
|
+
|
|
63
|
+
.q-avatar {
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
|
|
66
|
+
&--top-right-round {
|
|
67
|
+
border-bottom-left-radius: 0;
|
|
68
|
+
}
|
|
69
|
+
&--top-left-round {
|
|
70
|
+
border-bottom-right-radius: 0;
|
|
71
|
+
}
|
|
72
|
+
&--bottom-right-round {
|
|
73
|
+
border-top-left-radius: 0;
|
|
74
|
+
}
|
|
75
|
+
&--bottom-left-round {
|
|
76
|
+
border-top-right-radius: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@each $pos-y in $positions-y {
|
|
80
|
+
&--#{$pos-y}-round {
|
|
81
|
+
@extend .q-avatar--#{$pos-y}-left-round;
|
|
82
|
+
@extend .q-avatar--#{$pos-y}-right-round;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@each $pos-x in $positions-x {
|
|
87
|
+
&--#{$pos-x}-round {
|
|
88
|
+
@extend .q-avatar--top-#{$pos-x}-round;
|
|
89
|
+
@extend .q-avatar--bottom-#{$pos-x}-round;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--round {
|
|
94
|
+
border-radius: 0.5rem;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -1,52 +1,37 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<svelte:options runes={true} />
|
|
2
|
+
|
|
3
|
+
<script lang="ts">
|
|
4
|
+
import { useSize } from "../../composables/useSize";
|
|
5
|
+
let {
|
|
6
|
+
alt,
|
|
7
|
+
shape = "circle",
|
|
8
|
+
size = "md",
|
|
9
|
+
src,
|
|
10
|
+
video = false,
|
|
11
|
+
children,
|
|
12
|
+
videoAccessibility,
|
|
13
|
+
...props
|
|
14
|
+
} = $props();
|
|
15
|
+
const qSize = $derived(useSize(size, "q-avatar"));
|
|
16
|
+
const qShape = $derived(`q-avatar--${shape}`);
|
|
6
17
|
</script>
|
|
7
18
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{:else
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class="q-avatar {sizeObj.class ? `q-avatar--${sizeObj.class}` : ''} {userClasses}"
|
|
28
|
-
class:q-avatar--circle={shape === "circle"}
|
|
29
|
-
class:q-avatar--round={shape === "rounded"}
|
|
30
|
-
class:q-avatar--top-round={shape?.includes("top")}
|
|
31
|
-
class:q-avatar--bottom-round={shape?.includes("bottom")}
|
|
32
|
-
class:q-avatar--left-round={shape?.includes("left")}
|
|
33
|
-
class:q-avatar--right-round={shape?.includes("right")}
|
|
34
|
-
style:width={sizeObj.style}
|
|
35
|
-
style:height={sizeObj.style}
|
|
36
|
-
{src} {...$$restProps} on:click />
|
|
37
|
-
{:else}
|
|
38
|
-
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
39
|
-
<div
|
|
40
|
-
class="q-avatar {sizeObj.class ? `q-avatar--${sizeObj.class}` : ''} {userClasses}"
|
|
41
|
-
class:q-avatar--circle={shape === "circle"}
|
|
42
|
-
class:q-avatar--round={shape === "rounded"}
|
|
43
|
-
class:q-avatar--top-round={shape?.includes("top")}
|
|
44
|
-
class:q-avatar--bottom-round={shape?.includes("bottom")}
|
|
45
|
-
class:q-avatar--left-round={shape?.includes("left")}
|
|
46
|
-
class:q-avatar--right-round={shape?.includes("right")}
|
|
47
|
-
style:width={sizeObj.style}
|
|
48
|
-
style:height={sizeObj.style}
|
|
49
|
-
{...$$restProps} on:click>
|
|
50
|
-
<slot />
|
|
51
|
-
</div>
|
|
52
|
-
{/if}
|
|
19
|
+
<div
|
|
20
|
+
{...props}
|
|
21
|
+
class="q-avatar{qShape ? ` ${qShape}` : ''}{qSize.class
|
|
22
|
+
? ` ${qSize.class}`
|
|
23
|
+
: ''}{props.class ? ` ${props.class}` : ''}"
|
|
24
|
+
style:--size={qSize.style}
|
|
25
|
+
>
|
|
26
|
+
{#if video}
|
|
27
|
+
<video>
|
|
28
|
+
<source {src} type="video/mp4" />
|
|
29
|
+
<track kind="captions" />
|
|
30
|
+
{@render videoAccessibility?.()}
|
|
31
|
+
</video>
|
|
32
|
+
{:else if src !== undefined}
|
|
33
|
+
<img {src} {alt} />
|
|
34
|
+
{:else}
|
|
35
|
+
{@render children?.()}
|
|
36
|
+
{/if}
|
|
37
|
+
</div>
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { QAvatarProps } from "./props";
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
shape?: QAvatarProps["shape"];
|
|
7
|
-
size?: QAvatarProps["size"];
|
|
8
|
-
src?: QAvatarProps["src"];
|
|
9
|
-
video?: QAvatarProps["video"];
|
|
10
|
-
class?: string | null | undefined;
|
|
11
|
-
};
|
|
12
|
-
events: {
|
|
13
|
-
click: MouseEvent;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
type QAvatarProps_ = typeof __propDef.props;
|
|
22
|
-
export { QAvatarProps_ as QAvatarProps };
|
|
23
|
-
export type QAvatarEvents = typeof __propDef.events;
|
|
24
|
-
export type QAvatarSlots = typeof __propDef.slots;
|
|
25
|
-
export default class QAvatar extends SvelteComponent<QAvatarProps, QAvatarEvents, QAvatarSlots> {
|
|
26
|
-
}
|
|
2
|
+
declare const QAvatar: import("svelte").Component<QAvatarProps, {}, "">;
|
|
3
|
+
export default QAvatar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { QComponentDocs } from "../../utils";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const QAvatarDocs: QComponentDocs;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QAvatarDocsProps } from "./docs.props";
|
|
2
|
-
export
|
|
2
|
+
export const QAvatarDocs = {
|
|
3
3
|
name: "QAvatar",
|
|
4
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
5
|
docs: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// AUTO GENERATED FILE - DO NOT MODIFY OR DELETE
|
|
2
|
-
// @quaffHash
|
|
2
|
+
// @quaffHash 1e0adf78358181054a99b1cbccf54f26
|
|
3
3
|
export const QAvatarDocsProps = [
|
|
4
4
|
{
|
|
5
5
|
name: "shape",
|
|
@@ -7,7 +7,7 @@ export const QAvatarDocsProps = [
|
|
|
7
7
|
optional: true,
|
|
8
8
|
clickableType: true,
|
|
9
9
|
description: "Shape of the avatar.",
|
|
10
|
-
default: "circle",
|
|
10
|
+
default: '"circle"',
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
name: "size",
|
|
@@ -15,14 +15,14 @@ export const QAvatarDocsProps = [
|
|
|
15
15
|
optional: true,
|
|
16
16
|
clickableType: true,
|
|
17
17
|
description: 'Size of the avatar, can be a custom size using CSS units. If no unit is specified, "px" will be used.',
|
|
18
|
-
default: "md",
|
|
18
|
+
default: '"md"',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: "src",
|
|
22
22
|
type: "string",
|
|
23
23
|
optional: true,
|
|
24
24
|
clickableType: false,
|
|
25
|
-
description: "Source of the image to
|
|
25
|
+
description: "Source of the image to be used as the avatar. Can be a url or a path to a local file.",
|
|
26
26
|
default: "undefined",
|
|
27
27
|
},
|
|
28
28
|
{
|
|
@@ -30,7 +30,23 @@ export const QAvatarDocsProps = [
|
|
|
30
30
|
type: "boolean",
|
|
31
31
|
optional: true,
|
|
32
32
|
clickableType: false,
|
|
33
|
-
description: 'If set to true,
|
|
33
|
+
description: 'If set to true, the "src" prop will be used as a video source.',
|
|
34
34
|
default: "false",
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
name: "alt",
|
|
38
|
+
type: "string",
|
|
39
|
+
optional: true,
|
|
40
|
+
clickableType: false,
|
|
41
|
+
description: "alt property for the image.",
|
|
42
|
+
default: "undefined",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "videoAccessibility",
|
|
46
|
+
type: "Snippet",
|
|
47
|
+
optional: true,
|
|
48
|
+
clickableType: true,
|
|
49
|
+
description: "Accessibility controls you might want to add inside the <video> element.\nFor example, you might want to add a <p> tag in case the video player doesn't work.",
|
|
50
|
+
default: "undefined",
|
|
51
|
+
},
|
|
36
52
|
];
|