@stealthscale/component-disclosure 0.2.2 → 0.2.4
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/cyclonedx/bom.json +1 -1
- package/dist/index.js +1 -5423
- package/dist/pages/accordion/accordion.js +512 -0
- package/dist/pages/accordion/accordion.props.js +3 -0
- package/dist/pages/collapsible/collapsible.js +173 -0
- package/dist/pages/collapsible/collapsible.props.js +3 -0
- package/dist/pages/details/details.js +281 -0
- package/dist/pages/details/details.props.js +3 -0
- package/dist/pages/hover-card/hover-card.js +552 -0
- package/dist/pages/hover-card/hover-card.props.js +3 -0
- package/dist/pages/menu/menu.js +1103 -0
- package/dist/pages/menu/menu.props.js +3 -0
- package/dist/pages/menubar/menubar.js +1181 -0
- package/dist/pages/menubar/menubar.props.js +3 -0
- package/dist/pages/pages.json +138 -0
- package/dist/pages/popover/popover.js +161 -0
- package/dist/pages/popover/popover.props.js +3 -0
- package/dist/pages/steps/steps.js +660 -0
- package/dist/pages/steps/steps.props.js +3 -0
- package/dist/pages/tabs/tabs.js +815 -0
- package/dist/pages/tabs/tabs.props.js +3 -0
- package/dist/pages/toggle-tip/toggle-tip.js +344 -0
- package/dist/pages/toggle-tip/toggle-tip.props.js +3 -0
- package/dist/pages/tooltip/tooltip.js +112 -0
- package/dist/pages/tooltip/tooltip.props.js +3 -0
- package/dist/pages/truncate/truncate.js +235 -0
- package/dist/pages/truncate/truncate.props.js +3 -0
- package/dist/shared-Cfsikh3X.js +5424 -0
- package/dist/theme.js +23 -14
- package/locales/en/specimen/accordion.json +130 -0
- package/locales/en/specimen/collapsible.json +27 -0
- package/locales/en/specimen/details.json +48 -0
- package/locales/en/specimen/hover-card.json +58 -0
- package/locales/en/specimen/menu.json +81 -0
- package/locales/en/specimen/menubar.json +108 -0
- package/locales/en/specimen/popover.json +16 -0
- package/locales/en/specimen/steps.json +86 -0
- package/locales/en/specimen/tabs.json +108 -0
- package/locales/en/specimen/toggle-tip.json +47 -0
- package/locales/en/specimen/tooltip.json +14 -0
- package/locales/en/specimen/truncate.json +31 -0
- package/package.json +10 -9
- /package/dist/{recipe-95yCB2V3.js → recipes-95yCB2V3.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"CloseTriggerProps": {"conditions": 284, "foreign": 1041}, "ContentProps": {"conditions": 284, "foreign": 1041}, "IndicatorProps": {"conditions": 284, "foreign": 1041}, "ListProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1037}, "TriggerProps": {"conditions": 284, "foreign": 1049}};
|
|
2
|
+
export const parts = {"CloseTriggerProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "label", "refers": [], "required": false, "says": "Title a pointer shows over the control. Defaults to \"Close\"."}], "ContentProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Value of the tab that shows the panel."}], "IndicatorProps": [], "ListProps": [], "RootProps": [{"accepts": "\"automatic\" | \"manual\"", "fallback": "\"automatic\"", "kind": "option", "name": "activationMode", "refers": [], "required": false, "says": "The activation mode of the tabs. Can be `manual` or `automatic` - `manual`: Tabs are activated when clicked or press `enter` key. - `automatic`: Tabs are activated when receiving focus"}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "composite", "refers": [], "required": false, "says": "Whether the tab is composite"}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "defaultValue", "refers": [], "required": false, "says": "The initial selected tab value when rendered. Use when you don't need to control the selected tab value."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "deselectable", "refers": [], "required": false, "says": "Whether the active tab can be deselected when clicking on it."}, {"accepts": "\"ltr\" | \"rtl\"", "fallback": "\"ltr\"", "kind": "option", "name": "dir", "refers": [], "required": false, "says": "The document's text/writing direction."}, {"accepts": "boolean", "fallback": "", "kind": "variant", "name": "fitted", "refers": [], "required": false, "says": "Whether the tabs share the list's width equally."}, {"accepts": "(() => Document | Node | ShadowRoot)", "fallback": "", "kind": "option", "name": "getRootNode", "refers": [], "required": false, "says": "A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "id", "refers": [], "required": false, "says": "The unique identifier of the machine."}, {"accepts": "ElementIds", "fallback": "", "kind": "option", "name": "ids", "refers": ["tabs.ElementIds"], "required": false, "says": "The ids of the elements in the tabs. Useful for composition."}, {"accepts": "Justify", "fallback": "", "kind": "variant", "name": "justify", "refers": ["kit.Justify"], "required": false, "says": "Distribution of the tabs in a list wider than they are."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "loopFocus", "refers": [], "required": false, "says": "Whether the keyboard navigation will loop from last tab to first, and vice versa."}, {"accepts": "((details: NavigateDetails) => void) | null", "fallback": "", "kind": "option", "name": "navigate", "refers": ["tabs.NavigateDetails"], "required": false, "says": "Function to navigate to the selected tab when clicking on it. Useful if tab triggers are anchor elements."}, {"accepts": "((details: CloseDetails) => void)", "fallback": "", "kind": "option", "name": "onClose", "refers": ["kit.CloseDetails"], "required": false, "says": "Called with the value of a closable tab that a person closes, after the selection has moved off it. The caller removes the tab and its panel."}, {"accepts": "((details: FocusChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onFocusChange", "refers": ["tabs.FocusChangeDetails"], "required": false, "says": "Callback to be called when the focused tab changes"}, {"accepts": "((details: ValueChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onValueChange", "refers": ["tabs.ValueChangeDetails"], "required": false, "says": "Callback to be called when the selected/active tab changes"}, {"accepts": "\"horizontal\" | \"vertical\"", "fallback": "\"horizontal\"", "kind": "option", "name": "orientation", "refers": [], "required": false, "says": "The orientation of the tabs. Can be `horizontal` or `vertical` - `horizontal`: only left and right arrow key navigation will work. - `vertical`: only up and down arrow key navigation will work."}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "Palette of the line indicator, the subtle indicator and the selected tab's text, set on the root."}, {"accepts": "Scale", "fallback": "", "kind": "variant", "name": "size", "refers": ["kit.Scale"], "required": false, "says": "Size of the tabs on the control scale and the panel's padding on the inset scale."}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": false, "says": "The controlled selected tab value"}, {"accepts": "\"enclosed\" | \"line\" | \"plain\" | \"subtle\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of the list and the indicator of the selected tab."}], "TriggerProps": [{"accepts": "boolean", "fallback": "", "kind": "option", "name": "closable", "refers": [], "required": false, "says": "Whether a person can close the tab: Delete while it has focus, a middle click, or a press on its `Tabs.CloseTrigger`. The root's `onClose` receives the tab's value."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "disabled", "refers": [], "required": false, "says": "Whether the tab is disabled."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Value of the panel the tab shows."}]};
|
|
3
|
+
export const shapes = {"kit.CloseDetails": [{"accepts": "string", "name": "value", "says": "Value of the closed tab."}], "kit.Justify": [{"accepts": "", "name": "\"around\"", "says": ""}, {"accepts": "", "name": "\"between\"", "says": ""}, {"accepts": "", "name": "\"center\"", "says": ""}, {"accepts": "", "name": "\"end\"", "says": ""}, {"accepts": "", "name": "\"evenly\"", "says": ""}, {"accepts": "", "name": "\"start\"", "says": ""}], "kit.Scale": [{"accepts": "", "name": "\"2xl\"", "says": ""}, {"accepts": "", "name": "\"3xl\"", "says": ""}, {"accepts": "", "name": "\"4xl\"", "says": ""}, {"accepts": "", "name": "\"lg\"", "says": ""}, {"accepts": "", "name": "\"md\"", "says": ""}, {"accepts": "", "name": "\"sm\"", "says": ""}, {"accepts": "", "name": "\"xl\"", "says": ""}, {"accepts": "", "name": "\"xs\"", "says": ""}], "tabs.ElementIds": [{"accepts": "string", "name": "root", "says": ""}, {"accepts": "((value: string) => string)", "name": "trigger", "says": ""}, {"accepts": "string", "name": "list", "says": ""}, {"accepts": "((value: string) => string)", "name": "content", "says": ""}, {"accepts": "string", "name": "indicator", "says": ""}], "tabs.ValueChangeDetails": [{"accepts": "string", "name": "value", "says": ""}], "tabs.FocusChangeDetails": [{"accepts": "string", "name": "focusedValue", "says": ""}], "tabs.NavigateDetails": [{"accepts": "string", "name": "value", "says": ""}, {"accepts": "HTMLAnchorElement", "name": "node", "says": ""}, {"accepts": "string", "name": "href", "says": ""}]};
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { r as recipe } from "../../recipes-95yCB2V3.js";
|
|
3
|
+
import { d as Root, f as Positioner, h as ArrowTip, m as Arrow, p as Content, u as Trigger } from "../../shared-Cfsikh3X.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Portal } from "@stealthscale/component-primitives";
|
|
7
|
+
import { Matrix, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
8
|
+
import { InfoIcon } from "lucide-react";
|
|
9
|
+
import { ButtonPropsProvider, IconButton } from "@stealthscale/component-actions";
|
|
10
|
+
import { Stack } from "@stealthscale/component-layout";
|
|
11
|
+
import { Span } from "@stealthscale/component-typography";
|
|
12
|
+
import { DataList } from "@stealthscale/component-collections";
|
|
13
|
+
//#region src/toggle-tip/examples/definition.example.tsx
|
|
14
|
+
var definition_example_exports = /* @__PURE__ */ __exportAll({
|
|
15
|
+
Definition: () => Definition,
|
|
16
|
+
source: () => source$2
|
|
17
|
+
});
|
|
18
|
+
function Definition(props) {
|
|
19
|
+
const $ = c(22);
|
|
20
|
+
const { t } = useWords("toggle-tip");
|
|
21
|
+
let t0;
|
|
22
|
+
if ($[0] !== t) {
|
|
23
|
+
t0 = t("definition.label");
|
|
24
|
+
$[0] = t;
|
|
25
|
+
$[1] = t0;
|
|
26
|
+
} else t0 = $[1];
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[2] !== t0) {
|
|
29
|
+
t1 = /* @__PURE__ */ jsx(Span, {
|
|
30
|
+
weight: "medium",
|
|
31
|
+
children: t0
|
|
32
|
+
});
|
|
33
|
+
$[2] = t0;
|
|
34
|
+
$[3] = t1;
|
|
35
|
+
} else t1 = $[3];
|
|
36
|
+
let t2;
|
|
37
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
38
|
+
t2 = {
|
|
39
|
+
size: "xs",
|
|
40
|
+
variant: "ghost"
|
|
41
|
+
};
|
|
42
|
+
$[4] = t2;
|
|
43
|
+
} else t2 = $[4];
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[5] !== t) {
|
|
46
|
+
t3 = t("definition.trigger");
|
|
47
|
+
$[5] = t;
|
|
48
|
+
$[6] = t3;
|
|
49
|
+
} else t3 = $[6];
|
|
50
|
+
let t4;
|
|
51
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
52
|
+
t4 = /* @__PURE__ */ jsx(InfoIcon, {});
|
|
53
|
+
$[7] = t4;
|
|
54
|
+
} else t4 = $[7];
|
|
55
|
+
let t5;
|
|
56
|
+
if ($[8] !== t3) {
|
|
57
|
+
t5 = /* @__PURE__ */ jsx(ButtonPropsProvider, {
|
|
58
|
+
value: t2,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Trigger, {
|
|
60
|
+
"aria-label": t3,
|
|
61
|
+
as: IconButton,
|
|
62
|
+
children: t4
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
$[8] = t3;
|
|
66
|
+
$[9] = t5;
|
|
67
|
+
} else t5 = $[9];
|
|
68
|
+
let t6;
|
|
69
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
+
t6 = /* @__PURE__ */ jsx(Arrow, { children: /* @__PURE__ */ jsx(ArrowTip, {}) });
|
|
71
|
+
$[10] = t6;
|
|
72
|
+
} else t6 = $[10];
|
|
73
|
+
let t7;
|
|
74
|
+
if ($[11] !== t) {
|
|
75
|
+
t7 = t("definition.tip");
|
|
76
|
+
$[11] = t;
|
|
77
|
+
$[12] = t7;
|
|
78
|
+
} else t7 = $[12];
|
|
79
|
+
let t8;
|
|
80
|
+
if ($[13] !== t7) {
|
|
81
|
+
t8 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, { children: [t6, t7] }) }) });
|
|
82
|
+
$[13] = t7;
|
|
83
|
+
$[14] = t8;
|
|
84
|
+
} else t8 = $[14];
|
|
85
|
+
let t9;
|
|
86
|
+
if ($[15] !== props || $[16] !== t5 || $[17] !== t8) {
|
|
87
|
+
t9 = /* @__PURE__ */ jsxs(Root, {
|
|
88
|
+
...props,
|
|
89
|
+
children: [t5, t8]
|
|
90
|
+
});
|
|
91
|
+
$[15] = props;
|
|
92
|
+
$[16] = t5;
|
|
93
|
+
$[17] = t8;
|
|
94
|
+
$[18] = t9;
|
|
95
|
+
} else t9 = $[18];
|
|
96
|
+
let t10;
|
|
97
|
+
if ($[19] !== t1 || $[20] !== t9) {
|
|
98
|
+
t10 = /* @__PURE__ */ jsxs(Stack, {
|
|
99
|
+
direction: "row",
|
|
100
|
+
gap: "xs",
|
|
101
|
+
children: [t1, t9]
|
|
102
|
+
});
|
|
103
|
+
$[19] = t1;
|
|
104
|
+
$[20] = t9;
|
|
105
|
+
$[21] = t10;
|
|
106
|
+
} else t10 = $[21];
|
|
107
|
+
return t10;
|
|
108
|
+
}
|
|
109
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { InfoIcon } from \"lucide-react\";\n\nimport { ButtonPropsProvider, IconButton } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { Portal } from \"@stealthscale/component-primitives\";\nimport { Span } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ToggleTip } from \"@stealthscale/component-disclosure\";\n\nexport function Definition(props: ToggleTip.RootProps): ReactElement {\n const { t } = useWords(\"toggle-tip\");\n\n return (\n <Stack direction=\"row\" gap=\"xs\">\n <Span weight=\"medium\">{t(\"definition.label\")}</Span>\n <ToggleTip.Root {...props}>\n <ButtonPropsProvider value={{ size: \"xs\", variant: \"ghost\" }}>\n <ToggleTip.Trigger aria-label={t(\"definition.trigger\")} as={IconButton}>\n <InfoIcon />\n </ToggleTip.Trigger>\n </ButtonPropsProvider>\n <Portal>\n <ToggleTip.Positioner>\n <ToggleTip.Content>\n <ToggleTip.Arrow>\n <ToggleTip.ArrowTip />\n </ToggleTip.Arrow>\n {t(\"definition.tip\")}\n </ToggleTip.Content>\n </ToggleTip.Positioner>\n </Portal>\n </ToggleTip.Root>\n </Stack>\n );\n}\n";
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/toggle-tip/examples/fees.example.tsx
|
|
112
|
+
var fees_example_exports = /* @__PURE__ */ __exportAll({
|
|
113
|
+
Fees: () => Fees,
|
|
114
|
+
source: () => source$1
|
|
115
|
+
});
|
|
116
|
+
const FEES = [
|
|
117
|
+
"processing",
|
|
118
|
+
"payout",
|
|
119
|
+
"conversion"
|
|
120
|
+
];
|
|
121
|
+
function Fees() {
|
|
122
|
+
const $ = c(5);
|
|
123
|
+
const { t } = useWords("toggle-tip");
|
|
124
|
+
let t0;
|
|
125
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t0 = {
|
|
127
|
+
size: "xs",
|
|
128
|
+
variant: "ghost"
|
|
129
|
+
};
|
|
130
|
+
$[0] = t0;
|
|
131
|
+
} else t0 = $[0];
|
|
132
|
+
let t1;
|
|
133
|
+
if ($[1] !== t) {
|
|
134
|
+
t1 = FEES.map((fee) => /* @__PURE__ */ jsxs(DataList.Item, { children: [/* @__PURE__ */ jsxs(DataList.ItemLabel, { children: [t(`fees.${fee}.label`), /* @__PURE__ */ jsxs(Root, { children: [/* @__PURE__ */ jsx(Trigger, {
|
|
135
|
+
"aria-label": t(`fees.${fee}.trigger`),
|
|
136
|
+
as: IconButton,
|
|
137
|
+
children: /* @__PURE__ */ jsx(InfoIcon, {})
|
|
138
|
+
}), /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, { children: [/* @__PURE__ */ jsx(Arrow, { children: /* @__PURE__ */ jsx(ArrowTip, {}) }), t(`fees.${fee}.tip`)] }) }) })] })] }), /* @__PURE__ */ jsx(DataList.ItemValue, { children: t(`fees.${fee}.value`) })] }, fee));
|
|
139
|
+
$[1] = t;
|
|
140
|
+
$[2] = t1;
|
|
141
|
+
} else t1 = $[2];
|
|
142
|
+
let t2;
|
|
143
|
+
if ($[3] !== t1) {
|
|
144
|
+
t2 = /* @__PURE__ */ jsx(ButtonPropsProvider, {
|
|
145
|
+
value: t0,
|
|
146
|
+
children: /* @__PURE__ */ jsx(DataList.Root, {
|
|
147
|
+
orientation: "horizontal",
|
|
148
|
+
children: t1
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
$[3] = t1;
|
|
152
|
+
$[4] = t2;
|
|
153
|
+
} else t2 = $[4];
|
|
154
|
+
return t2;
|
|
155
|
+
}
|
|
156
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { InfoIcon } from \"lucide-react\";\n\nimport { ButtonPropsProvider, IconButton } from \"@stealthscale/component-actions\";\nimport { DataList } from \"@stealthscale/component-collections\";\nimport { Portal } from \"@stealthscale/component-primitives\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ToggleTip } from \"@stealthscale/component-disclosure\";\n\nconst FEES = [\"processing\", \"payout\", \"conversion\"] as const;\n\nexport function Fees(): ReactElement {\n const { t } = useWords(\"toggle-tip\");\n\n return (\n <ButtonPropsProvider value={{ size: \"xs\", variant: \"ghost\" }}>\n <DataList.Root orientation=\"horizontal\">\n {FEES.map((fee) => (\n <DataList.Item key={fee}>\n <DataList.ItemLabel>\n {t(`fees.${fee}.label`)}\n <ToggleTip.Root>\n <ToggleTip.Trigger aria-label={t(`fees.${fee}.trigger`)} as={IconButton}>\n <InfoIcon />\n </ToggleTip.Trigger>\n <Portal>\n <ToggleTip.Positioner>\n <ToggleTip.Content>\n <ToggleTip.Arrow>\n <ToggleTip.ArrowTip />\n </ToggleTip.Arrow>\n {t(`fees.${fee}.tip`)}\n </ToggleTip.Content>\n </ToggleTip.Positioner>\n </Portal>\n </ToggleTip.Root>\n </DataList.ItemLabel>\n <DataList.ItemValue>{t(`fees.${fee}.value`)}</DataList.ItemValue>\n </DataList.Item>\n ))}\n </DataList.Root>\n </ButtonPropsProvider>\n );\n}\n";
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/toggle-tip/examples/terms.example.tsx
|
|
159
|
+
var terms_example_exports = /* @__PURE__ */ __exportAll({
|
|
160
|
+
Terms: () => Terms,
|
|
161
|
+
source: () => source
|
|
162
|
+
});
|
|
163
|
+
function Terms() {
|
|
164
|
+
const $ = c(26);
|
|
165
|
+
const { t } = useWords("toggle-tip");
|
|
166
|
+
let t0;
|
|
167
|
+
if ($[0] !== t) {
|
|
168
|
+
t0 = t("terms.label");
|
|
169
|
+
$[0] = t;
|
|
170
|
+
$[1] = t0;
|
|
171
|
+
} else t0 = $[1];
|
|
172
|
+
let t1;
|
|
173
|
+
if ($[2] !== t0) {
|
|
174
|
+
t1 = /* @__PURE__ */ jsx(Span, {
|
|
175
|
+
weight: "medium",
|
|
176
|
+
children: t0
|
|
177
|
+
});
|
|
178
|
+
$[2] = t0;
|
|
179
|
+
$[3] = t1;
|
|
180
|
+
} else t1 = $[3];
|
|
181
|
+
let t2;
|
|
182
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
183
|
+
t2 = {
|
|
184
|
+
size: "xs",
|
|
185
|
+
variant: "ghost"
|
|
186
|
+
};
|
|
187
|
+
$[4] = t2;
|
|
188
|
+
} else t2 = $[4];
|
|
189
|
+
let t3;
|
|
190
|
+
if ($[5] !== t) {
|
|
191
|
+
t3 = t("terms.trigger");
|
|
192
|
+
$[5] = t;
|
|
193
|
+
$[6] = t3;
|
|
194
|
+
} else t3 = $[6];
|
|
195
|
+
let t4;
|
|
196
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
197
|
+
t4 = /* @__PURE__ */ jsx(InfoIcon, {});
|
|
198
|
+
$[7] = t4;
|
|
199
|
+
} else t4 = $[7];
|
|
200
|
+
let t5;
|
|
201
|
+
if ($[8] !== t3) {
|
|
202
|
+
t5 = /* @__PURE__ */ jsx(ButtonPropsProvider, {
|
|
203
|
+
value: t2,
|
|
204
|
+
children: /* @__PURE__ */ jsx(Trigger, {
|
|
205
|
+
"aria-label": t3,
|
|
206
|
+
as: IconButton,
|
|
207
|
+
children: t4
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
$[8] = t3;
|
|
211
|
+
$[9] = t5;
|
|
212
|
+
} else t5 = $[9];
|
|
213
|
+
let t6;
|
|
214
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
215
|
+
t6 = /* @__PURE__ */ jsx(Arrow, { children: /* @__PURE__ */ jsx(ArrowTip, {}) });
|
|
216
|
+
$[10] = t6;
|
|
217
|
+
} else t6 = $[10];
|
|
218
|
+
let t7;
|
|
219
|
+
if ($[11] !== t) {
|
|
220
|
+
t7 = t("terms.tip");
|
|
221
|
+
$[11] = t;
|
|
222
|
+
$[12] = t7;
|
|
223
|
+
} else t7 = $[12];
|
|
224
|
+
let t8;
|
|
225
|
+
if ($[13] !== t) {
|
|
226
|
+
t8 = t("terms.link");
|
|
227
|
+
$[13] = t;
|
|
228
|
+
$[14] = t8;
|
|
229
|
+
} else t8 = $[14];
|
|
230
|
+
let t9;
|
|
231
|
+
if ($[15] !== t8) {
|
|
232
|
+
t9 = /* @__PURE__ */ jsx("a", {
|
|
233
|
+
href: "#terms",
|
|
234
|
+
children: t8
|
|
235
|
+
});
|
|
236
|
+
$[15] = t8;
|
|
237
|
+
$[16] = t9;
|
|
238
|
+
} else t9 = $[16];
|
|
239
|
+
let t10;
|
|
240
|
+
if ($[17] !== t7 || $[18] !== t9) {
|
|
241
|
+
t10 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, { children: [
|
|
242
|
+
t6,
|
|
243
|
+
t7,
|
|
244
|
+
" ",
|
|
245
|
+
t9
|
|
246
|
+
] }) }) });
|
|
247
|
+
$[17] = t7;
|
|
248
|
+
$[18] = t9;
|
|
249
|
+
$[19] = t10;
|
|
250
|
+
} else t10 = $[19];
|
|
251
|
+
let t11;
|
|
252
|
+
if ($[20] !== t10 || $[21] !== t5) {
|
|
253
|
+
t11 = /* @__PURE__ */ jsxs(Root, { children: [t5, t10] });
|
|
254
|
+
$[20] = t10;
|
|
255
|
+
$[21] = t5;
|
|
256
|
+
$[22] = t11;
|
|
257
|
+
} else t11 = $[22];
|
|
258
|
+
let t12;
|
|
259
|
+
if ($[23] !== t1 || $[24] !== t11) {
|
|
260
|
+
t12 = /* @__PURE__ */ jsxs(Stack, {
|
|
261
|
+
direction: "row",
|
|
262
|
+
gap: "xs",
|
|
263
|
+
children: [t1, t11]
|
|
264
|
+
});
|
|
265
|
+
$[23] = t1;
|
|
266
|
+
$[24] = t11;
|
|
267
|
+
$[25] = t12;
|
|
268
|
+
} else t12 = $[25];
|
|
269
|
+
return t12;
|
|
270
|
+
}
|
|
271
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { InfoIcon } from \"lucide-react\";\n\nimport { ButtonPropsProvider, IconButton } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { Portal } from \"@stealthscale/component-primitives\";\nimport { Span } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ToggleTip } from \"@stealthscale/component-disclosure\";\n\nexport function Terms(): ReactElement {\n const { t } = useWords(\"toggle-tip\");\n\n return (\n <Stack direction=\"row\" gap=\"xs\">\n <Span weight=\"medium\">{t(\"terms.label\")}</Span>\n <ToggleTip.Root>\n <ButtonPropsProvider value={{ size: \"xs\", variant: \"ghost\" }}>\n <ToggleTip.Trigger aria-label={t(\"terms.trigger\")} as={IconButton}>\n <InfoIcon />\n </ToggleTip.Trigger>\n </ButtonPropsProvider>\n <Portal>\n <ToggleTip.Positioner>\n <ToggleTip.Content>\n <ToggleTip.Arrow>\n <ToggleTip.ArrowTip />\n </ToggleTip.Arrow>\n {t(\"terms.tip\")} <a href=\"#terms\">{t(\"terms.link\")}</a>\n </ToggleTip.Content>\n </ToggleTip.Positioner>\n </Portal>\n </ToggleTip.Root>\n </Stack>\n );\n}\n";
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/toggle-tip/toggle-tip.specimen.tsx
|
|
274
|
+
/**
|
|
275
|
+
* Catalogue page for the toggle tip.
|
|
276
|
+
*
|
|
277
|
+
* @remarks
|
|
278
|
+
* `scenesOf` generates the looks by sizes from the definition example. The placement scene is
|
|
279
|
+
* hand-written, because the placement is the machine's `positioning` option and not an axis. The
|
|
280
|
+
* terms and fees scenes show a note with a link and notes beside the names of a data list. Every
|
|
281
|
+
* toggle tip renders closed and portals its note to the document body, so an opened note renders
|
|
282
|
+
* over the page and a scene is as tall as its triggers. The words are keys under `toggle-tip` in
|
|
283
|
+
* `locales/en/specimen/toggle-tip.json`.
|
|
284
|
+
*/
|
|
285
|
+
/**
|
|
286
|
+
* Sides of the placement scene.
|
|
287
|
+
*/
|
|
288
|
+
const SIDES = [
|
|
289
|
+
"top",
|
|
290
|
+
"right",
|
|
291
|
+
"bottom",
|
|
292
|
+
"left"
|
|
293
|
+
];
|
|
294
|
+
/**
|
|
295
|
+
* Hand-written scene for the four placements.
|
|
296
|
+
*/
|
|
297
|
+
const placement = {
|
|
298
|
+
about: "toggle-tip.placement.about",
|
|
299
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
300
|
+
knob: "placement",
|
|
301
|
+
of: SIDES,
|
|
302
|
+
children: (side) => /* @__PURE__ */ jsx(Definition, { positioning: { placement: side } })
|
|
303
|
+
}),
|
|
304
|
+
example: definition_example_exports,
|
|
305
|
+
props: { positioning: { placement: "top" } },
|
|
306
|
+
title: "toggle-tip.placement.title"
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Hand-written scene for a note that contains a link.
|
|
310
|
+
*/
|
|
311
|
+
const terms = {
|
|
312
|
+
about: "toggle-tip.terms.about",
|
|
313
|
+
draw: Terms,
|
|
314
|
+
example: terms_example_exports,
|
|
315
|
+
title: "toggle-tip.terms.title"
|
|
316
|
+
};
|
|
317
|
+
/**
|
|
318
|
+
* Hand-written scene for notes beside the names of a data list.
|
|
319
|
+
*/
|
|
320
|
+
const fees = {
|
|
321
|
+
about: "toggle-tip.fees.about",
|
|
322
|
+
draw: Fees,
|
|
323
|
+
example: fees_example_exports,
|
|
324
|
+
title: "toggle-tip.fees.title"
|
|
325
|
+
};
|
|
326
|
+
var toggle_tip_specimen_default = specimen({
|
|
327
|
+
about: "toggle-tip.about",
|
|
328
|
+
id: "components/disclosure/toggle-tip",
|
|
329
|
+
imports: "import { ToggleTip } from \"@stealthscale/component-disclosure\";",
|
|
330
|
+
scenes: [
|
|
331
|
+
...scenesOf(recipe, {
|
|
332
|
+
axes: { variant: { across: "size" } },
|
|
333
|
+
draw: (props) => /* @__PURE__ */ jsx(Definition, { ...props }),
|
|
334
|
+
example: definition_example_exports,
|
|
335
|
+
namespace: "toggle-tip"
|
|
336
|
+
}),
|
|
337
|
+
placement,
|
|
338
|
+
terms,
|
|
339
|
+
fees
|
|
340
|
+
],
|
|
341
|
+
title: "toggle-tip.title"
|
|
342
|
+
});
|
|
343
|
+
//#endregion
|
|
344
|
+
export { toggle_tip_specimen_default as default, fees, placement, terms };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"ArrowTipProps": {"conditions": 284, "foreign": 1041}, "ArrowProps": {"conditions": 284, "foreign": 1041}, "ContentProps": {"conditions": 284, "foreign": 1040}, "PositionerProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1039}, "TriggerProps": {"conditions": 284, "foreign": 1051}};
|
|
2
|
+
export const parts = {"ArrowTipProps": [], "ArrowProps": [], "ContentProps": [], "PositionerProps": [], "RootProps": [{"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnEscape", "refers": [], "required": false, "says": "Whether to close the popover when the escape key is pressed."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnInteractOutside", "refers": [], "required": false, "says": "Whether to close the popover when the user clicks outside of the popover."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "defaultOpen", "refers": [], "required": false, "says": "The initial open state of the popover when rendered. Use when you don't need to control the open state of the popover."}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "defaultTriggerValue", "refers": [], "required": false, "says": "The initial trigger value when rendered. Use when you don't need to control the trigger value."}, {"accepts": "\"ltr\" | \"rtl\"", "fallback": "\"ltr\"", "kind": "option", "name": "dir", "refers": [], "required": false, "says": "The document's text/writing direction."}, {"accepts": "(() => MaybeElement)", "fallback": "", "kind": "option", "name": "finalFocusEl", "refers": [], "required": false, "says": "Element to receive focus when the popover is closed."}, {"accepts": "(() => Document | Node | ShadowRoot)", "fallback": "", "kind": "option", "name": "getRootNode", "refers": [], "required": false, "says": "A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "id", "refers": [], "required": false, "says": "The unique identifier of the machine."}, {"accepts": "ElementIds", "fallback": "", "kind": "option", "name": "ids", "refers": ["popover.ElementIds"], "required": false, "says": "The ids of the elements in the popover. Useful for composition."}, {"accepts": "(() => false | HTMLElement | null)", "fallback": "", "kind": "option", "name": "initialFocusEl", "refers": [], "required": false, "says": "The element to focus on when the popover is opened. Return `false` to skip moving focus, or `null` to use the default."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "lazyMount", "refers": [], "required": false, "says": "When true, the overlay renders no content until it first opens."}, {"accepts": "boolean", "fallback": "false", "kind": "option", "name": "modal", "refers": [], "required": false, "says": "Whether the popover should be modal. When set to `true`: - interaction with outside elements will be disabled - only popover content will be visible to screen readers - scrolling is blocked - focus is trapped within the popover"}, {"accepts": "((event: KeyboardEvent) => void)", "fallback": "", "kind": "option", "name": "onEscapeKeyDown", "refers": [], "required": false, "says": "Function called when the escape key is pressed"}, {"accepts": "(() => void)", "fallback": "", "kind": "option", "name": "onExitComplete", "refers": [], "required": false, "says": "Runs once the content's exit animation ends."}, {"accepts": "((event: FocusOutsideEvent) => void)", "fallback": "", "kind": "option", "name": "onFocusOutside", "refers": ["interact-outside.EventDetails", "interact-outside.FocusOutsideEvent"], "required": false, "says": "Function called when the focus is moved outside the component"}, {"accepts": "((event: InteractOutsideEvent) => void)", "fallback": "", "kind": "option", "name": "onInteractOutside", "refers": ["interact-outside.EventDetails", "interact-outside.FocusOutsideEvent", "interact-outside.InteractOutsideEvent", "interact-outside.PointerDownOutsideEvent"], "required": false, "says": "Function called when an interaction happens outside the component"}, {"accepts": "((details: OpenChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onOpenChange", "refers": ["popover.OpenChangeDetails"], "required": false, "says": "Function invoked when the popover opens or closes"}, {"accepts": "((event: PointerDownOutsideEvent) => void)", "fallback": "", "kind": "option", "name": "onPointerDownOutside", "refers": ["interact-outside.EventDetails", "interact-outside.PointerDownOutsideEvent"], "required": false, "says": "Function called when the pointer is pressed down outside the component"}, {"accepts": "((event: LayerDismissEvent) => void)", "fallback": "", "kind": "option", "name": "onRequestDismiss", "refers": ["dismissable.LayerDismissEvent", "dismissable.LayerDismissEventDetail"], "required": false, "says": "Function called when this layer is closed due to a parent layer being closed"}, {"accepts": "((details: TriggerValueChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onTriggerValueChange", "refers": ["popover.TriggerValueChangeDetails"], "required": false, "says": "Function called when the trigger value changes."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "open", "refers": [], "required": false, "says": "The controlled open state of the popover"}, {"accepts": "(() => Element | null)[]", "fallback": "", "kind": "option", "name": "persistentElements", "refers": [], "required": false, "says": "Returns the persistent elements that: - should not have pointer-events disabled - should not trigger the dismiss event"}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "portalled", "refers": [], "required": false, "says": "Whether the popover is portalled. This will proxy the tabbing behavior regardless of the DOM position of the popover content."}, {"accepts": "PositioningOptions", "fallback": "", "kind": "option", "name": "positioning", "refers": ["core.ComputePositionReturn", "dom.AutoUpdateOptions", "dom.VirtualElement", "popper.PositioningOptions", "utils.Placement"], "required": false, "says": "The user provided options used to position the popover content"}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "restoreFocus", "refers": [], "required": false, "says": "Whether to restore focus to the element that had focus before the popover was opened."}, {"accepts": "Scale", "fallback": "", "kind": "variant", "name": "size", "refers": ["kit.Scale"], "required": false, "says": "Padding of the content on the inset scale and its text on the label role."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "skipAnimationOnMount", "refers": [], "required": false, "says": "When true, content that is open on mount plays no entry animation."}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "triggerValue", "refers": [], "required": false, "says": "The controlled trigger value"}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "unmountOnExit", "refers": [], "required": false, "says": "When true, the overlay removes its content once the exit animation ends."}, {"accepts": "\"inverted\" | \"surface\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Surface of the content: the inverted surface, or the popover surface inside a hairline edge."}], "TriggerProps": []};
|
|
3
|
+
export const shapes = {"interact-outside.EventDetails": [{"accepts": "PointerEvent", "name": "originalEvent", "says": ""}, {"accepts": "boolean", "name": "contextmenu", "says": ""}, {"accepts": "boolean", "name": "focusable", "says": ""}, {"accepts": "EventTarget", "name": "target", "says": ""}], "interact-outside.PointerDownOutsideEvent": [{"accepts": "EventDetails<PointerEvent>", "name": "detail", "says": "The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean, detail?: EventDetails<PointerEvent>) => void", "name": "initCustomEvent", "says": "The **`CustomEvent.initCustomEvent()`** method initializes a CustomEvent object. If the event has already been dispatched, this method does nothing."}, {"accepts": "boolean", "name": "bubbles", "says": "The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not."}, {"accepts": "boolean", "name": "cancelBubble", "says": "The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details."}, {"accepts": "boolean", "name": "cancelable", "says": "The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened."}, {"accepts": "boolean", "name": "composed", "says": "The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM."}, {"accepts": "EventTarget | null", "name": "currentTarget", "says": "The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached."}, {"accepts": "boolean", "name": "defaultPrevented", "says": "The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event."}, {"accepts": "number", "name": "eventPhase", "says": "The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated."}, {"accepts": "boolean", "name": "isTrusted", "says": "The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents."}, {"accepts": "boolean", "name": "returnValue", "says": "The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not."}, {"accepts": "EventTarget | null", "name": "srcElement", "says": "The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead."}, {"accepts": "EventTarget | null", "name": "target", "says": "The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event."}, {"accepts": "number", "name": "timeStamp", "says": "The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created."}, {"accepts": "string", "name": "type", "says": "The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error."}, {"accepts": "() => EventTarget[]", "name": "composedPath", "says": "The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean) => void", "name": "initEvent", "says": "The **`Event.initEvent()`** method is used to initialize the value of an event created using Document.createEvent()."}, {"accepts": "() => void", "name": "preventDefault", "says": "The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken."}, {"accepts": "() => void", "name": "stopImmediatePropagation", "says": "The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called."}, {"accepts": "() => void", "name": "stopPropagation", "says": "The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation()."}, {"accepts": "0", "name": "NONE", "says": ""}, {"accepts": "1", "name": "CAPTURING_PHASE", "says": ""}, {"accepts": "2", "name": "AT_TARGET", "says": ""}, {"accepts": "3", "name": "BUBBLING_PHASE", "says": ""}], "interact-outside.FocusOutsideEvent": [{"accepts": "EventDetails<FocusEvent>", "name": "detail", "says": "The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean, detail?: EventDetails<FocusEvent>) => void", "name": "initCustomEvent", "says": "The **`CustomEvent.initCustomEvent()`** method initializes a CustomEvent object. If the event has already been dispatched, this method does nothing."}, {"accepts": "boolean", "name": "bubbles", "says": "The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not."}, {"accepts": "boolean", "name": "cancelBubble", "says": "The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details."}, {"accepts": "boolean", "name": "cancelable", "says": "The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened."}, {"accepts": "boolean", "name": "composed", "says": "The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM."}, {"accepts": "EventTarget | null", "name": "currentTarget", "says": "The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached."}, {"accepts": "boolean", "name": "defaultPrevented", "says": "The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event."}, {"accepts": "number", "name": "eventPhase", "says": "The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated."}, {"accepts": "boolean", "name": "isTrusted", "says": "The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents."}, {"accepts": "boolean", "name": "returnValue", "says": "The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not."}, {"accepts": "EventTarget | null", "name": "srcElement", "says": "The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead."}, {"accepts": "EventTarget | null", "name": "target", "says": "The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event."}, {"accepts": "number", "name": "timeStamp", "says": "The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created."}, {"accepts": "string", "name": "type", "says": "The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error."}, {"accepts": "() => EventTarget[]", "name": "composedPath", "says": "The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean) => void", "name": "initEvent", "says": "The **`Event.initEvent()`** method is used to initialize the value of an event created using Document.createEvent()."}, {"accepts": "() => void", "name": "preventDefault", "says": "The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken."}, {"accepts": "() => void", "name": "stopImmediatePropagation", "says": "The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called."}, {"accepts": "() => void", "name": "stopPropagation", "says": "The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation()."}, {"accepts": "0", "name": "NONE", "says": ""}, {"accepts": "1", "name": "CAPTURING_PHASE", "says": ""}, {"accepts": "2", "name": "AT_TARGET", "says": ""}, {"accepts": "3", "name": "BUBBLING_PHASE", "says": ""}], "interact-outside.InteractOutsideEvent": [{"accepts": "", "name": "FocusOutsideEvent", "says": ""}, {"accepts": "", "name": "PointerDownOutsideEvent", "says": ""}], "dismissable.LayerDismissEventDetail": [{"accepts": "HTMLElement", "name": "originalLayer", "says": ""}, {"accepts": "HTMLElement", "name": "targetLayer", "says": ""}, {"accepts": "number", "name": "originalIndex", "says": ""}, {"accepts": "number", "name": "targetIndex", "says": ""}], "dismissable.LayerDismissEvent": [{"accepts": "LayerDismissEventDetail", "name": "detail", "says": "The read-only **`detail`** property of the CustomEvent interface returns any data passed when initializing the event."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean, detail?: LayerDismissEventDetail) => void", "name": "initCustomEvent", "says": "The **`CustomEvent.initCustomEvent()`** method initializes a CustomEvent object. If the event has already been dispatched, this method does nothing."}, {"accepts": "boolean", "name": "bubbles", "says": "The **`bubbles`** read-only property of the Event interface indicates whether the event bubbles up through the DOM tree or not."}, {"accepts": "boolean", "name": "cancelBubble", "says": "The **`cancelBubble`** property of the Event interface is deprecated. Use Event.stopPropagation() instead. Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details."}, {"accepts": "boolean", "name": "cancelable", "says": "The **`cancelable`** read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened."}, {"accepts": "boolean", "name": "composed", "says": "The read-only **`composed`** property of the Event interface returns a boolean value which indicates whether or not the event will propagate across the shadow DOM boundary into the standard DOM."}, {"accepts": "EventTarget | null", "name": "currentTarget", "says": "The **`currentTarget`** read-only property of the Event interface identifies the element to which the event handler has been attached."}, {"accepts": "boolean", "name": "defaultPrevented", "says": "The **`defaultPrevented`** read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event."}, {"accepts": "number", "name": "eventPhase", "says": "The **`eventPhase`** read-only property of the Event interface indicates which phase of the event flow is currently being evaluated."}, {"accepts": "boolean", "name": "isTrusted", "says": "The **`isTrusted`** read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents."}, {"accepts": "boolean", "name": "returnValue", "says": "The Event property **`returnValue`** indicates whether the default action for this event has been prevented or not."}, {"accepts": "EventTarget | null", "name": "srcElement", "says": "The deprecated **`Event.srcElement`** is an alias for the Event.target property. Use Event.target instead."}, {"accepts": "EventTarget | null", "name": "target", "says": "The read-only **`target`** property of the Event interface is a reference to the object onto which the event was dispatched. It is different from Event.currentTarget when the event handler is called during the bubbling or capturing phase of the event."}, {"accepts": "number", "name": "timeStamp", "says": "The **`timeStamp`** read-only property of the Event interface returns the time (in milliseconds) at which the event was created."}, {"accepts": "string", "name": "type", "says": "The **`type`** read-only property of the Event interface returns a string containing the event's type. It is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error."}, {"accepts": "() => EventTarget[]", "name": "composedPath", "says": "The **`composedPath()`** method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked. This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed."}, {"accepts": "(type: string, bubbles?: boolean, cancelable?: boolean) => void", "name": "initEvent", "says": "The **`Event.initEvent()`** method is used to initialize the value of an event created using Document.createEvent()."}, {"accepts": "() => void", "name": "preventDefault", "says": "The **`preventDefault()`** method of the Event interface tells the user agent that the event is being explicitly handled, so its default action, such as page scrolling, link navigation, or pasting text, should not be taken."}, {"accepts": "() => void", "name": "stopImmediatePropagation", "says": "The **`stopImmediatePropagation()`** method of the Event interface prevents other listeners of the same event from being called."}, {"accepts": "() => void", "name": "stopPropagation", "says": "The **`stopPropagation()`** method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation()."}, {"accepts": "0", "name": "NONE", "says": ""}, {"accepts": "1", "name": "CAPTURING_PHASE", "says": ""}, {"accepts": "2", "name": "AT_TARGET", "says": ""}, {"accepts": "3", "name": "BUBBLING_PHASE", "says": ""}], "popover.ElementIds": [{"accepts": "string", "name": "anchor", "says": ""}, {"accepts": "string | ((value?: string) => string)", "name": "trigger", "says": ""}, {"accepts": "string", "name": "content", "says": ""}, {"accepts": "string", "name": "title", "says": ""}, {"accepts": "string", "name": "description", "says": ""}, {"accepts": "string", "name": "closeTrigger", "says": ""}, {"accepts": "string", "name": "positioner", "says": ""}, {"accepts": "string", "name": "arrow", "says": ""}], "popover.OpenChangeDetails": [{"accepts": "boolean", "name": "open", "says": ""}], "popper.PositioningOptions": [{"accepts": "boolean", "name": "restoreStyles", "says": "Whether styles applied by the positioning utility should be restored on cleanup."}, {"accepts": "boolean", "name": "applyStyles", "says": "Whether to apply computed position styles (`--x`, `--y`, `--z-index`, `z-index`) to the floating element. Set to `false` when the consumer applies these from context (e.g. for exit animations)."}, {"accepts": "boolean", "name": "hideWhenDetached", "says": "Whether the popover should be hidden when the reference element is detached"}, {"accepts": "\"absolute\" | \"fixed\"", "name": "strategy", "says": "The strategy to use for positioning"}, {"accepts": "Placement", "name": "placement", "says": "The initial placement of the floating element"}, {"accepts": "{ mainAxis?: number; crossAxis?: number; }", "name": "offset", "says": "The offset of the floating element"}, {"accepts": "number", "name": "gutter", "says": "The main axis offset or gap between the reference and floating elements"}, {"accepts": "number", "name": "shift", "says": "The secondary axis offset or gap between the reference and floating elements"}, {"accepts": "number", "name": "overflowPadding", "says": "The virtual padding around the viewport edges to check for overflow"}, {"accepts": "number", "name": "arrowPadding", "says": "The minimum padding between the arrow and the floating element's corner."}, {"accepts": "boolean | Placement[]", "name": "flip", "says": "Whether to flip the placement"}, {"accepts": "boolean", "name": "slide", "says": "Whether the popover should slide when it overflows."}, {"accepts": "boolean", "name": "overlap", "says": "Whether the floating element can overlap the reference element"}, {"accepts": "boolean", "name": "sameWidth", "says": "Whether to make the floating element same width as the reference element"}, {"accepts": "boolean", "name": "fitViewport", "says": "Whether the popover should fit the viewport."}, {"accepts": "boolean", "name": "sizeMiddleware", "says": "Whether to use the size middleware from Floating UI. It computes and sets CSS variables (`--reference-width`, `--reference-height`, `--available-width`, `--available-height`) used by `sameWidth` and `fitViewport`."}, {"accepts": "\"clipping-ancestors\" | (() => Boundary) | Boundary", "name": "boundary", "says": "The overflow boundary of the reference element Accepts a function returning a Boundary, a Boundary directly, or the shorthand string 'clipping-ancestors' which maps to Floating UI's 'clippingAncestors'."}, {"accepts": "boolean | AutoUpdateOptions", "name": "listeners", "says": "Options to activate auto-update listeners"}, {"accepts": "((data: ComputePositionReturn) => void)", "name": "onComplete", "says": "Function called when the placement is computed"}, {"accepts": "((data: { placed: boolean; }) => void)", "name": "onPositioned", "says": "Function called when the floating element is positioned or not"}, {"accepts": "(() => HTMLElement | VirtualElement | null)", "name": "getAnchorElement", "says": "Function that returns the anchor element. Useful when you want to use a different element as the anchor."}, {"accepts": "((element: HTMLElement | VirtualElement | null) => AnchorRect | null)", "name": "getAnchorRect", "says": "Function that returns the anchor rect"}, {"accepts": "((data: { updatePosition: () => Promise<void>; floatingElement: HTMLElement | null; }) => void | Promise<void>)", "name": "updatePosition", "says": "A callback that will be called when the popover needs to calculate its position."}], "utils.Placement": [{"accepts": "", "name": "\"bottom\"", "says": ""}, {"accepts": "", "name": "\"bottom-end\"", "says": ""}, {"accepts": "", "name": "\"bottom-start\"", "says": ""}, {"accepts": "", "name": "\"left\"", "says": ""}, {"accepts": "", "name": "\"left-end\"", "says": ""}, {"accepts": "", "name": "\"left-start\"", "says": ""}, {"accepts": "", "name": "\"right\"", "says": ""}, {"accepts": "", "name": "\"right-end\"", "says": ""}, {"accepts": "", "name": "\"right-start\"", "says": ""}, {"accepts": "", "name": "\"top\"", "says": ""}, {"accepts": "", "name": "\"top-end\"", "says": ""}, {"accepts": "", "name": "\"top-start\"", "says": ""}], "dom.AutoUpdateOptions": [{"accepts": "boolean", "name": "ancestorScroll", "says": "Whether to update the position when an overflow ancestor is scrolled."}, {"accepts": "boolean", "name": "ancestorResize", "says": "Whether to update the position when an overflow ancestor is resized. This\r uses the native `resize` event."}, {"accepts": "boolean", "name": "elementResize", "says": "Whether to update the position when either the reference or floating\r elements resized. This uses a `ResizeObserver`."}, {"accepts": "boolean", "name": "layoutShift", "says": "Whether to update the position when the reference relocated on the screen\r due to layout shift."}, {"accepts": "boolean", "name": "animationFrame", "says": "Whether to update on every animation frame if necessary. Only use if you\r need to update the position in response to an animation using transforms."}], "core.ComputePositionReturn": [{"accepts": "Placement", "name": "placement", "says": "The final chosen placement of the floating element."}, {"accepts": "Strategy", "name": "strategy", "says": "The strategy used to position the floating element."}, {"accepts": "MiddlewareData", "name": "middlewareData", "says": "Object containing data returned from all middleware, keyed by their name."}, {"accepts": "number", "name": "x", "says": ""}, {"accepts": "number", "name": "y", "says": ""}], "dom.VirtualElement": [{"accepts": "() => { bottom: number; height: number; left: number; right: number; top: number; width: number; x: number; y: number; }", "name": "getBoundingClientRect", "says": ""}, {"accepts": "(() => { bottom: number; height: number; left: number; right: number; top: number; width: number; x: number; y: number; }[] | DOMRectList)", "name": "getClientRects", "says": ""}, {"accepts": "Element", "name": "contextElement", "says": ""}], "popover.TriggerValueChangeDetails": [{"accepts": "string | null", "name": "value", "says": "The value of the trigger"}, {"accepts": "HTMLElement | null", "name": "triggerElement", "says": "The trigger element"}], "kit.Scale": [{"accepts": "", "name": "\"2xl\"", "says": ""}, {"accepts": "", "name": "\"3xl\"", "says": ""}, {"accepts": "", "name": "\"4xl\"", "says": ""}, {"accepts": "", "name": "\"lg\"", "says": ""}, {"accepts": "", "name": "\"md\"", "says": ""}, {"accepts": "", "name": "\"sm\"", "says": ""}, {"accepts": "", "name": "\"xl\"", "says": ""}, {"accepts": "", "name": "\"xs\"", "says": ""}]};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { n as recipe } from "../../recipes-95yCB2V3.js";
|
|
3
|
+
import { a as Positioner, c as ArrowTip, i as Root, o as Content, r as Trigger, s as Arrow } from "../../shared-Cfsikh3X.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Portal } from "@stealthscale/component-primitives";
|
|
7
|
+
import { Matrix, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
8
|
+
import { Button } from "@stealthscale/component-actions";
|
|
9
|
+
//#region src/tooltip/examples/save.example.tsx
|
|
10
|
+
var save_example_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
Save: () => Save,
|
|
12
|
+
source: () => source
|
|
13
|
+
});
|
|
14
|
+
function Save(props) {
|
|
15
|
+
const $ = c(13);
|
|
16
|
+
const { t } = useWords("tooltip");
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] !== t) {
|
|
19
|
+
t0 = t("save");
|
|
20
|
+
$[0] = t;
|
|
21
|
+
$[1] = t0;
|
|
22
|
+
} else t0 = $[1];
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[2] !== t0) {
|
|
25
|
+
t1 = /* @__PURE__ */ jsx(Trigger, {
|
|
26
|
+
as: Button,
|
|
27
|
+
children: t0
|
|
28
|
+
});
|
|
29
|
+
$[2] = t0;
|
|
30
|
+
$[3] = t1;
|
|
31
|
+
} else t1 = $[3];
|
|
32
|
+
let t2;
|
|
33
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
34
|
+
t2 = /* @__PURE__ */ jsx(Arrow, { children: /* @__PURE__ */ jsx(ArrowTip, {}) });
|
|
35
|
+
$[4] = t2;
|
|
36
|
+
} else t2 = $[4];
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[5] !== t) {
|
|
39
|
+
t3 = t("saves");
|
|
40
|
+
$[5] = t;
|
|
41
|
+
$[6] = t3;
|
|
42
|
+
} else t3 = $[6];
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[7] !== t3) {
|
|
45
|
+
t4 = /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Positioner, { children: /* @__PURE__ */ jsxs(Content, { children: [t2, t3] }) }) });
|
|
46
|
+
$[7] = t3;
|
|
47
|
+
$[8] = t4;
|
|
48
|
+
} else t4 = $[8];
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[9] !== props || $[10] !== t1 || $[11] !== t4) {
|
|
51
|
+
t5 = /* @__PURE__ */ jsxs(Root, {
|
|
52
|
+
openDelay: 100,
|
|
53
|
+
...props,
|
|
54
|
+
children: [t1, t4]
|
|
55
|
+
});
|
|
56
|
+
$[9] = props;
|
|
57
|
+
$[10] = t1;
|
|
58
|
+
$[11] = t4;
|
|
59
|
+
$[12] = t5;
|
|
60
|
+
} else t5 = $[12];
|
|
61
|
+
return t5;
|
|
62
|
+
}
|
|
63
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { Button } from \"@stealthscale/component-actions\";\nimport { Portal } from \"@stealthscale/component-primitives\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Tooltip } from \"@stealthscale/component-disclosure\";\n\nexport function Save(props: Tooltip.RootProps): ReactElement {\n const { t } = useWords(\"tooltip\");\n\n return (\n <Tooltip.Root openDelay={100} {...props}>\n <Tooltip.Trigger as={Button}>{t(\"save\")}</Tooltip.Trigger>\n <Portal>\n <Tooltip.Positioner>\n <Tooltip.Content>\n <Tooltip.Arrow>\n <Tooltip.ArrowTip />\n </Tooltip.Arrow>\n {t(\"saves\")}\n </Tooltip.Content>\n </Tooltip.Positioner>\n </Portal>\n </Tooltip.Root>\n );\n}\n";
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/tooltip/tooltip.specimen.tsx
|
|
66
|
+
/**
|
|
67
|
+
* Catalogue page for the tooltip.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* `scenesOf` generates the looks by sizes from the save example. The placement scene is
|
|
71
|
+
* hand-written, because the placement is the machine's `positioning` option and not an axis.
|
|
72
|
+
* Every tooltip renders closed and portals its content to the document body, so a shown tooltip
|
|
73
|
+
* renders over the page and a scene is as tall as its triggers. The words are keys under
|
|
74
|
+
* `tooltip` in `locales/en/specimen/tooltip.json`.
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Sides of the placement scene.
|
|
78
|
+
*/
|
|
79
|
+
const SIDES = [
|
|
80
|
+
"top",
|
|
81
|
+
"right",
|
|
82
|
+
"bottom",
|
|
83
|
+
"left"
|
|
84
|
+
];
|
|
85
|
+
/**
|
|
86
|
+
* Hand-written scene for the four placements.
|
|
87
|
+
*/
|
|
88
|
+
const placement = {
|
|
89
|
+
about: "tooltip.placement.about",
|
|
90
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
91
|
+
knob: "placement",
|
|
92
|
+
of: SIDES,
|
|
93
|
+
children: (side) => /* @__PURE__ */ jsx(Save, { positioning: { placement: side } })
|
|
94
|
+
}),
|
|
95
|
+
example: save_example_exports,
|
|
96
|
+
props: { positioning: { placement: "top" } },
|
|
97
|
+
title: "tooltip.placement.title"
|
|
98
|
+
};
|
|
99
|
+
var tooltip_specimen_default = specimen({
|
|
100
|
+
about: "tooltip.about",
|
|
101
|
+
id: "components/disclosure/tooltip",
|
|
102
|
+
imports: "import { Tooltip } from \"@stealthscale/component-disclosure\";",
|
|
103
|
+
scenes: [...scenesOf(recipe, {
|
|
104
|
+
axes: { variant: { across: "size" } },
|
|
105
|
+
draw: (props) => /* @__PURE__ */ jsx(Save, { ...props }),
|
|
106
|
+
example: save_example_exports,
|
|
107
|
+
namespace: "tooltip"
|
|
108
|
+
}), placement],
|
|
109
|
+
title: "tooltip.title"
|
|
110
|
+
});
|
|
111
|
+
//#endregion
|
|
112
|
+
export { tooltip_specimen_default as default, placement };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"ArrowTipProps": {"conditions": 284, "foreign": 1041}, "ArrowProps": {"conditions": 284, "foreign": 1041}, "ContentProps": {"conditions": 284, "foreign": 1040}, "PositionerProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1039}, "TriggerProps": {"conditions": 284, "foreign": 1051}};
|
|
2
|
+
export const parts = {"ArrowTipProps": [], "ArrowProps": [], "ContentProps": [], "PositionerProps": [], "RootProps": [{"accepts": "number", "fallback": "150", "kind": "option", "name": "closeDelay", "refers": [], "required": false, "says": "The close delay of the tooltip."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnClick", "refers": [], "required": false, "says": "Whether the tooltip should close on click"}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnEscape", "refers": [], "required": false, "says": "Whether to close the tooltip when the Escape key is pressed."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnPointerDown", "refers": [], "required": false, "says": "Whether to close the tooltip on pointerdown."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "closeOnScroll", "refers": [], "required": false, "says": "Whether the tooltip should close on scroll"}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "defaultOpen", "refers": [], "required": false, "says": "The initial open state of the tooltip when rendered. Use when you don't need to control the open state of the tooltip."}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "defaultTriggerValue", "refers": [], "required": false, "says": "The initial trigger value when rendered. Use when you don't need to control the trigger value."}, {"accepts": "\"ltr\" | \"rtl\"", "fallback": "\"ltr\"", "kind": "option", "name": "dir", "refers": [], "required": false, "says": "The document's text/writing direction."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "disabled", "refers": [], "required": false, "says": "Whether the tooltip is disabled"}, {"accepts": "(() => Document | Node | ShadowRoot)", "fallback": "", "kind": "option", "name": "getRootNode", "refers": [], "required": false, "says": "A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "id", "refers": [], "required": false, "says": "The unique identifier of the machine."}, {"accepts": "ElementIds", "fallback": "", "kind": "option", "name": "ids", "refers": ["tooltip.ElementIds"], "required": false, "says": "The ids of the elements in the tooltip. Useful for composition."}, {"accepts": "boolean", "fallback": "false", "kind": "option", "name": "interactive", "refers": [], "required": false, "says": "Whether the tooltip's content is interactive. In this mode, the tooltip will remain open when user hovers over the content."}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "lazyMount", "refers": [], "required": false, "says": "When true, the overlay renders no content until it first opens."}, {"accepts": "(() => void)", "fallback": "", "kind": "option", "name": "onExitComplete", "refers": [], "required": false, "says": "Runs once the content's exit animation ends."}, {"accepts": "((details: OpenChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onOpenChange", "refers": ["tooltip.OpenChangeDetails"], "required": false, "says": "Function called when the tooltip is opened."}, {"accepts": "((details: TriggerValueChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onTriggerValueChange", "refers": ["tooltip.TriggerValueChangeDetails"], "required": false, "says": "Function called when the trigger value changes."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "open", "refers": [], "required": false, "says": "The controlled open state of the tooltip"}, {"accepts": "number", "fallback": "400", "kind": "option", "name": "openDelay", "refers": [], "required": false, "says": "The open delay of the tooltip."}, {"accepts": "PositioningOptions", "fallback": "", "kind": "option", "name": "positioning", "refers": ["core.ComputePositionReturn", "dom.AutoUpdateOptions", "dom.VirtualElement", "popper.PositioningOptions", "utils.Placement"], "required": false, "says": "The user provided options used to position the popover content"}, {"accepts": "Scale", "fallback": "", "kind": "variant", "name": "size", "refers": ["kit.Scale"], "required": false, "says": "Padding of the content on the inset scale and its text on the label role."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "skipAnimationOnMount", "refers": [], "required": false, "says": "When true, content that is open on mount plays no entry animation."}, {"accepts": "string | null", "fallback": "", "kind": "option", "name": "triggerValue", "refers": [], "required": false, "says": "The controlled trigger value"}, {"accepts": "boolean", "fallback": "true", "kind": "option", "name": "unmountOnExit", "refers": [], "required": false, "says": "When true, the overlay removes its content once the exit animation ends."}, {"accepts": "\"inverted\" | \"surface\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Surface of the content: the inverted surface, or the popover surface inside a hairline edge."}], "TriggerProps": []};
|
|
3
|
+
export const shapes = {"kit.Scale": [{"accepts": "", "name": "\"2xl\"", "says": ""}, {"accepts": "", "name": "\"3xl\"", "says": ""}, {"accepts": "", "name": "\"4xl\"", "says": ""}, {"accepts": "", "name": "\"lg\"", "says": ""}, {"accepts": "", "name": "\"md\"", "says": ""}, {"accepts": "", "name": "\"sm\"", "says": ""}, {"accepts": "", "name": "\"xl\"", "says": ""}, {"accepts": "", "name": "\"xs\"", "says": ""}], "tooltip.ElementIds": [{"accepts": "string | ((value?: string) => string)", "name": "trigger", "says": ""}, {"accepts": "string", "name": "content", "says": ""}, {"accepts": "string", "name": "arrow", "says": ""}, {"accepts": "string", "name": "positioner", "says": ""}], "tooltip.OpenChangeDetails": [{"accepts": "boolean", "name": "open", "says": ""}], "popper.PositioningOptions": [{"accepts": "boolean", "name": "restoreStyles", "says": "Whether styles applied by the positioning utility should be restored on cleanup."}, {"accepts": "boolean", "name": "applyStyles", "says": "Whether to apply computed position styles (`--x`, `--y`, `--z-index`, `z-index`) to the floating element. Set to `false` when the consumer applies these from context (e.g. for exit animations)."}, {"accepts": "boolean", "name": "hideWhenDetached", "says": "Whether the popover should be hidden when the reference element is detached"}, {"accepts": "\"absolute\" | \"fixed\"", "name": "strategy", "says": "The strategy to use for positioning"}, {"accepts": "Placement", "name": "placement", "says": "The initial placement of the floating element"}, {"accepts": "{ mainAxis?: number; crossAxis?: number; }", "name": "offset", "says": "The offset of the floating element"}, {"accepts": "number", "name": "gutter", "says": "The main axis offset or gap between the reference and floating elements"}, {"accepts": "number", "name": "shift", "says": "The secondary axis offset or gap between the reference and floating elements"}, {"accepts": "number", "name": "overflowPadding", "says": "The virtual padding around the viewport edges to check for overflow"}, {"accepts": "number", "name": "arrowPadding", "says": "The minimum padding between the arrow and the floating element's corner."}, {"accepts": "boolean | Placement[]", "name": "flip", "says": "Whether to flip the placement"}, {"accepts": "boolean", "name": "slide", "says": "Whether the popover should slide when it overflows."}, {"accepts": "boolean", "name": "overlap", "says": "Whether the floating element can overlap the reference element"}, {"accepts": "boolean", "name": "sameWidth", "says": "Whether to make the floating element same width as the reference element"}, {"accepts": "boolean", "name": "fitViewport", "says": "Whether the popover should fit the viewport."}, {"accepts": "boolean", "name": "sizeMiddleware", "says": "Whether to use the size middleware from Floating UI. It computes and sets CSS variables (`--reference-width`, `--reference-height`, `--available-width`, `--available-height`) used by `sameWidth` and `fitViewport`."}, {"accepts": "\"clipping-ancestors\" | (() => Boundary) | Boundary", "name": "boundary", "says": "The overflow boundary of the reference element Accepts a function returning a Boundary, a Boundary directly, or the shorthand string 'clipping-ancestors' which maps to Floating UI's 'clippingAncestors'."}, {"accepts": "boolean | AutoUpdateOptions", "name": "listeners", "says": "Options to activate auto-update listeners"}, {"accepts": "((data: ComputePositionReturn) => void)", "name": "onComplete", "says": "Function called when the placement is computed"}, {"accepts": "((data: { placed: boolean; }) => void)", "name": "onPositioned", "says": "Function called when the floating element is positioned or not"}, {"accepts": "(() => HTMLElement | VirtualElement | null)", "name": "getAnchorElement", "says": "Function that returns the anchor element. Useful when you want to use a different element as the anchor."}, {"accepts": "((element: HTMLElement | VirtualElement | null) => AnchorRect | null)", "name": "getAnchorRect", "says": "Function that returns the anchor rect"}, {"accepts": "((data: { updatePosition: () => Promise<void>; floatingElement: HTMLElement | null; }) => void | Promise<void>)", "name": "updatePosition", "says": "A callback that will be called when the popover needs to calculate its position."}], "utils.Placement": [{"accepts": "", "name": "\"bottom\"", "says": ""}, {"accepts": "", "name": "\"bottom-end\"", "says": ""}, {"accepts": "", "name": "\"bottom-start\"", "says": ""}, {"accepts": "", "name": "\"left\"", "says": ""}, {"accepts": "", "name": "\"left-end\"", "says": ""}, {"accepts": "", "name": "\"left-start\"", "says": ""}, {"accepts": "", "name": "\"right\"", "says": ""}, {"accepts": "", "name": "\"right-end\"", "says": ""}, {"accepts": "", "name": "\"right-start\"", "says": ""}, {"accepts": "", "name": "\"top\"", "says": ""}, {"accepts": "", "name": "\"top-end\"", "says": ""}, {"accepts": "", "name": "\"top-start\"", "says": ""}], "dom.AutoUpdateOptions": [{"accepts": "boolean", "name": "ancestorScroll", "says": "Whether to update the position when an overflow ancestor is scrolled."}, {"accepts": "boolean", "name": "ancestorResize", "says": "Whether to update the position when an overflow ancestor is resized. This\r uses the native `resize` event."}, {"accepts": "boolean", "name": "elementResize", "says": "Whether to update the position when either the reference or floating\r elements resized. This uses a `ResizeObserver`."}, {"accepts": "boolean", "name": "layoutShift", "says": "Whether to update the position when the reference relocated on the screen\r due to layout shift."}, {"accepts": "boolean", "name": "animationFrame", "says": "Whether to update on every animation frame if necessary. Only use if you\r need to update the position in response to an animation using transforms."}], "core.ComputePositionReturn": [{"accepts": "Placement", "name": "placement", "says": "The final chosen placement of the floating element."}, {"accepts": "Strategy", "name": "strategy", "says": "The strategy used to position the floating element."}, {"accepts": "MiddlewareData", "name": "middlewareData", "says": "Object containing data returned from all middleware, keyed by their name."}, {"accepts": "number", "name": "x", "says": ""}, {"accepts": "number", "name": "y", "says": ""}], "dom.VirtualElement": [{"accepts": "() => { bottom: number; height: number; left: number; right: number; top: number; width: number; x: number; y: number; }", "name": "getBoundingClientRect", "says": ""}, {"accepts": "(() => { bottom: number; height: number; left: number; right: number; top: number; width: number; x: number; y: number; }[] | DOMRectList)", "name": "getClientRects", "says": ""}, {"accepts": "Element", "name": "contextElement", "says": ""}], "tooltip.TriggerValueChangeDetails": [{"accepts": "string | null", "name": "value", "says": "The value of the trigger"}, {"accepts": "HTMLElement | null", "name": "triggerElement", "says": "The trigger element"}]};
|