@nextui-org/theme 2.1.12 → 2.1.14
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/dist/{chunk-RNXUUR27.mjs → chunk-5IBYC42H.mjs} +45 -20
- package/dist/{chunk-6XG3Y4GM.mjs → chunk-5QVKTCUZ.mjs} +28 -26
- package/dist/{chunk-WHT6K6RC.mjs → chunk-5Y7664AG.mjs} +5 -5
- package/dist/{chunk-TLWI2J7W.mjs → chunk-YUUGIQ6E.mjs} +50 -31
- package/dist/components/autocomplete.d.ts +21 -21
- package/dist/components/autocomplete.js +5 -5
- package/dist/components/autocomplete.mjs +1 -1
- package/dist/components/index.js +100 -56
- package/dist/components/index.mjs +3 -3
- package/dist/components/input.d.ts +17 -10
- package/dist/components/input.js +45 -20
- package/dist/components/input.mjs +1 -1
- package/dist/components/select.d.ts +21 -28
- package/dist/components/select.js +50 -31
- package/dist/components/select.mjs +1 -1
- package/dist/index.js +128 -82
- package/dist/index.mjs +4 -4
- package/dist/plugin.js +28 -26
- package/dist/plugin.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3769,7 +3769,7 @@ var circularProgress = tv({
|
|
|
3769
3769
|
// src/components/input.ts
|
|
3770
3770
|
var input = tv({
|
|
3771
3771
|
slots: {
|
|
3772
|
-
base:
|
|
3772
|
+
base: "group flex flex-col",
|
|
3773
3773
|
label: [
|
|
3774
3774
|
"absolute",
|
|
3775
3775
|
"z-10",
|
|
@@ -3805,7 +3805,7 @@ var input = tv({
|
|
|
3805
3805
|
"rounded-full",
|
|
3806
3806
|
...dataFocusVisibleClasses
|
|
3807
3807
|
],
|
|
3808
|
-
helperWrapper: "
|
|
3808
|
+
helperWrapper: "p-1 flex relative flex-col gap-1.5",
|
|
3809
3809
|
description: "text-tiny text-foreground-400",
|
|
3810
3810
|
errorMessage: "text-tiny text-danger"
|
|
3811
3811
|
},
|
|
@@ -3824,14 +3824,15 @@ var input = tv({
|
|
|
3824
3824
|
"border-medium",
|
|
3825
3825
|
"border-default-200",
|
|
3826
3826
|
"data-[hover=true]:border-default-400"
|
|
3827
|
-
]
|
|
3827
|
+
],
|
|
3828
|
+
value: "group-data-[has-value=true]:text-default-foreground"
|
|
3828
3829
|
},
|
|
3829
3830
|
bordered: {
|
|
3830
3831
|
inputWrapper: [
|
|
3831
3832
|
"border-medium",
|
|
3832
3833
|
"border-default-200",
|
|
3833
3834
|
"data-[hover=true]:border-default-400",
|
|
3834
|
-
"group-data-[focus=true]:border-foreground"
|
|
3835
|
+
"group-data-[focus=true]:border-default-foreground"
|
|
3835
3836
|
]
|
|
3836
3837
|
},
|
|
3837
3838
|
underlined: {
|
|
@@ -3849,7 +3850,7 @@ var input = tv({
|
|
|
3849
3850
|
"after:content-['']",
|
|
3850
3851
|
"after:w-0",
|
|
3851
3852
|
"after:origin-center",
|
|
3852
|
-
"after:bg-foreground",
|
|
3853
|
+
"after:bg-default-foreground",
|
|
3853
3854
|
"after:absolute",
|
|
3854
3855
|
"after:left-1/2",
|
|
3855
3856
|
"after:-translate-x-1/2",
|
|
@@ -3857,7 +3858,8 @@ var input = tv({
|
|
|
3857
3858
|
"after:h-[2px]",
|
|
3858
3859
|
"group-data-[focus=true]:after:w-full"
|
|
3859
3860
|
],
|
|
3860
|
-
innerWrapper: "pb-1"
|
|
3861
|
+
innerWrapper: "pb-1",
|
|
3862
|
+
label: "group-data-[filled-within=true]:text-foreground"
|
|
3861
3863
|
}
|
|
3862
3864
|
},
|
|
3863
3865
|
color: {
|
|
@@ -3872,7 +3874,7 @@ var input = tv({
|
|
|
3872
3874
|
sm: {
|
|
3873
3875
|
label: "text-tiny",
|
|
3874
3876
|
inputWrapper: "h-unit-8 min-h-unit-8 px-2 rounded-small",
|
|
3875
|
-
input: "text-
|
|
3877
|
+
input: "text-small",
|
|
3876
3878
|
clearButton: "text-medium"
|
|
3877
3879
|
},
|
|
3878
3880
|
md: {
|
|
@@ -3905,7 +3907,6 @@ var input = tv({
|
|
|
3905
3907
|
},
|
|
3906
3908
|
labelPlacement: {
|
|
3907
3909
|
outside: {
|
|
3908
|
-
label: "text-foreground pb-1.5",
|
|
3909
3910
|
mainWrapper: "flex flex-col"
|
|
3910
3911
|
},
|
|
3911
3912
|
"outside-left": {
|
|
@@ -3941,7 +3942,7 @@ var input = tv({
|
|
|
3941
3942
|
isInvalid: {
|
|
3942
3943
|
true: {
|
|
3943
3944
|
label: "!text-danger",
|
|
3944
|
-
input: "placeholder:text-danger text-danger"
|
|
3945
|
+
input: "!placeholder:text-danger !text-danger"
|
|
3945
3946
|
}
|
|
3946
3947
|
},
|
|
3947
3948
|
isRequired: {
|
|
@@ -3986,6 +3987,13 @@ var input = tv({
|
|
|
3986
3987
|
disableAnimation: false
|
|
3987
3988
|
},
|
|
3988
3989
|
compoundVariants: [
|
|
3990
|
+
{
|
|
3991
|
+
variant: "flat",
|
|
3992
|
+
color: "default",
|
|
3993
|
+
class: {
|
|
3994
|
+
input: "group-data-[has-value=true]:text-default-foreground"
|
|
3995
|
+
}
|
|
3996
|
+
},
|
|
3989
3997
|
{
|
|
3990
3998
|
variant: "flat",
|
|
3991
3999
|
color: "primary",
|
|
@@ -4107,6 +4115,13 @@ var input = tv({
|
|
|
4107
4115
|
inputWrapper: "data-[hover=true]:border-danger focus-within:border-danger"
|
|
4108
4116
|
}
|
|
4109
4117
|
},
|
|
4118
|
+
{
|
|
4119
|
+
variant: "underlined",
|
|
4120
|
+
color: "default",
|
|
4121
|
+
class: {
|
|
4122
|
+
input: "group-data-[has-value=true]:text-foreground"
|
|
4123
|
+
}
|
|
4124
|
+
},
|
|
4110
4125
|
{
|
|
4111
4126
|
variant: "underlined",
|
|
4112
4127
|
color: "primary",
|
|
@@ -4187,6 +4202,20 @@ var input = tv({
|
|
|
4187
4202
|
label: "text-danger"
|
|
4188
4203
|
}
|
|
4189
4204
|
},
|
|
4205
|
+
{
|
|
4206
|
+
labelPlacement: "inside",
|
|
4207
|
+
color: "default",
|
|
4208
|
+
class: {
|
|
4209
|
+
label: "group-data-[filled-within=true]:text-default-600"
|
|
4210
|
+
}
|
|
4211
|
+
},
|
|
4212
|
+
{
|
|
4213
|
+
labelPlacement: "outside",
|
|
4214
|
+
color: "default",
|
|
4215
|
+
class: {
|
|
4216
|
+
label: "group-data-[filled-within=true]:text-foreground"
|
|
4217
|
+
}
|
|
4218
|
+
},
|
|
4190
4219
|
{
|
|
4191
4220
|
radius: "full",
|
|
4192
4221
|
size: ["sm"],
|
|
@@ -4230,13 +4259,6 @@ var input = tv({
|
|
|
4230
4259
|
]
|
|
4231
4260
|
}
|
|
4232
4261
|
},
|
|
4233
|
-
{
|
|
4234
|
-
labelPlacement: "inside",
|
|
4235
|
-
color: "default",
|
|
4236
|
-
class: {
|
|
4237
|
-
label: "group-data-[filled-within=true]:text-foreground-600"
|
|
4238
|
-
}
|
|
4239
|
-
},
|
|
4240
4262
|
{
|
|
4241
4263
|
isInvalid: true,
|
|
4242
4264
|
variant: "flat",
|
|
@@ -4312,11 +4334,9 @@ var input = tv({
|
|
|
4312
4334
|
label: [
|
|
4313
4335
|
"pb-0",
|
|
4314
4336
|
"z-20",
|
|
4315
|
-
"opacity-60",
|
|
4316
4337
|
"top-1/2",
|
|
4317
4338
|
"-translate-y-1/2",
|
|
4318
|
-
"group-data-[filled-within=true]:left-0"
|
|
4319
|
-
"group-data-[filled-within=true]:opacity-100"
|
|
4339
|
+
"group-data-[filled-within=true]:left-0"
|
|
4320
4340
|
]
|
|
4321
4341
|
}
|
|
4322
4342
|
},
|
|
@@ -4329,7 +4349,6 @@ var input = tv({
|
|
|
4329
4349
|
{
|
|
4330
4350
|
labelPlacement: ["inside"],
|
|
4331
4351
|
variant: "flat",
|
|
4332
|
-
size: ["md", "lg"],
|
|
4333
4352
|
class: {
|
|
4334
4353
|
innerWrapper: "pb-0.5"
|
|
4335
4354
|
}
|
|
@@ -4527,6 +4546,12 @@ var input = tv({
|
|
|
4527
4546
|
class: {
|
|
4528
4547
|
input: "transition-height !duration-100 motion-reduce:transition-none"
|
|
4529
4548
|
}
|
|
4549
|
+
},
|
|
4550
|
+
{
|
|
4551
|
+
labelPlacement: ["inside", "outside"],
|
|
4552
|
+
class: {
|
|
4553
|
+
label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"]
|
|
4554
|
+
}
|
|
4530
4555
|
}
|
|
4531
4556
|
]
|
|
4532
4557
|
});
|
|
@@ -6045,7 +6070,7 @@ var skeleton = tv({
|
|
|
6045
6070
|
// src/components/select.ts
|
|
6046
6071
|
var select = tv({
|
|
6047
6072
|
slots: {
|
|
6048
|
-
base: ["group inline-flex flex-col relative w-full"
|
|
6073
|
+
base: ["group inline-flex flex-col relative w-full"],
|
|
6049
6074
|
label: [
|
|
6050
6075
|
"block",
|
|
6051
6076
|
"absolute",
|
|
@@ -6061,11 +6086,11 @@ var select = tv({
|
|
|
6061
6086
|
innerWrapper: "inline-flex h-full w-[calc(100%_-_theme(spacing.unit-6))] min-h-unit-4 items-center gap-1.5 box-border",
|
|
6062
6087
|
selectorIcon: "absolute right-3 w-unit-4 h-unit-4",
|
|
6063
6088
|
spinner: "absolute right-3",
|
|
6064
|
-
value: ["font-normal", "w-full", "text-left"],
|
|
6089
|
+
value: ["text-foreground-500", "font-normal", "w-full", "text-left"],
|
|
6065
6090
|
listboxWrapper: "scroll-py-6 max-h-64 w-full",
|
|
6066
6091
|
listbox: "",
|
|
6067
6092
|
popoverContent: "w-full p-1 overflow-hidden",
|
|
6068
|
-
helperWrapper: "
|
|
6093
|
+
helperWrapper: "p-1 flex relative flex-col gap-1.5",
|
|
6069
6094
|
description: "text-tiny text-foreground-400",
|
|
6070
6095
|
errorMessage: "text-tiny text-danger"
|
|
6071
6096
|
},
|
|
@@ -6084,15 +6109,17 @@ var select = tv({
|
|
|
6084
6109
|
"border-medium",
|
|
6085
6110
|
"border-default-200",
|
|
6086
6111
|
"data-[hover=true]:border-default-400"
|
|
6087
|
-
]
|
|
6112
|
+
],
|
|
6113
|
+
value: "group-data-[has-value=true]:text-default-foreground"
|
|
6088
6114
|
},
|
|
6089
6115
|
bordered: {
|
|
6090
6116
|
trigger: [
|
|
6091
6117
|
"border-medium",
|
|
6092
6118
|
"border-default-200",
|
|
6093
6119
|
"data-[hover=true]:border-default-400",
|
|
6094
|
-
"data-[open=true]:border-foreground",
|
|
6095
|
-
"data-[focus=true]:border-foreground"
|
|
6120
|
+
"data-[open=true]:border-default-foreground",
|
|
6121
|
+
"data-[focus=true]:border-default-foreground",
|
|
6122
|
+
"data-[focus=true]:border-default-foreground"
|
|
6096
6123
|
]
|
|
6097
6124
|
},
|
|
6098
6125
|
underlined: {
|
|
@@ -6110,7 +6137,7 @@ var select = tv({
|
|
|
6110
6137
|
"after:content-['']",
|
|
6111
6138
|
"after:w-0",
|
|
6112
6139
|
"after:origin-center",
|
|
6113
|
-
"after:bg-foreground",
|
|
6140
|
+
"after:bg-default-foreground",
|
|
6114
6141
|
"after:absolute",
|
|
6115
6142
|
"after:left-1/2",
|
|
6116
6143
|
"after:-translate-x-1/2",
|
|
@@ -6118,13 +6145,12 @@ var select = tv({
|
|
|
6118
6145
|
"after:h-[2px]",
|
|
6119
6146
|
"data-[open=true]:after:w-full",
|
|
6120
6147
|
"data-[focus=true]:after:w-full"
|
|
6121
|
-
]
|
|
6148
|
+
],
|
|
6149
|
+
label: "group-data-[filled=true]:text-foreground"
|
|
6122
6150
|
}
|
|
6123
6151
|
},
|
|
6124
6152
|
color: {
|
|
6125
|
-
default: {
|
|
6126
|
-
value: ["text-foreground-500", "group-data-[has-value=true]:text-foreground"]
|
|
6127
|
-
},
|
|
6153
|
+
default: {},
|
|
6128
6154
|
primary: {},
|
|
6129
6155
|
secondary: {},
|
|
6130
6156
|
success: {},
|
|
@@ -6135,7 +6161,7 @@ var select = tv({
|
|
|
6135
6161
|
sm: {
|
|
6136
6162
|
label: "text-tiny",
|
|
6137
6163
|
trigger: "h-unit-8 min-h-unit-8 px-2 rounded-small",
|
|
6138
|
-
value: "text-
|
|
6164
|
+
value: "text-small"
|
|
6139
6165
|
},
|
|
6140
6166
|
md: {
|
|
6141
6167
|
trigger: "h-unit-10 min-h-unit-10 rounded-medium",
|
|
@@ -6165,12 +6191,11 @@ var select = tv({
|
|
|
6165
6191
|
},
|
|
6166
6192
|
labelPlacement: {
|
|
6167
6193
|
outside: {
|
|
6168
|
-
base: "flex flex-col"
|
|
6169
|
-
label: "text-foreground pb-1.5"
|
|
6194
|
+
base: "flex flex-col"
|
|
6170
6195
|
},
|
|
6171
6196
|
"outside-left": {
|
|
6172
6197
|
base: "flex-row items-center flex-nowrap items-start",
|
|
6173
|
-
label: "relative text-foreground
|
|
6198
|
+
label: "relative pr-2 text-foreground"
|
|
6174
6199
|
},
|
|
6175
6200
|
inside: {
|
|
6176
6201
|
label: "text-tiny cursor-pointer",
|
|
@@ -6248,6 +6273,13 @@ var select = tv({
|
|
|
6248
6273
|
disableSelectorIconRotation: false
|
|
6249
6274
|
},
|
|
6250
6275
|
compoundVariants: [
|
|
6276
|
+
{
|
|
6277
|
+
variant: "flat",
|
|
6278
|
+
color: "default",
|
|
6279
|
+
class: {
|
|
6280
|
+
value: "group-data-[has-value=true]:text-default-foreground"
|
|
6281
|
+
}
|
|
6282
|
+
},
|
|
6251
6283
|
{
|
|
6252
6284
|
variant: "flat",
|
|
6253
6285
|
color: "primary",
|
|
@@ -6361,6 +6393,13 @@ var select = tv({
|
|
|
6361
6393
|
label: "text-danger"
|
|
6362
6394
|
}
|
|
6363
6395
|
},
|
|
6396
|
+
{
|
|
6397
|
+
variant: "underlined",
|
|
6398
|
+
color: "default",
|
|
6399
|
+
class: {
|
|
6400
|
+
value: "group-data-[has-value=true]:text-foreground"
|
|
6401
|
+
}
|
|
6402
|
+
},
|
|
6364
6403
|
{
|
|
6365
6404
|
variant: "underlined",
|
|
6366
6405
|
color: "primary",
|
|
@@ -6441,6 +6480,20 @@ var select = tv({
|
|
|
6441
6480
|
label: "text-danger"
|
|
6442
6481
|
}
|
|
6443
6482
|
},
|
|
6483
|
+
{
|
|
6484
|
+
labelPlacement: "inside",
|
|
6485
|
+
color: "default",
|
|
6486
|
+
class: {
|
|
6487
|
+
label: "group-data-[filled=true]:text-default-600"
|
|
6488
|
+
}
|
|
6489
|
+
},
|
|
6490
|
+
{
|
|
6491
|
+
labelPlacement: "outside",
|
|
6492
|
+
color: "default",
|
|
6493
|
+
class: {
|
|
6494
|
+
label: "group-data-[filled=true]:text-foreground"
|
|
6495
|
+
}
|
|
6496
|
+
},
|
|
6444
6497
|
{
|
|
6445
6498
|
radius: "full",
|
|
6446
6499
|
size: ["sm"],
|
|
@@ -6484,13 +6537,6 @@ var select = tv({
|
|
|
6484
6537
|
]
|
|
6485
6538
|
}
|
|
6486
6539
|
},
|
|
6487
|
-
{
|
|
6488
|
-
labelPlacement: "inside",
|
|
6489
|
-
color: "default",
|
|
6490
|
-
class: {
|
|
6491
|
-
label: "group-data-[filled=true]:text-foreground-600"
|
|
6492
|
-
}
|
|
6493
|
-
},
|
|
6494
6540
|
{
|
|
6495
6541
|
isInvalid: true,
|
|
6496
6542
|
variant: "flat",
|
|
@@ -6549,15 +6595,7 @@ var select = tv({
|
|
|
6549
6595
|
isMultiline: false,
|
|
6550
6596
|
class: {
|
|
6551
6597
|
base: "group relative justify-end",
|
|
6552
|
-
label: [
|
|
6553
|
-
"pb-0",
|
|
6554
|
-
"z-20",
|
|
6555
|
-
"opacity-60",
|
|
6556
|
-
"top-1/2",
|
|
6557
|
-
"-translate-y-1/2",
|
|
6558
|
-
"group-data-[filled=true]:opacity-100",
|
|
6559
|
-
"group-data-[filled=true]:left-0"
|
|
6560
|
-
]
|
|
6598
|
+
label: ["pb-0", "z-20", "top-1/2", "-translate-y-1/2", "group-data-[filled=true]:left-0"]
|
|
6561
6599
|
}
|
|
6562
6600
|
},
|
|
6563
6601
|
{
|
|
@@ -6709,6 +6747,12 @@ var select = tv({
|
|
|
6709
6747
|
],
|
|
6710
6748
|
base: "data-[has-label=true]:mt-[calc(theme(fontSize.small)_+_12px)]"
|
|
6711
6749
|
}
|
|
6750
|
+
},
|
|
6751
|
+
{
|
|
6752
|
+
labelPlacement: ["inside", "outside"],
|
|
6753
|
+
class: {
|
|
6754
|
+
label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"]
|
|
6755
|
+
}
|
|
6712
6756
|
}
|
|
6713
6757
|
]
|
|
6714
6758
|
});
|
|
@@ -7840,11 +7884,11 @@ var autocomplete = tv({
|
|
|
7840
7884
|
selectorButton: "text-medium"
|
|
7841
7885
|
},
|
|
7842
7886
|
variants: {
|
|
7843
|
-
|
|
7844
|
-
true: {
|
|
7887
|
+
isClearable: {
|
|
7888
|
+
true: {},
|
|
7889
|
+
false: {
|
|
7845
7890
|
clearButton: "hidden"
|
|
7846
|
-
}
|
|
7847
|
-
false: {}
|
|
7891
|
+
}
|
|
7848
7892
|
},
|
|
7849
7893
|
disableAnimation: {
|
|
7850
7894
|
true: {
|
|
@@ -7863,7 +7907,7 @@ var autocomplete = tv({
|
|
|
7863
7907
|
},
|
|
7864
7908
|
defaultVariants: {
|
|
7865
7909
|
disableAnimation: false,
|
|
7866
|
-
|
|
7910
|
+
isClearable: true,
|
|
7867
7911
|
disableSelectorIconRotation: false
|
|
7868
7912
|
}
|
|
7869
7913
|
});
|
|
@@ -8492,13 +8536,14 @@ var darkLayout = {
|
|
|
8492
8536
|
|
|
8493
8537
|
// src/plugin.ts
|
|
8494
8538
|
var DEFAULT_PREFIX = "nextui";
|
|
8539
|
+
var parsedColorsCache = {};
|
|
8495
8540
|
var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
8496
8541
|
const resolved = {
|
|
8497
8542
|
variants: [],
|
|
8498
8543
|
utilities: {},
|
|
8499
8544
|
colors: {}
|
|
8500
8545
|
};
|
|
8501
|
-
(
|
|
8546
|
+
for (const [themeName, { extend, layout, colors: colors2 }] of Object.entries(themes)) {
|
|
8502
8547
|
let cssSelector = `.${themeName},[data-theme="${themeName}"]`;
|
|
8503
8548
|
const scheme = themeName === "light" || themeName === "dark" ? themeName : extend;
|
|
8504
8549
|
if (themeName === defaultTheme) {
|
|
@@ -8513,11 +8558,13 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
8513
8558
|
name: themeName,
|
|
8514
8559
|
definition: [`&.${themeName}`, `&[data-theme='${themeName}']`]
|
|
8515
8560
|
});
|
|
8516
|
-
(
|
|
8561
|
+
for (const [colorName, colorValue] of Object.entries(flatColors)) {
|
|
8517
8562
|
if (!colorValue)
|
|
8518
8563
|
return;
|
|
8519
8564
|
try {
|
|
8520
|
-
const
|
|
8565
|
+
const parsedColor = parsedColorsCache[colorValue] || (0, import_color.default)(colorValue).hsl().round().array();
|
|
8566
|
+
parsedColorsCache[colorValue] = parsedColor;
|
|
8567
|
+
const [h, s, l, defaultAlphaValue] = parsedColor;
|
|
8521
8568
|
const nextuiColorVariable = `--${prefix}-${colorName}`;
|
|
8522
8569
|
const nextuiOpacityVariable = `--${prefix}-${colorName}-opacity`;
|
|
8523
8570
|
resolved.utilities[cssSelector][nextuiColorVariable] = `${h} ${s}% ${l}%`;
|
|
@@ -8536,32 +8583,31 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
8536
8583
|
} catch (error) {
|
|
8537
8584
|
console.log("error", error == null ? void 0 : error.message);
|
|
8538
8585
|
}
|
|
8539
|
-
}
|
|
8540
|
-
(
|
|
8586
|
+
}
|
|
8587
|
+
for (const [key, value] of Object.entries(flatLayout)) {
|
|
8541
8588
|
if (!value)
|
|
8542
8589
|
return;
|
|
8590
|
+
const layoutVariablePrefix = `--${prefix}-${key}`;
|
|
8543
8591
|
if (typeof value === "object") {
|
|
8544
|
-
(
|
|
8545
|
-
const
|
|
8546
|
-
resolved.utilities[cssSelector][
|
|
8547
|
-
}
|
|
8548
|
-
} else if (key === "spacing-unit") {
|
|
8549
|
-
const layoutVariable = `--${prefix}-${key}`;
|
|
8550
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
8551
|
-
const spacingScale = generateSpacingScale(Number(value));
|
|
8552
|
-
(0, import_lodash3.default)(spacingScale, (v, k) => {
|
|
8553
|
-
const layoutVariable2 = `--${prefix}-${key}-${k}`;
|
|
8554
|
-
resolved.utilities[cssSelector][layoutVariable2] = v;
|
|
8555
|
-
});
|
|
8592
|
+
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
8593
|
+
const nestedLayoutVariable = `${layoutVariablePrefix}-${nestedKey}`;
|
|
8594
|
+
resolved.utilities[cssSelector][nestedLayoutVariable] = nestedValue;
|
|
8595
|
+
}
|
|
8556
8596
|
} else {
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8597
|
+
if (key === "spacing-unit") {
|
|
8598
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = value;
|
|
8599
|
+
const spacingScale = generateSpacingScale(Number(value));
|
|
8600
|
+
for (const [scaleKey, scaleValue] of Object.entries(spacingScale)) {
|
|
8601
|
+
const spacingVariable = `${layoutVariablePrefix}-${scaleKey}`;
|
|
8602
|
+
resolved.utilities[cssSelector][spacingVariable] = scaleValue;
|
|
8603
|
+
}
|
|
8604
|
+
} else {
|
|
8605
|
+
const formattedValue = layoutVariablePrefix.includes("opacity") && typeof value === "number" ? value.toString().replace(/^0\./, ".") : value;
|
|
8606
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = formattedValue;
|
|
8560
8607
|
}
|
|
8561
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
8562
8608
|
}
|
|
8563
|
-
}
|
|
8564
|
-
}
|
|
8609
|
+
}
|
|
8610
|
+
}
|
|
8565
8611
|
return resolved;
|
|
8566
8612
|
};
|
|
8567
8613
|
var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
@@ -8591,8 +8637,8 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
8591
8637
|
...baseStyles(prefix)
|
|
8592
8638
|
}
|
|
8593
8639
|
});
|
|
8594
|
-
addUtilities({ ...resolved.utilities, ...utilities });
|
|
8595
|
-
resolved.variants.forEach((variant) => {
|
|
8640
|
+
addUtilities({ ...resolved == null ? void 0 : resolved.utilities, ...utilities });
|
|
8641
|
+
resolved == null ? void 0 : resolved.variants.forEach((variant) => {
|
|
8596
8642
|
addVariant(variant.name, variant.definition);
|
|
8597
8643
|
});
|
|
8598
8644
|
},
|
|
@@ -8601,7 +8647,7 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
8601
8647
|
extend: {
|
|
8602
8648
|
colors: {
|
|
8603
8649
|
...addCommonColors ? commonColors : {},
|
|
8604
|
-
...resolved.colors
|
|
8650
|
+
...resolved == null ? void 0 : resolved.colors
|
|
8605
8651
|
},
|
|
8606
8652
|
scale: {
|
|
8607
8653
|
"80": "0.8",
|
package/dist/index.mjs
CHANGED
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
} from "./chunk-VGHVBXXT.mjs";
|
|
45
45
|
import {
|
|
46
46
|
select
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-YUUGIQ6E.mjs";
|
|
48
48
|
import {
|
|
49
49
|
skeleton
|
|
50
50
|
} from "./chunk-JX6O4KJS.mjs";
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from "./chunk-F36W5Y6O.mjs";
|
|
54
54
|
import {
|
|
55
55
|
input
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-5IBYC42H.mjs";
|
|
57
57
|
import {
|
|
58
58
|
kbd
|
|
59
59
|
} from "./chunk-J7FVLFSZ.mjs";
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
} from "./chunk-I5E37FAL.mjs";
|
|
105
105
|
import {
|
|
106
106
|
autocomplete
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-5Y7664AG.mjs";
|
|
108
108
|
import {
|
|
109
109
|
avatar,
|
|
110
110
|
avatarGroup
|
|
@@ -130,7 +130,7 @@ import {
|
|
|
130
130
|
} from "./chunk-WBUVHAJX.mjs";
|
|
131
131
|
import {
|
|
132
132
|
nextui
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-5QVKTCUZ.mjs";
|
|
134
134
|
import "./chunk-S7W5DQP2.mjs";
|
|
135
135
|
import "./chunk-DI2L75XK.mjs";
|
|
136
136
|
import "./chunk-4Z22WXZX.mjs";
|
package/dist/plugin.js
CHANGED
|
@@ -711,13 +711,14 @@ var baseStyles = (prefix) => ({
|
|
|
711
711
|
|
|
712
712
|
// src/plugin.ts
|
|
713
713
|
var DEFAULT_PREFIX = "nextui";
|
|
714
|
+
var parsedColorsCache = {};
|
|
714
715
|
var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
715
716
|
const resolved = {
|
|
716
717
|
variants: [],
|
|
717
718
|
utilities: {},
|
|
718
719
|
colors: {}
|
|
719
720
|
};
|
|
720
|
-
(
|
|
721
|
+
for (const [themeName, { extend, layout, colors: colors2 }] of Object.entries(themes)) {
|
|
721
722
|
let cssSelector = `.${themeName},[data-theme="${themeName}"]`;
|
|
722
723
|
const scheme = themeName === "light" || themeName === "dark" ? themeName : extend;
|
|
723
724
|
if (themeName === defaultTheme) {
|
|
@@ -732,11 +733,13 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
732
733
|
name: themeName,
|
|
733
734
|
definition: [`&.${themeName}`, `&[data-theme='${themeName}']`]
|
|
734
735
|
});
|
|
735
|
-
(
|
|
736
|
+
for (const [colorName, colorValue] of Object.entries(flatColors)) {
|
|
736
737
|
if (!colorValue)
|
|
737
738
|
return;
|
|
738
739
|
try {
|
|
739
|
-
const
|
|
740
|
+
const parsedColor = parsedColorsCache[colorValue] || (0, import_color.default)(colorValue).hsl().round().array();
|
|
741
|
+
parsedColorsCache[colorValue] = parsedColor;
|
|
742
|
+
const [h, s, l, defaultAlphaValue] = parsedColor;
|
|
740
743
|
const nextuiColorVariable = `--${prefix}-${colorName}`;
|
|
741
744
|
const nextuiOpacityVariable = `--${prefix}-${colorName}-opacity`;
|
|
742
745
|
resolved.utilities[cssSelector][nextuiColorVariable] = `${h} ${s}% ${l}%`;
|
|
@@ -755,32 +758,31 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
755
758
|
} catch (error) {
|
|
756
759
|
console.log("error", error == null ? void 0 : error.message);
|
|
757
760
|
}
|
|
758
|
-
}
|
|
759
|
-
(
|
|
761
|
+
}
|
|
762
|
+
for (const [key, value] of Object.entries(flatLayout)) {
|
|
760
763
|
if (!value)
|
|
761
764
|
return;
|
|
765
|
+
const layoutVariablePrefix = `--${prefix}-${key}`;
|
|
762
766
|
if (typeof value === "object") {
|
|
763
|
-
(
|
|
764
|
-
const
|
|
765
|
-
resolved.utilities[cssSelector][
|
|
766
|
-
}
|
|
767
|
-
} else if (key === "spacing-unit") {
|
|
768
|
-
const layoutVariable = `--${prefix}-${key}`;
|
|
769
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
770
|
-
const spacingScale = generateSpacingScale(Number(value));
|
|
771
|
-
(0, import_lodash3.default)(spacingScale, (v, k) => {
|
|
772
|
-
const layoutVariable2 = `--${prefix}-${key}-${k}`;
|
|
773
|
-
resolved.utilities[cssSelector][layoutVariable2] = v;
|
|
774
|
-
});
|
|
767
|
+
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
768
|
+
const nestedLayoutVariable = `${layoutVariablePrefix}-${nestedKey}`;
|
|
769
|
+
resolved.utilities[cssSelector][nestedLayoutVariable] = nestedValue;
|
|
770
|
+
}
|
|
775
771
|
} else {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
772
|
+
if (key === "spacing-unit") {
|
|
773
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = value;
|
|
774
|
+
const spacingScale = generateSpacingScale(Number(value));
|
|
775
|
+
for (const [scaleKey, scaleValue] of Object.entries(spacingScale)) {
|
|
776
|
+
const spacingVariable = `${layoutVariablePrefix}-${scaleKey}`;
|
|
777
|
+
resolved.utilities[cssSelector][spacingVariable] = scaleValue;
|
|
778
|
+
}
|
|
779
|
+
} else {
|
|
780
|
+
const formattedValue = layoutVariablePrefix.includes("opacity") && typeof value === "number" ? value.toString().replace(/^0\./, ".") : value;
|
|
781
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = formattedValue;
|
|
779
782
|
}
|
|
780
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
781
783
|
}
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
784
786
|
return resolved;
|
|
785
787
|
};
|
|
786
788
|
var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
@@ -810,8 +812,8 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
810
812
|
...baseStyles(prefix)
|
|
811
813
|
}
|
|
812
814
|
});
|
|
813
|
-
addUtilities({ ...resolved.utilities, ...utilities });
|
|
814
|
-
resolved.variants.forEach((variant) => {
|
|
815
|
+
addUtilities({ ...resolved == null ? void 0 : resolved.utilities, ...utilities });
|
|
816
|
+
resolved == null ? void 0 : resolved.variants.forEach((variant) => {
|
|
815
817
|
addVariant(variant.name, variant.definition);
|
|
816
818
|
});
|
|
817
819
|
},
|
|
@@ -820,7 +822,7 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
820
822
|
extend: {
|
|
821
823
|
colors: {
|
|
822
824
|
...addCommonColors ? commonColors : {},
|
|
823
|
-
...resolved.colors
|
|
825
|
+
...resolved == null ? void 0 : resolved.colors
|
|
824
826
|
},
|
|
825
827
|
scale: {
|
|
826
828
|
"80": "0.8",
|
package/dist/plugin.mjs
CHANGED