@quaffui/quaff 0.1.0-prealpha15 → 0.1.0-prealpha16
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/dist/components/avatar/QAvatar.svelte +13 -3
- package/dist/components/avatar/docs.d.ts +1 -1
- package/dist/components/avatar/docs.js +1 -1
- package/dist/components/breadcrumbs/QBreadcrumbs.svelte +1 -2
- package/dist/components/breadcrumbs/QBreadcrumbsEl.svelte +5 -7
- package/dist/components/breadcrumbs/docs.d.ts +1 -1
- package/dist/components/breadcrumbs/docs.js +1 -1
- package/dist/components/button/QBtn.svelte +4 -1
- package/dist/components/button/docs.d.ts +1 -1
- package/dist/components/button/docs.js +1 -1
- package/dist/components/button/index.scss +6 -1
- package/dist/components/card/QCard.svelte +1 -1
- package/dist/components/card/QCardSection.svelte +2 -2
- package/dist/components/card/docs.d.ts +3 -3
- package/dist/components/card/docs.js +3 -3
- package/dist/components/checkbox/QCheckbox.svelte +1 -5
- package/dist/components/checkbox/docs.d.ts +1 -1
- package/dist/components/checkbox/docs.js +1 -1
- package/dist/components/chip/QChip.svelte +4 -1
- package/dist/components/chip/docs.d.ts +1 -1
- package/dist/components/chip/docs.js +1 -1
- package/dist/components/codeBlock/QCodeBlock.svelte +8 -12
- package/dist/components/codeBlock/QCodeBlock.svelte.d.ts +1 -0
- package/dist/components/codeBlock/docs.props.js +2 -2
- package/dist/components/codeBlock/props.d.ts +1 -1
- package/dist/components/dialog/docs.d.ts +1 -1
- package/dist/components/dialog/docs.js +1 -1
- package/dist/components/drawer/QDrawer.svelte +1 -4
- package/dist/components/drawer/QDrawer.svelte.d.ts +0 -7
- package/dist/components/drawer/docs.d.ts +1 -1
- package/dist/components/drawer/docs.js +1 -1
- package/dist/components/footer/QFooter.svelte +7 -5
- package/dist/components/footer/docs.d.ts +1 -1
- package/dist/components/footer/docs.js +1 -1
- package/dist/components/icon/docs.d.ts +1 -1
- package/dist/components/icon/docs.js +1 -1
- package/dist/components/icon/docs.props.js +3 -3
- package/dist/components/icon/props.d.ts +2 -2
- package/dist/components/input/docs.d.ts +1 -1
- package/dist/components/input/docs.js +1 -1
- package/dist/components/layout/docs.d.ts +1 -1
- package/dist/components/layout/docs.js +1 -1
- package/dist/components/list/QItemSection.svelte +1 -4
- package/dist/components/list/QList.svelte +6 -5
- package/dist/components/list/docs.d.ts +1 -1
- package/dist/components/list/docs.js +1 -1
- package/dist/components/list/docs.props.js +1 -1
- package/dist/components/list/props.d.ts +1 -1
- package/dist/components/list/props.js +1 -1
- package/dist/components/private/QApi.svelte +14 -7
- package/dist/components/private/QApi.svelte.d.ts +1 -1
- package/dist/components/private/QDocs.svelte +3 -13
- package/dist/components/private/QDocs.svelte.d.ts +1 -1
- package/dist/components/private/QDocsSection.svelte +5 -13
- package/dist/components/private/QDocsSection.svelte.d.ts +7 -17
- package/dist/components/progress/docs.d.ts +1 -1
- package/dist/components/progress/docs.js +1 -1
- 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/props.d.ts +1 -1
- package/dist/components/railbar/docs.d.ts +1 -1
- package/dist/components/railbar/docs.js +1 -1
- package/dist/components/select/docs.d.ts +1 -1
- package/dist/components/select/docs.js +1 -1
- package/dist/components/separator/docs.d.ts +1 -1
- package/dist/components/separator/docs.js +1 -1
- package/dist/components/table/docs.d.ts +1 -1
- package/dist/components/table/docs.js +1 -1
- package/dist/components/tabs/QTab.svelte +2 -7
- package/dist/components/tabs/QTabs.svelte +2 -6
- package/dist/components/tabs/docs.d.ts +1 -1
- package/dist/components/tabs/docs.js +1 -1
- package/dist/components/tabs/docs.props.js +1 -1
- package/dist/components/tabs/props.js +1 -1
- package/dist/components/toggle/docs.d.ts +1 -1
- package/dist/components/toggle/docs.js +1 -1
- package/dist/components/toolbar/docs.d.ts +1 -1
- package/dist/components/toolbar/docs.js +1 -1
- package/dist/components/tooltip/docs.d.ts +1 -1
- package/dist/components/tooltip/docs.js +1 -1
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.js +3 -3
- package/dist/composables/{use-size.d.ts → useSize.d.ts} +1 -1
- package/dist/composables/{use-size.js → useSize.js} +1 -1
- package/dist/css/fonts.scss +16 -3
- package/dist/css/index.css +1 -1
- package/dist/css/ripple.scss +1 -1
- package/dist/global.d.ts +1 -1
- package/dist/helpers/clickOutside.d.ts +2 -2
- package/dist/helpers/clickOutside.js +3 -3
- package/dist/helpers/ripple.js +1 -1
- package/dist/helpers/version.d.ts +1 -1
- package/dist/helpers/version.js +1 -1
- package/dist/stores/QTheme.js +5 -6
- package/dist/stores/Quaff.js +1 -1
- package/dist/utils/clipboard.js +2 -2
- package/dist/utils/colors.js +2 -1
- package/dist/utils/dom.js +4 -4
- package/dist/utils/props.d.ts +2 -2
- package/dist/utils/props.js +5 -5
- package/dist/utils/string.js +1 -1
- package/dist/utils/types.d.ts +2 -2
- package/dist/utils/watchable.js +1 -1
- package/package.json +7 -7
- /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/ripple.scss
CHANGED
package/dist/global.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare function clickOutside(node: HTMLElement, onEventFunction: () =>
|
|
1
|
+
export declare function clickOutside(node: HTMLElement, onEventFunction: () => unknown): {
|
|
2
2
|
destroy(): void;
|
|
3
3
|
};
|
|
4
|
-
export declare function clickOutsideDialog(node: HTMLDialogElement, onEventFunction: () =>
|
|
4
|
+
export declare function clickOutsideDialog(node: HTMLDialogElement, onEventFunction: () => unknown): {
|
|
5
5
|
destroy(): void;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function clickOutside(node, onEventFunction) {
|
|
2
2
|
const handleClick = (event) => {
|
|
3
|
-
|
|
3
|
+
const path = event.composedPath();
|
|
4
4
|
if (!path.includes(node)) {
|
|
5
5
|
onEventFunction();
|
|
6
6
|
}
|
|
@@ -16,8 +16,8 @@ export function clickOutsideDialog(node, onEventFunction) {
|
|
|
16
16
|
const handleClick = (event) => {
|
|
17
17
|
if (!node.open)
|
|
18
18
|
return;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const rect = node.getBoundingClientRect();
|
|
20
|
+
const isInDialog = rect.top <= event.clientY &&
|
|
21
21
|
event.clientY <= rect.top + rect.height &&
|
|
22
22
|
rect.left <= event.clientX &&
|
|
23
23
|
event.clientX <= rect.left + rect.width;
|
package/dist/helpers/ripple.js
CHANGED
|
@@ -6,7 +6,7 @@ export function ripple(el, options = {}) {
|
|
|
6
6
|
setOptions(options);
|
|
7
7
|
el.appendChild(rippleContainer);
|
|
8
8
|
function addClasses(center) {
|
|
9
|
-
|
|
9
|
+
const shouldBeCentered = center || options.center;
|
|
10
10
|
if (!rippleContainer.classList.contains("q-ripple--effect")) {
|
|
11
11
|
rippleContainer.classList.add("q-ripple--effect");
|
|
12
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.1.0-
|
|
1
|
+
declare const _default: "0.1.0-prealpha16";
|
|
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-prealpha16";
|
package/dist/stores/QTheme.js
CHANGED
|
@@ -11,15 +11,14 @@ async function prepareThemeColors(from) {
|
|
|
11
11
|
if (from.startsWith("var(")) {
|
|
12
12
|
from = extractColorFromCssVar(from);
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//@ts-ignore
|
|
14
|
+
const theme = await materialDynamicColors(from);
|
|
16
15
|
const themeColors = {};
|
|
17
16
|
let mode;
|
|
18
17
|
for (mode in theme) {
|
|
19
18
|
let color;
|
|
20
19
|
for (color in theme[mode]) {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const colorFormatted = convertCase(color, "camel", "kebab");
|
|
21
|
+
const cssColor = `${colorFormatted}-${mode}`;
|
|
23
22
|
themeColors[cssColor] = theme[mode][color];
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -29,7 +28,7 @@ function themeBuilder() {
|
|
|
29
28
|
const { subscribe, set, update } = writable({});
|
|
30
29
|
prepareThemeColors("#3499E7").then(set);
|
|
31
30
|
const apply = () => {
|
|
32
|
-
|
|
31
|
+
const root = document.documentElement;
|
|
33
32
|
if (root === null)
|
|
34
33
|
return;
|
|
35
34
|
update(($themeColors) => {
|
|
@@ -47,7 +46,7 @@ function themeBuilder() {
|
|
|
47
46
|
});
|
|
48
47
|
};
|
|
49
48
|
const setTheme = async (from) => {
|
|
50
|
-
|
|
49
|
+
const newTheme = await prepareThemeColors(from);
|
|
51
50
|
set(newTheme);
|
|
52
51
|
apply();
|
|
53
52
|
};
|
package/dist/stores/Quaff.js
CHANGED
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.js
CHANGED
|
@@ -44,7 +44,8 @@ class QColors {
|
|
|
44
44
|
}
|
|
45
45
|
(r = +r / 255), (g = +g / 255), (b = +b / 255);
|
|
46
46
|
const max = Math.max(r, g, b), min = Math.min(r, g, b);
|
|
47
|
-
|
|
47
|
+
const l = (max + min) / 2;
|
|
48
|
+
let h, s;
|
|
48
49
|
if (max === min) {
|
|
49
50
|
h = s = 0; // achromatic
|
|
50
51
|
}
|
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);
|
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,12 +2,11 @@ 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
|
-
toJoin.push(`${styleName}: ${styleVal}`);
|
|
9
|
+
toJoin.push(`${convertCase(styleName, "camel", "kebab")}: ${styleVal}`);
|
|
11
10
|
}
|
|
12
11
|
userStyles && toJoin.push(userStyles);
|
|
13
12
|
if (toJoin.length === 0) {
|
|
@@ -19,12 +18,13 @@ export function createClasses(modifiers, options = { userClasses: "", quaffClass
|
|
|
19
18
|
const userClasses = options.userClasses?.trim();
|
|
20
19
|
const quaffClasses = options.quaffClasses?.length && createClasses(options.quaffClasses);
|
|
21
20
|
const baseClasses = `${quaffClasses || ""} ${userClasses || ""}`.trim();
|
|
22
|
-
|
|
21
|
+
const component = options.component;
|
|
22
|
+
let element;
|
|
23
23
|
if (component && options.element) {
|
|
24
24
|
element = `${component}__${options.element}`;
|
|
25
25
|
}
|
|
26
26
|
const filteredModifiers = modifiers.filter(Boolean);
|
|
27
|
-
|
|
27
|
+
const withModifiers = component
|
|
28
28
|
? filteredModifiers.map((modifier) => `${element || component}--${modifier}`)
|
|
29
29
|
: filteredModifiers;
|
|
30
30
|
return [element || component, ...withModifiers, baseClasses].filter(Boolean).join(" ").trim();
|
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
|
}
|
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,4 @@ export interface QComponentMethod {
|
|
|
42
42
|
type: string;
|
|
43
43
|
description: string;
|
|
44
44
|
}
|
|
45
|
-
export declare function isNumber(input:
|
|
45
|
+
export declare function isNumber(input: unknown): input is number;
|
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) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quaffui/quaff",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-prealpha16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"open": "vite dev --open",
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
13
13
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
14
14
|
"test:unit": "vitest",
|
|
15
|
-
"lint": "prettier --plugin-
|
|
16
|
-
"format": "prettier --plugin-
|
|
17
|
-
"docgen": "NODE_OPTIONS='--loader ts-node/esm/transpile-only --no-warnings' node
|
|
15
|
+
"lint": "prettier --plugin prettier-plugin-svelte . --check . && eslint .",
|
|
16
|
+
"format": "prettier --plugin prettier-plugin-svelte . --write .",
|
|
17
|
+
"docgen": "NODE_OPTIONS='--loader ts-node/esm/transpile-only --no-warnings' node scripts/docgenProps.ts",
|
|
18
|
+
"write-version": "NODE_OPTIONS='--loader ts-node/esm/transpile-only --no-warnings' node scripts/writeVersion.ts",
|
|
18
19
|
"snippet": "ts-node-esm docgen/snippets/parseSnippets.ts"
|
|
19
20
|
},
|
|
20
21
|
"exports": {
|
|
@@ -33,9 +34,6 @@
|
|
|
33
34
|
"svelte": "^4.0.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@fontsource/material-symbols-outlined": "^5.0.7",
|
|
37
|
-
"@fontsource/material-symbols-rounded": "^5.0.7",
|
|
38
|
-
"@fontsource/material-symbols-sharp": "^5.0.7",
|
|
39
37
|
"@fontsource/roboto": "^5.0.8",
|
|
40
38
|
"@sveltejs/adapter-auto": "^2.1.0",
|
|
41
39
|
"@sveltejs/kit": "^1.24.1",
|
|
@@ -48,6 +46,8 @@
|
|
|
48
46
|
"eslint": "^8.49.0",
|
|
49
47
|
"eslint-config-prettier": "^9.0.0",
|
|
50
48
|
"eslint-plugin-svelte": "^2.33.1",
|
|
49
|
+
"eslint-plugin-unicorn": "^48.0.1",
|
|
50
|
+
"material-symbols": "^0.12.0",
|
|
51
51
|
"prettier": "^3.0.3",
|
|
52
52
|
"prettier-plugin-svelte": "^3.0.3",
|
|
53
53
|
"publint": "^0.2.2",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|