@wellingtonhlc/shared-ui 0.24.1 → 0.24.2
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.
|
@@ -4,6 +4,13 @@ export type BadgeSize = 'xs' | 'sm' | 'md';
|
|
|
4
4
|
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
5
|
variant?: BadgeVariant | string;
|
|
6
6
|
size?: BadgeSize;
|
|
7
|
+
/**
|
|
8
|
+
* Permite que o conteudo quebre em multiplas linhas quando nao couber na largura
|
|
9
|
+
* disponivel. Por padrao o badge fica em linha unica (`inline-flex` + `whitespace-nowrap`),
|
|
10
|
+
* adequado a status curtos; com `wrap` vira `inline-block` e quebra palavras longas,
|
|
11
|
+
* util para valores longos (ex.: auditoria).
|
|
12
|
+
*/
|
|
13
|
+
wrap?: boolean;
|
|
7
14
|
}
|
|
8
15
|
export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
9
16
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIxD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/components/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIxD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA+BD,eAAO,MAAM,KAAK,wGAuBjB,CAAC"}
|
package/dist/components/Badge.js
CHANGED
|
@@ -24,11 +24,13 @@ const sizeClasses = {
|
|
|
24
24
|
sm: 'px-2.5 py-1 text-sm',
|
|
25
25
|
md: 'px-3 py-1 text-base',
|
|
26
26
|
};
|
|
27
|
-
export const Badge = forwardRef(({ className, size = 'xs', variant = 'default', ...props }, ref) => {
|
|
27
|
+
export const Badge = forwardRef(({ className, size = 'xs', variant = 'default', wrap = false, ...props }, ref) => {
|
|
28
28
|
const normalizedVariant = variant.toLowerCase();
|
|
29
29
|
const normalizedAlias = variantAlias[normalizedVariant] ?? normalizedVariant;
|
|
30
30
|
const knownVariant = normalizedAlias;
|
|
31
31
|
const variantClass = variantClasses[knownVariant] ?? normalizedVariant;
|
|
32
|
-
return (_jsx("span", { ref: ref, className: cn('
|
|
32
|
+
return (_jsx("span", { ref: ref, className: cn('rounded-full border font-medium', wrap
|
|
33
|
+
? 'inline-block whitespace-normal break-words [overflow-wrap:anywhere] leading-snug'
|
|
34
|
+
: 'inline-flex items-center gap-1.5 whitespace-nowrap leading-none', variantClass, sizeClasses[size], className), ...props }));
|
|
33
35
|
});
|
|
34
36
|
Badge.displayName = 'Badge';
|
package/dist/styles.css
CHANGED
|
@@ -1041,6 +1041,9 @@ h2.react-datepicker__current-month {
|
|
|
1041
1041
|
.inline {
|
|
1042
1042
|
display: inline;
|
|
1043
1043
|
}
|
|
1044
|
+
.inline-block {
|
|
1045
|
+
display: inline-block;
|
|
1046
|
+
}
|
|
1044
1047
|
.inline-flex {
|
|
1045
1048
|
display: inline-flex;
|
|
1046
1049
|
}
|
|
@@ -2194,9 +2197,18 @@ h2.react-datepicker__current-month {
|
|
|
2194
2197
|
--tw-tracking: var(--tracking-wide);
|
|
2195
2198
|
letter-spacing: var(--tracking-wide);
|
|
2196
2199
|
}
|
|
2200
|
+
.\[overflow-wrap\:anywhere\] {
|
|
2201
|
+
overflow-wrap: anywhere;
|
|
2202
|
+
}
|
|
2203
|
+
.break-words {
|
|
2204
|
+
overflow-wrap: break-word;
|
|
2205
|
+
}
|
|
2197
2206
|
.text-ellipsis {
|
|
2198
2207
|
text-overflow: ellipsis;
|
|
2199
2208
|
}
|
|
2209
|
+
.whitespace-normal {
|
|
2210
|
+
white-space: normal;
|
|
2211
|
+
}
|
|
2200
2212
|
.whitespace-nowrap {
|
|
2201
2213
|
white-space: nowrap;
|
|
2202
2214
|
}
|