@bug-on/m3-expressive 1.1.0 → 1.2.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 (61) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/buttons.d.mts +3 -3
  3. package/dist/buttons.d.ts +3 -3
  4. package/dist/buttons.js +708 -606
  5. package/dist/buttons.js.map +1 -1
  6. package/dist/buttons.mjs +707 -605
  7. package/dist/buttons.mjs.map +1 -1
  8. package/dist/core-Bc5Wj_pc.d.ts +497 -0
  9. package/dist/core-D4048_K5.d.mts +497 -0
  10. package/dist/core.d.mts +6 -422
  11. package/dist/core.d.ts +6 -422
  12. package/dist/core.js +223 -129
  13. package/dist/core.js.map +1 -1
  14. package/dist/core.mjs +224 -130
  15. package/dist/core.mjs.map +1 -1
  16. package/dist/feedback.js +85 -61
  17. package/dist/feedback.js.map +1 -1
  18. package/dist/feedback.mjs +85 -61
  19. package/dist/feedback.mjs.map +1 -1
  20. package/dist/forms.d.mts +2 -2
  21. package/dist/forms.d.ts +2 -2
  22. package/dist/forms.js +70 -8
  23. package/dist/forms.js.map +1 -1
  24. package/dist/forms.mjs +70 -8
  25. package/dist/forms.mjs.map +1 -1
  26. package/dist/{icon-button-D-gs0gfj.d.mts → icon-button-sSt6PPLg.d.mts} +6 -0
  27. package/dist/{icon-button-D-gs0gfj.d.ts → icon-button-sSt6PPLg.d.ts} +6 -0
  28. package/dist/index.css +6 -1
  29. package/dist/index.d.mts +68 -6
  30. package/dist/index.d.ts +68 -6
  31. package/dist/index.js +1177 -580
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +1172 -583
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/layout.d.mts +18 -1
  36. package/dist/layout.d.ts +18 -1
  37. package/dist/layout.js +94 -8
  38. package/dist/layout.js.map +1 -1
  39. package/dist/layout.mjs +94 -8
  40. package/dist/layout.mjs.map +1 -1
  41. package/dist/{md3-DFhj-NZj.d.mts → md3-Dty-Qcad.d.mts} +7 -1
  42. package/dist/{md3-DFhj-NZj.d.ts → md3-Dty-Qcad.d.ts} +7 -1
  43. package/dist/navigation.d.mts +134 -9
  44. package/dist/navigation.d.ts +134 -9
  45. package/dist/navigation.js +403 -93
  46. package/dist/navigation.js.map +1 -1
  47. package/dist/navigation.mjs +397 -94
  48. package/dist/navigation.mjs.map +1 -1
  49. package/dist/overlays.js +214 -189
  50. package/dist/overlays.js.map +1 -1
  51. package/dist/overlays.mjs +176 -151
  52. package/dist/overlays.mjs.map +1 -1
  53. package/dist/pickers.js +222 -197
  54. package/dist/pickers.js.map +1 -1
  55. package/dist/pickers.mjs +189 -164
  56. package/dist/pickers.mjs.map +1 -1
  57. package/dist/{split-button-trailing-uncheckable-BRPuTqi1.d.mts → split-button-trailing-uncheckable-BcPD_7uK.d.ts} +73 -7
  58. package/dist/{split-button-trailing-uncheckable-CjOFCoyW.d.ts → split-button-trailing-uncheckable-DtFJkTFr.d.mts} +73 -7
  59. package/dist/{text-field-eAIpz9z1.d.mts → text-field-T4Rg-9Bw.d.mts} +7 -0
  60. package/dist/{text-field-eAIpz9z1.d.ts → text-field-T4Rg-9Bw.d.ts} +7 -0
  61. package/package.json +4 -4
