@strategicos/ui 0.6.1 → 0.7.0
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/README.md
CHANGED
|
@@ -15,7 +15,7 @@ import { cn } from "@strategicos/ui/utils"
|
|
|
15
15
|
|
|
16
16
|
## Componentes
|
|
17
17
|
|
|
18
|
-
`accordion` · `alert` · `alert-dialog` · `avatar` · `badge` · `button` · `card` · `checkbox` · `chip` · `dialog` · `dropdown-menu` · `dropzone` · `empty-state` · `field` · `input` · `label` · `multi-select` · `page-header` · `pagination` · `password-input` · `popover` · `progress` · `segmented-control` · `select` · `separator` · `sheet` · `sidebar` · `skeleton` · `sonner` · `stat` · `switch` · `table` · `tabs` · `textarea` · `tooltip`
|
|
18
|
+
`accordion` · `alert` · `alert-dialog` · `avatar` · `badge` · `breadcrumb` · `button` · `card` · `checkbox` · `chip` · `dialog` · `dropdown-menu` · `dropzone` · `empty-state` · `field` · `input` · `label` · `multi-select` · `page-header` · `pagination` · `password-input` · `popover` · `progress` · `segmented-control` · `select` · `separator` · `sheet` · `sidebar` · `skeleton` · `sonner` · `stat` · `switch` · `table` · `tabs` · `textarea` · `tooltip`
|
|
19
19
|
|
|
20
20
|
Utilitários: `@strategicos/ui/utils` (`cn`) e `@strategicos/ui/hooks/use-mobile` (`useIsMobile`).
|
|
21
21
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Caminho até a tela atual: os níveis anteriores em tom apagado (links,
|
|
4
|
+
* quando dá para voltar a eles) e o atual em destaque, separados por "/".
|
|
5
|
+
*
|
|
6
|
+
* <Breadcrumb>
|
|
7
|
+
* <BreadcrumbList>
|
|
8
|
+
* <BreadcrumbItem>
|
|
9
|
+
* <BreadcrumbLink asChild><Link href="/configuracoes">Configurações</Link></BreadcrumbLink>
|
|
10
|
+
* </BreadcrumbItem>
|
|
11
|
+
* <BreadcrumbSeparator />
|
|
12
|
+
* <BreadcrumbItem>
|
|
13
|
+
* <BreadcrumbPage>Empresa</BreadcrumbPage>
|
|
14
|
+
* </BreadcrumbItem>
|
|
15
|
+
* </BreadcrumbList>
|
|
16
|
+
* </Breadcrumb>
|
|
17
|
+
*
|
|
18
|
+
* Só o nível atual (`BreadcrumbPage`) encolhe com reticências; os anteriores
|
|
19
|
+
* mantêm o texto inteiro. Um nível sem link é texto puro dentro do item.
|
|
20
|
+
*/
|
|
21
|
+
declare function Breadcrumb({ "aria-label": ariaLabel, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
22
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
23
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
24
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
28
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
29
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, };
|
|
30
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,UAAU,CAAC,EAAE,YAAY,EAAE,SAAqB,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAEjG;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAQ1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAQ1E;AAED,iBAAS,cAAc,CAAC,EACtB,OAAe,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,qBAanD;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAS5E;AAED,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,qBAYzF;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Caminho até a tela atual: os níveis anteriores em tom apagado (links,
|
|
6
|
+
* quando dá para voltar a eles) e o atual em destaque, separados por "/".
|
|
7
|
+
*
|
|
8
|
+
* <Breadcrumb>
|
|
9
|
+
* <BreadcrumbList>
|
|
10
|
+
* <BreadcrumbItem>
|
|
11
|
+
* <BreadcrumbLink asChild><Link href="/configuracoes">Configurações</Link></BreadcrumbLink>
|
|
12
|
+
* </BreadcrumbItem>
|
|
13
|
+
* <BreadcrumbSeparator />
|
|
14
|
+
* <BreadcrumbItem>
|
|
15
|
+
* <BreadcrumbPage>Empresa</BreadcrumbPage>
|
|
16
|
+
* </BreadcrumbItem>
|
|
17
|
+
* </BreadcrumbList>
|
|
18
|
+
* </Breadcrumb>
|
|
19
|
+
*
|
|
20
|
+
* Só o nível atual (`BreadcrumbPage`) encolhe com reticências; os anteriores
|
|
21
|
+
* mantêm o texto inteiro. Um nível sem link é texto puro dentro do item.
|
|
22
|
+
*/
|
|
23
|
+
function Breadcrumb({ "aria-label": ariaLabel = "Caminho", ...props }) {
|
|
24
|
+
return _jsx("nav", { "data-slot": "breadcrumb", "aria-label": ariaLabel, ...props });
|
|
25
|
+
}
|
|
26
|
+
function BreadcrumbList({ className, ...props }) {
|
|
27
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
30
|
+
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex min-w-0 items-center gap-1.5", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
function BreadcrumbLink({ asChild = false, className, ...props }) {
|
|
33
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
34
|
+
return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn("rounded-sm whitespace-nowrap transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50", className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
37
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", "aria-current": "page", className: cn("min-w-0 truncate font-medium text-foreground", className), ...props }));
|
|
38
|
+
}
|
|
39
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
40
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: cn("shrink-0 text-muted-foreground/60 [&>svg]:size-3.5", className), ...props, children: children ?? "/" }));
|
|
41
|
+
}
|
|
42
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, };
|
|
43
|
+
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AAEpC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,UAAU,CAAC,EAAE,YAAY,EAAE,SAAS,GAAG,SAAS,EAAE,GAAG,KAAK,EAA+B;IAChG,OAAO,2BAAe,YAAY,gBAAa,SAAS,KAAM,KAAK,GAAI,CAAA;AACzE,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B;IACzE,OAAO,CACL,0BACY,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CAAC,iEAAiE,EAAE,SAAS,CAAC,KACvF,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B;IACzE,OAAO,CACL,0BACY,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CAAC,0CAA0C,EAAE,SAAS,CAAC,KAChE,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,OAAO,GAAG,KAAK,EACf,SAAS,EACT,GAAG,KAAK,EAC0C;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA;IAEtC,OAAO,CACL,KAAC,IAAI,iBACO,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CACX,mIAAmI,EACnI,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC;IAC3E,OAAO,CACL,4BACY,iBAAiB,kBACd,MAAM,EACnB,SAAS,EAAE,EAAE,CAAC,8CAA8C,EAAE,SAAS,CAAC,KACpE,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAA8B;IACxF,OAAO,CACL,0BACY,sBAAsB,EAChC,IAAI,EAAC,cAAc,iBACP,MAAM,EAClB,SAAS,EAAE,EAAE,CAAC,oDAAoD,EAAE,SAAS,CAAC,KAC1E,KAAK,YAER,QAAQ,IAAI,GAAG,GACb,CACN,CAAA;AACH,CAAC;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils.js"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Caminho até a tela atual: os níveis anteriores em tom apagado (links,
|
|
8
|
+
* quando dá para voltar a eles) e o atual em destaque, separados por "/".
|
|
9
|
+
*
|
|
10
|
+
* <Breadcrumb>
|
|
11
|
+
* <BreadcrumbList>
|
|
12
|
+
* <BreadcrumbItem>
|
|
13
|
+
* <BreadcrumbLink asChild><Link href="/configuracoes">Configurações</Link></BreadcrumbLink>
|
|
14
|
+
* </BreadcrumbItem>
|
|
15
|
+
* <BreadcrumbSeparator />
|
|
16
|
+
* <BreadcrumbItem>
|
|
17
|
+
* <BreadcrumbPage>Empresa</BreadcrumbPage>
|
|
18
|
+
* </BreadcrumbItem>
|
|
19
|
+
* </BreadcrumbList>
|
|
20
|
+
* </Breadcrumb>
|
|
21
|
+
*
|
|
22
|
+
* Só o nível atual (`BreadcrumbPage`) encolhe com reticências; os anteriores
|
|
23
|
+
* mantêm o texto inteiro. Um nível sem link é texto puro dentro do item.
|
|
24
|
+
*/
|
|
25
|
+
function Breadcrumb({ "aria-label": ariaLabel = "Caminho", ...props }: React.ComponentProps<"nav">) {
|
|
26
|
+
return <nav data-slot="breadcrumb" aria-label={ariaLabel} {...props} />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
|
|
30
|
+
return (
|
|
31
|
+
<ol
|
|
32
|
+
data-slot="breadcrumb-list"
|
|
33
|
+
className={cn("flex min-w-0 items-center gap-1.5 text-sm text-muted-foreground", className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
40
|
+
return (
|
|
41
|
+
<li
|
|
42
|
+
data-slot="breadcrumb-item"
|
|
43
|
+
className={cn("inline-flex min-w-0 items-center gap-1.5", className)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function BreadcrumbLink({
|
|
50
|
+
asChild = false,
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: React.ComponentProps<"a"> & { asChild?: boolean }) {
|
|
54
|
+
const Comp = asChild ? Slot.Root : "a"
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Comp
|
|
58
|
+
data-slot="breadcrumb-link"
|
|
59
|
+
className={cn(
|
|
60
|
+
"rounded-sm whitespace-nowrap transition-colors outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50",
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
{...props}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
|
|
69
|
+
return (
|
|
70
|
+
<span
|
|
71
|
+
data-slot="breadcrumb-page"
|
|
72
|
+
aria-current="page"
|
|
73
|
+
className={cn("min-w-0 truncate font-medium text-foreground", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">) {
|
|
80
|
+
return (
|
|
81
|
+
<li
|
|
82
|
+
data-slot="breadcrumb-separator"
|
|
83
|
+
role="presentation"
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
className={cn("shrink-0 text-muted-foreground/60 [&>svg]:size-3.5", className)}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
{children ?? "/"}
|
|
89
|
+
</li>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
Breadcrumb,
|
|
95
|
+
BreadcrumbList,
|
|
96
|
+
BreadcrumbItem,
|
|
97
|
+
BreadcrumbLink,
|
|
98
|
+
BreadcrumbPage,
|
|
99
|
+
BreadcrumbSeparator,
|
|
100
|
+
}
|