@bug-on/md3-react 2.0.3 → 3.0.0
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/.turbo/turbo-build.log +33 -0
- package/CHANGELOG.md +55 -0
- package/dist/index.css.d.ts +2 -0
- package/dist/index.d.mts +6127 -0
- package/dist/index.d.ts +6127 -71
- package/dist/index.js +1653 -614
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1566 -547
- package/dist/index.mjs.map +1 -1
- package/dist/material-symbols-cdn.css.d.ts +2 -0
- package/dist/material-symbols-self-hosted.css.d.ts +2 -0
- package/dist/typography.css.d.ts +2 -0
- package/package.json +22 -19
- package/scripts/copy-assets.js +82 -0
- package/src/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
- package/src/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/loading-indicator.svg +19 -0
- package/src/assets/material-symbols-cdn.css +65 -0
- package/src/assets/material-symbols-self-hosted.css +90 -0
- package/src/css.d.ts +20 -0
- package/src/hooks/useClickOutside.ts +37 -0
- package/src/hooks/useMediaQuery.ts +28 -0
- package/src/hooks/useRipple.ts +88 -0
- package/src/index.css +23 -0
- package/src/index.ts +349 -0
- package/src/lib/material-symbols-preconnect.tsx +82 -0
- package/src/lib/theme-utils.ts +180 -0
- package/src/lib/utils.ts +6 -0
- package/src/test/button.test.tsx +59 -0
- package/src/test/icon.test.tsx +91 -0
- package/src/test/loading-indicator.test.tsx +128 -0
- package/src/test/progress-indicator.test.tsx +306 -0
- package/src/test/setup.ts +80 -0
- package/src/test/typography.test.tsx +206 -0
- package/src/types/index.ts +7 -0
- package/src/types/md3.ts +31 -0
- package/src/ui/Text.tsx +60 -0
- package/src/ui/__snapshots__/divider.test.tsx.snap +63 -0
- package/src/ui/app-bar/app-bar-column.tsx +99 -0
- package/src/ui/app-bar/app-bar-item-button.tsx +71 -0
- package/src/ui/app-bar/app-bar-items.test.tsx +89 -0
- package/src/ui/app-bar/app-bar-overflow-indicator.tsx +108 -0
- package/src/ui/app-bar/app-bar-row.tsx +104 -0
- package/src/ui/app-bar/app-bar.test.tsx +87 -0
- package/src/ui/app-bar/app-bar.tokens.ts +223 -0
- package/src/ui/app-bar/app-bar.types.ts +441 -0
- package/src/ui/app-bar/bottom-app-bar.test.tsx +42 -0
- package/src/ui/app-bar/bottom-app-bar.tsx +84 -0
- package/src/ui/app-bar/docked-toolbar.test.tsx +34 -0
- package/src/ui/app-bar/docked-toolbar.tsx +54 -0
- package/src/ui/app-bar/flexible-app-bar.test.tsx +75 -0
- package/src/ui/app-bar/hooks/use-app-bar-scroll.ts +110 -0
- package/src/ui/app-bar/hooks/use-flexible-app-bar.ts +123 -0
- package/{dist/ui/app-bar/index.d.ts → src/ui/app-bar/index.ts} +35 -2
- package/src/ui/app-bar/large-flexible-app-bar.tsx +165 -0
- package/src/ui/app-bar/medium-flexible-app-bar.tsx +167 -0
- package/src/ui/app-bar/search-app-bar.test.tsx +49 -0
- package/src/ui/app-bar/search-app-bar.tsx +176 -0
- package/src/ui/app-bar/search-view.tsx +227 -0
- package/src/ui/app-bar/small-app-bar.test.tsx +48 -0
- package/src/ui/app-bar/small-app-bar.tsx +203 -0
- package/src/ui/badge.test.tsx +345 -0
- package/src/ui/badge.tsx +282 -0
- package/src/ui/button-group.test.tsx +71 -0
- package/src/ui/button-group.tsx +350 -0
- package/src/ui/button.test.tsx +297 -0
- package/src/ui/button.tsx +669 -0
- package/src/ui/card.test.tsx +187 -0
- package/src/ui/card.tsx +259 -0
- package/src/ui/checkbox.test.tsx +423 -0
- package/src/ui/checkbox.tsx +525 -0
- package/src/ui/chip.test.tsx +292 -0
- package/src/ui/chip.tsx +548 -0
- package/src/ui/code-block.tsx +219 -0
- package/src/ui/dialog.test.tsx +300 -0
- package/src/ui/dialog.tsx +384 -0
- package/src/ui/divider.test.tsx +314 -0
- package/src/ui/divider.tsx +412 -0
- package/src/ui/drawer.tsx +240 -0
- package/src/ui/fab-menu.test.tsx +494 -0
- package/src/ui/fab-menu.tsx +739 -0
- package/src/ui/fab.test.tsx +232 -0
- package/src/ui/fab.tsx +505 -0
- package/src/ui/icon-button.test.tsx +515 -0
- package/src/ui/icon-button.tsx +525 -0
- package/src/ui/icon.test.tsx +197 -0
- package/src/ui/icon.tsx +179 -0
- package/src/ui/loading-indicator.test.tsx +73 -0
- package/src/ui/loading-indicator.tsx +312 -0
- package/src/ui/menu/context-menu.tsx +275 -0
- package/src/ui/menu/index.ts +77 -0
- package/src/ui/menu/menu-animations.ts +102 -0
- package/src/ui/menu/menu-context.tsx +99 -0
- package/src/ui/menu/menu-divider.tsx +47 -0
- package/src/ui/menu/menu-group.tsx +200 -0
- package/src/ui/menu/menu-item.tsx +294 -0
- package/src/ui/menu/menu-tokens.ts +208 -0
- package/src/ui/menu/menu-types.ts +313 -0
- package/src/ui/menu/menu.test.tsx +624 -0
- package/src/ui/menu/menu.tsx +289 -0
- package/src/ui/menu/sub-menu.tsx +223 -0
- package/src/ui/menu/vertical-menu.tsx +382 -0
- package/src/ui/navigation-rail.test.tsx +404 -0
- package/src/ui/navigation-rail.tsx +604 -0
- package/src/ui/progress-indicator/circular.tsx +248 -0
- package/src/ui/progress-indicator/hooks.ts +51 -0
- package/{dist/ui/progress-indicator/index.d.ts → src/ui/progress-indicator/index.tsx} +20 -2
- package/src/ui/progress-indicator/linear-flat.tsx +83 -0
- package/src/ui/progress-indicator/linear-wavy.tsx +243 -0
- package/src/ui/progress-indicator/linear.tsx +143 -0
- package/src/ui/progress-indicator/types.ts +158 -0
- package/src/ui/progress-indicator/utils.ts +73 -0
- package/src/ui/radio-button.test.tsx +407 -0
- package/src/ui/radio-button.tsx +551 -0
- package/src/ui/ripple.test.tsx +72 -0
- package/src/ui/ripple.tsx +234 -0
- package/src/ui/scroll-area.test.tsx +58 -0
- package/src/ui/scroll-area.tsx +139 -0
- package/src/ui/search/animated-placeholder.tsx +145 -0
- package/src/ui/search/hooks/use-search-keyboard.test.ts +202 -0
- package/src/ui/search/hooks/use-search-keyboard.ts +104 -0
- package/src/ui/search/hooks/use-search-view-focus.test.ts +96 -0
- package/src/ui/search/hooks/use-search-view-focus.ts +24 -0
- package/src/ui/search/index.ts +44 -0
- package/src/ui/search/search-bar.tsx +220 -0
- package/src/ui/search/search-context.tsx +42 -0
- package/src/ui/search/search-view-docked.tsx +194 -0
- package/src/ui/search/search-view-fullscreen.tsx +247 -0
- package/src/ui/search/search.test.tsx +233 -0
- package/src/ui/search/search.tokens.ts +134 -0
- package/src/ui/search/search.tsx +131 -0
- package/src/ui/search/search.types.ts +154 -0
- package/src/ui/search/trailing-action.tsx +49 -0
- package/src/ui/shared/constants.ts +122 -0
- package/{dist/ui/shared/touch-target.d.ts → src/ui/shared/touch-target.tsx} +13 -1
- package/src/ui/slider/hooks/useSliderMath.ts +195 -0
- package/{dist/ui/slider/index.d.ts → src/ui/slider/index.ts} +12 -1
- package/src/ui/slider/range-slider.tsx +561 -0
- package/src/ui/slider/slider-thumb.tsx +379 -0
- package/src/ui/slider/slider-track.tsx +912 -0
- package/src/ui/slider/slider.tokens.ts +189 -0
- package/src/ui/slider/slider.tsx +259 -0
- package/src/ui/slider/slider.types.ts +288 -0
- package/src/ui/snackbar/index.ts +20 -0
- package/src/ui/snackbar/snackbar.test.tsx +338 -0
- package/src/ui/snackbar/snackbar.tsx +476 -0
- package/{dist/ui/switch/index.d.ts → src/ui/switch/index.ts} +1 -0
- package/src/ui/switch/switch.stories.tsx +309 -0
- package/src/ui/switch/switch.test.tsx +243 -0
- package/src/ui/switch/switch.tokens.ts +89 -0
- package/src/ui/switch/switch.tsx +504 -0
- package/src/ui/switch/switch.types.ts +62 -0
- package/{dist/ui/tabs/index.d.ts → src/ui/tabs/index.ts} +8 -1
- package/src/ui/tabs/tab.tsx +407 -0
- package/src/ui/tabs/tabs-content.tsx +89 -0
- package/src/ui/tabs/tabs-list.tsx +146 -0
- package/src/ui/tabs/tabs.test.tsx +290 -0
- package/src/ui/tabs/tabs.tokens.ts +121 -0
- package/src/ui/tabs/tabs.tsx +229 -0
- package/src/ui/tabs/tabs.types.ts +185 -0
- package/{dist/ui/text-field/index.d.ts → src/ui/text-field/index.ts} +8 -1
- package/src/ui/text-field/subcomponents/active-indicator.tsx +67 -0
- package/src/ui/text-field/subcomponents/floating-label.tsx +161 -0
- package/src/ui/text-field/subcomponents/leading-icon.tsx +46 -0
- package/src/ui/text-field/subcomponents/outline-container.tsx +170 -0
- package/src/ui/text-field/subcomponents/prefix-suffix.tsx +59 -0
- package/src/ui/text-field/subcomponents/supporting-text.tsx +145 -0
- package/src/ui/text-field/subcomponents/trailing-icon.tsx +199 -0
- package/src/ui/text-field/text-field.test.tsx +454 -0
- package/src/ui/text-field/text-field.tokens.ts +104 -0
- package/src/ui/text-field/text-field.tsx +548 -0
- package/src/ui/text-field/text-field.types.ts +180 -0
- package/src/ui/theme-provider/index.tsx +190 -0
- package/src/ui/toc.test.tsx +108 -0
- package/src/ui/toc.tsx +172 -0
- package/src/ui/tooltip/plain-tooltip.tsx +63 -0
- package/src/ui/tooltip/rich-tooltip.tsx +94 -0
- package/src/ui/tooltip/tooltip-box.tsx +266 -0
- package/src/ui/tooltip/tooltip-caret-shape.tsx +68 -0
- package/src/ui/tooltip/tooltip.tokens.ts +26 -0
- package/src/ui/tooltip/tooltip.types.ts +70 -0
- package/src/ui/tooltip/use-tooltip-position.ts +208 -0
- package/src/ui/tooltip/use-tooltip-state.ts +41 -0
- package/src/ui/typography/__tests__/typography.test.tsx +170 -0
- package/{dist/ui/typography/index.d.ts → src/ui/typography/index.ts} +21 -3
- package/src/ui/typography/type-scale-tokens.ts +205 -0
- package/src/ui/typography/typography-key-tokens.ts +43 -0
- package/src/ui/typography/typography-tokens.ts +360 -0
- package/src/ui/typography/typography.css +22 -0
- package/src/ui/typography/typography.tsx +559 -0
- package/test-render.tsx +4 -0
- package/test-shadow.html +26 -0
- package/test_output.txt +164 -0
- package/test_output_v2.txt +5 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +20 -0
- package/vitest.config.ts +11 -0
- package/dist/hooks/useClickOutside.d.ts +0 -8
- package/dist/hooks/useMediaQuery.d.ts +0 -11
- package/dist/hooks/useRipple.d.ts +0 -26
- package/dist/lib/material-symbols-preconnect.d.ts +0 -42
- package/dist/lib/theme-utils.d.ts +0 -63
- package/dist/lib/utils.d.ts +0 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/md3.d.ts +0 -14
- package/dist/ui/app-bar/app-bar-column.d.ts +0 -28
- package/dist/ui/app-bar/app-bar-item-button.d.ts +0 -16
- package/dist/ui/app-bar/app-bar-overflow-indicator.d.ts +0 -18
- package/dist/ui/app-bar/app-bar-row.d.ts +0 -36
- package/dist/ui/app-bar/app-bar.tokens.d.ts +0 -184
- package/dist/ui/app-bar/app-bar.types.d.ts +0 -392
- package/dist/ui/app-bar/bottom-app-bar.d.ts +0 -31
- package/dist/ui/app-bar/docked-toolbar.d.ts +0 -25
- package/dist/ui/app-bar/hooks/use-app-bar-scroll.d.ts +0 -42
- package/dist/ui/app-bar/hooks/use-flexible-app-bar.d.ts +0 -37
- package/dist/ui/app-bar/large-flexible-app-bar.d.ts +0 -26
- package/dist/ui/app-bar/medium-flexible-app-bar.d.ts +0 -28
- package/dist/ui/app-bar/search-app-bar.d.ts +0 -43
- package/dist/ui/app-bar/search-view.d.ts +0 -54
- package/dist/ui/app-bar/small-app-bar.d.ts +0 -37
- package/dist/ui/badge.d.ts +0 -125
- package/dist/ui/button-group.d.ts +0 -59
- package/dist/ui/button.d.ts +0 -148
- package/dist/ui/card.d.ts +0 -62
- package/dist/ui/checkbox.d.ts +0 -82
- package/dist/ui/chip.d.ts +0 -110
- package/dist/ui/code-block.d.ts +0 -14
- package/dist/ui/dialog.d.ts +0 -111
- package/dist/ui/divider.d.ts +0 -164
- package/dist/ui/drawer.d.ts +0 -39
- package/dist/ui/dropdown.d.ts +0 -29
- package/dist/ui/fab-menu.d.ts +0 -204
- package/dist/ui/fab.d.ts +0 -162
- package/dist/ui/icon-button.d.ts +0 -131
- package/dist/ui/icon.d.ts +0 -88
- package/dist/ui/loading-indicator.d.ts +0 -42
- package/dist/ui/navigation-rail.d.ts +0 -29
- package/dist/ui/progress-indicator/circular.d.ts +0 -3
- package/dist/ui/progress-indicator/hooks.d.ts +0 -3
- package/dist/ui/progress-indicator/linear-flat.d.ts +0 -10
- package/dist/ui/progress-indicator/linear-wavy.d.ts +0 -18
- package/dist/ui/progress-indicator/linear.d.ts +0 -3
- package/dist/ui/progress-indicator/types.d.ts +0 -151
- package/dist/ui/progress-indicator/utils.d.ts +0 -3
- package/dist/ui/radio-button.d.ts +0 -106
- package/dist/ui/ripple.d.ts +0 -126
- package/dist/ui/scroll-area.d.ts +0 -27
- package/dist/ui/search/animated-placeholder.d.ts +0 -54
- package/dist/ui/search/hooks/use-search-keyboard.d.ts +0 -32
- package/dist/ui/search/hooks/use-search-view-focus.d.ts +0 -6
- package/dist/ui/search/index.d.ts +0 -27
- package/dist/ui/search/search-bar.d.ts +0 -32
- package/dist/ui/search/search-context.d.ts +0 -24
- package/dist/ui/search/search-view-docked.d.ts +0 -25
- package/dist/ui/search/search-view-fullscreen.d.ts +0 -36
- package/dist/ui/search/search.d.ts +0 -50
- package/dist/ui/search/search.tokens.d.ts +0 -112
- package/dist/ui/search/search.types.d.ts +0 -131
- package/dist/ui/search/trailing-action.d.ts +0 -9
- package/dist/ui/shared/constants.d.ts +0 -86
- package/dist/ui/slider/hooks/useSliderMath.d.ts +0 -101
- package/dist/ui/slider/range-slider.d.ts +0 -47
- package/dist/ui/slider/slider-thumb.d.ts +0 -33
- package/dist/ui/slider/slider-track.d.ts +0 -25
- package/dist/ui/slider/slider.d.ts +0 -60
- package/dist/ui/slider/slider.tokens.d.ts +0 -151
- package/dist/ui/slider/slider.types.d.ts +0 -259
- package/dist/ui/snackbar/index.d.ts +0 -6
- package/dist/ui/snackbar/snackbar.d.ts +0 -197
- package/dist/ui/switch/switch.d.ts +0 -30
- package/dist/ui/switch/switch.stories.d.ts +0 -48
- package/dist/ui/switch/switch.tokens.d.ts +0 -67
- package/dist/ui/switch/switch.types.d.ts +0 -59
- package/dist/ui/tabs/tab.d.ts +0 -43
- package/dist/ui/tabs/tabs-content.d.ts +0 -36
- package/dist/ui/tabs/tabs-list.d.ts +0 -40
- package/dist/ui/tabs/tabs.d.ts +0 -60
- package/dist/ui/tabs/tabs.tokens.d.ts +0 -94
- package/dist/ui/tabs/tabs.types.d.ts +0 -172
- package/dist/ui/text-field/subcomponents/active-indicator.d.ts +0 -24
- package/dist/ui/text-field/subcomponents/floating-label.d.ts +0 -43
- package/dist/ui/text-field/subcomponents/leading-icon.d.ts +0 -23
- package/dist/ui/text-field/subcomponents/outline-container.d.ts +0 -42
- package/dist/ui/text-field/subcomponents/prefix-suffix.d.ts +0 -24
- package/dist/ui/text-field/subcomponents/supporting-text.d.ts +0 -37
- package/dist/ui/text-field/subcomponents/trailing-icon.d.ts +0 -41
- package/dist/ui/text-field/text-field.d.ts +0 -49
- package/dist/ui/text-field/text-field.tokens.d.ts +0 -76
- package/dist/ui/text-field/text-field.types.d.ts +0 -126
- package/dist/ui/theme-provider/index.d.ts +0 -48
- package/dist/ui/toc.d.ts +0 -80
- package/dist/ui/tooltip/plain-tooltip.d.ts +0 -2
- package/dist/ui/tooltip/rich-tooltip.d.ts +0 -2
- package/dist/ui/tooltip/tooltip-box.d.ts +0 -2
- package/dist/ui/tooltip/tooltip-caret-shape.d.ts +0 -9
- package/dist/ui/tooltip/tooltip.tokens.d.ts +0 -26
- package/dist/ui/tooltip/tooltip.types.d.ts +0 -56
- package/dist/ui/tooltip/use-tooltip-position.d.ts +0 -8
- package/dist/ui/tooltip/use-tooltip-state.d.ts +0 -2
- package/dist/ui/typography/type-scale-tokens.d.ts +0 -162
- package/dist/ui/typography/typography-key-tokens.d.ts +0 -40
- package/dist/ui/typography/typography-tokens.d.ts +0 -220
- package/dist/ui/typography/typography.d.ts +0 -265
- /package/{dist/hooks/index.d.ts → src/hooks/index.ts} +0 -0
- /package/{dist/ui/tooltip/index.d.ts → src/ui/tooltip/index.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React38 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var materialColorUtilities = require('@material/material-color-utilities');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
9
|
-
var
|
|
9
|
+
var RxContextMenu = require('@radix-ui/react-context-menu');
|
|
10
10
|
var react = require('motion/react');
|
|
11
|
+
var DropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
11
12
|
var reactSlot = require('@radix-ui/react-slot');
|
|
12
13
|
var classVarianceAuthority = require('class-variance-authority');
|
|
13
14
|
var RadixScrollArea = require('@radix-ui/react-scroll-area');
|
|
@@ -32,8 +33,9 @@ function _interopNamespace(e) {
|
|
|
32
33
|
return Object.freeze(n);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
var
|
|
36
|
-
var
|
|
36
|
+
var React38__namespace = /*#__PURE__*/_interopNamespace(React38);
|
|
37
|
+
var RxContextMenu__namespace = /*#__PURE__*/_interopNamespace(RxContextMenu);
|
|
38
|
+
var DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
|
|
37
39
|
var RadixScrollArea__namespace = /*#__PURE__*/_interopNamespace(RadixScrollArea);
|
|
38
40
|
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
39
41
|
|
|
@@ -77,8 +79,8 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
77
79
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
78
80
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
79
81
|
function useMediaQuery(query) {
|
|
80
|
-
const [matches, setMatches] =
|
|
81
|
-
|
|
82
|
+
const [matches, setMatches] = React38.useState(false);
|
|
83
|
+
React38.useEffect(() => {
|
|
82
84
|
const mql = window.matchMedia(query);
|
|
83
85
|
const handler = (e) => setMatches(e.matches);
|
|
84
86
|
setMatches(mql.matches);
|
|
@@ -94,8 +96,8 @@ function useRipple(options = {}) {
|
|
|
94
96
|
opacity = 0.12,
|
|
95
97
|
disabled = false
|
|
96
98
|
} = options;
|
|
97
|
-
const ref =
|
|
98
|
-
const onPointerDown =
|
|
99
|
+
const ref = React38.useRef(null);
|
|
100
|
+
const onPointerDown = React38.useCallback(
|
|
99
101
|
(event) => {
|
|
100
102
|
if (disabled || !ref.current) return;
|
|
101
103
|
const el = ref.current;
|
|
@@ -236,7 +238,7 @@ function generateM3Theme(sourceColorHex, mode = "light") {
|
|
|
236
238
|
function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
|
|
237
239
|
const colors = generateM3Theme(sourceColorHex, mode);
|
|
238
240
|
for (const [key, value] of Object.entries(colors)) {
|
|
239
|
-
const kebabKey = key.replace(/[A-Z]/g, (
|
|
241
|
+
const kebabKey = key.replace(/[A-Z]/g, (m47) => `-${m47.toLowerCase()}`);
|
|
240
242
|
root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
|
|
241
243
|
root.style.setProperty(`--color-m3-${kebabKey}`, value);
|
|
242
244
|
}
|
|
@@ -433,6 +435,671 @@ function AppBarItemButton({ item }) {
|
|
|
433
435
|
);
|
|
434
436
|
}
|
|
435
437
|
|
|
438
|
+
// src/ui/menu/menu-animations.ts
|
|
439
|
+
var FAST_SPATIAL_SPRING = {
|
|
440
|
+
type: "spring",
|
|
441
|
+
stiffness: 380,
|
|
442
|
+
damping: 28,
|
|
443
|
+
mass: 1
|
|
444
|
+
};
|
|
445
|
+
var FAST_EFFECTS_TRANSITION = {
|
|
446
|
+
duration: 0.15,
|
|
447
|
+
ease: [0.4, 0, 1, 1]
|
|
448
|
+
// FastOutLinearIn
|
|
449
|
+
};
|
|
450
|
+
var MENU_CONTAINER_VARIANTS = {
|
|
451
|
+
hidden: {
|
|
452
|
+
opacity: 0,
|
|
453
|
+
scale: 0.8
|
|
454
|
+
},
|
|
455
|
+
visible: {
|
|
456
|
+
opacity: 1,
|
|
457
|
+
scale: 1,
|
|
458
|
+
transition: FAST_SPATIAL_SPRING
|
|
459
|
+
},
|
|
460
|
+
exit: {
|
|
461
|
+
opacity: 0,
|
|
462
|
+
scale: 0.8,
|
|
463
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
var MENU_CHECK_ICON_SIZE = 20;
|
|
467
|
+
var CHECK_ICON_VARIANTS = {
|
|
468
|
+
hidden: {
|
|
469
|
+
opacity: 0,
|
|
470
|
+
width: 0
|
|
471
|
+
},
|
|
472
|
+
visible: {
|
|
473
|
+
opacity: 1,
|
|
474
|
+
width: MENU_CHECK_ICON_SIZE,
|
|
475
|
+
transition: FAST_SPATIAL_SPRING
|
|
476
|
+
},
|
|
477
|
+
exit: {
|
|
478
|
+
opacity: 0,
|
|
479
|
+
width: 0,
|
|
480
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
var SUBMENU_CONTAINER_VARIANTS = {
|
|
484
|
+
hidden: {
|
|
485
|
+
opacity: 0,
|
|
486
|
+
scale: 0.9,
|
|
487
|
+
x: -4
|
|
488
|
+
},
|
|
489
|
+
visible: {
|
|
490
|
+
opacity: 1,
|
|
491
|
+
scale: 1,
|
|
492
|
+
x: 0,
|
|
493
|
+
transition: FAST_SPATIAL_SPRING
|
|
494
|
+
},
|
|
495
|
+
exit: {
|
|
496
|
+
opacity: 0,
|
|
497
|
+
scale: 0.9,
|
|
498
|
+
x: -4,
|
|
499
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
var MenuContext = React38__namespace.createContext({
|
|
503
|
+
variant: "baseline",
|
|
504
|
+
colorVariant: "standard",
|
|
505
|
+
menuPrimitive: "dropdown",
|
|
506
|
+
open: false,
|
|
507
|
+
onOpenChange: () => {
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
function MenuProvider({
|
|
511
|
+
variant = "baseline",
|
|
512
|
+
colorVariant = "standard",
|
|
513
|
+
menuPrimitive = "dropdown",
|
|
514
|
+
open,
|
|
515
|
+
onOpenChange,
|
|
516
|
+
children
|
|
517
|
+
}) {
|
|
518
|
+
const value = React38__namespace.useMemo(
|
|
519
|
+
() => ({ variant, colorVariant, menuPrimitive, open, onOpenChange }),
|
|
520
|
+
[variant, colorVariant, menuPrimitive, open, onOpenChange]
|
|
521
|
+
);
|
|
522
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuContext.Provider, { value, children });
|
|
523
|
+
}
|
|
524
|
+
function useMenuContext() {
|
|
525
|
+
const ctx = React38__namespace.useContext(MenuContext);
|
|
526
|
+
return React38__namespace.useMemo(
|
|
527
|
+
() => __spreadProps(__spreadValues({}, ctx), {
|
|
528
|
+
isStatic: ctx.menuPrimitive === "static",
|
|
529
|
+
menuVariant: ctx.variant
|
|
530
|
+
}),
|
|
531
|
+
[ctx]
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// src/ui/menu/menu-tokens.ts
|
|
536
|
+
var MENU_BASELINE_ITEM_HORIZONTAL_PADDING = "px-3";
|
|
537
|
+
var MENU_ITEM_MIN_HEIGHT = "min-h-11";
|
|
538
|
+
var MENU_MIN_WIDTH = "min-w-28";
|
|
539
|
+
var MENU_MAX_WIDTH = "max-w-70";
|
|
540
|
+
var MENU_GROUP_GAP = "gap-0.5";
|
|
541
|
+
var MENU_GROUP_PADDING_Y = "py-1";
|
|
542
|
+
var MENU_POPUP_PADDING_Y = "py-2";
|
|
543
|
+
var MENU_ICON_SIZE = 20;
|
|
544
|
+
var MENU_CONTAINER_SHAPE = "rounded-[4px]";
|
|
545
|
+
var BASELINE_ITEM_SHAPE = "rounded-none";
|
|
546
|
+
var GROUP_SHAPES = {
|
|
547
|
+
/** Active standalone group shape: CornerLarge all corners (16px) */
|
|
548
|
+
standaloneActive: "16px",
|
|
549
|
+
/**
|
|
550
|
+
* Active leading group shape: top=CornerLarge(16px), bottom=CornerSmall(8px)
|
|
551
|
+
* Source: SegmentedMenuTokens — LeadingContainerShape:
|
|
552
|
+
* topStart=CornerLarge, topEnd=CornerLarge, bottomStart=CornerSmall, bottomEnd=CornerSmall
|
|
553
|
+
*/
|
|
554
|
+
leadingActive: "16px 16px 8px 8px",
|
|
555
|
+
/** Active middle group shape: CornerExtraSmall all corners (4px) */
|
|
556
|
+
middleActive: "4px",
|
|
557
|
+
/**
|
|
558
|
+
* Active trailing group shape: top=CornerSmall(8px), bottom=CornerLarge(16px)
|
|
559
|
+
* Source: SegmentedMenuTokens — TrailingContainerShape:
|
|
560
|
+
* topStart=CornerSmall, topEnd=CornerSmall, bottomStart=CornerLarge, bottomEnd=CornerLarge
|
|
561
|
+
*/
|
|
562
|
+
trailingActive: "8px 8px 16px 16px",
|
|
563
|
+
/** Inactive (default, pre-hover) shape for all groups: CornerExtraSmall (4px) */
|
|
564
|
+
inactive: "4px"
|
|
565
|
+
};
|
|
566
|
+
var ITEM_SHAPE_CLASSES = {
|
|
567
|
+
leading: "rounded-t-[12px] rounded-b-[4px]",
|
|
568
|
+
middle: "rounded-[4px]",
|
|
569
|
+
trailing: "rounded-t-[4px] rounded-b-[12px]",
|
|
570
|
+
standalone: "rounded-[4px]",
|
|
571
|
+
selected: "rounded-[12px]"
|
|
572
|
+
};
|
|
573
|
+
var STANDARD_COLORS = {
|
|
574
|
+
/** Group/popup container background (StandardMenuTokens.ContainerColor) */
|
|
575
|
+
containerBg: "bg-m3-surface-container-low",
|
|
576
|
+
/** Label text color (StandardMenuTokens.ItemLabelTextColor) */
|
|
577
|
+
labelText: "text-m3-on-surface",
|
|
578
|
+
/** Leading/trailing icon color (StandardMenuTokens.ItemLeadingIconColor) */
|
|
579
|
+
iconColor: "text-m3-on-surface-variant",
|
|
580
|
+
/** Supporting text below label (StandardMenuTokens.ItemSupportingTextColor) */
|
|
581
|
+
supportingTextColor: "text-m3-on-surface-variant",
|
|
582
|
+
/** Trailing supporting text (StandardMenuTokens.ItemTrailingSupportingTextColor) */
|
|
583
|
+
trailingSupportingTextColor: "text-m3-on-surface-variant",
|
|
584
|
+
/** Trailing icon color (StandardMenuTokens.ItemTrailingIconColor) */
|
|
585
|
+
trailingIconColor: "text-m3-on-surface-variant",
|
|
586
|
+
/** Hover state layer (OnSurface @ 8% opacity) */
|
|
587
|
+
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
588
|
+
/** Focus state layer (OnSurface @ 12% opacity) */
|
|
589
|
+
focusLayer: "focus:bg-m3-on-surface/12",
|
|
590
|
+
/** Selected item background (StandardMenuTokens.ItemSelectedContainerColor) */
|
|
591
|
+
selectedBg: "bg-m3-tertiary-container",
|
|
592
|
+
/** Selected item text (StandardMenuTokens.ItemSelectedLabelTextColor) */
|
|
593
|
+
selectedText: "text-m3-on-tertiary-container",
|
|
594
|
+
/** Selected item icon (StandardMenuTokens.ItemSelectedLeadingIconColor) */
|
|
595
|
+
selectedIcon: "text-m3-on-tertiary-container",
|
|
596
|
+
/** Disabled opacity: 38% (StandardMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
597
|
+
disabledOpacity: "data-disabled:opacity-[0.38]"
|
|
598
|
+
};
|
|
599
|
+
var BASELINE_COLORS = {
|
|
600
|
+
containerBg: "bg-m3-surface-container",
|
|
601
|
+
labelText: "text-m3-on-surface",
|
|
602
|
+
iconColor: "text-m3-on-surface-variant",
|
|
603
|
+
supportingTextColor: "text-m3-on-surface-variant",
|
|
604
|
+
trailingIconColor: "text-m3-on-surface-variant",
|
|
605
|
+
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
606
|
+
focusLayer: "focus:bg-m3-on-surface/12",
|
|
607
|
+
selectedBg: "bg-m3-secondary-container",
|
|
608
|
+
selectedText: "text-m3-on-secondary-container",
|
|
609
|
+
selectedIcon: "text-m3-on-secondary-container"};
|
|
610
|
+
var VIBRANT_COLORS = {
|
|
611
|
+
/** Group/popup container background (VibrantMenuTokens.ContainerColor) */
|
|
612
|
+
containerBg: "bg-m3-tertiary-container",
|
|
613
|
+
/** Label text color (VibrantMenuTokens.ItemLabelTextColor) */
|
|
614
|
+
labelText: "text-m3-on-tertiary-container",
|
|
615
|
+
/** Leading/trailing icon color (VibrantMenuTokens.ItemLeadingIconColor) */
|
|
616
|
+
iconColor: "text-m3-on-tertiary-container",
|
|
617
|
+
/** Supporting text below label (VibrantMenuTokens.ItemSupportingTextColor) */
|
|
618
|
+
supportingTextColor: "text-m3-on-tertiary-container",
|
|
619
|
+
/** Trailing supporting text (VibrantMenuTokens.ItemTrailingSupportingTextColor) */
|
|
620
|
+
trailingSupportingTextColor: "text-m3-on-tertiary-container",
|
|
621
|
+
/** Trailing icon color (VibrantMenuTokens.ItemTrailingIconColor) */
|
|
622
|
+
trailingIconColor: "text-m3-on-tertiary-container",
|
|
623
|
+
/** Hover state layer (OnTertiaryContainer @ 8% opacity) */
|
|
624
|
+
hoverLayer: "hover:bg-m3-on-tertiary-container/8",
|
|
625
|
+
/** Focus state layer (OnTertiaryContainer @ 12% opacity) */
|
|
626
|
+
focusLayer: "focus:bg-m3-on-tertiary-container/12",
|
|
627
|
+
/** Selected item background (VibrantMenuTokens.ItemSelectedContainerColor = Tertiary) */
|
|
628
|
+
selectedBg: "bg-m3-tertiary",
|
|
629
|
+
/** Selected item text (VibrantMenuTokens.ItemSelectedLabelTextColor = OnTertiary) */
|
|
630
|
+
selectedText: "text-m3-on-tertiary",
|
|
631
|
+
/** Selected item icon (VibrantMenuTokens.ItemSelectedLeadingIconColor = OnTertiary) */
|
|
632
|
+
selectedIcon: "text-m3-on-tertiary",
|
|
633
|
+
/** Disabled opacity: 38% (VibrantMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
634
|
+
disabledOpacity: "data-disabled:opacity-[0.38]"
|
|
635
|
+
};
|
|
636
|
+
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
637
|
+
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
638
|
+
function ContextMenu({
|
|
639
|
+
children,
|
|
640
|
+
variant = "baseline",
|
|
641
|
+
colorVariant = "standard"
|
|
642
|
+
}) {
|
|
643
|
+
const [open, setOpen] = React38__namespace.useState(false);
|
|
644
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
645
|
+
MenuProvider,
|
|
646
|
+
{
|
|
647
|
+
variant,
|
|
648
|
+
colorVariant,
|
|
649
|
+
menuPrimitive: "context",
|
|
650
|
+
open,
|
|
651
|
+
onOpenChange: setOpen,
|
|
652
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Root, { onOpenChange: setOpen, children })
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
ContextMenu.displayName = "ContextMenu";
|
|
657
|
+
var ContextMenuTrigger = React38__namespace.forwardRef((_a, ref) => {
|
|
658
|
+
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
659
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
660
|
+
});
|
|
661
|
+
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
662
|
+
var ContextMenuContent = React38__namespace.forwardRef(
|
|
663
|
+
(_a, ref) => {
|
|
664
|
+
var _b = _a, {
|
|
665
|
+
children,
|
|
666
|
+
hasOverflow = false,
|
|
667
|
+
colorVariant: propColorVariant,
|
|
668
|
+
separatorStyle = "gap",
|
|
669
|
+
className
|
|
670
|
+
} = _b, props = __objRest(_b, [
|
|
671
|
+
"children",
|
|
672
|
+
"hasOverflow",
|
|
673
|
+
"colorVariant",
|
|
674
|
+
"separatorStyle",
|
|
675
|
+
"className"
|
|
676
|
+
]);
|
|
677
|
+
const {
|
|
678
|
+
open,
|
|
679
|
+
variant,
|
|
680
|
+
colorVariant: contextColorVariant
|
|
681
|
+
} = useMenuContext();
|
|
682
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
683
|
+
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
684
|
+
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
685
|
+
const containerClassName = variant === "expressive" ? cn(
|
|
686
|
+
"z-50 flex flex-col w-full",
|
|
687
|
+
MENU_MIN_WIDTH,
|
|
688
|
+
MENU_MAX_WIDTH,
|
|
689
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
690
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
691
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
692
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
693
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
694
|
+
"outline-none",
|
|
695
|
+
className
|
|
696
|
+
) : cn(
|
|
697
|
+
"z-50 flex flex-col",
|
|
698
|
+
MENU_MIN_WIDTH,
|
|
699
|
+
MENU_MAX_WIDTH,
|
|
700
|
+
MENU_POPUP_PADDING_Y,
|
|
701
|
+
MENU_GROUP_GAP,
|
|
702
|
+
colors.containerBg,
|
|
703
|
+
MENU_CONTAINER_SHAPE,
|
|
704
|
+
"elevation-2",
|
|
705
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
706
|
+
"outline-none",
|
|
707
|
+
className
|
|
708
|
+
);
|
|
709
|
+
const flattenChildren = (nodes) => {
|
|
710
|
+
return React38__namespace.Children.toArray(nodes).reduce(
|
|
711
|
+
(acc, child) => {
|
|
712
|
+
if (React38__namespace.isValidElement(child)) {
|
|
713
|
+
if (child.type === React38__namespace.Fragment) {
|
|
714
|
+
return acc.concat(
|
|
715
|
+
flattenChildren(
|
|
716
|
+
child.props.children
|
|
717
|
+
)
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
acc.push(child);
|
|
721
|
+
}
|
|
722
|
+
return acc;
|
|
723
|
+
},
|
|
724
|
+
[]
|
|
725
|
+
);
|
|
726
|
+
};
|
|
727
|
+
let renderedChildren = children;
|
|
728
|
+
if (variant === "expressive") {
|
|
729
|
+
const validChildren = flattenChildren(children);
|
|
730
|
+
const groupCount = validChildren.length;
|
|
731
|
+
const enhancedChildren = validChildren.map(
|
|
732
|
+
(child, i) => React38__namespace.cloneElement(
|
|
733
|
+
child,
|
|
734
|
+
{
|
|
735
|
+
index: i,
|
|
736
|
+
count: groupCount,
|
|
737
|
+
isGapVariant: isExpressiveGap
|
|
738
|
+
}
|
|
739
|
+
)
|
|
740
|
+
);
|
|
741
|
+
renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
742
|
+
if (i > 0) {
|
|
743
|
+
acc.push(
|
|
744
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
745
|
+
"hr",
|
|
746
|
+
{
|
|
747
|
+
className: cn(
|
|
748
|
+
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
749
|
+
)
|
|
750
|
+
},
|
|
751
|
+
`divider-${child.key || i}`
|
|
752
|
+
)
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
acc.push(child);
|
|
756
|
+
return acc;
|
|
757
|
+
}, []) : enhancedChildren;
|
|
758
|
+
}
|
|
759
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(RxContextMenu__namespace.Content, __spreadProps(__spreadValues({ ref, asChild: true, forceMount: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
760
|
+
react.m.div,
|
|
761
|
+
{
|
|
762
|
+
className: containerClassName,
|
|
763
|
+
initial: { opacity: 0, scale: 0.95, y: -4 },
|
|
764
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
765
|
+
exit: { opacity: 0, scale: 0.95, y: -4 },
|
|
766
|
+
transition: FAST_SPATIAL_SPRING,
|
|
767
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
768
|
+
transformOrigin: "var(--radix-context-menu-content-transform-origin)"
|
|
769
|
+
}),
|
|
770
|
+
children: renderedChildren
|
|
771
|
+
}
|
|
772
|
+
) })) }) });
|
|
773
|
+
}
|
|
774
|
+
);
|
|
775
|
+
ContextMenuContent.displayName = "ContextMenuContent";
|
|
776
|
+
function Menu(_a) {
|
|
777
|
+
var _b = _a, {
|
|
778
|
+
children,
|
|
779
|
+
variant,
|
|
780
|
+
menuVariant,
|
|
781
|
+
colorVariant = "standard",
|
|
782
|
+
open: controlledOpen,
|
|
783
|
+
onOpenChange: controlledOnOpenChange,
|
|
784
|
+
defaultOpen
|
|
785
|
+
} = _b, props = __objRest(_b, [
|
|
786
|
+
"children",
|
|
787
|
+
"variant",
|
|
788
|
+
"menuVariant",
|
|
789
|
+
"colorVariant",
|
|
790
|
+
"open",
|
|
791
|
+
"onOpenChange",
|
|
792
|
+
"defaultOpen"
|
|
793
|
+
]);
|
|
794
|
+
var _a2;
|
|
795
|
+
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
796
|
+
const [internalOpen, setInternalOpen] = React38__namespace.useState(
|
|
797
|
+
() => defaultOpen != null ? defaultOpen : false
|
|
798
|
+
);
|
|
799
|
+
const isControlled = controlledOpen !== void 0;
|
|
800
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
801
|
+
const handleOpenChange = React38__namespace.useCallback(
|
|
802
|
+
(next) => {
|
|
803
|
+
if (!isControlled) setInternalOpen(next);
|
|
804
|
+
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
805
|
+
},
|
|
806
|
+
[isControlled, controlledOnOpenChange]
|
|
807
|
+
);
|
|
808
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
809
|
+
MenuProvider,
|
|
810
|
+
{
|
|
811
|
+
variant: resolvedVariant,
|
|
812
|
+
colorVariant,
|
|
813
|
+
open,
|
|
814
|
+
onOpenChange: handleOpenChange,
|
|
815
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
816
|
+
DropdownMenu__namespace.Root,
|
|
817
|
+
__spreadProps(__spreadValues({}, props), {
|
|
818
|
+
defaultOpen,
|
|
819
|
+
open: isControlled ? open : void 0,
|
|
820
|
+
onOpenChange: handleOpenChange,
|
|
821
|
+
children
|
|
822
|
+
})
|
|
823
|
+
)
|
|
824
|
+
}
|
|
825
|
+
);
|
|
826
|
+
}
|
|
827
|
+
Menu.displayName = "Menu";
|
|
828
|
+
var MenuTrigger = React38__namespace.forwardRef((_a, ref) => {
|
|
829
|
+
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
830
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
831
|
+
});
|
|
832
|
+
MenuTrigger.displayName = "MenuTrigger";
|
|
833
|
+
var MenuContent = React38__namespace.forwardRef(
|
|
834
|
+
(_a, ref) => {
|
|
835
|
+
var _b = _a, {
|
|
836
|
+
children,
|
|
837
|
+
sideOffset = 6,
|
|
838
|
+
side = "bottom",
|
|
839
|
+
align = "start",
|
|
840
|
+
hasOverflow = false,
|
|
841
|
+
colorVariant: propColorVariant,
|
|
842
|
+
separatorStyle = "gap",
|
|
843
|
+
className
|
|
844
|
+
} = _b, props = __objRest(_b, [
|
|
845
|
+
"children",
|
|
846
|
+
"sideOffset",
|
|
847
|
+
"side",
|
|
848
|
+
"align",
|
|
849
|
+
"hasOverflow",
|
|
850
|
+
"colorVariant",
|
|
851
|
+
"separatorStyle",
|
|
852
|
+
"className"
|
|
853
|
+
]);
|
|
854
|
+
const {
|
|
855
|
+
open,
|
|
856
|
+
variant,
|
|
857
|
+
colorVariant: contextColorVariant
|
|
858
|
+
} = useMenuContext();
|
|
859
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
860
|
+
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
861
|
+
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
862
|
+
const containerClassName = variant === "expressive" ? cn(
|
|
863
|
+
"z-50 flex flex-col",
|
|
864
|
+
MENU_MIN_WIDTH,
|
|
865
|
+
MENU_MAX_WIDTH,
|
|
866
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
867
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
868
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
869
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
870
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
871
|
+
"outline-none",
|
|
872
|
+
className
|
|
873
|
+
) : cn(
|
|
874
|
+
"z-50 flex flex-col",
|
|
875
|
+
MENU_MIN_WIDTH,
|
|
876
|
+
MENU_MAX_WIDTH,
|
|
877
|
+
MENU_POPUP_PADDING_Y,
|
|
878
|
+
MENU_GROUP_GAP,
|
|
879
|
+
colors.containerBg,
|
|
880
|
+
MENU_CONTAINER_SHAPE,
|
|
881
|
+
"elevation-2",
|
|
882
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
883
|
+
"outline-none",
|
|
884
|
+
className
|
|
885
|
+
);
|
|
886
|
+
const flattenChildren = (nodes) => {
|
|
887
|
+
return React38__namespace.Children.toArray(nodes).reduce(
|
|
888
|
+
(acc, child) => {
|
|
889
|
+
if (React38__namespace.isValidElement(child)) {
|
|
890
|
+
if (child.type === React38__namespace.Fragment) {
|
|
891
|
+
return acc.concat(
|
|
892
|
+
flattenChildren(
|
|
893
|
+
child.props.children
|
|
894
|
+
)
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
acc.push(child);
|
|
898
|
+
}
|
|
899
|
+
return acc;
|
|
900
|
+
},
|
|
901
|
+
[]
|
|
902
|
+
);
|
|
903
|
+
};
|
|
904
|
+
let renderedChildren = children;
|
|
905
|
+
if (variant === "expressive") {
|
|
906
|
+
const validChildren = flattenChildren(children);
|
|
907
|
+
const groupCount = validChildren.length;
|
|
908
|
+
const enhancedChildren = validChildren.map(
|
|
909
|
+
(child, i) => React38__namespace.cloneElement(child, {
|
|
910
|
+
index: i,
|
|
911
|
+
count: groupCount,
|
|
912
|
+
isGapVariant: isExpressiveGap
|
|
913
|
+
})
|
|
914
|
+
);
|
|
915
|
+
renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
916
|
+
if (i > 0) {
|
|
917
|
+
acc.push(
|
|
918
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
919
|
+
"hr",
|
|
920
|
+
{
|
|
921
|
+
className: cn(
|
|
922
|
+
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
923
|
+
)
|
|
924
|
+
},
|
|
925
|
+
`divider-${child.key || i}`
|
|
926
|
+
)
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
acc.push(child);
|
|
930
|
+
return acc;
|
|
931
|
+
}, []) : enhancedChildren;
|
|
932
|
+
}
|
|
933
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
934
|
+
DropdownMenu__namespace.Content,
|
|
935
|
+
__spreadProps(__spreadValues({
|
|
936
|
+
ref,
|
|
937
|
+
sideOffset,
|
|
938
|
+
side,
|
|
939
|
+
align,
|
|
940
|
+
asChild: true,
|
|
941
|
+
forceMount: true
|
|
942
|
+
}, props), {
|
|
943
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
944
|
+
react.m.div,
|
|
945
|
+
{
|
|
946
|
+
role: "menu",
|
|
947
|
+
"aria-orientation": "vertical",
|
|
948
|
+
className: containerClassName,
|
|
949
|
+
variants: MENU_CONTAINER_VARIANTS,
|
|
950
|
+
initial: "hidden",
|
|
951
|
+
animate: "visible",
|
|
952
|
+
exit: "exit",
|
|
953
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
954
|
+
transformOrigin: "var(--radix-dropdown-menu-content-transform-origin)"
|
|
955
|
+
}),
|
|
956
|
+
children: renderedChildren
|
|
957
|
+
}
|
|
958
|
+
)
|
|
959
|
+
})
|
|
960
|
+
) }) });
|
|
961
|
+
}
|
|
962
|
+
);
|
|
963
|
+
MenuContent.displayName = "MenuContent";
|
|
964
|
+
var MenuDivider = React38__namespace.forwardRef(
|
|
965
|
+
(_a, ref) => {
|
|
966
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
967
|
+
const { menuVariant } = useMenuContext();
|
|
968
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Separator, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
969
|
+
"hr",
|
|
970
|
+
__spreadValues({
|
|
971
|
+
ref,
|
|
972
|
+
className: cn(
|
|
973
|
+
// Baseline: 8dp vertical margin, 0 horizontal. Expressive: 12dp horizontal, 2dp vertical
|
|
974
|
+
menuVariant === "baseline" ? "my-2 mx-0" : "mx-3 my-0.5",
|
|
975
|
+
// 1px height line
|
|
976
|
+
"h-px border-0",
|
|
977
|
+
// outline-variant color
|
|
978
|
+
"bg-m3-outline-variant",
|
|
979
|
+
className
|
|
980
|
+
)
|
|
981
|
+
}, props)
|
|
982
|
+
) });
|
|
983
|
+
}
|
|
984
|
+
);
|
|
985
|
+
MenuDivider.displayName = "MenuDivider";
|
|
986
|
+
function getGroupPosition(index, count) {
|
|
987
|
+
if (count === 1) return "standalone";
|
|
988
|
+
if (index === 0) return "leading";
|
|
989
|
+
if (index === count - 1) return "trailing";
|
|
990
|
+
return "middle";
|
|
991
|
+
}
|
|
992
|
+
function getGroupActiveShape(position) {
|
|
993
|
+
return GROUP_SHAPES[`${position}Active`];
|
|
994
|
+
}
|
|
995
|
+
var MenuGroup = React38__namespace.forwardRef(
|
|
996
|
+
(_a, ref) => {
|
|
997
|
+
var _b = _a, {
|
|
998
|
+
children,
|
|
999
|
+
label,
|
|
1000
|
+
index = 0,
|
|
1001
|
+
count = 1,
|
|
1002
|
+
colorVariant: propColorVariant,
|
|
1003
|
+
isGapVariant,
|
|
1004
|
+
itemPosition,
|
|
1005
|
+
className
|
|
1006
|
+
} = _b, rest = __objRest(_b, [
|
|
1007
|
+
"children",
|
|
1008
|
+
"label",
|
|
1009
|
+
"index",
|
|
1010
|
+
"count",
|
|
1011
|
+
"colorVariant",
|
|
1012
|
+
"isGapVariant",
|
|
1013
|
+
"itemPosition",
|
|
1014
|
+
"className"
|
|
1015
|
+
]);
|
|
1016
|
+
const {
|
|
1017
|
+
menuVariant,
|
|
1018
|
+
colorVariant: contextColorVariant,
|
|
1019
|
+
isStatic
|
|
1020
|
+
} = useMenuContext();
|
|
1021
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1022
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1023
|
+
const position = getGroupPosition(index, count);
|
|
1024
|
+
const activeShape = getGroupActiveShape(position);
|
|
1025
|
+
const [isHovered, setIsHovered] = React38__namespace.useState(false);
|
|
1026
|
+
const currentShape = isStatic || isHovered ? activeShape : GROUP_SHAPES.inactive;
|
|
1027
|
+
const handlePointerEnter = React38__namespace.useCallback(() => setIsHovered(true), []);
|
|
1028
|
+
const handlePointerLeave = React38__namespace.useCallback(() => setIsHovered(false), []);
|
|
1029
|
+
const flattenChildren = (children2) => {
|
|
1030
|
+
return React38__namespace.Children.toArray(children2).reduce(
|
|
1031
|
+
(acc, child) => {
|
|
1032
|
+
if (React38__namespace.isValidElement(child)) {
|
|
1033
|
+
if (child.type === React38__namespace.Fragment) {
|
|
1034
|
+
return acc.concat(
|
|
1035
|
+
flattenChildren(
|
|
1036
|
+
child.props.children
|
|
1037
|
+
)
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
acc.push(child);
|
|
1041
|
+
}
|
|
1042
|
+
return acc;
|
|
1043
|
+
},
|
|
1044
|
+
[]
|
|
1045
|
+
);
|
|
1046
|
+
};
|
|
1047
|
+
const validChildren = flattenChildren(children);
|
|
1048
|
+
const itemCount = validChildren.length;
|
|
1049
|
+
const enhancedChildren = validChildren.map((child, i) => {
|
|
1050
|
+
const itemPosition2 = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
1051
|
+
return React38__namespace.cloneElement(child, {
|
|
1052
|
+
itemPosition: itemPosition2,
|
|
1053
|
+
colorVariant
|
|
1054
|
+
});
|
|
1055
|
+
});
|
|
1056
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1057
|
+
react.m.div,
|
|
1058
|
+
__spreadProps(__spreadValues({
|
|
1059
|
+
ref,
|
|
1060
|
+
role: "group",
|
|
1061
|
+
"aria-label": label,
|
|
1062
|
+
className: cn(
|
|
1063
|
+
"relative",
|
|
1064
|
+
// In baseline variant, MenuGroup is transparent so it shouldn't clip.
|
|
1065
|
+
// In expressive variant, it needs overflow-hidden to clip hover states to its morphing shape.
|
|
1066
|
+
menuVariant === "baseline" ? "" : "overflow-hidden",
|
|
1067
|
+
// Vertical padding: 2dp for gap variant (to match Figma), 4dp for baseline
|
|
1068
|
+
isGapVariant ? "py-0.5" : MENU_GROUP_PADDING_Y,
|
|
1069
|
+
// Horizontal padding: 4dp for expressive menus (both static and popup), 0 for baseline
|
|
1070
|
+
menuVariant === "expressive" ? "px-1" : "",
|
|
1071
|
+
// Gap variant has floating segments, so each group manages its own shadow
|
|
1072
|
+
isGapVariant ? "elevation-2" : "",
|
|
1073
|
+
// Background based on color variant (transparent for baseline to avoid double-layering)
|
|
1074
|
+
menuVariant === "baseline" ? "bg-transparent" : colors.containerBg,
|
|
1075
|
+
className
|
|
1076
|
+
),
|
|
1077
|
+
animate: { borderRadius: currentShape },
|
|
1078
|
+
transition: FAST_SPATIAL_SPRING,
|
|
1079
|
+
onPointerEnter: handlePointerEnter,
|
|
1080
|
+
onPointerLeave: handlePointerLeave
|
|
1081
|
+
}, rest), {
|
|
1082
|
+
children: [
|
|
1083
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1084
|
+
"span",
|
|
1085
|
+
{
|
|
1086
|
+
className: cn(
|
|
1087
|
+
// Padding: 12dp top, 12dp horizontal, 8dp bottom (MD3 spec)
|
|
1088
|
+
"block pt-3 px-3 pb-2",
|
|
1089
|
+
"text-label-small",
|
|
1090
|
+
menuVariant === "baseline" ? "text-m3-on-surface-variant" : colorVariant === "vibrant" ? "text-m3-on-tertiary-container" : "text-m3-on-surface-variant"
|
|
1091
|
+
),
|
|
1092
|
+
children: label
|
|
1093
|
+
}
|
|
1094
|
+
),
|
|
1095
|
+
enhancedChildren
|
|
1096
|
+
]
|
|
1097
|
+
})
|
|
1098
|
+
);
|
|
1099
|
+
}
|
|
1100
|
+
);
|
|
1101
|
+
MenuGroup.displayName = "MenuGroup";
|
|
1102
|
+
|
|
436
1103
|
// src/ui/shared/constants.ts
|
|
437
1104
|
var SPRING_TRANSITION_FAST = {
|
|
438
1105
|
type: "spring",
|
|
@@ -464,7 +1131,7 @@ var VARIANT_FONT = {
|
|
|
464
1131
|
rounded: "'Material Symbols Rounded'",
|
|
465
1132
|
sharp: "'Material Symbols Sharp'"
|
|
466
1133
|
};
|
|
467
|
-
var IconComponent =
|
|
1134
|
+
var IconComponent = React38__namespace.forwardRef(
|
|
468
1135
|
(_a, ref) => {
|
|
469
1136
|
var _b = _a, {
|
|
470
1137
|
name,
|
|
@@ -530,222 +1197,527 @@ var IconComponent = React31__namespace.forwardRef(
|
|
|
530
1197
|
}
|
|
531
1198
|
);
|
|
532
1199
|
IconComponent.displayName = "Icon";
|
|
533
|
-
var Icon =
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
1200
|
+
var Icon = React38__namespace.memo(IconComponent);
|
|
1201
|
+
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
1202
|
+
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
1203
|
+
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
1204
|
+
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
1205
|
+
return ITEM_SHAPE_CLASSES[position];
|
|
1206
|
+
}
|
|
1207
|
+
var MenuItem = React38__namespace.forwardRef(
|
|
1208
|
+
(_a, ref) => {
|
|
1209
|
+
var _b = _a, {
|
|
1210
|
+
children,
|
|
1211
|
+
onClick,
|
|
1212
|
+
leadingIcon,
|
|
1213
|
+
trailingIcon,
|
|
1214
|
+
supportingText,
|
|
1215
|
+
trailingText,
|
|
1216
|
+
selected,
|
|
1217
|
+
disabled = false,
|
|
1218
|
+
itemPosition = "standalone",
|
|
1219
|
+
colorVariant: propColorVariant,
|
|
1220
|
+
keepOpen = false,
|
|
1221
|
+
className,
|
|
1222
|
+
isSubTrigger,
|
|
1223
|
+
value,
|
|
1224
|
+
role
|
|
1225
|
+
} = _b, rest = __objRest(_b, [
|
|
1226
|
+
"children",
|
|
1227
|
+
"onClick",
|
|
1228
|
+
"leadingIcon",
|
|
1229
|
+
"trailingIcon",
|
|
1230
|
+
"supportingText",
|
|
1231
|
+
"trailingText",
|
|
1232
|
+
"selected",
|
|
1233
|
+
"disabled",
|
|
1234
|
+
"itemPosition",
|
|
1235
|
+
"colorVariant",
|
|
1236
|
+
"keepOpen",
|
|
1237
|
+
"className",
|
|
1238
|
+
"isSubTrigger",
|
|
1239
|
+
"value",
|
|
1240
|
+
"role"
|
|
1241
|
+
]);
|
|
1242
|
+
const {
|
|
1243
|
+
menuVariant,
|
|
1244
|
+
colorVariant: contextColorVariant,
|
|
1245
|
+
menuPrimitive
|
|
1246
|
+
} = useMenuContext();
|
|
1247
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1248
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1249
|
+
const isStaticMenu = menuPrimitive === "static";
|
|
1250
|
+
const shapeClass = getItemShapeClass(
|
|
1251
|
+
itemPosition,
|
|
1252
|
+
!!selected,
|
|
1253
|
+
isStaticMenu,
|
|
1254
|
+
menuVariant
|
|
1255
|
+
);
|
|
1256
|
+
const isSelectable = selected !== void 0 && !isSubTrigger;
|
|
1257
|
+
const isCheckbox = role === "menuitemcheckbox" || selected !== void 0 && !role && !isSubTrigger;
|
|
1258
|
+
const isRadio = role === "menuitemradio";
|
|
1259
|
+
const ItemPrimitive = isStaticMenu || isSubTrigger ? reactSlot.Slot : menuPrimitive === "context" ? isCheckbox ? RxContextMenu__namespace.CheckboxItem : isRadio ? RxContextMenu__namespace.RadioItem : RxContextMenu__namespace.Item : isCheckbox ? DropdownMenu__namespace.CheckboxItem : isRadio ? DropdownMenu__namespace.RadioItem : DropdownMenu__namespace.Item;
|
|
1260
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1261
|
+
ItemPrimitive,
|
|
1262
|
+
__spreadProps(__spreadValues({
|
|
1263
|
+
ref
|
|
1264
|
+
}, isStaticMenu || isSubTrigger ? {
|
|
1265
|
+
role: role || (isCheckbox ? "menuitemcheckbox" : isRadio ? "menuitemradio" : "menuitem"),
|
|
1266
|
+
"aria-checked": isCheckbox || isRadio ? !!selected : void 0,
|
|
1267
|
+
"aria-disabled": disabled ? true : void 0,
|
|
1268
|
+
tabIndex: disabled ? -1 : 0,
|
|
1269
|
+
onKeyDown: (e) => {
|
|
1270
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1271
|
+
e.preventDefault();
|
|
1272
|
+
onClick == null ? void 0 : onClick(e);
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
onClick
|
|
1276
|
+
} : __spreadProps(__spreadValues(__spreadValues({
|
|
1277
|
+
disabled,
|
|
1278
|
+
onSelect: keepOpen ? (e) => e.preventDefault() : void 0,
|
|
1279
|
+
onClick
|
|
1280
|
+
}, isCheckbox || isRadio ? { checked: !!selected } : {}), isRadio ? { value: value != null ? value : "" } : {}), {
|
|
1281
|
+
asChild: true
|
|
1282
|
+
})), {
|
|
1283
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1284
|
+
"div",
|
|
1285
|
+
__spreadProps(__spreadValues({
|
|
1286
|
+
className: cn(
|
|
1287
|
+
// Layout
|
|
1288
|
+
"relative flex w-full cursor-pointer select-none items-center outline-none",
|
|
1289
|
+
// Sizing: min-h 48dp, min-w 112dp, max-w 280dp
|
|
1290
|
+
"min-h-12 min-w-28 max-w-70",
|
|
1291
|
+
// Horizontal padding
|
|
1292
|
+
menuVariant === "baseline" ? MENU_BASELINE_ITEM_HORIZONTAL_PADDING : "px-4",
|
|
1293
|
+
// Spacing between items
|
|
1294
|
+
isStaticMenu ? "my-0.5" : "",
|
|
1295
|
+
// Shape morphing (position-based + selected override)
|
|
1296
|
+
shapeClass,
|
|
1297
|
+
// Animate border-radius AND background-color together (FastEffects: 150ms)
|
|
1298
|
+
"transition-[border-radius,background-color] duration-150 ease-in",
|
|
1299
|
+
// Colors based on variant + selection
|
|
1300
|
+
selected ? cn(colors.selectedBg, colors.selectedText) : cn(colors.labelText),
|
|
1301
|
+
// State layers (only on unselected items)
|
|
1302
|
+
!selected && colors.hoverLayer,
|
|
1303
|
+
!selected && colors.focusLayer,
|
|
1304
|
+
// Focus visible ring (WCAG 2.4.11 — visible focus indicator)
|
|
1305
|
+
// Uses ring-inset so the ring doesn't overflow the item bounds.
|
|
1306
|
+
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-primary",
|
|
1307
|
+
// Disabled
|
|
1308
|
+
disabled && "pointer-events-none opacity-[0.38]",
|
|
1309
|
+
className
|
|
1310
|
+
)
|
|
1311
|
+
}, rest), {
|
|
1312
|
+
children: [
|
|
1313
|
+
(isSelectable || leadingIcon) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1314
|
+
"div",
|
|
1315
|
+
{
|
|
1316
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center mr-3",
|
|
1317
|
+
"aria-hidden": "true",
|
|
1318
|
+
children: isSelectable ? /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { initial: false, mode: "wait", children: selected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1319
|
+
react.m.span,
|
|
1320
|
+
{
|
|
1321
|
+
className: cn(
|
|
1322
|
+
"flex h-full w-full items-center justify-center overflow-hidden",
|
|
1323
|
+
colors.selectedIcon
|
|
1324
|
+
),
|
|
1325
|
+
variants: CHECK_ICON_VARIANTS,
|
|
1326
|
+
initial: "hidden",
|
|
1327
|
+
animate: "visible",
|
|
1328
|
+
exit: "exit",
|
|
1329
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "check", fill: 1, size: MENU_CHECK_ICON_SIZE })
|
|
1330
|
+
},
|
|
1331
|
+
"check"
|
|
1332
|
+
) : leadingIcon ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1333
|
+
react.m.span,
|
|
1334
|
+
{
|
|
1335
|
+
className: cn(
|
|
1336
|
+
"flex h-full w-full items-center justify-center overflow-hidden",
|
|
1337
|
+
colors.iconColor
|
|
1338
|
+
),
|
|
1339
|
+
variants: CHECK_ICON_VARIANTS,
|
|
1340
|
+
initial: "hidden",
|
|
1341
|
+
animate: "visible",
|
|
1342
|
+
exit: "exit",
|
|
1343
|
+
children: leadingIcon
|
|
1344
|
+
},
|
|
1345
|
+
"icon"
|
|
1346
|
+
) : (
|
|
1347
|
+
// Spacer for selectable items with no icon, to keep text aligned
|
|
1348
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-5" })
|
|
1349
|
+
) }) : (
|
|
1350
|
+
// Static icon for non-selectable items
|
|
1351
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1352
|
+
"span",
|
|
1353
|
+
{
|
|
1354
|
+
className: cn(
|
|
1355
|
+
"flex h-full w-full items-center justify-center",
|
|
1356
|
+
colors.iconColor
|
|
1357
|
+
),
|
|
1358
|
+
children: leadingIcon
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
)
|
|
1362
|
+
}
|
|
1363
|
+
),
|
|
1364
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-1 flex-col", children: [
|
|
1365
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-body-large leading-snug", children }),
|
|
1366
|
+
supportingText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1367
|
+
"span",
|
|
1368
|
+
{
|
|
1369
|
+
className: cn(
|
|
1370
|
+
"text-body-medium leading-snug",
|
|
1371
|
+
// Source: StandardMenuTokens.ItemSupportingTextColor / VibrantMenuTokens
|
|
1372
|
+
selected ? colors.selectedText : colors.supportingTextColor
|
|
1373
|
+
),
|
|
1374
|
+
children: supportingText
|
|
1375
|
+
}
|
|
1376
|
+
)
|
|
1377
|
+
] }),
|
|
1378
|
+
(trailingText || trailingIcon) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1379
|
+
"span",
|
|
1380
|
+
{
|
|
1381
|
+
className: cn(
|
|
1382
|
+
// Minimum 12dp gap from label column (ListTokens)
|
|
1383
|
+
"ml-3 flex shrink-0 items-center",
|
|
1384
|
+
// Source: StandardMenuTokens.ItemTrailingIconColor / VibrantMenuTokens
|
|
1385
|
+
selected ? colors.selectedText : colors.trailingIconColor
|
|
1386
|
+
),
|
|
1387
|
+
"aria-hidden": trailingIcon ? "true" : void 0,
|
|
1388
|
+
children: trailingText ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label-small tracking-wider", children: trailingText }) : trailingIcon
|
|
1389
|
+
}
|
|
1390
|
+
)
|
|
1391
|
+
]
|
|
1392
|
+
})
|
|
1393
|
+
)
|
|
1394
|
+
})
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
);
|
|
1398
|
+
MenuItem.displayName = "MenuItem";
|
|
1399
|
+
function SubMenu({
|
|
1400
|
+
children,
|
|
1401
|
+
trigger,
|
|
1402
|
+
side = "right",
|
|
1403
|
+
colorVariant: propColorVariant,
|
|
1404
|
+
hoverOpenDelay = 200,
|
|
1405
|
+
hoverCloseDelay = 300
|
|
1406
|
+
}) {
|
|
1407
|
+
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1408
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1409
|
+
const [open, setOpen] = React38__namespace.useState(false);
|
|
1410
|
+
const openTimerRef = React38__namespace.useRef(null);
|
|
1411
|
+
const closeTimerRef = React38__namespace.useRef(
|
|
1412
|
+
null
|
|
601
1413
|
);
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
1414
|
+
const clearTimers = React38__namespace.useCallback(() => {
|
|
1415
|
+
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1416
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1417
|
+
}, []);
|
|
1418
|
+
const handleTriggerPointerEnter = React38__namespace.useCallback(() => {
|
|
1419
|
+
clearTimers();
|
|
1420
|
+
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1421
|
+
}, [hoverOpenDelay, clearTimers]);
|
|
1422
|
+
const handleTriggerPointerLeave = React38__namespace.useCallback(() => {
|
|
1423
|
+
clearTimers();
|
|
1424
|
+
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1425
|
+
}, [hoverCloseDelay, clearTimers]);
|
|
1426
|
+
const handleContentPointerEnter = React38__namespace.useCallback(() => {
|
|
1427
|
+
clearTimers();
|
|
1428
|
+
}, [clearTimers]);
|
|
1429
|
+
const handleContentPointerLeave = React38__namespace.useCallback(() => {
|
|
1430
|
+
clearTimers();
|
|
1431
|
+
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1432
|
+
}, [hoverCloseDelay, clearTimers]);
|
|
1433
|
+
React38__namespace.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1434
|
+
const Sub3 = menuPrimitive === "context" ? RxContextMenu__namespace.Sub : DropdownMenu__namespace.Sub;
|
|
1435
|
+
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubTrigger : DropdownMenu__namespace.SubTrigger;
|
|
1436
|
+
const SubContent3 = menuPrimitive === "context" ? RxContextMenu__namespace.SubContent : DropdownMenu__namespace.SubContent;
|
|
1437
|
+
const Portal7 = menuPrimitive === "context" ? RxContextMenu__namespace.Portal : DropdownMenu__namespace.Portal;
|
|
1438
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Sub3, { open, onOpenChange: setOpen, children: [
|
|
1439
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1440
|
+
SubTrigger3,
|
|
1441
|
+
{
|
|
1442
|
+
className: "w-full outline-none",
|
|
1443
|
+
onPointerEnter: handleTriggerPointerEnter,
|
|
1444
|
+
onPointerLeave: handleTriggerPointerLeave,
|
|
1445
|
+
children: React38__namespace.isValidElement(trigger) ? React38__namespace.cloneElement(trigger, {
|
|
1446
|
+
isSubTrigger: true,
|
|
1447
|
+
// Auto-add chevron if missing
|
|
1448
|
+
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "chevron_right", size: 20 })
|
|
1449
|
+
}) : trigger
|
|
1450
|
+
}
|
|
1451
|
+
),
|
|
1452
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsx(Portal7, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1453
|
+
SubContent3,
|
|
1454
|
+
{
|
|
1455
|
+
sideOffset: 4,
|
|
1456
|
+
alignOffset: -4,
|
|
1457
|
+
forceMount: true,
|
|
1458
|
+
className: "outline-none",
|
|
1459
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1460
|
+
SubMenuContent,
|
|
1461
|
+
{
|
|
1462
|
+
side,
|
|
1463
|
+
colorVariant,
|
|
1464
|
+
onPointerEnter: handleContentPointerEnter,
|
|
1465
|
+
onPointerLeave: handleContentPointerLeave,
|
|
1466
|
+
children
|
|
1467
|
+
}
|
|
1468
|
+
)
|
|
1469
|
+
}
|
|
1470
|
+
) }) })
|
|
1471
|
+
] });
|
|
1472
|
+
}
|
|
1473
|
+
SubMenu.displayName = "SubMenu";
|
|
1474
|
+
function SubMenuContent({
|
|
1475
|
+
children,
|
|
1476
|
+
side,
|
|
1477
|
+
colorVariant: propColorVariant,
|
|
1478
|
+
onPointerEnter,
|
|
1479
|
+
onPointerLeave
|
|
1480
|
+
}) {
|
|
1481
|
+
const { menuVariant, colorVariant: contextColorVariant } = useMenuContext();
|
|
1482
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1483
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
606
1484
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
"rounded-lg px-3 py-2 text-sm text-m3-on-surface",
|
|
614
|
-
"outline-none transition-colors duration-150",
|
|
615
|
-
"hover:bg-m3-on-surface/8",
|
|
616
|
-
"focus:bg-m3-on-surface/12",
|
|
617
|
-
"data-disabled:pointer-events-none data-disabled:opacity-38",
|
|
618
|
-
"focus-visible:ring-0",
|
|
619
|
-
// Radix gốc handle ring internally
|
|
620
|
-
inset && "pl-8",
|
|
621
|
-
className
|
|
622
|
-
)
|
|
623
|
-
}, props)
|
|
624
|
-
);
|
|
625
|
-
});
|
|
626
|
-
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
627
|
-
var DropdownMenuCheckboxItem = React31__namespace.forwardRef((_a, ref) => {
|
|
628
|
-
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
629
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
630
|
-
RadixDropdown__namespace.CheckboxItem,
|
|
631
|
-
__spreadProps(__spreadValues({
|
|
632
|
-
ref,
|
|
1485
|
+
react.m.div,
|
|
1486
|
+
{
|
|
1487
|
+
role: "menu",
|
|
1488
|
+
"aria-orientation": "vertical",
|
|
1489
|
+
onPointerEnter,
|
|
1490
|
+
onPointerLeave,
|
|
633
1491
|
className: cn(
|
|
634
|
-
"
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
1492
|
+
"z-50 flex flex-col",
|
|
1493
|
+
// Width constraints
|
|
1494
|
+
MENU_MIN_WIDTH,
|
|
1495
|
+
MENU_MAX_WIDTH,
|
|
1496
|
+
// Vertical padding: 8dp
|
|
1497
|
+
MENU_POPUP_PADDING_Y,
|
|
1498
|
+
// Gap between groups: 2dp
|
|
1499
|
+
MENU_GROUP_GAP,
|
|
1500
|
+
// Container background
|
|
1501
|
+
colors.containerBg,
|
|
1502
|
+
// Container shape: CornerExtraSmall (4px)
|
|
1503
|
+
MENU_CONTAINER_SHAPE,
|
|
1504
|
+
// Elevation-2 shadow
|
|
1505
|
+
"elevation-2",
|
|
1506
|
+
// Overflow clip
|
|
1507
|
+
"overflow-hidden",
|
|
1508
|
+
"outline-none"
|
|
640
1509
|
),
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
}
|
|
650
|
-
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
651
|
-
var DropdownMenuRadioItem = React31__namespace.forwardRef((_a, ref) => {
|
|
652
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
653
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
654
|
-
RadixDropdown__namespace.RadioItem,
|
|
655
|
-
__spreadProps(__spreadValues({
|
|
656
|
-
ref,
|
|
657
|
-
className: cn(
|
|
658
|
-
"relative flex cursor-pointer select-none items-center gap-2",
|
|
659
|
-
"rounded-lg py-2 pl-8 pr-3 text-sm text-m3-on-surface",
|
|
660
|
-
"outline-none transition-colors duration-150",
|
|
661
|
-
"hover:bg-m3-on-surface/8 focus:bg-m3-on-surface/12",
|
|
662
|
-
"data-disabled:pointer-events-none data-disabled:opacity-38",
|
|
663
|
-
className
|
|
664
|
-
)
|
|
665
|
-
}, props), {
|
|
666
|
-
children: [
|
|
667
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(RadixDropdown__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "circle", fill: 1, size: 8, "aria-hidden": "true" }) }) }),
|
|
668
|
-
children
|
|
669
|
-
]
|
|
670
|
-
})
|
|
671
|
-
);
|
|
672
|
-
});
|
|
673
|
-
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
674
|
-
var DropdownMenuSeparator = React31__namespace.forwardRef((_a, ref) => {
|
|
675
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
676
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
677
|
-
RadixDropdown__namespace.Separator,
|
|
678
|
-
__spreadValues({
|
|
679
|
-
ref,
|
|
680
|
-
className: cn("my-1 h-px bg-m3-outline-variant", className)
|
|
681
|
-
}, props)
|
|
1510
|
+
variants: SUBMENU_CONTAINER_VARIANTS,
|
|
1511
|
+
initial: "hidden",
|
|
1512
|
+
animate: "visible",
|
|
1513
|
+
exit: "exit",
|
|
1514
|
+
style: {
|
|
1515
|
+
transformOrigin: side === "right" ? "top left" : "top right"
|
|
1516
|
+
},
|
|
1517
|
+
children
|
|
1518
|
+
}
|
|
682
1519
|
);
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
var
|
|
686
|
-
var _b = _a, { className,
|
|
1520
|
+
}
|
|
1521
|
+
SubMenuContent.displayName = "SubMenuContent";
|
|
1522
|
+
var VerticalMenuDivider = React38__namespace.forwardRef((_a, ref) => {
|
|
1523
|
+
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
687
1524
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
|
-
|
|
1525
|
+
"hr",
|
|
689
1526
|
__spreadValues({
|
|
690
1527
|
ref,
|
|
691
1528
|
className: cn(
|
|
692
|
-
|
|
693
|
-
|
|
1529
|
+
// HorizontalDividerPadding: horizontal=12dp, vertical=2dp
|
|
1530
|
+
"mx-3 my-0.5",
|
|
1531
|
+
// 1px height, no default border
|
|
1532
|
+
"h-px border-0",
|
|
1533
|
+
// Source: MenuDefaults.HorizontalDividerPadding / outline-variant
|
|
1534
|
+
"bg-m3-outline-variant",
|
|
694
1535
|
className
|
|
695
1536
|
)
|
|
696
1537
|
}, props)
|
|
697
1538
|
);
|
|
698
1539
|
});
|
|
699
|
-
|
|
700
|
-
var
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
{
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
1540
|
+
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1541
|
+
var VerticalMenuGroup = MenuGroup;
|
|
1542
|
+
var VerticalMenuContent = React38__namespace.forwardRef(
|
|
1543
|
+
(_a, ref) => {
|
|
1544
|
+
var _b = _a, {
|
|
1545
|
+
children,
|
|
1546
|
+
separatorStyle = "gap",
|
|
1547
|
+
colorVariant: propColorVariant,
|
|
1548
|
+
className
|
|
1549
|
+
} = _b, props = __objRest(_b, [
|
|
1550
|
+
"children",
|
|
1551
|
+
"separatorStyle",
|
|
1552
|
+
"colorVariant",
|
|
1553
|
+
"className"
|
|
1554
|
+
]);
|
|
1555
|
+
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
1556
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1557
|
+
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1558
|
+
const flattenChildren = (children2) => {
|
|
1559
|
+
return React38__namespace.Children.toArray(children2).reduce(
|
|
1560
|
+
(acc, child) => {
|
|
1561
|
+
if (React38__namespace.isValidElement(child)) {
|
|
1562
|
+
if (child.type === React38__namespace.Fragment) {
|
|
1563
|
+
return acc.concat(
|
|
1564
|
+
flattenChildren(
|
|
1565
|
+
child.props.children
|
|
1566
|
+
)
|
|
1567
|
+
);
|
|
1568
|
+
}
|
|
1569
|
+
acc.push(child);
|
|
725
1570
|
}
|
|
1571
|
+
return acc;
|
|
1572
|
+
},
|
|
1573
|
+
[]
|
|
1574
|
+
);
|
|
1575
|
+
};
|
|
1576
|
+
const validChildren = flattenChildren(children);
|
|
1577
|
+
const groupCount = validChildren.length;
|
|
1578
|
+
const enhancedChildren = validChildren.map(
|
|
1579
|
+
(child, i) => React38__namespace.cloneElement(child, {
|
|
1580
|
+
index: i,
|
|
1581
|
+
count: groupCount,
|
|
1582
|
+
isGapVariant: separatorStyle === "gap"
|
|
1583
|
+
})
|
|
1584
|
+
);
|
|
1585
|
+
const renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
1586
|
+
if (i > 0) {
|
|
1587
|
+
acc.push(
|
|
1588
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1589
|
+
VerticalMenuDivider,
|
|
1590
|
+
{},
|
|
1591
|
+
`divider-${child.key || i}`
|
|
1592
|
+
)
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
acc.push(child);
|
|
1596
|
+
return acc;
|
|
1597
|
+
}, []) : enhancedChildren;
|
|
1598
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1599
|
+
"div",
|
|
1600
|
+
__spreadProps(__spreadValues({
|
|
1601
|
+
ref,
|
|
1602
|
+
className: cn(
|
|
1603
|
+
"flex flex-col w-full",
|
|
1604
|
+
// Gap variant: transparent background + 2dp gap — page bg shows through gaps.
|
|
1605
|
+
// Divider variant: solid container background behind all groups.
|
|
1606
|
+
separatorStyle === "gap" ? cn("bg-transparent", MENU_GROUP_GAP) : colors.containerBg,
|
|
1607
|
+
className
|
|
726
1608
|
)
|
|
727
|
-
|
|
728
|
-
|
|
1609
|
+
}, props), {
|
|
1610
|
+
children: renderedChildren
|
|
1611
|
+
})
|
|
1612
|
+
);
|
|
1613
|
+
}
|
|
1614
|
+
);
|
|
1615
|
+
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1616
|
+
var VerticalMenu = React38__namespace.forwardRef((_a, ref) => {
|
|
1617
|
+
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1618
|
+
const noop = React38__namespace.useCallback(() => {
|
|
1619
|
+
}, []);
|
|
1620
|
+
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1621
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1622
|
+
const mergedRef = React38__namespace.useCallback(
|
|
1623
|
+
(node) => {
|
|
1624
|
+
containerRef.current = node;
|
|
1625
|
+
if (typeof ref === "function") ref(node);
|
|
1626
|
+
else if (ref)
|
|
1627
|
+
ref.current = node;
|
|
1628
|
+
},
|
|
1629
|
+
[ref]
|
|
729
1630
|
);
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
1631
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
1632
|
+
(e) => {
|
|
1633
|
+
var _a2;
|
|
1634
|
+
if (!containerRef.current) return;
|
|
1635
|
+
const items = Array.from(
|
|
1636
|
+
containerRef.current.querySelectorAll(
|
|
1637
|
+
'[role="menuitem"]:not([aria-disabled="true"]):not([tabindex="-1"]),[role="menuitemcheckbox"]:not([aria-disabled="true"]):not([tabindex="-1"]),[role="menuitemradio"]:not([aria-disabled="true"]):not([tabindex="-1"])'
|
|
1638
|
+
)
|
|
1639
|
+
);
|
|
1640
|
+
if (!items.length) return;
|
|
1641
|
+
const idx = items.indexOf(document.activeElement);
|
|
1642
|
+
let next = null;
|
|
1643
|
+
switch (e.key) {
|
|
1644
|
+
case "ArrowDown":
|
|
1645
|
+
e.preventDefault();
|
|
1646
|
+
next = idx < items.length - 1 ? idx + 1 : 0;
|
|
1647
|
+
break;
|
|
1648
|
+
case "ArrowUp":
|
|
1649
|
+
e.preventDefault();
|
|
1650
|
+
next = idx > 0 ? idx - 1 : items.length - 1;
|
|
1651
|
+
break;
|
|
1652
|
+
case "Home":
|
|
1653
|
+
e.preventDefault();
|
|
1654
|
+
next = 0;
|
|
1655
|
+
break;
|
|
1656
|
+
case "End":
|
|
1657
|
+
e.preventDefault();
|
|
1658
|
+
next = items.length - 1;
|
|
1659
|
+
break;
|
|
1660
|
+
default:
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
if (next !== null) (_a2 = items[next]) == null ? void 0 : _a2.focus();
|
|
1664
|
+
},
|
|
1665
|
+
[]
|
|
1666
|
+
);
|
|
1667
|
+
const separatorStyle = detectSeparatorStyle(children);
|
|
1668
|
+
const isGapVariant = separatorStyle !== "divider";
|
|
738
1669
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
1670
|
+
MenuProvider,
|
|
1671
|
+
{
|
|
1672
|
+
variant: "expressive",
|
|
1673
|
+
colorVariant,
|
|
1674
|
+
menuPrimitive: "static",
|
|
1675
|
+
open: true,
|
|
1676
|
+
onOpenChange: noop,
|
|
1677
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1678
|
+
"div",
|
|
1679
|
+
__spreadProps(__spreadValues({
|
|
1680
|
+
ref: mergedRef,
|
|
1681
|
+
role: "menu",
|
|
1682
|
+
"aria-orientation": "vertical",
|
|
1683
|
+
onKeyDown: handleKeyDown,
|
|
1684
|
+
className: cn(
|
|
1685
|
+
// Width constraints: 112dp min, 280dp max (MenuTokens)
|
|
1686
|
+
MENU_MIN_WIDTH,
|
|
1687
|
+
MENU_MAX_WIDTH,
|
|
1688
|
+
"flex flex-col",
|
|
1689
|
+
isGapVariant ? [
|
|
1690
|
+
// GAP VARIANT: NO overflow-hidden — groups must morph freely.
|
|
1691
|
+
"outline-none"
|
|
1692
|
+
// NO background — transparent between segments.
|
|
1693
|
+
// NO rounded corners — each group manages its own shape.
|
|
1694
|
+
// Elevation is managed by each individual group.
|
|
1695
|
+
] : [
|
|
1696
|
+
// DIVIDER VARIANT: Container clips the content.
|
|
1697
|
+
"rounded-2xl",
|
|
1698
|
+
"overflow-hidden",
|
|
1699
|
+
colors.containerBg,
|
|
1700
|
+
"elevation-2",
|
|
1701
|
+
"outline-none"
|
|
1702
|
+
],
|
|
1703
|
+
className
|
|
1704
|
+
)
|
|
1705
|
+
}, props), {
|
|
1706
|
+
children
|
|
1707
|
+
})
|
|
744
1708
|
)
|
|
745
|
-
}
|
|
1709
|
+
}
|
|
746
1710
|
);
|
|
747
|
-
};
|
|
748
|
-
|
|
1711
|
+
});
|
|
1712
|
+
VerticalMenu.displayName = "VerticalMenu";
|
|
1713
|
+
function detectSeparatorStyle(children) {
|
|
1714
|
+
const child = React38__namespace.Children.toArray(children).find(React38__namespace.isValidElement);
|
|
1715
|
+
if (child) {
|
|
1716
|
+
const style = child.props.separatorStyle;
|
|
1717
|
+
if (style) return style;
|
|
1718
|
+
}
|
|
1719
|
+
return "gap";
|
|
1720
|
+
}
|
|
749
1721
|
function MoreVertIcon() {
|
|
750
1722
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
751
1723
|
"span",
|
|
@@ -760,10 +1732,14 @@ function OverflowItem({ item }) {
|
|
|
760
1732
|
var _a;
|
|
761
1733
|
if (item.type === "toggleable") {
|
|
762
1734
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
763
|
-
|
|
1735
|
+
MenuItem,
|
|
764
1736
|
{
|
|
765
|
-
|
|
766
|
-
|
|
1737
|
+
role: "menuitemcheckbox",
|
|
1738
|
+
selected: (_a = item.checked) != null ? _a : false,
|
|
1739
|
+
onClick: () => {
|
|
1740
|
+
var _a2;
|
|
1741
|
+
return (_a2 = item.onCheckedChange) == null ? void 0 : _a2.call(item, !item.checked);
|
|
1742
|
+
},
|
|
767
1743
|
disabled: item.enabled === false,
|
|
768
1744
|
children: item.label
|
|
769
1745
|
}
|
|
@@ -778,15 +1754,15 @@ function OverflowItem({ item }) {
|
|
|
778
1754
|
}
|
|
779
1755
|
}) });
|
|
780
1756
|
}
|
|
781
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1757
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MenuItem, { onClick: item.onClick, disabled: item.enabled === false, children: item.label });
|
|
782
1758
|
}
|
|
783
1759
|
function AppBarOverflowIndicator({
|
|
784
1760
|
items,
|
|
785
1761
|
className
|
|
786
1762
|
}) {
|
|
787
1763
|
if (items.length === 0) return null;
|
|
788
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
789
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1764
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Menu, { children: [
|
|
1765
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
790
1766
|
"button",
|
|
791
1767
|
{
|
|
792
1768
|
type: "button",
|
|
@@ -805,7 +1781,7 @@ function AppBarOverflowIndicator({
|
|
|
805
1781
|
children: /* @__PURE__ */ jsxRuntime.jsx(MoreVertIcon, {})
|
|
806
1782
|
}
|
|
807
1783
|
) }),
|
|
808
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1784
|
+
/* @__PURE__ */ jsxRuntime.jsx(MenuContent, { align: "end", sideOffset: 4, children: items.map((item, index) => (
|
|
809
1785
|
// biome-ignore lint/suspicious/noArrayIndexKey: static list from props
|
|
810
1786
|
/* @__PURE__ */ jsxRuntime.jsx(OverflowItem, { item }, index)
|
|
811
1787
|
)) })
|
|
@@ -816,11 +1792,11 @@ function AppBarColumn({
|
|
|
816
1792
|
maxItemCount,
|
|
817
1793
|
className
|
|
818
1794
|
}) {
|
|
819
|
-
const containerRef =
|
|
820
|
-
const [visibleCount, setVisibleCount] =
|
|
1795
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1796
|
+
const [visibleCount, setVisibleCount] = React38__namespace.useState(
|
|
821
1797
|
maxItemCount != null ? maxItemCount : items.length
|
|
822
1798
|
);
|
|
823
|
-
|
|
1799
|
+
React38__namespace.useEffect(() => {
|
|
824
1800
|
if (maxItemCount !== void 0) {
|
|
825
1801
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
826
1802
|
return;
|
|
@@ -868,11 +1844,11 @@ function AppBarColumn({
|
|
|
868
1844
|
);
|
|
869
1845
|
}
|
|
870
1846
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
871
|
-
const containerRef =
|
|
872
|
-
const [visibleCount, setVisibleCount] =
|
|
1847
|
+
const containerRef = React38__namespace.useRef(null);
|
|
1848
|
+
const [visibleCount, setVisibleCount] = React38__namespace.useState(
|
|
873
1849
|
maxItemCount != null ? maxItemCount : items.length
|
|
874
1850
|
);
|
|
875
|
-
|
|
1851
|
+
React38__namespace.useEffect(() => {
|
|
876
1852
|
if (maxItemCount !== void 0) {
|
|
877
1853
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
878
1854
|
return;
|
|
@@ -926,12 +1902,12 @@ function useAppBarScroll({
|
|
|
926
1902
|
collapsedHeight = 64,
|
|
927
1903
|
expandedHeight = 112
|
|
928
1904
|
} = {}) {
|
|
929
|
-
const [isScrolled, setIsScrolled] =
|
|
930
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
931
|
-
const [isHidden, setIsHidden] =
|
|
932
|
-
const prevScrollYRef =
|
|
1905
|
+
const [isScrolled, setIsScrolled] = React38__namespace.useState(false);
|
|
1906
|
+
const [collapsedFraction, setCollapsedFraction] = React38__namespace.useState(0);
|
|
1907
|
+
const [isHidden, setIsHidden] = React38__namespace.useState(false);
|
|
1908
|
+
const prevScrollYRef = React38__namespace.useRef(0);
|
|
933
1909
|
const hideThreshold = 64;
|
|
934
|
-
|
|
1910
|
+
React38__namespace.useEffect(() => {
|
|
935
1911
|
var _a;
|
|
936
1912
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
937
1913
|
const getScrollY = () => {
|
|
@@ -1052,7 +2028,7 @@ function useFlexibleAppBar({
|
|
|
1052
2028
|
expandedHeight
|
|
1053
2029
|
});
|
|
1054
2030
|
const scrollProgress = react.useMotionValue(0);
|
|
1055
|
-
|
|
2031
|
+
React38__namespace.useEffect(() => {
|
|
1056
2032
|
scrollProgress.set(
|
|
1057
2033
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
1058
2034
|
);
|
|
@@ -1393,7 +2369,7 @@ function SearchAppBar({
|
|
|
1393
2369
|
}) {
|
|
1394
2370
|
var _a, _b;
|
|
1395
2371
|
const shouldReduceMotion = react.useReducedMotion();
|
|
1396
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2372
|
+
const [isSearchOpen, setIsSearchOpen] = React38__namespace.useState(false);
|
|
1397
2373
|
const { isScrolled } = useAppBarScroll({
|
|
1398
2374
|
scrollElement,
|
|
1399
2375
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -1507,8 +2483,8 @@ function SearchView({
|
|
|
1507
2483
|
className
|
|
1508
2484
|
}) {
|
|
1509
2485
|
const shouldReduceMotion = react.useReducedMotion();
|
|
1510
|
-
const inputRef =
|
|
1511
|
-
|
|
2486
|
+
const inputRef = React38__namespace.useRef(null);
|
|
2487
|
+
React38__namespace.useEffect(() => {
|
|
1512
2488
|
const timer = window.setTimeout(() => {
|
|
1513
2489
|
var _a;
|
|
1514
2490
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -1778,9 +2754,9 @@ function formatBadgeLabel(children, max) {
|
|
|
1778
2754
|
return "";
|
|
1779
2755
|
}
|
|
1780
2756
|
function detectBadgeHasContent(badge) {
|
|
1781
|
-
return
|
|
2757
|
+
return React38__namespace.isValidElement(badge) && badge.props.children != null;
|
|
1782
2758
|
}
|
|
1783
|
-
var BadgeImpl =
|
|
2759
|
+
var BadgeImpl = React38__namespace.forwardRef(
|
|
1784
2760
|
(_a, ref) => {
|
|
1785
2761
|
var _b = _a, {
|
|
1786
2762
|
children,
|
|
@@ -1834,7 +2810,7 @@ var BadgeImpl = React31__namespace.forwardRef(
|
|
|
1834
2810
|
}
|
|
1835
2811
|
);
|
|
1836
2812
|
BadgeImpl.displayName = "Badge";
|
|
1837
|
-
var Badge =
|
|
2813
|
+
var Badge = React38__namespace.memo(BadgeImpl);
|
|
1838
2814
|
function BadgedBox({
|
|
1839
2815
|
badge,
|
|
1840
2816
|
children,
|
|
@@ -1900,11 +2876,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
1900
2876
|
var ROTATE_VALUES = "0 24 24; 154 24 24; 309 24 24; 463 24 24; 617 24 24; 771 24 24; 926 24 24; 1080 24 24";
|
|
1901
2877
|
var DETERMINATE_CIRCLE = "M24 7 C34.49 7 41 13.51 41 24 C41 34.49 34.49 41 24 41 C13.51 41 7 34.49 7 24 C7 13.51 13.51 7 24 7 Z";
|
|
1902
2878
|
var DETERMINATE_SOFT_BURST = "M20.9 10.4 21.4 9.5 21.9 8.7 22.5 7.8 23.2 7.2 24.2 7 25.1 7.4 25.7 8.1 26.2 9 26.8 9.8 27.3 10.6 28.1 11.2 29 11.3 30 11 30.9 10.6 31.8 10.3 32.8 9.9 33.7 10 34.5 10.6 34.9 11.5 34.8 12.5 34.8 13.5 34.7 14.5 34.7 15.5 35.2 16.3 36 16.8 37 17.1 37.9 17.3 38.9 17.5 39.8 17.9 40.4 18.7 40.5 19.7 40 20.5 39.4 21.3 38.7 22 38.1 22.8 37.6 23.7 37.7 24.6 38.3 25.5 38.9 26.2 39.6 27 40.2 27.7 40.5 28.7 40.3 29.6 39.5 30.3 38.6 30.6 37.6 30.8 36.7 31 35.7 31.3 35 31.9 34.6 32.8 34.7 33.8 34.8 34.8 34.9 35.8 34.8 36.8 34.3 37.6 33.4 38.1 32.4 38 31.5 37.6 30.6 37.2 29.7 36.9 28.7 36.6 27.8 36.9 27.1 37.6 26.6 38.5 26.1 39.3 25.5 40.2 24.8 40.8 23.8 41 22.9 40.6 22.3 39.9 21.8 39 21.2 38.2 20.7 37.4 19.9 36.8 19 36.7 18 37 17.1 37.4 16.2 37.7 15.2 38.1 14.3 38 13.5 37.4 13.1 36.5 13.2 35.5 13.2 34.5 13.3 33.5 13.3 32.5 12.8 31.7 12 31.2 11 31 10.1 30.7 9.1 30.5 8.2 30.1 7.6 29.3 7.5 28.3 8 27.5 8.7 26.7 9.3 26 9.9 25.2 10.4 24.3 10.3 23.4 9.7 22.5 9.1 21.8 8.4 21 7.8 20.3 7.5 19.3 7.7 18.4 8.5 17.7 9.4 17.4 10.4 17.2 11.3 17 12.3 16.7 13 16.1 13.4 15.2 13.3 14.2 13.2 13.2 13.1 12.2 13.2 11.2 13.7 10.4 14.6 9.9 15.6 10 16.5 10.4 17.4 10.8 18.3 11.1 19.3 11.4 20.2 11.1Z";
|
|
1903
|
-
var IndeterminateSvg =
|
|
2879
|
+
var IndeterminateSvg = React38__namespace.memo(function IndeterminateSvg2({
|
|
1904
2880
|
size
|
|
1905
2881
|
}) {
|
|
1906
|
-
const [ready, setReady] =
|
|
1907
|
-
|
|
2882
|
+
const [ready, setReady] = React38__namespace.useState(false);
|
|
2883
|
+
React38__namespace.useEffect(() => {
|
|
1908
2884
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
1909
2885
|
return () => cancelAnimationFrame(raf);
|
|
1910
2886
|
}, []);
|
|
@@ -1949,7 +2925,7 @@ var IndeterminateSvg = React31__namespace.memo(function IndeterminateSvg2({
|
|
|
1949
2925
|
}
|
|
1950
2926
|
);
|
|
1951
2927
|
});
|
|
1952
|
-
var DeterminateSvg =
|
|
2928
|
+
var DeterminateSvg = React38__namespace.memo(function DeterminateSvg2({
|
|
1953
2929
|
size,
|
|
1954
2930
|
progress
|
|
1955
2931
|
}) {
|
|
@@ -1974,7 +2950,7 @@ var DeterminateSvg = React31__namespace.memo(function DeterminateSvg2({
|
|
|
1974
2950
|
}
|
|
1975
2951
|
);
|
|
1976
2952
|
});
|
|
1977
|
-
var LoadingIndicator =
|
|
2953
|
+
var LoadingIndicator = React38__namespace.forwardRef(
|
|
1978
2954
|
(_a, ref) => {
|
|
1979
2955
|
var _b = _a, {
|
|
1980
2956
|
variant = "uncontained",
|
|
@@ -2089,7 +3065,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
2089
3065
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
2090
3066
|
return d;
|
|
2091
3067
|
}
|
|
2092
|
-
var CircularProgress =
|
|
3068
|
+
var CircularProgress = React38__namespace.forwardRef(
|
|
2093
3069
|
(_a, ref) => {
|
|
2094
3070
|
var _b = _a, {
|
|
2095
3071
|
value,
|
|
@@ -2127,15 +3103,15 @@ var CircularProgress = React31__namespace.forwardRef(
|
|
|
2127
3103
|
const isWavy = shape === "wavy";
|
|
2128
3104
|
const BASELINE_SIZE = 48;
|
|
2129
3105
|
const scaleFactor = size / BASELINE_SIZE;
|
|
2130
|
-
const effectiveAmplitude =
|
|
3106
|
+
const effectiveAmplitude = React38__namespace.useMemo(
|
|
2131
3107
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
2132
3108
|
[amplitude, scaleFactor]
|
|
2133
3109
|
);
|
|
2134
|
-
const effectiveWavelength =
|
|
3110
|
+
const effectiveWavelength = React38__namespace.useMemo(
|
|
2135
3111
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
2136
3112
|
[wavelength, scaleFactor]
|
|
2137
3113
|
);
|
|
2138
|
-
const wavyActivePath =
|
|
3114
|
+
const wavyActivePath = React38__namespace.useMemo(
|
|
2139
3115
|
() => isWavy ? generateWavyCircularPath(
|
|
2140
3116
|
center,
|
|
2141
3117
|
radius,
|
|
@@ -2144,8 +3120,8 @@ var CircularProgress = React31__namespace.forwardRef(
|
|
|
2144
3120
|
) : null,
|
|
2145
3121
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
2146
3122
|
);
|
|
2147
|
-
const circumference =
|
|
2148
|
-
const gapForTrack =
|
|
3123
|
+
const circumference = React38__namespace.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
3124
|
+
const gapForTrack = React38__namespace.useMemo(
|
|
2149
3125
|
() => (gapSize + trackHeight) / circumference,
|
|
2150
3126
|
[gapSize, trackHeight, circumference]
|
|
2151
3127
|
);
|
|
@@ -2334,9 +3310,9 @@ var CircularProgress = React31__namespace.forwardRef(
|
|
|
2334
3310
|
);
|
|
2335
3311
|
CircularProgress.displayName = "CircularProgress";
|
|
2336
3312
|
function useContainerWidth() {
|
|
2337
|
-
const [width, setWidth] =
|
|
2338
|
-
const observerRef =
|
|
2339
|
-
const ref =
|
|
3313
|
+
const [width, setWidth] = React38__namespace.useState(0);
|
|
3314
|
+
const observerRef = React38__namespace.useRef(null);
|
|
3315
|
+
const ref = React38__namespace.useCallback((node) => {
|
|
2340
3316
|
if (observerRef.current) {
|
|
2341
3317
|
observerRef.current.disconnect();
|
|
2342
3318
|
observerRef.current = null;
|
|
@@ -2350,7 +3326,7 @@ function useContainerWidth() {
|
|
|
2350
3326
|
observerRef.current = obs;
|
|
2351
3327
|
}
|
|
2352
3328
|
}, []);
|
|
2353
|
-
|
|
3329
|
+
React38__namespace.useEffect(() => {
|
|
2354
3330
|
return () => {
|
|
2355
3331
|
if (observerRef.current) {
|
|
2356
3332
|
observerRef.current.disconnect();
|
|
@@ -2360,7 +3336,7 @@ function useContainerWidth() {
|
|
|
2360
3336
|
return [ref, width];
|
|
2361
3337
|
}
|
|
2362
3338
|
function useMergedRef(...refs) {
|
|
2363
|
-
return
|
|
3339
|
+
return React38__namespace.useCallback(
|
|
2364
3340
|
(node) => {
|
|
2365
3341
|
for (const ref of refs) {
|
|
2366
3342
|
if (typeof ref === "function") {
|
|
@@ -2374,7 +3350,7 @@ function useMergedRef(...refs) {
|
|
|
2374
3350
|
[refs]
|
|
2375
3351
|
);
|
|
2376
3352
|
}
|
|
2377
|
-
var FlatLinearTrack =
|
|
3353
|
+
var FlatLinearTrack = React38__namespace.memo(function FlatLinearTrack2({
|
|
2378
3354
|
trackHeight,
|
|
2379
3355
|
activeColor,
|
|
2380
3356
|
trackColor,
|
|
@@ -2450,7 +3426,7 @@ var FlatLinearTrack = React31__namespace.memo(function FlatLinearTrack2({
|
|
|
2450
3426
|
}
|
|
2451
3427
|
);
|
|
2452
3428
|
});
|
|
2453
|
-
var WavyLinearTrack =
|
|
3429
|
+
var WavyLinearTrack = React38__namespace.memo(function WavyLinearTrack2({
|
|
2454
3430
|
trackHeight,
|
|
2455
3431
|
svgHeight,
|
|
2456
3432
|
amplitude,
|
|
@@ -2469,13 +3445,13 @@ var WavyLinearTrack = React31__namespace.memo(function WavyLinearTrack2({
|
|
|
2469
3445
|
}) {
|
|
2470
3446
|
const isDeterminate = typeof value === "number";
|
|
2471
3447
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
2472
|
-
const titleId =
|
|
3448
|
+
const titleId = React38__namespace.useId();
|
|
2473
3449
|
const [containerRef, width] = useContainerWidth();
|
|
2474
|
-
const activePathRef =
|
|
2475
|
-
const trackPathRef =
|
|
3450
|
+
const activePathRef = React38__namespace.useRef(null);
|
|
3451
|
+
const trackPathRef = React38__namespace.useRef(null);
|
|
2476
3452
|
const amplitudeMV = react.useMotionValue(amplitude);
|
|
2477
3453
|
const fractionMV = react.useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
2478
|
-
|
|
3454
|
+
React38__namespace.useEffect(() => {
|
|
2479
3455
|
if (isDeterminate) {
|
|
2480
3456
|
const fraction = clampedValue / 100;
|
|
2481
3457
|
let targetAmp = amplitude;
|
|
@@ -2646,7 +3622,7 @@ var WavyLinearTrack = React31__namespace.memo(function WavyLinearTrack2({
|
|
|
2646
3622
|
}
|
|
2647
3623
|
);
|
|
2648
3624
|
});
|
|
2649
|
-
var LinearProgress =
|
|
3625
|
+
var LinearProgress = React38__namespace.forwardRef(
|
|
2650
3626
|
(_a, ref) => {
|
|
2651
3627
|
var _b = _a, {
|
|
2652
3628
|
value,
|
|
@@ -2687,10 +3663,10 @@ var LinearProgress = React31__namespace.forwardRef(
|
|
|
2687
3663
|
]);
|
|
2688
3664
|
const isDeterminate = value !== void 0;
|
|
2689
3665
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
2690
|
-
const containerRef =
|
|
3666
|
+
const containerRef = React38__namespace.useRef(null);
|
|
2691
3667
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
2692
|
-
const [isRtl, setIsRtl] =
|
|
2693
|
-
|
|
3668
|
+
const [isRtl, setIsRtl] = React38__namespace.useState(false);
|
|
3669
|
+
React38__namespace.useEffect(() => {
|
|
2694
3670
|
if (containerRef.current) {
|
|
2695
3671
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
2696
3672
|
setIsRtl(dir === "rtl");
|
|
@@ -2698,16 +3674,16 @@ var LinearProgress = React31__namespace.forwardRef(
|
|
|
2698
3674
|
}, []);
|
|
2699
3675
|
const isWavy = shape === "wavy";
|
|
2700
3676
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
2701
|
-
const effectiveAmplitude =
|
|
2702
|
-
const svgHeight =
|
|
3677
|
+
const effectiveAmplitude = React38__namespace.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
3678
|
+
const svgHeight = React38__namespace.useMemo(
|
|
2703
3679
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
2704
3680
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
2705
3681
|
);
|
|
2706
|
-
const shouldShowStop =
|
|
3682
|
+
const shouldShowStop = React38__namespace.useMemo(
|
|
2707
3683
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
2708
3684
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
2709
3685
|
);
|
|
2710
|
-
const stopSize =
|
|
3686
|
+
const stopSize = React38__namespace.useMemo(
|
|
2711
3687
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
2712
3688
|
[trackHeight]
|
|
2713
3689
|
);
|
|
@@ -2780,14 +3756,14 @@ var LinearProgress = React31__namespace.forwardRef(
|
|
|
2780
3756
|
}
|
|
2781
3757
|
);
|
|
2782
3758
|
LinearProgress.displayName = "LinearProgress";
|
|
2783
|
-
var ProgressIndicator =
|
|
3759
|
+
var ProgressIndicator = React38__namespace.forwardRef((props, ref) => {
|
|
2784
3760
|
if (props.variant === "circular") {
|
|
2785
3761
|
return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
2786
3762
|
}
|
|
2787
3763
|
return /* @__PURE__ */ jsxRuntime.jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
2788
3764
|
});
|
|
2789
3765
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
2790
|
-
var RippleItem =
|
|
3766
|
+
var RippleItem = React38__namespace.memo(function RippleItem2({
|
|
2791
3767
|
ripple,
|
|
2792
3768
|
onDone
|
|
2793
3769
|
}) {
|
|
@@ -2831,8 +3807,8 @@ function Ripple({
|
|
|
2831
3807
|
}
|
|
2832
3808
|
function useRippleState(options = {}) {
|
|
2833
3809
|
const { disabled = false } = options;
|
|
2834
|
-
const [ripples, setRipples] =
|
|
2835
|
-
const onPointerDown =
|
|
3810
|
+
const [ripples, setRipples] = React38__namespace.useState([]);
|
|
3811
|
+
const onPointerDown = React38__namespace.useCallback(
|
|
2836
3812
|
(e) => {
|
|
2837
3813
|
if (disabled) return;
|
|
2838
3814
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2846,7 +3822,7 @@ function useRippleState(options = {}) {
|
|
|
2846
3822
|
},
|
|
2847
3823
|
[disabled]
|
|
2848
3824
|
);
|
|
2849
|
-
const removeRipple =
|
|
3825
|
+
const removeRipple = React38__namespace.useCallback((id) => {
|
|
2850
3826
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2851
3827
|
}, []);
|
|
2852
3828
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -2980,7 +3956,7 @@ function toSentenceCase(text) {
|
|
|
2980
3956
|
}
|
|
2981
3957
|
function resolveLabel(children, asChild) {
|
|
2982
3958
|
if (asChild) {
|
|
2983
|
-
const child =
|
|
3959
|
+
const child = React38__namespace.Children.only(children);
|
|
2984
3960
|
return child.props.children;
|
|
2985
3961
|
}
|
|
2986
3962
|
return typeof children === "string" ? toSentenceCase(children) : children;
|
|
@@ -3052,7 +4028,7 @@ function AnimatedIconSlot({
|
|
|
3052
4028
|
}
|
|
3053
4029
|
);
|
|
3054
4030
|
}
|
|
3055
|
-
var ButtonComponent =
|
|
4031
|
+
var ButtonComponent = React38__namespace.forwardRef(
|
|
3056
4032
|
(_a, ref) => {
|
|
3057
4033
|
var _b = _a, {
|
|
3058
4034
|
className,
|
|
@@ -3101,15 +4077,15 @@ var ButtonComponent = React31__namespace.forwardRef(
|
|
|
3101
4077
|
const { pressed: pressedRadius } = (_b2 = radiusMap[size]) != null ? _b2 : radiusMap.sm;
|
|
3102
4078
|
const iconClass = (_c = SIZE_ICON_CLASS[size]) != null ? _c : "size-5";
|
|
3103
4079
|
const mergedStyle = __spreadValues(__spreadValues({}, SIZE_STYLES[size]), style);
|
|
3104
|
-
const labelText =
|
|
4080
|
+
const labelText = React38__namespace.useMemo(
|
|
3105
4081
|
() => resolveLabel(children, asChild),
|
|
3106
4082
|
[children, asChild]
|
|
3107
4083
|
);
|
|
3108
4084
|
const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
|
|
3109
4085
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
3110
4086
|
const motionRadius = react.useMotionValue(animateRadius);
|
|
3111
|
-
const asChildRef =
|
|
3112
|
-
const mergedRef =
|
|
4087
|
+
const asChildRef = React38__namespace.useRef(null);
|
|
4088
|
+
const mergedRef = React38__namespace.useCallback(
|
|
3113
4089
|
(node) => {
|
|
3114
4090
|
asChildRef.current = node;
|
|
3115
4091
|
if (typeof ref === "function") ref(node);
|
|
@@ -3118,27 +4094,27 @@ var ButtonComponent = React31__namespace.forwardRef(
|
|
|
3118
4094
|
},
|
|
3119
4095
|
[ref]
|
|
3120
4096
|
);
|
|
3121
|
-
|
|
4097
|
+
React38__namespace.useEffect(
|
|
3122
4098
|
() => motionRadius.on("change", (v) => {
|
|
3123
4099
|
if (asChildRef.current)
|
|
3124
4100
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
3125
4101
|
}),
|
|
3126
4102
|
[motionRadius]
|
|
3127
4103
|
);
|
|
3128
|
-
|
|
4104
|
+
React38__namespace.useEffect(() => {
|
|
3129
4105
|
springAnimate(motionRadius, animateRadius);
|
|
3130
4106
|
}, [animateRadius, motionRadius]);
|
|
3131
4107
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
3132
4108
|
disabled: loading
|
|
3133
4109
|
});
|
|
3134
|
-
const handleClick =
|
|
4110
|
+
const handleClick = React38__namespace.useCallback(
|
|
3135
4111
|
(e) => {
|
|
3136
4112
|
if (loading) return e.preventDefault();
|
|
3137
4113
|
onClick == null ? void 0 : onClick(e);
|
|
3138
4114
|
},
|
|
3139
4115
|
[loading, onClick]
|
|
3140
4116
|
);
|
|
3141
|
-
const handleKeyDown =
|
|
4117
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
3142
4118
|
(e) => {
|
|
3143
4119
|
if (loading) return;
|
|
3144
4120
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -3181,7 +4157,7 @@ var ButtonComponent = React31__namespace.forwardRef(
|
|
|
3181
4157
|
] });
|
|
3182
4158
|
if (asChild) {
|
|
3183
4159
|
const htmlProps = stripMotionProps(restProps);
|
|
3184
|
-
const child =
|
|
4160
|
+
const child = React38__namespace.Children.only(children);
|
|
3185
4161
|
const handleAsChildPointerDown = (e) => {
|
|
3186
4162
|
springAnimate(motionRadius, pressedRadius);
|
|
3187
4163
|
onPointerDown == null ? void 0 : onPointerDown(e);
|
|
@@ -3205,7 +4181,7 @@ var ButtonComponent = React31__namespace.forwardRef(
|
|
|
3205
4181
|
}),
|
|
3206
4182
|
className: buttonClassName
|
|
3207
4183
|
}, htmlProps), {
|
|
3208
|
-
children:
|
|
4184
|
+
children: React38__namespace.cloneElement(child, { children: innerContent })
|
|
3209
4185
|
})
|
|
3210
4186
|
) });
|
|
3211
4187
|
}
|
|
@@ -3233,7 +4209,7 @@ var ButtonComponent = React31__namespace.forwardRef(
|
|
|
3233
4209
|
}
|
|
3234
4210
|
);
|
|
3235
4211
|
ButtonComponent.displayName = "Button";
|
|
3236
|
-
var Button =
|
|
4212
|
+
var Button = React38__namespace.memo(ButtonComponent);
|
|
3237
4213
|
var SIZE_PADDING_MAP = {
|
|
3238
4214
|
xs: "0.75rem",
|
|
3239
4215
|
sm: "1rem",
|
|
@@ -3262,7 +4238,7 @@ var PRESSED_RADIUS_MAP = {
|
|
|
3262
4238
|
lg: 28,
|
|
3263
4239
|
xl: 40
|
|
3264
4240
|
};
|
|
3265
|
-
var ButtonGroupComponent =
|
|
4241
|
+
var ButtonGroupComponent = React38__namespace.forwardRef(
|
|
3266
4242
|
(_a, ref) => {
|
|
3267
4243
|
var _b = _a, {
|
|
3268
4244
|
className,
|
|
@@ -3283,13 +4259,13 @@ var ButtonGroupComponent = React31__namespace.forwardRef(
|
|
|
3283
4259
|
"showCheck",
|
|
3284
4260
|
"children"
|
|
3285
4261
|
]);
|
|
3286
|
-
const [pressedIndex, setPressedIndex] =
|
|
3287
|
-
const childrenArray =
|
|
3288
|
-
() =>
|
|
4262
|
+
const [pressedIndex, setPressedIndex] = React38__namespace.useState(null);
|
|
4263
|
+
const childrenArray = React38__namespace.useMemo(
|
|
4264
|
+
() => React38__namespace.Children.toArray(children).filter(React38__namespace.isValidElement),
|
|
3289
4265
|
[children]
|
|
3290
4266
|
);
|
|
3291
4267
|
const count = childrenArray.length;
|
|
3292
|
-
const handlePointerLeaveAndUp =
|
|
4268
|
+
const handlePointerLeaveAndUp = React38__namespace.useCallback(() => {
|
|
3293
4269
|
setPressedIndex(null);
|
|
3294
4270
|
}, []);
|
|
3295
4271
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3428,7 +4404,7 @@ var ButtonGroupComponent = React31__namespace.forwardRef(
|
|
|
3428
4404
|
duration: 0.2
|
|
3429
4405
|
};
|
|
3430
4406
|
}
|
|
3431
|
-
return
|
|
4407
|
+
return React38__namespace.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
|
|
3432
4408
|
key: (_a2 = element.key) != null ? _a2 : index,
|
|
3433
4409
|
tabIndex: isFirst ? 0 : -1,
|
|
3434
4410
|
size: size || element.props.size,
|
|
@@ -3457,7 +4433,7 @@ var ButtonGroupComponent = React31__namespace.forwardRef(
|
|
|
3457
4433
|
}
|
|
3458
4434
|
);
|
|
3459
4435
|
ButtonGroupComponent.displayName = "ButtonGroup";
|
|
3460
|
-
var ButtonGroup =
|
|
4436
|
+
var ButtonGroup = React38__namespace.memo(ButtonGroupComponent);
|
|
3461
4437
|
var SHADOW = {
|
|
3462
4438
|
level0: "none",
|
|
3463
4439
|
level1: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -3516,7 +4492,7 @@ function useCardElevation(variant, disabled) {
|
|
|
3516
4492
|
}
|
|
3517
4493
|
};
|
|
3518
4494
|
}
|
|
3519
|
-
var CardImpl =
|
|
4495
|
+
var CardImpl = React38__namespace.forwardRef(
|
|
3520
4496
|
(_a, ref) => {
|
|
3521
4497
|
var _b = _a, {
|
|
3522
4498
|
className,
|
|
@@ -3614,7 +4590,7 @@ var CardImpl = React31__namespace.forwardRef(
|
|
|
3614
4590
|
}
|
|
3615
4591
|
);
|
|
3616
4592
|
CardImpl.displayName = "Card";
|
|
3617
|
-
var Card =
|
|
4593
|
+
var Card = React38__namespace.memo(CardImpl);
|
|
3618
4594
|
var MD3_STANDARD = [0.2, 0, 0, 1];
|
|
3619
4595
|
var MD3_FAST_EFFECTS = [0.3, 0, 1, 1];
|
|
3620
4596
|
var CHECKMARK_PATH = "M 4.5 9.5 L 7.5 12.5 L 13.5 5.5";
|
|
@@ -3628,7 +4604,7 @@ var NEXT_STATE = {
|
|
|
3628
4604
|
checked: "indeterminate",
|
|
3629
4605
|
indeterminate: "unchecked"
|
|
3630
4606
|
};
|
|
3631
|
-
var CheckboxVisual =
|
|
4607
|
+
var CheckboxVisual = React38__namespace.memo(function CheckboxVisual2({
|
|
3632
4608
|
isSelected,
|
|
3633
4609
|
isIndeterminate,
|
|
3634
4610
|
containerBg,
|
|
@@ -3699,7 +4675,7 @@ var CheckboxVisual = React31__namespace.memo(function CheckboxVisual2({
|
|
|
3699
4675
|
);
|
|
3700
4676
|
});
|
|
3701
4677
|
function useMergedRef2(externalRef, internalRef) {
|
|
3702
|
-
return
|
|
4678
|
+
return React38__namespace.useCallback(
|
|
3703
4679
|
(node) => {
|
|
3704
4680
|
internalRef.current = node;
|
|
3705
4681
|
if (!externalRef) return;
|
|
@@ -3712,7 +4688,7 @@ function useMergedRef2(externalRef, internalRef) {
|
|
|
3712
4688
|
[externalRef, internalRef]
|
|
3713
4689
|
);
|
|
3714
4690
|
}
|
|
3715
|
-
var CheckboxComponent =
|
|
4691
|
+
var CheckboxComponent = React38__namespace.forwardRef(
|
|
3716
4692
|
({
|
|
3717
4693
|
checked,
|
|
3718
4694
|
defaultChecked = false,
|
|
@@ -3734,20 +4710,20 @@ var CheckboxComponent = React31__namespace.forwardRef(
|
|
|
3734
4710
|
}, ref) => {
|
|
3735
4711
|
var _a;
|
|
3736
4712
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
3737
|
-
const generatedId =
|
|
4713
|
+
const generatedId = React38__namespace.useId();
|
|
3738
4714
|
const inputId = idProp != null ? idProp : label ? `checkbox-${generatedId}` : void 0;
|
|
3739
|
-
const [internalState, setInternalState] =
|
|
4715
|
+
const [internalState, setInternalState] = React38__namespace.useState(
|
|
3740
4716
|
() => defaultChecked ? "checked" : "unchecked"
|
|
3741
4717
|
);
|
|
3742
4718
|
const isControlled = stateProp !== void 0 || checked !== void 0;
|
|
3743
4719
|
const baseState = isControlled ? resolveState(checked, false, stateProp) : internalState;
|
|
3744
4720
|
const effectiveState = indeterminate ? "indeterminate" : baseState;
|
|
3745
|
-
const [ripples, setRipples] =
|
|
3746
|
-
const removeRipple =
|
|
4721
|
+
const [ripples, setRipples] = React38__namespace.useState([]);
|
|
4722
|
+
const removeRipple = React38__namespace.useCallback(
|
|
3747
4723
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
3748
4724
|
[]
|
|
3749
4725
|
);
|
|
3750
|
-
const onPointerDown =
|
|
4726
|
+
const onPointerDown = React38__namespace.useCallback(
|
|
3751
4727
|
(e) => {
|
|
3752
4728
|
if (disabled) return;
|
|
3753
4729
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -3761,7 +4737,7 @@ var CheckboxComponent = React31__namespace.forwardRef(
|
|
|
3761
4737
|
},
|
|
3762
4738
|
[disabled]
|
|
3763
4739
|
);
|
|
3764
|
-
const handleChange =
|
|
4740
|
+
const handleChange = React38__namespace.useCallback(
|
|
3765
4741
|
(e) => {
|
|
3766
4742
|
if (disabled) return;
|
|
3767
4743
|
if (stateProp !== void 0) {
|
|
@@ -3787,9 +4763,9 @@ var CheckboxComponent = React31__namespace.forwardRef(
|
|
|
3787
4763
|
onCheckedChange
|
|
3788
4764
|
]
|
|
3789
4765
|
);
|
|
3790
|
-
const inputRef =
|
|
4766
|
+
const inputRef = React38__namespace.useRef(null);
|
|
3791
4767
|
const mergedRef = useMergedRef2(ref, inputRef);
|
|
3792
|
-
|
|
4768
|
+
React38__namespace.useEffect(() => {
|
|
3793
4769
|
if (inputRef.current) {
|
|
3794
4770
|
inputRef.current.indeterminate = effectiveState === "indeterminate";
|
|
3795
4771
|
}
|
|
@@ -3914,13 +4890,13 @@ var CheckboxComponent = React31__namespace.forwardRef(
|
|
|
3914
4890
|
}
|
|
3915
4891
|
);
|
|
3916
4892
|
CheckboxComponent.displayName = "Checkbox";
|
|
3917
|
-
var Checkbox =
|
|
3918
|
-
var TriStateCheckboxComponent =
|
|
4893
|
+
var Checkbox = React38__namespace.memo(CheckboxComponent);
|
|
4894
|
+
var TriStateCheckboxComponent = React38__namespace.forwardRef((_a, ref) => {
|
|
3919
4895
|
var _b = _a, { state, onStateChange } = _b, rest = __objRest(_b, ["state", "onStateChange"]);
|
|
3920
4896
|
return /* @__PURE__ */ jsxRuntime.jsx(Checkbox, __spreadValues({ ref, state, onStateChange }, rest));
|
|
3921
4897
|
});
|
|
3922
4898
|
TriStateCheckboxComponent.displayName = "TriStateCheckbox";
|
|
3923
|
-
var TriStateCheckbox =
|
|
4899
|
+
var TriStateCheckbox = React38__namespace.memo(TriStateCheckboxComponent);
|
|
3924
4900
|
function CheckIcon({ className }) {
|
|
3925
4901
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3926
4902
|
"svg",
|
|
@@ -4014,7 +4990,7 @@ var chipVariants = classVarianceAuthority.cva(
|
|
|
4014
4990
|
defaultVariants: { variant: "assist" }
|
|
4015
4991
|
}
|
|
4016
4992
|
);
|
|
4017
|
-
var ChipImpl =
|
|
4993
|
+
var ChipImpl = React38__namespace.forwardRef(
|
|
4018
4994
|
(_a, ref) => {
|
|
4019
4995
|
var _b = _a, {
|
|
4020
4996
|
variant = "assist",
|
|
@@ -4050,7 +5026,7 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4050
5026
|
const showCheckmark = isFilter && selected;
|
|
4051
5027
|
const hasTrailingContent = !!trailingIcon || !!onRemove;
|
|
4052
5028
|
const hasLeadingContent = isFilter || !!resolvedLeadingIcon;
|
|
4053
|
-
const paddingClass =
|
|
5029
|
+
const paddingClass = React38__namespace.useMemo(
|
|
4054
5030
|
() => cn(
|
|
4055
5031
|
!isInput && !hasLeadingContent && !hasTrailingContent && "px-4",
|
|
4056
5032
|
!isInput && hasLeadingContent && !hasTrailingContent && "pl-2 pr-4",
|
|
@@ -4063,7 +5039,7 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4063
5039
|
),
|
|
4064
5040
|
[isInput, hasLeadingContent, hasTrailingContent]
|
|
4065
5041
|
);
|
|
4066
|
-
const stateClass =
|
|
5042
|
+
const stateClass = React38__namespace.useMemo(
|
|
4067
5043
|
() => cn(
|
|
4068
5044
|
(isFilter || isInput) && selected && "bg-m3-secondary-container text-m3-on-secondary-container border-none before:bg-m3-on-secondary-container",
|
|
4069
5045
|
elevated && !selected && "bg-m3-surface-container-low border-none elevation-1",
|
|
@@ -4074,7 +5050,7 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4074
5050
|
),
|
|
4075
5051
|
[isFilter, isInput, selected, elevated, disabled]
|
|
4076
5052
|
);
|
|
4077
|
-
const leadingIconColorClass =
|
|
5053
|
+
const leadingIconColorClass = React38__namespace.useMemo(
|
|
4078
5054
|
() => cn(
|
|
4079
5055
|
(variant === "assist" || variant === "suggestion") && "text-m3-primary",
|
|
4080
5056
|
isFilter && !selected && "text-m3-primary",
|
|
@@ -4085,7 +5061,7 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4085
5061
|
[variant, isFilter, isInput, selected]
|
|
4086
5062
|
);
|
|
4087
5063
|
const isCompound = !!onRemove;
|
|
4088
|
-
const
|
|
5064
|
+
const Root6 = isCompound ? "div" : "button";
|
|
4089
5065
|
const containerClass = cn(
|
|
4090
5066
|
chipVariants({ variant }),
|
|
4091
5067
|
!isCompound && paddingClass,
|
|
@@ -4155,7 +5131,7 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4155
5131
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: label })
|
|
4156
5132
|
] });
|
|
4157
5133
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4158
|
-
|
|
5134
|
+
Root6,
|
|
4159
5135
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
4160
5136
|
ref: !isCompound ? ref : void 0,
|
|
4161
5137
|
type: !isCompound ? "button" : void 0
|
|
@@ -4246,8 +5222,8 @@ var ChipImpl = React31__namespace.forwardRef(
|
|
|
4246
5222
|
}
|
|
4247
5223
|
);
|
|
4248
5224
|
ChipImpl.displayName = "Chip";
|
|
4249
|
-
var Chip =
|
|
4250
|
-
var ScrollArea =
|
|
5225
|
+
var Chip = React38__namespace.memo(ChipImpl);
|
|
5226
|
+
var ScrollArea = React38__namespace.forwardRef(
|
|
4251
5227
|
(_a, ref) => {
|
|
4252
5228
|
var _b = _a, {
|
|
4253
5229
|
className,
|
|
@@ -4306,7 +5282,7 @@ var ScrollArea = React31__namespace.forwardRef(
|
|
|
4306
5282
|
}
|
|
4307
5283
|
);
|
|
4308
5284
|
ScrollArea.displayName = "ScrollArea";
|
|
4309
|
-
var ScrollAreaScrollbar =
|
|
5285
|
+
var ScrollAreaScrollbar = React38__namespace.forwardRef((_a, ref) => {
|
|
4310
5286
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
4311
5287
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4312
5288
|
RadixScrollArea__namespace.Scrollbar,
|
|
@@ -4336,7 +5312,7 @@ var ScrollAreaScrollbar = React31__namespace.forwardRef((_a, ref) => {
|
|
|
4336
5312
|
);
|
|
4337
5313
|
});
|
|
4338
5314
|
ScrollAreaScrollbar.displayName = RadixScrollArea__namespace.Scrollbar.displayName;
|
|
4339
|
-
var ScrollAreaCorner =
|
|
5315
|
+
var ScrollAreaCorner = React38__namespace.forwardRef((_a, ref) => {
|
|
4340
5316
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4341
5317
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4342
5318
|
RadixScrollArea__namespace.Corner,
|
|
@@ -4431,7 +5407,7 @@ function mapDomToReact(node, key) {
|
|
|
4431
5407
|
props[propName] = attr.value;
|
|
4432
5408
|
}
|
|
4433
5409
|
}
|
|
4434
|
-
return
|
|
5410
|
+
return React38.createElement(
|
|
4435
5411
|
tagName,
|
|
4436
5412
|
props,
|
|
4437
5413
|
Array.from(el.childNodes).map((child, i) => mapDomToReact(child, i))
|
|
@@ -4440,8 +5416,8 @@ function mapDomToReact(node, key) {
|
|
|
4440
5416
|
return null;
|
|
4441
5417
|
}
|
|
4442
5418
|
function CodeContent({ html, code }) {
|
|
4443
|
-
const [parsedContent, setParsedContent] =
|
|
4444
|
-
|
|
5419
|
+
const [parsedContent, setParsedContent] = React38.useState(null);
|
|
5420
|
+
React38.useEffect(() => {
|
|
4445
5421
|
if (html) {
|
|
4446
5422
|
const parser = new DOMParser();
|
|
4447
5423
|
const doc = parser.parseFromString(html, "text/html");
|
|
@@ -4471,8 +5447,8 @@ function CodeBlock({
|
|
|
4471
5447
|
className,
|
|
4472
5448
|
html
|
|
4473
5449
|
}) {
|
|
4474
|
-
const [copied, setCopied] =
|
|
4475
|
-
const handleCopy =
|
|
5450
|
+
const [copied, setCopied] = React38.useState(false);
|
|
5451
|
+
const handleCopy = React38.useCallback(async () => {
|
|
4476
5452
|
try {
|
|
4477
5453
|
await navigator.clipboard.writeText(code);
|
|
4478
5454
|
setCopied(true);
|
|
@@ -4613,7 +5589,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
4613
5589
|
}
|
|
4614
5590
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
4615
5591
|
}
|
|
4616
|
-
var IconButtonComponent =
|
|
5592
|
+
var IconButtonComponent = React38__namespace.forwardRef(
|
|
4617
5593
|
(_a, ref) => {
|
|
4618
5594
|
var _b = _a, {
|
|
4619
5595
|
className,
|
|
@@ -4647,18 +5623,18 @@ var IconButtonComponent = React31__namespace.forwardRef(
|
|
|
4647
5623
|
var _a2, _b2;
|
|
4648
5624
|
const isToggle = variant === "toggle";
|
|
4649
5625
|
const isSelected = isToggle && !!selected;
|
|
4650
|
-
const resolvedColorClass =
|
|
5626
|
+
const resolvedColorClass = React38__namespace.useMemo(
|
|
4651
5627
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
4652
5628
|
[isSelected, colorStyle]
|
|
4653
5629
|
);
|
|
4654
|
-
const outlineWidthClass =
|
|
5630
|
+
const outlineWidthClass = React38__namespace.useMemo(
|
|
4655
5631
|
() => {
|
|
4656
5632
|
var _a3;
|
|
4657
5633
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
4658
5634
|
},
|
|
4659
5635
|
[colorStyle, isSelected, size]
|
|
4660
5636
|
);
|
|
4661
|
-
const disabledBgClass =
|
|
5637
|
+
const disabledBgClass = React38__namespace.useMemo(
|
|
4662
5638
|
() => resolveDisabledBgClass(colorStyle),
|
|
4663
5639
|
[colorStyle]
|
|
4664
5640
|
);
|
|
@@ -4677,7 +5653,7 @@ var IconButtonComponent = React31__namespace.forwardRef(
|
|
|
4677
5653
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4678
5654
|
disabled: loading
|
|
4679
5655
|
});
|
|
4680
|
-
const handleClick =
|
|
5656
|
+
const handleClick = React38__namespace.useCallback(
|
|
4681
5657
|
(e) => {
|
|
4682
5658
|
if (loading) {
|
|
4683
5659
|
e.preventDefault();
|
|
@@ -4687,7 +5663,7 @@ var IconButtonComponent = React31__namespace.forwardRef(
|
|
|
4687
5663
|
},
|
|
4688
5664
|
[loading, onClick]
|
|
4689
5665
|
);
|
|
4690
|
-
const handleKeyDown =
|
|
5666
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
4691
5667
|
(e) => {
|
|
4692
5668
|
if (loading) return;
|
|
4693
5669
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -4775,7 +5751,7 @@ var IconButtonComponent = React31__namespace.forwardRef(
|
|
|
4775
5751
|
}
|
|
4776
5752
|
);
|
|
4777
5753
|
IconButtonComponent.displayName = "IconButton";
|
|
4778
|
-
var IconButton =
|
|
5754
|
+
var IconButton = React38__namespace.memo(IconButtonComponent);
|
|
4779
5755
|
var MD3_SPRING = {
|
|
4780
5756
|
type: "spring",
|
|
4781
5757
|
stiffness: 400,
|
|
@@ -4812,9 +5788,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
4812
5788
|
var DialogPortal = ({
|
|
4813
5789
|
open,
|
|
4814
5790
|
children
|
|
4815
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ?
|
|
5791
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { children: open ? React38__namespace.Children.toArray(children) : null }) });
|
|
4816
5792
|
DialogPortal.displayName = "DialogPortal";
|
|
4817
|
-
var DialogOverlay =
|
|
5793
|
+
var DialogOverlay = React38__namespace.forwardRef((_a, ref) => {
|
|
4818
5794
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4819
5795
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4820
5796
|
react.m.div,
|
|
@@ -4825,7 +5801,7 @@ var DialogOverlay = React31__namespace.forwardRef((_a, ref) => {
|
|
|
4825
5801
|
) }));
|
|
4826
5802
|
});
|
|
4827
5803
|
DialogOverlay.displayName = "DialogOverlay";
|
|
4828
|
-
var DialogContent =
|
|
5804
|
+
var DialogContent = React38__namespace.forwardRef((_a, ref) => {
|
|
4829
5805
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
4830
5806
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4831
5807
|
RadixDialog__namespace.Content,
|
|
@@ -4865,7 +5841,7 @@ var DialogContent = React31__namespace.forwardRef((_a, ref) => {
|
|
|
4865
5841
|
);
|
|
4866
5842
|
});
|
|
4867
5843
|
DialogContent.displayName = "DialogContent";
|
|
4868
|
-
var DialogIcon =
|
|
5844
|
+
var DialogIcon = React38__namespace.forwardRef((_a, ref) => {
|
|
4869
5845
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4870
5846
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4871
5847
|
"div",
|
|
@@ -4888,7 +5864,7 @@ var DialogHeader = (_a) => {
|
|
|
4888
5864
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
4889
5865
|
};
|
|
4890
5866
|
DialogHeader.displayName = "DialogHeader";
|
|
4891
|
-
var DialogTitle =
|
|
5867
|
+
var DialogTitle = React38__namespace.forwardRef((_a, ref) => {
|
|
4892
5868
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
4893
5869
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4894
5870
|
RadixDialog__namespace.Title,
|
|
@@ -4903,7 +5879,7 @@ var DialogTitle = React31__namespace.forwardRef((_a, ref) => {
|
|
|
4903
5879
|
);
|
|
4904
5880
|
});
|
|
4905
5881
|
DialogTitle.displayName = "DialogTitle";
|
|
4906
|
-
var DialogDescription =
|
|
5882
|
+
var DialogDescription = React38__namespace.forwardRef((_a, ref) => {
|
|
4907
5883
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
4908
5884
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4909
5885
|
RadixDialog__namespace.Description,
|
|
@@ -4915,7 +5891,7 @@ var DialogDescription = React31__namespace.forwardRef((_a, ref) => {
|
|
|
4915
5891
|
);
|
|
4916
5892
|
});
|
|
4917
5893
|
DialogDescription.displayName = "DialogDescription";
|
|
4918
|
-
var DialogBody =
|
|
5894
|
+
var DialogBody = React38__namespace.forwardRef((_a, ref) => {
|
|
4919
5895
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
4920
5896
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4921
5897
|
ScrollArea,
|
|
@@ -4946,7 +5922,7 @@ var DialogFooter = (_a) => {
|
|
|
4946
5922
|
};
|
|
4947
5923
|
DialogFooter.displayName = "DialogFooter";
|
|
4948
5924
|
var DialogClose = RadixDialog__namespace.Close;
|
|
4949
|
-
var DialogFullScreenContent =
|
|
5925
|
+
var DialogFullScreenContent = React38__namespace.forwardRef(
|
|
4950
5926
|
(_a, ref) => {
|
|
4951
5927
|
var _b = _a, {
|
|
4952
5928
|
className,
|
|
@@ -5029,7 +6005,7 @@ function buildWavePath(startX, endX, amplitude = 2, wavelength = 32, yCenter = 4
|
|
|
5029
6005
|
}
|
|
5030
6006
|
return d;
|
|
5031
6007
|
}
|
|
5032
|
-
var DividerImpl =
|
|
6008
|
+
var DividerImpl = React38__namespace.forwardRef(
|
|
5033
6009
|
(_a, ref) => {
|
|
5034
6010
|
var _b = _a, {
|
|
5035
6011
|
variant = "full-bleed",
|
|
@@ -5149,7 +6125,7 @@ var DividerImpl = React31__namespace.forwardRef(
|
|
|
5149
6125
|
}
|
|
5150
6126
|
);
|
|
5151
6127
|
DividerImpl.displayName = "Divider";
|
|
5152
|
-
var Divider =
|
|
6128
|
+
var Divider = React38__namespace.memo(DividerImpl);
|
|
5153
6129
|
var MD3_DRAWER_SPRING = {
|
|
5154
6130
|
type: "spring",
|
|
5155
6131
|
stiffness: 350,
|
|
@@ -5186,7 +6162,7 @@ var DrawerPortal = ({
|
|
|
5186
6162
|
open,
|
|
5187
6163
|
children
|
|
5188
6164
|
}) => /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { forceMount: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: open && children }) });
|
|
5189
|
-
var DrawerOverlay =
|
|
6165
|
+
var DrawerOverlay = React38__namespace.forwardRef((_a, ref) => {
|
|
5190
6166
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5191
6167
|
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5192
6168
|
react.m.div,
|
|
@@ -5197,7 +6173,7 @@ var DrawerOverlay = React31__namespace.forwardRef((_a, ref) => {
|
|
|
5197
6173
|
) }));
|
|
5198
6174
|
});
|
|
5199
6175
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
5200
|
-
var DrawerContent =
|
|
6176
|
+
var DrawerContent = React38__namespace.forwardRef(
|
|
5201
6177
|
(_a, ref) => {
|
|
5202
6178
|
var _b = _a, {
|
|
5203
6179
|
className,
|
|
@@ -5276,7 +6252,7 @@ var DrawerFooter = (_a) => {
|
|
|
5276
6252
|
return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
5277
6253
|
};
|
|
5278
6254
|
DrawerFooter.displayName = "DrawerFooter";
|
|
5279
|
-
var DrawerTitle =
|
|
6255
|
+
var DrawerTitle = React38__namespace.forwardRef((_a, ref) => {
|
|
5280
6256
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5281
6257
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5282
6258
|
RadixDialog__namespace.Title,
|
|
@@ -5290,7 +6266,7 @@ var DrawerTitle = React31__namespace.forwardRef((_a, ref) => {
|
|
|
5290
6266
|
);
|
|
5291
6267
|
});
|
|
5292
6268
|
DrawerTitle.displayName = "DrawerTitle";
|
|
5293
|
-
var DrawerDescription =
|
|
6269
|
+
var DrawerDescription = React38__namespace.forwardRef((_a, ref) => {
|
|
5294
6270
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5295
6271
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5296
6272
|
RadixDialog__namespace.Description,
|
|
@@ -5371,7 +6347,7 @@ function FABPosition({
|
|
|
5371
6347
|
}
|
|
5372
6348
|
);
|
|
5373
6349
|
}
|
|
5374
|
-
var FABComponent =
|
|
6350
|
+
var FABComponent = React38__namespace.forwardRef(
|
|
5375
6351
|
(_a, ref) => {
|
|
5376
6352
|
var _b = _a, {
|
|
5377
6353
|
className,
|
|
@@ -5416,7 +6392,7 @@ var FABComponent = React31__namespace.forwardRef(
|
|
|
5416
6392
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5417
6393
|
disabled: loading
|
|
5418
6394
|
});
|
|
5419
|
-
const handleClick =
|
|
6395
|
+
const handleClick = React38__namespace.useCallback(
|
|
5420
6396
|
(e) => {
|
|
5421
6397
|
if (loading) {
|
|
5422
6398
|
e.preventDefault();
|
|
@@ -5426,7 +6402,7 @@ var FABComponent = React31__namespace.forwardRef(
|
|
|
5426
6402
|
},
|
|
5427
6403
|
[loading, onClick]
|
|
5428
6404
|
);
|
|
5429
|
-
const handleKeyDown =
|
|
6405
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
5430
6406
|
(e) => {
|
|
5431
6407
|
if (loading) return;
|
|
5432
6408
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -5535,7 +6511,7 @@ var FABComponent = React31__namespace.forwardRef(
|
|
|
5535
6511
|
}
|
|
5536
6512
|
);
|
|
5537
6513
|
FABComponent.displayName = "FAB";
|
|
5538
|
-
var FAB =
|
|
6514
|
+
var FAB = React38__namespace.memo(FABComponent);
|
|
5539
6515
|
var SPRING_NORMAL = { stiffness: 700, damping: 40 };
|
|
5540
6516
|
var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
|
|
5541
6517
|
var FOCUS_DELAY_MS = 50;
|
|
@@ -5600,7 +6576,7 @@ var ALIGNMENT_TRANSFORM_ORIGIN = {
|
|
|
5600
6576
|
center: "bottom"
|
|
5601
6577
|
};
|
|
5602
6578
|
var ITEM_SPRING = { type: "spring", stiffness: 700, damping: 25 };
|
|
5603
|
-
var
|
|
6579
|
+
var MENU_CONTAINER_VARIANTS2 = {
|
|
5604
6580
|
open: { transition: { staggerChildren: 0.033, staggerDirection: 1 } },
|
|
5605
6581
|
closed: { transition: { staggerChildren: 0.02, staggerDirection: -1 } }
|
|
5606
6582
|
};
|
|
@@ -5643,7 +6619,7 @@ function CloseIcon3() {
|
|
|
5643
6619
|
function defaultFabIcon(progress) {
|
|
5644
6620
|
return progress > 0.5 ? /* @__PURE__ */ jsxRuntime.jsx(CloseIcon3, {}) : /* @__PURE__ */ jsxRuntime.jsx(AddIcon, {});
|
|
5645
6621
|
}
|
|
5646
|
-
var ToggleFABComponent =
|
|
6622
|
+
var ToggleFABComponent = React38__namespace.forwardRef(
|
|
5647
6623
|
({
|
|
5648
6624
|
expanded,
|
|
5649
6625
|
onToggle,
|
|
@@ -5661,7 +6637,7 @@ var ToggleFABComponent = React31__namespace.forwardRef(
|
|
|
5661
6637
|
const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
|
|
5662
6638
|
const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
|
|
5663
6639
|
const checkedProgress = react.useSpring(expanded ? 1 : 0, springConfig);
|
|
5664
|
-
|
|
6640
|
+
React38__namespace.useEffect(() => {
|
|
5665
6641
|
checkedProgress.set(expanded ? 1 : 0);
|
|
5666
6642
|
}, [expanded, checkedProgress]);
|
|
5667
6643
|
const borderRadius = react.useTransform(
|
|
@@ -5669,12 +6645,12 @@ var ToggleFABComponent = React31__namespace.forwardRef(
|
|
|
5669
6645
|
[0, 1],
|
|
5670
6646
|
[`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
|
|
5671
6647
|
);
|
|
5672
|
-
const [iconProgress, setIconProgress] =
|
|
5673
|
-
|
|
6648
|
+
const [iconProgress, setIconProgress] = React38__namespace.useState(expanded ? 1 : 0);
|
|
6649
|
+
React38__namespace.useEffect(() => {
|
|
5674
6650
|
return checkedProgress.on("change", setIconProgress);
|
|
5675
6651
|
}, [checkedProgress]);
|
|
5676
6652
|
const { ripples, onPointerDown, removeRipple } = useRippleState();
|
|
5677
|
-
const handleClick =
|
|
6653
|
+
const handleClick = React38__namespace.useCallback(() => {
|
|
5678
6654
|
onToggle(!expanded);
|
|
5679
6655
|
}, [expanded, onToggle]);
|
|
5680
6656
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5723,7 +6699,7 @@ var ToggleFABComponent = React31__namespace.forwardRef(
|
|
|
5723
6699
|
}
|
|
5724
6700
|
);
|
|
5725
6701
|
ToggleFABComponent.displayName = "ToggleFAB";
|
|
5726
|
-
var ToggleFAB =
|
|
6702
|
+
var ToggleFAB = React38__namespace.memo(ToggleFABComponent);
|
|
5727
6703
|
function FABMenuItem({
|
|
5728
6704
|
icon,
|
|
5729
6705
|
label,
|
|
@@ -5736,7 +6712,7 @@ function FABMenuItem({
|
|
|
5736
6712
|
var _a;
|
|
5737
6713
|
const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
|
|
5738
6714
|
const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
|
|
5739
|
-
const handleClick =
|
|
6715
|
+
const handleClick = React38__namespace.useCallback(
|
|
5740
6716
|
(e) => {
|
|
5741
6717
|
if (disabled) {
|
|
5742
6718
|
e.preventDefault();
|
|
@@ -5746,7 +6722,7 @@ function FABMenuItem({
|
|
|
5746
6722
|
},
|
|
5747
6723
|
[disabled, onClick]
|
|
5748
6724
|
);
|
|
5749
|
-
const handleKeyDown =
|
|
6725
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
5750
6726
|
(e) => {
|
|
5751
6727
|
if (disabled) return;
|
|
5752
6728
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -5813,13 +6789,13 @@ function FABMenu({
|
|
|
5813
6789
|
focusLast = true,
|
|
5814
6790
|
"aria-label": ariaLabel
|
|
5815
6791
|
}) {
|
|
5816
|
-
const fabId =
|
|
5817
|
-
const menuId =
|
|
5818
|
-
const toggleRef =
|
|
5819
|
-
const itemRefs =
|
|
5820
|
-
const [focusedIndex, setFocusedIndex] =
|
|
5821
|
-
const reversedItems =
|
|
5822
|
-
const focusItem =
|
|
6792
|
+
const fabId = React38__namespace.useId();
|
|
6793
|
+
const menuId = React38__namespace.useId();
|
|
6794
|
+
const toggleRef = React38__namespace.useRef(null);
|
|
6795
|
+
const itemRefs = React38__namespace.useRef([]);
|
|
6796
|
+
const [focusedIndex, setFocusedIndex] = React38__namespace.useState(-1);
|
|
6797
|
+
const reversedItems = React38__namespace.useMemo(() => [...items].reverse(), [items]);
|
|
6798
|
+
const focusItem = React38__namespace.useCallback((index) => {
|
|
5823
6799
|
var _a;
|
|
5824
6800
|
const clampedIndex = Math.max(
|
|
5825
6801
|
0,
|
|
@@ -5828,8 +6804,8 @@ function FABMenu({
|
|
|
5828
6804
|
setFocusedIndex(clampedIndex);
|
|
5829
6805
|
(_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
|
|
5830
6806
|
}, []);
|
|
5831
|
-
const wasExpandedRef =
|
|
5832
|
-
|
|
6807
|
+
const wasExpandedRef = React38__namespace.useRef(false);
|
|
6808
|
+
React38__namespace.useEffect(() => {
|
|
5833
6809
|
var _a;
|
|
5834
6810
|
if (expanded) {
|
|
5835
6811
|
wasExpandedRef.current = true;
|
|
@@ -5844,7 +6820,7 @@ function FABMenu({
|
|
|
5844
6820
|
wasExpandedRef.current = false;
|
|
5845
6821
|
setFocusedIndex(-1);
|
|
5846
6822
|
}, [expanded, focusLast, items.length, focusItem]);
|
|
5847
|
-
const handleMenuKeyDown =
|
|
6823
|
+
const handleMenuKeyDown = React38__namespace.useCallback(
|
|
5848
6824
|
(e) => {
|
|
5849
6825
|
if (!expanded) return;
|
|
5850
6826
|
const lastIndex = items.length - 1;
|
|
@@ -5905,7 +6881,7 @@ function FABMenu({
|
|
|
5905
6881
|
role: "menu",
|
|
5906
6882
|
"aria-labelledby": fabId,
|
|
5907
6883
|
"aria-orientation": "vertical",
|
|
5908
|
-
variants:
|
|
6884
|
+
variants: MENU_CONTAINER_VARIANTS2,
|
|
5909
6885
|
initial: "closed",
|
|
5910
6886
|
animate: "open",
|
|
5911
6887
|
exit: "closed",
|
|
@@ -5968,7 +6944,7 @@ function FABMenu({
|
|
|
5968
6944
|
)
|
|
5969
6945
|
] });
|
|
5970
6946
|
}
|
|
5971
|
-
var NavigationRailContext =
|
|
6947
|
+
var NavigationRailContext = React38__namespace.createContext({ variant: "collapsed", labelVisibility: "labeled", xr: false });
|
|
5972
6948
|
var MD3_MODAL_TRANSITION = {
|
|
5973
6949
|
type: "tween",
|
|
5974
6950
|
ease: [0.05, 0.7, 0.1, 1],
|
|
@@ -6004,9 +6980,9 @@ var railContainerVariants = classVarianceAuthority.cva(
|
|
|
6004
6980
|
}
|
|
6005
6981
|
);
|
|
6006
6982
|
function cloneIconWithFill(icon, selected) {
|
|
6007
|
-
if (!
|
|
6983
|
+
if (!React38__namespace.isValidElement(icon)) return icon;
|
|
6008
6984
|
if (icon.type === Icon) {
|
|
6009
|
-
return
|
|
6985
|
+
return React38__namespace.cloneElement(
|
|
6010
6986
|
icon,
|
|
6011
6987
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
6012
6988
|
);
|
|
@@ -6064,7 +7040,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
6064
7040
|
}
|
|
6065
7041
|
);
|
|
6066
7042
|
}
|
|
6067
|
-
var NavigationRailItemComponent =
|
|
7043
|
+
var NavigationRailItemComponent = React38__namespace.forwardRef(
|
|
6068
7044
|
({
|
|
6069
7045
|
selected,
|
|
6070
7046
|
icon,
|
|
@@ -6075,18 +7051,18 @@ var NavigationRailItemComponent = React31__namespace.forwardRef(
|
|
|
6075
7051
|
className,
|
|
6076
7052
|
"aria-label": ariaLabelProp
|
|
6077
7053
|
}, ref) => {
|
|
6078
|
-
const { variant, labelVisibility } =
|
|
7054
|
+
const { variant, labelVisibility } = React38__namespace.useContext(
|
|
6079
7055
|
NavigationRailContext
|
|
6080
7056
|
);
|
|
6081
7057
|
const isExpanded = variant === "expanded" || variant === "modal";
|
|
6082
7058
|
const isModal = variant === "modal";
|
|
6083
7059
|
const enableLayout = !isModal;
|
|
6084
|
-
const activePillId = `rail-pill-${
|
|
7060
|
+
const activePillId = `rail-pill-${React38__namespace.useId()}`;
|
|
6085
7061
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
6086
7062
|
disabled
|
|
6087
7063
|
});
|
|
6088
7064
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
6089
|
-
const handleClick =
|
|
7065
|
+
const handleClick = React38__namespace.useCallback(
|
|
6090
7066
|
(e) => {
|
|
6091
7067
|
if (disabled) {
|
|
6092
7068
|
e.preventDefault();
|
|
@@ -6188,9 +7164,9 @@ var NavigationRailItemComponent = React31__namespace.forwardRef(
|
|
|
6188
7164
|
}
|
|
6189
7165
|
);
|
|
6190
7166
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
6191
|
-
var NavigationRailItem =
|
|
7167
|
+
var NavigationRailItem = React38__namespace.memo(NavigationRailItemComponent);
|
|
6192
7168
|
function useRoving(navRef) {
|
|
6193
|
-
|
|
7169
|
+
React38__namespace.useEffect(() => {
|
|
6194
7170
|
if (!navRef.current) return;
|
|
6195
7171
|
const items = getMenuItems(navRef.current);
|
|
6196
7172
|
const selected = items.find(
|
|
@@ -6200,7 +7176,7 @@ function useRoving(navRef) {
|
|
|
6200
7176
|
const firstFocusable = selected != null ? selected : items[0];
|
|
6201
7177
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
6202
7178
|
}, [navRef]);
|
|
6203
|
-
return
|
|
7179
|
+
return React38__namespace.useCallback(
|
|
6204
7180
|
(e) => {
|
|
6205
7181
|
if (!navRef.current) return;
|
|
6206
7182
|
const items = getMenuItems(navRef.current);
|
|
@@ -6228,7 +7204,7 @@ function useRoving(navRef) {
|
|
|
6228
7204
|
[navRef]
|
|
6229
7205
|
);
|
|
6230
7206
|
}
|
|
6231
|
-
var NavigationRailComponent =
|
|
7207
|
+
var NavigationRailComponent = React38__namespace.forwardRef(
|
|
6232
7208
|
({
|
|
6233
7209
|
variant = "collapsed",
|
|
6234
7210
|
labelVisibility = "labeled",
|
|
@@ -6248,9 +7224,9 @@ var NavigationRailComponent = React31__namespace.forwardRef(
|
|
|
6248
7224
|
const xrMode = xr === "spatialized" ? "spatialized" : "contained";
|
|
6249
7225
|
const isSpatial = isXr && xrMode === "spatialized";
|
|
6250
7226
|
const applyAnimation = !isXr || !isSpatial;
|
|
6251
|
-
const navRef =
|
|
7227
|
+
const navRef = React38__namespace.useRef(null);
|
|
6252
7228
|
const handleKeyDown = useRoving(navRef);
|
|
6253
|
-
const setRefs =
|
|
7229
|
+
const setRefs = React38__namespace.useCallback(
|
|
6254
7230
|
(node) => {
|
|
6255
7231
|
navRef.current = node;
|
|
6256
7232
|
if (typeof ref === "function") ref(node);
|
|
@@ -6343,7 +7319,7 @@ var NavigationRailComponent = React31__namespace.forwardRef(
|
|
|
6343
7319
|
children: fab
|
|
6344
7320
|
}
|
|
6345
7321
|
),
|
|
6346
|
-
|
|
7322
|
+
React38__namespace.cloneElement(
|
|
6347
7323
|
navElement,
|
|
6348
7324
|
{
|
|
6349
7325
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -6381,13 +7357,13 @@ var NavigationRailComponent = React31__namespace.forwardRef(
|
|
|
6381
7357
|
}
|
|
6382
7358
|
);
|
|
6383
7359
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
6384
|
-
var NavigationRail =
|
|
7360
|
+
var NavigationRail = React38__namespace.memo(NavigationRailComponent);
|
|
6385
7361
|
var MD3_FAST_EFFECTS2 = [0.3, 0, 1, 1];
|
|
6386
|
-
var RadioGroupContext =
|
|
7362
|
+
var RadioGroupContext = React38__namespace.createContext(
|
|
6387
7363
|
null
|
|
6388
7364
|
);
|
|
6389
7365
|
function useMergedRef3(externalRef, internalRef) {
|
|
6390
|
-
return
|
|
7366
|
+
return React38__namespace.useCallback(
|
|
6391
7367
|
(node) => {
|
|
6392
7368
|
internalRef.current = node;
|
|
6393
7369
|
if (!externalRef) return;
|
|
@@ -6400,7 +7376,7 @@ function useMergedRef3(externalRef, internalRef) {
|
|
|
6400
7376
|
[externalRef, internalRef]
|
|
6401
7377
|
);
|
|
6402
7378
|
}
|
|
6403
|
-
var RadioVisual =
|
|
7379
|
+
var RadioVisual = React38__namespace.memo(function RadioVisual2({
|
|
6404
7380
|
isSelected,
|
|
6405
7381
|
disabled,
|
|
6406
7382
|
error,
|
|
@@ -6453,7 +7429,7 @@ var RadioVisual = React31__namespace.memo(function RadioVisual2({
|
|
|
6453
7429
|
}
|
|
6454
7430
|
);
|
|
6455
7431
|
});
|
|
6456
|
-
var RadioButtonComponent =
|
|
7432
|
+
var RadioButtonComponent = React38__namespace.forwardRef(
|
|
6457
7433
|
({
|
|
6458
7434
|
selected,
|
|
6459
7435
|
defaultSelected = false,
|
|
@@ -6472,23 +7448,23 @@ var RadioButtonComponent = React31__namespace.forwardRef(
|
|
|
6472
7448
|
required: requiredProp
|
|
6473
7449
|
}, ref) => {
|
|
6474
7450
|
var _a, _b;
|
|
6475
|
-
const group =
|
|
7451
|
+
const group = React38__namespace.useContext(RadioGroupContext);
|
|
6476
7452
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
6477
|
-
const generatedId =
|
|
7453
|
+
const generatedId = React38__namespace.useId();
|
|
6478
7454
|
const inputId = idProp != null ? idProp : label ? `radio-${generatedId}` : void 0;
|
|
6479
7455
|
const name = (_b = group == null ? void 0 : group.name) != null ? _b : nameProp;
|
|
6480
7456
|
const disabled = (group == null ? void 0 : group.disabled) || disabledProp;
|
|
6481
7457
|
const error = (group == null ? void 0 : group.error) || errorProp || color === "error";
|
|
6482
7458
|
const required = (group == null ? void 0 : group.required) || requiredProp;
|
|
6483
|
-
const [internalSelected, setInternalSelected] =
|
|
7459
|
+
const [internalSelected, setInternalSelected] = React38__namespace.useState(defaultSelected);
|
|
6484
7460
|
const isControlled = selected !== void 0;
|
|
6485
7461
|
const isSelected = group ? group.selectedValue === value : isControlled ? selected != null ? selected : false : internalSelected;
|
|
6486
|
-
const [ripples, setRipples] =
|
|
6487
|
-
const removeRipple =
|
|
7462
|
+
const [ripples, setRipples] = React38__namespace.useState([]);
|
|
7463
|
+
const removeRipple = React38__namespace.useCallback(
|
|
6488
7464
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
6489
7465
|
[]
|
|
6490
7466
|
);
|
|
6491
|
-
const onPointerDown =
|
|
7467
|
+
const onPointerDown = React38__namespace.useCallback(
|
|
6492
7468
|
(e) => {
|
|
6493
7469
|
if (disabled) return;
|
|
6494
7470
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -6502,12 +7478,12 @@ var RadioButtonComponent = React31__namespace.forwardRef(
|
|
|
6502
7478
|
},
|
|
6503
7479
|
[disabled]
|
|
6504
7480
|
);
|
|
6505
|
-
const [isHovered, setIsHovered] =
|
|
6506
|
-
const onPointerEnter =
|
|
7481
|
+
const [isHovered, setIsHovered] = React38__namespace.useState(false);
|
|
7482
|
+
const onPointerEnter = React38__namespace.useCallback(() => {
|
|
6507
7483
|
if (!disabled) setIsHovered(true);
|
|
6508
7484
|
}, [disabled]);
|
|
6509
|
-
const onPointerLeave =
|
|
6510
|
-
const handleChange =
|
|
7485
|
+
const onPointerLeave = React38__namespace.useCallback(() => setIsHovered(false), []);
|
|
7486
|
+
const handleChange = React38__namespace.useCallback(
|
|
6511
7487
|
(_e) => {
|
|
6512
7488
|
if (disabled || onClick === null) return;
|
|
6513
7489
|
if (group) {
|
|
@@ -6521,7 +7497,7 @@ var RadioButtonComponent = React31__namespace.forwardRef(
|
|
|
6521
7497
|
},
|
|
6522
7498
|
[disabled, onClick, group, value, isControlled]
|
|
6523
7499
|
);
|
|
6524
|
-
const inputRef =
|
|
7500
|
+
const inputRef = React38__namespace.useRef(null);
|
|
6525
7501
|
const mergedRef = useMergedRef3(ref, inputRef);
|
|
6526
7502
|
const stateLayerBg = error ? "before:bg-m3-error" : "before:bg-m3-primary";
|
|
6527
7503
|
const stateLayerClass = cn(
|
|
@@ -6632,8 +7608,8 @@ var RadioButtonComponent = React31__namespace.forwardRef(
|
|
|
6632
7608
|
}
|
|
6633
7609
|
);
|
|
6634
7610
|
RadioButtonComponent.displayName = "RadioButton";
|
|
6635
|
-
var RadioButton =
|
|
6636
|
-
var RadioGroupComponent =
|
|
7611
|
+
var RadioButton = React38__namespace.memo(RadioButtonComponent);
|
|
7612
|
+
var RadioGroupComponent = React38__namespace.forwardRef(
|
|
6637
7613
|
({
|
|
6638
7614
|
name,
|
|
6639
7615
|
value: valueProp,
|
|
@@ -6648,19 +7624,19 @@ var RadioGroupComponent = React31__namespace.forwardRef(
|
|
|
6648
7624
|
children,
|
|
6649
7625
|
className
|
|
6650
7626
|
}, ref) => {
|
|
6651
|
-
const [internalValue, setInternalValue] =
|
|
7627
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
6652
7628
|
const isControlled = valueProp !== void 0;
|
|
6653
7629
|
const selectedValue = isControlled ? valueProp : internalValue;
|
|
6654
|
-
const handleValueChange =
|
|
7630
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
6655
7631
|
(val) => {
|
|
6656
7632
|
if (!isControlled) setInternalValue(val);
|
|
6657
7633
|
onValueChange == null ? void 0 : onValueChange(val);
|
|
6658
7634
|
},
|
|
6659
7635
|
[isControlled, onValueChange]
|
|
6660
7636
|
);
|
|
6661
|
-
const groupRef =
|
|
7637
|
+
const groupRef = React38__namespace.useRef(null);
|
|
6662
7638
|
const mergedRef = useMergedRef3(ref, groupRef);
|
|
6663
|
-
const onKeyDown =
|
|
7639
|
+
const onKeyDown = React38__namespace.useCallback(
|
|
6664
7640
|
(e) => {
|
|
6665
7641
|
var _a, _b;
|
|
6666
7642
|
if (disabled) return;
|
|
@@ -6684,7 +7660,7 @@ var RadioGroupComponent = React31__namespace.forwardRef(
|
|
|
6684
7660
|
},
|
|
6685
7661
|
[disabled, handleValueChange]
|
|
6686
7662
|
);
|
|
6687
|
-
const contextValue =
|
|
7663
|
+
const contextValue = React38__namespace.useMemo(
|
|
6688
7664
|
() => ({
|
|
6689
7665
|
name,
|
|
6690
7666
|
selectedValue,
|
|
@@ -6719,7 +7695,7 @@ var RadioGroupComponent = React31__namespace.forwardRef(
|
|
|
6719
7695
|
}
|
|
6720
7696
|
);
|
|
6721
7697
|
RadioGroupComponent.displayName = "RadioGroup";
|
|
6722
|
-
var
|
|
7698
|
+
var RadioGroup = React38__namespace.memo(RadioGroupComponent);
|
|
6723
7699
|
function useSearchKeyboard({
|
|
6724
7700
|
active,
|
|
6725
7701
|
onActiveChange,
|
|
@@ -6728,14 +7704,14 @@ function useSearchKeyboard({
|
|
|
6728
7704
|
itemCount,
|
|
6729
7705
|
onSelectSuggestion
|
|
6730
7706
|
}) {
|
|
6731
|
-
const [activeIndex, setActiveIndex] =
|
|
6732
|
-
const resetKeyRef =
|
|
7707
|
+
const [activeIndex, setActiveIndex] = React38__namespace.useState(-1);
|
|
7708
|
+
const resetKeyRef = React38__namespace.useRef(`${active}:${query}`);
|
|
6733
7709
|
const currentKey = `${active}:${query}`;
|
|
6734
7710
|
if (resetKeyRef.current !== currentKey) {
|
|
6735
7711
|
resetKeyRef.current = currentKey;
|
|
6736
7712
|
setActiveIndex(-1);
|
|
6737
7713
|
}
|
|
6738
|
-
const handleKeyDown =
|
|
7714
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
6739
7715
|
(e) => {
|
|
6740
7716
|
if (!active) return;
|
|
6741
7717
|
switch (e.key) {
|
|
@@ -6775,7 +7751,7 @@ function useSearchKeyboard({
|
|
|
6775
7751
|
query
|
|
6776
7752
|
]
|
|
6777
7753
|
);
|
|
6778
|
-
const resetActiveIndex =
|
|
7754
|
+
const resetActiveIndex = React38__namespace.useCallback(() => {
|
|
6779
7755
|
setActiveIndex(-1);
|
|
6780
7756
|
}, []);
|
|
6781
7757
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -6863,10 +7839,10 @@ function AnimatedPlaceholder({
|
|
|
6863
7839
|
className
|
|
6864
7840
|
}) {
|
|
6865
7841
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6866
|
-
const containerRef =
|
|
6867
|
-
const spanRef =
|
|
6868
|
-
const [xOffset, setXOffset] =
|
|
6869
|
-
const recalculate =
|
|
7842
|
+
const containerRef = React38__namespace.useRef(null);
|
|
7843
|
+
const spanRef = React38__namespace.useRef(null);
|
|
7844
|
+
const [xOffset, setXOffset] = React38__namespace.useState(0);
|
|
7845
|
+
const recalculate = React38__namespace.useCallback(() => {
|
|
6870
7846
|
const container = containerRef.current;
|
|
6871
7847
|
const span = spanRef.current;
|
|
6872
7848
|
if (!container || !span || textAlign === "left") {
|
|
@@ -6881,10 +7857,10 @@ function AnimatedPlaceholder({
|
|
|
6881
7857
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
6882
7858
|
}
|
|
6883
7859
|
}, [textAlign]);
|
|
6884
|
-
|
|
7860
|
+
React38__namespace.useLayoutEffect(() => {
|
|
6885
7861
|
recalculate();
|
|
6886
7862
|
}, [recalculate]);
|
|
6887
|
-
|
|
7863
|
+
React38__namespace.useEffect(() => {
|
|
6888
7864
|
const container = containerRef.current;
|
|
6889
7865
|
if (!container) return;
|
|
6890
7866
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -6953,10 +7929,10 @@ function SearchBar({
|
|
|
6953
7929
|
activeIndex
|
|
6954
7930
|
}) {
|
|
6955
7931
|
const shouldReduceMotion = react.useReducedMotion();
|
|
6956
|
-
const inputRef =
|
|
6957
|
-
const prevActiveRef =
|
|
6958
|
-
const isRestoringFocusRef =
|
|
6959
|
-
|
|
7932
|
+
const inputRef = React38__namespace.useRef(null);
|
|
7933
|
+
const prevActiveRef = React38__namespace.useRef(active);
|
|
7934
|
+
const isRestoringFocusRef = React38__namespace.useRef(false);
|
|
7935
|
+
React38__namespace.useEffect(() => {
|
|
6960
7936
|
var _a;
|
|
6961
7937
|
let rafId;
|
|
6962
7938
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -7075,7 +8051,7 @@ function SearchBar({
|
|
|
7075
8051
|
) })
|
|
7076
8052
|
);
|
|
7077
8053
|
}
|
|
7078
|
-
var SearchContext =
|
|
8054
|
+
var SearchContext = React38__namespace.createContext(null);
|
|
7079
8055
|
function SearchProvider({
|
|
7080
8056
|
children,
|
|
7081
8057
|
value
|
|
@@ -7083,15 +8059,15 @@ function SearchProvider({
|
|
|
7083
8059
|
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
7084
8060
|
}
|
|
7085
8061
|
function useSearch() {
|
|
7086
|
-
const context =
|
|
8062
|
+
const context = React38__namespace.useContext(SearchContext);
|
|
7087
8063
|
if (!context) {
|
|
7088
8064
|
return { listboxId: "", activeIndex: -1 };
|
|
7089
8065
|
}
|
|
7090
8066
|
return context;
|
|
7091
8067
|
}
|
|
7092
8068
|
function useClickOutside(handler, enabled = true) {
|
|
7093
|
-
const ref =
|
|
7094
|
-
|
|
8069
|
+
const ref = React38.useRef(null);
|
|
8070
|
+
React38.useEffect(() => {
|
|
7095
8071
|
if (!enabled) return;
|
|
7096
8072
|
const listener = (event) => {
|
|
7097
8073
|
const el = ref.current;
|
|
@@ -7110,7 +8086,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
7110
8086
|
return ref;
|
|
7111
8087
|
}
|
|
7112
8088
|
function useSearchViewFocus(inputRef, active) {
|
|
7113
|
-
|
|
8089
|
+
React38__namespace.useEffect(() => {
|
|
7114
8090
|
if (!active) return;
|
|
7115
8091
|
let raf2;
|
|
7116
8092
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -7184,7 +8160,7 @@ function SearchViewDocked({
|
|
|
7184
8160
|
activeIndex
|
|
7185
8161
|
}) {
|
|
7186
8162
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7187
|
-
const inputRef =
|
|
8163
|
+
const inputRef = React38__namespace.useRef(null);
|
|
7188
8164
|
useSearchViewFocus(inputRef, active);
|
|
7189
8165
|
const dropdownRef = useClickOutside(() => {
|
|
7190
8166
|
onActiveChange(false);
|
|
@@ -7330,10 +8306,10 @@ function SearchViewFullScreen({
|
|
|
7330
8306
|
activeIndex
|
|
7331
8307
|
}) {
|
|
7332
8308
|
const shouldReduceMotion = react.useReducedMotion();
|
|
7333
|
-
const inputRef =
|
|
8309
|
+
const inputRef = React38__namespace.useRef(null);
|
|
7334
8310
|
useSearchViewFocus(inputRef, active);
|
|
7335
|
-
const [mounted, setMounted] =
|
|
7336
|
-
|
|
8311
|
+
const [mounted, setMounted] = React38__namespace.useState(false);
|
|
8312
|
+
React38__namespace.useEffect(() => {
|
|
7337
8313
|
setMounted(true);
|
|
7338
8314
|
}, []);
|
|
7339
8315
|
const handleFormSubmit = (e) => {
|
|
@@ -7491,10 +8467,10 @@ function SearchComponent({
|
|
|
7491
8467
|
className,
|
|
7492
8468
|
viewClassName
|
|
7493
8469
|
}) {
|
|
7494
|
-
const generatedId =
|
|
8470
|
+
const generatedId = React38__namespace.useId();
|
|
7495
8471
|
const searchId = id != null ? id : generatedId;
|
|
7496
8472
|
const listboxId = `${searchId}-listbox`;
|
|
7497
|
-
const itemCount =
|
|
8473
|
+
const itemCount = React38__namespace.Children.count(children);
|
|
7498
8474
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
7499
8475
|
active,
|
|
7500
8476
|
onActiveChange,
|
|
@@ -7592,7 +8568,7 @@ function useSliderMath({
|
|
|
7592
8568
|
max,
|
|
7593
8569
|
step
|
|
7594
8570
|
}) {
|
|
7595
|
-
return
|
|
8571
|
+
return React38.useMemo(
|
|
7596
8572
|
() => ({
|
|
7597
8573
|
coerce: (v) => coerceValue(v, min, max),
|
|
7598
8574
|
snap: (v) => snapToStep(v, min, step),
|
|
@@ -7730,7 +8706,7 @@ var SLIDER_INDICATOR_TRANSITION = {
|
|
|
7730
8706
|
stiffness: 450,
|
|
7731
8707
|
damping: 32
|
|
7732
8708
|
};
|
|
7733
|
-
var ValueIndicator =
|
|
8709
|
+
var ValueIndicator = React38__namespace.memo(function ValueIndicator2({
|
|
7734
8710
|
value,
|
|
7735
8711
|
visible,
|
|
7736
8712
|
orientation,
|
|
@@ -7777,7 +8753,7 @@ var ValueIndicator = React31__namespace.memo(function ValueIndicator2({
|
|
|
7777
8753
|
"value-indicator"
|
|
7778
8754
|
) });
|
|
7779
8755
|
});
|
|
7780
|
-
var SliderThumb =
|
|
8756
|
+
var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
7781
8757
|
value,
|
|
7782
8758
|
percent,
|
|
7783
8759
|
min,
|
|
@@ -7809,11 +8785,11 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7809
8785
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
7810
8786
|
};
|
|
7811
8787
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
7812
|
-
const [isDragging, setIsDragging] =
|
|
7813
|
-
const [isHovered, setIsHovered] =
|
|
7814
|
-
const [isFocused, setIsFocused] =
|
|
7815
|
-
const pointerIdRef =
|
|
7816
|
-
const thumbRef =
|
|
8788
|
+
const [isDragging, setIsDragging] = React38__namespace.useState(false);
|
|
8789
|
+
const [isHovered, setIsHovered] = React38__namespace.useState(false);
|
|
8790
|
+
const [isFocused, setIsFocused] = React38__namespace.useState(false);
|
|
8791
|
+
const pointerIdRef = React38__namespace.useRef(null);
|
|
8792
|
+
const thumbRef = React38__namespace.useRef(null);
|
|
7817
8793
|
const showIndicator = showValueIndicator && (isDragging || isHovered || isFocused);
|
|
7818
8794
|
const positionStyle = isHorizontal ? __spreadProps(__spreadValues({
|
|
7819
8795
|
position: "absolute"
|
|
@@ -7828,7 +8804,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7828
8804
|
transform: "translate(-50%, 50%)",
|
|
7829
8805
|
zIndex
|
|
7830
8806
|
});
|
|
7831
|
-
const getDeltaFromPointer =
|
|
8807
|
+
const getDeltaFromPointer = React38__namespace.useCallback(
|
|
7832
8808
|
(e) => {
|
|
7833
8809
|
const trackEl = trackRef.current;
|
|
7834
8810
|
if (!trackEl) return percent;
|
|
@@ -7855,7 +8831,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7855
8831
|
},
|
|
7856
8832
|
[isHorizontal, max, min, percent, step, trackRef, trackSize]
|
|
7857
8833
|
);
|
|
7858
|
-
const handlePointerDown =
|
|
8834
|
+
const handlePointerDown = React38__namespace.useCallback(
|
|
7859
8835
|
(e) => {
|
|
7860
8836
|
if (disabled) return;
|
|
7861
8837
|
e.preventDefault();
|
|
@@ -7866,7 +8842,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7866
8842
|
},
|
|
7867
8843
|
[disabled]
|
|
7868
8844
|
);
|
|
7869
|
-
const handlePointerMove =
|
|
8845
|
+
const handlePointerMove = React38__namespace.useCallback(
|
|
7870
8846
|
(e) => {
|
|
7871
8847
|
if (!isDragging || e.pointerId !== pointerIdRef.current) return;
|
|
7872
8848
|
const newValue = getDeltaFromPointer(e.nativeEvent);
|
|
@@ -7874,7 +8850,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7874
8850
|
},
|
|
7875
8851
|
[isDragging, getDeltaFromPointer, onValueChange]
|
|
7876
8852
|
);
|
|
7877
|
-
const handlePointerUp =
|
|
8853
|
+
const handlePointerUp = React38__namespace.useCallback(
|
|
7878
8854
|
(e) => {
|
|
7879
8855
|
if (e.pointerId !== pointerIdRef.current) return;
|
|
7880
8856
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
@@ -7884,7 +8860,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7884
8860
|
},
|
|
7885
8861
|
[onValueChangeEnd, value]
|
|
7886
8862
|
);
|
|
7887
|
-
const handleKeyDown =
|
|
8863
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
7888
8864
|
(e) => {
|
|
7889
8865
|
if (disabled) return;
|
|
7890
8866
|
if (e.key === "Home") {
|
|
@@ -7988,7 +8964,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7988
8964
|
}
|
|
7989
8965
|
);
|
|
7990
8966
|
});
|
|
7991
|
-
var RangeTrack =
|
|
8967
|
+
var RangeTrack = React38__namespace.memo(function RangeTrack2({
|
|
7992
8968
|
startPercent,
|
|
7993
8969
|
endPercent,
|
|
7994
8970
|
trackSize,
|
|
@@ -8233,7 +9209,7 @@ var RangeTrack = React31__namespace.memo(function RangeTrack2({
|
|
|
8233
9209
|
}
|
|
8234
9210
|
);
|
|
8235
9211
|
});
|
|
8236
|
-
var RangeSliderComponent =
|
|
9212
|
+
var RangeSliderComponent = React38__namespace.forwardRef(
|
|
8237
9213
|
({
|
|
8238
9214
|
value: controlledValue,
|
|
8239
9215
|
defaultValue,
|
|
@@ -8257,7 +9233,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8257
9233
|
const isHorizontal = orientation === "horizontal";
|
|
8258
9234
|
const defaultStart = (_a = defaultValue == null ? void 0 : defaultValue[0]) != null ? _a : min;
|
|
8259
9235
|
const defaultEnd = (_b = defaultValue == null ? void 0 : defaultValue[1]) != null ? _b : max;
|
|
8260
|
-
const [internalValue, setInternalValue] =
|
|
9236
|
+
const [internalValue, setInternalValue] = React38__namespace.useState([
|
|
8261
9237
|
defaultStart,
|
|
8262
9238
|
defaultEnd
|
|
8263
9239
|
]);
|
|
@@ -8271,10 +9247,10 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8271
9247
|
const endValue = snap(coerce(resolvedValue[1]));
|
|
8272
9248
|
const startPercent = toPercent(startValue);
|
|
8273
9249
|
const endPercent = toPercent(endValue);
|
|
8274
|
-
const [topThumb, setTopThumb] =
|
|
8275
|
-
const trackRef =
|
|
9250
|
+
const [topThumb, setTopThumb] = React38__namespace.useState("end");
|
|
9251
|
+
const trackRef = React38__namespace.useRef(null);
|
|
8276
9252
|
const minGap = step > 0 ? step : (max - min) / 1e3;
|
|
8277
|
-
const handleStartChange =
|
|
9253
|
+
const handleStartChange = React38__namespace.useCallback(
|
|
8278
9254
|
(newStart) => {
|
|
8279
9255
|
setTopThumb("start");
|
|
8280
9256
|
const clamped = Math.min(newStart, endValue - minGap);
|
|
@@ -8286,7 +9262,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8286
9262
|
},
|
|
8287
9263
|
[controlledValue, coerce, endValue, minGap, onValueChange, snap]
|
|
8288
9264
|
);
|
|
8289
|
-
const handleEndChange =
|
|
9265
|
+
const handleEndChange = React38__namespace.useCallback(
|
|
8290
9266
|
(newEnd) => {
|
|
8291
9267
|
setTopThumb("end");
|
|
8292
9268
|
const clamped = Math.max(newEnd, startValue + minGap);
|
|
@@ -8298,15 +9274,15 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8298
9274
|
},
|
|
8299
9275
|
[controlledValue, coerce, minGap, onValueChange, snap, startValue]
|
|
8300
9276
|
);
|
|
8301
|
-
const handleStartChangeEnd =
|
|
9277
|
+
const handleStartChangeEnd = React38__namespace.useCallback(
|
|
8302
9278
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([v, endValue]),
|
|
8303
9279
|
[endValue, onValueChangeEnd]
|
|
8304
9280
|
);
|
|
8305
|
-
const handleEndChangeEnd =
|
|
9281
|
+
const handleEndChangeEnd = React38__namespace.useCallback(
|
|
8306
9282
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([startValue, v]),
|
|
8307
9283
|
[onValueChangeEnd, startValue]
|
|
8308
9284
|
);
|
|
8309
|
-
const handleTrackPointerDown =
|
|
9285
|
+
const handleTrackPointerDown = React38__namespace.useCallback(
|
|
8310
9286
|
(e) => {
|
|
8311
9287
|
if (disabled) return;
|
|
8312
9288
|
const trackEl = trackRef.current;
|
|
@@ -8350,7 +9326,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8350
9326
|
trackSize
|
|
8351
9327
|
]
|
|
8352
9328
|
);
|
|
8353
|
-
const id =
|
|
9329
|
+
const id = React38__namespace.useId();
|
|
8354
9330
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8355
9331
|
"div",
|
|
8356
9332
|
{
|
|
@@ -8430,7 +9406,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
8430
9406
|
}
|
|
8431
9407
|
);
|
|
8432
9408
|
RangeSliderComponent.displayName = "RangeSlider";
|
|
8433
|
-
var RangeSlider =
|
|
9409
|
+
var RangeSlider = React38__namespace.memo(RangeSliderComponent);
|
|
8434
9410
|
function getHorizontalRadius(isLeading, innerR, outerR) {
|
|
8435
9411
|
if (isLeading) {
|
|
8436
9412
|
return {
|
|
@@ -8469,7 +9445,7 @@ var allInnerRadius = (innerR) => ({
|
|
|
8469
9445
|
borderTopRightRadius: innerR,
|
|
8470
9446
|
borderBottomRightRadius: innerR
|
|
8471
9447
|
});
|
|
8472
|
-
var InsetIcon =
|
|
9448
|
+
var InsetIcon = React38__namespace.memo(function InsetIcon2({
|
|
8473
9449
|
icon,
|
|
8474
9450
|
isOnActiveSegment,
|
|
8475
9451
|
position,
|
|
@@ -8563,7 +9539,7 @@ function Ticks({
|
|
|
8563
9539
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style, "aria-hidden": "true" }, tick);
|
|
8564
9540
|
}) });
|
|
8565
9541
|
}
|
|
8566
|
-
var SliderTrack =
|
|
9542
|
+
var SliderTrack = React38__namespace.memo(function SliderTrack2({
|
|
8567
9543
|
percent,
|
|
8568
9544
|
trackSize,
|
|
8569
9545
|
orientation,
|
|
@@ -8598,8 +9574,8 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
8598
9574
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
8599
9575
|
const hasAnyInsetIcon = Boolean(insetIcon || insetIconTrailing);
|
|
8600
9576
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
8601
|
-
const [trackWidth, setTrackWidth] =
|
|
8602
|
-
|
|
9577
|
+
const [trackWidth, setTrackWidth] = React38__namespace.useState(0);
|
|
9578
|
+
React38__namespace.useLayoutEffect(() => {
|
|
8603
9579
|
const el = trackRef.current;
|
|
8604
9580
|
if (!el || !hasAnyInsetIcon) return;
|
|
8605
9581
|
setTrackWidth(isHorizontal ? el.clientWidth : el.clientHeight);
|
|
@@ -8616,8 +9592,8 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
8616
9592
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
8617
9593
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
8618
9594
|
const HYSTERESIS_GAP = 0.04;
|
|
8619
|
-
const trailingActiveRef =
|
|
8620
|
-
const leadingActiveRef =
|
|
9595
|
+
const trailingActiveRef = React38__namespace.useRef(1 - percent <= iconThreshold);
|
|
9596
|
+
const leadingActiveRef = React38__namespace.useRef(percent > iconThreshold);
|
|
8621
9597
|
const trailingPercent = 1 - percent;
|
|
8622
9598
|
if (trailingActiveRef.current) {
|
|
8623
9599
|
if (trailingPercent > iconThreshold + HYSTERESIS_GAP) {
|
|
@@ -9124,7 +10100,7 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
9124
10100
|
}
|
|
9125
10101
|
);
|
|
9126
10102
|
});
|
|
9127
|
-
var SliderComponent =
|
|
10103
|
+
var SliderComponent = React38__namespace.forwardRef(
|
|
9128
10104
|
({
|
|
9129
10105
|
value: controlledValue,
|
|
9130
10106
|
defaultValue,
|
|
@@ -9153,7 +10129,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
9153
10129
|
const isHorizontal = orientation === "horizontal";
|
|
9154
10130
|
const midpoint = min + (max - min) / 2;
|
|
9155
10131
|
const initialValue = defaultValue != null ? defaultValue : midpoint;
|
|
9156
|
-
const [internalValue, setInternalValue] =
|
|
10132
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(initialValue);
|
|
9157
10133
|
const resolvedValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
9158
10134
|
const { coerce, snap, toPercent, ticks } = useSliderMath({
|
|
9159
10135
|
min,
|
|
@@ -9162,8 +10138,8 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
9162
10138
|
});
|
|
9163
10139
|
const safeValue = snap(coerce(resolvedValue));
|
|
9164
10140
|
const percent = toPercent(safeValue);
|
|
9165
|
-
const trackRef =
|
|
9166
|
-
const handleValueChange =
|
|
10141
|
+
const trackRef = React38__namespace.useRef(null);
|
|
10142
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
9167
10143
|
(newValue) => {
|
|
9168
10144
|
const clamped = snap(coerce(newValue));
|
|
9169
10145
|
if (controlledValue === void 0) {
|
|
@@ -9173,13 +10149,13 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
9173
10149
|
},
|
|
9174
10150
|
[coerce, controlledValue, onValueChange, snap]
|
|
9175
10151
|
);
|
|
9176
|
-
const handleValueChangeEnd =
|
|
10152
|
+
const handleValueChangeEnd = React38__namespace.useCallback(
|
|
9177
10153
|
(newValue) => {
|
|
9178
10154
|
onValueChangeEnd == null ? void 0 : onValueChangeEnd(snap(coerce(newValue)));
|
|
9179
10155
|
},
|
|
9180
10156
|
[coerce, onValueChangeEnd, snap]
|
|
9181
10157
|
);
|
|
9182
|
-
const handleTrackPointerDown =
|
|
10158
|
+
const handleTrackPointerDown = React38__namespace.useCallback(
|
|
9183
10159
|
(e) => {
|
|
9184
10160
|
if (disabled) return;
|
|
9185
10161
|
const trackEl = trackRef.current;
|
|
@@ -9214,7 +10190,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
9214
10190
|
trackSize
|
|
9215
10191
|
]
|
|
9216
10192
|
);
|
|
9217
|
-
const id =
|
|
10193
|
+
const id = React38__namespace.useId();
|
|
9218
10194
|
const thumbId = `slider-thumb-${id}`;
|
|
9219
10195
|
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[trackSize] >= 40;
|
|
9220
10196
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
@@ -9286,7 +10262,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
9286
10262
|
}
|
|
9287
10263
|
);
|
|
9288
10264
|
SliderComponent.displayName = "Slider";
|
|
9289
|
-
var Slider =
|
|
10265
|
+
var Slider = React38__namespace.memo(SliderComponent);
|
|
9290
10266
|
var DURATION_MAP = {
|
|
9291
10267
|
short: 4e3,
|
|
9292
10268
|
long: 7e3
|
|
@@ -9332,9 +10308,9 @@ function toSnackbarData(item) {
|
|
|
9332
10308
|
return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
|
|
9333
10309
|
}
|
|
9334
10310
|
function useSnackbarState() {
|
|
9335
|
-
const [current, setCurrent] =
|
|
9336
|
-
const queueRef =
|
|
9337
|
-
const showSnackbar =
|
|
10311
|
+
const [current, setCurrent] = React38__namespace.useState(null);
|
|
10312
|
+
const queueRef = React38__namespace.useRef([]);
|
|
10313
|
+
const showSnackbar = React38__namespace.useCallback(
|
|
9338
10314
|
(visuals) => {
|
|
9339
10315
|
return new Promise((resolve) => {
|
|
9340
10316
|
const item = { visuals, resolve };
|
|
@@ -9347,14 +10323,14 @@ function useSnackbarState() {
|
|
|
9347
10323
|
},
|
|
9348
10324
|
[]
|
|
9349
10325
|
);
|
|
9350
|
-
const _dismiss =
|
|
10326
|
+
const _dismiss = React38__namespace.useCallback((result) => {
|
|
9351
10327
|
setCurrent((prev) => {
|
|
9352
10328
|
if (prev) prev.resolve(result);
|
|
9353
10329
|
const next = queueRef.current.shift();
|
|
9354
10330
|
return next ? toSnackbarData(next) : null;
|
|
9355
10331
|
});
|
|
9356
10332
|
}, []);
|
|
9357
|
-
|
|
10333
|
+
React38__namespace.useEffect(() => {
|
|
9358
10334
|
return () => {
|
|
9359
10335
|
for (const item of queueRef.current) {
|
|
9360
10336
|
item.resolve(RESULT.DISMISSED);
|
|
@@ -9364,7 +10340,7 @@ function useSnackbarState() {
|
|
|
9364
10340
|
}, []);
|
|
9365
10341
|
return { current, showSnackbar, _dismiss };
|
|
9366
10342
|
}
|
|
9367
|
-
var Snackbar =
|
|
10343
|
+
var Snackbar = React38__namespace.memo(function Snackbar2({
|
|
9368
10344
|
data,
|
|
9369
10345
|
className
|
|
9370
10346
|
}) {
|
|
@@ -9378,15 +10354,15 @@ var Snackbar = React31__namespace.memo(function Snackbar2({
|
|
|
9378
10354
|
} = visuals;
|
|
9379
10355
|
const reducedMotion = react.useReducedMotion();
|
|
9380
10356
|
const durationMs = resolveDuration(duration);
|
|
9381
|
-
|
|
10357
|
+
React38__namespace.useEffect(() => {
|
|
9382
10358
|
const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
|
|
9383
10359
|
return () => clearTimeout(timer);
|
|
9384
10360
|
}, [resolve, durationMs]);
|
|
9385
|
-
const handleAction =
|
|
10361
|
+
const handleAction = React38__namespace.useCallback(
|
|
9386
10362
|
() => resolve(RESULT.ACTION),
|
|
9387
10363
|
[resolve]
|
|
9388
10364
|
);
|
|
9389
|
-
const handleDismiss =
|
|
10365
|
+
const handleDismiss = React38__namespace.useCallback(
|
|
9390
10366
|
() => resolve(RESULT.DISMISSED),
|
|
9391
10367
|
[resolve]
|
|
9392
10368
|
);
|
|
@@ -9454,7 +10430,7 @@ var Snackbar = React31__namespace.memo(function Snackbar2({
|
|
|
9454
10430
|
Snackbar.displayName = "Snackbar";
|
|
9455
10431
|
function SnackbarHost({ state, className }) {
|
|
9456
10432
|
const { current, _dismiss } = state;
|
|
9457
|
-
const wrappedData =
|
|
10433
|
+
const wrappedData = React38__namespace.useMemo(() => {
|
|
9458
10434
|
if (!current) return null;
|
|
9459
10435
|
return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
|
|
9460
10436
|
}, [current, _dismiss]);
|
|
@@ -9472,12 +10448,12 @@ function SnackbarHost({ state, className }) {
|
|
|
9472
10448
|
) });
|
|
9473
10449
|
}
|
|
9474
10450
|
SnackbarHost.displayName = "SnackbarHost";
|
|
9475
|
-
var SnackbarContext =
|
|
10451
|
+
var SnackbarContext = React38__namespace.createContext(
|
|
9476
10452
|
null
|
|
9477
10453
|
);
|
|
9478
10454
|
function SnackbarProvider({ children }) {
|
|
9479
10455
|
const state = useSnackbarState();
|
|
9480
|
-
const contextValue =
|
|
10456
|
+
const contextValue = React38__namespace.useMemo(
|
|
9481
10457
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
9482
10458
|
[state.showSnackbar]
|
|
9483
10459
|
);
|
|
@@ -9488,7 +10464,7 @@ function SnackbarProvider({ children }) {
|
|
|
9488
10464
|
}
|
|
9489
10465
|
SnackbarProvider.displayName = "SnackbarProvider";
|
|
9490
10466
|
function useSnackbar() {
|
|
9491
|
-
const ctx =
|
|
10467
|
+
const ctx = React38__namespace.useContext(SnackbarContext);
|
|
9492
10468
|
if (!ctx) {
|
|
9493
10469
|
throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
|
|
9494
10470
|
}
|
|
@@ -9551,7 +10527,7 @@ var SwitchColors = {
|
|
|
9551
10527
|
// Focus indicator
|
|
9552
10528
|
focusIndicator: "var(--md-sys-color-secondary)"
|
|
9553
10529
|
};
|
|
9554
|
-
var
|
|
10530
|
+
var FAST_SPATIAL_SPRING2 = {
|
|
9555
10531
|
type: "spring",
|
|
9556
10532
|
stiffness: 500,
|
|
9557
10533
|
damping: 40
|
|
@@ -9592,7 +10568,7 @@ function isIconVisible(thumbContent, icons, showOnlySelectedIcon, checked) {
|
|
|
9592
10568
|
if (icons) return true;
|
|
9593
10569
|
return showOnlySelectedIcon && checked;
|
|
9594
10570
|
}
|
|
9595
|
-
var SwitchVisual =
|
|
10571
|
+
var SwitchVisual = React38__namespace.memo(function SwitchVisual2({
|
|
9596
10572
|
checked,
|
|
9597
10573
|
disabled,
|
|
9598
10574
|
isPressed,
|
|
@@ -9683,9 +10659,9 @@ var SwitchVisual = React31__namespace.memo(function SwitchVisual2({
|
|
|
9683
10659
|
backgroundColor: thumbBg
|
|
9684
10660
|
},
|
|
9685
10661
|
transition: prefersReduced ? { duration: 0 } : isPressed ? SNAP_TRANSITION : {
|
|
9686
|
-
x:
|
|
9687
|
-
width:
|
|
9688
|
-
height:
|
|
10662
|
+
x: FAST_SPATIAL_SPRING2,
|
|
10663
|
+
width: FAST_SPATIAL_SPRING2,
|
|
10664
|
+
height: FAST_SPATIAL_SPRING2,
|
|
9689
10665
|
backgroundColor: colorTransition
|
|
9690
10666
|
},
|
|
9691
10667
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: showIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9712,7 +10688,7 @@ var SwitchVisual = React31__namespace.memo(function SwitchVisual2({
|
|
|
9712
10688
|
}
|
|
9713
10689
|
);
|
|
9714
10690
|
});
|
|
9715
|
-
var SwitchComponent =
|
|
10691
|
+
var SwitchComponent = React38__namespace.forwardRef(
|
|
9716
10692
|
({
|
|
9717
10693
|
checked,
|
|
9718
10694
|
onCheckedChange,
|
|
@@ -9730,16 +10706,16 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
9730
10706
|
}, ref) => {
|
|
9731
10707
|
var _a;
|
|
9732
10708
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
9733
|
-
const [isPressed, setIsPressed] =
|
|
9734
|
-
const [isHovered, setIsHovered] =
|
|
9735
|
-
const [isFocused, setIsFocused] =
|
|
9736
|
-
const [ripples, setRipples] =
|
|
9737
|
-
const generatedId =
|
|
10709
|
+
const [isPressed, setIsPressed] = React38__namespace.useState(false);
|
|
10710
|
+
const [isHovered, setIsHovered] = React38__namespace.useState(false);
|
|
10711
|
+
const [isFocused, setIsFocused] = React38__namespace.useState(false);
|
|
10712
|
+
const [ripples, setRipples] = React38__namespace.useState([]);
|
|
10713
|
+
const generatedId = React38__namespace.useId();
|
|
9738
10714
|
const switchId = label ? `switch-${generatedId}` : void 0;
|
|
9739
|
-
const handleClick =
|
|
10715
|
+
const handleClick = React38__namespace.useCallback(() => {
|
|
9740
10716
|
if (!disabled) onCheckedChange(!checked);
|
|
9741
10717
|
}, [disabled, checked, onCheckedChange]);
|
|
9742
|
-
const handleKeyDown =
|
|
10718
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
9743
10719
|
(e) => {
|
|
9744
10720
|
if (disabled) return;
|
|
9745
10721
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -9749,7 +10725,7 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
9749
10725
|
},
|
|
9750
10726
|
[disabled, checked, onCheckedChange]
|
|
9751
10727
|
);
|
|
9752
|
-
const handlePointerDown =
|
|
10728
|
+
const handlePointerDown = React38__namespace.useCallback(
|
|
9753
10729
|
(e) => {
|
|
9754
10730
|
if (disabled) return;
|
|
9755
10731
|
setIsPressed(true);
|
|
@@ -9764,19 +10740,19 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
9764
10740
|
},
|
|
9765
10741
|
[disabled]
|
|
9766
10742
|
);
|
|
9767
|
-
const handlePointerUp =
|
|
10743
|
+
const handlePointerUp = React38__namespace.useCallback(() => {
|
|
9768
10744
|
setIsPressed(false);
|
|
9769
10745
|
}, []);
|
|
9770
|
-
const handlePointerEnter =
|
|
10746
|
+
const handlePointerEnter = React38__namespace.useCallback(() => {
|
|
9771
10747
|
if (!disabled) setIsHovered(true);
|
|
9772
10748
|
}, [disabled]);
|
|
9773
|
-
const handlePointerLeave =
|
|
10749
|
+
const handlePointerLeave = React38__namespace.useCallback(() => {
|
|
9774
10750
|
setIsHovered(false);
|
|
9775
10751
|
setIsPressed(false);
|
|
9776
10752
|
}, []);
|
|
9777
|
-
const handleFocus =
|
|
9778
|
-
const handleBlur =
|
|
9779
|
-
const removeRipple =
|
|
10753
|
+
const handleFocus = React38__namespace.useCallback(() => setIsFocused(true), []);
|
|
10754
|
+
const handleBlur = React38__namespace.useCallback(() => setIsFocused(false), []);
|
|
10755
|
+
const removeRipple = React38__namespace.useCallback(
|
|
9780
10756
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
9781
10757
|
[]
|
|
9782
10758
|
);
|
|
@@ -9861,10 +10837,54 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
9861
10837
|
}
|
|
9862
10838
|
);
|
|
9863
10839
|
SwitchComponent.displayName = "Switch";
|
|
9864
|
-
var Switch =
|
|
9865
|
-
var
|
|
10840
|
+
var Switch = React38__namespace.memo(SwitchComponent);
|
|
10841
|
+
var typographyVariants = classVarianceAuthority.cva("m-0 p-0 text-m3-on-surface", {
|
|
10842
|
+
variants: {
|
|
10843
|
+
variant: {
|
|
10844
|
+
"display-lg": "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
|
|
10845
|
+
"display-md": "text-[45px] leading-[52px] font-normal tracking-[0px]",
|
|
10846
|
+
"display-sm": "text-[36px] leading-[44px] font-normal tracking-[0px]",
|
|
10847
|
+
"headline-lg": "text-[32px] leading-[40px] font-normal tracking-[0px]",
|
|
10848
|
+
"headline-md": "text-[28px] leading-[36px] font-normal tracking-[0px]",
|
|
10849
|
+
"headline-sm": "text-[24px] leading-[32px] font-normal tracking-[0px]",
|
|
10850
|
+
"title-lg": "text-[22px] leading-[28px] font-normal tracking-[0px]",
|
|
10851
|
+
"title-md": "text-[16px] leading-[24px] font-medium tracking-[0.15px]",
|
|
10852
|
+
"title-sm": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
|
|
10853
|
+
"label-lg": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
|
|
10854
|
+
"label-md": "text-[12px] leading-[16px] font-medium tracking-[0.5px]",
|
|
10855
|
+
"label-sm": "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
|
|
10856
|
+
"body-lg": "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
|
|
10857
|
+
"body-md": "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
|
|
10858
|
+
"body-sm": "text-[12px] leading-[16px] font-normal tracking-[0.4px]"
|
|
10859
|
+
}
|
|
10860
|
+
},
|
|
10861
|
+
defaultVariants: {
|
|
10862
|
+
variant: "body-md"
|
|
10863
|
+
}
|
|
10864
|
+
});
|
|
10865
|
+
var Text = React38__namespace.forwardRef(
|
|
10866
|
+
(_a, ref) => {
|
|
10867
|
+
var _b = _a, { className, variant, as: Component } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
10868
|
+
const defaultComponent = React38__namespace.useMemo(() => {
|
|
10869
|
+
if ((variant == null ? void 0 : variant.startsWith("display")) || (variant == null ? void 0 : variant.startsWith("headline")))
|
|
10870
|
+
return "h1";
|
|
10871
|
+
if (variant == null ? void 0 : variant.startsWith("title")) return "h2";
|
|
10872
|
+
return "p";
|
|
10873
|
+
}, [variant]);
|
|
10874
|
+
const Tag = Component || defaultComponent;
|
|
10875
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10876
|
+
Tag,
|
|
10877
|
+
__spreadValues({
|
|
10878
|
+
ref,
|
|
10879
|
+
className: cn(typographyVariants({ variant, className }))
|
|
10880
|
+
}, props)
|
|
10881
|
+
);
|
|
10882
|
+
}
|
|
10883
|
+
);
|
|
10884
|
+
Text.displayName = "Text";
|
|
10885
|
+
var TabsContext = React38__namespace.createContext(null);
|
|
9866
10886
|
function useTabsContext() {
|
|
9867
|
-
const ctx =
|
|
10887
|
+
const ctx = React38__namespace.useContext(TabsContext);
|
|
9868
10888
|
if (!ctx) {
|
|
9869
10889
|
throw new Error(
|
|
9870
10890
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -9872,7 +10892,7 @@ function useTabsContext() {
|
|
|
9872
10892
|
}
|
|
9873
10893
|
return ctx;
|
|
9874
10894
|
}
|
|
9875
|
-
var TabsComponent =
|
|
10895
|
+
var TabsComponent = React38__namespace.forwardRef(
|
|
9876
10896
|
({
|
|
9877
10897
|
value: controlledValue,
|
|
9878
10898
|
defaultValue = "",
|
|
@@ -9881,35 +10901,35 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9881
10901
|
children,
|
|
9882
10902
|
className
|
|
9883
10903
|
}, ref) => {
|
|
9884
|
-
const [internalValue, setInternalValue] =
|
|
10904
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
9885
10905
|
const isControlled = controlledValue !== void 0;
|
|
9886
10906
|
const value = isControlled ? controlledValue : internalValue;
|
|
9887
|
-
const handleValueChange =
|
|
10907
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
9888
10908
|
(newValue) => {
|
|
9889
10909
|
if (!isControlled) setInternalValue(newValue);
|
|
9890
10910
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9891
10911
|
},
|
|
9892
10912
|
[isControlled, onValueChange]
|
|
9893
10913
|
);
|
|
9894
|
-
const [focusedValue, setFocusedValue] =
|
|
9895
|
-
|
|
10914
|
+
const [focusedValue, setFocusedValue] = React38__namespace.useState(value);
|
|
10915
|
+
React38__namespace.useEffect(() => {
|
|
9896
10916
|
setFocusedValue(value);
|
|
9897
10917
|
}, [value]);
|
|
9898
|
-
const [tabValues, setTabValues] =
|
|
9899
|
-
const registerTab =
|
|
10918
|
+
const [tabValues, setTabValues] = React38__namespace.useState([]);
|
|
10919
|
+
const registerTab = React38__namespace.useCallback((tabValue) => {
|
|
9900
10920
|
setTabValues((prev) => {
|
|
9901
10921
|
if (prev.includes(tabValue)) return prev;
|
|
9902
10922
|
return [...prev, tabValue];
|
|
9903
10923
|
});
|
|
9904
10924
|
}, []);
|
|
9905
|
-
const unregisterTab =
|
|
10925
|
+
const unregisterTab = React38__namespace.useCallback((tabValue) => {
|
|
9906
10926
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
9907
10927
|
}, []);
|
|
9908
|
-
const hasAutoSelected =
|
|
9909
|
-
const [disabledValues, setDisabledValues] =
|
|
10928
|
+
const hasAutoSelected = React38__namespace.useRef(false);
|
|
10929
|
+
const [disabledValues, setDisabledValues] = React38__namespace.useState(
|
|
9910
10930
|
/* @__PURE__ */ new Set()
|
|
9911
10931
|
);
|
|
9912
|
-
const markTabDisabled =
|
|
10932
|
+
const markTabDisabled = React38__namespace.useCallback(
|
|
9913
10933
|
(tabValue, disabled) => {
|
|
9914
10934
|
setDisabledValues((prev) => {
|
|
9915
10935
|
const next = new Set(prev);
|
|
@@ -9923,7 +10943,7 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9923
10943
|
},
|
|
9924
10944
|
[]
|
|
9925
10945
|
);
|
|
9926
|
-
|
|
10946
|
+
React38__namespace.useEffect(() => {
|
|
9927
10947
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
9928
10948
|
return;
|
|
9929
10949
|
}
|
|
@@ -9938,9 +10958,9 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9938
10958
|
setFocusedValue(firstEnabled);
|
|
9939
10959
|
}
|
|
9940
10960
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
9941
|
-
const id =
|
|
10961
|
+
const id = React38__namespace.useId();
|
|
9942
10962
|
const layoutGroupId = `tabs-${id}`;
|
|
9943
|
-
const contextValue =
|
|
10963
|
+
const contextValue = React38__namespace.useMemo(
|
|
9944
10964
|
() => ({
|
|
9945
10965
|
value,
|
|
9946
10966
|
onValueChange: handleValueChange,
|
|
@@ -9971,12 +10991,12 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9971
10991
|
}
|
|
9972
10992
|
);
|
|
9973
10993
|
TabsComponent.displayName = "Tabs";
|
|
9974
|
-
var Tabs =
|
|
9975
|
-
var TabsListContext =
|
|
10994
|
+
var Tabs = React38__namespace.memo(TabsComponent);
|
|
10995
|
+
var TabsListContext = React38__namespace.createContext(
|
|
9976
10996
|
null
|
|
9977
10997
|
);
|
|
9978
10998
|
function useTabsListContext() {
|
|
9979
|
-
const ctx =
|
|
10999
|
+
const ctx = React38__namespace.useContext(TabsListContext);
|
|
9980
11000
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
9981
11001
|
}
|
|
9982
11002
|
|
|
@@ -10060,7 +11080,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
10060
11080
|
ease: "easeInOut"
|
|
10061
11081
|
};
|
|
10062
11082
|
var INDICATOR_MIN_WIDTH = 24;
|
|
10063
|
-
var TabComponent =
|
|
11083
|
+
var TabComponent = React38__namespace.forwardRef(
|
|
10064
11084
|
({
|
|
10065
11085
|
value,
|
|
10066
11086
|
icon,
|
|
@@ -10090,9 +11110,9 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
10090
11110
|
const isFocused = focusedValue === value;
|
|
10091
11111
|
const hasIcon = icon != null;
|
|
10092
11112
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
10093
|
-
const buttonRef =
|
|
10094
|
-
const isFirstMount =
|
|
10095
|
-
const mergedRef =
|
|
11113
|
+
const buttonRef = React38__namespace.useRef(null);
|
|
11114
|
+
const isFirstMount = React38__namespace.useRef(true);
|
|
11115
|
+
const mergedRef = React38__namespace.useCallback(
|
|
10096
11116
|
(node) => {
|
|
10097
11117
|
buttonRef.current = node;
|
|
10098
11118
|
if (typeof ref === "function") ref(node);
|
|
@@ -10100,15 +11120,15 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
10100
11120
|
},
|
|
10101
11121
|
[ref]
|
|
10102
11122
|
);
|
|
10103
|
-
|
|
11123
|
+
React38__namespace.useEffect(() => {
|
|
10104
11124
|
registerTab(value);
|
|
10105
11125
|
return () => unregisterTab(value);
|
|
10106
11126
|
}, [value, registerTab, unregisterTab]);
|
|
10107
|
-
|
|
11127
|
+
React38__namespace.useEffect(() => {
|
|
10108
11128
|
markTabDisabled(value, disabled);
|
|
10109
11129
|
return () => markTabDisabled(value, false);
|
|
10110
11130
|
}, [value, disabled, markTabDisabled]);
|
|
10111
|
-
const handleKeyDown =
|
|
11131
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
10112
11132
|
(e) => {
|
|
10113
11133
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
10114
11134
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -10162,7 +11182,7 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
10162
11182
|
autoActivate
|
|
10163
11183
|
]
|
|
10164
11184
|
);
|
|
10165
|
-
|
|
11185
|
+
React38__namespace.useEffect(() => {
|
|
10166
11186
|
if (isFirstMount.current) {
|
|
10167
11187
|
isFirstMount.current = false;
|
|
10168
11188
|
return;
|
|
@@ -10171,7 +11191,7 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
10171
11191
|
buttonRef.current.focus({ preventScroll: true });
|
|
10172
11192
|
}
|
|
10173
11193
|
}, [isFocused]);
|
|
10174
|
-
|
|
11194
|
+
React38__namespace.useEffect(() => {
|
|
10175
11195
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
10176
11196
|
const btn = buttonRef.current;
|
|
10177
11197
|
let container = btn.parentElement;
|
|
@@ -10308,8 +11328,8 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
10308
11328
|
}
|
|
10309
11329
|
);
|
|
10310
11330
|
TabComponent.displayName = "Tab";
|
|
10311
|
-
var Tab =
|
|
10312
|
-
var TabsContentComponent =
|
|
11331
|
+
var Tab = React38__namespace.memo(TabComponent);
|
|
11332
|
+
var TabsContentComponent = React38__namespace.forwardRef(
|
|
10313
11333
|
({ value, className, children }, ref) => {
|
|
10314
11334
|
var _a;
|
|
10315
11335
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -10343,8 +11363,8 @@ var TabsContentComponent = React31__namespace.forwardRef(
|
|
|
10343
11363
|
}
|
|
10344
11364
|
);
|
|
10345
11365
|
TabsContentComponent.displayName = "TabsContent";
|
|
10346
|
-
var TabsContent =
|
|
10347
|
-
var TabsListComponent =
|
|
11366
|
+
var TabsContent = React38__namespace.memo(TabsContentComponent);
|
|
11367
|
+
var TabsListComponent = React38__namespace.forwardRef(
|
|
10348
11368
|
({
|
|
10349
11369
|
variant,
|
|
10350
11370
|
scrollable = false,
|
|
@@ -10355,12 +11375,12 @@ var TabsListComponent = React31__namespace.forwardRef(
|
|
|
10355
11375
|
}, ref) => {
|
|
10356
11376
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
10357
11377
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
10358
|
-
const listContextValue =
|
|
11378
|
+
const listContextValue = React38__namespace.useMemo(
|
|
10359
11379
|
() => ({ variant, scrollable }),
|
|
10360
11380
|
[variant, scrollable]
|
|
10361
11381
|
);
|
|
10362
11382
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
10363
|
-
const handleBlur =
|
|
11383
|
+
const handleBlur = React38__namespace.useCallback(
|
|
10364
11384
|
(e) => {
|
|
10365
11385
|
const listEl = e.currentTarget;
|
|
10366
11386
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -10409,7 +11429,7 @@ var TabsListComponent = React31__namespace.forwardRef(
|
|
|
10409
11429
|
}
|
|
10410
11430
|
);
|
|
10411
11431
|
TabsListComponent.displayName = "TabsList";
|
|
10412
|
-
var TabsList =
|
|
11432
|
+
var TabsList = React38__namespace.memo(TabsListComponent);
|
|
10413
11433
|
|
|
10414
11434
|
// src/ui/text-field/text-field.tokens.ts
|
|
10415
11435
|
var TF_COLORS = {
|
|
@@ -10448,7 +11468,7 @@ var TF_TYPOGRAPHY = {
|
|
|
10448
11468
|
var TF_CLASSES = {
|
|
10449
11469
|
// Prefix / Suffix
|
|
10450
11470
|
prefixSuffix: "text-base text-[var(--color-m3-on-surface-variant)] select-none shrink-0"};
|
|
10451
|
-
var ActiveIndicator =
|
|
11471
|
+
var ActiveIndicator = React38__namespace.memo(function ActiveIndicator2({
|
|
10452
11472
|
isFocused,
|
|
10453
11473
|
isError,
|
|
10454
11474
|
isDisabled,
|
|
@@ -10495,7 +11515,7 @@ function getLabelColor(isFloated, isFocused, isError, isDisabled) {
|
|
|
10495
11515
|
if (isFloated && isFocused) return TF_COLORS.primary;
|
|
10496
11516
|
return TF_COLORS.onSurfaceVariant;
|
|
10497
11517
|
}
|
|
10498
|
-
var FloatingLabel =
|
|
11518
|
+
var FloatingLabel = React38__namespace.memo(function FloatingLabel2({
|
|
10499
11519
|
text,
|
|
10500
11520
|
isFloated,
|
|
10501
11521
|
isFocused,
|
|
@@ -10555,7 +11575,7 @@ var FloatingLabel = React31__namespace.memo(function FloatingLabel2({
|
|
|
10555
11575
|
);
|
|
10556
11576
|
});
|
|
10557
11577
|
FloatingLabel.displayName = "FloatingLabel";
|
|
10558
|
-
var LeadingIcon =
|
|
11578
|
+
var LeadingIcon = React38__namespace.memo(function LeadingIcon2({
|
|
10559
11579
|
children,
|
|
10560
11580
|
isError,
|
|
10561
11581
|
isDisabled
|
|
@@ -10579,7 +11599,7 @@ function getOutlineColor(isFocused, isError, isHovered, isDisabled) {
|
|
|
10579
11599
|
if (isHovered) return TF_COLORS.inputText;
|
|
10580
11600
|
return TF_COLORS.outline;
|
|
10581
11601
|
}
|
|
10582
|
-
var OutlineContainer =
|
|
11602
|
+
var OutlineContainer = React38__namespace.memo(function OutlineContainer2({
|
|
10583
11603
|
isFloated,
|
|
10584
11604
|
isFocused,
|
|
10585
11605
|
isError,
|
|
@@ -10677,7 +11697,7 @@ var OutlineContainer = React31__namespace.memo(function OutlineContainer2({
|
|
|
10677
11697
|
);
|
|
10678
11698
|
});
|
|
10679
11699
|
OutlineContainer.displayName = "OutlineContainer";
|
|
10680
|
-
var PrefixSuffix =
|
|
11700
|
+
var PrefixSuffix = React38__namespace.memo(function PrefixSuffix2({
|
|
10681
11701
|
text,
|
|
10682
11702
|
type,
|
|
10683
11703
|
visible,
|
|
@@ -10719,7 +11739,7 @@ function AnimatedText({
|
|
|
10719
11739
|
motionKey
|
|
10720
11740
|
);
|
|
10721
11741
|
}
|
|
10722
|
-
var SupportingText =
|
|
11742
|
+
var SupportingText = React38__namespace.memo(function SupportingText2({
|
|
10723
11743
|
supportingText,
|
|
10724
11744
|
errorText,
|
|
10725
11745
|
isError,
|
|
@@ -10830,7 +11850,7 @@ function ClearIcon() {
|
|
|
10830
11850
|
}
|
|
10831
11851
|
);
|
|
10832
11852
|
}
|
|
10833
|
-
var TrailingIcon =
|
|
11853
|
+
var TrailingIcon = React38__namespace.memo(function TrailingIcon2({
|
|
10834
11854
|
mode,
|
|
10835
11855
|
children,
|
|
10836
11856
|
value,
|
|
@@ -10896,7 +11916,7 @@ var TrailingIcon = React31__namespace.memo(function TrailingIcon2({
|
|
|
10896
11916
|
});
|
|
10897
11917
|
TrailingIcon.displayName = "TrailingIcon";
|
|
10898
11918
|
var LINE_HEIGHT_PX = 24;
|
|
10899
|
-
var TextFieldComponent =
|
|
11919
|
+
var TextFieldComponent = React38__namespace.forwardRef(
|
|
10900
11920
|
({
|
|
10901
11921
|
// Core
|
|
10902
11922
|
variant = "filled",
|
|
@@ -10960,30 +11980,30 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10960
11980
|
}, ref) => {
|
|
10961
11981
|
var _a;
|
|
10962
11982
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
10963
|
-
const generatedId =
|
|
11983
|
+
const generatedId = React38__namespace.useId();
|
|
10964
11984
|
const inputId = idProp != null ? idProp : `tf-${generatedId}`;
|
|
10965
11985
|
const supportingId = `${inputId}-supporting`;
|
|
10966
11986
|
const isControlled = valueProp !== void 0;
|
|
10967
|
-
const [internalValue, setInternalValue] =
|
|
11987
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
10968
11988
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
10969
|
-
const [isFocused, setIsFocused] =
|
|
10970
|
-
const [showPassword, setShowPassword] =
|
|
11989
|
+
const [isFocused, setIsFocused] = React38__namespace.useState(false);
|
|
11990
|
+
const [showPassword, setShowPassword] = React38__namespace.useState(false);
|
|
10971
11991
|
const resolvedInputType = type === "password" && showPassword ? "text" : type;
|
|
10972
|
-
const [nativeError, setNativeError] =
|
|
10973
|
-
const [labelWidth, setLabelWidth] =
|
|
11992
|
+
const [nativeError, setNativeError] = React38__namespace.useState("");
|
|
11993
|
+
const [labelWidth, setLabelWidth] = React38__namespace.useState(0);
|
|
10974
11994
|
const hasValue = currentValue.length > 0;
|
|
10975
11995
|
const isFloated = isFocused || hasValue;
|
|
10976
11996
|
const isError = errorProp || !!nativeError || maxLength !== void 0 && currentValue.length > maxLength;
|
|
10977
11997
|
const containerHeight = dense ? TF_SIZE.denseHeight : TF_SIZE.height;
|
|
10978
11998
|
const showAsterisk = required && !noAsterisk;
|
|
10979
|
-
const inputRef =
|
|
10980
|
-
const labelSpanRef =
|
|
10981
|
-
|
|
11999
|
+
const inputRef = React38__namespace.useRef(null);
|
|
12000
|
+
const labelSpanRef = React38__namespace.useRef(null);
|
|
12001
|
+
React38__namespace.useLayoutEffect(() => {
|
|
10982
12002
|
if (labelSpanRef.current) {
|
|
10983
12003
|
setLabelWidth(labelSpanRef.current.offsetWidth);
|
|
10984
12004
|
}
|
|
10985
12005
|
}, []);
|
|
10986
|
-
|
|
12006
|
+
React38__namespace.useLayoutEffect(() => {
|
|
10987
12007
|
if (type !== "textarea" || !inputRef.current) return;
|
|
10988
12008
|
const textarea = inputRef.current;
|
|
10989
12009
|
if (autoResize) {
|
|
@@ -10995,7 +12015,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10995
12015
|
}
|
|
10996
12016
|
textarea.style.overflowY = "hidden";
|
|
10997
12017
|
}, [type, autoResize, maxRows, currentValue]);
|
|
10998
|
-
const handleValueChange =
|
|
12018
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
10999
12019
|
(newValue) => {
|
|
11000
12020
|
var _a2, _b;
|
|
11001
12021
|
if (!isControlled) setInternalValue(newValue);
|
|
@@ -11004,7 +12024,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
11004
12024
|
},
|
|
11005
12025
|
[isControlled]
|
|
11006
12026
|
);
|
|
11007
|
-
const handleChange =
|
|
12027
|
+
const handleChange = React38__namespace.useCallback(
|
|
11008
12028
|
(e) => {
|
|
11009
12029
|
const newVal = e.target.value;
|
|
11010
12030
|
handleValueChange(newVal);
|
|
@@ -11012,14 +12032,14 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
11012
12032
|
},
|
|
11013
12033
|
[handleValueChange, onChange]
|
|
11014
12034
|
);
|
|
11015
|
-
const handleFocus =
|
|
12035
|
+
const handleFocus = React38__namespace.useCallback(
|
|
11016
12036
|
(e) => {
|
|
11017
12037
|
setIsFocused(true);
|
|
11018
12038
|
onFocus == null ? void 0 : onFocus(e);
|
|
11019
12039
|
},
|
|
11020
12040
|
[onFocus]
|
|
11021
12041
|
);
|
|
11022
|
-
const handleBlur =
|
|
12042
|
+
const handleBlur = React38__namespace.useCallback(
|
|
11023
12043
|
(e) => {
|
|
11024
12044
|
setIsFocused(false);
|
|
11025
12045
|
const el = inputRef.current;
|
|
@@ -11032,7 +12052,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
11032
12052
|
},
|
|
11033
12053
|
[onBlur]
|
|
11034
12054
|
);
|
|
11035
|
-
const handleClear =
|
|
12055
|
+
const handleClear = React38__namespace.useCallback(() => {
|
|
11036
12056
|
var _a2;
|
|
11037
12057
|
handleValueChange("");
|
|
11038
12058
|
onChange == null ? void 0 : onChange("", {
|
|
@@ -11040,12 +12060,12 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
11040
12060
|
});
|
|
11041
12061
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
11042
12062
|
}, [handleValueChange, onChange]);
|
|
11043
|
-
const handlePasswordToggle =
|
|
12063
|
+
const handlePasswordToggle = React38__namespace.useCallback(() => {
|
|
11044
12064
|
var _a2;
|
|
11045
12065
|
setShowPassword((prev) => !prev);
|
|
11046
12066
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
11047
12067
|
}, []);
|
|
11048
|
-
|
|
12068
|
+
React38__namespace.useImperativeHandle(
|
|
11049
12069
|
ref,
|
|
11050
12070
|
() => ({
|
|
11051
12071
|
focus: () => {
|
|
@@ -11290,7 +12310,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
11290
12310
|
}
|
|
11291
12311
|
);
|
|
11292
12312
|
TextFieldComponent.displayName = "TextField";
|
|
11293
|
-
var TextField =
|
|
12313
|
+
var TextField = React38__namespace.memo(TextFieldComponent);
|
|
11294
12314
|
|
|
11295
12315
|
// src/ui/typography/typography-key-tokens.ts
|
|
11296
12316
|
var TypographyKeyTokens = /* @__PURE__ */ ((TypographyKeyTokens2) => {
|
|
@@ -12005,9 +13025,9 @@ var TOKEN_TO_PROP = {
|
|
|
12005
13025
|
};
|
|
12006
13026
|
var defaultTokens = new TypographyTokens();
|
|
12007
13027
|
var defaultTypography = new Typography();
|
|
12008
|
-
var TypographyContext =
|
|
13028
|
+
var TypographyContext = React38.createContext(defaultTypography);
|
|
12009
13029
|
function useTypography() {
|
|
12010
|
-
return
|
|
13030
|
+
return React38.useContext(TypographyContext);
|
|
12011
13031
|
}
|
|
12012
13032
|
function TypographyProvider({
|
|
12013
13033
|
children,
|
|
@@ -12015,7 +13035,7 @@ function TypographyProvider({
|
|
|
12015
13035
|
fontFamily,
|
|
12016
13036
|
fontVariationAxes
|
|
12017
13037
|
}) {
|
|
12018
|
-
const value =
|
|
13038
|
+
const value = React38.useMemo(() => {
|
|
12019
13039
|
if (typography) return typography;
|
|
12020
13040
|
if (fontFamily || fontVariationAxes) {
|
|
12021
13041
|
return new Typography(
|
|
@@ -12026,7 +13046,7 @@ function TypographyProvider({
|
|
|
12026
13046
|
}, [typography, fontFamily, fontVariationAxes]);
|
|
12027
13047
|
return /* @__PURE__ */ jsxRuntime.jsx(TypographyContext.Provider, { value, children });
|
|
12028
13048
|
}
|
|
12029
|
-
var ThemeContext =
|
|
13049
|
+
var ThemeContext = React38.createContext(void 0);
|
|
12030
13050
|
var STORAGE_KEY_COLOR = "md3-source-color";
|
|
12031
13051
|
var STORAGE_KEY_MODE = "md3-theme-mode";
|
|
12032
13052
|
var defaultTokens2 = new TypographyTokens();
|
|
@@ -12041,10 +13061,10 @@ function MD3ThemeProvider({
|
|
|
12041
13061
|
fontVariationAxes,
|
|
12042
13062
|
enableSnackbar = false
|
|
12043
13063
|
}) {
|
|
12044
|
-
const [sourceColor, setSourceColor] =
|
|
12045
|
-
const [mode, setMode] =
|
|
12046
|
-
const [isHydrated, setIsHydrated] =
|
|
12047
|
-
|
|
13064
|
+
const [sourceColor, setSourceColor] = React38.useState(initialSourceColor);
|
|
13065
|
+
const [mode, setMode] = React38.useState(defaultMode);
|
|
13066
|
+
const [isHydrated, setIsHydrated] = React38.useState(!persistToLocalStorage);
|
|
13067
|
+
React38.useEffect(() => {
|
|
12048
13068
|
if (!persistToLocalStorage) return;
|
|
12049
13069
|
const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
|
|
12050
13070
|
const savedMode = localStorage.getItem(
|
|
@@ -12054,7 +13074,7 @@ function MD3ThemeProvider({
|
|
|
12054
13074
|
if (savedMode === "light" || savedMode === "dark") setMode(savedMode);
|
|
12055
13075
|
setIsHydrated(true);
|
|
12056
13076
|
}, [persistToLocalStorage]);
|
|
12057
|
-
|
|
13077
|
+
React38.useEffect(() => {
|
|
12058
13078
|
if (!isHydrated) return;
|
|
12059
13079
|
applyTheme(sourceColor, mode);
|
|
12060
13080
|
if (persistToLocalStorage) {
|
|
@@ -12062,11 +13082,11 @@ function MD3ThemeProvider({
|
|
|
12062
13082
|
localStorage.setItem(STORAGE_KEY_MODE, mode);
|
|
12063
13083
|
}
|
|
12064
13084
|
}, [sourceColor, mode, persistToLocalStorage, isHydrated]);
|
|
12065
|
-
const themeValue =
|
|
13085
|
+
const themeValue = React38.useMemo(
|
|
12066
13086
|
() => ({ sourceColor, setSourceColor, mode, setMode }),
|
|
12067
13087
|
[sourceColor, mode]
|
|
12068
13088
|
);
|
|
12069
|
-
const typographyValue =
|
|
13089
|
+
const typographyValue = React38.useMemo(() => {
|
|
12070
13090
|
if (typographyProp) return typographyProp;
|
|
12071
13091
|
if (fontFamily != null ? fontFamily : fontVariationAxes) {
|
|
12072
13092
|
return new Typography(
|
|
@@ -12079,7 +13099,7 @@ function MD3ThemeProvider({
|
|
|
12079
13099
|
}
|
|
12080
13100
|
function SnackbarMountedProvider({ children }) {
|
|
12081
13101
|
const state = useSnackbarState();
|
|
12082
|
-
const contextValue =
|
|
13102
|
+
const contextValue = React38.useMemo(
|
|
12083
13103
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
12084
13104
|
[state.showSnackbar]
|
|
12085
13105
|
);
|
|
@@ -12089,7 +13109,7 @@ function SnackbarMountedProvider({ children }) {
|
|
|
12089
13109
|
] });
|
|
12090
13110
|
}
|
|
12091
13111
|
function useTheme() {
|
|
12092
|
-
const context =
|
|
13112
|
+
const context = React38.useContext(ThemeContext);
|
|
12093
13113
|
if (!context) {
|
|
12094
13114
|
throw new Error("useTheme must be used within <MD3ThemeProvider>.");
|
|
12095
13115
|
}
|
|
@@ -12104,9 +13124,9 @@ function TableOfContents({
|
|
|
12104
13124
|
className,
|
|
12105
13125
|
scrollAreaProps
|
|
12106
13126
|
}) {
|
|
12107
|
-
const [activeId, setActiveId] =
|
|
12108
|
-
const itemIds =
|
|
12109
|
-
|
|
13127
|
+
const [activeId, setActiveId] = React38.useState("");
|
|
13128
|
+
const itemIds = React38.useMemo(() => items.map((i) => i.id), [items]);
|
|
13129
|
+
React38.useEffect(() => {
|
|
12110
13130
|
if (typeof IntersectionObserver === "undefined") return;
|
|
12111
13131
|
const observer = new IntersectionObserver(
|
|
12112
13132
|
(entries) => {
|
|
@@ -12123,7 +13143,7 @@ function TableOfContents({
|
|
|
12123
13143
|
}
|
|
12124
13144
|
return () => observer.disconnect();
|
|
12125
13145
|
}, [itemIds]);
|
|
12126
|
-
const handleClick =
|
|
13146
|
+
const handleClick = React38.useCallback(
|
|
12127
13147
|
(e, id) => {
|
|
12128
13148
|
var _a;
|
|
12129
13149
|
e.preventDefault();
|
|
@@ -12259,7 +13279,7 @@ function TooltipCaretShape({
|
|
|
12259
13279
|
}
|
|
12260
13280
|
);
|
|
12261
13281
|
}
|
|
12262
|
-
var PlainTooltip =
|
|
13282
|
+
var PlainTooltip = React38.forwardRef(
|
|
12263
13283
|
(_a, ref) => {
|
|
12264
13284
|
var _b = _a, {
|
|
12265
13285
|
children,
|
|
@@ -12316,7 +13336,7 @@ var PlainTooltip = React31.forwardRef(
|
|
|
12316
13336
|
}
|
|
12317
13337
|
);
|
|
12318
13338
|
PlainTooltip.displayName = "PlainTooltip";
|
|
12319
|
-
var RichTooltip =
|
|
13339
|
+
var RichTooltip = React38.forwardRef(
|
|
12320
13340
|
(_a, ref) => {
|
|
12321
13341
|
var _b = _a, {
|
|
12322
13342
|
children,
|
|
@@ -12400,7 +13420,7 @@ var RichTooltip = React31.forwardRef(
|
|
|
12400
13420
|
);
|
|
12401
13421
|
RichTooltip.displayName = "RichTooltip";
|
|
12402
13422
|
var VIEWPORT_PADDING = 8;
|
|
12403
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
13423
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React38.useLayoutEffect : React38.useEffect;
|
|
12404
13424
|
function resolveAutoPlacement(spaceTop, spaceBottom, spaceLeft, spaceRight, tooltipWidth, tooltipHeight, spacing) {
|
|
12405
13425
|
if (spaceTop >= tooltipHeight + spacing) return "top";
|
|
12406
13426
|
if (spaceBottom >= tooltipHeight + spacing) return "bottom";
|
|
@@ -12460,7 +13480,7 @@ function clampToViewport(side, top, left, tooltipWidth, tooltipHeight) {
|
|
|
12460
13480
|
return { top, left };
|
|
12461
13481
|
}
|
|
12462
13482
|
function useTooltipPosition(anchorRef, tooltipRef, placement, spacing, isVisible) {
|
|
12463
|
-
const [position, setPosition] =
|
|
13483
|
+
const [position, setPosition] = React38.useState({
|
|
12464
13484
|
top: -9999,
|
|
12465
13485
|
left: -9999,
|
|
12466
13486
|
actualSide: placement === "auto" ? "top" : placement
|
|
@@ -12535,24 +13555,24 @@ function useTooltipState(config) {
|
|
|
12535
13555
|
isPersistent = false,
|
|
12536
13556
|
duration = 1500
|
|
12537
13557
|
} = config != null ? config : {};
|
|
12538
|
-
const [isVisible, setIsVisible] =
|
|
12539
|
-
const dismiss =
|
|
13558
|
+
const [isVisible, setIsVisible] = React38.useState(initialVisible);
|
|
13559
|
+
const dismiss = React38.useCallback(() => {
|
|
12540
13560
|
setIsVisible(false);
|
|
12541
13561
|
activeTooltipDismissals.delete(dismiss);
|
|
12542
13562
|
}, []);
|
|
12543
|
-
const show =
|
|
13563
|
+
const show = React38.useCallback(() => {
|
|
12544
13564
|
for (const otherDismiss of activeTooltipDismissals) {
|
|
12545
13565
|
if (otherDismiss !== dismiss) otherDismiss();
|
|
12546
13566
|
}
|
|
12547
13567
|
setIsVisible(true);
|
|
12548
13568
|
activeTooltipDismissals.add(dismiss);
|
|
12549
13569
|
}, [dismiss]);
|
|
12550
|
-
|
|
13570
|
+
React38.useEffect(() => {
|
|
12551
13571
|
if (!isVisible || isPersistent) return;
|
|
12552
13572
|
const timeoutId = setTimeout(dismiss, duration);
|
|
12553
13573
|
return () => clearTimeout(timeoutId);
|
|
12554
13574
|
}, [isVisible, isPersistent, duration, dismiss]);
|
|
12555
|
-
|
|
13575
|
+
React38.useEffect(() => {
|
|
12556
13576
|
return () => {
|
|
12557
13577
|
activeTooltipDismissals.delete(dismiss);
|
|
12558
13578
|
};
|
|
@@ -12609,20 +13629,20 @@ function TooltipBox({
|
|
|
12609
13629
|
}) {
|
|
12610
13630
|
const internalState = useTooltipState();
|
|
12611
13631
|
const state = controlledState != null ? controlledState : internalState;
|
|
12612
|
-
const anchorRef =
|
|
12613
|
-
const tooltipRef =
|
|
12614
|
-
const hoverTimeoutRef =
|
|
12615
|
-
const hideTimeoutRef =
|
|
12616
|
-
const pressTimeoutRef =
|
|
13632
|
+
const anchorRef = React38.useRef(null);
|
|
13633
|
+
const tooltipRef = React38.useRef(null);
|
|
13634
|
+
const hoverTimeoutRef = React38.useRef(null);
|
|
13635
|
+
const hideTimeoutRef = React38.useRef(null);
|
|
13636
|
+
const pressTimeoutRef = React38.useRef(null);
|
|
12617
13637
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
12618
|
-
const [mounted, setMounted] =
|
|
12619
|
-
const [hasHoverSupport, setHasHoverSupport] =
|
|
12620
|
-
const [prefersReducedMotion, setPrefersReducedMotion] =
|
|
12621
|
-
|
|
13638
|
+
const [mounted, setMounted] = React38.useState(false);
|
|
13639
|
+
const [hasHoverSupport, setHasHoverSupport] = React38.useState(true);
|
|
13640
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = React38.useState(false);
|
|
13641
|
+
React38.useEffect(() => {
|
|
12622
13642
|
setMounted(true);
|
|
12623
13643
|
setHasHoverSupport(!window.matchMedia("(hover: none)").matches);
|
|
12624
13644
|
}, []);
|
|
12625
|
-
|
|
13645
|
+
React38.useEffect(() => {
|
|
12626
13646
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
12627
13647
|
setPrefersReducedMotion(mediaQuery.matches);
|
|
12628
13648
|
const onChange = (e) => setPrefersReducedMotion(e.matches);
|
|
@@ -12694,7 +13714,7 @@ function TooltipBox({
|
|
|
12694
13714
|
hideDelay
|
|
12695
13715
|
);
|
|
12696
13716
|
};
|
|
12697
|
-
|
|
13717
|
+
React38.useEffect(() => {
|
|
12698
13718
|
if (!state.isVisible) return;
|
|
12699
13719
|
const onKeyDown = (e) => {
|
|
12700
13720
|
var _a;
|
|
@@ -12706,8 +13726,8 @@ function TooltipBox({
|
|
|
12706
13726
|
document.addEventListener("keydown", onKeyDown);
|
|
12707
13727
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
12708
13728
|
}, [state.isVisible, state]);
|
|
12709
|
-
const tooltipId =
|
|
12710
|
-
const tooltipWithProps =
|
|
13729
|
+
const tooltipId = React38.useId();
|
|
13730
|
+
const tooltipWithProps = React38.cloneElement(
|
|
12711
13731
|
tooltip,
|
|
12712
13732
|
{
|
|
12713
13733
|
"data-side": position.actualSide,
|
|
@@ -12735,7 +13755,7 @@ function TooltipBox({
|
|
|
12735
13755
|
onKeyDown: handleKeyDown,
|
|
12736
13756
|
"aria-label": ariaLabel,
|
|
12737
13757
|
"aria-describedby": state.isVisible ? tooltipId : void 0,
|
|
12738
|
-
children:
|
|
13758
|
+
children: React38__namespace.isValidElement(children) ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
12739
13759
|
}
|
|
12740
13760
|
),
|
|
12741
13761
|
mounted && reactDom.createPortal(
|
|
@@ -12779,10 +13799,16 @@ exports.BadgedBox = BadgedBox;
|
|
|
12779
13799
|
exports.BottomAppBar = BottomAppBar;
|
|
12780
13800
|
exports.Button = Button;
|
|
12781
13801
|
exports.ButtonGroup = ButtonGroup;
|
|
13802
|
+
exports.CHECK_ICON_VARIANTS = CHECK_ICON_VARIANTS;
|
|
12782
13803
|
exports.Card = Card;
|
|
12783
13804
|
exports.Checkbox = Checkbox;
|
|
12784
13805
|
exports.Chip = Chip;
|
|
12785
13806
|
exports.CodeBlock = CodeBlock;
|
|
13807
|
+
exports.ContextMenu = ContextMenu;
|
|
13808
|
+
exports.ContextMenuContent = ContextMenuContent;
|
|
13809
|
+
exports.ContextMenuTrigger = ContextMenuTrigger;
|
|
13810
|
+
exports.DIVIDER_COLOR = DIVIDER_COLOR;
|
|
13811
|
+
exports.DIVIDER_PADDING = DIVIDER_PADDING;
|
|
12786
13812
|
exports.Dialog = Dialog;
|
|
12787
13813
|
exports.DialogBody = DialogBody;
|
|
12788
13814
|
exports.DialogClose = DialogClose;
|
|
@@ -12808,39 +13834,42 @@ exports.DrawerOverlay = DrawerOverlay;
|
|
|
12808
13834
|
exports.DrawerPortal = DrawerPortal;
|
|
12809
13835
|
exports.DrawerTitle = DrawerTitle;
|
|
12810
13836
|
exports.DrawerTrigger = DrawerTrigger;
|
|
12811
|
-
exports.DropdownMenu = DropdownMenu;
|
|
12812
|
-
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
12813
|
-
exports.DropdownMenuContent = DropdownMenuContent;
|
|
12814
|
-
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
12815
|
-
exports.DropdownMenuItem = DropdownMenuItem;
|
|
12816
|
-
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
12817
|
-
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
12818
|
-
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
12819
|
-
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
12820
|
-
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
12821
|
-
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
12822
|
-
exports.DropdownMenuSub = DropdownMenuSub;
|
|
12823
|
-
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
12824
|
-
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
12825
|
-
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
12826
13837
|
exports.FAB = FAB;
|
|
12827
13838
|
exports.FABMenu = FABMenu;
|
|
12828
13839
|
exports.FABMenuItem = FABMenuItem;
|
|
12829
13840
|
exports.FABPosition = FABPosition;
|
|
13841
|
+
exports.FAST_EFFECTS_TRANSITION = FAST_EFFECTS_TRANSITION;
|
|
13842
|
+
exports.FAST_SPATIAL_SPRING = FAST_SPATIAL_SPRING;
|
|
13843
|
+
exports.GROUP_SHAPES = GROUP_SHAPES;
|
|
13844
|
+
exports.ITEM_SHAPE_CLASSES = ITEM_SHAPE_CLASSES;
|
|
12830
13845
|
exports.Icon = Icon;
|
|
12831
13846
|
exports.IconButton = IconButton;
|
|
12832
13847
|
exports.LargeFlexibleAppBar = LargeFlexibleAppBar;
|
|
12833
13848
|
exports.LoadingIndicator = LoadingIndicator;
|
|
12834
13849
|
exports.MD3ThemeProvider = MD3ThemeProvider;
|
|
12835
13850
|
exports.MD3_EXPRESSIVE_FONT_VARIATION = MD3_EXPRESSIVE_FONT_VARIATION;
|
|
13851
|
+
exports.MENU_CHECK_ICON_SIZE = MENU_CHECK_ICON_SIZE;
|
|
13852
|
+
exports.MENU_CONTAINER_VARIANTS = MENU_CONTAINER_VARIANTS;
|
|
13853
|
+
exports.MENU_GROUP_GAP = MENU_GROUP_GAP;
|
|
13854
|
+
exports.MENU_ICON_SIZE = MENU_ICON_SIZE;
|
|
13855
|
+
exports.MENU_ITEM_MIN_HEIGHT = MENU_ITEM_MIN_HEIGHT;
|
|
13856
|
+
exports.MENU_MAX_WIDTH = MENU_MAX_WIDTH;
|
|
13857
|
+
exports.MENU_MIN_WIDTH = MENU_MIN_WIDTH;
|
|
12836
13858
|
exports.MaterialSymbolsPreconnect = MaterialSymbolsPreconnect;
|
|
12837
13859
|
exports.MediumFlexibleAppBar = MediumFlexibleAppBar;
|
|
13860
|
+
exports.Menu = Menu;
|
|
13861
|
+
exports.MenuContent = MenuContent;
|
|
13862
|
+
exports.MenuDivider = MenuDivider;
|
|
13863
|
+
exports.MenuGroup = MenuGroup;
|
|
13864
|
+
exports.MenuItem = MenuItem;
|
|
13865
|
+
exports.MenuProvider = MenuProvider;
|
|
13866
|
+
exports.MenuTrigger = MenuTrigger;
|
|
12838
13867
|
exports.NavigationRail = NavigationRail;
|
|
12839
13868
|
exports.NavigationRailItem = NavigationRailItem;
|
|
12840
13869
|
exports.PlainTooltip = PlainTooltip;
|
|
12841
13870
|
exports.ProgressIndicator = ProgressIndicator;
|
|
12842
13871
|
exports.RadioButton = RadioButton;
|
|
12843
|
-
exports.RadioGroup =
|
|
13872
|
+
exports.RadioGroup = RadioGroup;
|
|
12844
13873
|
exports.RangeSlider = RangeSlider;
|
|
12845
13874
|
exports.RichTooltip = RichTooltip;
|
|
12846
13875
|
exports.Ripple = Ripple;
|
|
@@ -12850,6 +13879,8 @@ exports.SEARCH_DOCKED_REVEAL_SPRING = SEARCH_DOCKED_REVEAL_SPRING;
|
|
|
12850
13879
|
exports.SEARCH_FULLSCREEN_SPRING = SEARCH_FULLSCREEN_SPRING;
|
|
12851
13880
|
exports.SEARCH_TYPOGRAPHY = SEARCH_TYPOGRAPHY;
|
|
12852
13881
|
exports.SEARCH_VIEW_SPRING = SEARCH_VIEW_SPRING;
|
|
13882
|
+
exports.STANDARD_COLORS = STANDARD_COLORS;
|
|
13883
|
+
exports.SUBMENU_CONTAINER_VARIANTS = SUBMENU_CONTAINER_VARIANTS;
|
|
12853
13884
|
exports.ScrollArea = ScrollArea;
|
|
12854
13885
|
exports.ScrollAreaScrollbar = ScrollAreaScrollbar;
|
|
12855
13886
|
exports.Search = Search;
|
|
@@ -12867,6 +13898,7 @@ exports.SmallAppBar = SmallAppBar;
|
|
|
12867
13898
|
exports.Snackbar = Snackbar;
|
|
12868
13899
|
exports.SnackbarHost = SnackbarHost;
|
|
12869
13900
|
exports.SnackbarProvider = SnackbarProvider;
|
|
13901
|
+
exports.SubMenu = SubMenu;
|
|
12870
13902
|
exports.Switch = Switch;
|
|
12871
13903
|
exports.SwitchColors = SwitchColors;
|
|
12872
13904
|
exports.SwitchTokens = SwitchTokens;
|
|
@@ -12877,6 +13909,7 @@ exports.TabsColors = TabsColors;
|
|
|
12877
13909
|
exports.TabsContent = TabsContent;
|
|
12878
13910
|
exports.TabsList = TabsList;
|
|
12879
13911
|
exports.TabsTokens = TabsTokens;
|
|
13912
|
+
exports.Text = Text;
|
|
12880
13913
|
exports.TextField = TextField;
|
|
12881
13914
|
exports.ToggleFAB = ToggleFAB;
|
|
12882
13915
|
exports.TooltipBox = TooltipBox;
|
|
@@ -12889,6 +13922,11 @@ exports.TypographyContext = TypographyContext;
|
|
|
12889
13922
|
exports.TypographyKeyTokens = TypographyKeyTokens;
|
|
12890
13923
|
exports.TypographyProvider = TypographyProvider;
|
|
12891
13924
|
exports.TypographyTokens = TypographyTokens;
|
|
13925
|
+
exports.VIBRANT_COLORS = VIBRANT_COLORS;
|
|
13926
|
+
exports.VerticalMenu = VerticalMenu;
|
|
13927
|
+
exports.VerticalMenuContent = VerticalMenuContent;
|
|
13928
|
+
exports.VerticalMenuDivider = VerticalMenuDivider;
|
|
13929
|
+
exports.VerticalMenuGroup = VerticalMenuGroup;
|
|
12892
13930
|
exports.appBarTypography = appBarTypography;
|
|
12893
13931
|
exports.applyTheme = applyTheme;
|
|
12894
13932
|
exports.buildWavePath = buildWavePath;
|
|
@@ -12897,6 +13935,7 @@ exports.generateM3Theme = generateM3Theme;
|
|
|
12897
13935
|
exports.useAppBarScroll = useAppBarScroll;
|
|
12898
13936
|
exports.useDOMRipple = useRipple;
|
|
12899
13937
|
exports.useMediaQuery = useMediaQuery;
|
|
13938
|
+
exports.useMenuContext = useMenuContext;
|
|
12900
13939
|
exports.useRipple = useRipple2;
|
|
12901
13940
|
exports.useRippleState = useRippleState;
|
|
12902
13941
|
exports.useSearchKeyboard = useSearchKeyboard;
|