@wellingtonhlc/shared-ui 0.24.0 → 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;CAClB;AA+BD,eAAO,MAAM,KAAK,wGAoBjB,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"}
@@ -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('inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border font-medium leading-none', variantClass, sizeClasses[size], className), ...props }));
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';
@@ -1 +1 @@
1
- {"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../src/components/Filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOjE,MAAM,WAAW,eAAe;I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AC,EAClB,KAAiB,EACjB,WAAqE,EACrE,QAAQ,EACR,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAuB,GACxB,EAAE,eAAe,+BAiCjB;AAED,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
@@ -10,7 +10,11 @@ function FilterRoot({ title = 'Filtros', description = 'Refine os critérios ant
10
10
  const childrenArray = Children.toArray(children);
11
11
  const footerChildren = childrenArray.filter(child => isValidElement(child) && child.type === FilterFooter);
12
12
  const contentChildren = childrenArray.filter(child => !(isValidElement(child) && child.type === FilterFooter));
13
- return (_jsxs(Card.Root, { className: cn('flex min-h-0 w-full flex-col overflow-hidden xl:h-full', maxHeightClassName, className), children: [_jsxs(Card.Title, { children: [_jsx(FilterIcon, { className: "text-primary h-4 w-4" }), title] }), _jsx(Card.Body, { className: cn('flex min-h-0 flex-1 flex-col', bodyClassName), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", children: [_jsx("div", { className: cn('min-h-0 flex-1 overflow-y-auto', contentClassName), children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }), contentChildren] }) }), footerChildren] }) })] }));
13
+ return (
14
+ // Altura natural (content) por padrao — seguro em pilhas verticais (nao empurra irmaos).
15
+ // O preenchimento da coluna e a rolagem interna sao impostos pelo container
16
+ // (ex.: `Workspace.Root` forca o filho a `h-full`/`min-h-0`; em grids o item estica).
17
+ _jsxs(Card.Root, { className: cn('flex w-full min-w-0 flex-col overflow-hidden', maxHeightClassName, className), children: [_jsxs(Card.Title, { children: [_jsx(FilterIcon, { className: "text-primary h-4 w-4" }), title] }), _jsx(Card.Body, { className: cn('flex min-h-0 flex-1 flex-col', bodyClassName), children: _jsxs("div", { className: "flex min-h-0 flex-1 flex-col gap-3", children: [_jsx("div", { className: cn('min-h-0 flex-1 overflow-y-auto', contentClassName), children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-foreground-muted text-xs leading-5", children: description }), contentChildren] }) }), footerChildren] }) })] }));
14
18
  }
15
19
  export const Filter = {
16
20
  Root: FilterRoot,
@@ -4,7 +4,7 @@ import { Card } from './Card';
4
4
  import { EmptyState } from './EmptyState';
5
5
  import { RenderCase } from './RenderCase';
6
6
  function WorkspaceRoot({ filters, children, className }) {
7
- return (_jsxs("div", { className: cn('grid min-h-0 flex-1 gap-3 xl:grid-cols-[320px_minmax(0,1fr)] xl:grid-rows-[minmax(0,1fr)]', className), children: [_jsx("aside", { className: "min-h-0 xl:self-stretch", children: filters }), _jsx("section", { className: "flex min-h-0 flex-1 flex-col", children: _jsxs(RenderCase.Root, { children: [_jsx(RenderCase.If, { when: Boolean(children && (Array.isArray(children) ? children.length > 0 : true)), children: children }), _jsx(RenderCase.Else, { children: _jsx(Card.Root, { className: "flex flex-1 items-center justify-center bg-surface/60 p-8 shadow-sm", children: _jsx(EmptyState, { title: "Nenhum resultado", description: "Ajuste os filtros e pesquise novamente." }) }) })] }) })] }));
7
+ return (_jsxs("div", { className: cn('grid min-h-0 flex-1 gap-3 xl:grid-cols-[320px_minmax(0,1fr)] xl:grid-rows-[minmax(0,1fr)]', className), children: [_jsx("aside", { className: "min-h-0 xl:self-stretch xl:[&>*]:h-full xl:[&>*]:min-h-0", children: filters }), _jsx("section", { className: "flex min-h-0 flex-1 flex-col", children: _jsxs(RenderCase.Root, { children: [_jsx(RenderCase.If, { when: Boolean(children && (Array.isArray(children) ? children.length > 0 : true)), children: children }), _jsx(RenderCase.Else, { children: _jsx(Card.Root, { className: "flex flex-1 items-center justify-center bg-surface/60 p-8 shadow-sm", children: _jsx(EmptyState, { title: "Nenhum resultado", description: "Ajuste os filtros e pesquise novamente." }) }) })] }) })] }));
8
8
  }
9
9
  export const Workspace = {
10
10
  Root: WorkspaceRoot,
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
  }
@@ -3522,11 +3534,6 @@ h2.react-datepicker__current-month {
3522
3534
  width: calc(var(--spacing) * 72);
3523
3535
  }
3524
3536
  }
3525
- .xl\:h-full {
3526
- @media (width >= 80rem) {
3527
- height: 100%;
3528
- }
3529
- }
3530
3537
  .xl\:grid-cols-\[320px_minmax\(0\,1fr\)\] {
3531
3538
  @media (width >= 80rem) {
3532
3539
  grid-template-columns: 320px minmax(0,1fr);
@@ -3822,6 +3829,20 @@ h2.react-datepicker__current-month {
3822
3829
  padding-block: calc(var(--spacing) * 2);
3823
3830
  }
3824
3831
  }
3832
+ .xl\:\[\&\>\*\]\:h-full {
3833
+ @media (width >= 80rem) {
3834
+ &>* {
3835
+ height: 100%;
3836
+ }
3837
+ }
3838
+ }
3839
+ .xl\:\[\&\>\*\]\:min-h-0 {
3840
+ @media (width >= 80rem) {
3841
+ &>* {
3842
+ min-height: calc(var(--spacing) * 0);
3843
+ }
3844
+ }
3845
+ }
3825
3846
  .\[\&\>\[role\=separator\]\]\:h-px {
3826
3847
  &>[role=separator] {
3827
3848
  height: 1px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellingtonhlc/shared-ui",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",