@hideyukimori/nene2-ui 0.19.0 → 0.19.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.
@@ -21,4 +21,19 @@ export interface BadgeProps {
21
21
  * `<Badge color="red">` becomes a lie the moment the theme changes, and there is no way to
22
22
  * find every such lie afterwards except by reading every screen.
23
23
  */
24
+ /**
25
+ * 🔮 `whitespace-nowrap` is load-bearing (#477). A badge is a label, not body copy — but the
26
+ * kit had no opinion on wrapping, so in a narrow flex row the label wrapped. In CJK that is
27
+ * not a word-boundary break: 「あăȘた」 came apart into three stacked characters and the badge
28
+ * grew from 26.5px tall to 43px (measured, nene-deal /users at 375px).
29
+ *
30
+ * Two holes were open at once — the label could *wrap* (`white-space: normal`) and the badge
31
+ * could *shrink* (`flex-shrink: 1`) — and either one alone produces the failure. `shrink-0`
32
+ * would close it too, but only while the badge is a flex item: measured in a 50px block
33
+ * container, `shrink-0` still wrapped (50 × 43) while `nowrap` did not (51 × 26.5). `nowrap`
34
+ * also stops the shrink, because a flex item's automatic minimum size is its min-content
35
+ * width and nowrap makes that the whole label. One class, both holes, any context.
36
+ *
37
+ * A badge that already fits is unchanged (35.88 × 26.5 before and after, measured).
38
+ */
24
39
  export declare function Badge({ tone, className, children }: BadgeProps): import("react").JSX.Element;
@@ -15,7 +15,22 @@ const TONE_CLASS = {
15
15
  * `<Badge color="red">` becomes a lie the moment the theme changes, and there is no way to
16
16
  * find every such lie afterwards except by reading every screen.
17
17
  */
18
+ /**
19
+ * 🔮 `whitespace-nowrap` is load-bearing (#477). A badge is a label, not body copy — but the
20
+ * kit had no opinion on wrapping, so in a narrow flex row the label wrapped. In CJK that is
21
+ * not a word-boundary break: 「あăȘた」 came apart into three stacked characters and the badge
22
+ * grew from 26.5px tall to 43px (measured, nene-deal /users at 375px).
23
+ *
24
+ * Two holes were open at once — the label could *wrap* (`white-space: normal`) and the badge
25
+ * could *shrink* (`flex-shrink: 1`) — and either one alone produces the failure. `shrink-0`
26
+ * would close it too, but only while the badge is a flex item: measured in a 50px block
27
+ * container, `shrink-0` still wrapped (50 × 43) while `nowrap` did not (51 × 26.5). `nowrap`
28
+ * also stops the shrink, because a flex item's automatic minimum size is its min-content
29
+ * width and nowrap makes that the whole label. One class, both holes, any context.
30
+ *
31
+ * A badge that already fits is unchanged (35.88 × 26.5 before and after, measured).
32
+ */
18
33
  export function Badge({ tone = 'neutral', className, children }) {
19
- return (_jsx("span", { className: cx('inline-flex items-center gap-x-slot-badge-gap rounded-x-slot-badge border px-x-slot-badge-pad-x py-x-slot-badge-pad-y font-sans text-x-slot-badge font-x-slot-badge', TONE_CLASS[tone], className), children: children }));
34
+ return (_jsx("span", { className: cx('inline-flex items-center whitespace-nowrap gap-x-slot-badge-gap rounded-x-slot-badge border px-x-slot-badge-pad-x py-x-slot-badge-pad-y font-sans text-x-slot-badge font-x-slot-badge', TONE_CLASS[tone], className), children: children }));
20
35
  }
21
36
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../src/feedback/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAkBlC,MAAM,UAAU,GAAoD;IAClE,OAAO,EACL,4FAA4F;IAC9F,MAAM,EAAE,yFAAyF;IACjG,MAAM,EAAE,yFAAyF;IACjG,OAAO,EACL,4FAA4F;IAC9F,IAAI,EAAE,mFAAmF;IACzF,IAAI,EAAE,mFAAmF;CAC1F,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAc;IACzE,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,qKAAqK,EACrK,UAAU,CAAC,IAAI,CAAC,EAChB,SAAS,CACV,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../src/feedback/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAkBlC,MAAM,UAAU,GAAoD;IAClE,OAAO,EACL,4FAA4F;IAC9F,MAAM,EAAE,yFAAyF;IACjG,MAAM,EAAE,yFAAyF;IACjG,OAAO,EACL,4FAA4F;IAC9F,IAAI,EAAE,mFAAmF;IACzF,IAAI,EAAE,mFAAmF;CAC1F,CAAC;AAEF;;;;;;GAMG;AACH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAc;IACzE,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,uLAAuL,EACvL,UAAU,CAAC,IAAI,CAAC,EAChB,SAAS,CACV,YAEA,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hideyukimori/nene2-ui",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "NeNe fleet shared React UI kit — token-driven primitives on Tailwind v4 @theme. Components carry no design of their own; themes do.",
5
5
  "type": "module",
6
6
  "license": "MIT",