@ihabdevteam/core 0.16.0 → 0.17.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.
@@ -5119,7 +5119,7 @@ export declare interface SliderProps {
5119
5119
  export declare function sortToValue(key: string, asc: boolean): string | undefined;
5120
5120
 
5121
5121
  /** @public */
5122
- export declare function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, }: SoundCompassProps): JSX.Element;
5122
+ export declare function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): JSX.Element;
5123
5123
 
5124
5124
  export declare interface SoundCompassExam {
5125
5125
  /** `<SoundCompass {...bind} />` 로 펼쳐 넣는 제어 props */
@@ -5208,6 +5208,17 @@ export declare interface SoundCompassProps {
5208
5208
  * 작아지고, 상한을 올려도 다음 소비자가 또 그 끝에서 막힌다. 그럴 때 직접 준다.
5209
5209
  */
5210
5210
  shortcutScale?: number;
5211
+ /**
5212
+ * 배지를 버튼 크기에 맞춰 스스로 키울지. 기본 꺼짐 — 배지는 24px 그대로다.
5213
+ *
5214
+ * 켜면 `clamp(0.75, buttonSize / 56, 3)` 이 걸린다(묶이지 않는 동안 버튼 대비
5215
+ * 0.43 으로 일정). `shortcutScale` 을 직접 주면 이것과 무관하게 그 값이 이긴다.
5216
+ *
5217
+ * 0.17.0 전에는 이 자동 배율이 **묻지 않고 늘 걸렸다.** 배지를 24px 그대로 두고
5218
+ * 싶은 소비자에게는 끌 방법이 없었고, 큰 버튼에서 배지가 갑자기 커지는 것이
5219
+ * 놀라움이 됐다. 스스로 정하는 쪽을 기본으로 두지 않는다.
5220
+ */
5221
+ scaleShortcut?: boolean;
5211
5222
  }
5212
5223
 
5213
5224
  /**
@@ -58,6 +58,8 @@
58
58
  /* 호버·포커스도 상태 색과 같은 방식으로 연다 — 소비자가 바꿔 끼울 수 있게. */
59
59
  --scb-idle-hover-bg: var(--color-whiteLine);
60
60
  --scb-idle-hover-border: var(--color-lightGray);
61
+ /* 호버의 글자색. 기본은 idle 과 같다 — 주지 않으면 예전 그대로다. */
62
+ --scb-idle-hover-fg: var(--scb-idle-fg);
61
63
  --scb-focus-ring: var(--color-main);
62
64
  }
63
65
 
@@ -149,6 +151,7 @@
149
151
  .sound-compass__speaker-btn--idle:hover {
150
152
  background: var(--scb-idle-hover-bg);
151
153
  border-color: var(--scb-idle-hover-border);
154
+ color: var(--scb-idle-hover-fg);
152
155
  }
153
156
  /* :focus-visible 이라 마우스로 누를 때는 링이 안 뜨고 키보드로 옮길 때만 뜬다. */
154
157
  .sound-compass__speaker-btn:focus-visible {
@@ -52,6 +52,17 @@ export interface SoundCompassProps {
52
52
  * 작아지고, 상한을 올려도 다음 소비자가 또 그 끝에서 막힌다. 그럴 때 직접 준다.
53
53
  */
54
54
  shortcutScale?: number;
55
+ /**
56
+ * 배지를 버튼 크기에 맞춰 스스로 키울지. 기본 꺼짐 — 배지는 24px 그대로다.
57
+ *
58
+ * 켜면 `clamp(0.75, buttonSize / 56, 3)` 이 걸린다(묶이지 않는 동안 버튼 대비
59
+ * 0.43 으로 일정). `shortcutScale` 을 직접 주면 이것과 무관하게 그 값이 이긴다.
60
+ *
61
+ * 0.17.0 전에는 이 자동 배율이 **묻지 않고 늘 걸렸다.** 배지를 24px 그대로 두고
62
+ * 싶은 소비자에게는 끌 방법이 없었고, 큰 버튼에서 배지가 갑자기 커지는 것이
63
+ * 놀라움이 됐다. 스스로 정하는 쪽을 기본으로 두지 않는다.
64
+ */
65
+ scaleShortcut?: boolean;
55
66
  }
56
67
  /** @public */
57
- export default function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, }: SoundCompassProps): import("react").JSX.Element;
68
+ export default function SoundCompass({ speakers, size, viewT, activeSpeakerId, playedIds, selectedId, answerId, showFeedback, clickable, onSelectSpeaker, buttonSize, showIcon, shortcutAnchor, shortcutScale, scaleShortcut, }: SoundCompassProps): import("react").JSX.Element;
@@ -14,7 +14,7 @@ import ShortcutBadge from './ShortcutBadge';
14
14
  import './SoundCompass.css';
15
15
  const lerp = (a, b, t) => a + (b - a) * t;
16
16
  /** @public */
17
- export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSpeakerId = null, playedIds, selectedId = null, answerId = null, showFeedback = false, clickable = false, onSelectSpeaker, buttonSize = 40, showIcon = true, shortcutAnchor = 'top-right', shortcutScale, }) {
17
+ export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSpeakerId = null, playedIds, selectedId = null, answerId = null, showFeedback = false, clickable = false, onSelectSpeaker, buttonSize = 40, showIcon = true, shortcutAnchor = 'top-right', shortcutScale, scaleShortcut = false, }) {
18
18
  const t = Math.max(0, Math.min(1, viewT));
19
19
  const CENTER = size / 2;
20
20
  // ── 탑뷰 좌표 ──────────────────────────────────────────────────────────
@@ -162,12 +162,16 @@ export default function SoundCompass({ speakers, size = 300, viewT = 0, activeSp
162
162
  // 3 이면 168px 까지 묶이지 않는다. 하한 0.75 는 배지가 읽히는 크기다.
163
163
  //
164
164
  // 그래도 이 식이 안 맞는 자리는 남는다 — 상한을 올려도 다음 소비자가 또
165
- // 그 끝에서 막힌다. 그래서 `shortcutScale` 로 직접 줄 수 있게 열어 두고,
166
- // 안 주면 이 식이 그대로 쓰인다.
165
+ // 그 끝에서 막힌다. 그래서 `shortcutScale` 로 직접 줄 수 있게 열어 둔다.
166
+ //
167
+ // **둘 다 안 주면 변수를 아예 얹지 않는다.** 그러면 CSS 의 기본값 1 이
168
+ // 살아 배지가 24px 그대로다. 예전에는 이 식이 묻지 않고 늘 걸렸다.
167
169
  //
168
170
  // 배율은 transform 이 아니라 변수로 넘긴다 — 배지의 anchor 가 같은 속성에
169
171
  // translate 를 걸고 있어, 여기서 transform 을 걸면 그것을 지운다.
170
- ['--shortcut-badge-scale']: String(shortcutScale ?? Math.max(0.75, Math.min(3, buttonSize / 56))),
172
+ ...(shortcutScale !== undefined || scaleShortcut
173
+ ? { ['--shortcut-badge-scale']: String(shortcutScale ?? Math.max(0.75, Math.min(3, buttonSize / 56))) }
174
+ : null),
171
175
  pointerEvents: (clickable ? 'auto' : 'none'),
172
176
  cursor: clickable ? 'pointer' : 'default',
173
177
  // 호출된(=idle이 아닌) 스피커를 다른 스피커 위로 끌어올렸다가, 초기화되면 다시 낮춘다
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihabdevteam/core",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "private": false,
5
5
  "main": "dist/ihabdevteam-core.cjs.js",
6
6
  "module": "dist/ihabdevteam-core.esm.js",