@nextui-org/theme 2.1.11 → 2.1.13
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-6XG3Y4GM.mjs → chunk-5QVKTCUZ.mjs} +28 -26
- package/dist/{chunk-KNUJMWVH.mjs → chunk-D4RGWEG7.mjs} +33 -23
- package/dist/{chunk-6RI6HHSE.mjs → chunk-DNEFEC5I.mjs} +40 -33
- package/dist/components/index.js +73 -56
- package/dist/components/index.mjs +2 -2
- package/dist/components/input.d.ts +80 -10
- package/dist/components/input.js +33 -23
- package/dist/components/input.mjs +1 -1
- package/dist/components/select.d.ts +63 -7
- package/dist/components/select.js +40 -33
- package/dist/components/select.mjs +1 -1
- package/dist/index.js +101 -82
- package/dist/index.mjs +3 -3
- 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",
|
|
@@ -3778,15 +3778,19 @@ var input = tv({
|
|
|
3778
3778
|
"subpixel-antialiased",
|
|
3779
3779
|
"block",
|
|
3780
3780
|
"text-small",
|
|
3781
|
-
"text-foreground-500"
|
|
3781
|
+
"text-foreground-500",
|
|
3782
|
+
"opacity-70",
|
|
3783
|
+
"group-data-[filled-within=true]:opacity-100"
|
|
3782
3784
|
],
|
|
3783
3785
|
mainWrapper: "h-full",
|
|
3784
3786
|
inputWrapper: "relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-sm px-3 gap-3",
|
|
3785
3787
|
innerWrapper: "inline-flex w-full items-center h-full box-border",
|
|
3786
3788
|
input: [
|
|
3789
|
+
"opacity-70",
|
|
3787
3790
|
"w-full font-normal bg-transparent !outline-none placeholder:text-foreground-500 focus-visible:outline-none",
|
|
3788
3791
|
"data-[has-start-content=true]:ps-1.5",
|
|
3789
|
-
"data-[has-end-content=true]:pe-1.5"
|
|
3792
|
+
"data-[has-end-content=true]:pe-1.5",
|
|
3793
|
+
"group-data-[has-value=true]:opacity-100"
|
|
3790
3794
|
],
|
|
3791
3795
|
clearButton: [
|
|
3792
3796
|
"p-2",
|
|
@@ -3805,7 +3809,7 @@ var input = tv({
|
|
|
3805
3809
|
"rounded-full",
|
|
3806
3810
|
...dataFocusVisibleClasses
|
|
3807
3811
|
],
|
|
3808
|
-
helperWrapper: "
|
|
3812
|
+
helperWrapper: "p-1 flex relative flex-col gap-1.5",
|
|
3809
3813
|
description: "text-tiny text-foreground-400",
|
|
3810
3814
|
errorMessage: "text-tiny text-danger"
|
|
3811
3815
|
},
|
|
@@ -3816,7 +3820,9 @@ var input = tv({
|
|
|
3816
3820
|
"bg-default-100",
|
|
3817
3821
|
"data-[hover=true]:bg-default-200",
|
|
3818
3822
|
"group-data-[focus=true]:bg-default-100"
|
|
3819
|
-
]
|
|
3823
|
+
],
|
|
3824
|
+
input: "placeholder:text-default-foreground",
|
|
3825
|
+
label: "text-default-foreground"
|
|
3820
3826
|
},
|
|
3821
3827
|
faded: {
|
|
3822
3828
|
inputWrapper: [
|
|
@@ -3824,15 +3830,19 @@ var input = tv({
|
|
|
3824
3830
|
"border-medium",
|
|
3825
3831
|
"border-default-200",
|
|
3826
3832
|
"data-[hover=true]:border-default-400"
|
|
3827
|
-
]
|
|
3833
|
+
],
|
|
3834
|
+
input: "placeholder:text-default-foreground",
|
|
3835
|
+
label: "text-default-foreground"
|
|
3828
3836
|
},
|
|
3829
3837
|
bordered: {
|
|
3830
3838
|
inputWrapper: [
|
|
3831
3839
|
"border-medium",
|
|
3832
3840
|
"border-default-200",
|
|
3833
3841
|
"data-[hover=true]:border-default-400",
|
|
3834
|
-
"group-data-[focus=true]:border-foreground"
|
|
3835
|
-
]
|
|
3842
|
+
"group-data-[focus=true]:border-default-foreground"
|
|
3843
|
+
],
|
|
3844
|
+
input: "placeholder:text-foreground",
|
|
3845
|
+
label: "text-foreground"
|
|
3836
3846
|
},
|
|
3837
3847
|
underlined: {
|
|
3838
3848
|
inputWrapper: [
|
|
@@ -3849,7 +3859,7 @@ var input = tv({
|
|
|
3849
3859
|
"after:content-['']",
|
|
3850
3860
|
"after:w-0",
|
|
3851
3861
|
"after:origin-center",
|
|
3852
|
-
"after:bg-foreground",
|
|
3862
|
+
"after:bg-default-foreground",
|
|
3853
3863
|
"after:absolute",
|
|
3854
3864
|
"after:left-1/2",
|
|
3855
3865
|
"after:-translate-x-1/2",
|
|
@@ -3857,11 +3867,15 @@ var input = tv({
|
|
|
3857
3867
|
"after:h-[2px]",
|
|
3858
3868
|
"group-data-[focus=true]:after:w-full"
|
|
3859
3869
|
],
|
|
3860
|
-
innerWrapper: "pb-1"
|
|
3870
|
+
innerWrapper: "pb-1",
|
|
3871
|
+
input: "placeholder:text-foreground",
|
|
3872
|
+
label: "text-foreground"
|
|
3861
3873
|
}
|
|
3862
3874
|
},
|
|
3863
3875
|
color: {
|
|
3864
|
-
default: {
|
|
3876
|
+
default: {
|
|
3877
|
+
label: "group-data-[filled-within=true]:opacity-80"
|
|
3878
|
+
},
|
|
3865
3879
|
primary: {},
|
|
3866
3880
|
secondary: {},
|
|
3867
3881
|
success: {},
|
|
@@ -3917,7 +3931,7 @@ var input = tv({
|
|
|
3917
3931
|
inside: {
|
|
3918
3932
|
label: "text-tiny cursor-text",
|
|
3919
3933
|
inputWrapper: "flex-col items-start justify-center gap-0",
|
|
3920
|
-
innerWrapper: "items-end"
|
|
3934
|
+
innerWrapper: "group-data-[has-label=true]:items-end"
|
|
3921
3935
|
}
|
|
3922
3936
|
},
|
|
3923
3937
|
fullWidth: {
|
|
@@ -4230,13 +4244,6 @@ var input = tv({
|
|
|
4230
4244
|
]
|
|
4231
4245
|
}
|
|
4232
4246
|
},
|
|
4233
|
-
{
|
|
4234
|
-
labelPlacement: "inside",
|
|
4235
|
-
color: "default",
|
|
4236
|
-
class: {
|
|
4237
|
-
label: "group-data-[filled-within=true]:text-foreground-600"
|
|
4238
|
-
}
|
|
4239
|
-
},
|
|
4240
4247
|
{
|
|
4241
4248
|
isInvalid: true,
|
|
4242
4249
|
variant: "flat",
|
|
@@ -4312,11 +4319,9 @@ var input = tv({
|
|
|
4312
4319
|
label: [
|
|
4313
4320
|
"pb-0",
|
|
4314
4321
|
"z-20",
|
|
4315
|
-
"opacity-60",
|
|
4316
4322
|
"top-1/2",
|
|
4317
4323
|
"-translate-y-1/2",
|
|
4318
|
-
"group-data-[filled-within=true]:left-0"
|
|
4319
|
-
"group-data-[filled-within=true]:opacity-100"
|
|
4324
|
+
"group-data-[filled-within=true]:left-0"
|
|
4320
4325
|
]
|
|
4321
4326
|
}
|
|
4322
4327
|
},
|
|
@@ -4329,7 +4334,6 @@ var input = tv({
|
|
|
4329
4334
|
{
|
|
4330
4335
|
labelPlacement: ["inside"],
|
|
4331
4336
|
variant: "flat",
|
|
4332
|
-
size: ["md", "lg"],
|
|
4333
4337
|
class: {
|
|
4334
4338
|
innerWrapper: "pb-0.5"
|
|
4335
4339
|
}
|
|
@@ -4527,6 +4531,12 @@ var input = tv({
|
|
|
4527
4531
|
class: {
|
|
4528
4532
|
input: "transition-height !duration-100 motion-reduce:transition-none"
|
|
4529
4533
|
}
|
|
4534
|
+
},
|
|
4535
|
+
{
|
|
4536
|
+
labelPlacement: ["inside", "outside"],
|
|
4537
|
+
class: {
|
|
4538
|
+
label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"]
|
|
4539
|
+
}
|
|
4530
4540
|
}
|
|
4531
4541
|
]
|
|
4532
4542
|
});
|
|
@@ -6045,7 +6055,7 @@ var skeleton = tv({
|
|
|
6045
6055
|
// src/components/select.ts
|
|
6046
6056
|
var select = tv({
|
|
6047
6057
|
slots: {
|
|
6048
|
-
base: ["group inline-flex flex-col relative w-full"
|
|
6058
|
+
base: ["group inline-flex flex-col relative w-full"],
|
|
6049
6059
|
label: [
|
|
6050
6060
|
"block",
|
|
6051
6061
|
"absolute",
|
|
@@ -6054,18 +6064,26 @@ var select = tv({
|
|
|
6054
6064
|
"subpixel-antialiased",
|
|
6055
6065
|
"text-small",
|
|
6056
6066
|
"text-foreground-500",
|
|
6057
|
-
"pointer-events-none"
|
|
6067
|
+
"pointer-events-none",
|
|
6068
|
+
"opacity-70",
|
|
6069
|
+
"group-data-[filled=true]:opacity-100"
|
|
6058
6070
|
],
|
|
6059
6071
|
mainWrapper: "w-full flex flex-col",
|
|
6060
6072
|
trigger: "relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-sm outline-none tap-highlight-transparent",
|
|
6061
6073
|
innerWrapper: "inline-flex h-full w-[calc(100%_-_theme(spacing.unit-6))] min-h-unit-4 items-center gap-1.5 box-border",
|
|
6062
6074
|
selectorIcon: "absolute right-3 w-unit-4 h-unit-4",
|
|
6063
6075
|
spinner: "absolute right-3",
|
|
6064
|
-
value: [
|
|
6076
|
+
value: [
|
|
6077
|
+
"font-normal",
|
|
6078
|
+
"w-full",
|
|
6079
|
+
"text-left",
|
|
6080
|
+
"opacity-70",
|
|
6081
|
+
"group-data-[has-value=true]:opacity-100"
|
|
6082
|
+
],
|
|
6065
6083
|
listboxWrapper: "scroll-py-6 max-h-64 w-full",
|
|
6066
6084
|
listbox: "",
|
|
6067
6085
|
popoverContent: "w-full p-1 overflow-hidden",
|
|
6068
|
-
helperWrapper: "
|
|
6086
|
+
helperWrapper: "p-1 flex relative flex-col gap-1.5",
|
|
6069
6087
|
description: "text-tiny text-foreground-400",
|
|
6070
6088
|
errorMessage: "text-tiny text-danger"
|
|
6071
6089
|
},
|
|
@@ -6076,7 +6094,9 @@ var select = tv({
|
|
|
6076
6094
|
"bg-default-100",
|
|
6077
6095
|
"data-[hover=true]:bg-default-200",
|
|
6078
6096
|
"group-data-[focus=true]:bg-default-100"
|
|
6079
|
-
]
|
|
6097
|
+
],
|
|
6098
|
+
label: "text-default-foreground",
|
|
6099
|
+
value: "placeholder:text-default-foreground"
|
|
6080
6100
|
},
|
|
6081
6101
|
faded: {
|
|
6082
6102
|
trigger: [
|
|
@@ -6084,16 +6104,21 @@ var select = tv({
|
|
|
6084
6104
|
"border-medium",
|
|
6085
6105
|
"border-default-200",
|
|
6086
6106
|
"data-[hover=true]:border-default-400"
|
|
6087
|
-
]
|
|
6107
|
+
],
|
|
6108
|
+
label: "text-default-foreground",
|
|
6109
|
+
value: "placeholder:text-default-foreground"
|
|
6088
6110
|
},
|
|
6089
6111
|
bordered: {
|
|
6090
6112
|
trigger: [
|
|
6091
6113
|
"border-medium",
|
|
6092
6114
|
"border-default-200",
|
|
6093
6115
|
"data-[hover=true]:border-default-400",
|
|
6094
|
-
"data-[open=true]:border-foreground",
|
|
6095
|
-
"data-[focus=true]:border-foreground"
|
|
6096
|
-
|
|
6116
|
+
"data-[open=true]:border-default-foreground",
|
|
6117
|
+
"data-[focus=true]:border-default-foreground",
|
|
6118
|
+
"data-[focus=true]:border-default-foreground"
|
|
6119
|
+
],
|
|
6120
|
+
label: "text-foreground",
|
|
6121
|
+
value: "placeholder:text-foreground"
|
|
6097
6122
|
},
|
|
6098
6123
|
underlined: {
|
|
6099
6124
|
trigger: [
|
|
@@ -6110,7 +6135,7 @@ var select = tv({
|
|
|
6110
6135
|
"after:content-['']",
|
|
6111
6136
|
"after:w-0",
|
|
6112
6137
|
"after:origin-center",
|
|
6113
|
-
"after:bg-foreground",
|
|
6138
|
+
"after:bg-default-foreground",
|
|
6114
6139
|
"after:absolute",
|
|
6115
6140
|
"after:left-1/2",
|
|
6116
6141
|
"after:-translate-x-1/2",
|
|
@@ -6118,12 +6143,14 @@ var select = tv({
|
|
|
6118
6143
|
"after:h-[2px]",
|
|
6119
6144
|
"data-[open=true]:after:w-full",
|
|
6120
6145
|
"data-[focus=true]:after:w-full"
|
|
6121
|
-
]
|
|
6146
|
+
],
|
|
6147
|
+
label: "text-foreground",
|
|
6148
|
+
value: "placeholder:text-foreground"
|
|
6122
6149
|
}
|
|
6123
6150
|
},
|
|
6124
6151
|
color: {
|
|
6125
6152
|
default: {
|
|
6126
|
-
|
|
6153
|
+
label: "group-data-[filled=true]:opacity-80"
|
|
6127
6154
|
},
|
|
6128
6155
|
primary: {},
|
|
6129
6156
|
secondary: {},
|
|
@@ -6484,13 +6511,6 @@ var select = tv({
|
|
|
6484
6511
|
]
|
|
6485
6512
|
}
|
|
6486
6513
|
},
|
|
6487
|
-
{
|
|
6488
|
-
labelPlacement: "inside",
|
|
6489
|
-
color: "default",
|
|
6490
|
-
class: {
|
|
6491
|
-
label: "group-data-[filled=true]:text-foreground-600"
|
|
6492
|
-
}
|
|
6493
|
-
},
|
|
6494
6514
|
{
|
|
6495
6515
|
isInvalid: true,
|
|
6496
6516
|
variant: "flat",
|
|
@@ -6549,15 +6569,7 @@ var select = tv({
|
|
|
6549
6569
|
isMultiline: false,
|
|
6550
6570
|
class: {
|
|
6551
6571
|
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
|
-
]
|
|
6572
|
+
label: ["pb-0", "z-20", "top-1/2", "-translate-y-1/2", "group-data-[filled=true]:left-0"]
|
|
6561
6573
|
}
|
|
6562
6574
|
},
|
|
6563
6575
|
{
|
|
@@ -6570,8 +6582,7 @@ var select = tv({
|
|
|
6570
6582
|
labelPlacement: "inside",
|
|
6571
6583
|
size: ["sm", "md"],
|
|
6572
6584
|
class: {
|
|
6573
|
-
label: "text-small"
|
|
6574
|
-
input: "pt-4"
|
|
6585
|
+
label: "text-small"
|
|
6575
6586
|
}
|
|
6576
6587
|
},
|
|
6577
6588
|
{
|
|
@@ -6580,7 +6591,7 @@ var select = tv({
|
|
|
6580
6591
|
size: "sm",
|
|
6581
6592
|
class: {
|
|
6582
6593
|
label: ["group-data-[filled=true]:-translate-y-[calc(50%_+_theme(fontSize.tiny)/2_-_8px)]"],
|
|
6583
|
-
innerWrapper: "pt-4"
|
|
6594
|
+
innerWrapper: "group-data-[has-label=true]:pt-4"
|
|
6584
6595
|
}
|
|
6585
6596
|
},
|
|
6586
6597
|
{
|
|
@@ -6591,7 +6602,7 @@ var select = tv({
|
|
|
6591
6602
|
label: [
|
|
6592
6603
|
"group-data-[filled=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_6px)]"
|
|
6593
6604
|
],
|
|
6594
|
-
innerWrapper: "pt-4"
|
|
6605
|
+
innerWrapper: "group-data-[has-label=true]:pt-4"
|
|
6595
6606
|
}
|
|
6596
6607
|
},
|
|
6597
6608
|
{
|
|
@@ -6603,7 +6614,7 @@ var select = tv({
|
|
|
6603
6614
|
"text-medium",
|
|
6604
6615
|
"group-data-[filled=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_8px)]"
|
|
6605
6616
|
],
|
|
6606
|
-
innerWrapper: "pt-5"
|
|
6617
|
+
innerWrapper: "group-data-[has-label=true]:pt-5"
|
|
6607
6618
|
}
|
|
6608
6619
|
},
|
|
6609
6620
|
{
|
|
@@ -6710,6 +6721,12 @@ var select = tv({
|
|
|
6710
6721
|
],
|
|
6711
6722
|
base: "data-[has-label=true]:mt-[calc(theme(fontSize.small)_+_12px)]"
|
|
6712
6723
|
}
|
|
6724
|
+
},
|
|
6725
|
+
{
|
|
6726
|
+
labelPlacement: ["inside", "outside"],
|
|
6727
|
+
class: {
|
|
6728
|
+
label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"]
|
|
6729
|
+
}
|
|
6713
6730
|
}
|
|
6714
6731
|
]
|
|
6715
6732
|
});
|
|
@@ -8493,13 +8510,14 @@ var darkLayout = {
|
|
|
8493
8510
|
|
|
8494
8511
|
// src/plugin.ts
|
|
8495
8512
|
var DEFAULT_PREFIX = "nextui";
|
|
8513
|
+
var parsedColorsCache = {};
|
|
8496
8514
|
var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
8497
8515
|
const resolved = {
|
|
8498
8516
|
variants: [],
|
|
8499
8517
|
utilities: {},
|
|
8500
8518
|
colors: {}
|
|
8501
8519
|
};
|
|
8502
|
-
(
|
|
8520
|
+
for (const [themeName, { extend, layout, colors: colors2 }] of Object.entries(themes)) {
|
|
8503
8521
|
let cssSelector = `.${themeName},[data-theme="${themeName}"]`;
|
|
8504
8522
|
const scheme = themeName === "light" || themeName === "dark" ? themeName : extend;
|
|
8505
8523
|
if (themeName === defaultTheme) {
|
|
@@ -8514,11 +8532,13 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
8514
8532
|
name: themeName,
|
|
8515
8533
|
definition: [`&.${themeName}`, `&[data-theme='${themeName}']`]
|
|
8516
8534
|
});
|
|
8517
|
-
(
|
|
8535
|
+
for (const [colorName, colorValue] of Object.entries(flatColors)) {
|
|
8518
8536
|
if (!colorValue)
|
|
8519
8537
|
return;
|
|
8520
8538
|
try {
|
|
8521
|
-
const
|
|
8539
|
+
const parsedColor = parsedColorsCache[colorValue] || (0, import_color.default)(colorValue).hsl().round().array();
|
|
8540
|
+
parsedColorsCache[colorValue] = parsedColor;
|
|
8541
|
+
const [h, s, l, defaultAlphaValue] = parsedColor;
|
|
8522
8542
|
const nextuiColorVariable = `--${prefix}-${colorName}`;
|
|
8523
8543
|
const nextuiOpacityVariable = `--${prefix}-${colorName}-opacity`;
|
|
8524
8544
|
resolved.utilities[cssSelector][nextuiColorVariable] = `${h} ${s}% ${l}%`;
|
|
@@ -8537,32 +8557,31 @@ var resolveConfig = (themes = {}, defaultTheme, prefix) => {
|
|
|
8537
8557
|
} catch (error) {
|
|
8538
8558
|
console.log("error", error == null ? void 0 : error.message);
|
|
8539
8559
|
}
|
|
8540
|
-
}
|
|
8541
|
-
(
|
|
8560
|
+
}
|
|
8561
|
+
for (const [key, value] of Object.entries(flatLayout)) {
|
|
8542
8562
|
if (!value)
|
|
8543
8563
|
return;
|
|
8564
|
+
const layoutVariablePrefix = `--${prefix}-${key}`;
|
|
8544
8565
|
if (typeof value === "object") {
|
|
8545
|
-
(
|
|
8546
|
-
const
|
|
8547
|
-
resolved.utilities[cssSelector][
|
|
8548
|
-
}
|
|
8549
|
-
} else if (key === "spacing-unit") {
|
|
8550
|
-
const layoutVariable = `--${prefix}-${key}`;
|
|
8551
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
8552
|
-
const spacingScale = generateSpacingScale(Number(value));
|
|
8553
|
-
(0, import_lodash3.default)(spacingScale, (v, k) => {
|
|
8554
|
-
const layoutVariable2 = `--${prefix}-${key}-${k}`;
|
|
8555
|
-
resolved.utilities[cssSelector][layoutVariable2] = v;
|
|
8556
|
-
});
|
|
8566
|
+
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
8567
|
+
const nestedLayoutVariable = `${layoutVariablePrefix}-${nestedKey}`;
|
|
8568
|
+
resolved.utilities[cssSelector][nestedLayoutVariable] = nestedValue;
|
|
8569
|
+
}
|
|
8557
8570
|
} else {
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8571
|
+
if (key === "spacing-unit") {
|
|
8572
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = value;
|
|
8573
|
+
const spacingScale = generateSpacingScale(Number(value));
|
|
8574
|
+
for (const [scaleKey, scaleValue] of Object.entries(spacingScale)) {
|
|
8575
|
+
const spacingVariable = `${layoutVariablePrefix}-${scaleKey}`;
|
|
8576
|
+
resolved.utilities[cssSelector][spacingVariable] = scaleValue;
|
|
8577
|
+
}
|
|
8578
|
+
} else {
|
|
8579
|
+
const formattedValue = layoutVariablePrefix.includes("opacity") && typeof value === "number" ? value.toString().replace(/^0\./, ".") : value;
|
|
8580
|
+
resolved.utilities[cssSelector][layoutVariablePrefix] = formattedValue;
|
|
8561
8581
|
}
|
|
8562
|
-
resolved.utilities[cssSelector][layoutVariable] = value;
|
|
8563
8582
|
}
|
|
8564
|
-
}
|
|
8565
|
-
}
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8566
8585
|
return resolved;
|
|
8567
8586
|
};
|
|
8568
8587
|
var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
@@ -8592,8 +8611,8 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
8592
8611
|
...baseStyles(prefix)
|
|
8593
8612
|
}
|
|
8594
8613
|
});
|
|
8595
|
-
addUtilities({ ...resolved.utilities, ...utilities });
|
|
8596
|
-
resolved.variants.forEach((variant) => {
|
|
8614
|
+
addUtilities({ ...resolved == null ? void 0 : resolved.utilities, ...utilities });
|
|
8615
|
+
resolved == null ? void 0 : resolved.variants.forEach((variant) => {
|
|
8597
8616
|
addVariant(variant.name, variant.definition);
|
|
8598
8617
|
});
|
|
8599
8618
|
},
|
|
@@ -8602,7 +8621,7 @@ var corePlugin = (themes = {}, defaultTheme, prefix, addCommonColors) => {
|
|
|
8602
8621
|
extend: {
|
|
8603
8622
|
colors: {
|
|
8604
8623
|
...addCommonColors ? commonColors : {},
|
|
8605
|
-
...resolved.colors
|
|
8624
|
+
...resolved == null ? void 0 : resolved.colors
|
|
8606
8625
|
},
|
|
8607
8626
|
scale: {
|
|
8608
8627
|
"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-DNEFEC5I.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-D4RGWEG7.mjs";
|
|
57
57
|
import {
|
|
58
58
|
kbd
|
|
59
59
|
} from "./chunk-J7FVLFSZ.mjs";
|
|
@@ -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