@voila.dev/ui 1.1.9 → 1.1.10
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/package.json
CHANGED
|
@@ -16,9 +16,9 @@ export const badgeVariants = cva({
|
|
|
16
16
|
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
17
17
|
secondary:
|
|
18
18
|
"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"bg-
|
|
19
|
+
brand: "bg-brand text-brand-foreground [a]:hover:bg-brand/90",
|
|
20
|
+
highlight:
|
|
21
|
+
"bg-highlight text-highlight-foreground [a]:hover:bg-highlight/90",
|
|
22
22
|
destructive:
|
|
23
23
|
"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",
|
|
24
24
|
outline:
|
|
@@ -155,8 +155,8 @@ export const badgeColorForegroundClass: Record<BadgeColor, string> = {
|
|
|
155
155
|
export const badgeVariantOptions = [
|
|
156
156
|
"default",
|
|
157
157
|
"secondary",
|
|
158
|
-
"
|
|
159
|
-
"
|
|
158
|
+
"brand",
|
|
159
|
+
"highlight",
|
|
160
160
|
"destructive",
|
|
161
161
|
"outline",
|
|
162
162
|
"ghost",
|
|
@@ -7,7 +7,7 @@ import { cva, type VariantProps } from "#/lib/cva.ts";
|
|
|
7
7
|
* tailwind-merge-configured `cva` (see `#/lib/cva.ts`).
|
|
8
8
|
*
|
|
9
9
|
* Variant colors map to the design tokens: `default` (primary, black),
|
|
10
|
-
* `
|
|
10
|
+
* `brand` (violet), `highlight` (teal), plus the neutral/utility roles.
|
|
11
11
|
* `primary` is an alias of `default` for the marketing site, whose buttons
|
|
12
12
|
* default to the `primary` variant name.
|
|
13
13
|
*
|
|
@@ -18,7 +18,7 @@ import { cva, type VariantProps } from "#/lib/cva.ts";
|
|
|
18
18
|
export const buttonVariants = cva({
|
|
19
19
|
base: "group/button inline-flex shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
20
20
|
variants: {
|
|
21
|
-
// Solid variants (default/primary/
|
|
21
|
+
// Solid variants (default/primary/brand/highlight) only hover when
|
|
22
22
|
// rendered as an anchor ([a]:hover) - a plain <button> is usually the
|
|
23
23
|
// page's primary action and gets its feedback from active:translate-y-px
|
|
24
24
|
// instead, so it stays inert under the cursor. The neutral/utility roles
|
|
@@ -29,9 +29,9 @@ export const buttonVariants = cva({
|
|
|
29
29
|
primary: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
30
30
|
secondary:
|
|
31
31
|
"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"bg-
|
|
32
|
+
brand: "bg-brand text-brand-foreground [a]:hover:bg-brand/90",
|
|
33
|
+
highlight:
|
|
34
|
+
"bg-highlight text-highlight-foreground [a]:hover:bg-highlight/90",
|
|
35
35
|
outline:
|
|
36
36
|
"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
37
37
|
ghost:
|
|
@@ -79,8 +79,8 @@ export const buttonVariantOptions = [
|
|
|
79
79
|
"default",
|
|
80
80
|
"primary",
|
|
81
81
|
"secondary",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
82
|
+
"brand",
|
|
83
|
+
"highlight",
|
|
84
84
|
"outline",
|
|
85
85
|
"ghost",
|
|
86
86
|
"destructive",
|
|
@@ -3,12 +3,12 @@ import * as React from "react";
|
|
|
3
3
|
import { Input } from "#/components/ui/input.tsx";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Ready-made digit masks for common identifier fields. `#` is a digit
|
|
7
7
|
* slot; any other character is a literal separator inserted while typing.
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const idNumberMask = "###########";
|
|
10
|
+
const businessIdMask = "### ### ### #####";
|
|
11
|
+
const phoneMask = "## ## ## ## ##";
|
|
12
12
|
|
|
13
13
|
function countDigitSlots(mask: string): number {
|
|
14
14
|
let count = 0;
|
|
@@ -128,7 +128,7 @@ type FormattedInputProps = Omit<
|
|
|
128
128
|
React.ComponentProps<typeof Input>,
|
|
129
129
|
"value" | "defaultValue" | "onValueChange" | "type"
|
|
130
130
|
> & {
|
|
131
|
-
/** Digit mask, e.g. `"### ### ### #####"` for
|
|
131
|
+
/** Digit mask, e.g. `"### ### ### #####"` for a business id. `#` marks a digit slot. */
|
|
132
132
|
mask: string;
|
|
133
133
|
/** Raw digits (unformatted). */
|
|
134
134
|
value?: string;
|
|
@@ -211,9 +211,9 @@ function FormattedInput({
|
|
|
211
211
|
|
|
212
212
|
export {
|
|
213
213
|
applyMask,
|
|
214
|
+
businessIdMask,
|
|
214
215
|
FormattedInput,
|
|
215
216
|
type FormattedInputProps,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
siretMask,
|
|
217
|
+
idNumberMask,
|
|
218
|
+
phoneMask,
|
|
219
219
|
};
|
|
@@ -8,18 +8,18 @@ import {
|
|
|
8
8
|
import { getInitials } from "#/components/ui/user-avatar.tsx";
|
|
9
9
|
import { cn } from "#/lib/utils.ts";
|
|
10
10
|
|
|
11
|
-
type ProfileTheme = "
|
|
11
|
+
type ProfileTheme = "brand" | "highlight";
|
|
12
12
|
|
|
13
13
|
// `theme` coordinates the themed children (cover gradient, avatar ring) off
|
|
14
14
|
// the `data-theme` attribute their group root emits.
|
|
15
15
|
|
|
16
16
|
/** Themed cover gradient used when no `coverImage` is supplied. */
|
|
17
17
|
const coverGradientClasses =
|
|
18
|
-
"bg-gradient-to-br group-data-[theme=
|
|
18
|
+
"bg-gradient-to-br group-data-[theme=highlight]/profile-header-cover:from-highlight group-data-[theme=highlight]/profile-header-cover:via-highlight/80 group-data-[theme=highlight]/profile-header-cover:to-highlight/40 group-data-[theme=brand]/profile-header-cover:from-brand group-data-[theme=brand]/profile-header-cover:via-brand/80 group-data-[theme=brand]/profile-header-cover:to-brand/40";
|
|
19
19
|
|
|
20
20
|
/** Ring color that frames the overlapping avatar, matched to the theme. */
|
|
21
21
|
const avatarRingClasses =
|
|
22
|
-
"group-data-[theme=
|
|
22
|
+
"group-data-[theme=highlight]/profile-header:ring-highlight/20 group-data-[theme=brand]/profile-header:ring-brand/20";
|
|
23
23
|
|
|
24
24
|
type ProfileHeaderAvatar = { src?: string; name?: string };
|
|
25
25
|
|
|
@@ -36,7 +36,7 @@ function isAvatarDescriptor(
|
|
|
36
36
|
/** Cover band — renders a `coverImage` (node or src) or a themed gradient. */
|
|
37
37
|
function ProfileHeaderCover({
|
|
38
38
|
coverImage,
|
|
39
|
-
theme = "
|
|
39
|
+
theme = "brand",
|
|
40
40
|
className,
|
|
41
41
|
children,
|
|
42
42
|
...props
|
|
@@ -78,7 +78,7 @@ function ProfileHeaderCover({
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* Hero band for a
|
|
81
|
+
* Hero band for a freelancer or client profile: a themed cover, an
|
|
82
82
|
* overlapping circular avatar, name + optional headline, a trust-badge row
|
|
83
83
|
* and a right-aligned actions slot. Composable — the cover/body sub-parts are
|
|
84
84
|
* exported so consumers can rebuild a custom hero when needed.
|
|
@@ -88,7 +88,7 @@ function ProfileHeader({
|
|
|
88
88
|
headline,
|
|
89
89
|
coverImage,
|
|
90
90
|
avatar,
|
|
91
|
-
theme = "
|
|
91
|
+
theme = "brand",
|
|
92
92
|
badges,
|
|
93
93
|
actions,
|
|
94
94
|
className,
|