@nextui-org/theme 2.0.4 → 2.1.0

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.
Files changed (36) hide show
  1. package/dist/chunk-4JBYJQSP.mjs +36 -0
  2. package/dist/chunk-AYWH7THQ.mjs +606 -0
  3. package/dist/{chunk-U3S42JDF.mjs → chunk-FTF3KQBD.mjs} +2 -0
  4. package/dist/{chunk-Z6QW3RI5.mjs → chunk-PBGVMEDL.mjs} +70 -142
  5. package/dist/{chunk-PW52XQD7.mjs → chunk-RYOZQSNI.mjs} +4 -1
  6. package/dist/chunk-YJLQTC7L.mjs +0 -0
  7. package/dist/chunk-YKWIBFFV.mjs +460 -0
  8. package/dist/components/index.d.ts +3 -0
  9. package/dist/components/index.js +1161 -142
  10. package/dist/components/index.mjs +40 -20
  11. package/dist/components/input.d.ts +28 -60
  12. package/dist/components/input.js +70 -142
  13. package/dist/components/input.mjs +1 -1
  14. package/dist/components/listbox.d.ts +3 -0
  15. package/dist/components/listbox.js +582 -0
  16. package/dist/components/listbox.mjs +17 -0
  17. package/dist/components/menu.d.ts +284 -0
  18. package/dist/components/menu.js +582 -0
  19. package/dist/components/menu.mjs +16 -0
  20. package/dist/components/popover.js +2 -0
  21. package/dist/components/popover.mjs +1 -1
  22. package/dist/components/scroll-shadow.d.ts +55 -0
  23. package/dist/components/scroll-shadow.js +150 -0
  24. package/dist/components/scroll-shadow.mjs +8 -0
  25. package/dist/components/select.d.ts +553 -0
  26. package/dist/components/select.js +726 -0
  27. package/dist/components/select.mjs +12 -0
  28. package/dist/index.d.ts +3 -0
  29. package/dist/index.js +1308 -286
  30. package/dist/index.mjs +43 -23
  31. package/dist/plugin.js +3 -0
  32. package/dist/plugin.mjs +3 -3
  33. package/dist/utilities/index.mjs +2 -2
  34. package/package.json +8 -8
  35. package/dist/{chunk-PRWEADY4.mjs → chunk-RH7YHIQY.mjs} +0 -0
  36. package/dist/{chunk-DYIIRM5B.mjs → chunk-Y32IWEMZ.mjs} +3 -3
