@umami/react-zen 0.221.0 → 0.222.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.
package/dist/index.mjs CHANGED
@@ -31493,6 +31493,373 @@ function getCssColorValue(value) {
31493
31493
  }
31494
31494
  return void 0;
31495
31495
  }
31496
+ var widthMap = {
31497
+ // Spacing scale
31498
+ "0": "w-0",
31499
+ px: "w-px",
31500
+ "0.5": "w-0.5",
31501
+ "1": "w-1",
31502
+ "1.5": "w-1.5",
31503
+ "2": "w-2",
31504
+ "2.5": "w-2.5",
31505
+ "3": "w-3",
31506
+ "3.5": "w-3.5",
31507
+ "4": "w-4",
31508
+ "5": "w-5",
31509
+ "6": "w-6",
31510
+ "7": "w-7",
31511
+ "8": "w-8",
31512
+ "9": "w-9",
31513
+ "10": "w-10",
31514
+ "11": "w-11",
31515
+ "12": "w-12",
31516
+ "14": "w-14",
31517
+ "16": "w-16",
31518
+ "20": "w-20",
31519
+ "24": "w-24",
31520
+ "28": "w-28",
31521
+ "32": "w-32",
31522
+ "36": "w-36",
31523
+ "40": "w-40",
31524
+ "44": "w-44",
31525
+ "48": "w-48",
31526
+ "52": "w-52",
31527
+ "56": "w-56",
31528
+ "60": "w-60",
31529
+ "64": "w-64",
31530
+ "72": "w-72",
31531
+ "80": "w-80",
31532
+ "96": "w-96",
31533
+ // Fractions
31534
+ "1/2": "w-1/2",
31535
+ "1/3": "w-1/3",
31536
+ "2/3": "w-2/3",
31537
+ "1/4": "w-1/4",
31538
+ "2/4": "w-2/4",
31539
+ "3/4": "w-3/4",
31540
+ "1/5": "w-1/5",
31541
+ "2/5": "w-2/5",
31542
+ "3/5": "w-3/5",
31543
+ "4/5": "w-4/5",
31544
+ "1/6": "w-1/6",
31545
+ "2/6": "w-2/6",
31546
+ "3/6": "w-3/6",
31547
+ "4/6": "w-4/6",
31548
+ "5/6": "w-5/6",
31549
+ "1/12": "w-1/12",
31550
+ "2/12": "w-2/12",
31551
+ "3/12": "w-3/12",
31552
+ "4/12": "w-4/12",
31553
+ "5/12": "w-5/12",
31554
+ "6/12": "w-6/12",
31555
+ "7/12": "w-7/12",
31556
+ "8/12": "w-8/12",
31557
+ "9/12": "w-9/12",
31558
+ "10/12": "w-10/12",
31559
+ "11/12": "w-11/12",
31560
+ // Special values
31561
+ auto: "w-auto",
31562
+ full: "w-full",
31563
+ screen: "w-screen",
31564
+ svw: "w-svw",
31565
+ lvw: "w-lvw",
31566
+ dvw: "w-dvw",
31567
+ min: "w-min",
31568
+ max: "w-max",
31569
+ fit: "w-fit"
31570
+ };
31571
+ var heightMap = {
31572
+ // Spacing scale
31573
+ "0": "h-0",
31574
+ px: "h-px",
31575
+ "0.5": "h-0.5",
31576
+ "1": "h-1",
31577
+ "1.5": "h-1.5",
31578
+ "2": "h-2",
31579
+ "2.5": "h-2.5",
31580
+ "3": "h-3",
31581
+ "3.5": "h-3.5",
31582
+ "4": "h-4",
31583
+ "5": "h-5",
31584
+ "6": "h-6",
31585
+ "7": "h-7",
31586
+ "8": "h-8",
31587
+ "9": "h-9",
31588
+ "10": "h-10",
31589
+ "11": "h-11",
31590
+ "12": "h-12",
31591
+ "14": "h-14",
31592
+ "16": "h-16",
31593
+ "20": "h-20",
31594
+ "24": "h-24",
31595
+ "28": "h-28",
31596
+ "32": "h-32",
31597
+ "36": "h-36",
31598
+ "40": "h-40",
31599
+ "44": "h-44",
31600
+ "48": "h-48",
31601
+ "52": "h-52",
31602
+ "56": "h-56",
31603
+ "60": "h-60",
31604
+ "64": "h-64",
31605
+ "72": "h-72",
31606
+ "80": "h-80",
31607
+ "96": "h-96",
31608
+ // Fractions
31609
+ "1/2": "h-1/2",
31610
+ "1/3": "h-1/3",
31611
+ "2/3": "h-2/3",
31612
+ "1/4": "h-1/4",
31613
+ "2/4": "h-2/4",
31614
+ "3/4": "h-3/4",
31615
+ "1/5": "h-1/5",
31616
+ "2/5": "h-2/5",
31617
+ "3/5": "h-3/5",
31618
+ "4/5": "h-4/5",
31619
+ "1/6": "h-1/6",
31620
+ "2/6": "h-2/6",
31621
+ "3/6": "h-3/6",
31622
+ "4/6": "h-4/6",
31623
+ "5/6": "h-5/6",
31624
+ // Special values
31625
+ auto: "h-auto",
31626
+ full: "h-full",
31627
+ screen: "h-screen",
31628
+ svh: "h-svh",
31629
+ lvh: "h-lvh",
31630
+ dvh: "h-dvh",
31631
+ min: "h-min",
31632
+ max: "h-max",
31633
+ fit: "h-fit"
31634
+ };
31635
+ var minWidthMap = {
31636
+ "0": "min-w-0",
31637
+ px: "min-w-px",
31638
+ "0.5": "min-w-0.5",
31639
+ "1": "min-w-1",
31640
+ "1.5": "min-w-1.5",
31641
+ "2": "min-w-2",
31642
+ "2.5": "min-w-2.5",
31643
+ "3": "min-w-3",
31644
+ "3.5": "min-w-3.5",
31645
+ "4": "min-w-4",
31646
+ "5": "min-w-5",
31647
+ "6": "min-w-6",
31648
+ "7": "min-w-7",
31649
+ "8": "min-w-8",
31650
+ "9": "min-w-9",
31651
+ "10": "min-w-10",
31652
+ "11": "min-w-11",
31653
+ "12": "min-w-12",
31654
+ "14": "min-w-14",
31655
+ "16": "min-w-16",
31656
+ "20": "min-w-20",
31657
+ "24": "min-w-24",
31658
+ "28": "min-w-28",
31659
+ "32": "min-w-32",
31660
+ "36": "min-w-36",
31661
+ "40": "min-w-40",
31662
+ "44": "min-w-44",
31663
+ "48": "min-w-48",
31664
+ "52": "min-w-52",
31665
+ "56": "min-w-56",
31666
+ "60": "min-w-60",
31667
+ "64": "min-w-64",
31668
+ "72": "min-w-72",
31669
+ "80": "min-w-80",
31670
+ "96": "min-w-96",
31671
+ full: "min-w-full",
31672
+ min: "min-w-min",
31673
+ max: "min-w-max",
31674
+ fit: "min-w-fit"
31675
+ };
31676
+ var maxWidthMap = {
31677
+ "0": "max-w-0",
31678
+ px: "max-w-px",
31679
+ "0.5": "max-w-0.5",
31680
+ "1": "max-w-1",
31681
+ "1.5": "max-w-1.5",
31682
+ "2": "max-w-2",
31683
+ "2.5": "max-w-2.5",
31684
+ "3": "max-w-3",
31685
+ "3.5": "max-w-3.5",
31686
+ "4": "max-w-4",
31687
+ "5": "max-w-5",
31688
+ "6": "max-w-6",
31689
+ "7": "max-w-7",
31690
+ "8": "max-w-8",
31691
+ "9": "max-w-9",
31692
+ "10": "max-w-10",
31693
+ "11": "max-w-11",
31694
+ "12": "max-w-12",
31695
+ "14": "max-w-14",
31696
+ "16": "max-w-16",
31697
+ "20": "max-w-20",
31698
+ "24": "max-w-24",
31699
+ "28": "max-w-28",
31700
+ "32": "max-w-32",
31701
+ "36": "max-w-36",
31702
+ "40": "max-w-40",
31703
+ "44": "max-w-44",
31704
+ "48": "max-w-48",
31705
+ "52": "max-w-52",
31706
+ "56": "max-w-56",
31707
+ "60": "max-w-60",
31708
+ "64": "max-w-64",
31709
+ "72": "max-w-72",
31710
+ "80": "max-w-80",
31711
+ "96": "max-w-96",
31712
+ // Container sizes
31713
+ none: "max-w-none",
31714
+ xs: "max-w-xs",
31715
+ sm: "max-w-sm",
31716
+ md: "max-w-md",
31717
+ lg: "max-w-lg",
31718
+ xl: "max-w-xl",
31719
+ "2xl": "max-w-2xl",
31720
+ "3xl": "max-w-3xl",
31721
+ "4xl": "max-w-4xl",
31722
+ "5xl": "max-w-5xl",
31723
+ "6xl": "max-w-6xl",
31724
+ "7xl": "max-w-7xl",
31725
+ full: "max-w-full",
31726
+ min: "max-w-min",
31727
+ max: "max-w-max",
31728
+ fit: "max-w-fit",
31729
+ prose: "max-w-prose",
31730
+ "screen-sm": "max-w-screen-sm",
31731
+ "screen-md": "max-w-screen-md",
31732
+ "screen-lg": "max-w-screen-lg",
31733
+ "screen-xl": "max-w-screen-xl",
31734
+ "screen-2xl": "max-w-screen-2xl"
31735
+ };
31736
+ var minHeightMap = {
31737
+ "0": "min-h-0",
31738
+ px: "min-h-px",
31739
+ "0.5": "min-h-0.5",
31740
+ "1": "min-h-1",
31741
+ "1.5": "min-h-1.5",
31742
+ "2": "min-h-2",
31743
+ "2.5": "min-h-2.5",
31744
+ "3": "min-h-3",
31745
+ "3.5": "min-h-3.5",
31746
+ "4": "min-h-4",
31747
+ "5": "min-h-5",
31748
+ "6": "min-h-6",
31749
+ "7": "min-h-7",
31750
+ "8": "min-h-8",
31751
+ "9": "min-h-9",
31752
+ "10": "min-h-10",
31753
+ "11": "min-h-11",
31754
+ "12": "min-h-12",
31755
+ "14": "min-h-14",
31756
+ "16": "min-h-16",
31757
+ "20": "min-h-20",
31758
+ "24": "min-h-24",
31759
+ "28": "min-h-28",
31760
+ "32": "min-h-32",
31761
+ "36": "min-h-36",
31762
+ "40": "min-h-40",
31763
+ "44": "min-h-44",
31764
+ "48": "min-h-48",
31765
+ "52": "min-h-52",
31766
+ "56": "min-h-56",
31767
+ "60": "min-h-60",
31768
+ "64": "min-h-64",
31769
+ "72": "min-h-72",
31770
+ "80": "min-h-80",
31771
+ "96": "min-h-96",
31772
+ full: "min-h-full",
31773
+ screen: "min-h-screen",
31774
+ svh: "min-h-svh",
31775
+ lvh: "min-h-lvh",
31776
+ dvh: "min-h-dvh",
31777
+ min: "min-h-min",
31778
+ max: "min-h-max",
31779
+ fit: "min-h-fit"
31780
+ };
31781
+ var maxHeightMap = {
31782
+ "0": "max-h-0",
31783
+ px: "max-h-px",
31784
+ "0.5": "max-h-0.5",
31785
+ "1": "max-h-1",
31786
+ "1.5": "max-h-1.5",
31787
+ "2": "max-h-2",
31788
+ "2.5": "max-h-2.5",
31789
+ "3": "max-h-3",
31790
+ "3.5": "max-h-3.5",
31791
+ "4": "max-h-4",
31792
+ "5": "max-h-5",
31793
+ "6": "max-h-6",
31794
+ "7": "max-h-7",
31795
+ "8": "max-h-8",
31796
+ "9": "max-h-9",
31797
+ "10": "max-h-10",
31798
+ "11": "max-h-11",
31799
+ "12": "max-h-12",
31800
+ "14": "max-h-14",
31801
+ "16": "max-h-16",
31802
+ "20": "max-h-20",
31803
+ "24": "max-h-24",
31804
+ "28": "max-h-28",
31805
+ "32": "max-h-32",
31806
+ "36": "max-h-36",
31807
+ "40": "max-h-40",
31808
+ "44": "max-h-44",
31809
+ "48": "max-h-48",
31810
+ "52": "max-h-52",
31811
+ "56": "max-h-56",
31812
+ "60": "max-h-60",
31813
+ "64": "max-h-64",
31814
+ "72": "max-h-72",
31815
+ "80": "max-h-80",
31816
+ "96": "max-h-96",
31817
+ none: "max-h-none",
31818
+ full: "max-h-full",
31819
+ screen: "max-h-screen",
31820
+ svh: "max-h-svh",
31821
+ lvh: "max-h-lvh",
31822
+ dvh: "max-h-dvh",
31823
+ min: "max-h-min",
31824
+ max: "max-h-max",
31825
+ fit: "max-h-fit"
31826
+ };
31827
+ function mapWidth(value) {
31828
+ return mapResponsive(value, (v) => widthMap[v]);
31829
+ }
31830
+ function mapHeight(value) {
31831
+ return mapResponsive(value, (v) => heightMap[v]);
31832
+ }
31833
+ function mapMinWidth(value) {
31834
+ return mapResponsive(value, (v) => minWidthMap[v]);
31835
+ }
31836
+ function mapMaxWidth(value) {
31837
+ return mapResponsive(value, (v) => maxWidthMap[v]);
31838
+ }
31839
+ function mapMinHeight(value) {
31840
+ return mapResponsive(value, (v) => minHeightMap[v]);
31841
+ }
31842
+ function mapMaxHeight(value) {
31843
+ return mapResponsive(value, (v) => maxHeightMap[v]);
31844
+ }
31845
+ function isWidthPreset(value) {
31846
+ return value in widthMap;
31847
+ }
31848
+ function isHeightPreset(value) {
31849
+ return value in heightMap;
31850
+ }
31851
+ function isMinWidthPreset(value) {
31852
+ return value in minWidthMap;
31853
+ }
31854
+ function isMaxWidthPreset(value) {
31855
+ return value in maxWidthMap;
31856
+ }
31857
+ function isMinHeightPreset(value) {
31858
+ return value in minHeightMap;
31859
+ }
31860
+ function isMaxHeightPreset(value) {
31861
+ return value in maxHeightMap;
31862
+ }
31496
31863
 
