@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/dist/helpers/ripple.js
CHANGED
|
@@ -4,18 +4,25 @@ export function ripple(el, options = {}) {
|
|
|
4
4
|
const rippleContainer = document.createElement("div");
|
|
5
5
|
addClasses();
|
|
6
6
|
setOptions(options);
|
|
7
|
-
el.appendChild(rippleContainer);
|
|
8
7
|
function addClasses(center) {
|
|
9
|
-
|
|
8
|
+
const shouldBeCentered = center || options.center;
|
|
10
9
|
if (!rippleContainer.classList.contains("q-ripple--effect")) {
|
|
11
10
|
rippleContainer.classList.add("q-ripple--effect");
|
|
12
11
|
}
|
|
13
12
|
if (!shouldBeCentered && rippleContainer.classList.contains("q-ripple--center")) {
|
|
14
13
|
rippleContainer.classList.remove("q-ripple--center");
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
if (shouldBeCentered) {
|
|
16
|
+
rippleContainer.classList.add("q-ripple--center");
|
|
17
|
+
}
|
|
17
18
|
}
|
|
18
19
|
function setOptions(options) {
|
|
20
|
+
if (options.disabled || el.hasAttribute("aria-disabled")) {
|
|
21
|
+
rippleContainer.remove();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
el.appendChild(rippleContainer);
|
|
25
|
+
}
|
|
19
26
|
if (options.duration && options.duration < 0) {
|
|
20
27
|
options.duration = undefined;
|
|
21
28
|
}
|
|
@@ -27,8 +34,9 @@ export function ripple(el, options = {}) {
|
|
|
27
34
|
}
|
|
28
35
|
}
|
|
29
36
|
function createRipple(e, center) {
|
|
30
|
-
if (options.
|
|
37
|
+
if (options.disabled || el.hasAttribute("aria-disabled")) {
|
|
31
38
|
return;
|
|
39
|
+
}
|
|
32
40
|
if (e instanceof KeyboardEvent) {
|
|
33
41
|
if (!["Enter", "Space"].includes(e.code) || e.repeat) {
|
|
34
42
|
return;
|
|
@@ -56,8 +64,9 @@ export function ripple(el, options = {}) {
|
|
|
56
64
|
ripple.style.width = ripple.style.height = `${radius * 2}px`;
|
|
57
65
|
rippleContainer.appendChild(ripple);
|
|
58
66
|
function removeRipple() {
|
|
59
|
-
if (ripple === null)
|
|
67
|
+
if (ripple === null) {
|
|
60
68
|
return;
|
|
69
|
+
}
|
|
61
70
|
ripple.style.opacity = "0";
|
|
62
71
|
setTimeout(() => {
|
|
63
72
|
ripple.remove();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.1.0-
|
|
1
|
+
declare const _default: "0.1.0-prealpha19";
|
|
2
2
|
export default _default;
|
package/dist/helpers/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default "0.1.0-
|
|
1
|
+
export default "0.1.0-prealpha19";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/stores/index.d.ts
CHANGED
package/dist/stores/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./Quaff";
|
|
1
|
+
"use strict";
|
package/dist/utils/clipboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export async function copy(text) {
|
|
2
2
|
if (navigator.clipboard.write) {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const blob = new Blob([text], { type: "text/plain" });
|
|
4
|
+
const item = new ClipboardItem({ "text/plain": blob });
|
|
5
5
|
await navigator.clipboard.write([item]);
|
|
6
6
|
}
|
|
7
7
|
else {
|
package/dist/utils/colors.d.ts
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
export type Mode = "light" | "dark";
|
|
2
|
+
export type HexValue = `#${string}`;
|
|
3
|
+
type BaseColorNames = [
|
|
4
|
+
"error",
|
|
5
|
+
"error-container",
|
|
6
|
+
"neutral",
|
|
7
|
+
"neutral-container",
|
|
8
|
+
"neutral-variant",
|
|
9
|
+
"neutral-variant-container",
|
|
10
|
+
"on-error",
|
|
11
|
+
"on-error-container",
|
|
12
|
+
"on-neutral",
|
|
13
|
+
"on-neutral-container",
|
|
14
|
+
"on-neutral-variant",
|
|
15
|
+
"on-neutral-variant-container",
|
|
16
|
+
"on-primary",
|
|
17
|
+
"on-primary-container",
|
|
18
|
+
"on-secondary",
|
|
19
|
+
"on-secondary-container",
|
|
20
|
+
"on-tertiary",
|
|
21
|
+
"on-tertiary-container",
|
|
22
|
+
"primary",
|
|
23
|
+
"primary-container",
|
|
24
|
+
"secondary",
|
|
25
|
+
"secondary-container",
|
|
26
|
+
"tertiary",
|
|
27
|
+
"tertiary-container"
|
|
28
|
+
];
|
|
29
|
+
type BaseColors = Record<BaseColorNames[number], HexValue>;
|
|
30
|
+
type ToneColorNames = [
|
|
31
|
+
"background",
|
|
32
|
+
"inverse-on-surface",
|
|
33
|
+
"inverse-primary",
|
|
34
|
+
"inverse-surface",
|
|
35
|
+
"on-background",
|
|
36
|
+
"on-primary-fixed",
|
|
37
|
+
"on-primary-fixed-variant",
|
|
38
|
+
"on-secondary-fixed",
|
|
39
|
+
"on-secondary-fixed-variant",
|
|
40
|
+
"on-surface",
|
|
41
|
+
"on-surface-variant",
|
|
42
|
+
"on-tertiary-fixed",
|
|
43
|
+
"on-tertiary-fixed-variant",
|
|
44
|
+
"outline",
|
|
45
|
+
"outline-variant",
|
|
46
|
+
"primary-fixed",
|
|
47
|
+
"primary-fixed-dim",
|
|
48
|
+
"scrim",
|
|
49
|
+
"secondary-fixed",
|
|
50
|
+
"secondary-fixed-dim",
|
|
51
|
+
"shadow",
|
|
52
|
+
"surface",
|
|
53
|
+
"surface-bright",
|
|
54
|
+
"surface-container",
|
|
55
|
+
"surface-container-high",
|
|
56
|
+
"surface-container-highest",
|
|
57
|
+
"surface-container-low",
|
|
58
|
+
"surface-container-lowest",
|
|
59
|
+
"surface-dim",
|
|
60
|
+
"surface-tint",
|
|
61
|
+
"surface-variant",
|
|
62
|
+
"tertiary-fixed",
|
|
63
|
+
"tertiary-fixed-dim"
|
|
64
|
+
];
|
|
65
|
+
type ToneColors = Record<ToneColorNames[number], HexValue>;
|
|
66
|
+
export type QuaffColorNames = [...BaseColorNames, ...ToneColorNames];
|
|
67
|
+
export type QuaffColors = BaseColors & ToneColors;
|
|
68
|
+
export declare function generateColors(from: string): {
|
|
69
|
+
light: QuaffColors;
|
|
70
|
+
dark: QuaffColors;
|
|
71
|
+
};
|
|
1
72
|
declare class QColors {
|
|
2
73
|
private static hexRegex;
|
|
3
74
|
private static isValidRgb;
|
package/dist/utils/colors.js
CHANGED
|
@@ -1,10 +1,88 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { argbFromHex, hexFromArgb, themeFromSourceColor, } from "@material/material-color-utilities";
|
|
2
|
+
import { isNumeric } from "./number.js";
|
|
3
|
+
import { convertCase } from "./string.js";
|
|
4
|
+
const COLOR_TONES = {
|
|
5
|
+
background: { fromColor: "neutral", light: 98, dark: 6 },
|
|
6
|
+
"inverse-on-surface": { fromColor: "neutral", light: 95, dark: 20 },
|
|
7
|
+
"inverse-primary": { fromColor: "primary", light: 80, dark: 40 },
|
|
8
|
+
"inverse-surface": { fromColor: "neutral", light: 20, dark: 90 },
|
|
9
|
+
"on-background": { fromColor: "neutral", light: 10, dark: 90 },
|
|
10
|
+
"on-primary-fixed": { fromColor: "primary", light: 10, dark: 10 },
|
|
11
|
+
"on-primary-fixed-variant": { fromColor: "primary", light: 30, dark: 30 },
|
|
12
|
+
"on-secondary-fixed": { fromColor: "secondary", light: 10, dark: 10 },
|
|
13
|
+
"on-secondary-fixed-variant": { fromColor: "secondary", light: 30, dark: 30 },
|
|
14
|
+
"on-surface": { fromColor: "neutral", light: 10, dark: 90 },
|
|
15
|
+
"on-surface-variant": { fromColor: "neutralVariant", light: 30, dark: 80 },
|
|
16
|
+
"on-tertiary-fixed": { fromColor: "tertiary", light: 10, dark: 10 },
|
|
17
|
+
"on-tertiary-fixed-variant": { fromColor: "tertiary", light: 30, dark: 30 },
|
|
18
|
+
outline: { fromColor: "neutralVariant", light: 50, dark: 60 },
|
|
19
|
+
"outline-variant": { fromColor: "neutralVariant", light: 80, dark: 30 },
|
|
20
|
+
"primary-fixed": { fromColor: "primary", light: 90, dark: 90 },
|
|
21
|
+
"primary-fixed-dim": { fromColor: "primary", light: 80, dark: 80 },
|
|
22
|
+
scrim: { fromColor: "neutral", light: 0, dark: 0 },
|
|
23
|
+
"secondary-fixed": { fromColor: "secondary", light: 90, dark: 90 },
|
|
24
|
+
"secondary-fixed-dim": { fromColor: "secondary", light: 80, dark: 80 },
|
|
25
|
+
shadow: { fromColor: "neutral", light: 0, dark: 0 },
|
|
26
|
+
surface: { fromColor: "neutral", light: 98, dark: 6 },
|
|
27
|
+
"surface-bright": { fromColor: "neutral", light: 98, dark: 24 },
|
|
28
|
+
"surface-container": { fromColor: "neutral", light: 94, dark: 12 },
|
|
29
|
+
"surface-container-high": { fromColor: "neutral", light: 92, dark: 17 },
|
|
30
|
+
"surface-container-highest": { fromColor: "neutral", light: 90, dark: 22 },
|
|
31
|
+
"surface-container-low": { fromColor: "neutral", light: 96, dark: 10 },
|
|
32
|
+
"surface-container-lowest": { fromColor: "neutral", light: 100, dark: 4 },
|
|
33
|
+
"surface-dim": { fromColor: "neutral", light: 87, dark: 6 },
|
|
34
|
+
"surface-tint": { fromColor: "primary", light: 40, dark: 80 },
|
|
35
|
+
"surface-variant": { fromColor: "neutral", light: 90, dark: 30 },
|
|
36
|
+
"tertiary-fixed": { fromColor: "tertiary", light: 90, dark: 90 },
|
|
37
|
+
"tertiary-fixed-dim": { fromColor: "tertiary", light: 80, dark: 80 },
|
|
38
|
+
};
|
|
39
|
+
export function generateColors(from) {
|
|
40
|
+
const argb = argbFromHex(from);
|
|
41
|
+
const palettes = themeFromSourceColor(argb).palettes;
|
|
42
|
+
return {
|
|
43
|
+
light: getColors(palettes, "light"),
|
|
44
|
+
dark: getColors(palettes, "dark"),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getColors(palettes, mode) {
|
|
48
|
+
const tones = mode === "light"
|
|
49
|
+
? {
|
|
50
|
+
base: 40,
|
|
51
|
+
onBase: 100,
|
|
52
|
+
baseContainer: 90,
|
|
53
|
+
onBaseContainer: 10,
|
|
54
|
+
}
|
|
55
|
+
: {
|
|
56
|
+
base: 80,
|
|
57
|
+
onBase: 20,
|
|
58
|
+
baseContainer: 30,
|
|
59
|
+
onBaseContainer: 90,
|
|
60
|
+
};
|
|
61
|
+
const getColor = (color, palette) => {
|
|
62
|
+
color = convertCase(color, "pascal", "kebab");
|
|
63
|
+
return [
|
|
64
|
+
[color, palette.tone(tones.base)],
|
|
65
|
+
[`on-${color}`, palette.tone(tones.onBase)],
|
|
66
|
+
[`${color}-container`, palette.tone(tones.baseContainer)],
|
|
67
|
+
[`on-${color}-container`, palette.tone(tones.onBaseContainer)],
|
|
68
|
+
];
|
|
69
|
+
};
|
|
70
|
+
const results = Object.fromEntries(Object.entries(palettes)
|
|
71
|
+
.map(([color, palette]) => getColor(color, palette))
|
|
72
|
+
.flat(1));
|
|
73
|
+
let toneColor;
|
|
74
|
+
for (toneColor in COLOR_TONES) {
|
|
75
|
+
const toneInfo = COLOR_TONES[toneColor];
|
|
76
|
+
results[toneColor] = palettes[toneInfo.fromColor].tone(toneInfo[mode]);
|
|
77
|
+
}
|
|
78
|
+
return Object.fromEntries(Object.entries(results).map(([color, value]) => [color, hexFromArgb(value)]));
|
|
79
|
+
}
|
|
2
80
|
class QColors {
|
|
3
81
|
static hexRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
4
82
|
static isValidRgb(r, g, b) {
|
|
5
|
-
return (
|
|
6
|
-
|
|
7
|
-
|
|
83
|
+
return (isNumeric(r) &&
|
|
84
|
+
isNumeric(g) &&
|
|
85
|
+
isNumeric(b) &&
|
|
8
86
|
+r >= 0 &&
|
|
9
87
|
+r <= 255 &&
|
|
10
88
|
+g >= 0 &&
|
|
@@ -13,9 +91,9 @@ class QColors {
|
|
|
13
91
|
+b <= 255);
|
|
14
92
|
}
|
|
15
93
|
static isValidHsl(h, s, l) {
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
|
|
94
|
+
return (isNumeric(h) &&
|
|
95
|
+
isNumeric(s) &&
|
|
96
|
+
isNumeric(l) &&
|
|
19
97
|
+h >= 0 &&
|
|
20
98
|
+h <= 360 &&
|
|
21
99
|
+s >= 0 &&
|
|
@@ -42,9 +120,12 @@ class QColors {
|
|
|
42
120
|
if (!QColors.isValidRgb(r, g, b)) {
|
|
43
121
|
throw new Error("Invalid RGB values. They should be in the range 0-255.");
|
|
44
122
|
}
|
|
45
|
-
|
|
123
|
+
r = +r / 255;
|
|
124
|
+
g = +g / 255;
|
|
125
|
+
b = +b / 255;
|
|
46
126
|
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
47
|
-
|
|
127
|
+
const l = (max + min) / 2;
|
|
128
|
+
let h, s;
|
|
48
129
|
if (max === min) {
|
|
49
130
|
h = s = 0; // achromatic
|
|
50
131
|
}
|
|
@@ -72,22 +153,29 @@ class QColors {
|
|
|
72
153
|
throw new Error("Invalid HSL values. Hue should be in the range 0-360, saturation and lightness in the range 0-100.");
|
|
73
154
|
}
|
|
74
155
|
let r, g, b;
|
|
75
|
-
|
|
156
|
+
h = +h / 360;
|
|
157
|
+
s = +s / 100;
|
|
158
|
+
l = +l / 100;
|
|
76
159
|
if (s === 0) {
|
|
77
160
|
r = g = b = l; // achromatic
|
|
78
161
|
}
|
|
79
162
|
else {
|
|
80
163
|
const hue2rgb = (p, q, t) => {
|
|
81
|
-
if (t < 0)
|
|
164
|
+
if (t < 0) {
|
|
82
165
|
t += 1;
|
|
83
|
-
|
|
166
|
+
}
|
|
167
|
+
if (t > 1) {
|
|
84
168
|
t -= 1;
|
|
85
|
-
|
|
169
|
+
}
|
|
170
|
+
if (t < 1 / 6) {
|
|
86
171
|
return p + (q - p) * 6 * t;
|
|
87
|
-
|
|
172
|
+
}
|
|
173
|
+
if (t < 1 / 2) {
|
|
88
174
|
return q;
|
|
89
|
-
|
|
175
|
+
}
|
|
176
|
+
if (t < 2 / 3) {
|
|
90
177
|
return p + (q - p) * (2 / 3 - t) * 6;
|
|
178
|
+
}
|
|
91
179
|
return p;
|
|
92
180
|
};
|
|
93
181
|
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
package/dist/utils/dom.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ export declare function getClosestFocusableChild(el: HTMLElement): HTMLElement;
|
|
|
7
7
|
export declare function getClosestFocusableSibling<T extends HTMLElement>(el: T, direction: Direction): HTMLElement;
|
|
8
8
|
export declare function getClosestFocusableBlock(el: HTMLElement, direction: Direction): HTMLElement;
|
|
9
9
|
export declare function movementDirection(from: HTMLElement, to: HTMLElement): Direction;
|
|
10
|
+
export declare function shouldReduceMotion(): boolean;
|
|
11
|
+
export declare function elFromSelector<T extends HTMLElement>(selector: string | T | null | typeof window | Document): Document | (Window & typeof globalThis) | T | null;
|
package/dist/utils/dom.js
CHANGED
|
@@ -21,14 +21,14 @@ export function getFocusableChildren(el) {
|
|
|
21
21
|
return Array.from(el.querySelectorAll(focusableElements));
|
|
22
22
|
}
|
|
23
23
|
export function getClosestFocusableChild(el) {
|
|
24
|
-
|
|
24
|
+
const children = Array.from(el.querySelectorAll(focusableElements));
|
|
25
25
|
const focusableChildren = children.filter(isFocusable);
|
|
26
26
|
return focusableChildren[0] || null;
|
|
27
27
|
}
|
|
28
28
|
export function getClosestFocusableSibling(el, direction) {
|
|
29
29
|
const parent = getParentElement(el);
|
|
30
30
|
const allSiblings = Array.from(parent.childNodes);
|
|
31
|
-
|
|
31
|
+
const filtered = allSiblings.filter(isFocusable);
|
|
32
32
|
const indexOfEl = filtered.indexOf(el);
|
|
33
33
|
if (direction === "next") {
|
|
34
34
|
const i = indexOfEl + 1 === filtered.length ? 0 : indexOfEl + 1;
|
|
@@ -48,8 +48,8 @@ export function getClosestFocusableSibling(el, direction) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
export function getClosestFocusableBlock(el, direction) {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const parent = getParentElement(el);
|
|
52
|
+
const parentFocusableChildren = getFocusableChildren(parent);
|
|
53
53
|
function getNextFocusableBlock(parentBlock) {
|
|
54
54
|
const grandParent = getParentElement(parentBlock);
|
|
55
55
|
const grandParentChildren = getAllChildren(grandParent);
|
|
@@ -73,3 +73,9 @@ export function movementDirection(from, to) {
|
|
|
73
73
|
const relativePosition = from.compareDocumentPosition(to);
|
|
74
74
|
return relativePosition === 2 ? "previous" : "next";
|
|
75
75
|
}
|
|
76
|
+
export function shouldReduceMotion() {
|
|
77
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
78
|
+
}
|
|
79
|
+
export function elFromSelector(selector) {
|
|
80
|
+
return typeof selector === "string" ? document.querySelector(selector) : selector;
|
|
81
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function isNumeric(input) {
|
|
2
|
+
return typeof input === "number" || !isNaN(Number(input));
|
|
3
|
+
}
|
|
4
|
+
export function between(value, min, max) {
|
|
5
|
+
if (max < min) {
|
|
6
|
+
console.warn(`max (${max}) should not be smaller than min (${min}).`);
|
|
7
|
+
}
|
|
8
|
+
return max <= min ? min : Math.min(max, Math.max(min, value));
|
|
9
|
+
}
|
package/dist/utils/props.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ interface CreateClassesOptions {
|
|
|
3
3
|
component?: string;
|
|
4
4
|
element?: string;
|
|
5
5
|
userClasses?: string | null;
|
|
6
|
-
quaffClasses?:
|
|
6
|
+
quaffClasses?: unknown[];
|
|
7
7
|
}
|
|
8
|
-
export declare function createClasses(modifiers:
|
|
8
|
+
export declare function createClasses(modifiers: unknown[], options?: CreateClassesOptions): string;
|
|
9
9
|
export {};
|
package/dist/utils/props.js
CHANGED
|
@@ -2,14 +2,15 @@ import { convertCase } from "./string";
|
|
|
2
2
|
export function createStyles(styleObj, userStyles) {
|
|
3
3
|
const stylesArray = Object.entries(styleObj);
|
|
4
4
|
const toJoin = [];
|
|
5
|
-
for (
|
|
5
|
+
for (const [styleName, styleVal] of stylesArray) {
|
|
6
6
|
if (styleVal === undefined || styleVal === null || styleVal === false) {
|
|
7
7
|
continue;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
toJoin.push(`${convertCase(styleName, "camel", "kebab")}: ${styleVal}`);
|
|
10
|
+
}
|
|
11
|
+
if (userStyles) {
|
|
12
|
+
toJoin.push(userStyles);
|
|
11
13
|
}
|
|
12
|
-
userStyles && toJoin.push(userStyles);
|
|
13
14
|
if (toJoin.length === 0) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -19,12 +20,13 @@ export function createClasses(modifiers, options = { userClasses: "", quaffClass
|
|
|
19
20
|
const userClasses = options.userClasses?.trim();
|
|
20
21
|
const quaffClasses = options.quaffClasses?.length && createClasses(options.quaffClasses);
|
|
21
22
|
const baseClasses = `${quaffClasses || ""} ${userClasses || ""}`.trim();
|
|
22
|
-
|
|
23
|
+
const component = options.component;
|
|
24
|
+
let element;
|
|
23
25
|
if (component && options.element) {
|
|
24
26
|
element = `${component}__${options.element}`;
|
|
25
27
|
}
|
|
26
28
|
const filteredModifiers = modifiers.filter(Boolean);
|
|
27
|
-
|
|
29
|
+
const withModifiers = component
|
|
28
30
|
? filteredModifiers.map((modifier) => `${element || component}--${modifier}`)
|
|
29
31
|
: filteredModifiers;
|
|
30
32
|
return [element || component, ...withModifiers, baseClasses].filter(Boolean).join(" ").trim();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Readable } from "svelte/store";
|
|
2
|
+
export interface RouterProps {
|
|
3
|
+
activeClass?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
href?: string;
|
|
6
|
+
replace?: boolean;
|
|
7
|
+
to?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const isRouteActive: Readable<(route?: string) => boolean>;
|
|
10
|
+
export declare function getRouterInfo<T extends RouterProps>(props: T): {
|
|
11
|
+
hasLink: boolean;
|
|
12
|
+
linkAttributes: {
|
|
13
|
+
href: string | undefined;
|
|
14
|
+
"data-sveltekit-reload": boolean | undefined;
|
|
15
|
+
};
|
|
16
|
+
linkClasses: string;
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { derived } from "svelte/store";
|
|
2
|
+
import { page } from "$app/stores";
|
|
3
|
+
export const isRouteActive = derived(page, ($page) => {
|
|
4
|
+
return (route) => {
|
|
5
|
+
if (!route) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
return $page.url.pathname === route || $page.url.pathname.startsWith(`${route}/`);
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
export function getRouterInfo(props) {
|
|
12
|
+
const hasLink = [props.to, props.href].some((entry) => entry !== undefined);
|
|
13
|
+
const linkClasses = `${hasLink ? "q-link" : ""} ${props.disabled ? "disabled" : ""}`.trim();
|
|
14
|
+
const linkAttributes = {
|
|
15
|
+
href: props.to || props.href,
|
|
16
|
+
"data-sveltekit-reload": props.replace ? true : undefined,
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
hasLink,
|
|
20
|
+
linkAttributes,
|
|
21
|
+
linkClasses,
|
|
22
|
+
};
|
|
23
|
+
}
|
package/dist/utils/string.d.ts
CHANGED
package/dist/utils/string.js
CHANGED
|
@@ -31,6 +31,7 @@ function convertToKebabSnakeCase(str, caseType) {
|
|
|
31
31
|
.join("");
|
|
32
32
|
}
|
|
33
33
|
export function convertCase(str, fromCase, toCase) {
|
|
34
|
+
const uncap = uncapitalize(str);
|
|
34
35
|
switch (fromCase) {
|
|
35
36
|
case "camel":
|
|
36
37
|
if (toCase === "pascal") {
|
|
@@ -41,7 +42,6 @@ export function convertCase(str, fromCase, toCase) {
|
|
|
41
42
|
}
|
|
42
43
|
break;
|
|
43
44
|
case "pascal":
|
|
44
|
-
let uncap = uncapitalize(str);
|
|
45
45
|
if (toCase === "camel") {
|
|
46
46
|
return uncap;
|
|
47
47
|
}
|
|
@@ -76,3 +76,6 @@ export function convertCase(str, fromCase, toCase) {
|
|
|
76
76
|
}
|
|
77
77
|
return str;
|
|
78
78
|
}
|
|
79
|
+
export function extractImgSrc(prop) {
|
|
80
|
+
return prop?.startsWith("img:") ? prop.slice(4) : undefined;
|
|
81
|
+
}
|
package/dist/utils/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface QComponentDocs {
|
|
|
19
19
|
export interface QComponentProp {
|
|
20
20
|
name: string;
|
|
21
21
|
type: string;
|
|
22
|
-
default?:
|
|
22
|
+
default?: unknown;
|
|
23
23
|
description: string;
|
|
24
24
|
clickableType?: boolean;
|
|
25
25
|
optional?: boolean;
|
|
@@ -42,4 +42,9 @@ export interface QComponentMethod {
|
|
|
42
42
|
type: string;
|
|
43
43
|
description: string;
|
|
44
44
|
}
|
|
45
|
-
export
|
|
45
|
+
export type Entries<T> = {
|
|
46
|
+
[K in keyof T]: [K, T[K]];
|
|
47
|
+
}[keyof T][];
|
|
48
|
+
export type QEvent<T, E> = T & {
|
|
49
|
+
currentTarget: EventTarget & E;
|
|
50
|
+
};
|
package/dist/utils/types.js
CHANGED
package/dist/utils/types.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"QAvatarShapeOptions": "type QAvatarShapeOptions =\n | \"circle\"\n | \"rounded\"\n | \"top-round\"\n | \"left-round\"\n | \"right-round\"\n | \"bottom-round\"\n | \"top-left-round\"\n | \"top-right-round\"\n | \"bottom-left-round\"\n | \"bottom-right-round\"",
|
|
3
|
-
"QAvatarSizeOptions": "type QAvatarSizeOptions =
|
|
4
|
-
"QBreadcrumbsGutterOptions": "type QBreadcrumbsGutterOptions =
|
|
5
|
-
"
|
|
3
|
+
"QAvatarSizeOptions": "type QAvatarSizeOptions = Q.Size | Q.CssValue | number",
|
|
4
|
+
"QBreadcrumbsGutterOptions": "type QBreadcrumbsGutterOptions = Exclude<Q.Size, \"xs\" | \"xl\">",
|
|
5
|
+
"QBtnDesignOptions": "type QBtnDesignOptions = \"elevated\" | \"filled\" | \"tonal\" | \"outlined\" | \"flat\"",
|
|
6
|
+
"QBtnSizeOptions": "type QBtnSizeOptions = Exclude<Q.Size, \"xs\">",
|
|
6
7
|
"QCardFillColors": "type QCardFillColors = \"primary\" | \"secondary\" | \"tertiary\"",
|
|
7
|
-
"
|
|
8
|
+
"QChipFillOptions": "type QChipFillOptions =\n | \"primary\"\n | \"secondary\"\n | \"tertiary\"\n | \"neutral\"\n | \"neutral-variant\"\n | \"error\"",
|
|
9
|
+
"QChipKindOptions": "type QChipKindOptions = \"assist\" | \"filter\" | \"input\" | \"suggestion\"",
|
|
10
|
+
"QChipSizeOptions": "type QChipSizeOptions = Exclude<Q.Size, \"xs\" | \"xl\" | \"none\">",
|
|
8
11
|
"QDialogPositionOptions": "type QDialogPositionOptions = \"default\" | \"top\" | \"right\" | \"bottom\" | \"left\"",
|
|
9
12
|
"QDrawerBehaviorOptions": "type QDrawerBehaviorOptions = \"default\" | \"desktop\" | \"mobile\"",
|
|
10
13
|
"QDrawerSideOptions": "type QDrawerSideOptions = \"left\" | \"right\"",
|
|
11
|
-
"QIconSizeOptions": "type QIconSizeOptions =
|
|
14
|
+
"QIconSizeOptions": "type QIconSizeOptions = Q.Size | Q.CssValue | number",
|
|
12
15
|
"QIconTypeOptions": "type QIconTypeOptions = \"outlined\" | \"sharp\" | \"rounded\"",
|
|
13
16
|
"QItemSectionTypes": "type QItemSectionTypes =\n | \"thumbnail\"\n | \"video\"\n | \"avatar\"\n | \"toggle\"\n | \"icon\"\n | \"trailingIcon\"\n | \"trailingText\"\n | \"content\"",
|
|
14
17
|
"QLayoutEvents": "type QLayoutEvents = \"resize\" | \"scroll\" | \"scrollHeight\"",
|
package/dist/utils/watchable.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { derived, writable } from "svelte/store";
|
|
2
2
|
export function watchable(value) {
|
|
3
|
-
|
|
3
|
+
const values = writable([value, null]);
|
|
4
4
|
const subscribe = derived(values, ($values) => $values[0]).subscribe;
|
|
5
5
|
const update = (fn, isEqual = (a, b) => a === b) => {
|
|
6
6
|
values.update(($values) => {
|