@azmr/ui 0.0.1 → 0.2.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 (92) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +244 -73
  3. package/dist/avatar.d.ts +58 -0
  4. package/dist/avatar.js +84 -0
  5. package/dist/breadcrumb.d.ts +47 -0
  6. package/dist/breadcrumb.js +120 -0
  7. package/dist/button-CYt2Zw3D.d.ts +64 -0
  8. package/dist/button.d.ts +54 -0
  9. package/dist/button.js +19 -0
  10. package/dist/chunk-2RIWL363.js +27 -0
  11. package/dist/chunk-2TQSHVXA.js +12 -0
  12. package/dist/chunk-7EOSDFS3.js +10 -0
  13. package/dist/chunk-C2HKIPLQ.js +118 -0
  14. package/dist/chunk-CAJLW6K2.js +16 -0
  15. package/dist/chunk-CZJZYN54.js +36 -0
  16. package/dist/chunk-EE4V6XMB.js +35 -0
  17. package/dist/chunk-EFHRRLAW.js +211 -0
  18. package/dist/chunk-GLB75NT3.js +21 -0
  19. package/dist/chunk-GX2YEJ43.js +36 -0
  20. package/dist/chunk-LTOLV67A.js +19 -0
  21. package/dist/chunk-LZMX27IZ.js +10 -0
  22. package/dist/chunk-NIIDYIZA.js +1 -0
  23. package/dist/chunk-Q4PPM2SU.js +97 -0
  24. package/dist/chunk-WVE2E37B.js +20 -0
  25. package/dist/chunk-XRZHP6BD.js +92 -0
  26. package/dist/disclosure.d.ts +72 -0
  27. package/dist/disclosure.js +221 -0
  28. package/dist/display.d.ts +111 -0
  29. package/dist/display.js +237 -0
  30. package/dist/floating.d.ts +81 -0
  31. package/dist/floating.js +231 -0
  32. package/dist/hooks.d.ts +33 -0
  33. package/dist/hooks.js +55 -0
  34. package/dist/icons/lucide.d.ts +77 -0
  35. package/dist/icons/lucide.js +135 -0
  36. package/dist/icons/mui-map.d.ts +1268 -0
  37. package/dist/icons/mui-map.js +352 -0
  38. package/dist/icons.d.ts +48 -0
  39. package/dist/icons.js +19 -0
  40. package/dist/index.d.ts +240 -5
  41. package/dist/index.js +242 -15
  42. package/dist/input.d.ts +14 -0
  43. package/dist/input.js +8 -0
  44. package/dist/layout/mui-map.d.ts +80 -0
  45. package/dist/layout/mui-map.js +104 -0
  46. package/dist/layout.d.ts +89 -0
  47. package/dist/layout.js +455 -0
  48. package/dist/lib.d.ts +11 -0
  49. package/dist/lib.js +6 -0
  50. package/dist/menu.d.ts +105 -0
  51. package/dist/menu.js +56 -0
  52. package/dist/modal.d.ts +105 -0
  53. package/dist/modal.js +273 -0
  54. package/dist/motion.css +295 -0
  55. package/dist/pagination.d.ts +82 -0
  56. package/dist/pagination.js +211 -0
  57. package/dist/presets.d.ts +97 -0
  58. package/dist/presets.js +94 -0
  59. package/dist/progress.d.ts +70 -0
  60. package/dist/progress.js +138 -0
  61. package/dist/react.d.ts +81 -0
  62. package/dist/react.js +281 -0
  63. package/dist/responsive-YJBnvsjt.d.ts +69 -0
  64. package/dist/scroll-area.d.ts +30 -0
  65. package/dist/scroll-area.js +80 -0
  66. package/dist/shared-Fkx-sjPt.d.ts +15 -0
  67. package/dist/spinner.d.ts +18 -0
  68. package/dist/spinner.js +39 -0
  69. package/dist/split-button.d.ts +32 -0
  70. package/dist/split-button.js +54 -0
  71. package/dist/stepper.d.ts +27 -0
  72. package/dist/stepper.js +104 -0
  73. package/dist/styles.css +24 -0
  74. package/dist/table.d.ts +52 -0
  75. package/dist/table.js +124 -0
  76. package/dist/theme.d.ts +111 -0
  77. package/dist/theme.js +414 -0
  78. package/dist/toast.d.ts +77 -0
  79. package/dist/toast.js +203 -0
  80. package/dist/toggle.d.ts +55 -0
  81. package/dist/toggle.js +88 -0
  82. package/dist/tokens.css +337 -0
  83. package/dist/transition.d.ts +51 -0
  84. package/dist/transition.js +79 -0
  85. package/dist/types-BBudf463.d.ts +39 -0
  86. package/dist/typography/mui-map.d.ts +91 -0
  87. package/dist/typography/mui-map.js +62 -0
  88. package/dist/typography.d.ts +90 -0
  89. package/dist/typography.js +193 -0
  90. package/dist/useSignal-C-3ZGURN.d.ts +21 -0
  91. package/dist/variants-De0c0ucO.d.ts +60 -0
  92. package/package.json +173 -18
