@walkeros/explorer 3.0.0 → 3.0.2
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/__mocks__/@monaco-editor/react.d.ts +3 -0
- package/dist/__mocks__/@monaco-editor/react.d.ts.map +1 -0
- package/dist/__mocks__/@monaco-editor/react.js +4 -0
- package/dist/__mocks__/@monaco-editor/react.js.map +1 -0
- package/dist/components/atoms/box.d.ts +27 -0
- package/dist/components/atoms/box.d.ts.map +1 -0
- package/dist/components/atoms/box.js +86 -0
- package/dist/components/atoms/box.js.map +1 -0
- package/dist/components/atoms/box.stories.d.ts +34 -0
- package/dist/components/atoms/box.stories.d.ts.map +1 -0
- package/dist/components/atoms/box.stories.js +104 -0
- package/dist/components/atoms/box.stories.js.map +1 -0
- package/dist/components/atoms/button-group.d.ts +17 -0
- package/dist/components/atoms/button-group.d.ts.map +1 -0
- package/dist/components/atoms/button-group.js +12 -0
- package/dist/components/atoms/button-group.js.map +1 -0
- package/dist/components/atoms/button-group.stories.d.ts +18 -0
- package/dist/components/atoms/button-group.stories.d.ts.map +1 -0
- package/dist/components/atoms/button-group.stories.js +39 -0
- package/dist/components/atoms/button-group.stories.js.map +1 -0
- package/dist/components/atoms/button-link.d.ts +12 -0
- package/dist/components/atoms/button-link.d.ts.map +1 -0
- package/dist/components/atoms/button-link.js +10 -0
- package/dist/components/atoms/button-link.js.map +1 -0
- package/dist/components/atoms/button-link.stories.d.ts +11 -0
- package/dist/components/atoms/button-link.stories.d.ts.map +1 -0
- package/dist/components/atoms/button-link.stories.js +50 -0
- package/dist/components/atoms/button-link.stories.js.map +1 -0
- package/dist/components/atoms/button.d.ts +15 -0
- package/dist/components/atoms/button.d.ts.map +1 -0
- package/dist/components/atoms/button.js +11 -0
- package/dist/components/atoms/button.js.map +1 -0
- package/dist/components/atoms/button.stories.d.ts +14 -0
- package/dist/components/atoms/button.stories.d.ts.map +1 -0
- package/dist/components/atoms/button.stories.js +25 -0
- package/dist/components/atoms/button.stories.js.map +1 -0
- package/dist/components/atoms/code.d.ts +92 -0
- package/dist/components/atoms/code.d.ts.map +1 -0
- package/dist/components/atoms/code.js +405 -0
- package/dist/components/atoms/code.js.map +1 -0
- package/dist/components/atoms/code.stories.d.ts +46 -0
- package/dist/components/atoms/code.stories.d.ts.map +1 -0
- package/dist/components/atoms/code.stories.js +156 -0
- package/dist/components/atoms/code.stories.js.map +1 -0
- package/dist/components/atoms/footer.d.ts +21 -0
- package/dist/components/atoms/footer.d.ts.map +1 -0
- package/dist/components/atoms/footer.js +19 -0
- package/dist/components/atoms/footer.js.map +1 -0
- package/dist/components/atoms/footer.stories.d.ts +14 -0
- package/dist/components/atoms/footer.stories.d.ts.map +1 -0
- package/dist/components/atoms/footer.stories.js +29 -0
- package/dist/components/atoms/footer.stories.js.map +1 -0
- package/dist/components/atoms/grid.d.ts +65 -0
- package/dist/components/atoms/grid.d.ts.map +1 -0
- package/dist/components/atoms/grid.js +169 -0
- package/dist/components/atoms/grid.js.map +1 -0
- package/dist/components/atoms/grid.stories.d.ts +18 -0
- package/dist/components/atoms/grid.stories.d.ts.map +1 -0
- package/dist/components/atoms/grid.stories.js +60 -0
- package/dist/components/atoms/grid.stories.js.map +1 -0
- package/dist/components/atoms/header.d.ts +7 -0
- package/dist/components/atoms/header.d.ts.map +1 -0
- package/dist/components/atoms/header.js +5 -0
- package/dist/components/atoms/header.js.map +1 -0
- package/dist/components/atoms/header.stories.d.ts +15 -0
- package/dist/components/atoms/header.stories.d.ts.map +1 -0
- package/dist/components/atoms/header.stories.js +37 -0
- package/dist/components/atoms/header.stories.js.map +1 -0
- package/dist/components/atoms/icons/icon.stories.d.ts +18 -0
- package/dist/components/atoms/icons/icon.stories.d.ts.map +1 -0
- package/dist/components/atoms/icons/icon.stories.js +37 -0
- package/dist/components/atoms/icons/icon.stories.js.map +1 -0
- package/dist/components/atoms/icons/icons.d.ts +2 -0
- package/dist/components/atoms/icons/icons.d.ts.map +1 -0
- package/dist/components/atoms/icons/icons.js +7 -0
- package/dist/components/atoms/icons/icons.js.map +1 -0
- package/dist/components/atoms/icons/index.d.ts +3 -0
- package/dist/components/atoms/icons/index.d.ts.map +1 -0
- package/dist/components/atoms/icons/index.js +3 -0
- package/dist/components/atoms/icons/index.js.map +1 -0
- package/dist/components/atoms/mdx-code.d.ts +33 -0
- package/dist/components/atoms/mdx-code.d.ts.map +1 -0
- package/dist/components/atoms/mdx-code.js +69 -0
- package/dist/components/atoms/mdx-code.js.map +1 -0
- package/dist/components/atoms/preview-footer.d.ts +32 -0
- package/dist/components/atoms/preview-footer.d.ts.map +1 -0
- package/dist/components/atoms/preview-footer.js +31 -0
- package/dist/components/atoms/preview-footer.js.map +1 -0
- package/dist/components/atoms/spinner.d.ts +17 -0
- package/dist/components/atoms/spinner.d.ts.map +1 -0
- package/dist/components/atoms/spinner.js +14 -0
- package/dist/components/atoms/spinner.js.map +1 -0
- package/dist/components/atoms/spinner.stories.d.ts +7 -0
- package/dist/components/atoms/spinner.stories.d.ts.map +1 -0
- package/dist/components/atoms/spinner.stories.js +9 -0
- package/dist/components/atoms/spinner.stories.js.map +1 -0
- package/dist/components/atoms/toggle.d.ts +9 -0
- package/dist/components/atoms/toggle.d.ts.map +1 -0
- package/dist/components/atoms/toggle.js +6 -0
- package/dist/components/atoms/toggle.js.map +1 -0
- package/dist/components/demos/DestinationDemo.d.ts +48 -0
- package/dist/components/demos/DestinationDemo.d.ts.map +1 -0
- package/dist/components/demos/DestinationDemo.js +105 -0
- package/dist/components/demos/DestinationDemo.js.map +1 -0
- package/dist/components/demos/DestinationDemo.stories.d.ts +17 -0
- package/dist/components/demos/DestinationDemo.stories.d.ts.map +1 -0
- package/dist/components/demos/DestinationDemo.stories.js +53 -0
- package/dist/components/demos/DestinationDemo.stories.js.map +1 -0
- package/dist/components/demos/DestinationInitDemo.d.ts +34 -0
- package/dist/components/demos/DestinationInitDemo.d.ts.map +1 -0
- package/dist/components/demos/DestinationInitDemo.js +73 -0
- package/dist/components/demos/DestinationInitDemo.js.map +1 -0
- package/dist/components/demos/DestinationInitDemo.stories.d.ts +17 -0
- package/dist/components/demos/DestinationInitDemo.stories.d.ts.map +1 -0
- package/dist/components/demos/DestinationInitDemo.stories.js +39 -0
- package/dist/components/demos/DestinationInitDemo.stories.js.map +1 -0
- package/dist/components/demos/PromotionPlayground.d.ts +30 -0
- package/dist/components/demos/PromotionPlayground.d.ts.map +1 -0
- package/dist/components/demos/PromotionPlayground.js +366 -0
- package/dist/components/demos/PromotionPlayground.js.map +1 -0
- package/dist/components/demos/PromotionPlayground.stories.d.ts +27 -0
- package/dist/components/demos/PromotionPlayground.stories.d.ts.map +1 -0
- package/dist/components/demos/PromotionPlayground.stories.js +32 -0
- package/dist/components/demos/PromotionPlayground.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.d.ts +24 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.js +10 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.js.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.d.ts +7 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js +71 -0
- package/dist/components/molecules/architecture-flow/ArchitectureFlow.stories.js.map +1 -0
- package/dist/components/molecules/architecture-flow/index.d.ts +3 -0
- package/dist/components/molecules/architecture-flow/index.d.ts.map +1 -0
- package/dist/components/molecules/architecture-flow/index.js +2 -0
- package/dist/components/molecules/architecture-flow/index.js.map +1 -0
- package/dist/components/molecules/code-box.d.ts +75 -0
- package/dist/components/molecules/code-box.d.ts.map +1 -0
- package/dist/components/molecules/code-box.js +174 -0
- package/dist/components/molecules/code-box.js.map +1 -0
- package/dist/components/molecules/code-box.stories.d.ts +87 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -0
- package/dist/components/molecules/code-box.stories.js +300 -0
- package/dist/components/molecules/code-box.stories.js.map +1 -0
- package/dist/components/molecules/code-snippet.d.ts +58 -0
- package/dist/components/molecules/code-snippet.d.ts.map +1 -0
- package/dist/components/molecules/code-snippet.js +72 -0
- package/dist/components/molecules/code-snippet.js.map +1 -0
- package/dist/components/molecules/code-snippet.stories.d.ts +23 -0
- package/dist/components/molecules/code-snippet.stories.d.ts.map +1 -0
- package/dist/components/molecules/code-snippet.stories.js +87 -0
- package/dist/components/molecules/code-snippet.stories.js.map +1 -0
- package/dist/components/molecules/dropdown.d.ts +68 -0
- package/dist/components/molecules/dropdown.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.js +47 -0
- package/dist/components/molecules/dropdown.js.map +1 -0
- package/dist/components/molecules/dropdown.stories.d.ts +7 -0
- package/dist/components/molecules/dropdown.stories.d.ts.map +1 -0
- package/dist/components/molecules/dropdown.stories.js +18 -0
- package/dist/components/molecules/dropdown.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.d.ts +74 -0
- package/dist/components/molecules/flow-map/FlowMap.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.js +1039 -0
- package/dist/components/molecules/flow-map/FlowMap.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts +47 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.js +355 -0
- package/dist/components/molecules/flow-map/FlowMap.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.d.ts +29 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.js +117 -0
- package/dist/components/molecules/flow-map/FlowMap.transformers.stories.js.map +1 -0
- package/dist/components/molecules/flow-map/index.d.ts +3 -0
- package/dist/components/molecules/flow-map/index.d.ts.map +1 -0
- package/dist/components/molecules/flow-map/index.js +2 -0
- package/dist/components/molecules/flow-map/index.js.map +1 -0
- package/dist/components/molecules/preview.d.ts +23 -0
- package/dist/components/molecules/preview.d.ts.map +1 -0
- package/dist/components/molecules/preview.js +232 -0
- package/dist/components/molecules/preview.js.map +1 -0
- package/dist/components/molecules/preview.stories.d.ts +23 -0
- package/dist/components/molecules/preview.stories.d.ts.map +1 -0
- package/dist/components/molecules/preview.stories.js +186 -0
- package/dist/components/molecules/preview.stories.js.map +1 -0
- package/dist/components/molecules/property-table.d.ts +7 -0
- package/dist/components/molecules/property-table.d.ts.map +1 -0
- package/dist/components/molecules/property-table.js +88 -0
- package/dist/components/molecules/property-table.js.map +1 -0
- package/dist/components/molecules/property-table.stories.d.ts +24 -0
- package/dist/components/molecules/property-table.stories.d.ts.map +1 -0
- package/dist/components/molecules/property-table.stories.js +86 -0
- package/dist/components/molecules/property-table.stories.js.map +1 -0
- package/dist/components/organisms/browser-box.d.ts +31 -0
- package/dist/components/organisms/browser-box.d.ts.map +1 -0
- package/dist/components/organisms/browser-box.js +80 -0
- package/dist/components/organisms/browser-box.js.map +1 -0
- package/dist/components/organisms/browser-box.stories.d.ts +26 -0
- package/dist/components/organisms/browser-box.stories.d.ts.map +1 -0
- package/dist/components/organisms/browser-box.stories.js +102 -0
- package/dist/components/organisms/browser-box.stories.js.map +1 -0
- package/dist/components/organisms/collector-box.d.ts +24 -0
- package/dist/components/organisms/collector-box.d.ts.map +1 -0
- package/dist/components/organisms/collector-box.js +56 -0
- package/dist/components/organisms/collector-box.js.map +1 -0
- package/dist/components/organisms/collector-box.stories.d.ts +22 -0
- package/dist/components/organisms/collector-box.stories.d.ts.map +1 -0
- package/dist/components/organisms/collector-box.stories.js +59 -0
- package/dist/components/organisms/collector-box.stories.js.map +1 -0
- package/dist/components/organisms/live-code.d.ts +22 -0
- package/dist/components/organisms/live-code.d.ts.map +1 -0
- package/dist/components/organisms/live-code.js +50 -0
- package/dist/components/organisms/live-code.js.map +1 -0
- package/dist/components/organisms/live-code.stories.d.ts +24 -0
- package/dist/components/organisms/live-code.stories.d.ts.map +1 -0
- package/dist/components/organisms/live-code.stories.js +55 -0
- package/dist/components/organisms/live-code.stories.js.map +1 -0
- package/dist/components/ui/button.d.ts +4 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +6 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/icon.d.ts +5 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/components/ui/icon.js +5 -0
- package/dist/components/ui/icon.js.map +1 -0
- package/dist/contexts/GridHeightContext.d.ts +11 -0
- package/dist/contexts/GridHeightContext.d.ts.map +1 -0
- package/dist/contexts/GridHeightContext.js +14 -0
- package/dist/contexts/GridHeightContext.js.map +1 -0
- package/dist/helpers/capture.d.ts +83 -0
- package/dist/helpers/capture.d.ts.map +1 -0
- package/dist/helpers/capture.js +125 -0
- package/dist/helpers/capture.js.map +1 -0
- package/dist/helpers/destinations.d.ts +21 -0
- package/dist/helpers/destinations.d.ts.map +1 -0
- package/dist/helpers/destinations.js +46 -0
- package/dist/helpers/destinations.js.map +1 -0
- package/dist/hooks/useDropdown.d.ts +34 -0
- package/dist/hooks/useDropdown.d.ts.map +1 -0
- package/dist/hooks/useDropdown.js +66 -0
- package/dist/hooks/useDropdown.js.map +1 -0
- package/dist/hooks/useMonacoHeight.d.ts +31 -0
- package/dist/hooks/useMonacoHeight.d.ts.map +1 -0
- package/dist/hooks/useMonacoHeight.js +83 -0
- package/dist/hooks/useMonacoHeight.js.map +1 -0
- package/dist/hooks/useTreeState.d.ts +32 -0
- package/dist/hooks/useTreeState.d.ts.map +1 -0
- package/dist/hooks/useTreeState.js +94 -0
- package/dist/hooks/useTreeState.js.map +1 -0
- package/dist/index.d.ts +69 -1338
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/providers/MDXProvider.d.ts +40 -0
- package/dist/providers/MDXProvider.d.ts.map +1 -0
- package/dist/providers/MDXProvider.js +57 -0
- package/dist/providers/MDXProvider.js.map +1 -0
- package/dist/themes/index.d.ts +23 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +29 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/lighthouse.d.ts +26 -0
- package/dist/themes/lighthouse.d.ts.map +1 -0
- package/dist/themes/lighthouse.js +230 -0
- package/dist/themes/lighthouse.js.map +1 -0
- package/dist/themes/palenight.d.ts +31 -0
- package/dist/themes/palenight.d.ts.map +1 -0
- package/dist/themes/palenight.js +236 -0
- package/dist/themes/palenight.js.map +1 -0
- package/dist/themes/types.d.ts +103 -0
- package/dist/themes/types.d.ts.map +1 -0
- package/dist/themes/types.js +8 -0
- package/dist/themes/types.js.map +1 -0
- package/dist/types/intellisense.d.ts +33 -0
- package/dist/types/intellisense.d.ts.map +1 -0
- package/dist/types/intellisense.js +2 -0
- package/dist/types/intellisense.js.map +1 -0
- package/dist/utils/code-normalizer.d.ts +11 -0
- package/dist/utils/code-normalizer.d.ts.map +1 -0
- package/dist/utils/code-normalizer.js +21 -0
- package/dist/utils/code-normalizer.js.map +1 -0
- package/dist/utils/contract-path-walker.d.ts +27 -0
- package/dist/utils/contract-path-walker.d.ts.map +1 -0
- package/dist/utils/contract-path-walker.js +145 -0
- package/dist/utils/contract-path-walker.js.map +1 -0
- package/dist/utils/format-code.d.ts +9 -0
- package/dist/utils/format-code.d.ts.map +1 -0
- package/dist/utils/format-code.js +77 -0
- package/dist/utils/format-code.js.map +1 -0
- package/dist/utils/mapping-context-detector.d.ts +17 -0
- package/dist/utils/mapping-context-detector.d.ts.map +1 -0
- package/dist/utils/mapping-context-detector.js +22 -0
- package/dist/utils/mapping-context-detector.js.map +1 -0
- package/dist/utils/monaco-context-types.d.ts +39 -0
- package/dist/utils/monaco-context-types.d.ts.map +1 -0
- package/dist/utils/monaco-context-types.js +426 -0
- package/dist/utils/monaco-context-types.js.map +1 -0
- package/dist/utils/monaco-decorators.d.ts +17 -0
- package/dist/utils/monaco-decorators.d.ts.map +1 -0
- package/dist/utils/monaco-decorators.js +81 -0
- package/dist/utils/monaco-decorators.js.map +1 -0
- package/dist/utils/monaco-formatters.d.ts +16 -0
- package/dist/utils/monaco-formatters.d.ts.map +1 -0
- package/dist/utils/monaco-formatters.js +139 -0
- package/dist/utils/monaco-formatters.js.map +1 -0
- package/dist/utils/monaco-intellisense-flow-extractor.d.ts +13 -0
- package/dist/utils/monaco-intellisense-flow-extractor.d.ts.map +1 -0
- package/dist/utils/monaco-intellisense-flow-extractor.js +168 -0
- package/dist/utils/monaco-intellisense-flow-extractor.js.map +1 -0
- package/dist/utils/monaco-json-path.d.ts +12 -0
- package/dist/utils/monaco-json-path.d.ts.map +1 -0
- package/dist/utils/monaco-json-path.js +68 -0
- package/dist/utils/monaco-json-path.js.map +1 -0
- package/dist/utils/monaco-json-schema.d.ts +45 -0
- package/dist/utils/monaco-json-schema.d.ts.map +1 -0
- package/dist/utils/monaco-json-schema.js +90 -0
- package/dist/utils/monaco-json-schema.js.map +1 -0
- package/dist/utils/monaco-schema-contract.d.ts +8 -0
- package/dist/utils/monaco-schema-contract.d.ts.map +1 -0
- package/dist/utils/monaco-schema-contract.js +73 -0
- package/dist/utils/monaco-schema-contract.js.map +1 -0
- package/dist/utils/monaco-schema-enrichment.d.ts +26 -0
- package/dist/utils/monaco-schema-enrichment.d.ts.map +1 -0
- package/dist/utils/monaco-schema-enrichment.js +31 -0
- package/dist/utils/monaco-schema-enrichment.js.map +1 -0
- package/dist/utils/monaco-schema-flow-config.d.ts +10 -0
- package/dist/utils/monaco-schema-flow-config.d.ts.map +1 -0
- package/dist/utils/monaco-schema-flow-config.js +201 -0
- package/dist/utils/monaco-schema-flow-config.js.map +1 -0
- package/dist/utils/monaco-schema-variables.d.ts +4 -0
- package/dist/utils/monaco-schema-variables.d.ts.map +1 -0
- package/dist/utils/monaco-schema-variables.js +26 -0
- package/dist/utils/monaco-schema-variables.js.map +1 -0
- package/dist/utils/monaco-types.d.ts +174 -0
- package/dist/utils/monaco-types.d.ts.map +1 -0
- package/dist/utils/monaco-types.js +378 -0
- package/dist/utils/monaco-types.js.map +1 -0
- package/dist/utils/monaco-walkeros-completions.d.ts +23 -0
- package/dist/utils/monaco-walkeros-completions.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-completions.js +258 -0
- package/dist/utils/monaco-walkeros-completions.js.map +1 -0
- package/dist/utils/monaco-walkeros-decorations.d.ts +29 -0
- package/dist/utils/monaco-walkeros-decorations.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-decorations.js +87 -0
- package/dist/utils/monaco-walkeros-decorations.js.map +1 -0
- package/dist/utils/monaco-walkeros-markers.d.ts +13 -0
- package/dist/utils/monaco-walkeros-markers.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-markers.js +69 -0
- package/dist/utils/monaco-walkeros-markers.js.map +1 -0
- package/dist/utils/monaco-walkeros-providers.d.ts +19 -0
- package/dist/utils/monaco-walkeros-providers.d.ts.map +1 -0
- package/dist/utils/monaco-walkeros-providers.js +284 -0
- package/dist/utils/monaco-walkeros-providers.js.map +1 -0
- package/dist/utils/path-analyzer.d.ts +88 -0
- package/dist/utils/path-analyzer.d.ts.map +1 -0
- package/dist/utils/path-analyzer.js +215 -0
- package/dist/utils/path-analyzer.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Header } from './header';
|
|
3
|
+
import { Button } from './button';
|
|
4
|
+
import { ButtonGroup } from './button-group';
|
|
5
|
+
/**
|
|
6
|
+
* Header - Header component for boxes and panels
|
|
7
|
+
*
|
|
8
|
+
* Displays a label with optional action buttons.
|
|
9
|
+
* Pairs with Footer for consistent box structure.
|
|
10
|
+
*/
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Atoms/Header',
|
|
13
|
+
component: Header,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
label: 'Code Preview',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const WithButtons = {
|
|
23
|
+
args: {
|
|
24
|
+
label: 'Configuration',
|
|
25
|
+
children: (_jsx(ButtonGroup, { buttons: [
|
|
26
|
+
{ label: 'Copy', value: 'copy' },
|
|
27
|
+
{ label: 'Reset', value: 'reset' },
|
|
28
|
+
], onButtonClick: () => { } })),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export const WithSingleButton = {
|
|
32
|
+
args: {
|
|
33
|
+
label: 'Events',
|
|
34
|
+
children: _jsx(Button, { children: "Clear" }),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=header.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.stories.js","sourceRoot":"","sources":["../../../src/components/atoms/header.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,IAAI,GAAwB;IAChC,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,cAAc;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,IAAI,EAAE;QACJ,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,CACR,KAAC,WAAW,IACV,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;gBAChC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;aACnC,EACD,aAAa,EAAE,GAAG,EAAE,GAAE,CAAC,GACvB,CACH;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAU;IACrC,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,KAAC,MAAM,wBAAe;KACjC;CACF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Icon } from '@iconify/react';
|
|
3
|
+
/**
|
|
4
|
+
* Icon - Iconify icon component
|
|
5
|
+
*
|
|
6
|
+
* Re-exported from @iconify/react for consistent imports.
|
|
7
|
+
* Use any Iconify icon name (e.g., 'mdi:home', 'lucide:settings').
|
|
8
|
+
*
|
|
9
|
+
* @see https://icon-sets.iconify.design/
|
|
10
|
+
*/
|
|
11
|
+
declare const meta: Meta<typeof Icon>;
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof Icon>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const CommonIcons: Story;
|
|
16
|
+
export declare const Sizes: Story;
|
|
17
|
+
export declare const CustomIcon: Story;
|
|
18
|
+
//# sourceMappingURL=icon.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/icons/icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC;;;;;;;GAOG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAI3B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAezB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KASnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '@iconify/react';
|
|
3
|
+
/**
|
|
4
|
+
* Icon - Iconify icon component
|
|
5
|
+
*
|
|
6
|
+
* Re-exported from @iconify/react for consistent imports.
|
|
7
|
+
* Use any Iconify icon name (e.g., 'mdi:home', 'lucide:settings').
|
|
8
|
+
*
|
|
9
|
+
* @see https://icon-sets.iconify.design/
|
|
10
|
+
*/
|
|
11
|
+
const meta = {
|
|
12
|
+
title: 'Atoms/Icon',
|
|
13
|
+
component: Icon,
|
|
14
|
+
tags: ['autodocs'],
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
export const Default = {
|
|
18
|
+
args: {
|
|
19
|
+
icon: 'mdi:home',
|
|
20
|
+
width: 24,
|
|
21
|
+
height: 24,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const CommonIcons = {
|
|
25
|
+
render: () => (_jsxs("div", { style: { display: 'flex', gap: '16px', alignItems: 'center' }, children: [_jsx(Icon, { icon: "mdi:home", width: 24 }), _jsx(Icon, { icon: "mdi:cog", width: 24 }), _jsx(Icon, { icon: "mdi:account", width: 24 }), _jsx(Icon, { icon: "mdi:magnify", width: 24 }), _jsx(Icon, { icon: "mdi:plus", width: 24 }), _jsx(Icon, { icon: "mdi:delete", width: 24 }), _jsx(Icon, { icon: "mdi:pencil", width: 24 }), _jsx(Icon, { icon: "mdi:check", width: 24 }), _jsx(Icon, { icon: "mdi:close", width: 24 }), _jsx(Icon, { icon: "mdi:chevron-down", width: 24 })] })),
|
|
26
|
+
};
|
|
27
|
+
export const Sizes = {
|
|
28
|
+
render: () => (_jsxs("div", { style: { display: 'flex', gap: '16px', alignItems: 'center' }, children: [_jsx(Icon, { icon: "mdi:star", width: 16 }), _jsx(Icon, { icon: "mdi:star", width: 24 }), _jsx(Icon, { icon: "mdi:star", width: 32 }), _jsx(Icon, { icon: "mdi:star", width: 48 })] })),
|
|
29
|
+
};
|
|
30
|
+
export const CustomIcon = {
|
|
31
|
+
args: {
|
|
32
|
+
icon: 'walkeros:piwik-pro',
|
|
33
|
+
width: 48,
|
|
34
|
+
height: 48,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=icon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.stories.js","sourceRoot":"","sources":["../../../../src/components/atoms/icons/icon.stories.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,IAAI,GAAsB;IAC9B,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACX;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,MAAM,EAAE,GAAG,EAAE,CAAC,CACZ,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAChE,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,GAAI,EACnC,KAAC,IAAI,IAAC,IAAI,EAA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AE;QACT,MAAM,EAAE,EAAE;KACX;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/icons/icons.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { addIcon } from '@iconify/react';
|
|
2
|
+
addIcon('walkeros:piwik-pro', {
|
|
3
|
+
body: '<g fill="none" fill-rule="evenodd"><path fill="#231F20" d="M0 0h90v90H0z"/><path d="M50.792 57.21v.044H37.99v8.675c0 3.38-2.652 6.07-6.006 6.07a5.917 5.917 0 0 1-4.243-1.77 6.073 6.073 0 0 1-1.74-4.3v-38.88C26 23.67 28.65 21 31.983 21H50.79v.022c9.58.4 17.209 8.341 17.209 18.104 0 9.764-7.628 17.704-17.209 18.083h.001Zm-2.148-25.29H37.99v14.57h10.872c3.88-.112 6.993-3.337 6.993-7.274a7.347 7.347 0 0 0-2.114-5.16 7.16 7.16 0 0 0-5.098-2.134Z" fill="#FFF" fill-rule="nonzero"/></g>',
|
|
4
|
+
width: 90,
|
|
5
|
+
height: 90,
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../../../src/components/atoms/icons/icons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,CAAC,oBAAoB,EAAE;IAC5B,IAAI,EAAE,qeAAqe;IAC3e,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/atoms/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
2
|
+
interface MDXCodeProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* MDXCode - Code component for MDX files
|
|
7
|
+
*
|
|
8
|
+
* Automatically detects and renders inline vs block code:
|
|
9
|
+
* - Inline code: `example` → <code className="elb-code-inline">
|
|
10
|
+
* - Block code: ```language\ncode\n``` → Uses CodeBox with Monaco editor
|
|
11
|
+
*
|
|
12
|
+
* Language detection:
|
|
13
|
+
* - Extracts language from className (e.g., "language-typescript")
|
|
14
|
+
* - Maps common MDX language names to Monaco language IDs
|
|
15
|
+
*
|
|
16
|
+
* Block code features (via CodeBox):
|
|
17
|
+
* - Full Monaco editor with syntax highlighting
|
|
18
|
+
* - Theme-aware (Palenight dark, VS Light)
|
|
19
|
+
* - Copy to clipboard button
|
|
20
|
+
* - Auto-height to fit content
|
|
21
|
+
* - Read-only mode
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // In MDX files (no import needed with MDXProvider):
|
|
25
|
+
* Inline `code` example
|
|
26
|
+
*
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const block = "code";
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const MDXCode: FC<PropsWithChildren<MDXCodeProps>>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=mdx-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-code.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/mdx-code.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAY,MAAM,OAAO,CAAC;AAGzE,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAyDvD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children } from 'react';
|
|
3
|
+
import { CodeBox } from '../molecules/code-box';
|
|
4
|
+
/**
|
|
5
|
+
* MDXCode - Code component for MDX files
|
|
6
|
+
*
|
|
7
|
+
* Automatically detects and renders inline vs block code:
|
|
8
|
+
* - Inline code: `example` → <code className="elb-code-inline">
|
|
9
|
+
* - Block code: ```language\ncode\n``` → Uses CodeBox with Monaco editor
|
|
10
|
+
*
|
|
11
|
+
* Language detection:
|
|
12
|
+
* - Extracts language from className (e.g., "language-typescript")
|
|
13
|
+
* - Maps common MDX language names to Monaco language IDs
|
|
14
|
+
*
|
|
15
|
+
* Block code features (via CodeBox):
|
|
16
|
+
* - Full Monaco editor with syntax highlighting
|
|
17
|
+
* - Theme-aware (Palenight dark, VS Light)
|
|
18
|
+
* - Copy to clipboard button
|
|
19
|
+
* - Auto-height to fit content
|
|
20
|
+
* - Read-only mode
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // In MDX files (no import needed with MDXProvider):
|
|
24
|
+
* Inline `code` example
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const block = "code";
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export const MDXCode = ({ className, children, }) => {
|
|
31
|
+
// Detect if this is block code based on:
|
|
32
|
+
// 1. Has className (markdown sets "language-*" for code blocks)
|
|
33
|
+
// 2. Content contains newlines
|
|
34
|
+
const childrenArray = Children.toArray(children);
|
|
35
|
+
const hasClassName = typeof className === 'string';
|
|
36
|
+
// Check if content has newlines (block code)
|
|
37
|
+
const hasNewlines = childrenArray.some((child) => {
|
|
38
|
+
if (typeof child === 'string') {
|
|
39
|
+
return child.match(/[\n\r]/g);
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
// Inline code: no className or no newlines
|
|
44
|
+
if (!hasClassName || !hasNewlines) {
|
|
45
|
+
return _jsx("code", { className: "elb-code-inline", children: children });
|
|
46
|
+
}
|
|
47
|
+
// Block code: extract language from className
|
|
48
|
+
// Format: "language-typescript" → "typescript"
|
|
49
|
+
const mdxLanguage = className.replace(/^language-/, '');
|
|
50
|
+
// Map MDX language names to Monaco language IDs
|
|
51
|
+
const languageMap = {
|
|
52
|
+
js: 'javascript',
|
|
53
|
+
ts: 'typescript',
|
|
54
|
+
jsx: 'javascript',
|
|
55
|
+
tsx: 'typescript',
|
|
56
|
+
bash: 'shell',
|
|
57
|
+
sh: 'shell',
|
|
58
|
+
yml: 'yaml',
|
|
59
|
+
md: 'markdown',
|
|
60
|
+
};
|
|
61
|
+
const monacoLanguage = languageMap[mdxLanguage] || mdxLanguage;
|
|
62
|
+
// Extract code string from children
|
|
63
|
+
const code = childrenArray
|
|
64
|
+
.map((child) => (typeof child === 'string' ? child : ''))
|
|
65
|
+
.join('')
|
|
66
|
+
.trim();
|
|
67
|
+
return (_jsx(CodeBox, { code: code, language: monacoLanguage, disabled: true, showCopy: true, showHeader: false, autoHeight: { min: 100, max: 600 } }));
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=mdx-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdx-code.js","sourceRoot":"","sources":["../../../src/components/atoms/mdx-code.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAmC,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH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AAE,CAAC,CAAC;SACxD,IAAI,CAAC,EAAE,CAAC;SACR,IAAI,EAAE,CAAC;IAEV,OAAO,CACL,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,cAAc,EACxB,QAAQ,QACR,QAAQ,QACR,UAAU,EAAE,KAAK,EACjB,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAClC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface PreviewFooterButton {
|
|
2
|
+
type: string;
|
|
3
|
+
label: string;
|
|
4
|
+
highlightClass: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PreviewFooterProps {
|
|
7
|
+
highlights: Set<string>;
|
|
8
|
+
onToggle: (type: string) => void;
|
|
9
|
+
buttons?: PreviewFooterButton[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* PreviewFooter - Footer with highlight toggle buttons
|
|
13
|
+
*
|
|
14
|
+
* Renders a set of buttons to toggle highlighting of walkerOS data attributes.
|
|
15
|
+
* Designed to be used with Box footer prop for preview components.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const [highlights, setHighlights] = useState<Set<string>>(new Set());
|
|
19
|
+
* const handleToggle = (type: string) => {
|
|
20
|
+
* setHighlights(prev => {
|
|
21
|
+
* const next = new Set(prev);
|
|
22
|
+
* next.has(type) ? next.delete(type) : next.add(type);
|
|
23
|
+
* return next;
|
|
24
|
+
* });
|
|
25
|
+
* };
|
|
26
|
+
*
|
|
27
|
+
* <Box footer={<PreviewFooter highlights={highlights} onToggle={handleToggle} />}>
|
|
28
|
+
* Preview content
|
|
29
|
+
* </Box>
|
|
30
|
+
*/
|
|
31
|
+
export declare function PreviewFooter({ highlights, onToggle, buttons, }: PreviewFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=preview-footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-footer.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/preview-footer.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACjC;AASD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,OAAwB,GACzB,EAAE,kBAAkB,2CAiBpB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const defaultButtons = [
|
|
3
|
+
{ type: 'context', label: 'Context', highlightClass: 'highlight-context' },
|
|
4
|
+
{ type: 'entity', label: 'Entity', highlightClass: 'highlight-entity' },
|
|
5
|
+
{ type: 'property', label: 'Property', highlightClass: 'highlight-property' },
|
|
6
|
+
{ type: 'action', label: 'Action', highlightClass: 'highlight-action' },
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* PreviewFooter - Footer with highlight toggle buttons
|
|
10
|
+
*
|
|
11
|
+
* Renders a set of buttons to toggle highlighting of walkerOS data attributes.
|
|
12
|
+
* Designed to be used with Box footer prop for preview components.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const [highlights, setHighlights] = useState<Set<string>>(new Set());
|
|
16
|
+
* const handleToggle = (type: string) => {
|
|
17
|
+
* setHighlights(prev => {
|
|
18
|
+
* const next = new Set(prev);
|
|
19
|
+
* next.has(type) ? next.delete(type) : next.add(type);
|
|
20
|
+
* return next;
|
|
21
|
+
* });
|
|
22
|
+
* };
|
|
23
|
+
*
|
|
24
|
+
* <Box footer={<PreviewFooter highlights={highlights} onToggle={handleToggle} />}>
|
|
25
|
+
* Preview content
|
|
26
|
+
* </Box>
|
|
27
|
+
*/
|
|
28
|
+
export function PreviewFooter({ highlights, onToggle, buttons = defaultButtons, }) {
|
|
29
|
+
return (_jsx("div", { className: "elb-preview-footer", children: buttons.map((button) => (_jsx("button", { className: `elb-preview-btn ${highlights.has(button.type) ? button.highlightClass : ''}`, onClick: () => onToggle(button.type), type: "button", children: button.label }, button.type))) }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=preview-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-footer.js","sourceRoot":"","sources":["../../../src/components/atoms/preview-footer.tsx"],"names":[],"mappings":";AAcA,MAAM,cAAc,GAA0B;IAC5C,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,mBAAmB,EAAE;IAC1E,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE;IACvE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,oBAAoB,EAAE;IAC7E,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,kBAAkB,EAAE;CACxE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EACR,OAAO,GAAG,cAAc,GACL;IACnB,OAAO,CACL,cAAK,SAAS,EAAC,oBAAoB,YAChC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAEE,SAAS,EAAE,mBACT,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EACxD,EAAE,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EACpC,IAAI,EAAC,QAAQ,YAEZ,MAAM,CAAC,KAAK,IAPR,MAAM,CAAC,IAAI,CAQT,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SpinnerProps {
|
|
2
|
+
/** Size of the spinner */
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
/** Additional CSS class */
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Spinner - Loading indicator
|
|
9
|
+
*
|
|
10
|
+
* Pure UI component for showing loading state.
|
|
11
|
+
* No internal state - controlled via parent.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Spinner size="md" />
|
|
15
|
+
*/
|
|
16
|
+
export declare function Spinner({ size, className }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/spinner.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,0BAA0B;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,EAAE,IAAW,EAAE,SAAc,EAAE,EAAE,YAAY,2CAQpE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Spinner - Loading indicator
|
|
4
|
+
*
|
|
5
|
+
* Pure UI component for showing loading state.
|
|
6
|
+
* No internal state - controlled via parent.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <Spinner size="md" />
|
|
10
|
+
*/
|
|
11
|
+
export function Spinner({ size = 'md', className = '' }) {
|
|
12
|
+
return (_jsx("span", { className: `elb-spinner elb-spinner--${size} ${className}`.trim(), role: "status", "aria-label": "Loading" }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../src/components/atoms/spinner.tsx"],"names":[],"mappings":";AASA;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,GAAG,EAAE,EAAgB;IACnE,OAAO,CACL,eACE,SAAS,EAAE,4BAA4B,IAAI,IAAI,SAAS,EAAE,CAAC,IAAI,EAAE,EACjE,IAAI,EAAC,QAAQ,gBACF,SAAS,GACpB,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Spinner } from './spinner';
|
|
3
|
+
declare const meta: Meta<typeof Spinner>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Spinner>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=spinner.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.stories.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/spinner.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAI9B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.stories.js","sourceRoot":"","sources":["../../../src/components/atoms/spinner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,IAAI,GAAyB;IACjC,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC;AACF,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,MAAM,OAAO,GAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ToggleProps {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
onChange: (checked: boolean) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Toggle({ checked, onChange, disabled, label, id, }: ToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/toggle.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAO,EACP,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,EAAE,GACH,EAAE,WAAW,2CAyBb"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Toggle({ checked, onChange, disabled = false, label, id, }) {
|
|
3
|
+
const toggleId = id || `toggle-${Math.random().toString(36).substr(2, 9)}`;
|
|
4
|
+
return (_jsxs("div", { className: "elb-toggle-container", children: [_jsx("button", { type: "button", role: "switch", "aria-checked": checked, id: toggleId, className: `elb-toggle ${checked ? 'elb-toggle-checked' : ''} ${disabled ? 'elb-toggle-disabled' : ''}`, onClick: () => !disabled && onChange(!checked), disabled: disabled, children: _jsx("span", { className: "elb-toggle-slider" }) }), label && (_jsx("label", { htmlFor: toggleId, className: "elb-toggle-label", children: label }))] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=toggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.js","sourceRoot":"","sources":["../../../src/components/atoms/toggle.tsx"],"names":[],"mappings":";AAUA,MAAM,UAAU,MAAM,CAAC,EACrB,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,EAAE,GACU;IACZ,MAAM,QAAQ,GAAG,EAAE,IAAI,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAE3E,OAAO,CACL,eAAK,SAAS,EAAC,sBAAsB,aACnC,iBACE,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,kBACC,OAAO,EACrB,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,cAAc,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,IAC1D,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrC,EAAE,EACF,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,OAAO,CAAC,EAC9C,QAAQ,EAAE,QAAQ,YAElB,eAAM,SAAS,EAAC,mBAAmB,GAAG,GAC/B,EACR,KAAK,IAAI,CACR,gBAAO,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,kBAAkB,YACnD,KAAK,GACA,CACT,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { WalkerOS, Mapping, Destination } from '@walkeros/core';
|
|
2
|
+
export interface DestinationDemoProps {
|
|
3
|
+
destination: Destination.Instance;
|
|
4
|
+
event: WalkerOS.PartialEvent;
|
|
5
|
+
mapping?: Mapping.Rule | string;
|
|
6
|
+
settings?: unknown;
|
|
7
|
+
generic?: boolean;
|
|
8
|
+
labelEvent?: string;
|
|
9
|
+
labelMapping?: string;
|
|
10
|
+
labelOutput?: string;
|
|
11
|
+
fn?: (event: WalkerOS.Event, context: Destination.PushContext) => Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* DestinationDemo - Interactive destination testing component
|
|
15
|
+
*
|
|
16
|
+
* Automatically captures destination.push() calls and displays the output.
|
|
17
|
+
* The component auto-detects the destination's env from destination.examples.env.push.
|
|
18
|
+
*
|
|
19
|
+
* Props:
|
|
20
|
+
* - destination: Destination instance with examples.env.push export
|
|
21
|
+
* - event: walkerOS event to process
|
|
22
|
+
* - mapping: Optional mapping rules
|
|
23
|
+
* - settings: Destination-specific settings
|
|
24
|
+
* - generic: If true, wraps mapping in { '*': { '*': mapping } }
|
|
25
|
+
* - labelEvent: Label for event panel (default: 'Event')
|
|
26
|
+
* - labelMapping: Label for mapping panel (default: 'Mapping')
|
|
27
|
+
* - labelOutput: Label for output panel (default: 'Result')
|
|
28
|
+
*
|
|
29
|
+
* Example:
|
|
30
|
+
* ```tsx
|
|
31
|
+
* import destinationPlausible from '@walkeros/web-destination-plausible';
|
|
32
|
+
* import { examples } from '@walkeros/web-destination-plausible';
|
|
33
|
+
* import { getEvent } from '@walkeros/core';
|
|
34
|
+
*
|
|
35
|
+
* const destination = { ...destinationPlausible, examples };
|
|
36
|
+
*
|
|
37
|
+
* <DestinationDemo
|
|
38
|
+
* destination={destination}
|
|
39
|
+
* event={getEvent('order complete')}
|
|
40
|
+
* mapping={examples.mapping.purchase}
|
|
41
|
+
* settings={{ domain: 'elbwalker.com' }}
|
|
42
|
+
* generic={true}
|
|
43
|
+
* />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function createCaptureFn(fnName: string, onCapture: (output: string) => void): (...args: unknown[]) => void;
|
|
47
|
+
export declare function DestinationDemo({ destination, event: initialEvent, mapping: initialMapping, settings, generic, labelEvent, labelMapping, labelOutput, fn, }: DestinationDemoProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
//# sourceMappingURL=DestinationDemo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestinationDemo.d.ts","sourceRoot":"","sources":["../../../src/components/demos/DestinationDemo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAWrE,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC;IAClC,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,CACH,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,OAAO,EAAE,WAAW,CAAC,WAAW,KAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,IAE3B,GAAG,MAAM,OAAO,EAAE,UAU3B;AAED,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,cAAmB,EAC5B,QAAQ,EACR,OAAe,EACf,UAAoB,EACpB,YAAwB,EACxB,WAAsB,EACtB,EAAE,GACH,EAAE,oBAAoB,2CAiGtB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
3
|
+
import { createEvent, tryCatchAsync, processEventMapping, } from '@walkeros/core';
|
|
4
|
+
import { startFlow } from '@walkeros/collector';
|
|
5
|
+
import { CodeBox } from '../molecules/code-box';
|
|
6
|
+
import { Grid } from '../atoms/grid';
|
|
7
|
+
import { captureDestinationPush } from '../../helpers/capture';
|
|
8
|
+
/**
|
|
9
|
+
* DestinationDemo - Interactive destination testing component
|
|
10
|
+
*
|
|
11
|
+
* Automatically captures destination.push() calls and displays the output.
|
|
12
|
+
* The component auto-detects the destination's env from destination.examples.env.push.
|
|
13
|
+
*
|
|
14
|
+
* Props:
|
|
15
|
+
* - destination: Destination instance with examples.env.push export
|
|
16
|
+
* - event: walkerOS event to process
|
|
17
|
+
* - mapping: Optional mapping rules
|
|
18
|
+
* - settings: Destination-specific settings
|
|
19
|
+
* - generic: If true, wraps mapping in { '*': { '*': mapping } }
|
|
20
|
+
* - labelEvent: Label for event panel (default: 'Event')
|
|
21
|
+
* - labelMapping: Label for mapping panel (default: 'Mapping')
|
|
22
|
+
* - labelOutput: Label for output panel (default: 'Result')
|
|
23
|
+
*
|
|
24
|
+
* Example:
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import destinationPlausible from '@walkeros/web-destination-plausible';
|
|
27
|
+
* import { examples } from '@walkeros/web-destination-plausible';
|
|
28
|
+
* import { getEvent } from '@walkeros/core';
|
|
29
|
+
*
|
|
30
|
+
* const destination = { ...destinationPlausible, examples };
|
|
31
|
+
*
|
|
32
|
+
* <DestinationDemo
|
|
33
|
+
* destination={destination}
|
|
34
|
+
* event={getEvent('order complete')}
|
|
35
|
+
* mapping={examples.mapping.purchase}
|
|
36
|
+
* settings={{ domain: 'elbwalker.com' }}
|
|
37
|
+
* generic={true}
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
// Generic capture function creator
|
|
42
|
+
export function createCaptureFn(fnName, onCapture) {
|
|
43
|
+
return (...args) => {
|
|
44
|
+
const formattedArgs = args
|
|
45
|
+
.map((arg) => {
|
|
46
|
+
if (typeof arg === 'string')
|
|
47
|
+
return `"${arg}"`;
|
|
48
|
+
return JSON.stringify(arg, null, 2);
|
|
49
|
+
})
|
|
50
|
+
.join(', ');
|
|
51
|
+
onCapture(`${fnName}(${formattedArgs});`);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function DestinationDemo({ destination, event: initialEvent, mapping: initialMapping = {}, settings, generic = false, labelEvent = 'Event', labelMapping = 'Mapping', labelOutput = 'Result', fn, }) {
|
|
55
|
+
const [eventInput, setEventInput] = useState(JSON.stringify(initialEvent, null, 2));
|
|
56
|
+
const [mappingInput, setMappingInput] = useState(typeof initialMapping === 'string'
|
|
57
|
+
? initialMapping
|
|
58
|
+
: JSON.stringify(initialMapping, null, 2));
|
|
59
|
+
const [output, setOutput] = useState('');
|
|
60
|
+
const executeDestination = useCallback(async () => {
|
|
61
|
+
await tryCatchAsync(async () => {
|
|
62
|
+
const eventData = JSON.parse(eventInput);
|
|
63
|
+
const mappingData = JSON.parse(mappingInput);
|
|
64
|
+
const event = createEvent(eventData);
|
|
65
|
+
// Wrap mapping in generic structure if requested
|
|
66
|
+
const wrappedMapping = generic && mappingData ? { '*': { '*': mappingData } } : mappingData;
|
|
67
|
+
// Build config
|
|
68
|
+
const config = {
|
|
69
|
+
settings: settings || {},
|
|
70
|
+
mapping: wrappedMapping,
|
|
71
|
+
};
|
|
72
|
+
// Create minimal collector for mapping processing
|
|
73
|
+
const { collector } = await startFlow({});
|
|
74
|
+
// Process event mapping (applies mapping transformations)
|
|
75
|
+
const processed = await processEventMapping(event, config, collector);
|
|
76
|
+
// Build context for destination.push()
|
|
77
|
+
const context = {
|
|
78
|
+
id: 'demo',
|
|
79
|
+
collector,
|
|
80
|
+
config,
|
|
81
|
+
data: processed.data,
|
|
82
|
+
env: destination.env || {},
|
|
83
|
+
logger: collector.logger,
|
|
84
|
+
};
|
|
85
|
+
// If custom function provided, use it
|
|
86
|
+
if (fn) {
|
|
87
|
+
const result = await fn(processed.event, context);
|
|
88
|
+
setOutput(result);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// Auto-detect destination.examples.env.push (for push method)
|
|
92
|
+
const destinationEnv = destination.examples?.env?.push;
|
|
93
|
+
// Use captureDestinationPush to automatically capture output
|
|
94
|
+
const captureFn = captureDestinationPush(destination, destinationEnv);
|
|
95
|
+
const result = await captureFn(processed.event, context);
|
|
96
|
+
setOutput(result);
|
|
97
|
+
}, (error) => setOutput(`Error: ${error}`))();
|
|
98
|
+
}, [eventInput, mappingInput, destination, settings, generic, fn]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const timeoutId = setTimeout(executeDestination, 500);
|
|
101
|
+
return () => clearTimeout(timeoutId);
|
|
102
|
+
}, [executeDestination]);
|
|
103
|
+
return (_jsxs(Grid, { columns: 3, rowHeight: "synced", children: [_jsx(CodeBox, { label: labelEvent, code: eventInput, onChange: setEventInput, language: "json", showFormat: true, autoHeight: true }), _jsx(CodeBox, { label: labelMapping, code: mappingInput, onChange: setMappingInput, language: "json", showFormat: true, autoHeight: true }), _jsx(CodeBox, { label: labelOutput, code: output, disabled: true, language: "javascript", autoHeight: true })] }));
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=DestinationDemo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestinationDemo.js","sourceRoot":"","sources":["../../../src/components/demos/DestinationDemo.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAiB/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,mCAAmC;AACnC,MAAM,UAAU,eAAe,CAC7B,MAAc,EACd,SAAmC;IAEnC,OAAO,CAAC,GAAG,IAAe,EAAE,EAAE;QAC5B,MAAM,aAAa,GAAG,IAAI;aACvB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACX,IAAI,OAAO,GAAG,KAAK,QAAQ;gBAAE,OAAO,IAAI,GAAG,GAAG,CAAC;YAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,SAAS,CAAC,GAAG,MAAM,IAAI,aAAa,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC9B,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,cAAc,GAAG,EAAE,EAC5B,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,UAAU,GAAG,OAAO,EACpB,YAAY,GAAG,SAAS,EACxB,WAAW,GAAG,QAAQ,EACtB,E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E,aAAa,EACvB,QAAQ,EAAC,MAAM,EACf,UAAU,QACV,UAAU,SACV,EACF,KAAC,OAAO,IACN,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAC,MAAM,EACf,UAAU,QACV,UAAU,SACV,EACF,KAAC,OAAO,IACN,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,QACR,QAAQ,EAAC,YAAY,EACrB,UAAU,SACV,IACG,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { DestinationDemo } from './DestinationDemo';
|
|
3
|
+
/**
|
|
4
|
+
* DestinationDemo - Interactive destination testing component
|
|
5
|
+
*
|
|
6
|
+
* Tests destination implementations with real walkerOS events.
|
|
7
|
+
* Automatically captures destination.push() calls and displays output.
|
|
8
|
+
* Perfect for testing and debugging destination configurations.
|
|
9
|
+
*/
|
|
10
|
+
declare const meta: Meta<typeof DestinationDemo>;
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof DestinationDemo>;
|
|
13
|
+
/**
|
|
14
|
+
* Default destination demo with gtag GA4 purchase event
|
|
15
|
+
*/
|
|
16
|
+
export declare const Default: Story;
|
|
17
|
+
//# sourceMappingURL=DestinationDemo.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DestinationDemo.stories.d.ts","sourceRoot":"","sources":["../../../src/components/demos/DestinationDemo.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD;;;;;;GAMG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CAOtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAS9C;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAqBrB,CAAC"}
|