@hemia/lume-registry 0.0.1 → 0.0.3
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 +1 -1
- package/registry/vue/alert/alert.vue +7 -7
- package/registry/vue/alertdialog/alertdialog-content.vue +1 -1
- package/registry/vue/alertdialog/alertdialog-footer.vue +1 -1
- package/registry/vue/badge/badge.vue +7 -7
- package/registry/vue/button/button.vue +15 -15
- package/registry/vue/card/card-footer.vue +1 -1
- package/registry/vue/field/field-description.vue +1 -1
- package/registry/vue/field/field-group.vue +1 -1
- package/registry/vue/field/field-separator.vue +1 -1
- package/registry/vue/textfield/textfield.vue +22 -25
package/package.json
CHANGED
|
@@ -4,21 +4,21 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
4
4
|
import { cn } from "@hemia/lume-vue"
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
7
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-lume-foreground",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-muted/50 text-foreground border-border",
|
|
11
|
+
default: "bg-lume-muted/50 text-lume-foreground border-lume-border",
|
|
12
12
|
destructive:
|
|
13
|
-
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive bg-destructive/10 dark:bg-destructive/20",
|
|
13
|
+
"border-lume-destructive/50 text-lume-destructive dark:border-lume-destructive [&>svg]:text-lume-destructive bg-lume-destructive/10 dark:bg-lume-destructive/20",
|
|
14
14
|
tonal:
|
|
15
|
-
"border-transparent bg-destructive/10 text-destructive dark:bg-destructive/30 dark:text-destructive-200",
|
|
15
|
+
"border-transparent bg-lume-destructive/10 text-lume-destructive dark:bg-lume-destructive/30 dark:text-lume-destructive-200",
|
|
16
16
|
success:
|
|
17
|
-
"
|
|
17
|
+
"bg-green-50 border-green-200/50 text-green-800 dark:bg-green-900/30 dark:text-green-200 dark:border-green-800/50",
|
|
18
18
|
warning:
|
|
19
|
-
"
|
|
19
|
+
"bg-amber-50 border-amber-200/50 text-amber-800 dark:bg-amber-900/30 dark:text-amber-200 dark:border-amber-800/50",
|
|
20
20
|
info:
|
|
21
|
-
"
|
|
21
|
+
"bg-blue-50 border-blue-200/50 text-blue-800 dark:bg-blue-900/30 dark:text-blue-200 dark:border-blue-800/50",
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
defaultVariants: {
|
|
@@ -65,7 +65,7 @@ const isCentered = computed(() => props.size === 'sm')
|
|
|
65
65
|
>
|
|
66
66
|
<div
|
|
67
67
|
v-if="isOpen"
|
|
68
|
-
class="fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-0 border bg-background shadow-lg duration-200 sm:rounded-lg"
|
|
68
|
+
class="fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-0 border bg-lume-background shadow-lg duration-200 sm:rounded-lg"
|
|
69
69
|
:class="cn(sizeClasses, isCentered && 'text-center', props.class)"
|
|
70
70
|
>
|
|
71
71
|
<slot />
|
|
@@ -24,7 +24,7 @@ const isSm = computed(() => size === 'sm')
|
|
|
24
24
|
isSm
|
|
25
25
|
? 'flex-col-reverse'
|
|
26
26
|
: 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
|
|
27
|
-
'bg-muted/50 rounded-b-lg px-6 py-4 dark:bg-muted/30',
|
|
27
|
+
'bg-lume-muted/50 rounded-b-lg px-6 py-4 dark:bg-lume-muted/30',
|
|
28
28
|
isSm && 'grid grid-cols-2 gap-2',
|
|
29
29
|
props.class
|
|
30
30
|
)"
|
|
@@ -3,19 +3,19 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
3
3
|
import { cn } from "@hemia/lume-vue"
|
|
4
4
|
|
|
5
5
|
const badgeVariants = cva(
|
|
6
|
-
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
6
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-lume-ring focus:ring-offset-2",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default:
|
|
11
|
-
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
11
|
+
"border-transparent bg-lume-primary text-lume-primary-foreground shadow hover:bg-lume-primary/80",
|
|
12
12
|
secondary:
|
|
13
|
-
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
+
"border-transparent bg-lume-secondary text-lume-secondary-foreground hover:bg-lume-secondary/80",
|
|
14
14
|
destructive:
|
|
15
|
-
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
16
|
-
outline: "text-foreground",
|
|
17
|
-
ghost: "border-transparent hover:bg-accent hover:text-accent-foreground",
|
|
18
|
-
link: "border-transparent text-primary underline-offset-4 hover:underline",
|
|
15
|
+
"border-transparent bg-lume-destructive text-lume-destructive-foreground shadow hover:bg-lume-destructive/80",
|
|
16
|
+
outline: "text-lume-foreground",
|
|
17
|
+
ghost: "border-transparent hover:bg-lume-accent hover:text-lume-accent-foreground",
|
|
18
|
+
link: "border-transparent text-lume-primary underline-offset-4 hover:underline",
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: {
|
|
@@ -3,29 +3,29 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
3
3
|
import { cn } from "@hemia/lume-vue"
|
|
4
4
|
|
|
5
5
|
const buttonVariants = cva(
|
|
6
|
-
"group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-
|
|
6
|
+
"group/button inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-xl border border-transparent bg-clip-padding text-sm font-medium transition-all outline-none select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lume-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
10
|
+
default: "bg-lume-primary text-lume-primary-foreground hover:bg-lume-primary/90",
|
|
11
11
|
destructive:
|
|
12
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
12
|
+
"bg-lume-destructive text-lume-destructive-foreground hover:bg-lume-destructive/90",
|
|
13
13
|
outline:
|
|
14
|
-
"border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
"border-lume-input bg-lume-background hover:bg-lume-accent hover:text-lume-accent-foreground",
|
|
15
15
|
secondary:
|
|
16
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
17
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
18
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
16
|
+
"bg-lume-secondary text-lume-secondary-foreground hover:bg-lume-secondary/80",
|
|
17
|
+
ghost: "hover:bg-lume-accent hover:text-lume-accent-foreground",
|
|
18
|
+
link: "text-lume-primary underline-offset-4 hover:underline",
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
|
-
default: "h-
|
|
22
|
-
xs: "h-
|
|
23
|
-
sm: "h-
|
|
24
|
-
lg: "h-
|
|
25
|
-
icon: "size-
|
|
26
|
-
"icon-xs": "size-
|
|
27
|
-
"icon-sm": "size-
|
|
28
|
-
"icon-lg": "size-
|
|
21
|
+
default: "h-8 px-4 py-2",
|
|
22
|
+
xs: "h-6 rounded-sm px-2 text-xs [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
sm: "h-7 rounded-lg px-3",
|
|
24
|
+
lg: "h-9 rounded-xl px-4",
|
|
25
|
+
icon: "size-8",
|
|
26
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
+
"icon-sm": "size-7",
|
|
28
|
+
"icon-lg": "size-9",
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
defaultVariants: {
|
|
@@ -16,7 +16,7 @@ const props = defineProps<{
|
|
|
16
16
|
isSm
|
|
17
17
|
? 'flex-col-reverse w-[calc(100%+1rem)] -mx-2 -mb-2 px-2'
|
|
18
18
|
: 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 -mx-6 -mb-6 px-6',
|
|
19
|
-
'bg-muted/50 rounded-b-xl dark:bg-muted/30 py-3',
|
|
19
|
+
'bg-lume-muted/50 rounded-b-xl dark:bg-lume-muted/30 py-3',
|
|
20
20
|
props.class
|
|
21
21
|
)">
|
|
22
22
|
<slot />
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cva } from "class-variance-authority"
|
|
3
3
|
import { cn } from "@hemia/lume-vue"
|
|
4
4
|
|
|
5
|
-
const fieldDescriptionVariants = cva("text-[0.8rem] text-muted-foreground")
|
|
5
|
+
const fieldDescriptionVariants = cva("text-[0.8rem] text-lume-muted-foreground")
|
|
6
6
|
|
|
7
7
|
const props = defineProps<{
|
|
8
8
|
class?: string
|
|
@@ -3,7 +3,7 @@ import { cva } from "class-variance-authority"
|
|
|
3
3
|
import { cn } from "@hemia/lume-vue"
|
|
4
4
|
|
|
5
5
|
const fieldGroupVariants = cva(
|
|
6
|
-
"flex flex-wrap items-center gap-2
|
|
6
|
+
"flex flex-wrap items-center gap-2"
|
|
7
7
|
)
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
@@ -4,12 +4,12 @@ import { cn } from "@hemia/lume-vue"
|
|
|
4
4
|
import { Field, FieldLabel, FieldDescription, FieldGroup } from "../field/index"
|
|
5
5
|
|
|
6
6
|
const textfieldVariants = cva(
|
|
7
|
-
"flex h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors
|
|
7
|
+
"flex h-9 w-full min-w-0 rounded-lg border border-lume-input bg-transparent px-2.5 py-1 text-base transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-lume-foreground placeholder:text-lume-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-lume-input/50 disabled:opacity-50 md:text-sm dark:bg-lume-input/30 dark:disabled:bg-lume-input/80",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default: "",
|
|
12
|
-
error: "bg-background border-
|
|
12
|
+
error: "bg-lume-background border-lume-destructive",
|
|
13
13
|
},
|
|
14
14
|
size: {
|
|
15
15
|
default: "",
|
|
@@ -25,7 +25,7 @@ const textfieldVariants = cva(
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
const textfieldIconVariants = cva(
|
|
28
|
-
"text-muted-foreground flex shrink-0 items-center",
|
|
28
|
+
"text-lume-muted-foreground flex shrink-0 items-center",
|
|
29
29
|
{
|
|
30
30
|
variants: {
|
|
31
31
|
size: {
|
|
@@ -91,30 +91,31 @@ const getInputPaddingClass = () => {
|
|
|
91
91
|
<template>
|
|
92
92
|
<Field :class="props.class">
|
|
93
93
|
<FieldLabel v-if="label" :for="forId">{{ label }}</FieldLabel>
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
|
|
95
|
+
<FieldGroup>
|
|
96
|
+
|
|
96
97
|
<component
|
|
97
98
|
v-if="prependIcon"
|
|
98
99
|
:is="prependIcon"
|
|
99
|
-
class="text-muted-foreground flex shrink-0 items-center"
|
|
100
|
+
class="text-lume-muted-foreground flex shrink-0 items-center"
|
|
100
101
|
:class="iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4'"
|
|
101
102
|
/>
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
<div
|
|
105
|
+
:aria-invalid="!!error"
|
|
104
106
|
:class="cn(
|
|
105
107
|
textfieldVariants({ variant: error ? 'error' : variant, size }),
|
|
106
|
-
'flex flex-1 items-center
|
|
108
|
+
'flex flex-1 items-center gap-2',
|
|
109
|
+
error
|
|
110
|
+
? 'border-lume-destructive ring-2 ring-lume-destructive/20 dark:border-lume-destructive/50 dark:ring-lume-destructive/40'
|
|
111
|
+
: 'focus-within:ring-2 focus-within:ring-lume-ring/25'
|
|
107
112
|
)"
|
|
108
113
|
>
|
|
109
|
-
<!-- Prepend-inner icon (inside, at start) -->
|
|
110
114
|
<component
|
|
111
115
|
v-if="prependInnerIcon"
|
|
112
116
|
:is="prependInnerIcon"
|
|
113
|
-
class="text-muted-foreground flex shrink-0 items-center"
|
|
114
|
-
:class="
|
|
115
|
-
iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4',
|
|
116
|
-
'me-1.5'
|
|
117
|
-
]"
|
|
117
|
+
class="text-lume-muted-foreground flex shrink-0 items-center"
|
|
118
|
+
:class="iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4'"
|
|
118
119
|
/>
|
|
119
120
|
<input
|
|
120
121
|
:id="forId"
|
|
@@ -122,35 +123,31 @@ const getInputPaddingClass = () => {
|
|
|
122
123
|
:value="modelValue"
|
|
123
124
|
:placeholder="placeholder"
|
|
124
125
|
:disabled="disabled"
|
|
125
|
-
:aria-invalid="!!error"
|
|
126
126
|
:class="cn(
|
|
127
|
-
'flex-1 bg-transparent
|
|
127
|
+
'flex-1 bg-transparent placeholder:text-lume-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 w-full min-w-0 outline-none focus:outline-none focus-visible:outline-none',
|
|
128
128
|
getInputPaddingClass()
|
|
129
129
|
)"
|
|
130
130
|
:style="{ '--tf-padding-x': '0.625rem' }"
|
|
131
131
|
@input="onInput"
|
|
132
132
|
/>
|
|
133
|
-
<!-- Append-inner icon (inside, at end) -->
|
|
134
133
|
<component
|
|
135
134
|
v-if="appendInnerIcon"
|
|
136
135
|
:is="appendInnerIcon"
|
|
137
|
-
class="text-muted-foreground flex shrink-0 items-center"
|
|
138
|
-
:class="
|
|
139
|
-
iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4',
|
|
140
|
-
'ms-1.5'
|
|
141
|
-
]"
|
|
136
|
+
class="text-lume-muted-foreground flex shrink-0 items-center"
|
|
137
|
+
:class="iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4'"
|
|
142
138
|
/>
|
|
143
139
|
</div>
|
|
144
|
-
|
|
140
|
+
|
|
145
141
|
<component
|
|
146
142
|
v-if="appendIcon"
|
|
147
143
|
:is="appendIcon"
|
|
148
|
-
class="text-muted-foreground flex shrink-0 items-center"
|
|
144
|
+
class="text-lume-muted-foreground flex shrink-0 items-center"
|
|
149
145
|
:class="iconSize === 'sm' ? 'size-3.5' : iconSize === 'lg' ? 'size-5' : 'size-4'"
|
|
150
146
|
/>
|
|
151
147
|
</FieldGroup>
|
|
148
|
+
|
|
152
149
|
<FieldDescription v-if="description && !error">{{ description }}</FieldDescription>
|
|
153
|
-
<p v-if="error" class="text-[0.8rem] font-medium text-destructive">
|
|
150
|
+
<p v-if="error" class="text-[0.8rem] font-medium text-lume-destructive">
|
|
154
151
|
{{ error }}
|
|
155
152
|
</p>
|
|
156
153
|
</Field>
|