@bug-on/m3-expressive 1.2.7 → 1.3.1

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +195 -50
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +196 -51
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/{core-D4048_K5.d.mts → core-CAU8g2HY.d.mts} +1 -1
  9. package/dist/{core-Bc5Wj_pc.d.ts → core-DRrLnsnJ.d.ts} +1 -1
  10. package/dist/core.d.mts +2 -2
  11. package/dist/core.d.ts +2 -2
  12. package/dist/core.js +159 -28
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +160 -29
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/feedback.d.mts +28 -6
  17. package/dist/feedback.d.ts +28 -6
  18. package/dist/feedback.js +161 -30
  19. package/dist/feedback.js.map +1 -1
  20. package/dist/feedback.mjs +162 -31
  21. package/dist/feedback.mjs.map +1 -1
  22. package/dist/forms.d.mts +3 -2
  23. package/dist/forms.d.ts +3 -2
  24. package/dist/forms.js +88 -100
  25. package/dist/forms.js.map +1 -1
  26. package/dist/forms.mjs +88 -100
  27. package/dist/forms.mjs.map +1 -1
  28. package/dist/{icon-button-CSsDmuQC.d.mts → icon-button-CqdQBsRe.d.ts} +11 -5
  29. package/dist/{icon-button-CSsDmuQC.d.ts → icon-button-USJo7AqO.d.mts} +11 -5
  30. package/dist/index.d.mts +8 -8
  31. package/dist/index.d.ts +8 -8
  32. package/dist/index.js +570 -309
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +570 -310
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/layout.d.mts +1 -1
  37. package/dist/layout.d.ts +1 -1
  38. package/dist/layout.js +159 -60
  39. package/dist/layout.js.map +1 -1
  40. package/dist/layout.mjs +160 -61
  41. package/dist/layout.mjs.map +1 -1
  42. package/dist/{md3-Dty-Qcad.d.mts → md3-D0_Z7IXj.d.mts} +9 -1
  43. package/dist/{md3-Dty-Qcad.d.ts → md3-D0_Z7IXj.d.ts} +9 -1
  44. package/dist/navigation.d.mts +103 -33
  45. package/dist/navigation.d.ts +103 -33
  46. package/dist/navigation.js +443 -152
  47. package/dist/navigation.js.map +1 -1
  48. package/dist/navigation.mjs +444 -154
  49. package/dist/navigation.mjs.map +1 -1
  50. package/dist/overlays.js +159 -28
  51. package/dist/overlays.js.map +1 -1
  52. package/dist/overlays.mjs +160 -29
  53. package/dist/overlays.mjs.map +1 -1
  54. package/dist/pickers.js +159 -28
  55. package/dist/pickers.js.map +1 -1
  56. package/dist/pickers.mjs +160 -29
  57. package/dist/pickers.mjs.map +1 -1
  58. package/dist/{split-button-trailing-uncheckable-DPJL3bO6.d.mts → split-button-trailing-uncheckable-CIVEYgjY.d.mts} +12 -7
  59. package/dist/{split-button-trailing-uncheckable--BhNTEJw.d.ts → split-button-trailing-uncheckable-DTQJjzsB.d.ts} +12 -7
  60. package/dist/{text-field-DWC7qOvp.d.mts → text-field-CiOmDM_8.d.ts} +52 -51
  61. package/dist/{text-field-DWC7qOvp.d.ts → text-field-Ear3hCSq.d.mts} +52 -51
  62. package/package.json +3 -3
@@ -1,6 +1,7 @@
1
- import * as React from 'react';
1
+ 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
+ import { c as MD3Size } from './md3-D0_Z7IXj.mjs';
4
5
 
5
6
  /**
6
7
  * @file checkbox.tsx
@@ -48,7 +49,7 @@ interface CheckboxProps {
48
49
  /** Extra class names on the outermost wrapper. */
49
50
  className?: string;
50
51
  /** Ref pointing to the hidden `<input type="checkbox">`. */
51
- ref?: React.Ref<HTMLInputElement>;
52
+ ref?: React$1.Ref<HTMLInputElement>;
52
53
  }
