doom-design-system 0.4.17 → 0.5.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/.agent/skills/doom/a2ui/a2ui-examples.md +289 -0
- package/.agent/skills/doom/a2ui/a2ui-principles.md +49 -0
- package/.agent/skills/doom/a2ui/a2ui-protocol.md +191 -0
- package/.agent/skills/doom/components/a2ui.md +46 -0
- package/.agent/skills/doom/components/chart.md +69 -34
- package/.agent/skills/doom/components/copybutton.md +41 -0
- package/.agent/skills/doom/components/sidebar.md +92 -0
- package/.agent/skills/doom/index.md +1 -0
- package/README.md +1 -1
- package/dist/components/A2UI/Renderer.d.ts +51 -0
- package/dist/components/A2UI/Renderer.js +116 -0
- package/dist/components/A2UI/catalog.d.ts +60 -0
- package/dist/components/A2UI/catalog.js +1079 -0
- package/dist/components/A2UI/index.d.ts +13 -0
- package/dist/components/A2UI/index.js +19 -0
- package/dist/components/A2UI/mapping.d.ts +2 -0
- package/dist/components/A2UI/mapping.js +100 -0
- package/dist/components/A2UI/types/components.d.ts +69 -0
- package/dist/components/A2UI/types/components.js +8 -0
- package/dist/components/A2UI/types/index.d.ts +11 -0
- package/dist/components/A2UI/types/index.js +9 -0
- package/dist/components/A2UI/types/messages.d.ts +67 -0
- package/dist/components/A2UI/types/messages.js +9 -0
- package/dist/components/A2UI/types/values.d.ts +78 -0
- package/dist/components/A2UI/types/values.js +41 -0
- package/dist/components/A2UI/utils/extractComponent.d.ts +27 -0
- package/dist/components/A2UI/utils/extractComponent.js +39 -0
- package/dist/components/A2UI/utils/index.d.ts +8 -0
- package/dist/components/A2UI/utils/index.js +8 -0
- package/dist/components/A2UI/utils/resolveTree.d.ts +30 -0
- package/dist/components/A2UI/utils/resolveTree.js +126 -0
- package/dist/components/A2UI/utils/resolveValue.d.ts +53 -0
- package/dist/components/A2UI/utils/resolveValue.js +100 -0
- package/dist/components/A2UI/wrappers/ChartWrapper.d.ts +20 -0
- package/dist/components/A2UI/wrappers/ChartWrapper.js +27 -0
- package/dist/components/A2UI/wrappers/index.d.ts +1 -0
- package/dist/components/A2UI/wrappers/index.js +1 -0
- package/dist/components/Accordion/Accordion.module.css +8 -8
- package/dist/components/ActionRow/ActionRow.js +1 -1
- package/dist/components/ActionRow/ActionRow.module.css +3 -3
- package/dist/components/Alert/Alert.module.css +4 -4
- package/dist/components/Avatar/Avatar.module.css +8 -8
- package/dist/components/Badge/Badge.module.css +8 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.module.css +3 -3
- package/dist/components/Button/Button.module.css +17 -11
- package/dist/components/Card/Card.d.ts +17 -2
- package/dist/components/Card/Card.js +24 -2
- package/dist/components/Card/Card.module.css +35 -3
- package/dist/components/Chart/Chart.d.ts +15 -14
- package/dist/components/Chart/Chart.js +18 -25
- package/dist/components/Chart/Chart.module.css +17 -9
- package/dist/components/Chart/behaviors/Cursor.d.ts +38 -0
- package/dist/components/Chart/behaviors/Cursor.js +29 -0
- package/dist/components/Chart/behaviors/Dim.d.ts +37 -0
- package/dist/components/Chart/behaviors/Dim.js +52 -0
- package/dist/components/Chart/behaviors/Markers.d.ts +35 -0
- package/dist/components/Chart/behaviors/Markers.js +60 -0
- package/dist/components/Chart/behaviors/Selection.d.ts +26 -0
- package/dist/components/Chart/behaviors/Selection.js +31 -0
- package/dist/components/Chart/behaviors/SelectionUpdate.d.ts +29 -0
- package/dist/components/Chart/behaviors/SelectionUpdate.js +62 -0
- package/dist/components/Chart/behaviors/Tooltip.d.ts +30 -0
- package/dist/components/Chart/behaviors/Tooltip.js +27 -0
- package/dist/components/Chart/behaviors/index.d.ts +6 -0
- package/dist/components/Chart/behaviors/index.js +6 -0
- package/dist/components/Chart/context.d.ts +3 -0
- package/dist/components/Chart/{ChartContext.js → context.js} +1 -1
- package/dist/components/Chart/hooks/useChartBehaviors.d.ts +3 -0
- package/dist/components/Chart/hooks/useChartBehaviors.js +85 -0
- package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.d.ts +31 -0
- package/dist/components/Chart/sensors/DataHoverSensor/DataHoverSensor.js +58 -0
- package/dist/components/Chart/sensors/DataHoverSensor/index.d.ts +1 -0
- package/dist/components/Chart/sensors/DataHoverSensor/index.js +1 -0
- package/dist/components/Chart/sensors/KeyboardSensor.d.ts +8 -0
- package/dist/components/Chart/sensors/KeyboardSensor.js +82 -0
- package/dist/components/Chart/sensors/SelectionSensor.d.ts +8 -0
- package/dist/components/Chart/sensors/SelectionSensor.js +41 -0
- package/dist/components/Chart/sensors/SensorManager/SensorManager.d.ts +10 -0
- package/dist/components/Chart/sensors/SensorManager/SensorManager.js +86 -0
- package/dist/components/Chart/sensors/SensorManager/index.d.ts +1 -0
- package/dist/components/Chart/sensors/SensorManager/index.js +1 -0
- package/dist/components/Chart/sensors/index.d.ts +4 -0
- package/dist/components/Chart/sensors/index.js +4 -0
- package/dist/components/Chart/sensors/utils/search.d.ts +15 -0
- package/dist/components/Chart/sensors/utils/search.js +40 -0
- package/dist/components/Chart/sensors/utils/strategies/BinaryXStrategy/index.d.ts +14 -0
- package/dist/components/Chart/sensors/utils/strategies/BinaryXStrategy/index.js +65 -0
- package/dist/components/Chart/sensors/utils/strategies/LinearStrategy/index.d.ts +19 -0
- package/dist/components/Chart/sensors/utils/strategies/LinearStrategy/index.js +50 -0
- package/dist/components/Chart/sensors/utils/strategies/QuadtreeStrategy/index.d.ts +17 -0
- package/dist/components/Chart/sensors/utils/strategies/QuadtreeStrategy/index.js +51 -0
- package/dist/components/Chart/sensors/utils/strategies/types.d.ts +17 -0
- package/dist/components/Chart/state/EventContext.d.ts +18 -0
- package/dist/components/Chart/state/EventContext.js +65 -0
- package/dist/components/Chart/state/store/chart.store.d.ts +52 -0
- package/dist/components/Chart/state/store/chart.store.js +140 -0
- package/dist/components/Chart/state/store/createStore.d.ts +12 -0
- package/dist/components/Chart/state/store/createStore.js +23 -0
- package/dist/components/Chart/state/store/slices/data.slice.d.ts +9 -0
- package/dist/components/Chart/state/store/slices/data.slice.js +7 -0
- package/dist/components/Chart/state/store/slices/dimensions.slice.d.ts +21 -0
- package/dist/components/Chart/state/store/slices/dimensions.slice.js +22 -0
- package/dist/components/Chart/state/store/slices/interactions.slice.d.ts +4 -0
- package/dist/components/Chart/state/store/slices/interactions.slice.js +3 -0
- package/dist/components/Chart/state/store/slices/lifecycle.slice.d.ts +9 -0
- package/dist/components/Chart/state/store/slices/lifecycle.slice.js +7 -0
- package/dist/components/Chart/state/store/slices/scales.slice.d.ts +8 -0
- package/dist/components/Chart/state/store/slices/scales.slice.js +3 -0
- package/dist/components/Chart/state/store/slices/series.slice.d.ts +8 -0
- package/dist/components/Chart/state/store/slices/series.slice.js +52 -0
- package/dist/components/Chart/subcomponents/Axis/Axis.d.ts +1 -0
- package/dist/components/Chart/subcomponents/Axis/Axis.js +73 -0
- package/dist/components/Chart/subcomponents/Axis/Axis.module.css +34 -0
- package/dist/components/Chart/subcomponents/BarSeries/BarSeries.d.ts +13 -0
- package/dist/components/Chart/subcomponents/BarSeries/BarSeries.js +95 -0
- package/dist/components/Chart/subcomponents/BarSeries/BarSeries.module.css +10 -0
- package/dist/components/Chart/subcomponents/Cursor/Cursor.d.ts +15 -0
- package/dist/components/Chart/subcomponents/Cursor/Cursor.js +51 -0
- package/dist/components/Chart/subcomponents/Cursor/Cursor.module.css +14 -0
- package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.d.ts +4 -0
- package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.js +95 -0
- package/dist/components/Chart/subcomponents/CustomSeries/CustomSeries.module.css +4 -0
- package/dist/components/Chart/subcomponents/CustomSeries/index.d.ts +1 -0
- package/dist/components/Chart/subcomponents/CustomSeries/index.js +1 -0
- package/dist/components/Chart/subcomponents/Footer/Footer.d.ts +8 -0
- package/dist/components/Chart/{ChartFooter.js → subcomponents/Footer/Footer.js} +4 -4
- package/dist/components/Chart/subcomponents/Footer/Footer.module.css +4 -0
- package/dist/components/Chart/subcomponents/Footer/index.d.ts +2 -0
- package/dist/components/Chart/subcomponents/Footer/index.js +1 -0
- package/dist/components/Chart/subcomponents/Grid/Grid.d.ts +1 -0
- package/dist/components/Chart/subcomponents/Grid/Grid.js +16 -0
- package/dist/components/Chart/subcomponents/Grid/Grid.module.css +12 -0
- package/dist/components/Chart/subcomponents/Header/Header.d.ts +9 -0
- package/dist/components/Chart/subcomponents/Header/Header.js +13 -0
- package/dist/components/Chart/subcomponents/Header/Header.module.css +8 -0
- package/dist/components/Chart/subcomponents/Header/index.d.ts +2 -0
- package/dist/components/Chart/subcomponents/Header/index.js +1 -0
- package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.d.ts +13 -0
- package/dist/components/Chart/subcomponents/InteractionLayer/InteractionLayer.js +157 -0
- package/dist/components/Chart/{ChartLegend.d.ts → subcomponents/Legend/Legend.d.ts} +3 -3
- package/dist/components/Chart/{ChartLegend.js → subcomponents/Legend/Legend.js} +12 -11
- package/dist/components/Chart/subcomponents/Legend/Legend.module.css +33 -0
- package/dist/components/Chart/subcomponents/Legend/index.d.ts +2 -0
- package/dist/components/Chart/subcomponents/Legend/index.js +1 -0
- package/dist/components/Chart/subcomponents/LineSeries/LineSeries.d.ts +21 -0
- package/dist/components/Chart/subcomponents/LineSeries/LineSeries.js +147 -0
- package/dist/components/Chart/subcomponents/LineSeries/LineSeries.module.css +22 -0
- package/dist/components/Chart/subcomponents/Plot/Plot.d.ts +7 -0
- package/dist/components/Chart/subcomponents/Plot/Plot.js +42 -0
- package/dist/components/Chart/subcomponents/Root/Root.d.ts +8 -0
- package/dist/components/Chart/subcomponents/Root/Root.js +215 -0
- package/dist/components/Chart/subcomponents/Root/Root.module.css +83 -0
- package/dist/components/Chart/subcomponents/Root/index.d.ts +2 -0
- package/dist/components/Chart/subcomponents/Root/index.js +1 -0
- package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.d.ts +14 -0
- package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.js +80 -0
- package/dist/components/Chart/subcomponents/ScatterSeries/ScatterSeries.module.css +6 -0
- package/dist/components/Chart/subcomponents/Series/Series.d.ts +2 -0
- package/dist/components/Chart/subcomponents/Series/Series.js +35 -0
- package/dist/components/Chart/subcomponents/Series/Series.module.css +129 -0
- package/dist/components/Chart/subcomponents/Series/index.d.ts +1 -0
- package/dist/components/Chart/subcomponents/Series/index.js +2 -0
- package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.d.ts +12 -0
- package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.js +34 -0
- package/dist/components/Chart/subcomponents/SeriesPoint/SeriesPoint.module.css +9 -0
- package/dist/components/Chart/subcomponents/Tooltip/DefaultTooltip.d.ts +1 -0
- package/dist/components/Chart/subcomponents/Tooltip/DefaultTooltip.js +12 -0
- package/dist/components/Chart/subcomponents/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Chart/subcomponents/Tooltip/Tooltip.js +98 -0
- package/dist/components/Chart/subcomponents/Tooltip/Tooltip.module.css +68 -0
- package/dist/components/Chart/subcomponents/Tooltip/types.d.ts +12 -0
- package/dist/components/Chart/subcomponents/index.d.ts +11 -0
- package/dist/components/Chart/subcomponents/index.js +13 -0
- package/dist/components/Chart/tests/chart-test-utils.d.ts +10 -0
- package/dist/components/Chart/tests/chart-test-utils.js +43 -0
- package/dist/components/Chart/types/accessors.d.ts +9 -0
- package/dist/components/Chart/types/accessors.js +12 -0
- package/dist/components/Chart/types/common.d.ts +1 -0
- package/dist/components/Chart/types/config.d.ts +22 -0
- package/dist/components/Chart/types/context.d.ts +77 -0
- package/dist/components/Chart/types/context.js +1 -0
- package/dist/components/Chart/types/events.d.ts +69 -0
- package/dist/components/Chart/types/events.js +1 -0
- package/dist/components/Chart/types/index.d.ts +11 -0
- package/dist/components/Chart/types/index.js +10 -0
- package/dist/components/Chart/types/interaction.d.ts +50 -0
- package/dist/components/Chart/types/interaction.js +20 -0
- package/dist/components/Chart/types/legend.d.ts +7 -0
- package/dist/components/Chart/types/legend.js +4 -0
- package/dist/components/Chart/types/props.d.ts +26 -0
- package/dist/components/Chart/types/props.js +1 -0
- package/dist/components/Chart/types/scales.d.ts +4 -0
- package/dist/components/Chart/types/scales.js +1 -0
- package/dist/components/Chart/types/selection.d.ts +3 -0
- package/dist/components/Chart/types/selection.js +1 -0
- package/dist/components/Chart/types/series.d.ts +32 -0
- package/dist/components/Chart/types/series.js +1 -0
- package/dist/components/Chart/utils/Reposition/Reposition.d.ts +120 -0
- package/dist/components/Chart/utils/Reposition/Reposition.js +256 -0
- package/dist/components/Chart/utils/Reposition/edgeDetection.d.ts +67 -0
- package/dist/components/Chart/utils/Reposition/edgeDetection.js +51 -0
- package/dist/components/Chart/utils/Reposition/index.d.ts +7 -0
- package/dist/components/Chart/utils/Reposition/index.js +5 -0
- package/dist/components/Chart/utils/accessors.d.ts +5 -0
- package/dist/components/Chart/utils/accessors.js +9 -0
- package/dist/components/Chart/utils/componentDetection.d.ts +20 -0
- package/dist/components/Chart/utils/componentDetection.js +47 -0
- package/dist/components/Chart/utils/coordinates.d.ts +38 -0
- package/dist/components/Chart/utils/coordinates.js +56 -0
- package/dist/components/Chart/utils/d3.d.ts +340 -0
- package/dist/components/Chart/utils/d3.js +7 -0
- package/dist/components/Chart/utils/hooks.d.ts +10 -0
- package/dist/components/Chart/utils/hooks.js +29 -0
- package/dist/components/Chart/utils/interaction.d.ts +15 -0
- package/dist/components/Chart/utils/interaction.js +110 -0
- package/dist/components/Chart/utils/path.d.ts +5 -0
- package/dist/components/Chart/utils/path.js +41 -0
- package/dist/components/Chart/utils/scales.d.ts +17 -0
- package/dist/components/Chart/utils/scales.js +41 -0
- package/dist/components/Chart/utils/shapes.d.ts +4 -0
- package/dist/components/Chart/utils/shapes.js +20 -0
- package/dist/components/Checkbox/Checkbox.module.css +8 -8
- package/dist/components/Chip/Chip.d.ts +2 -2
- package/dist/components/Chip/Chip.js +2 -1
- package/dist/components/Chip/Chip.module.css +27 -24
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/Combobox.module.css +30 -24
- package/dist/components/CopyButton/CopyButton.d.ts +12 -0
- package/dist/components/CopyButton/CopyButton.js +36 -0
- package/dist/components/CopyButton/CopyButton.module.css +91 -0
- package/dist/components/CopyButton/index.d.ts +1 -0
- package/dist/components/CopyButton/index.js +1 -0
- package/dist/components/Drawer/Drawer.d.ts +1 -0
- package/dist/components/Drawer/Drawer.js +1 -2
- package/dist/components/Drawer/Drawer.module.css +9 -8
- package/dist/components/Dropdown/Dropdown.module.css +4 -4
- package/dist/components/FileUpload/FileUpload.module.css +21 -21
- package/dist/components/Form/Form.module.css +2 -2
- package/dist/components/Input/Input.module.css +14 -12
- package/dist/components/Label/Label.module.css +2 -2
- package/dist/components/Layout/Box.d.ts +41 -0
- package/dist/components/Layout/Box.js +99 -0
- package/dist/components/Layout/Layout.d.ts +6 -10
- package/dist/components/Layout/Layout.js +7 -6
- package/dist/components/Layout/Layout.module.css +2 -2
- package/dist/components/Link/Link.module.css +5 -5
- package/dist/components/Modal/Modal.d.ts +1 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.module.css +12 -12
- package/dist/components/Page/Page.module.css +4 -3
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination.module.css +21 -7
- package/dist/components/Popover/Popover.module.css +1 -1
- package/dist/components/ProgressBar/ProgressBar.module.css +3 -3
- package/dist/components/RadioGroup/RadioGroup.module.css +9 -9
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.module.css +11 -11
- package/dist/components/Sheet/Sheet.d.ts +1 -0
- package/dist/components/Sheet/Sheet.js +1 -3
- package/dist/components/Sheet/Sheet.module.css +9 -9
- package/dist/components/Sidebar/Sidebar.d.ts +27 -0
- package/dist/components/Sidebar/Sidebar.js +82 -0
- package/dist/components/Sidebar/Sidebar.module.css +84 -0
- package/dist/components/Sidebar/context.d.ts +3 -0
- package/dist/components/Sidebar/context.js +9 -0
- package/dist/components/Sidebar/hooks.d.ts +2 -0
- package/dist/components/Sidebar/hooks.js +14 -0
- package/dist/components/Sidebar/index.d.ts +1 -0
- package/dist/components/Sidebar/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Footer/Footer.d.ts +2 -0
- package/dist/components/Sidebar/subcomponents/Footer/Footer.js +6 -0
- package/dist/components/Sidebar/subcomponents/Footer/Footer.module.css +6 -0
- package/dist/components/Sidebar/subcomponents/Footer/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Footer/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Group/Group.d.ts +2 -0
- package/dist/components/Sidebar/subcomponents/Group/Group.js +16 -0
- package/dist/components/Sidebar/subcomponents/Group/Group.module.css +86 -0
- package/dist/components/Sidebar/subcomponents/Group/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Group/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Header/Header.d.ts +2 -0
- package/dist/components/Sidebar/subcomponents/Header/Header.js +6 -0
- package/dist/components/Sidebar/subcomponents/Header/Header.module.css +11 -0
- package/dist/components/Sidebar/subcomponents/Header/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Header/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Item/Item.d.ts +5 -0
- package/dist/components/Sidebar/subcomponents/Item/Item.js +29 -0
- package/dist/components/Sidebar/subcomponents/Item/Item.module.css +56 -0
- package/dist/components/Sidebar/subcomponents/Item/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Item/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.d.ts +3 -0
- package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.js +38 -0
- package/dist/components/Sidebar/subcomponents/MobileOverlay/MobileOverlay.module.css +39 -0
- package/dist/components/Sidebar/subcomponents/MobileOverlay/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/MobileOverlay/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.d.ts +2 -0
- package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.js +10 -0
- package/dist/components/Sidebar/subcomponents/MobileTrigger/MobileTrigger.module.css +5 -0
- package/dist/components/Sidebar/subcomponents/MobileTrigger/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/MobileTrigger/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Nav/Nav.d.ts +5 -0
- package/dist/components/Sidebar/subcomponents/Nav/Nav.js +8 -0
- package/dist/components/Sidebar/subcomponents/Nav/Nav.module.css +12 -0
- package/dist/components/Sidebar/subcomponents/Nav/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Nav/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Rail/Rail.d.ts +2 -0
- package/dist/components/Sidebar/subcomponents/Rail/Rail.js +6 -0
- package/dist/components/Sidebar/subcomponents/Rail/Rail.module.css +64 -0
- package/dist/components/Sidebar/subcomponents/Rail/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Rail/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/Section/Section.d.ts +5 -0
- package/dist/components/Sidebar/subcomponents/Section/Section.js +23 -0
- package/dist/components/Sidebar/subcomponents/Section/Section.module.css +92 -0
- package/dist/components/Sidebar/subcomponents/Section/index.d.ts +1 -0
- package/dist/components/Sidebar/subcomponents/Section/index.js +1 -0
- package/dist/components/Sidebar/subcomponents/index.d.ts +9 -0
- package/dist/components/Sidebar/subcomponents/index.js +9 -0
- package/dist/components/Sidebar/types.d.ts +82 -0
- package/dist/components/Sidebar/types.js +1 -0
- package/dist/components/Sidebar/utils.d.ts +8 -0
- package/dist/components/Sidebar/utils.js +128 -0
- package/dist/components/Skeleton/Skeleton.module.css +4 -4
- package/dist/components/Slat/Slat.module.css +6 -6
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.module.css +4 -4
- package/dist/components/SplitButton/SplitButton.module.css +16 -12
- package/dist/components/Switch/Switch.module.css +8 -8
- package/dist/components/Table/FilterBuilder/FilterBuilder.module.css +6 -6
- package/dist/components/Table/FilterBuilder/FilterConditionRow.module.css +7 -8
- package/dist/components/Table/FilterBuilder/FilterGroup.js +3 -6
- package/dist/components/Table/FilterBuilder/FilterGroup.module.css +61 -80
- package/dist/components/Table/FilterBuilder/FilterSheet.module.css +7 -7
- package/dist/components/Table/FilterBuilder/FilterSheetNested.js +2 -1
- package/dist/components/Table/Table.d.ts +6 -1
- package/dist/components/Table/Table.js +27 -2
- package/dist/components/Table/Table.module.css +27 -27
- package/dist/components/Table/TableHeaderFilter.module.css +13 -13
- package/dist/components/Tabs/Tabs.module.css +11 -26
- package/dist/components/Textarea/Textarea.module.css +5 -4
- package/dist/components/Toast/Toast.module.css +11 -11
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/styles/globals.css +119 -2
- package/dist/styles/{tokens.d.ts → palettes.d.ts} +0 -60
- package/dist/styles/{tokens.js → palettes.js} +3 -74
- package/dist/styles/themes/definitions.d.ts +0 -240
- package/dist/styles/themes/definitions.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -3
- package/dist/components/Chart/ChartContext.d.ts +0 -27
- package/dist/components/Chart/ChartFooter.d.ts +0 -8
- package/dist/components/Chart/ChartHeader.d.ts +0 -9
- package/dist/components/Chart/ChartHeader.js +0 -14
- package/dist/components/Chart/ChartPlot.d.ts +0 -12
- package/dist/components/Chart/ChartPlot.js +0 -223
- package/dist/components/Chart/ChartRoot.d.ts +0 -6
- package/dist/components/Chart/ChartRoot.js +0 -120
- package/dist/components/Chart/renderers.d.ts +0 -50
- package/dist/components/Chart/renderers.js +0 -389
- package/dist/components/Chart/types.d.ts +0 -86
- package/dist/components/Table/FilterBuilder/utils/tree-utils.test.js +0 -167
- package/dist/components/Table/utils/arrayFilter.test.js +0 -32
- package/dist/components/Table/utils/filterAst.test.js +0 -110
- /package/dist/components/Chart/{types.js → sensors/utils/strategies/types.js} +0 -0
- /package/dist/components/{Table/FilterBuilder/utils/tree-utils.test.d.ts → Chart/subcomponents/Tooltip/types.js} +0 -0
- /package/dist/components/{Table/utils/arrayFilter.test.d.ts → Chart/types/common.js} +0 -0
- /package/dist/components/{Table/utils/filterAst.test.d.ts → Chart/types/config.js} +0 -0
|
@@ -8,31 +8,38 @@ import { Chart } from "doom-design-system";
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
| Prop | Type
|
|
12
|
-
| --------------- |
|
|
13
|
-
| `data` | `T[]`
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| --------------- | ---------------------------- | ----------- | ----------------------------------- |
|
|
13
|
+
| `data` | `T[]` | required | Data array |
|
|
14
|
+
| `x` | `(d: T) => string \| number` | required | Accessor function for X-axis values |
|
|
15
|
+
| `y` | `(d: T) => number` | required | Accessor function for Y-axis values |
|
|
16
|
+
| `type` | `"line" \| "area" \| "bar"` | — | Chart type (shorthand API) |
|
|
17
|
+
| `title` | `string \| ReactNode` | — | Chart title |
|
|
18
|
+
| `subtitle` | `string` | — | Chart subtitle |
|
|
19
|
+
| `withLegend` | `boolean` | — | Show legend |
|
|
20
|
+
| `withFrame` | `boolean` | `true` | Render card frame around chart |
|
|
21
|
+
| `variant` | `"default" \| "solid"` | `"default"` | Visual variant |
|
|
22
|
+
| `flat` | `boolean` | `false` | Remove shadow |
|
|
23
|
+
| `d3Config` | `ChartConfig` | — | D3 configuration options |
|
|
24
|
+
| `render` | `(ctx: DrawContext) => void` | — | Custom D3 render function |
|
|
25
|
+
| `renderTooltip` | `(data: T) => ReactNode` | — | Custom tooltip renderer |
|
|
26
|
+
| `onValueChange` | `(data: T \| null) => void` | — | Callback when hovered value changes |
|
|
27
|
+
| `style` | `CSSProperties` | — | Inline styles |
|
|
28
|
+
| `className` | `string` | — | CSS class name |
|
|
29
|
+
|
|
30
|
+
## D3 Config
|
|
25
31
|
|
|
26
32
|
```tsx
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const d3Config = {
|
|
34
|
+
margin: { top: 20, right: 20, bottom: 40, left: 50 },
|
|
35
|
+
grid: true,
|
|
36
|
+
withGradient: true,
|
|
37
|
+
showDots: true,
|
|
38
|
+
hideYAxisDomain: true,
|
|
39
|
+
xAxisLabel: "Month",
|
|
40
|
+
yAxisLabel: "Revenue (USD)",
|
|
41
|
+
curve: d3Shape.curveMonotoneX, // requires import from d3-shape
|
|
42
|
+
animate: true,
|
|
36
43
|
};
|
|
37
44
|
```
|
|
38
45
|
|
|
@@ -41,31 +48,59 @@ const config = {
|
|
|
41
48
|
### Shorthand API
|
|
42
49
|
|
|
43
50
|
```tsx
|
|
51
|
+
const data = [
|
|
52
|
+
{ month: "Jan", revenue: 4500 },
|
|
53
|
+
{ month: "Feb", revenue: 5200 },
|
|
54
|
+
{ month: "Mar", revenue: 4900 },
|
|
55
|
+
];
|
|
56
|
+
|
|
44
57
|
<Chart
|
|
45
|
-
type="
|
|
58
|
+
type="area"
|
|
46
59
|
data={data}
|
|
47
|
-
|
|
48
|
-
|
|
60
|
+
x={(d) => d.month}
|
|
61
|
+
y={(d) => d.revenue}
|
|
49
62
|
title="Monthly Revenue"
|
|
50
63
|
withLegend
|
|
51
|
-
|
|
64
|
+
d3Config={{ grid: true, withGradient: true }}
|
|
65
|
+
/>;
|
|
52
66
|
```
|
|
53
67
|
|
|
54
68
|
### Composition API
|
|
55
69
|
|
|
56
70
|
```tsx
|
|
57
|
-
<Chart.Root
|
|
71
|
+
<Chart.Root
|
|
72
|
+
data={data}
|
|
73
|
+
x={(d) => d.label}
|
|
74
|
+
y={(d) => d.value}
|
|
75
|
+
d3Config={{ grid: true, showDots: true }}
|
|
76
|
+
>
|
|
58
77
|
<Chart.Header title="Sales" subtitle="Last 12 months">
|
|
59
78
|
<Chart.Legend />
|
|
60
79
|
</Chart.Header>
|
|
61
|
-
<Chart.Plot type="area" />
|
|
62
|
-
<Chart.Footer>Custom footer</Chart.Footer>
|
|
80
|
+
<Chart.Plot type="area" color="var(--primary)" />
|
|
81
|
+
<Chart.Footer>Custom footer content</Chart.Footer>
|
|
63
82
|
</Chart.Root>
|
|
64
83
|
```
|
|
65
84
|
|
|
85
|
+
### Custom D3 Render
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Chart
|
|
89
|
+
data={pieData}
|
|
90
|
+
x={(d) => d.label}
|
|
91
|
+
y={(d) => d.value}
|
|
92
|
+
d3Config={{ showAxes: false, grid: false }}
|
|
93
|
+
render={(ctx) => {
|
|
94
|
+
// Full D3 access via ctx.g (SVG group)
|
|
95
|
+
// ctx.data, ctx.xScale, ctx.yScale available
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
```
|
|
99
|
+
|
|
66
100
|
## Guidelines
|
|
67
101
|
|
|
68
|
-
- Use shorthand API for simple charts.
|
|
69
|
-
- Use composition API for custom layouts.
|
|
70
|
-
-
|
|
71
|
-
-
|
|
102
|
+
- Use shorthand API for simple line/area/bar charts.
|
|
103
|
+
- Use composition API for custom layouts with headers/footers.
|
|
104
|
+
- Use `render` prop for fully custom D3 visualizations (pie, treemap, etc.).
|
|
105
|
+
- Built on D3.js with full access to scales and selections.
|
|
106
|
+
- Supports touch interactions and responsive sizing.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# CopyButton Component
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { CopyButton } from "doom-design-system";
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| ------------ | -------------- | ------------- | ------------------------ |
|
|
13
|
+
| `value` | `string` | **required** | Text to copy |
|
|
14
|
+
| `variant` | Button variant | `"secondary"` | Visual style |
|
|
15
|
+
| `size` | Button size | `"md"` | Button size |
|
|
16
|
+
| `copiedText` | `string` | `"Copied!"` | Text shown after copy |
|
|
17
|
+
| `resetDelay` | `number` | `2000` | Ms before reset to orig. |
|
|
18
|
+
|
|
19
|
+
Plus all standard `<button>` HTML attributes.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<CopyButton value={textToCopy}>Copy</CopyButton>
|
|
25
|
+
|
|
26
|
+
<CopyButton value={code} variant="ghost" size="sm">
|
|
27
|
+
Copy Code
|
|
28
|
+
</CopyButton>
|
|
29
|
+
|
|
30
|
+
<CopyButton copiedText="Done!" value={referenceDoc}>
|
|
31
|
+
Copy Reference
|
|
32
|
+
</CopyButton>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Behavior
|
|
36
|
+
|
|
37
|
+
- **Tactile Pop Animation**: Press effect on click, springy scale-in for success state
|
|
38
|
+
- Text changes to `copiedText` (default: "Copied!")
|
|
39
|
+
- Button width preserved (doesn't jump)
|
|
40
|
+
- Auto-resets after `resetDelay` ms (default 2s)
|
|
41
|
+
- Variant stays the same (no jarring color change)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Sidebar Component
|
|
2
|
+
|
|
3
|
+
The Sidebar is a complex navigation component supporting dual-mode (Standard and Rail), collapsible sections, groups, and hover-peek functionality.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Sidebar } from "doom-design-system";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
### Sidebar
|
|
14
|
+
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
| ----------------- | ---------------------------------------------- | ------- | ---------------------------------------------------------------- |
|
|
17
|
+
| `withRail` | `boolean` | `false` | Enables the two-column rail navigation. |
|
|
18
|
+
| `collapsed` | `boolean` | `false` | Collapses the main panel (standard) or whole sidebar (rail). |
|
|
19
|
+
| `activeSection` | `string` | — | The ID of the currently active Section. |
|
|
20
|
+
| `activeItem` | `string` | — | The `href` of the currently active Item. |
|
|
21
|
+
| `onNavigate` | `(href: string, e?: React.MouseEvent) => void` | — | Navigation callback. |
|
|
22
|
+
| `onSectionChange` | `(id: string) => void` | — | Callback when the active section changes (useful for Rail mode). |
|
|
23
|
+
| `brandIcon` | `React.ReactNode` | — | Icon displayed at the top of the Sidebar/Rail. |
|
|
24
|
+
|
|
25
|
+
### Sidebar.Section
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
| ---------- | ----------------- | ------- | ---------------------------------------------- |
|
|
29
|
+
| `id` | `string` | — | Unique identifier for section switching. |
|
|
30
|
+
| `label` | `string` | — | Descriptive label for the section. |
|
|
31
|
+
| `icon` | `React.ReactNode` | — | Icon for the section (required for Rail mode). |
|
|
32
|
+
| `expanded` | `boolean` | — | Controlled expansion state. |
|
|
33
|
+
|
|
34
|
+
### Sidebar.Group
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default | Description |
|
|
37
|
+
| ---------- | ----------------- | ------- | -------------------------------- |
|
|
38
|
+
| `id` | `string` | — | Unique identifier for the group. |
|
|
39
|
+
| `label` | `string` | — | Descriptive label for the group. |
|
|
40
|
+
| `icon` | `React.ReactNode` | — | Optional icon for the group. |
|
|
41
|
+
| `expanded` | `boolean` | — | Controlled expansion state. |
|
|
42
|
+
|
|
43
|
+
### Sidebar.Item
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
| --------------- | ----------------- | ------- | ----------------------------------------------- |
|
|
47
|
+
| `href` | `string` | — | Link destination. |
|
|
48
|
+
| `icon` | `React.ReactNode` | — | Optional icon. |
|
|
49
|
+
| `appendContent` | `React.ReactNode` | — | Content (badges, chips) at the end of the item. |
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
### Standard Sidebar
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
<Sidebar activeItem="/home">
|
|
57
|
+
<Sidebar.Header>App Logo</Sidebar.Header>
|
|
58
|
+
<Sidebar.Nav>
|
|
59
|
+
<Sidebar.Section id="main" label="Main" icon={<Home />}>
|
|
60
|
+
<Sidebar.Item href="/home" icon={<Home />}>
|
|
61
|
+
Dashboard
|
|
62
|
+
</Sidebar.Item>
|
|
63
|
+
<Sidebar.Item href="/inbox">Inbox</Sidebar.Item>
|
|
64
|
+
</Sidebar.Section>
|
|
65
|
+
</Sidebar.Nav>
|
|
66
|
+
</Sidebar>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Rail Mode with Groups
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Sidebar withRail activeSection="admin">
|
|
73
|
+
<Sidebar.Nav>
|
|
74
|
+
<Sidebar.Section id="main" label="Main" icon={<Home />}>
|
|
75
|
+
<Sidebar.Item href="/home">Home</Sidebar.Item>
|
|
76
|
+
</Sidebar.Section>
|
|
77
|
+
<Sidebar.Section id="admin" label="Admin" icon={<Settings />}>
|
|
78
|
+
<Sidebar.Group id="users" label="User Management">
|
|
79
|
+
<Sidebar.Item href="/users/list">User List</Sidebar.Item>
|
|
80
|
+
<Sidebar.Item href="/users/permissions">Permissions</Sidebar.Item>
|
|
81
|
+
</Sidebar.Group>
|
|
82
|
+
</Sidebar.Section>
|
|
83
|
+
</Sidebar.Nav>
|
|
84
|
+
</Sidebar>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Guidelines
|
|
88
|
+
|
|
89
|
+
- **Rail Icons**: Ensure every `Sidebar.Section` has an `icon` if `withRail` is enabled.
|
|
90
|
+
- **Snappy UI**: The component uses instant transitions for a high-performance feel.
|
|
91
|
+
- **Auto-collapse**: In rail mode, clicking an item auto-collapses to save space.
|
|
92
|
+
- **Accessibility**: Collapsed content is hidden via `display: none` to remove it from keyboard tab order.
|
|
@@ -112,6 +112,7 @@ function ThemeSwitcher() {
|
|
|
112
112
|
- [breadcrumbs.md](components/breadcrumbs.md) — Navigation hierarchy
|
|
113
113
|
- [link.md](components/link.md) — Anchor links
|
|
114
114
|
- [pagination.md](components/pagination.md) — Page navigation
|
|
115
|
+
- [sidebar.md](components/sidebar.md) — Multi-mode side navigation
|
|
115
116
|
- [tabs.md](components/tabs.md) — Tab navigation
|
|
116
117
|
|
|
117
118
|
### Forms
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Doom Design System
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ornelasEduardo/doom/actions/workflows/main.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/doom-design-system)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { A2UIComponentEntry, SurfaceUpdateMessage } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the A2UI Renderer component.
|
|
5
|
+
*/
|
|
6
|
+
export interface RendererProps {
|
|
7
|
+
/**
|
|
8
|
+
* A2UI surface update payload or array of component entries.
|
|
9
|
+
*
|
|
10
|
+
* Can be either:
|
|
11
|
+
* - A full `surfaceUpdate` payload with surfaceId and components
|
|
12
|
+
* - Just the components array for simpler usage
|
|
13
|
+
*/
|
|
14
|
+
surface: SurfaceUpdateMessage["surfaceUpdate"] | A2UIComponentEntry[];
|
|
15
|
+
/**
|
|
16
|
+
* ID of the root component to render.
|
|
17
|
+
*
|
|
18
|
+
* Required when `surface` is a components array.
|
|
19
|
+
* Optional when `surface` is a full payload (uses the first component if omitted).
|
|
20
|
+
*/
|
|
21
|
+
rootId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Data model for resolving path bindings.
|
|
24
|
+
*
|
|
25
|
+
* When components use `{ path: "/user/name" }` values,
|
|
26
|
+
* they are resolved against this object.
|
|
27
|
+
*/
|
|
28
|
+
dataModel?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A2UI Renderer Component
|
|
32
|
+
*
|
|
33
|
+
* Renders A2UI component trees following the official message schema.
|
|
34
|
+
* Handles adjacency list resolution, data binding, and component mapping.
|
|
35
|
+
*
|
|
36
|
+
* @see https://a2ui.org/reference/messages/
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const surface = {
|
|
41
|
+
* surfaceId: "main",
|
|
42
|
+
* components: [
|
|
43
|
+
* { id: "root", component: { Text: { text: { literalString: "Hello!" } } } }
|
|
44
|
+
* ]
|
|
45
|
+
* };
|
|
46
|
+
*
|
|
47
|
+
* <Renderer surface={surface} rootId="root" />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function Renderer({ surface, rootId, dataModel, }: RendererProps): React.ReactElement | null;
|
|
51
|
+
export type { RendererProps as A2UIProps };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
import { createElement as _createElement } from "react";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
import { componentMap } from "./mapping.js";
|
|
16
|
+
import { isA2UITextValue } from "./types/index.js";
|
|
17
|
+
import { resolveTextValue, resolveTree } from "./utils/index.js";
|
|
18
|
+
/**
|
|
19
|
+
* A2UI Renderer Component
|
|
20
|
+
*
|
|
21
|
+
* Renders A2UI component trees following the official message schema.
|
|
22
|
+
* Handles adjacency list resolution, data binding, and component mapping.
|
|
23
|
+
*
|
|
24
|
+
* @see https://a2ui.org/reference/messages/
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const surface = {
|
|
29
|
+
* surfaceId: "main",
|
|
30
|
+
* components: [
|
|
31
|
+
* { id: "root", component: { Text: { text: { literalString: "Hello!" } } } }
|
|
32
|
+
* ]
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* <Renderer surface={surface} rootId="root" />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function Renderer({ surface, rootId, dataModel = {}, }) {
|
|
39
|
+
var _a;
|
|
40
|
+
// Normalize input to components array
|
|
41
|
+
const components = Array.isArray(surface) ? surface : surface.components;
|
|
42
|
+
if (!components || components.length === 0) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
// Determine root ID
|
|
46
|
+
const effectiveRootId = rootId !== null && rootId !== void 0 ? rootId : (_a = components[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
47
|
+
if (!effectiveRootId) {
|
|
48
|
+
console.warn("A2UI: No root ID provided and no components available");
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// Resolve adjacency list to tree
|
|
52
|
+
const tree = resolveTree(components, effectiveRootId);
|
|
53
|
+
if (!tree) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
// Render the resolved tree
|
|
57
|
+
return _jsx(NodeRenderer, { dataModel: dataModel, node: tree });
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Internal component that renders a single resolved node.
|
|
61
|
+
*/
|
|
62
|
+
function NodeRenderer({ node, dataModel, }) {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
const { id, type, props, children } = node;
|
|
65
|
+
// Look up component (case-insensitive)
|
|
66
|
+
const Component = (_b = (_a = componentMap[type]) !== null && _a !== void 0 ? _a : componentMap[type.toLowerCase()]) !== null && _b !== void 0 ? _b : null;
|
|
67
|
+
if (!Component) {
|
|
68
|
+
console.warn(`A2UI: Unknown component type "${type}"`);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
// Resolve any data-bound props (including text -> children mapping)
|
|
72
|
+
const resolvedProps = resolveProps(props, dataModel);
|
|
73
|
+
// Render tree children (from adjacency list resolution)
|
|
74
|
+
const renderedChildren = children.map((child, index) => {
|
|
75
|
+
var _a;
|
|
76
|
+
if (typeof child === "string") {
|
|
77
|
+
return child;
|
|
78
|
+
}
|
|
79
|
+
return (_jsx(NodeRenderer, { dataModel: dataModel, node: child }, (_a = child.id) !== null && _a !== void 0 ? _a : index));
|
|
80
|
+
});
|
|
81
|
+
// Determine final children:
|
|
82
|
+
// 1. If there are tree children (from adjacency list), use those
|
|
83
|
+
// 2. Otherwise, use resolved children from props (e.g., from text prop)
|
|
84
|
+
const finalChildren = renderedChildren.length > 0 ? renderedChildren : resolvedProps.children;
|
|
85
|
+
// Remove children from props since we're passing it explicitly
|
|
86
|
+
const { children: _ } = resolvedProps, propsWithoutChildren = __rest(resolvedProps, ["children"]);
|
|
87
|
+
return (_createElement(Component, Object.assign({}, propsWithoutChildren, { key: id }), finalChildren));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Resolves data-bound values in props.
|
|
91
|
+
*
|
|
92
|
+
* Walks through props and resolves any A2UI text values
|
|
93
|
+
* (literalString or path references) to their actual values.
|
|
94
|
+
*
|
|
95
|
+
* Also handles A2UI-to-React prop mapping:
|
|
96
|
+
* - `text` prop is mapped to `children` for React components
|
|
97
|
+
*/
|
|
98
|
+
function resolveProps(props, dataModel) {
|
|
99
|
+
const resolved = {};
|
|
100
|
+
for (const [key, value] of Object.entries(props)) {
|
|
101
|
+
if (isA2UITextValue(value)) {
|
|
102
|
+
const resolvedValue = resolveTextValue(value, dataModel);
|
|
103
|
+
// Map A2UI 'text' prop to React 'children'
|
|
104
|
+
if (key === "text") {
|
|
105
|
+
resolved.children = resolvedValue;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
resolved[key] = resolvedValue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
resolved[key] = value;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return resolved;
|
|
116
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2UI Component Catalog
|
|
3
|
+
*
|
|
4
|
+
* Machine-readable catalog of available components for AI/LLM consumption.
|
|
5
|
+
* This is the single source of truth for component metadata.
|
|
6
|
+
*
|
|
7
|
+
* @see https://a2ui.org/reference/messages/ for catalogId specification
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Describes a single component prop
|
|
11
|
+
*/
|
|
12
|
+
export interface PropDescriptor {
|
|
13
|
+
/** Prop name */
|
|
14
|
+
name: string;
|
|
15
|
+
/** TypeScript-style type description */
|
|
16
|
+
type: string;
|
|
17
|
+
/** Whether the prop is required */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Human-readable description */
|
|
20
|
+
description: string;
|
|
21
|
+
/** Default value if any */
|
|
22
|
+
default?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Describes a component in the catalog
|
|
26
|
+
*/
|
|
27
|
+
export interface ComponentDescriptor {
|
|
28
|
+
/** Component type key (matches mapping.tsx) */
|
|
29
|
+
type: string;
|
|
30
|
+
/** Human-readable name */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Category for grouping */
|
|
33
|
+
category: "primitives" | "layout" | "navigation" | "feedback" | "data-display" | "actions";
|
|
34
|
+
/** Brief description */
|
|
35
|
+
description: string;
|
|
36
|
+
/** Whether this component receives text via the `text` prop (mapped to children) */
|
|
37
|
+
usesTextProp?: boolean;
|
|
38
|
+
/** List of key props */
|
|
39
|
+
props: PropDescriptor[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The full component catalog
|
|
43
|
+
*/
|
|
44
|
+
export declare const componentCatalog: ComponentDescriptor[];
|
|
45
|
+
/**
|
|
46
|
+
* Get component types grouped by category
|
|
47
|
+
*/
|
|
48
|
+
export declare function getComponentsByCategory(): Record<string, ComponentDescriptor[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Get a flat list of all component type keys
|
|
51
|
+
*/
|
|
52
|
+
export declare function getComponentTypes(): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Look up a component by type
|
|
55
|
+
*/
|
|
56
|
+
export declare function getComponent(type: string): ComponentDescriptor | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Generate JSON catalog for A2UI catalogId endpoint
|
|
59
|
+
*/
|
|
60
|
+
export declare function getCatalogJSON(): string;
|