package/dist/forms.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as SliderThumbProps } from './text-field-eAIpz9z1.mjs';
2
- export { C as Checkbox, a as CheckboxProps, b as CheckboxState, c as Chip, d as ChipProps, R as RadioButton, e as RadioButtonColors, f as RadioButtonProps, g as RadioGroup, h as RadioGroupProps, i as RangeSlider, j as RangeSliderProps, S as Slider, k as SliderColors, l as SliderOrientation, m as SliderProps, n as SliderTokens, o as SliderTrackSize, p as SliderVariant, q as Switch, r as SwitchColors, s as SwitchProps, t as SwitchTokens, T as TextField, u as TextFieldHandle, v as TextFieldInputType, w as TextFieldProps, x as TextFieldTrailingIconMode, y as TextFieldVariant, z as TriStateCheckbox, A as TriStateCheckboxProps } from './text-field-eAIpz9z1.mjs';
1
+ import { B as SliderThumbProps } from './text-field-T4Rg-9Bw.mjs';
2
+ export { C as Checkbox, a as CheckboxProps, b as CheckboxState, c as Chip, d as ChipProps, R as RadioButton, e as RadioButtonColors, f as RadioButtonProps, g as RadioGroup, h as RadioGroupProps, i as RangeSlider, j as RangeSliderProps, S as Slider, k as SliderColors, l as SliderOrientation, m as SliderProps, n as SliderTokens, o as SliderTrackSize, p as SliderVariant, q as Switch, r as SwitchColors, s as SwitchProps, t as SwitchTokens, T as TextField, u as TextFieldHandle, v as TextFieldInputType, w as TextFieldProps, x as TextFieldTrailingIconMode, y as TextFieldVariant, z as TriStateCheckbox, A as TriStateCheckboxProps } from './text-field-T4Rg-9Bw.mjs';
3
3
  import * as React from 'react';
4
4
  import 'class-variance-authority/types';
5
5
  import 'class-variance-authority';
package/dist/forms.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as SliderThumbProps } from './text-field-eAIpz9z1.js';
2
- export { C as Checkbox, a as CheckboxProps, b as CheckboxState, c as Chip, d as ChipProps, R as RadioButton, e as RadioButtonColors, f as RadioButtonProps, g as RadioGroup, h as RadioGroupProps, i as RangeSlider, j as RangeSliderProps, S as Slider, k as SliderColors, l as SliderOrientation, m as SliderProps, n as SliderTokens, o as SliderTrackSize, p as SliderVariant, q as Switch, r as SwitchColors, s as SwitchProps, t as SwitchTokens, T as TextField, u as TextFieldHandle, v as TextFieldInputType, w as TextFieldProps, x as TextFieldTrailingIconMode, y as TextFieldVariant, z as TriStateCheckbox, A as TriStateCheckboxProps } from './text-field-eAIpz9z1.js';
1
+ import { B as SliderThumbProps } from './text-field-T4Rg-9Bw.js';
2
+ export { C as Checkbox, a as CheckboxProps, b as CheckboxState, c as Chip, d as ChipProps, R as RadioButton, e as RadioButtonColors, f as RadioButtonProps, g as RadioGroup, h as RadioGroupProps, i as RangeSlider, j as RangeSliderProps, S as Slider, k as SliderColors, l as SliderOrientation, m as SliderProps, n as SliderTokens, o as SliderTrackSize, p as SliderVariant, q as Switch, r as SwitchColors, s as SwitchProps, t as SwitchTokens, T as TextField, u as TextFieldHandle, v as TextFieldInputType, w as TextFieldProps, x as TextFieldTrailingIconMode, y as TextFieldVariant, z as TriStateCheckbox, A as TriStateCheckboxProps } from './text-field-T4Rg-9Bw.js';
3
3
  import * as React from 'react';
4
4
  import 'class-variance-authority/types';
5
5
  import 'class-variance-authority';
package/dist/forms.js CHANGED
@@ -6,6 +6,7 @@ var React4 = require('react');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
+ var reactSlot = require('@radix-ui/react-slot');
9
10
  var classVarianceAuthority = require('class-variance-authority');
