@1money/component-ui 0.0.45 → 0.0.46
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/es/components/Tooltip/Tooltip.js +24 -19
- package/es/components/Tooltip/interface.d.ts +2 -0
- package/es/index.css +1 -1
- package/lib/components/Tooltip/Tooltip.js +24 -19
- package/lib/components/Tooltip/interface.d.ts +2 -0
- package/lib/index.css +1 -1
- package/package.json +1 -1
- package/scripts/mcp-server/examples.generated.json +6 -0
- package/scripts/mcp-server/index.generated.json +12 -0
package/package.json
CHANGED
|
@@ -865,6 +865,12 @@
|
|
|
865
865
|
"source": "stories",
|
|
866
866
|
"compilable": true
|
|
867
867
|
},
|
|
868
|
+
"5d0dff10d14f4ead2855259dace828f08c55f468c98f3d4852244078bbe6d87c": {
|
|
869
|
+
"title": "With Portal Container",
|
|
870
|
+
"code": "{\n const clippedParentStyle: CSSProperties = {\n display: 'flex',\n gap: 24,\n padding: 24,\n width: 320,\n height: 120,\n overflow: 'hidden',\n border: '1px dashed #d7dee7',\n borderRadius: 8,\n background: '#f8fafc',\n };\n const customContainerStyle: CSSProperties = {\n position: 'relative',\n padding: 24,\n width: 320,\n minHeight: 120,\n border: '1px dashed #4f8cff',\n borderRadius: 8,\n background: '#eef4ff',\n };\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column', gap: 32, padding: 80 }}>\n <div>\n <p style={PREVIEW_LABEL_STYLE}>\n Default — portaled to <code>document.body</code>, escapes ancestor <code>overflow: hidden</code>\n </p>\n <div style={clippedParentStyle}>\n <button id=\"tooltip-portal-default\">Hover me</button>\n <Tooltip\n anchorSelect=\"#tooltip-portal-default\"\n placement=\"bottom\"\n title=\"Portaled to body\"\n body=\"By default the tooltip is rendered in document.body, so the parent overflow can't clip it.\"\n />\n </div>\n </div>\n\n <div>\n <p style={PREVIEW_LABEL_STYLE}>\n Custom container — <code>getPopupContainer</code> returns the blue box\n </p>\n <div id=\"tooltip-portal-custom-container\" style={customContainerStyle}>\n <button id=\"tooltip-portal-custom\">Hover me</button>\n <Tooltip\n anchorSelect=\"#tooltip-portal-custom\"\n placement=\"bottom\"\n title=\"Custom container\"\n body=\"The tooltip DOM is mounted inside the blue box via getPopupContainer.\"\n getPopupContainer={() =>\n document.getElementById('tooltip-portal-custom-container') as HTMLElement\n }\n />\n </div>\n </div>\n </div>\n );\n }",
|
|
871
|
+
"source": "stories",
|
|
872
|
+
"compilable": true
|
|
873
|
+
},
|
|
868
874
|
"5dc10afdccbf1759489ec0ca6e8837d8edd2fdacf6965a82e879ea4b1fe9cfbc": {
|
|
869
875
|
"title": "All Variants",
|
|
870
876
|
"code": "<div style={{ display: 'flex', flexDirection: 'column', gap: 32 }}>\n <div>\n <h3 style={{ marginBottom: 12 }}>Default (3 items)</h3>\n <Segment items={DEFAULT_ITEMS} />\n </div>\n <div>\n <h3 style={{ marginBottom: 12 }}>5 items</h3>\n <Segment\n items={[\n { value: '1', label: 'Label' },\n { value: '2', label: 'Label' },\n { value: '3', label: 'Label' },\n { value: '4', label: 'Label' },\n { value: '5', label: 'Label' },\n ]}\n />\n </div>\n <div>\n <h3 style={{ marginBottom: 12 }}>With disabled item</h3>\n <Segment\n items={[\n { value: '1', label: 'Active' },\n { value: '2', label: 'Normal' },\n { value: '3', label: 'Disabled', disabled: true },\n ]}\n />\n </div>\n </div>",
|
|
@@ -14177,6 +14177,14 @@
|
|
|
14177
14177
|
"default": null,
|
|
14178
14178
|
"description": "Callback when the tooltip open state changes",
|
|
14179
14179
|
"inheritedFrom": null
|
|
14180
|
+
},
|
|
14181
|
+
{
|
|
14182
|
+
"name": "getPopupContainer",
|
|
14183
|
+
"type": "() => HTMLElement",
|
|
14184
|
+
"optional": true,
|
|
14185
|
+
"default": null,
|
|
14186
|
+
"description": "Return the DOM node the tooltip is portaled into.",
|
|
14187
|
+
"inheritedFrom": null
|
|
14180
14188
|
}
|
|
14181
14189
|
],
|
|
14182
14190
|
"extends": [
|
|
@@ -14236,6 +14244,10 @@
|
|
|
14236
14244
|
"hash": "89acd530e5d3ac4d2f2cdc50085c98fc8d6ee5a3f488a16486455a35460bb354",
|
|
14237
14245
|
"source": "stories"
|
|
14238
14246
|
},
|
|
14247
|
+
{
|
|
14248
|
+
"hash": "5d0dff10d14f4ead2855259dace828f08c55f468c98f3d4852244078bbe6d87c",
|
|
14249
|
+
"source": "stories"
|
|
14250
|
+
},
|
|
14239
14251
|
{
|
|
14240
14252
|
"hash": "7b215bce46f64784de7156995e907e66d62ce4f4a9b7cb0950fa2f8f78463ad3",
|
|
14241
14253
|
"source": "stories"
|