31497
31864
  // src/components/Icon.tsx
31498
31865
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -31728,6 +32095,11 @@ var Box = forwardRef3(function Box2({
31728
32095
  ...props
31729
32096
  }, ref) {
31730
32097
  const Component = as;
32098
+ const getSizingStyle = (value, isPreset) => {
32099
+ if (!value) return void 0;
32100
+ if (typeof value === "string" && !isPreset(value)) return value;
32101
+ return void 0;
32102
+ };
31731
32103
  const classes = cn(
31732
32104
  mapDisplay(display),
31733
32105
  mapTextColor(toStringValue(color)),
@@ -31753,6 +32125,12 @@ var Box = forwardRef3(function Box2({
31753
32125
  mapMargin(marginRight, "r"),
31754
32126
  mapMargin(marginBottom, "b"),
31755
32127
  mapMargin(marginLeft, "l"),
32128
+ mapWidth(width),
32129
+ mapMinWidth(minWidth),
32130
+ mapMaxWidth(maxWidth),
32131
+ mapHeight(height),
32132
+ mapMinHeight(minHeight),
32133
+ mapMaxHeight(maxHeight),
31756
32134
  mapPosition(position),
31757
32135
  mapTextAlign(textAlign),
31758
32136
  mapOverflow(overflow),
@@ -31765,14 +32143,20 @@ var Box = forwardRef3(function Box2({
31765
32143
  theme && `${theme}-theme`,
31766
32144
  className
31767
32145
  );
32146
+ const widthStyle = getSizingStyle(width, isWidthPreset);
32147
+ const minWidthStyle = getSizingStyle(minWidth, isMinWidthPreset);
32148
+ const maxWidthStyle = getSizingStyle(maxWidth, isMaxWidthPreset);
32149
+ const heightStyle = getSizingStyle(height, isHeightPreset);
32150
+ const minHeightStyle = getSizingStyle(minHeight, isMinHeightPreset);
32151
+ const maxHeightStyle = getSizingStyle(maxHeight, isMaxHeightPreset);
31768
32152
  const inlineStyles = {
31769
32153
  ...style,
31770
- ...width && { width },
31771
- ...minWidth && { minWidth },
31772
- ...maxWidth && { maxWidth },
31773
- ...height && { height },
31774
- ...minHeight && { minHeight },
31775
- ...maxHeight && { maxHeight },
32154
+ ...widthStyle && { width: widthStyle },
32155
+ ...minWidthStyle && { minWidth: minWidthStyle },
32156
+ ...maxWidthStyle && { maxWidth: maxWidthStyle },
32157
+ ...heightStyle && { height: heightStyle },
32158
+ ...minHeightStyle && { minHeight: minHeightStyle },
32159
+ ...maxHeightStyle && { maxHeight: maxHeightStyle },
31776
32160
  ...top && { top },
31777
32161
  ...right && { right },
31778
32162
  ...bottom && { bottom },
@@ -32526,7 +32910,22 @@ import { Fragment as Fragment7 } from "react";
32526
32910
  // src/components/Grid.tsx
32527
32911
  import { useId as useId2 } from "react";
32528
32912
  import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
32529
- var PRESET_VALUES = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "none", "subgrid"];
32913
+ var PRESET_VALUES = [
32914
+ "1",
32915
+ "2",
32916
+ "3",
32917
+ "4",
32918
+ "5",
32919
+ "6",
32920
+ "7",
32921
+ "8",
32922
+ "9",
32923
+ "10",
32924
+ "11",
32925
+ "12",
32926
+ "none",
32927
+ "subgrid"
32928
+ ];
32530
32929
  var BREAKPOINT_QUERIES = {
32531
32930
  base: "",
32532
32931
  sm: "@media (min-width: 640px)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umami/react-zen",
3
- "version": "0.221.0",
3
+ "version": "0.222.0",
4
4
  "description": "Modern, minimalist React component library",
5
5
  "homepage": "https://zen.umami.is",
6
6
  "repository": {