@copilotkit/a2ui-renderer 1.51.4 → 1.51.5-next.1
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/A2UIMessageRenderer.cjs +135 -0
- package/dist/A2UIMessageRenderer.cjs.map +1 -0
- package/dist/A2UIMessageRenderer.d.cts +11 -0
- package/dist/A2UIMessageRenderer.d.cts.map +1 -0
- package/dist/A2UIMessageRenderer.d.mts +11 -0
- package/dist/A2UIMessageRenderer.d.mts.map +1 -0
- package/dist/A2UIMessageRenderer.mjs +134 -0
- package/dist/A2UIMessageRenderer.mjs.map +1 -0
- package/dist/A2UIViewer.cjs +154 -0
- package/dist/A2UIViewer.cjs.map +1 -0
- package/dist/A2UIViewer.d.cts +39 -0
- package/dist/A2UIViewer.d.cts.map +1 -0
- package/dist/A2UIViewer.d.mts +39 -0
- package/dist/A2UIViewer.d.mts.map +1 -0
- package/dist/A2UIViewer.mjs +152 -0
- package/dist/A2UIViewer.mjs.map +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/index.cjs +8 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.umd.js +3070 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/react-renderer/components/content/AudioPlayer.cjs +34 -0
- package/dist/react-renderer/components/content/AudioPlayer.cjs.map +1 -0
- package/dist/react-renderer/components/content/AudioPlayer.mjs +33 -0
- package/dist/react-renderer/components/content/AudioPlayer.mjs.map +1 -0
- package/dist/react-renderer/components/content/Divider.cjs +31 -0
- package/dist/react-renderer/components/content/Divider.cjs.map +1 -0
- package/dist/react-renderer/components/content/Divider.mjs +30 -0
- package/dist/react-renderer/components/content/Divider.mjs.map +1 -0
- package/dist/react-renderer/components/content/Icon.cjs +50 -0
- package/dist/react-renderer/components/content/Icon.cjs.map +1 -0
- package/dist/react-renderer/components/content/Icon.mjs +49 -0
- package/dist/react-renderer/components/content/Icon.mjs.map +1 -0
- package/dist/react-renderer/components/content/Image.cjs +43 -0
- package/dist/react-renderer/components/content/Image.cjs.map +1 -0
- package/dist/react-renderer/components/content/Image.mjs +42 -0
- package/dist/react-renderer/components/content/Image.mjs.map +1 -0
- package/dist/react-renderer/components/content/Text.cjs +131 -0
- package/dist/react-renderer/components/content/Text.cjs.map +1 -0
- package/dist/react-renderer/components/content/Text.mjs +129 -0
- package/dist/react-renderer/components/content/Text.mjs.map +1 -0
- package/dist/react-renderer/components/content/Video.cjs +56 -0
- package/dist/react-renderer/components/content/Video.cjs.map +1 -0
- package/dist/react-renderer/components/content/Video.mjs +55 -0
- package/dist/react-renderer/components/content/Video.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/Button.cjs +39 -0
- package/dist/react-renderer/components/interactive/Button.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/Button.mjs +38 -0
- package/dist/react-renderer/components/interactive/Button.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/CheckBox.cjs +58 -0
- package/dist/react-renderer/components/interactive/CheckBox.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/CheckBox.mjs +57 -0
- package/dist/react-renderer/components/interactive/CheckBox.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/DateTimeInput.cjs +65 -0
- package/dist/react-renderer/components/interactive/DateTimeInput.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/DateTimeInput.mjs +64 -0
- package/dist/react-renderer/components/interactive/DateTimeInput.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/MultipleChoice.cjs +54 -0
- package/dist/react-renderer/components/interactive/MultipleChoice.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/MultipleChoice.mjs +53 -0
- package/dist/react-renderer/components/interactive/MultipleChoice.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/Slider.cjs +72 -0
- package/dist/react-renderer/components/interactive/Slider.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/Slider.mjs +71 -0
- package/dist/react-renderer/components/interactive/Slider.mjs.map +1 -0
- package/dist/react-renderer/components/interactive/TextField.cjs +74 -0
- package/dist/react-renderer/components/interactive/TextField.cjs.map +1 -0
- package/dist/react-renderer/components/interactive/TextField.mjs +73 -0
- package/dist/react-renderer/components/interactive/TextField.mjs.map +1 -0
- package/dist/react-renderer/components/layout/Card.cjs +46 -0
- package/dist/react-renderer/components/layout/Card.cjs.map +1 -0
- package/dist/react-renderer/components/layout/Card.mjs +45 -0
- package/dist/react-renderer/components/layout/Card.mjs.map +1 -0
- package/dist/react-renderer/components/layout/Column.cjs +43 -0
- package/dist/react-renderer/components/layout/Column.cjs.map +1 -0
- package/dist/react-renderer/components/layout/Column.mjs +42 -0
- package/dist/react-renderer/components/layout/Column.mjs.map +1 -0
- package/dist/react-renderer/components/layout/List.cjs +41 -0
- package/dist/react-renderer/components/layout/List.cjs.map +1 -0
- package/dist/react-renderer/components/layout/List.mjs +40 -0
- package/dist/react-renderer/components/layout/List.mjs.map +1 -0
- package/dist/react-renderer/components/layout/Modal.cjs +92 -0
- package/dist/react-renderer/components/layout/Modal.cjs.map +1 -0
- package/dist/react-renderer/components/layout/Modal.mjs +91 -0
- package/dist/react-renderer/components/layout/Modal.mjs.map +1 -0
- package/dist/react-renderer/components/layout/Row.cjs +43 -0
- package/dist/react-renderer/components/layout/Row.cjs.map +1 -0
- package/dist/react-renderer/components/layout/Row.mjs +42 -0
- package/dist/react-renderer/components/layout/Row.mjs.map +1 -0
- package/dist/react-renderer/components/layout/Tabs.cjs +47 -0
- package/dist/react-renderer/components/layout/Tabs.cjs.map +1 -0
- package/dist/react-renderer/components/layout/Tabs.mjs +46 -0
- package/dist/react-renderer/components/layout/Tabs.mjs.map +1 -0
- package/dist/react-renderer/core/A2UIProvider.cjs +123 -0
- package/dist/react-renderer/core/A2UIProvider.cjs.map +1 -0
- package/dist/react-renderer/core/A2UIProvider.mjs +120 -0
- package/dist/react-renderer/core/A2UIProvider.mjs.map +1 -0
- package/dist/react-renderer/core/A2UIRenderer.cjs +93 -0
- package/dist/react-renderer/core/A2UIRenderer.cjs.map +1 -0
- package/dist/react-renderer/core/A2UIRenderer.mjs +92 -0
- package/dist/react-renderer/core/A2UIRenderer.mjs.map +1 -0
- package/dist/react-renderer/core/ComponentNode.cjs +53 -0
- package/dist/react-renderer/core/ComponentNode.cjs.map +1 -0
- package/dist/react-renderer/core/ComponentNode.mjs +52 -0
- package/dist/react-renderer/core/ComponentNode.mjs.map +1 -0
- package/dist/react-renderer/hooks/useA2UI.cjs +46 -0
- package/dist/react-renderer/hooks/useA2UI.cjs.map +1 -0
- package/dist/react-renderer/hooks/useA2UI.mjs +46 -0
- package/dist/react-renderer/hooks/useA2UI.mjs.map +1 -0
- package/dist/react-renderer/hooks/useA2UIComponent.cjs +173 -0
- package/dist/react-renderer/hooks/useA2UIComponent.cjs.map +1 -0
- package/dist/react-renderer/hooks/useA2UIComponent.mjs +172 -0
- package/dist/react-renderer/hooks/useA2UIComponent.mjs.map +1 -0
- package/dist/react-renderer/lib/utils.cjs +39 -0
- package/dist/react-renderer/lib/utils.cjs.map +1 -0
- package/dist/react-renderer/lib/utils.mjs +37 -0
- package/dist/react-renderer/lib/utils.mjs.map +1 -0
- package/dist/react-renderer/registry/ComponentRegistry.cjs +114 -0
- package/dist/react-renderer/registry/ComponentRegistry.cjs.map +1 -0
- package/dist/react-renderer/registry/ComponentRegistry.mjs +113 -0
- package/dist/react-renderer/registry/ComponentRegistry.mjs.map +1 -0
- package/dist/react-renderer/registry/defaultCatalog.cjs +57 -0
- package/dist/react-renderer/registry/defaultCatalog.cjs.map +1 -0
- package/dist/react-renderer/registry/defaultCatalog.mjs +57 -0
- package/dist/react-renderer/registry/defaultCatalog.mjs.map +1 -0
- package/dist/react-renderer/styles/index.cjs +458 -0
- package/dist/react-renderer/styles/index.cjs.map +1 -0
- package/dist/react-renderer/styles/{index.js → index.mjs} +47 -64
- package/dist/react-renderer/styles/index.mjs.map +1 -0
- package/dist/react-renderer/styles/reset.cjs +29 -0
- package/dist/react-renderer/styles/reset.cjs.map +1 -0
- package/dist/react-renderer/styles/reset.mjs +28 -0
- package/dist/react-renderer/styles/reset.mjs.map +1 -0
- package/dist/react-renderer/theme/ThemeContext.cjs +35 -0
- package/dist/react-renderer/theme/ThemeContext.cjs.map +1 -0
- package/dist/react-renderer/theme/ThemeContext.mjs +33 -0
- package/dist/react-renderer/theme/ThemeContext.mjs.map +1 -0
- package/dist/react-renderer/theme/litTheme.cjs +368 -0
- package/dist/react-renderer/theme/litTheme.cjs.map +1 -0
- package/dist/react-renderer/theme/litTheme.mjs +367 -0
- package/dist/react-renderer/theme/litTheme.mjs.map +1 -0
- package/dist/react-renderer/theme/utils.cjs +41 -0
- package/dist/react-renderer/theme/utils.cjs.map +1 -0
- package/dist/react-renderer/theme/utils.mjs +39 -0
- package/dist/react-renderer/theme/utils.mjs.map +1 -0
- package/dist/theme/viewer-theme.cjs +366 -0
- package/dist/theme/viewer-theme.cjs.map +1 -0
- package/dist/theme/viewer-theme.d.cts +7 -0
- package/dist/theme/viewer-theme.d.cts.map +1 -0
- package/dist/theme/viewer-theme.d.mts +7 -0
- package/dist/theme/viewer-theme.d.mts.map +1 -0
- package/dist/theme/viewer-theme.mjs +365 -0
- package/dist/theme/viewer-theme.mjs.map +1 -0
- package/package.json +14 -9
- package/dist/.tsbuildinfo +0 -1
- package/dist/A2UIMessageRenderer.d.ts +0 -7
- package/dist/A2UIMessageRenderer.d.ts.map +0 -1
- package/dist/A2UIMessageRenderer.js +0 -126
- package/dist/A2UIMessageRenderer.js.map +0 -1
- package/dist/A2UIViewer.d.ts +0 -32
- package/dist/A2UIViewer.d.ts.map +0 -1
- package/dist/A2UIViewer.js +0 -121
- package/dist/A2UIViewer.js.map +0 -1
- package/dist/__tests__/A2UIMessageRenderer.test.d.ts +0 -2
- package/dist/__tests__/A2UIMessageRenderer.test.d.ts.map +0 -1
- package/dist/__tests__/A2UIMessageRenderer.test.js +0 -229
- package/dist/__tests__/A2UIMessageRenderer.test.js.map +0 -1
- package/dist/__tests__/clsx-shim.d.ts +0 -8
- package/dist/__tests__/clsx-shim.d.ts.map +0 -1
- package/dist/__tests__/clsx-shim.js +0 -24
- package/dist/__tests__/clsx-shim.js.map +0 -1
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/setup.d.ts.map +0 -1
- package/dist/__tests__/setup.js +0 -29
- package/dist/__tests__/setup.js.map +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/react-renderer/components/content/AudioPlayer.d.ts +0 -8
- package/dist/react-renderer/components/content/AudioPlayer.d.ts.map +0 -1
- package/dist/react-renderer/components/content/AudioPlayer.js +0 -23
- package/dist/react-renderer/components/content/AudioPlayer.js.map +0 -1
- package/dist/react-renderer/components/content/Divider.d.ts +0 -13
- package/dist/react-renderer/components/content/Divider.d.ts.map +0 -1
- package/dist/react-renderer/components/content/Divider.js +0 -22
- package/dist/react-renderer/components/content/Divider.js.map +0 -1
- package/dist/react-renderer/components/content/Icon.d.ts +0 -16
- package/dist/react-renderer/components/content/Icon.d.ts.map +0 -1
- package/dist/react-renderer/components/content/Icon.js +0 -40
- package/dist/react-renderer/components/content/Icon.js.map +0 -1
- package/dist/react-renderer/components/content/Image.d.ts +0 -11
- package/dist/react-renderer/components/content/Image.d.ts.map +0 -1
- package/dist/react-renderer/components/content/Image.js +0 -34
- package/dist/react-renderer/components/content/Image.js.map +0 -1
- package/dist/react-renderer/components/content/Text.d.ts +0 -28
- package/dist/react-renderer/components/content/Text.d.ts.map +0 -1
- package/dist/react-renderer/components/content/Text.js +0 -134
- package/dist/react-renderer/components/content/Text.js.map +0 -1
- package/dist/react-renderer/components/content/Video.d.ts +0 -10
- package/dist/react-renderer/components/content/Video.d.ts.map +0 -1
- package/dist/react-renderer/components/content/Video.js +0 -41
- package/dist/react-renderer/components/content/Video.js.map +0 -1
- package/dist/react-renderer/components/content/index.d.ts +0 -7
- package/dist/react-renderer/components/content/index.d.ts.map +0 -1
- package/dist/react-renderer/components/content/index.js +0 -7
- package/dist/react-renderer/components/content/index.js.map +0 -1
- package/dist/react-renderer/components/interactive/Button.d.ts +0 -11
- package/dist/react-renderer/components/interactive/Button.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/Button.js +0 -27
- package/dist/react-renderer/components/interactive/Button.js.map +0 -1
- package/dist/react-renderer/components/interactive/CheckBox.d.ts +0 -10
- package/dist/react-renderer/components/interactive/CheckBox.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/CheckBox.js +0 -55
- package/dist/react-renderer/components/interactive/CheckBox.js.map +0 -1
- package/dist/react-renderer/components/interactive/DateTimeInput.d.ts +0 -10
- package/dist/react-renderer/components/interactive/DateTimeInput.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/DateTimeInput.js +0 -68
- package/dist/react-renderer/components/interactive/DateTimeInput.js.map +0 -1
- package/dist/react-renderer/components/interactive/MultipleChoice.d.ts +0 -11
- package/dist/react-renderer/components/interactive/MultipleChoice.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/MultipleChoice.js +0 -43
- package/dist/react-renderer/components/interactive/MultipleChoice.js.map +0 -1
- package/dist/react-renderer/components/interactive/Slider.d.ts +0 -10
- package/dist/react-renderer/components/interactive/Slider.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/Slider.js +0 -62
- package/dist/react-renderer/components/interactive/Slider.js.map +0 -1
- package/dist/react-renderer/components/interactive/TextField.d.ts +0 -10
- package/dist/react-renderer/components/interactive/TextField.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/TextField.js +0 -59
- package/dist/react-renderer/components/interactive/TextField.js.map +0 -1
- package/dist/react-renderer/components/interactive/index.d.ts +0 -7
- package/dist/react-renderer/components/interactive/index.d.ts.map +0 -1
- package/dist/react-renderer/components/interactive/index.js +0 -7
- package/dist/react-renderer/components/interactive/index.js.map +0 -1
- package/dist/react-renderer/components/layout/Card.d.ts +0 -17
- package/dist/react-renderer/components/layout/Card.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/Card.js +0 -39
- package/dist/react-renderer/components/layout/Card.js.map +0 -1
- package/dist/react-renderer/components/layout/Column.d.ts +0 -10
- package/dist/react-renderer/components/layout/Column.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/Column.js +0 -33
- package/dist/react-renderer/components/layout/Column.js.map +0 -1
- package/dist/react-renderer/components/layout/List.d.ts +0 -10
- package/dist/react-renderer/components/layout/List.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/List.js +0 -32
- package/dist/react-renderer/components/layout/List.js.map +0 -1
- package/dist/react-renderer/components/layout/Modal.d.ts +0 -15
- package/dist/react-renderer/components/layout/Modal.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/Modal.js +0 -65
- package/dist/react-renderer/components/layout/Modal.js.map +0 -1
- package/dist/react-renderer/components/layout/Row.d.ts +0 -10
- package/dist/react-renderer/components/layout/Row.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/Row.js +0 -33
- package/dist/react-renderer/components/layout/Row.js.map +0 -1
- package/dist/react-renderer/components/layout/Tabs.d.ts +0 -8
- package/dist/react-renderer/components/layout/Tabs.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/Tabs.js +0 -29
- package/dist/react-renderer/components/layout/Tabs.js.map +0 -1
- package/dist/react-renderer/components/layout/index.d.ts +0 -7
- package/dist/react-renderer/components/layout/index.d.ts.map +0 -1
- package/dist/react-renderer/components/layout/index.js +0 -7
- package/dist/react-renderer/components/layout/index.js.map +0 -1
- package/dist/react-renderer/core/A2UIProvider.d.ts +0 -82
- package/dist/react-renderer/core/A2UIProvider.d.ts.map +0 -1
- package/dist/react-renderer/core/A2UIProvider.js +0 -156
- package/dist/react-renderer/core/A2UIProvider.js.map +0 -1
- package/dist/react-renderer/core/A2UIRenderer.d.ts +0 -36
- package/dist/react-renderer/core/A2UIRenderer.d.ts.map +0 -1
- package/dist/react-renderer/core/A2UIRenderer.js +0 -83
- package/dist/react-renderer/core/A2UIRenderer.js.map +0 -1
- package/dist/react-renderer/core/A2UIViewer.d.ts +0 -56
- package/dist/react-renderer/core/A2UIViewer.d.ts.map +0 -1
- package/dist/react-renderer/core/A2UIViewer.js +0 -135
- package/dist/react-renderer/core/A2UIViewer.js.map +0 -1
- package/dist/react-renderer/core/ComponentNode.d.ts +0 -25
- package/dist/react-renderer/core/ComponentNode.d.ts.map +0 -1
- package/dist/react-renderer/core/ComponentNode.js +0 -43
- package/dist/react-renderer/core/ComponentNode.js.map +0 -1
- package/dist/react-renderer/core/store.d.ts +0 -37
- package/dist/react-renderer/core/store.d.ts.map +0 -1
- package/dist/react-renderer/core/store.js +0 -2
- package/dist/react-renderer/core/store.js.map +0 -1
- package/dist/react-renderer/hooks/useA2UI.d.ts +0 -46
- package/dist/react-renderer/hooks/useA2UI.d.ts.map +0 -1
- package/dist/react-renderer/hooks/useA2UI.js +0 -41
- package/dist/react-renderer/hooks/useA2UI.js.map +0 -1
- package/dist/react-renderer/hooks/useA2UIComponent.d.ts +0 -52
- package/dist/react-renderer/hooks/useA2UIComponent.d.ts.map +0 -1
- package/dist/react-renderer/hooks/useA2UIComponent.js +0 -175
- package/dist/react-renderer/hooks/useA2UIComponent.js.map +0 -1
- package/dist/react-renderer/index.d.ts +0 -37
- package/dist/react-renderer/index.d.ts.map +0 -1
- package/dist/react-renderer/index.js +0 -40
- package/dist/react-renderer/index.js.map +0 -1
- package/dist/react-renderer/lib/utils.d.ts +0 -32
- package/dist/react-renderer/lib/utils.d.ts.map +0 -1
- package/dist/react-renderer/lib/utils.js +0 -41
- package/dist/react-renderer/lib/utils.js.map +0 -1
- package/dist/react-renderer/registry/ComponentRegistry.d.ts +0 -78
- package/dist/react-renderer/registry/ComponentRegistry.d.ts.map +0 -1
- package/dist/react-renderer/registry/ComponentRegistry.js +0 -113
- package/dist/react-renderer/registry/ComponentRegistry.js.map +0 -1
- package/dist/react-renderer/registry/defaultCatalog.d.ts +0 -13
- package/dist/react-renderer/registry/defaultCatalog.d.ts.map +0 -1
- package/dist/react-renderer/registry/defaultCatalog.js +0 -59
- package/dist/react-renderer/registry/defaultCatalog.js.map +0 -1
- package/dist/react-renderer/styles/index.d.ts +0 -41
- package/dist/react-renderer/styles/index.d.ts.map +0 -1
- package/dist/react-renderer/styles/index.js.map +0 -1
- package/dist/react-renderer/styles/reset.d.ts +0 -18
- package/dist/react-renderer/styles/reset.d.ts.map +0 -1
- package/dist/react-renderer/styles/reset.js +0 -24
- package/dist/react-renderer/styles/reset.js.map +0 -1
- package/dist/react-renderer/theme/ThemeContext.d.ts +0 -29
- package/dist/react-renderer/theme/ThemeContext.d.ts.map +0 -1
- package/dist/react-renderer/theme/ThemeContext.js +0 -35
- package/dist/react-renderer/theme/ThemeContext.js.map +0 -1
- package/dist/react-renderer/theme/litTheme.d.ts +0 -8
- package/dist/react-renderer/theme/litTheme.d.ts.map +0 -1
- package/dist/react-renderer/theme/litTheme.js +0 -401
- package/dist/react-renderer/theme/litTheme.js.map +0 -1
- package/dist/react-renderer/theme/utils.d.ts +0 -23
- package/dist/react-renderer/theme/utils.d.ts.map +0 -1
- package/dist/react-renderer/theme/utils.js +0 -46
- package/dist/react-renderer/theme/utils.js.map +0 -1
- package/dist/react-renderer/types.d.ts +0 -53
- package/dist/react-renderer/types.d.ts.map +0 -1
- package/dist/react-renderer/types.js +0 -2
- package/dist/react-renderer/types.js.map +0 -1
- package/dist/theme/viewer-theme.d.ts +0 -3
- package/dist/theme/viewer-theme.d.ts.map +0 -1
- package/dist/theme/viewer-theme.js +0 -391
- package/dist/theme/viewer-theme.js.map +0 -1
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_reset = require('./reset.cjs');
|
|
3
|
+
let _a2ui_lit_0_8 = require("@a2ui/lit/0.8");
|
|
4
|
+
|
|
5
|
+
//#region src/react-renderer/styles/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Structural CSS styles from the Lit renderer, converted for global DOM use.
|
|
8
|
+
* These styles define all the utility classes (layout-*, typography-*, color-*, etc.)
|
|
9
|
+
* Converts :host selectors to .a2ui-surface for scoped use outside Shadow DOM.
|
|
10
|
+
*/
|
|
11
|
+
const structuralStyles = _a2ui_lit_0_8.Styles.structuralStyles.replace(/:host\s*\{/g, ".a2ui-surface {");
|
|
12
|
+
/**
|
|
13
|
+
* Component-specific styles that replicate Lit's Shadow DOM scoped CSS.
|
|
14
|
+
*
|
|
15
|
+
* Each Lit component has `static styles` with :host, element selectors, and ::slotted().
|
|
16
|
+
* Since React uses Light DOM, we transform these to global CSS scoped under .a2ui-surface.
|
|
17
|
+
*
|
|
18
|
+
* Transformation rules:
|
|
19
|
+
* :host → .a2ui-surface .a2ui-{component}
|
|
20
|
+
* section → .a2ui-surface .a2ui-{component} section
|
|
21
|
+
* ::slotted(*) → .a2ui-surface .a2ui-{component} section > *
|
|
22
|
+
*/
|
|
23
|
+
const componentSpecificStyles = `
|
|
24
|
+
/* =========================================================================
|
|
25
|
+
* Card (from Lit card.ts static styles)
|
|
26
|
+
* ========================================================================= */
|
|
27
|
+
|
|
28
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
29
|
+
.a2ui-surface .a2ui-card {
|
|
30
|
+
display: block;
|
|
31
|
+
flex: var(--weight);
|
|
32
|
+
min-height: 0;
|
|
33
|
+
overflow: auto;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* section { height: 100%; width: 100%; min-height: 0; overflow: auto; } */
|
|
37
|
+
/* Use > to target only Card's direct section, not nested sections (e.g., TextField's section) */
|
|
38
|
+
.a2ui-surface .a2ui-card > section {
|
|
39
|
+
height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
min-height: 0;
|
|
42
|
+
overflow: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* section ::slotted(*) { height: 100%; width: 100%; } */
|
|
46
|
+
/* Use > section > to only target Card's slotted children, not deeply nested elements */
|
|
47
|
+
.a2ui-surface .a2ui-card > section > * {
|
|
48
|
+
height: 100%;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* =========================================================================
|
|
53
|
+
* Divider (from Lit divider.ts static styles)
|
|
54
|
+
* ========================================================================= */
|
|
55
|
+
|
|
56
|
+
/* :host { display: block; min-height: 0; overflow: auto; } */
|
|
57
|
+
.a2ui-surface .a2ui-divider {
|
|
58
|
+
display: block;
|
|
59
|
+
min-height: 0;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* hr { height: 1px; background: #ccc; border: none; } */
|
|
64
|
+
/* Use :where() for low specificity (0,0,1) so theme utility classes can override */
|
|
65
|
+
/* Browser default margins apply (margin-block: 0.5em, margin-inline: auto) */
|
|
66
|
+
:where(.a2ui-surface .a2ui-divider) hr {
|
|
67
|
+
height: 1px;
|
|
68
|
+
background: #ccc;
|
|
69
|
+
border: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* =========================================================================
|
|
73
|
+
* Text (from Lit text.ts static styles)
|
|
74
|
+
* ========================================================================= */
|
|
75
|
+
|
|
76
|
+
/* :host { display: block; flex: var(--weight); } */
|
|
77
|
+
.a2ui-surface .a2ui-text {
|
|
78
|
+
display: block;
|
|
79
|
+
flex: var(--weight);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* h1, h2, h3, h4, h5 { line-height: inherit; font: inherit; } */
|
|
83
|
+
/* Use :where() to match Lit's low specificity (0,0,0,1 - just element) */
|
|
84
|
+
:where(.a2ui-surface .a2ui-text) h1,
|
|
85
|
+
:where(.a2ui-surface .a2ui-text) h2,
|
|
86
|
+
:where(.a2ui-surface .a2ui-text) h3,
|
|
87
|
+
:where(.a2ui-surface .a2ui-text) h4,
|
|
88
|
+
:where(.a2ui-surface .a2ui-text) h5 {
|
|
89
|
+
line-height: inherit;
|
|
90
|
+
font: inherit;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Ensure markdown paragraph margins are reset */
|
|
94
|
+
.a2ui-surface .a2ui-text p {
|
|
95
|
+
margin: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* =========================================================================
|
|
99
|
+
* TextField (from Lit text-field.ts static styles)
|
|
100
|
+
* ========================================================================= */
|
|
101
|
+
|
|
102
|
+
/* :host { display: flex; flex: var(--weight); } */
|
|
103
|
+
.a2ui-surface .a2ui-textfield {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex: var(--weight);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* input { display: block; width: 100%; } */
|
|
109
|
+
:where(.a2ui-surface .a2ui-textfield) input {
|
|
110
|
+
display: block;
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* label { display: block; margin-bottom: 4px; } */
|
|
115
|
+
:where(.a2ui-surface .a2ui-textfield) label {
|
|
116
|
+
display: block;
|
|
117
|
+
margin-bottom: 4px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* textarea - same styling as input for multiline text fields */
|
|
121
|
+
:where(.a2ui-surface .a2ui-textfield) textarea {
|
|
122
|
+
display: block;
|
|
123
|
+
width: 100%;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* =========================================================================
|
|
127
|
+
* CheckBox (from Lit checkbox.ts static styles)
|
|
128
|
+
* ========================================================================= */
|
|
129
|
+
|
|
130
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
131
|
+
.a2ui-surface .a2ui-checkbox {
|
|
132
|
+
display: block;
|
|
133
|
+
flex: var(--weight);
|
|
134
|
+
min-height: 0;
|
|
135
|
+
overflow: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* input { display: block; width: 100%; } */
|
|
139
|
+
:where(.a2ui-surface .a2ui-checkbox) input {
|
|
140
|
+
display: block;
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* =========================================================================
|
|
145
|
+
* Slider (from Lit slider.ts static styles)
|
|
146
|
+
* ========================================================================= */
|
|
147
|
+
|
|
148
|
+
/* :host { display: block; flex: var(--weight); } */
|
|
149
|
+
.a2ui-surface .a2ui-slider {
|
|
150
|
+
display: block;
|
|
151
|
+
flex: var(--weight);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* input { display: block; width: 100%; } */
|
|
155
|
+
:where(.a2ui-surface .a2ui-slider) input {
|
|
156
|
+
display: block;
|
|
157
|
+
width: 100%;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* =========================================================================
|
|
161
|
+
* Button (from Lit button.ts static styles)
|
|
162
|
+
* ========================================================================= */
|
|
163
|
+
|
|
164
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; } */
|
|
165
|
+
.a2ui-surface .a2ui-button {
|
|
166
|
+
display: block;
|
|
167
|
+
flex: var(--weight);
|
|
168
|
+
min-height: 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* =========================================================================
|
|
172
|
+
* Icon (from Lit icon.ts static styles)
|
|
173
|
+
* ========================================================================= */
|
|
174
|
+
|
|
175
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
176
|
+
.a2ui-surface .a2ui-icon {
|
|
177
|
+
display: block;
|
|
178
|
+
flex: var(--weight);
|
|
179
|
+
min-height: 0;
|
|
180
|
+
overflow: auto;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* =========================================================================
|
|
184
|
+
* Tabs (from Lit tabs.ts static styles)
|
|
185
|
+
* ========================================================================= */
|
|
186
|
+
|
|
187
|
+
/* :host { display: block; flex: var(--weight); } */
|
|
188
|
+
.a2ui-surface .a2ui-tabs {
|
|
189
|
+
display: block;
|
|
190
|
+
flex: var(--weight);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* =========================================================================
|
|
194
|
+
* Modal (from Lit modal.ts static styles)
|
|
195
|
+
* ========================================================================= */
|
|
196
|
+
|
|
197
|
+
/* :host { display: block; flex: var(--weight); } */
|
|
198
|
+
.a2ui-surface .a2ui-modal {
|
|
199
|
+
display: block;
|
|
200
|
+
flex: var(--weight);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* dialog { padding: 0; border: none; background: none; } */
|
|
204
|
+
:where(.a2ui-surface .a2ui-modal) dialog {
|
|
205
|
+
padding: 0;
|
|
206
|
+
border: none;
|
|
207
|
+
background: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* dialog section #controls { display: flex; justify-content: end; margin-bottom: 4px; } */
|
|
211
|
+
.a2ui-surface .a2ui-modal dialog section #controls {
|
|
212
|
+
display: flex;
|
|
213
|
+
justify-content: end;
|
|
214
|
+
margin-bottom: 4px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* dialog section #controls button { padding: 0; background: none; ... } */
|
|
218
|
+
.a2ui-surface .a2ui-modal dialog section #controls button {
|
|
219
|
+
padding: 0;
|
|
220
|
+
background: none;
|
|
221
|
+
width: 20px;
|
|
222
|
+
height: 20px;
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
border: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* =========================================================================
|
|
228
|
+
* Image (from Lit image.ts static styles)
|
|
229
|
+
* ========================================================================= */
|
|
230
|
+
|
|
231
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
232
|
+
.a2ui-surface .a2ui-image {
|
|
233
|
+
display: block;
|
|
234
|
+
flex: var(--weight);
|
|
235
|
+
min-height: 0;
|
|
236
|
+
overflow: auto;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* img { display: block; width: 100%; height: 100%; object-fit: var(--object-fit, fill); } */
|
|
240
|
+
:where(.a2ui-surface .a2ui-image) img {
|
|
241
|
+
display: block;
|
|
242
|
+
width: 100%;
|
|
243
|
+
height: 100%;
|
|
244
|
+
object-fit: var(--object-fit, fill);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* =========================================================================
|
|
248
|
+
* Video (from Lit video.ts static styles)
|
|
249
|
+
* ========================================================================= */
|
|
250
|
+
|
|
251
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
252
|
+
.a2ui-surface .a2ui-video {
|
|
253
|
+
display: block;
|
|
254
|
+
flex: var(--weight);
|
|
255
|
+
min-height: 0;
|
|
256
|
+
overflow: auto;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* video { display: block; width: 100%; } */
|
|
260
|
+
:where(.a2ui-surface .a2ui-video) video {
|
|
261
|
+
display: block;
|
|
262
|
+
width: 100%;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* =========================================================================
|
|
266
|
+
* AudioPlayer (from Lit audio.ts static styles)
|
|
267
|
+
* ========================================================================= */
|
|
268
|
+
|
|
269
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
270
|
+
.a2ui-surface .a2ui-audio {
|
|
271
|
+
display: block;
|
|
272
|
+
flex: var(--weight);
|
|
273
|
+
min-height: 0;
|
|
274
|
+
overflow: auto;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* audio { display: block; width: 100%; } */
|
|
278
|
+
:where(.a2ui-surface .a2ui-audio) audio {
|
|
279
|
+
display: block;
|
|
280
|
+
width: 100%;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* =========================================================================
|
|
284
|
+
* MultipleChoice (from Lit multiple-choice.ts static styles)
|
|
285
|
+
* ========================================================================= */
|
|
286
|
+
|
|
287
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
288
|
+
.a2ui-surface .a2ui-multiplechoice {
|
|
289
|
+
display: block;
|
|
290
|
+
flex: var(--weight);
|
|
291
|
+
min-height: 0;
|
|
292
|
+
overflow: auto;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* select { width: 100%; } */
|
|
296
|
+
:where(.a2ui-surface .a2ui-multiplechoice) select {
|
|
297
|
+
width: 100%;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* =========================================================================
|
|
301
|
+
* Column (from Lit column.ts static styles)
|
|
302
|
+
* ========================================================================= */
|
|
303
|
+
|
|
304
|
+
/* :host { display: flex; flex: var(--weight); } */
|
|
305
|
+
.a2ui-surface .a2ui-column {
|
|
306
|
+
display: flex;
|
|
307
|
+
flex: var(--weight);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* section { display: flex; flex-direction: column; min-width: 100%; height: 100%; } */
|
|
311
|
+
.a2ui-surface .a2ui-column > section {
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
min-width: 100%;
|
|
315
|
+
height: 100%;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/* :host([alignment="..."]) section { align-items: ...; } */
|
|
319
|
+
/* Use > section to only target Column's direct section, not nested sections (e.g., CheckBox's section) */
|
|
320
|
+
.a2ui-surface .a2ui-column[data-alignment="start"] > section { align-items: start; }
|
|
321
|
+
.a2ui-surface .a2ui-column[data-alignment="center"] > section { align-items: center; }
|
|
322
|
+
.a2ui-surface .a2ui-column[data-alignment="end"] > section { align-items: end; }
|
|
323
|
+
.a2ui-surface .a2ui-column[data-alignment="stretch"] > section { align-items: stretch; }
|
|
324
|
+
|
|
325
|
+
/* :host([distribution="..."]) section { justify-content: ...; } */
|
|
326
|
+
.a2ui-surface .a2ui-column[data-distribution="start"] > section { justify-content: start; }
|
|
327
|
+
.a2ui-surface .a2ui-column[data-distribution="center"] > section { justify-content: center; }
|
|
328
|
+
.a2ui-surface .a2ui-column[data-distribution="end"] > section { justify-content: end; }
|
|
329
|
+
.a2ui-surface .a2ui-column[data-distribution="spaceBetween"] > section { justify-content: space-between; }
|
|
330
|
+
.a2ui-surface .a2ui-column[data-distribution="spaceAround"] > section { justify-content: space-around; }
|
|
331
|
+
.a2ui-surface .a2ui-column[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
|
|
332
|
+
|
|
333
|
+
/* =========================================================================
|
|
334
|
+
* Row (from Lit row.ts static styles)
|
|
335
|
+
* ========================================================================= */
|
|
336
|
+
|
|
337
|
+
/* :host { display: flex; flex: var(--weight); } */
|
|
338
|
+
.a2ui-surface .a2ui-row {
|
|
339
|
+
display: flex;
|
|
340
|
+
flex: var(--weight);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* section { display: flex; flex-direction: row; width: 100%; min-height: 100%; } */
|
|
344
|
+
.a2ui-surface .a2ui-row > section {
|
|
345
|
+
display: flex;
|
|
346
|
+
flex-direction: row;
|
|
347
|
+
width: 100%;
|
|
348
|
+
min-height: 100%;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* :host([alignment="..."]) section { align-items: ...; } */
|
|
352
|
+
/* Use > section to only target Row's direct section, not nested sections */
|
|
353
|
+
.a2ui-surface .a2ui-row[data-alignment="start"] > section { align-items: start; }
|
|
354
|
+
.a2ui-surface .a2ui-row[data-alignment="center"] > section { align-items: center; }
|
|
355
|
+
.a2ui-surface .a2ui-row[data-alignment="end"] > section { align-items: end; }
|
|
356
|
+
.a2ui-surface .a2ui-row[data-alignment="stretch"] > section { align-items: stretch; }
|
|
357
|
+
|
|
358
|
+
/* :host([distribution="..."]) section { justify-content: ...; } */
|
|
359
|
+
.a2ui-surface .a2ui-row[data-distribution="start"] > section { justify-content: start; }
|
|
360
|
+
.a2ui-surface .a2ui-row[data-distribution="center"] > section { justify-content: center; }
|
|
361
|
+
.a2ui-surface .a2ui-row[data-distribution="end"] > section { justify-content: end; }
|
|
362
|
+
.a2ui-surface .a2ui-row[data-distribution="spaceBetween"] > section { justify-content: space-between; }
|
|
363
|
+
.a2ui-surface .a2ui-row[data-distribution="spaceAround"] > section { justify-content: space-around; }
|
|
364
|
+
.a2ui-surface .a2ui-row[data-distribution="spaceEvenly"] > section { justify-content: space-evenly; }
|
|
365
|
+
|
|
366
|
+
/* =========================================================================
|
|
367
|
+
* List (from Lit list.ts static styles)
|
|
368
|
+
* ========================================================================= */
|
|
369
|
+
|
|
370
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
371
|
+
.a2ui-surface .a2ui-list {
|
|
372
|
+
display: block;
|
|
373
|
+
flex: var(--weight);
|
|
374
|
+
min-height: 0;
|
|
375
|
+
overflow: auto;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/* :host([direction="vertical"]) section { display: grid; } */
|
|
379
|
+
.a2ui-surface .a2ui-list[data-direction="vertical"] > section {
|
|
380
|
+
display: grid;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* :host([direction="horizontal"]) section { display: flex; max-width: 100%; overflow-x: scroll; ... } */
|
|
384
|
+
.a2ui-surface .a2ui-list[data-direction="horizontal"] > section {
|
|
385
|
+
display: flex;
|
|
386
|
+
max-width: 100%;
|
|
387
|
+
overflow-x: scroll;
|
|
388
|
+
overflow-y: hidden;
|
|
389
|
+
scrollbar-width: none;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* :host([direction="horizontal"]) section > ::slotted(*) { flex: 1 0 fit-content; ... } */
|
|
393
|
+
.a2ui-surface .a2ui-list[data-direction="horizontal"] > section > * {
|
|
394
|
+
flex: 1 0 fit-content;
|
|
395
|
+
max-width: min(80%, 400px);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* =========================================================================
|
|
399
|
+
* DateTimeInput (from Lit datetime-input.ts static styles)
|
|
400
|
+
* ========================================================================= */
|
|
401
|
+
|
|
402
|
+
/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */
|
|
403
|
+
.a2ui-surface .a2ui-datetime-input {
|
|
404
|
+
display: block;
|
|
405
|
+
flex: var(--weight);
|
|
406
|
+
min-height: 0;
|
|
407
|
+
overflow: auto;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* input { display: block; border-radius: 8px; padding: 8px; border: 1px solid #ccc; width: 100%; } */
|
|
411
|
+
/* Use :where() to match Lit's low specificity (0,0,0,1) so theme utility classes can override */
|
|
412
|
+
:where(.a2ui-surface .a2ui-datetime-input) input {
|
|
413
|
+
display: block;
|
|
414
|
+
border-radius: 8px;
|
|
415
|
+
padding: 8px;
|
|
416
|
+
border: 1px solid #ccc;
|
|
417
|
+
width: 100%;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* =========================================================================
|
|
421
|
+
* Global box-sizing (matches Lit's * { box-sizing: border-box; } in components)
|
|
422
|
+
* ========================================================================= */
|
|
423
|
+
|
|
424
|
+
.a2ui-surface *,
|
|
425
|
+
.a2ui-surface *::before,
|
|
426
|
+
.a2ui-surface *::after {
|
|
427
|
+
box-sizing: border-box;
|
|
428
|
+
}
|
|
429
|
+
`;
|
|
430
|
+
/**
|
|
431
|
+
* Injects A2UI structural styles into the document head.
|
|
432
|
+
* Includes utility classes (layout-*, typography-*, color-*, etc.) and React-specific overrides.
|
|
433
|
+
* Call this once at application startup.
|
|
434
|
+
*
|
|
435
|
+
* NOTE: CSS variables (--n-*, --p-*, etc.) must be defined by the host application on :root,
|
|
436
|
+
* just like in the Lit renderer. This allows full customization of the color palette.
|
|
437
|
+
*
|
|
438
|
+
* @example
|
|
439
|
+
* ```tsx
|
|
440
|
+
* import { injectStyles } from '@a2ui/react/styles';
|
|
441
|
+
*
|
|
442
|
+
* // In your app entry point:
|
|
443
|
+
* injectStyles();
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
function injectStyles() {
|
|
447
|
+
if (typeof document === "undefined") return;
|
|
448
|
+
const styleId = "a2ui-structural-styles";
|
|
449
|
+
if (document.getElementById(styleId)) return;
|
|
450
|
+
const styleElement = document.createElement("style");
|
|
451
|
+
styleElement.id = styleId;
|
|
452
|
+
styleElement.textContent = require_reset.resetStyles + "\n" + structuralStyles + "\n" + componentSpecificStyles;
|
|
453
|
+
document.head.appendChild(styleElement);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
//#endregion
|
|
457
|
+
exports.injectStyles = injectStyles;
|
|
458
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Styles","resetStyles"],"sources":["../../../src/react-renderer/styles/index.ts"],"sourcesContent":["import { Styles } from \"@a2ui/lit/0.8\";\nimport { resetStyles } from \"./reset\";\n\n/**\n * Structural CSS styles from the Lit renderer, converted for global DOM use.\n * These styles define all the utility classes (layout-*, typography-*, color-*, etc.)\n * Converts :host selectors to .a2ui-surface for scoped use outside Shadow DOM.\n */\nexport const structuralStyles: string = Styles.structuralStyles.replace(\n /:host\\s*\\{/g,\n \".a2ui-surface {\",\n);\n\n/**\n * Component-specific styles that replicate Lit's Shadow DOM scoped CSS.\n *\n * Each Lit component has `static styles` with :host, element selectors, and ::slotted().\n * Since React uses Light DOM, we transform these to global CSS scoped under .a2ui-surface.\n *\n * Transformation rules:\n * :host → .a2ui-surface .a2ui-{component}\n * section → .a2ui-surface .a2ui-{component} section\n * ::slotted(*) → .a2ui-surface .a2ui-{component} section > *\n */\nexport const componentSpecificStyles: string = `\n/* =========================================================================\n * Card (from Lit card.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-card {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* section { height: 100%; width: 100%; min-height: 0; overflow: auto; } */\n/* Use > to target only Card's direct section, not nested sections (e.g., TextField's section) */\n.a2ui-surface .a2ui-card > section {\n height: 100%;\n width: 100%;\n min-height: 0;\n overflow: auto;\n}\n\n/* section ::slotted(*) { height: 100%; width: 100%; } */\n/* Use > section > to only target Card's slotted children, not deeply nested elements */\n.a2ui-surface .a2ui-card > section > * {\n height: 100%;\n width: 100%;\n}\n\n/* =========================================================================\n * Divider (from Lit divider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-divider {\n display: block;\n min-height: 0;\n overflow: auto;\n}\n\n/* hr { height: 1px; background: #ccc; border: none; } */\n/* Use :where() for low specificity (0,0,1) so theme utility classes can override */\n/* Browser default margins apply (margin-block: 0.5em, margin-inline: auto) */\n:where(.a2ui-surface .a2ui-divider) hr {\n height: 1px;\n background: #ccc;\n border: none;\n}\n\n/* =========================================================================\n * Text (from Lit text.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-text {\n display: block;\n flex: var(--weight);\n}\n\n/* h1, h2, h3, h4, h5 { line-height: inherit; font: inherit; } */\n/* Use :where() to match Lit's low specificity (0,0,0,1 - just element) */\n:where(.a2ui-surface .a2ui-text) h1,\n:where(.a2ui-surface .a2ui-text) h2,\n:where(.a2ui-surface .a2ui-text) h3,\n:where(.a2ui-surface .a2ui-text) h4,\n:where(.a2ui-surface .a2ui-text) h5 {\n line-height: inherit;\n font: inherit;\n}\n\n/* Ensure markdown paragraph margins are reset */\n.a2ui-surface .a2ui-text p {\n margin: 0;\n}\n\n/* =========================================================================\n * TextField (from Lit text-field.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-textfield {\n display: flex;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-textfield) input {\n display: block;\n width: 100%;\n}\n\n/* label { display: block; margin-bottom: 4px; } */\n:where(.a2ui-surface .a2ui-textfield) label {\n display: block;\n margin-bottom: 4px;\n}\n\n/* textarea - same styling as input for multiline text fields */\n:where(.a2ui-surface .a2ui-textfield) textarea {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * CheckBox (from Lit checkbox.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-checkbox {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-checkbox) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Slider (from Lit slider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-slider {\n display: block;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-slider) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Button (from Lit button.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; } */\n.a2ui-surface .a2ui-button {\n display: block;\n flex: var(--weight);\n min-height: 0;\n}\n\n/* =========================================================================\n * Icon (from Lit icon.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-icon {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* =========================================================================\n * Tabs (from Lit tabs.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-tabs {\n display: block;\n flex: var(--weight);\n}\n\n/* =========================================================================\n * Modal (from Lit modal.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-modal {\n display: block;\n flex: var(--weight);\n}\n\n/* dialog { padding: 0; border: none; background: none; } */\n:where(.a2ui-surface .a2ui-modal) dialog {\n padding: 0;\n border: none;\n background: none;\n}\n\n/* dialog section #controls { display: flex; justify-content: end; margin-bottom: 4px; } */\n.a2ui-surface .a2ui-modal dialog section #controls {\n display: flex;\n justify-content: end;\n margin-bottom: 4px;\n}\n\n/* dialog section #controls button { padding: 0; background: none; ... } */\n.a2ui-surface .a2ui-modal dialog section #controls button {\n padding: 0;\n background: none;\n width: 20px;\n height: 20px;\n cursor: pointer;\n border: none;\n}\n\n/* =========================================================================\n * Image (from Lit image.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-image {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* img { display: block; width: 100%; height: 100%; object-fit: var(--object-fit, fill); } */\n:where(.a2ui-surface .a2ui-image) img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--object-fit, fill);\n}\n\n/* =========================================================================\n * Video (from Lit video.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-video {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* video { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-video) video {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * AudioPlayer (from Lit audio.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-audio {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* audio { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-audio) audio {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * MultipleChoice (from Lit multiple-choice.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-multiplechoice {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* select { width: 100%; } */\n:where(.a2ui-surface .a2ui-multiplechoice) select {\n width: 100%;\n}\n\n/* =========================================================================\n * Column (from Lit column.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-column {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: column; min-width: 100%; height: 100%; } */\n.a2ui-surface .a2ui-column > section {\n display: flex;\n flex-direction: column;\n min-width: 100%;\n height: 100%;\n}\n\n/* :host([alignment=\"...\"]) section { align-items: ...; } */\n/* Use > section to only target Column's direct section, not nested sections (e.g., CheckBox's section) */\n.a2ui-surface .a2ui-column[data-alignment=\"start\"] > section { align-items: start; }\n.a2ui-surface .a2ui-column[data-alignment=\"center\"] > section { align-items: center; }\n.a2ui-surface .a2ui-column[data-alignment=\"end\"] > section { align-items: end; }\n.a2ui-surface .a2ui-column[data-alignment=\"stretch\"] > section { align-items: stretch; }\n\n/* :host([distribution=\"...\"]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-column[data-distribution=\"start\"] > section { justify-content: start; }\n.a2ui-surface .a2ui-column[data-distribution=\"center\"] > section { justify-content: center; }\n.a2ui-surface .a2ui-column[data-distribution=\"end\"] > section { justify-content: end; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceBetween\"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceAround\"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceEvenly\"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * Row (from Lit row.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-row {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: row; width: 100%; min-height: 100%; } */\n.a2ui-surface .a2ui-row > section {\n display: flex;\n flex-direction: row;\n width: 100%;\n min-height: 100%;\n}\n\n/* :host([alignment=\"...\"]) section { align-items: ...; } */\n/* Use > section to only target Row's direct section, not nested sections */\n.a2ui-surface .a2ui-row[data-alignment=\"start\"] > section { align-items: start; }\n.a2ui-surface .a2ui-row[data-alignment=\"center\"] > section { align-items: center; }\n.a2ui-surface .a2ui-row[data-alignment=\"end\"] > section { align-items: end; }\n.a2ui-surface .a2ui-row[data-alignment=\"stretch\"] > section { align-items: stretch; }\n\n/* :host([distribution=\"...\"]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-row[data-distribution=\"start\"] > section { justify-content: start; }\n.a2ui-surface .a2ui-row[data-distribution=\"center\"] > section { justify-content: center; }\n.a2ui-surface .a2ui-row[data-distribution=\"end\"] > section { justify-content: end; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceBetween\"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceAround\"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceEvenly\"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * List (from Lit list.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-list {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* :host([direction=\"vertical\"]) section { display: grid; } */\n.a2ui-surface .a2ui-list[data-direction=\"vertical\"] > section {\n display: grid;\n}\n\n/* :host([direction=\"horizontal\"]) section { display: flex; max-width: 100%; overflow-x: scroll; ... } */\n.a2ui-surface .a2ui-list[data-direction=\"horizontal\"] > section {\n display: flex;\n max-width: 100%;\n overflow-x: scroll;\n overflow-y: hidden;\n scrollbar-width: none;\n}\n\n/* :host([direction=\"horizontal\"]) section > ::slotted(*) { flex: 1 0 fit-content; ... } */\n.a2ui-surface .a2ui-list[data-direction=\"horizontal\"] > section > * {\n flex: 1 0 fit-content;\n max-width: min(80%, 400px);\n}\n\n/* =========================================================================\n * DateTimeInput (from Lit datetime-input.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-datetime-input {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; border-radius: 8px; padding: 8px; border: 1px solid #ccc; width: 100%; } */\n/* Use :where() to match Lit's low specificity (0,0,0,1) so theme utility classes can override */\n:where(.a2ui-surface .a2ui-datetime-input) input {\n display: block;\n border-radius: 8px;\n padding: 8px;\n border: 1px solid #ccc;\n width: 100%;\n}\n\n/* =========================================================================\n * Global box-sizing (matches Lit's * { box-sizing: border-box; } in components)\n * ========================================================================= */\n\n.a2ui-surface *,\n.a2ui-surface *::before,\n.a2ui-surface *::after {\n box-sizing: border-box;\n}\n`;\n\n/**\n * Injects A2UI structural styles into the document head.\n * Includes utility classes (layout-*, typography-*, color-*, etc.) and React-specific overrides.\n * Call this once at application startup.\n *\n * NOTE: CSS variables (--n-*, --p-*, etc.) must be defined by the host application on :root,\n * just like in the Lit renderer. This allows full customization of the color palette.\n *\n * @example\n * ```tsx\n * import { injectStyles } from '@a2ui/react/styles';\n *\n * // In your app entry point:\n * injectStyles();\n * ```\n */\nexport function injectStyles(): void {\n if (typeof document === \"undefined\") {\n return; // SSR safety\n }\n\n const styleId = \"a2ui-structural-styles\";\n\n // Avoid duplicate injection\n if (document.getElementById(styleId)) {\n return;\n }\n\n const styleElement = document.createElement(\"style\");\n styleElement.id = styleId;\n // Include structural (utility classes) and component-specific styles\n // Note: CSS variables (palette) must be defined by the host application on :root,\n // just like in the Lit renderer. This allows full customization.\n styleElement.textContent =\n resetStyles + \"\\n\" + structuralStyles + \"\\n\" + componentSpecificStyles;\n document.head.appendChild(styleElement);\n}\n\n/**\n * Removes injected A2UI styles from the document.\n * Useful for cleanup in tests or when unmounting.\n */\nexport function removeStyles(): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const styleElement = document.getElementById(\"a2ui-structural-styles\");\n if (styleElement) {\n styleElement.remove();\n }\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAa,mBAA2BA,qBAAO,iBAAiB,QAC9D,eACA,kBACD;;;;;;;;;;;;AAaD,MAAa,0BAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwa/C,SAAgB,eAAqB;AACnC,KAAI,OAAO,aAAa,YACtB;CAGF,MAAM,UAAU;AAGhB,KAAI,SAAS,eAAe,QAAQ,CAClC;CAGF,MAAM,eAAe,SAAS,cAAc,QAAQ;AACpD,cAAa,KAAK;AAIlB,cAAa,cACXC,4BAAc,OAAO,mBAAmB,OAAO;AACjD,UAAS,KAAK,YAAY,aAAa"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
+
import { resetStyles } from "./reset.mjs";
|
|
1
2
|
import { Styles } from "@a2ui/lit/0.8";
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
//#region src/react-renderer/styles/index.ts
|
|
3
5
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
* Structural CSS styles from the Lit renderer, converted for global DOM use.
|
|
7
|
+
* These styles define all the utility classes (layout-*, typography-*, color-*, etc.)
|
|
8
|
+
* Converts :host selectors to .a2ui-surface for scoped use outside Shadow DOM.
|
|
9
|
+
*/
|
|
10
|
+
const structuralStyles = Styles.structuralStyles.replace(/:host\s*\{/g, ".a2ui-surface {");
|
|
9
11
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
* Component-specific styles that replicate Lit's Shadow DOM scoped CSS.
|
|
13
|
+
*
|
|
14
|
+
* Each Lit component has `static styles` with :host, element selectors, and ::slotted().
|
|
15
|
+
* Since React uses Light DOM, we transform these to global CSS scoped under .a2ui-surface.
|
|
16
|
+
*
|
|
17
|
+
* Transformation rules:
|
|
18
|
+
* :host → .a2ui-surface .a2ui-{component}
|
|
19
|
+
* section → .a2ui-surface .a2ui-{component} section
|
|
20
|
+
* ::slotted(*) → .a2ui-surface .a2ui-{component} section > *
|
|
21
|
+
*/
|
|
22
|
+
const componentSpecificStyles = `
|
|
21
23
|
/* =========================================================================
|
|
22
24
|
* Card (from Lit card.ts static styles)
|
|
23
25
|
* ========================================================================= */
|
|
@@ -425,50 +427,31 @@ export const componentSpecificStyles = `
|
|
|
425
427
|
}
|
|
426
428
|
`;
|
|
427
429
|
/**
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
// just like in the Lit renderer. This allows full customization.
|
|
457
|
-
styleElement.textContent =
|
|
458
|
-
resetStyles + "\n" + structuralStyles + "\n" + componentSpecificStyles;
|
|
459
|
-
document.head.appendChild(styleElement);
|
|
460
|
-
}
|
|
461
|
-
/**
|
|
462
|
-
* Removes injected A2UI styles from the document.
|
|
463
|
-
* Useful for cleanup in tests or when unmounting.
|
|
464
|
-
*/
|
|
465
|
-
export function removeStyles() {
|
|
466
|
-
if (typeof document === "undefined") {
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
const styleElement = document.getElementById("a2ui-structural-styles");
|
|
470
|
-
if (styleElement) {
|
|
471
|
-
styleElement.remove();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
//# sourceMappingURL=index.js.map
|
|
430
|
+
* Injects A2UI structural styles into the document head.
|
|
431
|
+
* Includes utility classes (layout-*, typography-*, color-*, etc.) and React-specific overrides.
|
|
432
|
+
* Call this once at application startup.
|
|
433
|
+
*
|
|
434
|
+
* NOTE: CSS variables (--n-*, --p-*, etc.) must be defined by the host application on :root,
|
|
435
|
+
* just like in the Lit renderer. This allows full customization of the color palette.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```tsx
|
|
439
|
+
* import { injectStyles } from '@a2ui/react/styles';
|
|
440
|
+
*
|
|
441
|
+
* // In your app entry point:
|
|
442
|
+
* injectStyles();
|
|
443
|
+
* ```
|
|
444
|
+
*/
|
|
445
|
+
function injectStyles() {
|
|
446
|
+
if (typeof document === "undefined") return;
|
|
447
|
+
const styleId = "a2ui-structural-styles";
|
|
448
|
+
if (document.getElementById(styleId)) return;
|
|
449
|
+
const styleElement = document.createElement("style");
|
|
450
|
+
styleElement.id = styleId;
|
|
451
|
+
styleElement.textContent = resetStyles + "\n" + structuralStyles + "\n" + componentSpecificStyles;
|
|
452
|
+
document.head.appendChild(styleElement);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
//#endregion
|
|
456
|
+
export { injectStyles };
|
|
457
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/react-renderer/styles/index.ts"],"sourcesContent":["import { Styles } from \"@a2ui/lit/0.8\";\nimport { resetStyles } from \"./reset\";\n\n/**\n * Structural CSS styles from the Lit renderer, converted for global DOM use.\n * These styles define all the utility classes (layout-*, typography-*, color-*, etc.)\n * Converts :host selectors to .a2ui-surface for scoped use outside Shadow DOM.\n */\nexport const structuralStyles: string = Styles.structuralStyles.replace(\n /:host\\s*\\{/g,\n \".a2ui-surface {\",\n);\n\n/**\n * Component-specific styles that replicate Lit's Shadow DOM scoped CSS.\n *\n * Each Lit component has `static styles` with :host, element selectors, and ::slotted().\n * Since React uses Light DOM, we transform these to global CSS scoped under .a2ui-surface.\n *\n * Transformation rules:\n * :host → .a2ui-surface .a2ui-{component}\n * section → .a2ui-surface .a2ui-{component} section\n * ::slotted(*) → .a2ui-surface .a2ui-{component} section > *\n */\nexport const componentSpecificStyles: string = `\n/* =========================================================================\n * Card (from Lit card.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-card {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* section { height: 100%; width: 100%; min-height: 0; overflow: auto; } */\n/* Use > to target only Card's direct section, not nested sections (e.g., TextField's section) */\n.a2ui-surface .a2ui-card > section {\n height: 100%;\n width: 100%;\n min-height: 0;\n overflow: auto;\n}\n\n/* section ::slotted(*) { height: 100%; width: 100%; } */\n/* Use > section > to only target Card's slotted children, not deeply nested elements */\n.a2ui-surface .a2ui-card > section > * {\n height: 100%;\n width: 100%;\n}\n\n/* =========================================================================\n * Divider (from Lit divider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-divider {\n display: block;\n min-height: 0;\n overflow: auto;\n}\n\n/* hr { height: 1px; background: #ccc; border: none; } */\n/* Use :where() for low specificity (0,0,1) so theme utility classes can override */\n/* Browser default margins apply (margin-block: 0.5em, margin-inline: auto) */\n:where(.a2ui-surface .a2ui-divider) hr {\n height: 1px;\n background: #ccc;\n border: none;\n}\n\n/* =========================================================================\n * Text (from Lit text.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-text {\n display: block;\n flex: var(--weight);\n}\n\n/* h1, h2, h3, h4, h5 { line-height: inherit; font: inherit; } */\n/* Use :where() to match Lit's low specificity (0,0,0,1 - just element) */\n:where(.a2ui-surface .a2ui-text) h1,\n:where(.a2ui-surface .a2ui-text) h2,\n:where(.a2ui-surface .a2ui-text) h3,\n:where(.a2ui-surface .a2ui-text) h4,\n:where(.a2ui-surface .a2ui-text) h5 {\n line-height: inherit;\n font: inherit;\n}\n\n/* Ensure markdown paragraph margins are reset */\n.a2ui-surface .a2ui-text p {\n margin: 0;\n}\n\n/* =========================================================================\n * TextField (from Lit text-field.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-textfield {\n display: flex;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-textfield) input {\n display: block;\n width: 100%;\n}\n\n/* label { display: block; margin-bottom: 4px; } */\n:where(.a2ui-surface .a2ui-textfield) label {\n display: block;\n margin-bottom: 4px;\n}\n\n/* textarea - same styling as input for multiline text fields */\n:where(.a2ui-surface .a2ui-textfield) textarea {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * CheckBox (from Lit checkbox.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-checkbox {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-checkbox) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Slider (from Lit slider.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-slider {\n display: block;\n flex: var(--weight);\n}\n\n/* input { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-slider) input {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * Button (from Lit button.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; } */\n.a2ui-surface .a2ui-button {\n display: block;\n flex: var(--weight);\n min-height: 0;\n}\n\n/* =========================================================================\n * Icon (from Lit icon.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-icon {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* =========================================================================\n * Tabs (from Lit tabs.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-tabs {\n display: block;\n flex: var(--weight);\n}\n\n/* =========================================================================\n * Modal (from Lit modal.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); } */\n.a2ui-surface .a2ui-modal {\n display: block;\n flex: var(--weight);\n}\n\n/* dialog { padding: 0; border: none; background: none; } */\n:where(.a2ui-surface .a2ui-modal) dialog {\n padding: 0;\n border: none;\n background: none;\n}\n\n/* dialog section #controls { display: flex; justify-content: end; margin-bottom: 4px; } */\n.a2ui-surface .a2ui-modal dialog section #controls {\n display: flex;\n justify-content: end;\n margin-bottom: 4px;\n}\n\n/* dialog section #controls button { padding: 0; background: none; ... } */\n.a2ui-surface .a2ui-modal dialog section #controls button {\n padding: 0;\n background: none;\n width: 20px;\n height: 20px;\n cursor: pointer;\n border: none;\n}\n\n/* =========================================================================\n * Image (from Lit image.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-image {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* img { display: block; width: 100%; height: 100%; object-fit: var(--object-fit, fill); } */\n:where(.a2ui-surface .a2ui-image) img {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: var(--object-fit, fill);\n}\n\n/* =========================================================================\n * Video (from Lit video.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-video {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* video { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-video) video {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * AudioPlayer (from Lit audio.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-audio {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* audio { display: block; width: 100%; } */\n:where(.a2ui-surface .a2ui-audio) audio {\n display: block;\n width: 100%;\n}\n\n/* =========================================================================\n * MultipleChoice (from Lit multiple-choice.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-multiplechoice {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* select { width: 100%; } */\n:where(.a2ui-surface .a2ui-multiplechoice) select {\n width: 100%;\n}\n\n/* =========================================================================\n * Column (from Lit column.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-column {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: column; min-width: 100%; height: 100%; } */\n.a2ui-surface .a2ui-column > section {\n display: flex;\n flex-direction: column;\n min-width: 100%;\n height: 100%;\n}\n\n/* :host([alignment=\"...\"]) section { align-items: ...; } */\n/* Use > section to only target Column's direct section, not nested sections (e.g., CheckBox's section) */\n.a2ui-surface .a2ui-column[data-alignment=\"start\"] > section { align-items: start; }\n.a2ui-surface .a2ui-column[data-alignment=\"center\"] > section { align-items: center; }\n.a2ui-surface .a2ui-column[data-alignment=\"end\"] > section { align-items: end; }\n.a2ui-surface .a2ui-column[data-alignment=\"stretch\"] > section { align-items: stretch; }\n\n/* :host([distribution=\"...\"]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-column[data-distribution=\"start\"] > section { justify-content: start; }\n.a2ui-surface .a2ui-column[data-distribution=\"center\"] > section { justify-content: center; }\n.a2ui-surface .a2ui-column[data-distribution=\"end\"] > section { justify-content: end; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceBetween\"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceAround\"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-column[data-distribution=\"spaceEvenly\"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * Row (from Lit row.ts static styles)\n * ========================================================================= */\n\n/* :host { display: flex; flex: var(--weight); } */\n.a2ui-surface .a2ui-row {\n display: flex;\n flex: var(--weight);\n}\n\n/* section { display: flex; flex-direction: row; width: 100%; min-height: 100%; } */\n.a2ui-surface .a2ui-row > section {\n display: flex;\n flex-direction: row;\n width: 100%;\n min-height: 100%;\n}\n\n/* :host([alignment=\"...\"]) section { align-items: ...; } */\n/* Use > section to only target Row's direct section, not nested sections */\n.a2ui-surface .a2ui-row[data-alignment=\"start\"] > section { align-items: start; }\n.a2ui-surface .a2ui-row[data-alignment=\"center\"] > section { align-items: center; }\n.a2ui-surface .a2ui-row[data-alignment=\"end\"] > section { align-items: end; }\n.a2ui-surface .a2ui-row[data-alignment=\"stretch\"] > section { align-items: stretch; }\n\n/* :host([distribution=\"...\"]) section { justify-content: ...; } */\n.a2ui-surface .a2ui-row[data-distribution=\"start\"] > section { justify-content: start; }\n.a2ui-surface .a2ui-row[data-distribution=\"center\"] > section { justify-content: center; }\n.a2ui-surface .a2ui-row[data-distribution=\"end\"] > section { justify-content: end; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceBetween\"] > section { justify-content: space-between; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceAround\"] > section { justify-content: space-around; }\n.a2ui-surface .a2ui-row[data-distribution=\"spaceEvenly\"] > section { justify-content: space-evenly; }\n\n/* =========================================================================\n * List (from Lit list.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-list {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* :host([direction=\"vertical\"]) section { display: grid; } */\n.a2ui-surface .a2ui-list[data-direction=\"vertical\"] > section {\n display: grid;\n}\n\n/* :host([direction=\"horizontal\"]) section { display: flex; max-width: 100%; overflow-x: scroll; ... } */\n.a2ui-surface .a2ui-list[data-direction=\"horizontal\"] > section {\n display: flex;\n max-width: 100%;\n overflow-x: scroll;\n overflow-y: hidden;\n scrollbar-width: none;\n}\n\n/* :host([direction=\"horizontal\"]) section > ::slotted(*) { flex: 1 0 fit-content; ... } */\n.a2ui-surface .a2ui-list[data-direction=\"horizontal\"] > section > * {\n flex: 1 0 fit-content;\n max-width: min(80%, 400px);\n}\n\n/* =========================================================================\n * DateTimeInput (from Lit datetime-input.ts static styles)\n * ========================================================================= */\n\n/* :host { display: block; flex: var(--weight); min-height: 0; overflow: auto; } */\n.a2ui-surface .a2ui-datetime-input {\n display: block;\n flex: var(--weight);\n min-height: 0;\n overflow: auto;\n}\n\n/* input { display: block; border-radius: 8px; padding: 8px; border: 1px solid #ccc; width: 100%; } */\n/* Use :where() to match Lit's low specificity (0,0,0,1) so theme utility classes can override */\n:where(.a2ui-surface .a2ui-datetime-input) input {\n display: block;\n border-radius: 8px;\n padding: 8px;\n border: 1px solid #ccc;\n width: 100%;\n}\n\n/* =========================================================================\n * Global box-sizing (matches Lit's * { box-sizing: border-box; } in components)\n * ========================================================================= */\n\n.a2ui-surface *,\n.a2ui-surface *::before,\n.a2ui-surface *::after {\n box-sizing: border-box;\n}\n`;\n\n/**\n * Injects A2UI structural styles into the document head.\n * Includes utility classes (layout-*, typography-*, color-*, etc.) and React-specific overrides.\n * Call this once at application startup.\n *\n * NOTE: CSS variables (--n-*, --p-*, etc.) must be defined by the host application on :root,\n * just like in the Lit renderer. This allows full customization of the color palette.\n *\n * @example\n * ```tsx\n * import { injectStyles } from '@a2ui/react/styles';\n *\n * // In your app entry point:\n * injectStyles();\n * ```\n */\nexport function injectStyles(): void {\n if (typeof document === \"undefined\") {\n return; // SSR safety\n }\n\n const styleId = \"a2ui-structural-styles\";\n\n // Avoid duplicate injection\n if (document.getElementById(styleId)) {\n return;\n }\n\n const styleElement = document.createElement(\"style\");\n styleElement.id = styleId;\n // Include structural (utility classes) and component-specific styles\n // Note: CSS variables (palette) must be defined by the host application on :root,\n // just like in the Lit renderer. This allows full customization.\n styleElement.textContent =\n resetStyles + \"\\n\" + structuralStyles + \"\\n\" + componentSpecificStyles;\n document.head.appendChild(styleElement);\n}\n\n/**\n * Removes injected A2UI styles from the document.\n * Useful for cleanup in tests or when unmounting.\n */\nexport function removeStyles(): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const styleElement = document.getElementById(\"a2ui-structural-styles\");\n if (styleElement) {\n styleElement.remove();\n }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,mBAA2B,OAAO,iBAAiB,QAC9D,eACA,kBACD;;;;;;;;;;;;AAaD,MAAa,0BAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwa/C,SAAgB,eAAqB;AACnC,KAAI,OAAO,aAAa,YACtB;CAGF,MAAM,UAAU;AAGhB,KAAI,SAAS,eAAe,QAAQ,CAClC;CAGF,MAAM,eAAe,SAAS,cAAc,QAAQ;AACpD,cAAa,KAAK;AAIlB,cAAa,cACX,cAAc,OAAO,mBAAmB,OAAO;AACjD,UAAS,KAAK,YAAY,aAAa"}
|