@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.
- package/dist/feedback/Badge.d.ts +15 -0
- package/dist/feedback/Badge.js +16 -1
- package/dist/feedback/Badge.js.map +1 -1
- package/package.json +1 -1
package/dist/feedback/Badge.d.ts
CHANGED
|
@@ -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;
|
package/dist/feedback/Badge.js
CHANGED
|
@@ -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,
|
|
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.
|
|
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",
|