53
54
  /**
54
55
  * `TriStateCheckbox` props — requires `state` + `onStateChange`.
@@ -71,7 +72,7 @@ interface TriStateCheckboxProps extends Omit<CheckboxProps, "checked" | "default
71
72
  * ```
72
73
  * @see https://m3.material.io/components/checkbox/overview
73
74
  */
74
- declare const Checkbox: React.NamedExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
75
+ declare const Checkbox: React$1.NamedExoticComponent<Omit<CheckboxProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
75
76
  /**
76
77
  * MD3 Expressive Tri-State Checkbox.
77
78
  *
@@ -83,12 +84,12 @@ declare const Checkbox: React.NamedExoticComponent<Omit<CheckboxProps, "ref"> &
83
84
  * <TriStateCheckbox state={parentState} onStateChange={setParentState} label="Select all" />
84
85
  * ```
85
86
  */
86
- declare const TriStateCheckbox: React.NamedExoticComponent<Omit<TriStateCheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
87
+ declare const TriStateCheckbox: React$1.NamedExoticComponent<Omit<TriStateCheckboxProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
87
88
 
88
89
  declare const chipVariants: (props?: ({
89
90
  variant?: "input" | "filter" | "assist" | "suggestion" | null | undefined;
90
91
  } & class_variance_authority_types.ClassProp) | undefined) => string;
91
- interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
92
+ interface ChipProps extends Omit<React$1.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
92
93
  /**
93
94
  * Chip variant.
94
95
  * - `assist` → Smart/automated actions. Flat by default, can be elevated.
@@ -122,36 +123,36 @@ interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>,
122
123
  /**
123
124
  * Visible label. Required. Can be a string or ReactNode.
124
125
  */
125
- label: React.ReactNode;
126
+ label: React$1.ReactNode;
126
127
  /**
127
128
  * Optional leading icon element (18×18px recommended).
128
129
  * For `filter` chips with `selected=true`, this is replaced by an animated checkmark.
129
130
  * For `assist`/`suggestion`: icon color → `primary`
130
131
  * For `input` (unselected): icon color → `on-surface-variant`
131
132
  */
132
- leadingIcon?: React.ReactNode;
133
+ leadingIcon?: React$1.ReactNode;
133
134
  /**
134
135
  * Optional trailing icon element (18×18px recommended).
135
136
  * Color: `on-surface-variant` (unselected) / `on-secondary-container` (selected).
136
137
  */
137
- trailingIcon?: React.ReactNode;
138
+ trailingIcon?: React$1.ReactNode;
138
139
  /**
139
140
  * Avatar element for `input` chips. Takes priority over `leadingIcon`.
140
141
  * Rendered as a 24×24px circle (InputChipTokens: AvatarSize = 24.dp, AvatarShape = CornerFull).
141
142
  */
142
- avatar?: React.ReactNode;
143
+ avatar?: React$1.ReactNode;
143
144
  /**
144
145
  * Callback when the trailing remove (×) button is activated on `input` chips.
145
146
  * When provided, a dedicated tabbable close button with `aria-label="Remove {label}"` is rendered.
146
147
  */
147
- onRemove?: (e: React.MouseEvent<HTMLButtonElement>) => void;
148
+ onRemove?: (e: React$1.MouseEvent<HTMLButtonElement>) => void;
148
149
  /**
149
150
  * Change the component to the underlying child element and merge props/behavior.
150
151
  * Useful when wrapping in Next.js `<Link>` or custom anchor tags.
151
152
  * @default false
152
153
  */
153
154
  asChild?: boolean;
154
- children?: React.ReactNode;
155
+ children?: React$1.ReactNode;
155
156
  }
156
157
  /**
157
158
  * MD3 Expressive Chip — 4-variant interactive tag component.
@@ -176,7 +177,7 @@ interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>,
176
177
  *
177
178
  * @see https://m3.material.io/components/chips/overview
178
179
  */
179
- declare const Chip: React.NamedExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
180
+ declare const Chip: React$1.NamedExoticComponent<ChipProps & React$1.RefAttributes<HTMLButtonElement>>;
180
181
 
