@bug-on/m3-expressive 1.3.3 → 1.3.5

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 (60) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +31 -7
  3. package/dist/assets/material-symbols-cdn.css +17 -23
  4. package/dist/buttons.js +129 -35
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +129 -35
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/{core-DyEy8H9Z.d.ts → core-Cckt8qEm.d.ts} +11 -8
  9. package/dist/{core-D8FdHY6I.d.mts → core-DDfG4pym.d.mts} +11 -8
  10. package/dist/core.d.mts +2 -3
  11. package/dist/core.d.ts +2 -3
  12. package/dist/core.js +7 -7
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +8 -7
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/fading-blur-mask--uZbBKLj.d.mts +77 -0
  17. package/dist/fading-blur-mask--uZbBKLj.d.ts +77 -0
  18. package/dist/feedback.js +1 -1
  19. package/dist/feedback.js.map +1 -1
  20. package/dist/feedback.mjs +1 -1
  21. package/dist/feedback.mjs.map +1 -1
  22. package/dist/forms.js +1 -1
  23. package/dist/forms.js.map +1 -1
  24. package/dist/forms.mjs +1 -1
  25. package/dist/forms.mjs.map +1 -1
  26. package/dist/index.d.mts +5 -5
  27. package/dist/index.d.ts +5 -5
  28. package/dist/index.js +270 -127
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +271 -127
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/layout.d.mts +5 -3
  33. package/dist/layout.d.ts +5 -3
  34. package/dist/layout.js +61 -6
  35. package/dist/layout.js.map +1 -1
  36. package/dist/layout.mjs +61 -7
  37. package/dist/layout.mjs.map +1 -1
  38. package/dist/material-symbols-cdn.css +17 -23
  39. package/dist/navigation.d.mts +25 -83
  40. package/dist/navigation.d.ts +25 -83
  41. package/dist/navigation.js +22 -9
  42. package/dist/navigation.js.map +1 -1
  43. package/dist/navigation.mjs +22 -9
  44. package/dist/navigation.mjs.map +1 -1
  45. package/dist/overlays.js +1 -1
  46. package/dist/overlays.js.map +1 -1
  47. package/dist/overlays.mjs +1 -1
  48. package/dist/overlays.mjs.map +1 -1
  49. package/dist/pickers.d.mts +12 -0
  50. package/dist/pickers.d.ts +12 -0
  51. package/dist/pickers.js +98 -65
  52. package/dist/pickers.js.map +1 -1
  53. package/dist/pickers.mjs +98 -65
  54. package/dist/pickers.mjs.map +1 -1
  55. package/dist/{typography-339RV6v7.d.mts → typography-CKTjvlZ4.d.mts} +25 -0
  56. package/dist/{typography-339RV6v7.d.ts → typography-CKTjvlZ4.d.ts} +25 -0
  57. package/dist/typography.css +1 -1
  58. package/llms-full.txt +17 -13
  59. package/llms.txt +11 -6
  60. package/package.json +18 -18
