@frontmcp/ui 0.6.0 → 0.6.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/README.md +140 -362
- package/bridge/core/bridge-factory.d.ts +1 -0
- package/bridge/core/bridge-factory.d.ts.map +1 -1
- package/bridge/index.d.ts +1 -1
- package/bridge/index.d.ts.map +1 -1
- package/bridge/index.js +39 -881
- package/bridge/runtime/index.d.ts +2 -1
- package/bridge/runtime/index.d.ts.map +1 -1
- package/bundler/browser-components.d.ts +42 -0
- package/bundler/browser-components.d.ts.map +1 -0
- package/bundler/bundler.d.ts +78 -4
- package/bundler/bundler.d.ts.map +1 -1
- package/bundler/index.d.ts +8 -8
- package/bundler/index.d.ts.map +1 -1
- package/bundler/index.js +1411 -2997
- package/bundler/types.d.ts +188 -7
- package/bundler/types.d.ts.map +1 -1
- package/components/alert.schema.d.ts +6 -6
- package/components/avatar.schema.d.ts +9 -9
- package/components/badge.schema.d.ts +9 -9
- package/components/button.schema.d.ts +9 -9
- package/components/card.schema.d.ts +7 -7
- package/components/form.schema.d.ts +24 -24
- package/components/index.js +128 -198
- package/components/modal.schema.d.ts +8 -8
- package/components/table.schema.d.ts +6 -6
- package/esm/bridge/{index.js → index.mjs} +40 -877
- package/esm/bundler/index.mjs +3136 -0
- package/esm/components/{index.js → index.mjs} +136 -196
- package/esm/index.mjs +5450 -0
- package/esm/layouts/index.mjs +409 -0
- package/esm/package.json +15 -32
- package/esm/react/{index.js → index.mjs} +71 -260
- package/esm/renderers/index.mjs +611 -0
- package/esm/universal/index.mjs +1951 -0
- package/esm/web-components/{index.js → index.mjs} +232 -287
- package/index.d.ts +22 -41
- package/index.d.ts.map +1 -1
- package/index.js +4286 -19607
- package/layouts/base.d.ts +2 -2
- package/layouts/base.d.ts.map +1 -1
- package/layouts/index.js +46 -539
- package/layouts/presets.d.ts.map +1 -1
- package/package.json +15 -32
- package/react/Alert.d.ts +1 -2
- package/react/Alert.d.ts.map +1 -1
- package/react/Badge.d.ts +1 -2
- package/react/Badge.d.ts.map +1 -1
- package/react/Button.d.ts +1 -2
- package/react/Button.d.ts.map +1 -1
- package/react/Card.d.ts +1 -2
- package/react/Card.d.ts.map +1 -1
- package/react/hooks/context.d.ts +1 -1
- package/react/hooks/context.d.ts.map +1 -1
- package/react/index.d.ts +5 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +55 -269
- package/react/types.d.ts +1 -2
- package/react/types.d.ts.map +1 -1
- package/renderers/index.d.ts +15 -25
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +393 -1619
- package/renderers/mdx.renderer.d.ts +13 -34
- package/renderers/mdx.renderer.d.ts.map +1 -1
- package/{esm/runtime/adapters → renderers}/react.adapter.d.ts +2 -2
- package/renderers/react.adapter.d.ts.map +1 -0
- package/renderers/react.renderer.d.ts +25 -16
- package/renderers/react.renderer.d.ts.map +1 -1
- package/renderers/transpiler.d.ts +49 -0
- package/renderers/transpiler.d.ts.map +1 -0
- package/universal/cached-runtime.d.ts +25 -1
- package/universal/cached-runtime.d.ts.map +1 -1
- package/universal/index.js +2037 -0
- package/universal/runtime-builder.d.ts.map +1 -1
- package/universal/types.d.ts.map +1 -1
- package/web-components/elements/fmcp-input.d.ts.map +1 -1
- package/web-components/elements/fmcp-select.d.ts.map +1 -1
- package/web-components/index.d.ts +0 -1
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +224 -289
- package/adapters/index.d.ts +0 -13
- package/adapters/index.d.ts.map +0 -1
- package/adapters/index.js +0 -462
- package/adapters/platform-meta.d.ts +0 -166
- package/adapters/platform-meta.d.ts.map +0 -1
- package/adapters/response-builder.d.ts +0 -108
- package/adapters/response-builder.d.ts.map +0 -1
- package/adapters/serving-mode.d.ts +0 -107
- package/adapters/serving-mode.d.ts.map +0 -1
- package/base-template/bridge.d.ts +0 -90
- package/base-template/bridge.d.ts.map +0 -1
- package/base-template/default-base-template.d.ts +0 -92
- package/base-template/default-base-template.d.ts.map +0 -1
- package/base-template/index.d.ts +0 -15
- package/base-template/index.d.ts.map +0 -1
- package/base-template/index.js +0 -1398
- package/base-template/polyfills.d.ts +0 -31
- package/base-template/polyfills.d.ts.map +0 -1
- package/base-template/theme-styles.d.ts +0 -74
- package/base-template/theme-styles.d.ts.map +0 -1
- package/build/cdn-resources.d.ts +0 -243
- package/build/cdn-resources.d.ts.map +0 -1
- package/build/index.d.ts +0 -295
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -7096
- package/build/widget-manifest.d.ts +0 -362
- package/build/widget-manifest.d.ts.map +0 -1
- package/bundler/cache.d.ts +0 -173
- package/bundler/cache.d.ts.map +0 -1
- package/bundler/file-cache/component-builder.d.ts +0 -167
- package/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/bundler/file-cache/index.d.ts +0 -12
- package/bundler/file-cache/index.d.ts.map +0 -1
- package/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/bundler/file-cache/storage/index.d.ts +0 -11
- package/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/bundler/file-cache/storage/interface.d.ts +0 -152
- package/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/bundler/file-cache/storage/redis.d.ts +0 -139
- package/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/bundler/sandbox/executor.d.ts +0 -14
- package/bundler/sandbox/executor.d.ts.map +0 -1
- package/bundler/sandbox/policy.d.ts +0 -62
- package/bundler/sandbox/policy.d.ts.map +0 -1
- package/dependency/cdn-registry.d.ts +0 -98
- package/dependency/cdn-registry.d.ts.map +0 -1
- package/dependency/import-map.d.ts +0 -186
- package/dependency/import-map.d.ts.map +0 -1
- package/dependency/import-parser.d.ts +0 -82
- package/dependency/import-parser.d.ts.map +0 -1
- package/dependency/index.d.ts +0 -17
- package/dependency/index.d.ts.map +0 -1
- package/dependency/resolver.d.ts +0 -164
- package/dependency/resolver.d.ts.map +0 -1
- package/dependency/schemas.d.ts +0 -486
- package/dependency/schemas.d.ts.map +0 -1
- package/dependency/template-loader.d.ts +0 -204
- package/dependency/template-loader.d.ts.map +0 -1
- package/dependency/template-processor.d.ts +0 -118
- package/dependency/template-processor.d.ts.map +0 -1
- package/dependency/types.d.ts +0 -739
- package/dependency/types.d.ts.map +0 -1
- package/esm/adapters/index.d.ts +0 -13
- package/esm/adapters/index.d.ts.map +0 -1
- package/esm/adapters/index.js +0 -427
- package/esm/adapters/platform-meta.d.ts +0 -166
- package/esm/adapters/platform-meta.d.ts.map +0 -1
- package/esm/adapters/response-builder.d.ts +0 -108
- package/esm/adapters/response-builder.d.ts.map +0 -1
- package/esm/adapters/serving-mode.d.ts +0 -107
- package/esm/adapters/serving-mode.d.ts.map +0 -1
- package/esm/base-template/bridge.d.ts +0 -90
- package/esm/base-template/bridge.d.ts.map +0 -1
- package/esm/base-template/default-base-template.d.ts +0 -92
- package/esm/base-template/default-base-template.d.ts.map +0 -1
- package/esm/base-template/index.d.ts +0 -15
- package/esm/base-template/index.d.ts.map +0 -1
- package/esm/base-template/index.js +0 -1364
- package/esm/base-template/polyfills.d.ts +0 -31
- package/esm/base-template/polyfills.d.ts.map +0 -1
- package/esm/base-template/theme-styles.d.ts +0 -74
- package/esm/base-template/theme-styles.d.ts.map +0 -1
- package/esm/bridge/adapters/base-adapter.d.ts +0 -104
- package/esm/bridge/adapters/base-adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/claude.adapter.d.ts +0 -67
- package/esm/bridge/adapters/claude.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/ext-apps.adapter.d.ts +0 -143
- package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/gemini.adapter.d.ts +0 -64
- package/esm/bridge/adapters/gemini.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/generic.adapter.d.ts +0 -56
- package/esm/bridge/adapters/generic.adapter.d.ts.map +0 -1
- package/esm/bridge/adapters/index.d.ts +0 -26
- package/esm/bridge/adapters/index.d.ts.map +0 -1
- package/esm/bridge/adapters/openai.adapter.d.ts +0 -65
- package/esm/bridge/adapters/openai.adapter.d.ts.map +0 -1
- package/esm/bridge/core/adapter-registry.d.ts +0 -122
- package/esm/bridge/core/adapter-registry.d.ts.map +0 -1
- package/esm/bridge/core/bridge-factory.d.ts +0 -199
- package/esm/bridge/core/bridge-factory.d.ts.map +0 -1
- package/esm/bridge/core/index.d.ts +0 -10
- package/esm/bridge/core/index.d.ts.map +0 -1
- package/esm/bridge/index.d.ts +0 -62
- package/esm/bridge/index.d.ts.map +0 -1
- package/esm/bridge/runtime/iife-generator.d.ts +0 -62
- package/esm/bridge/runtime/iife-generator.d.ts.map +0 -1
- package/esm/bridge/runtime/index.d.ts +0 -9
- package/esm/bridge/runtime/index.d.ts.map +0 -1
- package/esm/bridge/types.d.ts +0 -386
- package/esm/bridge/types.d.ts.map +0 -1
- package/esm/build/cdn-resources.d.ts +0 -243
- package/esm/build/cdn-resources.d.ts.map +0 -1
- package/esm/build/index.d.ts +0 -295
- package/esm/build/index.d.ts.map +0 -1
- package/esm/build/index.js +0 -7021
- package/esm/build/widget-manifest.d.ts +0 -362
- package/esm/build/widget-manifest.d.ts.map +0 -1
- package/esm/bundler/bundler.d.ts +0 -208
- package/esm/bundler/bundler.d.ts.map +0 -1
- package/esm/bundler/cache.d.ts +0 -173
- package/esm/bundler/cache.d.ts.map +0 -1
- package/esm/bundler/file-cache/component-builder.d.ts +0 -167
- package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
- package/esm/bundler/file-cache/index.d.ts +0 -12
- package/esm/bundler/file-cache/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/index.d.ts +0 -11
- package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
- package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
- package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
- package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
- package/esm/bundler/index.d.ts +0 -43
- package/esm/bundler/index.d.ts.map +0 -1
- package/esm/bundler/index.js +0 -4687
- package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
- package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
- package/esm/bundler/sandbox/executor.d.ts +0 -14
- package/esm/bundler/sandbox/executor.d.ts.map +0 -1
- package/esm/bundler/sandbox/policy.d.ts +0 -62
- package/esm/bundler/sandbox/policy.d.ts.map +0 -1
- package/esm/bundler/types.d.ts +0 -702
- package/esm/bundler/types.d.ts.map +0 -1
- package/esm/components/alert.d.ts +0 -66
- package/esm/components/alert.d.ts.map +0 -1
- package/esm/components/alert.schema.d.ts +0 -98
- package/esm/components/alert.schema.d.ts.map +0 -1
- package/esm/components/avatar.d.ts +0 -77
- package/esm/components/avatar.d.ts.map +0 -1
- package/esm/components/avatar.schema.d.ts +0 -170
- package/esm/components/avatar.schema.d.ts.map +0 -1
- package/esm/components/badge.d.ts +0 -64
- package/esm/components/badge.d.ts.map +0 -1
- package/esm/components/badge.schema.d.ts +0 -91
- package/esm/components/badge.schema.d.ts.map +0 -1
- package/esm/components/button.d.ts +0 -100
- package/esm/components/button.d.ts.map +0 -1
- package/esm/components/button.schema.d.ts +0 -120
- package/esm/components/button.schema.d.ts.map +0 -1
- package/esm/components/card.d.ts +0 -53
- package/esm/components/card.d.ts.map +0 -1
- package/esm/components/card.schema.d.ts +0 -93
- package/esm/components/card.schema.d.ts.map +0 -1
- package/esm/components/form.d.ts +0 -212
- package/esm/components/form.d.ts.map +0 -1
- package/esm/components/form.schema.d.ts +0 -365
- package/esm/components/form.schema.d.ts.map +0 -1
- package/esm/components/index.d.ts +0 -29
- package/esm/components/index.d.ts.map +0 -1
- package/esm/components/list.d.ts +0 -121
- package/esm/components/list.d.ts.map +0 -1
- package/esm/components/list.schema.d.ts +0 -129
- package/esm/components/list.schema.d.ts.map +0 -1
- package/esm/components/modal.d.ts +0 -100
- package/esm/components/modal.d.ts.map +0 -1
- package/esm/components/modal.schema.d.ts +0 -151
- package/esm/components/modal.schema.d.ts.map +0 -1
- package/esm/components/table.d.ts +0 -91
- package/esm/components/table.d.ts.map +0 -1
- package/esm/components/table.schema.d.ts +0 -123
- package/esm/components/table.schema.d.ts.map +0 -1
- package/esm/dependency/cdn-registry.d.ts +0 -98
- package/esm/dependency/cdn-registry.d.ts.map +0 -1
- package/esm/dependency/import-map.d.ts +0 -186
- package/esm/dependency/import-map.d.ts.map +0 -1
- package/esm/dependency/import-parser.d.ts +0 -82
- package/esm/dependency/import-parser.d.ts.map +0 -1
- package/esm/dependency/index.d.ts +0 -17
- package/esm/dependency/index.d.ts.map +0 -1
- package/esm/dependency/resolver.d.ts +0 -164
- package/esm/dependency/resolver.d.ts.map +0 -1
- package/esm/dependency/schemas.d.ts +0 -486
- package/esm/dependency/schemas.d.ts.map +0 -1
- package/esm/dependency/template-loader.d.ts +0 -204
- package/esm/dependency/template-loader.d.ts.map +0 -1
- package/esm/dependency/template-processor.d.ts +0 -118
- package/esm/dependency/template-processor.d.ts.map +0 -1
- package/esm/dependency/types.d.ts +0 -739
- package/esm/dependency/types.d.ts.map +0 -1
- package/esm/handlebars/expression-extractor.d.ts +0 -147
- package/esm/handlebars/expression-extractor.d.ts.map +0 -1
- package/esm/handlebars/helpers.d.ts +0 -339
- package/esm/handlebars/helpers.d.ts.map +0 -1
- package/esm/handlebars/index.d.ts +0 -195
- package/esm/handlebars/index.d.ts.map +0 -1
- package/esm/handlebars/index.js +0 -587
- package/esm/index.d.ts +0 -56
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -20511
- package/esm/layouts/base.d.ts +0 -86
- package/esm/layouts/base.d.ts.map +0 -1
- package/esm/layouts/index.d.ts +0 -8
- package/esm/layouts/index.d.ts.map +0 -1
- package/esm/layouts/index.js +0 -892
- package/esm/layouts/presets.d.ts +0 -134
- package/esm/layouts/presets.d.ts.map +0 -1
- package/esm/pages/consent.d.ts +0 -117
- package/esm/pages/consent.d.ts.map +0 -1
- package/esm/pages/error.d.ts +0 -101
- package/esm/pages/error.d.ts.map +0 -1
- package/esm/pages/index.d.ts +0 -9
- package/esm/pages/index.d.ts.map +0 -1
- package/esm/pages/index.js +0 -1563
- package/esm/react/Alert.d.ts +0 -102
- package/esm/react/Alert.d.ts.map +0 -1
- package/esm/react/Badge.d.ts +0 -101
- package/esm/react/Badge.d.ts.map +0 -1
- package/esm/react/Button.d.ts +0 -109
- package/esm/react/Button.d.ts.map +0 -1
- package/esm/react/Card.d.ts +0 -104
- package/esm/react/Card.d.ts.map +0 -1
- package/esm/react/hooks/context.d.ts +0 -179
- package/esm/react/hooks/context.d.ts.map +0 -1
- package/esm/react/hooks/index.d.ts +0 -42
- package/esm/react/hooks/index.d.ts.map +0 -1
- package/esm/react/hooks/tools.d.ts +0 -284
- package/esm/react/hooks/tools.d.ts.map +0 -1
- package/esm/react/index.d.ts +0 -81
- package/esm/react/index.d.ts.map +0 -1
- package/esm/react/types.d.ts +0 -106
- package/esm/react/types.d.ts.map +0 -1
- package/esm/react/utils.d.ts +0 -43
- package/esm/react/utils.d.ts.map +0 -1
- package/esm/registry/index.d.ts +0 -46
- package/esm/registry/index.d.ts.map +0 -1
- package/esm/registry/index.js +0 -6422
- package/esm/registry/render-template.d.ts +0 -91
- package/esm/registry/render-template.d.ts.map +0 -1
- package/esm/registry/tool-ui.registry.d.ts +0 -294
- package/esm/registry/tool-ui.registry.d.ts.map +0 -1
- package/esm/registry/uri-utils.d.ts +0 -56
- package/esm/registry/uri-utils.d.ts.map +0 -1
- package/esm/render/index.d.ts +0 -8
- package/esm/render/index.d.ts.map +0 -1
- package/esm/render/prerender.d.ts +0 -57
- package/esm/render/prerender.d.ts.map +0 -1
- package/esm/renderers/cache.d.ts +0 -145
- package/esm/renderers/cache.d.ts.map +0 -1
- package/esm/renderers/html.renderer.d.ts +0 -123
- package/esm/renderers/html.renderer.d.ts.map +0 -1
- package/esm/renderers/index.d.ts +0 -36
- package/esm/renderers/index.d.ts.map +0 -1
- package/esm/renderers/index.js +0 -1827
- package/esm/renderers/mdx.renderer.d.ts +0 -120
- package/esm/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/renderers/react.renderer.d.ts +0 -96
- package/esm/renderers/react.renderer.d.ts.map +0 -1
- package/esm/renderers/registry.d.ts +0 -134
- package/esm/renderers/registry.d.ts.map +0 -1
- package/esm/renderers/types.d.ts +0 -342
- package/esm/renderers/types.d.ts.map +0 -1
- package/esm/renderers/utils/detect.d.ts +0 -107
- package/esm/renderers/utils/detect.d.ts.map +0 -1
- package/esm/renderers/utils/hash.d.ts +0 -40
- package/esm/renderers/utils/hash.d.ts.map +0 -1
- package/esm/renderers/utils/index.d.ts +0 -9
- package/esm/renderers/utils/index.d.ts.map +0 -1
- package/esm/renderers/utils/transpiler.d.ts +0 -89
- package/esm/renderers/utils/transpiler.d.ts.map +0 -1
- package/esm/runtime/adapters/html.adapter.d.ts +0 -59
- package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/index.d.ts +0 -26
- package/esm/runtime/adapters/index.d.ts.map +0 -1
- package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/types.d.ts +0 -95
- package/esm/runtime/adapters/types.d.ts.map +0 -1
- package/esm/runtime/csp.d.ts +0 -48
- package/esm/runtime/csp.d.ts.map +0 -1
- package/esm/runtime/index.d.ts +0 -17
- package/esm/runtime/index.d.ts.map +0 -1
- package/esm/runtime/index.js +0 -5186
- package/esm/runtime/mcp-bridge.d.ts +0 -101
- package/esm/runtime/mcp-bridge.d.ts.map +0 -1
- package/esm/runtime/renderer-runtime.d.ts +0 -133
- package/esm/runtime/renderer-runtime.d.ts.map +0 -1
- package/esm/runtime/sanitizer.d.ts +0 -172
- package/esm/runtime/sanitizer.d.ts.map +0 -1
- package/esm/runtime/types.d.ts +0 -415
- package/esm/runtime/types.d.ts.map +0 -1
- package/esm/runtime/wrapper.d.ts +0 -421
- package/esm/runtime/wrapper.d.ts.map +0 -1
- package/esm/styles/index.d.ts +0 -8
- package/esm/styles/index.d.ts.map +0 -1
- package/esm/styles/index.js +0 -171
- package/esm/styles/variants.d.ts +0 -51
- package/esm/styles/variants.d.ts.map +0 -1
- package/esm/theme/cdn.d.ts +0 -195
- package/esm/theme/cdn.d.ts.map +0 -1
- package/esm/theme/index.d.ts +0 -18
- package/esm/theme/index.d.ts.map +0 -1
- package/esm/theme/index.js +0 -700
- package/esm/theme/platforms.d.ts +0 -107
- package/esm/theme/platforms.d.ts.map +0 -1
- package/esm/theme/presets/github-openai.d.ts +0 -50
- package/esm/theme/presets/github-openai.d.ts.map +0 -1
- package/esm/theme/presets/index.d.ts +0 -11
- package/esm/theme/presets/index.d.ts.map +0 -1
- package/esm/theme/theme.d.ts +0 -396
- package/esm/theme/theme.d.ts.map +0 -1
- package/esm/tool-template/builder.d.ts +0 -213
- package/esm/tool-template/builder.d.ts.map +0 -1
- package/esm/tool-template/index.d.ts +0 -16
- package/esm/tool-template/index.d.ts.map +0 -1
- package/esm/tool-template/index.js +0 -3515
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/index.js +0 -75
- package/esm/types/ui-config.d.ts +0 -639
- package/esm/types/ui-config.d.ts.map +0 -1
- package/esm/types/ui-runtime.d.ts +0 -1007
- package/esm/types/ui-runtime.d.ts.map +0 -1
- package/esm/typings/cache/cache-adapter.d.ts +0 -125
- package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
- package/esm/typings/cache/index.d.ts +0 -10
- package/esm/typings/cache/index.d.ts.map +0 -1
- package/esm/typings/cache/memory-cache.d.ts +0 -92
- package/esm/typings/cache/memory-cache.d.ts.map +0 -1
- package/esm/typings/dts-parser.d.ts +0 -90
- package/esm/typings/dts-parser.d.ts.map +0 -1
- package/esm/typings/index.d.ts +0 -48
- package/esm/typings/index.d.ts.map +0 -1
- package/esm/typings/schemas.d.ts +0 -232
- package/esm/typings/schemas.d.ts.map +0 -1
- package/esm/typings/type-fetcher.d.ts +0 -89
- package/esm/typings/type-fetcher.d.ts.map +0 -1
- package/esm/typings/types.d.ts +0 -320
- package/esm/typings/types.d.ts.map +0 -1
- package/esm/universal/UniversalApp.d.ts +0 -108
- package/esm/universal/UniversalApp.d.ts.map +0 -1
- package/esm/universal/cached-runtime.d.ts +0 -115
- package/esm/universal/cached-runtime.d.ts.map +0 -1
- package/esm/universal/context.d.ts +0 -122
- package/esm/universal/context.d.ts.map +0 -1
- package/esm/universal/index.d.ts +0 -57
- package/esm/universal/index.d.ts.map +0 -1
- package/esm/universal/renderers/html.renderer.d.ts +0 -37
- package/esm/universal/renderers/html.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/index.d.ts +0 -112
- package/esm/universal/renderers/index.d.ts.map +0 -1
- package/esm/universal/renderers/markdown.renderer.d.ts +0 -33
- package/esm/universal/renderers/markdown.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/mdx.renderer.d.ts +0 -38
- package/esm/universal/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/universal/renderers/react.renderer.d.ts +0 -46
- package/esm/universal/renderers/react.renderer.d.ts.map +0 -1
- package/esm/universal/runtime-builder.d.ts +0 -33
- package/esm/universal/runtime-builder.d.ts.map +0 -1
- package/esm/universal/store.d.ts +0 -135
- package/esm/universal/store.d.ts.map +0 -1
- package/esm/universal/types.d.ts +0 -199
- package/esm/universal/types.d.ts.map +0 -1
- package/esm/utils/escape-html.d.ts +0 -58
- package/esm/utils/escape-html.d.ts.map +0 -1
- package/esm/utils/index.d.ts +0 -10
- package/esm/utils/index.d.ts.map +0 -1
- package/esm/utils/index.js +0 -40
- package/esm/utils/safe-stringify.d.ts +0 -30
- package/esm/utils/safe-stringify.d.ts.map +0 -1
- package/esm/validation/error-box.d.ts +0 -56
- package/esm/validation/error-box.d.ts.map +0 -1
- package/esm/validation/index.d.ts +0 -13
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/index.js +0 -562
- package/esm/validation/schema-paths.d.ts +0 -118
- package/esm/validation/schema-paths.d.ts.map +0 -1
- package/esm/validation/template-validator.d.ts +0 -143
- package/esm/validation/template-validator.d.ts.map +0 -1
- package/esm/validation/wrapper.d.ts +0 -97
- package/esm/validation/wrapper.d.ts.map +0 -1
- package/esm/web-components/core/attribute-parser.d.ts +0 -82
- package/esm/web-components/core/attribute-parser.d.ts.map +0 -1
- package/esm/web-components/core/base-element.d.ts +0 -197
- package/esm/web-components/core/base-element.d.ts.map +0 -1
- package/esm/web-components/core/index.d.ts +0 -9
- package/esm/web-components/core/index.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-alert.d.ts +0 -46
- package/esm/web-components/elements/fmcp-alert.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-badge.d.ts +0 -47
- package/esm/web-components/elements/fmcp-badge.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-button.d.ts +0 -117
- package/esm/web-components/elements/fmcp-button.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-card.d.ts +0 -53
- package/esm/web-components/elements/fmcp-card.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-input.d.ts +0 -96
- package/esm/web-components/elements/fmcp-input.d.ts.map +0 -1
- package/esm/web-components/elements/fmcp-select.d.ts +0 -100
- package/esm/web-components/elements/fmcp-select.d.ts.map +0 -1
- package/esm/web-components/elements/index.d.ts +0 -13
- package/esm/web-components/elements/index.d.ts.map +0 -1
- package/esm/web-components/index.d.ts +0 -50
- package/esm/web-components/index.d.ts.map +0 -1
- package/esm/web-components/register.d.ts +0 -57
- package/esm/web-components/register.d.ts.map +0 -1
- package/esm/web-components/types.d.ts +0 -122
- package/esm/web-components/types.d.ts.map +0 -1
- package/esm/widgets/index.d.ts +0 -8
- package/esm/widgets/index.d.ts.map +0 -1
- package/esm/widgets/index.js +0 -941
- package/esm/widgets/progress.d.ts +0 -133
- package/esm/widgets/progress.d.ts.map +0 -1
- package/esm/widgets/resource.d.ts +0 -163
- package/esm/widgets/resource.d.ts.map +0 -1
- package/handlebars/expression-extractor.d.ts +0 -147
- package/handlebars/expression-extractor.d.ts.map +0 -1
- package/handlebars/helpers.d.ts +0 -339
- package/handlebars/helpers.d.ts.map +0 -1
- package/handlebars/index.d.ts +0 -195
- package/handlebars/index.d.ts.map +0 -1
- package/handlebars/index.js +0 -666
- package/pages/consent.d.ts +0 -117
- package/pages/consent.d.ts.map +0 -1
- package/pages/error.d.ts +0 -101
- package/pages/error.d.ts.map +0 -1
- package/pages/index.d.ts +0 -9
- package/pages/index.d.ts.map +0 -1
- package/pages/index.js +0 -1602
- package/react/utils.d.ts +0 -43
- package/react/utils.d.ts.map +0 -1
- package/registry/index.d.ts +0 -46
- package/registry/index.d.ts.map +0 -1
- package/registry/index.js +0 -6465
- package/registry/render-template.d.ts +0 -91
- package/registry/render-template.d.ts.map +0 -1
- package/registry/tool-ui.registry.d.ts +0 -294
- package/registry/tool-ui.registry.d.ts.map +0 -1
- package/registry/uri-utils.d.ts +0 -56
- package/registry/uri-utils.d.ts.map +0 -1
- package/renderers/cache.d.ts +0 -145
- package/renderers/cache.d.ts.map +0 -1
- package/renderers/html.renderer.d.ts +0 -123
- package/renderers/html.renderer.d.ts.map +0 -1
- package/renderers/registry.d.ts +0 -134
- package/renderers/registry.d.ts.map +0 -1
- package/renderers/types.d.ts +0 -342
- package/renderers/types.d.ts.map +0 -1
- package/renderers/utils/detect.d.ts +0 -107
- package/renderers/utils/detect.d.ts.map +0 -1
- package/renderers/utils/hash.d.ts +0 -40
- package/renderers/utils/hash.d.ts.map +0 -1
- package/renderers/utils/index.d.ts +0 -9
- package/renderers/utils/index.d.ts.map +0 -1
- package/renderers/utils/transpiler.d.ts +0 -89
- package/renderers/utils/transpiler.d.ts.map +0 -1
- package/runtime/adapters/html.adapter.d.ts +0 -59
- package/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/runtime/adapters/index.d.ts +0 -26
- package/runtime/adapters/index.d.ts.map +0 -1
- package/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/runtime/adapters/react.adapter.d.ts +0 -70
- package/runtime/adapters/react.adapter.d.ts.map +0 -1
- package/runtime/adapters/types.d.ts +0 -95
- package/runtime/adapters/types.d.ts.map +0 -1
- package/runtime/csp.d.ts +0 -48
- package/runtime/csp.d.ts.map +0 -1
- package/runtime/index.d.ts +0 -17
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -5264
- package/runtime/mcp-bridge.d.ts +0 -101
- package/runtime/mcp-bridge.d.ts.map +0 -1
- package/runtime/renderer-runtime.d.ts +0 -133
- package/runtime/renderer-runtime.d.ts.map +0 -1
- package/runtime/sanitizer.d.ts +0 -172
- package/runtime/sanitizer.d.ts.map +0 -1
- package/runtime/types.d.ts +0 -415
- package/runtime/types.d.ts.map +0 -1
- package/runtime/wrapper.d.ts +0 -421
- package/runtime/wrapper.d.ts.map +0 -1
- package/styles/index.d.ts +0 -8
- package/styles/index.d.ts.map +0 -1
- package/styles/index.js +0 -222
- package/styles/variants.d.ts +0 -51
- package/styles/variants.d.ts.map +0 -1
- package/theme/cdn.d.ts +0 -195
- package/theme/cdn.d.ts.map +0 -1
- package/theme/index.d.ts +0 -18
- package/theme/index.d.ts.map +0 -1
- package/theme/index.js +0 -757
- package/theme/platforms.d.ts +0 -107
- package/theme/platforms.d.ts.map +0 -1
- package/theme/presets/github-openai.d.ts +0 -50
- package/theme/presets/github-openai.d.ts.map +0 -1
- package/theme/presets/index.d.ts +0 -11
- package/theme/presets/index.d.ts.map +0 -1
- package/theme/theme.d.ts +0 -396
- package/theme/theme.d.ts.map +0 -1
- package/tool-template/builder.d.ts +0 -213
- package/tool-template/builder.d.ts.map +0 -1
- package/tool-template/index.d.ts +0 -16
- package/tool-template/index.d.ts.map +0 -1
- package/tool-template/index.js +0 -3559
- package/types/index.d.ts +0 -14
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -108
- package/types/ui-config.d.ts +0 -639
- package/types/ui-config.d.ts.map +0 -1
- package/types/ui-runtime.d.ts +0 -1007
- package/types/ui-runtime.d.ts.map +0 -1
- package/typings/cache/cache-adapter.d.ts +0 -125
- package/typings/cache/cache-adapter.d.ts.map +0 -1
- package/typings/cache/index.d.ts +0 -10
- package/typings/cache/index.d.ts.map +0 -1
- package/typings/cache/memory-cache.d.ts +0 -92
- package/typings/cache/memory-cache.d.ts.map +0 -1
- package/typings/dts-parser.d.ts +0 -90
- package/typings/dts-parser.d.ts.map +0 -1
- package/typings/index.d.ts +0 -48
- package/typings/index.d.ts.map +0 -1
- package/typings/schemas.d.ts +0 -232
- package/typings/schemas.d.ts.map +0 -1
- package/typings/type-fetcher.d.ts +0 -89
- package/typings/type-fetcher.d.ts.map +0 -1
- package/typings/types.d.ts +0 -320
- package/typings/types.d.ts.map +0 -1
- package/utils/escape-html.d.ts +0 -58
- package/utils/escape-html.d.ts.map +0 -1
- package/utils/index.d.ts +0 -10
- package/utils/index.d.ts.map +0 -1
- package/utils/index.js +0 -70
- package/utils/safe-stringify.d.ts +0 -30
- package/utils/safe-stringify.d.ts.map +0 -1
- package/validation/error-box.d.ts +0 -56
- package/validation/error-box.d.ts.map +0 -1
- package/validation/index.d.ts +0 -13
- package/validation/index.d.ts.map +0 -1
- package/validation/index.js +0 -603
- package/validation/schema-paths.d.ts +0 -118
- package/validation/schema-paths.d.ts.map +0 -1
- package/validation/template-validator.d.ts +0 -143
- package/validation/template-validator.d.ts.map +0 -1
- package/validation/wrapper.d.ts +0 -97
- package/validation/wrapper.d.ts.map +0 -1
- package/widgets/index.d.ts +0 -8
- package/widgets/index.d.ts.map +0 -1
- package/widgets/index.js +0 -978
- package/widgets/progress.d.ts +0 -133
- package/widgets/progress.d.ts.map +0 -1
- package/widgets/resource.d.ts +0 -163
- package/widgets/resource.d.ts.map +0 -1
- /package/esm/render/{index.js → index.mjs} +0 -0
package/web-components/index.js
CHANGED
|
@@ -42,55 +42,8 @@ __export(web_components_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(web_components_exports);
|
|
44
44
|
|
|
45
|
-
// libs/ui/src/
|
|
46
|
-
var
|
|
47
|
-
id: "claude",
|
|
48
|
-
name: "Claude (Artifacts)",
|
|
49
|
-
supportsWidgets: true,
|
|
50
|
-
supportsTailwind: true,
|
|
51
|
-
supportsHtmx: false,
|
|
52
|
-
// Network blocked, HTMX won't work for API calls
|
|
53
|
-
networkMode: "blocked",
|
|
54
|
-
scriptStrategy: "inline",
|
|
55
|
-
maxInlineSize: 100 * 1024,
|
|
56
|
-
// 100KB limit for artifacts
|
|
57
|
-
cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
|
|
58
|
-
options: {
|
|
59
|
-
mode: "artifacts",
|
|
60
|
-
framework: "react"
|
|
61
|
-
// Claude artifacts prefer React
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// libs/ui/src/utils/escape-html.ts
|
|
66
|
-
function escapeHtml(str) {
|
|
67
|
-
if (str === null || str === void 0) {
|
|
68
|
-
return "";
|
|
69
|
-
}
|
|
70
|
-
const s = String(str);
|
|
71
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// libs/ui/src/validation/error-box.ts
|
|
75
|
-
var errorIcon = `<svg class="w-5 h-5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
76
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
|
77
|
-
</svg>`;
|
|
78
|
-
function validationErrorBox(options) {
|
|
79
|
-
const { componentName, invalidParam } = options;
|
|
80
|
-
return `<div
|
|
81
|
-
class="validation-error flex items-start gap-3 p-4 bg-red-50 border border-red-200 text-red-800 rounded-lg"
|
|
82
|
-
role="alert"
|
|
83
|
-
data-testid="validation-error"
|
|
84
|
-
data-component="${escapeHtml(componentName)}"
|
|
85
|
-
data-param="${escapeHtml(invalidParam)}"
|
|
86
|
-
>
|
|
87
|
-
${errorIcon}
|
|
88
|
-
<div class="min-w-0">
|
|
89
|
-
<p class="font-semibold text-sm">${escapeHtml(componentName)}: Invalid Configuration</p>
|
|
90
|
-
<p class="text-sm opacity-90 mt-0.5">The "${escapeHtml(invalidParam)}" parameter is invalid.</p>
|
|
91
|
-
</div>
|
|
92
|
-
</div>`;
|
|
93
|
-
}
|
|
45
|
+
// libs/ui/src/web-components/core/base-element.ts
|
|
46
|
+
var import_validation = require("@frontmcp/uipack/validation");
|
|
94
47
|
|
|
95
48
|
// libs/ui/src/web-components/core/attribute-parser.ts
|
|
96
49
|
function parseAttributeValue(attrName, value) {
|
|
@@ -294,7 +247,7 @@ var FmcpElement = class extends HTMLElementBase {
|
|
|
294
247
|
if (!result.success) {
|
|
295
248
|
const firstError = result.error.issues[0];
|
|
296
249
|
const invalidParam = firstError?.path.join(".") || "options";
|
|
297
|
-
this.innerHTML = validationErrorBox({
|
|
250
|
+
this.innerHTML = (0, import_validation.validationErrorBox)({
|
|
298
251
|
componentName: this.config.name,
|
|
299
252
|
invalidParam
|
|
300
253
|
});
|
|
@@ -354,81 +307,63 @@ var FmcpElement = class extends HTMLElementBase {
|
|
|
354
307
|
}
|
|
355
308
|
};
|
|
356
309
|
|
|
357
|
-
// libs/ui/src/
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
return "options";
|
|
362
|
-
}
|
|
363
|
-
return firstError.path.map(String).join(".");
|
|
364
|
-
}
|
|
365
|
-
function validateOptions(options, config) {
|
|
366
|
-
const result = config.schema.safeParse(options);
|
|
367
|
-
if (result.success) {
|
|
368
|
-
return { success: true, data: result.data };
|
|
369
|
-
}
|
|
370
|
-
const invalidParam = getFirstInvalidPath(result.error);
|
|
371
|
-
return {
|
|
372
|
-
success: false,
|
|
373
|
-
error: validationErrorBox({
|
|
374
|
-
componentName: config.componentName,
|
|
375
|
-
invalidParam
|
|
376
|
-
})
|
|
377
|
-
};
|
|
378
|
-
}
|
|
310
|
+
// libs/ui/src/layouts/base.ts
|
|
311
|
+
var import_theme = require("@frontmcp/uipack/theme");
|
|
312
|
+
var import_utils = require("@frontmcp/uipack/utils");
|
|
313
|
+
var import_utils2 = require("@frontmcp/uipack/utils");
|
|
379
314
|
|
|
380
|
-
// libs/ui/src/
|
|
381
|
-
var
|
|
315
|
+
// libs/ui/src/components/button.ts
|
|
316
|
+
var import_validation2 = require("@frontmcp/uipack/validation");
|
|
382
317
|
|
|
383
318
|
// libs/ui/src/components/button.schema.ts
|
|
384
|
-
var
|
|
385
|
-
var ButtonVariantSchema =
|
|
386
|
-
var ButtonSizeSchema =
|
|
387
|
-
var ButtonOptionsSchema =
|
|
319
|
+
var import_zod = require("zod");
|
|
320
|
+
var ButtonVariantSchema = import_zod.z.enum(["primary", "secondary", "outline", "ghost", "danger", "success", "link"]);
|
|
321
|
+
var ButtonSizeSchema = import_zod.z.enum(["xs", "sm", "md", "lg", "xl"]);
|
|
322
|
+
var ButtonOptionsSchema = import_zod.z.object({
|
|
388
323
|
/** Button variant */
|
|
389
324
|
variant: ButtonVariantSchema.optional(),
|
|
390
325
|
/** Button size */
|
|
391
326
|
size: ButtonSizeSchema.optional(),
|
|
392
327
|
/** Button type attribute */
|
|
393
|
-
type:
|
|
328
|
+
type: import_zod.z.enum(["button", "submit", "reset"]).optional(),
|
|
394
329
|
/** Disabled state */
|
|
395
|
-
disabled:
|
|
330
|
+
disabled: import_zod.z.boolean().optional(),
|
|
396
331
|
/** Loading state */
|
|
397
|
-
loading:
|
|
332
|
+
loading: import_zod.z.boolean().optional(),
|
|
398
333
|
/** Full width */
|
|
399
|
-
fullWidth:
|
|
334
|
+
fullWidth: import_zod.z.boolean().optional(),
|
|
400
335
|
/** Icon before text (HTML string) */
|
|
401
|
-
iconBefore:
|
|
336
|
+
iconBefore: import_zod.z.string().optional(),
|
|
402
337
|
/** Icon after text (HTML string) */
|
|
403
|
-
iconAfter:
|
|
338
|
+
iconAfter: import_zod.z.string().optional(),
|
|
404
339
|
/** Icon only (no text) */
|
|
405
|
-
iconOnly:
|
|
340
|
+
iconOnly: import_zod.z.boolean().optional(),
|
|
406
341
|
/** Additional CSS classes */
|
|
407
|
-
className:
|
|
342
|
+
className: import_zod.z.string().optional(),
|
|
408
343
|
/** Button ID */
|
|
409
|
-
id:
|
|
344
|
+
id: import_zod.z.string().optional(),
|
|
410
345
|
/** Name attribute */
|
|
411
|
-
name:
|
|
346
|
+
name: import_zod.z.string().optional(),
|
|
412
347
|
/** Value attribute */
|
|
413
|
-
value:
|
|
348
|
+
value: import_zod.z.string().optional(),
|
|
414
349
|
/** Click handler (URL for links) */
|
|
415
|
-
href:
|
|
350
|
+
href: import_zod.z.string().optional(),
|
|
416
351
|
/** Open in new tab */
|
|
417
|
-
target:
|
|
352
|
+
target: import_zod.z.enum(["_blank", "_self"]).optional(),
|
|
418
353
|
/** Data attributes */
|
|
419
|
-
data:
|
|
354
|
+
data: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional(),
|
|
420
355
|
/** ARIA label */
|
|
421
|
-
ariaLabel:
|
|
356
|
+
ariaLabel: import_zod.z.string().optional()
|
|
422
357
|
}).strict();
|
|
423
|
-
var ButtonGroupOptionsSchema =
|
|
358
|
+
var ButtonGroupOptionsSchema = import_zod.z.object({
|
|
424
359
|
/** Attach buttons visually */
|
|
425
|
-
attached:
|
|
360
|
+
attached: import_zod.z.boolean().optional(),
|
|
426
361
|
/** Direction */
|
|
427
|
-
direction:
|
|
362
|
+
direction: import_zod.z.enum(["horizontal", "vertical"]).optional(),
|
|
428
363
|
/** Gap between buttons */
|
|
429
|
-
gap:
|
|
364
|
+
gap: import_zod.z.enum(["sm", "md", "lg"]).optional(),
|
|
430
365
|
/** Additional CSS classes */
|
|
431
|
-
className:
|
|
366
|
+
className: import_zod.z.string().optional()
|
|
432
367
|
}).strict();
|
|
433
368
|
|
|
434
369
|
// libs/ui/src/components/button.ts
|
|
@@ -481,7 +416,7 @@ function isValidHrefProtocol(href) {
|
|
|
481
416
|
return trimmed.startsWith("http://") || trimmed.startsWith("https://") || trimmed.startsWith("/") || trimmed.startsWith("#") || trimmed.startsWith("mailto:") || trimmed.startsWith("tel:");
|
|
482
417
|
}
|
|
483
418
|
function button(text, options = {}) {
|
|
484
|
-
const validation = validateOptions(options, {
|
|
419
|
+
const validation = (0, import_validation2.validateOptions)(options, {
|
|
485
420
|
schema: ButtonOptionsSchema,
|
|
486
421
|
componentName: "button"
|
|
487
422
|
});
|
|
@@ -521,7 +456,7 @@ function button(text, options = {}) {
|
|
|
521
456
|
}
|
|
522
457
|
const variantClasses = getVariantClasses(variant);
|
|
523
458
|
const sizeClasses = getSizeClasses(size, iconOnly);
|
|
524
|
-
const safeClassName = className ? escapeHtml(className) : "";
|
|
459
|
+
const safeClassName = className ? (0, import_utils2.escapeHtml)(className) : "";
|
|
525
460
|
const baseClasses = [
|
|
526
461
|
"inline-flex items-center justify-center",
|
|
527
462
|
"font-medium",
|
|
@@ -536,24 +471,24 @@ function button(text, options = {}) {
|
|
|
536
471
|
].filter(Boolean).join(" ");
|
|
537
472
|
const dataAttrs = data ? Object.entries(data).map(([key, val]) => {
|
|
538
473
|
const safeKey = sanitizeDataKey(key);
|
|
539
|
-
return safeKey ? `data-${safeKey}="${escapeHtml(val)}"` : "";
|
|
474
|
+
return safeKey ? `data-${safeKey}="${(0, import_utils2.escapeHtml)(val)}"` : "";
|
|
540
475
|
}).filter(Boolean).join(" ") : "";
|
|
541
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
542
|
-
const nameAttr = name ? `name="${escapeHtml(name)}"` : "";
|
|
543
|
-
const valueAttr = value ? `value="${escapeHtml(value)}"` : "";
|
|
476
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
477
|
+
const nameAttr = name ? `name="${(0, import_utils2.escapeHtml)(name)}"` : "";
|
|
478
|
+
const valueAttr = value ? `value="${(0, import_utils2.escapeHtml)(value)}"` : "";
|
|
544
479
|
const disabledAttr = disabled || loading ? "disabled" : "";
|
|
545
|
-
const targetAttr = target ? `target="${escapeHtml(target)}"` : "";
|
|
480
|
+
const targetAttr = target ? `target="${(0, import_utils2.escapeHtml)(target)}"` : "";
|
|
546
481
|
const relAttr = target === "_blank" ? 'rel="noopener noreferrer"' : "";
|
|
547
482
|
const trimmedText = text.trim();
|
|
548
483
|
const effectiveAriaLabel = ariaLabel ?? (iconOnly && trimmedText ? trimmedText : void 0);
|
|
549
|
-
const ariaLabelAttr = effectiveAriaLabel ? `aria-label="${escapeHtml(effectiveAriaLabel)}"` : "";
|
|
484
|
+
const ariaLabelAttr = effectiveAriaLabel ? `aria-label="${(0, import_utils2.escapeHtml)(effectiveAriaLabel)}"` : "";
|
|
550
485
|
const iconBeforeHtml = iconBefore && !loading ? `<span class="${iconOnly ? "" : "mr-2"}">${iconBefore}</span>` : "";
|
|
551
486
|
const iconAfterHtml = iconAfter && !loading ? `<span class="${iconOnly ? "" : "ml-2"}">${iconAfter}</span>` : "";
|
|
552
487
|
const loadingHtml = loading ? loadingSpinner : "";
|
|
553
|
-
const textHtml = iconOnly ? "" : escapeHtml(text);
|
|
488
|
+
const textHtml = iconOnly ? "" : (0, import_utils2.escapeHtml)(text);
|
|
554
489
|
const contentHtml = `${loadingHtml}${iconBeforeHtml}${textHtml}${iconAfterHtml}`;
|
|
555
490
|
if (href && !disabled && !loading && isValidHrefProtocol(href)) {
|
|
556
|
-
return `<a href="${escapeHtml(
|
|
491
|
+
return `<a href="${(0, import_utils2.escapeHtml)(
|
|
557
492
|
href
|
|
558
493
|
)}" class="${baseClasses}" ${idAttr} ${dataAttrs} ${ariaLabelAttr} ${targetAttr} ${relAttr}>
|
|
559
494
|
${contentHtml}
|
|
@@ -737,7 +672,7 @@ function getSizeClasses2(size) {
|
|
|
737
672
|
}
|
|
738
673
|
function buildDataAttrs(data) {
|
|
739
674
|
if (!data) return "";
|
|
740
|
-
return Object.entries(data).map(([key, value]) => `data-${key}="${escapeHtml(value)}"`).join(" ");
|
|
675
|
+
return Object.entries(data).map(([key, value]) => `data-${key}="${(0, import_utils2.escapeHtml)(value)}"`).join(" ");
|
|
741
676
|
}
|
|
742
677
|
function card(content, options = {}) {
|
|
743
678
|
const {
|
|
@@ -758,18 +693,18 @@ function card(content, options = {}) {
|
|
|
758
693
|
const clickableClasses = clickable ? "cursor-pointer hover:shadow-md transition-shadow" : "";
|
|
759
694
|
const allClasses = [variantClasses, sizeClasses, clickableClasses, className].filter(Boolean).join(" ");
|
|
760
695
|
const dataAttrs = buildDataAttrs(data);
|
|
761
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
696
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
762
697
|
const hasHeader = title || subtitle || headerActions;
|
|
763
698
|
const headerHtml = hasHeader ? `<div class="flex items-start justify-between mb-4">
|
|
764
699
|
<div>
|
|
765
|
-
${title ? `<h3 class="text-lg font-semibold text-text-primary">${escapeHtml(title)}</h3>` : ""}
|
|
766
|
-
${subtitle ? `<p class="text-sm text-text-secondary mt-1">${escapeHtml(subtitle)}</p>` : ""}
|
|
700
|
+
${title ? `<h3 class="text-lg font-semibold text-text-primary">${(0, import_utils2.escapeHtml)(title)}</h3>` : ""}
|
|
701
|
+
${subtitle ? `<p class="text-sm text-text-secondary mt-1">${(0, import_utils2.escapeHtml)(subtitle)}</p>` : ""}
|
|
767
702
|
</div>
|
|
768
703
|
${headerActions ? `<div class="flex items-center gap-2">${headerActions}</div>` : ""}
|
|
769
704
|
</div>` : "";
|
|
770
705
|
const footerHtml = footer ? `<div class="mt-4 pt-4 border-t border-divider">${footer}</div>` : "";
|
|
771
706
|
if (href) {
|
|
772
|
-
return `<a href="${escapeHtml(href)}" class="${allClasses}" ${idAttr} ${dataAttrs}>
|
|
707
|
+
return `<a href="${(0, import_utils2.escapeHtml)(href)}" class="${allClasses}" ${idAttr} ${dataAttrs}>
|
|
773
708
|
${headerHtml}
|
|
774
709
|
${content}
|
|
775
710
|
${footerHtml}
|
|
@@ -783,40 +718,40 @@ function card(content, options = {}) {
|
|
|
783
718
|
}
|
|
784
719
|
|
|
785
720
|
// libs/ui/src/components/card.schema.ts
|
|
786
|
-
var
|
|
787
|
-
var CardVariantSchema =
|
|
788
|
-
var CardSizeSchema =
|
|
789
|
-
var CardOptionsSchema =
|
|
721
|
+
var import_zod2 = require("zod");
|
|
722
|
+
var CardVariantSchema = import_zod2.z.enum(["default", "outlined", "elevated", "filled", "ghost"]);
|
|
723
|
+
var CardSizeSchema = import_zod2.z.enum(["sm", "md", "lg"]);
|
|
724
|
+
var CardOptionsSchema = import_zod2.z.object({
|
|
790
725
|
/** Card variant */
|
|
791
726
|
variant: CardVariantSchema.optional(),
|
|
792
727
|
/** Card size (padding) */
|
|
793
728
|
size: CardSizeSchema.optional(),
|
|
794
729
|
/** Card title */
|
|
795
|
-
title:
|
|
730
|
+
title: import_zod2.z.string().optional(),
|
|
796
731
|
/** Card subtitle/description */
|
|
797
|
-
subtitle:
|
|
732
|
+
subtitle: import_zod2.z.string().optional(),
|
|
798
733
|
/** Header actions (HTML string) */
|
|
799
|
-
headerActions:
|
|
734
|
+
headerActions: import_zod2.z.string().optional(),
|
|
800
735
|
/** Footer content (HTML string) */
|
|
801
|
-
footer:
|
|
736
|
+
footer: import_zod2.z.string().optional(),
|
|
802
737
|
/** Additional CSS classes */
|
|
803
|
-
className:
|
|
738
|
+
className: import_zod2.z.string().optional(),
|
|
804
739
|
/** Card ID */
|
|
805
|
-
id:
|
|
740
|
+
id: import_zod2.z.string().optional(),
|
|
806
741
|
/** Data attributes */
|
|
807
|
-
data:
|
|
742
|
+
data: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
|
|
808
743
|
/** Clickable card (adds hover effects) */
|
|
809
|
-
clickable:
|
|
744
|
+
clickable: import_zod2.z.boolean().optional(),
|
|
810
745
|
/** Click handler URL */
|
|
811
|
-
href:
|
|
746
|
+
href: import_zod2.z.string().optional()
|
|
812
747
|
}).strict();
|
|
813
|
-
var CardGroupOptionsSchema =
|
|
748
|
+
var CardGroupOptionsSchema = import_zod2.z.object({
|
|
814
749
|
/** Direction */
|
|
815
|
-
direction:
|
|
750
|
+
direction: import_zod2.z.enum(["horizontal", "vertical"]).optional(),
|
|
816
751
|
/** Gap between cards */
|
|
817
|
-
gap:
|
|
752
|
+
gap: import_zod2.z.enum(["sm", "md", "lg"]).optional(),
|
|
818
753
|
/** Additional CSS classes */
|
|
819
|
-
className:
|
|
754
|
+
className: import_zod2.z.string().optional()
|
|
820
755
|
}).strict();
|
|
821
756
|
|
|
822
757
|
// libs/ui/src/web-components/elements/fmcp-card.ts
|
|
@@ -949,7 +884,7 @@ function alert(message, options = {}) {
|
|
|
949
884
|
const iconHtml = showIcon ? `<div class="flex-shrink-0 ${variantClasses.icon}">
|
|
950
885
|
${icon || alertIcons[variant]}
|
|
951
886
|
</div>` : "";
|
|
952
|
-
const titleHtml = title ? `<h3 class="font-semibold">${escapeHtml(title)}</h3>` : "";
|
|
887
|
+
const titleHtml = title ? `<h3 class="font-semibold">${(0, import_utils2.escapeHtml)(title)}</h3>` : "";
|
|
953
888
|
const dismissHtml = dismissible ? `<button
|
|
954
889
|
type="button"
|
|
955
890
|
class="flex-shrink-0 ml-auto -mr-1 -mt-1 p-1 rounded hover:bg-black/5 transition-colors"
|
|
@@ -961,13 +896,13 @@ function alert(message, options = {}) {
|
|
|
961
896
|
</svg>
|
|
962
897
|
</button>` : "";
|
|
963
898
|
const actionsHtml = actions ? `<div class="mt-3">${actions}</div>` : "";
|
|
964
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
899
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
965
900
|
return `<div class="alert ${baseClasses}" role="alert" ${idAttr}>
|
|
966
901
|
<div class="flex gap-3">
|
|
967
902
|
${iconHtml}
|
|
968
903
|
<div class="flex-1">
|
|
969
904
|
${titleHtml}
|
|
970
|
-
<div class="${title ? "mt-1" : ""}">${escapeHtml(message)}</div>
|
|
905
|
+
<div class="${title ? "mt-1" : ""}">${(0, import_utils2.escapeHtml)(message)}</div>
|
|
971
906
|
${actionsHtml}
|
|
972
907
|
</div>
|
|
973
908
|
${dismissHtml}
|
|
@@ -976,27 +911,27 @@ function alert(message, options = {}) {
|
|
|
976
911
|
}
|
|
977
912
|
|
|
978
913
|
// libs/ui/src/components/alert.schema.ts
|
|
979
|
-
var
|
|
980
|
-
var AlertVariantSchema =
|
|
981
|
-
var AlertOptionsSchema =
|
|
914
|
+
var import_zod3 = require("zod");
|
|
915
|
+
var AlertVariantSchema = import_zod3.z.enum(["info", "success", "warning", "danger", "neutral"]);
|
|
916
|
+
var AlertOptionsSchema = import_zod3.z.object({
|
|
982
917
|
/** Alert variant */
|
|
983
918
|
variant: AlertVariantSchema.optional(),
|
|
984
919
|
/** Alert title */
|
|
985
|
-
title:
|
|
920
|
+
title: import_zod3.z.string().optional(),
|
|
986
921
|
/** Show icon */
|
|
987
|
-
showIcon:
|
|
922
|
+
showIcon: import_zod3.z.boolean().optional(),
|
|
988
923
|
/** Custom icon (HTML string, overrides default) */
|
|
989
|
-
icon:
|
|
924
|
+
icon: import_zod3.z.string().optional(),
|
|
990
925
|
/** Dismissible alert */
|
|
991
|
-
dismissible:
|
|
926
|
+
dismissible: import_zod3.z.boolean().optional(),
|
|
992
927
|
/** Additional CSS classes */
|
|
993
|
-
className:
|
|
928
|
+
className: import_zod3.z.string().optional(),
|
|
994
929
|
/** Alert ID */
|
|
995
|
-
id:
|
|
930
|
+
id: import_zod3.z.string().optional(),
|
|
996
931
|
/** Actions (HTML string for buttons) */
|
|
997
|
-
actions:
|
|
932
|
+
actions: import_zod3.z.string().optional()
|
|
998
933
|
}).strict();
|
|
999
|
-
var ToastPositionSchema =
|
|
934
|
+
var ToastPositionSchema = import_zod3.z.enum([
|
|
1000
935
|
"top-right",
|
|
1001
936
|
"top-left",
|
|
1002
937
|
"bottom-right",
|
|
@@ -1004,17 +939,17 @@ var ToastPositionSchema = import_zod4.z.enum([
|
|
|
1004
939
|
"top-center",
|
|
1005
940
|
"bottom-center"
|
|
1006
941
|
]);
|
|
1007
|
-
var ToastOptionsSchema =
|
|
942
|
+
var ToastOptionsSchema = import_zod3.z.object({
|
|
1008
943
|
/** Toast variant */
|
|
1009
944
|
variant: AlertVariantSchema.optional(),
|
|
1010
945
|
/** Toast title */
|
|
1011
|
-
title:
|
|
946
|
+
title: import_zod3.z.string().optional(),
|
|
1012
947
|
/** Duration in ms (0 = no auto-dismiss) */
|
|
1013
|
-
duration:
|
|
948
|
+
duration: import_zod3.z.number().min(0).optional(),
|
|
1014
949
|
/** Position */
|
|
1015
950
|
position: ToastPositionSchema.optional(),
|
|
1016
951
|
/** Toast ID */
|
|
1017
|
-
id:
|
|
952
|
+
id: import_zod3.z.string().optional()
|
|
1018
953
|
}).strict();
|
|
1019
954
|
|
|
1020
955
|
// libs/ui/src/web-components/elements/fmcp-alert.ts
|
|
@@ -1128,7 +1063,7 @@ function badge(text, options = {}) {
|
|
|
1128
1063
|
outline: "border border-current"
|
|
1129
1064
|
};
|
|
1130
1065
|
const dotClasses = ["inline-block rounded-full", getSizeClasses3(size, true), dotVariants[variant], className].filter(Boolean).join(" ");
|
|
1131
|
-
return `<span class="${dotClasses}" aria-label="${escapeHtml(text)}" title="${escapeHtml(text)}"></span>`;
|
|
1066
|
+
return `<span class="${dotClasses}" aria-label="${(0, import_utils2.escapeHtml)(text)}" title="${(0, import_utils2.escapeHtml)(text)}"></span>`;
|
|
1132
1067
|
}
|
|
1133
1068
|
const variantClasses = getVariantClasses4(variant);
|
|
1134
1069
|
const sizeClasses = getSizeClasses3(size, false);
|
|
@@ -1151,13 +1086,13 @@ function badge(text, options = {}) {
|
|
|
1151
1086
|
</svg>
|
|
1152
1087
|
</button>` : "";
|
|
1153
1088
|
return `<span class="${baseClasses}">
|
|
1154
|
-
${iconHtml}${escapeHtml(text)}${removeHtml}
|
|
1089
|
+
${iconHtml}${(0, import_utils2.escapeHtml)(text)}${removeHtml}
|
|
1155
1090
|
</span>`;
|
|
1156
1091
|
}
|
|
1157
1092
|
|
|
1158
1093
|
// libs/ui/src/components/badge.schema.ts
|
|
1159
|
-
var
|
|
1160
|
-
var BadgeVariantSchema =
|
|
1094
|
+
var import_zod4 = require("zod");
|
|
1095
|
+
var BadgeVariantSchema = import_zod4.z.enum([
|
|
1161
1096
|
"default",
|
|
1162
1097
|
"primary",
|
|
1163
1098
|
"secondary",
|
|
@@ -1167,28 +1102,28 @@ var BadgeVariantSchema = import_zod5.z.enum([
|
|
|
1167
1102
|
"info",
|
|
1168
1103
|
"outline"
|
|
1169
1104
|
]);
|
|
1170
|
-
var BadgeSizeSchema =
|
|
1171
|
-
var BadgeOptionsSchema =
|
|
1105
|
+
var BadgeSizeSchema = import_zod4.z.enum(["sm", "md", "lg"]);
|
|
1106
|
+
var BadgeOptionsSchema = import_zod4.z.object({
|
|
1172
1107
|
/** Badge variant */
|
|
1173
1108
|
variant: BadgeVariantSchema.optional(),
|
|
1174
1109
|
/** Badge size */
|
|
1175
1110
|
size: BadgeSizeSchema.optional(),
|
|
1176
1111
|
/** Rounded pill style */
|
|
1177
|
-
pill:
|
|
1112
|
+
pill: import_zod4.z.boolean().optional(),
|
|
1178
1113
|
/** Icon before text (HTML string) */
|
|
1179
|
-
icon:
|
|
1114
|
+
icon: import_zod4.z.string().optional(),
|
|
1180
1115
|
/** Dot indicator (no text) */
|
|
1181
|
-
dot:
|
|
1116
|
+
dot: import_zod4.z.boolean().optional(),
|
|
1182
1117
|
/** Additional CSS classes */
|
|
1183
|
-
className:
|
|
1118
|
+
className: import_zod4.z.string().optional(),
|
|
1184
1119
|
/** Removable badge */
|
|
1185
|
-
removable:
|
|
1120
|
+
removable: import_zod4.z.boolean().optional()
|
|
1186
1121
|
}).strict();
|
|
1187
|
-
var BadgeGroupOptionsSchema =
|
|
1122
|
+
var BadgeGroupOptionsSchema = import_zod4.z.object({
|
|
1188
1123
|
/** Gap between badges */
|
|
1189
|
-
gap:
|
|
1124
|
+
gap: import_zod4.z.enum(["sm", "md", "lg"]).optional(),
|
|
1190
1125
|
/** Additional CSS classes */
|
|
1191
|
-
className:
|
|
1126
|
+
className: import_zod4.z.string().optional()
|
|
1192
1127
|
}).strict();
|
|
1193
1128
|
|
|
1194
1129
|
// libs/ui/src/web-components/elements/fmcp-badge.ts
|
|
@@ -1277,7 +1212,7 @@ function getInputStateClasses(state) {
|
|
|
1277
1212
|
}
|
|
1278
1213
|
function buildDataAttrs2(data) {
|
|
1279
1214
|
if (!data) return "";
|
|
1280
|
-
return Object.entries(data).map(([key, value]) => `data-${key}="${escapeHtml(value)}"`).join(" ");
|
|
1215
|
+
return Object.entries(data).map(([key, value]) => `data-${key}="${(0, import_utils2.escapeHtml)(value)}"`).join(" ");
|
|
1281
1216
|
}
|
|
1282
1217
|
function input(options) {
|
|
1283
1218
|
const {
|
|
@@ -1320,26 +1255,26 @@ function input(options) {
|
|
|
1320
1255
|
const dataAttrs = buildDataAttrs2(data);
|
|
1321
1256
|
const inputAttrs = [
|
|
1322
1257
|
`type="${type}"`,
|
|
1323
|
-
`name="${escapeHtml(name)}"`,
|
|
1324
|
-
`id="${escapeHtml(id)}"`,
|
|
1325
|
-
value ? `value="${escapeHtml(value)}"` : "",
|
|
1326
|
-
placeholder ? `placeholder="${escapeHtml(placeholder)}"` : "",
|
|
1258
|
+
`name="${(0, import_utils2.escapeHtml)(name)}"`,
|
|
1259
|
+
`id="${(0, import_utils2.escapeHtml)(id)}"`,
|
|
1260
|
+
value ? `value="${(0, import_utils2.escapeHtml)(value)}"` : "",
|
|
1261
|
+
placeholder ? `placeholder="${(0, import_utils2.escapeHtml)(placeholder)}"` : "",
|
|
1327
1262
|
required ? "required" : "",
|
|
1328
1263
|
disabled ? "disabled" : "",
|
|
1329
1264
|
readonly ? "readonly" : "",
|
|
1330
|
-
autocomplete ? `autocomplete="${escapeHtml(autocomplete)}"` : "",
|
|
1331
|
-
pattern ? `pattern="${escapeHtml(pattern)}"` : "",
|
|
1332
|
-
min !== void 0 ? `min="${escapeHtml(String(min))}"` : "",
|
|
1333
|
-
max !== void 0 ? `max="${escapeHtml(String(max))}"` : "",
|
|
1334
|
-
step !== void 0 ? `step="${escapeHtml(String(step))}"` : "",
|
|
1265
|
+
autocomplete ? `autocomplete="${(0, import_utils2.escapeHtml)(autocomplete)}"` : "",
|
|
1266
|
+
pattern ? `pattern="${(0, import_utils2.escapeHtml)(pattern)}"` : "",
|
|
1267
|
+
min !== void 0 ? `min="${(0, import_utils2.escapeHtml)(String(min))}"` : "",
|
|
1268
|
+
max !== void 0 ? `max="${(0, import_utils2.escapeHtml)(String(max))}"` : "",
|
|
1269
|
+
step !== void 0 ? `step="${(0, import_utils2.escapeHtml)(String(step))}"` : "",
|
|
1335
1270
|
`class="${baseClasses}"`,
|
|
1336
1271
|
dataAttrs
|
|
1337
1272
|
].filter(Boolean).join(" ");
|
|
1338
|
-
const labelHtml = label ? `<label for="${escapeHtml(id)}" class="block text-sm font-medium text-text-primary mb-1.5">
|
|
1339
|
-
${escapeHtml(label)}${required ? '<span class="text-danger ml-1">*</span>' : ""}
|
|
1273
|
+
const labelHtml = label ? `<label for="${(0, import_utils2.escapeHtml)(id)}" class="block text-sm font-medium text-text-primary mb-1.5">
|
|
1274
|
+
${(0, import_utils2.escapeHtml)(label)}${required ? '<span class="text-danger ml-1">*</span>' : ""}
|
|
1340
1275
|
</label>` : "";
|
|
1341
|
-
const helperHtml = helper && !error ? `<p class="mt-1.5 text-sm text-text-secondary">${escapeHtml(helper)}</p>` : "";
|
|
1342
|
-
const errorHtml = error ? `<p class="mt-1.5 text-sm text-danger">${escapeHtml(error)}</p>` : "";
|
|
1276
|
+
const helperHtml = helper && !error ? `<p class="mt-1.5 text-sm text-text-secondary">${(0, import_utils2.escapeHtml)(helper)}</p>` : "";
|
|
1277
|
+
const errorHtml = error ? `<p class="mt-1.5 text-sm text-danger">${(0, import_utils2.escapeHtml)(error)}</p>` : "";
|
|
1343
1278
|
const iconBeforeHtml = iconBefore ? `<span class="absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary">${iconBefore}</span>` : "";
|
|
1344
1279
|
const iconAfterHtml = iconAfter ? `<span class="absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary">${iconAfter}</span>` : "";
|
|
1345
1280
|
const inputHtml = hasIcon ? `<div class="relative">
|
|
@@ -1386,18 +1321,18 @@ function select(options) {
|
|
|
1386
1321
|
const optionsHtml = selectOptions.map((opt) => {
|
|
1387
1322
|
const selected = opt.selected || opt.value === value ? "selected" : "";
|
|
1388
1323
|
const optDisabled = opt.disabled ? "disabled" : "";
|
|
1389
|
-
return `<option value="${escapeHtml(opt.value)}" ${selected} ${optDisabled}>${escapeHtml(opt.label)}</option>`;
|
|
1324
|
+
return `<option value="${(0, import_utils2.escapeHtml)(opt.value)}" ${selected} ${optDisabled}>${(0, import_utils2.escapeHtml)(opt.label)}</option>`;
|
|
1390
1325
|
}).join("\n");
|
|
1391
|
-
const labelHtml = label ? `<label for="${escapeHtml(id)}" class="block text-sm font-medium text-text-primary mb-1.5">
|
|
1392
|
-
${escapeHtml(label)}${required ? '<span class="text-danger ml-1">*</span>' : ""}
|
|
1326
|
+
const labelHtml = label ? `<label for="${(0, import_utils2.escapeHtml)(id)}" class="block text-sm font-medium text-text-primary mb-1.5">
|
|
1327
|
+
${(0, import_utils2.escapeHtml)(label)}${required ? '<span class="text-danger ml-1">*</span>' : ""}
|
|
1393
1328
|
</label>` : "";
|
|
1394
|
-
const helperHtml = helper && !error ? `<p class="mt-1.5 text-sm text-text-secondary">${escapeHtml(helper)}</p>` : "";
|
|
1395
|
-
const errorHtml = error ? `<p class="mt-1.5 text-sm text-danger">${escapeHtml(error)}</p>` : "";
|
|
1329
|
+
const helperHtml = helper && !error ? `<p class="mt-1.5 text-sm text-text-secondary">${(0, import_utils2.escapeHtml)(helper)}</p>` : "";
|
|
1330
|
+
const errorHtml = error ? `<p class="mt-1.5 text-sm text-danger">${(0, import_utils2.escapeHtml)(error)}</p>` : "";
|
|
1396
1331
|
return `<div class="form-field">
|
|
1397
1332
|
${labelHtml}
|
|
1398
1333
|
<select
|
|
1399
|
-
name="${escapeHtml(name)}"
|
|
1400
|
-
id="${escapeHtml(id)}"
|
|
1334
|
+
name="${(0, import_utils2.escapeHtml)(name)}"
|
|
1335
|
+
id="${(0, import_utils2.escapeHtml)(id)}"
|
|
1401
1336
|
class="${baseClasses}"
|
|
1402
1337
|
${required ? "required" : ""}
|
|
1403
1338
|
${disabled ? "disabled" : ""}
|
|
@@ -1412,8 +1347,8 @@ function select(options) {
|
|
|
1412
1347
|
}
|
|
1413
1348
|
|
|
1414
1349
|
// libs/ui/src/components/form.schema.ts
|
|
1415
|
-
var
|
|
1416
|
-
var InputTypeSchema =
|
|
1350
|
+
var import_zod5 = require("zod");
|
|
1351
|
+
var InputTypeSchema = import_zod5.z.enum([
|
|
1417
1352
|
"text",
|
|
1418
1353
|
"email",
|
|
1419
1354
|
"password",
|
|
@@ -1426,221 +1361,221 @@ var InputTypeSchema = import_zod6.z.enum([
|
|
|
1426
1361
|
"datetime-local",
|
|
1427
1362
|
"hidden"
|
|
1428
1363
|
]);
|
|
1429
|
-
var InputSizeSchema =
|
|
1430
|
-
var InputStateSchema =
|
|
1431
|
-
var InputOptionsSchema =
|
|
1364
|
+
var InputSizeSchema = import_zod5.z.enum(["sm", "md", "lg"]);
|
|
1365
|
+
var InputStateSchema = import_zod5.z.enum(["default", "error", "success", "warning"]);
|
|
1366
|
+
var InputOptionsSchema = import_zod5.z.object({
|
|
1432
1367
|
/** Input type */
|
|
1433
1368
|
type: InputTypeSchema.optional(),
|
|
1434
1369
|
/** Input name (required) */
|
|
1435
|
-
name:
|
|
1370
|
+
name: import_zod5.z.string(),
|
|
1436
1371
|
/** Input ID (defaults to name) */
|
|
1437
|
-
id:
|
|
1372
|
+
id: import_zod5.z.string().optional(),
|
|
1438
1373
|
/** Input value */
|
|
1439
|
-
value:
|
|
1374
|
+
value: import_zod5.z.string().optional(),
|
|
1440
1375
|
/** Placeholder text */
|
|
1441
|
-
placeholder:
|
|
1376
|
+
placeholder: import_zod5.z.string().optional(),
|
|
1442
1377
|
/** Label text */
|
|
1443
|
-
label:
|
|
1378
|
+
label: import_zod5.z.string().optional(),
|
|
1444
1379
|
/** Helper text */
|
|
1445
|
-
helper:
|
|
1380
|
+
helper: import_zod5.z.string().optional(),
|
|
1446
1381
|
/** Error message */
|
|
1447
|
-
error:
|
|
1382
|
+
error: import_zod5.z.string().optional(),
|
|
1448
1383
|
/** Input size */
|
|
1449
1384
|
size: InputSizeSchema.optional(),
|
|
1450
1385
|
/** Input state */
|
|
1451
1386
|
state: InputStateSchema.optional(),
|
|
1452
1387
|
/** Required field */
|
|
1453
|
-
required:
|
|
1388
|
+
required: import_zod5.z.boolean().optional(),
|
|
1454
1389
|
/** Disabled state */
|
|
1455
|
-
disabled:
|
|
1390
|
+
disabled: import_zod5.z.boolean().optional(),
|
|
1456
1391
|
/** Readonly state */
|
|
1457
|
-
readonly:
|
|
1392
|
+
readonly: import_zod5.z.boolean().optional(),
|
|
1458
1393
|
/** Autocomplete attribute */
|
|
1459
|
-
autocomplete:
|
|
1394
|
+
autocomplete: import_zod5.z.string().optional(),
|
|
1460
1395
|
/** Pattern for validation */
|
|
1461
|
-
pattern:
|
|
1396
|
+
pattern: import_zod5.z.string().optional(),
|
|
1462
1397
|
/** Min value (for number/date) */
|
|
1463
|
-
min:
|
|
1398
|
+
min: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).optional(),
|
|
1464
1399
|
/** Max value (for number/date) */
|
|
1465
|
-
max:
|
|
1400
|
+
max: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).optional(),
|
|
1466
1401
|
/** Step value (for number) */
|
|
1467
|
-
step:
|
|
1402
|
+
step: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).optional(),
|
|
1468
1403
|
/** Additional CSS classes */
|
|
1469
|
-
className:
|
|
1404
|
+
className: import_zod5.z.string().optional(),
|
|
1470
1405
|
/** Data attributes */
|
|
1471
|
-
data:
|
|
1406
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.string()).optional(),
|
|
1472
1407
|
/** Icon before input (HTML string) */
|
|
1473
|
-
iconBefore:
|
|
1408
|
+
iconBefore: import_zod5.z.string().optional(),
|
|
1474
1409
|
/** Icon after input (HTML string) */
|
|
1475
|
-
iconAfter:
|
|
1410
|
+
iconAfter: import_zod5.z.string().optional()
|
|
1476
1411
|
}).strict();
|
|
1477
|
-
var SelectOptionItemSchema =
|
|
1478
|
-
value:
|
|
1479
|
-
label:
|
|
1480
|
-
disabled:
|
|
1481
|
-
selected:
|
|
1412
|
+
var SelectOptionItemSchema = import_zod5.z.object({
|
|
1413
|
+
value: import_zod5.z.string(),
|
|
1414
|
+
label: import_zod5.z.string(),
|
|
1415
|
+
disabled: import_zod5.z.boolean().optional(),
|
|
1416
|
+
selected: import_zod5.z.boolean().optional()
|
|
1482
1417
|
}).strict();
|
|
1483
|
-
var SelectOptionsSchema =
|
|
1418
|
+
var SelectOptionsSchema = import_zod5.z.object({
|
|
1484
1419
|
/** Input name (required) */
|
|
1485
|
-
name:
|
|
1420
|
+
name: import_zod5.z.string(),
|
|
1486
1421
|
/** Input ID (defaults to name) */
|
|
1487
|
-
id:
|
|
1422
|
+
id: import_zod5.z.string().optional(),
|
|
1488
1423
|
/** Input value */
|
|
1489
|
-
value:
|
|
1424
|
+
value: import_zod5.z.string().optional(),
|
|
1490
1425
|
/** Placeholder text */
|
|
1491
|
-
placeholder:
|
|
1426
|
+
placeholder: import_zod5.z.string().optional(),
|
|
1492
1427
|
/** Label text */
|
|
1493
|
-
label:
|
|
1428
|
+
label: import_zod5.z.string().optional(),
|
|
1494
1429
|
/** Helper text */
|
|
1495
|
-
helper:
|
|
1430
|
+
helper: import_zod5.z.string().optional(),
|
|
1496
1431
|
/** Error message */
|
|
1497
|
-
error:
|
|
1432
|
+
error: import_zod5.z.string().optional(),
|
|
1498
1433
|
/** Input size */
|
|
1499
1434
|
size: InputSizeSchema.optional(),
|
|
1500
1435
|
/** Input state */
|
|
1501
1436
|
state: InputStateSchema.optional(),
|
|
1502
1437
|
/** Required field */
|
|
1503
|
-
required:
|
|
1438
|
+
required: import_zod5.z.boolean().optional(),
|
|
1504
1439
|
/** Disabled state */
|
|
1505
|
-
disabled:
|
|
1440
|
+
disabled: import_zod5.z.boolean().optional(),
|
|
1506
1441
|
/** Readonly state */
|
|
1507
|
-
readonly:
|
|
1442
|
+
readonly: import_zod5.z.boolean().optional(),
|
|
1508
1443
|
/** Additional CSS classes */
|
|
1509
|
-
className:
|
|
1444
|
+
className: import_zod5.z.string().optional(),
|
|
1510
1445
|
/** Data attributes */
|
|
1511
|
-
data:
|
|
1446
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.string()).optional(),
|
|
1512
1447
|
/** Icon before input (HTML string) */
|
|
1513
|
-
iconBefore:
|
|
1448
|
+
iconBefore: import_zod5.z.string().optional(),
|
|
1514
1449
|
/** Icon after input (HTML string) */
|
|
1515
|
-
iconAfter:
|
|
1450
|
+
iconAfter: import_zod5.z.string().optional(),
|
|
1516
1451
|
/** Select options (required) */
|
|
1517
|
-
options:
|
|
1452
|
+
options: import_zod5.z.array(SelectOptionItemSchema),
|
|
1518
1453
|
/** Multiple selection */
|
|
1519
|
-
multiple:
|
|
1454
|
+
multiple: import_zod5.z.boolean().optional()
|
|
1520
1455
|
}).strict();
|
|
1521
|
-
var TextareaResizeSchema =
|
|
1522
|
-
var TextareaOptionsSchema =
|
|
1456
|
+
var TextareaResizeSchema = import_zod5.z.enum(["none", "vertical", "horizontal", "both"]);
|
|
1457
|
+
var TextareaOptionsSchema = import_zod5.z.object({
|
|
1523
1458
|
/** Input name (required) */
|
|
1524
|
-
name:
|
|
1459
|
+
name: import_zod5.z.string(),
|
|
1525
1460
|
/** Input ID (defaults to name) */
|
|
1526
|
-
id:
|
|
1461
|
+
id: import_zod5.z.string().optional(),
|
|
1527
1462
|
/** Input value */
|
|
1528
|
-
value:
|
|
1463
|
+
value: import_zod5.z.string().optional(),
|
|
1529
1464
|
/** Placeholder text */
|
|
1530
|
-
placeholder:
|
|
1465
|
+
placeholder: import_zod5.z.string().optional(),
|
|
1531
1466
|
/** Label text */
|
|
1532
|
-
label:
|
|
1467
|
+
label: import_zod5.z.string().optional(),
|
|
1533
1468
|
/** Helper text */
|
|
1534
|
-
helper:
|
|
1469
|
+
helper: import_zod5.z.string().optional(),
|
|
1535
1470
|
/** Error message */
|
|
1536
|
-
error:
|
|
1471
|
+
error: import_zod5.z.string().optional(),
|
|
1537
1472
|
/** Input size */
|
|
1538
1473
|
size: InputSizeSchema.optional(),
|
|
1539
1474
|
/** Input state */
|
|
1540
1475
|
state: InputStateSchema.optional(),
|
|
1541
1476
|
/** Required field */
|
|
1542
|
-
required:
|
|
1477
|
+
required: import_zod5.z.boolean().optional(),
|
|
1543
1478
|
/** Disabled state */
|
|
1544
|
-
disabled:
|
|
1479
|
+
disabled: import_zod5.z.boolean().optional(),
|
|
1545
1480
|
/** Readonly state */
|
|
1546
|
-
readonly:
|
|
1481
|
+
readonly: import_zod5.z.boolean().optional(),
|
|
1547
1482
|
/** Autocomplete attribute */
|
|
1548
|
-
autocomplete:
|
|
1483
|
+
autocomplete: import_zod5.z.string().optional(),
|
|
1549
1484
|
/** Additional CSS classes */
|
|
1550
|
-
className:
|
|
1485
|
+
className: import_zod5.z.string().optional(),
|
|
1551
1486
|
/** Data attributes */
|
|
1552
|
-
data:
|
|
1487
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.string()).optional(),
|
|
1553
1488
|
/** Icon before input (HTML string) */
|
|
1554
|
-
iconBefore:
|
|
1489
|
+
iconBefore: import_zod5.z.string().optional(),
|
|
1555
1490
|
/** Icon after input (HTML string) */
|
|
1556
|
-
iconAfter:
|
|
1491
|
+
iconAfter: import_zod5.z.string().optional(),
|
|
1557
1492
|
/** Number of rows */
|
|
1558
|
-
rows:
|
|
1493
|
+
rows: import_zod5.z.number().min(1).optional(),
|
|
1559
1494
|
/** Resize behavior */
|
|
1560
1495
|
resize: TextareaResizeSchema.optional()
|
|
1561
1496
|
}).strict();
|
|
1562
|
-
var CheckboxOptionsSchema =
|
|
1497
|
+
var CheckboxOptionsSchema = import_zod5.z.object({
|
|
1563
1498
|
/** Input name (required) */
|
|
1564
|
-
name:
|
|
1499
|
+
name: import_zod5.z.string(),
|
|
1565
1500
|
/** Input ID */
|
|
1566
|
-
id:
|
|
1501
|
+
id: import_zod5.z.string().optional(),
|
|
1567
1502
|
/** Input value */
|
|
1568
|
-
value:
|
|
1503
|
+
value: import_zod5.z.string().optional(),
|
|
1569
1504
|
/** Label text (required) */
|
|
1570
|
-
label:
|
|
1505
|
+
label: import_zod5.z.string(),
|
|
1571
1506
|
/** Checked state */
|
|
1572
|
-
checked:
|
|
1507
|
+
checked: import_zod5.z.boolean().optional(),
|
|
1573
1508
|
/** Disabled state */
|
|
1574
|
-
disabled:
|
|
1509
|
+
disabled: import_zod5.z.boolean().optional(),
|
|
1575
1510
|
/** Helper text */
|
|
1576
|
-
helper:
|
|
1511
|
+
helper: import_zod5.z.string().optional(),
|
|
1577
1512
|
/** Error message */
|
|
1578
|
-
error:
|
|
1513
|
+
error: import_zod5.z.string().optional(),
|
|
1579
1514
|
/** Additional CSS classes */
|
|
1580
|
-
className:
|
|
1515
|
+
className: import_zod5.z.string().optional()
|
|
1581
1516
|
}).strict();
|
|
1582
|
-
var RadioOptionItemSchema =
|
|
1583
|
-
value:
|
|
1584
|
-
label:
|
|
1585
|
-
disabled:
|
|
1517
|
+
var RadioOptionItemSchema = import_zod5.z.object({
|
|
1518
|
+
value: import_zod5.z.string(),
|
|
1519
|
+
label: import_zod5.z.string(),
|
|
1520
|
+
disabled: import_zod5.z.boolean().optional()
|
|
1586
1521
|
}).strict();
|
|
1587
|
-
var RadioGroupOptionsSchema =
|
|
1522
|
+
var RadioGroupOptionsSchema = import_zod5.z.object({
|
|
1588
1523
|
/** Group name (required) */
|
|
1589
|
-
name:
|
|
1524
|
+
name: import_zod5.z.string(),
|
|
1590
1525
|
/** Radio options (required) */
|
|
1591
|
-
options:
|
|
1526
|
+
options: import_zod5.z.array(RadioOptionItemSchema),
|
|
1592
1527
|
/** Selected value */
|
|
1593
|
-
value:
|
|
1528
|
+
value: import_zod5.z.string().optional(),
|
|
1594
1529
|
/** Label for the group */
|
|
1595
|
-
label:
|
|
1530
|
+
label: import_zod5.z.string().optional(),
|
|
1596
1531
|
/** Helper text */
|
|
1597
|
-
helper:
|
|
1532
|
+
helper: import_zod5.z.string().optional(),
|
|
1598
1533
|
/** Error message */
|
|
1599
|
-
error:
|
|
1534
|
+
error: import_zod5.z.string().optional(),
|
|
1600
1535
|
/** Layout direction */
|
|
1601
|
-
direction:
|
|
1536
|
+
direction: import_zod5.z.enum(["horizontal", "vertical"]).optional(),
|
|
1602
1537
|
/** Additional CSS classes */
|
|
1603
|
-
className:
|
|
1538
|
+
className: import_zod5.z.string().optional()
|
|
1604
1539
|
}).strict();
|
|
1605
|
-
var FormMethodSchema =
|
|
1606
|
-
var FormEnctypeSchema =
|
|
1607
|
-
var FormOptionsSchema =
|
|
1540
|
+
var FormMethodSchema = import_zod5.z.enum(["get", "post", "dialog"]);
|
|
1541
|
+
var FormEnctypeSchema = import_zod5.z.enum(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
1542
|
+
var FormOptionsSchema = import_zod5.z.object({
|
|
1608
1543
|
/** Form action URL */
|
|
1609
|
-
action:
|
|
1544
|
+
action: import_zod5.z.string().optional(),
|
|
1610
1545
|
/** Form method */
|
|
1611
1546
|
method: FormMethodSchema.optional(),
|
|
1612
1547
|
/** Form ID */
|
|
1613
|
-
id:
|
|
1548
|
+
id: import_zod5.z.string().optional(),
|
|
1614
1549
|
/** Form enctype */
|
|
1615
1550
|
enctype: FormEnctypeSchema.optional(),
|
|
1616
1551
|
/** Disable browser validation */
|
|
1617
|
-
novalidate:
|
|
1552
|
+
novalidate: import_zod5.z.boolean().optional(),
|
|
1618
1553
|
/** Autocomplete behavior */
|
|
1619
|
-
autocomplete:
|
|
1554
|
+
autocomplete: import_zod5.z.enum(["on", "off"]).optional(),
|
|
1620
1555
|
/** Additional CSS classes */
|
|
1621
|
-
className:
|
|
1556
|
+
className: import_zod5.z.string().optional()
|
|
1622
1557
|
}).strict();
|
|
1623
|
-
var FormRowOptionsSchema =
|
|
1558
|
+
var FormRowOptionsSchema = import_zod5.z.object({
|
|
1624
1559
|
/** Number of columns */
|
|
1625
|
-
cols:
|
|
1560
|
+
cols: import_zod5.z.number().min(1).max(12).optional(),
|
|
1626
1561
|
/** Gap between columns */
|
|
1627
|
-
gap:
|
|
1562
|
+
gap: import_zod5.z.enum(["sm", "md", "lg"]).optional(),
|
|
1628
1563
|
/** Additional CSS classes */
|
|
1629
|
-
className:
|
|
1564
|
+
className: import_zod5.z.string().optional()
|
|
1630
1565
|
}).strict();
|
|
1631
|
-
var FormSectionOptionsSchema =
|
|
1566
|
+
var FormSectionOptionsSchema = import_zod5.z.object({
|
|
1632
1567
|
/** Section title */
|
|
1633
|
-
title:
|
|
1568
|
+
title: import_zod5.z.string().optional(),
|
|
1634
1569
|
/** Section description */
|
|
1635
|
-
description:
|
|
1570
|
+
description: import_zod5.z.string().optional(),
|
|
1636
1571
|
/** Additional CSS classes */
|
|
1637
|
-
className:
|
|
1572
|
+
className: import_zod5.z.string().optional()
|
|
1638
1573
|
}).strict();
|
|
1639
|
-
var FormActionsOptionsSchema =
|
|
1574
|
+
var FormActionsOptionsSchema = import_zod5.z.object({
|
|
1640
1575
|
/** Alignment */
|
|
1641
|
-
align:
|
|
1576
|
+
align: import_zod5.z.enum(["left", "center", "right", "between"]).optional(),
|
|
1642
1577
|
/** Additional CSS classes */
|
|
1643
|
-
className:
|
|
1578
|
+
className: import_zod5.z.string().optional()
|
|
1644
1579
|
}).strict();
|
|
1645
1580
|
|
|
1646
1581
|
// libs/ui/src/web-components/elements/fmcp-input.ts
|