181
182
  /**
182
183
  * @file radio-button.tsx
@@ -221,7 +222,7 @@ interface RadioButtonProps {
221
222
  /** Whether the radio is required for form submission. */
222
223
  required?: boolean;
223
224
  /** Ref to the hidden `<input type="radio">`. */
224
- ref?: React.Ref<HTMLInputElement>;
225
+ ref?: React$1.Ref<HTMLInputElement>;
225
226
  }
226
227
  /** Props for `RadioGroup`. */
227
228
  interface RadioGroupProps {
@@ -245,7 +246,7 @@ interface RadioGroupProps {
245
246
  orientation?: "horizontal" | "vertical";
246
247
  /** Whether at least one radio in the group must be selected. */
247
248
  required?: boolean;
248
- children: React.ReactNode;
249
+ children: React$1.ReactNode;
249
250
  className?: string;
250
251
  }
251
252
  /**
@@ -266,7 +267,7 @@ interface RadioGroupProps {
266
267
  * ```
267
268
  * @see https://m3.material.io/components/radio-button/overview
268
269
  */
269
- declare const RadioButton: React.NamedExoticComponent<Omit<RadioButtonProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
270
+ declare const RadioButton: React$1.NamedExoticComponent<Omit<RadioButtonProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
270
271
  /**
271
272
  * MD3 Expressive RadioGroup component.
272
273
  *
@@ -283,7 +284,7 @@ declare const RadioButton: React.NamedExoticComponent<Omit<RadioButtonProps, "re
283
284
  * ```
284
285
  * @see https://m3.material.io/components/radio-button/overview
285
286
  */
286
- declare const RadioGroup: React.NamedExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
287
+ declare const RadioGroup: React$1.NamedExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
287
288
 
288
289
  /**
289
290
  * @file text-field.types.ts
@@ -328,7 +329,7 @@ interface TextFieldProps {
328
329
  /** Initial value for uncontrolled mode. */
329
330
  defaultValue?: string;
330
331
  /** Fires when value changes. Receives new value string and native event. */
331
- onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
332
+ onChange?: (value: string, event: React$1.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
332
333
  /** Input type. Use 'textarea' for multi-line input. @default 'text' */
333
334
  type?: TextFieldInputType;
334
335
  /** Placeholder text — shown only when no label OR label is floated. */
@@ -336,7 +337,7 @@ interface TextFieldProps {
336
337
  name?: string;
337
338
  id?: string;
338
339
  autoComplete?: string;
339
- inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"];
340
+ inputMode?: React$1.HTMLAttributes<HTMLInputElement>["inputMode"];
340
341
  /** Number of rows for textarea type. @default 2 */
341
342
  rows?: number;
342
343
  /** Number of columns for textarea type. @default 20 */
@@ -371,9 +372,9 @@ interface TextFieldProps {
371
372
  /** Text displayed after the input value (e.g., ".00"). */
372
373
  suffixText?: string;
373
374
  /** Icon node for the leading slot. Should be 24×24px. */
374
- leadingIcon?: React.ReactNode;
375
+ leadingIcon?: React$1.ReactNode;
375
376
  /** Custom trailing icon node. Used when trailingIconMode='custom'. */
376
- trailingIcon?: React.ReactNode;
377
+ trailingIcon?: React$1.ReactNode;
377
378
  /**
378
379
  * Built-in trailing icon behavior.
379
380
  * - 'none' — no trailing icon
@@ -397,11 +398,11 @@ interface TextFieldProps {
397
398
  fullWidth?: boolean;
398
399
  /** Dense variant — reduced height (48px instead of 56px). */
399
400
  dense?: boolean;
400
- onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
401
- onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
402
- onKeyDown?: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
403
- onKeyUp?: React.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
404
- ref?: React.Ref<TextFieldHandle>;
401
+ onFocus?: React$1.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
402
+ onBlur?: React$1.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
403
+ onKeyDown?: React$1.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
404
+ onKeyUp?: React$1.KeyboardEventHandler<HTMLInputElement | HTMLTextAreaElement>;
405
+ ref?: React$1.Ref<TextFieldHandle>;
405
406
  /**
406
407
  * Controls when the scrollbars are visible when type="textarea".
407
408
  * - `hover`: Show on hover (default)
@@ -419,8 +420,8 @@ interface TextFieldProps {
419
420
  * Reference: docs/m3/sliders/Slider.kt
420
421
  */
421
422
 
422
- /** Track size variants mapping to physical px values. */
423
- type SliderTrackSize = "xs" | "s" | "m" | "l" | "xl";
423
+ /** @deprecated Use MD3Size instead */
424
+ type SliderTrackSize = MD3Size;
424
425
  type SliderVariant = "primary" | "secondary" | "tertiary" | "error";
425
426
  type SliderTrackShape = "md3" | "full" | number;
426
427
  /** Slider layout direction. */
@@ -471,11 +472,11 @@ interface SliderProps {
471
472
  /** Layout orientation. @default "horizontal" */
472
473
  orientation?: SliderOrientation;
473
474
  /**
474
- * Physical track size.
475
+ * Physical track size per MD3 specification.
475
476
  * Horizontal: height. Vertical: width.
476
- * @default "m"
477
+ * @default "md"
477
478
  */
478
- trackSize?: SliderTrackSize;
479
+ size?: MD3Size;
479
480
  /**
480
481
  * Color variant.
481
482
  * @default "primary"
@@ -588,7 +589,7 @@ interface SliderThumbProps {
588
589
  showValueIndicator: boolean;
589
590
  /** For the drag constraint ref. */
590
591
  trackRef: React.RefObject<HTMLDivElement | null>;
591
- trackSize: SliderTrackSize;
592
+ size: MD3Size;
592
593
  variant: SliderVariant;
593
594
  /** Called during pointer drag with new value. */
594
595
  onValueChange: (value: number) => void;
@@ -650,7 +651,7 @@ interface SliderThumbProps {
650
651
  *
651
652
  * @see https://m3.material.io/components/sliders/overview
652
653
  */
653
- declare const RangeSlider: React.NamedExoticComponent<RangeSliderProps & React.RefAttributes<HTMLDivElement>>;
654
+ declare const RangeSlider: React$1.NamedExoticComponent<RangeSliderProps & React$1.RefAttributes<HTMLDivElement>>;
654
655
 
655
656
  /**
656
657
  * @file slider.tsx
@@ -710,7 +711,7 @@ declare const RangeSlider: React.NamedExoticComponent<RangeSliderProps & React.R
710
711
  *
711
712
  * @see https://m3.material.io/components/sliders/overview
712
713
  */
713
- declare const Slider: React.NamedExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
714
+ declare const Slider: React$1.NamedExoticComponent<SliderProps & React$1.RefAttributes<HTMLDivElement>>;
714
715
 
715
716
  /**
716
717
  * @file slider.tokens.ts
@@ -729,24 +730,24 @@ declare const Slider: React.NamedExoticComponent<SliderProps & React.RefAttribut
729
730
  declare const SliderTokens: {
730
731
  readonly trackSizes: {
731
732
  xs: number;
732
- s: number;
733
- m: number;
734
- l: number;
733
+ sm: number;
734
+ md: number;
735
+ lg: number;
735
736
  xl: number;
736
737
  };
737
738
  readonly trackShapes: {
738
739
  xs: number;
739
- s: number;
740
- m: number;
741
- l: number;
740
+ sm: number;
741
+ md: number;
742
+ lg: number;
742
743
  xl: number;
743
744
  };
744
745
  /** Thumb height grows with track size */
745
746
  readonly thumbHeights: {
746
747
  xs: number;
747
- s: number;
748
- m: number;
749
- l: number;
748
+ sm: number;
749
+ md: number;
750
+ lg: number;
750
751
  xl: number;
751
752
  };
752
753
  /**
@@ -785,9 +786,9 @@ declare const SliderTokens: {
785
786
  /** Standard icon size map for inset icons inside the track. */
786
787
  readonly insetIconSizes: {
787
788
  xs: number;
788
- s: number;
789
- m: number;
790
- l: number;
789
+ sm: number;
790
+ md: number;
791
+ lg: number;
791
792
  xl: number;
792
793
  };
793
794
  /**
@@ -824,14 +825,14 @@ declare const SliderColors: {
824
825
  readonly valueIndicatorText: "var(--md-sys-color-inverse-on-surface)";
825
826
  /**
826
827
  * Tick on the INACTIVE portion of the track.
827
- * Maps to TickMarkActiveContainerColor (in spec: primary color stands out).
828
+ * Maps to TickMarkInactiveContainerColor (in spec: primary color stands out).
828
829
  */
829
830
  readonly tickOnInactive: "var(--md-sys-color-primary)";
830
831
  /**
831
832
  * Tick on the ACTIVE portion of the track.
832
- * Maps to TickMarkInactiveContainerColor (secondary-container blends in).
833
+ * Maps to TickMarkActiveContainerColor (in spec: on-primary contrasts with filled track).
833
834
  */
834
- readonly tickOnActive: "var(--md-sys-color-secondary-container)";
835
+ readonly tickOnActive: "var(--md-sys-color-on-primary)";
835
836
  readonly disabledTick: "var(--md-sys-color-on-surface)";
836
837
  };
837
838
 
@@ -860,7 +861,7 @@ interface SwitchProps {
860
861
  * Optional icon content rendered inside the thumb.
861
862
  * Expected to measure 16dp (SwitchTokens.iconSize).
862
863
  */
863
- thumbContent?: React.ReactNode;
864
+ thumbContent?: React$1.ReactNode;
864
865
  /**
865
866
  * When true, shows thumb icons in both selected and unselected states.
866
867
  * Requires `thumbContent` to be provided.
@@ -923,7 +924,7 @@ interface SwitchProps {
923
924
  *
924
925
  * @see https://m3.material.io/components/switch/overview
925
926
  */
926
- declare const Switch: React.NamedExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
927
+ declare const Switch: React$1.NamedExoticComponent<SwitchProps & React$1.RefAttributes<HTMLButtonElement>>;
927
928
 
928
929
  /**
929
930
  * @file switch.tokens.ts
@@ -1040,6 +1041,6 @@ declare const SwitchColors: {
1040
1041
  *
1041
1042
  * @see https://m3.material.io/components/text-fields/overview
1042
1043
  */
1043
- declare const TextField: React.NamedExoticComponent<Omit<TextFieldProps, "ref"> & React.RefAttributes<TextFieldHandle>>;
1044
+ declare const TextField: React$1.NamedExoticComponent<Omit<TextFieldProps, "ref"> & React$1.RefAttributes<TextFieldHandle>>;
1044
1045
 
1045
1046
  export { TriStateCheckbox as A, type TriStateCheckboxProps as B, Checkbox as C, RadioButton as R, type SliderThumbProps as S, TextField as T, type CheckboxProps as a, type CheckboxState as b, Chip as c, type ChipProps as d, type RadioButtonColors as e, type RadioButtonProps as f, RadioGroup as g, type RadioGroupProps as h, RangeSlider as i, type RangeSliderProps as j, Slider as k, SliderColors as l, type SliderOrientation as m, type SliderProps as n, SliderTokens as o, type SliderTrackSize as p, type SliderVariant as q, Switch as r, SwitchColors as s, type SwitchProps as t, SwitchTokens as u, type TextFieldHandle as v, type TextFieldInputType as w, type TextFieldProps as x, type TextFieldTrailingIconMode as y, type TextFieldVariant as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bug-on/m3-expressive",
3
- "version": "1.2.7",
3
+ "version": "1.3.1",
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-tailwind": "1.2.1",
183
- "@bug-on/m3-tokens": "1.2.1"
182
+ "@bug-on/m3-tokens": "1.2.1",
183
+ "@bug-on/m3-tailwind": "1.2.1"
184
184
  },
185
185
  "devDependencies": {
186
186
  "@testing-library/jest-dom": "^6.9.1",