@oxyhq/bloom 0.35.7 → 0.36.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.
Files changed (95) hide show
  1. package/lib/commonjs/content-panel/index.js +37 -9
  2. package/lib/commonjs/content-panel/index.js.map +1 -1
  3. package/lib/commonjs/content-panel/index.web.js +71 -15
  4. package/lib/commonjs/content-panel/index.web.js.map +1 -1
  5. package/lib/commonjs/frosted-icon-button/FrostedIconButton.js +148 -0
  6. package/lib/commonjs/frosted-icon-button/FrostedIconButton.js.map +1 -0
  7. package/lib/commonjs/frosted-icon-button/FrostedIconButton.web.js +166 -0
  8. package/lib/commonjs/frosted-icon-button/FrostedIconButton.web.js.map +1 -0
  9. package/lib/commonjs/frosted-icon-button/index.js +13 -0
  10. package/lib/commonjs/frosted-icon-button/index.js.map +1 -0
  11. package/lib/commonjs/frosted-icon-button/index.web.js +13 -0
  12. package/lib/commonjs/frosted-icon-button/index.web.js.map +1 -0
  13. package/lib/commonjs/frosted-icon-button/shared.js +112 -0
  14. package/lib/commonjs/frosted-icon-button/shared.js.map +1 -0
  15. package/lib/commonjs/frosted-icon-button/types.js +6 -0
  16. package/lib/commonjs/frosted-icon-button/types.js.map +1 -0
  17. package/lib/commonjs/index.js +10 -1
  18. package/lib/commonjs/index.js.map +1 -1
  19. package/lib/commonjs/index.web.js +46 -37
  20. package/lib/commonjs/index.web.js.map +1 -1
  21. package/lib/module/content-panel/index.js +37 -9
  22. package/lib/module/content-panel/index.js.map +1 -1
  23. package/lib/module/content-panel/index.web.js +71 -15
  24. package/lib/module/content-panel/index.web.js.map +1 -1
  25. package/lib/module/frosted-icon-button/FrostedIconButton.js +143 -0
  26. package/lib/module/frosted-icon-button/FrostedIconButton.js.map +1 -0
  27. package/lib/module/frosted-icon-button/FrostedIconButton.web.js +161 -0
  28. package/lib/module/frosted-icon-button/FrostedIconButton.web.js.map +1 -0
  29. package/lib/module/frosted-icon-button/index.js +4 -0
  30. package/lib/module/frosted-icon-button/index.js.map +1 -0
  31. package/lib/module/frosted-icon-button/index.web.js +11 -0
  32. package/lib/module/frosted-icon-button/index.web.js.map +1 -0
  33. package/lib/module/frosted-icon-button/shared.js +107 -0
  34. package/lib/module/frosted-icon-button/shared.js.map +1 -0
  35. package/lib/module/frosted-icon-button/types.js +4 -0
  36. package/lib/module/frosted-icon-button/types.js.map +1 -0
  37. package/lib/module/index.js +1 -0
  38. package/lib/module/index.js.map +1 -1
  39. package/lib/module/index.web.js +1 -0
  40. package/lib/module/index.web.js.map +1 -1
  41. package/lib/typescript/commonjs/content-panel/index.d.ts +24 -6
  42. package/lib/typescript/commonjs/content-panel/index.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/content-panel/index.web.d.ts +33 -10
  44. package/lib/typescript/commonjs/content-panel/index.web.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.d.ts +5 -0
  46. package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.d.ts.map +1 -0
  47. package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.web.d.ts +5 -0
  48. package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.web.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/frosted-icon-button/index.d.ts +3 -0
  50. package/lib/typescript/commonjs/frosted-icon-button/index.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/frosted-icon-button/index.web.d.ts +3 -0
  52. package/lib/typescript/commonjs/frosted-icon-button/index.web.d.ts.map +1 -0
  53. package/lib/typescript/commonjs/frosted-icon-button/shared.d.ts +60 -0
  54. package/lib/typescript/commonjs/frosted-icon-button/shared.d.ts.map +1 -0
  55. package/lib/typescript/commonjs/frosted-icon-button/types.d.ts +69 -0
  56. package/lib/typescript/commonjs/frosted-icon-button/types.d.ts.map +1 -0
  57. package/lib/typescript/commonjs/index.d.ts +2 -0
  58. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/index.web.d.ts +2 -0
  60. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  61. package/lib/typescript/module/content-panel/index.d.ts +24 -6
  62. package/lib/typescript/module/content-panel/index.d.ts.map +1 -1
  63. package/lib/typescript/module/content-panel/index.web.d.ts +33 -10
  64. package/lib/typescript/module/content-panel/index.web.d.ts.map +1 -1
  65. package/lib/typescript/module/frosted-icon-button/FrostedIconButton.d.ts +5 -0
  66. package/lib/typescript/module/frosted-icon-button/FrostedIconButton.d.ts.map +1 -0
  67. package/lib/typescript/module/frosted-icon-button/FrostedIconButton.web.d.ts +5 -0
  68. package/lib/typescript/module/frosted-icon-button/FrostedIconButton.web.d.ts.map +1 -0
  69. package/lib/typescript/module/frosted-icon-button/index.d.ts +3 -0
  70. package/lib/typescript/module/frosted-icon-button/index.d.ts.map +1 -0
  71. package/lib/typescript/module/frosted-icon-button/index.web.d.ts +3 -0
  72. package/lib/typescript/module/frosted-icon-button/index.web.d.ts.map +1 -0
  73. package/lib/typescript/module/frosted-icon-button/shared.d.ts +60 -0
  74. package/lib/typescript/module/frosted-icon-button/shared.d.ts.map +1 -0
  75. package/lib/typescript/module/frosted-icon-button/types.d.ts +69 -0
  76. package/lib/typescript/module/frosted-icon-button/types.d.ts.map +1 -0
  77. package/lib/typescript/module/index.d.ts +2 -0
  78. package/lib/typescript/module/index.d.ts.map +1 -1
  79. package/lib/typescript/module/index.web.d.ts +2 -0
  80. package/lib/typescript/module/index.web.d.ts.map +1 -1
  81. package/package.json +17 -1
  82. package/src/__tests__/ContentPanelNesting.test.tsx +74 -0
  83. package/src/__tests__/FrostedIconButton.test.tsx +137 -0
  84. package/src/__tests__/FrostedIconButton.web.test.tsx +246 -0
  85. package/src/content-panel/index.tsx +47 -11
  86. package/src/content-panel/index.web.tsx +85 -17
  87. package/src/frosted-icon-button/FrostedIconButton.stories.tsx +65 -0
  88. package/src/frosted-icon-button/FrostedIconButton.tsx +156 -0
  89. package/src/frosted-icon-button/FrostedIconButton.web.tsx +207 -0
  90. package/src/frosted-icon-button/index.ts +2 -0
  91. package/src/frosted-icon-button/index.web.ts +9 -0
  92. package/src/frosted-icon-button/shared.ts +118 -0
  93. package/src/frosted-icon-button/types.ts +81 -0
  94. package/src/index.ts +2 -0
  95. package/src/index.web.ts +2 -0
