@nextui-org/theme 0.0.0-dev-v2-20230326015909 → 0.0.0-dev-v2-20230326032643
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-OSARGUKT.mjs → chunk-BD2KW4ZD.mjs} +32 -2
- package/dist/components/button.d.ts +6 -0
- package/dist/components/button.js +32 -2
- package/dist/components/button.mjs +1 -1
- package/dist/components/index.js +32 -2
- package/dist/components/index.mjs +1 -1
- package/dist/index.js +32 -2
- package/dist/index.mjs +1 -1
- package/dist/plugin.d.ts +15 -3
- package/dist/plugin.js +20 -10
- package/dist/plugin.mjs +20 -10
- package/package.json +1 -1
|
@@ -22,7 +22,9 @@ var button = tv({
|
|
|
22
22
|
"subpixel-antialiased",
|
|
23
23
|
"active:scale-95",
|
|
24
24
|
"overflow-hidden",
|
|
25
|
-
"gap-3"
|
|
25
|
+
"gap-3",
|
|
26
|
+
"[&>svg]:fill-current",
|
|
27
|
+
"[&>svg]:max-w-[2em]"
|
|
26
28
|
],
|
|
27
29
|
variants: {
|
|
28
30
|
variant: {
|
|
@@ -72,9 +74,12 @@ var button = tv({
|
|
|
72
74
|
isInGroup: {
|
|
73
75
|
true: "[&:not(:first-child):not(:last-child)]:rounded-none"
|
|
74
76
|
},
|
|
77
|
+
isIconButton: {
|
|
78
|
+
true: "p-0 gap-0"
|
|
79
|
+
},
|
|
75
80
|
disableAnimation: {
|
|
76
81
|
true: "!transition-none",
|
|
77
|
-
false: "transition-transform-background"
|
|
82
|
+
false: "transition-transform-background motion-reduce:transition-none"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
defaultVariants: {
|
|
@@ -317,6 +322,31 @@ var button = tv({
|
|
|
317
322
|
isInGroup: true,
|
|
318
323
|
variant: "bordered",
|
|
319
324
|
class: "[&:not(:first-child)]:border-l-0"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
isIconButton: true,
|
|
328
|
+
size: "xs",
|
|
329
|
+
class: "w-6 h-6"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
isIconButton: true,
|
|
333
|
+
size: "sm",
|
|
334
|
+
class: "w-8 h-8"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
isIconButton: true,
|
|
338
|
+
size: "md",
|
|
339
|
+
class: "w-10 h-10"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
isIconButton: true,
|
|
343
|
+
size: "lg",
|
|
344
|
+
class: "w-12 h-12"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
isIconButton: true,
|
|
348
|
+
size: "xl",
|
|
349
|
+
class: "w-14 h-14"
|
|
320
350
|
}
|
|
321
351
|
]
|
|
322
352
|
});
|
|
@@ -60,6 +60,9 @@ declare const button: tailwind_variants.TVReturnType<{
|
|
|
60
60
|
isInGroup: {
|
|
61
61
|
true: string;
|
|
62
62
|
};
|
|
63
|
+
isIconButton: {
|
|
64
|
+
true: string;
|
|
65
|
+
};
|
|
63
66
|
disableAnimation: {
|
|
64
67
|
true: string;
|
|
65
68
|
false: string;
|
|
@@ -112,6 +115,9 @@ declare const button: tailwind_variants.TVReturnType<{
|
|
|
112
115
|
isInGroup: {
|
|
113
116
|
true: string;
|
|
114
117
|
};
|
|
118
|
+
isIconButton: {
|
|
119
|
+
true: string;
|
|
120
|
+
};
|
|
115
121
|
disableAnimation: {
|
|
116
122
|
true: string;
|
|
117
123
|
false: string;
|
|
@@ -125,7 +125,9 @@ var button = (0, import_tailwind_variants.tv)({
|
|
|
125
125
|
"subpixel-antialiased",
|
|
126
126
|
"active:scale-95",
|
|
127
127
|
"overflow-hidden",
|
|
128
|
-
"gap-3"
|
|
128
|
+
"gap-3",
|
|
129
|
+
"[&>svg]:fill-current",
|
|
130
|
+
"[&>svg]:max-w-[2em]"
|
|
129
131
|
],
|
|
130
132
|
variants: {
|
|
131
133
|
variant: {
|
|
@@ -175,9 +177,12 @@ var button = (0, import_tailwind_variants.tv)({
|
|
|
175
177
|
isInGroup: {
|
|
176
178
|
true: "[&:not(:first-child):not(:last-child)]:rounded-none"
|
|
177
179
|
},
|
|
180
|
+
isIconButton: {
|
|
181
|
+
true: "p-0 gap-0"
|
|
182
|
+
},
|
|
178
183
|
disableAnimation: {
|
|
179
184
|
true: "!transition-none",
|
|
180
|
-
false: "transition-transform-background"
|
|
185
|
+
false: "transition-transform-background motion-reduce:transition-none"
|
|
181
186
|
}
|
|
182
187
|
},
|
|
183
188
|
defaultVariants: {
|
|
@@ -420,6 +425,31 @@ var button = (0, import_tailwind_variants.tv)({
|
|
|
420
425
|
isInGroup: true,
|
|
421
426
|
variant: "bordered",
|
|
422
427
|
class: "[&:not(:first-child)]:border-l-0"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
isIconButton: true,
|
|
431
|
+
size: "xs",
|
|
432
|
+
class: "w-6 h-6"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
isIconButton: true,
|
|
436
|
+
size: "sm",
|
|
437
|
+
class: "w-8 h-8"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
isIconButton: true,
|
|
441
|
+
size: "md",
|
|
442
|
+
class: "w-10 h-10"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
isIconButton: true,
|
|
446
|
+
size: "lg",
|
|
447
|
+
class: "w-12 h-12"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
isIconButton: true,
|
|
451
|
+
size: "xl",
|
|
452
|
+
class: "w-14 h-14"
|
|
423
453
|
}
|
|
424
454
|
]
|
|
425
455
|
});
|
package/dist/components/index.js
CHANGED
|
@@ -648,7 +648,9 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
648
648
|
"subpixel-antialiased",
|
|
649
649
|
"active:scale-95",
|
|
650
650
|
"overflow-hidden",
|
|
651
|
-
"gap-3"
|
|
651
|
+
"gap-3",
|
|
652
|
+
"[&>svg]:fill-current",
|
|
653
|
+
"[&>svg]:max-w-[2em]"
|
|
652
654
|
],
|
|
653
655
|
variants: {
|
|
654
656
|
variant: {
|
|
@@ -698,9 +700,12 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
698
700
|
isInGroup: {
|
|
699
701
|
true: "[&:not(:first-child):not(:last-child)]:rounded-none"
|
|
700
702
|
},
|
|
703
|
+
isIconButton: {
|
|
704
|
+
true: "p-0 gap-0"
|
|
705
|
+
},
|
|
701
706
|
disableAnimation: {
|
|
702
707
|
true: "!transition-none",
|
|
703
|
-
false: "transition-transform-background"
|
|
708
|
+
false: "transition-transform-background motion-reduce:transition-none"
|
|
704
709
|
}
|
|
705
710
|
},
|
|
706
711
|
defaultVariants: {
|
|
@@ -943,6 +948,31 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
943
948
|
isInGroup: true,
|
|
944
949
|
variant: "bordered",
|
|
945
950
|
class: "[&:not(:first-child)]:border-l-0"
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
isIconButton: true,
|
|
954
|
+
size: "xs",
|
|
955
|
+
class: "w-6 h-6"
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
isIconButton: true,
|
|
959
|
+
size: "sm",
|
|
960
|
+
class: "w-8 h-8"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
isIconButton: true,
|
|
964
|
+
size: "md",
|
|
965
|
+
class: "w-10 h-10"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
isIconButton: true,
|
|
969
|
+
size: "lg",
|
|
970
|
+
class: "w-12 h-12"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
isIconButton: true,
|
|
974
|
+
size: "xl",
|
|
975
|
+
class: "w-14 h-14"
|
|
946
976
|
}
|
|
947
977
|
]
|
|
948
978
|
});
|
package/dist/index.js
CHANGED
|
@@ -670,7 +670,9 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
670
670
|
"subpixel-antialiased",
|
|
671
671
|
"active:scale-95",
|
|
672
672
|
"overflow-hidden",
|
|
673
|
-
"gap-3"
|
|
673
|
+
"gap-3",
|
|
674
|
+
"[&>svg]:fill-current",
|
|
675
|
+
"[&>svg]:max-w-[2em]"
|
|
674
676
|
],
|
|
675
677
|
variants: {
|
|
676
678
|
variant: {
|
|
@@ -720,9 +722,12 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
720
722
|
isInGroup: {
|
|
721
723
|
true: "[&:not(:first-child):not(:last-child)]:rounded-none"
|
|
722
724
|
},
|
|
725
|
+
isIconButton: {
|
|
726
|
+
true: "p-0 gap-0"
|
|
727
|
+
},
|
|
723
728
|
disableAnimation: {
|
|
724
729
|
true: "!transition-none",
|
|
725
|
-
false: "transition-transform-background"
|
|
730
|
+
false: "transition-transform-background motion-reduce:transition-none"
|
|
726
731
|
}
|
|
727
732
|
},
|
|
728
733
|
defaultVariants: {
|
|
@@ -965,6 +970,31 @@ var button = (0, import_tailwind_variants6.tv)({
|
|
|
965
970
|
isInGroup: true,
|
|
966
971
|
variant: "bordered",
|
|
967
972
|
class: "[&:not(:first-child)]:border-l-0"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
isIconButton: true,
|
|
976
|
+
size: "xs",
|
|
977
|
+
class: "w-6 h-6"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
isIconButton: true,
|
|
981
|
+
size: "sm",
|
|
982
|
+
class: "w-8 h-8"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
isIconButton: true,
|
|
986
|
+
size: "md",
|
|
987
|
+
class: "w-10 h-10"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
isIconButton: true,
|
|
991
|
+
size: "lg",
|
|
992
|
+
class: "w-12 h-12"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
isIconButton: true,
|
|
996
|
+
size: "xl",
|
|
997
|
+
class: "w-14 h-14"
|
|
968
998
|
}
|
|
969
999
|
]
|
|
970
1000
|
});
|
package/dist/index.mjs
CHANGED
package/dist/plugin.d.ts
CHANGED
|
@@ -14,12 +14,24 @@ interface ColorsWithScheme<T> extends Colors {
|
|
|
14
14
|
[SCHEME]?: T;
|
|
15
15
|
}
|
|
16
16
|
type SchemerFn<T> = (colors: Colors) => ColorsWithScheme<T>;
|
|
17
|
+
type DefaultTheme = "light" | "dark";
|
|
17
18
|
type ConfigObject = Record<string, ColorsWithScheme<"light" | "dark">>;
|
|
18
19
|
type ConfigFunction = ({ light, dark, }: {
|
|
19
20
|
light: SchemerFn<"light">;
|
|
20
21
|
dark: SchemerFn<"dark">;
|
|
21
22
|
}) => ConfigObject;
|
|
22
|
-
|
|
23
|
+
type NextUIConfig = {
|
|
24
|
+
/**
|
|
25
|
+
* The theme definitions.
|
|
26
|
+
*/
|
|
27
|
+
themes?: ConfigObject | ConfigFunction;
|
|
28
|
+
/**
|
|
29
|
+
* The default theme to use.
|
|
30
|
+
* @default "light"
|
|
31
|
+
*/
|
|
32
|
+
defaultTheme?: DefaultTheme;
|
|
33
|
+
};
|
|
34
|
+
declare const resolveConfig: (config: ConfigObject | ConfigFunction | undefined, defaultTheme: DefaultTheme) => {
|
|
23
35
|
variants: {
|
|
24
36
|
name: string;
|
|
25
37
|
definition: string[];
|
|
@@ -30,9 +42,9 @@ declare const resolveConfig: (config?: ConfigObject | ConfigFunction) => {
|
|
|
30
42
|
opacityVariable: string;
|
|
31
43
|
}) => string>;
|
|
32
44
|
};
|
|
33
|
-
declare const nextui: (config?:
|
|
45
|
+
declare const nextui: (config?: NextUIConfig) => {
|
|
34
46
|
handler: tailwindcss_types_config.PluginCreator;
|
|
35
47
|
config?: Partial<tailwindcss.Config> | undefined;
|
|
36
48
|
};
|
|
37
49
|
|
|
38
|
-
export { Colors, ColorsWithScheme, ConfigFunction, ConfigObject, nextui, resolveConfig };
|
|
50
|
+
export { Colors, ColorsWithScheme, ConfigFunction, ConfigObject, DefaultTheme, NextUIConfig, nextui, resolveConfig };
|
package/dist/plugin.js
CHANGED
|
@@ -460,7 +460,7 @@ var light = (colors2) => {
|
|
|
460
460
|
...colors2
|
|
461
461
|
};
|
|
462
462
|
};
|
|
463
|
-
var resolveConfig = (config = {}) => {
|
|
463
|
+
var resolveConfig = (config = {}, defaultTheme) => {
|
|
464
464
|
const resolved = {
|
|
465
465
|
variants: [],
|
|
466
466
|
utilities: {},
|
|
@@ -468,7 +468,10 @@ var resolveConfig = (config = {}) => {
|
|
|
468
468
|
};
|
|
469
469
|
const configObject = typeof config === "function" ? config({ dark, light }) : config;
|
|
470
470
|
(0, import_lodash.default)(configObject, (colors2, themeName) => {
|
|
471
|
-
|
|
471
|
+
let cssSelector = `.${themeName},.theme-${themeName},[data-theme="${themeName}"]`;
|
|
472
|
+
if (themeName === defaultTheme) {
|
|
473
|
+
cssSelector = `:root,${cssSelector}`;
|
|
474
|
+
}
|
|
472
475
|
resolved.utilities[cssSelector] = colors2[SCHEME] ? {
|
|
473
476
|
"color-scheme": colors2[SCHEME]
|
|
474
477
|
} : {};
|
|
@@ -509,8 +512,8 @@ var resolveConfig = (config = {}) => {
|
|
|
509
512
|
});
|
|
510
513
|
return resolved;
|
|
511
514
|
};
|
|
512
|
-
var corePlugin = (config = {}) => {
|
|
513
|
-
const resolved = resolveConfig(config);
|
|
515
|
+
var corePlugin = (config = {}, defaultTheme) => {
|
|
516
|
+
const resolved = resolveConfig(config, defaultTheme);
|
|
514
517
|
return (0, import_plugin.default)(
|
|
515
518
|
({ addBase, addUtilities, addVariant }) => {
|
|
516
519
|
addBase({
|
|
@@ -550,13 +553,20 @@ var corePlugin = (config = {}) => {
|
|
|
550
553
|
);
|
|
551
554
|
};
|
|
552
555
|
var nextui = (config = {}) => {
|
|
553
|
-
const userLightColors = (0, import_lodash2.default)(config, "light", {});
|
|
554
|
-
const userDarkColors = (0, import_lodash2.default)(config, "dark", {});
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
556
|
+
const userLightColors = (0, import_lodash2.default)(config.themes, "light", {});
|
|
557
|
+
const userDarkColors = (0, import_lodash2.default)(config.themes, "dark", {});
|
|
558
|
+
const defaultTheme = config.defaultTheme || "light";
|
|
559
|
+
return corePlugin(
|
|
560
|
+
{
|
|
561
|
+
light: (0, import_deepmerge.default)(semanticColors.light, userLightColors),
|
|
562
|
+
dark: (0, import_deepmerge.default)(semanticColors.dark, userDarkColors)
|
|
563
|
+
},
|
|
564
|
+
defaultTheme
|
|
565
|
+
);
|
|
559
566
|
};
|
|
567
|
+
nextui({
|
|
568
|
+
defaultTheme: "light"
|
|
569
|
+
});
|
|
560
570
|
// Annotate the CommonJS export names for ESM import in node:
|
|
561
571
|
0 && (module.exports = {
|
|
562
572
|
nextui,
|
package/dist/plugin.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var light = (colors) => {
|
|
|
48
48
|
...colors
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
var resolveConfig = (config = {}) => {
|
|
51
|
+
var resolveConfig = (config = {}, defaultTheme) => {
|
|
52
52
|
const resolved = {
|
|
53
53
|
variants: [],
|
|
54
54
|
utilities: {},
|
|
@@ -56,7 +56,10 @@ var resolveConfig = (config = {}) => {
|
|
|
56
56
|
};
|
|
57
57
|
const configObject = typeof config === "function" ? config({ dark, light }) : config;
|
|
58
58
|
forEach(configObject, (colors, themeName) => {
|
|
59
|
-
|
|
59
|
+
let cssSelector = `.${themeName},.theme-${themeName},[data-theme="${themeName}"]`;
|
|
60
|
+
if (themeName === defaultTheme) {
|
|
61
|
+
cssSelector = `:root,${cssSelector}`;
|
|
62
|
+
}
|
|
60
63
|
resolved.utilities[cssSelector] = colors[SCHEME] ? {
|
|
61
64
|
"color-scheme": colors[SCHEME]
|
|
62
65
|
} : {};
|
|
@@ -97,8 +100,8 @@ var resolveConfig = (config = {}) => {
|
|
|
97
100
|
});
|
|
98
101
|
return resolved;
|
|
99
102
|
};
|
|
100
|
-
var corePlugin = (config = {}) => {
|
|
101
|
-
const resolved = resolveConfig(config);
|
|
103
|
+
var corePlugin = (config = {}, defaultTheme) => {
|
|
104
|
+
const resolved = resolveConfig(config, defaultTheme);
|
|
102
105
|
return plugin(
|
|
103
106
|
({ addBase, addUtilities, addVariant }) => {
|
|
104
107
|
addBase({
|
|
@@ -138,13 +141,20 @@ var corePlugin = (config = {}) => {
|
|
|
138
141
|
);
|
|
139
142
|
};
|
|
140
143
|
var nextui = (config = {}) => {
|
|
141
|
-
const userLightColors = get(config, "light", {});
|
|
142
|
-
const userDarkColors = get(config, "dark", {});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
const userLightColors = get(config.themes, "light", {});
|
|
145
|
+
const userDarkColors = get(config.themes, "dark", {});
|
|
146
|
+
const defaultTheme = config.defaultTheme || "light";
|
|
147
|
+
return corePlugin(
|
|
148
|
+
{
|
|
149
|
+
light: deepMerge(semanticColors.light, userLightColors),
|
|
150
|
+
dark: deepMerge(semanticColors.dark, userDarkColors)
|
|
151
|
+
},
|
|
152
|
+
defaultTheme
|
|
153
|
+
);
|
|
147
154
|
};
|
|
155
|
+
nextui({
|
|
156
|
+
defaultTheme: "light"
|
|
157
|
+
});
|
|
148
158
|
export {
|
|
149
159
|
nextui,
|
|
150
160
|
resolveConfig
|