@xmesh/system-design 0.0.3 → 0.0.5
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 +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +6 -1
- package/dist/lit/components/alert/index.js +9 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +2 -1
- package/dist/lit/components/app-bar/index.js +5 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +6 -1
- package/dist/lit/components/artifact/index.js +20 -2
- package/dist/lit/components/artifact/index.styles.js +180 -0
- package/dist/lit/components/autocomplete/index.d.ts +5 -0
- package/dist/lit/components/autocomplete/index.js +11 -2
- package/dist/lit/components/autocomplete/index.styles.js +185 -0
- package/dist/lit/components/avatar/index.d.ts +2 -1
- package/dist/lit/components/avatar/index.js +5 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +2 -1
- package/dist/lit/components/avatar-group/index.js +5 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +2 -2
- package/dist/lit/components/badge/index.js +5 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.d.ts +2 -2
- package/dist/lit/components/brand-mark/index.js +13 -0
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +2 -1
- package/dist/lit/components/breadcrumbs/index.js +6 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +8 -4
- package/dist/lit/components/bubble/index.js +21 -0
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +2 -1
- package/dist/lit/components/button/index.js +7 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +2 -1
- package/dist/lit/components/card/index.js +5 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +7 -2
- package/dist/lit/components/chat/index.js +21 -2
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +2 -2
- package/dist/lit/components/checkbox/index.js +8 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +6 -1
- package/dist/lit/components/chip/index.js +9 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +5 -1
- package/dist/lit/components/chip-group/index.js +8 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +2 -2
- package/dist/lit/components/code/index.js +5 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +7 -2
- package/dist/lit/components/composer/index.js +19 -0
- package/dist/lit/components/composer/index.styles.js +562 -0
- package/dist/lit/components/data-table/index.css +18 -0
- package/dist/lit/components/data-table/index.d.ts +30 -0
- package/dist/lit/components/data-table/index.js +120 -34
- package/dist/lit/components/data-table/index.styles.js +198 -0
- package/dist/lit/components/date-range/index.d.ts +4 -0
- package/dist/lit/components/date-range/index.js +7 -2
- package/dist/lit/components/date-range/index.styles.js +338 -0
- package/dist/lit/components/dialog/index.d.ts +4 -0
- package/dist/lit/components/dialog/index.js +7 -2
- package/dist/lit/components/dialog/index.styles.js +138 -0
- package/dist/lit/components/divider/index.d.ts +2 -1
- package/dist/lit/components/divider/index.js +5 -2
- package/dist/lit/components/divider/index.styles.js +41 -0
- package/dist/lit/components/empty-state/index.d.ts +1 -0
- package/dist/lit/components/empty-state/index.js +4 -2
- package/dist/lit/components/empty-state/index.styles.js +83 -0
- package/dist/lit/components/expansion-panel/index.d.ts +6 -2
- package/dist/lit/components/expansion-panel/index.js +9 -2
- package/dist/lit/components/expansion-panel/index.styles.js +134 -0
- package/dist/lit/components/field/index.d.ts +4 -0
- package/dist/lit/components/field/index.js +9 -4
- package/dist/lit/components/field/index.styles.js +237 -0
- package/dist/lit/components/file-input/index.d.ts +4 -0
- package/dist/lit/components/file-input/index.js +10 -4
- package/dist/lit/components/file-input/index.styles.js +271 -0
- package/dist/lit/components/form/index.d.ts +4 -0
- package/dist/lit/components/form/index.js +7 -2
- package/dist/lit/components/form/index.styles.js +43 -0
- package/dist/lit/components/grid/index.d.ts +2 -1
- package/dist/lit/components/grid/index.js +5 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +2 -2
- package/dist/lit/components/kbd/index.js +5 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +5 -1
- package/dist/lit/components/list/index.js +8 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +2 -2
- package/dist/lit/components/list-item/index.js +5 -2
- package/dist/lit/components/list-item/index.styles.js +133 -0
- package/dist/lit/components/menu/index.d.ts +8 -0
- package/dist/lit/components/menu/index.js +11 -3
- package/dist/lit/components/menu/index.styles.js +108 -0
- package/dist/lit/components/multi-select/index.css +156 -0
- package/dist/lit/components/multi-select/index.d.ts +70 -0
- package/dist/lit/components/multi-select/index.js +497 -0
- package/dist/lit/components/multi-select/index.styles.js +170 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +5 -2
- package/dist/lit/components/navigation-drawer/index.js +8 -2
- package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
- package/dist/lit/components/overlay/index.d.ts +5 -0
- package/dist/lit/components/overlay/index.js +8 -2
- package/dist/lit/components/overlay/index.styles.js +185 -0
- package/dist/lit/components/pagination/index.d.ts +18 -1
- package/dist/lit/components/pagination/index.js +54 -8
- package/dist/lit/components/pagination/index.styles.js +116 -0
- package/dist/lit/components/popover/index.d.ts +5 -0
- package/dist/lit/components/popover/index.js +8 -2
- package/dist/lit/components/popover/index.styles.js +48 -0
- package/dist/lit/components/primitives/index.d.ts +2 -2
- package/dist/lit/components/primitives/index.js +13 -0
- package/dist/lit/components/primitives/index.styles.js +518 -0
- package/dist/lit/components/progress/index.d.ts +1 -0
- package/dist/lit/components/progress/index.js +4 -2
- package/dist/lit/components/progress/index.styles.js +157 -0
- package/dist/lit/components/radio-group/index.d.ts +5 -0
- package/dist/lit/components/radio-group/index.js +10 -6
- package/dist/lit/components/radio-group/index.styles.js +192 -0
- package/dist/lit/components/select/index.d.ts +4 -0
- package/dist/lit/components/select/index.js +10 -2
- package/dist/lit/components/select/index.styles.js +165 -0
- package/dist/lit/components/sidebar-item/index.d.ts +1 -1
- package/dist/lit/components/sidebar-item/index.js +12 -0
- package/dist/lit/components/sidebar-item/index.styles.js +147 -0
- package/dist/lit/components/skeleton/index.d.ts +1 -0
- package/dist/lit/components/skeleton/index.js +4 -2
- package/dist/lit/components/skeleton/index.styles.js +95 -0
- package/dist/lit/components/slider/index.d.ts +5 -0
- package/dist/lit/components/slider/index.js +11 -4
- package/dist/lit/components/slider/index.styles.js +185 -0
- package/dist/lit/components/snackbar/index.d.ts +5 -2
- package/dist/lit/components/snackbar/index.js +20 -2
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +2 -1
- package/dist/lit/components/stack/index.js +5 -2
- package/dist/lit/components/stack/index.styles.js +55 -0
- package/dist/lit/components/switch/index.d.ts +1 -0
- package/dist/lit/components/switch/index.js +7 -4
- package/dist/lit/components/switch/index.styles.js +140 -0
- package/dist/lit/components/table/index.d.ts +2 -2
- package/dist/lit/components/table/index.js +5 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +7 -3
- package/dist/lit/components/tabs/index.js +11 -4
- package/dist/lit/components/tabs/index.styles.js +130 -0
- package/dist/lit/components/text-field/index.d.ts +1 -0
- package/dist/lit/components/text-field/index.js +7 -2
- package/dist/lit/components/text-field/index.styles.js +104 -0
- package/dist/lit/components/textarea/index.d.ts +1 -0
- package/dist/lit/components/textarea/index.js +7 -2
- package/dist/lit/components/textarea/index.styles.js +69 -0
- package/dist/lit/components/tooltip/index.d.ts +1 -0
- package/dist/lit/components/tooltip/index.js +4 -2
- package/dist/lit/components/tooltip/index.styles.js +51 -0
- package/dist/lit/components/validation/index.d.ts +7 -2
- package/dist/lit/components/validation/index.js +21 -1
- package/dist/lit/components/validation/index.styles.js +400 -0
- package/dist/lit/index.d.ts +1 -0
- package/dist/lit/index.js +1 -0
- package/dist/react/XmAlert.d.ts +99 -0
- package/dist/react/XmAlert.js +45 -0
- package/dist/react/XmAppBar.d.ts +59 -0
- package/dist/react/XmAppBar.js +34 -0
- package/dist/react/XmArtifact.d.ts +113 -0
- package/dist/react/XmArtifact.js +45 -0
- package/dist/react/XmArtifactChip.d.ts +56 -0
- package/dist/react/XmArtifactChip.js +32 -0
- package/dist/react/XmAutocomplete.d.ts +153 -0
- package/dist/react/XmAutocomplete.js +68 -0
- package/dist/react/XmAvatar.d.ts +71 -0
- package/dist/react/XmAvatar.js +40 -0
- package/dist/react/XmAvatarGroup.d.ts +59 -0
- package/dist/react/XmAvatarGroup.js +34 -0
- package/dist/react/XmBadge.d.ts +67 -0
- package/dist/react/XmBadge.js +38 -0
- package/dist/react/XmBrandGlyph.d.ts +46 -0
- package/dist/react/XmBrandGlyph.js +24 -0
- package/dist/react/XmBrandMark.d.ts +71 -0
- package/dist/react/XmBrandMark.js +40 -0
- package/dist/react/XmBreadcrumbs.d.ts +56 -0
- package/dist/react/XmBreadcrumbs.js +32 -0
- package/dist/react/XmBubble.d.ts +69 -0
- package/dist/react/XmBubble.js +38 -0
- package/dist/react/XmBubbleActions.d.ts +59 -0
- package/dist/react/XmBubbleActions.js +34 -0
- package/dist/react/XmBubbleGroup.d.ts +82 -0
- package/dist/react/XmBubbleGroup.js +36 -0
- package/dist/react/XmButton.d.ts +89 -0
- package/dist/react/XmButton.js +48 -0
- package/dist/react/XmCard.d.ts +59 -0
- package/dist/react/XmCard.js +34 -0
- package/dist/react/XmChatShell.d.ts +110 -0
- package/dist/react/XmChatShell.js +44 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +58 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +46 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +35 -0
- package/dist/react/XmCode.d.ts +55 -0
- package/dist/react/XmCode.js +32 -0
- package/dist/react/XmComposer.d.ts +123 -0
- package/dist/react/XmComposer.js +52 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +65 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +41 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +40 -0
- package/dist/react/XmDivider.d.ts +55 -0
- package/dist/react/XmDivider.js +32 -0
- package/dist/react/XmEmptyState.d.ts +61 -0
- package/dist/react/XmEmptyState.js +34 -0
- package/dist/react/XmExpansionPanel.d.ts +101 -0
- package/dist/react/XmExpansionPanel.js +48 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +68 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +45 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +37 -0
- package/dist/react/XmGrid.d.ts +59 -0
- package/dist/react/XmGrid.js +34 -0
- package/dist/react/XmKbd.d.ts +46 -0
- package/dist/react/XmKbd.js +24 -0
- package/dist/react/XmList.d.ts +83 -0
- package/dist/react/XmList.js +37 -0
- package/dist/react/XmListItem.d.ts +67 -0
- package/dist/react/XmListItem.js +38 -0
- package/dist/react/XmMenu.d.ts +98 -0
- package/dist/react/XmMenu.js +42 -0
- package/dist/react/XmMenuItem.d.ts +63 -0
- package/dist/react/XmMenuItem.js +36 -0
- package/dist/react/XmMultiSelect.d.ts +161 -0
- package/dist/react/XmMultiSelect.js +72 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +41 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +54 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +57 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +40 -0
- package/dist/react/XmProgress.d.ts +75 -0
- package/dist/react/XmProgress.js +42 -0
- package/dist/react/XmRadio.d.ts +88 -0
- package/dist/react/XmRadio.js +41 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +56 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +68 -0
- package/dist/react/XmSidebarItem.d.ts +75 -0
- package/dist/react/XmSidebarItem.js +42 -0
- package/dist/react/XmSkeleton.d.ts +71 -0
- package/dist/react/XmSkeleton.js +40 -0
- package/dist/react/XmSlider.d.ts +160 -0
- package/dist/react/XmSlider.js +74 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +49 -0
- package/dist/react/XmStack.d.ts +71 -0
- package/dist/react/XmStack.js +40 -0
- package/dist/react/XmSwitch.d.ts +136 -0
- package/dist/react/XmSwitch.js +56 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +37 -0
- package/dist/react/XmTabPanel.d.ts +55 -0
- package/dist/react/XmTabPanel.js +32 -0
- package/dist/react/XmTable.d.ts +57 -0
- package/dist/react/XmTable.js +32 -0
- package/dist/react/XmTabs.d.ts +82 -0
- package/dist/react/XmTabs.js +37 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +60 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +64 -0
- package/dist/react/XmTooltip.d.ts +67 -0
- package/dist/react/XmTooltip.js +38 -0
- package/dist/react/index.d.ts +59 -0
- package/dist/react/index.js +59 -0
- package/dist/react/react-utils.js +67 -0
- package/package.json +37 -9
- package/styles/_base-typography.css +86 -0
- package/styles/_primitives.css +54 -0
- package/styles/_reset.css +58 -0
- package/styles/base.css +23 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +979 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
export function mergeRefs(target, forwardedRef) {
|
|
4
|
+
if (!forwardedRef) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (typeof forwardedRef === "function") {
|
|
9
|
+
forwardedRef(target);
|
|
10
|
+
} else {
|
|
11
|
+
forwardedRef.current = target;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createForwardedRefHandler(localRef, forwardedRef) {
|
|
16
|
+
return (node) => {
|
|
17
|
+
localRef.current = node;
|
|
18
|
+
mergeRefs(node, forwardedRef);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useProperties(targetElement, propName, value) {
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const el = targetElement?.current;
|
|
25
|
+
if (!el || value === undefined || el[propName] === value) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
el[propName] = value;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
console.warn(e);
|
|
33
|
+
}
|
|
34
|
+
}, [targetElement, propName, value]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function useEventListener(targetElement, eventName, eventHandler) {
|
|
38
|
+
// keep a ref to the latest handler so we don't need to re-register the event listener
|
|
39
|
+
// whenever the handler changes (avoids duplicate listeners on re-renders)
|
|
40
|
+
const handlerRef = useRef(eventHandler);
|
|
41
|
+
handlerRef.current = eventHandler;
|
|
42
|
+
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
const el = targetElement?.current;
|
|
45
|
+
if (!el || eventName === undefined) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// capture the handler at the time the listener is attached so we can call cancel on it
|
|
50
|
+
const eventListener = (event) => {
|
|
51
|
+
const handler = handlerRef.current;
|
|
52
|
+
if (handler) {
|
|
53
|
+
handler(event);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
el.addEventListener(eventName, eventListener);
|
|
58
|
+
|
|
59
|
+
return () => {
|
|
60
|
+
const handler = handlerRef.current;
|
|
61
|
+
if (handler?.cancel) {
|
|
62
|
+
handler.cancel();
|
|
63
|
+
}
|
|
64
|
+
el.removeEventListener(eventName, eventListener);
|
|
65
|
+
};
|
|
66
|
+
}, [eventName, targetElement?.current]);
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmesh/system-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
"import": "./dist/lit/components/*/index.js"
|
|
36
36
|
},
|
|
37
37
|
"./styles": "./styles/index.css",
|
|
38
|
+
"./base": "./styles/base.css",
|
|
39
|
+
"./react": {
|
|
40
|
+
"types": "./dist/react/index.d.ts",
|
|
41
|
+
"import": "./dist/react/index.js"
|
|
42
|
+
},
|
|
38
43
|
"./styles/*": "./styles/*",
|
|
39
44
|
"./assets/*": "./assets/*"
|
|
40
45
|
},
|
|
@@ -42,7 +47,10 @@
|
|
|
42
47
|
"dist",
|
|
43
48
|
"styles",
|
|
44
49
|
"assets",
|
|
45
|
-
"colors_and_type.css"
|
|
50
|
+
"colors_and_type.css",
|
|
51
|
+
"custom-elements.json",
|
|
52
|
+
"vscode.html-custom-data.json",
|
|
53
|
+
"vscode.css-custom-data.json"
|
|
46
54
|
],
|
|
47
55
|
"sideEffects": [
|
|
48
56
|
"**/*.css",
|
|
@@ -52,12 +60,14 @@
|
|
|
52
60
|
"scripts": {
|
|
53
61
|
"serve": "npm-run-all --parallel watch:lit serve:static",
|
|
54
62
|
"serve:static": "npx --yes http-server . -p 8080 -c-1 -o /lit/preview/",
|
|
55
|
-
"build:lit": "tsc -p lit/tsconfig.json",
|
|
63
|
+
"build:lit": "tsc -p lit/tsconfig.json && node scripts/gen-styles.mjs --out lit/build",
|
|
56
64
|
"watch:lit": "tsc -p lit/tsconfig.json --watch --preserveWatchOutput",
|
|
57
65
|
"build:dist": "node scripts/build-dist.mjs",
|
|
58
66
|
"gen:barrel": "node scripts/gen-barrel.mjs",
|
|
67
|
+
"gen:cem": "node scripts/gen-cem.mjs",
|
|
59
68
|
"screenshot": "node scripts/screenshot.mjs",
|
|
60
69
|
"shoot-all": "node scripts/screenshot.mjs --all",
|
|
70
|
+
"smoke": "npm run build:lit && node scripts/smoke-render.mjs",
|
|
61
71
|
"shoot:storybook": "node scripts/shoot-storybook.mjs",
|
|
62
72
|
"shoot:storybook:build": "node scripts/shoot-storybook.mjs --build --theme=both",
|
|
63
73
|
"check": "bash scripts/check.sh",
|
|
@@ -65,27 +75,36 @@
|
|
|
65
75
|
"check:structure": "bash scripts/check-structure.sh",
|
|
66
76
|
"check:previews": "bash scripts/check-previews.sh",
|
|
67
77
|
"check:bem": "bash scripts/check-bem.sh",
|
|
78
|
+
"check:public-elements": "bash scripts/check-public-elements.sh",
|
|
79
|
+
"check:element-typings": "bash scripts/check-element-typings.sh",
|
|
80
|
+
"check:annotation-coverage": "bash scripts/check-annotation-coverage.sh",
|
|
81
|
+
"check:theme-parity": "bash scripts/check-theme-parity.sh",
|
|
82
|
+
"check:css-delivery": "bash scripts/check-css-delivery.sh",
|
|
68
83
|
"check:contrast": "node scripts/check-contrast.mjs",
|
|
69
84
|
"audit:contrast": "node scripts/check-contrast.mjs --audit",
|
|
70
85
|
"check:spacing": "node scripts/check-spacing.mjs",
|
|
71
|
-
"prepublishOnly": "npm run build:dist",
|
|
86
|
+
"prepublishOnly": "npm run gen:cem && npm run build:dist",
|
|
72
87
|
"release": "npm publish",
|
|
73
88
|
"sb:prep": "npm run build:lit && node scripts/gen-storybook-register.mjs",
|
|
74
89
|
"storybook": "npm run sb:prep && storybook dev -p 6006 --no-open",
|
|
75
90
|
"storybook:dev": "storybook dev -p 6006 --no-open",
|
|
76
91
|
"storybook:watch": "npm run sb:prep && npm-run-all --parallel watch:lit storybook:dev",
|
|
77
|
-
"storybook
|
|
78
|
-
"build-storybook": "npm run sb:prep && storybook build -o storybook-static",
|
|
79
|
-
"build-storybook:react": "storybook build -c .storybook-react -o storybook-static-react"
|
|
92
|
+
"build-storybook": "npm run sb:prep && storybook build -o storybook-static"
|
|
80
93
|
},
|
|
81
94
|
"peerDependencies": {
|
|
82
|
-
"lit": "^3.2.0"
|
|
95
|
+
"lit": "^3.2.0",
|
|
96
|
+
"react": "^18 || ^19",
|
|
97
|
+
"react-dom": "^18 || ^19"
|
|
83
98
|
},
|
|
84
99
|
"devDependencies": {
|
|
100
|
+
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
85
101
|
"@storybook/addon-a11y": "^9.0.0",
|
|
86
102
|
"@storybook/addon-docs": "^9.0.0",
|
|
87
|
-
"@storybook/react-vite": "^9.0.0",
|
|
88
103
|
"@storybook/web-components-vite": "^9.0.0",
|
|
104
|
+
"@types/react": "^18.3.31",
|
|
105
|
+
"@types/react-dom": "^18.3.7",
|
|
106
|
+
"@wc-toolkit/react-wrappers": "^1.2.6",
|
|
107
|
+
"custom-element-vs-code-integration": "^1.5.0",
|
|
89
108
|
"http-server": "^14.1.1",
|
|
90
109
|
"lit": "^3.2.0",
|
|
91
110
|
"npm-run-all": "^4.1.5",
|
|
@@ -95,5 +114,14 @@
|
|
|
95
114
|
"storybook": "^9.0.0",
|
|
96
115
|
"typescript": "^5.6.3",
|
|
97
116
|
"vite": "^6.0.0"
|
|
117
|
+
},
|
|
118
|
+
"customElements": "custom-elements.json",
|
|
119
|
+
"peerDependenciesMeta": {
|
|
120
|
+
"react": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"react-dom": {
|
|
124
|
+
"optional": true
|
|
125
|
+
}
|
|
98
126
|
}
|
|
99
127
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
xmesh DS · _base-typography.css — opt-in raw-HTML typography.
|
|
3
|
+
|
|
4
|
+
Styles a consumer's raw `<h1>`…`<p>`/`<a>`/`<ul>`/`<code>` from the
|
|
5
|
+
type + color token contract, but ONLY under a `[data-xm-base]`
|
|
6
|
+
ancestor (ADR 0011, spine AD-3/AD-3a) — so importing the baseline
|
|
7
|
+
never restyles existing consumer markup until they opt a subtree in.
|
|
8
|
+
Sourced only from `--t-*` type roles + `--md-sys-color-*`; no raw
|
|
9
|
+
colors, no raw spacing px. Imported into @layer base by
|
|
10
|
+
styles/base.css.
|
|
11
|
+
============================================================ */
|
|
12
|
+
|
|
13
|
+
[data-xm-base] {
|
|
14
|
+
background: var(--md-sys-color-surface);
|
|
15
|
+
color: var(--md-sys-color-on-surface);
|
|
16
|
+
font: var(--t-body);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-xm-base] h1 { font: var(--t-h1); letter-spacing: var(--t-tracking-tight); }
|
|
20
|
+
[data-xm-base] h2 { font: var(--t-h2); letter-spacing: var(--t-tracking-tight); }
|
|
21
|
+
[data-xm-base] h3 { font: var(--t-h3); letter-spacing: var(--t-tracking-snug); }
|
|
22
|
+
[data-xm-base] h4 { font: var(--t-h4); letter-spacing: var(--t-tracking-snug); }
|
|
23
|
+
[data-xm-base] h5 { font: var(--t-body-strong); }
|
|
24
|
+
[data-xm-base] h6 {
|
|
25
|
+
font: var(--t-eyebrow);
|
|
26
|
+
text-transform: uppercase;
|
|
27
|
+
letter-spacing: var(--t-tracking-wide);
|
|
28
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-xm-base] :is(h1, h2, h3, h4, h5, h6) {
|
|
32
|
+
margin-block: var(--s-6) var(--s-3);
|
|
33
|
+
}
|
|
34
|
+
[data-xm-base] :is(h1, h2, h3, h4, h5, h6):first-child {
|
|
35
|
+
margin-block-start: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
[data-xm-base] p { font: var(--t-body); margin-block: var(--s-3); }
|
|
39
|
+
[data-xm-base] small { font: var(--t-small); color: var(--md-sys-color-on-surface-variant); }
|
|
40
|
+
|
|
41
|
+
[data-xm-base] strong,
|
|
42
|
+
[data-xm-base] b { font-weight: var(--t-weight-semibold); }
|
|
43
|
+
|
|
44
|
+
[data-xm-base] a {
|
|
45
|
+
color: var(--md-sys-color-primary);
|
|
46
|
+
text-decoration: underline;
|
|
47
|
+
text-underline-offset: 0.15em;
|
|
48
|
+
}
|
|
49
|
+
[data-xm-base] a:hover { text-decoration-thickness: 2px; }
|
|
50
|
+
|
|
51
|
+
[data-xm-base] :is(ul, ol) {
|
|
52
|
+
margin-block: var(--s-3);
|
|
53
|
+
padding-inline-start: var(--s-6);
|
|
54
|
+
}
|
|
55
|
+
[data-xm-base] li { margin-block: var(--s-1); }
|
|
56
|
+
|
|
57
|
+
[data-xm-base] :is(code, kbd, samp) {
|
|
58
|
+
font: var(--t-mono);
|
|
59
|
+
background: var(--md-sys-color-surface-container);
|
|
60
|
+
padding: var(--s-0-5) var(--s-1-5);
|
|
61
|
+
border-radius: var(--md-sys-shape-corner-extra-small);
|
|
62
|
+
}
|
|
63
|
+
[data-xm-base] pre {
|
|
64
|
+
font: var(--t-mono);
|
|
65
|
+
background: var(--md-sys-color-surface-container);
|
|
66
|
+
padding: var(--s-4);
|
|
67
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
68
|
+
overflow: auto;
|
|
69
|
+
}
|
|
70
|
+
[data-xm-base] pre code {
|
|
71
|
+
background: none;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-xm-base] blockquote {
|
|
76
|
+
margin-block: var(--s-4);
|
|
77
|
+
padding-inline-start: var(--s-4);
|
|
78
|
+
border-inline-start: 2px solid var(--md-sys-color-outline-variant);
|
|
79
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-xm-base] hr {
|
|
83
|
+
border: none;
|
|
84
|
+
border-block-start: 1px solid var(--md-sys-color-outline-variant);
|
|
85
|
+
margin-block: var(--s-6);
|
|
86
|
+
}
|
package/styles/_primitives.css
CHANGED
|
@@ -152,3 +152,57 @@
|
|
|
152
152
|
--x-secondary-strong: oklch(0.32 0.050 125);
|
|
153
153
|
--x-secondary-ink: #ffffff;
|
|
154
154
|
}
|
|
155
|
+
|
|
156
|
+
/* OS-preference default (ADR 0013): with no `data-theme` pinned, follow the OS.
|
|
157
|
+
The declarations below MUST stay identical to the `:root[data-theme="light"]`
|
|
158
|
+
block above — enforced by scripts/check-theme-parity.mjs. An explicit
|
|
159
|
+
`data-theme` always wins because this selector only matches when the
|
|
160
|
+
attribute is absent (`:not([data-theme])`). */
|
|
161
|
+
@media (prefers-color-scheme: light) {
|
|
162
|
+
:root:not([data-theme]) {
|
|
163
|
+
--x-canvas-deep: #ffffff;
|
|
164
|
+
--x-canvas-0: #f8f8f6;
|
|
165
|
+
--x-canvas-1: oklch(0.96 0.006 90);
|
|
166
|
+
--x-canvas-2: oklch(0.94 0.010 88);
|
|
167
|
+
--x-canvas-3: oklch(0.92 0.013 87);
|
|
168
|
+
--x-canvas-4: oklch(0.89 0.015 86);
|
|
169
|
+
--x-canvas-5: oklch(0.85 0.017 85);
|
|
170
|
+
--x-canvas-6: oklch(0.78 0.018 85);
|
|
171
|
+
--x-canvas-7: oklch(0.70 0.018 85);
|
|
172
|
+
--x-canvas-8: oklch(0.62 0.018 85);
|
|
173
|
+
--x-surface-0: #ffffff;
|
|
174
|
+
--x-surface-1: oklch(0.995 0.002 85);
|
|
175
|
+
--x-surface-2: oklch(0.985 0.004 85);
|
|
176
|
+
--x-surface-3: oklch(0.97 0.006 85);
|
|
177
|
+
--x-surface-4: oklch(0.91 0.010 85);
|
|
178
|
+
--x-surface-5: oklch(0.86 0.013 85);
|
|
179
|
+
--x-surface-6: oklch(0.78 0.015 85);
|
|
180
|
+
--x-surface-7: oklch(0.66 0.018 85);
|
|
181
|
+
--x-surface-8: oklch(0.58 0.020 85);
|
|
182
|
+
--x-paper: oklch(0.99 0.005 85);
|
|
183
|
+
--x-ink-0: oklch(0.20 0.010 60);
|
|
184
|
+
--x-ink-1: oklch(0.30 0.010 60);
|
|
185
|
+
--x-ink-2: oklch(0.42 0.010 60);
|
|
186
|
+
--x-ink-3: oklch(0.55 0.010 60);
|
|
187
|
+
--x-ink-4: oklch(0.68 0.010 60);
|
|
188
|
+
--x-ink-canvas-0: oklch(0.18 0.005 80);
|
|
189
|
+
--x-ink-canvas-1: oklch(0.28 0.005 80);
|
|
190
|
+
--x-ink-canvas-2: oklch(0.42 0.005 80);
|
|
191
|
+
--x-ink-canvas-3: oklch(0.55 0.006 80);
|
|
192
|
+
--x-ink-canvas-4: oklch(0.68 0.006 80);
|
|
193
|
+
--x-accent-soft: oklch(0.92 0.045 45);
|
|
194
|
+
--x-accent: oklch(0.62 0.110 40);
|
|
195
|
+
--x-accent-strong: oklch(0.50 0.115 38);
|
|
196
|
+
--x-accent-ink: #ffffff;
|
|
197
|
+
--x-accent-disabled: oklch(0.88 0.015 60);
|
|
198
|
+
--x-primary-soft: oklch(0.92 0.045 45);
|
|
199
|
+
--x-primary: oklch(0.62 0.110 40);
|
|
200
|
+
--x-primary-strong: oklch(0.50 0.115 38);
|
|
201
|
+
--x-primary-ink: #ffffff;
|
|
202
|
+
--x-primary-disabled: oklch(0.88 0.015 60);
|
|
203
|
+
--x-secondary-soft: oklch(0.88 0.045 120);
|
|
204
|
+
--x-secondary: oklch(0.42 0.055 125);
|
|
205
|
+
--x-secondary-strong: oklch(0.32 0.050 125);
|
|
206
|
+
--x-secondary-ink: #ffffff;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
xmesh DS · _reset.css — modern, minimal reset.
|
|
3
|
+
|
|
4
|
+
Always-on within the `./base` entry (ADR 0011, spine AD-3): it
|
|
5
|
+
normalizes the box model and user-agent defaults but sets NO colors
|
|
6
|
+
and NO typography, so importing the baseline never restyles a
|
|
7
|
+
consumer's content beyond the reset itself. Imported into @layer
|
|
8
|
+
reset by styles/base.css, so a consumer's own rules win without
|
|
9
|
+
`!important`.
|
|
10
|
+
============================================================ */
|
|
11
|
+
|
|
12
|
+
*,
|
|
13
|
+
*::before,
|
|
14
|
+
*::after {
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
* {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
html {
|
|
23
|
+
-webkit-text-size-adjust: 100%;
|
|
24
|
+
text-size-adjust: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
min-height: 100vh;
|
|
29
|
+
line-height: 1.5;
|
|
30
|
+
-webkit-font-smoothing: antialiased;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
img,
|
|
34
|
+
picture,
|
|
35
|
+
video,
|
|
36
|
+
canvas,
|
|
37
|
+
svg {
|
|
38
|
+
display: block;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
input,
|
|
43
|
+
button,
|
|
44
|
+
textarea,
|
|
45
|
+
select {
|
|
46
|
+
font: inherit;
|
|
47
|
+
color: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
p,
|
|
51
|
+
h1,
|
|
52
|
+
h2,
|
|
53
|
+
h3,
|
|
54
|
+
h4,
|
|
55
|
+
h5,
|
|
56
|
+
h6 {
|
|
57
|
+
overflow-wrap: break-word;
|
|
58
|
+
}
|
package/styles/base.css
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* ============================================================
|
|
2
|
+
xmesh DS · base.css — the one-import baseline (the `./base` entry).
|
|
3
|
+
|
|
4
|
+
Imported once at a consumer's app root, this gives a styled, themed
|
|
5
|
+
page foundation in a single statement (FR-1/2/3/4/6, ADR 0011):
|
|
6
|
+
• the declared @layer order — consumer overrides written outside
|
|
7
|
+
these layers win without `!important`;
|
|
8
|
+
• an always-on reset (@layer reset);
|
|
9
|
+
• the full token contract + theming default (@layer tokens, via
|
|
10
|
+
styles/index.css), so OS / data-theme theming applies (ADR 0013);
|
|
11
|
+
• opt-in raw-HTML typography behind [data-xm-base] (@layer base).
|
|
12
|
+
|
|
13
|
+
The existing `./styles` entry (styles/index.css) is unchanged and
|
|
14
|
+
stays tokens-only — existing consumers get no surprise reset.
|
|
15
|
+
`components` / `utilities` are declared (reserved order slots) so
|
|
16
|
+
component CSS and consumer utilities slot in predictably later.
|
|
17
|
+
============================================================ */
|
|
18
|
+
|
|
19
|
+
@layer reset, base, tokens, components, utilities;
|
|
20
|
+
|
|
21
|
+
@import url("./_reset.css") layer(reset);
|
|
22
|
+
@import url("./index.css") layer(tokens);
|
|
23
|
+
@import url("./_base-typography.css") layer(base);
|