@bug-on/m3-expressive 1.0.0 → 1.2.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/CHANGELOG.md +41 -2
- package/README.md +20 -18
- package/dist/assets/material-symbols-self-hosted.css +27 -26
- package/dist/buttons.d.mts +2 -2
- package/dist/buttons.d.ts +2 -2
- package/dist/buttons.js +30 -1
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs +30 -1
- package/dist/buttons.mjs.map +1 -1
- package/dist/core-Bc5Wj_pc.d.ts +497 -0
- package/dist/core-D4048_K5.d.mts +497 -0
- package/dist/core.d.mts +6 -422
- package/dist/core.d.ts +6 -422
- package/dist/core.js +137 -68
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +138 -69
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +54 -54
- package/dist/feedback.d.ts +54 -54
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.css +9 -1
- package/dist/index.d.mts +66 -4
- package/dist/index.d.ts +66 -4
- package/dist/index.js +214 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +214 -95
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +40 -40
- package/dist/layout.d.ts +40 -40
- package/dist/layout.js +34 -5
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +34 -5
- package/dist/layout.mjs.map +1 -1
- package/dist/material-symbols-self-hosted.css +27 -26
- package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
- package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -1
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +2 -2
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +2 -2
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.d.mts +241 -243
- package/dist/pickers.d.ts +241 -243
- package/dist/pickers.js +1 -1
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +1 -1
- package/dist/pickers.mjs.map +1 -1
- package/dist/{side-sheet-modal-BY6VCC8p.d.mts → side-sheet-modal-64FGhDxL.d.mts} +20 -21
- package/dist/{side-sheet-modal-CglP6KYA.d.ts → side-sheet-modal-Bd5Qqvp9.d.ts} +20 -21
- package/dist/{split-button-trailing-uncheckable-C5CLCIKP.d.ts → split-button-trailing-uncheckable-BkPbiBo3.d.ts} +169 -152
- package/dist/{split-button-trailing-uncheckable-MXj_kyNt.d.mts → split-button-trailing-uncheckable-D_PLPb-u.d.mts} +169 -152
- package/dist/typography.css +5 -0
- package/package.json +5 -5
package/dist/layout.d.mts
CHANGED
|
@@ -13,21 +13,21 @@ declare const cardVariants: (props?: ({
|
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
14
|
type MotionDivProps = Omit<HTMLMotionProps<"button">, "children" | "color">;
|
|
15
15
|
interface CardProps extends MotionDivProps, VariantProps<typeof cardVariants> {
|
|
16
|
-
/**
|
|
16
|
+
/** Disables interaction and reduces opacity (MD3 disabled state). */
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Forces card to be interactive even without `onClick`.
|
|
20
|
+
* Useful when card contains child interactive elements.
|
|
21
21
|
*/
|
|
22
22
|
interactive?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* If provided, renders card as `<a>` element. Automatically enables interactive mode.
|
|
25
|
+
* Prefer `href` over `onClick` for page navigation.
|
|
26
26
|
*/
|
|
27
27
|
href?: string;
|
|
28
|
-
/** Target
|
|
28
|
+
/** Target for `<a>` element (effective only when `href` is provided). */
|
|
29
29
|
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>["target"];
|
|
30
|
-
/** rel
|
|
30
|
+
/** rel for `<a>` element (automatically adds `noreferrer` when `target="_blank"`). */
|
|
31
31
|
rel?: string;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
33
|
}
|
|
@@ -219,77 +219,77 @@ type ListItemPosition = "solo" | "leading" | "middle" | "trailing";
|
|
|
219
219
|
type ListItemLeadingType = "none" | "icon" | "avatar" | "image" | "video" | "checkbox" | "radio" | "custom";
|
|
220
220
|
type ListItemTrailingType = "none" | "icon" | "icon-button" | "text" | "checkbox" | "radio" | "switch" | "custom";
|
|
221
221
|
interface ListProps extends Omit<React.HTMLAttributes<HTMLUListElement>, "onChange"> {
|
|
222
|
-
/**
|
|
222
|
+
/** List variant, supports 'baseline' and 'expressive'. Default: 'baseline' */
|
|
223
223
|
variant?: ListVariant;
|
|
224
|
-
/**
|
|
224
|
+
/** Display style, supports 'standard' (no gap) and 'segmented' (2px gap). Default: 'standard' */
|
|
225
225
|
listStyle?: ListStyle;
|
|
226
|
-
/**
|
|
226
|
+
/** Selection/interaction mode of the list. Default: 'none' */
|
|
227
227
|
selectionMode?: ListSelectionMode;
|
|
228
|
-
/**
|
|
228
|
+
/** Currently selected value (for controlled mode). String for single, string[] for multi */
|
|
229
229
|
value?: string | string[];
|
|
230
|
-
/**
|
|
230
|
+
/** Default initial selected value (for uncontrolled mode) */
|
|
231
231
|
defaultValue?: string | string[];
|
|
232
|
-
/** Callback
|
|
232
|
+
/** Callback fired when selection changes */
|
|
233
233
|
onChange?: (value: string | string[]) => void;
|
|
234
|
-
/**
|
|
234
|
+
/** Enable drag-and-drop reordering */
|
|
235
235
|
reorderable?: boolean;
|
|
236
|
-
/**
|
|
236
|
+
/** Data items array used with reorderable mode */
|
|
237
237
|
items?: unknown[];
|
|
238
|
-
/** Callback
|
|
238
|
+
/** Callback returning reordered items */
|
|
239
239
|
onReorder?: (newItems: unknown[]) => void;
|
|
240
|
-
/** Custom
|
|
240
|
+
/** Custom outer corner radius (for leading/trailing list items). Default per MD3 Expressive spec is 16px */
|
|
241
241
|
outerRadius?: number;
|
|
242
|
-
/** Custom
|
|
242
|
+
/** Custom inner corner radius (for adjacent list items). Default per MD3 Expressive spec is 4px */
|
|
243
243
|
innerRadius?: number;
|
|
244
244
|
children?: React.ReactNode;
|
|
245
245
|
}
|
|
246
246
|
type SafeHTMLLIAttrs = Omit<React.HTMLAttributes<HTMLLIElement>, "onClick" | "color" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onTransitionEnd">;
|
|
247
247
|
interface ListItemProps extends SafeHTMLLIAttrs {
|
|
248
|
-
/**
|
|
248
|
+
/** Unique identifier value for the ListItem */
|
|
249
249
|
value: string;
|
|
250
|
-
/**
|
|
250
|
+
/** Main headline title of the item */
|
|
251
251
|
headline: React.ReactNode;
|
|
252
|
-
/**
|
|
252
|
+
/** Supporting text displayed below the headline */
|
|
253
253
|
supportingText?: React.ReactNode;
|
|
254
|
-
/**
|
|
254
|
+
/** Max lines for supporting text (1 or 2) to calculate height. Default: 1 */
|
|
255
255
|
supportingTextLines?: 1 | 2;
|
|
256
|
-
/**
|
|
256
|
+
/** Small overline text displayed above the main headline */
|
|
257
257
|
overline?: React.ReactNode;
|
|
258
|
-
/**
|
|
258
|
+
/** Type of element rendered at the start of the list item */
|
|
259
259
|
leadingType?: ListItemLeadingType;
|
|
260
|
-
/**
|
|
260
|
+
/** Source URL for image or video when leadingType is 'image' or 'video' */
|
|
261
261
|
leadingSrc?: string;
|
|
262
|
-
/** Alt text
|
|
262
|
+
/** Alt text for image */
|
|
263
263
|
leadingAlt?: string;
|
|
264
|
-
/** Custom content
|
|
264
|
+
/** Custom leading content (used when leadingType = 'custom') */
|
|
265
265
|
leadingContent?: React.ReactNode;
|
|
266
|
-
/**
|
|
266
|
+
/** Type of element rendered at the end of the list item */
|
|
267
267
|
trailingType?: ListItemTrailingType;
|
|
268
|
-
/**
|
|
268
|
+
/** Text displayed at the end of the list item */
|
|
269
269
|
trailingText?: string;
|
|
270
|
-
/** Custom content
|
|
270
|
+
/** Custom content or callback for trailing element */
|
|
271
271
|
trailingContent?: React.ReactNode;
|
|
272
|
-
/**
|
|
272
|
+
/** Disable interaction */
|
|
273
273
|
disabled?: boolean;
|
|
274
|
-
/**
|
|
274
|
+
/** Selected state (for single-select / multi-select) */
|
|
275
275
|
selected?: boolean;
|
|
276
|
-
/**
|
|
276
|
+
/** Target URL if rendering ListItem as an anchor <a> tag */
|
|
277
277
|
href?: string;
|
|
278
|
-
/** Callback
|
|
278
|
+
/** Callback when clicking on ListItem */
|
|
279
279
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
280
|
-
/**
|
|
280
|
+
/** Force interactive mode (hover/focus overlay, ripple) even without onClick/href */
|
|
281
281
|
interactive?: boolean;
|
|
282
|
-
/**
|
|
282
|
+
/** Enable drag handle icon drag restriction */
|
|
283
283
|
dragHandle?: boolean;
|
|
284
|
-
/** Override
|
|
284
|
+
/** Override position of item in list (solo, leading, middle, trailing) */
|
|
285
285
|
position?: ListItemPosition;
|
|
286
|
-
/**
|
|
286
|
+
/** Internal item index passed automatically by parent List */
|
|
287
287
|
_listIndex?: number;
|
|
288
288
|
}
|
|
289
289
|
interface ListDividerProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
290
|
-
/**
|
|
290
|
+
/** Indent start of divider */
|
|
291
291
|
inset?: boolean;
|
|
292
|
-
/**
|
|
292
|
+
/** Indent style: 'icon' (56px indent), 'avatar' (72px indent), or 'custom' */
|
|
293
293
|
insetType?: "icon" | "avatar" | "custom";
|
|
294
294
|
}
|
|
295
295
|
|
package/dist/layout.d.ts
CHANGED
|
@@ -13,21 +13,21 @@ declare const cardVariants: (props?: ({
|
|
|
13
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
14
|
type MotionDivProps = Omit<HTMLMotionProps<"button">, "children" | "color">;
|
|
15
15
|
interface CardProps extends MotionDivProps, VariantProps<typeof cardVariants> {
|
|
16
|
-
/**
|
|
16
|
+
/** Disables interaction and reduces opacity (MD3 disabled state). */
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Forces card to be interactive even without `onClick`.
|
|
20
|
+
* Useful when card contains child interactive elements.
|
|
21
21
|
*/
|
|
22
22
|
interactive?: boolean;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* If provided, renders card as `<a>` element. Automatically enables interactive mode.
|
|
25
|
+
* Prefer `href` over `onClick` for page navigation.
|
|
26
26
|
*/
|
|
27
27
|
href?: string;
|
|
28
|
-
/** Target
|
|
28
|
+
/** Target for `<a>` element (effective only when `href` is provided). */
|
|
29
29
|
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>["target"];
|
|
30
|
-
/** rel
|
|
30
|
+
/** rel for `<a>` element (automatically adds `noreferrer` when `target="_blank"`). */
|
|
31
31
|
rel?: string;
|
|
32
32
|
children?: React.ReactNode;
|
|
33
33
|
}
|
|
@@ -219,77 +219,77 @@ type ListItemPosition = "solo" | "leading" | "middle" | "trailing";
|
|
|
219
219
|
type ListItemLeadingType = "none" | "icon" | "avatar" | "image" | "video" | "checkbox" | "radio" | "custom";
|
|
220
220
|
type ListItemTrailingType = "none" | "icon" | "icon-button" | "text" | "checkbox" | "radio" | "switch" | "custom";
|
|
221
221
|
interface ListProps extends Omit<React.HTMLAttributes<HTMLUListElement>, "onChange"> {
|
|
222
|
-
/**
|
|
222
|
+
/** List variant, supports 'baseline' and 'expressive'. Default: 'baseline' */
|
|
223
223
|
variant?: ListVariant;
|
|
224
|
-
/**
|
|
224
|
+
/** Display style, supports 'standard' (no gap) and 'segmented' (2px gap). Default: 'standard' */
|
|
225
225
|
listStyle?: ListStyle;
|
|
226
|
-
/**
|
|
226
|
+
/** Selection/interaction mode of the list. Default: 'none' */
|
|
227
227
|
selectionMode?: ListSelectionMode;
|
|
228
|
-
/**
|
|
228
|
+
/** Currently selected value (for controlled mode). String for single, string[] for multi */
|
|
229
229
|
value?: string | string[];
|
|
230
|
-
/**
|
|
230
|
+
/** Default initial selected value (for uncontrolled mode) */
|
|
231
231
|
defaultValue?: string | string[];
|
|
232
|
-
/** Callback
|
|
232
|
+
/** Callback fired when selection changes */
|
|
233
233
|
onChange?: (value: string | string[]) => void;
|
|
234
|
-
/**
|
|
234
|
+
/** Enable drag-and-drop reordering */
|
|
235
235
|
reorderable?: boolean;
|
|
236
|
-
/**
|
|
236
|
+
/** Data items array used with reorderable mode */
|
|
237
237
|
items?: unknown[];
|
|
238
|
-
/** Callback
|
|
238
|
+
/** Callback returning reordered items */
|
|
239
239
|
onReorder?: (newItems: unknown[]) => void;
|
|
240
|
-
/** Custom
|
|
240
|
+
/** Custom outer corner radius (for leading/trailing list items). Default per MD3 Expressive spec is 16px */
|
|
241
241
|
outerRadius?: number;
|
|
242
|
-
/** Custom
|
|
242
|
+
/** Custom inner corner radius (for adjacent list items). Default per MD3 Expressive spec is 4px */
|
|
243
243
|
innerRadius?: number;
|
|
244
244
|
children?: React.ReactNode;
|
|
245
245
|
}
|
|
246
246
|
type SafeHTMLLIAttrs = Omit<React.HTMLAttributes<HTMLLIElement>, "onClick" | "color" | "onDrag" | "onDragStart" | "onDragEnd" | "onDragEnter" | "onDragLeave" | "onDragOver" | "onDrop" | "onAnimationStart" | "onAnimationEnd" | "onAnimationIteration" | "onTransitionEnd">;
|
|
247
247
|
interface ListItemProps extends SafeHTMLLIAttrs {
|
|
248
|
-
/**
|
|
248
|
+
/** Unique identifier value for the ListItem */
|
|
249
249
|
value: string;
|
|
250
|
-
/**
|
|
250
|
+
/** Main headline title of the item */
|
|
251
251
|
headline: React.ReactNode;
|
|
252
|
-
/**
|
|
252
|
+
/** Supporting text displayed below the headline */
|
|
253
253
|
supportingText?: React.ReactNode;
|
|
254
|
-
/**
|
|
254
|
+
/** Max lines for supporting text (1 or 2) to calculate height. Default: 1 */
|
|
255
255
|
supportingTextLines?: 1 | 2;
|
|
256
|
-
/**
|
|
256
|
+
/** Small overline text displayed above the main headline */
|
|
257
257
|
overline?: React.ReactNode;
|
|
258
|
-
/**
|
|
258
|
+
/** Type of element rendered at the start of the list item */
|
|
259
259
|
leadingType?: ListItemLeadingType;
|
|
260
|
-
/**
|
|
260
|
+
/** Source URL for image or video when leadingType is 'image' or 'video' */
|
|
261
261
|
leadingSrc?: string;
|
|
262
|
-
/** Alt text
|
|
262
|
+
/** Alt text for image */
|
|
263
263
|
leadingAlt?: string;
|
|
264
|
-
/** Custom content
|
|
264
|
+
/** Custom leading content (used when leadingType = 'custom') */
|
|
265
265
|
leadingContent?: React.ReactNode;
|
|
266
|
-
/**
|
|
266
|
+
/** Type of element rendered at the end of the list item */
|
|
267
267
|
trailingType?: ListItemTrailingType;
|
|
268
|
-
/**
|
|
268
|
+
/** Text displayed at the end of the list item */
|
|
269
269
|
trailingText?: string;
|
|
270
|
-
/** Custom content
|
|
270
|
+
/** Custom content or callback for trailing element */
|
|
271
271
|
trailingContent?: React.ReactNode;
|
|
272
|
-
/**
|
|
272
|
+
/** Disable interaction */
|
|
273
273
|
disabled?: boolean;
|
|
274
|
-
/**
|
|
274
|
+
/** Selected state (for single-select / multi-select) */
|
|
275
275
|
selected?: boolean;
|
|
276
|
-
/**
|
|
276
|
+
/** Target URL if rendering ListItem as an anchor <a> tag */
|
|
277
277
|
href?: string;
|
|
278
|
-
/** Callback
|
|
278
|
+
/** Callback when clicking on ListItem */
|
|
279
279
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
280
|
-
/**
|
|
280
|
+
/** Force interactive mode (hover/focus overlay, ripple) even without onClick/href */
|
|
281
281
|
interactive?: boolean;
|
|
282
|
-
/**
|
|
282
|
+
/** Enable drag handle icon drag restriction */
|
|
283
283
|
dragHandle?: boolean;
|
|
284
|
-
/** Override
|
|
284
|
+
/** Override position of item in list (solo, leading, middle, trailing) */
|
|
285
285
|
position?: ListItemPosition;
|
|
286
|
-
/**
|
|
286
|
+
/** Internal item index passed automatically by parent List */
|
|
287
287
|
_listIndex?: number;
|
|
288
288
|
}
|
|
289
289
|
interface ListDividerProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
290
|
-
/**
|
|
290
|
+
/** Indent start of divider */
|
|
291
291
|
inset?: boolean;
|
|
292
|
-
/**
|
|
292
|
+
/** Indent style: 'icon' (56px indent), 'avatar' (72px indent), or 'custom' */
|
|
293
293
|
insetType?: "icon" | "avatar" | "custom";
|
|
294
294
|
}
|
|
295
295
|
|
package/dist/layout.js
CHANGED
|
@@ -229,19 +229,19 @@ var CardImpl = React18__namespace.forwardRef(
|
|
|
229
229
|
const baseClass = cn(
|
|
230
230
|
cardVariants({ variant }),
|
|
231
231
|
// Disabled state:
|
|
232
|
-
// - pointer-events-none →
|
|
232
|
+
// - pointer-events-none → disable interactions completely
|
|
233
233
|
// - opacity-[0.38] → MD3 DisabledContainerOpacity
|
|
234
234
|
disabled && "pointer-events-none opacity-[0.38]",
|
|
235
235
|
className
|
|
236
236
|
);
|
|
237
237
|
const interactiveClass = cn(
|
|
238
|
-
//
|
|
238
|
+
// Remove default outline, use MD3 state overlay & elevation for focus
|
|
239
239
|
"focus-visible:outline-none focus:outline-none group",
|
|
240
|
-
//
|
|
240
|
+
// Base pseudo-element overlay layer
|
|
241
241
|
"before:absolute before:inset-0 before:pointer-events-none before:bg-m3-on-surface before:opacity-0 before:transition-opacity before:duration-200",
|
|
242
|
-
// Interactive
|
|
242
|
+
// Interactive state opacities
|
|
243
243
|
"hover:before:opacity-[0.08] focus-visible:before:opacity-[0.10] active:before:opacity-[0.10]",
|
|
244
|
-
// Outlined interactive card:
|
|
244
|
+
// Outlined interactive card: change border color to m3-outline on focus/press/hover
|
|
245
245
|
variant === "outlined" && "hover:border-m3-outline focus-visible:border-m3-outline active:border-m3-outline"
|
|
246
246
|
);
|
|
247
247
|
if (!isInteractive) {
|
|
@@ -1396,6 +1396,35 @@ var BUTTON_COLOR_TOKENS = {
|
|
|
1396
1396
|
default: "bg-transparent text-m3-primary",
|
|
1397
1397
|
selected: "bg-transparent text-m3-primary",
|
|
1398
1398
|
unselected: "bg-transparent text-m3-primary"
|
|
1399
|
+
},
|
|
1400
|
+
// ── MD3 Expressive accent variants ──────────────────────────────────────
|
|
1401
|
+
/**
|
|
1402
|
+
* High-chroma tertiary tone. Use for hero CTAs and expressive moments where
|
|
1403
|
+
* a distinct accent beyond primary is needed (e.g., hero chip, highlight fab).
|
|
1404
|
+
*/
|
|
1405
|
+
tertiary: {
|
|
1406
|
+
default: "bg-m3-tertiary text-m3-on-tertiary",
|
|
1407
|
+
selected: "bg-m3-tertiary text-m3-on-tertiary",
|
|
1408
|
+
unselected: "bg-m3-tertiary-container text-m3-on-tertiary-container"
|
|
1409
|
+
},
|
|
1410
|
+
/**
|
|
1411
|
+
* Brand-stable primary fixed. Hue stays consistent across light and dark modes.
|
|
1412
|
+
* Ideal for badges, pill chips, and elements that must carry the brand color
|
|
1413
|
+
* regardless of the active theme.
|
|
1414
|
+
*/
|
|
1415
|
+
"primary-fixed": {
|
|
1416
|
+
default: "bg-m3-primary-fixed text-m3-on-primary-fixed",
|
|
1417
|
+
selected: "bg-m3-primary-fixed text-m3-on-primary-fixed",
|
|
1418
|
+
unselected: "bg-m3-primary-fixed text-m3-on-primary-fixed-variant"
|
|
1419
|
+
},
|
|
1420
|
+
/**
|
|
1421
|
+
* Brand-stable tertiary fixed. Use for special-state indicators, achievement
|
|
1422
|
+
* badges, or accent pills that need a fixed tertiary hue across themes.
|
|
1423
|
+
*/
|
|
1424
|
+
"tertiary-fixed": {
|
|
1425
|
+
default: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed",
|
|
1426
|
+
selected: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed",
|
|
1427
|
+
unselected: "bg-m3-tertiary-fixed text-m3-on-tertiary-fixed-variant"
|
|
1399
1428
|
}
|
|
1400
1429
|
};
|
|
1401
1430
|
var MOTION_PROP_KEYS = [
|