@@ -22,11 +22,12 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
22
22
  * scroll, no sticky positioning, and no bleed to mask, so the panel is simply a
23
23
  * surface wrapping its content. The `framed` prop still drives whether that
24
24
  * surface is rounded + bordered, tri-state and resolved with pure NativeWind
25
- * (`md:` evaluates against the window width on native too — no JS breakpoint
26
- * hook needed):
25
+ * (the breakpoint's `min-*:` variant evaluates against the window width on
26
+ * native too — no JS breakpoint hook needed):
27
27
  *
28
- * - `undefined` (DEFAULT) → responsive: full-bleed below `md`, rounded +
29
- * bordered at `md`+ (`md:rounded-radius-28 md:border md:border-border`).
28
+ * - `undefined` (DEFAULT) → responsive: full-bleed below the `framedFrom`
29
+ * breakpoint (default `768` / Tailwind `md`), rounded + bordered at/above it
30
+ * (e.g. `md:rounded-radius-28 md:border md:border-border`).
30
31
  * - `false` → never framed (plain full-bleed at every size).
31
32
  * - `true` → always rounded + bordered.
32
33
  *
@@ -50,9 +51,34 @@ const GUTTER_MASK_SPREAD = exports.GUTTER_MASK_SPREAD = 40;
50
51
  const PANEL_TOP_INSET = exports.PANEL_TOP_INSET = 8;
51
52
  /** Bottom sticky inset (px) of the framed panel chrome. */
52
53
  const PANEL_BOTTOM_INSET = exports.PANEL_BOTTOM_INSET = 8;
