@bug-on/m3-expressive 1.2.1 → 1.2.2
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 +6 -0
- package/dist/buttons.d.mts +26 -5
- package/dist/buttons.d.ts +26 -5
- package/dist/buttons.js +581 -345
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +573 -345
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.js +52 -13
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +52 -13
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.js +52 -13
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs +52 -13
- package/dist/feedback.mjs.map +1 -1
- package/dist/forms.js +4 -1
- package/dist/forms.js.map +1 -1
- package/dist/forms.mjs +4 -1
- package/dist/forms.mjs.map +1 -1
- package/dist/{icon-button-sSt6PPLg.d.mts → icon-button-CSsDmuQC.d.mts} +13 -0
- package/dist/{icon-button-sSt6PPLg.d.ts → icon-button-CSsDmuQC.d.ts} +13 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1268 -1005
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1127 -865
- package/dist/index.mjs.map +1 -1
- package/dist/layout.js +15 -7
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +15 -7
- package/dist/layout.mjs.map +1 -1
- package/dist/navigation.d.mts +1 -1
- package/dist/navigation.d.ts +1 -1
- package/dist/navigation.js +66 -16
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs +66 -16
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.js +52 -13
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +52 -13
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.js +177 -111
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +177 -111
- package/dist/pickers.mjs.map +1 -1
- package/dist/{split-button-trailing-uncheckable-BcPD_7uK.d.ts → split-button-trailing-uncheckable-C-qQlyZx.d.ts} +74 -19
- package/dist/{split-button-trailing-uncheckable-DtFJkTFr.d.mts → split-button-trailing-uncheckable-DHJqNeq_.d.mts} +74 -19
- package/package.json +3 -3
|
@@ -37,6 +37,10 @@ interface BaseButtonProps extends MotionButtonProps$3 {
|
|
|
37
37
|
* An optional icon to display alongside the label.
|
|
38
38
|
*/
|
|
39
39
|
icon?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* An optional icon to display when the button is in a selected toggle state (`variant="toggle"` and `selected={true}`).
|
|
42
|
+
*/
|
|
43
|
+
selectedIcon?: React.ReactNode;
|
|
40
44
|
/**
|
|
41
45
|
* Position of the icon relative to the label.
|
|
42
46
|
* @default "leading"
|
|
@@ -200,6 +204,75 @@ declare const BUTTON_COLOR_TOKENS: {
|
|
|
200
204
|
};
|
|
201
205
|
};
|
|
202
206
|
|
|
207
|
+
type DistributeMode = "fixed" | "dynamic" | "mixed";
|
|
208
|
+
interface ButtonDistributeProps extends React$1.HTMLAttributes<HTMLFieldSetElement> {
|
|
209
|
+
/**
|
|
210
|
+
* Distribution mode:
|
|
211
|
+
* - `fixed`: Buttons maintain fixed base size, morph and compress neighbors on press/interaction.
|
|
212
|
+
* - `dynamic`: Group fills 100% container width, expanding active button and shrinking neighbors proportionally.
|
|
213
|
+
* - `mixed`: Leading/trailing buttons remain fixed size, center button(s) flex: 1.
|
|
214
|
+
* @default "dynamic"
|
|
215
|
+
*/
|
|
216
|
+
mode?: DistributeMode;
|
|
217
|
+
/**
|
|
218
|
+
* Custom weight ratios for children in `dynamic` mode (e.g. `[1, 2, 1]` for Prev:Play:Next).
|
|
219
|
+
* If omitted, defaults to `[1, 2, 1]` for 3 children, or equal weights `[1, 1, ..., 1]`.
|
|
220
|
+
*/
|
|
221
|
+
weights?: number[];
|
|
222
|
+
/**
|
|
223
|
+
* Expansion factor added to active item weight in `dynamic` mode.
|
|
224
|
+
* @default 0.3
|
|
225
|
+
*/
|
|
226
|
+
expandRatio?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Controls whether hover state triggers button expansion in `dynamic` mode.
|
|
229
|
+
* Focus and Active/Press always trigger expansion regardless of this prop.
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
expandOnHover?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Fixed size (width in px or CSS string) for leading/trailing buttons in `mixed` mode,
|
|
235
|
+
* or base size override in `fixed` mode.
|
|
236
|
+
* @default 48
|
|
237
|
+
*/
|
|
238
|
+
fixedSize?: number | string;
|
|
239
|
+
/**
|
|
240
|
+
* Explicit fixed size for leading button in `mixed` mode. Overrides `fixedSize` if set.
|
|
241
|
+
*/
|
|
242
|
+
leadingSize?: number | string;
|
|
243
|
+
/**
|
|
244
|
+
* Explicit fixed size for trailing button in `mixed` mode. Overrides `fixedSize` if set.
|
|
245
|
+
*/
|
|
246
|
+
trailingSize?: number | string;
|
|
247
|
+
/**
|
|
248
|
+
* Gap spacing between buttons in group.
|
|
249
|
+
* @default "0.5rem" (8px)
|
|
250
|
+
*/
|
|
251
|
+
gap?: string | number;
|
|
252
|
+
/**
|
|
253
|
+
* Applied size token to all child buttons in group if not specified on child.
|
|
254
|
+
* @default "sm"
|
|
255
|
+
*/
|
|
256
|
+
size?: MD3Size;
|
|
257
|
+
/**
|
|
258
|
+
* Custom CSS class applied to button wrappers inside the group.
|
|
259
|
+
*/
|
|
260
|
+
itemClassName?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Child button elements (Button, IconButton, etc.).
|
|
263
|
+
*/
|
|
264
|
+
children: React$1.ReactNode;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @file button-distribute.tsx
|
|
269
|
+
*
|
|
270
|
+
* MD3 Expressive ButtonDistribute component.
|
|
271
|
+
* Flexible Button Group with Expressive Motion & Size Distribution (Fixed, Dynamic, Mixed).
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
declare const ButtonDistribute: React$1.ForwardRefExoticComponent<ButtonDistributeProps & React$1.RefAttributes<HTMLFieldSetElement>>;
|
|
275
|
+
|
|
203
276
|
type ButtonGroupVariant = "standard" | "connected";
|
|
204
277
|
type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
205
278
|
/**
|
|
@@ -227,17 +300,6 @@ interface ButtonGroupProps extends React$1.FieldsetHTMLAttributes<HTMLFieldSetEl
|
|
|
227
300
|
* Applies unified `size` to all child buttons in group (overrides individual button sizes).
|
|
228
301
|
*/
|
|
229
302
|
size?: MD3Size;
|
|
230
|
-
/**
|
|
231
|
-
* Toggles width expansion/padding animation (Morphing Width) when buttons are pressed (`standard` group).
|
|
232
|
-
* @default true
|
|
233
|
-
*/
|
|
234
|
-
morphingWidth?: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* Expansion ratio for button width on press (`standard` horizontal group).
|
|
237
|
-
* Per MD3 Spec, default is 0.15 (15%).
|
|
238
|
-
* @default 0.15
|
|
239
|
-
*/
|
|
240
|
-
expandedRatio?: number;
|
|
241
303
|
/**
|
|
242
304
|
* Automatically displays Check icon when a child button has `selected={true}`.
|
|
243
305
|
* @default false
|
|
@@ -257,13 +319,6 @@ interface ButtonGroupProps extends React$1.FieldsetHTMLAttributes<HTMLFieldSetEl
|
|
|
257
319
|
* - `none`: Hide all labels.
|
|
258
320
|
*/
|
|
259
321
|
labelBehavior?: "selected" | "all" | "none";
|
|
260
|
-
/**
|
|
261
|
-
* Enable Active Morphing mode (selection-based).
|
|
262
|
-
* When `true`, buttons automatically expand/contract based on selection state,
|
|
263
|
-
* creating smooth size transitions.
|
|
264
|
-
* When `false` or `undefined`, Group responds to `isPressed` by default.
|
|
265
|
-
*/
|
|
266
|
-
activeMorphing?: boolean;
|
|
267
322
|
/**
|
|
268
323
|
* Custom CSS class applied to individual child buttons in group.
|
|
269
324
|
* Useful for customizing padding, min-width, or other layout properties.
|
|
@@ -783,4 +838,4 @@ declare const TonalSplitButtonTrailingUncheckable: React$1.ForwardRefExoticCompo
|
|
|
783
838
|
declare const ElevatedSplitButtonTrailingUncheckable: React$1.ForwardRefExoticComponent<Omit<Omit<SplitButtonTrailingUncheckableProps, "variant">, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
784
839
|
declare const OutlinedSplitButtonTrailingUncheckable: React$1.ForwardRefExoticComponent<Omit<Omit<SplitButtonTrailingUncheckableProps, "variant">, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
785
840
|
|
|
786
|
-
export {
|
|
841
|
+
export { OutlinedSplitButtonTrailingUncheckable as A, BUTTON_COLOR_TOKENS as B, type SplitButtonLayoutProps as C, type DistributeMode as D, ElevatedSplitButtonLeading as E, FAB as F, SplitButtonLeading as G, type SplitButtonLeadingProps as H, type SplitButtonSize as I, SplitButtonTrailing as J, type SplitButtonTrailingProps as K, SplitButtonTrailingUncheckable as L, type SplitButtonTrailingUncheckableProps as M, type SplitButtonVariant as N, OutlinedSplitButtonLeading as O, type ToggleFABProps as P, TonalSplitButtonLeading as Q, TonalSplitButtonTrailing as R, SplitButtonLayout as S, ToggleFAB as T, TonalSplitButtonTrailingUncheckable as U, type SplitButtonSizeTokens as V, BUTTON_SIZE_TOKENS as a, type BaseButtonProps as b, Button as c, ButtonDistribute as d, type ButtonDistributeProps as e, ButtonGroup as f, type ButtonGroupOrientation as g, type ButtonGroupProps as h, type ButtonGroupVariant as i, type ButtonProps as j, ElevatedSplitButtonTrailing as k, ElevatedSplitButtonTrailingUncheckable as l, ExtendedFAB as m, type ExtendedFABProps as n, FABMenu as o, FABMenuItem as p, type FABMenuItemData as q, type FABMenuItemProps as r, type FABMenuProps as s, FABPosition as t, type FABPositionProps as u, type FABProps as v, FilledSplitButtonLeading as w, FilledSplitButtonTrailing as x, FilledSplitButtonTrailingUncheckable as y, OutlinedSplitButtonTrailing as z };
|
|
@@ -37,6 +37,10 @@ interface BaseButtonProps extends MotionButtonProps$3 {
|
|
|
37
37
|
* An optional icon to display alongside the label.
|
|
38
38
|
*/
|
|
39
39
|
icon?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* An optional icon to display when the button is in a selected toggle state (`variant="toggle"` and `selected={true}`).
|
|
42
|
+
*/
|
|
43
|
+
selectedIcon?: React.ReactNode;
|
|
40
44
|
/**
|
|
41
45
|
* Position of the icon relative to the label.
|
|
42
46
|
* @default "leading"
|
|
@@ -200,6 +204,75 @@ declare const BUTTON_COLOR_TOKENS: {
|
|
|
200
204
|
};
|
|
201
205
|
};
|
|
202
206
|
|
|
207
|
+
type DistributeMode = "fixed" | "dynamic" | "mixed";
|
|
208
|
+
interface ButtonDistributeProps extends React$1.HTMLAttributes<HTMLFieldSetElement> {
|
|
209
|
+
/**
|
|
210
|
+
* Distribution mode:
|
|
211
|
+
* - `fixed`: Buttons maintain fixed base size, morph and compress neighbors on press/interaction.
|
|
212
|
+
* - `dynamic`: Group fills 100% container width, expanding active button and shrinking neighbors proportionally.
|
|
213
|
+
* - `mixed`: Leading/trailing buttons remain fixed size, center button(s) flex: 1.
|
|
214
|
+
* @default "dynamic"
|
|
215
|
+
*/
|
|
216
|
+
mode?: DistributeMode;
|
|
217
|
+
/**
|
|
218
|
+
* Custom weight ratios for children in `dynamic` mode (e.g. `[1, 2, 1]` for Prev:Play:Next).
|
|
219
|
+
* If omitted, defaults to `[1, 2, 1]` for 3 children, or equal weights `[1, 1, ..., 1]`.
|
|
220
|
+
*/
|
|
221
|
+
weights?: number[];
|
|
222
|
+
/**
|
|
223
|
+
* Expansion factor added to active item weight in `dynamic` mode.
|
|
224
|
+
* @default 0.3
|
|
225
|
+
*/
|
|
226
|
+
expandRatio?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Controls whether hover state triggers button expansion in `dynamic` mode.
|
|
229
|
+
* Focus and Active/Press always trigger expansion regardless of this prop.
|
|
230
|
+
* @default false
|
|
231
|
+
*/
|
|
232
|
+
expandOnHover?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Fixed size (width in px or CSS string) for leading/trailing buttons in `mixed` mode,
|
|
235
|
+
* or base size override in `fixed` mode.
|
|
236
|
+
* @default 48
|
|
237
|
+
*/
|
|
238
|
+
fixedSize?: number | string;
|
|
239
|
+
/**
|
|
240
|
+
* Explicit fixed size for leading button in `mixed` mode. Overrides `fixedSize` if set.
|
|
241
|
+
*/
|
|
242
|
+
leadingSize?: number | string;
|
|
243
|
+
/**
|
|
244
|
+
* Explicit fixed size for trailing button in `mixed` mode. Overrides `fixedSize` if set.
|
|
245
|
+
*/
|
|
246
|
+
trailingSize?: number | string;
|
|
247
|
+
/**
|
|
248
|
+
* Gap spacing between buttons in group.
|
|
249
|
+
* @default "0.5rem" (8px)
|
|
250
|
+
*/
|
|
251
|
+
gap?: string | number;
|
|
252
|
+
/**
|
|
253
|
+
* Applied size token to all child buttons in group if not specified on child.
|
|
254
|
+
* @default "sm"
|
|
255
|
+
*/
|
|
256
|
+
size?: MD3Size;
|
|
257
|
+
/**
|
|
258
|
+
* Custom CSS class applied to button wrappers inside the group.
|
|
259
|
+
*/
|
|
260
|
+
itemClassName?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Child button elements (Button, IconButton, etc.).
|
|
263
|
+
*/
|
|
264
|
+
children: React$1.ReactNode;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @file button-distribute.tsx
|
|
269
|
+
*
|
|
270
|
+
* MD3 Expressive ButtonDistribute component.
|
|
271
|
+
* Flexible Button Group with Expressive Motion & Size Distribution (Fixed, Dynamic, Mixed).
|
|
272
|
+
*/
|
|
273
|
+
|
|
274
|
+
declare const ButtonDistribute: React$1.ForwardRefExoticComponent<ButtonDistributeProps & React$1.RefAttributes<HTMLFieldSetElement>>;
|
|
275
|
+
|
|
203
276
|
type ButtonGroupVariant = "standard" | "connected";
|
|
204
277
|
type ButtonGroupOrientation = "horizontal" | "vertical";
|
|
205
278
|
/**
|
|
@@ -227,17 +300,6 @@ interface ButtonGroupProps extends React$1.FieldsetHTMLAttributes<HTMLFieldSetEl
|
|
|
227
300
|
* Applies unified `size` to all child buttons in group (overrides individual button sizes).
|
|
228
301
|
*/
|
|
229
302
|
size?: MD3Size;
|
|
230
|
-
/**
|
|
231
|
-
* Toggles width expansion/padding animation (Morphing Width) when buttons are pressed (`standard` group).
|
|
232
|
-
* @default true
|
|
233
|
-
*/
|
|
234
|
-
morphingWidth?: boolean;
|
|
235
|
-
/**
|
|
236
|
-
* Expansion ratio for button width on press (`standard` horizontal group).
|
|
237
|
-
* Per MD3 Spec, default is 0.15 (15%).
|
|
238
|
-
* @default 0.15
|
|
239
|
-
*/
|
|
240
|
-
expandedRatio?: number;
|
|
241
303
|
/**
|
|
242
304
|
* Automatically displays Check icon when a child button has `selected={true}`.
|
|
243
305
|
* @default false
|
|
@@ -257,13 +319,6 @@ interface ButtonGroupProps extends React$1.FieldsetHTMLAttributes<HTMLFieldSetEl
|
|
|
257
319
|
* - `none`: Hide all labels.
|
|
258
320
|
*/
|
|
259
321
|
labelBehavior?: "selected" | "all" | "none";
|
|
260
|
-
/**
|
|
261
|
-
* Enable Active Morphing mode (selection-based).
|
|
262
|
-
* When `true`, buttons automatically expand/contract based on selection state,
|
|
263
|
-
* creating smooth size transitions.
|
|
264
|
-
* When `false` or `undefined`, Group responds to `isPressed` by default.
|
|
265
|
-
*/
|
|
266
|
-
activeMorphing?: boolean;
|
|
267
322
|
/**
|
|
268
323
|
* Custom CSS class applied to individual child buttons in group.
|
|
269
324
|
* Useful for customizing padding, min-width, or other layout properties.
|
|
@@ -783,4 +838,4 @@ declare const TonalSplitButtonTrailingUncheckable: React$1.ForwardRefExoticCompo
|
|
|
783
838
|
declare const ElevatedSplitButtonTrailingUncheckable: React$1.ForwardRefExoticComponent<Omit<Omit<SplitButtonTrailingUncheckableProps, "variant">, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
784
839
|
declare const OutlinedSplitButtonTrailingUncheckable: React$1.ForwardRefExoticComponent<Omit<Omit<SplitButtonTrailingUncheckableProps, "variant">, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
785
840
|
|
|
786
|
-
export {
|
|
841
|
+
export { OutlinedSplitButtonTrailingUncheckable as A, BUTTON_COLOR_TOKENS as B, type SplitButtonLayoutProps as C, type DistributeMode as D, ElevatedSplitButtonLeading as E, FAB as F, SplitButtonLeading as G, type SplitButtonLeadingProps as H, type SplitButtonSize as I, SplitButtonTrailing as J, type SplitButtonTrailingProps as K, SplitButtonTrailingUncheckable as L, type SplitButtonTrailingUncheckableProps as M, type SplitButtonVariant as N, OutlinedSplitButtonLeading as O, type ToggleFABProps as P, TonalSplitButtonLeading as Q, TonalSplitButtonTrailing as R, SplitButtonLayout as S, ToggleFAB as T, TonalSplitButtonTrailingUncheckable as U, type SplitButtonSizeTokens as V, BUTTON_SIZE_TOKENS as a, type BaseButtonProps as b, Button as c, ButtonDistribute as d, type ButtonDistributeProps as e, ButtonGroup as f, type ButtonGroupOrientation as g, type ButtonGroupProps as h, type ButtonGroupVariant as i, type ButtonProps as j, ElevatedSplitButtonTrailing as k, ElevatedSplitButtonTrailingUncheckable as l, ExtendedFAB as m, type ExtendedFABProps as n, FABMenu as o, FABMenuItem as p, type FABMenuItemData as q, type FABMenuItemProps as r, type FABMenuProps as s, FABPosition as t, type FABPositionProps as u, type FABProps as v, FilledSplitButtonLeading as w, FilledSplitButtonTrailing as x, FilledSplitButtonTrailingUncheckable as y, OutlinedSplitButtonTrailing as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bug-on/m3-expressive",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Material Design 3 Expressive React components",
|
|
5
5
|
"author": "Bug On",
|
|
6
6
|
"license": "MIT",
|
|
@@ -179,8 +179,8 @@
|
|
|
179
179
|
"class-variance-authority": "^0.7.1",
|
|
180
180
|
"clsx": "^2.1.1",
|
|
181
181
|
"tailwind-merge": "^3.3.1",
|
|
182
|
-
"@bug-on/m3-
|
|
183
|
-
"@bug-on/m3-
|
|
182
|
+
"@bug-on/m3-tokens": "1.2.0",
|
|
183
|
+
"@bug-on/m3-tailwind": "1.2.0"
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
186
|
"@testing-library/jest-dom": "^6.9.1",
|