@code-id-labs/plugin-vite 1.0.0 → 1.0.2

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/index.cjs CHANGED
@@ -482,13 +482,13 @@ function accordionItemTheme(_options = {}) {
482
482
  function actionSheetTheme(_options = {}) {
483
483
  return defineTheme({
484
484
  slots: {
485
- root: "fixed inset-0 z-50 flex items-end justify-center overflow-hidden overscroll-contain box-border",
485
+ root: "fixed inset-0 z-action-sheet flex items-end justify-center overflow-hidden overscroll-contain box-border",
486
486
  backdrop: "cui-action-sheet-backdrop-enter fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300",
487
487
  content: "cui-action-sheet-content-enter relative z-10 flex flex-col w-full max-h-[85vh] bg-elevated rounded-t-lg shadow-2xl transition-transform duration-300 ease-out box-border overflow-hidden translate-y-0",
488
488
  header: "relative flex flex-col items-center justify-center px-6 py-4 bg-default text-center border-b border-muted shrink-0 w-full box-border",
489
- title: "text-xs font-semibold uppercase tracking-wider text-dimmed text-center leading-snug",
490
- description: "text-xs text-muted text-center mt-1 leading-normal",
491
- closeTrigger: "absolute right-3.5 top-3.5 inline-flex items-center justify-center w-7 h-7 rounded-full bg-elevated text-muted shrink-0 cursor-pointer active:opacity-70 transition-opacity",
489
+ title: "w-full max-w-full break-words text-xs font-semibold uppercase tracking-wider text-dimmed text-center leading-snug",
490
+ description: "w-full max-w-full break-words text-xs text-muted text-center mt-1 leading-normal",
491
+ closeTrigger: "absolute right-3.5 top-3.5 z-10 inline-flex items-center justify-center w-7 h-7 rounded-full bg-elevated text-muted shrink-0 cursor-pointer active:opacity-70 transition-opacity",
492
492
  closeButton: "p-0 w-full h-full rounded-full text-inherit",
493
493
  closeIcon: "w-4 h-4",
494
494
  body: "flex flex-col w-full bg-default overflow-y-auto max-h-[60vh] overscroll-contain box-border",
@@ -518,6 +518,10 @@ function actionSheetTheme(_options = {}) {
518
518
  itemDescription: "opacity-75"
519
519
  },
520
520
  false: {}
521
+ },
522
+ closable: {
523
+ true: { header: "px-14 min-h-14" },
524
+ false: {}
521
525
  }
522
526
  },
523
527
  compoundVariants: [{
@@ -529,25 +533,26 @@ function actionSheetTheme(_options = {}) {
529
533
  }],
530
534
  defaultVariants: {
531
535
  open: false,
532
- disabled: false
536
+ disabled: false,
537
+ closable: false
533
538
  }
534
539
  });
535
540
  }
536
541
  function appTheme(_options = {}) {
537
542
  return defineTheme({
538
543
  slots: {
539
- root: "relative flex flex-col min-h-screen box-border text-default transition-[padding,background-color] duration-300",
540
- scaleWrapper: "w-full flex-1 flex flex-col box-border bg-default text-default transform-origin-top transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
544
+ root: "relative flex flex-col min-h-screen box-border text-default transition-colors duration-300",
545
+ scaleWrapper: "w-full flex-1 flex flex-col box-border bg-default text-default origin-top transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
541
546
  toaster: "fixed z-[100] pointer-events-none"
542
547
  },
543
548
  variants: { scaled: {
544
549
  true: {
545
550
  root: "bg-black",
546
- scaleWrapper: "overflow-hidden rounded-md shadow-2xl"
551
+ scaleWrapper: ""
547
552
  },
548
553
  false: {
549
554
  root: "bg-default",
550
- scaleWrapper: "rounded-none shadow-none"
555
+ scaleWrapper: ""
551
556
  }
552
557
  } },
553
558
  defaultVariants: { scaled: false }
@@ -1534,8 +1539,8 @@ function dividerTheme(options = {}) {
1534
1539
  function drawerTheme(_options = {}) {
1535
1540
  return defineTheme({
1536
1541
  slots: {
1537
- root: "fixed inset-0 z-50 flex overflow-hidden overscroll-contain box-border",
1538
- backdrop: "fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300",
1542
+ root: "fixed inset-0 z-drawer flex overflow-hidden overscroll-contain box-border transition-[padding-bottom] duration-150 ease-out",
1543
+ backdrop: "fixed inset-0 bg-black/40 transition-opacity duration-300",
1539
1544
  content: "relative z-10 flex bg-default shadow-2xl transition-transform duration-300 ease-out box-border overflow-hidden",
1540
1545
  container: "flex flex-col min-w-0 min-h-0 overflow-hidden",
1541
1546
  grabber: "flex items-center justify-center cursor-grab active:cursor-grabbing shrink-0 box-border",
@@ -1545,7 +1550,7 @@ function drawerTheme(_options = {}) {
1545
1550
  closeTrigger: "inline-flex items-center justify-center w-8 h-8 rounded-full text-dimmed hover:text-default hover:bg-elevated transition-colors shrink-0",
1546
1551
  closeButton: "p-0 w-full h-full rounded-full text-inherit",
1547
1552
  closeIcon: "w-4 h-4",
1548
- body: "flex-1 min-h-0 w-full box-border overflow-y-auto px-4 pt-3 pb-6 text-sm text-toned overscroll-contain",
1553
+ body: "min-h-0 w-full box-border overflow-y-auto px-4 pt-3 pb-6 text-sm text-toned overscroll-contain",
1549
1554
  footer: "flex items-center justify-end gap-2 px-4 py-3 border-t border-muted shrink-0 box-border w-full pb-[calc(var(--spacing)_*_3_+_env(safe-area-inset-bottom))]"
1550
1555
  },
1551
1556
  variants: {
@@ -1553,14 +1558,16 @@ function drawerTheme(_options = {}) {
1553
1558
  bottom: {
1554
1559
  root: "items-end justify-center",
1555
1560
  content: "flex-col w-full max-h-[85vh] rounded-t-xl",
1556
- container: "w-full flex-1",
1561
+ container: "w-full flex-initial",
1562
+ body: "flex-initial max-h-[60vh]",
1557
1563
  grabber: "w-full py-2.5",
1558
1564
  grabberBar: "w-12 h-1.5"
1559
1565
  },
1560
1566
  top: {
1561
1567
  root: "items-start justify-center",
1562
1568
  content: "flex-col w-full max-h-[85vh] rounded-b-xl",
1563
- container: "w-full flex-1",
1569
+ container: "w-full flex-initial",
1570
+ body: "flex-initial max-h-[60vh]",
1564
1571
  grabber: "w-full py-2.5",
1565
1572
  grabberBar: "w-12 h-1.5",
1566
1573
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]",
@@ -1568,18 +1575,18 @@ function drawerTheme(_options = {}) {
1568
1575
  },
1569
1576
  left: {
1570
1577
  root: "items-center justify-start",
1571
- content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-r-xl",
1578
+ content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-none",
1572
1579
  container: "flex-1 h-full",
1573
- body: "h-0",
1580
+ body: "flex-1 h-0",
1574
1581
  grabber: "h-full px-2.5",
1575
1582
  grabberBar: "w-1.5 h-12",
1576
1583
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]"
1577
1584
  },
1578
1585
  right: {
1579
1586
  root: "items-center justify-end",
1580
- content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-l-xl",
1587
+ content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-none",
1581
1588
  container: "flex-1 h-full",
1582
- body: "h-0",
1589
+ body: "flex-1 h-0",
1583
1590
  grabber: "h-full px-2.5",
1584
1591
  grabberBar: "w-1.5 h-12",
1585
1592
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]"
@@ -1591,9 +1598,29 @@ function drawerTheme(_options = {}) {
1591
1598
  content: "cui-drawer-open"
1592
1599
  },
1593
1600
  false: { backdrop: "opacity-0 pointer-events-none" }
1601
+ },
1602
+ keyboardOpen: {
1603
+ true: { footer: "pb-3" },
1604
+ false: {}
1594
1605
  }
1595
1606
  },
1596
1607
  compoundVariants: [
1608
+ {
1609
+ placement: "bottom",
1610
+ keyboardOpen: true,
1611
+ class: {
1612
+ content: "max-h-[calc(100%_-_env(safe-area-inset-top))]",
1613
+ body: "max-h-[calc(100vh_-_var(--keyboard-height,0px)_-_env(safe-area-inset-top,0px)_-_10rem)]"
1614
+ }
1615
+ },
1616
+ {
1617
+ placement: "top",
1618
+ keyboardOpen: true,
1619
+ class: {
1620
+ content: "max-h-full",
1621
+ body: "max-h-[calc(100vh_-_var(--keyboard-height,0px)_-_env(safe-area-inset-top,0px)_-_10rem)]"
1622
+ }
1623
+ },
1597
1624
  {
1598
1625
  placement: "bottom",
1599
1626
  open: true,
@@ -1637,7 +1664,8 @@ function drawerTheme(_options = {}) {
1637
1664
  ],
1638
1665
  defaultVariants: {
1639
1666
  placement: "bottom",
1640
- open: true
1667
+ open: true,
1668
+ keyboardOpen: false
1641
1669
  }
1642
1670
  });
1643
1671
  }
@@ -1665,7 +1693,18 @@ function fileUploadTheme(options = {}) {
1665
1693
  fileIcon: "w-5 h-5 text-dimmed",
1666
1694
  fileRemove: "flex items-center justify-center rounded-lg text-dimmed hover:text-default transition-colors p-1",
1667
1695
  fileRemoveIcon: "w-4 h-4",
1668
- fileProgress: "w-full mt-1.5"
1696
+ fileProgress: "w-full mt-1.5",
1697
+ previewOverlay: "fixed inset-0 z-modal bg-black/95 flex flex-col select-none",
1698
+ previewHeader: "relative z-10 flex items-center justify-between px-4 pb-3 pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))] text-white shrink-0",
1699
+ previewCounter: "text-sm font-medium text-white/90 tabular-nums px-2.5 py-1 rounded-full bg-white/15",
1700
+ previewClose: "flex items-center justify-center w-9 h-9 rounded-full bg-white/15 text-white active:bg-white/25 transition-colors",
1701
+ previewCloseIcon: "w-5 h-5 text-white",
1702
+ previewSwiper: "flex-1 w-full h-0 min-h-0",
1703
+ previewSlide: "w-full h-full flex items-center justify-center px-3 box-border",
1704
+ previewImage: "w-full h-full block",
1705
+ previewFooter: "relative z-10 flex flex-col gap-0.5 px-4 pt-3 pb-[calc(var(--spacing)_*_4_+_env(safe-area-inset-bottom))] text-center shrink-0 bg-black/60",
1706
+ previewName: "text-sm font-medium text-white truncate",
1707
+ previewMeta: "text-xs text-white/70"
1669
1708
  },
1670
1709
  variants: {
1671
1710
  color: Object.assign(Object.fromEntries(colors.map((color) => [color, { dropzone: `focus:border-${color} focus:ring-2 focus:ring-${color}/20` }])), { neutral: { dropzone: "focus:border-inverted focus:ring-2 focus:ring-inverted/20" } }),
@@ -1795,7 +1834,7 @@ function popoverTheme(_options = {}) {
1795
1834
  root: "relative",
1796
1835
  trigger: "relative",
1797
1836
  backdrop: "fixed inset-0 z-40 bg-transparent",
1798
- positioner: "z-50 box-border",
1837
+ positioner: "z-popover box-border",
1799
1838
  content: "relative w-full rounded-md bg-default text-default shadow-lg ring-1 ring-default box-border transition-all duration-150 ease-out",
1800
1839
  body: "relative w-full overflow-hidden rounded-[inherit] bg-inherit",
1801
1840
  arrow: "absolute w-2.5 h-2.5 bg-default border-default pointer-events-none"
@@ -2157,7 +2196,7 @@ function inputMenuTheme(options = {}) {
2157
2196
  true: {
2158
2197
  base: "h-auto py-1",
2159
2198
  tagsWrapper: "flex-wrap gap-y-1",
2160
- nativeInput: "min-w-[60px] h-6"
2199
+ nativeInput: "min-w-[80px] w-auto h-6"
2161
2200
  },
2162
2201
  false: {}
2163
2202
  },
@@ -2365,7 +2404,7 @@ function inputMenuItemTheme(options = {}) {
2365
2404
  function modalTheme(_options = {}) {
2366
2405
  return defineTheme({
2367
2406
  slots: {
2368
- root: "fixed inset-0 z-50 box-border overscroll-contain",
2407
+ root: "fixed inset-0 z-modal box-border overscroll-contain",
2369
2408
  trigger: "inline-flex",
2370
2409
  overlay: "fixed inset-0 bg-black/35 backdrop-blur-md",
2371
2410
  container: "relative z-10 w-full flex items-center justify-center box-border",
@@ -2748,7 +2787,7 @@ function pullDownRefreshTheme(_options = {}) {
2748
2787
  },
2749
2788
  variants: {
2750
2789
  disabled: {
2751
- true: { root: "opacity-60" },
2790
+ true: {},
2752
2791
  false: {}
2753
2792
  },
2754
2793
  status: {
@@ -3014,7 +3053,7 @@ function selectTheme(options = {}) {
3014
3053
  header: "px-2.5 py-2 border-b border-muted",
3015
3054
  footer: "px-2.5 py-2 border-t border-muted",
3016
3055
  empty: "py-6 px-3 text-center text-sm text-muted",
3017
- pickerRoot: "fixed inset-0 z-50 flex items-end justify-center overflow-hidden overscroll-contain box-border",
3056
+ pickerRoot: "fixed inset-0 z-picker flex items-end justify-center overflow-hidden overscroll-contain box-border",
3018
3057
  pickerBackdrop: "fixed inset-0 bg-black/40 transition-opacity duration-250",
3019
3058
  pickerContent: "relative z-10 flex flex-col w-full bg-default rounded-t-md shadow-2xl transition-transform duration-250 ease-out box-border overflow-hidden pb-[env(safe-area-inset-bottom)]",
3020
3059
  pickerHeader: "flex items-center justify-between px-4 py-3 border-b border-muted shrink-0 box-border w-full",
@@ -3258,7 +3297,7 @@ function sliderTheme(options = {}) {
3258
3297
  range: "absolute rounded-full transition-all duration-75",
3259
3298
  thumb: "absolute rounded-full bg-white shadow-md ring-1 ring-black/5 flex items-center justify-center transition-[transform,shadow] duration-75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
3260
3299
  markerGroup: "absolute inset-0 pointer-events-none",
3261
- marker: "absolute flex flex-col items-center -translate-x-1/2 text-dimmed font-medium",
3300
+ marker: "absolute flex flex-col items-center text-dimmed font-medium",
3262
3301
  markerTick: "w-1 h-1 rounded-full bg-default",
3263
3302
  markerTickActive: "bg-white/90",
3264
3303
  markerLabel: "mt-2 tabular-nums select-none",
@@ -3657,7 +3696,7 @@ function switchTheme(options = {}) {
3657
3696
  true: { icon: "opacity-100" },
3658
3697
  false: {
3659
3698
  base: "bg-accented",
3660
- thumb: "translate-x-0 rtl:-translate-x-0",
3699
+ thumb: "translate-x-0",
3661
3700
  icon: "opacity-0"
3662
3701
  }
3663
3702
  },
@@ -3702,27 +3741,27 @@ function switchTheme(options = {}) {
3702
3741
  {
3703
3742
  size: "xs",
3704
3743
  checked: true,
3705
- class: { thumb: "translate-x-3 rtl:-translate-x-3" }
3744
+ class: { thumb: "translate-x-3" }
3706
3745
  },
3707
3746
  {
3708
3747
  size: "sm",
3709
3748
  checked: true,
3710
- class: { thumb: "translate-x-3.5 rtl:-translate-x-3.5" }
3749
+ class: { thumb: "translate-x-3.5" }
3711
3750
  },
3712
3751
  {
3713
3752
  size: "md",
3714
3753
  checked: true,
3715
- class: { thumb: "translate-x-4 rtl:-translate-x-4" }
3754
+ class: { thumb: "translate-x-4" }
3716
3755
  },
3717
3756
  {
3718
3757
  size: "lg",
3719
3758
  checked: true,
3720
- class: { thumb: "translate-x-4.5 rtl:-translate-x-4.5" }
3759
+ class: { thumb: "translate-x-4.5" }
3721
3760
  },
3722
3761
  {
3723
3762
  size: "xl",
3724
3763
  checked: true,
3725
- class: { thumb: "translate-x-5 rtl:-translate-x-5" }
3764
+ class: { thumb: "translate-x-5" }
3726
3765
  }
3727
3766
  ],
3728
3767
  defaultVariants: {
@@ -3742,8 +3781,8 @@ function swipeCellTheme(_options = {}) {
3742
3781
  root: "relative overflow-hidden w-full select-none touch-pan-y box-border",
3743
3782
  wrapper: "relative flex flex-row w-full transition-transform duration-300 ease-out will-change-transform box-border",
3744
3783
  content: "relative z-10 w-full shrink-0 bg-default box-border",
3745
- left: "absolute left-0 top-0 bottom-0 z-0 flex flex-row h-full -translate-x-full box-border",
3746
- right: "absolute right-0 top-0 bottom-0 z-0 flex flex-row h-full translate-x-full box-border",
3784
+ left: "absolute left-0 top-0 bottom-0 z-0 flex flex-row h-full box-border",
3785
+ right: "absolute right-0 top-0 bottom-0 z-0 flex flex-row h-full box-border",
3747
3786
  action: "flex flex-row items-center justify-center h-full text-white transition-opacity active:opacity-85 select-none cursor-pointer box-border font-medium",
3748
3787
  actionText: "font-medium leading-none",
3749
3788
  actionIcon: "shrink-0"
@@ -3902,12 +3941,12 @@ function tabsItemTheme(options = {}) {
3902
3941
  slots: {
3903
3942
  root: "w-full focus:outline-none",
3904
3943
  content: "w-full",
3905
- trigger: "relative flex flex-row items-center justify-center font-medium transition-colors duration-200 select-none shrink-0 whitespace-nowrap z-[1] cursor-pointer focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:pointer-events-none",
3944
+ trigger: "relative flex flex-row items-center justify-center font-medium transition-colors duration-100 select-none shrink-0 whitespace-nowrap z-[1] cursor-pointer focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:pointer-events-none",
3906
3945
  triggerInner: "relative z-10 flex flex-row items-center justify-center gap-1.5 min-w-0",
3907
3946
  leading: "relative z-10 shrink-0",
3908
3947
  label: "relative z-10 truncate",
3909
3948
  trailing: "relative z-10 shrink-0",
3910
- indicator: "absolute pointer-events-none transition-all duration-200 ease-out origin-center"
3949
+ indicator: "absolute pointer-events-none transition-[transform,opacity] duration-100 ease-out origin-center"
3911
3950
  },
3912
3951
  variants: {
3913
3952
  color: Object.assign(Object.fromEntries(colors.map((color) => [color, {}])), { neutral: {} }),
@@ -4350,9 +4389,9 @@ function toastTheme(options = {}) {
4350
4389
  vertical: {}
4351
4390
  },
4352
4391
  placement: {
4353
- top: { root: "fixed top-0 left-1/2 -translate-x-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" },
4354
- center: { root: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md z-[100]" },
4355
- bottom: { root: "fixed bottom-0 left-1/2 -translate-x-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4392
+ top: { root: "fixed top-0 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" },
4393
+ center: { root: "fixed top-1/2 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md z-[100]" },
4394
+ bottom: { root: "fixed bottom-0 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4356
4395
  },
4357
4396
  progressPosition: {
4358
4397
  top: { progress: "top-0" },
@@ -4374,17 +4413,17 @@ function toastTheme(options = {}) {
4374
4413
  {
4375
4414
  mode: "native",
4376
4415
  placement: "top",
4377
- class: { root: "fixed top-0 left-1/2 -translate-x-1/2 w-auto mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" }
4416
+ class: { root: "fixed top-0 left-1/2 w-auto mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" }
4378
4417
  },
4379
4418
  {
4380
4419
  mode: "native",
4381
4420
  placement: "center",
4382
- class: { root: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-auto z-[100]" }
4421
+ class: { root: "fixed top-1/2 left-1/2 w-auto z-[100]" }
4383
4422
  },
4384
4423
  {
4385
4424
  mode: "native",
4386
4425
  placement: "bottom",
4387
- class: { root: "fixed bottom-0 left-1/2 -translate-x-1/2 w-auto mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4426
+ class: { root: "fixed bottom-0 left-1/2 w-auto mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4388
4427
  },
4389
4428
  ...colors.map((color) => ({
4390
4429
  color,
@@ -5266,8 +5305,26 @@ function generateThemeCSS(ui) {
5266
5305
  rootLines.push(" --tw-translate-x: 0;");
5267
5306
  rootLines.push(" --tw-translate-y: 0;");
5268
5307
  rootLines.push(" --tw-translate-z: 0;");
5308
+ const configuredZIndex = {
5309
+ popover: 50,
5310
+ drawer: 100,
5311
+ modal: 110,
5312
+ actionSheet: 120,
5313
+ picker: 130,
5314
+ banner: 140,
5315
+ toast: 150,
5316
+ ...ui?.zIndex
5317
+ };
5318
+ const zUtilityBlocks = [];
5319
+ for (const [zKey, zVal] of Object.entries(configuredZIndex)) {
5320
+ if (zVal === void 0 || zVal === null || zVal === "") continue;
5321
+ const kebabKey = zKey.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
5322
+ rootLines.push(` --z-${kebabKey}: ${zVal};`);
5323
+ zUtilityBlocks.push(`.z-${kebabKey} {\n z-index: var(--z-${kebabKey}, ${zVal});\n}`);
5324
+ }
5269
5325
  if (colorMode === "dark") rootLines.push(...darkLines);
5270
5326
  let css = `${THEME_TAG}\n@theme default inline {\n${themeLines.join("\n")}\n}\n\n:root, page, :host {\n${rootLines.join("\n")}\n}\n`;
5327
+ if (zUtilityBlocks.length > 0) css += `\n${zUtilityBlocks.join("\n\n")}\n`;
5271
5328
  if (colorMode === "system" && darkLines.length > 0) css += `\n@media (prefers-color-scheme: dark) {\n :root, page, :host {\n ${darkLines.join("\n ")}\n }\n}\n\npage[data-theme="light"], .light, [data-theme="light"] {\n${lightResetLines.join("\n")}\n}\n\npage[data-theme="dark"], .dark, [data-theme="dark"] {\n${darkLines.join("\n")}\n}\n`;
5272
5329
  return css;
5273
5330
  }
@@ -7517,9 +7574,9 @@ function syncDiskSlotDetect(rootDir, outDir, opts) {
7517
7574
  function compatMiniProgramTransforms(css) {
7518
7575
  if (!css.includes("translate:") && !css.includes("scale:") && !css.includes("rotate:")) return css;
7519
7576
  let result = css;
7520
- if (result.includes("translate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*translate\s*\([^;}]+\)\s*;\s*)*translate\s*:\s*var\(--tw-translate-x\)\s+var\(--tw-translate-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}translate: var(--tw-translate-x) var(--tw-translate-y);`);
7521
- if (result.includes("scale:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*scale\s*\([^;}]+\)\s*;\s*)*scale\s*:\s*var\(--tw-scale-x\)\s+var\(--tw-scale-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}scale: var(--tw-scale-x) var(--tw-scale-y);`);
7522
- if (result.includes("rotate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*rotate\s*\([^;}]+\)\s*;\s*)*(?<![\w-])rotate\s*:\s*([^;}]+?)\s*(?:;|(?=\s*\}))/g, (_, indent, val) => `${indent}-webkit-transform: rotate(${val});\n${indent}transform: rotate(${val});\n${indent}rotate: ${val};`);
7577
+ if (result.includes("translate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*translate\s*\([^;}]+\)\s*;\s*)*translate\s*:\s*var\(--tw-translate-x\)\s+var\(--tw-translate-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));`);
7578
+ if (result.includes("scale:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*scale\s*\([^;}]+\)\s*;\s*)*scale\s*:\s*var\(--tw-scale-x\)\s+var\(--tw-scale-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));`);
7579
+ if (result.includes("rotate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*rotate\s*\([^;}]+\)\s*;\s*)*(?<![\w-])rotate\s*:\s*([^;}]+?)\s*(?:;|(?=\s*\}))/g, (_, indent, val) => `${indent}-webkit-transform: rotate(${val});\n${indent}transform: rotate(${val});`);
7523
7580
  return result;
7524
7581
  }
7525
7582
  const SEMANTIC_UTILITY_RE = /(?:^|[\s,.]|_[a-zA-Z])(?:bg|text|border|ring|divide|outline|fill|stroke|accent|caret|from|via|to)-(primary|secondary|success|warning|danger|info)(?:-(\d{2,3}))?(?:_f(\d+))?(?=$|[\s.,:[>+~{])/g;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "vite";
2
- //#region ../core/dist/icons-78wOszBL.d.ts
2
+ //#region ../core/dist/icons-CGWn5Sxv.d.ts
3
3
  //#region src/theme.d.ts
4
4
  type ThemeSlots = Record<string, string>;
5
5
  type ThemeVariants = Record<string, Record<string, Record<string, string> | string | Record<string, unknown>>>;
@@ -164,13 +164,21 @@ declare function actionSheetTheme(_options?: ThemeOptions): ThemeDefinition<{
164
164
  };
165
165
  false: {};
166
166
  };
167
+ closable: {
168
+ true: {
169
+ header: string;
170
+ };
171
+ false: {};
172
+ };
167
173
  }, {
168
174
  open: false;
169
175
  disabled: false;
176
+ closable: false;
170
177
  }> & {
171
178
  defaultVariants: {
172
179
  open: false;
173
180
  disabled: false;
181
+ closable: false;
174
182
  };
175
183
  };
176
184
  //#endregion
@@ -1029,6 +1037,7 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1029
1037
  root: string;
1030
1038
  content: string;
1031
1039
  container: string;
1040
+ body: string;
1032
1041
  grabber: string;
1033
1042
  grabberBar: string;
1034
1043
  };
@@ -1036,6 +1045,7 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1036
1045
  root: string;
1037
1046
  content: string;
1038
1047
  container: string;
1048
+ body: string;
1039
1049
  grabber: string;
1040
1050
  grabberBar: string;
1041
1051
  header: string;
@@ -1069,13 +1079,21 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1069
1079
  backdrop: string;
1070
1080
  };
1071
1081
  };
1082
+ keyboardOpen: {
1083
+ true: {
1084
+ footer: string;
1085
+ };
1086
+ false: {};
1087
+ };
1072
1088
  }, {
1073
1089
  placement: "bottom";
1074
1090
  open: true;
1091
+ keyboardOpen: false;
1075
1092
  }> & {
1076
1093
  defaultVariants: {
1077
1094
  placement: "bottom";
1078
1095
  open: true;
1096
+ keyboardOpen: false;
1079
1097
  };
1080
1098
  };
1081
1099
  //#endregion
@@ -1101,6 +1119,17 @@ declare function fileUploadTheme(options?: ThemeOptions): ThemeDefinition<{
1101
1119
  fileRemove: string;
1102
1120
  fileRemoveIcon: string;
1103
1121
  fileProgress: string;
1122
+ previewOverlay: string;
1123
+ previewHeader: string;
1124
+ previewCounter: string;
1125
+ previewClose: string;
1126
+ previewCloseIcon: string;
1127
+ previewSwiper: string;
1128
+ previewSlide: string;
1129
+ previewImage: string;
1130
+ previewFooter: string;
1131
+ previewName: string;
1132
+ previewMeta: string;
1104
1133
  }, {
1105
1134
  color: {
1106
1135
  [k: string]: {
@@ -2250,9 +2279,7 @@ declare function pullDownRefreshTheme(_options?: ThemeOptions): ThemeDefinition<
2250
2279
  content: string;
2251
2280
  }, {
2252
2281
  disabled: {
2253
- true: {
2254
- root: string;
2255
- };
2282
+ true: {};
2256
2283
  false: {};
2257
2284
  };
2258
2285
  status: {
@@ -3798,6 +3825,16 @@ type UIRadiusConfig = string | {
3798
3825
  full?: string;
3799
3826
  [key: string]: string | undefined;
3800
3827
  };
3828
+ interface UIZIndexConfig {
3829
+ popover?: number | string;
3830
+ drawer?: number | string;
3831
+ modal?: number | string;
3832
+ actionSheet?: number | string;
3833
+ picker?: number | string;
3834
+ banner?: number | string;
3835
+ toast?: number | string;
3836
+ [key: string]: number | string | undefined;
3837
+ }
3801
3838
  interface UIConfig {
3802
3839
  /** Design token colors */
3803
3840
  colors?: UIColorsConfig;
@@ -3824,6 +3861,8 @@ interface UIConfig {
3824
3861
  mono?: string;
3825
3862
  [key: string]: string | undefined;
3826
3863
  };
3864
+ /** Z-index layering tokens (generates `--z-<name>` and `z-<name>` utilities) */
3865
+ zIndex?: UIZIndexConfig;
3827
3866
  }
3828
3867
  type BuiltinIconCollection = "lucide" | "tabler" | "mdi" | "heroicons";
3829
3868
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "vite";
2
- //#region ../core/dist/icons-78wOszBL.d.ts
2
+ //#region ../core/dist/icons-CGWn5Sxv.d.ts
3
3
  //#region src/theme.d.ts
4
4
  type ThemeSlots = Record<string, string>;
5
5
  type ThemeVariants = Record<string, Record<string, Record<string, string> | string | Record<string, unknown>>>;
@@ -164,13 +164,21 @@ declare function actionSheetTheme(_options?: ThemeOptions): ThemeDefinition<{
164
164
  };
165
165
  false: {};
166
166
  };
167
+ closable: {
168
+ true: {
169
+ header: string;
170
+ };
171
+ false: {};
172
+ };
167
173
  }, {
168
174
  open: false;
169
175
  disabled: false;
176
+ closable: false;
170
177
  }> & {
171
178
  defaultVariants: {
172
179
  open: false;
173
180
  disabled: false;
181
+ closable: false;
174
182
  };
175
183
  };
176
184
  //#endregion
@@ -1029,6 +1037,7 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1029
1037
  root: string;
1030
1038
  content: string;
1031
1039
  container: string;
1040
+ body: string;
1032
1041
  grabber: string;
1033
1042
  grabberBar: string;
1034
1043
  };
@@ -1036,6 +1045,7 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1036
1045
  root: string;
1037
1046
  content: string;
1038
1047
  container: string;
1048
+ body: string;
1039
1049
  grabber: string;
1040
1050
  grabberBar: string;
1041
1051
  header: string;
@@ -1069,13 +1079,21 @@ declare function drawerTheme(_options?: ThemeOptions): ThemeDefinition<{
1069
1079
  backdrop: string;
1070
1080
  };
1071
1081
  };
1082
+ keyboardOpen: {
1083
+ true: {
1084
+ footer: string;
1085
+ };
1086
+ false: {};
1087
+ };
1072
1088
  }, {
1073
1089
  placement: "bottom";
1074
1090
  open: true;
1091
+ keyboardOpen: false;
1075
1092
  }> & {
1076
1093
  defaultVariants: {
1077
1094
  placement: "bottom";
1078
1095
  open: true;
1096
+ keyboardOpen: false;
1079
1097
  };
1080
1098
  };
1081
1099
  //#endregion
@@ -1101,6 +1119,17 @@ declare function fileUploadTheme(options?: ThemeOptions): ThemeDefinition<{
1101
1119
  fileRemove: string;
1102
1120
  fileRemoveIcon: string;
1103
1121
  fileProgress: string;
1122
+ previewOverlay: string;
1123
+ previewHeader: string;
1124
+ previewCounter: string;
1125
+ previewClose: string;
1126
+ previewCloseIcon: string;
1127
+ previewSwiper: string;
1128
+ previewSlide: string;
1129
+ previewImage: string;
1130
+ previewFooter: string;
1131
+ previewName: string;
1132
+ previewMeta: string;
1104
1133
  }, {
1105
1134
  color: {
1106
1135
  [k: string]: {
@@ -2250,9 +2279,7 @@ declare function pullDownRefreshTheme(_options?: ThemeOptions): ThemeDefinition<
2250
2279
  content: string;
2251
2280
  }, {
2252
2281
  disabled: {
2253
- true: {
2254
- root: string;
2255
- };
2282
+ true: {};
2256
2283
  false: {};
2257
2284
  };
2258
2285
  status: {
@@ -3798,6 +3825,16 @@ type UIRadiusConfig = string | {
3798
3825
  full?: string;
3799
3826
  [key: string]: string | undefined;
3800
3827
  };
3828
+ interface UIZIndexConfig {
3829
+ popover?: number | string;
3830
+ drawer?: number | string;
3831
+ modal?: number | string;
3832
+ actionSheet?: number | string;
3833
+ picker?: number | string;
3834
+ banner?: number | string;
3835
+ toast?: number | string;
3836
+ [key: string]: number | string | undefined;
3837
+ }
3801
3838
  interface UIConfig {
3802
3839
  /** Design token colors */
3803
3840
  colors?: UIColorsConfig;
@@ -3824,6 +3861,8 @@ interface UIConfig {
3824
3861
  mono?: string;
3825
3862
  [key: string]: string | undefined;
3826
3863
  };
3864
+ /** Z-index layering tokens (generates `--z-<name>` and `z-<name>` utilities) */
3865
+ zIndex?: UIZIndexConfig;
3827
3866
  }
3828
3867
  type BuiltinIconCollection = "lucide" | "tabler" | "mdi" | "heroicons";
3829
3868
  /**
package/dist/index.js CHANGED
@@ -475,13 +475,13 @@ function accordionItemTheme(_options = {}) {
475
475
  function actionSheetTheme(_options = {}) {
476
476
  return defineTheme({
477
477
  slots: {
478
- root: "fixed inset-0 z-50 flex items-end justify-center overflow-hidden overscroll-contain box-border",
478
+ root: "fixed inset-0 z-action-sheet flex items-end justify-center overflow-hidden overscroll-contain box-border",
479
479
  backdrop: "cui-action-sheet-backdrop-enter fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300",
480
480
  content: "cui-action-sheet-content-enter relative z-10 flex flex-col w-full max-h-[85vh] bg-elevated rounded-t-lg shadow-2xl transition-transform duration-300 ease-out box-border overflow-hidden translate-y-0",
481
481
  header: "relative flex flex-col items-center justify-center px-6 py-4 bg-default text-center border-b border-muted shrink-0 w-full box-border",
482
- title: "text-xs font-semibold uppercase tracking-wider text-dimmed text-center leading-snug",
483
- description: "text-xs text-muted text-center mt-1 leading-normal",
484
- closeTrigger: "absolute right-3.5 top-3.5 inline-flex items-center justify-center w-7 h-7 rounded-full bg-elevated text-muted shrink-0 cursor-pointer active:opacity-70 transition-opacity",
482
+ title: "w-full max-w-full break-words text-xs font-semibold uppercase tracking-wider text-dimmed text-center leading-snug",
483
+ description: "w-full max-w-full break-words text-xs text-muted text-center mt-1 leading-normal",
484
+ closeTrigger: "absolute right-3.5 top-3.5 z-10 inline-flex items-center justify-center w-7 h-7 rounded-full bg-elevated text-muted shrink-0 cursor-pointer active:opacity-70 transition-opacity",
485
485
  closeButton: "p-0 w-full h-full rounded-full text-inherit",
486
486
  closeIcon: "w-4 h-4",
487
487
  body: "flex flex-col w-full bg-default overflow-y-auto max-h-[60vh] overscroll-contain box-border",
@@ -511,6 +511,10 @@ function actionSheetTheme(_options = {}) {
511
511
  itemDescription: "opacity-75"
512
512
  },
513
513
  false: {}
514
+ },
515
+ closable: {
516
+ true: { header: "px-14 min-h-14" },
517
+ false: {}
514
518
  }
515
519
  },
516
520
  compoundVariants: [{
@@ -522,25 +526,26 @@ function actionSheetTheme(_options = {}) {
522
526
  }],
523
527
  defaultVariants: {
524
528
  open: false,
525
- disabled: false
529
+ disabled: false,
530
+ closable: false
526
531
  }
527
532
  });
528
533
  }
529
534
  function appTheme(_options = {}) {
530
535
  return defineTheme({
531
536
  slots: {
532
- root: "relative flex flex-col min-h-screen box-border text-default transition-[padding,background-color] duration-300",
533
- scaleWrapper: "w-full flex-1 flex flex-col box-border bg-default text-default transform-origin-top transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
537
+ root: "relative flex flex-col min-h-screen box-border text-default transition-colors duration-300",
538
+ scaleWrapper: "w-full flex-1 flex flex-col box-border bg-default text-default origin-top transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)]",
534
539
  toaster: "fixed z-[100] pointer-events-none"
535
540
  },
536
541
  variants: { scaled: {
537
542
  true: {
538
543
  root: "bg-black",
539
- scaleWrapper: "overflow-hidden rounded-md shadow-2xl"
544
+ scaleWrapper: ""
540
545
  },
541
546
  false: {
542
547
  root: "bg-default",
543
- scaleWrapper: "rounded-none shadow-none"
548
+ scaleWrapper: ""
544
549
  }
545
550
  } },
546
551
  defaultVariants: { scaled: false }
@@ -1527,8 +1532,8 @@ function dividerTheme(options = {}) {
1527
1532
  function drawerTheme(_options = {}) {
1528
1533
  return defineTheme({
1529
1534
  slots: {
1530
- root: "fixed inset-0 z-50 flex overflow-hidden overscroll-contain box-border",
1531
- backdrop: "fixed inset-0 bg-black/40 backdrop-blur-sm transition-opacity duration-300",
1535
+ root: "fixed inset-0 z-drawer flex overflow-hidden overscroll-contain box-border transition-[padding-bottom] duration-150 ease-out",
1536
+ backdrop: "fixed inset-0 bg-black/40 transition-opacity duration-300",
1532
1537
  content: "relative z-10 flex bg-default shadow-2xl transition-transform duration-300 ease-out box-border overflow-hidden",
1533
1538
  container: "flex flex-col min-w-0 min-h-0 overflow-hidden",
1534
1539
  grabber: "flex items-center justify-center cursor-grab active:cursor-grabbing shrink-0 box-border",
@@ -1538,7 +1543,7 @@ function drawerTheme(_options = {}) {
1538
1543
  closeTrigger: "inline-flex items-center justify-center w-8 h-8 rounded-full text-dimmed hover:text-default hover:bg-elevated transition-colors shrink-0",
1539
1544
  closeButton: "p-0 w-full h-full rounded-full text-inherit",
1540
1545
  closeIcon: "w-4 h-4",
1541
- body: "flex-1 min-h-0 w-full box-border overflow-y-auto px-4 pt-3 pb-6 text-sm text-toned overscroll-contain",
1546
+ body: "min-h-0 w-full box-border overflow-y-auto px-4 pt-3 pb-6 text-sm text-toned overscroll-contain",
1542
1547
  footer: "flex items-center justify-end gap-2 px-4 py-3 border-t border-muted shrink-0 box-border w-full pb-[calc(var(--spacing)_*_3_+_env(safe-area-inset-bottom))]"
1543
1548
  },
1544
1549
  variants: {
@@ -1546,14 +1551,16 @@ function drawerTheme(_options = {}) {
1546
1551
  bottom: {
1547
1552
  root: "items-end justify-center",
1548
1553
  content: "flex-col w-full max-h-[85vh] rounded-t-xl",
1549
- container: "w-full flex-1",
1554
+ container: "w-full flex-initial",
1555
+ body: "flex-initial max-h-[60vh]",
1550
1556
  grabber: "w-full py-2.5",
1551
1557
  grabberBar: "w-12 h-1.5"
1552
1558
  },
1553
1559
  top: {
1554
1560
  root: "items-start justify-center",
1555
1561
  content: "flex-col w-full max-h-[85vh] rounded-b-xl",
1556
- container: "w-full flex-1",
1562
+ container: "w-full flex-initial",
1563
+ body: "flex-initial max-h-[60vh]",
1557
1564
  grabber: "w-full py-2.5",
1558
1565
  grabberBar: "w-12 h-1.5",
1559
1566
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]",
@@ -1561,18 +1568,18 @@ function drawerTheme(_options = {}) {
1561
1568
  },
1562
1569
  left: {
1563
1570
  root: "items-center justify-start",
1564
- content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-r-xl",
1571
+ content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-none",
1565
1572
  container: "flex-1 h-full",
1566
- body: "h-0",
1573
+ body: "flex-1 h-0",
1567
1574
  grabber: "h-full px-2.5",
1568
1575
  grabberBar: "w-1.5 h-12",
1569
1576
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]"
1570
1577
  },
1571
1578
  right: {
1572
1579
  root: "items-center justify-end",
1573
- content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-l-xl",
1580
+ content: "flex-row h-full w-4/5 max-w-sm md:max-w-md rounded-none",
1574
1581
  container: "flex-1 h-full",
1575
- body: "h-0",
1582
+ body: "flex-1 h-0",
1576
1583
  grabber: "h-full px-2.5",
1577
1584
  grabberBar: "w-1.5 h-12",
1578
1585
  header: "pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))]"
@@ -1584,9 +1591,29 @@ function drawerTheme(_options = {}) {
1584
1591
  content: "cui-drawer-open"
1585
1592
  },
1586
1593
  false: { backdrop: "opacity-0 pointer-events-none" }
1594
+ },
1595
+ keyboardOpen: {
1596
+ true: { footer: "pb-3" },
1597
+ false: {}
1587
1598
  }
1588
1599
  },
1589
1600
  compoundVariants: [
1601
+ {
1602
+ placement: "bottom",
1603
+ keyboardOpen: true,
1604
+ class: {
1605
+ content: "max-h-[calc(100%_-_env(safe-area-inset-top))]",
1606
+ body: "max-h-[calc(100vh_-_var(--keyboard-height,0px)_-_env(safe-area-inset-top,0px)_-_10rem)]"
1607
+ }
1608
+ },
1609
+ {
1610
+ placement: "top",
1611
+ keyboardOpen: true,
1612
+ class: {
1613
+ content: "max-h-full",
1614
+ body: "max-h-[calc(100vh_-_var(--keyboard-height,0px)_-_env(safe-area-inset-top,0px)_-_10rem)]"
1615
+ }
1616
+ },
1590
1617
  {
1591
1618
  placement: "bottom",
1592
1619
  open: true,
@@ -1630,7 +1657,8 @@ function drawerTheme(_options = {}) {
1630
1657
  ],
1631
1658
  defaultVariants: {
1632
1659
  placement: "bottom",
1633
- open: true
1660
+ open: true,
1661
+ keyboardOpen: false
1634
1662
  }
1635
1663
  });
1636
1664
  }
@@ -1658,7 +1686,18 @@ function fileUploadTheme(options = {}) {
1658
1686
  fileIcon: "w-5 h-5 text-dimmed",
1659
1687
  fileRemove: "flex items-center justify-center rounded-lg text-dimmed hover:text-default transition-colors p-1",
1660
1688
  fileRemoveIcon: "w-4 h-4",
1661
- fileProgress: "w-full mt-1.5"
1689
+ fileProgress: "w-full mt-1.5",
1690
+ previewOverlay: "fixed inset-0 z-modal bg-black/95 flex flex-col select-none",
1691
+ previewHeader: "relative z-10 flex items-center justify-between px-4 pb-3 pt-[calc(var(--spacing)_*_3_+_env(safe-area-inset-top))] text-white shrink-0",
1692
+ previewCounter: "text-sm font-medium text-white/90 tabular-nums px-2.5 py-1 rounded-full bg-white/15",
1693
+ previewClose: "flex items-center justify-center w-9 h-9 rounded-full bg-white/15 text-white active:bg-white/25 transition-colors",
1694
+ previewCloseIcon: "w-5 h-5 text-white",
1695
+ previewSwiper: "flex-1 w-full h-0 min-h-0",
1696
+ previewSlide: "w-full h-full flex items-center justify-center px-3 box-border",
1697
+ previewImage: "w-full h-full block",
1698
+ previewFooter: "relative z-10 flex flex-col gap-0.5 px-4 pt-3 pb-[calc(var(--spacing)_*_4_+_env(safe-area-inset-bottom))] text-center shrink-0 bg-black/60",
1699
+ previewName: "text-sm font-medium text-white truncate",
1700
+ previewMeta: "text-xs text-white/70"
1662
1701
  },
1663
1702
  variants: {
1664
1703
  color: Object.assign(Object.fromEntries(colors.map((color) => [color, { dropzone: `focus:border-${color} focus:ring-2 focus:ring-${color}/20` }])), { neutral: { dropzone: "focus:border-inverted focus:ring-2 focus:ring-inverted/20" } }),
@@ -1788,7 +1827,7 @@ function popoverTheme(_options = {}) {
1788
1827
  root: "relative",
1789
1828
  trigger: "relative",
1790
1829
  backdrop: "fixed inset-0 z-40 bg-transparent",
1791
- positioner: "z-50 box-border",
1830
+ positioner: "z-popover box-border",
1792
1831
  content: "relative w-full rounded-md bg-default text-default shadow-lg ring-1 ring-default box-border transition-all duration-150 ease-out",
1793
1832
  body: "relative w-full overflow-hidden rounded-[inherit] bg-inherit",
1794
1833
  arrow: "absolute w-2.5 h-2.5 bg-default border-default pointer-events-none"
@@ -2150,7 +2189,7 @@ function inputMenuTheme(options = {}) {
2150
2189
  true: {
2151
2190
  base: "h-auto py-1",
2152
2191
  tagsWrapper: "flex-wrap gap-y-1",
2153
- nativeInput: "min-w-[60px] h-6"
2192
+ nativeInput: "min-w-[80px] w-auto h-6"
2154
2193
  },
2155
2194
  false: {}
2156
2195
  },
@@ -2358,7 +2397,7 @@ function inputMenuItemTheme(options = {}) {
2358
2397
  function modalTheme(_options = {}) {
2359
2398
  return defineTheme({
2360
2399
  slots: {
2361
- root: "fixed inset-0 z-50 box-border overscroll-contain",
2400
+ root: "fixed inset-0 z-modal box-border overscroll-contain",
2362
2401
  trigger: "inline-flex",
2363
2402
  overlay: "fixed inset-0 bg-black/35 backdrop-blur-md",
2364
2403
  container: "relative z-10 w-full flex items-center justify-center box-border",
@@ -2741,7 +2780,7 @@ function pullDownRefreshTheme(_options = {}) {
2741
2780
  },
2742
2781
  variants: {
2743
2782
  disabled: {
2744
- true: { root: "opacity-60" },
2783
+ true: {},
2745
2784
  false: {}
2746
2785
  },
2747
2786
  status: {
@@ -3007,7 +3046,7 @@ function selectTheme(options = {}) {
3007
3046
  header: "px-2.5 py-2 border-b border-muted",
3008
3047
  footer: "px-2.5 py-2 border-t border-muted",
3009
3048
  empty: "py-6 px-3 text-center text-sm text-muted",
3010
- pickerRoot: "fixed inset-0 z-50 flex items-end justify-center overflow-hidden overscroll-contain box-border",
3049
+ pickerRoot: "fixed inset-0 z-picker flex items-end justify-center overflow-hidden overscroll-contain box-border",
3011
3050
  pickerBackdrop: "fixed inset-0 bg-black/40 transition-opacity duration-250",
3012
3051
  pickerContent: "relative z-10 flex flex-col w-full bg-default rounded-t-md shadow-2xl transition-transform duration-250 ease-out box-border overflow-hidden pb-[env(safe-area-inset-bottom)]",
3013
3052
  pickerHeader: "flex items-center justify-between px-4 py-3 border-b border-muted shrink-0 box-border w-full",
@@ -3251,7 +3290,7 @@ function sliderTheme(options = {}) {
3251
3290
  range: "absolute rounded-full transition-all duration-75",
3252
3291
  thumb: "absolute rounded-full bg-white shadow-md ring-1 ring-black/5 flex items-center justify-center transition-[transform,shadow] duration-75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
3253
3292
  markerGroup: "absolute inset-0 pointer-events-none",
3254
- marker: "absolute flex flex-col items-center -translate-x-1/2 text-dimmed font-medium",
3293
+ marker: "absolute flex flex-col items-center text-dimmed font-medium",
3255
3294
  markerTick: "w-1 h-1 rounded-full bg-default",
3256
3295
  markerTickActive: "bg-white/90",
3257
3296
  markerLabel: "mt-2 tabular-nums select-none",
@@ -3650,7 +3689,7 @@ function switchTheme(options = {}) {
3650
3689
  true: { icon: "opacity-100" },
3651
3690
  false: {
3652
3691
  base: "bg-accented",
3653
- thumb: "translate-x-0 rtl:-translate-x-0",
3692
+ thumb: "translate-x-0",
3654
3693
  icon: "opacity-0"
3655
3694
  }
3656
3695
  },
@@ -3695,27 +3734,27 @@ function switchTheme(options = {}) {
3695
3734
  {
3696
3735
  size: "xs",
3697
3736
  checked: true,
3698
- class: { thumb: "translate-x-3 rtl:-translate-x-3" }
3737
+ class: { thumb: "translate-x-3" }
3699
3738
  },
3700
3739
  {
3701
3740
  size: "sm",
3702
3741
  checked: true,
3703
- class: { thumb: "translate-x-3.5 rtl:-translate-x-3.5" }
3742
+ class: { thumb: "translate-x-3.5" }
3704
3743
  },
3705
3744
  {
3706
3745
  size: "md",
3707
3746
  checked: true,
3708
- class: { thumb: "translate-x-4 rtl:-translate-x-4" }
3747
+ class: { thumb: "translate-x-4" }
3709
3748
  },
3710
3749
  {
3711
3750
  size: "lg",
3712
3751
  checked: true,
3713
- class: { thumb: "translate-x-4.5 rtl:-translate-x-4.5" }
3752
+ class: { thumb: "translate-x-4.5" }
3714
3753
  },
3715
3754
  {
3716
3755
  size: "xl",
3717
3756
  checked: true,
3718
- class: { thumb: "translate-x-5 rtl:-translate-x-5" }
3757
+ class: { thumb: "translate-x-5" }
3719
3758
  }
3720
3759
  ],
3721
3760
  defaultVariants: {
@@ -3735,8 +3774,8 @@ function swipeCellTheme(_options = {}) {
3735
3774
  root: "relative overflow-hidden w-full select-none touch-pan-y box-border",
3736
3775
  wrapper: "relative flex flex-row w-full transition-transform duration-300 ease-out will-change-transform box-border",
3737
3776
  content: "relative z-10 w-full shrink-0 bg-default box-border",
3738
- left: "absolute left-0 top-0 bottom-0 z-0 flex flex-row h-full -translate-x-full box-border",
3739
- right: "absolute right-0 top-0 bottom-0 z-0 flex flex-row h-full translate-x-full box-border",
3777
+ left: "absolute left-0 top-0 bottom-0 z-0 flex flex-row h-full box-border",
3778
+ right: "absolute right-0 top-0 bottom-0 z-0 flex flex-row h-full box-border",
3740
3779
  action: "flex flex-row items-center justify-center h-full text-white transition-opacity active:opacity-85 select-none cursor-pointer box-border font-medium",
3741
3780
  actionText: "font-medium leading-none",
3742
3781
  actionIcon: "shrink-0"
@@ -3895,12 +3934,12 @@ function tabsItemTheme(options = {}) {
3895
3934
  slots: {
3896
3935
  root: "w-full focus:outline-none",
3897
3936
  content: "w-full",
3898
- trigger: "relative flex flex-row items-center justify-center font-medium transition-colors duration-200 select-none shrink-0 whitespace-nowrap z-[1] cursor-pointer focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:pointer-events-none",
3937
+ trigger: "relative flex flex-row items-center justify-center font-medium transition-colors duration-100 select-none shrink-0 whitespace-nowrap z-[1] cursor-pointer focus:outline-none data-[disabled=true]:opacity-40 data-[disabled=true]:pointer-events-none",
3899
3938
  triggerInner: "relative z-10 flex flex-row items-center justify-center gap-1.5 min-w-0",
3900
3939
  leading: "relative z-10 shrink-0",
3901
3940
  label: "relative z-10 truncate",
3902
3941
  trailing: "relative z-10 shrink-0",
3903
- indicator: "absolute pointer-events-none transition-all duration-200 ease-out origin-center"
3942
+ indicator: "absolute pointer-events-none transition-[transform,opacity] duration-100 ease-out origin-center"
3904
3943
  },
3905
3944
  variants: {
3906
3945
  color: Object.assign(Object.fromEntries(colors.map((color) => [color, {}])), { neutral: {} }),
@@ -4343,9 +4382,9 @@ function toastTheme(options = {}) {
4343
4382
  vertical: {}
4344
4383
  },
4345
4384
  placement: {
4346
- top: { root: "fixed top-0 left-1/2 -translate-x-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" },
4347
- center: { root: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md z-[100]" },
4348
- bottom: { root: "fixed bottom-0 left-1/2 -translate-x-1/2 w-[calc(100vw-32px)] max-w-sm md:max-w-md mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4385
+ top: { root: "fixed top-0 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" },
4386
+ center: { root: "fixed top-1/2 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md z-[100]" },
4387
+ bottom: { root: "fixed bottom-0 left-1/2 w-[calc(100vw_-_32px)] max-w-sm md:max-w-md mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4349
4388
  },
4350
4389
  progressPosition: {
4351
4390
  top: { progress: "top-0" },
@@ -4367,17 +4406,17 @@ function toastTheme(options = {}) {
4367
4406
  {
4368
4407
  mode: "native",
4369
4408
  placement: "top",
4370
- class: { root: "fixed top-0 left-1/2 -translate-x-1/2 w-auto mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" }
4409
+ class: { root: "fixed top-0 left-1/2 w-auto mt-[calc(var(--cui-toast-top-offset,env(safe-area-inset-top,0px))_+_var(--spacing)_*_4)] z-[100]" }
4371
4410
  },
4372
4411
  {
4373
4412
  mode: "native",
4374
4413
  placement: "center",
4375
- class: { root: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-auto z-[100]" }
4414
+ class: { root: "fixed top-1/2 left-1/2 w-auto z-[100]" }
4376
4415
  },
4377
4416
  {
4378
4417
  mode: "native",
4379
4418
  placement: "bottom",
4380
- class: { root: "fixed bottom-0 left-1/2 -translate-x-1/2 w-auto mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4419
+ class: { root: "fixed bottom-0 left-1/2 w-auto mb-[calc(var(--cui-toast-bottom-offset,env(safe-area-inset-bottom,0px))_+_var(--spacing)_*_4)] z-[100]" }
4381
4420
  },
4382
4421
  ...colors.map((color) => ({
4383
4422
  color,
@@ -5259,8 +5298,26 @@ function generateThemeCSS(ui) {
5259
5298
  rootLines.push(" --tw-translate-x: 0;");
5260
5299
  rootLines.push(" --tw-translate-y: 0;");
5261
5300
  rootLines.push(" --tw-translate-z: 0;");
5301
+ const configuredZIndex = {
5302
+ popover: 50,
5303
+ drawer: 100,
5304
+ modal: 110,
5305
+ actionSheet: 120,
5306
+ picker: 130,
5307
+ banner: 140,
5308
+ toast: 150,
5309
+ ...ui?.zIndex
5310
+ };
5311
+ const zUtilityBlocks = [];
5312
+ for (const [zKey, zVal] of Object.entries(configuredZIndex)) {
5313
+ if (zVal === void 0 || zVal === null || zVal === "") continue;
5314
+ const kebabKey = zKey.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
5315
+ rootLines.push(` --z-${kebabKey}: ${zVal};`);
5316
+ zUtilityBlocks.push(`.z-${kebabKey} {\n z-index: var(--z-${kebabKey}, ${zVal});\n}`);
5317
+ }
5262
5318
  if (colorMode === "dark") rootLines.push(...darkLines);
5263
5319
  let css = `${THEME_TAG}\n@theme default inline {\n${themeLines.join("\n")}\n}\n\n:root, page, :host {\n${rootLines.join("\n")}\n}\n`;
5320
+ if (zUtilityBlocks.length > 0) css += `\n${zUtilityBlocks.join("\n\n")}\n`;
5264
5321
  if (colorMode === "system" && darkLines.length > 0) css += `\n@media (prefers-color-scheme: dark) {\n :root, page, :host {\n ${darkLines.join("\n ")}\n }\n}\n\npage[data-theme="light"], .light, [data-theme="light"] {\n${lightResetLines.join("\n")}\n}\n\npage[data-theme="dark"], .dark, [data-theme="dark"] {\n${darkLines.join("\n")}\n}\n`;
5265
5322
  return css;
5266
5323
  }
@@ -7510,9 +7567,9 @@ function syncDiskSlotDetect(rootDir, outDir, opts) {
7510
7567
  function compatMiniProgramTransforms(css) {
7511
7568
  if (!css.includes("translate:") && !css.includes("scale:") && !css.includes("rotate:")) return css;
7512
7569
  let result = css;
7513
- if (result.includes("translate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*translate\s*\([^;}]+\)\s*;\s*)*translate\s*:\s*var\(--tw-translate-x\)\s+var\(--tw-translate-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}translate: var(--tw-translate-x) var(--tw-translate-y);`);
7514
- if (result.includes("scale:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*scale\s*\([^;}]+\)\s*;\s*)*scale\s*:\s*var\(--tw-scale-x\)\s+var\(--tw-scale-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}scale: var(--tw-scale-x) var(--tw-scale-y);`);
7515
- if (result.includes("rotate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*rotate\s*\([^;}]+\)\s*;\s*)*(?<![\w-])rotate\s*:\s*([^;}]+?)\s*(?:;|(?=\s*\}))/g, (_, indent, val) => `${indent}-webkit-transform: rotate(${val});\n${indent}transform: rotate(${val});\n${indent}rotate: ${val};`);
7570
+ if (result.includes("translate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*translate\s*\([^;}]+\)\s*;\s*)*translate\s*:\s*var\(--tw-translate-x\)\s+var\(--tw-translate-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));\n${indent}transform: translate(var(--tw-translate-x, 0), var(--tw-translate-y, 0));`);
7571
+ if (result.includes("scale:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*scale\s*\([^;}]+\)\s*;\s*)*scale\s*:\s*var\(--tw-scale-x\)\s+var\(--tw-scale-y\)\s*(?:;|(?=\s*\}))/g, (_, indent) => `${indent}-webkit-transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));\n${indent}transform: scale(var(--tw-scale-x, 1), var(--tw-scale-y, 1));`);
7572
+ if (result.includes("rotate:")) result = result.replace(/([ \t]*)(?:(?:-webkit-transform|transform)\s*:\s*rotate\s*\([^;}]+\)\s*;\s*)*(?<![\w-])rotate\s*:\s*([^;}]+?)\s*(?:;|(?=\s*\}))/g, (_, indent, val) => `${indent}-webkit-transform: rotate(${val});\n${indent}transform: rotate(${val});`);
7516
7573
  return result;
7517
7574
  }
7518
7575
  const SEMANTIC_UTILITY_RE = /(?:^|[\s,.]|_[a-zA-Z])(?:bg|text|border|ring|divide|outline|fill|stroke|accent|caret|from|via|to)-(primary|secondary|success|warning|danger|info)(?:-(\d{2,3}))?(?:_f(\d+))?(?=$|[\s.,:[>+~{])/g;
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@code-id-labs/plugin-vite",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Vite plugin for Code-UI — provides cui.config.ts loading, virtual modules, HMR, and Tailwind template scanning",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/code-id-miniapp-labs/code-ui.git",
8
+ "directory": "packages/plugin-vite"
9
+ },
5
10
  "files": [
6
11
  "dist"
7
12
  ],