@cbrl/design 0.7.0 → 0.9.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 +85 -5
- package/dist/components/badge.d.ts +3 -2
- package/dist/components/badge.js +30 -13
- package/dist/components/button.d.ts +1 -1
- package/dist/components/container.d.ts +19 -0
- package/dist/components/container.js +46 -0
- package/dist/components/dialog.d.ts +6 -2
- package/dist/components/dialog.js +4 -4
- package/dist/components/page-header.d.ts +24 -0
- package/dist/components/page-header.js +42 -0
- package/dist/components/sheet.d.ts +3 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/status-dot.d.ts +1 -1
- package/dist/components/status-dot.js +5 -3
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/theme-toggle.d.ts +22 -0
- package/dist/components/theme-toggle.js +60 -0
- package/dist/components/typography.d.ts +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/tokens.css +48 -0
- package/dist/tokens.d.ts +144 -0
- package/dist/tokens.js +145 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -99,8 +99,8 @@ pass a localized `overflowLabel`). Without `max` it renders every child, as befo
|
|
|
99
99
|
|
|
100
100
|
### Status
|
|
101
101
|
|
|
102
|
-
`StatusDot` is a small status indicator: `tone` (`
|
|
103
|
-
`destructive`, `info
|
|
102
|
+
`StatusDot` is a small status indicator: `tone` (`neutral`, `success`,
|
|
103
|
+
`warning`, `destructive`, `info`; `muted` is an alias of `neutral`), `size` (`sm`, `default`, `lg`) and an optional
|
|
104
104
|
`pulse` ring (off under reduced motion). Give it a `label` when nothing next to
|
|
105
105
|
it says the status; without one it is decorative (`aria-hidden`).
|
|
106
106
|
|
|
@@ -111,9 +111,36 @@ it says the status; without one it is decorative (`aria-hidden`).
|
|
|
111
111
|
<StatusDot tone="destructive" label="Falha na sincronização" />
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
`Badge`
|
|
115
|
-
`<Badge
|
|
116
|
-
`
|
|
114
|
+
`Badge` takes the same `tone` (`neutral`, `success`, `warning`, `info`,
|
|
115
|
+
`destructive`) as a soft tint for status text: `<Badge tone="success">Ativo</Badge>`.
|
|
116
|
+
The older `variant="success" | "warning" | "info"` keep working.
|
|
117
|
+
|
|
118
|
+
### Semantic color tokens
|
|
119
|
+
|
|
120
|
+
Use these instead of raw palette colors (`green-600`, `red-500`, `amber-*`) when
|
|
121
|
+
the color means something. All have light and dark values and are Tailwind
|
|
122
|
+
utilities (`bg-success`, `text-negative`, `border-warning`, ...):
|
|
123
|
+
|
|
124
|
+
| Token | Use |
|
|
125
|
+
| ------------------------------------------------------------------------ | ---------------------------------------------------- |
|
|
126
|
+
| `success`, `success-foreground` | Solid fill for OK/done/active, text on it |
|
|
127
|
+
| `warning`, `warning-foreground` | Solid fill for pending/attention, text on it |
|
|
128
|
+
| `info`, `info-foreground` | Solid fill for informational/in progress, text on it |
|
|
129
|
+
| `success-muted`, `success-muted-foreground` (also `warning-*`, `info-*`) | Soft banner/badge fill and the text on it |
|
|
130
|
+
| `destructive` | Errors and destructive actions (existing) |
|
|
131
|
+
| `positive`, `negative` | Finance amounts: income vs expense (`text-positive`) |
|
|
132
|
+
|
|
133
|
+
Every foreground pair and `positive`/`negative` on the page meet WCAG AA (4.5:1).
|
|
134
|
+
|
|
135
|
+
For places CSS variables do not reach (OG images, emails), the light-theme
|
|
136
|
+
values are exported as plain strings:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { tokens } from '@cbrl/design/tokens'
|
|
140
|
+
|
|
141
|
+
tokens.success.hex // '#008236'
|
|
142
|
+
tokens.negative.oklch // 'oklch(0.577 0.245 27.325)'
|
|
143
|
+
```
|
|
117
144
|
|
|
118
145
|
### Button group
|
|
119
146
|
|
|
@@ -154,6 +181,59 @@ import { ChevronDown } from 'lucide-react'
|
|
|
154
181
|
</ButtonGroup>
|
|
155
182
|
```
|
|
156
183
|
|
|
184
|
+
### Page layout
|
|
185
|
+
|
|
186
|
+
`Container` centers content and caps its width; `gutter` adds the horizontal
|
|
187
|
+
padding (vertical spacing stays with the caller). Use `asChild` to render a
|
|
188
|
+
semantic element.
|
|
189
|
+
|
|
190
|
+
| `size` | max width | | `gutter` | padding |
|
|
191
|
+
| ------- | ---------------- | --- | -------- | ------------------------ |
|
|
192
|
+
| `prose` | 840px | | `none` | — (default) |
|
|
193
|
+
| `sm` | 1120px | | `sm` | `px-6` |
|
|
194
|
+
| `md` | 1200px (default) | | `md` | `px-6 sm:px-10 lg:px-14` |
|
|
195
|
+
| `lg` | 1280px | | | |
|
|
196
|
+
| `xl` | 1600px | | | |
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
import { Container, PageHeader, PageHeaderSkeleton, Button } from '@cbrl/design'
|
|
200
|
+
|
|
201
|
+
<Container asChild size="xl" className="px-4 py-5 md:px-6 md:py-8">
|
|
202
|
+
<main>
|
|
203
|
+
<PageHeader
|
|
204
|
+
title="Imóveis"
|
|
205
|
+
description="Gerencie seus imóveis."
|
|
206
|
+
actions={<Button>Novo imóvel</Button>}
|
|
207
|
+
className="mb-6 md:mb-8"
|
|
208
|
+
/>
|
|
209
|
+
</main>
|
|
210
|
+
</Container>
|
|
211
|
+
|
|
212
|
+
// loading.tsx
|
|
213
|
+
<PageHeaderSkeleton titleWidth="w-32" descriptionWidth={null} />
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Theme toggle
|
|
217
|
+
|
|
218
|
+
`ThemeToggle` flips light/dark through `next-themes` (mount `ThemeProvider`).
|
|
219
|
+
`variant="icon"` (default) is a ghost sun/moon button; `variant="text"` is a mono
|
|
220
|
+
uppercase label. Labels default to pt-BR and are overridable via `labels`.
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<ThemeToggle
|
|
224
|
+
variant="text"
|
|
225
|
+
labels={{
|
|
226
|
+
light: 'light',
|
|
227
|
+
dark: 'dark',
|
|
228
|
+
switchToLight: 'Switch to light theme',
|
|
229
|
+
switchToDark: 'Switch to dark theme',
|
|
230
|
+
}}
|
|
231
|
+
/>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`SheetContent`, `DialogContent` and `DialogFooter` take `closeLabel` to localize
|
|
235
|
+
their built-in close button (default `"Close"`).
|
|
236
|
+
|
|
157
237
|
### App shell
|
|
158
238
|
|
|
159
239
|
`AppShell` renders the whole authenticated layout (collapsible sidebar with brand,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "secondary" | "destructive" | "success" | "warning" | "info" | "default" | "outline" | "ghost" | "link" | null | undefined;
|
|
5
|
+
tone?: "destructive" | "success" | "warning" | "info" | "neutral" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
declare function Badge({ className, variant, tone, asChild, ...props }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
7
8
|
asChild?: boolean;
|
|
8
9
|
}): React.JSX.Element;
|
|
9
10
|
export { Badge, badgeVariants };
|
package/dist/components/badge.js
CHANGED
|
@@ -5,25 +5,42 @@ import { Slot } from "radix-ui";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
// src/components/badge.tsx
|
|
7
7
|
const badgeVariants = cva("group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
8
|
-
variants: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
12
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
13
|
+
success: "bg-success/15 text-success-muted-foreground focus-visible:ring-success/20 [a]:hover:bg-success/25",
|
|
14
|
+
warning: "bg-warning/15 text-warning-muted-foreground focus-visible:ring-warning/20 [a]:hover:bg-warning/25",
|
|
15
|
+
info: "bg-info/15 text-info-muted-foreground focus-visible:ring-info/20 [a]:hover:bg-info/25",
|
|
16
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
17
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
18
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Semantic tint on top of any `variant` (wins over its colors). Use it
|
|
22
|
+
* for status: `<Badge tone="success">`.
|
|
23
|
+
*/
|
|
24
|
+
tone: {
|
|
25
|
+
neutral: "bg-muted text-muted-foreground [a]:hover:bg-muted/80",
|
|
26
|
+
success: "bg-success-muted text-success-muted-foreground focus-visible:ring-success/20 [a]:hover:bg-success-muted/80",
|
|
27
|
+
warning: "bg-warning-muted text-warning-muted-foreground focus-visible:ring-warning/20 [a]:hover:bg-warning-muted/80",
|
|
28
|
+
info: "bg-info-muted text-info-muted-foreground focus-visible:ring-info/20 [a]:hover:bg-info-muted/80",
|
|
29
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 [a]:hover:bg-destructive/20"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
19
32
|
defaultVariants: { variant: "default" }
|
|
20
33
|
});
|
|
21
|
-
function Badge({ className, variant = "default", asChild = false, ...props }) {
|
|
34
|
+
function Badge({ className, variant = "default", tone, asChild = false, ...props }) {
|
|
22
35
|
const Comp = asChild ? Slot.Root : "span";
|
|
23
36
|
return /* @__PURE__ */ jsx(Comp, {
|
|
24
37
|
"data-slot": "badge",
|
|
25
38
|
"data-variant": variant,
|
|
26
|
-
|
|
39
|
+
"data-tone": tone ?? void 0,
|
|
40
|
+
className: cn(badgeVariants({
|
|
41
|
+
variant,
|
|
42
|
+
tone
|
|
43
|
+
}), className),
|
|
27
44
|
...props
|
|
28
45
|
});
|
|
29
46
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "secondary" | "destructive" | "default" | "outline" | "ghost" | "link" | null | undefined;
|
|
5
5
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* Horizontal page container: centers content, caps its width and (optionally)
|
|
5
|
+
* applies the horizontal gutter. Vertical spacing is the caller's job.
|
|
6
|
+
*
|
|
7
|
+
* Widths: `prose` 840px · `sm` 1120px · `md` 1200px · `lg` 1280px · `xl` 1600px.
|
|
8
|
+
* Gutters: `none` · `sm` (px-6) · `md` (px-6 → sm:px-10 → lg:px-14).
|
|
9
|
+
*/
|
|
10
|
+
declare const containerVariants: (props?: ({
|
|
11
|
+
size?: "sm" | "lg" | "prose" | "md" | "xl" | null | undefined;
|
|
12
|
+
gutter?: "sm" | "md" | "none" | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
type ContainerProps = React.ComponentProps<'div'> & VariantProps<typeof containerVariants> & {
|
|
15
|
+
/** Render the single child (e.g. `<main>`, `<section>`) with the container classes. */
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function Container({ className, size, gutter, asChild, ...props }: ContainerProps): React.JSX.Element;
|
|
19
|
+
export { Container, type ContainerProps, containerVariants };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { Slot } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/components/container.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Horizontal page container: centers content, caps its width and (optionally)
|
|
9
|
+
* applies the horizontal gutter. Vertical spacing is the caller's job.
|
|
10
|
+
*
|
|
11
|
+
* Widths: `prose` 840px · `sm` 1120px · `md` 1200px · `lg` 1280px · `xl` 1600px.
|
|
12
|
+
* Gutters: `none` · `sm` (px-6) · `md` (px-6 → sm:px-10 → lg:px-14).
|
|
13
|
+
*/
|
|
14
|
+
const containerVariants = cva("mx-auto w-full", {
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
prose: "max-w-[840px]",
|
|
18
|
+
sm: "max-w-[1120px]",
|
|
19
|
+
md: "max-w-[1200px]",
|
|
20
|
+
lg: "max-w-[1280px]",
|
|
21
|
+
xl: "max-w-[1600px]"
|
|
22
|
+
},
|
|
23
|
+
gutter: {
|
|
24
|
+
none: "",
|
|
25
|
+
sm: "px-6",
|
|
26
|
+
md: "px-6 sm:px-10 lg:px-14"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
size: "md",
|
|
31
|
+
gutter: "none"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
function Container({ className, size, gutter, asChild = false, ...props }) {
|
|
35
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
36
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
37
|
+
"data-slot": "container",
|
|
38
|
+
"data-size": size ?? "md",
|
|
39
|
+
className: cn(containerVariants({
|
|
40
|
+
size,
|
|
41
|
+
gutter
|
|
42
|
+
}), className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export { Container, containerVariants };
|
|
@@ -5,11 +5,15 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof Dialog$
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof Dialog$1.Portal>): React.JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof Dialog$1.Close>): React.JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof Dialog$1.Overlay>): React.JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, closeLabel, ...props }: React.ComponentProps<typeof Dialog$1.Content> & {
|
|
9
|
+
/** Accessible label of the built-in close button. */
|
|
10
|
+
closeLabel?: string;
|
|
9
11
|
showCloseButton?: boolean;
|
|
10
12
|
}): React.JSX.Element;
|
|
11
13
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
-
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<'div'> & {
|
|
14
|
+
declare function DialogFooter({ className, showCloseButton, closeLabel, children, ...props }: React.ComponentProps<'div'> & {
|
|
15
|
+
/** Text of the footer close button. */
|
|
16
|
+
closeLabel?: string;
|
|
13
17
|
showCloseButton?: boolean;
|
|
14
18
|
}): React.JSX.Element;
|
|
15
19
|
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): React.JSX.Element;
|
|
@@ -37,7 +37,7 @@ function DialogOverlay({ className, ...props }) {
|
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
40
|
+
function DialogContent({ className, children, showCloseButton = true, closeLabel = "Close", ...props }) {
|
|
41
41
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
|
|
42
42
|
"data-slot": "dialog-content",
|
|
43
43
|
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm", className),
|
|
@@ -51,7 +51,7 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
|
|
|
51
51
|
size: "icon-sm",
|
|
52
52
|
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
53
53
|
className: "sr-only",
|
|
54
|
-
children:
|
|
54
|
+
children: closeLabel
|
|
55
55
|
})]
|
|
56
56
|
})
|
|
57
57
|
})]
|
|
@@ -64,7 +64,7 @@ function DialogHeader({ className, ...props }) {
|
|
|
64
64
|
...props
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
67
|
+
function DialogFooter({ className, showCloseButton = false, closeLabel = "Close", children, ...props }) {
|
|
68
68
|
return /* @__PURE__ */ jsxs("div", {
|
|
69
69
|
"data-slot": "dialog-footer",
|
|
70
70
|
className: cn("bg-muted/50 -mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t p-4 sm:flex-row sm:justify-end", className),
|
|
@@ -73,7 +73,7 @@ function DialogFooter({ className, showCloseButton = false, children, ...props }
|
|
|
73
73
|
asChild: true,
|
|
74
74
|
children: /* @__PURE__ */ jsx(Button, {
|
|
75
75
|
variant: "outline",
|
|
76
|
-
children:
|
|
76
|
+
children: closeLabel
|
|
77
77
|
})
|
|
78
78
|
})]
|
|
79
79
|
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type PageHeaderProps = Omit<React.ComponentProps<'div'>, 'title'> & {
|
|
3
|
+
/** Page title, rendered as the page's `<h1>`. */
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
/** Optional supporting copy under the title. */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
/** Optional trailing actions (buttons, menus), aligned to the end of the row. */
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Title row of an app page: `<h1>` + optional description on the start side,
|
|
12
|
+
* optional actions on the end side (wrapping below on narrow screens).
|
|
13
|
+
* Outer spacing is the caller's job — pass it via `className`.
|
|
14
|
+
*/
|
|
15
|
+
declare function PageHeader({ title, description, actions, className, ...props }: PageHeaderProps): React.JSX.Element;
|
|
16
|
+
type PageHeaderSkeletonProps = React.ComponentProps<'div'> & {
|
|
17
|
+
/** Width class of the title bar. */
|
|
18
|
+
titleWidth?: string;
|
|
19
|
+
/** Width class of the description bar; `null` hides it. */
|
|
20
|
+
descriptionWidth?: string | null;
|
|
21
|
+
};
|
|
22
|
+
/** Loading placeholder whose dimensions mirror `PageHeader` (title + description). */
|
|
23
|
+
declare function PageHeaderSkeleton({ titleWidth, descriptionWidth, className, ...props }: PageHeaderSkeletonProps): React.JSX.Element;
|
|
24
|
+
export { PageHeader, type PageHeaderProps, PageHeaderSkeleton, type PageHeaderSkeletonProps };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Skeleton } from "./skeleton.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/page-header.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Title row of an app page: `<h1>` + optional description on the start side,
|
|
8
|
+
* optional actions on the end side (wrapping below on narrow screens).
|
|
9
|
+
* Outer spacing is the caller's job — pass it via `className`.
|
|
10
|
+
*/
|
|
11
|
+
function PageHeader({ title, description, actions, className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
"data-slot": "page-header",
|
|
14
|
+
className: cn("flex flex-wrap items-center justify-between gap-2", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "min-w-0 flex-1",
|
|
18
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
19
|
+
className: "text-xl font-semibold tracking-tight md:text-2xl",
|
|
20
|
+
children: title
|
|
21
|
+
}), description ? /* @__PURE__ */ jsx("p", {
|
|
22
|
+
"data-slot": "page-header-description",
|
|
23
|
+
className: "text-muted-foreground mt-1 text-sm md:text-base",
|
|
24
|
+
children: description
|
|
25
|
+
}) : null]
|
|
26
|
+
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"data-slot": "page-header-actions",
|
|
28
|
+
className: "flex flex-wrap items-center gap-2",
|
|
29
|
+
children: actions
|
|
30
|
+
}) : null]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Loading placeholder whose dimensions mirror `PageHeader` (title + description). */
|
|
34
|
+
function PageHeaderSkeleton({ titleWidth = "w-40", descriptionWidth = "w-64", className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
"data-slot": "page-header-skeleton",
|
|
37
|
+
className,
|
|
38
|
+
...props,
|
|
39
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: cn("h-6 md:h-7", titleWidth) }), descriptionWidth ? /* @__PURE__ */ jsx(Skeleton, { className: cn("mt-1 h-4 md:h-5", descriptionWidth) }) : null]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export { PageHeader, PageHeaderSkeleton };
|
|
@@ -3,7 +3,9 @@ import { Dialog } from "radix-ui";
|
|
|
3
3
|
declare function Sheet({ ...props }: React.ComponentProps<typeof Dialog.Root>): React.JSX.Element;
|
|
4
4
|
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof Dialog.Trigger>): React.JSX.Element;
|
|
5
5
|
declare function SheetClose({ ...props }: React.ComponentProps<typeof Dialog.Close>): React.JSX.Element;
|
|
6
|
-
declare function SheetContent({ className, children, side, showCloseButton, ...props }: React.ComponentProps<typeof Dialog.Content> & {
|
|
6
|
+
declare function SheetContent({ className, children, side, showCloseButton, closeLabel, ...props }: React.ComponentProps<typeof Dialog.Content> & {
|
|
7
|
+
/** Accessible label of the built-in close button. */
|
|
8
|
+
closeLabel?: string;
|
|
7
9
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
8
10
|
showCloseButton?: boolean;
|
|
9
11
|
}): React.JSX.Element;
|
package/dist/components/sheet.js
CHANGED
|
@@ -37,7 +37,7 @@ function SheetOverlay({ className, ...props }) {
|
|
|
37
37
|
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function SheetContent({ className, children, side = "right", showCloseButton = true, ...props }) {
|
|
40
|
+
function SheetContent({ className, children, side = "right", showCloseButton = true, closeLabel = "Close", ...props }) {
|
|
41
41
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
42
42
|
"data-slot": "sheet-content",
|
|
43
43
|
"data-side": side,
|
|
@@ -52,7 +52,7 @@ function SheetContent({ className, children, side = "right", showCloseButton = t
|
|
|
52
52
|
size: "icon-sm",
|
|
53
53
|
children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
54
54
|
className: "sr-only",
|
|
55
|
-
children:
|
|
55
|
+
children: closeLabel
|
|
56
56
|
})]
|
|
57
57
|
})
|
|
58
58
|
})]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const statusDotVariants: (props?: ({
|
|
4
|
-
tone?: "destructive" | "success" | "warning" | "info" | "
|
|
4
|
+
tone?: "muted" | "destructive" | "success" | "warning" | "info" | "neutral" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
type StatusDotProps = Omit<React.ComponentProps<'span'>, 'children'> & VariantProps<typeof statusDotVariants> & {
|
|
@@ -6,10 +6,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
const statusDotVariants = cva("relative inline-flex shrink-0 rounded-full", {
|
|
7
7
|
variants: {
|
|
8
8
|
tone: {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
neutral: "bg-muted-foreground/50",
|
|
10
|
+
success: "bg-success",
|
|
11
|
+
warning: "bg-warning",
|
|
11
12
|
destructive: "bg-destructive",
|
|
12
|
-
info: "bg-
|
|
13
|
+
info: "bg-info",
|
|
14
|
+
/** Alias of `neutral`, kept for compatibility. */
|
|
13
15
|
muted: "bg-muted-foreground/50"
|
|
14
16
|
},
|
|
15
17
|
size: {
|
|
@@ -29,7 +29,7 @@ declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeo
|
|
|
29
29
|
* "Atrasadas 2".
|
|
30
30
|
*/
|
|
31
31
|
declare const tabsCountVariants: (props?: ({
|
|
32
|
-
tone?: "
|
|
32
|
+
tone?: "destructive" | "default" | null | undefined;
|
|
33
33
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
34
34
|
declare function TabsCount({ className, tone, ...props }: React.ComponentProps<'span'> & VariantProps<typeof tabsCountVariants>): React.JSX.Element;
|
|
35
35
|
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type ThemeToggleLabels = {
|
|
3
|
+
/** Visible name of the light theme (`text` variant). */
|
|
4
|
+
light?: string;
|
|
5
|
+
/** Visible name of the dark theme (`text` variant). */
|
|
6
|
+
dark?: string;
|
|
7
|
+
/** Accessible label of the button when it switches to light. */
|
|
8
|
+
switchToLight?: string;
|
|
9
|
+
/** Accessible label of the button when it switches to dark. */
|
|
10
|
+
switchToDark?: string;
|
|
11
|
+
};
|
|
12
|
+
type ThemeToggleProps = Omit<React.ComponentProps<'button'>, 'children' | 'onClick'> & {
|
|
13
|
+
/** `icon`: ghost icon button (sun/moon). `text`: mono uppercase label + glyph. */
|
|
14
|
+
variant?: 'icon' | 'text';
|
|
15
|
+
labels?: ThemeToggleLabels;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Light/dark toggle wired to `next-themes` (mount the DS `ThemeProvider`).
|
|
19
|
+
* Renders a neutral placeholder until hydrated so SSR markup never mismatches.
|
|
20
|
+
*/
|
|
21
|
+
declare function ThemeToggle({ variant, labels, className, ...props }: ThemeToggleProps): React.JSX.Element;
|
|
22
|
+
export { ThemeToggle, type ThemeToggleLabels, type ThemeToggleProps };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { MoonIcon, SunIcon } from "lucide-react";
|
|
7
|
+
import { useTheme } from "next-themes";
|
|
8
|
+
// src/components/theme-toggle.tsx
|
|
9
|
+
const defaultLabels = {
|
|
10
|
+
light: "claro",
|
|
11
|
+
dark: "escuro",
|
|
12
|
+
switchToLight: "Mudar para o tema claro",
|
|
13
|
+
switchToDark: "Mudar para o tema escuro"
|
|
14
|
+
};
|
|
15
|
+
function useMounted() {
|
|
16
|
+
return React.useSyncExternalStore(() => () => {}, () => true, () => false);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Light/dark toggle wired to `next-themes` (mount the DS `ThemeProvider`).
|
|
20
|
+
* Renders a neutral placeholder until hydrated so SSR markup never mismatches.
|
|
21
|
+
*/
|
|
22
|
+
function ThemeToggle({ variant = "icon", labels, className, ...props }) {
|
|
23
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
24
|
+
const mounted = useMounted();
|
|
25
|
+
const l = {
|
|
26
|
+
...defaultLabels,
|
|
27
|
+
...labels
|
|
28
|
+
};
|
|
29
|
+
const isDark = mounted && resolvedTheme === "dark";
|
|
30
|
+
const next = isDark ? "light" : "dark";
|
|
31
|
+
const label = isDark ? l.switchToLight : l.switchToDark;
|
|
32
|
+
if (variant === "text") {
|
|
33
|
+
let text = "— — —";
|
|
34
|
+
if (mounted) text = isDark ? `${l.light} ☀` : `${l.dark} ☾`;
|
|
35
|
+
return /* @__PURE__ */ jsx("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
"data-slot": "theme-toggle",
|
|
38
|
+
"aria-label": label,
|
|
39
|
+
onClick: () => setTheme(next),
|
|
40
|
+
className: cn("text-muted-foreground hover:text-foreground focus-visible:text-foreground font-mono text-[0.7rem] tracking-[0.12em] uppercase transition-colors focus-visible:outline-none", className),
|
|
41
|
+
...props,
|
|
42
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "inline-block min-w-[3.5rem] text-right tabular-nums",
|
|
44
|
+
children: text
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
49
|
+
type: "button",
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
size: "icon",
|
|
52
|
+
"data-slot": "theme-toggle",
|
|
53
|
+
"aria-label": label,
|
|
54
|
+
onClick: () => setTheme(next),
|
|
55
|
+
className,
|
|
56
|
+
...props,
|
|
57
|
+
children: isDark ? /* @__PURE__ */ jsx(SunIcon, {}) : /* @__PURE__ */ jsx(MoonIcon, {})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export { ThemeToggle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const typographyVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "muted" | "blockquote" | "code" | "h1" | "h2" | "h3" | "h4" | "p" | "small" | "pageTitle" | "lead" | "large" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function Typography({ variant, as, className, ...props }: VariantProps<typeof typographyVariants> & {
|
|
7
7
|
as?: React.ElementType;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Button, buttonVariants } from "./components/button.js";
|
|
|
16
16
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "./components/button-group.js";
|
|
17
17
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card.js";
|
|
18
18
|
import { Checkbox } from "./components/checkbox.js";
|
|
19
|
+
import { Container, ContainerProps, containerVariants } from "./components/container.js";
|
|
19
20
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
20
21
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdown-menu.js";
|
|
21
22
|
import { EmptyState, EmptyStateProps } from "./components/empty-state.js";
|
|
@@ -29,6 +30,7 @@ import { InputGroup, InputGroupAddon, InputGroupInput } from "./components/input
|
|
|
29
30
|
import { Label } from "./components/label.js";
|
|
30
31
|
import { List, ListEmptyContent, ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, ListPaginationConfig, ListProps, ListSearchConfig, listItemVariants, listVariants } from "./components/list.js";
|
|
31
32
|
import { Main, mainVariants } from "./components/main.js";
|
|
33
|
+
import { PageHeader, PageHeaderProps, PageHeaderSkeleton, PageHeaderSkeletonProps } from "./components/page-header.js";
|
|
32
34
|
import { Pagination, PaginationProps } from "./components/pagination.js";
|
|
33
35
|
import { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
34
36
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/select.js";
|
|
@@ -41,6 +43,7 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
41
43
|
import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
|
|
42
44
|
import { Textarea } from "./components/textarea.js";
|
|
43
45
|
import { ThemeProvider } from "./components/theme-provider.js";
|
|
46
|
+
import { ThemeToggle, ThemeToggleLabels, ThemeToggleProps } from "./components/theme-toggle.js";
|
|
44
47
|
import { Typography, typographyVariants } from "./components/typography.js";
|
|
45
48
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
|
|
46
49
|
import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
|
|
@@ -56,4 +59,4 @@ import { ElementSize, useElementSize } from "./hooks/use-element-size.js";
|
|
|
56
59
|
import { HashSection, useHashSection } from "./hooks/use-hash-section.js";
|
|
57
60
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
58
61
|
import { ScrollStripEdges, useScrollStrip } from "./hooks/use-scroll-strip.js";
|
|
59
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellNavLink, type AppShellProps, AuthSplitScreen, type AuthSplitScreenProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BrandIconProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DateField, type DateFieldProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ElementSize, EmptyState, type EmptyStateProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, type HashSection, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, type ListEmptyContent, type ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, type ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, type ListPaginationConfig, type ListProps, type ListSearchConfig, Main, type NavItem, type NavMatch, type NavSection, Pagination, type PaginationProps, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, type ScrollStripEdges, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, type StatusDotProps, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, type UserMenuProps, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
|
62
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, type AppShellNavLink, type AppShellProps, AuthSplitScreen, type AuthSplitScreenProps, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BrandIconProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Container, type ContainerProps, DateField, type DateFieldProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type ElementSize, EmptyState, type EmptyStateProps, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, type HashSection, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, type ListEmptyContent, type ListFilterConfig, ListItem, ListItemActions, ListItemContent, ListItemDescription, type ListItemDescriptor, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, type ListPaginationConfig, type ListProps, type ListSearchConfig, Main, type NavItem, type NavMatch, type NavSection, PageHeader, type PageHeaderProps, PageHeaderSkeleton, type PageHeaderSkeletonProps, Pagination, type PaginationProps, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, type ScrollStripEdges, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, type StatusDotProps, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeToggle, type ThemeToggleLabels, type ThemeToggleProps, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, type UserMenuProps, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { Button, buttonVariants } from "./components/button.js";
|
|
|
14
14
|
import { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants } from "./components/button-group.js";
|
|
15
15
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card.js";
|
|
16
16
|
import { Checkbox } from "./components/checkbox.js";
|
|
17
|
+
import { Container, containerVariants } from "./components/container.js";
|
|
17
18
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/dialog.js";
|
|
18
19
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/dropdown-menu.js";
|
|
19
20
|
import { EmptyState } from "./components/empty-state.js";
|
|
@@ -26,6 +27,7 @@ import { InputGroup, InputGroupAddon, InputGroupInput } from "./components/input
|
|
|
26
27
|
import { Label } from "./components/label.js";
|
|
27
28
|
import { List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, listItemVariants, listVariants } from "./components/list.js";
|
|
28
29
|
import { Main, mainVariants } from "./components/main.js";
|
|
30
|
+
import { PageHeader, PageHeaderSkeleton } from "./components/page-header.js";
|
|
29
31
|
import { Pagination } from "./components/pagination.js";
|
|
30
32
|
import { RadioGroup, RadioGroupItem } from "./components/radio-group.js";
|
|
31
33
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/select.js";
|
|
@@ -38,6 +40,7 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
38
40
|
import { Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, tabsListVariants } from "./components/tabs.js";
|
|
39
41
|
import { Textarea } from "./components/textarea.js";
|
|
40
42
|
import { ThemeProvider } from "./components/theme-provider.js";
|
|
43
|
+
import { ThemeToggle } from "./components/theme-toggle.js";
|
|
41
44
|
import { Typography, typographyVariants } from "./components/typography.js";
|
|
42
45
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./components/collapsible.js";
|
|
43
46
|
import { Popover, PopoverContent, PopoverTrigger } from "./components/popover.js";
|
|
@@ -54,4 +57,4 @@ import { useElementSize } from "./hooks/use-element-size.js";
|
|
|
54
57
|
import { useHashSection } from "./hooks/use-hash-section.js";
|
|
55
58
|
import { useIsMobile } from "./hooks/use-mobile.js";
|
|
56
59
|
import { useScrollStrip } from "./hooks/use-scroll-strip.js";
|
|
57
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, AuthSplitScreen, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DateField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, Main, Pagination, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
|
60
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppShell, AuthSplitScreen, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Container, DateField, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GoogleIcon, HighlightedTextarea, Input, InputGroup, InputGroupAddon, InputGroupInput, Label, List, ListItem, ListItemActions, ListItemContent, ListItemDescription, ListItemLeading, ListItemMedia, ListItemMeta, ListItemTitle, ListItemTrailing, Main, PageHeader, PageHeaderSkeleton, Pagination, Popover, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingRow, SettingRowGroup, SettingsDialog, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, StatusDot, Stepper, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsCount, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeToggle, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, UserMenu, WhatsappIcon, badgeVariants, buttonGroupVariants, buttonVariants, cn, containerVariants, hasActiveChild as hasActiveNavChild, initials, isActive as isNavItemActive, listItemVariants, listVariants, mainVariants, statusDotVariants, tabsListVariants, typographyVariants, useElementSize, useHashSection, useIsMobile, useScrollStrip, useSidebar, userMenuInitials };
|
package/dist/tokens.css
CHANGED
|
@@ -58,6 +58,26 @@
|
|
|
58
58
|
/* Verde WhatsApp — token funcional (não-de-marca) usado em CTAs de contato. */
|
|
59
59
|
--wa: oklch(0.64 0.155 152);
|
|
60
60
|
--wa-foreground: oklch(0.99 0 0);
|
|
61
|
+
/*
|
|
62
|
+
* Semantic status/finance tokens (contrast checked for WCAG AA: >= 4.5:1
|
|
63
|
+
* for each foreground pair, and for `positive`/`negative` text on page and
|
|
64
|
+
* card). `*-muted` are soft fills for banners/badges, read with
|
|
65
|
+
* `*-muted-foreground`.
|
|
66
|
+
*/
|
|
67
|
+
--success: oklch(0.527 0.154 150.069);
|
|
68
|
+
--success-foreground: oklch(0.985 0 0);
|
|
69
|
+
--success-muted: oklch(0.962 0.044 156.743);
|
|
70
|
+
--success-muted-foreground: oklch(0.448 0.119 151.328);
|
|
71
|
+
--warning: oklch(0.769 0.188 70.08);
|
|
72
|
+
--warning-foreground: oklch(0.279 0.077 45.635);
|
|
73
|
+
--warning-muted: oklch(0.962 0.059 95.617);
|
|
74
|
+
--warning-muted-foreground: oklch(0.473 0.137 46.201);
|
|
75
|
+
--info: oklch(0.5 0.134 242.749);
|
|
76
|
+
--info-foreground: oklch(0.985 0 0);
|
|
77
|
+
--info-muted: oklch(0.951 0.026 236.824);
|
|
78
|
+
--info-muted-foreground: oklch(0.443 0.11 240.79);
|
|
79
|
+
--positive: oklch(0.527 0.154 150.069);
|
|
80
|
+
--negative: oklch(0.577 0.245 27.325);
|
|
61
81
|
}
|
|
62
82
|
|
|
63
83
|
.dark {
|
|
@@ -96,6 +116,20 @@
|
|
|
96
116
|
|
|
97
117
|
--wa: oklch(0.68 0.16 152);
|
|
98
118
|
--wa-foreground: oklch(0.99 0 0);
|
|
119
|
+
--success: oklch(0.723 0.219 149.579);
|
|
120
|
+
--success-foreground: oklch(0.145 0 0);
|
|
121
|
+
--success-muted: oklch(0.266 0.065 152.934);
|
|
122
|
+
--success-muted-foreground: oklch(0.871 0.15 154.449);
|
|
123
|
+
--warning: oklch(0.828 0.189 84.429);
|
|
124
|
+
--warning-foreground: oklch(0.145 0 0);
|
|
125
|
+
--warning-muted: oklch(0.279 0.077 45.635);
|
|
126
|
+
--warning-muted-foreground: oklch(0.879 0.169 91.605);
|
|
127
|
+
--info: oklch(0.746 0.16 232.661);
|
|
128
|
+
--info-foreground: oklch(0.145 0 0);
|
|
129
|
+
--info-muted: oklch(0.293 0.066 243.157);
|
|
130
|
+
--info-muted-foreground: oklch(0.828 0.111 230.318);
|
|
131
|
+
--positive: oklch(0.792 0.209 151.711);
|
|
132
|
+
--negative: oklch(0.704 0.191 22.216);
|
|
99
133
|
}
|
|
100
134
|
|
|
101
135
|
/*
|
|
@@ -168,6 +202,20 @@
|
|
|
168
202
|
--color-background: var(--background);
|
|
169
203
|
--color-wa: var(--wa);
|
|
170
204
|
--color-wa-foreground: var(--wa-foreground);
|
|
205
|
+
--color-success: var(--success);
|
|
206
|
+
--color-success-foreground: var(--success-foreground);
|
|
207
|
+
--color-success-muted: var(--success-muted);
|
|
208
|
+
--color-success-muted-foreground: var(--success-muted-foreground);
|
|
209
|
+
--color-warning: var(--warning);
|
|
210
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
211
|
+
--color-warning-muted: var(--warning-muted);
|
|
212
|
+
--color-warning-muted-foreground: var(--warning-muted-foreground);
|
|
213
|
+
--color-info: var(--info);
|
|
214
|
+
--color-info-foreground: var(--info-foreground);
|
|
215
|
+
--color-info-muted: var(--info-muted);
|
|
216
|
+
--color-info-muted-foreground: var(--info-muted-foreground);
|
|
217
|
+
--color-positive: var(--positive);
|
|
218
|
+
--color-negative: var(--negative);
|
|
171
219
|
--radius-sm: calc(var(--radius) * 0.6);
|
|
172
220
|
--radius-md: calc(var(--radius) * 0.8);
|
|
173
221
|
--radius-lg: var(--radius);
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Light-theme color tokens as plain values, for places CSS custom properties
|
|
3
|
+
* do not reach (OG images, emails, canvas). Mirrors `:root` in `tokens.css`;
|
|
4
|
+
* `tokens.test.ts` keeps both in sync.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tokens: {
|
|
7
|
+
readonly background: {
|
|
8
|
+
readonly oklch: "oklch(0.985 0 0)";
|
|
9
|
+
readonly hex: "#fafafa";
|
|
10
|
+
};
|
|
11
|
+
readonly foreground: {
|
|
12
|
+
readonly oklch: "oklch(0.145 0 0)";
|
|
13
|
+
readonly hex: "#0a0a0a";
|
|
14
|
+
};
|
|
15
|
+
readonly card: {
|
|
16
|
+
readonly oklch: "oklch(1 0 0)";
|
|
17
|
+
readonly hex: "#ffffff";
|
|
18
|
+
};
|
|
19
|
+
readonly cardForeground: {
|
|
20
|
+
readonly oklch: "oklch(0.145 0 0)";
|
|
21
|
+
readonly hex: "#0a0a0a";
|
|
22
|
+
};
|
|
23
|
+
readonly popover: {
|
|
24
|
+
readonly oklch: "oklch(1 0 0)";
|
|
25
|
+
readonly hex: "#ffffff";
|
|
26
|
+
};
|
|
27
|
+
readonly popoverForeground: {
|
|
28
|
+
readonly oklch: "oklch(0.145 0 0)";
|
|
29
|
+
readonly hex: "#0a0a0a";
|
|
30
|
+
};
|
|
31
|
+
readonly primary: {
|
|
32
|
+
readonly oklch: "oklch(0.205 0 0)";
|
|
33
|
+
readonly hex: "#171717";
|
|
34
|
+
};
|
|
35
|
+
readonly primaryForeground: {
|
|
36
|
+
readonly oklch: "oklch(0.985 0 0)";
|
|
37
|
+
readonly hex: "#fafafa";
|
|
38
|
+
};
|
|
39
|
+
readonly secondary: {
|
|
40
|
+
readonly oklch: "oklch(0.97 0 0)";
|
|
41
|
+
readonly hex: "#f5f5f5";
|
|
42
|
+
};
|
|
43
|
+
readonly secondaryForeground: {
|
|
44
|
+
readonly oklch: "oklch(0.205 0 0)";
|
|
45
|
+
readonly hex: "#171717";
|
|
46
|
+
};
|
|
47
|
+
readonly muted: {
|
|
48
|
+
readonly oklch: "oklch(0.97 0 0)";
|
|
49
|
+
readonly hex: "#f5f5f5";
|
|
50
|
+
};
|
|
51
|
+
readonly mutedForeground: {
|
|
52
|
+
readonly oklch: "oklch(0.556 0 0)";
|
|
53
|
+
readonly hex: "#737373";
|
|
54
|
+
};
|
|
55
|
+
readonly accent: {
|
|
56
|
+
readonly oklch: "oklch(0.97 0 0)";
|
|
57
|
+
readonly hex: "#f5f5f5";
|
|
58
|
+
};
|
|
59
|
+
readonly accentForeground: {
|
|
60
|
+
readonly oklch: "oklch(0.205 0 0)";
|
|
61
|
+
readonly hex: "#171717";
|
|
62
|
+
};
|
|
63
|
+
readonly destructive: {
|
|
64
|
+
readonly oklch: "oklch(0.577 0.245 27.325)";
|
|
65
|
+
readonly hex: "#e7000b";
|
|
66
|
+
};
|
|
67
|
+
readonly border: {
|
|
68
|
+
readonly oklch: "oklch(0.922 0 0)";
|
|
69
|
+
readonly hex: "#e5e5e5";
|
|
70
|
+
};
|
|
71
|
+
readonly input: {
|
|
72
|
+
readonly oklch: "oklch(0.922 0 0)";
|
|
73
|
+
readonly hex: "#e5e5e5";
|
|
74
|
+
};
|
|
75
|
+
readonly ring: {
|
|
76
|
+
readonly oklch: "oklch(0.708 0 0)";
|
|
77
|
+
readonly hex: "#a1a1a1";
|
|
78
|
+
};
|
|
79
|
+
readonly wa: {
|
|
80
|
+
readonly oklch: "oklch(0.64 0.155 152)";
|
|
81
|
+
readonly hex: "#26a65a";
|
|
82
|
+
};
|
|
83
|
+
readonly waForeground: {
|
|
84
|
+
readonly oklch: "oklch(0.99 0 0)";
|
|
85
|
+
readonly hex: "#fcfcfc";
|
|
86
|
+
};
|
|
87
|
+
readonly success: {
|
|
88
|
+
readonly oklch: "oklch(0.527 0.154 150.069)";
|
|
89
|
+
readonly hex: "#008236";
|
|
90
|
+
};
|
|
91
|
+
readonly successForeground: {
|
|
92
|
+
readonly oklch: "oklch(0.985 0 0)";
|
|
93
|
+
readonly hex: "#fafafa";
|
|
94
|
+
};
|
|
95
|
+
readonly successMuted: {
|
|
96
|
+
readonly oklch: "oklch(0.962 0.044 156.743)";
|
|
97
|
+
readonly hex: "#dcfce7";
|
|
98
|
+
};
|
|
99
|
+
readonly successMutedForeground: {
|
|
100
|
+
readonly oklch: "oklch(0.448 0.119 151.328)";
|
|
101
|
+
readonly hex: "#016630";
|
|
102
|
+
};
|
|
103
|
+
readonly warning: {
|
|
104
|
+
readonly oklch: "oklch(0.769 0.188 70.08)";
|
|
105
|
+
readonly hex: "#fe9a00";
|
|
106
|
+
};
|
|
107
|
+
readonly warningForeground: {
|
|
108
|
+
readonly oklch: "oklch(0.279 0.077 45.635)";
|
|
109
|
+
readonly hex: "#461901";
|
|
110
|
+
};
|
|
111
|
+
readonly warningMuted: {
|
|
112
|
+
readonly oklch: "oklch(0.962 0.059 95.617)";
|
|
113
|
+
readonly hex: "#fef3c6";
|
|
114
|
+
};
|
|
115
|
+
readonly warningMutedForeground: {
|
|
116
|
+
readonly oklch: "oklch(0.473 0.137 46.201)";
|
|
117
|
+
readonly hex: "#973c00";
|
|
118
|
+
};
|
|
119
|
+
readonly info: {
|
|
120
|
+
readonly oklch: "oklch(0.5 0.134 242.749)";
|
|
121
|
+
readonly hex: "#0069a8";
|
|
122
|
+
};
|
|
123
|
+
readonly infoForeground: {
|
|
124
|
+
readonly oklch: "oklch(0.985 0 0)";
|
|
125
|
+
readonly hex: "#fafafa";
|
|
126
|
+
};
|
|
127
|
+
readonly infoMuted: {
|
|
128
|
+
readonly oklch: "oklch(0.951 0.026 236.824)";
|
|
129
|
+
readonly hex: "#dff2fe";
|
|
130
|
+
};
|
|
131
|
+
readonly infoMutedForeground: {
|
|
132
|
+
readonly oklch: "oklch(0.443 0.11 240.79)";
|
|
133
|
+
readonly hex: "#00598a";
|
|
134
|
+
};
|
|
135
|
+
readonly positive: {
|
|
136
|
+
readonly oklch: "oklch(0.527 0.154 150.069)";
|
|
137
|
+
readonly hex: "#008236";
|
|
138
|
+
};
|
|
139
|
+
readonly negative: {
|
|
140
|
+
readonly oklch: "oklch(0.577 0.245 27.325)";
|
|
141
|
+
readonly hex: "#e7000b";
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export type TokenName = keyof typeof tokens;
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// src/tokens.ts
|
|
2
|
+
/**
|
|
3
|
+
* Light-theme color tokens as plain values, for places CSS custom properties
|
|
4
|
+
* do not reach (OG images, emails, canvas). Mirrors `:root` in `tokens.css`;
|
|
5
|
+
* `tokens.test.ts` keeps both in sync.
|
|
6
|
+
*/
|
|
7
|
+
const tokens = {
|
|
8
|
+
background: {
|
|
9
|
+
oklch: "oklch(0.985 0 0)",
|
|
10
|
+
hex: "#fafafa"
|
|
11
|
+
},
|
|
12
|
+
foreground: {
|
|
13
|
+
oklch: "oklch(0.145 0 0)",
|
|
14
|
+
hex: "#0a0a0a"
|
|
15
|
+
},
|
|
16
|
+
card: {
|
|
17
|
+
oklch: "oklch(1 0 0)",
|
|
18
|
+
hex: "#ffffff"
|
|
19
|
+
},
|
|
20
|
+
cardForeground: {
|
|
21
|
+
oklch: "oklch(0.145 0 0)",
|
|
22
|
+
hex: "#0a0a0a"
|
|
23
|
+
},
|
|
24
|
+
popover: {
|
|
25
|
+
oklch: "oklch(1 0 0)",
|
|
26
|
+
hex: "#ffffff"
|
|
27
|
+
},
|
|
28
|
+
popoverForeground: {
|
|
29
|
+
oklch: "oklch(0.145 0 0)",
|
|
30
|
+
hex: "#0a0a0a"
|
|
31
|
+
},
|
|
32
|
+
primary: {
|
|
33
|
+
oklch: "oklch(0.205 0 0)",
|
|
34
|
+
hex: "#171717"
|
|
35
|
+
},
|
|
36
|
+
primaryForeground: {
|
|
37
|
+
oklch: "oklch(0.985 0 0)",
|
|
38
|
+
hex: "#fafafa"
|
|
39
|
+
},
|
|
40
|
+
secondary: {
|
|
41
|
+
oklch: "oklch(0.97 0 0)",
|
|
42
|
+
hex: "#f5f5f5"
|
|
43
|
+
},
|
|
44
|
+
secondaryForeground: {
|
|
45
|
+
oklch: "oklch(0.205 0 0)",
|
|
46
|
+
hex: "#171717"
|
|
47
|
+
},
|
|
48
|
+
muted: {
|
|
49
|
+
oklch: "oklch(0.97 0 0)",
|
|
50
|
+
hex: "#f5f5f5"
|
|
51
|
+
},
|
|
52
|
+
mutedForeground: {
|
|
53
|
+
oklch: "oklch(0.556 0 0)",
|
|
54
|
+
hex: "#737373"
|
|
55
|
+
},
|
|
56
|
+
accent: {
|
|
57
|
+
oklch: "oklch(0.97 0 0)",
|
|
58
|
+
hex: "#f5f5f5"
|
|
59
|
+
},
|
|
60
|
+
accentForeground: {
|
|
61
|
+
oklch: "oklch(0.205 0 0)",
|
|
62
|
+
hex: "#171717"
|
|
63
|
+
},
|
|
64
|
+
destructive: {
|
|
65
|
+
oklch: "oklch(0.577 0.245 27.325)",
|
|
66
|
+
hex: "#e7000b"
|
|
67
|
+
},
|
|
68
|
+
border: {
|
|
69
|
+
oklch: "oklch(0.922 0 0)",
|
|
70
|
+
hex: "#e5e5e5"
|
|
71
|
+
},
|
|
72
|
+
input: {
|
|
73
|
+
oklch: "oklch(0.922 0 0)",
|
|
74
|
+
hex: "#e5e5e5"
|
|
75
|
+
},
|
|
76
|
+
ring: {
|
|
77
|
+
oklch: "oklch(0.708 0 0)",
|
|
78
|
+
hex: "#a1a1a1"
|
|
79
|
+
},
|
|
80
|
+
wa: {
|
|
81
|
+
oklch: "oklch(0.64 0.155 152)",
|
|
82
|
+
hex: "#26a65a"
|
|
83
|
+
},
|
|
84
|
+
waForeground: {
|
|
85
|
+
oklch: "oklch(0.99 0 0)",
|
|
86
|
+
hex: "#fcfcfc"
|
|
87
|
+
},
|
|
88
|
+
success: {
|
|
89
|
+
oklch: "oklch(0.527 0.154 150.069)",
|
|
90
|
+
hex: "#008236"
|
|
91
|
+
},
|
|
92
|
+
successForeground: {
|
|
93
|
+
oklch: "oklch(0.985 0 0)",
|
|
94
|
+
hex: "#fafafa"
|
|
95
|
+
},
|
|
96
|
+
successMuted: {
|
|
97
|
+
oklch: "oklch(0.962 0.044 156.743)",
|
|
98
|
+
hex: "#dcfce7"
|
|
99
|
+
},
|
|
100
|
+
successMutedForeground: {
|
|
101
|
+
oklch: "oklch(0.448 0.119 151.328)",
|
|
102
|
+
hex: "#016630"
|
|
103
|
+
},
|
|
104
|
+
warning: {
|
|
105
|
+
oklch: "oklch(0.769 0.188 70.08)",
|
|
106
|
+
hex: "#fe9a00"
|
|
107
|
+
},
|
|
108
|
+
warningForeground: {
|
|
109
|
+
oklch: "oklch(0.279 0.077 45.635)",
|
|
110
|
+
hex: "#461901"
|
|
111
|
+
},
|
|
112
|
+
warningMuted: {
|
|
113
|
+
oklch: "oklch(0.962 0.059 95.617)",
|
|
114
|
+
hex: "#fef3c6"
|
|
115
|
+
},
|
|
116
|
+
warningMutedForeground: {
|
|
117
|
+
oklch: "oklch(0.473 0.137 46.201)",
|
|
118
|
+
hex: "#973c00"
|
|
119
|
+
},
|
|
120
|
+
info: {
|
|
121
|
+
oklch: "oklch(0.5 0.134 242.749)",
|
|
122
|
+
hex: "#0069a8"
|
|
123
|
+
},
|
|
124
|
+
infoForeground: {
|
|
125
|
+
oklch: "oklch(0.985 0 0)",
|
|
126
|
+
hex: "#fafafa"
|
|
127
|
+
},
|
|
128
|
+
infoMuted: {
|
|
129
|
+
oklch: "oklch(0.951 0.026 236.824)",
|
|
130
|
+
hex: "#dff2fe"
|
|
131
|
+
},
|
|
132
|
+
infoMutedForeground: {
|
|
133
|
+
oklch: "oklch(0.443 0.11 240.79)",
|
|
134
|
+
hex: "#00598a"
|
|
135
|
+
},
|
|
136
|
+
positive: {
|
|
137
|
+
oklch: "oklch(0.527 0.154 150.069)",
|
|
138
|
+
hex: "#008236"
|
|
139
|
+
},
|
|
140
|
+
negative: {
|
|
141
|
+
oklch: "oklch(0.577 0.245 27.325)",
|
|
142
|
+
hex: "#e7000b"
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
export { tokens };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cbrl/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Design system on Radix + Tailwind v4: shadcn-style components, layout shells and design tokens with an overridable brand accent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Kayron Cabral",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": "./dist/index.js",
|
|
29
29
|
"./form": "./dist/form.js",
|
|
30
|
+
"./tokens": "./dist/tokens.js",
|
|
30
31
|
"./package.json": "./package.json",
|
|
31
32
|
"./globals.css": "./dist/globals.css",
|
|
32
33
|
"./tokens.css": "./dist/tokens.css",
|