54
+
55
+ /**
56
+ * Viewport width (px) at which a RESPONSIVE `ContentPanel` (`framed` undefined)
57
+ * switches from full-bleed to framed. Each value maps to a PRE-SHIPPED literal
58
+ * Tailwind class bundle — `768` (default) uses the named `md:` screen
59
+ * (byte-identical to prior behavior), `640` uses `sm:`, `1024` uses `lg:`, and
60
+ * `500` uses the arbitrary `min-[500px]:` variant (there is no named screen at
61
+ * 500px). The breakpoint tokens are never built at runtime, so a consumer's
62
+ * Tailwind content-scan over `src/**`/`lib/**` resolves them verbatim.
63
+ */
64
+
65
+ /**
66
+ * Per-breakpoint literal Tailwind surface class bundle for the NATIVE responsive
67
+ * mode. Each value is a WHOLE literal string (never assembled from parts at
68
+ * runtime) so the Tailwind content-scan over `src/**`/`lib/**` picks up every
69
+ * `min-*`/`sm:`/`md:`/`lg:` token verbatim. Selecting a bundle by `framedFrom`
70
+ * value is the only runtime decision.
71
+ */
72
+ const RESPONSIVE_SURFACE = {
73
+ 500: 'min-[500px]:overflow-hidden min-[500px]:rounded-radius-28 min-[500px]:border min-[500px]:border-border',
74
+ 640: 'sm:overflow-hidden sm:rounded-radius-28 sm:border sm:border-border',
75
+ 768: 'md:overflow-hidden md:rounded-radius-28 md:border md:border-border',
76
+ 1024: 'lg:overflow-hidden lg:rounded-radius-28 lg:border lg:border-border'
77
+ };
53
78
  const ContentPanelComponent = ({
54
79
  children,
55
80
  framed,
81
+ framedFrom = 768,
56
82
  surfaceClassName,
57
83
  surfaceStyle,
58
84
  contentClassName,
@@ -61,11 +87,13 @@ const ContentPanelComponent = ({
61
87
  // Dev-only invariant — a ContentPanel must never be nested inside another.
62
88
  (0, _nestingContext.useContentPanelNestingGuard)();
63
89
 
64
- // Tri-state: `undefined` → responsive (md:-gated), `true` → always framed,
65
- // `false` → never framed (plain full-bleed). Whole literal class strings are
66
- // selected per mode so the Tailwind content-scan over `src/**` picks up every
67
- // `md:` / `rounded-radius-28` token verbatim (no dynamic concatenation).
68
- const surfaceBase = framed === undefined ? 'flex-1 md:overflow-hidden md:rounded-radius-28 md:border md:border-border' : framed ? 'flex-1 overflow-hidden rounded-radius-28 border border-border' : 'flex-1';
90
+ // Tri-state: `undefined` → responsive (breakpoint-gated), `true` → always
91
+ // framed, `false` → never framed (plain full-bleed). Whole literal class
92
+ // strings are selected per mode so the Tailwind content-scan over `src/**`
93
+ // picks up every `min-*`/`sm:`/`md:`/`lg:` / `rounded-radius-28` token verbatim
94
+ // (the breakpoint bundle lives whole in `RESPONSIVE_SURFACE`; `framed ===
95
+ // true`/`false` ignore `framedFrom` for fixed always/never framing).
96
+ const surfaceBase = framed === undefined ? `flex-1 ${RESPONSIVE_SURFACE[framedFrom]}` : framed ? 'flex-1 overflow-hidden rounded-radius-28 border border-border' : 'flex-1';
69
97
  const surfaceClass = [surfaceBase, surfaceClassName ?? 'bg-card'].join(' ');
70
98
  const contentClass = ['flex-1', contentClassName].filter(Boolean).join(' ');
71
99
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_nestingContext.ContentPanelNestingContext.Provider, {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_nestingContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GUTTER_MASK_SPREAD","exports","PANEL_TOP_INSET","PANEL_BOTTOM_INSET","ContentPanelComponent","children","framed","surfaceClassName","surfaceStyle","contentClassName","contentStyle","useContentPanelNestingGuard","surfaceBase","undefined","surfaceClass","join","contentClass","filter","Boolean","jsx","ContentPanelNestingContext","Provider","value","View","className","style","ContentPanel","memo","displayName"],"sourceRoot":"../../../src","sources":["content-panel/index.tsx"],"mappings":";;;;;;AA+BA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAG2B,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAA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,MAAM,KAAKO,SAAS,GAChB,2EAA2E,GAC3EP,MAAM,GACJ,+DAA+D,GAC/D,QAAQ;EAChB,MAAMQ,YAAY,GAAG,CAACF,WAAW,EAAEL,gBAAgB,IAAI,SAAS,CAAC,CAACQ,IAAI,CAAC,GAAG,CAAC;EAC3E,MAAMC,YAAY,GAAG,CAAC,QAAQ,EAAEP,gBAAgB,CAAC,CAACQ,MAAM,CAACC,OAAO,CAAC,CAACH,IAAI,CAAC,GAAG,CAAC;EAE3E,oBACE,IAAAnC,WAAA,CAAAuC,GAAA,EAACxC,eAAA,CAAAyC,0BAA0B,CAACC,QAAQ;IAACC,KAAK,EAAE,IAAK;IAAAjB,QAAA,eAC/C,IAAAzB,WAAA,CAAAuC,GAAA,EAACzC,YAAA,CAAA6C,IAAI;MACIC,SAAS,EAAEV,YAAY;MAC9BW,KAAK,EAAEjB,YAAa;MAAAH,QAAA,eAEpB,IAAAzB,WAAA,CAAAuC,GAAA,EAACzC,YAAA,CAAA6C,IAAI;QACIC,SAAS,EAAER,YAAY;QAC9BS,KAAK,EAAEf,YAAa;QAAAL,QAAA,EAEnBA;MAAQ,CACL;IAAC,CACH;EAAC,CAC4B,CAAC;AAE1C,CAAC;AAEM,MAAMqB,YAAY,GAAAzB,OAAA,CAAAyB,YAAA,gBAAG,IAAAC,WAAI,EAACvB,qBAAqB,CAAC;AACvDsB,YAAY,CAACE,WAAW,GAAG,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_nestingContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GUTTER_MASK_SPREAD","exports","PANEL_TOP_INSET","PANEL_BOTTOM_INSET","RESPONSIVE_SURFACE","ContentPanelComponent","children","framed","framedFrom","surfaceClassName","surfaceStyle","contentClassName","contentStyle","useContentPanelNestingGuard","surfaceBase","undefined","surfaceClass","join","contentClass","filter","Boolean","jsx","ContentPanelNestingContext","Provider","value","View","className","style","ContentPanel","memo","displayName"],"sourceRoot":"../../../src","sources":["content-panel/index.tsx"],"mappings":";;;;;;AAgCA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAG2B,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAtC3B;AACA;AACA;AACA;AACA;AACA;AAC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EAAE,IAAK;IAAAlB,QAAA,eAC/C,IAAA1B,WAAA,CAAAyC,GAAA,EAAC3C,YAAA,CAAA+C,IAAI;MACIC,SAAS,EAAEV,YAAY;MAC9BW,KAAK,EAAEjB,YAAa;MAAAJ,QAAA,eAEpB,IAAA1B,WAAA,CAAAyC,GAAA,EAAC3C,YAAA,CAAA+C,IAAI;QACIC,SAAS,EAAER,YAAY;QAC9BS,KAAK,EAAEf,YAAa;QAAAN,QAAA,EAEnBA;MAAQ,CACL;IAAC,CACH;EAAC,CAC4B,CAAC;AAE1C,CAAC;AAEM,MAAMsB,YAAY,GAAA3B,OAAA,CAAA2B,YAAA,gBAAG,IAAAC,WAAI,EAACxB,qBAAqB,CAAC;AACvDuB,YAAY,CAACE,WAAW,GAAG,cAAc","ignoreList":[]}
@@ -38,18 +38,22 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
38
38
  * Framing is tri-state via the `framed` prop:
39
39
  *
40
40
  * - `undefined` (DEFAULT) → RESPONSIVE, driven purely by NativeWind: full-bleed
41
- * below `md`, framed at `md`+. The rounding is `md:`-gated and both overlays
42
- * are always rendered but carry `max-md:hidden` (`display:none` below `md`),
43
- * so the breakpoint is decided in CSS no consumer JS breakpoint hook.
41
+ * below the `framedFrom` breakpoint, framed at/above it. The breakpoint is
42
+ * configurable per consumer (`framedFrom`, default `768` / Tailwind `md`); the
43
+ * rounding is gated by that breakpoint's `min-*:` variant and both overlays
44
+ * are always rendered but carry the matching `max-*:hidden` literal
45
+ * (`display:none` below the breakpoint), so the breakpoint is decided entirely
46
+ * in CSS — no consumer JS breakpoint hook.
44
47
  * - `false` → NEVER framed (full-bleed at every size): a single flat surface,
45
48
  * no rounding, no overlays.
46
49
  * - `true` → ALWAYS framed (rounded + overlays at every size).
47
50
  *
48
- * The overlays are gated by VISIBILITY (a `max-md:hidden` literal) rather than
49
- * by conditional mounting for the responsive case, so crossing the breakpoint
50
- * never remounts them. The content wrapper likewise keeps a stable `key` so
51
- * `{children}` reconciles in place across the breakpoint instead of remounting
52
- * (which would reset feed scroll / the virtualizer + refetch).
51
+ * The overlays are gated by VISIBILITY (a `max-*:hidden` literal for the chosen
52
+ * breakpoint) rather than by conditional mounting for the responsive case, so
53
+ * crossing the breakpoint never remounts them. The content wrapper likewise
54
+ * keeps a stable `key` so `{children}` reconciles in place across the breakpoint
55
+ * instead of remounting (which would reset feed scroll / the virtualizer +
56
+ * refetch).
53
57
  *
54
58
  * Native bundlers use `./index.tsx` (a plain rounded surface); web bundlers
55
59
  * select this file via the `"browser"` export condition in `package.json`.
@@ -66,9 +70,58 @@ const GUTTER_MASK_SPREAD = exports.GUTTER_MASK_SPREAD = 40;
66
70
  const PANEL_TOP_INSET = exports.PANEL_TOP_INSET = 8;
67
71
  /** Bottom sticky inset (px) of the framed panel chrome. */
68
72
  const PANEL_BOTTOM_INSET = exports.PANEL_BOTTOM_INSET = 8;
73
+
74
+ /**
75
+ * Viewport width (px) at which a RESPONSIVE `ContentPanel` (`framed` undefined)
76
+ * switches from full-bleed to framed. Each value maps to a PRE-SHIPPED literal
77
+ * Tailwind class bundle — `768` (default) uses the named `md:`/`max-md:` screens
78
+ * (byte-identical to prior behavior), `640` uses `sm:`/`max-sm:`, `1024` uses
79
+ * `lg:`/`max-lg:`, and `500` uses the arbitrary `min-[500px]:`/`max-[500px]:`
80
+ * variants (there is no named screen at 500px). The breakpoint tokens are never
81
+ * built at runtime, so a consumer's Tailwind content-scan over `lib/**` resolves
82
+ * them verbatim.
83
+ */
84
+
85
+ /**
86
+ * Per-breakpoint literal Tailwind variant tokens for the WEB responsive mode.
87
+ * Each field is a WHOLE literal class string (never assembled from parts at
88
+ * runtime) so the consumer's content-scan over `lib/**` picks up every
89
+ * arbitrary/`min-*`/`max-*`/`web:` token verbatim. Selecting a bundle by
90
+ * `framedFrom` value is the only runtime decision:
91
+ * - `surface` → framing rounding on the surface at/above the breakpoint.
92
+ * - `content` → the same rounding + a web-only horizontal clip on the
93
+ * inner content wrapper (`web:<bp>:overflow-x-clip`, platform-first-then-
94
+ * breakpoint — matching the consumer convention `web:sm:flex` in `@mercaria/ui`).
95
+ * - `overlayHidden` → `display:none` for the sticky overlays BELOW the breakpoint.
96
+ * `min-[500px]:` (≥500) and `max-[500px]:` (<500) are exactly complementary
97
+ * (meet at 500, no overlap/gap), mirroring the named `md:`/`max-md:` pair.
98
+ */
99
+ const RESPONSIVE_WEB = {
100
+ 500: {
101
+ surface: 'min-[500px]:rounded-radius-28',
102
+ content: 'min-[500px]:rounded-radius-28 web:min-[500px]:overflow-x-clip',
103
+ overlayHidden: 'max-[500px]:hidden'
104
+ },
105
+ 640: {
106
+ surface: 'sm:rounded-radius-28',
107
+ content: 'sm:rounded-radius-28 web:sm:overflow-x-clip',
108
+ overlayHidden: 'max-sm:hidden'
109
+ },
110
+ 768: {
111
+ surface: 'md:rounded-radius-28',
112
+ content: 'md:rounded-radius-28 web:md:overflow-x-clip',
113
+ overlayHidden: 'max-md:hidden'
114
+ },
115
+ 1024: {
116
+ surface: 'lg:rounded-radius-28',
117
+ content: 'lg:rounded-radius-28 web:lg:overflow-x-clip',
118
+ overlayHidden: 'max-lg:hidden'
119
+ }
120
+ };
69
121
  const ContentPanelComponent = ({
70
122
  children,
71
123
  framed,
124
+ framedFrom = 768,
72
125
  surfaceClassName,
73
126
  surfaceStyle,
74
127
  contentClassName,
@@ -87,13 +140,16 @@ const ContentPanelComponent = ({
87
140
  // `false` → never framed (full-bleed).
88
141
  const responsive = framed === undefined;
89
142
  const showOverlays = framed !== false;
143
+ // Responsive mode selects a pre-shipped literal breakpoint bundle by value;
144
+ // `framed === true`/`false` ignore `framedFrom` (fixed always/never framing).
145
+ const bp = RESPONSIVE_WEB[framedFrom];
90
146
 
91
147
  // Whole literal class strings selected per mode (the Tailwind content-scan
92
- // over `lib/**` requires each arbitrary/`md:`/`web:` token stay literal).
93
- // `web:md:overflow-x-clip` is platform-first-then-breakpoint, matching the
94
- // consumer convention (`web:sm:flex` in `@mercaria/ui`).
95
- const surfaceBase = responsive ? 'flex-1 md:rounded-radius-28' : framed ? 'flex-1 rounded-radius-28' : 'flex-1';
96
- const contentBase = responsive ? 'flex-1 md:rounded-radius-28 web:md:overflow-x-clip' : framed ? 'flex-1 rounded-radius-28 web:overflow-x-clip' : 'flex-1';
148
+ // over `lib/**` requires each arbitrary/`min-*`/`max-*`/`web:` token stay
149
+ // literal — the breakpoint tokens live whole in `RESPONSIVE_WEB` above and are
150
+ // only spliced in, never assembled from parts).
151
+ const surfaceBase = responsive ? `flex-1 ${bp.surface}` : framed ? 'flex-1 rounded-radius-28' : 'flex-1';
152
+ const contentBase = responsive ? `flex-1 ${bp.content}` : framed ? 'flex-1 rounded-radius-28 web:overflow-x-clip' : 'flex-1';
97
153
  const surfaceClass = [surfaceBase, surfaceClassName ?? 'bg-card'].join(' ');
98
154
  const contentClass = [contentBase, contentClassName].filter(Boolean).join(' ');
99
155
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_nestingContext.ContentPanelNestingContext.Provider, {
@@ -103,13 +159,13 @@ const ContentPanelComponent = ({
103
159
  style: surfaceStyle,
104
160
  children: [showOverlays && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
105
161
  pointerEvents: "none",
106
- className: responsive ? 'web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 max-md:hidden web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]' : 'web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]',
162
+ className: responsive ? `web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 ${bp.overlayHidden} web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]` : 'web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]',
107
163
  style: {
108
164
  boxShadow: `0 0 0 ${GUTTER_MASK_SPREAD}px ${maskColor ?? colors.background}`
109
165
  }
110
166
  }, "bleed-mask"), showOverlays && showStickyFrame !== false && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
111
167
  pointerEvents: "none",
112
- className: responsive ? 'web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border max-md:hidden web:[margin-bottom:calc(-100dvh+16px)]' : 'web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border web:[margin-bottom:calc(-100dvh+16px)]'
168
+ className: responsive ? `web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border ${bp.overlayHidden} web:[margin-bottom:calc(-100dvh+16px)]` : 'web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border web:[margin-bottom:calc(-100dvh+16px)]'
113
169
  }, "border-frame"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
114
170
  className: contentClass,
115
171
  style: contentStyle,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_nestingContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GUTTER_MASK_SPREAD","exports","PANEL_TOP_INSET","PANEL_BOTTOM_INSET","ContentPanelComponent","children","framed","surfaceClassName","surfaceStyle","contentClassName","contentStyle","showStickyFrame","maskColor","useContentPanelNestingGuard","colors","useTheme","responsive","undefined","showOverlays","surfaceBase","contentBase","surfaceClass","join","contentClass","filter","Boolean","jsx","ContentPanelNestingContext","Provider","value","jsxs","View","className","style","pointerEvents","boxShadow","background","ContentPanel","memo","displayName"],"sourceRoot":"../../../src","sources":["content-panel/index.web.tsx"],"mappings":";;;;;;AAiDA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;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AA,EAACrD,YAAA,CAAAsD,IAAI;MACIC,SAAS,EAAEX,YAAY;MAC9BY,KAAK,EAAEzB,YAAa;MAAAH,QAAA,GAKnBa,YAAY,iBACX,IAAAtC,WAAA,CAAA8C,GAAA,EAACjD,YAAA,CAAAsD,IAAI;QAEHG,aAAa,EAAC,MAAM;QAElBF,SAAS,EAAEhB,UAAU,GACjB,4JAA4J,GAC5J,8IAA8I;QAEpJiB,KAAK,EAAE;UAAEE,SAAS,EAAE,SAASnC,kBAAkB,MAAMY,SAAS,IAAIE,MAAM,CAACsB,UAAU;QAAG;MAAE,GAPpF,YAQL,CACF,EAGAlB,YAAY,IAAIP,eAAe,KAAK,KAAK,iBACxC,IAAA/B,WAAA,CAAA8C,GAAA,EAACjD,YAAA,CAAAsD,IAAI;QAEHG,aAAa,EAAC,MAAM;QAElBF,SAAS,EAAEhB,UAAU,GACjB,uJAAuJ,GACvJ;MAAyI,GAL3I,cAOL,CACF,eAKD,IAAApC,WAAA,CAAA8C,GAAA,EAACjD,YAAA,CAAAsD,IAAI;QAEIC,SAAS,EAAET,YAAY;QAC9BU,KAAK,EAAEvB,YAAa;QAAAL,QAAA,EAEnBA;MAAQ,GAJL,SAKA,CAAC;IAAA,CACH;EAAC,CAC4B,CAAC;AAE1C,CAAC;AAEM,MAAMgC,YAAY,GAAApC,OAAA,CAAAoC,YAAA,gBAAG,IAAAC,WAAI,EAAClC,qBAAqB,CAAC;AACvDiC,YAAY,CAACE,WAAW,GAAG,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_useTheme","_nestingContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","GUTTER_MASK_SPREAD","exports","PANEL_TOP_INSET","PANEL_BOTTOM_INSET","RESPONSIVE_WEB","surface","content","overlayHidden","ContentPanelComponent","children","framed","framedFrom","surfaceClassName","surfaceStyle","contentClassName","contentStyle","showStickyFrame","maskColor","useContentPanelNestingGuard","colors","useTheme","responsive","undefined","showOverlays","bp","surfaceBase","contentBase","surfaceClass","join","contentClass","filter","Boolean","jsx","ContentPanelNestingContext","Provider","value","jsxs","View","className","style","pointerEvents","boxShadow","background","ContentPanel","memo","displayName"],"sourceRoot":"../../../src","sources":["content-panel/index.web.tsx"],"mappings":";;;;;;AAqDA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAG2B,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,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GACjB,4EAA4EG,EAAE,CAACjB,aAAa,sEAAsE,GAClK,8IAA8I;QAEpJgC,KAAK,EAAE;UAAEE,SAAS,EAAE,SAASzC,kBAAkB,MAAMiB,SAAS,IAAIE,MAAM,CAACuB,UAAU;QAAG;MAAE,GAPpF,YAQL,CACF,EAGAnB,YAAY,IAAIP,eAAe,KAAK,KAAK,iBACxC,IAAApC,WAAA,CAAAoD,GAAA,EAACvD,YAAA,CAAA4D,IAAI;QAEHG,aAAa,EAAC,MAAM;QAElBF,SAAS,EAAEjB,UAAU,GACjB,oGAAoGG,EAAE,CAACjB,aAAa,yCAAyC,GAC7J;MAAyI,GAL3I,cAOL,CACF,eAKD,IAAA3B,WAAA,CAAAoD,GAAA,EAACvD,YAAA,CAAA4D,IAAI;QAEIC,SAAS,EAAET,YAAY;QAC9BU,KAAK,EAAExB,YAAa;QAAAN,QAAA,EAEnBA;MAAQ,GAJL,SAKA,CAAC;IAAA,CACH;EAAC,CAC4B,CAAC;AAE1C,CAAC;AAEM,MAAMkC,YAAY,GAAA1C,OAAA,CAAA0C,YAAA,gBAAG,IAAAC,WAAI,EAACpC,qBAAqB,CAAC;AACvDmC,YAAY,CAACE,WAAW,GAAG,cAAc","ignoreList":[]}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FrostedIconButton = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _expoBlur = require("expo-blur");
10
+ var _useTheme = require("../theme/use-theme.js");
11
+ var _usePressAnimation = require("../hooks/usePressAnimation.js");
12
+ var _useInteractionState = require("../hooks/useInteractionState.js");
13
+ var _shared = require("./shared.js");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
+ const RADIUS = 999;
17
+ const PRESS_SCALE = 0.94;
18
+ const DEFAULT_HIT_SLOP = {
19
+ top: 8,
20
+ bottom: 8,
21
+ left: 8,
22
+ right: 8
23
+ };
24
+
25
+ // BlurView intensity (0–100). A gentle frost so the chip reads over an image
26
+ // without smearing the content behind it. The `active` (solid) state has none.
27
+ const BLUR_INTENSITY = 24;
28
+ const FrostedIconButtonComponent = ({
29
+ onPress,
30
+ icon,
31
+ children,
32
+ active = false,
33
+ disabled = false,
34
+ size = 'md',
35
+ accessibilityLabel,
36
+ accessibilityHint,
37
+ style,
38
+ className,
39
+ testID,
40
+ hitSlop
41
+ }) => {
42
+ const theme = (0, _useTheme.useTheme)();
43
+ const geo = (0, _react.useMemo)(() => (0, _shared.resolveFrostedSize)(size), [size]);
44
+ const palette = (0, _react.useMemo)(() => (0, _shared.resolveFrostedPalette)(theme.colors, theme.isDark), [theme.colors, theme.isDark]);
45
+ const {
46
+ scaleAnim,
47
+ onPressIn: onScalePressIn,
48
+ onPressOut: onScalePressOut
49
+ } = (0, _usePressAnimation.usePressAnimation)(disabled ? undefined : PRESS_SCALE);
50
+ const {
51
+ state: pressed,
52
+ onIn: onPressedIn,
53
+ onOut: onPressedOut
54
+ } = (0, _useInteractionState.useInteractionState)();
55
+ const handlePressIn = disabled ? undefined : () => {
56
+ onScalePressIn();
57
+ onPressedIn();
58
+ };
59
+ const handlePressOut = disabled ? undefined : () => {
60
+ onScalePressOut();
61
+ onPressedOut();
62
+ };
63
+ const highlighted = pressed && !disabled;
64
+ const surface = active ? palette.activeSurface : highlighted ? palette.surfaceHover : palette.surface;
65
+ const ring = highlighted ? palette.ringHover : palette.ring;
66
+ const iconColor = active ? palette.activeIcon : palette.icon;
67
+ const containerStyle = (0, _react.useMemo)(() => {
68
+ return {
69
+ width: geo.diameter,
70
+ height: geo.diameter,
71
+ borderRadius: RADIUS,
72
+ alignItems: 'center',
73
+ justifyContent: 'center',
74
+ borderWidth: _reactNative.StyleSheet.hairlineWidth * 2,
75
+ borderColor: ring,
76
+ // Soft shadow lives on the (non-clipping) Pressable so it renders on iOS —
77
+ // the blur/tint are clipped by an inner overflow:hidden layer instead.
78
+ shadowColor: palette.shadow,
79
+ shadowOffset: {
80
+ width: 0,
81
+ height: 2
82
+ },
83
+ shadowOpacity: 1,
84
+ shadowRadius: 8,
85
+ elevation: 4
86
+ };
87
+ }, [geo.diameter, ring, palette.shadow]);
88
+ const content = icon ?? children;
89
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
90
+ style: [{
91
+ transform: [{
92
+ scale: scaleAnim
93
+ }]
94
+ }, style],
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
96
+ ...(className ? {
97
+ className
98
+ } : {}),
99
+ style: [containerStyle, disabled && styles.disabled],
100
+ onPress: disabled ? undefined : onPress,
101
+ onPressIn: handlePressIn,
102
+ onPressOut: handlePressOut,
103
+ disabled: disabled,
104
+ hitSlop: hitSlop ?? DEFAULT_HIT_SLOP,
105
+ accessibilityRole: "button",
106
+ accessibilityLabel: accessibilityLabel,
107
+ accessibilityHint: accessibilityHint,
108
+ accessibilityState: {
109
+ disabled,
110
+ selected: active
111
+ },
112
+ testID: testID,
113
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
114
+ style: [_reactNative.StyleSheet.absoluteFill, styles.clip],
115
+ children: [!active && /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoBlur.BlurView, {
116
+ intensity: BLUR_INTENSITY,
117
+ tint: theme.isDark ? 'dark' : 'light',
118
+ experimentalBlurMethod: "dimezisBlurView",
119
+ style: _reactNative.StyleSheet.absoluteFill
120
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
121
+ style: [_reactNative.StyleSheet.absoluteFill, {
122
+ backgroundColor: surface
123
+ }]
124
+ })]
125
+ }), content != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
126
+ style: {
127
+ width: geo.iconBox,
128
+ height: geo.iconBox,
129
+ alignItems: 'center',
130
+ justifyContent: 'center'
131
+ },
132
+ children: (0, _shared.applyIconColor)(content, iconColor)
133
+ })]
134
+ })
135
+ });
136
+ };
137
+ const styles = _reactNative.StyleSheet.create({
138
+ clip: {
139
+ borderRadius: RADIUS,
140
+ overflow: 'hidden'
141
+ },
142
+ disabled: {
143
+ opacity: 0.5
144
+ }
145
+ });
146
+ const FrostedIconButton = exports.FrostedIconButton = /*#__PURE__*/(0, _react.memo)(FrostedIconButtonComponent);
147
+ FrostedIconButton.displayName = 'FrostedIconButton';
148
+ //# sourceMappingURL=FrostedIconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_expoBlur","_useTheme","_usePressAnimation","_useInteractionState","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","RADIUS","PRESS_SCALE","DEFAULT_HIT_SLOP","top","bottom","left","right","BLUR_INTENSITY","FrostedIconButtonComponent","onPress","icon","children","active","disabled","size","accessibilityLabel","accessibilityHint","style","className","testID","hitSlop","theme","useTheme","geo","useMemo","resolveFrostedSize","palette","resolveFrostedPalette","colors","isDark","scaleAnim","onPressIn","onScalePressIn","onPressOut","onScalePressOut","usePressAnimation","undefined","state","pressed","onIn","onPressedIn","onOut","onPressedOut","useInteractionState","handlePressIn","handlePressOut","highlighted","surface","activeSurface","surfaceHover","ring","ringHover","iconColor","activeIcon","containerStyle","width","diameter","height","borderRadius","alignItems","justifyContent","borderWidth","StyleSheet","hairlineWidth","borderColor","shadowColor","shadow","shadowOffset","shadowOpacity","shadowRadius","elevation","content","jsx","Animated","View","transform","scale","jsxs","Pressable","styles","accessibilityRole","accessibilityState","selected","absoluteFill","clip","BlurView","intensity","tint","experimentalBlurMethod","backgroundColor","iconBox","applyIconColor","create","overflow","opacity","FrostedIconButton","exports","memo","displayName"],"sourceRoot":"../../../src","sources":["frosted-icon-button/FrostedIconButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAIkB,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAS,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD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ostedIconButton = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _useTheme = require("../theme/use-theme.js");
9
+ var _flattenWebStyle = require("../styles/flatten-web-style.js");
10
+ var _shared = require("./shared.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
+ const RADIUS = 999;
14
+ const PRESS_SCALE = 0.94;
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Per-state CSS injection
18
+ //
19
+ // Inline styles cannot express `:hover` / `:focus-visible` / `:active`. We
20
+ // inject one static stylesheet (keyed by id, once) defining the interaction
21
+ // behavior for the base `bloom-frosted-icon-btn` class; per-instance resolved
22
+ // colors are passed in as inline CSS custom properties. Self-injecting the CSS
23
+ // (rather than exporting a string for consumers to paste) is the Bloom web-fork
24
+ // convention — an unresolvable rule would fail silently otherwise.
25
+ // ---------------------------------------------------------------------------
26
+
27
+ const STYLE_ID = 'bloom-frosted-icon-button-web-css';
28
+ const BLOOM_FROSTED_ICON_BUTTON_CSS = `
29
+ .bloom-frosted-icon-btn {
30
+ appearance: none;
31
+ -webkit-appearance: none;
32
+ box-sizing: border-box;
33
+ display: inline-flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ padding: 0;
37
+ margin: 0;
38
+ border-style: solid;
39
+ border-width: 1px;
40
+ font-family: inherit;
41
+ cursor: pointer;
42
+ user-select: none;
43
+ outline: none;
44
+ transition: background-color 140ms ease, border-color 140ms ease,
45
+ box-shadow 160ms ease, transform 120ms ease;
46
+ }
47
+ .bloom-frosted-icon-btn:disabled,
48
+ .bloom-frosted-icon-btn[aria-disabled="true"] {
49
+ cursor: default;
50
+ opacity: 0.5;
51
+ }
52
+ .bloom-frosted-icon-btn:not(:disabled):not([aria-disabled="true"]):not([data-active="true"]):hover {
53
+ background-color: var(--bloom-frosted-hover-bg);
54
+ border-color: var(--bloom-frosted-hover-ring);
55
+ }
56
+ .bloom-frosted-icon-btn:not(:disabled):not([aria-disabled="true"]):active {
57
+ transform: scale(var(--bloom-frosted-press-scale, 1));
58
+ }
59
+ .bloom-frosted-icon-btn:focus-visible {
60
+ outline: 2px solid var(--bloom-frosted-ring-focus, currentColor);
61
+ outline-offset: 2px;
62
+ }
63
+ `;
64
+ function useFrostedIconButtonCss() {
65
+ (0, _react.useEffect)(() => {
66
+ if (typeof document === 'undefined') return;
67
+ if (document.getElementById(STYLE_ID)) return;
68
+ const style = document.createElement('style');
69
+ style.id = STYLE_ID;
70
+ style.textContent = BLOOM_FROSTED_ICON_BUTTON_CSS;
71
+ document.head.appendChild(style);
72
+ }, []);
73
+ }
74
+ const FrostedIconButtonWebComponent = ({
75
+ onPress,
76
+ onClick,
77
+ icon,
78
+ children,
79
+ active = false,
80
+ disabled = false,
81
+ size = 'md',
82
+ accessibilityLabel,
83
+ 'aria-label': ariaLabelProp,
84
+ accessibilityHint,
85
+ style,
86
+ className,
87
+ testID,
88
+ id,
89
+ title,
90
+ type = 'button'
91
+ }) => {
92
+ useFrostedIconButtonCss();
93
+ const theme = (0, _useTheme.useTheme)();
94
+ const reactId = (0, _react.useId)();
95
+ const resolvedId = id ?? `bloom-frosted-icon-btn-${reactId}`;
96
+ const geo = (0, _react.useMemo)(() => (0, _shared.resolveFrostedSize)(size), [size]);
97
+ const palette = (0, _react.useMemo)(() => (0, _shared.resolveFrostedPalette)(theme.colors, theme.isDark), [theme.colors, theme.isDark]);
98
+ const iconColor = active ? palette.activeIcon : palette.icon;
99
+ const blur = `blur(${geo.blur}px)`;
100
+ const containerStyle = (0, _react.useMemo)(() => {
101
+ return {
102
+ width: geo.diameter,
103
+ height: geo.diameter,
104
+ borderRadius: RADIUS,
105
+ backgroundColor: active ? palette.activeSurface : palette.surface,
106
+ borderColor: palette.ring,
107
+ color: iconColor,
108
+ // Real CSS backdrop blur so the chip frosts over content behind it. The
109
+ // solid `active` state drops the blur. Both prefixed forms for Safari.
110
+ backdropFilter: active ? 'none' : blur,
111
+ WebkitBackdropFilter: active ? 'none' : blur,
112
+ // Soft shadow kept in BOTH modes so the chip has an edge on a solid bg.
113
+ boxShadow: `0 2px 8px ${palette.shadow}`,
114
+ ['--bloom-frosted-hover-bg']: palette.surfaceHover,
115
+ ['--bloom-frosted-hover-ring']: palette.ringHover,
116
+ ['--bloom-frosted-ring-focus']: palette.focusRing,
117
+ ['--bloom-frosted-press-scale']: PRESS_SCALE
118
+ };
119
+ }, [geo.diameter, active, palette.activeSurface, palette.surface, palette.ring, palette.surfaceHover, palette.ringHover, palette.focusRing, palette.shadow, iconColor, blur]);
120
+ const handleClick = (0, _react.useCallback)(event => {
121
+ if (disabled) {
122
+ event.preventDefault();
123
+ return;
124
+ }
125
+ onClick?.(event);
126
+ onPress?.();
127
+ }, [disabled, onClick, onPress]);
128
+ const ariaLabel = ariaLabelProp ?? accessibilityLabel;
129
+ const composedClassName = ['bloom-frosted-icon-btn'].concat(className ? [className] : []).join(' ');
130
+
131
+ // `style` is an RN `StyleProp` (array-capable). Flatten before spreading into
132
+ // the raw DOM `style` object so an array form never leaks numeric keys onto
133
+ // the element's CSSStyleDeclaration. See `flattenWebStyle` for the rationale.
134
+ const resolvedStyle = (0, _flattenWebStyle.flattenWebStyle)(style);
135
+ const content = icon ?? children;
136
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
137
+ id: resolvedId,
138
+ type: type,
139
+ className: composedClassName,
140
+ style: {
141
+ ...containerStyle,
142
+ ...resolvedStyle
143
+ },
144
+ onClick: handleClick,
145
+ disabled: disabled,
146
+ "aria-disabled": disabled || undefined,
147
+ "aria-label": ariaLabel,
148
+ "aria-pressed": active,
149
+ "data-active": active || undefined,
150
+ title: title ?? accessibilityHint,
151
+ "data-testid": testID,
152
+ children: content != null && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
153
+ style: {
154
+ display: 'inline-flex',
155
+ alignItems: 'center',
156
+ justifyContent: 'center',
157
+ width: geo.iconBox,
158
+ height: geo.iconBox
159
+ },
160
+ children: (0, _shared.applyIconColor)(content, iconColor)
161
+ })
162
+ });
163
+ };
164
+ const FrostedIconButton = exports.FrostedIconButton = /*#__PURE__*/(0, _react.memo)(FrostedIconButtonWebComponent);
165
+ FrostedIconButton.displayName = 'FrostedIconButton';
166
+ //# sourceMappingURL=FrostedIconButton.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_useTheme","_flattenWebStyle","_shared","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","RADIUS","PRESS_SCALE","STYLE_ID","BLOOM_FROSTED_ICON_BUTTON_CSS","useFrostedIconButtonCss","useEffect","document","getElementById","style","createElement","id","textContent","head","appendChild","FrostedIconButtonWebComponent","onPress","onClick","icon","children","active","disabled","size","accessibilityLabel","ariaLabelProp","accessibilityHint","className","testID","title","type","theme","useTheme","reactId","useId","resolvedId","geo","useMemo","resolveFrostedSize","palette","resolveFrostedPalette","colors","isDark","iconColor","activeIcon","blur","containerStyle","width","diameter","height","borderRadius","backgroundColor","activeSurface","surface","borderColor","ring","color","backdropFilter","WebkitBackdropFilter","boxShadow","shadow","surfaceHover","ringHover","focusRing","handleClick","useCallback","event","preventDefault","ariaLabel","composedClassName","concat","join","resolvedStyle","flattenWebStyle","content","jsx","undefined","display","alignItems","justifyContent","iconBox","applyIconColor","FrostedIconButton","exports","memo","displayName"],"sourceRoot":"../../../src","sources":["frosted-icon-button/FrostedIconButton.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MACEjE,KAAK,EAAE;QACLmE,OAAO,EAAE,aAAa;QACtBC,UAAU,EAAE,QAAQ;QACpBC,cAAc,EAAE,QAAQ;QACxBhC,KAAK,EAAEX,GAAG,CAAC4C,OAAO;QAClB/B,MAAM,EAAEb,GAAG,CAAC4C;MACd,CAAE;MAAA5D,QAAA,EAED,IAAA6D,sBAAc,EAACP,OAAO,EAAE/B,SAAS;IAAC,CAC/B;EACP,CACK,CAAC;AAEb,CAAC;AAEM,MAAMuC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,gBAAG,IAAAE,WAAI,EAACpE,6BAA6B,CAAC;AACpEkE,iBAAiB,CAACG,WAAW,GAAG,mBAAmB","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "FrostedIconButton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _FrostedIconButton.FrostedIconButton;
10
+ }
11
+ });
12
+ var _FrostedIconButton = require("./FrostedIconButton");
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FrostedIconButton","require"],"sourceRoot":"../../../src","sources":["frosted-icon-button/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "FrostedIconButton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _FrostedIconButtonWeb.FrostedIconButton;
10
+ }
11
+ });
12
+ var _FrostedIconButtonWeb = require("./FrostedIconButton.web.js");
13
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_FrostedIconButtonWeb","require"],"sourceRoot":"../../../src","sources":["frosted-icon-button/index.web.ts"],"mappings":";;;;;;;;;;;AAOA,IAAAA,qBAAA,GAAAC,OAAA","ignoreList":[]}