@ttoss/fsl-ui 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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/_virtual/_rolldown/runtime.cjs +30 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +129 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +61 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.mts +61 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +126 -0
- package/dist/components/Button/Button.cjs +80 -0
- package/dist/components/Button/Button.d.cts +68 -0
- package/dist/components/Button/Button.d.mts +68 -0
- package/dist/components/Button/Button.mjs +79 -0
- package/dist/components/Checkbox/Checkbox.cjs +183 -0
- package/dist/components/Checkbox/Checkbox.d.cts +45 -0
- package/dist/components/Checkbox/Checkbox.d.mts +45 -0
- package/dist/components/Checkbox/Checkbox.mjs +182 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +97 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.cts +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.mts +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.mjs +96 -0
- package/dist/components/FileTrigger/FileTrigger.cjs +51 -0
- package/dist/components/FileTrigger/FileTrigger.d.cts +52 -0
- package/dist/components/FileTrigger/FileTrigger.d.mts +52 -0
- package/dist/components/FileTrigger/FileTrigger.mjs +50 -0
- package/dist/components/GridList/GridList.cjs +220 -0
- package/dist/components/GridList/GridList.d.cts +72 -0
- package/dist/components/GridList/GridList.d.mts +72 -0
- package/dist/components/GridList/GridList.mjs +217 -0
- package/dist/components/Group/Group.cjs +77 -0
- package/dist/components/Group/Group.d.cts +61 -0
- package/dist/components/Group/Group.d.mts +61 -0
- package/dist/components/Group/Group.mjs +74 -0
- package/dist/components/Icon/Icon.cjs +52 -0
- package/dist/components/Icon/Icon.mjs +52 -0
- package/dist/components/Icon/glyphs.cjs +72 -0
- package/dist/components/Icon/glyphs.mjs +63 -0
- package/dist/components/Link/Link.cjs +62 -0
- package/dist/components/Link/Link.d.cts +38 -0
- package/dist/components/Link/Link.d.mts +38 -0
- package/dist/components/Link/Link.mjs +61 -0
- package/dist/components/ListBox/ListBox.cjs +126 -0
- package/dist/components/ListBox/ListBox.d.cts +63 -0
- package/dist/components/ListBox/ListBox.d.mts +63 -0
- package/dist/components/ListBox/ListBox.mjs +123 -0
- package/dist/components/Meter/Meter.cjs +126 -0
- package/dist/components/Meter/Meter.d.cts +63 -0
- package/dist/components/Meter/Meter.d.mts +63 -0
- package/dist/components/Meter/Meter.mjs +125 -0
- package/dist/components/NumberField/NumberField.cjs +221 -0
- package/dist/components/NumberField/NumberField.d.cts +68 -0
- package/dist/components/NumberField/NumberField.d.mts +68 -0
- package/dist/components/NumberField/NumberField.mjs +220 -0
- package/dist/components/ProgressBar/ProgressBar.cjs +132 -0
- package/dist/components/ProgressBar/ProgressBar.d.cts +56 -0
- package/dist/components/ProgressBar/ProgressBar.d.mts +56 -0
- package/dist/components/ProgressBar/ProgressBar.mjs +129 -0
- package/dist/components/RadioGroup/RadioGroup.cjs +218 -0
- package/dist/components/RadioGroup/RadioGroup.d.cts +82 -0
- package/dist/components/RadioGroup/RadioGroup.d.mts +82 -0
- package/dist/components/RadioGroup/RadioGroup.mjs +215 -0
- package/dist/components/Select/Select.cjs +253 -0
- package/dist/components/Select/Select.d.cts +86 -0
- package/dist/components/Select/Select.d.mts +86 -0
- package/dist/components/Select/Select.mjs +250 -0
- package/dist/components/Separator/Separator.cjs +64 -0
- package/dist/components/Separator/Separator.d.cts +44 -0
- package/dist/components/Separator/Separator.d.mts +44 -0
- package/dist/components/Separator/Separator.mjs +63 -0
- package/dist/components/Slider/Slider.cjs +160 -0
- package/dist/components/Slider/Slider.d.cts +45 -0
- package/dist/components/Slider/Slider.d.mts +45 -0
- package/dist/components/Slider/Slider.mjs +159 -0
- package/dist/components/Switch/Switch.cjs +176 -0
- package/dist/components/Switch/Switch.d.cts +43 -0
- package/dist/components/Switch/Switch.d.mts +43 -0
- package/dist/components/Switch/Switch.mjs +175 -0
- package/dist/components/Tabs/Tabs.cjs +180 -0
- package/dist/components/Tabs/Tabs.d.cts +85 -0
- package/dist/components/Tabs/Tabs.d.mts +85 -0
- package/dist/components/Tabs/Tabs.mjs +173 -0
- package/dist/components/Toast/Toast.cjs +218 -0
- package/dist/components/Toast/Toast.d.cts +96 -0
- package/dist/components/Toast/Toast.d.mts +96 -0
- package/dist/components/Toast/Toast.mjs +214 -0
- package/dist/components/ToggleButton/ToggleButton.cjs +125 -0
- package/dist/components/ToggleButton/ToggleButton.d.cts +43 -0
- package/dist/components/ToggleButton/ToggleButton.d.mts +43 -0
- package/dist/components/ToggleButton/ToggleButton.mjs +124 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +48 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.cts +41 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.mts +41 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +47 -0
- package/dist/components/Toolbar/Toolbar.cjs +67 -0
- package/dist/components/Toolbar/Toolbar.d.cts +60 -0
- package/dist/components/Toolbar/Toolbar.d.mts +60 -0
- package/dist/components/Toolbar/Toolbar.mjs +66 -0
- package/dist/composites/Accordion/Accordion.cjs +279 -0
- package/dist/composites/Accordion/Accordion.d.cts +176 -0
- package/dist/composites/Accordion/Accordion.d.mts +176 -0
- package/dist/composites/Accordion/Accordion.mjs +270 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.cjs +206 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.cts +166 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.mts +166 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.mjs +203 -0
- package/dist/composites/Dialog/Dialog.cjs +372 -0
- package/dist/composites/Dialog/Dialog.d.cts +234 -0
- package/dist/composites/Dialog/Dialog.d.mts +234 -0
- package/dist/composites/Dialog/Dialog.mjs +360 -0
- package/dist/composites/Disclosure/Disclosure.cjs +214 -0
- package/dist/composites/Disclosure/Disclosure.d.cts +118 -0
- package/dist/composites/Disclosure/Disclosure.d.mts +118 -0
- package/dist/composites/Disclosure/Disclosure.mjs +207 -0
- package/dist/composites/Form/Form.cjs +161 -0
- package/dist/composites/Form/Form.d.cts +176 -0
- package/dist/composites/Form/Form.d.mts +176 -0
- package/dist/composites/Form/Form.mjs +156 -0
- package/dist/composites/Menu/Menu.cjs +190 -0
- package/dist/composites/Menu/Menu.d.cts +158 -0
- package/dist/composites/Menu/Menu.d.mts +158 -0
- package/dist/composites/Menu/Menu.mjs +186 -0
- package/dist/composites/Popover/Popover.cjs +80 -0
- package/dist/composites/Popover/Popover.d.cts +56 -0
- package/dist/composites/Popover/Popover.d.mts +56 -0
- package/dist/composites/Popover/Popover.mjs +78 -0
- package/dist/composites/SearchField/SearchField.cjs +194 -0
- package/dist/composites/SearchField/SearchField.d.cts +81 -0
- package/dist/composites/SearchField/SearchField.d.mts +81 -0
- package/dist/composites/SearchField/SearchField.mjs +189 -0
- package/dist/composites/TagGroup/TagGroup.cjs +212 -0
- package/dist/composites/TagGroup/TagGroup.d.cts +84 -0
- package/dist/composites/TagGroup/TagGroup.d.mts +84 -0
- package/dist/composites/TagGroup/TagGroup.mjs +209 -0
- package/dist/composites/TextArea/TextArea.cjs +190 -0
- package/dist/composites/TextArea/TextArea.d.cts +95 -0
- package/dist/composites/TextArea/TextArea.d.mts +95 -0
- package/dist/composites/TextArea/TextArea.mjs +181 -0
- package/dist/composites/TextField/TextField.cjs +200 -0
- package/dist/composites/TextField/TextField.d.cts +111 -0
- package/dist/composites/TextField/TextField.d.mts +111 -0
- package/dist/composites/TextField/TextField.mjs +191 -0
- package/dist/composites/Tooltip/Tooltip.cjs +79 -0
- package/dist/composites/Tooltip/Tooltip.d.cts +53 -0
- package/dist/composites/Tooltip/Tooltip.d.mts +53 -0
- package/dist/composites/Tooltip/Tooltip.mjs +77 -0
- package/dist/composites/Wizard/Wizard.cjs +333 -0
- package/dist/composites/Wizard/Wizard.d.cts +206 -0
- package/dist/composites/Wizard/Wizard.d.mts +206 -0
- package/dist/composites/Wizard/Wizard.mjs +324 -0
- package/dist/composites/scope.cjs +124 -0
- package/dist/composites/scope.mjs +121 -0
- package/dist/index.cjs +186 -0
- package/dist/index.d.cts +37 -0
- package/dist/index.d.mts +37 -0
- package/dist/index.mjs +39 -0
- package/dist/semantics/componentMeta.d.cts +37 -0
- package/dist/semantics/componentMeta.d.mts +37 -0
- package/dist/semantics/index.cjs +16 -0
- package/dist/semantics/index.d.cts +4 -0
- package/dist/semantics/index.d.mts +4 -0
- package/dist/semantics/index.mjs +3 -0
- package/dist/semantics/taxonomy.cjs +150 -0
- package/dist/semantics/taxonomy.d.cts +153 -0
- package/dist/semantics/taxonomy.d.mts +153 -0
- package/dist/semantics/taxonomy.mjs +140 -0
- package/dist/tokens/escapeHatch.cjs +13 -0
- package/dist/tokens/escapeHatch.mjs +13 -0
- package/dist/tokens/focusRing.cjs +28 -0
- package/dist/tokens/focusRing.mjs +28 -0
- package/dist/tokens/keyframes.cjs +76 -0
- package/dist/tokens/keyframes.mjs +75 -0
- package/dist/tokens/resolveInteractiveStyle.cjs +41 -0
- package/dist/tokens/resolveInteractiveStyle.mjs +41 -0
- package/llms.txt +142 -0
- package/package.json +70 -0
- package/src/tokens/CONTRACT.md +505 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
const require_focusRing = require('../../tokens/focusRing.cjs');
|
|
3
|
+
const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
|
|
4
|
+
const require_scope = require('../scope.cjs');
|
|
5
|
+
const require_escapeHatch = require('../../tokens/escapeHatch.cjs');
|
|
6
|
+
let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
|
|
7
|
+
let react_aria_components = require("react-aria-components");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
|
|
10
|
+
//#region src/composites/Menu/Menu.tsx
|
|
11
|
+
var MENU_MIN_WIDTH_DEFAULT = "12rem";
|
|
12
|
+
var MENU_MAX_WIDTH_DEFAULT = "min(320px, 90vw)";
|
|
13
|
+
var MENU_OFFSET_DEFAULT = 4;
|
|
14
|
+
var menuScope = require_scope.createPresenceScope("Menu");
|
|
15
|
+
/**
|
|
16
|
+
* Orchestrates open/close state between a trigger and a Menu.
|
|
17
|
+
* Pure pass-through to React Aria — no semantic tokens applied.
|
|
18
|
+
*/
|
|
19
|
+
var MenuTrigger = props => {
|
|
20
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.MenuTrigger, {
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
MenuTrigger.displayName = "MenuTrigger";
|
|
25
|
+
/**
|
|
26
|
+
* Formal semantic identity — what this component *is* (Layer 1).
|
|
27
|
+
*
|
|
28
|
+
* Entity = Overlay → CONTRACT.md §1 row:
|
|
29
|
+
* colors: `informational`, radii: `surface`, border: `outline.surface`,
|
|
30
|
+
* spacing: `inset.surface`, typography: `label`, motion: `transition`,
|
|
31
|
+
* elevation: `overlay`.
|
|
32
|
+
*/
|
|
33
|
+
var menuMeta = {
|
|
34
|
+
displayName: "Menu",
|
|
35
|
+
entity: "Overlay",
|
|
36
|
+
structure: "root"
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A semantic menu built on React Aria.
|
|
40
|
+
*
|
|
41
|
+
* Renders an anchored popover containing a keyboard-navigable list of
|
|
42
|
+
* {@link MenuItem} children. Must be placed inside a {@link MenuTrigger}.
|
|
43
|
+
*
|
|
44
|
+
* Entity = Overlay → `vars.colors.informational[evaluation].*`,
|
|
45
|
+
* `vars.radii.surface`, `vars.spacing.inset.surface.md`,
|
|
46
|
+
* `vars.elevation.surface.overlay`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <MenuTrigger>
|
|
51
|
+
* <Button>Open</Button>
|
|
52
|
+
* <Menu>
|
|
53
|
+
* <MenuItem>Edit</MenuItem>
|
|
54
|
+
* <MenuItem consequence="destructive">Delete</MenuItem>
|
|
55
|
+
* </Menu>
|
|
56
|
+
* </MenuTrigger>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
var Menu = ({
|
|
60
|
+
evaluation = "primary",
|
|
61
|
+
placement = "bottom start",
|
|
62
|
+
offset = MENU_OFFSET_DEFAULT,
|
|
63
|
+
crossOffset,
|
|
64
|
+
shouldFlip,
|
|
65
|
+
containerPadding,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
const colors = _ttoss_fsl_theme_vars.vars.colors.informational[evaluation];
|
|
70
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(menuScope.Provider, {
|
|
71
|
+
children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Popover, {
|
|
72
|
+
placement,
|
|
73
|
+
offset,
|
|
74
|
+
crossOffset,
|
|
75
|
+
shouldFlip,
|
|
76
|
+
containerPadding,
|
|
77
|
+
"data-scope": "menu",
|
|
78
|
+
"data-part": "root",
|
|
79
|
+
"data-evaluation": evaluation,
|
|
80
|
+
style: {
|
|
81
|
+
boxSizing: "border-box",
|
|
82
|
+
minWidth: require_escapeHatch.fslVar("--fsl-menu-min-width", MENU_MIN_WIDTH_DEFAULT),
|
|
83
|
+
maxWidth: require_escapeHatch.fslVar("--fsl-menu-max-width", MENU_MAX_WIDTH_DEFAULT),
|
|
84
|
+
borderRadius: _ttoss_fsl_theme_vars.vars.radii.surface,
|
|
85
|
+
borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.surface.width,
|
|
86
|
+
borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.surface.style,
|
|
87
|
+
borderColor: colors?.border?.default,
|
|
88
|
+
backgroundColor: colors?.background?.default,
|
|
89
|
+
color: colors?.text?.default,
|
|
90
|
+
boxShadow: _ttoss_fsl_theme_vars.vars.elevation.surface.overlay,
|
|
91
|
+
outline: "none",
|
|
92
|
+
overflow: "auto",
|
|
93
|
+
zIndex: _ttoss_fsl_theme_vars.vars.zIndex.layer.overlay
|
|
94
|
+
},
|
|
95
|
+
children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Menu, {
|
|
96
|
+
...props,
|
|
97
|
+
"data-scope": "menu",
|
|
98
|
+
"data-part": "content",
|
|
99
|
+
"data-evaluation": evaluation,
|
|
100
|
+
style: {
|
|
101
|
+
boxSizing: "border-box",
|
|
102
|
+
outline: "none",
|
|
103
|
+
padding: _ttoss_fsl_theme_vars.vars.spacing.inset.surface.sm,
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
..._ttoss_fsl_theme_vars.vars.text.label.md
|
|
107
|
+
},
|
|
108
|
+
children
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
Menu.displayName = menuMeta.displayName;
|
|
114
|
+
/**
|
|
115
|
+
* Formal semantic identity — a single menu action (Layer 1).
|
|
116
|
+
*
|
|
117
|
+
* Entity = Action. Structure is `root` — a MenuItem is the root of its own
|
|
118
|
+
* Action identity, nested inside the menu's `data-scope="menu"`.
|
|
119
|
+
*/
|
|
120
|
+
var menuItemMeta = {
|
|
121
|
+
displayName: "MenuItem",
|
|
122
|
+
entity: "Action",
|
|
123
|
+
structure: "root"
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* An actionable item inside a {@link Menu}.
|
|
127
|
+
*
|
|
128
|
+
* Entity = Action → `vars.colors.action[evaluation].*`, `vars.radii.control`,
|
|
129
|
+
* `vars.spacing.inset.control.sm`, `vars.text.label.md`, `vars.motion.feedback`.
|
|
130
|
+
*/
|
|
131
|
+
var MenuItem = ({
|
|
132
|
+
evaluation = "primary",
|
|
133
|
+
consequence = "neutral",
|
|
134
|
+
composition,
|
|
135
|
+
children,
|
|
136
|
+
...props
|
|
137
|
+
}) => {
|
|
138
|
+
menuScope.use(menuItemMeta.displayName);
|
|
139
|
+
const colors = _ttoss_fsl_theme_vars.vars.colors.action[evaluation];
|
|
140
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.MenuItem, {
|
|
141
|
+
...props,
|
|
142
|
+
"data-scope": "menu",
|
|
143
|
+
"data-part": "root",
|
|
144
|
+
"data-evaluation": evaluation,
|
|
145
|
+
"data-consequence": consequence,
|
|
146
|
+
"data-composition": composition,
|
|
147
|
+
style: ({
|
|
148
|
+
isHovered,
|
|
149
|
+
isPressed,
|
|
150
|
+
isDisabled,
|
|
151
|
+
isFocusVisible
|
|
152
|
+
}) => {
|
|
153
|
+
return {
|
|
154
|
+
boxSizing: "border-box",
|
|
155
|
+
display: "flex",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
158
|
+
borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
|
|
159
|
+
minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
|
|
160
|
+
paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
|
|
161
|
+
paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
|
|
162
|
+
..._ttoss_fsl_theme_vars.vars.text.label.md,
|
|
163
|
+
transitionDuration: _ttoss_fsl_theme_vars.vars.motion.feedback.duration,
|
|
164
|
+
transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.feedback.easing,
|
|
165
|
+
transitionProperty: "background-color, color",
|
|
166
|
+
backgroundColor: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.background, {
|
|
167
|
+
isHovered,
|
|
168
|
+
isPressed,
|
|
169
|
+
isDisabled
|
|
170
|
+
}),
|
|
171
|
+
color: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.text, {
|
|
172
|
+
isHovered,
|
|
173
|
+
isPressed,
|
|
174
|
+
isDisabled
|
|
175
|
+
}) ?? colors?.text?.default,
|
|
176
|
+
outline: require_focusRing.focusRingOutline(isFocusVisible),
|
|
177
|
+
outlineOffset: "-1px"
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
children
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
MenuItem.displayName = menuItemMeta.displayName;
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
exports.Menu = Menu;
|
|
187
|
+
exports.MenuItem = MenuItem;
|
|
188
|
+
exports.MenuTrigger = MenuTrigger;
|
|
189
|
+
exports.menuItemMeta = menuItemMeta;
|
|
190
|
+
exports.menuMeta = menuMeta;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
|
|
2
|
+
import { CompositionsFor, ConsequencesFor, EvaluationsFor } from "../../semantics/taxonomy.cjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { MenuItemProps, MenuProps, MenuTriggerProps, PopoverProps } from "react-aria-components";
|
|
5
|
+
|
|
6
|
+
//#region src/composites/Menu/Menu.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Orchestrates open/close state between a trigger and a Menu.
|
|
9
|
+
* Pure pass-through to React Aria — no semantic tokens applied.
|
|
10
|
+
*/
|
|
11
|
+
declare const MenuTrigger: {
|
|
12
|
+
(props: MenuTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Formal semantic identity — what this component *is* (Layer 1).
|
|
17
|
+
*
|
|
18
|
+
* Entity = Overlay → CONTRACT.md §1 row:
|
|
19
|
+
* colors: `informational`, radii: `surface`, border: `outline.surface`,
|
|
20
|
+
* spacing: `inset.surface`, typography: `label`, motion: `transition`,
|
|
21
|
+
* elevation: `overlay`.
|
|
22
|
+
*/
|
|
23
|
+
declare const menuMeta: {
|
|
24
|
+
readonly displayName: "Menu";
|
|
25
|
+
readonly entity: "Overlay";
|
|
26
|
+
readonly structure: "root";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Props for the Menu component.
|
|
30
|
+
*
|
|
31
|
+
* The composite owns its layout; pass `style`/`className` on a wrapping
|
|
32
|
+
* element rather than on the composite root. See CONTRIBUTING §4.
|
|
33
|
+
*/
|
|
34
|
+
interface MenuProps$1<T extends object> extends Omit<MenuProps<T>, 'style' | 'className'> {
|
|
35
|
+
/**
|
|
36
|
+
* Semantic emphasis for the overlay surface.
|
|
37
|
+
* @default 'primary'
|
|
38
|
+
*/
|
|
39
|
+
evaluation?: EvaluationsFor<(typeof menuMeta)['entity']>;
|
|
40
|
+
/**
|
|
41
|
+
* Popover placement relative to the trigger.
|
|
42
|
+
*/
|
|
43
|
+
placement?: PopoverProps['placement'];
|
|
44
|
+
/**
|
|
45
|
+
* Popover offset (px) from the trigger.
|
|
46
|
+
*/
|
|
47
|
+
offset?: PopoverProps['offset'];
|
|
48
|
+
/**
|
|
49
|
+
* Popover offset (px) along the cross axis of `placement`.
|
|
50
|
+
*/
|
|
51
|
+
crossOffset?: PopoverProps['crossOffset'];
|
|
52
|
+
/**
|
|
53
|
+
* Whether the popover flips to the opposite side when it would overflow
|
|
54
|
+
* the viewport.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
shouldFlip?: PopoverProps['shouldFlip'];
|
|
58
|
+
/**
|
|
59
|
+
* Minimum distance (px) the popover keeps from the viewport edges when
|
|
60
|
+
* positioning.
|
|
61
|
+
*/
|
|
62
|
+
containerPadding?: PopoverProps['containerPadding'];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A semantic menu built on React Aria.
|
|
66
|
+
*
|
|
67
|
+
* Renders an anchored popover containing a keyboard-navigable list of
|
|
68
|
+
* {@link MenuItem} children. Must be placed inside a {@link MenuTrigger}.
|
|
69
|
+
*
|
|
70
|
+
* Entity = Overlay → `vars.colors.informational[evaluation].*`,
|
|
71
|
+
* `vars.radii.surface`, `vars.spacing.inset.surface.md`,
|
|
72
|
+
* `vars.elevation.surface.overlay`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <MenuTrigger>
|
|
77
|
+
* <Button>Open</Button>
|
|
78
|
+
* <Menu>
|
|
79
|
+
* <MenuItem>Edit</MenuItem>
|
|
80
|
+
* <MenuItem consequence="destructive">Delete</MenuItem>
|
|
81
|
+
* </Menu>
|
|
82
|
+
* </MenuTrigger>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare const Menu: {
|
|
86
|
+
<T extends object>({
|
|
87
|
+
evaluation,
|
|
88
|
+
placement,
|
|
89
|
+
offset,
|
|
90
|
+
crossOffset,
|
|
91
|
+
shouldFlip,
|
|
92
|
+
containerPadding,
|
|
93
|
+
children,
|
|
94
|
+
...props
|
|
95
|
+
}: MenuProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
displayName: "Menu";
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Formal semantic identity — a single menu action (Layer 1).
|
|
100
|
+
*
|
|
101
|
+
* Entity = Action. Structure is `root` — a MenuItem is the root of its own
|
|
102
|
+
* Action identity, nested inside the menu's `data-scope="menu"`.
|
|
103
|
+
*/
|
|
104
|
+
declare const menuItemMeta: {
|
|
105
|
+
readonly displayName: "MenuItem";
|
|
106
|
+
readonly entity: "Action";
|
|
107
|
+
readonly structure: "root";
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Props for the MenuItem component.
|
|
111
|
+
*/
|
|
112
|
+
interface MenuItemProps$1 extends Omit<MenuItemProps, 'style' | 'children' | 'className'> {
|
|
113
|
+
/**
|
|
114
|
+
* Semantic emphasis for the item.
|
|
115
|
+
* @default 'primary'
|
|
116
|
+
*/
|
|
117
|
+
evaluation?: EvaluationsFor<(typeof menuItemMeta)['entity']>;
|
|
118
|
+
/**
|
|
119
|
+
* Effect on state that activating this item produces.
|
|
120
|
+
*
|
|
121
|
+
* Emitted as `data-consequence` on the rendered element so callers, tests,
|
|
122
|
+
* and host integrations (confirm wrappers, telemetry) can observe the
|
|
123
|
+
* contract. This component does **not** alter colors based on consequence;
|
|
124
|
+
* visual distinction (if any) is a theme / CSS layer concern.
|
|
125
|
+
*
|
|
126
|
+
* @default 'neutral'
|
|
127
|
+
*/
|
|
128
|
+
consequence?: ConsequencesFor<(typeof menuItemMeta)['entity']>;
|
|
129
|
+
/**
|
|
130
|
+
* Optional composition slot when this item plays a named role inside the
|
|
131
|
+
* parent Menu (e.g. `primaryAction`, `dismissAction`). Emitted as
|
|
132
|
+
* `data-composition` so parents can target it with layout CSS (ordering,
|
|
133
|
+
* separation).
|
|
134
|
+
*/
|
|
135
|
+
composition?: CompositionsFor<(typeof menuItemMeta)['entity']>;
|
|
136
|
+
/**
|
|
137
|
+
* Item content.
|
|
138
|
+
*/
|
|
139
|
+
children?: React.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* An actionable item inside a {@link Menu}.
|
|
143
|
+
*
|
|
144
|
+
* Entity = Action → `vars.colors.action[evaluation].*`, `vars.radii.control`,
|
|
145
|
+
* `vars.spacing.inset.control.sm`, `vars.text.label.md`, `vars.motion.feedback`.
|
|
146
|
+
*/
|
|
147
|
+
declare const MenuItem: {
|
|
148
|
+
({
|
|
149
|
+
evaluation,
|
|
150
|
+
consequence,
|
|
151
|
+
composition,
|
|
152
|
+
children,
|
|
153
|
+
...props
|
|
154
|
+
}: MenuItemProps$1): import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
displayName: "MenuItem";
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { Menu, MenuItem, MenuItemProps$1 as MenuItemProps, MenuProps$1 as MenuProps, MenuTrigger, menuItemMeta, menuMeta };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
|
|
2
|
+
import { CompositionsFor, ConsequencesFor, EvaluationsFor } from "../../semantics/taxonomy.mjs";
|
|
3
|
+
import { MenuItemProps, MenuProps, MenuTriggerProps, PopoverProps } from "react-aria-components";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/composites/Menu/Menu.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Orchestrates open/close state between a trigger and a Menu.
|
|
9
|
+
* Pure pass-through to React Aria — no semantic tokens applied.
|
|
10
|
+
*/
|
|
11
|
+
declare const MenuTrigger$1: {
|
|
12
|
+
(props: MenuTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Formal semantic identity — what this component *is* (Layer 1).
|
|
17
|
+
*
|
|
18
|
+
* Entity = Overlay → CONTRACT.md §1 row:
|
|
19
|
+
* colors: `informational`, radii: `surface`, border: `outline.surface`,
|
|
20
|
+
* spacing: `inset.surface`, typography: `label`, motion: `transition`,
|
|
21
|
+
* elevation: `overlay`.
|
|
22
|
+
*/
|
|
23
|
+
declare const menuMeta: {
|
|
24
|
+
readonly displayName: "Menu";
|
|
25
|
+
readonly entity: "Overlay";
|
|
26
|
+
readonly structure: "root";
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Props for the Menu component.
|
|
30
|
+
*
|
|
31
|
+
* The composite owns its layout; pass `style`/`className` on a wrapping
|
|
32
|
+
* element rather than on the composite root. See CONTRIBUTING §4.
|
|
33
|
+
*/
|
|
34
|
+
interface MenuProps$1<T extends object> extends Omit<MenuProps<T>, 'style' | 'className'> {
|
|
35
|
+
/**
|
|
36
|
+
* Semantic emphasis for the overlay surface.
|
|
37
|
+
* @default 'primary'
|
|
38
|
+
*/
|
|
39
|
+
evaluation?: EvaluationsFor<(typeof menuMeta)['entity']>;
|
|
40
|
+
/**
|
|
41
|
+
* Popover placement relative to the trigger.
|
|
42
|
+
*/
|
|
43
|
+
placement?: PopoverProps['placement'];
|
|
44
|
+
/**
|
|
45
|
+
* Popover offset (px) from the trigger.
|
|
46
|
+
*/
|
|
47
|
+
offset?: PopoverProps['offset'];
|
|
48
|
+
/**
|
|
49
|
+
* Popover offset (px) along the cross axis of `placement`.
|
|
50
|
+
*/
|
|
51
|
+
crossOffset?: PopoverProps['crossOffset'];
|
|
52
|
+
/**
|
|
53
|
+
* Whether the popover flips to the opposite side when it would overflow
|
|
54
|
+
* the viewport.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
shouldFlip?: PopoverProps['shouldFlip'];
|
|
58
|
+
/**
|
|
59
|
+
* Minimum distance (px) the popover keeps from the viewport edges when
|
|
60
|
+
* positioning.
|
|
61
|
+
*/
|
|
62
|
+
containerPadding?: PopoverProps['containerPadding'];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A semantic menu built on React Aria.
|
|
66
|
+
*
|
|
67
|
+
* Renders an anchored popover containing a keyboard-navigable list of
|
|
68
|
+
* {@link MenuItem} children. Must be placed inside a {@link MenuTrigger}.
|
|
69
|
+
*
|
|
70
|
+
* Entity = Overlay → `vars.colors.informational[evaluation].*`,
|
|
71
|
+
* `vars.radii.surface`, `vars.spacing.inset.surface.md`,
|
|
72
|
+
* `vars.elevation.surface.overlay`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <MenuTrigger>
|
|
77
|
+
* <Button>Open</Button>
|
|
78
|
+
* <Menu>
|
|
79
|
+
* <MenuItem>Edit</MenuItem>
|
|
80
|
+
* <MenuItem consequence="destructive">Delete</MenuItem>
|
|
81
|
+
* </Menu>
|
|
82
|
+
* </MenuTrigger>
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
declare const Menu$1: {
|
|
86
|
+
<T extends object>({
|
|
87
|
+
evaluation,
|
|
88
|
+
placement,
|
|
89
|
+
offset,
|
|
90
|
+
crossOffset,
|
|
91
|
+
shouldFlip,
|
|
92
|
+
containerPadding,
|
|
93
|
+
children,
|
|
94
|
+
...props
|
|
95
|
+
}: MenuProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
displayName: "Menu";
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Formal semantic identity — a single menu action (Layer 1).
|
|
100
|
+
*
|
|
101
|
+
* Entity = Action. Structure is `root` — a MenuItem is the root of its own
|
|
102
|
+
* Action identity, nested inside the menu's `data-scope="menu"`.
|
|
103
|
+
*/
|
|
104
|
+
declare const menuItemMeta: {
|
|
105
|
+
readonly displayName: "MenuItem";
|
|
106
|
+
readonly entity: "Action";
|
|
107
|
+
readonly structure: "root";
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Props for the MenuItem component.
|
|
111
|
+
*/
|
|
112
|
+
interface MenuItemProps$1 extends Omit<MenuItemProps, 'style' | 'children' | 'className'> {
|
|
113
|
+
/**
|
|
114
|
+
* Semantic emphasis for the item.
|
|
115
|
+
* @default 'primary'
|
|
116
|
+
*/
|
|
117
|
+
evaluation?: EvaluationsFor<(typeof menuItemMeta)['entity']>;
|
|
118
|
+
/**
|
|
119
|
+
* Effect on state that activating this item produces.
|
|
120
|
+
*
|
|
121
|
+
* Emitted as `data-consequence` on the rendered element so callers, tests,
|
|
122
|
+
* and host integrations (confirm wrappers, telemetry) can observe the
|
|
123
|
+
* contract. This component does **not** alter colors based on consequence;
|
|
124
|
+
* visual distinction (if any) is a theme / CSS layer concern.
|
|
125
|
+
*
|
|
126
|
+
* @default 'neutral'
|
|
127
|
+
*/
|
|
128
|
+
consequence?: ConsequencesFor<(typeof menuItemMeta)['entity']>;
|
|
129
|
+
/**
|
|
130
|
+
* Optional composition slot when this item plays a named role inside the
|
|
131
|
+
* parent Menu (e.g. `primaryAction`, `dismissAction`). Emitted as
|
|
132
|
+
* `data-composition` so parents can target it with layout CSS (ordering,
|
|
133
|
+
* separation).
|
|
134
|
+
*/
|
|
135
|
+
composition?: CompositionsFor<(typeof menuItemMeta)['entity']>;
|
|
136
|
+
/**
|
|
137
|
+
* Item content.
|
|
138
|
+
*/
|
|
139
|
+
children?: React.ReactNode;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* An actionable item inside a {@link Menu}.
|
|
143
|
+
*
|
|
144
|
+
* Entity = Action → `vars.colors.action[evaluation].*`, `vars.radii.control`,
|
|
145
|
+
* `vars.spacing.inset.control.sm`, `vars.text.label.md`, `vars.motion.feedback`.
|
|
146
|
+
*/
|
|
147
|
+
declare const MenuItem$1: {
|
|
148
|
+
({
|
|
149
|
+
evaluation,
|
|
150
|
+
consequence,
|
|
151
|
+
composition,
|
|
152
|
+
children,
|
|
153
|
+
...props
|
|
154
|
+
}: MenuItemProps$1): import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
displayName: "MenuItem";
|
|
156
|
+
};
|
|
157
|
+
//#endregion
|
|
158
|
+
export { Menu$1 as Menu, MenuItem$1 as MenuItem, MenuItemProps$1 as MenuItemProps, MenuProps$1 as MenuProps, MenuTrigger$1 as MenuTrigger, menuItemMeta, menuMeta };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { focusRingOutline } from "../../tokens/focusRing.mjs";
|
|
3
|
+
import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
|
|
4
|
+
import { createPresenceScope } from "../scope.mjs";
|
|
5
|
+
import { fslVar } from "../../tokens/escapeHatch.mjs";
|
|
6
|
+
import { vars } from "@ttoss/fsl-theme/vars";
|
|
7
|
+
import { Menu, MenuItem, MenuTrigger, Popover } from "react-aria-components";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/composites/Menu/Menu.tsx
|
|
11
|
+
var MENU_MIN_WIDTH_DEFAULT = "12rem";
|
|
12
|
+
var MENU_MAX_WIDTH_DEFAULT = "min(320px, 90vw)";
|
|
13
|
+
var MENU_OFFSET_DEFAULT = 4;
|
|
14
|
+
var menuScope = createPresenceScope("Menu");
|
|
15
|
+
/**
|
|
16
|
+
* Orchestrates open/close state between a trigger and a Menu.
|
|
17
|
+
* Pure pass-through to React Aria — no semantic tokens applied.
|
|
18
|
+
*/
|
|
19
|
+
var MenuTrigger$1 = props => {
|
|
20
|
+
return /* @__PURE__ */jsx(MenuTrigger, {
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
MenuTrigger$1.displayName = "MenuTrigger";
|
|
25
|
+
/**
|
|
26
|
+
* Formal semantic identity — what this component *is* (Layer 1).
|
|
27
|
+
*
|
|
28
|
+
* Entity = Overlay → CONTRACT.md §1 row:
|
|
29
|
+
* colors: `informational`, radii: `surface`, border: `outline.surface`,
|
|
30
|
+
* spacing: `inset.surface`, typography: `label`, motion: `transition`,
|
|
31
|
+
* elevation: `overlay`.
|
|
32
|
+
*/
|
|
33
|
+
var menuMeta = {
|
|
34
|
+
displayName: "Menu",
|
|
35
|
+
entity: "Overlay",
|
|
36
|
+
structure: "root"
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A semantic menu built on React Aria.
|
|
40
|
+
*
|
|
41
|
+
* Renders an anchored popover containing a keyboard-navigable list of
|
|
42
|
+
* {@link MenuItem} children. Must be placed inside a {@link MenuTrigger}.
|
|
43
|
+
*
|
|
44
|
+
* Entity = Overlay → `vars.colors.informational[evaluation].*`,
|
|
45
|
+
* `vars.radii.surface`, `vars.spacing.inset.surface.md`,
|
|
46
|
+
* `vars.elevation.surface.overlay`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <MenuTrigger>
|
|
51
|
+
* <Button>Open</Button>
|
|
52
|
+
* <Menu>
|
|
53
|
+
* <MenuItem>Edit</MenuItem>
|
|
54
|
+
* <MenuItem consequence="destructive">Delete</MenuItem>
|
|
55
|
+
* </Menu>
|
|
56
|
+
* </MenuTrigger>
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
var Menu$1 = ({
|
|
60
|
+
evaluation = "primary",
|
|
61
|
+
placement = "bottom start",
|
|
62
|
+
offset = MENU_OFFSET_DEFAULT,
|
|
63
|
+
crossOffset,
|
|
64
|
+
shouldFlip,
|
|
65
|
+
containerPadding,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
const colors = vars.colors.informational[evaluation];
|
|
70
|
+
return /* @__PURE__ */jsx(menuScope.Provider, {
|
|
71
|
+
children: /* @__PURE__ */jsx(Popover, {
|
|
72
|
+
placement,
|
|
73
|
+
offset,
|
|
74
|
+
crossOffset,
|
|
75
|
+
shouldFlip,
|
|
76
|
+
containerPadding,
|
|
77
|
+
"data-scope": "menu",
|
|
78
|
+
"data-part": "root",
|
|
79
|
+
"data-evaluation": evaluation,
|
|
80
|
+
style: {
|
|
81
|
+
boxSizing: "border-box",
|
|
82
|
+
minWidth: fslVar("--fsl-menu-min-width", MENU_MIN_WIDTH_DEFAULT),
|
|
83
|
+
maxWidth: fslVar("--fsl-menu-max-width", MENU_MAX_WIDTH_DEFAULT),
|
|
84
|
+
borderRadius: vars.radii.surface,
|
|
85
|
+
borderWidth: vars.border.outline.surface.width,
|
|
86
|
+
borderStyle: vars.border.outline.surface.style,
|
|
87
|
+
borderColor: colors?.border?.default,
|
|
88
|
+
backgroundColor: colors?.background?.default,
|
|
89
|
+
color: colors?.text?.default,
|
|
90
|
+
boxShadow: vars.elevation.surface.overlay,
|
|
91
|
+
outline: "none",
|
|
92
|
+
overflow: "auto",
|
|
93
|
+
zIndex: vars.zIndex.layer.overlay
|
|
94
|
+
},
|
|
95
|
+
children: /* @__PURE__ */jsx(Menu, {
|
|
96
|
+
...props,
|
|
97
|
+
"data-scope": "menu",
|
|
98
|
+
"data-part": "content",
|
|
99
|
+
"data-evaluation": evaluation,
|
|
100
|
+
style: {
|
|
101
|
+
boxSizing: "border-box",
|
|
102
|
+
outline: "none",
|
|
103
|
+
padding: vars.spacing.inset.surface.sm,
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "column",
|
|
106
|
+
...vars.text.label.md
|
|
107
|
+
},
|
|
108
|
+
children
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
Menu$1.displayName = menuMeta.displayName;
|
|
114
|
+
/**
|
|
115
|
+
* Formal semantic identity — a single menu action (Layer 1).
|
|
116
|
+
*
|
|
117
|
+
* Entity = Action. Structure is `root` — a MenuItem is the root of its own
|
|
118
|
+
* Action identity, nested inside the menu's `data-scope="menu"`.
|
|
119
|
+
*/
|
|
120
|
+
var menuItemMeta = {
|
|
121
|
+
displayName: "MenuItem",
|
|
122
|
+
entity: "Action",
|
|
123
|
+
structure: "root"
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* An actionable item inside a {@link Menu}.
|
|
127
|
+
*
|
|
128
|
+
* Entity = Action → `vars.colors.action[evaluation].*`, `vars.radii.control`,
|
|
129
|
+
* `vars.spacing.inset.control.sm`, `vars.text.label.md`, `vars.motion.feedback`.
|
|
130
|
+
*/
|
|
131
|
+
var MenuItem$1 = ({
|
|
132
|
+
evaluation = "primary",
|
|
133
|
+
consequence = "neutral",
|
|
134
|
+
composition,
|
|
135
|
+
children,
|
|
136
|
+
...props
|
|
137
|
+
}) => {
|
|
138
|
+
menuScope.use(menuItemMeta.displayName);
|
|
139
|
+
const colors = vars.colors.action[evaluation];
|
|
140
|
+
return /* @__PURE__ */jsx(MenuItem, {
|
|
141
|
+
...props,
|
|
142
|
+
"data-scope": "menu",
|
|
143
|
+
"data-part": "root",
|
|
144
|
+
"data-evaluation": evaluation,
|
|
145
|
+
"data-consequence": consequence,
|
|
146
|
+
"data-composition": composition,
|
|
147
|
+
style: ({
|
|
148
|
+
isHovered,
|
|
149
|
+
isPressed,
|
|
150
|
+
isDisabled,
|
|
151
|
+
isFocusVisible
|
|
152
|
+
}) => {
|
|
153
|
+
return {
|
|
154
|
+
boxSizing: "border-box",
|
|
155
|
+
display: "flex",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
158
|
+
borderRadius: vars.radii.control,
|
|
159
|
+
minHeight: vars.sizing.hit.base,
|
|
160
|
+
paddingBlock: vars.spacing.inset.control.sm,
|
|
161
|
+
paddingInline: vars.spacing.inset.control.md,
|
|
162
|
+
...vars.text.label.md,
|
|
163
|
+
transitionDuration: vars.motion.feedback.duration,
|
|
164
|
+
transitionTimingFunction: vars.motion.feedback.easing,
|
|
165
|
+
transitionProperty: "background-color, color",
|
|
166
|
+
backgroundColor: resolveInteractiveStyle(colors?.background, {
|
|
167
|
+
isHovered,
|
|
168
|
+
isPressed,
|
|
169
|
+
isDisabled
|
|
170
|
+
}),
|
|
171
|
+
color: resolveInteractiveStyle(colors?.text, {
|
|
172
|
+
isHovered,
|
|
173
|
+
isPressed,
|
|
174
|
+
isDisabled
|
|
175
|
+
}) ?? colors?.text?.default,
|
|
176
|
+
outline: focusRingOutline(isFocusVisible),
|
|
177
|
+
outlineOffset: "-1px"
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
children
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
MenuItem$1.displayName = menuItemMeta.displayName;
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
export { Menu$1 as Menu, MenuItem$1 as MenuItem, MenuTrigger$1 as MenuTrigger, menuItemMeta, menuMeta };
|