10
11
  var RadixScrollArea = require('@radix-ui/react-scroll-area');
11
12
 
@@ -540,7 +541,9 @@ var ChipImpl = React4__namespace.forwardRef(
540
541
  avatar,
541
542
  onRemove,
542
543
  className,
543
- onClick
544
+ onClick,
545
+ asChild = false,
546
+ children
544
547
  } = _b, props = __objRest(_b, [
545
548
  "variant",
546
549
  "elevated",
@@ -552,7 +555,9 @@ var ChipImpl = React4__namespace.forwardRef(
552
555
  "avatar",
553
556
  "onRemove",
554
557
  "className",
555
- "onClick"
558
+ "onClick",
559
+ "asChild",
560
+ "children"
556
561
  ]);
557
562
  const { ripples, onPointerDown, removeRipple } = useRippleState({
558
563
  disabled
@@ -667,6 +672,63 @@ var ChipImpl = React4__namespace.forwardRef(
667
672
  ) : null }),
668
673
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: label })
669
674
  ] });
675
+ if (asChild) {
676
+ const child = React4__namespace.Children.only(children);
677
+ const innerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
678
+ /* @__PURE__ */ jsxRuntime.jsx(Ripple, { ripples, onRippleDone: removeRipple }),
679
+ mainContent,
680
+ hasTrailingContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center shrink-0", children: onRemove ? /* @__PURE__ */ jsxRuntime.jsx(
681
+ "button",
682
+ {
683
+ type: "button",
684
+ tabIndex: disabled ? -1 : 0,
685
+ "aria-label": typeof label === "string" ? `Remove ${label}` : "Remove",
686
+ onClick: (e) => {
687
+ e.stopPropagation();
688
+ onRemove(e);
689
+ },
690
+ onPointerDown: (e) => e.stopPropagation(),
691
+ className: cn(
692
+ "flex items-center justify-center w-8.5 h-full",
693
+ "cursor-pointer focus-visible:outline-none",
694
+ "transition-all duration-150",
695
+ "relative overflow-hidden rounded-r-[7px] rounded-l-none",
696
+ "before:absolute before:-inset-px before:pointer-events-none before:bg-current",
697
+ "before:transition-opacity before:duration-200 before:opacity-0 before:rounded-r-[7px]",
698
+ "hover:before:opacity-[0.08] active:before:opacity-[0.12]",
699
+ selected ? "text-m3-on-secondary-container" : "text-m3-on-surface-variant"
700
+ ),
701
+ children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, {})
702
+ }
703
+ ) : trailingIcon ? /* @__PURE__ */ jsxRuntime.jsx(
704
+ "span",
705
+ {
706
+ className: cn(
707
+ "flex items-center justify-center w-4.5 h-4.5 [&_.md-icon]:text-[length:inherit]!",
708
+ selected ? "text-m3-on-secondary-container" : "text-m3-on-surface-variant"
709
+ ),
710
+ style: { fontSize: 18 },
711
+ "aria-hidden": "true",
712
+ children: trailingIcon
713
+ }
714
+ ) : null })
715
+ ] });
716
+ const strippedProps = __spreadValues({}, props);
717
+ delete strippedProps.children;
718
+ return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsx(
719
+ reactSlot.Slot,
720
+ __spreadProps(__spreadValues({
721
+ ref,
722
+ "aria-disabled": disabled || void 0,
723
+ tabIndex: disabled ? -1 : 0,
724
+ onClick,
725
+ onPointerDown,
726
+ className: containerClass
727
+ }, strippedProps), {
728
+ children: React4__namespace.cloneElement(child, { children: innerContent })
729
+ })
730
+ ) });
731
+ }
670
732
  return /* @__PURE__ */ jsxRuntime.jsx(react.LazyMotion, { features: react.domMax, strict: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
671
733
  Root2,
672
734
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({
@@ -3471,7 +3533,6 @@ var FloatingLabel = React4__namespace.memo(function FloatingLabel2({
3471
3533
  "absolute pointer-events-none select-none origin-[left_center] leading-6 text-base whitespace-nowrap",
3472
3534
  "px-1 -mx-1",
3473
3535
  // Clear the notch gap and keep text aligned
3474
- variant === "outlined" && isFloated && "bg-m3-surface",
3475
3536
  "left-4",
3476
3537
  isDisabled && "opacity-[0.38]"
3477
3538
  ),
@@ -3547,7 +3608,8 @@ var OutlineContainer = React4__namespace.memo(function OutlineContainer2({
3547
3608
  );
3548
3609
  const borderWidth = isFocused || isError ? TF_SIZE.outlineThick : TF_SIZE.outlineThin;
3549
3610
  const leftSegmentWidth = TF_SIZE.paddingStart;
3550
- const notchWidth = isFloated ? labelWidth * TF_TYPOGRAPHY.labelScaleRatio + TF_SIZE.notchPadding * 2 : 0;
3611
+ const isNotched = isFloated && labelWidth > 0;
3612
+ const notchWidth = isNotched ? labelWidth * TF_TYPOGRAPHY.labelScaleRatio + TF_SIZE.notchPadding * 2 : 0;
3551
3613
  const borderTransition = { duration: colorDuration, ease };
3552
3614
  const notchTransition = { duration: notchDuration, ease };
3553
3615
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3585,7 +3647,7 @@ var OutlineContainer = React4__namespace.memo(function OutlineContainer2({
3585
3647
  style: { height: borderWidth },
3586
3648
  animate: {
3587
3649
  borderTopColor: borderColor,
3588
- opacity: isFloated ? 0 : 1,
3650
+ opacity: isNotched ? 0 : 1,
3589
3651
  borderTopWidth: borderWidth,
3590
3652
  borderTopStyle: "solid"
3591
3653
  },
@@ -4037,7 +4099,7 @@ var TextFieldComponent = React4__namespace.forwardRef(
4037
4099
  const computedDescribedby = [hasSupporting ? supportingId : "", ariaDescribedby != null ? ariaDescribedby : ""].filter(Boolean).join(" ") || void 0;
4038
4100
  const inputClass = cn(
4039
4101
  "bg-transparent outline-none w-full",
4040
- isInToolbar ? "self-center" : "self-end",
4102
+ !resolvedLabel || isInToolbar ? "self-center" : "self-end",
4041
4103
  "text-base leading-6 text-m3-on-surface",
4042
4104
  "caret-[var(--color-m3-primary)]",
4043
4105
  "placeholder:text-m3-on-surface-variant/60",
@@ -4048,7 +4110,7 @@ var TextFieldComponent = React4__namespace.forwardRef(
4048
4110
  id: inputId,
4049
4111
  name,
4050
4112
  value: currentValue,
4051
- placeholder: isFloated ? placeholder != null ? placeholder : "" : "",
4113
+ placeholder: !resolvedLabel || isFloated ? placeholder != null ? placeholder : "" : "",
4052
4114
  disabled,
4053
4115
  readOnly,
4054
4116
  required,
@@ -4080,7 +4142,7 @@ var TextFieldComponent = React4__namespace.forwardRef(
4080
4142
  "relative flex flex-col flex-1 min-w-0 h-full",
4081
4143
  paddingStart,
4082
4144
  paddingEnd,
4083
- isInToolbar ? "justify-center" : variant === "filled" ? resolvedDense ? "pt-5 pb-2" : "pt-6 pb-2" : resolvedDense ? "py-3" : "py-4"
4145
+ isInToolbar || !resolvedLabel ? "justify-center" : variant === "filled" ? resolvedDense ? "pt-5 pb-2" : "pt-6 pb-2" : resolvedDense ? "py-3" : "py-4"
4084
4146
  );
4085
4147
  const wrapperClass = cn(
4086
4148
  "group/tf inline-flex flex-col",