@@ -0,0 +1,582 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/listbox.ts
21
+ var listbox_exports = {};
22
+ __export(listbox_exports, {
23
+ listbox: () => menu,
24
+ listboxItem: () => menuItem,
25
+ listboxSection: () => menuSection
26
+ });
27
+ module.exports = __toCommonJS(listbox_exports);
28
+
29
+ // src/utils/tv.ts
30
+ var import_tailwind_variants = require("tailwind-variants");
31
+
32
+ // src/types.ts
33
+ var spacingScaleKeys = [
34
+ "0",
35
+ "xs",
36
+ "sm",
37
+ "md",
38
+ "lg",
39
+ "xl",
40
+ "2xl",
41
+ "3xl",
42
+ "4xl",
43
+ "5xl",
44
+ "6xl",
45
+ "7xl",
46
+ "8xl",
47
+ "9xl",
48
+ "1",
49
+ "2",
50
+ "3",
51
+ "3.5",
52
+ "4",
53
+ "5",
54
+ "6",
55
+ "7",
56
+ "8",
57
+ "9",
58
+ "10",
59
+ "11",
60
+ "12",
61
+ "13",
62
+ "14",
63
+ "15",
64
+ "16",
65
+ "17",
66
+ "18",
67
+ "20",
68
+ "24",
69
+ "28",
70
+ "32",
71
+ "36",
72
+ "40",
73
+ "44",
74
+ "48",
75
+ "52",
76
+ "56",
77
+ "60",
78
+ "64",
79
+ "72",
80
+ "80",
81
+ "96"
82
+ ];
83
+ var mappedSpacingScaleKeys = spacingScaleKeys.map((key) => `unit-${key}`);
84
+
85
+ // src/utils/tv.ts
86
+ var COMMON_UNITS = ["small", "medium", "large"];
87
+ var tv = (options, config) => {
88
+ var _a, _b, _c;
89
+ return (0, import_tailwind_variants.tv)(options, {
90
+ ...config,
91
+ twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
92
+ twMergeConfig: {
93
+ ...config == null ? void 0 : config.twMergeConfig,
94
+ theme: {
95
+ ...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
96
+ opacity: ["disabled"],
97
+ spacing: ["divider", "unit", ...mappedSpacingScaleKeys],
98
+ borderWidth: COMMON_UNITS,
99
+ borderRadius: COMMON_UNITS
100
+ },
101
+ classGroups: {
102
+ ...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
103
+ shadow: [{ shadow: COMMON_UNITS }],
104
+ "font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
105
+ "bg-image": ["bg-stripe-gradient"],
106
+ "min-w": [
107
+ {
108
+ "min-w": ["unit", ...mappedSpacingScaleKeys]
109
+ }
110
+ ],
111
+ "min-h": [
112
+ {
113
+ "min-h": ["unit", ...mappedSpacingScaleKeys]
114
+ }
115
+ ]
116
+ }
117
+ }
118
+ });
119
+ };
120
+
121
+ // src/utils/classes.ts
122
+ var dataFocusVisibleClasses = [
123
+ "outline-none",
124
+ "data-[focus-visible=true]:z-10",
125
+ "data-[focus-visible=true]:outline-2",
126
+ "data-[focus-visible=true]:outline-focus",
127
+ "data-[focus-visible=true]:outline-offset-2"
128
+ ];
129
+
130
+ // src/components/menu.ts
131
+ var menu = tv({
132
+ base: "w-full flex flex-col gap-0.5 p-1 outline-none"
133
+ });
134
+ var menuItem = tv({
135
+ slots: {
136
+ base: [
137
+ "flex",
138
+ "group",
139
+ "gap-2",
140
+ "items-center",
141
+ "justify-between",
142
+ "relative",
143
+ "px-2",
144
+ "py-1.5",
145
+ "w-full",
146
+ "h-full",
147
+ "box-border",
148
+ "rounded-small",
149
+ "subpixel-antialiased",
150
+ "outline-none",
151
+ "cursor-pointer",
152
+ "tap-highlight-transparent",
153
+ ...dataFocusVisibleClasses,
154
+ "data-[focus-visible=true]:dark:ring-offset-background-content1"
155
+ ],
156
+ wrapper: "w-full flex flex-col items-start justify-center",
157
+ title: "flex-1 text-small font-normal truncate",
158
+ description: ["w-full", "text-tiny", "text-foreground-500", "group-hover:text-current"],
159
+ selectedIcon: ["text-inherit", "w-3", "h-3", "flex-shrink-0"],
160
+ shortcut: [
161
+ "px-1",
162
+ "py-0.5",
163
+ "rounded",
164
+ "font-sans",
165
+ "text-foreground-500",
166
+ "text-tiny",
167
+ "border-small",
168
+ "border-default-300",
169
+ "group-hover:border-current"
170
+ ]
171
+ },
172
+ variants: {
173
+ variant: {
174
+ solid: {
175
+ base: ""
176
+ },
177
+ bordered: {
178
+ base: "border-medium border-transparent bg-transparent"
179
+ },
180
+ light: {
181
+ base: "bg-transparent"
182
+ },
183
+ faded: {
184
+ base: [
185
+ "border-small border-transparent hover:border-default data-[hover=true]:bg-default-100",
186
+ "data-[selectable=true]:focus:border-default data-[selectable=true]:focus:bg-default-100"
187
+ ]
188
+ },
189
+ flat: {
190
+ base: ""
191
+ },
192
+ shadow: {
193
+ base: "data-[hover=true]:shadow-lg"
194
+ }
195
+ },
196
+ color: {
197
+ default: {},
198
+ primary: {},
199
+ secondary: {},
200
+ success: {},
201
+ warning: {},
202
+ danger: {}
203
+ },
204
+ showDivider: {
205
+ true: {
206
+ base: [
207
+ "mb-1.5",
208
+ "after:content-['']",
209
+ "after:absolute",
210
+ "after:-bottom-1",
211
+ "after:left-0",
212
+ "after:right-0",
213
+ "after:h-divider",
214
+ "after:bg-divider"
215
+ ]
216
+ },
217
+ false: {}
218
+ },
219
+ isDisabled: {
220
+ true: {
221
+ base: "opacity-disabled pointer-events-none"
222
+ }
223
+ },
224
+ disableAnimation: {
225
+ true: {},
226
+ false: {}
227
+ }
228
+ },
229
+ defaultVariants: {
230
+ variant: "solid",
231
+ color: "default",
232
+ disableAnimation: false,
233
+ showDivider: false
234
+ },
235
+ compoundVariants: [
236
+ {
237
+ variant: "solid",
238
+ color: "default",
239
+ class: {
240
+ base: [
241
+ "data-[hover=true]:bg-default",
242
+ "data-[hover=true]:text-default-foreground",
243
+ "data-[selectable=true]:focus:bg-default",
244
+ "data-[selectable=true]:focus:text-default-foreground"
245
+ ]
246
+ }
247
+ },
248
+ {
249
+ variant: "solid",
250
+ color: "primary",
251
+ class: {
252
+ base: [
253
+ "data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground",
254
+ "data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"
255
+ ]
256
+ }
257
+ },
258
+ {
259
+ variant: "solid",
260
+ color: "secondary",
261
+ class: {
262
+ base: [
263
+ "data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground",
264
+ "data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"
265
+ ]
266
+ }
267
+ },
268
+ {
269
+ variant: "solid",
270
+ color: "success",
271
+ class: {
272
+ base: [
273
+ "data-[hover=true]:bg-success data-[hover=true]:text-success-foreground",
274
+ "data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"
275
+ ]
276
+ }
277
+ },
278
+ {
279
+ variant: "solid",
280
+ color: "warning",
281
+ class: {
282
+ base: [
283
+ "data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground",
284
+ "data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"
285
+ ]
286
+ }
287
+ },
288
+ {
289
+ variant: "solid",
290
+ color: "danger",
291
+ class: {
292
+ base: [
293
+ "data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground",
294
+ "data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"
295
+ ]
296
+ }
297
+ },
298
+ {
299
+ variant: "shadow",
300
+ color: "default",
301
+ class: {
302
+ base: [
303
+ "data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground",
304
+ "data-[selectable=true]:focus:shadow-default/50 data-[selectable=true]:focus:bg-default data-[selectable=true]:focus:text-default-foreground"
305
+ ]
306
+ }
307
+ },
308
+ {
309
+ variant: "shadow",
310
+ color: "primary",
311
+ class: {
312
+ base: [
313
+ "data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground",
314
+ "data-[selectable=true]:focus:shadow-primary/30 data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"
315
+ ]
316
+ }
317
+ },
318
+ {
319
+ variant: "shadow",
320
+ color: "secondary",
321
+ class: {
322
+ base: [
323
+ "data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground",
324
+ "data-[selectable=true]:focus:shadow-secondary/30 data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"
325
+ ]
326
+ }
327
+ },
328
+ {
329
+ variant: "shadow",
330
+ color: "success",
331
+ class: {
332
+ base: [
333
+ "data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground",
334
+ "data-[selectable=true]:focus:shadow-success/30 data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"
335
+ ]
336
+ }
337
+ },
338
+ {
339
+ variant: "shadow",
340
+ color: "warning",
341
+ class: {
342
+ base: [
343
+ "data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground",
344
+ "data-[selectable=true]:focus:shadow-warning/30 data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"
345
+ ]
346
+ }
347
+ },
348
+ {
349
+ variant: "shadow",
350
+ color: "danger",
351
+ class: {
352
+ base: [
353
+ "data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground",
354
+ "data-[selectable=true]:focus:shadow-danger/30 data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"
355
+ ]
356
+ }
357
+ },
358
+ {
359
+ variant: "bordered",
360
+ color: "default",
361
+ class: {
362
+ base: ["data-[hover=true]:border-default", "data-[selectable=true]:focus:border-default"]
363
+ }
364
+ },
365
+ {
366
+ variant: "bordered",
367
+ color: "primary",
368
+ class: {
369
+ base: [
370
+ "data-[hover=true]:border-primary data-[hover=true]:text-primary",
371
+ "data-[selectable=true]:focus:border-primary data-[selectable=true]:focus:text-primary"
372
+ ]
373
+ }
374
+ },
375
+ {
376
+ variant: "bordered",
377
+ color: "secondary",
378
+ class: {
379
+ base: [
380
+ "data-[hover=true]:border-secondary data-[hover=true]:text-secondary",
381
+ "data-[selectable=true]:focus:border-secondary data-[selectable=true]:focus:text-secondary"
382
+ ]
383
+ }
384
+ },
385
+ {
386
+ variant: "bordered",
387
+ color: "success",
388
+ class: {
389
+ base: [
390
+ "data-[hover=true]:border-success data-[hover=true]:text-success",
391
+ "data-[selectable=true]:focus:border-success data-[selectable=true]:focus:text-success"
392
+ ]
393
+ }
394
+ },
395
+ {
396
+ variant: "bordered",
397
+ color: "warning",
398
+ class: {
399
+ base: [
400
+ "data-[hover=true]:border-warning data-[hover=true]:text-warning",
401
+ "data-[selectable=true]:focus:border-warning data-[selectable=true]:focus:text-warning"
402
+ ]
403
+ }
404
+ },
405
+ {
406
+ variant: "bordered",
407
+ color: "danger",
408
+ class: {
409
+ base: [
410
+ "data-[hover=true]:border-danger data-[hover=true]:text-danger",
411
+ "data-[selectable=true]:focus:border-danger data-[selectable=true]:focus:text-danger"
412
+ ]
413
+ }
414
+ },
415
+ {
416
+ variant: "flat",
417
+ color: "default",
418
+ class: {
419
+ base: [
420
+ "data-[hover=true]:bg-default/40",
421
+ "data-[hover=true]:text-default-foreground",
422
+ "data-[selectable=true]:focus:bg-default/40",
423
+ "data-[selectable=true]:focus:text-default-foreground"
424
+ ]
425
+ }
426
+ },
427
+ {
428
+ variant: "flat",
429
+ color: "primary",
430
+ class: {
431
+ base: [
432
+ "data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary",
433
+ "data-[selectable=true]:focus:bg-primary/20 data-[selectable=true]:focus:text-primary"
434
+ ]
435
+ }
436
+ },
437
+ {
438
+ variant: "flat",
439
+ color: "secondary",
440
+ class: {
441
+ base: [
442
+ "data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary",
443
+ "data-[selectable=true]:focus:bg-secondary/20 data-[selectable=true]:focus:text-secondary"
444
+ ]
445
+ }
446
+ },
447
+ {
448
+ variant: "flat",
449
+ color: "success",
450
+ class: {
451
+ base: [
452
+ "data-[hover=true]:bg-success/20 data-[hover=true]:text-success",
453
+ "data-[selectable=true]:focus:bg-success/20 data-[selectable=true]:focus:text-success"
454
+ ]
455
+ }
456
+ },
457
+ {
458
+ variant: "flat",
459
+ color: "warning",
460
+ class: {
461
+ base: [
462
+ "data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning",
463
+ "data-[selectable=true]:focus:bg-warning/20 data-[selectable=true]:focus:text-warning"
464
+ ]
465
+ }
466
+ },
467
+ {
468
+ variant: "flat",
469
+ color: "danger",
470
+ class: {
471
+ base: [
472
+ "data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger",
473
+ "data-[selectable=true]:focus:bg-danger/20 data-[selectable=true]:focus:text-danger"
474
+ ]
475
+ }
476
+ },
477
+ {
478
+ variant: "faded",
479
+ color: "default",
480
+ class: {
481
+ base: [
482
+ "data-[hover=true]:text-default-foreground",
483
+ "data-[selectable=true]:focus:text-default-foreground"
484
+ ]
485
+ }
486
+ },
487
+ {
488
+ variant: "faded",
489
+ color: "primary",
490
+ class: {
491
+ base: ["data-[hover=true]:text-primary", "data-[selectable=true]:focus:text-primary"]
492
+ }
493
+ },
494
+ {
495
+ variant: "faded",
496
+ color: "secondary",
497
+ class: {
498
+ base: ["data-[hover=true]:text-secondary", "data-[selectable=true]:focus:text-secondary"]
499
+ }
500
+ },
501
+ {
502
+ variant: "faded",
503
+ color: "success",
504
+ class: {
505
+ base: ["data-[hover=true]:text-success", "data-[selectable=true]:focus:text-success"]
506
+ }
507
+ },
508
+ {
509
+ variant: "faded",
510
+ color: "warning",
511
+ class: {
512
+ base: ["data-[hover=true]:text-warning", "data-[selectable=true]:focus:text-warning"]
513
+ }
514
+ },
515
+ {
516
+ variant: "faded",
517
+ color: "danger",
518
+ class: {
519
+ base: ["data-[hover=true]:text-danger", "data-[selectable=true]:focus:text-danger"]
520
+ }
521
+ },
522
+ {
523
+ variant: "light",
524
+ color: "default",
525
+ class: {
526
+ base: [
527
+ "data-[hover=true]:text-default-500",
528
+ "data-[selectable=true]:focus:text-default-500"
529
+ ]
530
+ }
531
+ },
532
+ {
533
+ variant: "light",
534
+ color: "primary",
535
+ class: {
536
+ base: ["data-[hover=true]:text-primary", "data-[selectable=true]:focus:text-primary"]
537
+ }
538
+ },
539
+ {
540
+ variant: "light",
541
+ color: "secondary",
542
+ class: {
543
+ base: ["data-[hover=true]:text-secondary", "data-[selectable=true]:focus:text-secondary"]
544
+ }
545
+ },
546
+ {
547
+ variant: "light",
548
+ color: "success",
549
+ class: {
550
+ base: ["data-[hover=true]:text-success", "data-[selectable=true]:focus:text-success"]
551
+ }
552
+ },
553
+ {
554
+ variant: "light",
555
+ color: "warning",
556
+ class: {
557
+ base: ["data-[hover=true]:text-warning", "data-[selectable=true]:focus:text-warning"]
558
+ }
559
+ },
560
+ {
561
+ variant: "light",
562
+ color: "danger",
563
+ class: {
564
+ base: ["data-[hover=true]:text-danger", "data-[selectable=true]:focus:text-danger"]
565
+ }
566
+ }
567
+ ]
568
+ });
569
+ var menuSection = tv({
570
+ slots: {
571
+ base: "relative mb-2",
572
+ heading: "pl-1 text-tiny text-foreground-500",
573
+ group: "data-[has-title=true]:pt-1",
574
+ divider: "mt-2"
575
+ }
576
+ });
577
+ // Annotate the CommonJS export names for ESM import in node:
578
+ 0 && (module.exports = {
579
+ listbox,
580
+ listboxItem,
581
+ listboxSection
582
+ });
@@ -0,0 +1,17 @@
1
+ import "../chunk-YJLQTC7L.mjs";
2
+ import {
3
+ menu,
4
+ menuItem,
5
+ menuSection
6
+ } from "../chunk-YKWIBFFV.mjs";
7
+ import "../chunk-CMYR6AOY.mjs";
8
+ import "../chunk-K7LK7NCE.mjs";
9
+ import "../chunk-2PIR7DFM.mjs";
10
+ import "../chunk-6AEINX52.mjs";
11
+ import "../chunk-T7JNS25F.mjs";
12
+ import "../chunk-WA5F6AED.mjs";
13
+ export {
14
+ menu as listbox,
15
+ menuItem as listboxItem,
16
+ menuSection as listboxSection
17
+ };