@bug-on/md3-react 2.0.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +33 -0
- package/CHANGELOG.md +55 -0
- package/dist/index.css.d.ts +2 -0
- package/dist/index.d.mts +6127 -0
- package/dist/index.d.ts +6127 -71
- package/dist/index.js +1653 -614
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1566 -547
- package/dist/index.mjs.map +1 -1
- package/dist/material-symbols-cdn.css.d.ts +2 -0
- package/dist/material-symbols-self-hosted.css.d.ts +2 -0
- package/dist/typography.css.d.ts +2 -0
- package/package.json +22 -19
- package/scripts/copy-assets.js +82 -0
- package/src/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
- package/src/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
- package/src/assets/loading-indicator.svg +19 -0
- package/src/assets/material-symbols-cdn.css +65 -0
- package/src/assets/material-symbols-self-hosted.css +90 -0
- package/src/css.d.ts +20 -0
- package/src/hooks/useClickOutside.ts +37 -0
- package/src/hooks/useMediaQuery.ts +28 -0
- package/src/hooks/useRipple.ts +88 -0
- package/src/index.css +23 -0
- package/src/index.ts +349 -0
- package/src/lib/material-symbols-preconnect.tsx +82 -0
- package/src/lib/theme-utils.ts +180 -0
- package/src/lib/utils.ts +6 -0
- package/src/test/button.test.tsx +59 -0
- package/src/test/icon.test.tsx +91 -0
- package/src/test/loading-indicator.test.tsx +128 -0
- package/src/test/progress-indicator.test.tsx +306 -0
- package/src/test/setup.ts +80 -0
- package/src/test/typography.test.tsx +206 -0
- package/src/types/index.ts +7 -0
- package/src/types/md3.ts +31 -0
- package/src/ui/Text.tsx +60 -0
- package/src/ui/__snapshots__/divider.test.tsx.snap +63 -0
- package/src/ui/app-bar/app-bar-column.tsx +99 -0
- package/src/ui/app-bar/app-bar-item-button.tsx +71 -0
- package/src/ui/app-bar/app-bar-items.test.tsx +89 -0
- package/src/ui/app-bar/app-bar-overflow-indicator.tsx +108 -0
- package/src/ui/app-bar/app-bar-row.tsx +104 -0
- package/src/ui/app-bar/app-bar.test.tsx +87 -0
- package/src/ui/app-bar/app-bar.tokens.ts +223 -0
- package/src/ui/app-bar/app-bar.types.ts +441 -0
- package/src/ui/app-bar/bottom-app-bar.test.tsx +42 -0
- package/src/ui/app-bar/bottom-app-bar.tsx +84 -0
- package/src/ui/app-bar/docked-toolbar.test.tsx +34 -0
- package/src/ui/app-bar/docked-toolbar.tsx +54 -0
- package/src/ui/app-bar/flexible-app-bar.test.tsx +75 -0
- package/src/ui/app-bar/hooks/use-app-bar-scroll.ts +110 -0
- package/src/ui/app-bar/hooks/use-flexible-app-bar.ts +123 -0
- package/{dist/ui/app-bar/index.d.ts → src/ui/app-bar/index.ts} +35 -2
- package/src/ui/app-bar/large-flexible-app-bar.tsx +165 -0
- package/src/ui/app-bar/medium-flexible-app-bar.tsx +167 -0
- package/src/ui/app-bar/search-app-bar.test.tsx +49 -0
- package/src/ui/app-bar/search-app-bar.tsx +176 -0
- package/src/ui/app-bar/search-view.tsx +227 -0
- package/src/ui/app-bar/small-app-bar.test.tsx +48 -0
- package/src/ui/app-bar/small-app-bar.tsx +203 -0
- package/src/ui/badge.test.tsx +345 -0
- package/src/ui/badge.tsx +282 -0
- package/src/ui/button-group.test.tsx +71 -0
- package/src/ui/button-group.tsx +350 -0
- package/src/ui/button.test.tsx +297 -0
- package/src/ui/button.tsx +669 -0
- package/src/ui/card.test.tsx +187 -0
- package/src/ui/card.tsx +259 -0
- package/src/ui/checkbox.test.tsx +423 -0
- package/src/ui/checkbox.tsx +525 -0
- package/src/ui/chip.test.tsx +292 -0
- package/src/ui/chip.tsx +548 -0
- package/src/ui/code-block.tsx +219 -0
- package/src/ui/dialog.test.tsx +300 -0
- package/src/ui/dialog.tsx +384 -0
- package/src/ui/divider.test.tsx +314 -0
- package/src/ui/divider.tsx +412 -0
- package/src/ui/drawer.tsx +240 -0
- package/src/ui/fab-menu.test.tsx +494 -0
- package/src/ui/fab-menu.tsx +739 -0
- package/src/ui/fab.test.tsx +232 -0
- package/src/ui/fab.tsx +505 -0
- package/src/ui/icon-button.test.tsx +515 -0
- package/src/ui/icon-button.tsx +525 -0
- package/src/ui/icon.test.tsx +197 -0
- package/src/ui/icon.tsx +179 -0
- package/src/ui/loading-indicator.test.tsx +73 -0
- package/src/ui/loading-indicator.tsx +312 -0
- package/src/ui/menu/context-menu.tsx +275 -0
- package/src/ui/menu/index.ts +77 -0
- package/src/ui/menu/menu-animations.ts +102 -0
- package/src/ui/menu/menu-context.tsx +99 -0
- package/src/ui/menu/menu-divider.tsx +47 -0
- package/src/ui/menu/menu-group.tsx +200 -0
- package/src/ui/menu/menu-item.tsx +294 -0
- package/src/ui/menu/menu-tokens.ts +208 -0
- package/src/ui/menu/menu-types.ts +313 -0
- package/src/ui/menu/menu.test.tsx +624 -0
- package/src/ui/menu/menu.tsx +289 -0
- package/src/ui/menu/sub-menu.tsx +223 -0
- package/src/ui/menu/vertical-menu.tsx +382 -0
- package/src/ui/navigation-rail.test.tsx +404 -0
- package/src/ui/navigation-rail.tsx +604 -0
- package/src/ui/progress-indicator/circular.tsx +248 -0
- package/src/ui/progress-indicator/hooks.ts +51 -0
- package/{dist/ui/progress-indicator/index.d.ts → src/ui/progress-indicator/index.tsx} +20 -2
- package/src/ui/progress-indicator/linear-flat.tsx +83 -0
- package/src/ui/progress-indicator/linear-wavy.tsx +243 -0
- package/src/ui/progress-indicator/linear.tsx +143 -0
- package/src/ui/progress-indicator/types.ts +158 -0
- package/src/ui/progress-indicator/utils.ts +73 -0
- package/src/ui/radio-button.test.tsx +407 -0
- package/src/ui/radio-button.tsx +551 -0
- package/src/ui/ripple.test.tsx +72 -0
- package/src/ui/ripple.tsx +234 -0
- package/src/ui/scroll-area.test.tsx +58 -0
- package/src/ui/scroll-area.tsx +139 -0
- package/src/ui/search/animated-placeholder.tsx +145 -0
- package/src/ui/search/hooks/use-search-keyboard.test.ts +202 -0
- package/src/ui/search/hooks/use-search-keyboard.ts +104 -0
- package/src/ui/search/hooks/use-search-view-focus.test.ts +96 -0
- package/src/ui/search/hooks/use-search-view-focus.ts +24 -0
- package/src/ui/search/index.ts +44 -0
- package/src/ui/search/search-bar.tsx +220 -0
- package/src/ui/search/search-context.tsx +42 -0
- package/src/ui/search/search-view-docked.tsx +194 -0
- package/src/ui/search/search-view-fullscreen.tsx +247 -0
- package/src/ui/search/search.test.tsx +233 -0
- package/src/ui/search/search.tokens.ts +134 -0
- package/src/ui/search/search.tsx +131 -0
- package/src/ui/search/search.types.ts +154 -0
- package/src/ui/search/trailing-action.tsx +49 -0
- package/src/ui/shared/constants.ts +122 -0
- package/{dist/ui/shared/touch-target.d.ts → src/ui/shared/touch-target.tsx} +13 -1
- package/src/ui/slider/hooks/useSliderMath.ts +195 -0
- package/{dist/ui/slider/index.d.ts → src/ui/slider/index.ts} +12 -1
- package/src/ui/slider/range-slider.tsx +561 -0
- package/src/ui/slider/slider-thumb.tsx +379 -0
- package/src/ui/slider/slider-track.tsx +912 -0
- package/src/ui/slider/slider.tokens.ts +189 -0
- package/src/ui/slider/slider.tsx +259 -0
- package/src/ui/slider/slider.types.ts +288 -0
- package/src/ui/snackbar/index.ts +20 -0
- package/src/ui/snackbar/snackbar.test.tsx +338 -0
- package/src/ui/snackbar/snackbar.tsx +476 -0
- package/{dist/ui/switch/index.d.ts → src/ui/switch/index.ts} +1 -0
- package/src/ui/switch/switch.stories.tsx +309 -0
- package/src/ui/switch/switch.test.tsx +243 -0
- package/src/ui/switch/switch.tokens.ts +89 -0
- package/src/ui/switch/switch.tsx +504 -0
- package/src/ui/switch/switch.types.ts +62 -0
- package/{dist/ui/tabs/index.d.ts → src/ui/tabs/index.ts} +8 -1
- package/src/ui/tabs/tab.tsx +407 -0
- package/src/ui/tabs/tabs-content.tsx +89 -0
- package/src/ui/tabs/tabs-list.tsx +146 -0
- package/src/ui/tabs/tabs.test.tsx +290 -0
- package/src/ui/tabs/tabs.tokens.ts +121 -0
- package/src/ui/tabs/tabs.tsx +229 -0
- package/src/ui/tabs/tabs.types.ts +185 -0
- package/{dist/ui/text-field/index.d.ts → src/ui/text-field/index.ts} +8 -1
- package/src/ui/text-field/subcomponents/active-indicator.tsx +67 -0
- package/src/ui/text-field/subcomponents/floating-label.tsx +161 -0
- package/src/ui/text-field/subcomponents/leading-icon.tsx +46 -0
- package/src/ui/text-field/subcomponents/outline-container.tsx +170 -0
- package/src/ui/text-field/subcomponents/prefix-suffix.tsx +59 -0
- package/src/ui/text-field/subcomponents/supporting-text.tsx +145 -0
- package/src/ui/text-field/subcomponents/trailing-icon.tsx +199 -0
- package/src/ui/text-field/text-field.test.tsx +454 -0
- package/src/ui/text-field/text-field.tokens.ts +104 -0
- package/src/ui/text-field/text-field.tsx +548 -0
- package/src/ui/text-field/text-field.types.ts +180 -0
- package/src/ui/theme-provider/index.tsx +190 -0
- package/src/ui/toc.test.tsx +108 -0
- package/src/ui/toc.tsx +172 -0
- package/src/ui/tooltip/plain-tooltip.tsx +63 -0
- package/src/ui/tooltip/rich-tooltip.tsx +94 -0
- package/src/ui/tooltip/tooltip-box.tsx +266 -0
- package/src/ui/tooltip/tooltip-caret-shape.tsx +68 -0
- package/src/ui/tooltip/tooltip.tokens.ts +26 -0
- package/src/ui/tooltip/tooltip.types.ts +70 -0
- package/src/ui/tooltip/use-tooltip-position.ts +208 -0
- package/src/ui/tooltip/use-tooltip-state.ts +41 -0
- package/src/ui/typography/__tests__/typography.test.tsx +170 -0
- package/{dist/ui/typography/index.d.ts → src/ui/typography/index.ts} +21 -3
- package/src/ui/typography/type-scale-tokens.ts +205 -0
- package/src/ui/typography/typography-key-tokens.ts +43 -0
- package/src/ui/typography/typography-tokens.ts +360 -0
- package/src/ui/typography/typography.css +22 -0
- package/src/ui/typography/typography.tsx +559 -0
- package/test-render.tsx +4 -0
- package/test-shadow.html +26 -0
- package/test_output.txt +164 -0
- package/test_output_v2.txt +5 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +18 -0
- package/tsup.config.ts +20 -0
- package/vitest.config.ts +11 -0
- package/dist/hooks/useClickOutside.d.ts +0 -8
- package/dist/hooks/useMediaQuery.d.ts +0 -11
- package/dist/hooks/useRipple.d.ts +0 -26
- package/dist/lib/material-symbols-preconnect.d.ts +0 -42
- package/dist/lib/theme-utils.d.ts +0 -63
- package/dist/lib/utils.d.ts +0 -2
- package/dist/types/index.d.ts +0 -1
- package/dist/types/md3.d.ts +0 -14
- package/dist/ui/app-bar/app-bar-column.d.ts +0 -28
- package/dist/ui/app-bar/app-bar-item-button.d.ts +0 -16
- package/dist/ui/app-bar/app-bar-overflow-indicator.d.ts +0 -18
- package/dist/ui/app-bar/app-bar-row.d.ts +0 -36
- package/dist/ui/app-bar/app-bar.tokens.d.ts +0 -184
- package/dist/ui/app-bar/app-bar.types.d.ts +0 -392
- package/dist/ui/app-bar/bottom-app-bar.d.ts +0 -31
- package/dist/ui/app-bar/docked-toolbar.d.ts +0 -25
- package/dist/ui/app-bar/hooks/use-app-bar-scroll.d.ts +0 -42
- package/dist/ui/app-bar/hooks/use-flexible-app-bar.d.ts +0 -37
- package/dist/ui/app-bar/large-flexible-app-bar.d.ts +0 -26
- package/dist/ui/app-bar/medium-flexible-app-bar.d.ts +0 -28
- package/dist/ui/app-bar/search-app-bar.d.ts +0 -43
- package/dist/ui/app-bar/search-view.d.ts +0 -54
- package/dist/ui/app-bar/small-app-bar.d.ts +0 -37
- package/dist/ui/badge.d.ts +0 -125
- package/dist/ui/button-group.d.ts +0 -59
- package/dist/ui/button.d.ts +0 -148
- package/dist/ui/card.d.ts +0 -62
- package/dist/ui/checkbox.d.ts +0 -82
- package/dist/ui/chip.d.ts +0 -110
- package/dist/ui/code-block.d.ts +0 -14
- package/dist/ui/dialog.d.ts +0 -111
- package/dist/ui/divider.d.ts +0 -164
- package/dist/ui/drawer.d.ts +0 -39
- package/dist/ui/dropdown.d.ts +0 -29
- package/dist/ui/fab-menu.d.ts +0 -204
- package/dist/ui/fab.d.ts +0 -162
- package/dist/ui/icon-button.d.ts +0 -131
- package/dist/ui/icon.d.ts +0 -88
- package/dist/ui/loading-indicator.d.ts +0 -42
- package/dist/ui/navigation-rail.d.ts +0 -29
- package/dist/ui/progress-indicator/circular.d.ts +0 -3
- package/dist/ui/progress-indicator/hooks.d.ts +0 -3
- package/dist/ui/progress-indicator/linear-flat.d.ts +0 -10
- package/dist/ui/progress-indicator/linear-wavy.d.ts +0 -18
- package/dist/ui/progress-indicator/linear.d.ts +0 -3
- package/dist/ui/progress-indicator/types.d.ts +0 -151
- package/dist/ui/progress-indicator/utils.d.ts +0 -3
- package/dist/ui/radio-button.d.ts +0 -106
- package/dist/ui/ripple.d.ts +0 -126
- package/dist/ui/scroll-area.d.ts +0 -27
- package/dist/ui/search/animated-placeholder.d.ts +0 -54
- package/dist/ui/search/hooks/use-search-keyboard.d.ts +0 -32
- package/dist/ui/search/hooks/use-search-view-focus.d.ts +0 -6
- package/dist/ui/search/index.d.ts +0 -27
- package/dist/ui/search/search-bar.d.ts +0 -32
- package/dist/ui/search/search-context.d.ts +0 -24
- package/dist/ui/search/search-view-docked.d.ts +0 -25
- package/dist/ui/search/search-view-fullscreen.d.ts +0 -36
- package/dist/ui/search/search.d.ts +0 -50
- package/dist/ui/search/search.tokens.d.ts +0 -112
- package/dist/ui/search/search.types.d.ts +0 -131
- package/dist/ui/search/trailing-action.d.ts +0 -9
- package/dist/ui/shared/constants.d.ts +0 -86
- package/dist/ui/slider/hooks/useSliderMath.d.ts +0 -101
- package/dist/ui/slider/range-slider.d.ts +0 -47
- package/dist/ui/slider/slider-thumb.d.ts +0 -33
- package/dist/ui/slider/slider-track.d.ts +0 -25
- package/dist/ui/slider/slider.d.ts +0 -60
- package/dist/ui/slider/slider.tokens.d.ts +0 -151
- package/dist/ui/slider/slider.types.d.ts +0 -259
- package/dist/ui/snackbar/index.d.ts +0 -6
- package/dist/ui/snackbar/snackbar.d.ts +0 -197
- package/dist/ui/switch/switch.d.ts +0 -30
- package/dist/ui/switch/switch.stories.d.ts +0 -48
- package/dist/ui/switch/switch.tokens.d.ts +0 -67
- package/dist/ui/switch/switch.types.d.ts +0 -59
- package/dist/ui/tabs/tab.d.ts +0 -43
- package/dist/ui/tabs/tabs-content.d.ts +0 -36
- package/dist/ui/tabs/tabs-list.d.ts +0 -40
- package/dist/ui/tabs/tabs.d.ts +0 -60
- package/dist/ui/tabs/tabs.tokens.d.ts +0 -94
- package/dist/ui/tabs/tabs.types.d.ts +0 -172
- package/dist/ui/text-field/subcomponents/active-indicator.d.ts +0 -24
- package/dist/ui/text-field/subcomponents/floating-label.d.ts +0 -43
- package/dist/ui/text-field/subcomponents/leading-icon.d.ts +0 -23
- package/dist/ui/text-field/subcomponents/outline-container.d.ts +0 -42
- package/dist/ui/text-field/subcomponents/prefix-suffix.d.ts +0 -24
- package/dist/ui/text-field/subcomponents/supporting-text.d.ts +0 -37
- package/dist/ui/text-field/subcomponents/trailing-icon.d.ts +0 -41
- package/dist/ui/text-field/text-field.d.ts +0 -49
- package/dist/ui/text-field/text-field.tokens.d.ts +0 -76
- package/dist/ui/text-field/text-field.types.d.ts +0 -126
- package/dist/ui/theme-provider/index.d.ts +0 -48
- package/dist/ui/toc.d.ts +0 -80
- package/dist/ui/tooltip/plain-tooltip.d.ts +0 -2
- package/dist/ui/tooltip/rich-tooltip.d.ts +0 -2
- package/dist/ui/tooltip/tooltip-box.d.ts +0 -2
- package/dist/ui/tooltip/tooltip-caret-shape.d.ts +0 -9
- package/dist/ui/tooltip/tooltip.tokens.d.ts +0 -26
- package/dist/ui/tooltip/tooltip.types.d.ts +0 -56
- package/dist/ui/tooltip/use-tooltip-position.d.ts +0 -8
- package/dist/ui/tooltip/use-tooltip-state.d.ts +0 -2
- package/dist/ui/typography/type-scale-tokens.d.ts +0 -162
- package/dist/ui/typography/typography-key-tokens.d.ts +0 -40
- package/dist/ui/typography/typography-tokens.d.ts +0 -220
- package/dist/ui/typography/typography.d.ts +0 -265
- /package/{dist/hooks/index.d.ts → src/hooks/index.ts} +0 -0
- /package/{dist/ui/tooltip/index.d.ts → src/ui/tooltip/index.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React38 from 'react';
|
|
3
3
|
import { createContext, forwardRef, useMemo, useRef, useEffect, useState, useCallback, useContext, useId, cloneElement, useLayoutEffect, createElement } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { argbFromHex, themeFromSourceColor, hexFromArgb } from '@material/material-color-utilities';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
8
|
+
import * as RxContextMenu from '@radix-ui/react-context-menu';
|
|
9
|
+
import { AnimatePresence, m, LazyMotion, domMax, useReducedMotion, useMotionValue, animate, useAnimationFrame, useSpring, useTransform, LayoutGroup } from 'motion/react';
|
|
10
|
+
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
10
11
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
12
|
import { cva } from 'class-variance-authority';
|
|
12
13
|
import * as RadixScrollArea from '@radix-ui/react-scroll-area';
|
|
@@ -212,7 +213,7 @@ function generateM3Theme(sourceColorHex, mode = "light") {
|
|
|
212
213
|
function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
|
|
213
214
|
const colors = generateM3Theme(sourceColorHex, mode);
|
|
214
215
|
for (const [key, value] of Object.entries(colors)) {
|
|
215
|
-
const kebabKey = key.replace(/[A-Z]/g, (
|
|
216
|
+
const kebabKey = key.replace(/[A-Z]/g, (m47) => `-${m47.toLowerCase()}`);
|
|
216
217
|
root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
|
|
217
218
|
root.style.setProperty(`--color-m3-${kebabKey}`, value);
|
|
218
219
|
}
|
|
@@ -409,6 +410,671 @@ function AppBarItemButton({ item }) {
|
|
|
409
410
|
);
|
|
410
411
|
}
|
|
411
412
|
|
|
413
|
+
// src/ui/menu/menu-animations.ts
|
|
414
|
+
var FAST_SPATIAL_SPRING = {
|
|
415
|
+
type: "spring",
|
|
416
|
+
stiffness: 380,
|
|
417
|
+
damping: 28,
|
|
418
|
+
mass: 1
|
|
419
|
+
};
|
|
420
|
+
var FAST_EFFECTS_TRANSITION = {
|
|
421
|
+
duration: 0.15,
|
|
422
|
+
ease: [0.4, 0, 1, 1]
|
|
423
|
+
// FastOutLinearIn
|
|
424
|
+
};
|
|
425
|
+
var MENU_CONTAINER_VARIANTS = {
|
|
426
|
+
hidden: {
|
|
427
|
+
opacity: 0,
|
|
428
|
+
scale: 0.8
|
|
429
|
+
},
|
|
430
|
+
visible: {
|
|
431
|
+
opacity: 1,
|
|
432
|
+
scale: 1,
|
|
433
|
+
transition: FAST_SPATIAL_SPRING
|
|
434
|
+
},
|
|
435
|
+
exit: {
|
|
436
|
+
opacity: 0,
|
|
437
|
+
scale: 0.8,
|
|
438
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
var MENU_CHECK_ICON_SIZE = 20;
|
|
442
|
+
var CHECK_ICON_VARIANTS = {
|
|
443
|
+
hidden: {
|
|
444
|
+
opacity: 0,
|
|
445
|
+
width: 0
|
|
446
|
+
},
|
|
447
|
+
visible: {
|
|
448
|
+
opacity: 1,
|
|
449
|
+
width: MENU_CHECK_ICON_SIZE,
|
|
450
|
+
transition: FAST_SPATIAL_SPRING
|
|
451
|
+
},
|
|
452
|
+
exit: {
|
|
453
|
+
opacity: 0,
|
|
454
|
+
width: 0,
|
|
455
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var SUBMENU_CONTAINER_VARIANTS = {
|
|
459
|
+
hidden: {
|
|
460
|
+
opacity: 0,
|
|
461
|
+
scale: 0.9,
|
|
462
|
+
x: -4
|
|
463
|
+
},
|
|
464
|
+
visible: {
|
|
465
|
+
opacity: 1,
|
|
466
|
+
scale: 1,
|
|
467
|
+
x: 0,
|
|
468
|
+
transition: FAST_SPATIAL_SPRING
|
|
469
|
+
},
|
|
470
|
+
exit: {
|
|
471
|
+
opacity: 0,
|
|
472
|
+
scale: 0.9,
|
|
473
|
+
x: -4,
|
|
474
|
+
transition: FAST_EFFECTS_TRANSITION
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
var MenuContext = React38.createContext({
|
|
478
|
+
variant: "baseline",
|
|
479
|
+
colorVariant: "standard",
|
|
480
|
+
menuPrimitive: "dropdown",
|
|
481
|
+
open: false,
|
|
482
|
+
onOpenChange: () => {
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
function MenuProvider({
|
|
486
|
+
variant = "baseline",
|
|
487
|
+
colorVariant = "standard",
|
|
488
|
+
menuPrimitive = "dropdown",
|
|
489
|
+
open,
|
|
490
|
+
onOpenChange,
|
|
491
|
+
children
|
|
492
|
+
}) {
|
|
493
|
+
const value = React38.useMemo(
|
|
494
|
+
() => ({ variant, colorVariant, menuPrimitive, open, onOpenChange }),
|
|
495
|
+
[variant, colorVariant, menuPrimitive, open, onOpenChange]
|
|
496
|
+
);
|
|
497
|
+
return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children });
|
|
498
|
+
}
|
|
499
|
+
function useMenuContext() {
|
|
500
|
+
const ctx = React38.useContext(MenuContext);
|
|
501
|
+
return React38.useMemo(
|
|
502
|
+
() => __spreadProps(__spreadValues({}, ctx), {
|
|
503
|
+
isStatic: ctx.menuPrimitive === "static",
|
|
504
|
+
menuVariant: ctx.variant
|
|
505
|
+
}),
|
|
506
|
+
[ctx]
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// src/ui/menu/menu-tokens.ts
|
|
511
|
+
var MENU_BASELINE_ITEM_HORIZONTAL_PADDING = "px-3";
|
|
512
|
+
var MENU_ITEM_MIN_HEIGHT = "min-h-11";
|
|
513
|
+
var MENU_MIN_WIDTH = "min-w-28";
|
|
514
|
+
var MENU_MAX_WIDTH = "max-w-70";
|
|
515
|
+
var MENU_GROUP_GAP = "gap-0.5";
|
|
516
|
+
var MENU_GROUP_PADDING_Y = "py-1";
|
|
517
|
+
var MENU_POPUP_PADDING_Y = "py-2";
|
|
518
|
+
var MENU_ICON_SIZE = 20;
|
|
519
|
+
var MENU_CONTAINER_SHAPE = "rounded-[4px]";
|
|
520
|
+
var BASELINE_ITEM_SHAPE = "rounded-none";
|
|
521
|
+
var GROUP_SHAPES = {
|
|
522
|
+
/** Active standalone group shape: CornerLarge all corners (16px) */
|
|
523
|
+
standaloneActive: "16px",
|
|
524
|
+
/**
|
|
525
|
+
* Active leading group shape: top=CornerLarge(16px), bottom=CornerSmall(8px)
|
|
526
|
+
* Source: SegmentedMenuTokens — LeadingContainerShape:
|
|
527
|
+
* topStart=CornerLarge, topEnd=CornerLarge, bottomStart=CornerSmall, bottomEnd=CornerSmall
|
|
528
|
+
*/
|
|
529
|
+
leadingActive: "16px 16px 8px 8px",
|
|
530
|
+
/** Active middle group shape: CornerExtraSmall all corners (4px) */
|
|
531
|
+
middleActive: "4px",
|
|
532
|
+
/**
|
|
533
|
+
* Active trailing group shape: top=CornerSmall(8px), bottom=CornerLarge(16px)
|
|
534
|
+
* Source: SegmentedMenuTokens — TrailingContainerShape:
|
|
535
|
+
* topStart=CornerSmall, topEnd=CornerSmall, bottomStart=CornerLarge, bottomEnd=CornerLarge
|
|
536
|
+
*/
|
|
537
|
+
trailingActive: "8px 8px 16px 16px",
|
|
538
|
+
/** Inactive (default, pre-hover) shape for all groups: CornerExtraSmall (4px) */
|
|
539
|
+
inactive: "4px"
|
|
540
|
+
};
|
|
541
|
+
var ITEM_SHAPE_CLASSES = {
|
|
542
|
+
leading: "rounded-t-[12px] rounded-b-[4px]",
|
|
543
|
+
middle: "rounded-[4px]",
|
|
544
|
+
trailing: "rounded-t-[4px] rounded-b-[12px]",
|
|
545
|
+
standalone: "rounded-[4px]",
|
|
546
|
+
selected: "rounded-[12px]"
|
|
547
|
+
};
|
|
548
|
+
var STANDARD_COLORS = {
|
|
549
|
+
/** Group/popup container background (StandardMenuTokens.ContainerColor) */
|
|
550
|
+
containerBg: "bg-m3-surface-container-low",
|
|
551
|
+
/** Label text color (StandardMenuTokens.ItemLabelTextColor) */
|
|
552
|
+
labelText: "text-m3-on-surface",
|
|
553
|
+
/** Leading/trailing icon color (StandardMenuTokens.ItemLeadingIconColor) */
|
|
554
|
+
iconColor: "text-m3-on-surface-variant",
|
|
555
|
+
/** Supporting text below label (StandardMenuTokens.ItemSupportingTextColor) */
|
|
556
|
+
supportingTextColor: "text-m3-on-surface-variant",
|
|
557
|
+
/** Trailing supporting text (StandardMenuTokens.ItemTrailingSupportingTextColor) */
|
|
558
|
+
trailingSupportingTextColor: "text-m3-on-surface-variant",
|
|
559
|
+
/** Trailing icon color (StandardMenuTokens.ItemTrailingIconColor) */
|
|
560
|
+
trailingIconColor: "text-m3-on-surface-variant",
|
|
561
|
+
/** Hover state layer (OnSurface @ 8% opacity) */
|
|
562
|
+
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
563
|
+
/** Focus state layer (OnSurface @ 12% opacity) */
|
|
564
|
+
focusLayer: "focus:bg-m3-on-surface/12",
|
|
565
|
+
/** Selected item background (StandardMenuTokens.ItemSelectedContainerColor) */
|
|
566
|
+
selectedBg: "bg-m3-tertiary-container",
|
|
567
|
+
/** Selected item text (StandardMenuTokens.ItemSelectedLabelTextColor) */
|
|
568
|
+
selectedText: "text-m3-on-tertiary-container",
|
|
569
|
+
/** Selected item icon (StandardMenuTokens.ItemSelectedLeadingIconColor) */
|
|
570
|
+
selectedIcon: "text-m3-on-tertiary-container",
|
|
571
|
+
/** Disabled opacity: 38% (StandardMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
572
|
+
disabledOpacity: "data-disabled:opacity-[0.38]"
|
|
573
|
+
};
|
|
574
|
+
var BASELINE_COLORS = {
|
|
575
|
+
containerBg: "bg-m3-surface-container",
|
|
576
|
+
labelText: "text-m3-on-surface",
|
|
577
|
+
iconColor: "text-m3-on-surface-variant",
|
|
578
|
+
supportingTextColor: "text-m3-on-surface-variant",
|
|
579
|
+
trailingIconColor: "text-m3-on-surface-variant",
|
|
580
|
+
hoverLayer: "hover:bg-m3-on-surface/8",
|
|
581
|
+
focusLayer: "focus:bg-m3-on-surface/12",
|
|
582
|
+
selectedBg: "bg-m3-secondary-container",
|
|
583
|
+
selectedText: "text-m3-on-secondary-container",
|
|
584
|
+
selectedIcon: "text-m3-on-secondary-container"};
|
|
585
|
+
var VIBRANT_COLORS = {
|
|
586
|
+
/** Group/popup container background (VibrantMenuTokens.ContainerColor) */
|
|
587
|
+
containerBg: "bg-m3-tertiary-container",
|
|
588
|
+
/** Label text color (VibrantMenuTokens.ItemLabelTextColor) */
|
|
589
|
+
labelText: "text-m3-on-tertiary-container",
|
|
590
|
+
/** Leading/trailing icon color (VibrantMenuTokens.ItemLeadingIconColor) */
|
|
591
|
+
iconColor: "text-m3-on-tertiary-container",
|
|
592
|
+
/** Supporting text below label (VibrantMenuTokens.ItemSupportingTextColor) */
|
|
593
|
+
supportingTextColor: "text-m3-on-tertiary-container",
|
|
594
|
+
/** Trailing supporting text (VibrantMenuTokens.ItemTrailingSupportingTextColor) */
|
|
595
|
+
trailingSupportingTextColor: "text-m3-on-tertiary-container",
|
|
596
|
+
/** Trailing icon color (VibrantMenuTokens.ItemTrailingIconColor) */
|
|
597
|
+
trailingIconColor: "text-m3-on-tertiary-container",
|
|
598
|
+
/** Hover state layer (OnTertiaryContainer @ 8% opacity) */
|
|
599
|
+
hoverLayer: "hover:bg-m3-on-tertiary-container/8",
|
|
600
|
+
/** Focus state layer (OnTertiaryContainer @ 12% opacity) */
|
|
601
|
+
focusLayer: "focus:bg-m3-on-tertiary-container/12",
|
|
602
|
+
/** Selected item background (VibrantMenuTokens.ItemSelectedContainerColor = Tertiary) */
|
|
603
|
+
selectedBg: "bg-m3-tertiary",
|
|
604
|
+
/** Selected item text (VibrantMenuTokens.ItemSelectedLabelTextColor = OnTertiary) */
|
|
605
|
+
selectedText: "text-m3-on-tertiary",
|
|
606
|
+
/** Selected item icon (VibrantMenuTokens.ItemSelectedLeadingIconColor = OnTertiary) */
|
|
607
|
+
selectedIcon: "text-m3-on-tertiary",
|
|
608
|
+
/** Disabled opacity: 38% (VibrantMenuTokens.ItemDisabledLabelTextOpacity) */
|
|
609
|
+
disabledOpacity: "data-disabled:opacity-[0.38]"
|
|
610
|
+
};
|
|
611
|
+
var DIVIDER_PADDING = "mx-3 my-0.5";
|
|
612
|
+
var DIVIDER_COLOR = "bg-m3-outline-variant";
|
|
613
|
+
function ContextMenu({
|
|
614
|
+
children,
|
|
615
|
+
variant = "baseline",
|
|
616
|
+
colorVariant = "standard"
|
|
617
|
+
}) {
|
|
618
|
+
const [open, setOpen] = React38.useState(false);
|
|
619
|
+
return /* @__PURE__ */ jsx(
|
|
620
|
+
MenuProvider,
|
|
621
|
+
{
|
|
622
|
+
variant,
|
|
623
|
+
colorVariant,
|
|
624
|
+
menuPrimitive: "context",
|
|
625
|
+
open,
|
|
626
|
+
onOpenChange: setOpen,
|
|
627
|
+
children: /* @__PURE__ */ jsx(RxContextMenu.Root, { onOpenChange: setOpen, children })
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
ContextMenu.displayName = "ContextMenu";
|
|
632
|
+
var ContextMenuTrigger = React38.forwardRef((_a, ref) => {
|
|
633
|
+
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
634
|
+
return /* @__PURE__ */ jsx(RxContextMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
635
|
+
});
|
|
636
|
+
ContextMenuTrigger.displayName = "ContextMenuTrigger";
|
|
637
|
+
var ContextMenuContent = React38.forwardRef(
|
|
638
|
+
(_a, ref) => {
|
|
639
|
+
var _b = _a, {
|
|
640
|
+
children,
|
|
641
|
+
hasOverflow = false,
|
|
642
|
+
colorVariant: propColorVariant,
|
|
643
|
+
separatorStyle = "gap",
|
|
644
|
+
className
|
|
645
|
+
} = _b, props = __objRest(_b, [
|
|
646
|
+
"children",
|
|
647
|
+
"hasOverflow",
|
|
648
|
+
"colorVariant",
|
|
649
|
+
"separatorStyle",
|
|
650
|
+
"className"
|
|
651
|
+
]);
|
|
652
|
+
const {
|
|
653
|
+
open,
|
|
654
|
+
variant,
|
|
655
|
+
colorVariant: contextColorVariant
|
|
656
|
+
} = useMenuContext();
|
|
657
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
658
|
+
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
659
|
+
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
660
|
+
const containerClassName = variant === "expressive" ? cn(
|
|
661
|
+
"z-50 flex flex-col w-full",
|
|
662
|
+
MENU_MIN_WIDTH,
|
|
663
|
+
MENU_MAX_WIDTH,
|
|
664
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
665
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
666
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
667
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
668
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
669
|
+
"outline-none",
|
|
670
|
+
className
|
|
671
|
+
) : cn(
|
|
672
|
+
"z-50 flex flex-col",
|
|
673
|
+
MENU_MIN_WIDTH,
|
|
674
|
+
MENU_MAX_WIDTH,
|
|
675
|
+
MENU_POPUP_PADDING_Y,
|
|
676
|
+
MENU_GROUP_GAP,
|
|
677
|
+
colors.containerBg,
|
|
678
|
+
MENU_CONTAINER_SHAPE,
|
|
679
|
+
"elevation-2",
|
|
680
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
681
|
+
"outline-none",
|
|
682
|
+
className
|
|
683
|
+
);
|
|
684
|
+
const flattenChildren = (nodes) => {
|
|
685
|
+
return React38.Children.toArray(nodes).reduce(
|
|
686
|
+
(acc, child) => {
|
|
687
|
+
if (React38.isValidElement(child)) {
|
|
688
|
+
if (child.type === React38.Fragment) {
|
|
689
|
+
return acc.concat(
|
|
690
|
+
flattenChildren(
|
|
691
|
+
child.props.children
|
|
692
|
+
)
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
acc.push(child);
|
|
696
|
+
}
|
|
697
|
+
return acc;
|
|
698
|
+
},
|
|
699
|
+
[]
|
|
700
|
+
);
|
|
701
|
+
};
|
|
702
|
+
let renderedChildren = children;
|
|
703
|
+
if (variant === "expressive") {
|
|
704
|
+
const validChildren = flattenChildren(children);
|
|
705
|
+
const groupCount = validChildren.length;
|
|
706
|
+
const enhancedChildren = validChildren.map(
|
|
707
|
+
(child, i) => React38.cloneElement(
|
|
708
|
+
child,
|
|
709
|
+
{
|
|
710
|
+
index: i,
|
|
711
|
+
count: groupCount,
|
|
712
|
+
isGapVariant: isExpressiveGap
|
|
713
|
+
}
|
|
714
|
+
)
|
|
715
|
+
);
|
|
716
|
+
renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
717
|
+
if (i > 0) {
|
|
718
|
+
acc.push(
|
|
719
|
+
/* @__PURE__ */ jsx(
|
|
720
|
+
"hr",
|
|
721
|
+
{
|
|
722
|
+
className: cn(
|
|
723
|
+
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
724
|
+
)
|
|
725
|
+
},
|
|
726
|
+
`divider-${child.key || i}`
|
|
727
|
+
)
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
acc.push(child);
|
|
731
|
+
return acc;
|
|
732
|
+
}, []) : enhancedChildren;
|
|
733
|
+
}
|
|
734
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(RxContextMenu.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(RxContextMenu.Content, __spreadProps(__spreadValues({ ref, asChild: true, forceMount: true }, props), { children: /* @__PURE__ */ jsx(
|
|
735
|
+
m.div,
|
|
736
|
+
{
|
|
737
|
+
className: containerClassName,
|
|
738
|
+
initial: { opacity: 0, scale: 0.95, y: -4 },
|
|
739
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
740
|
+
exit: { opacity: 0, scale: 0.95, y: -4 },
|
|
741
|
+
transition: FAST_SPATIAL_SPRING,
|
|
742
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
743
|
+
transformOrigin: "var(--radix-context-menu-content-transform-origin)"
|
|
744
|
+
}),
|
|
745
|
+
children: renderedChildren
|
|
746
|
+
}
|
|
747
|
+
) })) }) });
|
|
748
|
+
}
|
|
749
|
+
);
|
|
750
|
+
ContextMenuContent.displayName = "ContextMenuContent";
|
|
751
|
+
function Menu(_a) {
|
|
752
|
+
var _b = _a, {
|
|
753
|
+
children,
|
|
754
|
+
variant,
|
|
755
|
+
menuVariant,
|
|
756
|
+
colorVariant = "standard",
|
|
757
|
+
open: controlledOpen,
|
|
758
|
+
onOpenChange: controlledOnOpenChange,
|
|
759
|
+
defaultOpen
|
|
760
|
+
} = _b, props = __objRest(_b, [
|
|
761
|
+
"children",
|
|
762
|
+
"variant",
|
|
763
|
+
"menuVariant",
|
|
764
|
+
"colorVariant",
|
|
765
|
+
"open",
|
|
766
|
+
"onOpenChange",
|
|
767
|
+
"defaultOpen"
|
|
768
|
+
]);
|
|
769
|
+
var _a2;
|
|
770
|
+
const resolvedVariant = (_a2 = variant != null ? variant : menuVariant) != null ? _a2 : "baseline";
|
|
771
|
+
const [internalOpen, setInternalOpen] = React38.useState(
|
|
772
|
+
() => defaultOpen != null ? defaultOpen : false
|
|
773
|
+
);
|
|
774
|
+
const isControlled = controlledOpen !== void 0;
|
|
775
|
+
const open = isControlled ? controlledOpen : internalOpen;
|
|
776
|
+
const handleOpenChange = React38.useCallback(
|
|
777
|
+
(next) => {
|
|
778
|
+
if (!isControlled) setInternalOpen(next);
|
|
779
|
+
controlledOnOpenChange == null ? void 0 : controlledOnOpenChange(next);
|
|
780
|
+
},
|
|
781
|
+
[isControlled, controlledOnOpenChange]
|
|
782
|
+
);
|
|
783
|
+
return /* @__PURE__ */ jsx(
|
|
784
|
+
MenuProvider,
|
|
785
|
+
{
|
|
786
|
+
variant: resolvedVariant,
|
|
787
|
+
colorVariant,
|
|
788
|
+
open,
|
|
789
|
+
onOpenChange: handleOpenChange,
|
|
790
|
+
children: /* @__PURE__ */ jsx(
|
|
791
|
+
DropdownMenu.Root,
|
|
792
|
+
__spreadProps(__spreadValues({}, props), {
|
|
793
|
+
defaultOpen,
|
|
794
|
+
open: isControlled ? open : void 0,
|
|
795
|
+
onOpenChange: handleOpenChange,
|
|
796
|
+
children
|
|
797
|
+
})
|
|
798
|
+
)
|
|
799
|
+
}
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
Menu.displayName = "Menu";
|
|
803
|
+
var MenuTrigger = React38.forwardRef((_a, ref) => {
|
|
804
|
+
var _b = _a, { children, asChild = true } = _b, props = __objRest(_b, ["children", "asChild"]);
|
|
805
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Trigger, __spreadProps(__spreadValues({ ref, asChild }, props), { children }));
|
|
806
|
+
});
|
|
807
|
+
MenuTrigger.displayName = "MenuTrigger";
|
|
808
|
+
var MenuContent = React38.forwardRef(
|
|
809
|
+
(_a, ref) => {
|
|
810
|
+
var _b = _a, {
|
|
811
|
+
children,
|
|
812
|
+
sideOffset = 6,
|
|
813
|
+
side = "bottom",
|
|
814
|
+
align = "start",
|
|
815
|
+
hasOverflow = false,
|
|
816
|
+
colorVariant: propColorVariant,
|
|
817
|
+
separatorStyle = "gap",
|
|
818
|
+
className
|
|
819
|
+
} = _b, props = __objRest(_b, [
|
|
820
|
+
"children",
|
|
821
|
+
"sideOffset",
|
|
822
|
+
"side",
|
|
823
|
+
"align",
|
|
824
|
+
"hasOverflow",
|
|
825
|
+
"colorVariant",
|
|
826
|
+
"separatorStyle",
|
|
827
|
+
"className"
|
|
828
|
+
]);
|
|
829
|
+
const {
|
|
830
|
+
open,
|
|
831
|
+
variant,
|
|
832
|
+
colorVariant: contextColorVariant
|
|
833
|
+
} = useMenuContext();
|
|
834
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
835
|
+
const colors = variant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
836
|
+
const isExpressiveGap = variant === "expressive" && separatorStyle === "gap";
|
|
837
|
+
const containerClassName = variant === "expressive" ? cn(
|
|
838
|
+
"z-50 flex flex-col",
|
|
839
|
+
MENU_MIN_WIDTH,
|
|
840
|
+
MENU_MAX_WIDTH,
|
|
841
|
+
isExpressiveGap ? MENU_GROUP_GAP : "",
|
|
842
|
+
isExpressiveGap ? "bg-transparent" : colors.containerBg,
|
|
843
|
+
isExpressiveGap ? "" : "rounded-2xl",
|
|
844
|
+
isExpressiveGap ? "" : "elevation-2",
|
|
845
|
+
hasOverflow || isExpressiveGap ? "overflow-visible" : "overflow-hidden",
|
|
846
|
+
"outline-none",
|
|
847
|
+
className
|
|
848
|
+
) : cn(
|
|
849
|
+
"z-50 flex flex-col",
|
|
850
|
+
MENU_MIN_WIDTH,
|
|
851
|
+
MENU_MAX_WIDTH,
|
|
852
|
+
MENU_POPUP_PADDING_Y,
|
|
853
|
+
MENU_GROUP_GAP,
|
|
854
|
+
colors.containerBg,
|
|
855
|
+
MENU_CONTAINER_SHAPE,
|
|
856
|
+
"elevation-2",
|
|
857
|
+
hasOverflow ? "overflow-visible" : "overflow-hidden",
|
|
858
|
+
"outline-none",
|
|
859
|
+
className
|
|
860
|
+
);
|
|
861
|
+
const flattenChildren = (nodes) => {
|
|
862
|
+
return React38.Children.toArray(nodes).reduce(
|
|
863
|
+
(acc, child) => {
|
|
864
|
+
if (React38.isValidElement(child)) {
|
|
865
|
+
if (child.type === React38.Fragment) {
|
|
866
|
+
return acc.concat(
|
|
867
|
+
flattenChildren(
|
|
868
|
+
child.props.children
|
|
869
|
+
)
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
acc.push(child);
|
|
873
|
+
}
|
|
874
|
+
return acc;
|
|
875
|
+
},
|
|
876
|
+
[]
|
|
877
|
+
);
|
|
878
|
+
};
|
|
879
|
+
let renderedChildren = children;
|
|
880
|
+
if (variant === "expressive") {
|
|
881
|
+
const validChildren = flattenChildren(children);
|
|
882
|
+
const groupCount = validChildren.length;
|
|
883
|
+
const enhancedChildren = validChildren.map(
|
|
884
|
+
(child, i) => React38.cloneElement(child, {
|
|
885
|
+
index: i,
|
|
886
|
+
count: groupCount,
|
|
887
|
+
isGapVariant: isExpressiveGap
|
|
888
|
+
})
|
|
889
|
+
);
|
|
890
|
+
renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
891
|
+
if (i > 0) {
|
|
892
|
+
acc.push(
|
|
893
|
+
/* @__PURE__ */ jsx(
|
|
894
|
+
"hr",
|
|
895
|
+
{
|
|
896
|
+
className: cn(
|
|
897
|
+
"mx-3 my-0.5 h-px border-0 bg-m3-outline-variant"
|
|
898
|
+
)
|
|
899
|
+
},
|
|
900
|
+
`divider-${child.key || i}`
|
|
901
|
+
)
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
acc.push(child);
|
|
905
|
+
return acc;
|
|
906
|
+
}, []) : enhancedChildren;
|
|
907
|
+
}
|
|
908
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(DropdownMenu.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(
|
|
909
|
+
DropdownMenu.Content,
|
|
910
|
+
__spreadProps(__spreadValues({
|
|
911
|
+
ref,
|
|
912
|
+
sideOffset,
|
|
913
|
+
side,
|
|
914
|
+
align,
|
|
915
|
+
asChild: true,
|
|
916
|
+
forceMount: true
|
|
917
|
+
}, props), {
|
|
918
|
+
children: /* @__PURE__ */ jsx(
|
|
919
|
+
m.div,
|
|
920
|
+
{
|
|
921
|
+
role: "menu",
|
|
922
|
+
"aria-orientation": "vertical",
|
|
923
|
+
className: containerClassName,
|
|
924
|
+
variants: MENU_CONTAINER_VARIANTS,
|
|
925
|
+
initial: "hidden",
|
|
926
|
+
animate: "visible",
|
|
927
|
+
exit: "exit",
|
|
928
|
+
style: __spreadProps(__spreadValues({}, props.style), {
|
|
929
|
+
transformOrigin: "var(--radix-dropdown-menu-content-transform-origin)"
|
|
930
|
+
}),
|
|
931
|
+
children: renderedChildren
|
|
932
|
+
}
|
|
933
|
+
)
|
|
934
|
+
})
|
|
935
|
+
) }) });
|
|
936
|
+
}
|
|
937
|
+
);
|
|
938
|
+
MenuContent.displayName = "MenuContent";
|
|
939
|
+
var MenuDivider = React38.forwardRef(
|
|
940
|
+
(_a, ref) => {
|
|
941
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
942
|
+
const { menuVariant } = useMenuContext();
|
|
943
|
+
return /* @__PURE__ */ jsx(DropdownMenu.Separator, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
944
|
+
"hr",
|
|
945
|
+
__spreadValues({
|
|
946
|
+
ref,
|
|
947
|
+
className: cn(
|
|
948
|
+
// Baseline: 8dp vertical margin, 0 horizontal. Expressive: 12dp horizontal, 2dp vertical
|
|
949
|
+
menuVariant === "baseline" ? "my-2 mx-0" : "mx-3 my-0.5",
|
|
950
|
+
// 1px height line
|
|
951
|
+
"h-px border-0",
|
|
952
|
+
// outline-variant color
|
|
953
|
+
"bg-m3-outline-variant",
|
|
954
|
+
className
|
|
955
|
+
)
|
|
956
|
+
}, props)
|
|
957
|
+
) });
|
|
958
|
+
}
|
|
959
|
+
);
|
|
960
|
+
MenuDivider.displayName = "MenuDivider";
|
|
961
|
+
function getGroupPosition(index, count) {
|
|
962
|
+
if (count === 1) return "standalone";
|
|
963
|
+
if (index === 0) return "leading";
|
|
964
|
+
if (index === count - 1) return "trailing";
|
|
965
|
+
return "middle";
|
|
966
|
+
}
|
|
967
|
+
function getGroupActiveShape(position) {
|
|
968
|
+
return GROUP_SHAPES[`${position}Active`];
|
|
969
|
+
}
|
|
970
|
+
var MenuGroup = React38.forwardRef(
|
|
971
|
+
(_a, ref) => {
|
|
972
|
+
var _b = _a, {
|
|
973
|
+
children,
|
|
974
|
+
label,
|
|
975
|
+
index = 0,
|
|
976
|
+
count = 1,
|
|
977
|
+
colorVariant: propColorVariant,
|
|
978
|
+
isGapVariant,
|
|
979
|
+
itemPosition,
|
|
980
|
+
className
|
|
981
|
+
} = _b, rest = __objRest(_b, [
|
|
982
|
+
"children",
|
|
983
|
+
"label",
|
|
984
|
+
"index",
|
|
985
|
+
"count",
|
|
986
|
+
"colorVariant",
|
|
987
|
+
"isGapVariant",
|
|
988
|
+
"itemPosition",
|
|
989
|
+
"className"
|
|
990
|
+
]);
|
|
991
|
+
const {
|
|
992
|
+
menuVariant,
|
|
993
|
+
colorVariant: contextColorVariant,
|
|
994
|
+
isStatic
|
|
995
|
+
} = useMenuContext();
|
|
996
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
997
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
998
|
+
const position = getGroupPosition(index, count);
|
|
999
|
+
const activeShape = getGroupActiveShape(position);
|
|
1000
|
+
const [isHovered, setIsHovered] = React38.useState(false);
|
|
1001
|
+
const currentShape = isStatic || isHovered ? activeShape : GROUP_SHAPES.inactive;
|
|
1002
|
+
const handlePointerEnter = React38.useCallback(() => setIsHovered(true), []);
|
|
1003
|
+
const handlePointerLeave = React38.useCallback(() => setIsHovered(false), []);
|
|
1004
|
+
const flattenChildren = (children2) => {
|
|
1005
|
+
return React38.Children.toArray(children2).reduce(
|
|
1006
|
+
(acc, child) => {
|
|
1007
|
+
if (React38.isValidElement(child)) {
|
|
1008
|
+
if (child.type === React38.Fragment) {
|
|
1009
|
+
return acc.concat(
|
|
1010
|
+
flattenChildren(
|
|
1011
|
+
child.props.children
|
|
1012
|
+
)
|
|
1013
|
+
);
|
|
1014
|
+
}
|
|
1015
|
+
acc.push(child);
|
|
1016
|
+
}
|
|
1017
|
+
return acc;
|
|
1018
|
+
},
|
|
1019
|
+
[]
|
|
1020
|
+
);
|
|
1021
|
+
};
|
|
1022
|
+
const validChildren = flattenChildren(children);
|
|
1023
|
+
const itemCount = validChildren.length;
|
|
1024
|
+
const enhancedChildren = validChildren.map((child, i) => {
|
|
1025
|
+
const itemPosition2 = itemCount === 1 ? "standalone" : i === 0 ? "leading" : i === itemCount - 1 ? "trailing" : "middle";
|
|
1026
|
+
return React38.cloneElement(child, {
|
|
1027
|
+
itemPosition: itemPosition2,
|
|
1028
|
+
colorVariant
|
|
1029
|
+
});
|
|
1030
|
+
});
|
|
1031
|
+
return /* @__PURE__ */ jsxs(
|
|
1032
|
+
m.div,
|
|
1033
|
+
__spreadProps(__spreadValues({
|
|
1034
|
+
ref,
|
|
1035
|
+
role: "group",
|
|
1036
|
+
"aria-label": label,
|
|
1037
|
+
className: cn(
|
|
1038
|
+
"relative",
|
|
1039
|
+
// In baseline variant, MenuGroup is transparent so it shouldn't clip.
|
|
1040
|
+
// In expressive variant, it needs overflow-hidden to clip hover states to its morphing shape.
|
|
1041
|
+
menuVariant === "baseline" ? "" : "overflow-hidden",
|
|
1042
|
+
// Vertical padding: 2dp for gap variant (to match Figma), 4dp for baseline
|
|
1043
|
+
isGapVariant ? "py-0.5" : MENU_GROUP_PADDING_Y,
|
|
1044
|
+
// Horizontal padding: 4dp for expressive menus (both static and popup), 0 for baseline
|
|
1045
|
+
menuVariant === "expressive" ? "px-1" : "",
|
|
1046
|
+
// Gap variant has floating segments, so each group manages its own shadow
|
|
1047
|
+
isGapVariant ? "elevation-2" : "",
|
|
1048
|
+
// Background based on color variant (transparent for baseline to avoid double-layering)
|
|
1049
|
+
menuVariant === "baseline" ? "bg-transparent" : colors.containerBg,
|
|
1050
|
+
className
|
|
1051
|
+
),
|
|
1052
|
+
animate: { borderRadius: currentShape },
|
|
1053
|
+
transition: FAST_SPATIAL_SPRING,
|
|
1054
|
+
onPointerEnter: handlePointerEnter,
|
|
1055
|
+
onPointerLeave: handlePointerLeave
|
|
1056
|
+
}, rest), {
|
|
1057
|
+
children: [
|
|
1058
|
+
label && /* @__PURE__ */ jsx(
|
|
1059
|
+
"span",
|
|
1060
|
+
{
|
|
1061
|
+
className: cn(
|
|
1062
|
+
// Padding: 12dp top, 12dp horizontal, 8dp bottom (MD3 spec)
|
|
1063
|
+
"block pt-3 px-3 pb-2",
|
|
1064
|
+
"text-label-small",
|
|
1065
|
+
menuVariant === "baseline" ? "text-m3-on-surface-variant" : colorVariant === "vibrant" ? "text-m3-on-tertiary-container" : "text-m3-on-surface-variant"
|
|
1066
|
+
),
|
|
1067
|
+
children: label
|
|
1068
|
+
}
|
|
1069
|
+
),
|
|
1070
|
+
enhancedChildren
|
|
1071
|
+
]
|
|
1072
|
+
})
|
|
1073
|
+
);
|
|
1074
|
+
}
|
|
1075
|
+
);
|
|
1076
|
+
MenuGroup.displayName = "MenuGroup";
|
|
1077
|
+
|
|
412
1078
|
// src/ui/shared/constants.ts
|
|
413
1079
|
var SPRING_TRANSITION_FAST = {
|
|
414
1080
|
type: "spring",
|
|
@@ -440,7 +1106,7 @@ var VARIANT_FONT = {
|
|
|
440
1106
|
rounded: "'Material Symbols Rounded'",
|
|
441
1107
|
sharp: "'Material Symbols Sharp'"
|
|
442
1108
|
};
|
|
443
|
-
var IconComponent =
|
|
1109
|
+
var IconComponent = React38.forwardRef(
|
|
444
1110
|
(_a, ref) => {
|
|
445
1111
|
var _b = _a, {
|
|
446
1112
|
name,
|
|
@@ -506,222 +1172,527 @@ var IconComponent = React31.forwardRef(
|
|
|
506
1172
|
}
|
|
507
1173
|
);
|
|
508
1174
|
IconComponent.displayName = "Icon";
|
|
509
|
-
var Icon =
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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
|
-
|
|
1175
|
+
var Icon = React38.memo(IconComponent);
|
|
1176
|
+
function getItemShapeClass(position, selected, isStatic = false, menuVariant = "expressive") {
|
|
1177
|
+
if (menuVariant === "baseline") return BASELINE_ITEM_SHAPE;
|
|
1178
|
+
if (selected) return ITEM_SHAPE_CLASSES.selected;
|
|
1179
|
+
if (isStatic && position === "standalone") return "rounded-[12px]";
|
|
1180
|
+
return ITEM_SHAPE_CLASSES[position];
|
|
1181
|
+
}
|
|
1182
|
+
var MenuItem = React38.forwardRef(
|
|
1183
|
+
(_a, ref) => {
|
|
1184
|
+
var _b = _a, {
|
|
1185
|
+
children,
|
|
1186
|
+
onClick,
|
|
1187
|
+
leadingIcon,
|
|
1188
|
+
trailingIcon,
|
|
1189
|
+
supportingText,
|
|
1190
|
+
trailingText,
|
|
1191
|
+
selected,
|
|
1192
|
+
disabled = false,
|
|
1193
|
+
itemPosition = "standalone",
|
|
1194
|
+
colorVariant: propColorVariant,
|
|
1195
|
+
keepOpen = false,
|
|
1196
|
+
className,
|
|
1197
|
+
isSubTrigger,
|
|
1198
|
+
value,
|
|
1199
|
+
role
|
|
1200
|
+
} = _b, rest = __objRest(_b, [
|
|
1201
|
+
"children",
|
|
1202
|
+
"onClick",
|
|
1203
|
+
"leadingIcon",
|
|
1204
|
+
"trailingIcon",
|
|
1205
|
+
"supportingText",
|
|
1206
|
+
"trailingText",
|
|
1207
|
+
"selected",
|
|
1208
|
+
"disabled",
|
|
1209
|
+
"itemPosition",
|
|
1210
|
+
"colorVariant",
|
|
1211
|
+
"keepOpen",
|
|
1212
|
+
"className",
|
|
1213
|
+
"isSubTrigger",
|
|
1214
|
+
"value",
|
|
1215
|
+
"role"
|
|
1216
|
+
]);
|
|
1217
|
+
const {
|
|
1218
|
+
menuVariant,
|
|
1219
|
+
colorVariant: contextColorVariant,
|
|
1220
|
+
menuPrimitive
|
|
1221
|
+
} = useMenuContext();
|
|
1222
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1223
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1224
|
+
const isStaticMenu = menuPrimitive === "static";
|
|
1225
|
+
const shapeClass = getItemShapeClass(
|
|
1226
|
+
itemPosition,
|
|
1227
|
+
!!selected,
|
|
1228
|
+
isStaticMenu,
|
|
1229
|
+
menuVariant
|
|
1230
|
+
);
|
|
1231
|
+
const isSelectable = selected !== void 0 && !isSubTrigger;
|
|
1232
|
+
const isCheckbox = role === "menuitemcheckbox" || selected !== void 0 && !role && !isSubTrigger;
|
|
1233
|
+
const isRadio = role === "menuitemradio";
|
|
1234
|
+
const ItemPrimitive = isStaticMenu || isSubTrigger ? Slot : menuPrimitive === "context" ? isCheckbox ? RxContextMenu.CheckboxItem : isRadio ? RxContextMenu.RadioItem : RxContextMenu.Item : isCheckbox ? DropdownMenu.CheckboxItem : isRadio ? DropdownMenu.RadioItem : DropdownMenu.Item;
|
|
1235
|
+
return /* @__PURE__ */ jsx(
|
|
1236
|
+
ItemPrimitive,
|
|
1237
|
+
__spreadProps(__spreadValues({
|
|
1238
|
+
ref
|
|
1239
|
+
}, isStaticMenu || isSubTrigger ? {
|
|
1240
|
+
role: role || (isCheckbox ? "menuitemcheckbox" : isRadio ? "menuitemradio" : "menuitem"),
|
|
1241
|
+
"aria-checked": isCheckbox || isRadio ? !!selected : void 0,
|
|
1242
|
+
"aria-disabled": disabled ? true : void 0,
|
|
1243
|
+
tabIndex: disabled ? -1 : 0,
|
|
1244
|
+
onKeyDown: (e) => {
|
|
1245
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1246
|
+
e.preventDefault();
|
|
1247
|
+
onClick == null ? void 0 : onClick(e);
|
|
1248
|
+
}
|
|
1249
|
+
},
|
|
1250
|
+
onClick
|
|
1251
|
+
} : __spreadProps(__spreadValues(__spreadValues({
|
|
1252
|
+
disabled,
|
|
1253
|
+
onSelect: keepOpen ? (e) => e.preventDefault() : void 0,
|
|
1254
|
+
onClick
|
|
1255
|
+
}, isCheckbox || isRadio ? { checked: !!selected } : {}), isRadio ? { value: value != null ? value : "" } : {}), {
|
|
1256
|
+
asChild: true
|
|
1257
|
+
})), {
|
|
1258
|
+
children: /* @__PURE__ */ jsxs(
|
|
1259
|
+
"div",
|
|
1260
|
+
__spreadProps(__spreadValues({
|
|
1261
|
+
className: cn(
|
|
1262
|
+
// Layout
|
|
1263
|
+
"relative flex w-full cursor-pointer select-none items-center outline-none",
|
|
1264
|
+
// Sizing: min-h 48dp, min-w 112dp, max-w 280dp
|
|
1265
|
+
"min-h-12 min-w-28 max-w-70",
|
|
1266
|
+
// Horizontal padding
|
|
1267
|
+
menuVariant === "baseline" ? MENU_BASELINE_ITEM_HORIZONTAL_PADDING : "px-4",
|
|
1268
|
+
// Spacing between items
|
|
1269
|
+
isStaticMenu ? "my-0.5" : "",
|
|
1270
|
+
// Shape morphing (position-based + selected override)
|
|
1271
|
+
shapeClass,
|
|
1272
|
+
// Animate border-radius AND background-color together (FastEffects: 150ms)
|
|
1273
|
+
"transition-[border-radius,background-color] duration-150 ease-in",
|
|
1274
|
+
// Colors based on variant + selection
|
|
1275
|
+
selected ? cn(colors.selectedBg, colors.selectedText) : cn(colors.labelText),
|
|
1276
|
+
// State layers (only on unselected items)
|
|
1277
|
+
!selected && colors.hoverLayer,
|
|
1278
|
+
!selected && colors.focusLayer,
|
|
1279
|
+
// Focus visible ring (WCAG 2.4.11 — visible focus indicator)
|
|
1280
|
+
// Uses ring-inset so the ring doesn't overflow the item bounds.
|
|
1281
|
+
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-primary",
|
|
1282
|
+
// Disabled
|
|
1283
|
+
disabled && "pointer-events-none opacity-[0.38]",
|
|
1284
|
+
className
|
|
1285
|
+
)
|
|
1286
|
+
}, rest), {
|
|
1287
|
+
children: [
|
|
1288
|
+
(isSelectable || leadingIcon) && /* @__PURE__ */ jsx(
|
|
1289
|
+
"div",
|
|
1290
|
+
{
|
|
1291
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center mr-3",
|
|
1292
|
+
"aria-hidden": "true",
|
|
1293
|
+
children: isSelectable ? /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: selected ? /* @__PURE__ */ jsx(
|
|
1294
|
+
m.span,
|
|
1295
|
+
{
|
|
1296
|
+
className: cn(
|
|
1297
|
+
"flex h-full w-full items-center justify-center overflow-hidden",
|
|
1298
|
+
colors.selectedIcon
|
|
1299
|
+
),
|
|
1300
|
+
variants: CHECK_ICON_VARIANTS,
|
|
1301
|
+
initial: "hidden",
|
|
1302
|
+
animate: "visible",
|
|
1303
|
+
exit: "exit",
|
|
1304
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "check", fill: 1, size: MENU_CHECK_ICON_SIZE })
|
|
1305
|
+
},
|
|
1306
|
+
"check"
|
|
1307
|
+
) : leadingIcon ? /* @__PURE__ */ jsx(
|
|
1308
|
+
m.span,
|
|
1309
|
+
{
|
|
1310
|
+
className: cn(
|
|
1311
|
+
"flex h-full w-full items-center justify-center overflow-hidden",
|
|
1312
|
+
colors.iconColor
|
|
1313
|
+
),
|
|
1314
|
+
variants: CHECK_ICON_VARIANTS,
|
|
1315
|
+
initial: "hidden",
|
|
1316
|
+
animate: "visible",
|
|
1317
|
+
exit: "exit",
|
|
1318
|
+
children: leadingIcon
|
|
1319
|
+
},
|
|
1320
|
+
"icon"
|
|
1321
|
+
) : (
|
|
1322
|
+
// Spacer for selectable items with no icon, to keep text aligned
|
|
1323
|
+
/* @__PURE__ */ jsx("div", { className: "w-5" })
|
|
1324
|
+
) }) : (
|
|
1325
|
+
// Static icon for non-selectable items
|
|
1326
|
+
/* @__PURE__ */ jsx(
|
|
1327
|
+
"span",
|
|
1328
|
+
{
|
|
1329
|
+
className: cn(
|
|
1330
|
+
"flex h-full w-full items-center justify-center",
|
|
1331
|
+
colors.iconColor
|
|
1332
|
+
),
|
|
1333
|
+
children: leadingIcon
|
|
1334
|
+
}
|
|
1335
|
+
)
|
|
1336
|
+
)
|
|
1337
|
+
}
|
|
1338
|
+
),
|
|
1339
|
+
/* @__PURE__ */ jsxs("span", { className: "flex flex-1 flex-col", children: [
|
|
1340
|
+
/* @__PURE__ */ jsx("span", { className: "text-body-large leading-snug", children }),
|
|
1341
|
+
supportingText && /* @__PURE__ */ jsx(
|
|
1342
|
+
"span",
|
|
1343
|
+
{
|
|
1344
|
+
className: cn(
|
|
1345
|
+
"text-body-medium leading-snug",
|
|
1346
|
+
// Source: StandardMenuTokens.ItemSupportingTextColor / VibrantMenuTokens
|
|
1347
|
+
selected ? colors.selectedText : colors.supportingTextColor
|
|
1348
|
+
),
|
|
1349
|
+
children: supportingText
|
|
1350
|
+
}
|
|
1351
|
+
)
|
|
1352
|
+
] }),
|
|
1353
|
+
(trailingText || trailingIcon) && /* @__PURE__ */ jsx(
|
|
1354
|
+
"span",
|
|
1355
|
+
{
|
|
1356
|
+
className: cn(
|
|
1357
|
+
// Minimum 12dp gap from label column (ListTokens)
|
|
1358
|
+
"ml-3 flex shrink-0 items-center",
|
|
1359
|
+
// Source: StandardMenuTokens.ItemTrailingIconColor / VibrantMenuTokens
|
|
1360
|
+
selected ? colors.selectedText : colors.trailingIconColor
|
|
1361
|
+
),
|
|
1362
|
+
"aria-hidden": trailingIcon ? "true" : void 0,
|
|
1363
|
+
children: trailingText ? /* @__PURE__ */ jsx("span", { className: "text-label-small tracking-wider", children: trailingText }) : trailingIcon
|
|
1364
|
+
}
|
|
1365
|
+
)
|
|
1366
|
+
]
|
|
1367
|
+
})
|
|
1368
|
+
)
|
|
1369
|
+
})
|
|
1370
|
+
);
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
MenuItem.displayName = "MenuItem";
|
|
1374
|
+
function SubMenu({
|
|
1375
|
+
children,
|
|
1376
|
+
trigger,
|
|
1377
|
+
side = "right",
|
|
1378
|
+
colorVariant: propColorVariant,
|
|
1379
|
+
hoverOpenDelay = 200,
|
|
1380
|
+
hoverCloseDelay = 300
|
|
1381
|
+
}) {
|
|
1382
|
+
const { colorVariant: contextColorVariant, menuPrimitive } = useMenuContext();
|
|
1383
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1384
|
+
const [open, setOpen] = React38.useState(false);
|
|
1385
|
+
const openTimerRef = React38.useRef(null);
|
|
1386
|
+
const closeTimerRef = React38.useRef(
|
|
1387
|
+
null
|
|
577
1388
|
);
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
1389
|
+
const clearTimers = React38.useCallback(() => {
|
|
1390
|
+
if (openTimerRef.current) clearTimeout(openTimerRef.current);
|
|
1391
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
1392
|
+
}, []);
|
|
1393
|
+
const handleTriggerPointerEnter = React38.useCallback(() => {
|
|
1394
|
+
clearTimers();
|
|
1395
|
+
openTimerRef.current = setTimeout(() => setOpen(true), hoverOpenDelay);
|
|
1396
|
+
}, [hoverOpenDelay, clearTimers]);
|
|
1397
|
+
const handleTriggerPointerLeave = React38.useCallback(() => {
|
|
1398
|
+
clearTimers();
|
|
1399
|
+
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1400
|
+
}, [hoverCloseDelay, clearTimers]);
|
|
1401
|
+
const handleContentPointerEnter = React38.useCallback(() => {
|
|
1402
|
+
clearTimers();
|
|
1403
|
+
}, [clearTimers]);
|
|
1404
|
+
const handleContentPointerLeave = React38.useCallback(() => {
|
|
1405
|
+
clearTimers();
|
|
1406
|
+
closeTimerRef.current = setTimeout(() => setOpen(false), hoverCloseDelay);
|
|
1407
|
+
}, [hoverCloseDelay, clearTimers]);
|
|
1408
|
+
React38.useEffect(() => () => clearTimers(), [clearTimers]);
|
|
1409
|
+
const Sub3 = menuPrimitive === "context" ? RxContextMenu.Sub : DropdownMenu.Sub;
|
|
1410
|
+
const SubTrigger3 = menuPrimitive === "context" ? RxContextMenu.SubTrigger : DropdownMenu.SubTrigger;
|
|
1411
|
+
const SubContent3 = menuPrimitive === "context" ? RxContextMenu.SubContent : DropdownMenu.SubContent;
|
|
1412
|
+
const Portal7 = menuPrimitive === "context" ? RxContextMenu.Portal : DropdownMenu.Portal;
|
|
1413
|
+
return /* @__PURE__ */ jsxs(Sub3, { open, onOpenChange: setOpen, children: [
|
|
1414
|
+
/* @__PURE__ */ jsx(
|
|
1415
|
+
SubTrigger3,
|
|
1416
|
+
{
|
|
1417
|
+
className: "w-full outline-none",
|
|
1418
|
+
onPointerEnter: handleTriggerPointerEnter,
|
|
1419
|
+
onPointerLeave: handleTriggerPointerLeave,
|
|
1420
|
+
children: React38.isValidElement(trigger) ? React38.cloneElement(trigger, {
|
|
1421
|
+
isSubTrigger: true,
|
|
1422
|
+
// Auto-add chevron if missing
|
|
1423
|
+
trailingIcon: trigger.props.trailingIcon || /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 20 })
|
|
1424
|
+
}) : trigger
|
|
1425
|
+
}
|
|
1426
|
+
),
|
|
1427
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(Portal7, { forceMount: true, children: /* @__PURE__ */ jsx(
|
|
1428
|
+
SubContent3,
|
|
1429
|
+
{
|
|
1430
|
+
sideOffset: 4,
|
|
1431
|
+
alignOffset: -4,
|
|
1432
|
+
forceMount: true,
|
|
1433
|
+
className: "outline-none",
|
|
1434
|
+
children: /* @__PURE__ */ jsx(
|
|
1435
|
+
SubMenuContent,
|
|
1436
|
+
{
|
|
1437
|
+
side,
|
|
1438
|
+
colorVariant,
|
|
1439
|
+
onPointerEnter: handleContentPointerEnter,
|
|
1440
|
+
onPointerLeave: handleContentPointerLeave,
|
|
1441
|
+
children
|
|
1442
|
+
}
|
|
1443
|
+
)
|
|
1444
|
+
}
|
|
1445
|
+
) }) })
|
|
1446
|
+
] });
|
|
1447
|
+
}
|
|
1448
|
+
SubMenu.displayName = "SubMenu";
|
|
1449
|
+
function SubMenuContent({
|
|
1450
|
+
children,
|
|
1451
|
+
side,
|
|
1452
|
+
colorVariant: propColorVariant,
|
|
1453
|
+
onPointerEnter,
|
|
1454
|
+
onPointerLeave
|
|
1455
|
+
}) {
|
|
1456
|
+
const { menuVariant, colorVariant: contextColorVariant } = useMenuContext();
|
|
1457
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1458
|
+
const colors = menuVariant === "baseline" ? BASELINE_COLORS : colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
582
1459
|
return /* @__PURE__ */ jsx(
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
"rounded-lg px-3 py-2 text-sm text-m3-on-surface",
|
|
590
|
-
"outline-none transition-colors duration-150",
|
|
591
|
-
"hover:bg-m3-on-surface/8",
|
|
592
|
-
"focus:bg-m3-on-surface/12",
|
|
593
|
-
"data-disabled:pointer-events-none data-disabled:opacity-38",
|
|
594
|
-
"focus-visible:ring-0",
|
|
595
|
-
// Radix gốc handle ring internally
|
|
596
|
-
inset && "pl-8",
|
|
597
|
-
className
|
|
598
|
-
)
|
|
599
|
-
}, props)
|
|
600
|
-
);
|
|
601
|
-
});
|
|
602
|
-
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
603
|
-
var DropdownMenuCheckboxItem = React31.forwardRef((_a, ref) => {
|
|
604
|
-
var _b = _a, { className, children, checked } = _b, props = __objRest(_b, ["className", "children", "checked"]);
|
|
605
|
-
return /* @__PURE__ */ jsxs(
|
|
606
|
-
RadixDropdown.CheckboxItem,
|
|
607
|
-
__spreadProps(__spreadValues({
|
|
608
|
-
ref,
|
|
1460
|
+
m.div,
|
|
1461
|
+
{
|
|
1462
|
+
role: "menu",
|
|
1463
|
+
"aria-orientation": "vertical",
|
|
1464
|
+
onPointerEnter,
|
|
1465
|
+
onPointerLeave,
|
|
609
1466
|
className: cn(
|
|
610
|
-
"
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
1467
|
+
"z-50 flex flex-col",
|
|
1468
|
+
// Width constraints
|
|
1469
|
+
MENU_MIN_WIDTH,
|
|
1470
|
+
MENU_MAX_WIDTH,
|
|
1471
|
+
// Vertical padding: 8dp
|
|
1472
|
+
MENU_POPUP_PADDING_Y,
|
|
1473
|
+
// Gap between groups: 2dp
|
|
1474
|
+
MENU_GROUP_GAP,
|
|
1475
|
+
// Container background
|
|
1476
|
+
colors.containerBg,
|
|
1477
|
+
// Container shape: CornerExtraSmall (4px)
|
|
1478
|
+
MENU_CONTAINER_SHAPE,
|
|
1479
|
+
// Elevation-2 shadow
|
|
1480
|
+
"elevation-2",
|
|
1481
|
+
// Overflow clip
|
|
1482
|
+
"overflow-hidden",
|
|
1483
|
+
"outline-none"
|
|
616
1484
|
),
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
627
|
-
var DropdownMenuRadioItem = React31.forwardRef((_a, ref) => {
|
|
628
|
-
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
629
|
-
return /* @__PURE__ */ jsxs(
|
|
630
|
-
RadixDropdown.RadioItem,
|
|
631
|
-
__spreadProps(__spreadValues({
|
|
632
|
-
ref,
|
|
633
|
-
className: cn(
|
|
634
|
-
"relative flex cursor-pointer select-none items-center gap-2",
|
|
635
|
-
"rounded-lg py-2 pl-8 pr-3 text-sm text-m3-on-surface",
|
|
636
|
-
"outline-none transition-colors duration-150",
|
|
637
|
-
"hover:bg-m3-on-surface/8 focus:bg-m3-on-surface/12",
|
|
638
|
-
"data-disabled:pointer-events-none data-disabled:opacity-38",
|
|
639
|
-
className
|
|
640
|
-
)
|
|
641
|
-
}, props), {
|
|
642
|
-
children: [
|
|
643
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsx(RadixDropdown.ItemIndicator, { children: /* @__PURE__ */ jsx(Icon, { name: "circle", fill: 1, size: 8, "aria-hidden": "true" }) }) }),
|
|
644
|
-
children
|
|
645
|
-
]
|
|
646
|
-
})
|
|
647
|
-
);
|
|
648
|
-
});
|
|
649
|
-
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
650
|
-
var DropdownMenuSeparator = React31.forwardRef((_a, ref) => {
|
|
651
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
652
|
-
return /* @__PURE__ */ jsx(
|
|
653
|
-
RadixDropdown.Separator,
|
|
654
|
-
__spreadValues({
|
|
655
|
-
ref,
|
|
656
|
-
className: cn("my-1 h-px bg-m3-outline-variant", className)
|
|
657
|
-
}, props)
|
|
1485
|
+
variants: SUBMENU_CONTAINER_VARIANTS,
|
|
1486
|
+
initial: "hidden",
|
|
1487
|
+
animate: "visible",
|
|
1488
|
+
exit: "exit",
|
|
1489
|
+
style: {
|
|
1490
|
+
transformOrigin: side === "right" ? "top left" : "top right"
|
|
1491
|
+
},
|
|
1492
|
+
children
|
|
1493
|
+
}
|
|
658
1494
|
);
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
var
|
|
662
|
-
var _b = _a, { className,
|
|
1495
|
+
}
|
|
1496
|
+
SubMenuContent.displayName = "SubMenuContent";
|
|
1497
|
+
var VerticalMenuDivider = React38.forwardRef((_a, ref) => {
|
|
1498
|
+
var _b = _a, { className, index, count, isGapVariant } = _b, props = __objRest(_b, ["className", "index", "count", "isGapVariant"]);
|
|
663
1499
|
return /* @__PURE__ */ jsx(
|
|
664
|
-
|
|
1500
|
+
"hr",
|
|
665
1501
|
__spreadValues({
|
|
666
1502
|
ref,
|
|
667
1503
|
className: cn(
|
|
668
|
-
|
|
669
|
-
|
|
1504
|
+
// HorizontalDividerPadding: horizontal=12dp, vertical=2dp
|
|
1505
|
+
"mx-3 my-0.5",
|
|
1506
|
+
// 1px height, no default border
|
|
1507
|
+
"h-px border-0",
|
|
1508
|
+
// Source: MenuDefaults.HorizontalDividerPadding / outline-variant
|
|
1509
|
+
"bg-m3-outline-variant",
|
|
670
1510
|
className
|
|
671
1511
|
)
|
|
672
1512
|
}, props)
|
|
673
1513
|
);
|
|
674
1514
|
});
|
|
675
|
-
|
|
676
|
-
var
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
{
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
1515
|
+
VerticalMenuDivider.displayName = "VerticalMenuDivider";
|
|
1516
|
+
var VerticalMenuGroup = MenuGroup;
|
|
1517
|
+
var VerticalMenuContent = React38.forwardRef(
|
|
1518
|
+
(_a, ref) => {
|
|
1519
|
+
var _b = _a, {
|
|
1520
|
+
children,
|
|
1521
|
+
separatorStyle = "gap",
|
|
1522
|
+
colorVariant: propColorVariant,
|
|
1523
|
+
className
|
|
1524
|
+
} = _b, props = __objRest(_b, [
|
|
1525
|
+
"children",
|
|
1526
|
+
"separatorStyle",
|
|
1527
|
+
"colorVariant",
|
|
1528
|
+
"className"
|
|
1529
|
+
]);
|
|
1530
|
+
const { colorVariant: contextColorVariant } = useMenuContext();
|
|
1531
|
+
const colorVariant = propColorVariant != null ? propColorVariant : contextColorVariant;
|
|
1532
|
+
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1533
|
+
const flattenChildren = (children2) => {
|
|
1534
|
+
return React38.Children.toArray(children2).reduce(
|
|
1535
|
+
(acc, child) => {
|
|
1536
|
+
if (React38.isValidElement(child)) {
|
|
1537
|
+
if (child.type === React38.Fragment) {
|
|
1538
|
+
return acc.concat(
|
|
1539
|
+
flattenChildren(
|
|
1540
|
+
child.props.children
|
|
1541
|
+
)
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
acc.push(child);
|
|
701
1545
|
}
|
|
1546
|
+
return acc;
|
|
1547
|
+
},
|
|
1548
|
+
[]
|
|
1549
|
+
);
|
|
1550
|
+
};
|
|
1551
|
+
const validChildren = flattenChildren(children);
|
|
1552
|
+
const groupCount = validChildren.length;
|
|
1553
|
+
const enhancedChildren = validChildren.map(
|
|
1554
|
+
(child, i) => React38.cloneElement(child, {
|
|
1555
|
+
index: i,
|
|
1556
|
+
count: groupCount,
|
|
1557
|
+
isGapVariant: separatorStyle === "gap"
|
|
1558
|
+
})
|
|
1559
|
+
);
|
|
1560
|
+
const renderedChildren = separatorStyle === "divider" ? enhancedChildren.reduce((acc, child, i) => {
|
|
1561
|
+
if (i > 0) {
|
|
1562
|
+
acc.push(
|
|
1563
|
+
/* @__PURE__ */ jsx(
|
|
1564
|
+
VerticalMenuDivider,
|
|
1565
|
+
{},
|
|
1566
|
+
`divider-${child.key || i}`
|
|
1567
|
+
)
|
|
1568
|
+
);
|
|
1569
|
+
}
|
|
1570
|
+
acc.push(child);
|
|
1571
|
+
return acc;
|
|
1572
|
+
}, []) : enhancedChildren;
|
|
1573
|
+
return /* @__PURE__ */ jsx(
|
|
1574
|
+
"div",
|
|
1575
|
+
__spreadProps(__spreadValues({
|
|
1576
|
+
ref,
|
|
1577
|
+
className: cn(
|
|
1578
|
+
"flex flex-col w-full",
|
|
1579
|
+
// Gap variant: transparent background + 2dp gap — page bg shows through gaps.
|
|
1580
|
+
// Divider variant: solid container background behind all groups.
|
|
1581
|
+
separatorStyle === "gap" ? cn("bg-transparent", MENU_GROUP_GAP) : colors.containerBg,
|
|
1582
|
+
className
|
|
702
1583
|
)
|
|
703
|
-
|
|
704
|
-
|
|
1584
|
+
}, props), {
|
|
1585
|
+
children: renderedChildren
|
|
1586
|
+
})
|
|
1587
|
+
);
|
|
1588
|
+
}
|
|
1589
|
+
);
|
|
1590
|
+
VerticalMenuContent.displayName = "VerticalMenuContent";
|
|
1591
|
+
var VerticalMenu = React38.forwardRef((_a, ref) => {
|
|
1592
|
+
var _b = _a, { children, colorVariant = "standard", className } = _b, props = __objRest(_b, ["children", "colorVariant", "className"]);
|
|
1593
|
+
const noop = React38.useCallback(() => {
|
|
1594
|
+
}, []);
|
|
1595
|
+
const colors = colorVariant === "vibrant" ? VIBRANT_COLORS : STANDARD_COLORS;
|
|
1596
|
+
const containerRef = React38.useRef(null);
|
|
1597
|
+
const mergedRef = React38.useCallback(
|
|
1598
|
+
(node) => {
|
|
1599
|
+
containerRef.current = node;
|
|
1600
|
+
if (typeof ref === "function") ref(node);
|
|
1601
|
+
else if (ref)
|
|
1602
|
+
ref.current = node;
|
|
1603
|
+
},
|
|
1604
|
+
[ref]
|
|
705
1605
|
);
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
var
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
1606
|
+
const handleKeyDown = React38.useCallback(
|
|
1607
|
+
(e) => {
|
|
1608
|
+
var _a2;
|
|
1609
|
+
if (!containerRef.current) return;
|
|
1610
|
+
const items = Array.from(
|
|
1611
|
+
containerRef.current.querySelectorAll(
|
|
1612
|
+
'[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"])'
|
|
1613
|
+
)
|
|
1614
|
+
);
|
|
1615
|
+
if (!items.length) return;
|
|
1616
|
+
const idx = items.indexOf(document.activeElement);
|
|
1617
|
+
let next = null;
|
|
1618
|
+
switch (e.key) {
|
|
1619
|
+
case "ArrowDown":
|
|
1620
|
+
e.preventDefault();
|
|
1621
|
+
next = idx < items.length - 1 ? idx + 1 : 0;
|
|
1622
|
+
break;
|
|
1623
|
+
case "ArrowUp":
|
|
1624
|
+
e.preventDefault();
|
|
1625
|
+
next = idx > 0 ? idx - 1 : items.length - 1;
|
|
1626
|
+
break;
|
|
1627
|
+
case "Home":
|
|
1628
|
+
e.preventDefault();
|
|
1629
|
+
next = 0;
|
|
1630
|
+
break;
|
|
1631
|
+
case "End":
|
|
1632
|
+
e.preventDefault();
|
|
1633
|
+
next = items.length - 1;
|
|
1634
|
+
break;
|
|
1635
|
+
default:
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
if (next !== null) (_a2 = items[next]) == null ? void 0 : _a2.focus();
|
|
1639
|
+
},
|
|
1640
|
+
[]
|
|
1641
|
+
);
|
|
1642
|
+
const separatorStyle = detectSeparatorStyle(children);
|
|
1643
|
+
const isGapVariant = separatorStyle !== "divider";
|
|
714
1644
|
return /* @__PURE__ */ jsx(
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
1645
|
+
MenuProvider,
|
|
1646
|
+
{
|
|
1647
|
+
variant: "expressive",
|
|
1648
|
+
colorVariant,
|
|
1649
|
+
menuPrimitive: "static",
|
|
1650
|
+
open: true,
|
|
1651
|
+
onOpenChange: noop,
|
|
1652
|
+
children: /* @__PURE__ */ jsx(
|
|
1653
|
+
"div",
|
|
1654
|
+
__spreadProps(__spreadValues({
|
|
1655
|
+
ref: mergedRef,
|
|
1656
|
+
role: "menu",
|
|
1657
|
+
"aria-orientation": "vertical",
|
|
1658
|
+
onKeyDown: handleKeyDown,
|
|
1659
|
+
className: cn(
|
|
1660
|
+
// Width constraints: 112dp min, 280dp max (MenuTokens)
|
|
1661
|
+
MENU_MIN_WIDTH,
|
|
1662
|
+
MENU_MAX_WIDTH,
|
|
1663
|
+
"flex flex-col",
|
|
1664
|
+
isGapVariant ? [
|
|
1665
|
+
// GAP VARIANT: NO overflow-hidden — groups must morph freely.
|
|
1666
|
+
"outline-none"
|
|
1667
|
+
// NO background — transparent between segments.
|
|
1668
|
+
// NO rounded corners — each group manages its own shape.
|
|
1669
|
+
// Elevation is managed by each individual group.
|
|
1670
|
+
] : [
|
|
1671
|
+
// DIVIDER VARIANT: Container clips the content.
|
|
1672
|
+
"rounded-2xl",
|
|
1673
|
+
"overflow-hidden",
|
|
1674
|
+
colors.containerBg,
|
|
1675
|
+
"elevation-2",
|
|
1676
|
+
"outline-none"
|
|
1677
|
+
],
|
|
1678
|
+
className
|
|
1679
|
+
)
|
|
1680
|
+
}, props), {
|
|
1681
|
+
children
|
|
1682
|
+
})
|
|
720
1683
|
)
|
|
721
|
-
}
|
|
1684
|
+
}
|
|
722
1685
|
);
|
|
723
|
-
};
|
|
724
|
-
|
|
1686
|
+
});
|
|
1687
|
+
VerticalMenu.displayName = "VerticalMenu";
|
|
1688
|
+
function detectSeparatorStyle(children) {
|
|
1689
|
+
const child = React38.Children.toArray(children).find(React38.isValidElement);
|
|
1690
|
+
if (child) {
|
|
1691
|
+
const style = child.props.separatorStyle;
|
|
1692
|
+
if (style) return style;
|
|
1693
|
+
}
|
|
1694
|
+
return "gap";
|
|
1695
|
+
}
|
|
725
1696
|
function MoreVertIcon() {
|
|
726
1697
|
return /* @__PURE__ */ jsx(
|
|
727
1698
|
"span",
|
|
@@ -736,10 +1707,14 @@ function OverflowItem({ item }) {
|
|
|
736
1707
|
var _a;
|
|
737
1708
|
if (item.type === "toggleable") {
|
|
738
1709
|
return /* @__PURE__ */ jsx(
|
|
739
|
-
|
|
1710
|
+
MenuItem,
|
|
740
1711
|
{
|
|
741
|
-
|
|
742
|
-
|
|
1712
|
+
role: "menuitemcheckbox",
|
|
1713
|
+
selected: (_a = item.checked) != null ? _a : false,
|
|
1714
|
+
onClick: () => {
|
|
1715
|
+
var _a2;
|
|
1716
|
+
return (_a2 = item.onCheckedChange) == null ? void 0 : _a2.call(item, !item.checked);
|
|
1717
|
+
},
|
|
743
1718
|
disabled: item.enabled === false,
|
|
744
1719
|
children: item.label
|
|
745
1720
|
}
|
|
@@ -754,15 +1729,15 @@ function OverflowItem({ item }) {
|
|
|
754
1729
|
}
|
|
755
1730
|
}) });
|
|
756
1731
|
}
|
|
757
|
-
return /* @__PURE__ */ jsx(
|
|
1732
|
+
return /* @__PURE__ */ jsx(MenuItem, { onClick: item.onClick, disabled: item.enabled === false, children: item.label });
|
|
758
1733
|
}
|
|
759
1734
|
function AppBarOverflowIndicator({
|
|
760
1735
|
items,
|
|
761
1736
|
className
|
|
762
1737
|
}) {
|
|
763
1738
|
if (items.length === 0) return null;
|
|
764
|
-
return /* @__PURE__ */ jsxs(
|
|
765
|
-
/* @__PURE__ */ jsx(
|
|
1739
|
+
return /* @__PURE__ */ jsxs(Menu, { children: [
|
|
1740
|
+
/* @__PURE__ */ jsx(MenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
766
1741
|
"button",
|
|
767
1742
|
{
|
|
768
1743
|
type: "button",
|
|
@@ -781,7 +1756,7 @@ function AppBarOverflowIndicator({
|
|
|
781
1756
|
children: /* @__PURE__ */ jsx(MoreVertIcon, {})
|
|
782
1757
|
}
|
|
783
1758
|
) }),
|
|
784
|
-
/* @__PURE__ */ jsx(
|
|
1759
|
+
/* @__PURE__ */ jsx(MenuContent, { align: "end", sideOffset: 4, children: items.map((item, index) => (
|
|
785
1760
|
// biome-ignore lint/suspicious/noArrayIndexKey: static list from props
|
|
786
1761
|
/* @__PURE__ */ jsx(OverflowItem, { item }, index)
|
|
787
1762
|
)) })
|
|
@@ -792,11 +1767,11 @@ function AppBarColumn({
|
|
|
792
1767
|
maxItemCount,
|
|
793
1768
|
className
|
|
794
1769
|
}) {
|
|
795
|
-
const containerRef =
|
|
796
|
-
const [visibleCount, setVisibleCount] =
|
|
1770
|
+
const containerRef = React38.useRef(null);
|
|
1771
|
+
const [visibleCount, setVisibleCount] = React38.useState(
|
|
797
1772
|
maxItemCount != null ? maxItemCount : items.length
|
|
798
1773
|
);
|
|
799
|
-
|
|
1774
|
+
React38.useEffect(() => {
|
|
800
1775
|
if (maxItemCount !== void 0) {
|
|
801
1776
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
802
1777
|
return;
|
|
@@ -844,11 +1819,11 @@ function AppBarColumn({
|
|
|
844
1819
|
);
|
|
845
1820
|
}
|
|
846
1821
|
function AppBarRow({ items, maxItemCount, className }) {
|
|
847
|
-
const containerRef =
|
|
848
|
-
const [visibleCount, setVisibleCount] =
|
|
1822
|
+
const containerRef = React38.useRef(null);
|
|
1823
|
+
const [visibleCount, setVisibleCount] = React38.useState(
|
|
849
1824
|
maxItemCount != null ? maxItemCount : items.length
|
|
850
1825
|
);
|
|
851
|
-
|
|
1826
|
+
React38.useEffect(() => {
|
|
852
1827
|
if (maxItemCount !== void 0) {
|
|
853
1828
|
setVisibleCount(Math.min(maxItemCount, items.length));
|
|
854
1829
|
return;
|
|
@@ -902,12 +1877,12 @@ function useAppBarScroll({
|
|
|
902
1877
|
collapsedHeight = 64,
|
|
903
1878
|
expandedHeight = 112
|
|
904
1879
|
} = {}) {
|
|
905
|
-
const [isScrolled, setIsScrolled] =
|
|
906
|
-
const [collapsedFraction, setCollapsedFraction] =
|
|
907
|
-
const [isHidden, setIsHidden] =
|
|
908
|
-
const prevScrollYRef =
|
|
1880
|
+
const [isScrolled, setIsScrolled] = React38.useState(false);
|
|
1881
|
+
const [collapsedFraction, setCollapsedFraction] = React38.useState(0);
|
|
1882
|
+
const [isHidden, setIsHidden] = React38.useState(false);
|
|
1883
|
+
const prevScrollYRef = React38.useRef(0);
|
|
909
1884
|
const hideThreshold = 64;
|
|
910
|
-
|
|
1885
|
+
React38.useEffect(() => {
|
|
911
1886
|
var _a;
|
|
912
1887
|
const scrollDistance = expandedHeight - collapsedHeight;
|
|
913
1888
|
const getScrollY = () => {
|
|
@@ -1028,7 +2003,7 @@ function useFlexibleAppBar({
|
|
|
1028
2003
|
expandedHeight
|
|
1029
2004
|
});
|
|
1030
2005
|
const scrollProgress = useMotionValue(0);
|
|
1031
|
-
|
|
2006
|
+
React38.useEffect(() => {
|
|
1032
2007
|
scrollProgress.set(
|
|
1033
2008
|
shouldReduceMotion ? collapsedFraction > 0.5 ? 1 : 0 : collapsedFraction
|
|
1034
2009
|
);
|
|
@@ -1369,7 +2344,7 @@ function SearchAppBar({
|
|
|
1369
2344
|
}) {
|
|
1370
2345
|
var _a, _b;
|
|
1371
2346
|
const shouldReduceMotion = useReducedMotion();
|
|
1372
|
-
const [isSearchOpen, setIsSearchOpen] =
|
|
2347
|
+
const [isSearchOpen, setIsSearchOpen] = React38.useState(false);
|
|
1373
2348
|
const { isScrolled } = useAppBarScroll({
|
|
1374
2349
|
scrollElement,
|
|
1375
2350
|
behavior: scrollBehavior === "exitUntilCollapsed" ? "pinned" : scrollBehavior
|
|
@@ -1483,8 +2458,8 @@ function SearchView({
|
|
|
1483
2458
|
className
|
|
1484
2459
|
}) {
|
|
1485
2460
|
const shouldReduceMotion = useReducedMotion();
|
|
1486
|
-
const inputRef =
|
|
1487
|
-
|
|
2461
|
+
const inputRef = React38.useRef(null);
|
|
2462
|
+
React38.useEffect(() => {
|
|
1488
2463
|
const timer = window.setTimeout(() => {
|
|
1489
2464
|
var _a;
|
|
1490
2465
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -1754,9 +2729,9 @@ function formatBadgeLabel(children, max) {
|
|
|
1754
2729
|
return "";
|
|
1755
2730
|
}
|
|
1756
2731
|
function detectBadgeHasContent(badge) {
|
|
1757
|
-
return
|
|
2732
|
+
return React38.isValidElement(badge) && badge.props.children != null;
|
|
1758
2733
|
}
|
|
1759
|
-
var BadgeImpl =
|
|
2734
|
+
var BadgeImpl = React38.forwardRef(
|
|
1760
2735
|
(_a, ref) => {
|
|
1761
2736
|
var _b = _a, {
|
|
1762
2737
|
children,
|
|
@@ -1810,7 +2785,7 @@ var BadgeImpl = React31.forwardRef(
|
|
|
1810
2785
|
}
|
|
1811
2786
|
);
|
|
1812
2787
|
BadgeImpl.displayName = "Badge";
|
|
1813
|
-
var Badge =
|
|
2788
|
+
var Badge = React38.memo(BadgeImpl);
|
|
1814
2789
|
function BadgedBox({
|
|
1815
2790
|
badge,
|
|
1816
2791
|
children,
|
|
@@ -1876,11 +2851,11 @@ var ROTATE_KEY_SPLINES = [
|
|
|
1876
2851
|
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";
|
|
1877
2852
|
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";
|
|
1878
2853
|
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";
|
|
1879
|
-
var IndeterminateSvg =
|
|
2854
|
+
var IndeterminateSvg = React38.memo(function IndeterminateSvg2({
|
|
1880
2855
|
size
|
|
1881
2856
|
}) {
|
|
1882
|
-
const [ready, setReady] =
|
|
1883
|
-
|
|
2857
|
+
const [ready, setReady] = React38.useState(false);
|
|
2858
|
+
React38.useEffect(() => {
|
|
1884
2859
|
const raf = requestAnimationFrame(() => setReady(true));
|
|
1885
2860
|
return () => cancelAnimationFrame(raf);
|
|
1886
2861
|
}, []);
|
|
@@ -1925,7 +2900,7 @@ var IndeterminateSvg = React31.memo(function IndeterminateSvg2({
|
|
|
1925
2900
|
}
|
|
1926
2901
|
);
|
|
1927
2902
|
});
|
|
1928
|
-
var DeterminateSvg =
|
|
2903
|
+
var DeterminateSvg = React38.memo(function DeterminateSvg2({
|
|
1929
2904
|
size,
|
|
1930
2905
|
progress
|
|
1931
2906
|
}) {
|
|
@@ -1950,7 +2925,7 @@ var DeterminateSvg = React31.memo(function DeterminateSvg2({
|
|
|
1950
2925
|
}
|
|
1951
2926
|
);
|
|
1952
2927
|
});
|
|
1953
|
-
var LoadingIndicator =
|
|
2928
|
+
var LoadingIndicator = React38.forwardRef(
|
|
1954
2929
|
(_a, ref) => {
|
|
1955
2930
|
var _b = _a, {
|
|
1956
2931
|
variant = "uncontained",
|
|
@@ -2065,7 +3040,7 @@ function getSinePath(startX, endX, phase, wl, amp) {
|
|
|
2065
3040
|
d += ` L ${endX.toFixed(2)} ${yEnd.toFixed(2)}`;
|
|
2066
3041
|
return d;
|
|
2067
3042
|
}
|
|
2068
|
-
var CircularProgress =
|
|
3043
|
+
var CircularProgress = React38.forwardRef(
|
|
2069
3044
|
(_a, ref) => {
|
|
2070
3045
|
var _b = _a, {
|
|
2071
3046
|
value,
|
|
@@ -2103,15 +3078,15 @@ var CircularProgress = React31.forwardRef(
|
|
|
2103
3078
|
const isWavy = shape === "wavy";
|
|
2104
3079
|
const BASELINE_SIZE = 48;
|
|
2105
3080
|
const scaleFactor = size / BASELINE_SIZE;
|
|
2106
|
-
const effectiveAmplitude =
|
|
3081
|
+
const effectiveAmplitude = React38.useMemo(
|
|
2107
3082
|
() => amplitude != null ? amplitude : 1.6 * scaleFactor,
|
|
2108
3083
|
[amplitude, scaleFactor]
|
|
2109
3084
|
);
|
|
2110
|
-
const effectiveWavelength =
|
|
3085
|
+
const effectiveWavelength = React38.useMemo(
|
|
2111
3086
|
() => wavelength != null ? wavelength : 15 * scaleFactor,
|
|
2112
3087
|
[wavelength, scaleFactor]
|
|
2113
3088
|
);
|
|
2114
|
-
const wavyActivePath =
|
|
3089
|
+
const wavyActivePath = React38.useMemo(
|
|
2115
3090
|
() => isWavy ? generateWavyCircularPath(
|
|
2116
3091
|
center,
|
|
2117
3092
|
radius,
|
|
@@ -2120,8 +3095,8 @@ var CircularProgress = React31.forwardRef(
|
|
|
2120
3095
|
) : null,
|
|
2121
3096
|
[isWavy, center, radius, effectiveAmplitude, effectiveWavelength]
|
|
2122
3097
|
);
|
|
2123
|
-
const circumference =
|
|
2124
|
-
const gapForTrack =
|
|
3098
|
+
const circumference = React38.useMemo(() => 2 * Math.PI * radius, [radius]);
|
|
3099
|
+
const gapForTrack = React38.useMemo(
|
|
2125
3100
|
() => (gapSize + trackHeight) / circumference,
|
|
2126
3101
|
[gapSize, trackHeight, circumference]
|
|
2127
3102
|
);
|
|
@@ -2310,9 +3285,9 @@ var CircularProgress = React31.forwardRef(
|
|
|
2310
3285
|
);
|
|
2311
3286
|
CircularProgress.displayName = "CircularProgress";
|
|
2312
3287
|
function useContainerWidth() {
|
|
2313
|
-
const [width, setWidth] =
|
|
2314
|
-
const observerRef =
|
|
2315
|
-
const ref =
|
|
3288
|
+
const [width, setWidth] = React38.useState(0);
|
|
3289
|
+
const observerRef = React38.useRef(null);
|
|
3290
|
+
const ref = React38.useCallback((node) => {
|
|
2316
3291
|
if (observerRef.current) {
|
|
2317
3292
|
observerRef.current.disconnect();
|
|
2318
3293
|
observerRef.current = null;
|
|
@@ -2326,7 +3301,7 @@ function useContainerWidth() {
|
|
|
2326
3301
|
observerRef.current = obs;
|
|
2327
3302
|
}
|
|
2328
3303
|
}, []);
|
|
2329
|
-
|
|
3304
|
+
React38.useEffect(() => {
|
|
2330
3305
|
return () => {
|
|
2331
3306
|
if (observerRef.current) {
|
|
2332
3307
|
observerRef.current.disconnect();
|
|
@@ -2336,7 +3311,7 @@ function useContainerWidth() {
|
|
|
2336
3311
|
return [ref, width];
|
|
2337
3312
|
}
|
|
2338
3313
|
function useMergedRef(...refs) {
|
|
2339
|
-
return
|
|
3314
|
+
return React38.useCallback(
|
|
2340
3315
|
(node) => {
|
|
2341
3316
|
for (const ref of refs) {
|
|
2342
3317
|
if (typeof ref === "function") {
|
|
@@ -2350,7 +3325,7 @@ function useMergedRef(...refs) {
|
|
|
2350
3325
|
[refs]
|
|
2351
3326
|
);
|
|
2352
3327
|
}
|
|
2353
|
-
var FlatLinearTrack =
|
|
3328
|
+
var FlatLinearTrack = React38.memo(function FlatLinearTrack2({
|
|
2354
3329
|
trackHeight,
|
|
2355
3330
|
activeColor,
|
|
2356
3331
|
trackColor,
|
|
@@ -2426,7 +3401,7 @@ var FlatLinearTrack = React31.memo(function FlatLinearTrack2({
|
|
|
2426
3401
|
}
|
|
2427
3402
|
);
|
|
2428
3403
|
});
|
|
2429
|
-
var WavyLinearTrack =
|
|
3404
|
+
var WavyLinearTrack = React38.memo(function WavyLinearTrack2({
|
|
2430
3405
|
trackHeight,
|
|
2431
3406
|
svgHeight,
|
|
2432
3407
|
amplitude,
|
|
@@ -2445,13 +3420,13 @@ var WavyLinearTrack = React31.memo(function WavyLinearTrack2({
|
|
|
2445
3420
|
}) {
|
|
2446
3421
|
const isDeterminate = typeof value === "number";
|
|
2447
3422
|
const clampedValue = isDeterminate ? Math.max(0, Math.min(100, value)) : 100;
|
|
2448
|
-
const titleId =
|
|
3423
|
+
const titleId = React38.useId();
|
|
2449
3424
|
const [containerRef, width] = useContainerWidth();
|
|
2450
|
-
const activePathRef =
|
|
2451
|
-
const trackPathRef =
|
|
3425
|
+
const activePathRef = React38.useRef(null);
|
|
3426
|
+
const trackPathRef = React38.useRef(null);
|
|
2452
3427
|
const amplitudeMV = useMotionValue(amplitude);
|
|
2453
3428
|
const fractionMV = useMotionValue(isDeterminate ? clampedValue / 100 : 1);
|
|
2454
|
-
|
|
3429
|
+
React38.useEffect(() => {
|
|
2455
3430
|
if (isDeterminate) {
|
|
2456
3431
|
const fraction = clampedValue / 100;
|
|
2457
3432
|
let targetAmp = amplitude;
|
|
@@ -2622,7 +3597,7 @@ var WavyLinearTrack = React31.memo(function WavyLinearTrack2({
|
|
|
2622
3597
|
}
|
|
2623
3598
|
);
|
|
2624
3599
|
});
|
|
2625
|
-
var LinearProgress =
|
|
3600
|
+
var LinearProgress = React38.forwardRef(
|
|
2626
3601
|
(_a, ref) => {
|
|
2627
3602
|
var _b = _a, {
|
|
2628
3603
|
value,
|
|
@@ -2663,10 +3638,10 @@ var LinearProgress = React31.forwardRef(
|
|
|
2663
3638
|
]);
|
|
2664
3639
|
const isDeterminate = value !== void 0;
|
|
2665
3640
|
const clampedValue = isDeterminate ? Math.min(100, Math.max(0, value)) : 0;
|
|
2666
|
-
const containerRef =
|
|
3641
|
+
const containerRef = React38.useRef(null);
|
|
2667
3642
|
const mergedRef = useMergedRef(ref, containerRef);
|
|
2668
|
-
const [isRtl, setIsRtl] =
|
|
2669
|
-
|
|
3643
|
+
const [isRtl, setIsRtl] = React38.useState(false);
|
|
3644
|
+
React38.useEffect(() => {
|
|
2670
3645
|
if (containerRef.current) {
|
|
2671
3646
|
const dir = getComputedStyle(containerRef.current).direction;
|
|
2672
3647
|
setIsRtl(dir === "rtl");
|
|
@@ -2674,16 +3649,16 @@ var LinearProgress = React31.forwardRef(
|
|
|
2674
3649
|
}, []);
|
|
2675
3650
|
const isWavy = shape === "wavy";
|
|
2676
3651
|
const resolvedTrackShape = trackShape != null ? trackShape : shape;
|
|
2677
|
-
const effectiveAmplitude =
|
|
2678
|
-
const svgHeight =
|
|
3652
|
+
const effectiveAmplitude = React38.useMemo(() => amplitude != null ? amplitude : 3, [amplitude]);
|
|
3653
|
+
const svgHeight = React38.useMemo(
|
|
2679
3654
|
() => isWavy ? trackHeight + effectiveAmplitude * 2 : trackHeight,
|
|
2680
3655
|
[isWavy, trackHeight, effectiveAmplitude]
|
|
2681
3656
|
);
|
|
2682
|
-
const shouldShowStop =
|
|
3657
|
+
const shouldShowStop = React38.useMemo(
|
|
2683
3658
|
() => isDeterminate && resolvedTrackShape === "flat" && (showStopIndicator === true || showStopIndicator === "auto" && isDeterminate),
|
|
2684
3659
|
[isDeterminate, resolvedTrackShape, showStopIndicator]
|
|
2685
3660
|
);
|
|
2686
|
-
const stopSize =
|
|
3661
|
+
const stopSize = React38.useMemo(
|
|
2687
3662
|
() => Math.max(2, trackHeight > 4 ? 4 : trackHeight / 2),
|
|
2688
3663
|
[trackHeight]
|
|
2689
3664
|
);
|
|
@@ -2756,14 +3731,14 @@ var LinearProgress = React31.forwardRef(
|
|
|
2756
3731
|
}
|
|
2757
3732
|
);
|
|
2758
3733
|
LinearProgress.displayName = "LinearProgress";
|
|
2759
|
-
var ProgressIndicator =
|
|
3734
|
+
var ProgressIndicator = React38.forwardRef((props, ref) => {
|
|
2760
3735
|
if (props.variant === "circular") {
|
|
2761
3736
|
return /* @__PURE__ */ jsx(CircularProgress, __spreadValues({ ref }, props));
|
|
2762
3737
|
}
|
|
2763
3738
|
return /* @__PURE__ */ jsx(LinearProgress, __spreadValues({ ref }, props));
|
|
2764
3739
|
});
|
|
2765
3740
|
ProgressIndicator.displayName = "ProgressIndicator";
|
|
2766
|
-
var RippleItem =
|
|
3741
|
+
var RippleItem = React38.memo(function RippleItem2({
|
|
2767
3742
|
ripple,
|
|
2768
3743
|
onDone
|
|
2769
3744
|
}) {
|
|
@@ -2807,8 +3782,8 @@ function Ripple({
|
|
|
2807
3782
|
}
|
|
2808
3783
|
function useRippleState(options = {}) {
|
|
2809
3784
|
const { disabled = false } = options;
|
|
2810
|
-
const [ripples, setRipples] =
|
|
2811
|
-
const onPointerDown =
|
|
3785
|
+
const [ripples, setRipples] = React38.useState([]);
|
|
3786
|
+
const onPointerDown = React38.useCallback(
|
|
2812
3787
|
(e) => {
|
|
2813
3788
|
if (disabled) return;
|
|
2814
3789
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -2822,7 +3797,7 @@ function useRippleState(options = {}) {
|
|
|
2822
3797
|
},
|
|
2823
3798
|
[disabled]
|
|
2824
3799
|
);
|
|
2825
|
-
const removeRipple =
|
|
3800
|
+
const removeRipple = React38.useCallback((id) => {
|
|
2826
3801
|
setRipples((prev) => prev.filter((r) => r.id !== id));
|
|
2827
3802
|
}, []);
|
|
2828
3803
|
return { ripples, onPointerDown, removeRipple };
|
|
@@ -2956,7 +3931,7 @@ function toSentenceCase(text) {
|
|
|
2956
3931
|
}
|
|
2957
3932
|
function resolveLabel(children, asChild) {
|
|
2958
3933
|
if (asChild) {
|
|
2959
|
-
const child =
|
|
3934
|
+
const child = React38.Children.only(children);
|
|
2960
3935
|
return child.props.children;
|
|
2961
3936
|
}
|
|
2962
3937
|
return typeof children === "string" ? toSentenceCase(children) : children;
|
|
@@ -3028,7 +4003,7 @@ function AnimatedIconSlot({
|
|
|
3028
4003
|
}
|
|
3029
4004
|
);
|
|
3030
4005
|
}
|
|
3031
|
-
var ButtonComponent =
|
|
4006
|
+
var ButtonComponent = React38.forwardRef(
|
|
3032
4007
|
(_a, ref) => {
|
|
3033
4008
|
var _b = _a, {
|
|
3034
4009
|
className,
|
|
@@ -3077,15 +4052,15 @@ var ButtonComponent = React31.forwardRef(
|
|
|
3077
4052
|
const { pressed: pressedRadius } = (_b2 = radiusMap[size]) != null ? _b2 : radiusMap.sm;
|
|
3078
4053
|
const iconClass = (_c = SIZE_ICON_CLASS[size]) != null ? _c : "size-5";
|
|
3079
4054
|
const mergedStyle = __spreadValues(__spreadValues({}, SIZE_STYLES[size]), style);
|
|
3080
|
-
const labelText =
|
|
4055
|
+
const labelText = React38.useMemo(
|
|
3081
4056
|
() => resolveLabel(children, asChild),
|
|
3082
4057
|
[children, asChild]
|
|
3083
4058
|
);
|
|
3084
4059
|
const computedAriaLabel = ariaLabelProp || (typeof children === "string" ? children : void 0);
|
|
3085
4060
|
const needsTouchTarget = size === "xs" || size === "sm";
|
|
3086
4061
|
const motionRadius = useMotionValue(animateRadius);
|
|
3087
|
-
const asChildRef =
|
|
3088
|
-
const mergedRef =
|
|
4062
|
+
const asChildRef = React38.useRef(null);
|
|
4063
|
+
const mergedRef = React38.useCallback(
|
|
3089
4064
|
(node) => {
|
|
3090
4065
|
asChildRef.current = node;
|
|
3091
4066
|
if (typeof ref === "function") ref(node);
|
|
@@ -3094,27 +4069,27 @@ var ButtonComponent = React31.forwardRef(
|
|
|
3094
4069
|
},
|
|
3095
4070
|
[ref]
|
|
3096
4071
|
);
|
|
3097
|
-
|
|
4072
|
+
React38.useEffect(
|
|
3098
4073
|
() => motionRadius.on("change", (v) => {
|
|
3099
4074
|
if (asChildRef.current)
|
|
3100
4075
|
asChildRef.current.style.borderRadius = `${v}px`;
|
|
3101
4076
|
}),
|
|
3102
4077
|
[motionRadius]
|
|
3103
4078
|
);
|
|
3104
|
-
|
|
4079
|
+
React38.useEffect(() => {
|
|
3105
4080
|
springAnimate(motionRadius, animateRadius);
|
|
3106
4081
|
}, [animateRadius, motionRadius]);
|
|
3107
4082
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
3108
4083
|
disabled: loading
|
|
3109
4084
|
});
|
|
3110
|
-
const handleClick =
|
|
4085
|
+
const handleClick = React38.useCallback(
|
|
3111
4086
|
(e) => {
|
|
3112
4087
|
if (loading) return e.preventDefault();
|
|
3113
4088
|
onClick == null ? void 0 : onClick(e);
|
|
3114
4089
|
},
|
|
3115
4090
|
[loading, onClick]
|
|
3116
4091
|
);
|
|
3117
|
-
const handleKeyDown =
|
|
4092
|
+
const handleKeyDown = React38.useCallback(
|
|
3118
4093
|
(e) => {
|
|
3119
4094
|
if (loading) return;
|
|
3120
4095
|
if (onClick && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -3157,7 +4132,7 @@ var ButtonComponent = React31.forwardRef(
|
|
|
3157
4132
|
] });
|
|
3158
4133
|
if (asChild) {
|
|
3159
4134
|
const htmlProps = stripMotionProps(restProps);
|
|
3160
|
-
const child =
|
|
4135
|
+
const child = React38.Children.only(children);
|
|
3161
4136
|
const handleAsChildPointerDown = (e) => {
|
|
3162
4137
|
springAnimate(motionRadius, pressedRadius);
|
|
3163
4138
|
onPointerDown == null ? void 0 : onPointerDown(e);
|
|
@@ -3181,7 +4156,7 @@ var ButtonComponent = React31.forwardRef(
|
|
|
3181
4156
|
}),
|
|
3182
4157
|
className: buttonClassName
|
|
3183
4158
|
}, htmlProps), {
|
|
3184
|
-
children:
|
|
4159
|
+
children: React38.cloneElement(child, { children: innerContent })
|
|
3185
4160
|
})
|
|
3186
4161
|
) });
|
|
3187
4162
|
}
|
|
@@ -3209,7 +4184,7 @@ var ButtonComponent = React31.forwardRef(
|
|
|
3209
4184
|
}
|
|
3210
4185
|
);
|
|
3211
4186
|
ButtonComponent.displayName = "Button";
|
|
3212
|
-
var Button =
|
|
4187
|
+
var Button = React38.memo(ButtonComponent);
|
|
3213
4188
|
var SIZE_PADDING_MAP = {
|
|
3214
4189
|
xs: "0.75rem",
|
|
3215
4190
|
sm: "1rem",
|
|
@@ -3238,7 +4213,7 @@ var PRESSED_RADIUS_MAP = {
|
|
|
3238
4213
|
lg: 28,
|
|
3239
4214
|
xl: 40
|
|
3240
4215
|
};
|
|
3241
|
-
var ButtonGroupComponent =
|
|
4216
|
+
var ButtonGroupComponent = React38.forwardRef(
|
|
3242
4217
|
(_a, ref) => {
|
|
3243
4218
|
var _b = _a, {
|
|
3244
4219
|
className,
|
|
@@ -3259,13 +4234,13 @@ var ButtonGroupComponent = React31.forwardRef(
|
|
|
3259
4234
|
"showCheck",
|
|
3260
4235
|
"children"
|
|
3261
4236
|
]);
|
|
3262
|
-
const [pressedIndex, setPressedIndex] =
|
|
3263
|
-
const childrenArray =
|
|
3264
|
-
() =>
|
|
4237
|
+
const [pressedIndex, setPressedIndex] = React38.useState(null);
|
|
4238
|
+
const childrenArray = React38.useMemo(
|
|
4239
|
+
() => React38.Children.toArray(children).filter(React38.isValidElement),
|
|
3265
4240
|
[children]
|
|
3266
4241
|
);
|
|
3267
4242
|
const count = childrenArray.length;
|
|
3268
|
-
const handlePointerLeaveAndUp =
|
|
4243
|
+
const handlePointerLeaveAndUp = React38.useCallback(() => {
|
|
3269
4244
|
setPressedIndex(null);
|
|
3270
4245
|
}, []);
|
|
3271
4246
|
return /* @__PURE__ */ jsx(
|
|
@@ -3404,7 +4379,7 @@ var ButtonGroupComponent = React31.forwardRef(
|
|
|
3404
4379
|
duration: 0.2
|
|
3405
4380
|
};
|
|
3406
4381
|
}
|
|
3407
|
-
return
|
|
4382
|
+
return React38.cloneElement(element, __spreadValues(__spreadProps(__spreadValues({
|
|
3408
4383
|
key: (_a2 = element.key) != null ? _a2 : index,
|
|
3409
4384
|
tabIndex: isFirst ? 0 : -1,
|
|
3410
4385
|
size: size || element.props.size,
|
|
@@ -3433,7 +4408,7 @@ var ButtonGroupComponent = React31.forwardRef(
|
|
|
3433
4408
|
}
|
|
3434
4409
|
);
|
|
3435
4410
|
ButtonGroupComponent.displayName = "ButtonGroup";
|
|
3436
|
-
var ButtonGroup =
|
|
4411
|
+
var ButtonGroup = React38.memo(ButtonGroupComponent);
|
|
3437
4412
|
var SHADOW = {
|
|
3438
4413
|
level0: "none",
|
|
3439
4414
|
level1: "0px 1px 2px 0px rgba(0,0,0,.3), 0px 1px 3px 1px rgba(0,0,0,.15)",
|
|
@@ -3492,7 +4467,7 @@ function useCardElevation(variant, disabled) {
|
|
|
3492
4467
|
}
|
|
3493
4468
|
};
|
|
3494
4469
|
}
|
|
3495
|
-
var CardImpl =
|
|
4470
|
+
var CardImpl = React38.forwardRef(
|
|
3496
4471
|
(_a, ref) => {
|
|
3497
4472
|
var _b = _a, {
|
|
3498
4473
|
className,
|
|
@@ -3590,7 +4565,7 @@ var CardImpl = React31.forwardRef(
|
|
|
3590
4565
|
}
|
|
3591
4566
|
);
|
|
3592
4567
|
CardImpl.displayName = "Card";
|
|
3593
|
-
var Card =
|
|
4568
|
+
var Card = React38.memo(CardImpl);
|
|
3594
4569
|
var MD3_STANDARD = [0.2, 0, 0, 1];
|
|
3595
4570
|
var MD3_FAST_EFFECTS = [0.3, 0, 1, 1];
|
|
3596
4571
|
var CHECKMARK_PATH = "M 4.5 9.5 L 7.5 12.5 L 13.5 5.5";
|
|
@@ -3604,7 +4579,7 @@ var NEXT_STATE = {
|
|
|
3604
4579
|
checked: "indeterminate",
|
|
3605
4580
|
indeterminate: "unchecked"
|
|
3606
4581
|
};
|
|
3607
|
-
var CheckboxVisual =
|
|
4582
|
+
var CheckboxVisual = React38.memo(function CheckboxVisual2({
|
|
3608
4583
|
isSelected,
|
|
3609
4584
|
isIndeterminate,
|
|
3610
4585
|
containerBg,
|
|
@@ -3675,7 +4650,7 @@ var CheckboxVisual = React31.memo(function CheckboxVisual2({
|
|
|
3675
4650
|
);
|
|
3676
4651
|
});
|
|
3677
4652
|
function useMergedRef2(externalRef, internalRef) {
|
|
3678
|
-
return
|
|
4653
|
+
return React38.useCallback(
|
|
3679
4654
|
(node) => {
|
|
3680
4655
|
internalRef.current = node;
|
|
3681
4656
|
if (!externalRef) return;
|
|
@@ -3688,7 +4663,7 @@ function useMergedRef2(externalRef, internalRef) {
|
|
|
3688
4663
|
[externalRef, internalRef]
|
|
3689
4664
|
);
|
|
3690
4665
|
}
|
|
3691
|
-
var CheckboxComponent =
|
|
4666
|
+
var CheckboxComponent = React38.forwardRef(
|
|
3692
4667
|
({
|
|
3693
4668
|
checked,
|
|
3694
4669
|
defaultChecked = false,
|
|
@@ -3710,20 +4685,20 @@ var CheckboxComponent = React31.forwardRef(
|
|
|
3710
4685
|
}, ref) => {
|
|
3711
4686
|
var _a;
|
|
3712
4687
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
3713
|
-
const generatedId =
|
|
4688
|
+
const generatedId = React38.useId();
|
|
3714
4689
|
const inputId = idProp != null ? idProp : label ? `checkbox-${generatedId}` : void 0;
|
|
3715
|
-
const [internalState, setInternalState] =
|
|
4690
|
+
const [internalState, setInternalState] = React38.useState(
|
|
3716
4691
|
() => defaultChecked ? "checked" : "unchecked"
|
|
3717
4692
|
);
|
|
3718
4693
|
const isControlled = stateProp !== void 0 || checked !== void 0;
|
|
3719
4694
|
const baseState = isControlled ? resolveState(checked, false, stateProp) : internalState;
|
|
3720
4695
|
const effectiveState = indeterminate ? "indeterminate" : baseState;
|
|
3721
|
-
const [ripples, setRipples] =
|
|
3722
|
-
const removeRipple =
|
|
4696
|
+
const [ripples, setRipples] = React38.useState([]);
|
|
4697
|
+
const removeRipple = React38.useCallback(
|
|
3723
4698
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
3724
4699
|
[]
|
|
3725
4700
|
);
|
|
3726
|
-
const onPointerDown =
|
|
4701
|
+
const onPointerDown = React38.useCallback(
|
|
3727
4702
|
(e) => {
|
|
3728
4703
|
if (disabled) return;
|
|
3729
4704
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -3737,7 +4712,7 @@ var CheckboxComponent = React31.forwardRef(
|
|
|
3737
4712
|
},
|
|
3738
4713
|
[disabled]
|
|
3739
4714
|
);
|
|
3740
|
-
const handleChange =
|
|
4715
|
+
const handleChange = React38.useCallback(
|
|
3741
4716
|
(e) => {
|
|
3742
4717
|
if (disabled) return;
|
|
3743
4718
|
if (stateProp !== void 0) {
|
|
@@ -3763,9 +4738,9 @@ var CheckboxComponent = React31.forwardRef(
|
|
|
3763
4738
|
onCheckedChange
|
|
3764
4739
|
]
|
|
3765
4740
|
);
|
|
3766
|
-
const inputRef =
|
|
4741
|
+
const inputRef = React38.useRef(null);
|
|
3767
4742
|
const mergedRef = useMergedRef2(ref, inputRef);
|
|
3768
|
-
|
|
4743
|
+
React38.useEffect(() => {
|
|
3769
4744
|
if (inputRef.current) {
|
|
3770
4745
|
inputRef.current.indeterminate = effectiveState === "indeterminate";
|
|
3771
4746
|
}
|
|
@@ -3890,13 +4865,13 @@ var CheckboxComponent = React31.forwardRef(
|
|
|
3890
4865
|
}
|
|
3891
4866
|
);
|
|
3892
4867
|
CheckboxComponent.displayName = "Checkbox";
|
|
3893
|
-
var Checkbox =
|
|
3894
|
-
var TriStateCheckboxComponent =
|
|
4868
|
+
var Checkbox = React38.memo(CheckboxComponent);
|
|
4869
|
+
var TriStateCheckboxComponent = React38.forwardRef((_a, ref) => {
|
|
3895
4870
|
var _b = _a, { state, onStateChange } = _b, rest = __objRest(_b, ["state", "onStateChange"]);
|
|
3896
4871
|
return /* @__PURE__ */ jsx(Checkbox, __spreadValues({ ref, state, onStateChange }, rest));
|
|
3897
4872
|
});
|
|
3898
4873
|
TriStateCheckboxComponent.displayName = "TriStateCheckbox";
|
|
3899
|
-
var TriStateCheckbox =
|
|
4874
|
+
var TriStateCheckbox = React38.memo(TriStateCheckboxComponent);
|
|
3900
4875
|
function CheckIcon({ className }) {
|
|
3901
4876
|
return /* @__PURE__ */ jsx(
|
|
3902
4877
|
"svg",
|
|
@@ -3990,7 +4965,7 @@ var chipVariants = cva(
|
|
|
3990
4965
|
defaultVariants: { variant: "assist" }
|
|
3991
4966
|
}
|
|
3992
4967
|
);
|
|
3993
|
-
var ChipImpl =
|
|
4968
|
+
var ChipImpl = React38.forwardRef(
|
|
3994
4969
|
(_a, ref) => {
|
|
3995
4970
|
var _b = _a, {
|
|
3996
4971
|
variant = "assist",
|
|
@@ -4026,7 +5001,7 @@ var ChipImpl = React31.forwardRef(
|
|
|
4026
5001
|
const showCheckmark = isFilter && selected;
|
|
4027
5002
|
const hasTrailingContent = !!trailingIcon || !!onRemove;
|
|
4028
5003
|
const hasLeadingContent = isFilter || !!resolvedLeadingIcon;
|
|
4029
|
-
const paddingClass =
|
|
5004
|
+
const paddingClass = React38.useMemo(
|
|
4030
5005
|
() => cn(
|
|
4031
5006
|
!isInput && !hasLeadingContent && !hasTrailingContent && "px-4",
|
|
4032
5007
|
!isInput && hasLeadingContent && !hasTrailingContent && "pl-2 pr-4",
|
|
@@ -4039,7 +5014,7 @@ var ChipImpl = React31.forwardRef(
|
|
|
4039
5014
|
),
|
|
4040
5015
|
[isInput, hasLeadingContent, hasTrailingContent]
|
|
4041
5016
|
);
|
|
4042
|
-
const stateClass =
|
|
5017
|
+
const stateClass = React38.useMemo(
|
|
4043
5018
|
() => cn(
|
|
4044
5019
|
(isFilter || isInput) && selected && "bg-m3-secondary-container text-m3-on-secondary-container border-none before:bg-m3-on-secondary-container",
|
|
4045
5020
|
elevated && !selected && "bg-m3-surface-container-low border-none elevation-1",
|
|
@@ -4050,7 +5025,7 @@ var ChipImpl = React31.forwardRef(
|
|
|
4050
5025
|
),
|
|
4051
5026
|
[isFilter, isInput, selected, elevated, disabled]
|
|
4052
5027
|
);
|
|
4053
|
-
const leadingIconColorClass =
|
|
5028
|
+
const leadingIconColorClass = React38.useMemo(
|
|
4054
5029
|
() => cn(
|
|
4055
5030
|
(variant === "assist" || variant === "suggestion") && "text-m3-primary",
|
|
4056
5031
|
isFilter && !selected && "text-m3-primary",
|
|
@@ -4061,7 +5036,7 @@ var ChipImpl = React31.forwardRef(
|
|
|
4061
5036
|
[variant, isFilter, isInput, selected]
|
|
4062
5037
|
);
|
|
4063
5038
|
const isCompound = !!onRemove;
|
|
4064
|
-
const
|
|
5039
|
+
const Root6 = isCompound ? "div" : "button";
|
|
4065
5040
|
const containerClass = cn(
|
|
4066
5041
|
chipVariants({ variant }),
|
|
4067
5042
|
!isCompound && paddingClass,
|
|
@@ -4131,7 +5106,7 @@ var ChipImpl = React31.forwardRef(
|
|
|
4131
5106
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: label })
|
|
4132
5107
|
] });
|
|
4133
5108
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
4134
|
-
|
|
5109
|
+
Root6,
|
|
4135
5110
|
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
4136
5111
|
ref: !isCompound ? ref : void 0,
|
|
4137
5112
|
type: !isCompound ? "button" : void 0
|
|
@@ -4222,8 +5197,8 @@ var ChipImpl = React31.forwardRef(
|
|
|
4222
5197
|
}
|
|
4223
5198
|
);
|
|
4224
5199
|
ChipImpl.displayName = "Chip";
|
|
4225
|
-
var Chip =
|
|
4226
|
-
var ScrollArea =
|
|
5200
|
+
var Chip = React38.memo(ChipImpl);
|
|
5201
|
+
var ScrollArea = React38.forwardRef(
|
|
4227
5202
|
(_a, ref) => {
|
|
4228
5203
|
var _b = _a, {
|
|
4229
5204
|
className,
|
|
@@ -4282,7 +5257,7 @@ var ScrollArea = React31.forwardRef(
|
|
|
4282
5257
|
}
|
|
4283
5258
|
);
|
|
4284
5259
|
ScrollArea.displayName = "ScrollArea";
|
|
4285
|
-
var ScrollAreaScrollbar =
|
|
5260
|
+
var ScrollAreaScrollbar = React38.forwardRef((_a, ref) => {
|
|
4286
5261
|
var _b = _a, { className, orientation = "vertical" } = _b, props = __objRest(_b, ["className", "orientation"]);
|
|
4287
5262
|
return /* @__PURE__ */ jsx(
|
|
4288
5263
|
RadixScrollArea.Scrollbar,
|
|
@@ -4312,7 +5287,7 @@ var ScrollAreaScrollbar = React31.forwardRef((_a, ref) => {
|
|
|
4312
5287
|
);
|
|
4313
5288
|
});
|
|
4314
5289
|
ScrollAreaScrollbar.displayName = RadixScrollArea.Scrollbar.displayName;
|
|
4315
|
-
var ScrollAreaCorner =
|
|
5290
|
+
var ScrollAreaCorner = React38.forwardRef((_a, ref) => {
|
|
4316
5291
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4317
5292
|
return /* @__PURE__ */ jsx(
|
|
4318
5293
|
RadixScrollArea.Corner,
|
|
@@ -4589,7 +5564,7 @@ function resolveDisabledBgClass(colorStyle) {
|
|
|
4589
5564
|
}
|
|
4590
5565
|
return "disabled:text-m3-on-surface/[0.38]";
|
|
4591
5566
|
}
|
|
4592
|
-
var IconButtonComponent =
|
|
5567
|
+
var IconButtonComponent = React38.forwardRef(
|
|
4593
5568
|
(_a, ref) => {
|
|
4594
5569
|
var _b = _a, {
|
|
4595
5570
|
className,
|
|
@@ -4623,18 +5598,18 @@ var IconButtonComponent = React31.forwardRef(
|
|
|
4623
5598
|
var _a2, _b2;
|
|
4624
5599
|
const isToggle = variant === "toggle";
|
|
4625
5600
|
const isSelected = isToggle && !!selected;
|
|
4626
|
-
const resolvedColorClass =
|
|
5601
|
+
const resolvedColorClass = React38.useMemo(
|
|
4627
5602
|
() => isSelected ? colorStyles[colorStyle].selected : colorStyles[colorStyle].default,
|
|
4628
5603
|
[isSelected, colorStyle]
|
|
4629
5604
|
);
|
|
4630
|
-
const outlineWidthClass =
|
|
5605
|
+
const outlineWidthClass = React38.useMemo(
|
|
4631
5606
|
() => {
|
|
4632
5607
|
var _a3;
|
|
4633
5608
|
return colorStyle === "outlined" && !isSelected ? (_a3 = SIZE_OUTLINE_WIDTH[size]) != null ? _a3 : "border" : "";
|
|
4634
5609
|
},
|
|
4635
5610
|
[colorStyle, isSelected, size]
|
|
4636
5611
|
);
|
|
4637
|
-
const disabledBgClass =
|
|
5612
|
+
const disabledBgClass = React38.useMemo(
|
|
4638
5613
|
() => resolveDisabledBgClass(colorStyle),
|
|
4639
5614
|
[colorStyle]
|
|
4640
5615
|
);
|
|
@@ -4653,7 +5628,7 @@ var IconButtonComponent = React31.forwardRef(
|
|
|
4653
5628
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
4654
5629
|
disabled: loading
|
|
4655
5630
|
});
|
|
4656
|
-
const handleClick =
|
|
5631
|
+
const handleClick = React38.useCallback(
|
|
4657
5632
|
(e) => {
|
|
4658
5633
|
if (loading) {
|
|
4659
5634
|
e.preventDefault();
|
|
@@ -4663,7 +5638,7 @@ var IconButtonComponent = React31.forwardRef(
|
|
|
4663
5638
|
},
|
|
4664
5639
|
[loading, onClick]
|
|
4665
5640
|
);
|
|
4666
|
-
const handleKeyDown =
|
|
5641
|
+
const handleKeyDown = React38.useCallback(
|
|
4667
5642
|
(e) => {
|
|
4668
5643
|
if (loading) return;
|
|
4669
5644
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -4751,7 +5726,7 @@ var IconButtonComponent = React31.forwardRef(
|
|
|
4751
5726
|
}
|
|
4752
5727
|
);
|
|
4753
5728
|
IconButtonComponent.displayName = "IconButton";
|
|
4754
|
-
var IconButton =
|
|
5729
|
+
var IconButton = React38.memo(IconButtonComponent);
|
|
4755
5730
|
var MD3_SPRING = {
|
|
4756
5731
|
type: "spring",
|
|
4757
5732
|
stiffness: 400,
|
|
@@ -4788,9 +5763,9 @@ DialogTrigger.displayName = "DialogTrigger";
|
|
|
4788
5763
|
var DialogPortal = ({
|
|
4789
5764
|
open,
|
|
4790
5765
|
children
|
|
4791
|
-
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ?
|
|
5766
|
+
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: open ? React38.Children.toArray(children) : null }) });
|
|
4792
5767
|
DialogPortal.displayName = "DialogPortal";
|
|
4793
|
-
var DialogOverlay =
|
|
5768
|
+
var DialogOverlay = React38.forwardRef((_a, ref) => {
|
|
4794
5769
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
4795
5770
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
4796
5771
|
m.div,
|
|
@@ -4801,7 +5776,7 @@ var DialogOverlay = React31.forwardRef((_a, ref) => {
|
|
|
4801
5776
|
) }));
|
|
4802
5777
|
});
|
|
4803
5778
|
DialogOverlay.displayName = "DialogOverlay";
|
|
4804
|
-
var DialogContent =
|
|
5779
|
+
var DialogContent = React38.forwardRef((_a, ref) => {
|
|
4805
5780
|
var _b = _a, { className, children, hideCloseButton = false } = _b, props = __objRest(_b, ["className", "children", "hideCloseButton"]);
|
|
4806
5781
|
return /* @__PURE__ */ jsx(
|
|
4807
5782
|
RadixDialog.Content,
|
|
@@ -4841,7 +5816,7 @@ var DialogContent = React31.forwardRef((_a, ref) => {
|
|
|
4841
5816
|
);
|
|
4842
5817
|
});
|
|
4843
5818
|
DialogContent.displayName = "DialogContent";
|
|
4844
|
-
var DialogIcon =
|
|
5819
|
+
var DialogIcon = React38.forwardRef((_a, ref) => {
|
|
4845
5820
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
4846
5821
|
return /* @__PURE__ */ jsx(
|
|
4847
5822
|
"div",
|
|
@@ -4864,7 +5839,7 @@ var DialogHeader = (_a) => {
|
|
|
4864
5839
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mb-4", className) }, props));
|
|
4865
5840
|
};
|
|
4866
5841
|
DialogHeader.displayName = "DialogHeader";
|
|
4867
|
-
var DialogTitle =
|
|
5842
|
+
var DialogTitle = React38.forwardRef((_a, ref) => {
|
|
4868
5843
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
4869
5844
|
return /* @__PURE__ */ jsx(
|
|
4870
5845
|
RadixDialog.Title,
|
|
@@ -4879,7 +5854,7 @@ var DialogTitle = React31.forwardRef((_a, ref) => {
|
|
|
4879
5854
|
);
|
|
4880
5855
|
});
|
|
4881
5856
|
DialogTitle.displayName = "DialogTitle";
|
|
4882
|
-
var DialogDescription =
|
|
5857
|
+
var DialogDescription = React38.forwardRef((_a, ref) => {
|
|
4883
5858
|
var _b = _a, { className, asChild } = _b, props = __objRest(_b, ["className", "asChild"]);
|
|
4884
5859
|
return /* @__PURE__ */ jsx(
|
|
4885
5860
|
RadixDialog.Description,
|
|
@@ -4891,7 +5866,7 @@ var DialogDescription = React31.forwardRef((_a, ref) => {
|
|
|
4891
5866
|
);
|
|
4892
5867
|
});
|
|
4893
5868
|
DialogDescription.displayName = "DialogDescription";
|
|
4894
|
-
var DialogBody =
|
|
5869
|
+
var DialogBody = React38.forwardRef((_a, ref) => {
|
|
4895
5870
|
var _b = _a, { className, children, dir } = _b, props = __objRest(_b, ["className", "children", "dir"]);
|
|
4896
5871
|
return /* @__PURE__ */ jsx(
|
|
4897
5872
|
ScrollArea,
|
|
@@ -4922,7 +5897,7 @@ var DialogFooter = (_a) => {
|
|
|
4922
5897
|
};
|
|
4923
5898
|
DialogFooter.displayName = "DialogFooter";
|
|
4924
5899
|
var DialogClose = RadixDialog.Close;
|
|
4925
|
-
var DialogFullScreenContent =
|
|
5900
|
+
var DialogFullScreenContent = React38.forwardRef(
|
|
4926
5901
|
(_a, ref) => {
|
|
4927
5902
|
var _b = _a, {
|
|
4928
5903
|
className,
|
|
@@ -5005,7 +5980,7 @@ function buildWavePath(startX, endX, amplitude = 2, wavelength = 32, yCenter = 4
|
|
|
5005
5980
|
}
|
|
5006
5981
|
return d;
|
|
5007
5982
|
}
|
|
5008
|
-
var DividerImpl =
|
|
5983
|
+
var DividerImpl = React38.forwardRef(
|
|
5009
5984
|
(_a, ref) => {
|
|
5010
5985
|
var _b = _a, {
|
|
5011
5986
|
variant = "full-bleed",
|
|
@@ -5125,7 +6100,7 @@ var DividerImpl = React31.forwardRef(
|
|
|
5125
6100
|
}
|
|
5126
6101
|
);
|
|
5127
6102
|
DividerImpl.displayName = "Divider";
|
|
5128
|
-
var Divider =
|
|
6103
|
+
var Divider = React38.memo(DividerImpl);
|
|
5129
6104
|
var MD3_DRAWER_SPRING = {
|
|
5130
6105
|
type: "spring",
|
|
5131
6106
|
stiffness: 350,
|
|
@@ -5162,7 +6137,7 @@ var DrawerPortal = ({
|
|
|
5162
6137
|
open,
|
|
5163
6138
|
children
|
|
5164
6139
|
}) => /* @__PURE__ */ jsx(RadixDialog.Portal, { forceMount: true, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: open && children }) });
|
|
5165
|
-
var DrawerOverlay =
|
|
6140
|
+
var DrawerOverlay = React38.forwardRef((_a, ref) => {
|
|
5166
6141
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5167
6142
|
return /* @__PURE__ */ jsx(RadixDialog.Overlay, __spreadProps(__spreadValues({ ref, asChild: true }, props), { children: /* @__PURE__ */ jsx(
|
|
5168
6143
|
m.div,
|
|
@@ -5173,7 +6148,7 @@ var DrawerOverlay = React31.forwardRef((_a, ref) => {
|
|
|
5173
6148
|
) }));
|
|
5174
6149
|
});
|
|
5175
6150
|
DrawerOverlay.displayName = "DrawerOverlay";
|
|
5176
|
-
var DrawerContent =
|
|
6151
|
+
var DrawerContent = React38.forwardRef(
|
|
5177
6152
|
(_a, ref) => {
|
|
5178
6153
|
var _b = _a, {
|
|
5179
6154
|
className,
|
|
@@ -5252,7 +6227,7 @@ var DrawerFooter = (_a) => {
|
|
|
5252
6227
|
return /* @__PURE__ */ jsx("div", __spreadValues({ className: cn("flex flex-col gap-2 mt-4", className) }, props));
|
|
5253
6228
|
};
|
|
5254
6229
|
DrawerFooter.displayName = "DrawerFooter";
|
|
5255
|
-
var DrawerTitle =
|
|
6230
|
+
var DrawerTitle = React38.forwardRef((_a, ref) => {
|
|
5256
6231
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5257
6232
|
return /* @__PURE__ */ jsx(
|
|
5258
6233
|
RadixDialog.Title,
|
|
@@ -5266,7 +6241,7 @@ var DrawerTitle = React31.forwardRef((_a, ref) => {
|
|
|
5266
6241
|
);
|
|
5267
6242
|
});
|
|
5268
6243
|
DrawerTitle.displayName = "DrawerTitle";
|
|
5269
|
-
var DrawerDescription =
|
|
6244
|
+
var DrawerDescription = React38.forwardRef((_a, ref) => {
|
|
5270
6245
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5271
6246
|
return /* @__PURE__ */ jsx(
|
|
5272
6247
|
RadixDialog.Description,
|
|
@@ -5347,7 +6322,7 @@ function FABPosition({
|
|
|
5347
6322
|
}
|
|
5348
6323
|
);
|
|
5349
6324
|
}
|
|
5350
|
-
var FABComponent =
|
|
6325
|
+
var FABComponent = React38.forwardRef(
|
|
5351
6326
|
(_a, ref) => {
|
|
5352
6327
|
var _b = _a, {
|
|
5353
6328
|
className,
|
|
@@ -5392,7 +6367,7 @@ var FABComponent = React31.forwardRef(
|
|
|
5392
6367
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
5393
6368
|
disabled: loading
|
|
5394
6369
|
});
|
|
5395
|
-
const handleClick =
|
|
6370
|
+
const handleClick = React38.useCallback(
|
|
5396
6371
|
(e) => {
|
|
5397
6372
|
if (loading) {
|
|
5398
6373
|
e.preventDefault();
|
|
@@ -5402,7 +6377,7 @@ var FABComponent = React31.forwardRef(
|
|
|
5402
6377
|
},
|
|
5403
6378
|
[loading, onClick]
|
|
5404
6379
|
);
|
|
5405
|
-
const handleKeyDown =
|
|
6380
|
+
const handleKeyDown = React38.useCallback(
|
|
5406
6381
|
(e) => {
|
|
5407
6382
|
if (loading) return;
|
|
5408
6383
|
if ((e.key === "Enter" || e.key === " ") && onClick) {
|
|
@@ -5511,7 +6486,7 @@ var FABComponent = React31.forwardRef(
|
|
|
5511
6486
|
}
|
|
5512
6487
|
);
|
|
5513
6488
|
FABComponent.displayName = "FAB";
|
|
5514
|
-
var FAB =
|
|
6489
|
+
var FAB = React38.memo(FABComponent);
|
|
5515
6490
|
var SPRING_NORMAL = { stiffness: 700, damping: 40 };
|
|
5516
6491
|
var SPRING_REDUCED = { stiffness: 1e4, damping: 100 };
|
|
5517
6492
|
var FOCUS_DELAY_MS = 50;
|
|
@@ -5576,7 +6551,7 @@ var ALIGNMENT_TRANSFORM_ORIGIN = {
|
|
|
5576
6551
|
center: "bottom"
|
|
5577
6552
|
};
|
|
5578
6553
|
var ITEM_SPRING = { type: "spring", stiffness: 700, damping: 25 };
|
|
5579
|
-
var
|
|
6554
|
+
var MENU_CONTAINER_VARIANTS2 = {
|
|
5580
6555
|
open: { transition: { staggerChildren: 0.033, staggerDirection: 1 } },
|
|
5581
6556
|
closed: { transition: { staggerChildren: 0.02, staggerDirection: -1 } }
|
|
5582
6557
|
};
|
|
@@ -5619,7 +6594,7 @@ function CloseIcon3() {
|
|
|
5619
6594
|
function defaultFabIcon(progress) {
|
|
5620
6595
|
return progress > 0.5 ? /* @__PURE__ */ jsx(CloseIcon3, {}) : /* @__PURE__ */ jsx(AddIcon, {});
|
|
5621
6596
|
}
|
|
5622
|
-
var ToggleFABComponent =
|
|
6597
|
+
var ToggleFABComponent = React38.forwardRef(
|
|
5623
6598
|
({
|
|
5624
6599
|
expanded,
|
|
5625
6600
|
onToggle,
|
|
@@ -5637,7 +6612,7 @@ var ToggleFABComponent = React31.forwardRef(
|
|
|
5637
6612
|
const sizeTokens = (_b = TOGGLE_FAB_SIZES[fabSize]) != null ? _b : TOGGLE_FAB_SIZES.baseline;
|
|
5638
6613
|
const springConfig = prefersReduced ? SPRING_REDUCED : SPRING_NORMAL;
|
|
5639
6614
|
const checkedProgress = useSpring(expanded ? 1 : 0, springConfig);
|
|
5640
|
-
|
|
6615
|
+
React38.useEffect(() => {
|
|
5641
6616
|
checkedProgress.set(expanded ? 1 : 0);
|
|
5642
6617
|
}, [expanded, checkedProgress]);
|
|
5643
6618
|
const borderRadius = useTransform(
|
|
@@ -5645,12 +6620,12 @@ var ToggleFABComponent = React31.forwardRef(
|
|
|
5645
6620
|
[0, 1],
|
|
5646
6621
|
[`${sizeTokens.initialRadius}px`, `${sizeTokens.finalRadius}px`]
|
|
5647
6622
|
);
|
|
5648
|
-
const [iconProgress, setIconProgress] =
|
|
5649
|
-
|
|
6623
|
+
const [iconProgress, setIconProgress] = React38.useState(expanded ? 1 : 0);
|
|
6624
|
+
React38.useEffect(() => {
|
|
5650
6625
|
return checkedProgress.on("change", setIconProgress);
|
|
5651
6626
|
}, [checkedProgress]);
|
|
5652
6627
|
const { ripples, onPointerDown, removeRipple } = useRippleState();
|
|
5653
|
-
const handleClick =
|
|
6628
|
+
const handleClick = React38.useCallback(() => {
|
|
5654
6629
|
onToggle(!expanded);
|
|
5655
6630
|
}, [expanded, onToggle]);
|
|
5656
6631
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5699,7 +6674,7 @@ var ToggleFABComponent = React31.forwardRef(
|
|
|
5699
6674
|
}
|
|
5700
6675
|
);
|
|
5701
6676
|
ToggleFABComponent.displayName = "ToggleFAB";
|
|
5702
|
-
var ToggleFAB =
|
|
6677
|
+
var ToggleFAB = React38.memo(ToggleFABComponent);
|
|
5703
6678
|
function FABMenuItem({
|
|
5704
6679
|
icon,
|
|
5705
6680
|
label,
|
|
@@ -5712,7 +6687,7 @@ function FABMenuItem({
|
|
|
5712
6687
|
var _a;
|
|
5713
6688
|
const colors = (_a = MENU_ITEM_COLORS[colorVariant]) != null ? _a : MENU_ITEM_COLORS.primary;
|
|
5714
6689
|
const { ripples, onPointerDown, removeRipple } = useRippleState({ disabled });
|
|
5715
|
-
const handleClick =
|
|
6690
|
+
const handleClick = React38.useCallback(
|
|
5716
6691
|
(e) => {
|
|
5717
6692
|
if (disabled) {
|
|
5718
6693
|
e.preventDefault();
|
|
@@ -5722,7 +6697,7 @@ function FABMenuItem({
|
|
|
5722
6697
|
},
|
|
5723
6698
|
[disabled, onClick]
|
|
5724
6699
|
);
|
|
5725
|
-
const handleKeyDown =
|
|
6700
|
+
const handleKeyDown = React38.useCallback(
|
|
5726
6701
|
(e) => {
|
|
5727
6702
|
if (disabled) return;
|
|
5728
6703
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -5789,13 +6764,13 @@ function FABMenu({
|
|
|
5789
6764
|
focusLast = true,
|
|
5790
6765
|
"aria-label": ariaLabel
|
|
5791
6766
|
}) {
|
|
5792
|
-
const fabId =
|
|
5793
|
-
const menuId =
|
|
5794
|
-
const toggleRef =
|
|
5795
|
-
const itemRefs =
|
|
5796
|
-
const [focusedIndex, setFocusedIndex] =
|
|
5797
|
-
const reversedItems =
|
|
5798
|
-
const focusItem =
|
|
6767
|
+
const fabId = React38.useId();
|
|
6768
|
+
const menuId = React38.useId();
|
|
6769
|
+
const toggleRef = React38.useRef(null);
|
|
6770
|
+
const itemRefs = React38.useRef([]);
|
|
6771
|
+
const [focusedIndex, setFocusedIndex] = React38.useState(-1);
|
|
6772
|
+
const reversedItems = React38.useMemo(() => [...items].reverse(), [items]);
|
|
6773
|
+
const focusItem = React38.useCallback((index) => {
|
|
5799
6774
|
var _a;
|
|
5800
6775
|
const clampedIndex = Math.max(
|
|
5801
6776
|
0,
|
|
@@ -5804,8 +6779,8 @@ function FABMenu({
|
|
|
5804
6779
|
setFocusedIndex(clampedIndex);
|
|
5805
6780
|
(_a = itemRefs.current[clampedIndex]) == null ? void 0 : _a.focus();
|
|
5806
6781
|
}, []);
|
|
5807
|
-
const wasExpandedRef =
|
|
5808
|
-
|
|
6782
|
+
const wasExpandedRef = React38.useRef(false);
|
|
6783
|
+
React38.useEffect(() => {
|
|
5809
6784
|
var _a;
|
|
5810
6785
|
if (expanded) {
|
|
5811
6786
|
wasExpandedRef.current = true;
|
|
@@ -5820,7 +6795,7 @@ function FABMenu({
|
|
|
5820
6795
|
wasExpandedRef.current = false;
|
|
5821
6796
|
setFocusedIndex(-1);
|
|
5822
6797
|
}, [expanded, focusLast, items.length, focusItem]);
|
|
5823
|
-
const handleMenuKeyDown =
|
|
6798
|
+
const handleMenuKeyDown = React38.useCallback(
|
|
5824
6799
|
(e) => {
|
|
5825
6800
|
if (!expanded) return;
|
|
5826
6801
|
const lastIndex = items.length - 1;
|
|
@@ -5881,7 +6856,7 @@ function FABMenu({
|
|
|
5881
6856
|
role: "menu",
|
|
5882
6857
|
"aria-labelledby": fabId,
|
|
5883
6858
|
"aria-orientation": "vertical",
|
|
5884
|
-
variants:
|
|
6859
|
+
variants: MENU_CONTAINER_VARIANTS2,
|
|
5885
6860
|
initial: "closed",
|
|
5886
6861
|
animate: "open",
|
|
5887
6862
|
exit: "closed",
|
|
@@ -5944,7 +6919,7 @@ function FABMenu({
|
|
|
5944
6919
|
)
|
|
5945
6920
|
] });
|
|
5946
6921
|
}
|
|
5947
|
-
var NavigationRailContext =
|
|
6922
|
+
var NavigationRailContext = React38.createContext({ variant: "collapsed", labelVisibility: "labeled", xr: false });
|
|
5948
6923
|
var MD3_MODAL_TRANSITION = {
|
|
5949
6924
|
type: "tween",
|
|
5950
6925
|
ease: [0.05, 0.7, 0.1, 1],
|
|
@@ -5980,9 +6955,9 @@ var railContainerVariants = cva(
|
|
|
5980
6955
|
}
|
|
5981
6956
|
);
|
|
5982
6957
|
function cloneIconWithFill(icon, selected) {
|
|
5983
|
-
if (!
|
|
6958
|
+
if (!React38.isValidElement(icon)) return icon;
|
|
5984
6959
|
if (icon.type === Icon) {
|
|
5985
|
-
return
|
|
6960
|
+
return React38.cloneElement(
|
|
5986
6961
|
icon,
|
|
5987
6962
|
{ fill: selected ? 1 : 0, animateFill: true }
|
|
5988
6963
|
);
|
|
@@ -6040,7 +7015,7 @@ function IconContainer({ selected, badge, children }) {
|
|
|
6040
7015
|
}
|
|
6041
7016
|
);
|
|
6042
7017
|
}
|
|
6043
|
-
var NavigationRailItemComponent =
|
|
7018
|
+
var NavigationRailItemComponent = React38.forwardRef(
|
|
6044
7019
|
({
|
|
6045
7020
|
selected,
|
|
6046
7021
|
icon,
|
|
@@ -6051,18 +7026,18 @@ var NavigationRailItemComponent = React31.forwardRef(
|
|
|
6051
7026
|
className,
|
|
6052
7027
|
"aria-label": ariaLabelProp
|
|
6053
7028
|
}, ref) => {
|
|
6054
|
-
const { variant, labelVisibility } =
|
|
7029
|
+
const { variant, labelVisibility } = React38.useContext(
|
|
6055
7030
|
NavigationRailContext
|
|
6056
7031
|
);
|
|
6057
7032
|
const isExpanded = variant === "expanded" || variant === "modal";
|
|
6058
7033
|
const isModal = variant === "modal";
|
|
6059
7034
|
const enableLayout = !isModal;
|
|
6060
|
-
const activePillId = `rail-pill-${
|
|
7035
|
+
const activePillId = `rail-pill-${React38.useId()}`;
|
|
6061
7036
|
const { ripples, onPointerDown, removeRipple } = useRippleState({
|
|
6062
7037
|
disabled
|
|
6063
7038
|
});
|
|
6064
7039
|
const showLabel = isExpanded || labelVisibility === "labeled" || labelVisibility === "auto" && selected;
|
|
6065
|
-
const handleClick =
|
|
7040
|
+
const handleClick = React38.useCallback(
|
|
6066
7041
|
(e) => {
|
|
6067
7042
|
if (disabled) {
|
|
6068
7043
|
e.preventDefault();
|
|
@@ -6164,9 +7139,9 @@ var NavigationRailItemComponent = React31.forwardRef(
|
|
|
6164
7139
|
}
|
|
6165
7140
|
);
|
|
6166
7141
|
NavigationRailItemComponent.displayName = "NavigationRailItem";
|
|
6167
|
-
var NavigationRailItem =
|
|
7142
|
+
var NavigationRailItem = React38.memo(NavigationRailItemComponent);
|
|
6168
7143
|
function useRoving(navRef) {
|
|
6169
|
-
|
|
7144
|
+
React38.useEffect(() => {
|
|
6170
7145
|
if (!navRef.current) return;
|
|
6171
7146
|
const items = getMenuItems(navRef.current);
|
|
6172
7147
|
const selected = items.find(
|
|
@@ -6176,7 +7151,7 @@ function useRoving(navRef) {
|
|
|
6176
7151
|
const firstFocusable = selected != null ? selected : items[0];
|
|
6177
7152
|
if (firstFocusable) firstFocusable.tabIndex = 0;
|
|
6178
7153
|
}, [navRef]);
|
|
6179
|
-
return
|
|
7154
|
+
return React38.useCallback(
|
|
6180
7155
|
(e) => {
|
|
6181
7156
|
if (!navRef.current) return;
|
|
6182
7157
|
const items = getMenuItems(navRef.current);
|
|
@@ -6204,7 +7179,7 @@ function useRoving(navRef) {
|
|
|
6204
7179
|
[navRef]
|
|
6205
7180
|
);
|
|
6206
7181
|
}
|
|
6207
|
-
var NavigationRailComponent =
|
|
7182
|
+
var NavigationRailComponent = React38.forwardRef(
|
|
6208
7183
|
({
|
|
6209
7184
|
variant = "collapsed",
|
|
6210
7185
|
labelVisibility = "labeled",
|
|
@@ -6224,9 +7199,9 @@ var NavigationRailComponent = React31.forwardRef(
|
|
|
6224
7199
|
const xrMode = xr === "spatialized" ? "spatialized" : "contained";
|
|
6225
7200
|
const isSpatial = isXr && xrMode === "spatialized";
|
|
6226
7201
|
const applyAnimation = !isXr || !isSpatial;
|
|
6227
|
-
const navRef =
|
|
7202
|
+
const navRef = React38.useRef(null);
|
|
6228
7203
|
const handleKeyDown = useRoving(navRef);
|
|
6229
|
-
const setRefs =
|
|
7204
|
+
const setRefs = React38.useCallback(
|
|
6230
7205
|
(node) => {
|
|
6231
7206
|
navRef.current = node;
|
|
6232
7207
|
if (typeof ref === "function") ref(node);
|
|
@@ -6319,7 +7294,7 @@ var NavigationRailComponent = React31.forwardRef(
|
|
|
6319
7294
|
children: fab
|
|
6320
7295
|
}
|
|
6321
7296
|
),
|
|
6322
|
-
|
|
7297
|
+
React38.cloneElement(
|
|
6323
7298
|
navElement,
|
|
6324
7299
|
{
|
|
6325
7300
|
className: cn(navBaseClasses, "pointer-events-auto")
|
|
@@ -6357,13 +7332,13 @@ var NavigationRailComponent = React31.forwardRef(
|
|
|
6357
7332
|
}
|
|
6358
7333
|
);
|
|
6359
7334
|
NavigationRailComponent.displayName = "NavigationRail";
|
|
6360
|
-
var NavigationRail =
|
|
7335
|
+
var NavigationRail = React38.memo(NavigationRailComponent);
|
|
6361
7336
|
var MD3_FAST_EFFECTS2 = [0.3, 0, 1, 1];
|
|
6362
|
-
var RadioGroupContext =
|
|
7337
|
+
var RadioGroupContext = React38.createContext(
|
|
6363
7338
|
null
|
|
6364
7339
|
);
|
|
6365
7340
|
function useMergedRef3(externalRef, internalRef) {
|
|
6366
|
-
return
|
|
7341
|
+
return React38.useCallback(
|
|
6367
7342
|
(node) => {
|
|
6368
7343
|
internalRef.current = node;
|
|
6369
7344
|
if (!externalRef) return;
|
|
@@ -6376,7 +7351,7 @@ function useMergedRef3(externalRef, internalRef) {
|
|
|
6376
7351
|
[externalRef, internalRef]
|
|
6377
7352
|
);
|
|
6378
7353
|
}
|
|
6379
|
-
var RadioVisual =
|
|
7354
|
+
var RadioVisual = React38.memo(function RadioVisual2({
|
|
6380
7355
|
isSelected,
|
|
6381
7356
|
disabled,
|
|
6382
7357
|
error,
|
|
@@ -6429,7 +7404,7 @@ var RadioVisual = React31.memo(function RadioVisual2({
|
|
|
6429
7404
|
}
|
|
6430
7405
|
);
|
|
6431
7406
|
});
|
|
6432
|
-
var RadioButtonComponent =
|
|
7407
|
+
var RadioButtonComponent = React38.forwardRef(
|
|
6433
7408
|
({
|
|
6434
7409
|
selected,
|
|
6435
7410
|
defaultSelected = false,
|
|
@@ -6448,23 +7423,23 @@ var RadioButtonComponent = React31.forwardRef(
|
|
|
6448
7423
|
required: requiredProp
|
|
6449
7424
|
}, ref) => {
|
|
6450
7425
|
var _a, _b;
|
|
6451
|
-
const group =
|
|
7426
|
+
const group = React38.useContext(RadioGroupContext);
|
|
6452
7427
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
6453
|
-
const generatedId =
|
|
7428
|
+
const generatedId = React38.useId();
|
|
6454
7429
|
const inputId = idProp != null ? idProp : label ? `radio-${generatedId}` : void 0;
|
|
6455
7430
|
const name = (_b = group == null ? void 0 : group.name) != null ? _b : nameProp;
|
|
6456
7431
|
const disabled = (group == null ? void 0 : group.disabled) || disabledProp;
|
|
6457
7432
|
const error = (group == null ? void 0 : group.error) || errorProp || color === "error";
|
|
6458
7433
|
const required = (group == null ? void 0 : group.required) || requiredProp;
|
|
6459
|
-
const [internalSelected, setInternalSelected] =
|
|
7434
|
+
const [internalSelected, setInternalSelected] = React38.useState(defaultSelected);
|
|
6460
7435
|
const isControlled = selected !== void 0;
|
|
6461
7436
|
const isSelected = group ? group.selectedValue === value : isControlled ? selected != null ? selected : false : internalSelected;
|
|
6462
|
-
const [ripples, setRipples] =
|
|
6463
|
-
const removeRipple =
|
|
7437
|
+
const [ripples, setRipples] = React38.useState([]);
|
|
7438
|
+
const removeRipple = React38.useCallback(
|
|
6464
7439
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
6465
7440
|
[]
|
|
6466
7441
|
);
|
|
6467
|
-
const onPointerDown =
|
|
7442
|
+
const onPointerDown = React38.useCallback(
|
|
6468
7443
|
(e) => {
|
|
6469
7444
|
if (disabled) return;
|
|
6470
7445
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
@@ -6478,12 +7453,12 @@ var RadioButtonComponent = React31.forwardRef(
|
|
|
6478
7453
|
},
|
|
6479
7454
|
[disabled]
|
|
6480
7455
|
);
|
|
6481
|
-
const [isHovered, setIsHovered] =
|
|
6482
|
-
const onPointerEnter =
|
|
7456
|
+
const [isHovered, setIsHovered] = React38.useState(false);
|
|
7457
|
+
const onPointerEnter = React38.useCallback(() => {
|
|
6483
7458
|
if (!disabled) setIsHovered(true);
|
|
6484
7459
|
}, [disabled]);
|
|
6485
|
-
const onPointerLeave =
|
|
6486
|
-
const handleChange =
|
|
7460
|
+
const onPointerLeave = React38.useCallback(() => setIsHovered(false), []);
|
|
7461
|
+
const handleChange = React38.useCallback(
|
|
6487
7462
|
(_e) => {
|
|
6488
7463
|
if (disabled || onClick === null) return;
|
|
6489
7464
|
if (group) {
|
|
@@ -6497,7 +7472,7 @@ var RadioButtonComponent = React31.forwardRef(
|
|
|
6497
7472
|
},
|
|
6498
7473
|
[disabled, onClick, group, value, isControlled]
|
|
6499
7474
|
);
|
|
6500
|
-
const inputRef =
|
|
7475
|
+
const inputRef = React38.useRef(null);
|
|
6501
7476
|
const mergedRef = useMergedRef3(ref, inputRef);
|
|
6502
7477
|
const stateLayerBg = error ? "before:bg-m3-error" : "before:bg-m3-primary";
|
|
6503
7478
|
const stateLayerClass = cn(
|
|
@@ -6608,8 +7583,8 @@ var RadioButtonComponent = React31.forwardRef(
|
|
|
6608
7583
|
}
|
|
6609
7584
|
);
|
|
6610
7585
|
RadioButtonComponent.displayName = "RadioButton";
|
|
6611
|
-
var RadioButton =
|
|
6612
|
-
var RadioGroupComponent =
|
|
7586
|
+
var RadioButton = React38.memo(RadioButtonComponent);
|
|
7587
|
+
var RadioGroupComponent = React38.forwardRef(
|
|
6613
7588
|
({
|
|
6614
7589
|
name,
|
|
6615
7590
|
value: valueProp,
|
|
@@ -6624,19 +7599,19 @@ var RadioGroupComponent = React31.forwardRef(
|
|
|
6624
7599
|
children,
|
|
6625
7600
|
className
|
|
6626
7601
|
}, ref) => {
|
|
6627
|
-
const [internalValue, setInternalValue] =
|
|
7602
|
+
const [internalValue, setInternalValue] = React38.useState(defaultValue);
|
|
6628
7603
|
const isControlled = valueProp !== void 0;
|
|
6629
7604
|
const selectedValue = isControlled ? valueProp : internalValue;
|
|
6630
|
-
const handleValueChange =
|
|
7605
|
+
const handleValueChange = React38.useCallback(
|
|
6631
7606
|
(val) => {
|
|
6632
7607
|
if (!isControlled) setInternalValue(val);
|
|
6633
7608
|
onValueChange == null ? void 0 : onValueChange(val);
|
|
6634
7609
|
},
|
|
6635
7610
|
[isControlled, onValueChange]
|
|
6636
7611
|
);
|
|
6637
|
-
const groupRef =
|
|
7612
|
+
const groupRef = React38.useRef(null);
|
|
6638
7613
|
const mergedRef = useMergedRef3(ref, groupRef);
|
|
6639
|
-
const onKeyDown =
|
|
7614
|
+
const onKeyDown = React38.useCallback(
|
|
6640
7615
|
(e) => {
|
|
6641
7616
|
var _a, _b;
|
|
6642
7617
|
if (disabled) return;
|
|
@@ -6660,7 +7635,7 @@ var RadioGroupComponent = React31.forwardRef(
|
|
|
6660
7635
|
},
|
|
6661
7636
|
[disabled, handleValueChange]
|
|
6662
7637
|
);
|
|
6663
|
-
const contextValue =
|
|
7638
|
+
const contextValue = React38.useMemo(
|
|
6664
7639
|
() => ({
|
|
6665
7640
|
name,
|
|
6666
7641
|
selectedValue,
|
|
@@ -6695,7 +7670,7 @@ var RadioGroupComponent = React31.forwardRef(
|
|
|
6695
7670
|
}
|
|
6696
7671
|
);
|
|
6697
7672
|
RadioGroupComponent.displayName = "RadioGroup";
|
|
6698
|
-
var
|
|
7673
|
+
var RadioGroup = React38.memo(RadioGroupComponent);
|
|
6699
7674
|
function useSearchKeyboard({
|
|
6700
7675
|
active,
|
|
6701
7676
|
onActiveChange,
|
|
@@ -6704,14 +7679,14 @@ function useSearchKeyboard({
|
|
|
6704
7679
|
itemCount,
|
|
6705
7680
|
onSelectSuggestion
|
|
6706
7681
|
}) {
|
|
6707
|
-
const [activeIndex, setActiveIndex] =
|
|
6708
|
-
const resetKeyRef =
|
|
7682
|
+
const [activeIndex, setActiveIndex] = React38.useState(-1);
|
|
7683
|
+
const resetKeyRef = React38.useRef(`${active}:${query}`);
|
|
6709
7684
|
const currentKey = `${active}:${query}`;
|
|
6710
7685
|
if (resetKeyRef.current !== currentKey) {
|
|
6711
7686
|
resetKeyRef.current = currentKey;
|
|
6712
7687
|
setActiveIndex(-1);
|
|
6713
7688
|
}
|
|
6714
|
-
const handleKeyDown =
|
|
7689
|
+
const handleKeyDown = React38.useCallback(
|
|
6715
7690
|
(e) => {
|
|
6716
7691
|
if (!active) return;
|
|
6717
7692
|
switch (e.key) {
|
|
@@ -6751,7 +7726,7 @@ function useSearchKeyboard({
|
|
|
6751
7726
|
query
|
|
6752
7727
|
]
|
|
6753
7728
|
);
|
|
6754
|
-
const resetActiveIndex =
|
|
7729
|
+
const resetActiveIndex = React38.useCallback(() => {
|
|
6755
7730
|
setActiveIndex(-1);
|
|
6756
7731
|
}, []);
|
|
6757
7732
|
return { activeIndex, handleKeyDown, resetActiveIndex };
|
|
@@ -6839,10 +7814,10 @@ function AnimatedPlaceholder({
|
|
|
6839
7814
|
className
|
|
6840
7815
|
}) {
|
|
6841
7816
|
const shouldReduceMotion = useReducedMotion();
|
|
6842
|
-
const containerRef =
|
|
6843
|
-
const spanRef =
|
|
6844
|
-
const [xOffset, setXOffset] =
|
|
6845
|
-
const recalculate =
|
|
7817
|
+
const containerRef = React38.useRef(null);
|
|
7818
|
+
const spanRef = React38.useRef(null);
|
|
7819
|
+
const [xOffset, setXOffset] = React38.useState(0);
|
|
7820
|
+
const recalculate = React38.useCallback(() => {
|
|
6846
7821
|
const container = containerRef.current;
|
|
6847
7822
|
const span = spanRef.current;
|
|
6848
7823
|
if (!container || !span || textAlign === "left") {
|
|
@@ -6857,10 +7832,10 @@ function AnimatedPlaceholder({
|
|
|
6857
7832
|
setXOffset(Math.max(0, containerWidth - textWidth));
|
|
6858
7833
|
}
|
|
6859
7834
|
}, [textAlign]);
|
|
6860
|
-
|
|
7835
|
+
React38.useLayoutEffect(() => {
|
|
6861
7836
|
recalculate();
|
|
6862
7837
|
}, [recalculate]);
|
|
6863
|
-
|
|
7838
|
+
React38.useEffect(() => {
|
|
6864
7839
|
const container = containerRef.current;
|
|
6865
7840
|
if (!container) return;
|
|
6866
7841
|
const observer = new ResizeObserver(recalculate);
|
|
@@ -6929,10 +7904,10 @@ function SearchBar({
|
|
|
6929
7904
|
activeIndex
|
|
6930
7905
|
}) {
|
|
6931
7906
|
const shouldReduceMotion = useReducedMotion();
|
|
6932
|
-
const inputRef =
|
|
6933
|
-
const prevActiveRef =
|
|
6934
|
-
const isRestoringFocusRef =
|
|
6935
|
-
|
|
7907
|
+
const inputRef = React38.useRef(null);
|
|
7908
|
+
const prevActiveRef = React38.useRef(active);
|
|
7909
|
+
const isRestoringFocusRef = React38.useRef(false);
|
|
7910
|
+
React38.useEffect(() => {
|
|
6936
7911
|
var _a;
|
|
6937
7912
|
let rafId;
|
|
6938
7913
|
if (prevActiveRef.current === true && active === false) {
|
|
@@ -7051,7 +8026,7 @@ function SearchBar({
|
|
|
7051
8026
|
) })
|
|
7052
8027
|
);
|
|
7053
8028
|
}
|
|
7054
|
-
var SearchContext =
|
|
8029
|
+
var SearchContext = React38.createContext(null);
|
|
7055
8030
|
function SearchProvider({
|
|
7056
8031
|
children,
|
|
7057
8032
|
value
|
|
@@ -7059,7 +8034,7 @@ function SearchProvider({
|
|
|
7059
8034
|
return /* @__PURE__ */ jsx(SearchContext.Provider, { value, children });
|
|
7060
8035
|
}
|
|
7061
8036
|
function useSearch() {
|
|
7062
|
-
const context =
|
|
8037
|
+
const context = React38.useContext(SearchContext);
|
|
7063
8038
|
if (!context) {
|
|
7064
8039
|
return { listboxId: "", activeIndex: -1 };
|
|
7065
8040
|
}
|
|
@@ -7086,7 +8061,7 @@ function useClickOutside(handler, enabled = true) {
|
|
|
7086
8061
|
return ref;
|
|
7087
8062
|
}
|
|
7088
8063
|
function useSearchViewFocus(inputRef, active) {
|
|
7089
|
-
|
|
8064
|
+
React38.useEffect(() => {
|
|
7090
8065
|
if (!active) return;
|
|
7091
8066
|
let raf2;
|
|
7092
8067
|
const raf1 = requestAnimationFrame(() => {
|
|
@@ -7160,7 +8135,7 @@ function SearchViewDocked({
|
|
|
7160
8135
|
activeIndex
|
|
7161
8136
|
}) {
|
|
7162
8137
|
const shouldReduceMotion = useReducedMotion();
|
|
7163
|
-
const inputRef =
|
|
8138
|
+
const inputRef = React38.useRef(null);
|
|
7164
8139
|
useSearchViewFocus(inputRef, active);
|
|
7165
8140
|
const dropdownRef = useClickOutside(() => {
|
|
7166
8141
|
onActiveChange(false);
|
|
@@ -7306,10 +8281,10 @@ function SearchViewFullScreen({
|
|
|
7306
8281
|
activeIndex
|
|
7307
8282
|
}) {
|
|
7308
8283
|
const shouldReduceMotion = useReducedMotion();
|
|
7309
|
-
const inputRef =
|
|
8284
|
+
const inputRef = React38.useRef(null);
|
|
7310
8285
|
useSearchViewFocus(inputRef, active);
|
|
7311
|
-
const [mounted, setMounted] =
|
|
7312
|
-
|
|
8286
|
+
const [mounted, setMounted] = React38.useState(false);
|
|
8287
|
+
React38.useEffect(() => {
|
|
7313
8288
|
setMounted(true);
|
|
7314
8289
|
}, []);
|
|
7315
8290
|
const handleFormSubmit = (e) => {
|
|
@@ -7467,10 +8442,10 @@ function SearchComponent({
|
|
|
7467
8442
|
className,
|
|
7468
8443
|
viewClassName
|
|
7469
8444
|
}) {
|
|
7470
|
-
const generatedId =
|
|
8445
|
+
const generatedId = React38.useId();
|
|
7471
8446
|
const searchId = id != null ? id : generatedId;
|
|
7472
8447
|
const listboxId = `${searchId}-listbox`;
|
|
7473
|
-
const itemCount =
|
|
8448
|
+
const itemCount = React38.Children.count(children);
|
|
7474
8449
|
const { activeIndex, handleKeyDown } = useSearchKeyboard({
|
|
7475
8450
|
active,
|
|
7476
8451
|
onActiveChange,
|
|
@@ -7706,7 +8681,7 @@ var SLIDER_INDICATOR_TRANSITION = {
|
|
|
7706
8681
|
stiffness: 450,
|
|
7707
8682
|
damping: 32
|
|
7708
8683
|
};
|
|
7709
|
-
var ValueIndicator =
|
|
8684
|
+
var ValueIndicator = React38.memo(function ValueIndicator2({
|
|
7710
8685
|
value,
|
|
7711
8686
|
visible,
|
|
7712
8687
|
orientation,
|
|
@@ -7753,7 +8728,7 @@ var ValueIndicator = React31.memo(function ValueIndicator2({
|
|
|
7753
8728
|
"value-indicator"
|
|
7754
8729
|
) });
|
|
7755
8730
|
});
|
|
7756
|
-
var SliderThumb =
|
|
8731
|
+
var SliderThumb = React38.memo(function SliderThumb2({
|
|
7757
8732
|
value,
|
|
7758
8733
|
percent,
|
|
7759
8734
|
min,
|
|
@@ -7785,11 +8760,11 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7785
8760
|
[posTarget]: `calc(${trackInset}px + ${percent} * (100% - ${trackInset * 2}px))`
|
|
7786
8761
|
};
|
|
7787
8762
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
7788
|
-
const [isDragging, setIsDragging] =
|
|
7789
|
-
const [isHovered, setIsHovered] =
|
|
7790
|
-
const [isFocused, setIsFocused] =
|
|
7791
|
-
const pointerIdRef =
|
|
7792
|
-
const thumbRef =
|
|
8763
|
+
const [isDragging, setIsDragging] = React38.useState(false);
|
|
8764
|
+
const [isHovered, setIsHovered] = React38.useState(false);
|
|
8765
|
+
const [isFocused, setIsFocused] = React38.useState(false);
|
|
8766
|
+
const pointerIdRef = React38.useRef(null);
|
|
8767
|
+
const thumbRef = React38.useRef(null);
|
|
7793
8768
|
const showIndicator = showValueIndicator && (isDragging || isHovered || isFocused);
|
|
7794
8769
|
const positionStyle = isHorizontal ? __spreadProps(__spreadValues({
|
|
7795
8770
|
position: "absolute"
|
|
@@ -7804,7 +8779,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7804
8779
|
transform: "translate(-50%, 50%)",
|
|
7805
8780
|
zIndex
|
|
7806
8781
|
});
|
|
7807
|
-
const getDeltaFromPointer =
|
|
8782
|
+
const getDeltaFromPointer = React38.useCallback(
|
|
7808
8783
|
(e) => {
|
|
7809
8784
|
const trackEl = trackRef.current;
|
|
7810
8785
|
if (!trackEl) return percent;
|
|
@@ -7831,7 +8806,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7831
8806
|
},
|
|
7832
8807
|
[isHorizontal, max, min, percent, step, trackRef, trackSize]
|
|
7833
8808
|
);
|
|
7834
|
-
const handlePointerDown =
|
|
8809
|
+
const handlePointerDown = React38.useCallback(
|
|
7835
8810
|
(e) => {
|
|
7836
8811
|
if (disabled) return;
|
|
7837
8812
|
e.preventDefault();
|
|
@@ -7842,7 +8817,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7842
8817
|
},
|
|
7843
8818
|
[disabled]
|
|
7844
8819
|
);
|
|
7845
|
-
const handlePointerMove =
|
|
8820
|
+
const handlePointerMove = React38.useCallback(
|
|
7846
8821
|
(e) => {
|
|
7847
8822
|
if (!isDragging || e.pointerId !== pointerIdRef.current) return;
|
|
7848
8823
|
const newValue = getDeltaFromPointer(e.nativeEvent);
|
|
@@ -7850,7 +8825,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7850
8825
|
},
|
|
7851
8826
|
[isDragging, getDeltaFromPointer, onValueChange]
|
|
7852
8827
|
);
|
|
7853
|
-
const handlePointerUp =
|
|
8828
|
+
const handlePointerUp = React38.useCallback(
|
|
7854
8829
|
(e) => {
|
|
7855
8830
|
if (e.pointerId !== pointerIdRef.current) return;
|
|
7856
8831
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
@@ -7860,7 +8835,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7860
8835
|
},
|
|
7861
8836
|
[onValueChangeEnd, value]
|
|
7862
8837
|
);
|
|
7863
|
-
const handleKeyDown =
|
|
8838
|
+
const handleKeyDown = React38.useCallback(
|
|
7864
8839
|
(e) => {
|
|
7865
8840
|
if (disabled) return;
|
|
7866
8841
|
if (e.key === "Home") {
|
|
@@ -7964,7 +8939,7 @@ var SliderThumb = React31.memo(function SliderThumb2({
|
|
|
7964
8939
|
}
|
|
7965
8940
|
);
|
|
7966
8941
|
});
|
|
7967
|
-
var RangeTrack =
|
|
8942
|
+
var RangeTrack = React38.memo(function RangeTrack2({
|
|
7968
8943
|
startPercent,
|
|
7969
8944
|
endPercent,
|
|
7970
8945
|
trackSize,
|
|
@@ -8209,7 +9184,7 @@ var RangeTrack = React31.memo(function RangeTrack2({
|
|
|
8209
9184
|
}
|
|
8210
9185
|
);
|
|
8211
9186
|
});
|
|
8212
|
-
var RangeSliderComponent =
|
|
9187
|
+
var RangeSliderComponent = React38.forwardRef(
|
|
8213
9188
|
({
|
|
8214
9189
|
value: controlledValue,
|
|
8215
9190
|
defaultValue,
|
|
@@ -8233,7 +9208,7 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8233
9208
|
const isHorizontal = orientation === "horizontal";
|
|
8234
9209
|
const defaultStart = (_a = defaultValue == null ? void 0 : defaultValue[0]) != null ? _a : min;
|
|
8235
9210
|
const defaultEnd = (_b = defaultValue == null ? void 0 : defaultValue[1]) != null ? _b : max;
|
|
8236
|
-
const [internalValue, setInternalValue] =
|
|
9211
|
+
const [internalValue, setInternalValue] = React38.useState([
|
|
8237
9212
|
defaultStart,
|
|
8238
9213
|
defaultEnd
|
|
8239
9214
|
]);
|
|
@@ -8247,10 +9222,10 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8247
9222
|
const endValue = snap(coerce(resolvedValue[1]));
|
|
8248
9223
|
const startPercent = toPercent(startValue);
|
|
8249
9224
|
const endPercent = toPercent(endValue);
|
|
8250
|
-
const [topThumb, setTopThumb] =
|
|
8251
|
-
const trackRef =
|
|
9225
|
+
const [topThumb, setTopThumb] = React38.useState("end");
|
|
9226
|
+
const trackRef = React38.useRef(null);
|
|
8252
9227
|
const minGap = step > 0 ? step : (max - min) / 1e3;
|
|
8253
|
-
const handleStartChange =
|
|
9228
|
+
const handleStartChange = React38.useCallback(
|
|
8254
9229
|
(newStart) => {
|
|
8255
9230
|
setTopThumb("start");
|
|
8256
9231
|
const clamped = Math.min(newStart, endValue - minGap);
|
|
@@ -8262,7 +9237,7 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8262
9237
|
},
|
|
8263
9238
|
[controlledValue, coerce, endValue, minGap, onValueChange, snap]
|
|
8264
9239
|
);
|
|
8265
|
-
const handleEndChange =
|
|
9240
|
+
const handleEndChange = React38.useCallback(
|
|
8266
9241
|
(newEnd) => {
|
|
8267
9242
|
setTopThumb("end");
|
|
8268
9243
|
const clamped = Math.max(newEnd, startValue + minGap);
|
|
@@ -8274,15 +9249,15 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8274
9249
|
},
|
|
8275
9250
|
[controlledValue, coerce, minGap, onValueChange, snap, startValue]
|
|
8276
9251
|
);
|
|
8277
|
-
const handleStartChangeEnd =
|
|
9252
|
+
const handleStartChangeEnd = React38.useCallback(
|
|
8278
9253
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([v, endValue]),
|
|
8279
9254
|
[endValue, onValueChangeEnd]
|
|
8280
9255
|
);
|
|
8281
|
-
const handleEndChangeEnd =
|
|
9256
|
+
const handleEndChangeEnd = React38.useCallback(
|
|
8282
9257
|
(v) => onValueChangeEnd == null ? void 0 : onValueChangeEnd([startValue, v]),
|
|
8283
9258
|
[onValueChangeEnd, startValue]
|
|
8284
9259
|
);
|
|
8285
|
-
const handleTrackPointerDown =
|
|
9260
|
+
const handleTrackPointerDown = React38.useCallback(
|
|
8286
9261
|
(e) => {
|
|
8287
9262
|
if (disabled) return;
|
|
8288
9263
|
const trackEl = trackRef.current;
|
|
@@ -8326,7 +9301,7 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8326
9301
|
trackSize
|
|
8327
9302
|
]
|
|
8328
9303
|
);
|
|
8329
|
-
const id =
|
|
9304
|
+
const id = React38.useId();
|
|
8330
9305
|
return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsxs(
|
|
8331
9306
|
"div",
|
|
8332
9307
|
{
|
|
@@ -8406,7 +9381,7 @@ var RangeSliderComponent = React31.forwardRef(
|
|
|
8406
9381
|
}
|
|
8407
9382
|
);
|
|
8408
9383
|
RangeSliderComponent.displayName = "RangeSlider";
|
|
8409
|
-
var RangeSlider =
|
|
9384
|
+
var RangeSlider = React38.memo(RangeSliderComponent);
|
|
8410
9385
|
function getHorizontalRadius(isLeading, innerR, outerR) {
|
|
8411
9386
|
if (isLeading) {
|
|
8412
9387
|
return {
|
|
@@ -8445,7 +9420,7 @@ var allInnerRadius = (innerR) => ({
|
|
|
8445
9420
|
borderTopRightRadius: innerR,
|
|
8446
9421
|
borderBottomRightRadius: innerR
|
|
8447
9422
|
});
|
|
8448
|
-
var InsetIcon =
|
|
9423
|
+
var InsetIcon = React38.memo(function InsetIcon2({
|
|
8449
9424
|
icon,
|
|
8450
9425
|
isOnActiveSegment,
|
|
8451
9426
|
position,
|
|
@@ -8539,7 +9514,7 @@ function Ticks({
|
|
|
8539
9514
|
return /* @__PURE__ */ jsx("div", { style, "aria-hidden": "true" }, tick);
|
|
8540
9515
|
}) });
|
|
8541
9516
|
}
|
|
8542
|
-
var SliderTrack =
|
|
9517
|
+
var SliderTrack = React38.memo(function SliderTrack2({
|
|
8543
9518
|
percent,
|
|
8544
9519
|
trackSize,
|
|
8545
9520
|
orientation,
|
|
@@ -8574,8 +9549,8 @@ var SliderTrack = React31.memo(function SliderTrack2({
|
|
|
8574
9549
|
const gapWithThumbStr = `${thumbGap + thumbHalfWidth}px`;
|
|
8575
9550
|
const hasAnyInsetIcon = Boolean(insetIcon || insetIconTrailing);
|
|
8576
9551
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
8577
|
-
const [trackWidth, setTrackWidth] =
|
|
8578
|
-
|
|
9552
|
+
const [trackWidth, setTrackWidth] = React38.useState(0);
|
|
9553
|
+
React38.useLayoutEffect(() => {
|
|
8579
9554
|
const el = trackRef.current;
|
|
8580
9555
|
if (!el || !hasAnyInsetIcon) return;
|
|
8581
9556
|
setTrackWidth(isHorizontal ? el.clientWidth : el.clientHeight);
|
|
@@ -8592,8 +9567,8 @@ var SliderTrack = React31.memo(function SliderTrack2({
|
|
|
8592
9567
|
const iconTotalWidth = activeIconSize + SliderTokens.insetIconPadding * 2 + thumbGap + thumbHalfWidth;
|
|
8593
9568
|
const iconThreshold = trackWidth > 0 ? iconTotalWidth / trackWidth : 0.15;
|
|
8594
9569
|
const HYSTERESIS_GAP = 0.04;
|
|
8595
|
-
const trailingActiveRef =
|
|
8596
|
-
const leadingActiveRef =
|
|
9570
|
+
const trailingActiveRef = React38.useRef(1 - percent <= iconThreshold);
|
|
9571
|
+
const leadingActiveRef = React38.useRef(percent > iconThreshold);
|
|
8597
9572
|
const trailingPercent = 1 - percent;
|
|
8598
9573
|
if (trailingActiveRef.current) {
|
|
8599
9574
|
if (trailingPercent > iconThreshold + HYSTERESIS_GAP) {
|
|
@@ -9100,7 +10075,7 @@ var SliderTrack = React31.memo(function SliderTrack2({
|
|
|
9100
10075
|
}
|
|
9101
10076
|
);
|
|
9102
10077
|
});
|
|
9103
|
-
var SliderComponent =
|
|
10078
|
+
var SliderComponent = React38.forwardRef(
|
|
9104
10079
|
({
|
|
9105
10080
|
value: controlledValue,
|
|
9106
10081
|
defaultValue,
|
|
@@ -9129,7 +10104,7 @@ var SliderComponent = React31.forwardRef(
|
|
|
9129
10104
|
const isHorizontal = orientation === "horizontal";
|
|
9130
10105
|
const midpoint = min + (max - min) / 2;
|
|
9131
10106
|
const initialValue = defaultValue != null ? defaultValue : midpoint;
|
|
9132
|
-
const [internalValue, setInternalValue] =
|
|
10107
|
+
const [internalValue, setInternalValue] = React38.useState(initialValue);
|
|
9133
10108
|
const resolvedValue = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
9134
10109
|
const { coerce, snap, toPercent, ticks } = useSliderMath({
|
|
9135
10110
|
min,
|
|
@@ -9138,8 +10113,8 @@ var SliderComponent = React31.forwardRef(
|
|
|
9138
10113
|
});
|
|
9139
10114
|
const safeValue = snap(coerce(resolvedValue));
|
|
9140
10115
|
const percent = toPercent(safeValue);
|
|
9141
|
-
const trackRef =
|
|
9142
|
-
const handleValueChange =
|
|
10116
|
+
const trackRef = React38.useRef(null);
|
|
10117
|
+
const handleValueChange = React38.useCallback(
|
|
9143
10118
|
(newValue) => {
|
|
9144
10119
|
const clamped = snap(coerce(newValue));
|
|
9145
10120
|
if (controlledValue === void 0) {
|
|
@@ -9149,13 +10124,13 @@ var SliderComponent = React31.forwardRef(
|
|
|
9149
10124
|
},
|
|
9150
10125
|
[coerce, controlledValue, onValueChange, snap]
|
|
9151
10126
|
);
|
|
9152
|
-
const handleValueChangeEnd =
|
|
10127
|
+
const handleValueChangeEnd = React38.useCallback(
|
|
9153
10128
|
(newValue) => {
|
|
9154
10129
|
onValueChangeEnd == null ? void 0 : onValueChangeEnd(snap(coerce(newValue)));
|
|
9155
10130
|
},
|
|
9156
10131
|
[coerce, onValueChangeEnd, snap]
|
|
9157
10132
|
);
|
|
9158
|
-
const handleTrackPointerDown =
|
|
10133
|
+
const handleTrackPointerDown = React38.useCallback(
|
|
9159
10134
|
(e) => {
|
|
9160
10135
|
if (disabled) return;
|
|
9161
10136
|
const trackEl = trackRef.current;
|
|
@@ -9190,7 +10165,7 @@ var SliderComponent = React31.forwardRef(
|
|
|
9190
10165
|
trackSize
|
|
9191
10166
|
]
|
|
9192
10167
|
);
|
|
9193
|
-
const id =
|
|
10168
|
+
const id = React38.useId();
|
|
9194
10169
|
const thumbId = `slider-thumb-${id}`;
|
|
9195
10170
|
const supportsInsetIcon = !isCentered && SliderTokens.trackSizes[trackSize] >= 40;
|
|
9196
10171
|
const hasAnyInsetIcon = !!(insetIcon || insetIconTrailing);
|
|
@@ -9262,7 +10237,7 @@ var SliderComponent = React31.forwardRef(
|
|
|
9262
10237
|
}
|
|
9263
10238
|
);
|
|
9264
10239
|
SliderComponent.displayName = "Slider";
|
|
9265
|
-
var Slider =
|
|
10240
|
+
var Slider = React38.memo(SliderComponent);
|
|
9266
10241
|
var DURATION_MAP = {
|
|
9267
10242
|
short: 4e3,
|
|
9268
10243
|
long: 7e3
|
|
@@ -9308,9 +10283,9 @@ function toSnackbarData(item) {
|
|
|
9308
10283
|
return { id: generateId(), visuals: item.visuals, resolve: item.resolve };
|
|
9309
10284
|
}
|
|
9310
10285
|
function useSnackbarState() {
|
|
9311
|
-
const [current, setCurrent] =
|
|
9312
|
-
const queueRef =
|
|
9313
|
-
const showSnackbar =
|
|
10286
|
+
const [current, setCurrent] = React38.useState(null);
|
|
10287
|
+
const queueRef = React38.useRef([]);
|
|
10288
|
+
const showSnackbar = React38.useCallback(
|
|
9314
10289
|
(visuals) => {
|
|
9315
10290
|
return new Promise((resolve) => {
|
|
9316
10291
|
const item = { visuals, resolve };
|
|
@@ -9323,14 +10298,14 @@ function useSnackbarState() {
|
|
|
9323
10298
|
},
|
|
9324
10299
|
[]
|
|
9325
10300
|
);
|
|
9326
|
-
const _dismiss =
|
|
10301
|
+
const _dismiss = React38.useCallback((result) => {
|
|
9327
10302
|
setCurrent((prev) => {
|
|
9328
10303
|
if (prev) prev.resolve(result);
|
|
9329
10304
|
const next = queueRef.current.shift();
|
|
9330
10305
|
return next ? toSnackbarData(next) : null;
|
|
9331
10306
|
});
|
|
9332
10307
|
}, []);
|
|
9333
|
-
|
|
10308
|
+
React38.useEffect(() => {
|
|
9334
10309
|
return () => {
|
|
9335
10310
|
for (const item of queueRef.current) {
|
|
9336
10311
|
item.resolve(RESULT.DISMISSED);
|
|
@@ -9340,7 +10315,7 @@ function useSnackbarState() {
|
|
|
9340
10315
|
}, []);
|
|
9341
10316
|
return { current, showSnackbar, _dismiss };
|
|
9342
10317
|
}
|
|
9343
|
-
var Snackbar =
|
|
10318
|
+
var Snackbar = React38.memo(function Snackbar2({
|
|
9344
10319
|
data,
|
|
9345
10320
|
className
|
|
9346
10321
|
}) {
|
|
@@ -9354,15 +10329,15 @@ var Snackbar = React31.memo(function Snackbar2({
|
|
|
9354
10329
|
} = visuals;
|
|
9355
10330
|
const reducedMotion = useReducedMotion();
|
|
9356
10331
|
const durationMs = resolveDuration(duration);
|
|
9357
|
-
|
|
10332
|
+
React38.useEffect(() => {
|
|
9358
10333
|
const timer = setTimeout(() => resolve(RESULT.DISMISSED), durationMs);
|
|
9359
10334
|
return () => clearTimeout(timer);
|
|
9360
10335
|
}, [resolve, durationMs]);
|
|
9361
|
-
const handleAction =
|
|
10336
|
+
const handleAction = React38.useCallback(
|
|
9362
10337
|
() => resolve(RESULT.ACTION),
|
|
9363
10338
|
[resolve]
|
|
9364
10339
|
);
|
|
9365
|
-
const handleDismiss =
|
|
10340
|
+
const handleDismiss = React38.useCallback(
|
|
9366
10341
|
() => resolve(RESULT.DISMISSED),
|
|
9367
10342
|
[resolve]
|
|
9368
10343
|
);
|
|
@@ -9430,7 +10405,7 @@ var Snackbar = React31.memo(function Snackbar2({
|
|
|
9430
10405
|
Snackbar.displayName = "Snackbar";
|
|
9431
10406
|
function SnackbarHost({ state, className }) {
|
|
9432
10407
|
const { current, _dismiss } = state;
|
|
9433
|
-
const wrappedData =
|
|
10408
|
+
const wrappedData = React38.useMemo(() => {
|
|
9434
10409
|
if (!current) return null;
|
|
9435
10410
|
return __spreadProps(__spreadValues({}, current), { resolve: _dismiss });
|
|
9436
10411
|
}, [current, _dismiss]);
|
|
@@ -9448,12 +10423,12 @@ function SnackbarHost({ state, className }) {
|
|
|
9448
10423
|
) });
|
|
9449
10424
|
}
|
|
9450
10425
|
SnackbarHost.displayName = "SnackbarHost";
|
|
9451
|
-
var SnackbarContext =
|
|
10426
|
+
var SnackbarContext = React38.createContext(
|
|
9452
10427
|
null
|
|
9453
10428
|
);
|
|
9454
10429
|
function SnackbarProvider({ children }) {
|
|
9455
10430
|
const state = useSnackbarState();
|
|
9456
|
-
const contextValue =
|
|
10431
|
+
const contextValue = React38.useMemo(
|
|
9457
10432
|
() => ({ showSnackbar: state.showSnackbar }),
|
|
9458
10433
|
[state.showSnackbar]
|
|
9459
10434
|
);
|
|
@@ -9464,7 +10439,7 @@ function SnackbarProvider({ children }) {
|
|
|
9464
10439
|
}
|
|
9465
10440
|
SnackbarProvider.displayName = "SnackbarProvider";
|
|
9466
10441
|
function useSnackbar() {
|
|
9467
|
-
const ctx =
|
|
10442
|
+
const ctx = React38.useContext(SnackbarContext);
|
|
9468
10443
|
if (!ctx) {
|
|
9469
10444
|
throw new Error("useSnackbar must be used within a <SnackbarProvider>.");
|
|
9470
10445
|
}
|
|
@@ -9527,7 +10502,7 @@ var SwitchColors = {
|
|
|
9527
10502
|
// Focus indicator
|
|
9528
10503
|
focusIndicator: "var(--md-sys-color-secondary)"
|
|
9529
10504
|
};
|
|
9530
|
-
var
|
|
10505
|
+
var FAST_SPATIAL_SPRING2 = {
|
|
9531
10506
|
type: "spring",
|
|
9532
10507
|
stiffness: 500,
|
|
9533
10508
|
damping: 40
|
|
@@ -9568,7 +10543,7 @@ function isIconVisible(thumbContent, icons, showOnlySelectedIcon, checked) {
|
|
|
9568
10543
|
if (icons) return true;
|
|
9569
10544
|
return showOnlySelectedIcon && checked;
|
|
9570
10545
|
}
|
|
9571
|
-
var SwitchVisual =
|
|
10546
|
+
var SwitchVisual = React38.memo(function SwitchVisual2({
|
|
9572
10547
|
checked,
|
|
9573
10548
|
disabled,
|
|
9574
10549
|
isPressed,
|
|
@@ -9659,9 +10634,9 @@ var SwitchVisual = React31.memo(function SwitchVisual2({
|
|
|
9659
10634
|
backgroundColor: thumbBg
|
|
9660
10635
|
},
|
|
9661
10636
|
transition: prefersReduced ? { duration: 0 } : isPressed ? SNAP_TRANSITION : {
|
|
9662
|
-
x:
|
|
9663
|
-
width:
|
|
9664
|
-
height:
|
|
10637
|
+
x: FAST_SPATIAL_SPRING2,
|
|
10638
|
+
width: FAST_SPATIAL_SPRING2,
|
|
10639
|
+
height: FAST_SPATIAL_SPRING2,
|
|
9665
10640
|
backgroundColor: colorTransition
|
|
9666
10641
|
},
|
|
9667
10642
|
children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: showIcon && /* @__PURE__ */ jsx(
|
|
@@ -9688,7 +10663,7 @@ var SwitchVisual = React31.memo(function SwitchVisual2({
|
|
|
9688
10663
|
}
|
|
9689
10664
|
);
|
|
9690
10665
|
});
|
|
9691
|
-
var SwitchComponent =
|
|
10666
|
+
var SwitchComponent = React38.forwardRef(
|
|
9692
10667
|
({
|
|
9693
10668
|
checked,
|
|
9694
10669
|
onCheckedChange,
|
|
@@ -9706,16 +10681,16 @@ var SwitchComponent = React31.forwardRef(
|
|
|
9706
10681
|
}, ref) => {
|
|
9707
10682
|
var _a;
|
|
9708
10683
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
9709
|
-
const [isPressed, setIsPressed] =
|
|
9710
|
-
const [isHovered, setIsHovered] =
|
|
9711
|
-
const [isFocused, setIsFocused] =
|
|
9712
|
-
const [ripples, setRipples] =
|
|
9713
|
-
const generatedId =
|
|
10684
|
+
const [isPressed, setIsPressed] = React38.useState(false);
|
|
10685
|
+
const [isHovered, setIsHovered] = React38.useState(false);
|
|
10686
|
+
const [isFocused, setIsFocused] = React38.useState(false);
|
|
10687
|
+
const [ripples, setRipples] = React38.useState([]);
|
|
10688
|
+
const generatedId = React38.useId();
|
|
9714
10689
|
const switchId = label ? `switch-${generatedId}` : void 0;
|
|
9715
|
-
const handleClick =
|
|
10690
|
+
const handleClick = React38.useCallback(() => {
|
|
9716
10691
|
if (!disabled) onCheckedChange(!checked);
|
|
9717
10692
|
}, [disabled, checked, onCheckedChange]);
|
|
9718
|
-
const handleKeyDown =
|
|
10693
|
+
const handleKeyDown = React38.useCallback(
|
|
9719
10694
|
(e) => {
|
|
9720
10695
|
if (disabled) return;
|
|
9721
10696
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -9725,7 +10700,7 @@ var SwitchComponent = React31.forwardRef(
|
|
|
9725
10700
|
},
|
|
9726
10701
|
[disabled, checked, onCheckedChange]
|
|
9727
10702
|
);
|
|
9728
|
-
const handlePointerDown =
|
|
10703
|
+
const handlePointerDown = React38.useCallback(
|
|
9729
10704
|
(e) => {
|
|
9730
10705
|
if (disabled) return;
|
|
9731
10706
|
setIsPressed(true);
|
|
@@ -9740,19 +10715,19 @@ var SwitchComponent = React31.forwardRef(
|
|
|
9740
10715
|
},
|
|
9741
10716
|
[disabled]
|
|
9742
10717
|
);
|
|
9743
|
-
const handlePointerUp =
|
|
10718
|
+
const handlePointerUp = React38.useCallback(() => {
|
|
9744
10719
|
setIsPressed(false);
|
|
9745
10720
|
}, []);
|
|
9746
|
-
const handlePointerEnter =
|
|
10721
|
+
const handlePointerEnter = React38.useCallback(() => {
|
|
9747
10722
|
if (!disabled) setIsHovered(true);
|
|
9748
10723
|
}, [disabled]);
|
|
9749
|
-
const handlePointerLeave =
|
|
10724
|
+
const handlePointerLeave = React38.useCallback(() => {
|
|
9750
10725
|
setIsHovered(false);
|
|
9751
10726
|
setIsPressed(false);
|
|
9752
10727
|
}, []);
|
|
9753
|
-
const handleFocus =
|
|
9754
|
-
const handleBlur =
|
|
9755
|
-
const removeRipple =
|
|
10728
|
+
const handleFocus = React38.useCallback(() => setIsFocused(true), []);
|
|
10729
|
+
const handleBlur = React38.useCallback(() => setIsFocused(false), []);
|
|
10730
|
+
const removeRipple = React38.useCallback(
|
|
9756
10731
|
(id) => setRipples((prev) => prev.filter((r) => r.id !== id)),
|
|
9757
10732
|
[]
|
|
9758
10733
|
);
|
|
@@ -9837,10 +10812,54 @@ var SwitchComponent = React31.forwardRef(
|
|
|
9837
10812
|
}
|
|
9838
10813
|
);
|
|
9839
10814
|
SwitchComponent.displayName = "Switch";
|
|
9840
|
-
var Switch =
|
|
9841
|
-
var
|
|
10815
|
+
var Switch = React38.memo(SwitchComponent);
|
|
10816
|
+
var typographyVariants = cva("m-0 p-0 text-m3-on-surface", {
|
|
10817
|
+
variants: {
|
|
10818
|
+
variant: {
|
|
10819
|
+
"display-lg": "text-[57px] leading-[64px] font-normal tracking-[-0.25px]",
|
|
10820
|
+
"display-md": "text-[45px] leading-[52px] font-normal tracking-[0px]",
|
|
10821
|
+
"display-sm": "text-[36px] leading-[44px] font-normal tracking-[0px]",
|
|
10822
|
+
"headline-lg": "text-[32px] leading-[40px] font-normal tracking-[0px]",
|
|
10823
|
+
"headline-md": "text-[28px] leading-[36px] font-normal tracking-[0px]",
|
|
10824
|
+
"headline-sm": "text-[24px] leading-[32px] font-normal tracking-[0px]",
|
|
10825
|
+
"title-lg": "text-[22px] leading-[28px] font-normal tracking-[0px]",
|
|
10826
|
+
"title-md": "text-[16px] leading-[24px] font-medium tracking-[0.15px]",
|
|
10827
|
+
"title-sm": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
|
|
10828
|
+
"label-lg": "text-[14px] leading-[20px] font-medium tracking-[0.1px]",
|
|
10829
|
+
"label-md": "text-[12px] leading-[16px] font-medium tracking-[0.5px]",
|
|
10830
|
+
"label-sm": "text-[11px] leading-[16px] font-medium tracking-[0.5px]",
|
|
10831
|
+
"body-lg": "text-[16px] leading-[24px] font-normal tracking-[0.5px]",
|
|
10832
|
+
"body-md": "text-[14px] leading-[20px] font-normal tracking-[0.25px]",
|
|
10833
|
+
"body-sm": "text-[12px] leading-[16px] font-normal tracking-[0.4px]"
|
|
10834
|
+
}
|
|
10835
|
+
},
|
|
10836
|
+
defaultVariants: {
|
|
10837
|
+
variant: "body-md"
|
|
10838
|
+
}
|
|
10839
|
+
});
|
|
10840
|
+
var Text = React38.forwardRef(
|
|
10841
|
+
(_a, ref) => {
|
|
10842
|
+
var _b = _a, { className, variant, as: Component } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
10843
|
+
const defaultComponent = React38.useMemo(() => {
|
|
10844
|
+
if ((variant == null ? void 0 : variant.startsWith("display")) || (variant == null ? void 0 : variant.startsWith("headline")))
|
|
10845
|
+
return "h1";
|
|
10846
|
+
if (variant == null ? void 0 : variant.startsWith("title")) return "h2";
|
|
10847
|
+
return "p";
|
|
10848
|
+
}, [variant]);
|
|
10849
|
+
const Tag = Component || defaultComponent;
|
|
10850
|
+
return /* @__PURE__ */ jsx(
|
|
10851
|
+
Tag,
|
|
10852
|
+
__spreadValues({
|
|
10853
|
+
ref,
|
|
10854
|
+
className: cn(typographyVariants({ variant, className }))
|
|
10855
|
+
}, props)
|
|
10856
|
+
);
|
|
10857
|
+
}
|
|
10858
|
+
);
|
|
10859
|
+
Text.displayName = "Text";
|
|
10860
|
+
var TabsContext = React38.createContext(null);
|
|
9842
10861
|
function useTabsContext() {
|
|
9843
|
-
const ctx =
|
|
10862
|
+
const ctx = React38.useContext(TabsContext);
|
|
9844
10863
|
if (!ctx) {
|
|
9845
10864
|
throw new Error(
|
|
9846
10865
|
"[MD3 Tabs] Component must be used within a <Tabs> root. Ensure <TabsList>, <Tab>, and <TabsContent> are descendants of <Tabs>."
|
|
@@ -9848,7 +10867,7 @@ function useTabsContext() {
|
|
|
9848
10867
|
}
|
|
9849
10868
|
return ctx;
|
|
9850
10869
|
}
|
|
9851
|
-
var TabsComponent =
|
|
10870
|
+
var TabsComponent = React38.forwardRef(
|
|
9852
10871
|
({
|
|
9853
10872
|
value: controlledValue,
|
|
9854
10873
|
defaultValue = "",
|
|
@@ -9857,35 +10876,35 @@ var TabsComponent = React31.forwardRef(
|
|
|
9857
10876
|
children,
|
|
9858
10877
|
className
|
|
9859
10878
|
}, ref) => {
|
|
9860
|
-
const [internalValue, setInternalValue] =
|
|
10879
|
+
const [internalValue, setInternalValue] = React38.useState(defaultValue);
|
|
9861
10880
|
const isControlled = controlledValue !== void 0;
|
|
9862
10881
|
const value = isControlled ? controlledValue : internalValue;
|
|
9863
|
-
const handleValueChange =
|
|
10882
|
+
const handleValueChange = React38.useCallback(
|
|
9864
10883
|
(newValue) => {
|
|
9865
10884
|
if (!isControlled) setInternalValue(newValue);
|
|
9866
10885
|
onValueChange == null ? void 0 : onValueChange(newValue);
|
|
9867
10886
|
},
|
|
9868
10887
|
[isControlled, onValueChange]
|
|
9869
10888
|
);
|
|
9870
|
-
const [focusedValue, setFocusedValue] =
|
|
9871
|
-
|
|
10889
|
+
const [focusedValue, setFocusedValue] = React38.useState(value);
|
|
10890
|
+
React38.useEffect(() => {
|
|
9872
10891
|
setFocusedValue(value);
|
|
9873
10892
|
}, [value]);
|
|
9874
|
-
const [tabValues, setTabValues] =
|
|
9875
|
-
const registerTab =
|
|
10893
|
+
const [tabValues, setTabValues] = React38.useState([]);
|
|
10894
|
+
const registerTab = React38.useCallback((tabValue) => {
|
|
9876
10895
|
setTabValues((prev) => {
|
|
9877
10896
|
if (prev.includes(tabValue)) return prev;
|
|
9878
10897
|
return [...prev, tabValue];
|
|
9879
10898
|
});
|
|
9880
10899
|
}, []);
|
|
9881
|
-
const unregisterTab =
|
|
10900
|
+
const unregisterTab = React38.useCallback((tabValue) => {
|
|
9882
10901
|
setTabValues((prev) => prev.filter((v) => v !== tabValue));
|
|
9883
10902
|
}, []);
|
|
9884
|
-
const hasAutoSelected =
|
|
9885
|
-
const [disabledValues, setDisabledValues] =
|
|
10903
|
+
const hasAutoSelected = React38.useRef(false);
|
|
10904
|
+
const [disabledValues, setDisabledValues] = React38.useState(
|
|
9886
10905
|
/* @__PURE__ */ new Set()
|
|
9887
10906
|
);
|
|
9888
|
-
const markTabDisabled =
|
|
10907
|
+
const markTabDisabled = React38.useCallback(
|
|
9889
10908
|
(tabValue, disabled) => {
|
|
9890
10909
|
setDisabledValues((prev) => {
|
|
9891
10910
|
const next = new Set(prev);
|
|
@@ -9899,7 +10918,7 @@ var TabsComponent = React31.forwardRef(
|
|
|
9899
10918
|
},
|
|
9900
10919
|
[]
|
|
9901
10920
|
);
|
|
9902
|
-
|
|
10921
|
+
React38.useEffect(() => {
|
|
9903
10922
|
if (isControlled || hasAutoSelected.current || tabValues.length === 0) {
|
|
9904
10923
|
return;
|
|
9905
10924
|
}
|
|
@@ -9914,9 +10933,9 @@ var TabsComponent = React31.forwardRef(
|
|
|
9914
10933
|
setFocusedValue(firstEnabled);
|
|
9915
10934
|
}
|
|
9916
10935
|
}, [tabValues, disabledValues, isControlled, value]);
|
|
9917
|
-
const id =
|
|
10936
|
+
const id = React38.useId();
|
|
9918
10937
|
const layoutGroupId = `tabs-${id}`;
|
|
9919
|
-
const contextValue =
|
|
10938
|
+
const contextValue = React38.useMemo(
|
|
9920
10939
|
() => ({
|
|
9921
10940
|
value,
|
|
9922
10941
|
onValueChange: handleValueChange,
|
|
@@ -9947,12 +10966,12 @@ var TabsComponent = React31.forwardRef(
|
|
|
9947
10966
|
}
|
|
9948
10967
|
);
|
|
9949
10968
|
TabsComponent.displayName = "Tabs";
|
|
9950
|
-
var Tabs =
|
|
9951
|
-
var TabsListContext =
|
|
10969
|
+
var Tabs = React38.memo(TabsComponent);
|
|
10970
|
+
var TabsListContext = React38.createContext(
|
|
9952
10971
|
null
|
|
9953
10972
|
);
|
|
9954
10973
|
function useTabsListContext() {
|
|
9955
|
-
const ctx =
|
|
10974
|
+
const ctx = React38.useContext(TabsListContext);
|
|
9956
10975
|
return ctx != null ? ctx : { variant: "primary", scrollable: false };
|
|
9957
10976
|
}
|
|
9958
10977
|
|
|
@@ -10036,7 +11055,7 @@ var TABS_CONTENT_TRANSITION = {
|
|
|
10036
11055
|
ease: "easeInOut"
|
|
10037
11056
|
};
|
|
10038
11057
|
var INDICATOR_MIN_WIDTH = 24;
|
|
10039
|
-
var TabComponent =
|
|
11058
|
+
var TabComponent = React38.forwardRef(
|
|
10040
11059
|
({
|
|
10041
11060
|
value,
|
|
10042
11061
|
icon,
|
|
@@ -10066,9 +11085,9 @@ var TabComponent = React31.forwardRef(
|
|
|
10066
11085
|
const isFocused = focusedValue === value;
|
|
10067
11086
|
const hasIcon = icon != null;
|
|
10068
11087
|
const isStackedIcon = hasIcon && !inlineIcon;
|
|
10069
|
-
const buttonRef =
|
|
10070
|
-
const isFirstMount =
|
|
10071
|
-
const mergedRef =
|
|
11088
|
+
const buttonRef = React38.useRef(null);
|
|
11089
|
+
const isFirstMount = React38.useRef(true);
|
|
11090
|
+
const mergedRef = React38.useCallback(
|
|
10072
11091
|
(node) => {
|
|
10073
11092
|
buttonRef.current = node;
|
|
10074
11093
|
if (typeof ref === "function") ref(node);
|
|
@@ -10076,15 +11095,15 @@ var TabComponent = React31.forwardRef(
|
|
|
10076
11095
|
},
|
|
10077
11096
|
[ref]
|
|
10078
11097
|
);
|
|
10079
|
-
|
|
11098
|
+
React38.useEffect(() => {
|
|
10080
11099
|
registerTab(value);
|
|
10081
11100
|
return () => unregisterTab(value);
|
|
10082
11101
|
}, [value, registerTab, unregisterTab]);
|
|
10083
|
-
|
|
11102
|
+
React38.useEffect(() => {
|
|
10084
11103
|
markTabDisabled(value, disabled);
|
|
10085
11104
|
return () => markTabDisabled(value, false);
|
|
10086
11105
|
}, [value, disabled, markTabDisabled]);
|
|
10087
|
-
const handleKeyDown =
|
|
11106
|
+
const handleKeyDown = React38.useCallback(
|
|
10088
11107
|
(e) => {
|
|
10089
11108
|
const isRtl = buttonRef.current ? getComputedStyle(buttonRef.current).direction === "rtl" : false;
|
|
10090
11109
|
const enabledValues = tabValues.filter((v) => !disabledValues.has(v));
|
|
@@ -10138,7 +11157,7 @@ var TabComponent = React31.forwardRef(
|
|
|
10138
11157
|
autoActivate
|
|
10139
11158
|
]
|
|
10140
11159
|
);
|
|
10141
|
-
|
|
11160
|
+
React38.useEffect(() => {
|
|
10142
11161
|
if (isFirstMount.current) {
|
|
10143
11162
|
isFirstMount.current = false;
|
|
10144
11163
|
return;
|
|
@@ -10147,7 +11166,7 @@ var TabComponent = React31.forwardRef(
|
|
|
10147
11166
|
buttonRef.current.focus({ preventScroll: true });
|
|
10148
11167
|
}
|
|
10149
11168
|
}, [isFocused]);
|
|
10150
|
-
|
|
11169
|
+
React38.useEffect(() => {
|
|
10151
11170
|
if (!isActive || !scrollable || !buttonRef.current) return;
|
|
10152
11171
|
const btn = buttonRef.current;
|
|
10153
11172
|
let container = btn.parentElement;
|
|
@@ -10284,8 +11303,8 @@ var TabComponent = React31.forwardRef(
|
|
|
10284
11303
|
}
|
|
10285
11304
|
);
|
|
10286
11305
|
TabComponent.displayName = "Tab";
|
|
10287
|
-
var Tab =
|
|
10288
|
-
var TabsContentComponent =
|
|
11306
|
+
var Tab = React38.memo(TabComponent);
|
|
11307
|
+
var TabsContentComponent = React38.forwardRef(
|
|
10289
11308
|
({ value, className, children }, ref) => {
|
|
10290
11309
|
var _a;
|
|
10291
11310
|
const { value: selectedValue, layoutGroupId } = useTabsContext();
|
|
@@ -10319,8 +11338,8 @@ var TabsContentComponent = React31.forwardRef(
|
|
|
10319
11338
|
}
|
|
10320
11339
|
);
|
|
10321
11340
|
TabsContentComponent.displayName = "TabsContent";
|
|
10322
|
-
var TabsContent =
|
|
10323
|
-
var TabsListComponent =
|
|
11341
|
+
var TabsContent = React38.memo(TabsContentComponent);
|
|
11342
|
+
var TabsListComponent = React38.forwardRef(
|
|
10324
11343
|
({
|
|
10325
11344
|
variant,
|
|
10326
11345
|
scrollable = false,
|
|
@@ -10331,12 +11350,12 @@ var TabsListComponent = React31.forwardRef(
|
|
|
10331
11350
|
}, ref) => {
|
|
10332
11351
|
const { layoutGroupId, value, setFocusedValue } = useTabsContext();
|
|
10333
11352
|
const listLayoutId = `${layoutGroupId}-list`;
|
|
10334
|
-
const listContextValue =
|
|
11353
|
+
const listContextValue = React38.useMemo(
|
|
10335
11354
|
() => ({ variant, scrollable }),
|
|
10336
11355
|
[variant, scrollable]
|
|
10337
11356
|
);
|
|
10338
11357
|
const bgColor = backgroundColor != null ? backgroundColor : "var(--md-sys-color-surface)";
|
|
10339
|
-
const handleBlur =
|
|
11358
|
+
const handleBlur = React38.useCallback(
|
|
10340
11359
|
(e) => {
|
|
10341
11360
|
const listEl = e.currentTarget;
|
|
10342
11361
|
if (listEl.contains(e.relatedTarget)) return;
|
|
@@ -10385,7 +11404,7 @@ var TabsListComponent = React31.forwardRef(
|
|
|
10385
11404
|
}
|
|
10386
11405
|
);
|
|
10387
11406
|
TabsListComponent.displayName = "TabsList";
|
|
10388
|
-
var TabsList =
|
|
11407
|
+
var TabsList = React38.memo(TabsListComponent);
|
|
10389
11408
|
|
|
10390
11409
|
// src/ui/text-field/text-field.tokens.ts
|
|
10391
11410
|
var TF_COLORS = {
|
|
@@ -10424,7 +11443,7 @@ var TF_TYPOGRAPHY = {
|
|
|
10424
11443
|
var TF_CLASSES = {
|
|
10425
11444
|
// Prefix / Suffix
|
|
10426
11445
|
prefixSuffix: "text-base text-[var(--color-m3-on-surface-variant)] select-none shrink-0"};
|
|
10427
|
-
var ActiveIndicator =
|
|
11446
|
+
var ActiveIndicator = React38.memo(function ActiveIndicator2({
|
|
10428
11447
|
isFocused,
|
|
10429
11448
|
isError,
|
|
10430
11449
|
isDisabled,
|
|
@@ -10471,7 +11490,7 @@ function getLabelColor(isFloated, isFocused, isError, isDisabled) {
|
|
|
10471
11490
|
if (isFloated && isFocused) return TF_COLORS.primary;
|
|
10472
11491
|
return TF_COLORS.onSurfaceVariant;
|
|
10473
11492
|
}
|
|
10474
|
-
var FloatingLabel =
|
|
11493
|
+
var FloatingLabel = React38.memo(function FloatingLabel2({
|
|
10475
11494
|
text,
|
|
10476
11495
|
isFloated,
|
|
10477
11496
|
isFocused,
|
|
@@ -10531,7 +11550,7 @@ var FloatingLabel = React31.memo(function FloatingLabel2({
|
|
|
10531
11550
|
);
|
|
10532
11551
|
});
|
|
10533
11552
|
FloatingLabel.displayName = "FloatingLabel";
|
|
10534
|
-
var LeadingIcon =
|
|
11553
|
+
var LeadingIcon = React38.memo(function LeadingIcon2({
|
|
10535
11554
|
children,
|
|
10536
11555
|
isError,
|
|
10537
11556
|
isDisabled
|
|
@@ -10555,7 +11574,7 @@ function getOutlineColor(isFocused, isError, isHovered, isDisabled) {
|
|
|
10555
11574
|
if (isHovered) return TF_COLORS.inputText;
|
|
10556
11575
|
return TF_COLORS.outline;
|
|
10557
11576
|
}
|
|
10558
|
-
var OutlineContainer =
|
|
11577
|
+
var OutlineContainer = React38.memo(function OutlineContainer2({
|
|
10559
11578
|
isFloated,
|
|
10560
11579
|
isFocused,
|
|
10561
11580
|
isError,
|
|
@@ -10653,7 +11672,7 @@ var OutlineContainer = React31.memo(function OutlineContainer2({
|
|
|
10653
11672
|
);
|
|
10654
11673
|
});
|
|
10655
11674
|
OutlineContainer.displayName = "OutlineContainer";
|
|
10656
|
-
var PrefixSuffix =
|
|
11675
|
+
var PrefixSuffix = React38.memo(function PrefixSuffix2({
|
|
10657
11676
|
text,
|
|
10658
11677
|
type,
|
|
10659
11678
|
visible,
|
|
@@ -10695,7 +11714,7 @@ function AnimatedText({
|
|
|
10695
11714
|
motionKey
|
|
10696
11715
|
);
|
|
10697
11716
|
}
|
|
10698
|
-
var SupportingText =
|
|
11717
|
+
var SupportingText = React38.memo(function SupportingText2({
|
|
10699
11718
|
supportingText,
|
|
10700
11719
|
errorText,
|
|
10701
11720
|
isError,
|
|
@@ -10806,7 +11825,7 @@ function ClearIcon() {
|
|
|
10806
11825
|
}
|
|
10807
11826
|
);
|
|
10808
11827
|
}
|
|
10809
|
-
var TrailingIcon =
|
|
11828
|
+
var TrailingIcon = React38.memo(function TrailingIcon2({
|
|
10810
11829
|
mode,
|
|
10811
11830
|
children,
|
|
10812
11831
|
value,
|
|
@@ -10872,7 +11891,7 @@ var TrailingIcon = React31.memo(function TrailingIcon2({
|
|
|
10872
11891
|
});
|
|
10873
11892
|
TrailingIcon.displayName = "TrailingIcon";
|
|
10874
11893
|
var LINE_HEIGHT_PX = 24;
|
|
10875
|
-
var TextFieldComponent =
|
|
11894
|
+
var TextFieldComponent = React38.forwardRef(
|
|
10876
11895
|
({
|
|
10877
11896
|
// Core
|
|
10878
11897
|
variant = "filled",
|
|
@@ -10936,30 +11955,30 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
10936
11955
|
}, ref) => {
|
|
10937
11956
|
var _a;
|
|
10938
11957
|
const prefersReduced = (_a = useReducedMotion()) != null ? _a : false;
|
|
10939
|
-
const generatedId =
|
|
11958
|
+
const generatedId = React38.useId();
|
|
10940
11959
|
const inputId = idProp != null ? idProp : `tf-${generatedId}`;
|
|
10941
11960
|
const supportingId = `${inputId}-supporting`;
|
|
10942
11961
|
const isControlled = valueProp !== void 0;
|
|
10943
|
-
const [internalValue, setInternalValue] =
|
|
11962
|
+
const [internalValue, setInternalValue] = React38.useState(defaultValue);
|
|
10944
11963
|
const currentValue = isControlled ? valueProp : internalValue;
|
|
10945
|
-
const [isFocused, setIsFocused] =
|
|
10946
|
-
const [showPassword, setShowPassword] =
|
|
11964
|
+
const [isFocused, setIsFocused] = React38.useState(false);
|
|
11965
|
+
const [showPassword, setShowPassword] = React38.useState(false);
|
|
10947
11966
|
const resolvedInputType = type === "password" && showPassword ? "text" : type;
|
|
10948
|
-
const [nativeError, setNativeError] =
|
|
10949
|
-
const [labelWidth, setLabelWidth] =
|
|
11967
|
+
const [nativeError, setNativeError] = React38.useState("");
|
|
11968
|
+
const [labelWidth, setLabelWidth] = React38.useState(0);
|
|
10950
11969
|
const hasValue = currentValue.length > 0;
|
|
10951
11970
|
const isFloated = isFocused || hasValue;
|
|
10952
11971
|
const isError = errorProp || !!nativeError || maxLength !== void 0 && currentValue.length > maxLength;
|
|
10953
11972
|
const containerHeight = dense ? TF_SIZE.denseHeight : TF_SIZE.height;
|
|
10954
11973
|
const showAsterisk = required && !noAsterisk;
|
|
10955
|
-
const inputRef =
|
|
10956
|
-
const labelSpanRef =
|
|
10957
|
-
|
|
11974
|
+
const inputRef = React38.useRef(null);
|
|
11975
|
+
const labelSpanRef = React38.useRef(null);
|
|
11976
|
+
React38.useLayoutEffect(() => {
|
|
10958
11977
|
if (labelSpanRef.current) {
|
|
10959
11978
|
setLabelWidth(labelSpanRef.current.offsetWidth);
|
|
10960
11979
|
}
|
|
10961
11980
|
}, []);
|
|
10962
|
-
|
|
11981
|
+
React38.useLayoutEffect(() => {
|
|
10963
11982
|
if (type !== "textarea" || !inputRef.current) return;
|
|
10964
11983
|
const textarea = inputRef.current;
|
|
10965
11984
|
if (autoResize) {
|
|
@@ -10971,7 +11990,7 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
10971
11990
|
}
|
|
10972
11991
|
textarea.style.overflowY = "hidden";
|
|
10973
11992
|
}, [type, autoResize, maxRows, currentValue]);
|
|
10974
|
-
const handleValueChange =
|
|
11993
|
+
const handleValueChange = React38.useCallback(
|
|
10975
11994
|
(newValue) => {
|
|
10976
11995
|
var _a2, _b;
|
|
10977
11996
|
if (!isControlled) setInternalValue(newValue);
|
|
@@ -10980,7 +11999,7 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
10980
11999
|
},
|
|
10981
12000
|
[isControlled]
|
|
10982
12001
|
);
|
|
10983
|
-
const handleChange =
|
|
12002
|
+
const handleChange = React38.useCallback(
|
|
10984
12003
|
(e) => {
|
|
10985
12004
|
const newVal = e.target.value;
|
|
10986
12005
|
handleValueChange(newVal);
|
|
@@ -10988,14 +12007,14 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
10988
12007
|
},
|
|
10989
12008
|
[handleValueChange, onChange]
|
|
10990
12009
|
);
|
|
10991
|
-
const handleFocus =
|
|
12010
|
+
const handleFocus = React38.useCallback(
|
|
10992
12011
|
(e) => {
|
|
10993
12012
|
setIsFocused(true);
|
|
10994
12013
|
onFocus == null ? void 0 : onFocus(e);
|
|
10995
12014
|
},
|
|
10996
12015
|
[onFocus]
|
|
10997
12016
|
);
|
|
10998
|
-
const handleBlur =
|
|
12017
|
+
const handleBlur = React38.useCallback(
|
|
10999
12018
|
(e) => {
|
|
11000
12019
|
setIsFocused(false);
|
|
11001
12020
|
const el = inputRef.current;
|
|
@@ -11008,7 +12027,7 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
11008
12027
|
},
|
|
11009
12028
|
[onBlur]
|
|
11010
12029
|
);
|
|
11011
|
-
const handleClear =
|
|
12030
|
+
const handleClear = React38.useCallback(() => {
|
|
11012
12031
|
var _a2;
|
|
11013
12032
|
handleValueChange("");
|
|
11014
12033
|
onChange == null ? void 0 : onChange("", {
|
|
@@ -11016,12 +12035,12 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
11016
12035
|
});
|
|
11017
12036
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
11018
12037
|
}, [handleValueChange, onChange]);
|
|
11019
|
-
const handlePasswordToggle =
|
|
12038
|
+
const handlePasswordToggle = React38.useCallback(() => {
|
|
11020
12039
|
var _a2;
|
|
11021
12040
|
setShowPassword((prev) => !prev);
|
|
11022
12041
|
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
11023
12042
|
}, []);
|
|
11024
|
-
|
|
12043
|
+
React38.useImperativeHandle(
|
|
11025
12044
|
ref,
|
|
11026
12045
|
() => ({
|
|
11027
12046
|
focus: () => {
|
|
@@ -11266,7 +12285,7 @@ var TextFieldComponent = React31.forwardRef(
|
|
|
11266
12285
|
}
|
|
11267
12286
|
);
|
|
11268
12287
|
TextFieldComponent.displayName = "TextField";
|
|
11269
|
-
var TextField =
|
|
12288
|
+
var TextField = React38.memo(TextFieldComponent);
|
|
11270
12289
|
|
|
11271
12290
|
// src/ui/typography/typography-key-tokens.ts
|
|
11272
12291
|
var TypographyKeyTokens = /* @__PURE__ */ ((TypographyKeyTokens2) => {
|
|
@@ -12711,7 +13730,7 @@ function TooltipBox({
|
|
|
12711
13730
|
onKeyDown: handleKeyDown,
|
|
12712
13731
|
"aria-label": ariaLabel,
|
|
12713
13732
|
"aria-describedby": state.isVisible ? tooltipId : void 0,
|
|
12714
|
-
children:
|
|
13733
|
+
children: React38.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children })
|
|
12715
13734
|
}
|
|
12716
13735
|
),
|
|
12717
13736
|
mounted && createPortal(
|
|
@@ -12741,6 +13760,6 @@ function TooltipBox({
|
|
|
12741
13760
|
] });
|
|
12742
13761
|
}
|
|
12743
13762
|
|
|
12744
|
-
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, Badge, BadgedBox, BottomAppBar, Button, ButtonGroup, Card, Checkbox, Chip, CodeBlock, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogFullScreenContent, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DockedToolbar, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger,
|
|
13763
|
+
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, AppBarColumn, AppBarOverflowIndicator, AppBarRow, AppBarTokens, Badge, BadgedBox, BottomAppBar, Button, ButtonGroup, CHECK_ICON_VARIANTS, Card, Checkbox, Chip, CodeBlock, ContextMenu, ContextMenuContent, ContextMenuTrigger, DIVIDER_COLOR, DIVIDER_PADDING, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogFullScreenContent, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DockedToolbar, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, FAB, FABMenu, FABMenuItem, FABPosition, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, GROUP_SHAPES, ITEM_SHAPE_CLASSES, Icon, IconButton, LargeFlexibleAppBar, LoadingIndicator, MD3ThemeProvider, MD3_EXPRESSIVE_FONT_VARIATION, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MaterialSymbolsPreconnect, MediumFlexibleAppBar, Menu, MenuContent, MenuDivider, MenuGroup, MenuItem, MenuProvider, MenuTrigger, NavigationRail, NavigationRailItem, PlainTooltip, ProgressIndicator, RadioButton, RadioGroup, RangeSlider, RichTooltip, Ripple, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, ScrollArea, ScrollAreaScrollbar, Search, SearchAppBar, SearchBar, SearchTokens, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, Slider, SliderColors, SliderTokens, SmallAppBar, Snackbar, SnackbarHost, SnackbarProvider, SubMenu, Switch, SwitchColors, SwitchTokens, Tab, TableOfContents, Tabs, TabsColors, TabsContent, TabsList, TabsTokens, Text, TextField, ToggleFAB, TooltipBox, TooltipCaretShape, TooltipTokens, TriStateCheckbox, TypeScaleTokens, Typography, TypographyContext, TypographyKeyTokens, TypographyProvider, TypographyTokens, VIBRANT_COLORS, VerticalMenu, VerticalMenuContent, VerticalMenuDivider, VerticalMenuGroup, appBarTypography, applyTheme, buildWavePath, cn, generateM3Theme, useAppBarScroll, useRipple as useDOMRipple, useMediaQuery, useMenuContext, useRipple2 as useRipple, useRippleState, useSearchKeyboard, useSnackbar, useSnackbarState, useTheme, useThemeMode, useTooltipPosition, useTooltipState, useTypography };
|
|
12745
13764
|
//# sourceMappingURL=index.mjs.map
|
|
12746
13765
|
//# sourceMappingURL=index.mjs.map
|