@bug-on/md3-react 2.0.2 → 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 +23 -0
- package/dist/index.css.d.ts +2 -0
- package/dist/index.d.mts +6127 -0
- package/dist/index.d.ts +6127 -69
- package/dist/index.js +2536 -665
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2443 -603
- 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 +23 -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/{dist/hooks/index.d.ts → src/hooks/index.ts} +1 -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/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/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/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(
|
|
@@ -6628,98 +7604,917 @@ var RadioButtonComponent = React31__namespace.forwardRef(
|
|
|
6628
7604
|
visual
|
|
6629
7605
|
]
|
|
6630
7606
|
}
|
|
6631
|
-
) });
|
|
7607
|
+
) });
|
|
7608
|
+
}
|
|
7609
|
+
);
|
|
7610
|
+
RadioButtonComponent.displayName = "RadioButton";
|
|
7611
|
+
var RadioButton = React38__namespace.memo(RadioButtonComponent);
|
|
7612
|
+
var RadioGroupComponent = React38__namespace.forwardRef(
|
|
7613
|
+
({
|
|
7614
|
+
name,
|
|
7615
|
+
value: valueProp,
|
|
7616
|
+
defaultValue,
|
|
7617
|
+
onValueChange,
|
|
7618
|
+
disabled = false,
|
|
7619
|
+
error = false,
|
|
7620
|
+
label,
|
|
7621
|
+
"aria-labelledby": ariaLabelledby,
|
|
7622
|
+
required = false,
|
|
7623
|
+
orientation = "vertical",
|
|
7624
|
+
children,
|
|
7625
|
+
className
|
|
7626
|
+
}, ref) => {
|
|
7627
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
7628
|
+
const isControlled = valueProp !== void 0;
|
|
7629
|
+
const selectedValue = isControlled ? valueProp : internalValue;
|
|
7630
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
7631
|
+
(val) => {
|
|
7632
|
+
if (!isControlled) setInternalValue(val);
|
|
7633
|
+
onValueChange == null ? void 0 : onValueChange(val);
|
|
7634
|
+
},
|
|
7635
|
+
[isControlled, onValueChange]
|
|
7636
|
+
);
|
|
7637
|
+
const groupRef = React38__namespace.useRef(null);
|
|
7638
|
+
const mergedRef = useMergedRef3(ref, groupRef);
|
|
7639
|
+
const onKeyDown = React38__namespace.useCallback(
|
|
7640
|
+
(e) => {
|
|
7641
|
+
var _a, _b;
|
|
7642
|
+
if (disabled) return;
|
|
7643
|
+
const isNext = e.key === "ArrowDown" || e.key === "ArrowRight";
|
|
7644
|
+
const isPrev = e.key === "ArrowUp" || e.key === "ArrowLeft";
|
|
7645
|
+
if (!isNext && !isPrev) return;
|
|
7646
|
+
e.preventDefault();
|
|
7647
|
+
const inputs = Array.from(
|
|
7648
|
+
(_b = (_a = groupRef.current) == null ? void 0 : _a.querySelectorAll(
|
|
7649
|
+
'input[type="radio"]:not(:disabled)'
|
|
7650
|
+
)) != null ? _b : []
|
|
7651
|
+
);
|
|
7652
|
+
if (inputs.length === 0) return;
|
|
7653
|
+
const currentIdx = inputs.indexOf(
|
|
7654
|
+
document.activeElement
|
|
7655
|
+
);
|
|
7656
|
+
const nextIdx = isNext ? currentIdx < inputs.length - 1 ? currentIdx + 1 : 0 : currentIdx > 0 ? currentIdx - 1 : inputs.length - 1;
|
|
7657
|
+
const target = inputs[nextIdx];
|
|
7658
|
+
target.focus();
|
|
7659
|
+
handleValueChange(target.value);
|
|
7660
|
+
},
|
|
7661
|
+
[disabled, handleValueChange]
|
|
7662
|
+
);
|
|
7663
|
+
const contextValue = React38__namespace.useMemo(
|
|
7664
|
+
() => ({
|
|
7665
|
+
name,
|
|
7666
|
+
selectedValue,
|
|
7667
|
+
onValueChange: handleValueChange,
|
|
7668
|
+
disabled,
|
|
7669
|
+
error,
|
|
7670
|
+
required
|
|
7671
|
+
}),
|
|
7672
|
+
[name, selectedValue, handleValueChange, disabled, error, required]
|
|
7673
|
+
);
|
|
7674
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7675
|
+
"div",
|
|
7676
|
+
{
|
|
7677
|
+
ref: mergedRef,
|
|
7678
|
+
role: "radiogroup",
|
|
7679
|
+
"aria-label": label && !ariaLabelledby ? label : void 0,
|
|
7680
|
+
"aria-labelledby": ariaLabelledby,
|
|
7681
|
+
"aria-disabled": disabled || void 0,
|
|
7682
|
+
"aria-required": required || void 0,
|
|
7683
|
+
className: cn(
|
|
7684
|
+
"flex",
|
|
7685
|
+
orientation === "horizontal" ? "flex-row gap-4" : "flex-col gap-1",
|
|
7686
|
+
className
|
|
7687
|
+
),
|
|
7688
|
+
onKeyDown,
|
|
7689
|
+
children: [
|
|
7690
|
+
label && !ariaLabelledby && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label }),
|
|
7691
|
+
children
|
|
7692
|
+
]
|
|
7693
|
+
}
|
|
7694
|
+
) });
|
|
7695
|
+
}
|
|
7696
|
+
);
|
|
7697
|
+
RadioGroupComponent.displayName = "RadioGroup";
|
|
7698
|
+
var RadioGroup = React38__namespace.memo(RadioGroupComponent);
|
|
7699
|
+
function useSearchKeyboard({
|
|
7700
|
+
active,
|
|
7701
|
+
onActiveChange,
|
|
7702
|
+
onSearch,
|
|
7703
|
+
query,
|
|
7704
|
+
itemCount,
|
|
7705
|
+
onSelectSuggestion
|
|
7706
|
+
}) {
|
|
7707
|
+
const [activeIndex, setActiveIndex] = React38__namespace.useState(-1);
|
|
7708
|
+
const resetKeyRef = React38__namespace.useRef(`${active}:${query}`);
|
|
7709
|
+
const currentKey = `${active}:${query}`;
|
|
7710
|
+
if (resetKeyRef.current !== currentKey) {
|
|
7711
|
+
resetKeyRef.current = currentKey;
|
|
7712
|
+
setActiveIndex(-1);
|
|
7713
|
+
}
|
|
7714
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
7715
|
+
(e) => {
|
|
7716
|
+
if (!active) return;
|
|
7717
|
+
switch (e.key) {
|
|
7718
|
+
case "ArrowDown": {
|
|
7719
|
+
e.preventDefault();
|
|
7720
|
+
setActiveIndex((i) => i < itemCount - 1 ? i + 1 : i);
|
|
7721
|
+
break;
|
|
7722
|
+
}
|
|
7723
|
+
case "ArrowUp": {
|
|
7724
|
+
e.preventDefault();
|
|
7725
|
+
setActiveIndex((i) => i > -1 ? i - 1 : -1);
|
|
7726
|
+
break;
|
|
7727
|
+
}
|
|
7728
|
+
case "Enter": {
|
|
7729
|
+
e.preventDefault();
|
|
7730
|
+
if (activeIndex >= 0 && onSelectSuggestion) {
|
|
7731
|
+
onSelectSuggestion(activeIndex);
|
|
7732
|
+
} else {
|
|
7733
|
+
onSearch(query);
|
|
7734
|
+
}
|
|
7735
|
+
break;
|
|
7736
|
+
}
|
|
7737
|
+
case "Escape": {
|
|
7738
|
+
e.preventDefault();
|
|
7739
|
+
onActiveChange(false);
|
|
7740
|
+
break;
|
|
7741
|
+
}
|
|
7742
|
+
}
|
|
7743
|
+
},
|
|
7744
|
+
[
|
|
7745
|
+
active,
|
|
7746
|
+
activeIndex,
|
|
7747
|
+
itemCount,
|
|
7748
|
+
onActiveChange,
|
|
7749
|
+
onSearch,
|
|
7750
|
+
onSelectSuggestion,
|
|
7751
|
+
query
|
|
7752
|
+
]
|
|
7753
|
+
);
|
|
7754
|
+
const resetActiveIndex = React38__namespace.useCallback(() => {
|
|
7755
|
+
setActiveIndex(-1);
|
|
7756
|
+
}, []);
|
|
7757
|
+
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
7758
|
+
}
|
|
7759
|
+
|
|
7760
|
+
// src/ui/search/search.tokens.ts
|
|
7761
|
+
var SearchTokens = {
|
|
7762
|
+
// ── Heights ─────────────────────────────────────────────────────────────
|
|
7763
|
+
heights: {
|
|
7764
|
+
/** SearchBarTokens.ContainerHeight = 56dp */
|
|
7765
|
+
bar: 56,
|
|
7766
|
+
/** SearchViewTokens.DockedHeaderContainerHeight = 56dp */
|
|
7767
|
+
dockedHeader: 56,
|
|
7768
|
+
/** SearchViewTokens.FullScreenHeaderContainerHeight = 72dp */
|
|
7769
|
+
fullScreenHeader: 72
|
|
7770
|
+
},
|
|
7771
|
+
// ── Avatar ────────────────────────────────────────────────────────────
|
|
7772
|
+
/** SearchBarTokens.AvatarSize = 30dp */
|
|
7773
|
+
avatarSize: 30,
|
|
7774
|
+
// ── Icon ───────────────────────────────────────────────────────────────
|
|
7775
|
+
/** Standard icon size for leading/trailing icons. */
|
|
7776
|
+
iconSize: 20,
|
|
7777
|
+
/** Touch target for interactive icons per MD3 a11y spec. */
|
|
7778
|
+
iconTouchTarget: 48,
|
|
7779
|
+
// ── Gap ────────────────────────────────────────────────────────────────
|
|
7780
|
+
/** Gap between SearchBar and results list when hasGap=true. */
|
|
7781
|
+
dropdownGap: 2
|
|
7782
|
+
};
|
|
7783
|
+
var SEARCH_COLORS = {
|
|
7784
|
+
/** SearchBarTokens.ContainerColor → surface-container-high */
|
|
7785
|
+
container: "var(--md-sys-color-surface-container-high)",
|
|
7786
|
+
/** SearchBarTokens.LeadingIconColor → on-surface */
|
|
7787
|
+
leadingIcon: "var(--md-sys-color-on-surface)",
|
|
7788
|
+
/** SearchBarTokens.TrailingIconColor → on-surface-variant */
|
|
7789
|
+
trailingIcon: "var(--md-sys-color-on-surface-variant)",
|
|
7790
|
+
/** SearchBarTokens.InputTextColor → on-surface */
|
|
7791
|
+
inputText: "var(--md-sys-color-on-surface)",
|
|
7792
|
+
/** SearchBarTokens.SupportingTextColor → on-surface-variant (placeholder) */
|
|
7793
|
+
supportingText: "var(--md-sys-color-on-surface-variant)",
|
|
7794
|
+
/** SearchViewTokens.DividerColor → outline */
|
|
7795
|
+
divider: "var(--md-sys-color-outline)",
|
|
7796
|
+
/** Focus indicator → secondary */
|
|
7797
|
+
focusIndicator: "var(--md-sys-color-secondary)"
|
|
7798
|
+
};
|
|
7799
|
+
var SEARCH_TYPOGRAPHY = {
|
|
7800
|
+
/** BodyLarge — used for input text and placeholder. */
|
|
7801
|
+
bodyLarge: "text-[16px] leading-6 font-normal tracking-[0.5px]"
|
|
7802
|
+
};
|
|
7803
|
+
var SEARCH_BAR_EXPAND_SPRING = {
|
|
7804
|
+
type: "spring",
|
|
7805
|
+
stiffness: 380,
|
|
7806
|
+
damping: 38,
|
|
7807
|
+
mass: 1
|
|
7808
|
+
};
|
|
7809
|
+
var SEARCH_DOCKED_REVEAL_SPRING = {
|
|
7810
|
+
type: "spring",
|
|
7811
|
+
stiffness: 400,
|
|
7812
|
+
damping: 35,
|
|
7813
|
+
mass: 0.8
|
|
7814
|
+
};
|
|
7815
|
+
var SEARCH_FULLSCREEN_SPRING = {
|
|
7816
|
+
type: "spring",
|
|
7817
|
+
stiffness: 300,
|
|
7818
|
+
damping: 30,
|
|
7819
|
+
mass: 0.9
|
|
7820
|
+
};
|
|
7821
|
+
var SEARCH_BAR_EXIT_SPRING = {
|
|
7822
|
+
type: "spring",
|
|
7823
|
+
stiffness: 500,
|
|
7824
|
+
damping: 40,
|
|
7825
|
+
mass: 0.6
|
|
7826
|
+
};
|
|
7827
|
+
var PLACEHOLDER_SPRING = {
|
|
7828
|
+
type: "spring",
|
|
7829
|
+
stiffness: 350,
|
|
7830
|
+
damping: 30,
|
|
7831
|
+
mass: 0.8
|
|
7832
|
+
};
|
|
7833
|
+
function AnimatedPlaceholder({
|
|
7834
|
+
text,
|
|
7835
|
+
textAlign,
|
|
7836
|
+
visible,
|
|
7837
|
+
focused,
|
|
7838
|
+
children,
|
|
7839
|
+
className
|
|
7840
|
+
}) {
|
|
7841
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
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(() => {
|
|
7846
|
+
const container = containerRef.current;
|
|
7847
|
+
const span = spanRef.current;
|
|
7848
|
+
if (!container || !span || textAlign === "left") {
|
|
7849
|
+
setXOffset(0);
|
|
7850
|
+
return;
|
|
7851
|
+
}
|
|
7852
|
+
const containerWidth = container.offsetWidth;
|
|
7853
|
+
const textWidth = span.offsetWidth;
|
|
7854
|
+
if (textAlign === "center") {
|
|
7855
|
+
setXOffset(Math.max(0, (containerWidth - textWidth) / 2));
|
|
7856
|
+
} else {
|
|
7857
|
+
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
7858
|
+
}
|
|
7859
|
+
}, [textAlign]);
|
|
7860
|
+
React38__namespace.useLayoutEffect(() => {
|
|
7861
|
+
recalculate();
|
|
7862
|
+
}, [recalculate]);
|
|
7863
|
+
React38__namespace.useEffect(() => {
|
|
7864
|
+
const container = containerRef.current;
|
|
7865
|
+
if (!container) return;
|
|
7866
|
+
const observer = new ResizeObserver(recalculate);
|
|
7867
|
+
observer.observe(container);
|
|
7868
|
+
return () => observer.disconnect();
|
|
7869
|
+
}, [recalculate]);
|
|
7870
|
+
const targetX = focused || !visible ? 0 : xOffset;
|
|
7871
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7872
|
+
"div",
|
|
7873
|
+
{
|
|
7874
|
+
ref: containerRef,
|
|
7875
|
+
className: cn("relative flex-1 min-w-0", className),
|
|
7876
|
+
children: [
|
|
7877
|
+
children,
|
|
7878
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7879
|
+
react.m.span,
|
|
7880
|
+
{
|
|
7881
|
+
ref: (el) => {
|
|
7882
|
+
spanRef.current = el;
|
|
7883
|
+
},
|
|
7884
|
+
"aria-hidden": "true",
|
|
7885
|
+
className: cn(
|
|
7886
|
+
"pointer-events-none absolute inset-y-0 left-0",
|
|
7887
|
+
"flex items-center whitespace-nowrap select-none",
|
|
7888
|
+
SEARCH_TYPOGRAPHY.bodyLarge
|
|
7889
|
+
),
|
|
7890
|
+
style: { color: SEARCH_COLORS.supportingText },
|
|
7891
|
+
animate: {
|
|
7892
|
+
x: targetX,
|
|
7893
|
+
opacity: visible ? 1 : 0
|
|
7894
|
+
},
|
|
7895
|
+
transition: shouldReduceMotion ? { duration: 0 } : PLACEHOLDER_SPRING,
|
|
7896
|
+
children: text
|
|
7897
|
+
}
|
|
7898
|
+
)
|
|
7899
|
+
]
|
|
7900
|
+
}
|
|
7901
|
+
);
|
|
7902
|
+
}
|
|
7903
|
+
function DefaultSearchIcon() {
|
|
7904
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7905
|
+
"span",
|
|
7906
|
+
{
|
|
7907
|
+
className: "material-symbols-rounded select-none leading-none",
|
|
7908
|
+
style: { fontSize: SearchTokens.iconSize },
|
|
7909
|
+
"aria-hidden": "true",
|
|
7910
|
+
children: "search"
|
|
7911
|
+
}
|
|
7912
|
+
);
|
|
7913
|
+
}
|
|
7914
|
+
function SearchBar({
|
|
7915
|
+
query,
|
|
7916
|
+
onQueryChange,
|
|
7917
|
+
onSearch,
|
|
7918
|
+
active,
|
|
7919
|
+
onActiveChange,
|
|
7920
|
+
leadingIcon,
|
|
7921
|
+
trailingIcon,
|
|
7922
|
+
placeholder = "Search",
|
|
7923
|
+
textAlign = "left",
|
|
7924
|
+
className,
|
|
7925
|
+
"aria-label": ariaLabel = "Search",
|
|
7926
|
+
searchId,
|
|
7927
|
+
listboxId,
|
|
7928
|
+
onKeyDown,
|
|
7929
|
+
activeIndex
|
|
7930
|
+
}) {
|
|
7931
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
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(() => {
|
|
7936
|
+
var _a;
|
|
7937
|
+
let rafId;
|
|
7938
|
+
if (prevActiveRef.current === true && active === false) {
|
|
7939
|
+
isRestoringFocusRef.current = true;
|
|
7940
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
7941
|
+
rafId = requestAnimationFrame(() => {
|
|
7942
|
+
isRestoringFocusRef.current = false;
|
|
7943
|
+
});
|
|
7944
|
+
}
|
|
7945
|
+
prevActiveRef.current = active;
|
|
7946
|
+
return () => {
|
|
7947
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
7948
|
+
};
|
|
7949
|
+
}, [active]);
|
|
7950
|
+
const handleFocus = () => {
|
|
7951
|
+
if (!active && !isRestoringFocusRef.current) {
|
|
7952
|
+
onActiveChange(true);
|
|
7953
|
+
}
|
|
7954
|
+
};
|
|
7955
|
+
const handleFormSubmit = (e) => {
|
|
7956
|
+
e.preventDefault();
|
|
7957
|
+
onSearch(query);
|
|
7958
|
+
};
|
|
7959
|
+
const activeDescendant = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0;
|
|
7960
|
+
return (
|
|
7961
|
+
/*
|
|
7962
|
+
* AnimatePresence mode="popLayout":
|
|
7963
|
+
* When SearchView opens (active=true), SearchBar plays its exit animation
|
|
7964
|
+
* first, then unmounts — releasing the shared layoutId for SearchView to
|
|
7965
|
+
* claim and morph from the pill shape.
|
|
7966
|
+
*/
|
|
7967
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: !active && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7968
|
+
react.m.div,
|
|
7969
|
+
{
|
|
7970
|
+
layout: !shouldReduceMotion,
|
|
7971
|
+
layoutId: shouldReduceMotion ? void 0 : searchId,
|
|
7972
|
+
transition: shouldReduceMotion ? void 0 : SEARCH_BAR_EXPAND_SPRING,
|
|
7973
|
+
className: cn("relative", className),
|
|
7974
|
+
style: { height: SearchTokens.heights.bar },
|
|
7975
|
+
initial: shouldReduceMotion ? false : { opacity: 0, scale: 0.95 },
|
|
7976
|
+
animate: { opacity: 1, scale: 1 },
|
|
7977
|
+
exit: shouldReduceMotion ? {} : { opacity: 0, scale: 0.95, transition: SEARCH_BAR_EXIT_SPRING },
|
|
7978
|
+
children: [
|
|
7979
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7980
|
+
"div",
|
|
7981
|
+
{
|
|
7982
|
+
className: "absolute inset-0 rounded-full",
|
|
7983
|
+
style: { backgroundColor: SEARCH_COLORS.container },
|
|
7984
|
+
"aria-hidden": "true"
|
|
7985
|
+
}
|
|
7986
|
+
),
|
|
7987
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7988
|
+
"search",
|
|
7989
|
+
{
|
|
7990
|
+
"aria-label": ariaLabel,
|
|
7991
|
+
className: "relative flex h-full items-center gap-2 rounded-full px-4",
|
|
7992
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "contents", onSubmit: handleFormSubmit, children: [
|
|
7993
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7994
|
+
"span",
|
|
7995
|
+
{
|
|
7996
|
+
className: "flex shrink-0 items-center justify-center",
|
|
7997
|
+
style: { color: SEARCH_COLORS.leadingIcon },
|
|
7998
|
+
"aria-hidden": "true",
|
|
7999
|
+
children: leadingIcon != null ? leadingIcon : /* @__PURE__ */ jsxRuntime.jsx(DefaultSearchIcon, {})
|
|
8000
|
+
}
|
|
8001
|
+
),
|
|
8002
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8003
|
+
AnimatedPlaceholder,
|
|
8004
|
+
{
|
|
8005
|
+
text: placeholder,
|
|
8006
|
+
textAlign,
|
|
8007
|
+
visible: !query,
|
|
8008
|
+
focused: active,
|
|
8009
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8010
|
+
"input",
|
|
8011
|
+
{
|
|
8012
|
+
ref: inputRef,
|
|
8013
|
+
id: searchId,
|
|
8014
|
+
type: "search",
|
|
8015
|
+
role: "combobox",
|
|
8016
|
+
"aria-expanded": active,
|
|
8017
|
+
"aria-controls": listboxId,
|
|
8018
|
+
"aria-autocomplete": "list",
|
|
8019
|
+
"aria-activedescendant": activeDescendant,
|
|
8020
|
+
"aria-label": placeholder,
|
|
8021
|
+
value: query,
|
|
8022
|
+
placeholder,
|
|
8023
|
+
className: cn(
|
|
8024
|
+
"w-full bg-transparent border-none outline-none",
|
|
8025
|
+
"text-[16px] leading-6 font-normal tracking-[0.5px]",
|
|
8026
|
+
"placeholder:text-transparent"
|
|
8027
|
+
),
|
|
8028
|
+
style: { color: SEARCH_COLORS.inputText },
|
|
8029
|
+
onFocus: handleFocus,
|
|
8030
|
+
onChange: (e) => onQueryChange(e.target.value),
|
|
8031
|
+
onKeyDown
|
|
8032
|
+
}
|
|
8033
|
+
)
|
|
8034
|
+
}
|
|
8035
|
+
),
|
|
8036
|
+
trailingIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8037
|
+
"span",
|
|
8038
|
+
{
|
|
8039
|
+
className: "flex shrink-0 items-center justify-center",
|
|
8040
|
+
style: { color: SEARCH_COLORS.trailingIcon },
|
|
8041
|
+
"aria-hidden": "true",
|
|
8042
|
+
children: trailingIcon
|
|
8043
|
+
}
|
|
8044
|
+
)
|
|
8045
|
+
] })
|
|
8046
|
+
}
|
|
8047
|
+
)
|
|
8048
|
+
]
|
|
8049
|
+
},
|
|
8050
|
+
searchId
|
|
8051
|
+
) })
|
|
8052
|
+
);
|
|
8053
|
+
}
|
|
8054
|
+
var SearchContext = React38__namespace.createContext(null);
|
|
8055
|
+
function SearchProvider({
|
|
8056
|
+
children,
|
|
8057
|
+
value
|
|
8058
|
+
}) {
|
|
8059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SearchContext.Provider, { value, children });
|
|
8060
|
+
}
|
|
8061
|
+
function useSearch() {
|
|
8062
|
+
const context = React38__namespace.useContext(SearchContext);
|
|
8063
|
+
if (!context) {
|
|
8064
|
+
return { listboxId: "", activeIndex: -1 };
|
|
8065
|
+
}
|
|
8066
|
+
return context;
|
|
8067
|
+
}
|
|
8068
|
+
function useClickOutside(handler, enabled = true) {
|
|
8069
|
+
const ref = React38.useRef(null);
|
|
8070
|
+
React38.useEffect(() => {
|
|
8071
|
+
if (!enabled) return;
|
|
8072
|
+
const listener = (event) => {
|
|
8073
|
+
const el = ref.current;
|
|
8074
|
+
if (!el || el.contains(event.target)) {
|
|
8075
|
+
return;
|
|
8076
|
+
}
|
|
8077
|
+
handler();
|
|
8078
|
+
};
|
|
8079
|
+
document.addEventListener("mousedown", listener);
|
|
8080
|
+
document.addEventListener("touchstart", listener);
|
|
8081
|
+
return () => {
|
|
8082
|
+
document.removeEventListener("mousedown", listener);
|
|
8083
|
+
document.removeEventListener("touchstart", listener);
|
|
8084
|
+
};
|
|
8085
|
+
}, [handler, enabled]);
|
|
8086
|
+
return ref;
|
|
8087
|
+
}
|
|
8088
|
+
function useSearchViewFocus(inputRef, active) {
|
|
8089
|
+
React38__namespace.useEffect(() => {
|
|
8090
|
+
if (!active) return;
|
|
8091
|
+
let raf2;
|
|
8092
|
+
const raf1 = requestAnimationFrame(() => {
|
|
8093
|
+
raf2 = requestAnimationFrame(() => {
|
|
8094
|
+
var _a;
|
|
8095
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
8096
|
+
});
|
|
8097
|
+
});
|
|
8098
|
+
return () => {
|
|
8099
|
+
cancelAnimationFrame(raf1);
|
|
8100
|
+
if (raf2) cancelAnimationFrame(raf2);
|
|
8101
|
+
};
|
|
8102
|
+
}, [active, inputRef]);
|
|
8103
|
+
}
|
|
8104
|
+
function TrailingAction({
|
|
8105
|
+
query,
|
|
8106
|
+
trailingIcon,
|
|
8107
|
+
onClear
|
|
8108
|
+
}) {
|
|
8109
|
+
if (query) {
|
|
8110
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8111
|
+
IconButton,
|
|
8112
|
+
{
|
|
8113
|
+
size: "sm",
|
|
8114
|
+
style: { color: SEARCH_COLORS.trailingIcon },
|
|
8115
|
+
"aria-label": "Clear search",
|
|
8116
|
+
onClick: onClear,
|
|
8117
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8118
|
+
"span",
|
|
8119
|
+
{
|
|
8120
|
+
className: "material-symbols-rounded select-none leading-none",
|
|
8121
|
+
style: { fontSize: 20 },
|
|
8122
|
+
"aria-hidden": "true",
|
|
8123
|
+
children: "close"
|
|
8124
|
+
}
|
|
8125
|
+
)
|
|
8126
|
+
}
|
|
8127
|
+
);
|
|
6632
8128
|
}
|
|
6633
|
-
)
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
disabled = false,
|
|
6643
|
-
error = false,
|
|
6644
|
-
label,
|
|
6645
|
-
"aria-labelledby": ariaLabelledby,
|
|
6646
|
-
required = false,
|
|
6647
|
-
orientation = "vertical",
|
|
6648
|
-
children,
|
|
6649
|
-
className
|
|
6650
|
-
}, ref) => {
|
|
6651
|
-
const [internalValue, setInternalValue] = React31__namespace.useState(defaultValue);
|
|
6652
|
-
const isControlled = valueProp !== void 0;
|
|
6653
|
-
const selectedValue = isControlled ? valueProp : internalValue;
|
|
6654
|
-
const handleValueChange = React31__namespace.useCallback(
|
|
6655
|
-
(val) => {
|
|
6656
|
-
if (!isControlled) setInternalValue(val);
|
|
6657
|
-
onValueChange == null ? void 0 : onValueChange(val);
|
|
6658
|
-
},
|
|
6659
|
-
[isControlled, onValueChange]
|
|
8129
|
+
if (trailingIcon) {
|
|
8130
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8131
|
+
"span",
|
|
8132
|
+
{
|
|
8133
|
+
className: "flex shrink-0 items-center justify-center",
|
|
8134
|
+
style: { color: SEARCH_COLORS.trailingIcon },
|
|
8135
|
+
"aria-hidden": "true",
|
|
8136
|
+
children: trailingIcon
|
|
8137
|
+
}
|
|
6660
8138
|
);
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
8139
|
+
}
|
|
8140
|
+
return null;
|
|
8141
|
+
}
|
|
8142
|
+
function SearchViewDocked({
|
|
8143
|
+
query,
|
|
8144
|
+
onQueryChange,
|
|
8145
|
+
onSearch,
|
|
8146
|
+
active,
|
|
8147
|
+
onActiveChange,
|
|
8148
|
+
leadingIcon,
|
|
8149
|
+
trailingIcon,
|
|
8150
|
+
placeholder = "Search",
|
|
8151
|
+
textAlign = "left",
|
|
8152
|
+
styleType = "contained",
|
|
8153
|
+
hasGap = false,
|
|
8154
|
+
children,
|
|
8155
|
+
viewClassName,
|
|
8156
|
+
"aria-label": ariaLabel = "Search",
|
|
8157
|
+
searchId,
|
|
8158
|
+
listboxId,
|
|
8159
|
+
onKeyDown,
|
|
8160
|
+
activeIndex
|
|
8161
|
+
}) {
|
|
8162
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
8163
|
+
const inputRef = React38__namespace.useRef(null);
|
|
8164
|
+
useSearchViewFocus(inputRef, active);
|
|
8165
|
+
const dropdownRef = useClickOutside(() => {
|
|
8166
|
+
onActiveChange(false);
|
|
8167
|
+
}, active);
|
|
8168
|
+
const handleFormSubmit = (e) => {
|
|
8169
|
+
e.preventDefault();
|
|
8170
|
+
onSearch(query);
|
|
8171
|
+
};
|
|
8172
|
+
const activeDescendant = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0;
|
|
8173
|
+
return (
|
|
8174
|
+
/*
|
|
8175
|
+
* mode="popLayout": when SearchView exits, it plays exit animation first,
|
|
8176
|
+
* then unmounts — freeing the layoutId for SearchBar to re-enter and morph back.
|
|
8177
|
+
*/
|
|
8178
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: active && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8179
|
+
react.m.div,
|
|
8180
|
+
{
|
|
8181
|
+
ref: dropdownRef,
|
|
8182
|
+
layoutId: shouldReduceMotion ? void 0 : searchId,
|
|
8183
|
+
className: cn(
|
|
8184
|
+
// DockedContainerShape = CornerExtraLarge = 28dp radius
|
|
8185
|
+
"rounded-[28px] overflow-hidden",
|
|
8186
|
+
viewClassName
|
|
8187
|
+
),
|
|
8188
|
+
style: { backgroundColor: SEARCH_COLORS.container },
|
|
8189
|
+
initial: shouldReduceMotion ? {} : { opacity: 0, y: -8 },
|
|
8190
|
+
animate: { opacity: 1, y: 0 },
|
|
8191
|
+
exit: shouldReduceMotion ? {} : { opacity: 0, y: -8 },
|
|
8192
|
+
transition: shouldReduceMotion ? { duration: 0 } : SEARCH_DOCKED_REVEAL_SPRING,
|
|
8193
|
+
children: [
|
|
8194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8195
|
+
"search",
|
|
8196
|
+
{
|
|
8197
|
+
"aria-label": ariaLabel,
|
|
8198
|
+
className: "flex items-center gap-2 px-4",
|
|
8199
|
+
style: { height: SearchTokens.heights.dockedHeader },
|
|
8200
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "contents", onSubmit: handleFormSubmit, children: [
|
|
8201
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8202
|
+
"span",
|
|
8203
|
+
{
|
|
8204
|
+
className: "flex shrink-0 items-center justify-center",
|
|
8205
|
+
style: { color: SEARCH_COLORS.leadingIcon },
|
|
8206
|
+
"aria-hidden": "true",
|
|
8207
|
+
children: leadingIcon
|
|
8208
|
+
}
|
|
8209
|
+
),
|
|
8210
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8211
|
+
AnimatedPlaceholder,
|
|
8212
|
+
{
|
|
8213
|
+
text: placeholder,
|
|
8214
|
+
textAlign,
|
|
8215
|
+
visible: !query,
|
|
8216
|
+
focused: active,
|
|
8217
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8218
|
+
"input",
|
|
8219
|
+
{
|
|
8220
|
+
ref: inputRef,
|
|
8221
|
+
id: `${searchId}-view`,
|
|
8222
|
+
type: "search",
|
|
8223
|
+
role: "combobox",
|
|
8224
|
+
"aria-expanded": true,
|
|
8225
|
+
"aria-controls": listboxId,
|
|
8226
|
+
"aria-autocomplete": "list",
|
|
8227
|
+
"aria-activedescendant": activeDescendant,
|
|
8228
|
+
"aria-label": placeholder,
|
|
8229
|
+
value: query,
|
|
8230
|
+
placeholder,
|
|
8231
|
+
className: cn(
|
|
8232
|
+
"w-full bg-transparent border-none outline-none",
|
|
8233
|
+
"text-[16px] leading-6 font-normal tracking-[0.5px]",
|
|
8234
|
+
"placeholder:text-transparent"
|
|
8235
|
+
),
|
|
8236
|
+
style: { color: SEARCH_COLORS.inputText },
|
|
8237
|
+
onChange: (e) => onQueryChange(e.target.value),
|
|
8238
|
+
onKeyDown
|
|
8239
|
+
}
|
|
8240
|
+
)
|
|
8241
|
+
}
|
|
8242
|
+
),
|
|
8243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8244
|
+
TrailingAction,
|
|
8245
|
+
{
|
|
8246
|
+
query,
|
|
8247
|
+
trailingIcon,
|
|
8248
|
+
onClear: () => onQueryChange("")
|
|
8249
|
+
}
|
|
8250
|
+
)
|
|
8251
|
+
] })
|
|
8252
|
+
}
|
|
8253
|
+
),
|
|
8254
|
+
hasGap && children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-0.5", "aria-hidden": "true" }),
|
|
8255
|
+
styleType === "divided" && children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8256
|
+
"hr",
|
|
8257
|
+
{
|
|
8258
|
+
className: "border-0 border-t",
|
|
8259
|
+
style: { borderColor: SEARCH_COLORS.divider }
|
|
8260
|
+
}
|
|
8261
|
+
),
|
|
8262
|
+
children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8263
|
+
"div",
|
|
8264
|
+
{
|
|
8265
|
+
id: listboxId,
|
|
8266
|
+
role: "listbox",
|
|
8267
|
+
"aria-label": `${ariaLabel} results`,
|
|
8268
|
+
className: "min-h-30",
|
|
8269
|
+
children
|
|
8270
|
+
}
|
|
8271
|
+
)
|
|
8272
|
+
]
|
|
6684
8273
|
},
|
|
6685
|
-
|
|
6686
|
-
)
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
8274
|
+
`${searchId}-view`
|
|
8275
|
+
) })
|
|
8276
|
+
);
|
|
8277
|
+
}
|
|
8278
|
+
function ArrowBackIcon2() {
|
|
8279
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8280
|
+
"span",
|
|
8281
|
+
{
|
|
8282
|
+
className: "material-symbols-rounded select-none leading-none",
|
|
8283
|
+
style: { fontSize: 24 },
|
|
8284
|
+
"aria-hidden": "true",
|
|
8285
|
+
children: "arrow_back"
|
|
8286
|
+
}
|
|
8287
|
+
);
|
|
8288
|
+
}
|
|
8289
|
+
function SearchViewFullScreen({
|
|
8290
|
+
query,
|
|
8291
|
+
onQueryChange,
|
|
8292
|
+
onSearch,
|
|
8293
|
+
active,
|
|
8294
|
+
onActiveChange,
|
|
8295
|
+
leadingIcon,
|
|
8296
|
+
trailingIcon,
|
|
8297
|
+
placeholder = "Search",
|
|
8298
|
+
textAlign = "left",
|
|
8299
|
+
styleType = "contained",
|
|
8300
|
+
children,
|
|
8301
|
+
viewClassName,
|
|
8302
|
+
"aria-label": ariaLabel = "Search",
|
|
8303
|
+
searchId,
|
|
8304
|
+
listboxId,
|
|
8305
|
+
onKeyDown,
|
|
8306
|
+
activeIndex
|
|
8307
|
+
}) {
|
|
8308
|
+
const shouldReduceMotion = react.useReducedMotion();
|
|
8309
|
+
const inputRef = React38__namespace.useRef(null);
|
|
8310
|
+
useSearchViewFocus(inputRef, active);
|
|
8311
|
+
const [mounted, setMounted] = React38__namespace.useState(false);
|
|
8312
|
+
React38__namespace.useEffect(() => {
|
|
8313
|
+
setMounted(true);
|
|
8314
|
+
}, []);
|
|
8315
|
+
const handleFormSubmit = (e) => {
|
|
8316
|
+
e.preventDefault();
|
|
8317
|
+
onSearch(query);
|
|
8318
|
+
};
|
|
8319
|
+
const handleEscape = (e) => {
|
|
8320
|
+
if (e.key === "Escape") {
|
|
8321
|
+
e.stopPropagation();
|
|
8322
|
+
onActiveChange(false);
|
|
8323
|
+
}
|
|
8324
|
+
};
|
|
8325
|
+
const activeDescendant = activeIndex >= 0 ? `${listboxId}-option-${activeIndex}` : void 0;
|
|
8326
|
+
if (!mounted) return null;
|
|
8327
|
+
const content = (
|
|
8328
|
+
/*
|
|
8329
|
+
* mode="popLayout": when FullScreen exits, it plays exit animation first,
|
|
8330
|
+
* then unmounts — freeing the layoutId for SearchBar to re-enter and morph back
|
|
8331
|
+
* to the pill shape.
|
|
8332
|
+
*/
|
|
8333
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "popLayout", children: active && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8334
|
+
react.m.div,
|
|
6700
8335
|
{
|
|
6701
|
-
|
|
6702
|
-
role: "
|
|
6703
|
-
"aria-
|
|
6704
|
-
"aria-
|
|
6705
|
-
"aria-disabled": disabled || void 0,
|
|
6706
|
-
"aria-required": required || void 0,
|
|
8336
|
+
layoutId: shouldReduceMotion ? void 0 : searchId,
|
|
8337
|
+
role: "dialog",
|
|
8338
|
+
"aria-modal": "true",
|
|
8339
|
+
"aria-label": ariaLabel,
|
|
6707
8340
|
className: cn(
|
|
6708
|
-
"flex",
|
|
6709
|
-
|
|
6710
|
-
|
|
8341
|
+
"fixed inset-0 z-50 flex flex-col overflow-hidden",
|
|
8342
|
+
// CornerNone — shape is resolved by Framer Motion layout animation
|
|
8343
|
+
"rounded-none",
|
|
8344
|
+
viewClassName
|
|
6711
8345
|
),
|
|
6712
|
-
|
|
8346
|
+
style: { backgroundColor: SEARCH_COLORS.container },
|
|
8347
|
+
initial: shouldReduceMotion ? {} : { opacity: 0 },
|
|
8348
|
+
animate: { opacity: 1 },
|
|
8349
|
+
exit: shouldReduceMotion ? {} : { opacity: 0 },
|
|
8350
|
+
transition: shouldReduceMotion ? { duration: 0 } : SEARCH_FULLSCREEN_SPRING,
|
|
8351
|
+
onKeyDown: handleEscape,
|
|
6713
8352
|
children: [
|
|
6714
|
-
|
|
6715
|
-
|
|
8353
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8354
|
+
"search",
|
|
8355
|
+
{
|
|
8356
|
+
"aria-label": ariaLabel,
|
|
8357
|
+
className: "flex shrink-0 items-center gap-2 px-4",
|
|
8358
|
+
style: { height: SearchTokens.heights.fullScreenHeader },
|
|
8359
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("form", { className: "contents", onSubmit: handleFormSubmit, children: [
|
|
8360
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8361
|
+
IconButton,
|
|
8362
|
+
{
|
|
8363
|
+
size: "sm",
|
|
8364
|
+
style: { color: SEARCH_COLORS.leadingIcon },
|
|
8365
|
+
"aria-label": "Close search",
|
|
8366
|
+
onClick: (e) => {
|
|
8367
|
+
e.stopPropagation();
|
|
8368
|
+
onActiveChange(false);
|
|
8369
|
+
},
|
|
8370
|
+
children: leadingIcon != null ? leadingIcon : /* @__PURE__ */ jsxRuntime.jsx(ArrowBackIcon2, {})
|
|
8371
|
+
}
|
|
8372
|
+
),
|
|
8373
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8374
|
+
AnimatedPlaceholder,
|
|
8375
|
+
{
|
|
8376
|
+
text: placeholder,
|
|
8377
|
+
textAlign,
|
|
8378
|
+
visible: !query,
|
|
8379
|
+
focused: active,
|
|
8380
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8381
|
+
"input",
|
|
8382
|
+
{
|
|
8383
|
+
ref: inputRef,
|
|
8384
|
+
id: `${searchId}-fs`,
|
|
8385
|
+
type: "search",
|
|
8386
|
+
role: "combobox",
|
|
8387
|
+
"aria-expanded": true,
|
|
8388
|
+
"aria-controls": listboxId,
|
|
8389
|
+
"aria-autocomplete": "list",
|
|
8390
|
+
"aria-activedescendant": activeDescendant,
|
|
8391
|
+
"aria-label": placeholder,
|
|
8392
|
+
value: query,
|
|
8393
|
+
placeholder,
|
|
8394
|
+
className: cn(
|
|
8395
|
+
"w-full bg-transparent border-none outline-none",
|
|
8396
|
+
"text-[16px] leading-6 font-normal tracking-[0.5px]",
|
|
8397
|
+
"placeholder:text-transparent"
|
|
8398
|
+
),
|
|
8399
|
+
style: { color: SEARCH_COLORS.inputText },
|
|
8400
|
+
onChange: (e) => onQueryChange(e.target.value),
|
|
8401
|
+
onKeyDown
|
|
8402
|
+
}
|
|
8403
|
+
)
|
|
8404
|
+
}
|
|
8405
|
+
),
|
|
8406
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8407
|
+
TrailingAction,
|
|
8408
|
+
{
|
|
8409
|
+
query,
|
|
8410
|
+
trailingIcon,
|
|
8411
|
+
onClear: () => onQueryChange("")
|
|
8412
|
+
}
|
|
8413
|
+
)
|
|
8414
|
+
] })
|
|
8415
|
+
}
|
|
8416
|
+
),
|
|
8417
|
+
styleType === "divided" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8418
|
+
"hr",
|
|
8419
|
+
{
|
|
8420
|
+
className: "border-0 border-t shrink-0",
|
|
8421
|
+
style: { borderColor: SEARCH_COLORS.divider }
|
|
8422
|
+
}
|
|
8423
|
+
),
|
|
8424
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8425
|
+
"div",
|
|
8426
|
+
{
|
|
8427
|
+
id: listboxId,
|
|
8428
|
+
role: "listbox",
|
|
8429
|
+
tabIndex: 0,
|
|
8430
|
+
"aria-label": `${ariaLabel} results`,
|
|
8431
|
+
className: "flex-1 overflow-y-auto outline-none",
|
|
8432
|
+
onClick: (e) => {
|
|
8433
|
+
if (e.target === e.currentTarget) onActiveChange(false);
|
|
8434
|
+
},
|
|
8435
|
+
onKeyDown: (e) => {
|
|
8436
|
+
if (e.target === e.currentTarget && (e.key === "Enter" || e.key === " ")) {
|
|
8437
|
+
e.preventDefault();
|
|
8438
|
+
onActiveChange(false);
|
|
8439
|
+
}
|
|
8440
|
+
},
|
|
8441
|
+
children
|
|
8442
|
+
}
|
|
8443
|
+
)
|
|
6716
8444
|
]
|
|
6717
|
-
}
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
);
|
|
6721
|
-
|
|
6722
|
-
|
|
8445
|
+
},
|
|
8446
|
+
`${searchId}-fs`
|
|
8447
|
+
) })
|
|
8448
|
+
);
|
|
8449
|
+
return reactDom.createPortal(content, document.body);
|
|
8450
|
+
}
|
|
8451
|
+
function SearchComponent({
|
|
8452
|
+
query,
|
|
8453
|
+
onQueryChange,
|
|
8454
|
+
onSearch,
|
|
8455
|
+
active,
|
|
8456
|
+
onActiveChange,
|
|
8457
|
+
variant = "docked",
|
|
8458
|
+
styleType = "contained",
|
|
8459
|
+
hasGap = false,
|
|
8460
|
+
leadingIcon,
|
|
8461
|
+
trailingIcon,
|
|
8462
|
+
placeholder = "Search",
|
|
8463
|
+
textAlign = "left",
|
|
8464
|
+
children,
|
|
8465
|
+
id,
|
|
8466
|
+
"aria-label": ariaLabel = "Search",
|
|
8467
|
+
className,
|
|
8468
|
+
viewClassName
|
|
8469
|
+
}) {
|
|
8470
|
+
const generatedId = React38__namespace.useId();
|
|
8471
|
+
const searchId = id != null ? id : generatedId;
|
|
8472
|
+
const listboxId = `${searchId}-listbox`;
|
|
8473
|
+
const itemCount = React38__namespace.Children.count(children);
|
|
8474
|
+
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
8475
|
+
active,
|
|
8476
|
+
onActiveChange,
|
|
8477
|
+
onSearch,
|
|
8478
|
+
query,
|
|
8479
|
+
itemCount
|
|
8480
|
+
});
|
|
8481
|
+
const sharedProps = {
|
|
8482
|
+
query,
|
|
8483
|
+
onQueryChange,
|
|
8484
|
+
onSearch,
|
|
8485
|
+
active,
|
|
8486
|
+
onActiveChange,
|
|
8487
|
+
leadingIcon,
|
|
8488
|
+
trailingIcon,
|
|
8489
|
+
placeholder,
|
|
8490
|
+
textAlign,
|
|
8491
|
+
"aria-label": ariaLabel,
|
|
8492
|
+
searchId,
|
|
8493
|
+
listboxId,
|
|
8494
|
+
onKeyDown: handleKeyDown,
|
|
8495
|
+
activeIndex
|
|
8496
|
+
};
|
|
8497
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SearchProvider, { value: { activeIndex, listboxId }, children: /* @__PURE__ */ jsxRuntime.jsxs(react.m.div, { className, style: { minHeight: 56 }, children: [
|
|
8498
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchBar, __spreadValues({}, sharedProps)),
|
|
8499
|
+
variant === "fullscreen" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8500
|
+
SearchViewFullScreen,
|
|
8501
|
+
__spreadProps(__spreadValues({}, sharedProps), {
|
|
8502
|
+
styleType,
|
|
8503
|
+
viewClassName,
|
|
8504
|
+
children
|
|
8505
|
+
})
|
|
8506
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8507
|
+
SearchViewDocked,
|
|
8508
|
+
__spreadProps(__spreadValues({}, sharedProps), {
|
|
8509
|
+
styleType,
|
|
8510
|
+
hasGap,
|
|
8511
|
+
viewClassName,
|
|
8512
|
+
children
|
|
8513
|
+
})
|
|
8514
|
+
)
|
|
8515
|
+
] }) });
|
|
8516
|
+
}
|
|
8517
|
+
var Search = Object.assign(SearchComponent, { useSearch });
|
|
6723
8518
|
function coerceValue(value, min, max) {
|
|
6724
8519
|
return Math.max(min, Math.min(max, value));
|
|
6725
8520
|
}
|
|
@@ -6773,7 +8568,7 @@ function useSliderMath({
|
|
|
6773
8568
|
max,
|
|
6774
8569
|
step
|
|
6775
8570
|
}) {
|
|
6776
|
-
return
|
|
8571
|
+
return React38.useMemo(
|
|
6777
8572
|
() => ({
|
|
6778
8573
|
coerce: (v) => coerceValue(v, min, max),
|
|
6779
8574
|
snap: (v) => snapToStep(v, min, step),
|
|
@@ -6911,7 +8706,7 @@ var SLIDER_INDICATOR_TRANSITION = {
|
|
|
6911
8706
|
stiffness: 450,
|
|
6912
8707
|
damping: 32
|
|
6913
8708
|
};
|
|
6914
|
-
var ValueIndicator =
|
|
8709
|
+
var ValueIndicator = React38__namespace.memo(function ValueIndicator2({
|
|
6915
8710
|
value,
|
|
6916
8711
|
visible,
|
|
6917
8712
|
orientation,
|
|
@@ -6958,7 +8753,7 @@ var ValueIndicator = React31__namespace.memo(function ValueIndicator2({
|
|
|
6958
8753
|
"value-indicator"
|
|
6959
8754
|
) });
|
|
6960
8755
|
});
|
|
6961
|
-
var SliderThumb =
|
|
8756
|
+
var SliderThumb = React38__namespace.memo(function SliderThumb2({
|
|
6962
8757
|
value,
|
|
6963
8758
|
percent,
|
|
6964
8759
|
min,
|
|
@@ -6990,11 +8785,11 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
6990
8785
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
6991
8786
|
};
|
|
6992
8787
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
6993
|
-
const [isDragging, setIsDragging] =
|
|
6994
|
-
const [isHovered, setIsHovered] =
|
|
6995
|
-
const [isFocused, setIsFocused] =
|
|
6996
|
-
const pointerIdRef =
|
|
6997
|
-
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);
|
|
6998
8793
|
const showIndicator = showValueIndicator && (isDragging || isHovered || isFocused);
|
|
6999
8794
|
const positionStyle = isHorizontal ? __spreadProps(__spreadValues({
|
|
7000
8795
|
position: "absolute"
|
|
@@ -7009,7 +8804,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7009
8804
|
transform: "translate(-50%, 50%)",
|
|
7010
8805
|
zIndex
|
|
7011
8806
|
});
|
|
7012
|
-
const getDeltaFromPointer =
|
|
8807
|
+
const getDeltaFromPointer = React38__namespace.useCallback(
|
|
7013
8808
|
(e) => {
|
|
7014
8809
|
const trackEl = trackRef.current;
|
|
7015
8810
|
if (!trackEl) return percent;
|
|
@@ -7036,7 +8831,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7036
8831
|
},
|
|
7037
8832
|
[isHorizontal, max, min, percent, step, trackRef, trackSize]
|
|
7038
8833
|
);
|
|
7039
|
-
const handlePointerDown =
|
|
8834
|
+
const handlePointerDown = React38__namespace.useCallback(
|
|
7040
8835
|
(e) => {
|
|
7041
8836
|
if (disabled) return;
|
|
7042
8837
|
e.preventDefault();
|
|
@@ -7047,7 +8842,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7047
8842
|
},
|
|
7048
8843
|
[disabled]
|
|
7049
8844
|
);
|
|
7050
|
-
const handlePointerMove =
|
|
8845
|
+
const handlePointerMove = React38__namespace.useCallback(
|
|
7051
8846
|
(e) => {
|
|
7052
8847
|
if (!isDragging || e.pointerId !== pointerIdRef.current) return;
|
|
7053
8848
|
const newValue = getDeltaFromPointer(e.nativeEvent);
|
|
@@ -7055,7 +8850,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7055
8850
|
},
|
|
7056
8851
|
[isDragging, getDeltaFromPointer, onValueChange]
|
|
7057
8852
|
);
|
|
7058
|
-
const handlePointerUp =
|
|
8853
|
+
const handlePointerUp = React38__namespace.useCallback(
|
|
7059
8854
|
(e) => {
|
|
7060
8855
|
if (e.pointerId !== pointerIdRef.current) return;
|
|
7061
8856
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
@@ -7065,7 +8860,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7065
8860
|
},
|
|
7066
8861
|
[onValueChangeEnd, value]
|
|
7067
8862
|
);
|
|
7068
|
-
const handleKeyDown =
|
|
8863
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
7069
8864
|
(e) => {
|
|
7070
8865
|
if (disabled) return;
|
|
7071
8866
|
if (e.key === "Home") {
|
|
@@ -7169,7 +8964,7 @@ var SliderThumb = React31__namespace.memo(function SliderThumb2({
|
|
|
7169
8964
|
}
|
|
7170
8965
|
);
|
|
7171
8966
|
});
|
|
7172
|
-
var RangeTrack =
|
|
8967
|
+
var RangeTrack = React38__namespace.memo(function RangeTrack2({
|
|
7173
8968
|
startPercent,
|
|
7174
8969
|
endPercent,
|
|
7175
8970
|
trackSize,
|
|
@@ -7414,7 +9209,7 @@ var RangeTrack = React31__namespace.memo(function RangeTrack2({
|
|
|
7414
9209
|
}
|
|
7415
9210
|
);
|
|
7416
9211
|
});
|
|
7417
|
-
var RangeSliderComponent =
|
|
9212
|
+
var RangeSliderComponent = React38__namespace.forwardRef(
|
|
7418
9213
|
({
|
|
7419
9214
|
value: controlledValue,
|
|
7420
9215
|
defaultValue,
|
|
@@ -7438,7 +9233,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7438
9233
|
const isHorizontal = orientation === "horizontal";
|
|
7439
9234
|
const defaultStart = (_a = defaultValue == null ? void 0 : defaultValue[0]) != null ? _a : min;
|
|
7440
9235
|
const defaultEnd = (_b = defaultValue == null ? void 0 : defaultValue[1]) != null ? _b : max;
|
|
7441
|
-
const [internalValue, setInternalValue] =
|
|
9236
|
+
const [internalValue, setInternalValue] = React38__namespace.useState([
|
|
7442
9237
|
defaultStart,
|
|
7443
9238
|
defaultEnd
|
|
7444
9239
|
]);
|
|
@@ -7452,10 +9247,10 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7452
9247
|
const endValue = snap(coerce(resolvedValue[1]));
|
|
7453
9248
|
const startPercent = toPercent(startValue);
|
|
7454
9249
|
const endPercent = toPercent(endValue);
|
|
7455
|
-
const [topThumb, setTopThumb] =
|
|
7456
|
-
const trackRef =
|
|
9250
|
+
const [topThumb, setTopThumb] = React38__namespace.useState("end");
|
|
9251
|
+
const trackRef = React38__namespace.useRef(null);
|
|
7457
9252
|
const minGap = step > 0 ? step : (max - min) / 1e3;
|
|
7458
|
-
const handleStartChange =
|
|
9253
|
+
const handleStartChange = React38__namespace.useCallback(
|
|
7459
9254
|
(newStart) => {
|
|
7460
9255
|
setTopThumb("start");
|
|
7461
9256
|
const clamped = Math.min(newStart, endValue - minGap);
|
|
@@ -7467,7 +9262,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7467
9262
|
},
|
|
7468
9263
|
[controlledValue, coerce, endValue, minGap, onValueChange, snap]
|
|
7469
9264
|
);
|
|
7470
|
-
const handleEndChange =
|
|
9265
|
+
const handleEndChange = React38__namespace.useCallback(
|
|
7471
9266
|
(newEnd) => {
|
|
7472
9267
|
setTopThumb("end");
|
|
7473
9268
|
const clamped = Math.max(newEnd, startValue + minGap);
|
|
@@ -7479,15 +9274,15 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7479
9274
|
},
|
|
7480
9275
|
[controlledValue, coerce, minGap, onValueChange, snap, startValue]
|
|
7481
9276
|
);
|
|
7482
|
-
const handleStartChangeEnd =
|
|
9277
|
+
const handleStartChangeEnd = React38__namespace.useCallback(
|
|
7483
9278
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([v, endValue]),
|
|
7484
9279
|
[endValue, onValueChangeEnd]
|
|
7485
9280
|
);
|
|
7486
|
-
const handleEndChangeEnd =
|
|
9281
|
+
const handleEndChangeEnd = React38__namespace.useCallback(
|
|
7487
9282
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([startValue, v]),
|
|
7488
9283
|
[onValueChangeEnd, startValue]
|
|
7489
9284
|
);
|
|
7490
|
-
const handleTrackPointerDown =
|
|
9285
|
+
const handleTrackPointerDown = React38__namespace.useCallback(
|
|
7491
9286
|
(e) => {
|
|
7492
9287
|
if (disabled) return;
|
|
7493
9288
|
const trackEl = trackRef.current;
|
|
@@ -7531,7 +9326,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7531
9326
|
trackSize
|
|
7532
9327
|
]
|
|
7533
9328
|
);
|
|
7534
|
-
const id =
|
|
9329
|
+
const id = React38__namespace.useId();
|
|
7535
9330
|
return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7536
9331
|
"div",
|
|
7537
9332
|
{
|
|
@@ -7611,7 +9406,7 @@ var RangeSliderComponent = React31__namespace.forwardRef(
|
|
|
7611
9406
|
}
|
|
7612
9407
|
);
|
|
7613
9408
|
RangeSliderComponent.displayName = "RangeSlider";
|
|
7614
|
-
var RangeSlider =
|
|
9409
|
+
var RangeSlider = React38__namespace.memo(RangeSliderComponent);
|
|
7615
9410
|
function getHorizontalRadius(isLeading, innerR, outerR) {
|
|
7616
9411
|
if (isLeading) {
|
|
7617
9412
|
return {
|
|
@@ -7650,7 +9445,7 @@ var allInnerRadius = (innerR) => ({
|
|
|
7650
9445
|
borderTopRightRadius: innerR,
|
|
7651
9446
|
borderBottomRightRadius: innerR
|
|
7652
9447
|
});
|
|
7653
|
-
var InsetIcon =
|
|
9448
|
+
var InsetIcon = React38__namespace.memo(function InsetIcon2({
|
|
7654
9449
|
icon,
|
|
7655
9450
|
isOnActiveSegment,
|
|
7656
9451
|
position,
|
|
@@ -7744,7 +9539,7 @@ function Ticks({
|
|
|
7744
9539
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style, "aria-hidden": "true" }, tick);
|
|
7745
9540
|
}) });
|
|
7746
9541
|
}
|
|
7747
|
-
var SliderTrack =
|
|
9542
|
+
var SliderTrack = React38__namespace.memo(function SliderTrack2({
|
|
7748
9543
|
percent,
|
|
7749
9544
|
trackSize,
|
|
7750
9545
|
orientation,
|
|
@@ -7779,8 +9574,8 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
7779
9574
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
7780
9575
|
const hasAnyInsetIcon = Boolean(insetIcon || insetIconTrailing);
|
|
7781
9576
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
7782
|
-
const [trackWidth, setTrackWidth] =
|
|
7783
|
-
|
|
9577
|
+
const [trackWidth, setTrackWidth] = React38__namespace.useState(0);
|
|
9578
|
+
React38__namespace.useLayoutEffect(() => {
|
|
7784
9579
|
const el = trackRef.current;
|
|
7785
9580
|
if (!el || !hasAnyInsetIcon) return;
|
|
7786
9581
|
setTrackWidth(isHorizontal ? el.clientWidth : el.clientHeight);
|
|
@@ -7797,8 +9592,8 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
7797
9592
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
7798
9593
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
7799
9594
|
const HYSTERESIS_GAP = 0.04;
|
|
7800
|
-
const trailingActiveRef =
|
|
7801
|
-
const leadingActiveRef =
|
|
9595
|
+
const trailingActiveRef = React38__namespace.useRef(1 - percent <= iconThreshold);
|
|
9596
|
+
const leadingActiveRef = React38__namespace.useRef(percent > iconThreshold);
|
|
7802
9597
|
const trailingPercent = 1 - percent;
|
|
7803
9598
|
if (trailingActiveRef.current) {
|
|
7804
9599
|
if (trailingPercent > iconThreshold + HYSTERESIS_GAP) {
|
|
@@ -8305,7 +10100,7 @@ var SliderTrack = React31__namespace.memo(function SliderTrack2({
|
|
|
8305
10100
|
}
|
|
8306
10101
|
);
|
|
8307
10102
|
});
|
|
8308
|
-
var SliderComponent =
|
|
10103
|
+
var SliderComponent = React38__namespace.forwardRef(
|
|
8309
10104
|
({
|
|
8310
10105
|
value: controlledValue,
|
|
8311
10106
|
defaultValue,
|
|
@@ -8334,7 +10129,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
8334
10129
|
const isHorizontal = orientation === "horizontal";
|
|
8335
10130
|
const midpoint = min + (max - min) / 2;
|
|
8336
10131
|
const initialValue = defaultValue != null ? defaultValue : midpoint;
|
|
8337
|
-
const [internalValue, setInternalValue] =
|
|
10132
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(initialValue);
|
|
8338
10133
|
const resolvedValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
8339
10134
|
const { coerce, snap, toPercent, ticks } = useSliderMath({
|
|
8340
10135
|
min,
|
|
@@ -8343,8 +10138,8 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
8343
10138
|
});
|
|
8344
10139
|
const safeValue = snap(coerce(resolvedValue));
|
|
8345
10140
|
const percent = toPercent(safeValue);
|
|
8346
|
-
const trackRef =
|
|
8347
|
-
const handleValueChange =
|
|
10141
|
+
const trackRef = React38__namespace.useRef(null);
|
|
10142
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
8348
10143
|
(newValue) => {
|
|
8349
10144
|
const clamped = snap(coerce(newValue));
|
|
8350
10145
|
if (controlledValue === void 0) {
|
|
@@ -8354,13 +10149,13 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
8354
10149
|
},
|
|
8355
10150
|
[coerce, controlledValue, onValueChange, snap]
|
|
8356
10151
|
);
|
|
8357
|
-
const handleValueChangeEnd =
|
|
10152
|
+
const handleValueChangeEnd = React38__namespace.useCallback(
|
|
8358
10153
|
(newValue) => {
|
|
8359
10154
|
onValueChangeEnd == null ? void 0 : onValueChangeEnd(snap(coerce(newValue)));
|
|
8360
10155
|
},
|
|
8361
10156
|
[coerce, onValueChangeEnd, snap]
|
|
8362
10157
|
);
|
|
8363
|
-
const handleTrackPointerDown =
|
|
10158
|
+
const handleTrackPointerDown = React38__namespace.useCallback(
|
|
8364
10159
|
(e) => {
|
|
8365
10160
|
if (disabled) return;
|
|
8366
10161
|
const trackEl = trackRef.current;
|
|
@@ -8395,7 +10190,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
8395
10190
|
trackSize
|
|
8396
10191
|
]
|
|
8397
10192
|
);
|
|
8398
|
-
const id =
|
|
10193
|
+
const id = React38__namespace.useId();
|
|
8399
10194
|
const thumbId = `slider-thumb-${id}`;
|
|
8400
10195
|
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[trackSize] >= 40;
|
|
8401
10196
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
@@ -8467,7 +10262,7 @@ var SliderComponent = React31__namespace.forwardRef(
|
|
|
8467
10262
|
}
|
|
8468
10263
|
);
|
|
8469
10264
|
SliderComponent.displayName = "Slider";
|
|
8470
|
-
var Slider =
|
|
10265
|
+
var Slider = React38__namespace.memo(SliderComponent);
|
|
8471
10266
|
var DURATION_MAP = {
|
|
8472
10267
|
short: 4e3,
|
|
8473
10268
|
long: 7e3
|
|
@@ -8513,9 +10308,9 @@ function toSnackbarData(item) {
|
|
|
8513
10308
|
return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
|
|
8514
10309
|
}
|
|
8515
10310
|
function useSnackbarState() {
|
|
8516
|
-
const [current, setCurrent] =
|
|
8517
|
-
const queueRef =
|
|
8518
|
-
const showSnackbar =
|
|
10311
|
+
const [current, setCurrent] = React38__namespace.useState(null);
|
|
10312
|
+
const queueRef = React38__namespace.useRef([]);
|
|
10313
|
+
const showSnackbar = React38__namespace.useCallback(
|
|
8519
10314
|
(visuals) => {
|
|
8520
10315
|
return new Promise((resolve) => {
|
|
8521
10316
|
const item = { visuals, resolve };
|
|
@@ -8528,14 +10323,14 @@ function useSnackbarState() {
|
|
|
8528
10323
|
},
|
|
8529
10324
|
[]
|
|
8530
10325
|
);
|
|
8531
|
-
const _dismiss =
|
|
10326
|
+
const _dismiss = React38__namespace.useCallback((result) => {
|
|
8532
10327
|
setCurrent((prev) => {
|
|
8533
10328
|
if (prev) prev.resolve(result);
|
|
8534
10329
|
const next = queueRef.current.shift();
|
|
8535
10330
|
return next ? toSnackbarData(next) : null;
|
|
8536
10331
|
});
|
|
8537
10332
|
}, []);
|
|
8538
|
-
|
|
10333
|
+
React38__namespace.useEffect(() => {
|
|
8539
10334
|
return () => {
|
|
8540
10335
|
for (const item of queueRef.current) {
|
|
8541
10336
|
item.resolve(RESULT.DISMISSED);
|
|
@@ -8545,7 +10340,7 @@ function useSnackbarState() {
|
|
|
8545
10340
|
}, []);
|
|
8546
10341
|
return { current, showSnackbar, _dismiss };
|
|
8547
10342
|
}
|
|
8548
|
-
var Snackbar =
|
|
10343
|
+
var Snackbar = React38__namespace.memo(function Snackbar2({
|
|
8549
10344
|
data,
|
|
8550
10345
|
className
|
|
8551
10346
|
}) {
|
|
@@ -8559,15 +10354,15 @@ var Snackbar = React31__namespace.memo(function Snackbar2({
|
|
|
8559
10354
|
} = visuals;
|
|
8560
10355
|
const reducedMotion = react.useReducedMotion();
|
|
8561
10356
|
const durationMs = resolveDuration(duration);
|
|
8562
|
-
|
|
10357
|
+
React38__namespace.useEffect(() => {
|
|
8563
10358
|
const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
|
|
8564
10359
|
return () => clearTimeout(timer);
|
|
8565
10360
|
}, [resolve, durationMs]);
|
|
8566
|
-
const handleAction =
|
|
10361
|
+
const handleAction = React38__namespace.useCallback(
|
|
8567
10362
|
() => resolve(RESULT.ACTION),
|
|
8568
10363
|
[resolve]
|
|
8569
10364
|
);
|
|
8570
|
-
const handleDismiss =
|
|
10365
|
+
const handleDismiss = React38__namespace.useCallback(
|
|
8571
10366
|
() => resolve(RESULT.DISMISSED),
|
|
8572
10367
|
[resolve]
|
|
8573
10368
|
);
|
|
@@ -8635,7 +10430,7 @@ var Snackbar = React31__namespace.memo(function Snackbar2({
|
|
|
8635
10430
|
Snackbar.displayName = "Snackbar";
|
|
8636
10431
|
function SnackbarHost({ state, className }) {
|
|
8637
10432
|
const { current, _dismiss } = state;
|
|
8638
|
-
const wrappedData =
|
|
10433
|
+
const wrappedData = React38__namespace.useMemo(() => {
|
|
8639
10434
|
if (!current) return null;
|
|
8640
10435
|
return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
|
|
8641
10436
|
}, [current, _dismiss]);
|
|
@@ -8653,10 +10448,12 @@ function SnackbarHost({ state, className }) {
|
|
|
8653
10448
|
) });
|
|
8654
10449
|
}
|
|
8655
10450
|
SnackbarHost.displayName = "SnackbarHost";
|
|
8656
|
-
var SnackbarContext =
|
|
10451
|
+
var SnackbarContext = React38__namespace.createContext(
|
|
10452
|
+
null
|
|
10453
|
+
);
|
|
8657
10454
|
function SnackbarProvider({ children }) {
|
|
8658
10455
|
const state = useSnackbarState();
|
|
8659
|
-
const contextValue =
|
|
10456
|
+
const contextValue = React38__namespace.useMemo(
|
|
8660
10457
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
8661
10458
|
[state.showSnackbar]
|
|
8662
10459
|
);
|
|
@@ -8667,7 +10464,7 @@ function SnackbarProvider({ children }) {
|
|
|
8667
10464
|
}
|
|
8668
10465
|
SnackbarProvider.displayName = "SnackbarProvider";
|
|
8669
10466
|
function useSnackbar() {
|
|
8670
|
-
const ctx =
|
|
10467
|
+
const ctx = React38__namespace.useContext(SnackbarContext);
|
|
8671
10468
|
if (!ctx) {
|
|
8672
10469
|
throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
|
|
8673
10470
|
}
|
|
@@ -8730,7 +10527,7 @@ var SwitchColors = {
|
|
|
8730
10527
|
// Focus indicator
|
|
8731
10528
|
focusIndicator: "var(--md-sys-color-secondary)"
|
|
8732
10529
|
};
|
|
8733
|
-
var
|
|
10530
|
+
var FAST_SPATIAL_SPRING2 = {
|
|
8734
10531
|
type: "spring",
|
|
8735
10532
|
stiffness: 500,
|
|
8736
10533
|
damping: 40
|
|
@@ -8771,7 +10568,7 @@ function isIconVisible(thumbContent, icons, showOnlySelectedIcon, checked) {
|
|
|
8771
10568
|
if (icons) return true;
|
|
8772
10569
|
return showOnlySelectedIcon && checked;
|
|
8773
10570
|
}
|
|
8774
|
-
var SwitchVisual =
|
|
10571
|
+
var SwitchVisual = React38__namespace.memo(function SwitchVisual2({
|
|
8775
10572
|
checked,
|
|
8776
10573
|
disabled,
|
|
8777
10574
|
isPressed,
|
|
@@ -8862,9 +10659,9 @@ var SwitchVisual = React31__namespace.memo(function SwitchVisual2({
|
|
|
8862
10659
|
backgroundColor: thumbBg
|
|
8863
10660
|
},
|
|
8864
10661
|
transition: prefersReduced ? { duration: 0 } : isPressed ? SNAP_TRANSITION : {
|
|
8865
|
-
x:
|
|
8866
|
-
width:
|
|
8867
|
-
height:
|
|
10662
|
+
x: FAST_SPATIAL_SPRING2,
|
|
10663
|
+
width: FAST_SPATIAL_SPRING2,
|
|
10664
|
+
height: FAST_SPATIAL_SPRING2,
|
|
8868
10665
|
backgroundColor: colorTransition
|
|
8869
10666
|
},
|
|
8870
10667
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", children: showIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8891,7 +10688,7 @@ var SwitchVisual = React31__namespace.memo(function SwitchVisual2({
|
|
|
8891
10688
|
}
|
|
8892
10689
|
);
|
|
8893
10690
|
});
|
|
8894
|
-
var SwitchComponent =
|
|
10691
|
+
var SwitchComponent = React38__namespace.forwardRef(
|
|
8895
10692
|
({
|
|
8896
10693
|
checked,
|
|
8897
10694
|
onCheckedChange,
|
|
@@ -8909,16 +10706,16 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
8909
10706
|
}, ref) => {
|
|
8910
10707
|
var _a;
|
|
8911
10708
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
8912
|
-
const [isPressed, setIsPressed] =
|
|
8913
|
-
const [isHovered, setIsHovered] =
|
|
8914
|
-
const [isFocused, setIsFocused] =
|
|
8915
|
-
const [ripples, setRipples] =
|
|
8916
|
-
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();
|
|
8917
10714
|
const switchId = label ? `switch-${generatedId}` : void 0;
|
|
8918
|
-
const handleClick =
|
|
10715
|
+
const handleClick = React38__namespace.useCallback(() => {
|
|
8919
10716
|
if (!disabled) onCheckedChange(!checked);
|
|
8920
10717
|
}, [disabled, checked, onCheckedChange]);
|
|
8921
|
-
const handleKeyDown =
|
|
10718
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
8922
10719
|
(e) => {
|
|
8923
10720
|
if (disabled) return;
|
|
8924
10721
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -8928,7 +10725,7 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
8928
10725
|
},
|
|
8929
10726
|
[disabled, checked, onCheckedChange]
|
|
8930
10727
|
);
|
|
8931
|
-
const handlePointerDown =
|
|
10728
|
+
const handlePointerDown = React38__namespace.useCallback(
|
|
8932
10729
|
(e) => {
|
|
8933
10730
|
if (disabled) return;
|
|
8934
10731
|
setIsPressed(true);
|
|
@@ -8943,19 +10740,19 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
8943
10740
|
},
|
|
8944
10741
|
[disabled]
|
|
8945
10742
|
);
|
|
8946
|
-
const handlePointerUp =
|
|
10743
|
+
const handlePointerUp = React38__namespace.useCallback(() => {
|
|
8947
10744
|
setIsPressed(false);
|
|
8948
10745
|
}, []);
|
|
8949
|
-
const handlePointerEnter =
|
|
10746
|
+
const handlePointerEnter = React38__namespace.useCallback(() => {
|
|
8950
10747
|
if (!disabled) setIsHovered(true);
|
|
8951
10748
|
}, [disabled]);
|
|
8952
|
-
const handlePointerLeave =
|
|
10749
|
+
const handlePointerLeave = React38__namespace.useCallback(() => {
|
|
8953
10750
|
setIsHovered(false);
|
|
8954
10751
|
setIsPressed(false);
|
|
8955
10752
|
}, []);
|
|
8956
|
-
const handleFocus =
|
|
8957
|
-
const handleBlur =
|
|
8958
|
-
const removeRipple =
|
|
10753
|
+
const handleFocus = React38__namespace.useCallback(() => setIsFocused(true), []);
|
|
10754
|
+
const handleBlur = React38__namespace.useCallback(() => setIsFocused(false), []);
|
|
10755
|
+
const removeRipple = React38__namespace.useCallback(
|
|
8959
10756
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
8960
10757
|
[]
|
|
8961
10758
|
);
|
|
@@ -9040,10 +10837,54 @@ var SwitchComponent = React31__namespace.forwardRef(
|
|
|
9040
10837
|
}
|
|
9041
10838
|
);
|
|
9042
10839
|
SwitchComponent.displayName = "Switch";
|
|
9043
|
-
var Switch =
|
|
9044
|
-
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);
|
|
9045
10886
|
function useTabsContext() {
|
|
9046
|
-
const ctx =
|
|
10887
|
+
const ctx = React38__namespace.useContext(TabsContext);
|
|
9047
10888
|
if (!ctx) {
|
|
9048
10889
|
throw new Error(
|
|
9049
10890
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -9051,7 +10892,7 @@ function useTabsContext() {
|
|
|
9051
10892
|
}
|
|
9052
10893
|
return ctx;
|
|
9053
10894
|
}
|
|
9054
|
-
var TabsComponent =
|
|
10895
|
+
var TabsComponent = React38__namespace.forwardRef(
|
|
9055
10896
|
({
|
|
9056
10897
|
value: controlledValue,
|
|
9057
10898
|
defaultValue = "",
|
|
@@ -9060,35 +10901,35 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9060
10901
|
children,
|
|
9061
10902
|
className
|
|
9062
10903
|
}, ref) => {
|
|
9063
|
-
const [internalValue, setInternalValue] =
|
|
10904
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
9064
10905
|
const isControlled = controlledValue !== void 0;
|
|
9065
10906
|
const value = isControlled ? controlledValue : internalValue;
|
|
9066
|
-
const handleValueChange =
|
|
10907
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
9067
10908
|
(newValue) => {
|
|
9068
10909
|
if (!isControlled) setInternalValue(newValue);
|
|
9069
10910
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9070
10911
|
},
|
|
9071
10912
|
[isControlled, onValueChange]
|
|
9072
10913
|
);
|
|
9073
|
-
const [focusedValue, setFocusedValue] =
|
|
9074
|
-
|
|
10914
|
+
const [focusedValue, setFocusedValue] = React38__namespace.useState(value);
|
|
10915
|
+
React38__namespace.useEffect(() => {
|
|
9075
10916
|
setFocusedValue(value);
|
|
9076
10917
|
}, [value]);
|
|
9077
|
-
const [tabValues, setTabValues] =
|
|
9078
|
-
const registerTab =
|
|
10918
|
+
const [tabValues, setTabValues] = React38__namespace.useState([]);
|
|
10919
|
+
const registerTab = React38__namespace.useCallback((tabValue) => {
|
|
9079
10920
|
setTabValues((prev) => {
|
|
9080
10921
|
if (prev.includes(tabValue)) return prev;
|
|
9081
10922
|
return [...prev, tabValue];
|
|
9082
10923
|
});
|
|
9083
10924
|
}, []);
|
|
9084
|
-
const unregisterTab =
|
|
10925
|
+
const unregisterTab = React38__namespace.useCallback((tabValue) => {
|
|
9085
10926
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
9086
10927
|
}, []);
|
|
9087
|
-
const hasAutoSelected =
|
|
9088
|
-
const [disabledValues, setDisabledValues] =
|
|
10928
|
+
const hasAutoSelected = React38__namespace.useRef(false);
|
|
10929
|
+
const [disabledValues, setDisabledValues] = React38__namespace.useState(
|
|
9089
10930
|
/* @__PURE__ */ new Set()
|
|
9090
10931
|
);
|
|
9091
|
-
const markTabDisabled =
|
|
10932
|
+
const markTabDisabled = React38__namespace.useCallback(
|
|
9092
10933
|
(tabValue, disabled) => {
|
|
9093
10934
|
setDisabledValues((prev) => {
|
|
9094
10935
|
const next = new Set(prev);
|
|
@@ -9102,7 +10943,7 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9102
10943
|
},
|
|
9103
10944
|
[]
|
|
9104
10945
|
);
|
|
9105
|
-
|
|
10946
|
+
React38__namespace.useEffect(() => {
|
|
9106
10947
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
9107
10948
|
return;
|
|
9108
10949
|
}
|
|
@@ -9117,9 +10958,9 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9117
10958
|
setFocusedValue(firstEnabled);
|
|
9118
10959
|
}
|
|
9119
10960
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
9120
|
-
const id =
|
|
10961
|
+
const id = React38__namespace.useId();
|
|
9121
10962
|
const layoutGroupId = `tabs-${id}`;
|
|
9122
|
-
const contextValue =
|
|
10963
|
+
const contextValue = React38__namespace.useMemo(
|
|
9123
10964
|
() => ({
|
|
9124
10965
|
value,
|
|
9125
10966
|
onValueChange: handleValueChange,
|
|
@@ -9150,12 +10991,12 @@ var TabsComponent = React31__namespace.forwardRef(
|
|
|
9150
10991
|
}
|
|
9151
10992
|
);
|
|
9152
10993
|
TabsComponent.displayName = "Tabs";
|
|
9153
|
-
var Tabs =
|
|
9154
|
-
var TabsListContext =
|
|
10994
|
+
var Tabs = React38__namespace.memo(TabsComponent);
|
|
10995
|
+
var TabsListContext = React38__namespace.createContext(
|
|
9155
10996
|
null
|
|
9156
10997
|
);
|
|
9157
10998
|
function useTabsListContext() {
|
|
9158
|
-
const ctx =
|
|
10999
|
+
const ctx = React38__namespace.useContext(TabsListContext);
|
|
9159
11000
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
9160
11001
|
}
|
|
9161
11002
|
|
|
@@ -9239,7 +11080,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
9239
11080
|
ease: "easeInOut"
|
|
9240
11081
|
};
|
|
9241
11082
|
var INDICATOR_MIN_WIDTH = 24;
|
|
9242
|
-
var TabComponent =
|
|
11083
|
+
var TabComponent = React38__namespace.forwardRef(
|
|
9243
11084
|
({
|
|
9244
11085
|
value,
|
|
9245
11086
|
icon,
|
|
@@ -9269,9 +11110,9 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
9269
11110
|
const isFocused = focusedValue === value;
|
|
9270
11111
|
const hasIcon = icon != null;
|
|
9271
11112
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
9272
|
-
const buttonRef =
|
|
9273
|
-
const isFirstMount =
|
|
9274
|
-
const mergedRef =
|
|
11113
|
+
const buttonRef = React38__namespace.useRef(null);
|
|
11114
|
+
const isFirstMount = React38__namespace.useRef(true);
|
|
11115
|
+
const mergedRef = React38__namespace.useCallback(
|
|
9275
11116
|
(node) => {
|
|
9276
11117
|
buttonRef.current = node;
|
|
9277
11118
|
if (typeof ref === "function") ref(node);
|
|
@@ -9279,15 +11120,15 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
9279
11120
|
},
|
|
9280
11121
|
[ref]
|
|
9281
11122
|
);
|
|
9282
|
-
|
|
11123
|
+
React38__namespace.useEffect(() => {
|
|
9283
11124
|
registerTab(value);
|
|
9284
11125
|
return () => unregisterTab(value);
|
|
9285
11126
|
}, [value, registerTab, unregisterTab]);
|
|
9286
|
-
|
|
11127
|
+
React38__namespace.useEffect(() => {
|
|
9287
11128
|
markTabDisabled(value, disabled);
|
|
9288
11129
|
return () => markTabDisabled(value, false);
|
|
9289
11130
|
}, [value, disabled, markTabDisabled]);
|
|
9290
|
-
const handleKeyDown =
|
|
11131
|
+
const handleKeyDown = React38__namespace.useCallback(
|
|
9291
11132
|
(e) => {
|
|
9292
11133
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
9293
11134
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -9341,7 +11182,7 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
9341
11182
|
autoActivate
|
|
9342
11183
|
]
|
|
9343
11184
|
);
|
|
9344
|
-
|
|
11185
|
+
React38__namespace.useEffect(() => {
|
|
9345
11186
|
if (isFirstMount.current) {
|
|
9346
11187
|
isFirstMount.current = false;
|
|
9347
11188
|
return;
|
|
@@ -9350,7 +11191,7 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
9350
11191
|
buttonRef.current.focus({ preventScroll: true });
|
|
9351
11192
|
}
|
|
9352
11193
|
}, [isFocused]);
|
|
9353
|
-
|
|
11194
|
+
React38__namespace.useEffect(() => {
|
|
9354
11195
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
9355
11196
|
const btn = buttonRef.current;
|
|
9356
11197
|
let container = btn.parentElement;
|
|
@@ -9487,8 +11328,8 @@ var TabComponent = React31__namespace.forwardRef(
|
|
|
9487
11328
|
}
|
|
9488
11329
|
);
|
|
9489
11330
|
TabComponent.displayName = "Tab";
|
|
9490
|
-
var Tab =
|
|
9491
|
-
var TabsContentComponent =
|
|
11331
|
+
var Tab = React38__namespace.memo(TabComponent);
|
|
11332
|
+
var TabsContentComponent = React38__namespace.forwardRef(
|
|
9492
11333
|
({ value, className, children }, ref) => {
|
|
9493
11334
|
var _a;
|
|
9494
11335
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -9522,8 +11363,8 @@ var TabsContentComponent = React31__namespace.forwardRef(
|
|
|
9522
11363
|
}
|
|
9523
11364
|
);
|
|
9524
11365
|
TabsContentComponent.displayName = "TabsContent";
|
|
9525
|
-
var TabsContent =
|
|
9526
|
-
var TabsListComponent =
|
|
11366
|
+
var TabsContent = React38__namespace.memo(TabsContentComponent);
|
|
11367
|
+
var TabsListComponent = React38__namespace.forwardRef(
|
|
9527
11368
|
({
|
|
9528
11369
|
variant,
|
|
9529
11370
|
scrollable = false,
|
|
@@ -9534,12 +11375,12 @@ var TabsListComponent = React31__namespace.forwardRef(
|
|
|
9534
11375
|
}, ref) => {
|
|
9535
11376
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
9536
11377
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
9537
|
-
const listContextValue =
|
|
11378
|
+
const listContextValue = React38__namespace.useMemo(
|
|
9538
11379
|
() => ({ variant, scrollable }),
|
|
9539
11380
|
[variant, scrollable]
|
|
9540
11381
|
);
|
|
9541
11382
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
9542
|
-
const handleBlur =
|
|
11383
|
+
const handleBlur = React38__namespace.useCallback(
|
|
9543
11384
|
(e) => {
|
|
9544
11385
|
const listEl = e.currentTarget;
|
|
9545
11386
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -9588,7 +11429,7 @@ var TabsListComponent = React31__namespace.forwardRef(
|
|
|
9588
11429
|
}
|
|
9589
11430
|
);
|
|
9590
11431
|
TabsListComponent.displayName = "TabsList";
|
|
9591
|
-
var TabsList =
|
|
11432
|
+
var TabsList = React38__namespace.memo(TabsListComponent);
|
|
9592
11433
|
|
|
9593
11434
|
// src/ui/text-field/text-field.tokens.ts
|
|
9594
11435
|
var TF_COLORS = {
|
|
@@ -9627,7 +11468,7 @@ var TF_TYPOGRAPHY = {
|
|
|
9627
11468
|
var TF_CLASSES = {
|
|
9628
11469
|
// Prefix / Suffix
|
|
9629
11470
|
prefixSuffix: "text-base text-[var(--color-m3-on-surface-variant)] select-none shrink-0"};
|
|
9630
|
-
var ActiveIndicator =
|
|
11471
|
+
var ActiveIndicator = React38__namespace.memo(function ActiveIndicator2({
|
|
9631
11472
|
isFocused,
|
|
9632
11473
|
isError,
|
|
9633
11474
|
isDisabled,
|
|
@@ -9674,7 +11515,7 @@ function getLabelColor(isFloated, isFocused, isError, isDisabled) {
|
|
|
9674
11515
|
if (isFloated && isFocused) return TF_COLORS.primary;
|
|
9675
11516
|
return TF_COLORS.onSurfaceVariant;
|
|
9676
11517
|
}
|
|
9677
|
-
var FloatingLabel =
|
|
11518
|
+
var FloatingLabel = React38__namespace.memo(function FloatingLabel2({
|
|
9678
11519
|
text,
|
|
9679
11520
|
isFloated,
|
|
9680
11521
|
isFocused,
|
|
@@ -9734,7 +11575,7 @@ var FloatingLabel = React31__namespace.memo(function FloatingLabel2({
|
|
|
9734
11575
|
);
|
|
9735
11576
|
});
|
|
9736
11577
|
FloatingLabel.displayName = "FloatingLabel";
|
|
9737
|
-
var LeadingIcon =
|
|
11578
|
+
var LeadingIcon = React38__namespace.memo(function LeadingIcon2({
|
|
9738
11579
|
children,
|
|
9739
11580
|
isError,
|
|
9740
11581
|
isDisabled
|
|
@@ -9758,7 +11599,7 @@ function getOutlineColor(isFocused, isError, isHovered, isDisabled) {
|
|
|
9758
11599
|
if (isHovered) return TF_COLORS.inputText;
|
|
9759
11600
|
return TF_COLORS.outline;
|
|
9760
11601
|
}
|
|
9761
|
-
var OutlineContainer =
|
|
11602
|
+
var OutlineContainer = React38__namespace.memo(function OutlineContainer2({
|
|
9762
11603
|
isFloated,
|
|
9763
11604
|
isFocused,
|
|
9764
11605
|
isError,
|
|
@@ -9856,7 +11697,7 @@ var OutlineContainer = React31__namespace.memo(function OutlineContainer2({
|
|
|
9856
11697
|
);
|
|
9857
11698
|
});
|
|
9858
11699
|
OutlineContainer.displayName = "OutlineContainer";
|
|
9859
|
-
var PrefixSuffix =
|
|
11700
|
+
var PrefixSuffix = React38__namespace.memo(function PrefixSuffix2({
|
|
9860
11701
|
text,
|
|
9861
11702
|
type,
|
|
9862
11703
|
visible,
|
|
@@ -9898,7 +11739,7 @@ function AnimatedText({
|
|
|
9898
11739
|
motionKey
|
|
9899
11740
|
);
|
|
9900
11741
|
}
|
|
9901
|
-
var SupportingText =
|
|
11742
|
+
var SupportingText = React38__namespace.memo(function SupportingText2({
|
|
9902
11743
|
supportingText,
|
|
9903
11744
|
errorText,
|
|
9904
11745
|
isError,
|
|
@@ -10009,7 +11850,7 @@ function ClearIcon() {
|
|
|
10009
11850
|
}
|
|
10010
11851
|
);
|
|
10011
11852
|
}
|
|
10012
|
-
var TrailingIcon =
|
|
11853
|
+
var TrailingIcon = React38__namespace.memo(function TrailingIcon2({
|
|
10013
11854
|
mode,
|
|
10014
11855
|
children,
|
|
10015
11856
|
value,
|
|
@@ -10075,7 +11916,7 @@ var TrailingIcon = React31__namespace.memo(function TrailingIcon2({
|
|
|
10075
11916
|
});
|
|
10076
11917
|
TrailingIcon.displayName = "TrailingIcon";
|
|
10077
11918
|
var LINE_HEIGHT_PX = 24;
|
|
10078
|
-
var TextFieldComponent =
|
|
11919
|
+
var TextFieldComponent = React38__namespace.forwardRef(
|
|
10079
11920
|
({
|
|
10080
11921
|
// Core
|
|
10081
11922
|
variant = "filled",
|
|
@@ -10139,30 +11980,30 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10139
11980
|
}, ref) => {
|
|
10140
11981
|
var _a;
|
|
10141
11982
|
const prefersReduced = (_a = react.useReducedMotion()) != null ? _a : false;
|
|
10142
|
-
const generatedId =
|
|
11983
|
+
const generatedId = React38__namespace.useId();
|
|
10143
11984
|
const inputId = idProp != null ? idProp : `tf-${generatedId}`;
|
|
10144
11985
|
const supportingId = `${inputId}-supporting`;
|
|
10145
11986
|
const isControlled = valueProp !== void 0;
|
|
10146
|
-
const [internalValue, setInternalValue] =
|
|
11987
|
+
const [internalValue, setInternalValue] = React38__namespace.useState(defaultValue);
|
|
10147
11988
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
10148
|
-
const [isFocused, setIsFocused] =
|
|
10149
|
-
const [showPassword, setShowPassword] =
|
|
11989
|
+
const [isFocused, setIsFocused] = React38__namespace.useState(false);
|
|
11990
|
+
const [showPassword, setShowPassword] = React38__namespace.useState(false);
|
|
10150
11991
|
const resolvedInputType = type === "password" && showPassword ? "text" : type;
|
|
10151
|
-
const [nativeError, setNativeError] =
|
|
10152
|
-
const [labelWidth, setLabelWidth] =
|
|
11992
|
+
const [nativeError, setNativeError] = React38__namespace.useState("");
|
|
11993
|
+
const [labelWidth, setLabelWidth] = React38__namespace.useState(0);
|
|
10153
11994
|
const hasValue = currentValue.length > 0;
|
|
10154
11995
|
const isFloated = isFocused || hasValue;
|
|
10155
11996
|
const isError = errorProp || !!nativeError || maxLength !== void 0 && currentValue.length > maxLength;
|
|
10156
11997
|
const containerHeight = dense ? TF_SIZE.denseHeight : TF_SIZE.height;
|
|
10157
11998
|
const showAsterisk = required && !noAsterisk;
|
|
10158
|
-
const inputRef =
|
|
10159
|
-
const labelSpanRef =
|
|
10160
|
-
|
|
11999
|
+
const inputRef = React38__namespace.useRef(null);
|
|
12000
|
+
const labelSpanRef = React38__namespace.useRef(null);
|
|
12001
|
+
React38__namespace.useLayoutEffect(() => {
|
|
10161
12002
|
if (labelSpanRef.current) {
|
|
10162
12003
|
setLabelWidth(labelSpanRef.current.offsetWidth);
|
|
10163
12004
|
}
|
|
10164
12005
|
}, []);
|
|
10165
|
-
|
|
12006
|
+
React38__namespace.useLayoutEffect(() => {
|
|
10166
12007
|
if (type !== "textarea" || !inputRef.current) return;
|
|
10167
12008
|
const textarea = inputRef.current;
|
|
10168
12009
|
if (autoResize) {
|
|
@@ -10174,7 +12015,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10174
12015
|
}
|
|
10175
12016
|
textarea.style.overflowY = "hidden";
|
|
10176
12017
|
}, [type, autoResize, maxRows, currentValue]);
|
|
10177
|
-
const handleValueChange =
|
|
12018
|
+
const handleValueChange = React38__namespace.useCallback(
|
|
10178
12019
|
(newValue) => {
|
|
10179
12020
|
var _a2, _b;
|
|
10180
12021
|
if (!isControlled) setInternalValue(newValue);
|
|
@@ -10183,7 +12024,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10183
12024
|
},
|
|
10184
12025
|
[isControlled]
|
|
10185
12026
|
);
|
|
10186
|
-
const handleChange =
|
|
12027
|
+
const handleChange = React38__namespace.useCallback(
|
|
10187
12028
|
(e) => {
|
|
10188
12029
|
const newVal = e.target.value;
|
|
10189
12030
|
handleValueChange(newVal);
|
|
@@ -10191,14 +12032,14 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10191
12032
|
},
|
|
10192
12033
|
[handleValueChange, onChange]
|
|
10193
12034
|
);
|
|
10194
|
-
const handleFocus =
|
|
12035
|
+
const handleFocus = React38__namespace.useCallback(
|
|
10195
12036
|
(e) => {
|
|
10196
12037
|
setIsFocused(true);
|
|
10197
12038
|
onFocus == null ? void 0 : onFocus(e);
|
|
10198
12039
|
},
|
|
10199
12040
|
[onFocus]
|
|
10200
12041
|
);
|
|
10201
|
-
const handleBlur =
|
|
12042
|
+
const handleBlur = React38__namespace.useCallback(
|
|
10202
12043
|
(e) => {
|
|
10203
12044
|
setIsFocused(false);
|
|
10204
12045
|
const el = inputRef.current;
|
|
@@ -10211,7 +12052,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10211
12052
|
},
|
|
10212
12053
|
[onBlur]
|
|
10213
12054
|
);
|
|
10214
|
-
const handleClear =
|
|
12055
|
+
const handleClear = React38__namespace.useCallback(() => {
|
|
10215
12056
|
var _a2;
|
|
10216
12057
|
handleValueChange("");
|
|
10217
12058
|
onChange == null ? void 0 : onChange("", {
|
|
@@ -10219,12 +12060,12 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10219
12060
|
});
|
|
10220
12061
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
10221
12062
|
}, [handleValueChange, onChange]);
|
|
10222
|
-
const handlePasswordToggle =
|
|
12063
|
+
const handlePasswordToggle = React38__namespace.useCallback(() => {
|
|
10223
12064
|
var _a2;
|
|
10224
12065
|
setShowPassword((prev) => !prev);
|
|
10225
12066
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
10226
12067
|
}, []);
|
|
10227
|
-
|
|
12068
|
+
React38__namespace.useImperativeHandle(
|
|
10228
12069
|
ref,
|
|
10229
12070
|
() => ({
|
|
10230
12071
|
focus: () => {
|
|
@@ -10469,7 +12310,7 @@ var TextFieldComponent = React31__namespace.forwardRef(
|
|
|
10469
12310
|
}
|
|
10470
12311
|
);
|
|
10471
12312
|
TextFieldComponent.displayName = "TextField";
|
|
10472
|
-
var TextField =
|
|
12313
|
+
var TextField = React38__namespace.memo(TextFieldComponent);
|
|
10473
12314
|
|
|
10474
12315
|
// src/ui/typography/typography-key-tokens.ts
|
|
10475
12316
|
var TypographyKeyTokens = /* @__PURE__ */ ((TypographyKeyTokens2) => {
|
|
@@ -11184,9 +13025,9 @@ var TOKEN_TO_PROP = {
|
|
|
11184
13025
|
};
|
|
11185
13026
|
var defaultTokens = new TypographyTokens();
|
|
11186
13027
|
var defaultTypography = new Typography();
|
|
11187
|
-
var TypographyContext =
|
|
13028
|
+
var TypographyContext = React38.createContext(defaultTypography);
|
|
11188
13029
|
function useTypography() {
|
|
11189
|
-
return
|
|
13030
|
+
return React38.useContext(TypographyContext);
|
|
11190
13031
|
}
|
|
11191
13032
|
function TypographyProvider({
|
|
11192
13033
|
children,
|
|
@@ -11194,7 +13035,7 @@ function TypographyProvider({
|
|
|
11194
13035
|
fontFamily,
|
|
11195
13036
|
fontVariationAxes
|
|
11196
13037
|
}) {
|
|
11197
|
-
const value =
|
|
13038
|
+
const value = React38.useMemo(() => {
|
|
11198
13039
|
if (typography) return typography;
|
|
11199
13040
|
if (fontFamily || fontVariationAxes) {
|
|
11200
13041
|
return new Typography(
|
|
@@ -11205,7 +13046,7 @@ function TypographyProvider({
|
|
|
11205
13046
|
}, [typography, fontFamily, fontVariationAxes]);
|
|
11206
13047
|
return /* @__PURE__ */ jsxRuntime.jsx(TypographyContext.Provider, { value, children });
|
|
11207
13048
|
}
|
|
11208
|
-
var ThemeContext =
|
|
13049
|
+
var ThemeContext = React38.createContext(void 0);
|
|
11209
13050
|
var STORAGE_KEY_COLOR = "md3-source-color";
|
|
11210
13051
|
var STORAGE_KEY_MODE = "md3-theme-mode";
|
|
11211
13052
|
var defaultTokens2 = new TypographyTokens();
|
|
@@ -11220,10 +13061,10 @@ function MD3ThemeProvider({
|
|
|
11220
13061
|
fontVariationAxes,
|
|
11221
13062
|
enableSnackbar = false
|
|
11222
13063
|
}) {
|
|
11223
|
-
const [sourceColor, setSourceColor] =
|
|
11224
|
-
const [mode, setMode] =
|
|
11225
|
-
const [isHydrated, setIsHydrated] =
|
|
11226
|
-
|
|
13064
|
+
const [sourceColor, setSourceColor] = React38.useState(initialSourceColor);
|
|
13065
|
+
const [mode, setMode] = React38.useState(defaultMode);
|
|
13066
|
+
const [isHydrated, setIsHydrated] = React38.useState(!persistToLocalStorage);
|
|
13067
|
+
React38.useEffect(() => {
|
|
11227
13068
|
if (!persistToLocalStorage) return;
|
|
11228
13069
|
const savedColor = localStorage.getItem(STORAGE_KEY_COLOR);
|
|
11229
13070
|
const savedMode = localStorage.getItem(
|
|
@@ -11233,7 +13074,7 @@ function MD3ThemeProvider({
|
|
|
11233
13074
|
if (savedMode === "light" || savedMode === "dark") setMode(savedMode);
|
|
11234
13075
|
setIsHydrated(true);
|
|
11235
13076
|
}, [persistToLocalStorage]);
|
|
11236
|
-
|
|
13077
|
+
React38.useEffect(() => {
|
|
11237
13078
|
if (!isHydrated) return;
|
|
11238
13079
|
applyTheme(sourceColor, mode);
|
|
11239
13080
|
if (persistToLocalStorage) {
|
|
@@ -11241,11 +13082,11 @@ function MD3ThemeProvider({
|
|
|
11241
13082
|
localStorage.setItem(STORAGE_KEY_MODE, mode);
|
|
11242
13083
|
}
|
|
11243
13084
|
}, [sourceColor, mode, persistToLocalStorage, isHydrated]);
|
|
11244
|
-
const themeValue =
|
|
13085
|
+
const themeValue = React38.useMemo(
|
|
11245
13086
|
() => ({ sourceColor, setSourceColor, mode, setMode }),
|
|
11246
13087
|
[sourceColor, mode]
|
|
11247
13088
|
);
|
|
11248
|
-
const typographyValue =
|
|
13089
|
+
const typographyValue = React38.useMemo(() => {
|
|
11249
13090
|
if (typographyProp) return typographyProp;
|
|
11250
13091
|
if (fontFamily != null ? fontFamily : fontVariationAxes) {
|
|
11251
13092
|
return new Typography(
|
|
@@ -11258,7 +13099,7 @@ function MD3ThemeProvider({
|
|
|
11258
13099
|
}
|
|
11259
13100
|
function SnackbarMountedProvider({ children }) {
|
|
11260
13101
|
const state = useSnackbarState();
|
|
11261
|
-
const contextValue =
|
|
13102
|
+
const contextValue = React38.useMemo(
|
|
11262
13103
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
11263
13104
|
[state.showSnackbar]
|
|
11264
13105
|
);
|
|
@@ -11268,7 +13109,7 @@ function SnackbarMountedProvider({ children }) {
|
|
|
11268
13109
|
] });
|
|
11269
13110
|
}
|
|
11270
13111
|
function useTheme() {
|
|
11271
|
-
const context =
|
|
13112
|
+
const context = React38.useContext(ThemeContext);
|
|
11272
13113
|
if (!context) {
|
|
11273
13114
|
throw new Error("useTheme must be used within <MD3ThemeProvider>.");
|
|
11274
13115
|
}
|
|
@@ -11283,9 +13124,9 @@ function TableOfContents({
|
|
|
11283
13124
|
className,
|
|
11284
13125
|
scrollAreaProps
|
|
11285
13126
|
}) {
|
|
11286
|
-
const [activeId, setActiveId] =
|
|
11287
|
-
const itemIds =
|
|
11288
|
-
|
|
13127
|
+
const [activeId, setActiveId] = React38.useState("");
|
|
13128
|
+
const itemIds = React38.useMemo(() => items.map((i) => i.id), [items]);
|
|
13129
|
+
React38.useEffect(() => {
|
|
11289
13130
|
if (typeof IntersectionObserver === "undefined") return;
|
|
11290
13131
|
const observer = new IntersectionObserver(
|
|
11291
13132
|
(entries) => {
|
|
@@ -11302,7 +13143,7 @@ function TableOfContents({
|
|
|
11302
13143
|
}
|
|
11303
13144
|
return () => observer.disconnect();
|
|
11304
13145
|
}, [itemIds]);
|
|
11305
|
-
const handleClick =
|
|
13146
|
+
const handleClick = React38.useCallback(
|
|
11306
13147
|
(e, id) => {
|
|
11307
13148
|
var _a;
|
|
11308
13149
|
e.preventDefault();
|
|
@@ -11438,7 +13279,7 @@ function TooltipCaretShape({
|
|
|
11438
13279
|
}
|
|
11439
13280
|
);
|
|
11440
13281
|
}
|
|
11441
|
-
var PlainTooltip =
|
|
13282
|
+
var PlainTooltip = React38.forwardRef(
|
|
11442
13283
|
(_a, ref) => {
|
|
11443
13284
|
var _b = _a, {
|
|
11444
13285
|
children,
|
|
@@ -11495,7 +13336,7 @@ var PlainTooltip = React31.forwardRef(
|
|
|
11495
13336
|
}
|
|
11496
13337
|
);
|
|
11497
13338
|
PlainTooltip.displayName = "PlainTooltip";
|
|
11498
|
-
var RichTooltip =
|
|
13339
|
+
var RichTooltip = React38.forwardRef(
|
|
11499
13340
|
(_a, ref) => {
|
|
11500
13341
|
var _b = _a, {
|
|
11501
13342
|
children,
|
|
@@ -11579,7 +13420,7 @@ var RichTooltip = React31.forwardRef(
|
|
|
11579
13420
|
);
|
|
11580
13421
|
RichTooltip.displayName = "RichTooltip";
|
|
11581
13422
|
var VIEWPORT_PADDING = 8;
|
|
11582
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
13423
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React38.useLayoutEffect : React38.useEffect;
|
|
11583
13424
|
function resolveAutoPlacement(spaceTop, spaceBottom, spaceLeft, spaceRight, tooltipWidth, tooltipHeight, spacing) {
|
|
11584
13425
|
if (spaceTop >= tooltipHeight + spacing) return "top";
|
|
11585
13426
|
if (spaceBottom >= tooltipHeight + spacing) return "bottom";
|
|
@@ -11639,7 +13480,7 @@ function clampToViewport(side, top, left, tooltipWidth, tooltipHeight) {
|
|
|
11639
13480
|
return { top, left };
|
|
11640
13481
|
}
|
|
11641
13482
|
function useTooltipPosition(anchorRef, tooltipRef, placement, spacing, isVisible) {
|
|
11642
|
-
const [position, setPosition] =
|
|
13483
|
+
const [position, setPosition] = React38.useState({
|
|
11643
13484
|
top: -9999,
|
|
11644
13485
|
left: -9999,
|
|
11645
13486
|
actualSide: placement === "auto" ? "top" : placement
|
|
@@ -11714,24 +13555,24 @@ function useTooltipState(config) {
|
|
|
11714
13555
|
isPersistent = false,
|
|
11715
13556
|
duration = 1500
|
|
11716
13557
|
} = config != null ? config : {};
|
|
11717
|
-
const [isVisible, setIsVisible] =
|
|
11718
|
-
const dismiss =
|
|
13558
|
+
const [isVisible, setIsVisible] = React38.useState(initialVisible);
|
|
13559
|
+
const dismiss = React38.useCallback(() => {
|
|
11719
13560
|
setIsVisible(false);
|
|
11720
13561
|
activeTooltipDismissals.delete(dismiss);
|
|
11721
13562
|
}, []);
|
|
11722
|
-
const show =
|
|
13563
|
+
const show = React38.useCallback(() => {
|
|
11723
13564
|
for (const otherDismiss of activeTooltipDismissals) {
|
|
11724
13565
|
if (otherDismiss !== dismiss) otherDismiss();
|
|
11725
13566
|
}
|
|
11726
13567
|
setIsVisible(true);
|
|
11727
13568
|
activeTooltipDismissals.add(dismiss);
|
|
11728
13569
|
}, [dismiss]);
|
|
11729
|
-
|
|
13570
|
+
React38.useEffect(() => {
|
|
11730
13571
|
if (!isVisible || isPersistent) return;
|
|
11731
13572
|
const timeoutId = setTimeout(dismiss, duration);
|
|
11732
13573
|
return () => clearTimeout(timeoutId);
|
|
11733
13574
|
}, [isVisible, isPersistent, duration, dismiss]);
|
|
11734
|
-
|
|
13575
|
+
React38.useEffect(() => {
|
|
11735
13576
|
return () => {
|
|
11736
13577
|
activeTooltipDismissals.delete(dismiss);
|
|
11737
13578
|
};
|
|
@@ -11788,20 +13629,20 @@ function TooltipBox({
|
|
|
11788
13629
|
}) {
|
|
11789
13630
|
const internalState = useTooltipState();
|
|
11790
13631
|
const state = controlledState != null ? controlledState : internalState;
|
|
11791
|
-
const anchorRef =
|
|
11792
|
-
const tooltipRef =
|
|
11793
|
-
const hoverTimeoutRef =
|
|
11794
|
-
const hideTimeoutRef =
|
|
11795
|
-
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);
|
|
11796
13637
|
const triggers = Array.isArray(trigger) ? trigger : [trigger];
|
|
11797
|
-
const [mounted, setMounted] =
|
|
11798
|
-
const [hasHoverSupport, setHasHoverSupport] =
|
|
11799
|
-
const [prefersReducedMotion, setPrefersReducedMotion] =
|
|
11800
|
-
|
|
13638
|
+
const [mounted, setMounted] = React38.useState(false);
|
|
13639
|
+
const [hasHoverSupport, setHasHoverSupport] = React38.useState(true);
|
|
13640
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = React38.useState(false);
|
|
13641
|
+
React38.useEffect(() => {
|
|
11801
13642
|
setMounted(true);
|
|
11802
13643
|
setHasHoverSupport(!window.matchMedia("(hover: none)").matches);
|
|
11803
13644
|
}, []);
|
|
11804
|
-
|
|
13645
|
+
React38.useEffect(() => {
|
|
11805
13646
|
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
11806
13647
|
setPrefersReducedMotion(mediaQuery.matches);
|
|
11807
13648
|
const onChange = (e) => setPrefersReducedMotion(e.matches);
|
|
@@ -11873,7 +13714,7 @@ function TooltipBox({
|
|
|
11873
13714
|
hideDelay
|
|
11874
13715
|
);
|
|
11875
13716
|
};
|
|
11876
|
-
|
|
13717
|
+
React38.useEffect(() => {
|
|
11877
13718
|
if (!state.isVisible) return;
|
|
11878
13719
|
const onKeyDown = (e) => {
|
|
11879
13720
|
var _a;
|
|
@@ -11885,8 +13726,8 @@ function TooltipBox({
|
|
|
11885
13726
|
document.addEventListener("keydown", onKeyDown);
|
|
11886
13727
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
11887
13728
|
}, [state.isVisible, state]);
|
|
11888
|
-
const tooltipId =
|
|
11889
|
-
const tooltipWithProps =
|
|
13729
|
+
const tooltipId = React38.useId();
|
|
13730
|
+
const tooltipWithProps = React38.cloneElement(
|
|
11890
13731
|
tooltip,
|
|
11891
13732
|
{
|
|
11892
13733
|
"data-side": position.actualSide,
|
|
@@ -11914,7 +13755,7 @@ function TooltipBox({
|
|
|
11914
13755
|
onKeyDown: handleKeyDown,
|
|
11915
13756
|
"aria-label": ariaLabel,
|
|
11916
13757
|
"aria-describedby": state.isVisible ? tooltipId : void 0,
|
|
11917
|
-
children:
|
|
13758
|
+
children: React38__namespace.isValidElement(children) ? children : /* @__PURE__ */ jsxRuntime.jsx("span", { children })
|
|
11918
13759
|
}
|
|
11919
13760
|
),
|
|
11920
13761
|
mounted && reactDom.createPortal(
|
|
@@ -11958,10 +13799,16 @@ exports.BadgedBox = BadgedBox;
|
|
|
11958
13799
|
exports.BottomAppBar = BottomAppBar;
|
|
11959
13800
|
exports.Button = Button;
|
|
11960
13801
|
exports.ButtonGroup = ButtonGroup;
|
|
13802
|
+
exports.CHECK_ICON_VARIANTS = CHECK_ICON_VARIANTS;
|
|
11961
13803
|
exports.Card = Card;
|
|
11962
13804
|
exports.Checkbox = Checkbox;
|
|
11963
13805
|
exports.Chip = Chip;
|
|
11964
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;
|
|
11965
13812
|
exports.Dialog = Dialog;
|
|
11966
13813
|
exports.DialogBody = DialogBody;
|
|
11967
13814
|
exports.DialogClose = DialogClose;
|
|
@@ -11987,48 +13834,63 @@ exports.DrawerOverlay = DrawerOverlay;
|
|
|
11987
13834
|
exports.DrawerPortal = DrawerPortal;
|
|
11988
13835
|
exports.DrawerTitle = DrawerTitle;
|
|
11989
13836
|
exports.DrawerTrigger = DrawerTrigger;
|
|
11990
|
-
exports.DropdownMenu = DropdownMenu;
|
|
11991
|
-
exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
|
|
11992
|
-
exports.DropdownMenuContent = DropdownMenuContent;
|
|
11993
|
-
exports.DropdownMenuGroup = DropdownMenuGroup;
|
|
11994
|
-
exports.DropdownMenuItem = DropdownMenuItem;
|
|
11995
|
-
exports.DropdownMenuLabel = DropdownMenuLabel;
|
|
11996
|
-
exports.DropdownMenuPortal = DropdownMenuPortal;
|
|
11997
|
-
exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
|
|
11998
|
-
exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
|
|
11999
|
-
exports.DropdownMenuSeparator = DropdownMenuSeparator;
|
|
12000
|
-
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
12001
|
-
exports.DropdownMenuSub = DropdownMenuSub;
|
|
12002
|
-
exports.DropdownMenuSubContent = DropdownMenuSubContent;
|
|
12003
|
-
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
|
|
12004
|
-
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
12005
13837
|
exports.FAB = FAB;
|
|
12006
13838
|
exports.FABMenu = FABMenu;
|
|
12007
13839
|
exports.FABMenuItem = FABMenuItem;
|
|
12008
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;
|
|
12009
13845
|
exports.Icon = Icon;
|
|
12010
13846
|
exports.IconButton = IconButton;
|
|
12011
13847
|
exports.LargeFlexibleAppBar = LargeFlexibleAppBar;
|
|
12012
13848
|
exports.LoadingIndicator = LoadingIndicator;
|
|
12013
13849
|
exports.MD3ThemeProvider = MD3ThemeProvider;
|
|
12014
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;
|
|
12015
13858
|
exports.MaterialSymbolsPreconnect = MaterialSymbolsPreconnect;
|
|
12016
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;
|
|
12017
13867
|
exports.NavigationRail = NavigationRail;
|
|
12018
13868
|
exports.NavigationRailItem = NavigationRailItem;
|
|
12019
13869
|
exports.PlainTooltip = PlainTooltip;
|
|
12020
13870
|
exports.ProgressIndicator = ProgressIndicator;
|
|
12021
13871
|
exports.RadioButton = RadioButton;
|
|
12022
|
-
exports.RadioGroup =
|
|
13872
|
+
exports.RadioGroup = RadioGroup;
|
|
12023
13873
|
exports.RangeSlider = RangeSlider;
|
|
12024
13874
|
exports.RichTooltip = RichTooltip;
|
|
12025
13875
|
exports.Ripple = Ripple;
|
|
13876
|
+
exports.SEARCH_BAR_EXPAND_SPRING = SEARCH_BAR_EXPAND_SPRING;
|
|
13877
|
+
exports.SEARCH_COLORS = SEARCH_COLORS;
|
|
13878
|
+
exports.SEARCH_DOCKED_REVEAL_SPRING = SEARCH_DOCKED_REVEAL_SPRING;
|
|
13879
|
+
exports.SEARCH_FULLSCREEN_SPRING = SEARCH_FULLSCREEN_SPRING;
|
|
13880
|
+
exports.SEARCH_TYPOGRAPHY = SEARCH_TYPOGRAPHY;
|
|
12026
13881
|
exports.SEARCH_VIEW_SPRING = SEARCH_VIEW_SPRING;
|
|
13882
|
+
exports.STANDARD_COLORS = STANDARD_COLORS;
|
|
13883
|
+
exports.SUBMENU_CONTAINER_VARIANTS = SUBMENU_CONTAINER_VARIANTS;
|
|
12027
13884
|
exports.ScrollArea = ScrollArea;
|
|
12028
13885
|
exports.ScrollAreaScrollbar = ScrollAreaScrollbar;
|
|
13886
|
+
exports.Search = Search;
|
|
12029
13887
|
exports.SearchAppBar = SearchAppBar;
|
|
13888
|
+
exports.SearchBar = SearchBar;
|
|
13889
|
+
exports.SearchTokens = SearchTokens;
|
|
12030
13890
|
exports.SearchView = SearchView;
|
|
12031
13891
|
exports.SearchViewContainer = SearchViewContainer;
|
|
13892
|
+
exports.SearchViewDocked = SearchViewDocked;
|
|
13893
|
+
exports.SearchViewFullScreen = SearchViewFullScreen;
|
|
12032
13894
|
exports.Slider = Slider;
|
|
12033
13895
|
exports.SliderColors = SliderColors;
|
|
12034
13896
|
exports.SliderTokens = SliderTokens;
|
|
@@ -12036,6 +13898,7 @@ exports.SmallAppBar = SmallAppBar;
|
|
|
12036
13898
|
exports.Snackbar = Snackbar;
|
|
12037
13899
|
exports.SnackbarHost = SnackbarHost;
|
|
12038
13900
|
exports.SnackbarProvider = SnackbarProvider;
|
|
13901
|
+
exports.SubMenu = SubMenu;
|
|
12039
13902
|
exports.Switch = Switch;
|
|
12040
13903
|
exports.SwitchColors = SwitchColors;
|
|
12041
13904
|
exports.SwitchTokens = SwitchTokens;
|
|
@@ -12046,6 +13909,7 @@ exports.TabsColors = TabsColors;
|
|
|
12046
13909
|
exports.TabsContent = TabsContent;
|
|
12047
13910
|
exports.TabsList = TabsList;
|
|
12048
13911
|
exports.TabsTokens = TabsTokens;
|
|
13912
|
+
exports.Text = Text;
|
|
12049
13913
|
exports.TextField = TextField;
|
|
12050
13914
|
exports.ToggleFAB = ToggleFAB;
|
|
12051
13915
|
exports.TooltipBox = TooltipBox;
|
|
@@ -12058,6 +13922,11 @@ exports.TypographyContext = TypographyContext;
|
|
|
12058
13922
|
exports.TypographyKeyTokens = TypographyKeyTokens;
|
|
12059
13923
|
exports.TypographyProvider = TypographyProvider;
|
|
12060
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;
|
|
12061
13930
|
exports.appBarTypography = appBarTypography;
|
|
12062
13931
|
exports.applyTheme = applyTheme;
|
|
12063
13932
|
exports.buildWavePath = buildWavePath;
|
|
@@ -12066,8 +13935,10 @@ exports.generateM3Theme = generateM3Theme;
|
|
|
12066
13935
|
exports.useAppBarScroll = useAppBarScroll;
|
|
12067
13936
|
exports.useDOMRipple = useRipple;
|
|
12068
13937
|
exports.useMediaQuery = useMediaQuery;
|
|
13938
|
+
exports.useMenuContext = useMenuContext;
|
|
12069
13939
|
exports.useRipple = useRipple2;
|
|
12070
13940
|
exports.useRippleState = useRippleState;
|
|
13941
|
+
exports.useSearchKeyboard = useSearchKeyboard;
|
|
12071
13942
|
exports.useSnackbar = useSnackbar;
|
|
12072
13943
|
exports.useSnackbarState = useSnackbarState;
|
|
12073
13944
|
exports.useTheme = useTheme;
|