package/dist/buttons.mjs CHANGED
@@ -2178,7 +2178,7 @@ var IconComponent = React16.forwardRef(
2178
2178
  (_a, ref) => {
2179
2179
  var _b = _a, {
2180
2180
  name,
2181
- variant = "outlined",
2181
+ variant = "rounded",
2182
2182
  fill = 0,
2183
2183
  weight = 400,
2184
2184
  grade = 0,
@@ -2682,6 +2682,7 @@ var ExtendedFABComponent = React16.forwardRef(
2682
2682
  onClick,
2683
2683
  onKeyDown,
2684
2684
  layoutId,
2685
+ layout,
2685
2686
  "aria-label": ariaLabel
2686
2687
  } = _b, restProps = __objRest(_b, [
2687
2688
  "className",
@@ -2703,6 +2704,7 @@ var ExtendedFABComponent = React16.forwardRef(
2703
2704
  "onClick",
2704
2705
  "onKeyDown",
2705
2706
  "layoutId",
2707
+ "layout",
2706
2708
  "aria-label"
2707
2709
  ]);
2708
2710
  var _a2, _b2, _c, _d;
@@ -2727,6 +2729,13 @@ var ExtendedFABComponent = React16.forwardRef(
2727
2729
  const colors = (_a2 = COLOR_CLASSES[colorStyle]) != null ? _a2 : COLOR_CLASSES.primary;
2728
2730
  const radiusConfig = (_b2 = MORPH_RADIUS[size]) != null ? _b2 : MORPH_RADIUS.sm;
2729
2731
  const sizeIcon = (_c = SIZE_ICON[size]) != null ? _c : SIZE_ICON.sm;
2732
+ const motionRadius = useMotionValue(radiusConfig.default);
2733
+ React16.useEffect(() => {
2734
+ const controls = animate(motionRadius, radiusConfig.default, __spreadProps(__spreadValues({}, SPRING_TRANSITION), {
2735
+ type: "spring"
2736
+ }));
2737
+ return () => controls.stop();
2738
+ }, [radiusConfig.default, motionRadius]);
2730
2739
  const { ripples, onPointerDown, removeRipple } = useRippleState({
2731
2740
  disabled: loading
2732
2741
  });
@@ -2821,13 +2830,25 @@ var ExtendedFABComponent = React16.forwardRef(
2821
2830
  {
2822
2831
  layout: "position",
2823
2832
  initial: { opacity: 0, width: 0 },
2824
- animate: { opacity: 1, width: "auto" },
2825
- exit: { opacity: 0, width: 0 },
2826
- transition: {
2827
- opacity: { duration: 0.15, ease: "linear" },
2828
- width: SPRING_TRANSITION
2833
+ animate: {
2834
+ opacity: 1,
2835
+ width: "auto",
2836
+ transition: {
2837
+ width: SPRING_TRANSITION,
2838
+ opacity: { delay: 0.08, duration: 0.15, ease: "easeIn" },
2839
+ layout: SPRING_TRANSITION
2840
+ }
2829
2841
  },
2830
- className: "overflow-hidden whitespace-nowrap",
2842
+ exit: {
2843
+ opacity: 0,
2844
+ width: 0,
2845
+ transition: {
2846
+ opacity: { duration: 0.1, ease: "linear" },
2847
+ width: __spreadProps(__spreadValues({}, SPRING_TRANSITION), { delay: 0.03 }),
2848
+ layout: SPRING_TRANSITION
2849
+ }
2850
+ },
2851
+ className: "overflow-hidden whitespace-nowrap shrink-0 inline-block",
2831
2852
  children: label
2832
2853
  },
2833
2854
  "label"
@@ -2858,7 +2879,7 @@ var ExtendedFABComponent = React16.forwardRef(
2858
2879
  __spreadProps(__spreadValues({
2859
2880
  ref: localRef,
2860
2881
  type: "button",
2861
- layout: true,
2882
+ layout: layout !== void 0 ? layout : "position",
2862
2883
  layoutId,
2863
2884
  "aria-label": ariaLabel || label,
2864
2885
  "aria-busy": loading || void 0,
@@ -2866,21 +2887,23 @@ var ExtendedFABComponent = React16.forwardRef(
2866
2887
  onClick: handleClick,
2867
2888
  onPointerDown,
2868
2889
  onKeyDown: handleKeyDown,
2869
- style,
2890
+ style: __spreadProps(__spreadValues({}, style), {
2891
+ borderRadius: motionRadius
2892
+ }),
2870
2893
  initial: {
2871
2894
  scale: 0.6,
2872
- opacity: 0,
2873
- borderRadius: radiusConfig.default
2895
+ opacity: 0
2874
2896
  },
2875
2897
  animate: {
2876
2898
  scale: 1,
2877
- opacity: 1,
2878
- borderRadius: radiusConfig.default
2899
+ opacity: 1
2879
2900
  },
2880
2901
  exit: { scale: 0.6, opacity: 0 },
2881
- whileTap: { borderRadius: radiusConfig.pressed },
2902
+ whileTap: {
2903
+ borderRadius: radiusConfig.pressed,
2904
+ transition: { borderRadius: SPRING_TRANSITION_FAST }
2905
+ },
2882
2906
  transition: {
2883
- borderRadius: { type: "spring", stiffness: 500, damping: 30 },
2884
2907
  scale: SPRING_TRANSITION,
2885
2908
  opacity: { duration: 0.2, ease: "linear" },
2886
2909
  layout: SPRING_TRANSITION
@@ -2912,6 +2935,18 @@ var SIZE_TEXT_CLASS = {
2912
2935
  lg: "text-xl font-semibold",
2913
2936
  xl: "text-2xl font-semibold"
2914
2937
  };
2938
+ var SIZE_PADDING_COLLAPSED = {
2939
+ sm: "px-2",
2940
+ md: "px-4",
2941
+ lg: "px-8",
2942
+ xl: "px-12"
2943
+ };
2944
+ var SIZE_PADDING_EXTENDED = {
2945
+ sm: "pl-2 pr-4",
2946
+ md: "pl-4 pr-6",
2947
+ lg: "pl-8 pr-8",
2948
+ xl: "pl-12 pr-10"
2949
+ };
2915
2950
  var MORPH_RADIUS2 = {
2916
2951
  sm: { default: 12, pressed: 8, extended: 12, extended_pressed: 8 },
2917
2952
  md: { default: 16, pressed: 10, extended: 16, extended_pressed: 10 },
@@ -3003,7 +3038,7 @@ var FABComponent = React16.forwardRef(
3003
3038
  "layout",
3004
3039
  "layoutId"
3005
3040
  ]);
3006
- var _a2, _b2, _c, _d;
3041
+ var _a2, _b2, _c, _d, _e, _f;
3007
3042
  const colors = (_a2 = COLOR_CLASSES2[colorStyle]) != null ? _a2 : COLOR_CLASSES2.primary;
3008
3043
  const radiusConfig = (_b2 = MORPH_RADIUS2[size]) != null ? _b2 : MORPH_RADIUS2.md;
3009
3044
  const animateRadius = extended ? radiusConfig.extended : radiusConfig.default;
@@ -3088,22 +3123,37 @@ var FABComponent = React16.forwardRef(
3088
3123
  m.span,
3089
3124
  {
3090
3125
  layout: "position",
3091
- initial: { width: 0, opacity: 0 },
3092
- animate: { width: "auto", opacity: 1 },
3093
- exit: { width: 0, opacity: 0 },
3094
- transition: {
3095
- opacity: { duration: 0.15, ease: "linear" },
3096
- width: SPRING_TRANSITION,
3097
- layout: SPRING_TRANSITION
3126
+ initial: { width: 0, opacity: 0, marginLeft: 0 },
3127
+ animate: {
3128
+ width: "auto",
3129
+ opacity: 1,
3130
+ marginLeft: 12,
3131
+ transition: {
3132
+ width: SPRING_TRANSITION,
3133
+ marginLeft: SPRING_TRANSITION,
3134
+ opacity: { delay: 0.08, duration: 0.15, ease: "easeIn" },
3135
+ layout: SPRING_TRANSITION
3136
+ }
3137
+ },
3138
+ exit: {
3139
+ width: 0,
3140
+ opacity: 0,
3141
+ marginLeft: 0,
3142
+ transition: {
3143
+ opacity: { duration: 0.1, ease: "linear" },
3144
+ width: __spreadProps(__spreadValues({}, SPRING_TRANSITION), { delay: 0.03 }),
3145
+ marginLeft: __spreadProps(__spreadValues({}, SPRING_TRANSITION), { delay: 0.03 }),
3146
+ layout: SPRING_TRANSITION
3147
+ }
3098
3148
  },
3099
- className: "overflow-hidden whitespace-nowrap ml-3",
3149
+ className: "overflow-hidden whitespace-nowrap shrink-0 inline-block",
3100
3150
  children: labelContent
3101
3151
  },
3102
3152
  "label"
3103
3153
  ) })
3104
3154
  ] });
3105
3155
  const containerClassName = cn(
3106
- "relative shrink-0 inline-flex items-center justify-center",
3156
+ "relative shrink-0 inline-flex items-center justify-start",
3107
3157
  "select-none cursor-pointer overflow-hidden",
3108
3158
  "transition-[box-shadow,opacity,filter] duration-200",
3109
3159
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-m3-primary focus-visible:ring-offset-2",
@@ -3112,21 +3162,62 @@ var FABComponent = React16.forwardRef(
3112
3162
  colors.text,
3113
3163
  lowered ? "shadow-sm" : colors.shadow,
3114
3164
  (_d = SIZE_STYLES[size]) != null ? _d : "h-14 w-14",
3115
- extended && "w-auto pl-4 pr-6",
3165
+ extended ? cn("w-auto", (_e = SIZE_PADDING_EXTENDED[size]) != null ? _e : "pl-4 pr-6") : (_f = SIZE_PADDING_COLLAPSED[size]) != null ? _f : "px-4",
3116
3166
  SIZE_TEXT_CLASS[size],
3117
3167
  loading && "pointer-events-none opacity-75 cursor-not-allowed",
3118
3168
  className
3119
3169
  );
3170
+ const motionRadius = useMotionValue(animateRadius);
3171
+ const asChildRef = React16.useRef(null);
3172
+ const mergedRef = React16.useCallback(
3173
+ (node) => {
3174
+ asChildRef.current = node;
3175
+ if (typeof ref === "function") ref(node);
3176
+ else if (ref)
3177
+ ref.current = node;
3178
+ },
3179
+ [ref]
3180
+ );
3181
+ React16.useEffect(() => {
3182
+ if (!asChild) return;
3183
+ return motionRadius.on("change", (v) => {
3184
+ if (asChildRef.current)
3185
+ asChildRef.current.style.borderRadius = `${v}px`;
3186
+ });
3187
+ }, [motionRadius, asChild]);
3188
+ React16.useEffect(() => {
3189
+ const controls = animate(motionRadius, animateRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION), {
3190
+ type: "spring"
3191
+ }));
3192
+ return () => controls.stop();
3193
+ }, [animateRadius, motionRadius]);
3194
+ const handleAsChildPointerDown = React16.useCallback(
3195
+ (e) => {
3196
+ onPointerDown(e);
3197
+ animate(motionRadius, pressedRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION_FAST), {
3198
+ type: "spring"
3199
+ }));
3200
+ },
3201
+ [onPointerDown, motionRadius, pressedRadius]
3202
+ );
3203
+ const handleAsChildPointerUp = React16.useCallback(() => {
3204
+ animate(motionRadius, animateRadius, __spreadProps(__spreadValues({}, SPRING_TRANSITION_FAST), {
3205
+ type: "spring"
3206
+ }));
3207
+ }, [motionRadius, animateRadius]);
3120
3208
  const computedAriaLabel = ariaLabel || (typeof children === "string" ? children : void 0);
3121
3209
  return /* @__PURE__ */ jsx(LazyMotion, { features: domMax, strict: true, children: /* @__PURE__ */ jsx(AnimatePresence, { children: visible && (asChild ? /* @__PURE__ */ jsx(
3122
3210
  Slot,
3123
3211
  __spreadProps(__spreadValues({
3124
- ref,
3212
+ ref: mergedRef,
3125
3213
  "aria-label": computedAriaLabel,
3126
3214
  "aria-busy": loading || void 0,
3127
3215
  "aria-disabled": loading || restProps.disabled,
3128
3216
  onClick: handleClick,
3129
- onPointerDown,
3217
+ onPointerDown: handleAsChildPointerDown,
3218
+ onPointerUp: handleAsChildPointerUp,
3219
+ onPointerLeave: handleAsChildPointerUp,
3220
+ onPointerCancel: handleAsChildPointerUp,
3130
3221
  onKeyDown: handleKeyDown,
3131
3222
  style: __spreadProps(__spreadValues({}, style), {
3132
3223
  borderRadius: `${animateRadius}px`
@@ -3143,7 +3234,7 @@ var FABComponent = React16.forwardRef(
3143
3234
  __spreadProps(__spreadValues({
3144
3235
  ref,
3145
3236
  type: "button",
3146
- layout: layout !== void 0 ? layout : true,
3237
+ layout: layout !== void 0 ? layout : "position",
3147
3238
  layoutId,
3148
3239
  "aria-label": computedAriaLabel,
3149
3240
  "aria-busy": loading || void 0,
@@ -3151,17 +3242,20 @@ var FABComponent = React16.forwardRef(
3151
3242
  onClick: handleClick,
3152
3243
  onPointerDown,
3153
3244
  onKeyDown: handleKeyDown,
3154
- style,
3245
+ style: __spreadProps(__spreadValues({}, style), {
3246
+ borderRadius: motionRadius
3247
+ }),
3155
3248
  initial: {
3156
3249
  scale: 0.5,
3157
- opacity: 0,
3158
- borderRadius: animateRadius
3250
+ opacity: 0
3159
3251
  },
3160
- animate: { scale: 1, opacity: 1, borderRadius: animateRadius },
3252
+ animate: { scale: 1, opacity: 1 },
3161
3253
  exit: { scale: 0.5, opacity: 0 },
3162
- whileTap: { borderRadius: pressedRadius },
3254
+ whileTap: {
3255
+ borderRadius: pressedRadius,
3256
+ transition: { borderRadius: SPRING_TRANSITION_FAST }
3257
+ },
3163
3258
  transition: {
3164
- borderRadius: SPRING_TRANSITION_FAST,
3165
3259
  scale: SPRING_TRANSITION,
3166
3260
  opacity: { duration: 0.25, ease: "easeOut" },
3167
3261
  layout: SPRING_TRANSITION