@majapisoftwares/ui 6.8.1 → 6.8.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.
package/docs/STANDARDS.md
CHANGED
|
@@ -52,6 +52,7 @@ AGENTS.md nos apps exige contribuição upstream antes de uso. O verificador est
|
|
|
52
52
|
- Imports internos relativos e `"use client"` são aplicados por `npm run normalize:ui` após o CLI do shadcn.
|
|
53
53
|
- Sheet traduz o nome acessível do fechamento pelo idioma ativo.
|
|
54
54
|
- Sidebar: três modos (open/compact/closed), largura redimensionável (208–448px) com troca de modo por largura, menu de clique direito, tooltip que fecha ao clicar e textos traduzidos.
|
|
55
|
+
- Tabelas nunca alargam a página: `SidebarInset` tem `min-w-0` (sem ele, um conteúdo largo mantinha o inset na largura inteira e a página rolava para o lado pela largura da sidebar) e o contêiner de `Table` usa `contain-inline-size`, então a largura das linhas não entra no tamanho de nenhum ancestral (flex ou grid): a tabela rola dentro do próprio contêiner. O contêiner ocupa a largura que o pai dá; dentro de um pai que encolhe ao conteúdo (`w-fit`, inline, trilha `auto` de grid), dê largura ao pai. Não remova nenhum dos dois.
|
|
55
56
|
- use-mobile usa useSyncExternalStore (compatível com SSR e com a regra de hooks).
|
|
56
57
|
- Field usa imports relativos. Button assume type=button para evitar submissões acidentais; formulários declaram type=submit. Badge inclui variantes success e warning reutilizadas por StatusBadge.
|
|
57
58
|
- Tokens de identidade, estados semânticos e padrões compostos são mantidos aqui.
|
package/package.json
CHANGED
|
@@ -615,12 +615,14 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
615
615
|
);
|
|
616
616
|
}
|
|
617
617
|
|
|
618
|
+
// Majapi UI: `min-w-0` lets the inset shrink beside the sidebar; without it a
|
|
619
|
+
// wide child (a table) keeps it at full width and the page scrolls sideways.
|
|
618
620
|
function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
|
|
619
621
|
return (
|
|
620
622
|
<main
|
|
621
623
|
data-slot="sidebar-inset"
|
|
622
624
|
className={cn(
|
|
623
|
-
"relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
625
|
+
"relative flex w-full min-w-0 flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
624
626
|
className,
|
|
625
627
|
)}
|
|
626
628
|
{...props}
|
|
@@ -4,7 +4,10 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "cn";
|
|
5
5
|
|
|
6
6
|
// Majapi UI: `containerClassName` styles the scroll container (e.g. to fill
|
|
7
|
-
// the available height and scroll vertically).
|
|
7
|
+
// the available height and scroll vertically). `contain-inline-size` keeps the
|
|
8
|
+
// table's width out of every ancestor's sizing: however wide the rows, the
|
|
9
|
+
// table scrolls inside its own container and never widens the page, in any
|
|
10
|
+
// flex or grid layout. The container takes the width its parent gives it.
|
|
8
11
|
function Table({
|
|
9
12
|
className,
|
|
10
13
|
containerClassName,
|
|
@@ -13,7 +16,7 @@ function Table({
|
|
|
13
16
|
return (
|
|
14
17
|
<div
|
|
15
18
|
data-slot="table-container"
|
|
16
|
-
className={cn("relative w-full overflow-x-auto", containerClassName)}
|
|
19
|
+
className={cn("relative w-full overflow-x-auto contain-inline-size", containerClassName)}
|
|
17
20
|
>
|
|
18
21
|
<table
|
|
19
22
|
data-slot="table"
|