@bug-on/m3-expressive 1.3.5 → 1.3.7
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/CHANGELOG.md +12 -0
- package/dist/buttons.d.mts +3 -3
- package/dist/buttons.d.ts +3 -3
- package/dist/buttons.js +110 -91
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +110 -91
- package/dist/buttons.mjs.map +1 -1
- package/dist/{core-Cckt8qEm.d.ts → core-DamhB5Yd.d.ts} +1 -1
- package/dist/{core-DDfG4pym.d.mts → core-Wsfqn9_N.d.mts} +1 -1
- package/dist/core.d.mts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/{fading-blur-mask--uZbBKLj.d.ts → fading-blur-mask-CX-bwjNU.d.mts} +6 -1
- package/dist/{fading-blur-mask--uZbBKLj.d.mts → fading-blur-mask-D57UMguz.d.ts} +6 -1
- package/dist/feedback.d.mts +17 -5
- package/dist/feedback.d.ts +17 -5
- package/dist/feedback.js +1 -1
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.d.mts +3 -3
- package/dist/forms.d.ts +3 -3
- package/dist/forms.js +16 -6
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +16 -6
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-CxyJv7UV.d.mts → icon-button-BpX9_fwZ.d.mts} +1 -1
- package/dist/{icon-button-Di8VX6ou.d.ts → icon-button-DFXp9hze.d.ts} +1 -1
- package/dist/index.d.mts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +1790 -1133
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1640 -988
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +92 -23
- package/dist/layout.d.ts +92 -23
- package/dist/layout.js +118 -13
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +118 -15
- package/dist/layout.mjs.map +1 -1
- package/dist/{md3-expressive-shapes-CPcfl_Hf.d.mts → md3-expressive-shapes-wk_98LJh.d.mts} +20 -1
- package/dist/{md3-expressive-shapes-CPcfl_Hf.d.ts → md3-expressive-shapes-wk_98LJh.d.ts} +20 -1
- package/dist/md3-xBl4wgND.d.mts +44 -0
- package/dist/md3-xBl4wgND.d.ts +44 -0
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.js +74 -21
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +74 -21
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +4 -2
- package/dist/overlays.d.ts +4 -2
- package/dist/overlays.js +85 -44
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +85 -44
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +89 -56
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +89 -56
- package/dist/pickers.mjs.map +1 -1
- package/dist/shapes.d.mts +150 -17
- package/dist/shapes.d.ts +150 -17
- package/dist/shapes.js +618 -126
- package/dist/shapes.js.map +1 -1
- package/dist/shapes.mjs +614 -127
- package/dist/shapes.mjs.map +1 -1
- package/dist/{side-sheet-modal-Bd5Qqvp9.d.ts → side-sheet-modal-BfdgYjd3.d.ts} +70 -0
- package/dist/{side-sheet-modal-64FGhDxL.d.mts → side-sheet-modal-kLfHINFZ.d.mts} +70 -0
- package/dist/{split-button-trailing-uncheckable-CGzk7KcG.d.ts → split-button-trailing-uncheckable-BpyIlOdn.d.ts} +7 -3
- package/dist/{split-button-trailing-uncheckable-gAz6OAIi.d.mts → split-button-trailing-uncheckable-CpT8iPpr.d.mts} +7 -3
- package/dist/{text-field-DARNdj14.d.ts → text-field-Ct-LT_2T.d.ts} +23 -4
- package/dist/{text-field-4OlT9o8s.d.mts → text-field-D5xiGn-q.d.mts} +23 -4
- package/llms-full.txt +25 -3
- package/llms.txt +4 -1
- package/package.json +1 -1
- package/dist/md3-BQhRygSi.d.mts +0 -31
- package/dist/md3-BQhRygSi.d.ts +0 -31
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
+
import { B as BaseIconButtonProps } from './icon-button-DFXp9hze.js';
|
|
4
5
|
import { MotionStyle, useMotionValue, useTransform } from 'motion/react';
|
|
5
6
|
import { b as ScrollAreaProps } from './scroll-area-CVS6HyLl.js';
|
|
6
7
|
|
|
@@ -43,6 +44,49 @@ interface DialogProps {
|
|
|
43
44
|
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof RadixDialog.Content> {
|
|
44
45
|
/** Hides the top-right close (X) button. @default false */
|
|
45
46
|
hideCloseButton?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Override any `IconButton` prop on the default close button.
|
|
49
|
+
*
|
|
50
|
+
* Common use cases:
|
|
51
|
+
* - `disabled` — prevent closing during form submission.
|
|
52
|
+
* - `aria-label` — i18n label (e.g. `"Đóng"`).
|
|
53
|
+
* - `colorStyle` — change visual style (`"filled"` restores original look).
|
|
54
|
+
* - `className` — reposition or override the default `absolute right-4 top-4`.
|
|
55
|
+
*
|
|
56
|
+
* These props are **merged** with the library defaults — you only need to specify overrides.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // Disable during form submission
|
|
61
|
+
* <DialogContent closeButtonProps={{ disabled: isSubmitting, "aria-label": "Đóng" }}>
|
|
62
|
+
*
|
|
63
|
+
* // Restore the original filled style
|
|
64
|
+
* <DialogContent closeButtonProps={{ colorStyle: "filled" }}>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
closeButtonProps?: Partial<BaseIconButtonProps>;
|
|
68
|
+
/**
|
|
69
|
+
* Fully replace the close button with a custom React node.
|
|
70
|
+
* The node is automatically wrapped in `RadixDialog.Close asChild`.
|
|
71
|
+
*
|
|
72
|
+
* When provided, `hideCloseButton` and `closeButtonProps` are ignored —
|
|
73
|
+
* this slot takes full ownership of the close action.
|
|
74
|
+
*
|
|
75
|
+
* Use when `closeButtonProps` is insufficient (e.g. completely different element
|
|
76
|
+
* or button placed inside a custom flex header).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <DialogContent
|
|
81
|
+
* closeButton={
|
|
82
|
+
* <IconButton disabled={isSubmitting} aria-label="Đóng" className="absolute right-4 top-4">
|
|
83
|
+
* <Icon name="close" />
|
|
84
|
+
* </IconButton>
|
|
85
|
+
* }
|
|
86
|
+
* >
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
closeButton?: React$1.ReactNode;
|
|
46
90
|
className?: string;
|
|
47
91
|
}
|
|
48
92
|
/**
|
|
@@ -62,6 +106,32 @@ interface DialogFullScreenContentProps extends React$1.ComponentPropsWithoutRef<
|
|
|
62
106
|
actionLabel?: string;
|
|
63
107
|
/** Handler invoked when pressing the primary action button. */
|
|
64
108
|
onAction?: () => void;
|
|
109
|
+
/**
|
|
110
|
+
* Override any native `<button>` attribute on the top-bar action button.
|
|
111
|
+
*
|
|
112
|
+
* Common use case: `disabled` during form submission.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <DialogFullScreenContent
|
|
117
|
+
* actionLabel="Lưu"
|
|
118
|
+
* onAction={handleSave}
|
|
119
|
+
* actionButtonProps={{ disabled: isSubmitting }}
|
|
120
|
+
* >
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
actionButtonProps?: React$1.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
124
|
+
/**
|
|
125
|
+
* Override any `IconButton` prop on the top-bar close button.
|
|
126
|
+
*
|
|
127
|
+
* Common use cases: `disabled` during submission, `aria-label` for i18n.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <DialogFullScreenContent closeButtonProps={{ disabled: isSubmitting, "aria-label": "Đóng" }}>
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
closeButtonProps?: Partial<BaseIconButtonProps>;
|
|
65
135
|
/** Renders a divider separating Top App Bar from scrollable body content. @default false */
|
|
66
136
|
showDivider?: boolean;
|
|
67
137
|
className?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
+
import { B as BaseIconButtonProps } from './icon-button-BpX9_fwZ.mjs';
|
|
4
5
|
import { MotionStyle, useMotionValue, useTransform } from 'motion/react';
|
|
5
6
|
import { b as ScrollAreaProps } from './scroll-area-CVS6HyLl.mjs';
|
|
6
7
|
|
|
@@ -43,6 +44,49 @@ interface DialogProps {
|
|
|
43
44
|
interface DialogContentProps extends React$1.ComponentPropsWithoutRef<typeof RadixDialog.Content> {
|
|
44
45
|
/** Hides the top-right close (X) button. @default false */
|
|
45
46
|
hideCloseButton?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Override any `IconButton` prop on the default close button.
|
|
49
|
+
*
|
|
50
|
+
* Common use cases:
|
|
51
|
+
* - `disabled` — prevent closing during form submission.
|
|
52
|
+
* - `aria-label` — i18n label (e.g. `"Đóng"`).
|
|
53
|
+
* - `colorStyle` — change visual style (`"filled"` restores original look).
|
|
54
|
+
* - `className` — reposition or override the default `absolute right-4 top-4`.
|
|
55
|
+
*
|
|
56
|
+
* These props are **merged** with the library defaults — you only need to specify overrides.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // Disable during form submission
|
|
61
|
+
* <DialogContent closeButtonProps={{ disabled: isSubmitting, "aria-label": "Đóng" }}>
|
|
62
|
+
*
|
|
63
|
+
* // Restore the original filled style
|
|
64
|
+
* <DialogContent closeButtonProps={{ colorStyle: "filled" }}>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
closeButtonProps?: Partial<BaseIconButtonProps>;
|
|
68
|
+
/**
|
|
69
|
+
* Fully replace the close button with a custom React node.
|
|
70
|
+
* The node is automatically wrapped in `RadixDialog.Close asChild`.
|
|
71
|
+
*
|
|
72
|
+
* When provided, `hideCloseButton` and `closeButtonProps` are ignored —
|
|
73
|
+
* this slot takes full ownership of the close action.
|
|
74
|
+
*
|
|
75
|
+
* Use when `closeButtonProps` is insufficient (e.g. completely different element
|
|
76
|
+
* or button placed inside a custom flex header).
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <DialogContent
|
|
81
|
+
* closeButton={
|
|
82
|
+
* <IconButton disabled={isSubmitting} aria-label="Đóng" className="absolute right-4 top-4">
|
|
83
|
+
* <Icon name="close" />
|
|
84
|
+
* </IconButton>
|
|
85
|
+
* }
|
|
86
|
+
* >
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
closeButton?: React$1.ReactNode;
|
|
46
90
|
className?: string;
|
|
47
91
|
}
|
|
48
92
|
/**
|
|
@@ -62,6 +106,32 @@ interface DialogFullScreenContentProps extends React$1.ComponentPropsWithoutRef<
|
|
|
62
106
|
actionLabel?: string;
|
|
63
107
|
/** Handler invoked when pressing the primary action button. */
|
|
64
108
|
onAction?: () => void;
|
|
109
|
+
/**
|
|
110
|
+
* Override any native `<button>` attribute on the top-bar action button.
|
|
111
|
+
*
|
|
112
|
+
* Common use case: `disabled` during form submission.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```tsx
|
|
116
|
+
* <DialogFullScreenContent
|
|
117
|
+
* actionLabel="Lưu"
|
|
118
|
+
* onAction={handleSave}
|
|
119
|
+
* actionButtonProps={{ disabled: isSubmitting }}
|
|
120
|
+
* >
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
actionButtonProps?: React$1.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
124
|
+
/**
|
|
125
|
+
* Override any `IconButton` prop on the top-bar close button.
|
|
126
|
+
*
|
|
127
|
+
* Common use cases: `disabled` during submission, `aria-label` for i18n.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <DialogFullScreenContent closeButtonProps={{ disabled: isSubmitting, "aria-label": "Đóng" }}>
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
closeButtonProps?: Partial<BaseIconButtonProps>;
|
|
65
135
|
/** Renders a divider separating Top App Bar from scrollable body content. @default false */
|
|
66
136
|
showDivider?: boolean;
|
|
67
137
|
className?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
-
import { M as MD3ColorStyle,
|
|
2
|
+
import { M as MD3ColorStyle, d as MD3Size, c as MD3Shape } from './md3-xBl4wgND.js';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -583,7 +583,10 @@ interface FABMenuProps {
|
|
|
583
583
|
/** Custom CSS className for root component. */
|
|
584
584
|
className?: string;
|
|
585
585
|
/**
|
|
586
|
-
* When `true`, clicking
|
|
586
|
+
* When `true`, clicking or tapping anywhere outside the FABMenu container closes the menu.
|
|
587
|
+
* Implemented via document-level pointer listeners (`mousedown` and `touchstart`)
|
|
588
|
+
* without rendering a blocking full-screen overlay, preserving hover and scroll
|
|
589
|
+
* interactions on background elements.
|
|
587
590
|
* @default true
|
|
588
591
|
*/
|
|
589
592
|
closeOnBackdropClick?: boolean;
|
|
@@ -695,10 +698,12 @@ declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, cla
|
|
|
695
698
|
* Floating Action Button expansion menu. Toggling trigger button reveals vertically stacked action items.
|
|
696
699
|
*
|
|
697
700
|
* Full MD3 Accessibility implementation:
|
|
701
|
+
* - `role="group"` assigned to outer container with non-blocking click-outside detection
|
|
698
702
|
* - `role="menu"` assigned to container
|
|
699
703
|
* - `role="menuitem"` assigned to child action items
|
|
700
704
|
* - Focus lifecycle management: Open -> Focus first/last menu item; Close -> Restore focus to ToggleFAB
|
|
701
705
|
* - Keyboard navigation: Escape key closes menu, ArrowUp/Down navigates items, Tab moves focus.
|
|
706
|
+
* - Click outside: Automatically closes the menu when clicking or tapping outside without blocking background interactions.
|
|
702
707
|
*
|
|
703
708
|
* @example
|
|
704
709
|
* ```tsx
|
|
@@ -716,7 +721,6 @@ declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, cla
|
|
|
716
721
|
* aria-label="Quick actions"
|
|
717
722
|
* alignment="center"
|
|
718
723
|
* colorVariant="tertiary"
|
|
719
|
-
|
|
720
724
|
* items={items}
|
|
721
725
|
* />
|
|
722
726
|
* ```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLMotionProps } from 'motion/react';
|
|
2
|
-
import { M as MD3ColorStyle,
|
|
2
|
+
import { M as MD3ColorStyle, d as MD3Size, c as MD3Shape } from './md3-xBl4wgND.mjs';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -583,7 +583,10 @@ interface FABMenuProps {
|
|
|
583
583
|
/** Custom CSS className for root component. */
|
|
584
584
|
className?: string;
|
|
585
585
|
/**
|
|
586
|
-
* When `true`, clicking
|
|
586
|
+
* When `true`, clicking or tapping anywhere outside the FABMenu container closes the menu.
|
|
587
|
+
* Implemented via document-level pointer listeners (`mousedown` and `touchstart`)
|
|
588
|
+
* without rendering a blocking full-screen overlay, preserving hover and scroll
|
|
589
|
+
* interactions on background elements.
|
|
587
590
|
* @default true
|
|
588
591
|
*/
|
|
589
592
|
closeOnBackdropClick?: boolean;
|
|
@@ -695,10 +698,12 @@ declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, cla
|
|
|
695
698
|
* Floating Action Button expansion menu. Toggling trigger button reveals vertically stacked action items.
|
|
696
699
|
*
|
|
697
700
|
* Full MD3 Accessibility implementation:
|
|
701
|
+
* - `role="group"` assigned to outer container with non-blocking click-outside detection
|
|
698
702
|
* - `role="menu"` assigned to container
|
|
699
703
|
* - `role="menuitem"` assigned to child action items
|
|
700
704
|
* - Focus lifecycle management: Open -> Focus first/last menu item; Close -> Restore focus to ToggleFAB
|
|
701
705
|
* - Keyboard navigation: Escape key closes menu, ArrowUp/Down navigates items, Tab moves focus.
|
|
706
|
+
* - Click outside: Automatically closes the menu when clicking or tapping outside without blocking background interactions.
|
|
702
707
|
*
|
|
703
708
|
* @example
|
|
704
709
|
* ```tsx
|
|
@@ -716,7 +721,6 @@ declare function FABMenuItem({ icon, label, onClick, disabled, colorVariant, cla
|
|
|
716
721
|
* aria-label="Quick actions"
|
|
717
722
|
* alignment="center"
|
|
718
723
|
* colorVariant="tertiary"
|
|
719
|
-
|
|
720
724
|
* items={items}
|
|
721
725
|
* />
|
|
722
726
|
* ```
|
|
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { M as MenuColorVariant, l as MenuVariant, p as VerticalMenuSeparatorStyle } from './menu-types-rZNQFO7Y.js';
|
|
5
|
-
import {
|
|
5
|
+
import { d as MD3Size } from './md3-xBl4wgND.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @file checkbox.tsx
|
|
@@ -473,11 +473,30 @@ interface SelectProps extends Omit<TextFieldProps, "value" | "onChange" | "defau
|
|
|
473
473
|
/** Callback fired when selection changes */
|
|
474
474
|
onChange?: (value: string, option?: SelectOption) => void;
|
|
475
475
|
/**
|
|
476
|
-
* Callback fired when search query changes
|
|
477
|
-
*
|
|
476
|
+
* Callback fired when the search query changes.
|
|
477
|
+
*
|
|
478
|
+
* ⚠️ **Requires `searchable={true}`** — without it, typing is disabled and this callback is never called.
|
|
479
|
+
*
|
|
480
|
+
* When provided, INTERNAL filtering is disabled — you control `options` externally
|
|
481
|
+
* (ideal for server-side / async search with large datasets).
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* // Server-side search: fetch results as user types
|
|
485
|
+
* <Select
|
|
486
|
+
* searchable
|
|
487
|
+
* loading={isLoading}
|
|
488
|
+
* options={serverResults}
|
|
489
|
+
* onSearchChange={(query) => fetchOptions(query)}
|
|
490
|
+
* onChange={(val) => setSelected(val)}
|
|
491
|
+
* />
|
|
478
492
|
*/
|
|
479
493
|
onSearchChange?: (query: string) => void;
|
|
480
|
-
/**
|
|
494
|
+
/**
|
|
495
|
+
* Enable autocomplete/search mode — renders the trigger as an editable text input.
|
|
496
|
+
*
|
|
497
|
+
* - When `false` (default): read-only dropdown, no typing allowed.
|
|
498
|
+
* - When `true`: user can type to filter options. Combine with `onSearchChange` for server-side search.
|
|
499
|
+
*/
|
|
481
500
|
searchable?: boolean;
|
|
482
501
|
/** Whether data is loading (displays a spinner inside the dropdown) */
|
|
483
502
|
loading?: boolean;
|
|
@@ -2,7 +2,7 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { M as MenuColorVariant, l as MenuVariant, p as VerticalMenuSeparatorStyle } from './menu-types-rZNQFO7Y.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { d as MD3Size } from './md3-xBl4wgND.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @file checkbox.tsx
|
|
@@ -473,11 +473,30 @@ interface SelectProps extends Omit<TextFieldProps, "value" | "onChange" | "defau
|
|
|
473
473
|
/** Callback fired when selection changes */
|
|
474
474
|
onChange?: (value: string, option?: SelectOption) => void;
|
|
475
475
|
/**
|
|
476
|
-
* Callback fired when search query changes
|
|
477
|
-
*
|
|
476
|
+
* Callback fired when the search query changes.
|
|
477
|
+
*
|
|
478
|
+
* ⚠️ **Requires `searchable={true}`** — without it, typing is disabled and this callback is never called.
|
|
479
|
+
*
|
|
480
|
+
* When provided, INTERNAL filtering is disabled — you control `options` externally
|
|
481
|
+
* (ideal for server-side / async search with large datasets).
|
|
482
|
+
*
|
|
483
|
+
* @example
|
|
484
|
+
* // Server-side search: fetch results as user types
|
|
485
|
+
* <Select
|
|
486
|
+
* searchable
|
|
487
|
+
* loading={isLoading}
|
|
488
|
+
* options={serverResults}
|
|
489
|
+
* onSearchChange={(query) => fetchOptions(query)}
|
|
490
|
+
* onChange={(val) => setSelected(val)}
|
|
491
|
+
* />
|
|
478
492
|
*/
|
|
479
493
|
onSearchChange?: (query: string) => void;
|
|
480
|
-
/**
|
|
494
|
+
/**
|
|
495
|
+
* Enable autocomplete/search mode — renders the trigger as an editable text input.
|
|
496
|
+
*
|
|
497
|
+
* - When `false` (default): read-only dropdown, no typing allowed.
|
|
498
|
+
* - When `true`: user can type to filter options. Combine with `onSearchChange` for server-side search.
|
|
499
|
+
*/
|
|
481
500
|
searchable?: boolean;
|
|
482
501
|
/** Whether data is loading (displays a spinner inside the dropdown) */
|
|
483
502
|
loading?: boolean;
|
package/llms-full.txt
CHANGED
|
@@ -126,11 +126,18 @@ Icons use **Material Symbols** (Variable Font).
|
|
|
126
126
|
### 7.1 Compound Components & Responsive Layout Groups
|
|
127
127
|
Complex components use a structured compound pattern:
|
|
128
128
|
- **Dialog & Drawer**: `Dialog`, `DialogTrigger`, `DialogContent`, `DialogHeader`, `DialogTitle`, `DialogBody`, `DialogFooter`, `DialogClose`.
|
|
129
|
+
- `DialogContent` has `closeButtonProps?: Partial<IconButtonProps>` to override the default close button (use `disabled`, `aria-label`, `colorStyle`, `className`) and `closeButton?: React.ReactNode` for full slot replacement (auto-wrapped in `DialogClose`).
|
|
130
|
+
- `DialogFullScreenContent` has `closeButtonProps?: Partial<IconButtonProps>` and `actionButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>` to disable/label close and action buttons during form submission.
|
|
129
131
|
- **Tabs**: `Tabs`, `TabsList`, `Tab`, `TabsContent`.
|
|
130
132
|
- **SplitButton**: `SplitButtonLayout`, `SplitButtonLeading`, `SplitButtonTrailing` (or `SplitButtonTrailingUncheckable`).
|
|
131
133
|
- **ButtonDistribute**: `ButtonDistribute` (`mode="dynamic" | "fixed" | "mixed"`), spring-animated button layout container for responsive action bars.
|
|
132
134
|
- **Menu Family**: `Menu`, `MenuTrigger`, `MenuContent`, `MenuGroup`, `MenuItem`, `MenuDivider`, `SubMenu`. Features shape morphing (`12dp` standalone corners), `variant="expressive" | "baseline"`, `colorVariant="standard" | "vibrant"`, and `matchTriggerWidth`. Includes `ContextMenu` and static `VerticalMenu`.
|
|
133
|
-
- **
|
|
135
|
+
- **TextField**: Supports `filled` (default) and `outlined` variants, floating animated labels, `prefixText`/`suffixText`, `leadingIcon`, `trailingIconMode` (`"none" | "clear" | "password-toggle" | "custom"`), and `type="textarea"` with `autoResize`.
|
|
136
|
+
- **CRITICAL `onChange` Signature**: `onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void`.
|
|
137
|
+
- The 1st argument is always the extracted `value: string` (e.g. `onChange={(val) => setValue(val)}`).
|
|
138
|
+
- The 2nd argument is the native `event` (optional, for accessing event metadata).
|
|
139
|
+
- ❌ NEVER write `onChange={e => setValue(e.target.value)}` — because `e` is already the `string`, accessing `e.target` causes `TypeError: Cannot read properties of undefined (reading 'value')`.
|
|
140
|
+
- **Select**: `Select` (Exposed Dropdown Menu & Autocomplete). Wraps `TextField` + `Menu`. Supports `searchable` (real-time filtering), controlled/uncontrolled state, and `onChange={(value: string, option?: SelectOption) => void}`.
|
|
134
141
|
|
|
135
142
|
### 7.2 Navigation Customization
|
|
136
143
|
- **NavigationBar & NavigationRail**: Support customizable `itemShape` (`"pill" | "circle" | "rounded-rectangle"`), `labelVisibility` (`"labeled" | "auto" | "unlabeled"`), and `fabAlignment` (`"left" | "center"`).
|
|
@@ -161,6 +168,14 @@ const state = useDatePickerState({ initialSelectedDateMs: Date.now() });
|
|
|
161
168
|
<DatePicker state={state} />
|
|
162
169
|
```
|
|
163
170
|
|
|
171
|
+
### 7.5 Card Component & Morphing Border Radius
|
|
172
|
+
`Card` (`@bug-on/m3-expressive/layout`) supports static (`<div>`), link (`<m.a>`), and button (`<m.button>`) modes with ripple and elevation physics.
|
|
173
|
+
- **Morphing Border Radius (`morphRadius`)**: Dynamically animates `borderRadius` on hover/press using MD3 spatial spring physics (`framerSprings.fast.spatial`).
|
|
174
|
+
- `morphRadius={true}`: Default rest `large` (16px) -> hover `extraLarge` (28px).
|
|
175
|
+
- `morphRadius={{ rest: "medium", hover: "full", pressed: "small" }}`: Granular configuration with preset levels (`MorphRadiusLevel`) or raw numbers (px).
|
|
176
|
+
- Only active on interactive cards by default (`onClick`, `href`, `interactive`).
|
|
177
|
+
- Static cards can opt-in by setting `forceMotion={true}` alongside `morphRadius`.
|
|
178
|
+
|
|
164
179
|
---
|
|
165
180
|
|
|
166
181
|
# PART 2: Styling & Design Tokens
|
|
@@ -247,8 +262,8 @@ import {
|
|
|
247
262
|
| `<Button variant="toggle">` (without `selected`) | Must pass both `variant="toggle"` and `selected={boolean}` |
|
|
248
263
|
| `<IconButton>` (without `aria-label`) | `aria-label` is required on icon buttons for accessibility |
|
|
249
264
|
| Manually writing flex math for responsive action bars | Use `<ButtonDistribute mode="dynamic">` for spring-animated responsive width distribution |
|
|
250
|
-
| `onChange={e => setValue(e.target.value)}` on TextField | `onChange={(value) => setValue(value)}`
|
|
251
|
-
| `Select` `onChange` assuming standard React `SyntheticEvent` | Signature is `onChange={(value: string, option?: SelectOption) => void}` |
|
|
265
|
+
| `onChange={e => setValue(e.target.value)}` on TextField | `onChange={(value) => setValue(value)}` — 1st arg is pre-extracted `string`, 2nd arg is optional `event`. Accessing `e.target.value` throws TypeError! |
|
|
266
|
+
| `Select` `onChange` assuming standard React `SyntheticEvent` | Signature is `onChange={(value: string, option?: SelectOption) => void}` (1st arg is `value: string`) |
|
|
252
267
|
| `<TabsList>` (without `variant`) | `variant` prop is required on `TabsList` (`"primary"` or `"secondary"`) |
|
|
253
268
|
| Using `useSnackbar()` outside `MD3ThemeProvider` or `SnackbarProvider` | Ensure provider wraps the tree with `enableSnackbar` |
|
|
254
269
|
| `<DatePicker />` or `<TimePicker />` without `state` prop | Always create state via `useDatePickerState()` or `useTimePickerState()` |
|
|
@@ -257,3 +272,10 @@ import {
|
|
|
257
272
|
| `<ProgressIndicator max={100} />` | ProgressIndicator does not support `max` prop. Progress is mapped strictly from 0 to 100 on the `value` prop |
|
|
258
273
|
| `<ProgressIndicator>` without `aria-label` | `aria-label` is required on all progress indicators for accessibility |
|
|
259
274
|
| `<ProgressIndicator value={0} />` for indeterminate mode | Omit `value` prop entirely (or pass `undefined`) to trigger indeterminate loading. Setting `value={0}` indicates 0% determinate progress |
|
|
275
|
+
| `<DialogContent>` close button during form submission | Use `closeButtonProps={{ disabled: isSubmitting }}` — do not build a custom close button just for `disabled` support |
|
|
276
|
+
| `<DialogContent>` close button i18n label | Use `closeButtonProps={{ "aria-label": "Đóng" }}` — the `aria-label` prop is forwarded to the `IconButton` |
|
|
277
|
+
| `<DialogContent>` needing full custom close button | Use `closeButton={<YourNode />}` — library auto-wraps in `DialogClose asChild`. When provided, `hideCloseButton` and `closeButtonProps` are ignored |
|
|
278
|
+
| `<DialogFullScreenContent>` action/close disabled during submit | Use `actionButtonProps={{ disabled: isSubmitting }}` and `closeButtonProps={{ disabled: isSubmitting }}` |
|
|
279
|
+
| Building a custom header with `DialogContent` just to control close button style | Use `closeButtonProps={{ colorStyle: "standard" }}` (default) or `"filled"` to override. Only use `hideCloseButton` + custom header when layout positioning is the actual requirement |
|
|
280
|
+
| Expecting `morphRadius` to animate on static `<Card>` without interaction | Static cards render a plain `<div>`. Pass `forceMotion={true}` to promote it to `<m.div>` and enable morph radius animation |
|
|
281
|
+
|
package/llms.txt
CHANGED
|
@@ -77,10 +77,13 @@ function Root({ children }: { children: React.ReactNode }) {
|
|
|
77
77
|
- **Physics Springs**: Powered by `motion/react` (Framer Motion ≥12). Uses spatial (`FAST_SPATIAL_SPRING`, `DEFAULT_SPATIAL_SPRING`) and effects (`FAST_EFFECTS_SPRING`) springs.
|
|
78
78
|
- **Polymorphism (`asChild`)**: Supported across buttons, cards, drawers, and dialog triggers for custom routing links.
|
|
79
79
|
- **Hoisted State**: `DatePicker` and `TimePicker` are stateless and require `useDatePickerState()` / `useTimePickerState()`.
|
|
80
|
-
- **TextField & Select onChange**: Parameter signature receives `(value: string)` — NOT a raw React SyntheticEvent
|
|
80
|
+
- **TextField & Select onChange**: Parameter signature receives `(value: string)` as the 1st argument — NOT a raw React SyntheticEvent!
|
|
81
|
+
- `TextField`: `onChange?: (value: string, event: React.ChangeEvent<...>) => void` (write `onChange={(val) => ...}`, NEVER `e.target.value` which throws `TypeError`).
|
|
82
|
+
- `Select`: `onChange?: (value: string, option?: SelectOption) => void`.
|
|
81
83
|
- **Select & Exposed Dropdowns**: `Select` supports standard dropdown and `searchable` autocomplete mode with real-time option filtering and `matchTriggerWidth` (default `true`).
|
|
82
84
|
- **Menu Family & Morphing**: `Menu`, `ContextMenu`, and `VerticalMenu` feature container shape morphing (`12dp` standalone corners). `MenuContent` `matchTriggerWidth` matches popover width to trigger.
|
|
83
85
|
- **ProgressIndicator & Wavy Motion**: Supports `"linear"` and `"circular"` variants with dynamic `"wavy"` shapes (`shape="wavy"`, `trackShape`, `amplitude`, `wavelength`). `aria-label` is strictly **required**. Indeterminate mode is triggered by omitting the `value` prop (do not use `max` prop). Supports co-elastic animations (`determinateAnimation`, `indeterminateAnimation`) and track stop dots (`showStopIndicator`).
|
|
86
|
+
- **Card & Morphing Border Radius**: Interactive cards support spring-animated border radius morphing on hover/tap via `morphRadius` (default: `16px` rest -> `28px` hover). Static cards can opt-in using `forceMotion={true}`. Configurable via preset tokens (`"large"`, `"extraLarge"`, etc.) or custom numeric px.
|
|
84
87
|
|
|
85
88
|
---
|
|
86
89
|
|
package/package.json
CHANGED
package/dist/md3-BQhRygSi.d.mts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ElementType, ComponentPropsWithoutRef, ReactNode, ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
|
-
/** MD3 button color variants */
|
|
4
|
-
type MD3ColorStyle = "elevated" | "filled" | "tonal" | "outlined" | "text"
|
|
5
|
-
/** High-chroma tertiary tone — for hero accents, CTAs, expressive moments. */
|
|
6
|
-
| "tertiary"
|
|
7
|
-
/** Brand-stable primary fixed — same hue across light/dark, for badges/pills. */
|
|
8
|
-
| "primary-fixed"
|
|
9
|
-
/** Brand-stable tertiary fixed — same hue across light/dark, for special states. */
|
|
10
|
-
| "tertiary-fixed";
|
|
11
|
-
/** MD3 Expressive button sizes */
|
|
12
|
-
type MD3Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
13
|
-
/**
|
|
14
|
-
* MD3 Expressive slot width ratio.
|
|
15
|
-
* Used for icon buttons where width is independent from the size scale.
|
|
16
|
-
* - `"narrow"` – compressed width for dense toolbars.
|
|
17
|
-
* - `"default"` – 1:1 square/round aspect ratio.
|
|
18
|
-
* - `"wide"` – extended width.
|
|
19
|
-
*/
|
|
20
|
-
type MD3SlotWidth = "narrow" | "default" | "wide";
|
|
21
|
-
/** MD3 shape families */
|
|
22
|
-
type MD3Shape = "round" | "square";
|
|
23
|
-
/** Helper: PolyMorphic component ref */
|
|
24
|
-
type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>["ref"];
|
|
25
|
-
/** Helper: Props cho polymorphic components */
|
|
26
|
-
type PolymorphicProps<C extends ElementType, Props = object> = Props & Omit<ComponentPropsWithoutRef<C>, keyof Props> & {
|
|
27
|
-
as?: C;
|
|
28
|
-
children?: ReactNode;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type { MD3ColorStyle as M, PolymorphicProps as P, MD3Shape as a, MD3Size as b, PolymorphicRef as c, MD3SlotWidth as d };
|
package/dist/md3-BQhRygSi.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ElementType, ComponentPropsWithoutRef, ReactNode, ComponentPropsWithRef } from 'react';
|
|
2
|
-
|
|
3
|
-
/** MD3 button color variants */
|
|
4
|
-
type MD3ColorStyle = "elevated" | "filled" | "tonal" | "outlined" | "text"
|
|
5
|
-
/** High-chroma tertiary tone — for hero accents, CTAs, expressive moments. */
|
|
6
|
-
| "tertiary"
|
|
7
|
-
/** Brand-stable primary fixed — same hue across light/dark, for badges/pills. */
|
|
8
|
-
| "primary-fixed"
|
|
9
|
-
/** Brand-stable tertiary fixed — same hue across light/dark, for special states. */
|
|
10
|
-
| "tertiary-fixed";
|
|
11
|
-
/** MD3 Expressive button sizes */
|
|
12
|
-
type MD3Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
13
|
-
/**
|
|
14
|
-
* MD3 Expressive slot width ratio.
|
|
15
|
-
* Used for icon buttons where width is independent from the size scale.
|
|
16
|
-
* - `"narrow"` – compressed width for dense toolbars.
|
|
17
|
-
* - `"default"` – 1:1 square/round aspect ratio.
|
|
18
|
-
* - `"wide"` – extended width.
|
|
19
|
-
*/
|
|
20
|
-
type MD3SlotWidth = "narrow" | "default" | "wide";
|
|
21
|
-
/** MD3 shape families */
|
|
22
|
-
type MD3Shape = "round" | "square";
|
|
23
|
-
/** Helper: PolyMorphic component ref */
|
|
24
|
-
type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>["ref"];
|
|
25
|
-
/** Helper: Props cho polymorphic components */
|
|
26
|
-
type PolymorphicProps<C extends ElementType, Props = object> = Props & Omit<ComponentPropsWithoutRef<C>, keyof Props> & {
|
|
27
|
-
as?: C;
|
|
28
|
-
children?: ReactNode;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type { MD3ColorStyle as M, PolymorphicProps as P, MD3Shape as a, MD3Size as b, PolymorphicRef as c, MD3SlotWidth as d };
|