kang-components 0.9.6 → 0.9.8

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-press-tooltip.styles.d.ts","sourceRoot":"","sources":["../src/long-press-tooltip.styles.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uVAY1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAe1B,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,YAAY;gBAA4B,OAAO,GAAG,OAAO;;gBAAjB,OAAO,GAAG,OAAO;oBAQrE,CAAC"}
@@ -0,0 +1,55 @@
1
+ // Named import (not the default) so styled-components resolves consistently
2
+ // when this file is consumed as a published node_modules ESM module.
3
+ import { styled } from 'styled-components';
4
+ import { animated } from '@react-spring/web';
5
+ /**
6
+ * Transparent block wrapper that sits inside a list (e.g. a flex column with no
7
+ * `gap`), so it doesn't alter row spacing. It owns the long-press gesture and
8
+ * suppresses the native callout / text selection that iOS and Android trigger
9
+ * on touch-and-hold.
10
+ */
11
+ export const TooltipWrapper = styled.div `
12
+ width: 100%;
13
+ /*
14
+ * Let the browser keep vertical scrolling, but claim every other gesture
15
+ * (incl. the press-and-hold) for us. Without this, Chrome on Android
16
+ * optimistically hands the touch to the compositor and fires pointercancel
17
+ * before our long-press timer completes — so a still hold "does nothing".
18
+ */
19
+ touch-action: pan-y;
20
+ -webkit-touch-callout: none;
21
+ -webkit-user-select: none;
22
+ user-select: none;
23
+ `;
24
+ /**
25
+ * Floating bubble. Uses the inverted scheme (onSurface background / surface
26
+ * text) for consistency with other transient overlays. Portaled to <body> so it
27
+ * escapes any clipped (`overflow: hidden`) ancestor.
28
+ */
29
+ export const TooltipPopover = styled(animated.div) `
30
+ position: fixed;
31
+ z-index: 9999;
32
+ box-sizing: border-box;
33
+ max-width: min(20rem, calc(100vw - 2rem));
34
+ padding: 0.75rem 0.875rem;
35
+ border-radius: 12px;
36
+ background: ${({ theme }) => theme?.colors?.onSurface ?? '#1a1a1a'};
37
+ color: ${({ theme }) => theme?.colors?.surface ?? '#ffffff'};
38
+ font-size: 0.8125rem;
39
+ line-height: 1.45;
40
+ box-shadow: 0 8px 24px ${({ theme }) => theme?.colors?.shadowLight ?? 'rgba(0, 0, 0, 0.15)'};
41
+ /* Informational only — taps anywhere dismiss it via a document listener. */
42
+ pointer-events: none;
43
+ will-change: transform, opacity;
44
+ `;
45
+ /** Small caret that points from the bubble back toward the long-pressed row. */
46
+ export const TooltipArrow = styled.div `
47
+ position: absolute;
48
+ left: var(--arrow-left, 1rem);
49
+ ${({ $placement }) => ($placement === 'below' ? 'top: -5px;' : 'bottom: -5px;')}
50
+ width: 10px;
51
+ height: 10px;
52
+ background: ${({ theme }) => theme?.colors?.onSurface ?? '#1a1a1a'};
53
+ transform: rotate(45deg);
54
+ `;
55
+ //# sourceMappingURL=long-press-tooltip.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"long-press-tooltip.styles.js","sourceRoot":"","sources":["../src/long-press-tooltip.styles.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,qEAAqE;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAa7C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;CAYvC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;;;;;;;eAOnC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAE,KAAqB,EAAE,MAAM,EAAE,SAAS,IAAI,SAAS;UAC1E,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAE,KAAqB,EAAE,MAAM,EAAE,OAAO,IAAI,SAAS;;;0BAGnD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAE,KAAqB,EAAE,MAAM,EAAE,WAAW,IAAI,qBAAqB;;;;CAI5G,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAmC;;;GAGtE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC;;;eAGjE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAE,KAAqB,EAAE,MAAM,EAAE,SAAS,IAAI,SAAS;;CAEnF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kang-components",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "description": "Generic, domain-free React UI primitives (CSS-first press feedback, delayed-action hook, spring presets, cross-fading text, circle icon button).",
5
5
  "type": "module",
6
6
  "license": "MIT",