@@ -0,0 +1,104 @@
1
+ // src/components/layout/mui-map.ts
2
+ var muiLayoutMap = {
3
+ grid: {
4
+ container: "Use <Grid cols={12}>. It is a CSS grid, not MUI's flex-based container.",
5
+ item: "Use <GridItem span={{ base, sm, md, lg, xl }}> with the same numbers.",
6
+ props: {
7
+ spacing: "gap (MUI unit 8px, ours 4px: spacing 2 is gap 4). See muiSpacingToGap.",
8
+ rowSpacing: 'No separate row gap: use gap, or className="gap-y-*".',
9
+ columnSpacing: 'No separate column gap: use gap, or className="gap-x-*".',
10
+ direction: "Not needed: GridItem placement is by column span.",
11
+ alignItems: "align",
12
+ justifyContent: "justify (justifyItems semantics in a grid).",
13
+ columns: "cols (the number of columns, default 12 in MUI).",
14
+ xs: "GridItem span.base",
15
+ sm: "GridItem span.sm",
16
+ md: "GridItem span.md",
17
+ lg: "GridItem span.lg",
18
+ xl: "GridItem span.xl"
19
+ }
20
+ },
21
+ stack: {
22
+ props: {
23
+ spacing: "gap (MUI unit 8px, ours 4px). See muiSpacingToGap.",
24
+ direction: "direction (accepts a responsive object).",
25
+ divider: "divider",
26
+ alignItems: "align",
27
+ justifyContent: "justify",
28
+ useFlexGap: "Not needed: Stack always uses flex gap."
29
+ }
30
+ },
31
+ container: {
32
+ props: {
33
+ maxWidth: "size (see muiContainerSize).",
34
+ disableGutters: "gutters={false}",
35
+ fixed: "Not supported: use size."
36
+ }
37
+ },
38
+ breakpoints: {
39
+ xs: "base",
40
+ sm: "sm",
41
+ md: "md",
42
+ lg: "lg",
43
+ xl: "xl",
44
+ note: "MUI breakpoints are 0/600/900/1200/1536px; Tailwind's are 0/640/768/1024/1280px, so layouts shift a little near the boundaries. Check them in the browser."
45
+ }
46
+ };
47
+ var SPACING_TO_GAP = /* @__PURE__ */ new Map([
48
+ [0, 0],
49
+ [0.5, 1],
50
+ [1, 2],
51
+ [1.5, 3],
52
+ [2, 4],
53
+ [2.5, 5],
54
+ [3, 6],
55
+ [4, 8],
56
+ [5, 10],
57
+ [6, 12]
58
+ ]);
59
+ function muiSpacingToGap(spacing) {
60
+ return SPACING_TO_GAP.get(spacing);
61
+ }
62
+ var MUI_BREAKPOINTS = {
63
+ xs: "base",
64
+ sm: "sm",
65
+ md: "md",
66
+ lg: "lg",
67
+ xl: "xl"
68
+ };
69
+ function muiBreakpoint(key) {
70
+ return Object.hasOwn(MUI_BREAKPOINTS, key) ? MUI_BREAKPOINTS[key] : void 0;
71
+ }
72
+ var MUI_CONTAINER = {
73
+ xs: { size: "sm", approximate: true },
74
+ sm: { size: "sm" },
75
+ md: { size: "md" },
76
+ lg: { size: "lg" },
77
+ xl: { size: "2xl" }
78
+ };
79
+ function muiContainerSize(maxWidth) {
80
+ if (maxWidth === false) return { size: "full" };
81
+ const key = maxWidth ?? "lg";
82
+ return Object.hasOwn(MUI_CONTAINER, key) ? MUI_CONTAINER[key] : void 0;
83
+ }
84
+ function muiGridItemSpan(props) {
85
+ const span = {};
86
+ const unsupported = [];
87
+ for (const [key, value] of Object.entries(props)) {
88
+ const breakpoint = muiBreakpoint(key);
89
+ if (breakpoint === void 0 || value === void 0) continue;
90
+ if (typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 12) {
91
+ span[breakpoint] = value;
92
+ } else {
93
+ unsupported.push(`${key}=${String(value)}`);
94
+ }
95
+ }
96
+ return { span: Object.keys(span).length > 0 ? span : void 0, unsupported };
97
+ }
98
+ export {
99
+ muiBreakpoint,
100
+ muiContainerSize,
101
+ muiGridItemSpan,
102
+ muiLayoutMap,
103
+ muiSpacingToGap
104
+ };
@@ -0,0 +1,89 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { B as Breakpoint, G as Gap, A as AlignItems, J as JustifyItems, L as LayoutElement, a as JustifyContent } from './responsive-YJBnvsjt.js';
4
+ export { C as Container, b as ContainerProps, c as ContainerSize } from './responsive-YJBnvsjt.js';
5
+
6
+ declare const NAMED_RATIOS: {
7
+ readonly square: "aspect-square";
8
+ readonly video: "aspect-video";
9
+ readonly "4/3": "aspect-[4/3]";
10
+ readonly "3/2": "aspect-[3/2]";
11
+ readonly "21/9": "aspect-[21/9]";
12
+ readonly "3/4": "aspect-[3/4]";
13
+ };
14
+ type NamedRatio = keyof typeof NAMED_RATIOS;
15
+ interface AspectRatioProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
16
+ /** A name (`square`, `video` (16/9), `4/3`, `3/2`, `21/9`, `3/4`) or a positive width-to-height number. Default `video`. */
17
+ ratio?: NamedRatio | number;
18
+ children?: ReactNode;
19
+ }
20
+ /** A box that keeps an aspect ratio. Direct `img`, `video` and `iframe` children fill it. Server-safe. */
21
+ declare const AspectRatio: react.ForwardRefExoticComponent<AspectRatioProps & react.RefAttributes<HTMLDivElement>>;
22
+
23
+ /** A value, or one per breakpoint: `4` or `{ base: 1, md: 3 }`. A bare value applies from `base`. */
24
+ type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
25
+
26
+ type ColumnCount = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
27
+ interface GridProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
28
+ /** Column count, or one per breakpoint: `{ base: 1, md: 3 }`. Default 1. */
29
+ cols?: Responsive<ColumnCount>;
30
+ /**
31
+ * Fill the row with as many columns as fit, each at least this wide (`"16rem"`), instead of a
32
+ * fixed count. Takes the place of `cols`.
33
+ */
34
+ minItemWidth?: string;
35
+ gap?: Gap;
36
+ /** Vertical alignment of items within their cell. */
37
+ align?: AlignItems;
38
+ /** Horizontal alignment of items within their cell. */
39
+ justify?: JustifyItems;
40
+ as?: LayoutElement;
41
+ children?: ReactNode;
42
+ }
43
+ /**
44
+ * CSS grid with a responsive column count. This is not MUI's 12-column item system: for that,
45
+ * use `cols={12}` and give children a `GridItem` with `span`. Server-safe.
46
+ */
47
+ declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLElement>>;
48
+ type SpanValue = ColumnCount | "full";
49
+ interface GridItemProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
50
+ /** Columns to span, or one per breakpoint: `{ base: 12, md: 6 }`. `"full"` spans every column. */
51
+ span?: Responsive<SpanValue>;
52
+ as?: LayoutElement;
53
+ children?: ReactNode;
54
+ }
55
+ /** A grid cell that spans columns. The replacement for MUI's `<Grid item xs md>`. */
56
+ declare const GridItem: react.ForwardRefExoticComponent<GridItemProps & react.RefAttributes<HTMLElement>>;
57
+
58
+ interface SeparatorProps extends HTMLAttributes<HTMLElement> {
59
+ orientation?: "horizontal" | "vertical";
60
+ /**
61
+ * Purely visual: hidden from assistive technology (`role="none"`). Use it when the content
62
+ * either side of the line already reads as separate. Otherwise it is announced as a separator.
63
+ */
64
+ decorative?: boolean;
65
+ }
66
+ /**
67
+ * A line between content. A horizontal one is a real `<hr>`; a vertical one is a `role="separator"`
68
+ * with `aria-orientation`. Server-safe.
69
+ */
70
+ declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLElement>>;
71
+
72
+ interface StackProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
73
+ /** `column` (default) or `row`, or one per breakpoint: `{ base: "column", md: "row" }`. */
74
+ direction?: Responsive<"row" | "column">;
75
+ /** The space between children, on the 4px scale (0 to 12), or `density` to follow the density token. */
76
+ gap?: Gap;
77
+ align?: AlignItems;
78
+ justify?: JustifyContent;
79
+ wrap?: boolean;
80
+ /** An element placed between children (never before the first or after the last). */
81
+ divider?: ReactNode;
82
+ /** The element to render. Default `div`. */
83
+ as?: LayoutElement;
84
+ children?: ReactNode;
85
+ }
86
+ /** One-dimensional layout: children in a row or column with a consistent gap. Server-safe. */
87
+ declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLElement>>;
88
+
89
+ export { AlignItems, AspectRatio, type AspectRatioProps, Breakpoint, Gap, Grid, GridItem, type GridItemProps, type GridProps, JustifyContent, JustifyItems, LayoutElement, type NamedRatio, type Responsive, Separator, type SeparatorProps, Stack, type StackProps };
package/dist/layout.js ADDED
@@ -0,0 +1,455 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-7EOSDFS3.js";
4
+
5
+ // src/components/layout/aspect-ratio.tsx
6
+ import {
7
+ forwardRef
8
+ } from "react";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var NAMED_RATIOS = {
11
+ square: "aspect-square",
12
+ video: "aspect-video",
13
+ "4/3": "aspect-[4/3]",
14
+ "3/2": "aspect-[3/2]",
15
+ "21/9": "aspect-[21/9]",
16
+ "3/4": "aspect-[3/4]"
17
+ };
18
+ var AspectRatio = forwardRef(function AspectRatio2({ ratio = "video", className, style, children, ...props }, ref) {
19
+ const named = typeof ratio === "string" && Object.hasOwn(NAMED_RATIOS, ratio);
20
+ if (!named && !(typeof ratio === "number" && Number.isFinite(ratio) && ratio > 0)) {
21
+ throw new Error(
22
+ `AspectRatio: ratio must be one of ${Object.keys(NAMED_RATIOS).join(", ")} or a positive number, got ${JSON.stringify(ratio)}`
23
+ );
24
+ }
25
+ return /* @__PURE__ */ jsx(
26
+ "div",
27
+ {
28
+ ref,
29
+ className: cn(
30
+ "relative w-full overflow-hidden",
31
+ named ? NAMED_RATIOS[ratio] : "aspect-(--azmr-ratio)",
32
+ "[&>img]:h-full [&>img]:w-full [&>img]:object-cover",
33
+ "[&>video]:h-full [&>video]:w-full [&>video]:object-cover",
34
+ "[&>iframe]:h-full [&>iframe]:w-full",
35
+ className
36
+ ),
37
+ style: named ? style : { "--azmr-ratio": String(ratio), ...style },
38
+ ...props,
39
+ children
40
+ }
41
+ );
42
+ });
43
+
44
+ // src/components/layout/container.tsx
45
+ import { forwardRef as forwardRef2 } from "react";
46
+ import { jsx as jsx2 } from "react/jsx-runtime";
47
+ var CONTAINER_SIZE_CLASSES = {
48
+ sm: "max-w-2xl",
49
+ md: "max-w-4xl",
50
+ lg: "max-w-6xl",
51
+ xl: "max-w-7xl",
52
+ "2xl": "max-w-[96rem]",
53
+ full: "max-w-none"
54
+ };
55
+ var Container = forwardRef2(function Container2({ size = "lg", gutters = true, as: Component = "div", className, children, ...props }, ref) {
56
+ return /* @__PURE__ */ jsx2(
57
+ Component,
58
+ {
59
+ ref,
60
+ className: cn(
61
+ "mx-auto w-full",
62
+ CONTAINER_SIZE_CLASSES[size],
63
+ gutters && "px-4 sm:px-6 lg:px-8",
64
+ className
65
+ ),
66
+ ...props,
67
+ children
68
+ }
69
+ );
70
+ });
71
+
72
+ // src/components/layout/grid.tsx
73
+ import {
74
+ forwardRef as forwardRef3
75
+ } from "react";
76
+
77
+ // src/components/layout/responsive.ts
78
+ var BREAKPOINTS = ["base", "sm", "md", "lg", "xl", "2xl"];
79
+ var DIRECTION_CLASSES = {
80
+ base: {
81
+ row: "flex-row",
82
+ column: "flex-col"
83
+ },
84
+ sm: {
85
+ row: "sm:flex-row",
86
+ column: "sm:flex-col"
87
+ },
88
+ md: {
89
+ row: "md:flex-row",
90
+ column: "md:flex-col"
91
+ },
92
+ lg: {
93
+ row: "lg:flex-row",
94
+ column: "lg:flex-col"
95
+ },
96
+ xl: {
97
+ row: "xl:flex-row",
98
+ column: "xl:flex-col"
99
+ },
100
+ "2xl": {
101
+ row: "2xl:flex-row",
102
+ column: "2xl:flex-col"
103
+ }
104
+ };
105
+ var COLS_CLASSES = {
106
+ base: {
107
+ "1": "grid-cols-1",
108
+ "2": "grid-cols-2",
109
+ "3": "grid-cols-3",
110
+ "4": "grid-cols-4",
111
+ "5": "grid-cols-5",
112
+ "6": "grid-cols-6",
113
+ "7": "grid-cols-7",
114
+ "8": "grid-cols-8",
115
+ "9": "grid-cols-9",
116
+ "10": "grid-cols-10",
117
+ "11": "grid-cols-11",
118
+ "12": "grid-cols-12"
119
+ },
120
+ sm: {
121
+ "1": "sm:grid-cols-1",
122
+ "2": "sm:grid-cols-2",
123
+ "3": "sm:grid-cols-3",
124
+ "4": "sm:grid-cols-4",
125
+ "5": "sm:grid-cols-5",
126
+ "6": "sm:grid-cols-6",
127
+ "7": "sm:grid-cols-7",
128
+ "8": "sm:grid-cols-8",
129
+ "9": "sm:grid-cols-9",
130
+ "10": "sm:grid-cols-10",
131
+ "11": "sm:grid-cols-11",
132
+ "12": "sm:grid-cols-12"
133
+ },
134
+ md: {
135
+ "1": "md:grid-cols-1",
136
+ "2": "md:grid-cols-2",
137
+ "3": "md:grid-cols-3",
138
+ "4": "md:grid-cols-4",
139
+ "5": "md:grid-cols-5",
140
+ "6": "md:grid-cols-6",
141
+ "7": "md:grid-cols-7",
142
+ "8": "md:grid-cols-8",
143
+ "9": "md:grid-cols-9",
144
+ "10": "md:grid-cols-10",
145
+ "11": "md:grid-cols-11",
146
+ "12": "md:grid-cols-12"
147
+ },
148
+ lg: {
149
+ "1": "lg:grid-cols-1",
150
+ "2": "lg:grid-cols-2",
151
+ "3": "lg:grid-cols-3",
152
+ "4": "lg:grid-cols-4",
153
+ "5": "lg:grid-cols-5",
154
+ "6": "lg:grid-cols-6",
155
+ "7": "lg:grid-cols-7",
156
+ "8": "lg:grid-cols-8",
157
+ "9": "lg:grid-cols-9",
158
+ "10": "lg:grid-cols-10",
159
+ "11": "lg:grid-cols-11",
160
+ "12": "lg:grid-cols-12"
161
+ },
162
+ xl: {
163
+ "1": "xl:grid-cols-1",
164
+ "2": "xl:grid-cols-2",
165
+ "3": "xl:grid-cols-3",
166
+ "4": "xl:grid-cols-4",
167
+ "5": "xl:grid-cols-5",
168
+ "6": "xl:grid-cols-6",
169
+ "7": "xl:grid-cols-7",
170
+ "8": "xl:grid-cols-8",
171
+ "9": "xl:grid-cols-9",
172
+ "10": "xl:grid-cols-10",
173
+ "11": "xl:grid-cols-11",
174
+ "12": "xl:grid-cols-12"
175
+ },
176
+ "2xl": {
177
+ "1": "2xl:grid-cols-1",
178
+ "2": "2xl:grid-cols-2",
179
+ "3": "2xl:grid-cols-3",
180
+ "4": "2xl:grid-cols-4",
181
+ "5": "2xl:grid-cols-5",
182
+ "6": "2xl:grid-cols-6",
183
+ "7": "2xl:grid-cols-7",
184
+ "8": "2xl:grid-cols-8",
185
+ "9": "2xl:grid-cols-9",
186
+ "10": "2xl:grid-cols-10",
187
+ "11": "2xl:grid-cols-11",
188
+ "12": "2xl:grid-cols-12"
189
+ }
190
+ };
191
+ var SPAN_CLASSES = {
192
+ base: {
193
+ "1": "col-span-1",
194
+ "2": "col-span-2",
195
+ "3": "col-span-3",
196
+ "4": "col-span-4",
197
+ "5": "col-span-5",
198
+ "6": "col-span-6",
199
+ "7": "col-span-7",
200
+ "8": "col-span-8",
201
+ "9": "col-span-9",
202
+ "10": "col-span-10",
203
+ "11": "col-span-11",
204
+ "12": "col-span-12",
205
+ full: "col-span-full"
206
+ },
207
+ sm: {
208
+ "1": "sm:col-span-1",
209
+ "2": "sm:col-span-2",
210
+ "3": "sm:col-span-3",
211
+ "4": "sm:col-span-4",
212
+ "5": "sm:col-span-5",
213
+ "6": "sm:col-span-6",
214
+ "7": "sm:col-span-7",
215
+ "8": "sm:col-span-8",
216
+ "9": "sm:col-span-9",
217
+ "10": "sm:col-span-10",
218
+ "11": "sm:col-span-11",
219
+ "12": "sm:col-span-12",
220
+ full: "sm:col-span-full"
221
+ },
222
+ md: {
223
+ "1": "md:col-span-1",
224
+ "2": "md:col-span-2",
225
+ "3": "md:col-span-3",
226
+ "4": "md:col-span-4",
227
+ "5": "md:col-span-5",
228
+ "6": "md:col-span-6",
229
+ "7": "md:col-span-7",
230
+ "8": "md:col-span-8",
231
+ "9": "md:col-span-9",
232
+ "10": "md:col-span-10",
233
+ "11": "md:col-span-11",
234
+ "12": "md:col-span-12",
235
+ full: "md:col-span-full"
236
+ },
237
+ lg: {
238
+ "1": "lg:col-span-1",
239
+ "2": "lg:col-span-2",
240
+ "3": "lg:col-span-3",
241
+ "4": "lg:col-span-4",
242
+ "5": "lg:col-span-5",
243
+ "6": "lg:col-span-6",
244
+ "7": "lg:col-span-7",
245
+ "8": "lg:col-span-8",
246
+ "9": "lg:col-span-9",
247
+ "10": "lg:col-span-10",
248
+ "11": "lg:col-span-11",
249
+ "12": "lg:col-span-12",
250
+ full: "lg:col-span-full"
251
+ },
252
+ xl: {
253
+ "1": "xl:col-span-1",
254
+ "2": "xl:col-span-2",
255
+ "3": "xl:col-span-3",
256
+ "4": "xl:col-span-4",
257
+ "5": "xl:col-span-5",
258
+ "6": "xl:col-span-6",
259
+ "7": "xl:col-span-7",
260
+ "8": "xl:col-span-8",
261
+ "9": "xl:col-span-9",
262
+ "10": "xl:col-span-10",
263
+ "11": "xl:col-span-11",
264
+ "12": "xl:col-span-12",
265
+ full: "xl:col-span-full"
266
+ },
267
+ "2xl": {
268
+ "1": "2xl:col-span-1",
269
+ "2": "2xl:col-span-2",
270
+ "3": "2xl:col-span-3",
271
+ "4": "2xl:col-span-4",
272
+ "5": "2xl:col-span-5",
273
+ "6": "2xl:col-span-6",
274
+ "7": "2xl:col-span-7",
275
+ "8": "2xl:col-span-8",
276
+ "9": "2xl:col-span-9",
277
+ "10": "2xl:col-span-10",
278
+ "11": "2xl:col-span-11",
279
+ "12": "2xl:col-span-12",
280
+ full: "2xl:col-span-full"
281
+ }
282
+ };
283
+
284
+ // src/components/layout/responsive-utils.ts
285
+ function responsiveClasses(value, table) {
286
+ if (value === void 0 || value === null) return [];
287
+ const perBreakpoint = typeof value === "object" ? value : { base: value };
288
+ const classes = [];
289
+ for (const breakpoint of BREAKPOINTS) {
290
+ if (!Object.hasOwn(perBreakpoint, breakpoint)) continue;
291
+ const key = perBreakpoint[breakpoint];
292
+ if (key === void 0) continue;
293
+ const row = table[breakpoint];
294
+ const name = String(key);
295
+ if (Object.hasOwn(row, name)) classes.push(row[name]);
296
+ }
297
+ return classes;
298
+ }
299
+
300
+ // src/components/layout/scale.ts
301
+ var GAP_CLASSES = {
302
+ 0: "gap-0",
303
+ 1: "gap-1",
304
+ 2: "gap-2",
305
+ 3: "gap-3",
306
+ 4: "gap-4",
307
+ 5: "gap-5",
308
+ 6: "gap-6",
309
+ 8: "gap-8",
310
+ 10: "gap-10",
311
+ 12: "gap-12",
312
+ density: "gap-(--density-gap)"
313
+ };
314
+ var ALIGN_ITEMS_CLASSES = {
315
+ start: "items-start",
316
+ center: "items-center",
317
+ end: "items-end",
318
+ stretch: "items-stretch",
319
+ baseline: "items-baseline"
320
+ };
321
+ var JUSTIFY_CONTENT_CLASSES = {
322
+ start: "justify-start",
323
+ center: "justify-center",
324
+ end: "justify-end",
325
+ between: "justify-between",
326
+ around: "justify-around",
327
+ evenly: "justify-evenly"
328
+ };
329
+ var JUSTIFY_ITEMS_CLASSES = {
330
+ start: "justify-items-start",
331
+ center: "justify-items-center",
332
+ end: "justify-items-end",
333
+ stretch: "justify-items-stretch"
334
+ };
335
+
336
+ // src/components/layout/grid.tsx
337
+ import { jsx as jsx3 } from "react/jsx-runtime";
338
+ var CSS_LENGTH = /^\d+(?:\.\d+)?(?:px|rem|em|ch|vw|%)$/;
339
+ var Grid = forwardRef3(function Grid2({
340
+ cols = 1,
341
+ minItemWidth,
342
+ gap = 0,
343
+ align,
344
+ justify,
345
+ as: Component = "div",
346
+ className,
347
+ style,
348
+ children,
349
+ ...props
350
+ }, ref) {
351
+ if (minItemWidth !== void 0 && !CSS_LENGTH.test(minItemWidth)) {
352
+ throw new Error(
353
+ `Grid: minItemWidth must be a plain CSS length like "16rem" or "240px", got ${JSON.stringify(minItemWidth)}`
354
+ );
355
+ }
356
+ const autoFit = minItemWidth !== void 0;
357
+ return /* @__PURE__ */ jsx3(
358
+ Component,
359
+ {
360
+ ref,
361
+ className: cn(
362
+ "grid",
363
+ autoFit ? "grid-cols-[repeat(auto-fit,minmax(min(100%,var(--azmr-grid-min)),1fr))]" : responsiveClasses(cols, COLS_CLASSES),
364
+ GAP_CLASSES[gap],
365
+ align && ALIGN_ITEMS_CLASSES[align],
366
+ justify && JUSTIFY_ITEMS_CLASSES[justify],
367
+ className
368
+ ),
369
+ style: autoFit ? { "--azmr-grid-min": minItemWidth, ...style } : style,
370
+ ...props,
371
+ children
372
+ }
373
+ );
374
+ });
375
+ var GridItem = forwardRef3(function GridItem2({ span, as: Component = "div", className, children, ...props }, ref) {
376
+ return /* @__PURE__ */ jsx3(
377
+ Component,
378
+ {
379
+ ref,
380
+ className: cn(responsiveClasses(span, SPAN_CLASSES), className),
381
+ ...props,
382
+ children
383
+ }
384
+ );
385
+ });
386
+
387
+ // src/components/layout/separator.tsx
388
+ import { forwardRef as forwardRef4 } from "react";
389
+ import { jsx as jsx4 } from "react/jsx-runtime";
390
+ var Separator = forwardRef4(function Separator2({ orientation = "horizontal", decorative = false, className, ...props }, ref) {
391
+ const vertical = orientation === "vertical";
392
+ const classes = cn(
393
+ "shrink-0 border-0 bg-border",
394
+ vertical ? "w-px self-stretch" : "h-px w-full",
395
+ className
396
+ );
397
+ const semantics = decorative ? { role: "none" } : vertical ? { role: "separator", "aria-orientation": "vertical" } : {};
398
+ return vertical ? /* @__PURE__ */ jsx4("div", { ref, className: classes, ...semantics, ...props }) : /* @__PURE__ */ jsx4("hr", { ref, className: classes, ...semantics, ...props });
399
+ });
400
+
401
+ // src/components/layout/stack.tsx
402
+ import {
403
+ Children,
404
+ Fragment,
405
+ forwardRef as forwardRef5
406
+ } from "react";
407
+ import { jsx as jsx5 } from "react/jsx-runtime";
408
+ var Stack = forwardRef5(function Stack2({
409
+ direction = "column",
410
+ gap = 0,
411
+ align,
412
+ justify,
413
+ wrap,
414
+ divider,
415
+ as: Component = "div",
416
+ className,
417
+ children,
418
+ ...props
419
+ }, ref) {
420
+ const items = divider === void 0 ? children : withDividers(children, divider);
421
+ return /* @__PURE__ */ jsx5(
422
+ Component,
423
+ {
424
+ ref,
425
+ className: cn(
426
+ "flex",
427
+ responsiveClasses(direction, DIRECTION_CLASSES),
428
+ GAP_CLASSES[gap],
429
+ align && ALIGN_ITEMS_CLASSES[align],
430
+ justify && JUSTIFY_CONTENT_CLASSES[justify],
431
+ wrap && "flex-wrap",
432
+ className
433
+ ),
434
+ ...props,
435
+ children: items
436
+ }
437
+ );
438
+ });
439
+ function withDividers(children, divider) {
440
+ const items = Children.toArray(children);
441
+ const out = [];
442
+ items.forEach((child, index) => {
443
+ if (index > 0) out.push(/* @__PURE__ */ jsx5(Fragment, { children: divider }, `divider-${index}`));
444
+ out.push(child);
445
+ });
446
+ return out;
447
+ }
448
+ export {
449
+ AspectRatio,
450
+ Container,
451
+ Grid,
452
+ GridItem,
453
+ Separator,
454
+ Stack
455
+ };
package/dist/lib.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { ClassValue } from 'clsx';
2
+ export { ClassValue } from 'clsx';
3
+
4
+ /**
5
+ * Merge class names, resolving conflicting Tailwind utilities so the last one
6
+ * wins (`cn("p-2", "p-4")` → `"p-4"`). Every component accepts `className` and
7
+ * passes it through `cn` last, so callers can always override a default.
8
+ */
9
+ declare function cn(...inputs: ClassValue[]): string;
10
+
11
+ export { cn };
package/dist/lib.js ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ cn
3
+ } from "./chunk-7EOSDFS3.js";
4
+ export {
5
+ cn
6
+ };