@xaroth.nl/design 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/all.css +2536 -0
- package/dist/astro.d.ts +41 -0
- package/dist/astro.js +41 -0
- package/dist/bem.d.ts +12 -0
- package/dist/bem.js +19 -0
- package/dist/components/alert/alert.astro +46 -0
- package/dist/components/alert/alert.css +68 -0
- package/dist/components/alert/alert.d.ts +11 -0
- package/dist/components/alert/alert.js +6 -0
- package/dist/components/alert/index.d.ts +14 -0
- package/dist/components/alert/index.js +27 -0
- package/dist/components/avatar/avatar.astro +23 -0
- package/dist/components/avatar/avatar.css +35 -0
- package/dist/components/avatar/avatar.d.ts +5 -0
- package/dist/components/avatar/avatar.js +7 -0
- package/dist/components/avatar/index.d.ts +32 -0
- package/dist/components/avatar/index.js +24 -0
- package/dist/components/badge/badge.astro +11 -0
- package/dist/components/badge/badge.css +46 -0
- package/dist/components/badge/badge.d.ts +5 -0
- package/dist/components/badge/badge.js +6 -0
- package/dist/components/badge/index.d.ts +6 -0
- package/dist/components/badge/index.js +3 -0
- package/dist/components/breadcrumbs/breadcrumbs.astro +27 -0
- package/dist/components/breadcrumbs/breadcrumbs.css +33 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +9 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +11 -0
- package/dist/components/breadcrumbs/index.d.ts +37 -0
- package/dist/components/breadcrumbs/index.js +16 -0
- package/dist/components/button/button.astro +36 -0
- package/dist/components/button/button.css +117 -0
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +23 -0
- package/dist/components/button/index.d.ts +59 -0
- package/dist/components/button/index.js +26 -0
- package/dist/components/card/card.astro +98 -0
- package/dist/components/card/card.css +91 -0
- package/dist/components/card/card.d.ts +19 -0
- package/dist/components/card/card.js +7 -0
- package/dist/components/card/index.d.ts +11 -0
- package/dist/components/card/index.js +7 -0
- package/dist/components/description-list/description-list.astro +39 -0
- package/dist/components/description-list/description-list.css +72 -0
- package/dist/components/description-list/description-list.d.ts +7 -0
- package/dist/components/description-list/description-list.js +6 -0
- package/dist/components/description-list/index.d.ts +12 -0
- package/dist/components/description-list/index.js +5 -0
- package/dist/components/divider/divider.astro +27 -0
- package/dist/components/divider/divider.css +40 -0
- package/dist/components/divider/divider.d.ts +5 -0
- package/dist/components/divider/divider.js +11 -0
- package/dist/components/divider/index.d.ts +22 -0
- package/dist/components/divider/index.js +11 -0
- package/dist/components/empty-state/empty-state.astro +47 -0
- package/dist/components/empty-state/empty-state.css +38 -0
- package/dist/components/empty-state/empty-state.d.ts +12 -0
- package/dist/components/empty-state/empty-state.js +7 -0
- package/dist/components/empty-state/index.d.ts +5 -0
- package/dist/components/empty-state/index.js +3 -0
- package/dist/components/field/checkbox-group.astro +58 -0
- package/dist/components/field/checkbox.astro +17 -0
- package/dist/components/field/field.astro +51 -0
- package/dist/components/field/field.css +336 -0
- package/dist/components/field/field.d.ts +47 -0
- package/dist/components/field/field.js +51 -0
- package/dist/components/field/index.d.ts +53 -0
- package/dist/components/field/index.js +54 -0
- package/dist/components/field/input.astro +27 -0
- package/dist/components/field/radio-group.astro +58 -0
- package/dist/components/field/radio.astro +17 -0
- package/dist/components/field/select.astro +13 -0
- package/dist/components/field/switch.astro +17 -0
- package/dist/components/field/textarea.astro +24 -0
- package/dist/components/filters/filter-layout.astro +72 -0
- package/dist/components/filters/filter-panel.astro +13 -0
- package/dist/components/filters/filters.css +230 -0
- package/dist/components/filters/filters.d.ts +20 -0
- package/dist/components/filters/filters.js +24 -0
- package/dist/components/filters/index.d.ts +27 -0
- package/dist/components/filters/index.js +25 -0
- package/dist/components/footer/footer.astro +70 -0
- package/dist/components/footer/footer.css +128 -0
- package/dist/components/footer/footer.d.ts +16 -0
- package/dist/components/footer/footer.js +7 -0
- package/dist/components/footer/index.d.ts +35 -0
- package/dist/components/footer/index.js +18 -0
- package/dist/components/header/header.astro +89 -0
- package/dist/components/header/header.css +163 -0
- package/dist/components/header/header.d.ts +18 -0
- package/dist/components/header/header.js +9 -0
- package/dist/components/header/index.d.ts +39 -0
- package/dist/components/header/index.js +25 -0
- package/dist/components/icon/icon.astro +21 -0
- package/dist/components/icon/icon.css +15 -0
- package/dist/components/icon/icon.d.ts +5 -0
- package/dist/components/icon/icon.js +6 -0
- package/dist/components/icon/index.d.ts +57 -0
- package/dist/components/icon/index.js +72 -0
- package/dist/components/layout/container.astro +15 -0
- package/dist/components/layout/grid.astro +14 -0
- package/dist/components/layout/index.d.ts +33 -0
- package/dist/components/layout/index.js +13 -0
- package/dist/components/layout/layout.css +262 -0
- package/dist/components/layout/layout.d.ts +24 -0
- package/dist/components/layout/layout.js +17 -0
- package/dist/components/layout/section-head.astro +42 -0
- package/dist/components/layout/section.astro +15 -0
- package/dist/components/page-head/index.d.ts +18 -0
- package/dist/components/page-head/index.js +14 -0
- package/dist/components/page-head/page-head.astro +60 -0
- package/dist/components/page-head/page-head.css +79 -0
- package/dist/components/page-head/page-head.d.ts +18 -0
- package/dist/components/page-head/page-head.js +8 -0
- package/dist/components/pagination/index.d.ts +73 -0
- package/dist/components/pagination/index.js +87 -0
- package/dist/components/pagination/pagination.astro +81 -0
- package/dist/components/pagination/pagination.css +70 -0
- package/dist/components/pagination/pagination.d.ts +8 -0
- package/dist/components/pagination/pagination.js +19 -0
- package/dist/components/panel/index.d.ts +11 -0
- package/dist/components/panel/index.js +3 -0
- package/dist/components/panel/panel.astro +15 -0
- package/dist/components/panel/panel.css +48 -0
- package/dist/components/panel/panel.d.ts +7 -0
- package/dist/components/panel/panel.js +6 -0
- package/dist/components/progress/index.d.ts +37 -0
- package/dist/components/progress/index.js +44 -0
- package/dist/components/progress/progress.astro +18 -0
- package/dist/components/progress/progress.css +115 -0
- package/dist/components/progress/progress.d.ts +5 -0
- package/dist/components/progress/progress.js +7 -0
- package/dist/components/prose/code-block.astro +26 -0
- package/dist/components/prose/index.d.ts +14 -0
- package/dist/components/prose/index.js +67 -0
- package/dist/components/prose/prose.astro +14 -0
- package/dist/components/prose/prose.css +156 -0
- package/dist/components/prose/prose.d.ts +12 -0
- package/dist/components/prose/prose.js +11 -0
- package/dist/components/stat/index.d.ts +15 -0
- package/dist/components/stat/index.js +5 -0
- package/dist/components/stat/stat-group.astro +11 -0
- package/dist/components/stat/stat.astro +43 -0
- package/dist/components/stat/stat.css +51 -0
- package/dist/components/stat/stat.d.ts +15 -0
- package/dist/components/stat/stat.js +10 -0
- package/dist/components/table/index.d.ts +38 -0
- package/dist/components/table/index.js +18 -0
- package/dist/components/table/table.astro +111 -0
- package/dist/components/table/table.css +78 -0
- package/dist/components/table/table.d.ts +11 -0
- package/dist/components/table/table.js +10 -0
- package/dist/components/tabs/index.d.ts +21 -0
- package/dist/components/tabs/index.js +13 -0
- package/dist/components/tabs/tabs.astro +30 -0
- package/dist/components/tabs/tabs.css +59 -0
- package/dist/components/tabs/tabs.d.ts +9 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/tag/index.d.ts +19 -0
- package/dist/components/tag/index.js +7 -0
- package/dist/components/tag/tag.astro +17 -0
- package/dist/components/tag/tag.css +30 -0
- package/dist/components/tag/tag.d.ts +9 -0
- package/dist/components/tag/tag.js +12 -0
- package/dist/components/timeline/index.d.ts +22 -0
- package/dist/components/timeline/index.js +5 -0
- package/dist/components/timeline/timeline.astro +40 -0
- package/dist/components/timeline/timeline.css +92 -0
- package/dist/components/timeline/timeline.d.ts +9 -0
- package/dist/components/timeline/timeline.js +7 -0
- package/dist/components/tooltip/index.d.ts +15 -0
- package/dist/components/tooltip/index.js +41 -0
- package/dist/components/tooltip/tooltip.astro +25 -0
- package/dist/components/tooltip/tooltip.css +84 -0
- package/dist/components/tooltip/tooltip.d.ts +12 -0
- package/dist/components/tooltip/tooltip.js +34 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +6 -0
- package/dist/env.d.ts +2 -0
- package/dist/html.d.ts +37 -0
- package/dist/html.js +126 -0
- package/dist/parts.d.ts +27 -0
- package/dist/parts.js +28 -0
- package/dist/react.d.ts +27 -0
- package/dist/react.js +28 -0
- package/dist/scss/_chamfer.scss +37 -0
- package/dist/scss/_layers.scss +2 -0
- package/dist/scss/_theme.scss +15 -0
- package/dist/themes/eve-online.css +1945 -0
- package/dist/themes/xaroth.css +1974 -0
- package/dist/themes.css +3919 -0
- package/package.json +80 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import './tooltip.css';
|
|
4
|
+
import { cloneElement, isValidElement, useEffect, useRef, useState, } from 'react';
|
|
5
|
+
import { describedBy, tooltipClass, tooltipId } from "./index.js";
|
|
6
|
+
export function Tooltip({ id, text, placement, open, className, children, onPointerLeave, onFocus, onBlur, ...rest }) {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const [dismissed, setDismissed] = useState(false);
|
|
9
|
+
// Escape hides the shown tooltip (WCAG 1.4.13) until the pointer leaves or focus moves in or out.
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const onKeyDown = (event) => {
|
|
12
|
+
if (event.key === 'Escape' && ref.current?.matches(':hover, :has(:focus-visible)')) {
|
|
13
|
+
setDismissed(true);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
document.addEventListener('keydown', onKeyDown);
|
|
17
|
+
return () => document.removeEventListener('keydown', onKeyDown);
|
|
18
|
+
}, []);
|
|
19
|
+
const trigger = isValidElement(children)
|
|
20
|
+
? cloneElement(children, {
|
|
21
|
+
'aria-describedby': describedBy(children.props['aria-describedby'], id),
|
|
22
|
+
})
|
|
23
|
+
: children;
|
|
24
|
+
return (_jsxs("span", { ...rest, ref: ref, onPointerLeave: (event) => {
|
|
25
|
+
setDismissed(false);
|
|
26
|
+
onPointerLeave?.(event);
|
|
27
|
+
}, onFocus: (event) => {
|
|
28
|
+
setDismissed(false);
|
|
29
|
+
onFocus?.(event);
|
|
30
|
+
}, onBlur: (event) => {
|
|
31
|
+
setDismissed(false);
|
|
32
|
+
onBlur?.(event);
|
|
33
|
+
}, className: tooltipClass({ placement, open, dismissed, className }), children: [trigger, _jsx("span", { className: "x-tooltip__bubble", role: "tooltip", id: tooltipId(id), children: text })] }));
|
|
34
|
+
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const themes: readonly [{
|
|
2
|
+
readonly id: "xaroth";
|
|
3
|
+
readonly label: "xaroth.nl";
|
|
4
|
+
}, {
|
|
5
|
+
readonly id: "eve-online";
|
|
6
|
+
readonly label: "eve-online.tools";
|
|
7
|
+
}];
|
|
8
|
+
export type Theme = (typeof themes)[number]['id'];
|
|
9
|
+
export declare const themeIds: readonly Theme[];
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Single source for the theme list: scripts, package exports, Storybook and the harness read it.
|
|
2
|
+
export const themes = [
|
|
3
|
+
{ id: 'xaroth', label: 'xaroth.nl' },
|
|
4
|
+
{ id: 'eve-online', label: 'eve-online.tools' },
|
|
5
|
+
];
|
|
6
|
+
export const themeIds = themes.map((t) => t.id);
|
package/dist/env.d.ts
ADDED
package/dist/html.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type Attr = {
|
|
2
|
+
/** Lowercased, for matching. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Decoded value; `true` for a bare attribute. */
|
|
5
|
+
value: string | true;
|
|
6
|
+
/** Source text, written back unchanged when the attribute is kept. */
|
|
7
|
+
raw: string;
|
|
8
|
+
};
|
|
9
|
+
export type Tag = {
|
|
10
|
+
/** Lowercased tag name. */
|
|
11
|
+
name: string;
|
|
12
|
+
attrs: Attr[];
|
|
13
|
+
selfClosing: boolean;
|
|
14
|
+
/** Offsets of the whole start tag in the scanned html. */
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
/** Tag name as written. */
|
|
18
|
+
rawName: string;
|
|
19
|
+
};
|
|
20
|
+
/** `null` removes the attribute, `undefined` leaves it as it is, `true` writes it bare. */
|
|
21
|
+
export type AttrChanges = Record<string, string | true | null | undefined>;
|
|
22
|
+
export declare const escapeAttr: (value: string) => string;
|
|
23
|
+
/** First start tag, in document order, that `match` accepts. Looks inside wrappers that do not match. */
|
|
24
|
+
export declare function findTag(html: string, match: (tag: Tag) => boolean): Tag | undefined;
|
|
25
|
+
export declare const getAttr: (tag: Tag, name: string) => string | true | undefined;
|
|
26
|
+
/** Writes the start tag back. Changed attributes move to the end, after the ones the tag already had. */
|
|
27
|
+
export declare function writeTag(tag: Tag, changes?: AttrChanges): string;
|
|
28
|
+
/** Replaces `tag` (found in `html`) with `changes` applied. */
|
|
29
|
+
export declare const replaceTag: (html: string, tag: Tag, changes: AttrChanges) => string;
|
|
30
|
+
/** Applies `changes(tag)` to the first tag that `match` accepts. Returns `html` unchanged when none does. */
|
|
31
|
+
export declare function rewriteTag(html: string, match: (tag: Tag) => boolean, changes: (tag: Tag) => AttrChanges): string;
|
|
32
|
+
/** Space separated token lists (ids for aria-describedby) joined in order without repeats. */
|
|
33
|
+
export declare const mergeTokens: (...lists: (string | true | false | null | undefined)[]) => string;
|
|
34
|
+
/** Drops undefined keys, so spreading recipe attributes after user ones never erases a user value. */
|
|
35
|
+
export declare const defined: <T extends Record<string, unknown>>(attrs: T) => Partial<T>;
|
|
36
|
+
/** True the first time per `scope` (the page's request) and `key`, for markup a page needs only once. */
|
|
37
|
+
export declare function firstOnPage(scope: object, key: string): boolean;
|
package/dist/html.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Astro cannot pass props to slotted children, so parts that must wire their child rewrite one tag of the rendered
|
|
2
|
+
// slot. This is a scanner for that markup, not a full HTML parser.
|
|
3
|
+
// Their content is text (or inert), so tags inside are never the target.
|
|
4
|
+
const opaque = new Set(['script', 'style', 'template', 'textarea', 'title']);
|
|
5
|
+
const tagName = /[a-zA-Z][^\s/>]*/y;
|
|
6
|
+
const attr = /([^\s"'>/=][^\s"'>/=]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/y;
|
|
7
|
+
const entities = { amp: '&', quot: '"', apos: "'", lt: '<', gt: '>' };
|
|
8
|
+
const decode = (value) => value.replace(/&(#x[\da-f]+|#\d+|[a-z]+);/gi, (entity, body) => {
|
|
9
|
+
if (body[0] !== '#') {
|
|
10
|
+
return entities[body.toLowerCase()] ?? entity;
|
|
11
|
+
}
|
|
12
|
+
const code = body[1] === 'x' || body[1] === 'X' ? parseInt(body.slice(2), 16) : parseInt(body.slice(1), 10);
|
|
13
|
+
return String.fromCodePoint(code);
|
|
14
|
+
});
|
|
15
|
+
export const escapeAttr = (value) => value.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
|
16
|
+
// Reads the start tag whose `<` is at `lt`, or undefined when `<` does not open a tag there.
|
|
17
|
+
const readTag = (html, lt) => {
|
|
18
|
+
tagName.lastIndex = lt + 1;
|
|
19
|
+
const name = tagName.exec(html);
|
|
20
|
+
if (!name) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const attrs = [];
|
|
24
|
+
let i = tagName.lastIndex;
|
|
25
|
+
while (i < html.length) {
|
|
26
|
+
const char = html[i];
|
|
27
|
+
if (/\s/.test(char)) {
|
|
28
|
+
i++;
|
|
29
|
+
}
|
|
30
|
+
else if (char === '>') {
|
|
31
|
+
return { name: name[0].toLowerCase(), rawName: name[0], attrs, selfClosing: false, start: lt, end: i + 1 };
|
|
32
|
+
}
|
|
33
|
+
else if (html.startsWith('/>', i)) {
|
|
34
|
+
return { name: name[0].toLowerCase(), rawName: name[0], attrs, selfClosing: true, start: lt, end: i + 2 };
|
|
35
|
+
}
|
|
36
|
+
else if (char === '/') {
|
|
37
|
+
i++;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
attr.lastIndex = i;
|
|
41
|
+
const found = attr.exec(html);
|
|
42
|
+
if (!found) {
|
|
43
|
+
i++;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const value = found[2] ?? found[3] ?? found[4];
|
|
47
|
+
attrs.push({ name: found[1].toLowerCase(), value: value === undefined ? true : decode(value), raw: found[0] });
|
|
48
|
+
i = attr.lastIndex;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
};
|
|
53
|
+
/** First start tag, in document order, that `match` accepts. Looks inside wrappers that do not match. */
|
|
54
|
+
export function findTag(html, match) {
|
|
55
|
+
const lower = html.toLowerCase();
|
|
56
|
+
let i = 0;
|
|
57
|
+
while (i < html.length) {
|
|
58
|
+
const lt = html.indexOf('<', i);
|
|
59
|
+
if (lt === -1) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (html.startsWith('<!--', lt)) {
|
|
63
|
+
const close = html.indexOf('-->', lt + 4);
|
|
64
|
+
i = close === -1 ? html.length : close + 3;
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (html[lt + 1] === '/' || html[lt + 1] === '!' || html[lt + 1] === '?') {
|
|
68
|
+
const close = html.indexOf('>', lt);
|
|
69
|
+
i = close === -1 ? html.length : close + 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const tag = readTag(html, lt);
|
|
73
|
+
if (!tag) {
|
|
74
|
+
i = lt + 1;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (match(tag)) {
|
|
78
|
+
return tag;
|
|
79
|
+
}
|
|
80
|
+
i = tag.end;
|
|
81
|
+
if (opaque.has(tag.name) && !tag.selfClosing) {
|
|
82
|
+
const close = lower.indexOf(`</${tag.name}`, i);
|
|
83
|
+
i = close === -1 ? html.length : close;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
export const getAttr = (tag, name) => tag.attrs.find((a) => a.name === name)?.value;
|
|
89
|
+
/** Writes the start tag back. Changed attributes move to the end, after the ones the tag already had. */
|
|
90
|
+
export function writeTag(tag, changes = {}) {
|
|
91
|
+
const entries = Object.entries(changes).filter(([, value]) => value !== undefined);
|
|
92
|
+
const touched = new Set(entries.map(([name]) => name.toLowerCase()));
|
|
93
|
+
const kept = tag.attrs.filter((a) => !touched.has(a.name)).map((a) => a.raw);
|
|
94
|
+
const added = entries
|
|
95
|
+
.filter(([, value]) => value !== null)
|
|
96
|
+
.map(([name, value]) => (value === true ? name : `${name}="${escapeAttr(value)}"`));
|
|
97
|
+
const attrs = [...kept, ...added].map((a) => ` ${a}`).join('');
|
|
98
|
+
return `<${tag.rawName}${attrs}${tag.selfClosing ? ' />' : '>'}`;
|
|
99
|
+
}
|
|
100
|
+
/** Replaces `tag` (found in `html`) with `changes` applied. */
|
|
101
|
+
export const replaceTag = (html, tag, changes) => html.slice(0, tag.start) + writeTag(tag, changes) + html.slice(tag.end);
|
|
102
|
+
/** Applies `changes(tag)` to the first tag that `match` accepts. Returns `html` unchanged when none does. */
|
|
103
|
+
export function rewriteTag(html, match, changes) {
|
|
104
|
+
const tag = findTag(html, match);
|
|
105
|
+
return tag ? replaceTag(html, tag, changes(tag)) : html;
|
|
106
|
+
}
|
|
107
|
+
/** Space separated token lists (ids for aria-describedby) joined in order without repeats. */
|
|
108
|
+
export const mergeTokens = (...lists) => [
|
|
109
|
+
...new Set(lists
|
|
110
|
+
.filter((list) => typeof list === 'string')
|
|
111
|
+
.flatMap((list) => list.split(/\s+/))
|
|
112
|
+
.filter(Boolean)),
|
|
113
|
+
].join(' ');
|
|
114
|
+
/** Drops undefined keys, so spreading recipe attributes after user ones never erases a user value. */
|
|
115
|
+
export const defined = (attrs) => Object.fromEntries(Object.entries(attrs).filter(([, value]) => value !== undefined));
|
|
116
|
+
const claimed = new WeakMap();
|
|
117
|
+
/** True the first time per `scope` (the page's request) and `key`, for markup a page needs only once. */
|
|
118
|
+
export function firstOnPage(scope, key) {
|
|
119
|
+
const keys = claimed.get(scope) ?? new Set();
|
|
120
|
+
claimed.set(scope, keys);
|
|
121
|
+
if (keys.has(key)) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
keys.add(key);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
package/dist/parts.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './components/alert/index.ts';
|
|
2
|
+
export * from './components/avatar/index.ts';
|
|
3
|
+
export * from './components/badge/index.ts';
|
|
4
|
+
export * from './components/breadcrumbs/index.ts';
|
|
5
|
+
export * from './components/button/index.ts';
|
|
6
|
+
export * from './components/card/index.ts';
|
|
7
|
+
export * from './components/description-list/index.ts';
|
|
8
|
+
export * from './components/divider/index.ts';
|
|
9
|
+
export * from './components/empty-state/index.ts';
|
|
10
|
+
export * from './components/field/index.ts';
|
|
11
|
+
export * from './components/filters/index.ts';
|
|
12
|
+
export * from './components/footer/index.ts';
|
|
13
|
+
export * from './components/header/index.ts';
|
|
14
|
+
export * from './components/icon/index.ts';
|
|
15
|
+
export * from './components/layout/index.ts';
|
|
16
|
+
export * from './components/page-head/index.ts';
|
|
17
|
+
export * from './components/pagination/index.ts';
|
|
18
|
+
export * from './components/panel/index.ts';
|
|
19
|
+
export * from './components/progress/index.ts';
|
|
20
|
+
export * from './components/prose/index.ts';
|
|
21
|
+
export * from './components/stat/index.ts';
|
|
22
|
+
export * from './components/table/index.ts';
|
|
23
|
+
export * from './components/tabs/index.ts';
|
|
24
|
+
export * from './components/tag/index.ts';
|
|
25
|
+
export * from './components/timeline/index.ts';
|
|
26
|
+
export * from './components/tooltip/index.ts';
|
|
27
|
+
export * from './config.ts';
|
package/dist/parts.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Generated by scripts/generate.ts. Do not edit.
|
|
2
|
+
export * from "./components/alert/index.js";
|
|
3
|
+
export * from "./components/avatar/index.js";
|
|
4
|
+
export * from "./components/badge/index.js";
|
|
5
|
+
export * from "./components/breadcrumbs/index.js";
|
|
6
|
+
export * from "./components/button/index.js";
|
|
7
|
+
export * from "./components/card/index.js";
|
|
8
|
+
export * from "./components/description-list/index.js";
|
|
9
|
+
export * from "./components/divider/index.js";
|
|
10
|
+
export * from "./components/empty-state/index.js";
|
|
11
|
+
export * from "./components/field/index.js";
|
|
12
|
+
export * from "./components/filters/index.js";
|
|
13
|
+
export * from "./components/footer/index.js";
|
|
14
|
+
export * from "./components/header/index.js";
|
|
15
|
+
export * from "./components/icon/index.js";
|
|
16
|
+
export * from "./components/layout/index.js";
|
|
17
|
+
export * from "./components/page-head/index.js";
|
|
18
|
+
export * from "./components/pagination/index.js";
|
|
19
|
+
export * from "./components/panel/index.js";
|
|
20
|
+
export * from "./components/progress/index.js";
|
|
21
|
+
export * from "./components/prose/index.js";
|
|
22
|
+
export * from "./components/stat/index.js";
|
|
23
|
+
export * from "./components/table/index.js";
|
|
24
|
+
export * from "./components/tabs/index.js";
|
|
25
|
+
export * from "./components/tag/index.js";
|
|
26
|
+
export * from "./components/timeline/index.js";
|
|
27
|
+
export * from "./components/tooltip/index.js";
|
|
28
|
+
export * from "./config.js";
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './parts.ts';
|
|
2
|
+
export * from './components/alert/alert.tsx';
|
|
3
|
+
export * from './components/avatar/avatar.tsx';
|
|
4
|
+
export * from './components/badge/badge.tsx';
|
|
5
|
+
export * from './components/breadcrumbs/breadcrumbs.tsx';
|
|
6
|
+
export * from './components/button/button.tsx';
|
|
7
|
+
export * from './components/card/card.tsx';
|
|
8
|
+
export * from './components/description-list/description-list.tsx';
|
|
9
|
+
export * from './components/divider/divider.tsx';
|
|
10
|
+
export * from './components/empty-state/empty-state.tsx';
|
|
11
|
+
export * from './components/field/field.tsx';
|
|
12
|
+
export * from './components/filters/filters.tsx';
|
|
13
|
+
export * from './components/footer/footer.tsx';
|
|
14
|
+
export * from './components/header/header.tsx';
|
|
15
|
+
export * from './components/icon/icon.tsx';
|
|
16
|
+
export * from './components/layout/layout.tsx';
|
|
17
|
+
export * from './components/page-head/page-head.tsx';
|
|
18
|
+
export * from './components/pagination/pagination.tsx';
|
|
19
|
+
export * from './components/panel/panel.tsx';
|
|
20
|
+
export * from './components/progress/progress.tsx';
|
|
21
|
+
export * from './components/prose/prose.tsx';
|
|
22
|
+
export * from './components/stat/stat.tsx';
|
|
23
|
+
export * from './components/table/table.tsx';
|
|
24
|
+
export * from './components/tabs/tabs.tsx';
|
|
25
|
+
export * from './components/tag/tag.tsx';
|
|
26
|
+
export * from './components/timeline/timeline.tsx';
|
|
27
|
+
export * from './components/tooltip/tooltip.tsx';
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Generated by scripts/generate.ts. Do not edit.
|
|
2
|
+
export * from "./parts.js";
|
|
3
|
+
export * from "./components/alert/alert.js";
|
|
4
|
+
export * from "./components/avatar/avatar.js";
|
|
5
|
+
export * from "./components/badge/badge.js";
|
|
6
|
+
export * from "./components/breadcrumbs/breadcrumbs.js";
|
|
7
|
+
export * from "./components/button/button.js";
|
|
8
|
+
export * from "./components/card/card.js";
|
|
9
|
+
export * from "./components/description-list/description-list.js";
|
|
10
|
+
export * from "./components/divider/divider.js";
|
|
11
|
+
export * from "./components/empty-state/empty-state.js";
|
|
12
|
+
export * from "./components/field/field.js";
|
|
13
|
+
export * from "./components/filters/filters.js";
|
|
14
|
+
export * from "./components/footer/footer.js";
|
|
15
|
+
export * from "./components/header/header.js";
|
|
16
|
+
export * from "./components/icon/icon.js";
|
|
17
|
+
export * from "./components/layout/layout.js";
|
|
18
|
+
export * from "./components/page-head/page-head.js";
|
|
19
|
+
export * from "./components/pagination/pagination.js";
|
|
20
|
+
export * from "./components/panel/panel.js";
|
|
21
|
+
export * from "./components/progress/progress.js";
|
|
22
|
+
export * from "./components/prose/prose.js";
|
|
23
|
+
export * from "./components/stat/stat.js";
|
|
24
|
+
export * from "./components/table/table.js";
|
|
25
|
+
export * from "./components/tabs/tabs.js";
|
|
26
|
+
export * from "./components/tag/tag.js";
|
|
27
|
+
export * from "./components/timeline/timeline.js";
|
|
28
|
+
export * from "./components/tooltip/tooltip.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
// Cut top-left and bottom-right corners.
|
|
4
|
+
@function shape($c) {
|
|
5
|
+
@return polygon(
|
|
6
|
+
$c 0,
|
|
7
|
+
100% 0,
|
|
8
|
+
100% calc(100% - #{$c}),
|
|
9
|
+
calc(100% - #{$c}) 100%,
|
|
10
|
+
0 100%,
|
|
11
|
+
0 $c
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The same outline as a ring of width $w, for drawing edges along the cut. A 45 degree edge moved inward by $w
|
|
16
|
+
// meets the straight sides at $c + $w * (sqrt(2) - 1).
|
|
17
|
+
@function ring($c, $w) {
|
|
18
|
+
$d: $w * (math.sqrt(2) - 1);
|
|
19
|
+
|
|
20
|
+
@return polygon(
|
|
21
|
+
evenodd,
|
|
22
|
+
$c 0,
|
|
23
|
+
100% 0,
|
|
24
|
+
100% calc(100% - #{$c}),
|
|
25
|
+
calc(100% - #{$c}) 100%,
|
|
26
|
+
0 100%,
|
|
27
|
+
0 $c,
|
|
28
|
+
$c 0,
|
|
29
|
+
calc(#{$c} + #{$d}) $w,
|
|
30
|
+
calc(100% - #{$w}) $w,
|
|
31
|
+
calc(100% - #{$w}) calc(100% - #{$c} - #{$d}),
|
|
32
|
+
calc(100% - #{$c} - #{$d}) calc(100% - #{$w}),
|
|
33
|
+
$w calc(100% - #{$w}),
|
|
34
|
+
$w calc(#{$c} + #{$d}),
|
|
35
|
+
calc(#{$c} + #{$d}) $w
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// A theme applies on the page root when the site sets no data-x-theme, or inside [data-x-theme='name'].
|
|
2
|
+
// Docs showing several themes set data-x-theme on <html> (any value) so the root default stops matching.
|
|
3
|
+
@mixin scope($name) {
|
|
4
|
+
:where(:root:not([data-x-theme])),
|
|
5
|
+
[data-x-theme='#{$name}'] {
|
|
6
|
+
@content;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Theme-specific part styling, scoped the same way so two loaded themes never style each other's parts.
|
|
11
|
+
@mixin parts($name) {
|
|
12
|
+
:where(:root:not([data-x-theme]), [data-x-theme='#{$name}']) {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
}
|