@techzyapp/ui-library 1.0.2 → 1.0.3

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.
@@ -0,0 +1,104 @@
1
+ import { jsx as M } from "react/jsx-runtime";
2
+ import { forwardRef as G, useMemo as I, Children as K, useState as A, useRef as C, useCallback as T, useLayoutEffect as N, useEffect as P } from "react";
3
+ import { s as O } from "./Flex-Bj3mMF5A.js";
4
+ import { B as d, a as H } from "./breakpoints-o3dzSzrU.js";
5
+ import { u as h } from "./useMediaQuery-_1EcFoC5.js";
6
+ const q = 200, F = (r, l) => r.length === l.length && r.every((n, c) => n === l[c]);
7
+ function S(r, l) {
8
+ if (r == null || typeof r != "object") return r;
9
+ const n = r;
10
+ let c;
11
+ for (const i of H)
12
+ n[i] != null && l[i] && (c = n[i]);
13
+ if (c === void 0) {
14
+ for (const i of H)
15
+ if (n[i] != null) {
16
+ c = n[i];
17
+ break;
18
+ }
19
+ }
20
+ return c;
21
+ }
22
+ const U = G(function({ columns: l = 3, minColumnWidth: n, gap: c = "md", padding: i, className: $, style: k, children: b, ...B }, m) {
23
+ const x = I(() => K.toArray(b), [b]), f = x.length, v = {
24
+ xs: !0,
25
+ sm: h(`(min-width: ${d.sm}px)`),
26
+ md: h(`(min-width: ${d.md}px)`),
27
+ lg: h(`(min-width: ${d.lg}px)`),
28
+ xl: h(`(min-width: ${d.xl}px)`)
29
+ }, y = Math.max(1, S(l, v) ?? 1), g = O(S(c, v)), [a, D] = A(y), [w, _] = A([]), R = C(null), E = C([]), j = T(
30
+ (e) => {
31
+ R.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
32
+ },
33
+ [m]
34
+ ), p = T(() => {
35
+ const e = R.current;
36
+ if (!e) return;
37
+ let s = y;
38
+ if (n != null) {
39
+ const t = parseFloat(getComputedStyle(e).columnGap) || 0, u = e.clientWidth;
40
+ s = Math.max(1, Math.floor((u + t) / (n + t)));
41
+ }
42
+ D((t) => t === s ? t : s);
43
+ const o = E.current.slice(0, f).map((t) => t ? t.offsetHeight : 0);
44
+ _((t) => F(t, o) ? t : o);
45
+ }, [y, n, f]);
46
+ N(p, [p, x, a, g]), P(() => {
47
+ const e = R.current;
48
+ if (!e || typeof ResizeObserver > "u") return;
49
+ const s = new ResizeObserver(() => p());
50
+ return s.observe(e), E.current.slice(0, f).forEach((o) => o && s.observe(o)), () => s.disconnect();
51
+ }, [p, f, a]);
52
+ const z = I(() => {
53
+ const e = Array.from({ length: a }, () => []), s = new Array(a).fill(0);
54
+ for (let o = 0; o < f; o++) {
55
+ let t = 0;
56
+ for (let u = 1; u < a; u++) s[u] < s[t] && (t = u);
57
+ e[t].push(o), s[t] += w[o] || q;
58
+ }
59
+ return e;
60
+ }, [a, f, w]);
61
+ return /* @__PURE__ */ M(
62
+ "div",
63
+ {
64
+ ref: j,
65
+ className: $,
66
+ style: {
67
+ display: "flex",
68
+ alignItems: "flex-start",
69
+ gap: g,
70
+ padding: O(i),
71
+ ...k
72
+ },
73
+ ...B,
74
+ children: z.map((e, s) => /* @__PURE__ */ M(
75
+ "div",
76
+ {
77
+ style: {
78
+ display: "flex",
79
+ flexDirection: "column",
80
+ gap: g,
81
+ flex: "1 1 0",
82
+ minWidth: 0
83
+ },
84
+ children: e.map((o) => /* @__PURE__ */ M(
85
+ "div",
86
+ {
87
+ ref: (t) => {
88
+ E.current[o] = t;
89
+ },
90
+ style: { minWidth: 0 },
91
+ children: x[o]
92
+ },
93
+ o
94
+ ))
95
+ },
96
+ s
97
+ ))
98
+ }
99
+ );
100
+ });
101
+ export {
102
+ U as M
103
+ };
104
+ //# sourceMappingURL=Masonry-BTvtDdnt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Masonry-BTvtDdnt.js","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { BREAKPOINTS, BREAKPOINT_ORDER, type Breakpoint } from '../../theme/breakpoints'\nimport { useMediaQuery } from '../../hooks/useMediaQuery'\n\n// nominal height for a not-yet-measured item, so the first (pre-measure) pass spreads items across\n// columns round-robin instead of dumping them all into the first one; corrected on the layout pass.\nconst ESTIMATED_ITEM_HEIGHT = 200\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Number of columns. Either a fixed number, or a **mobile-first** map keyed by the library's\n * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies from that breakpoint's min-width up,\n * until a larger defined one overrides it, with the smallest defined key as the base. Defaults to\n * `3`. Ignored when `minColumnWidth` is set.\n *\n * @example columns={2} // always 2\n * @example columns={{ xs: 1, md: 2 }} // 1 below md (768px), 2 at md and up\n */\n columns?: number | Partial<Record<Breakpoint, number>>\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /**\n * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px\n * number, or any CSS value) or a **mobile-first** breakpoint map — same resolution as `columns`.\n * Defaults to `md`.\n *\n * @example gap=\"md\"\n * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up\n */\n gap?: Spacing | Partial<Record<Breakpoint, Spacing>>\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Resolve a possibly-responsive prop to a concrete value. A plain value passes through; a mobile-first\n * breakpoint map (a plain object keyed by breakpoints) picks the value of the **largest defined\n * breakpoint that currently matches**, falling back to the smallest defined key as the base when none\n * larger has kicked in yet.\n */\nfunction resolveResponsive<T>(\n value: T | Partial<Record<Breakpoint, T>>,\n matches: Record<Breakpoint, boolean>,\n): T | undefined {\n if (value == null || typeof value !== 'object') return value as T | undefined\n const map = value as Partial<Record<Breakpoint, T>>\n let resolved: T | undefined\n for (const bp of BREAKPOINT_ORDER) {\n if (map[bp] != null && matches[bp]) resolved = map[bp]\n }\n if (resolved === undefined) {\n for (const bp of BREAKPOINT_ORDER) {\n if (map[bp] != null) {\n resolved = map[bp]\n break\n }\n }\n }\n return resolved\n}\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),\n * so it works with any children. `columns` is either a fixed number or a mobile-first breakpoint map\n * (`{ xs: 1, md: 2 }`); `minColumnWidth` is a responsive alternative (and overrides `columns`); `gap`\n * spaces items on both axes and is itself responsive the same way (`{ xs: 'sm', md: 'lg' }`).\n * Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer `style` merges last.\n * Reading order flows left-to-right across the columns.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n // active min-width breakpoints — a FIXED set of hook calls (order-stable), mobile-first; `xs` is the\n // always-true base. `useMediaQuery` is correct on the first client render, so the resolved count has\n // no flash. These fire regardless of the `columns` form; a plain number just ignores them.\n const matches: Record<Breakpoint, boolean> = {\n xs: true,\n sm: useMediaQuery(`(min-width: ${BREAKPOINTS.sm}px)`),\n md: useMediaQuery(`(min-width: ${BREAKPOINTS.md}px)`),\n lg: useMediaQuery(`(min-width: ${BREAKPOINTS.lg}px)`),\n xl: useMediaQuery(`(min-width: ${BREAKPOINTS.xl}px)`),\n }\n const resolvedColumns = Math.max(1, resolveResponsive(columns, matches) ?? 1)\n const gapValue = space(resolveResponsive(gap, matches))\n\n const [colCount, setColCount] = useState(resolvedColumns)\n const [heights, setHeights] = useState<number[]>([])\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // merge the internal measuring ref with the forwarded ref\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // measure the container width → column count, and each item's height → the balance\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n\n let nextCols = resolvedColumns\n if (minColumnWidth != null) {\n const g = parseFloat(getComputedStyle(root).columnGap) || 0\n const width = root.clientWidth\n nextCols = Math.max(1, Math.floor((width + g) / (minColumnWidth + g)))\n }\n setColCount((prev) => (prev === nextCols ? prev : nextCols))\n\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [resolvedColumns, minColumnWidth, count])\n\n // measure before paint (mount + whenever the item set, column count, or gap changes — a gap change\n // shifts column widths, so heights and the minColumnWidth count need re-reading)\n useLayoutEffect(measure, [measure, items, colCount, gapValue])\n\n // re-balance on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count, colCount])\n\n // greedily assign each item (in order) to the currently shortest column\n const columnsItems = useMemo(() => {\n const buckets: number[][] = Array.from({ length: colCount }, () => [])\n const acc = new Array(colCount).fill(0)\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (acc[c] < acc[min]) min = c\n buckets[min].push(i)\n acc[min] += heights[i] || ESTIMATED_ITEM_HEIGHT\n }\n return buckets\n }, [colCount, count, heights])\n\n return (\n <div\n ref={setRootRef}\n className={className}\n style={{\n display: 'flex',\n alignItems: 'flex-start',\n gap: gapValue,\n padding: space(padding),\n ...style,\n }}\n {...props}\n >\n {columnsItems.map((indices, c) => (\n <div\n key={c}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: gapValue,\n flex: '1 1 0',\n minWidth: 0,\n }}\n >\n {indices.map((i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={{ minWidth: 0 } as CSSProperties}\n >\n {items[i]}\n </div>\n ))}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["ESTIMATED_ITEM_HEIGHT","arraysEqual","a","b","v","i","resolveResponsive","value","matches","map","resolved","bp","BREAKPOINT_ORDER","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","useMediaQuery","BREAKPOINTS","resolvedColumns","gapValue","space","colCount","setColCount","useState","heights","setHeights","rootRef","useRef","itemRefs","setRootRef","useCallback","node","measure","root","nextCols","g","width","prev","next","el","useLayoutEffect","useEffect","ro","columnsItems","buckets","acc","min","c","jsx","indices"],"mappings":";;;;;AAmBA,MAAMA,IAAwB,KA8BxBC,IAAc,CAACC,GAAaC,MAChCD,EAAE,WAAWC,EAAE,UAAUD,EAAE,MAAM,CAACE,GAAGC,MAAMD,MAAMD,EAAEE,CAAC,CAAC;AAQvD,SAASC,EACPC,GACAC,GACe;AACf,MAAID,KAAS,QAAQ,OAAOA,KAAU,SAAU,QAAOA;AACvD,QAAME,IAAMF;AACZ,MAAIG;AACJ,aAAWC,KAAMC;AACf,IAAIH,EAAIE,CAAE,KAAK,QAAQH,EAAQG,CAAE,MAAGD,IAAWD,EAAIE,CAAE;AAEvD,MAAID,MAAa;AACf,eAAWC,KAAMC;AACf,UAAIH,EAAIE,CAAE,KAAK,MAAM;AACnB,QAAAD,IAAWD,EAAIE,CAAE;AACjB;AAAA,MACF;AAAA;AAGJ,SAAOD;AACT;AAYO,MAAMG,IAAUC,EAAyC,SAC9D,EAAE,SAAAC,IAAU,GAAG,gBAAAC,GAAgB,KAAAC,IAAM,MAAM,SAAAC,GAAS,WAAAC,GAAW,OAAAC,GAAO,UA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;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,KAAKY;AAAA,QACL,SAASC,EAAMd,CAAO;AAAA,QACtB,GAAGE;AAAA,MAAA;AAAA,MAEJ,GAAGE;AAAA,MAEH,UAAAiC,EAAa,IAAI,CAACM,GAASF,MAC1B,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,OAAO;AAAA,YACL,SAAS;AAAA,YACT,eAAe;AAAA,YACf,KAAK7B;AAAA,YACL,MAAM;AAAA,YACN,UAAU;AAAA,UAAA;AAAA,UAGX,UAAA8B,EAAQ,IAAI,CAACxD,MACZ,gBAAAuD;AAAA,YAAC;AAAA,YAAA;AAAA,cAEC,KAAK,CAACT,MAAO;AACX,gBAAAX,EAAS,QAAQnC,CAAC,IAAI8C;AAAA,cACxB;AAAA,cACA,OAAO,EAAE,UAAU,EAAA;AAAA,cAElB,YAAM9C,CAAC;AAAA,YAAA;AAAA,YANHA;AAAA,UAAA,CAQR;AAAA,QAAA;AAAA,QAnBIsD;AAAA,MAAA,CAqBR;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const b=require("react/jsx-runtime"),r=require("react"),T=require("./Flex-CqL3Ghda.cjs"),m=require("./breakpoints-BNPC2_Te.cjs"),y=require("./useMediaQuery-BCsNfMA1.cjs"),P=200,j=(c,l)=>c.length===l.length&&c.every((o,i)=>o===l[i]);function v(c,l){if(c==null||typeof c!="object")return c;const o=c;let i;for(const u of m.BREAKPOINT_ORDER)o[u]!=null&&l[u]&&(i=o[u]);if(i===void 0){for(const u of m.BREAKPOINT_ORDER)if(o[u]!=null){i=o[u];break}}return i}const k=r.forwardRef(function({columns:l=3,minColumnWidth:o,gap:i="md",padding:u,className:w,style:S,children:I,...C},p){const x=r.useMemo(()=>r.Children.toArray(I),[I]),a=x.length,A={xs:!0,sm:y.useMediaQuery(`(min-width: ${m.BREAKPOINTS.sm}px)`),md:y.useMediaQuery(`(min-width: ${m.BREAKPOINTS.md}px)`),lg:y.useMediaQuery(`(min-width: ${m.BREAKPOINTS.lg}px)`),xl:y.useMediaQuery(`(min-width: ${m.BREAKPOINTS.xl}px)`)},R=Math.max(1,v(l,A)??1),g=T.space(v(i,A)),[f,q]=r.useState(R),[O,B]=r.useState([]),E=r.useRef(null),M=r.useRef([]),K=r.useCallback(t=>{E.current=t,typeof p=="function"?p(t):p&&(p.current=t)},[p]),h=r.useCallback(()=>{const t=E.current;if(!t)return;let n=R;if(o!=null){const e=parseFloat(getComputedStyle(t).columnGap)||0,d=t.clientWidth;n=Math.max(1,Math.floor((d+e)/(o+e)))}q(e=>e===n?e:n);const s=M.current.slice(0,a).map(e=>e?e.offsetHeight:0);B(e=>j(e,s)?e:s)},[R,o,a]);r.useLayoutEffect(h,[h,x,f,g]),r.useEffect(()=>{const t=E.current;if(!t||typeof ResizeObserver>"u")return;const n=new ResizeObserver(()=>h());return n.observe(t),M.current.slice(0,a).forEach(s=>s&&n.observe(s)),()=>n.disconnect()},[h,a,f]);const N=r.useMemo(()=>{const t=Array.from({length:f},()=>[]),n=new Array(f).fill(0);for(let s=0;s<a;s++){let e=0;for(let d=1;d<f;d++)n[d]<n[e]&&(e=d);t[e].push(s),n[e]+=O[s]||P}return t},[f,a,O]);return b.jsx("div",{ref:K,className:w,style:{display:"flex",alignItems:"flex-start",gap:g,padding:T.space(u),...S},...C,children:N.map((t,n)=>b.jsx("div",{style:{display:"flex",flexDirection:"column",gap:g,flex:"1 1 0",minWidth:0},children:t.map(s=>b.jsx("div",{ref:e=>{M.current[s]=e},style:{minWidth:0},children:x[s]},s))},n))})});exports.Masonry=k;
2
+ //# sourceMappingURL=Masonry-Bl1Mlzqw.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Masonry-Bl1Mlzqw.cjs","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\nimport { BREAKPOINTS, BREAKPOINT_ORDER, type Breakpoint } from '../../theme/breakpoints'\nimport { useMediaQuery } from '../../hooks/useMediaQuery'\n\n// nominal height for a not-yet-measured item, so the first (pre-measure) pass spreads items across\n// columns round-robin instead of dumping them all into the first one; corrected on the layout pass.\nconst ESTIMATED_ITEM_HEIGHT = 200\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Number of columns. Either a fixed number, or a **mobile-first** map keyed by the library's\n * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies from that breakpoint's min-width up,\n * until a larger defined one overrides it, with the smallest defined key as the base. Defaults to\n * `3`. Ignored when `minColumnWidth` is set.\n *\n * @example columns={2} // always 2\n * @example columns={{ xs: 1, md: 2 }} // 1 below md (768px), 2 at md and up\n */\n columns?: number | Partial<Record<Breakpoint, number>>\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /**\n * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px\n * number, or any CSS value) or a **mobile-first** breakpoint map — same resolution as `columns`.\n * Defaults to `md`.\n *\n * @example gap=\"md\"\n * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up\n */\n gap?: Spacing | Partial<Record<Breakpoint, Spacing>>\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * Resolve a possibly-responsive prop to a concrete value. A plain value passes through; a mobile-first\n * breakpoint map (a plain object keyed by breakpoints) picks the value of the **largest defined\n * breakpoint that currently matches**, falling back to the smallest defined key as the base when none\n * larger has kicked in yet.\n */\nfunction resolveResponsive<T>(\n value: T | Partial<Record<Breakpoint, T>>,\n matches: Record<Breakpoint, boolean>,\n): T | undefined {\n if (value == null || typeof value !== 'object') return value as T | undefined\n const map = value as Partial<Record<Breakpoint, T>>\n let resolved: T | undefined\n for (const bp of BREAKPOINT_ORDER) {\n if (map[bp] != null && matches[bp]) resolved = map[bp]\n }\n if (resolved === undefined) {\n for (const bp of BREAKPOINT_ORDER) {\n if (map[bp] != null) {\n resolved = map[bp]\n break\n }\n }\n }\n return resolved\n}\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),\n * so it works with any children. `columns` is either a fixed number or a mobile-first breakpoint map\n * (`{ xs: 1, md: 2 }`); `minColumnWidth` is a responsive alternative (and overrides `columns`); `gap`\n * spaces items on both axes and is itself responsive the same way (`{ xs: 'sm', md: 'lg' }`).\n * Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer `style` merges last.\n * Reading order flows left-to-right across the columns.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n // active min-width breakpoints — a FIXED set of hook calls (order-stable), mobile-first; `xs` is the\n // always-true base. `useMediaQuery` is correct on the first client render, so the resolved count has\n // no flash. These fire regardless of the `columns` form; a plain number just ignores them.\n const matches: Record<Breakpoint, boolean> = {\n xs: true,\n sm: useMediaQuery(`(min-width: ${BREAKPOINTS.sm}px)`),\n md: useMediaQuery(`(min-width: ${BREAKPOINTS.md}px)`),\n lg: useMediaQuery(`(min-width: ${BREAKPOINTS.lg}px)`),\n xl: useMediaQuery(`(min-width: ${BREAKPOINTS.xl}px)`),\n }\n const resolvedColumns = Math.max(1, resolveResponsive(columns, matches) ?? 1)\n const gapValue = space(resolveResponsive(gap, matches))\n\n const [colCount, setColCount] = useState(resolvedColumns)\n const [heights, setHeights] = useState<number[]>([])\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // merge the internal measuring ref with the forwarded ref\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // measure the container width → column count, and each item's height → the balance\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n\n let nextCols = resolvedColumns\n if (minColumnWidth != null) {\n const g = parseFloat(getComputedStyle(root).columnGap) || 0\n const width = root.clientWidth\n nextCols = Math.max(1, Math.floor((width + g) / (minColumnWidth + g)))\n }\n setColCount((prev) => (prev === nextCols ? prev : nextCols))\n\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [resolvedColumns, minColumnWidth, count])\n\n // measure before paint (mount + whenever the item set, column count, or gap changes — a gap change\n // shifts column widths, so heights and the minColumnWidth count need re-reading)\n useLayoutEffect(measure, [measure, items, colCount, gapValue])\n\n // re-balance on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count, colCount])\n\n // greedily assign each item (in order) to the currently shortest column\n const columnsItems = useMemo(() => {\n const buckets: number[][] = Array.from({ length: colCount }, () => [])\n const acc = new Array(colCount).fill(0)\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (acc[c] < acc[min]) min = c\n buckets[min].push(i)\n acc[min] += heights[i] || ESTIMATED_ITEM_HEIGHT\n }\n return buckets\n }, [colCount, count, heights])\n\n return (\n <div\n ref={setRootRef}\n className={className}\n style={{\n display: 'flex',\n alignItems: 'flex-start',\n gap: gapValue,\n padding: space(padding),\n ...style,\n }}\n {...props}\n >\n {columnsItems.map((indices, c) => (\n <div\n key={c}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: gapValue,\n flex: '1 1 0',\n minWidth: 0,\n }}\n >\n {indices.map((i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={{ minWidth: 0 } as CSSProperties}\n >\n {items[i]}\n </div>\n ))}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["ESTIMATED_ITEM_HEIGHT","arraysEqual","a","b","v","resolveResponsive","value","matches","map","resolved","bp","BREAKPOINT_ORDER","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","useMediaQuery","BREAKPOINTS","resolvedColumns","gapValue","space","colCount","setColCount","useState","heights","setHeights","rootRef","useRef","itemRefs","setRootRef","useCallback","node","measure","root","nextCols","g","width","prev","next","el","useLayoutEffect","useEffect","ro","columnsItems","buckets","acc","i","min","c","jsx","indices"],"mappings":"wLAmBMA,EAAwB,IA8BxBC,EAAc,CAACC,EAAaC,IAChCD,EAAE,SAAWC,EAAE,QAAUD,EAAE,MAAM,CAACE,EAAG,IAAMA,IAAMD,EAAE,CAAC,CAAC,EAQvD,SAASE,EACPC,EACAC,EACe,CACf,GAAID,GAAS,MAAQ,OAAOA,GAAU,SAAU,OAAOA,EACvD,MAAME,EAAMF,EACZ,IAAIG,EACJ,UAAWC,KAAMC,mBACXH,EAAIE,CAAE,GAAK,MAAQH,EAAQG,CAAE,IAAGD,EAAWD,EAAIE,CAAE,GAEvD,GAAID,IAAa,QACf,UAAWC,KAAMC,mBACf,GAAIH,EAAIE,CAAE,GAAK,KAAM,CACnBD,EAAWD,EAAIE,CAAE,EACjB,KACF,EAGJ,OAAOD,CACT,CAYO,MAAMG,EAAUC,EAAAA,WAAyC,SAC9D,CAAE,QAAAC,EAAU,EAAG,eAAAC,EAAgB,IAAAC,EAAM,KAAM,QAAAC,EAAS,UAAA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S,OACT,WAAY,aACZ,IAAKY,EACL,QAASC,EAAAA,MAAMd,CAAO,EACtB,GAAGE,CAAA,EAEJ,GAAGE,EAEH,SAAAiC,EAAa,IAAI,CAACO,EAASF,IAC1BC,EAAAA,IAAC,MAAA,CAEC,MAAO,CACL,QAAS,OACT,cAAe,SACf,IAAK9B,EACL,KAAM,QACN,SAAU,CAAA,EAGX,SAAA+B,EAAQ,IAAKJ,GACZG,EAAAA,IAAC,MAAA,CAEC,IAAMV,GAAO,CACXX,EAAS,QAAQkB,CAAC,EAAIP,CACxB,EACA,MAAO,CAAE,SAAU,CAAA,EAElB,WAAMO,CAAC,CAAA,EANHA,CAAA,CAQR,CAAA,EAnBIE,CAAA,CAqBR,CAAA,CAAA,CAGP,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";const s={xs:0,sm:576,md:768,lg:992,xl:1280},R=["xs","sm","md","lg","xl"];exports.BREAKPOINTS=s;exports.BREAKPOINT_ORDER=R;
2
+ //# sourceMappingURL=breakpoints-BNPC2_Te.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints-BNPC2_Te.cjs","sources":["../src/theme/breakpoints.ts"],"sourcesContent":["/**\n * The library's shared responsive breakpoints — the single source of truth for width thresholds.\n *\n * Mobile-first **min-width** values in px. `xs` is the base (`0`); the two values the component CSS\n * already keys off (`≤575.98px` phones, `≤1279.98px` tablet/overlay) line up with `sm` (576) and `xl`\n * (1280), so this scale is a superset of what the styles already use rather than a new set. Consume\n * these instead of hardcoding pixel thresholds, and derive the `Breakpoint` type from here rather than\n * re-listing the keys locally.\n */\nexport const BREAKPOINTS = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1280,\n} as const\n\n/** A responsive breakpoint key (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`). */\nexport type Breakpoint = keyof typeof BREAKPOINTS\n\n/** Breakpoint keys in ascending (mobile-first) order. */\nexport const BREAKPOINT_ORDER: readonly Breakpoint[] = ['xs', 'sm', 'md', 'lg', 'xl']\n"],"names":["BREAKPOINTS","BREAKPOINT_ORDER"],"mappings":"aASO,MAAMA,EAAc,CACzB,GAAI,EACJ,GAAI,IACJ,GAAI,IACJ,GAAI,IACJ,GAAI,IACN,EAMaC,EAA0C,CAAC,KAAM,KAAM,KAAM,KAAM,IAAI"}
@@ -0,0 +1,12 @@
1
+ const s = {
2
+ xs: 0,
3
+ sm: 576,
4
+ md: 768,
5
+ lg: 992,
6
+ xl: 1280
7
+ }, x = ["xs", "sm", "md", "lg", "xl"];
8
+ export {
9
+ s as B,
10
+ x as a
11
+ };
12
+ //# sourceMappingURL=breakpoints-o3dzSzrU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoints-o3dzSzrU.js","sources":["../src/theme/breakpoints.ts"],"sourcesContent":["/**\n * The library's shared responsive breakpoints — the single source of truth for width thresholds.\n *\n * Mobile-first **min-width** values in px. `xs` is the base (`0`); the two values the component CSS\n * already keys off (`≤575.98px` phones, `≤1279.98px` tablet/overlay) line up with `sm` (576) and `xl`\n * (1280), so this scale is a superset of what the styles already use rather than a new set. Consume\n * these instead of hardcoding pixel thresholds, and derive the `Breakpoint` type from here rather than\n * re-listing the keys locally.\n */\nexport const BREAKPOINTS = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1280,\n} as const\n\n/** A responsive breakpoint key (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`). */\nexport type Breakpoint = keyof typeof BREAKPOINTS\n\n/** Breakpoint keys in ascending (mobile-first) order. */\nexport const BREAKPOINT_ORDER: readonly Breakpoint[] = ['xs', 'sm', 'md', 'lg', 'xl']\n"],"names":["BREAKPOINTS","BREAKPOINT_ORDER"],"mappings":"AASO,MAAMA,IAAc;AAAA,EACzB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN,GAMaC,IAA0C,CAAC,MAAM,MAAM,MAAM,MAAM,IAAI;"}
@@ -1,12 +1,28 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import { type Spacing } from '../Flex/Flex';
3
+ import { type Breakpoint } from '../../theme/breakpoints';
3
4
  export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
4
- /** Fixed number of columns. Defaults to `3`. Ignored when `minColumnWidth` is set. */
5
- columns?: number;
5
+ /**
6
+ * Number of columns. Either a fixed number, or a **mobile-first** map keyed by the library's
7
+ * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies from that breakpoint's min-width up,
8
+ * until a larger defined one overrides it, with the smallest defined key as the base. Defaults to
9
+ * `3`. Ignored when `minColumnWidth` is set.
10
+ *
11
+ * @example columns={2} // always 2
12
+ * @example columns={{ xs: 1, md: 2 }} // 1 below md (768px), 2 at md and up
13
+ */
14
+ columns?: number | Partial<Record<Breakpoint, number>>;
6
15
  /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */
7
16
  minColumnWidth?: number;
8
- /** Gap between items, horizontally and vertically (token key, px number, or CSS value). Defaults to `md`. */
9
- gap?: Spacing;
17
+ /**
18
+ * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px
19
+ * number, or any CSS value) or a **mobile-first** breakpoint map — same resolution as `columns`.
20
+ * Defaults to `md`.
21
+ *
22
+ * @example gap="md"
23
+ * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up
24
+ */
25
+ gap?: Spacing | Partial<Record<Breakpoint, Spacing>>;
10
26
  /** Padding around the grid (token key, px number, or CSS value). */
11
27
  padding?: Spacing;
12
28
  /** The items to lay out. */
@@ -16,8 +32,10 @@ export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
16
32
  * A masonry layout — packs items of varying heights into balanced columns, always adding the next item
17
33
  * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed
18
34
  * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),
19
- * so it works with any children. Use a fixed `columns` count or a responsive `minColumnWidth`; `gap`
20
- * spaces items on both axes. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer
21
- * `style` merges last. Reading order flows left-to-right across the columns.
35
+ * so it works with any children. `columns` is either a fixed number or a mobile-first breakpoint map
36
+ * (`{ xs: 1, md: 2 }`); `minColumnWidth` is a responsive alternative (and overrides `columns`); `gap`
37
+ * spaces items on both axes and is itself responsive the same way (`{ xs: 'sm', md: 'lg' }`).
38
+ * Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer `style` merges last.
39
+ * Reading order flows left-to-right across the columns.
22
40
  */
23
41
  export declare const Masonry: import("react").ForwardRefExoticComponent<MasonryProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,12 +1,28 @@
1
1
  import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import { type Spacing } from '../Flex/Flex';
3
+ import { type Breakpoint } from '../../theme/breakpoints';
3
4
  export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
4
- /** Fixed number of columns. Defaults to `3`. Ignored when `minColumnWidth` is set. */
5
- columns?: number;
5
+ /**
6
+ * Number of columns. Either a fixed number, or a **mobile-first** map keyed by the library's
7
+ * `Breakpoint`s (`xs`/`sm`/`md`/`lg`/`xl`) — each entry applies from that breakpoint's min-width up,
8
+ * until a larger defined one overrides it, with the smallest defined key as the base. Defaults to
9
+ * `3`. Ignored when `minColumnWidth` is set.
10
+ *
11
+ * @example columns={2} // always 2
12
+ * @example columns={{ xs: 1, md: 2 }} // 1 below md (768px), 2 at md and up
13
+ */
14
+ columns?: number | Partial<Record<Breakpoint, number>>;
6
15
  /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */
7
16
  minColumnWidth?: number;
8
- /** Gap between items, horizontally and vertically (token key, px number, or CSS value). Defaults to `md`. */
9
- gap?: Spacing;
17
+ /**
18
+ * Gap between items, horizontally and vertically. Either a single value (a `--tz-space-*` key, a px
19
+ * number, or any CSS value) or a **mobile-first** breakpoint map — same resolution as `columns`.
20
+ * Defaults to `md`.
21
+ *
22
+ * @example gap="md"
23
+ * @example gap={{ xs: 'sm', md: 'lg' }} // tighter on phones, looser from md up
24
+ */
25
+ gap?: Spacing | Partial<Record<Breakpoint, Spacing>>;
10
26
  /** Padding around the grid (token key, px number, or CSS value). */
11
27
  padding?: Spacing;
12
28
  /** The items to lay out. */
@@ -16,8 +32,10 @@ export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
16
32
  * A masonry layout — packs items of varying heights into balanced columns, always adding the next item
17
33
  * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed
18
34
  * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),
19
- * so it works with any children. Use a fixed `columns` count or a responsive `minColumnWidth`; `gap`
20
- * spaces items on both axes. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer
21
- * `style` merges last. Reading order flows left-to-right across the columns.
35
+ * so it works with any children. `columns` is either a fixed number or a mobile-first breakpoint map
36
+ * (`{ xs: 1, md: 2 }`); `minColumnWidth` is a responsive alternative (and overrides `columns`); `gap`
37
+ * spaces items on both axes and is itself responsive the same way (`{ xs: 'sm', md: 'lg' }`).
38
+ * Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer `style` merges last.
39
+ * Reading order flows left-to-right across the columns.
22
40
  */
23
41
  export declare const Masonry: import("react").ForwardRefExoticComponent<MasonryProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Masonry-DlD-rIQX.cjs");exports.Masonry=e.Masonry;exports.default=e.Masonry;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../Masonry-Bl1Mlzqw.cjs");exports.Masonry=e.Masonry;exports.default=e.Masonry;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- import { M as r, M as s } from "../../Masonry--bT8SICO.js";
1
+ import { M as r, M as s } from "../../Masonry-BTvtDdnt.js";
2
2
  export {
3
3
  r as Masonry,
4
4
  s as default
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../Form-Bz2xgkEm.cjs"),e=require("../Accordion-Dy_dM79Y.cjs"),s=require("../Alert-DKIjM-9x.cjs"),d=require("../Avatar-_ufXh3AY.cjs"),q=require("../AvatarGroup-TW1pt4tj.cjs"),T=require("../Badge-BQpr2Jee.cjs"),p=require("../Blockquote-CxHwOecc.cjs"),g=require("../Breadcrumbs-CHONper7.cjs"),C=require("../Button-D4bfVNNa.cjs"),m=require("../Card-CfyaerZZ.cjs"),F=require("../Checkbox-DXOzYIAz.cjs"),S=require("../Chip-DSrdXLBU.cjs"),r=require("../ChoiceCardGroup-6eFM1eL0.cjs"),h=require("../Code-CUdpWlY5.cjs"),P=require("../CodeBlock-CgXOjKS-.cjs"),o=require("../Col-R5mAy8T9.cjs"),k=require("../ColorPicker-BwmaXCOy.cjs"),B=require("../DatePicker-DF4Epkn8.cjs"),b=require("../DateTimePicker-C557OjBU.cjs"),y=require("../Divider-CzbhdCiD.cjs"),D=require("../Dropdown-DygP50OB.cjs"),R=require("../EmptyState-CCCpZ-ZA.cjs"),A=require("../FileUploader-B4TJHyoi.cjs"),t=require("../Sidebar-AaIlRzgk.cjs"),I=require("../Flag-EPZOrH-U.cjs"),v=require("../Flex-CqL3Ghda.cjs"),x=require("../FullscreenToggle-DDKN5n8B.cjs"),G=require("../Grid-Bw95bKkJ.cjs"),i=require("../names-C2Yj1p3u.cjs"),L=require("../Icon-CXTl_QAP.cjs"),M=require("../IconButton-D6TenQZ_.cjs"),w=require("../List-CNz2M3-q.cjs"),N=require("../ListItem-RH-D-Wey.cjs"),O=require("../Loader-D1MtlQOH.cjs"),E=require("../Masonry-DlD-rIQX.cjs"),U=require("../Modal-B2YSCVVt.cjs"),_=require("../MultiSelect-CSJKSWpA.cjs"),f=require("../MultilineTextField-Dz6Fg8RJ.cjs"),j=require("../NumberField-DBpO-Z_7.cjs"),z=require("../OtpField-BUBYyorC.cjs"),H=require("../PageLayout-Dfbjw6jD.cjs"),J=require("../Pagination-DRwTLPh8.cjs"),K=require("../Popover-CBI1icIM.cjs"),c=require("../RadioGroup-C8u7eNBS.cjs"),Q=require("../RemoveDialog-ClyZKyUG.cjs"),V=require("../RichTextEditor-CAYt1Zm1.cjs"),W=require("../RootLayout-Cp-9CVjP.cjs"),X=require("../Select-_6WogC0u.cjs"),Y=require("../Slider-dxYVXRev.cjs"),n=require("../SpeedDial-C4jxIXTr.cjs"),Z=require("../Stepper-7pPEBRLI.cjs"),$=require("../SwatchPicker-DbAU9-ux.cjs"),ee=require("../Switch-DRkZ6kHJ.cjs"),re=require("../Table-BeOumGng.cjs"),oe=require("../Tabs-BZcMnjdC.cjs"),te=require("../TagsField-kknWiJZZ.cjs"),ie=require("../TextField-BPefnD5M.cjs"),ce=require("../ThemeToggle-DTal3RX5.cjs"),ne=require("../TimePicker-CfGrCH9T.cjs"),u=require("../Timeline-CoxW0Ia_.cjs"),ue=require("../Toaster-Bk5GtPjX.cjs"),a=require("../ToggleButtonGroup-DYRLwKKh.cjs"),ae=require("../Tooltip-Ao7az09p.cjs"),le=require("../TranslatedFields-DT3bYse6.cjs"),se=require("../Typography-BFatE1_A.cjs"),de=require("../UserCard-OlLeyyS0.cjs"),qe=require("../toastStore-B4Tk2Xk7.cjs");exports.Form=l.Form;exports.Accordion=e.Accordion;exports.AccordionItem=e.AccordionItem;exports.Alert=s.Alert;exports.Avatar=d.Avatar;exports.AvatarGroup=q.AvatarGroup;exports.Badge=T.Badge;exports.Blockquote=p.Blockquote;exports.Breadcrumbs=g.Breadcrumbs;exports.Button=C.Button;exports.Card=m.Card;exports.Checkbox=F.Checkbox;exports.Chip=S.Chip;exports.ChoiceCard=r.ChoiceCard;exports.ChoiceCardGroup=r.ChoiceCardGroup;exports.Code=h.Code;exports.CodeBlock=P.CodeBlock;exports.Col=o.Col;exports.Row=o.Row;exports.ColorPicker=k.ColorPicker;exports.DatePicker=B.DatePicker;exports.DateTimePicker=b.DateTimePicker;exports.Divider=y.Divider;exports.Dropdown=D.Dropdown;exports.EmptyState=R.EmptyState;exports.FileUploader=A.FileUploader;exports.FirstRouteRedirect=t.FirstRouteRedirect;exports.Sidebar=t.Sidebar;exports.Flag=I.Flag;exports.Flex=v.Flex;exports.FullscreenToggle=x.FullscreenToggle;exports.Grid=G.Grid;exports.ICON_COUNT=i.ICON_COUNT;exports.ICON_NAMES=i.ICON_NAMES;exports.Icon=L.Icon;exports.IconButton=M.IconButton;exports.List=w.List;exports.ListItem=N.ListItem;exports.Loader=O.Loader;exports.Masonry=E.Masonry;exports.Modal=U.Modal;exports.MultiSelect=_.MultiSelect;exports.MultilineTextField=f.MultilineTextField;exports.NumberField=j.NumberField;exports.OtpField=z.OtpField;exports.PageLayout=H.PageLayout;exports.Pagination=J.Pagination;exports.Popover=K.Popover;exports.Radio=c.Radio;exports.RadioGroup=c.RadioGroup;exports.RemoveDialog=Q.RemoveDialog;exports.RichTextEditor=V.RichTextEditor;exports.RootLayout=W.RootLayout;exports.Select=X.Select;exports.Slider=Y.Slider;exports.SpeedDial=n.SpeedDial;exports.SpeedDialAction=n.SpeedDialAction;exports.Stepper=Z.Stepper;exports.SwatchPicker=$.SwatchPicker;exports.Switch=ee.Switch;exports.Table=re.Table;exports.Tabs=oe.Tabs;exports.TagsField=te.TagsField;exports.TextField=ie.TextField;exports.ThemeToggle=ce.ThemeToggle;exports.TimePicker=ne.TimePicker;exports.Timeline=u.Timeline;exports.TimelineItem=u.TimelineItem;exports.Toaster=ue.Toaster;exports.ToggleButton=a.ToggleButton;exports.ToggleButtonGroup=a.ToggleButtonGroup;exports.Tooltip=ae.Tooltip;exports.TranslatedFields=le.TranslatedFields;exports.Typography=se.Typography;exports.UserCard=de.UserCard;exports.toast=qe.toast;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../Form-Bz2xgkEm.cjs"),e=require("../Accordion-Dy_dM79Y.cjs"),s=require("../Alert-DKIjM-9x.cjs"),d=require("../Avatar-_ufXh3AY.cjs"),q=require("../AvatarGroup-TW1pt4tj.cjs"),T=require("../Badge-BQpr2Jee.cjs"),p=require("../Blockquote-CxHwOecc.cjs"),g=require("../Breadcrumbs-CHONper7.cjs"),C=require("../Button-D4bfVNNa.cjs"),m=require("../Card-CfyaerZZ.cjs"),F=require("../Checkbox-DXOzYIAz.cjs"),S=require("../Chip-DSrdXLBU.cjs"),r=require("../ChoiceCardGroup-6eFM1eL0.cjs"),h=require("../Code-CUdpWlY5.cjs"),P=require("../CodeBlock-CgXOjKS-.cjs"),o=require("../Col-R5mAy8T9.cjs"),k=require("../ColorPicker-BwmaXCOy.cjs"),B=require("../DatePicker-DF4Epkn8.cjs"),b=require("../DateTimePicker-C557OjBU.cjs"),y=require("../Divider-CzbhdCiD.cjs"),D=require("../Dropdown-DygP50OB.cjs"),R=require("../EmptyState-CCCpZ-ZA.cjs"),A=require("../FileUploader-B4TJHyoi.cjs"),t=require("../Sidebar-AaIlRzgk.cjs"),I=require("../Flag-EPZOrH-U.cjs"),v=require("../Flex-CqL3Ghda.cjs"),x=require("../FullscreenToggle-DDKN5n8B.cjs"),G=require("../Grid-Bw95bKkJ.cjs"),i=require("../names-C2Yj1p3u.cjs"),L=require("../Icon-CXTl_QAP.cjs"),M=require("../IconButton-D6TenQZ_.cjs"),w=require("../List-CNz2M3-q.cjs"),N=require("../ListItem-RH-D-Wey.cjs"),O=require("../Loader-D1MtlQOH.cjs"),E=require("../Masonry-Bl1Mlzqw.cjs"),U=require("../Modal-B2YSCVVt.cjs"),_=require("../MultiSelect-CSJKSWpA.cjs"),f=require("../MultilineTextField-Dz6Fg8RJ.cjs"),j=require("../NumberField-DBpO-Z_7.cjs"),z=require("../OtpField-BUBYyorC.cjs"),H=require("../PageLayout-Dfbjw6jD.cjs"),J=require("../Pagination-DRwTLPh8.cjs"),K=require("../Popover-CBI1icIM.cjs"),c=require("../RadioGroup-C8u7eNBS.cjs"),Q=require("../RemoveDialog-ClyZKyUG.cjs"),V=require("../RichTextEditor-CAYt1Zm1.cjs"),W=require("../RootLayout-Cp-9CVjP.cjs"),X=require("../Select-_6WogC0u.cjs"),Y=require("../Slider-dxYVXRev.cjs"),n=require("../SpeedDial-C4jxIXTr.cjs"),Z=require("../Stepper-7pPEBRLI.cjs"),$=require("../SwatchPicker-DbAU9-ux.cjs"),ee=require("../Switch-DRkZ6kHJ.cjs"),re=require("../Table-BeOumGng.cjs"),oe=require("../Tabs-BZcMnjdC.cjs"),te=require("../TagsField-kknWiJZZ.cjs"),ie=require("../TextField-BPefnD5M.cjs"),ce=require("../ThemeToggle-DTal3RX5.cjs"),ne=require("../TimePicker-CfGrCH9T.cjs"),u=require("../Timeline-CoxW0Ia_.cjs"),ue=require("../Toaster-Bk5GtPjX.cjs"),a=require("../ToggleButtonGroup-DYRLwKKh.cjs"),ae=require("../Tooltip-Ao7az09p.cjs"),le=require("../TranslatedFields-DT3bYse6.cjs"),se=require("../Typography-BFatE1_A.cjs"),de=require("../UserCard-OlLeyyS0.cjs"),qe=require("../toastStore-B4Tk2Xk7.cjs");exports.Form=l.Form;exports.Accordion=e.Accordion;exports.AccordionItem=e.AccordionItem;exports.Alert=s.Alert;exports.Avatar=d.Avatar;exports.AvatarGroup=q.AvatarGroup;exports.Badge=T.Badge;exports.Blockquote=p.Blockquote;exports.Breadcrumbs=g.Breadcrumbs;exports.Button=C.Button;exports.Card=m.Card;exports.Checkbox=F.Checkbox;exports.Chip=S.Chip;exports.ChoiceCard=r.ChoiceCard;exports.ChoiceCardGroup=r.ChoiceCardGroup;exports.Code=h.Code;exports.CodeBlock=P.CodeBlock;exports.Col=o.Col;exports.Row=o.Row;exports.ColorPicker=k.ColorPicker;exports.DatePicker=B.DatePicker;exports.DateTimePicker=b.DateTimePicker;exports.Divider=y.Divider;exports.Dropdown=D.Dropdown;exports.EmptyState=R.EmptyState;exports.FileUploader=A.FileUploader;exports.FirstRouteRedirect=t.FirstRouteRedirect;exports.Sidebar=t.Sidebar;exports.Flag=I.Flag;exports.Flex=v.Flex;exports.FullscreenToggle=x.FullscreenToggle;exports.Grid=G.Grid;exports.ICON_COUNT=i.ICON_COUNT;exports.ICON_NAMES=i.ICON_NAMES;exports.Icon=L.Icon;exports.IconButton=M.IconButton;exports.List=w.List;exports.ListItem=N.ListItem;exports.Loader=O.Loader;exports.Masonry=E.Masonry;exports.Modal=U.Modal;exports.MultiSelect=_.MultiSelect;exports.MultilineTextField=f.MultilineTextField;exports.NumberField=j.NumberField;exports.OtpField=z.OtpField;exports.PageLayout=H.PageLayout;exports.Pagination=J.Pagination;exports.Popover=K.Popover;exports.Radio=c.Radio;exports.RadioGroup=c.RadioGroup;exports.RemoveDialog=Q.RemoveDialog;exports.RichTextEditor=V.RichTextEditor;exports.RootLayout=W.RootLayout;exports.Select=X.Select;exports.Slider=Y.Slider;exports.SpeedDial=n.SpeedDial;exports.SpeedDialAction=n.SpeedDialAction;exports.Stepper=Z.Stepper;exports.SwatchPicker=$.SwatchPicker;exports.Switch=ee.Switch;exports.Table=re.Table;exports.Tabs=oe.Tabs;exports.TagsField=te.TagsField;exports.TextField=ie.TextField;exports.ThemeToggle=ce.ThemeToggle;exports.TimePicker=ne.TimePicker;exports.Timeline=u.Timeline;exports.TimelineItem=u.TimelineItem;exports.Toaster=ue.Toaster;exports.ToggleButton=a.ToggleButton;exports.ToggleButtonGroup=a.ToggleButtonGroup;exports.Tooltip=ae.Tooltip;exports.TranslatedFields=le.TranslatedFields;exports.Typography=se.Typography;exports.UserCard=de.UserCard;exports.toast=qe.toast;
2
2
  //# sourceMappingURL=components.cjs.map
@@ -32,7 +32,7 @@ import { I as co } from "../IconButton-CBusrDa9.js";
32
32
  import { L as no } from "../List-BHgFI9Ll.js";
33
33
  import { L as So } from "../ListItem-B4yqZR-Z.js";
34
34
  import { L as go } from "../Loader-C4JoXOyA.js";
35
- import { M as Bo } from "../Masonry--bT8SICO.js";
35
+ import { M as Bo } from "../Masonry-BTvtDdnt.js";
36
36
  import { M as Do } from "../Modal-BuaPDlKV.js";
37
37
  import { M as Io } from "../MultiSelect-BGRT_B60.js";
38
38
  import { M as Mo } from "../MultilineTextField-CwNCJ9lZ.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ConfigProvider-ByOFXVyP.cjs");exports.ConfigProvider=e.ConfigProvider;exports.DEFAULT_FONT_FAMILY=e.DEFAULT_FONT_FAMILY;exports.DEFAULT_NESTED_TAB_QUERY_KEY=e.DEFAULT_NESTED_TAB_QUERY_KEY;exports.DEFAULT_STEP_QUERY_KEY=e.DEFAULT_STEP_QUERY_KEY;exports.DEFAULT_TABS_QUERY_KEY=e.DEFAULT_TABS_QUERY_KEY;exports.applyTheme=e.applyTheme;exports.useHeaderConfig=e.useHeaderConfig;exports.useLocales=e.useLocales;exports.useNestedTabQueryKey=e.useNestedTabQueryKey;exports.useStepQueryKey=e.useStepQueryKey;exports.useTableQueryConfig=e.useTableQueryConfig;exports.useTabsQueryKey=e.useTabsQueryKey;exports.useTheme=e.useTheme;exports.useTranslationsNamespace=e.useTranslationsNamespace;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../breakpoints-BNPC2_Te.cjs"),e=require("../ConfigProvider-ByOFXVyP.cjs");exports.BREAKPOINTS=T.BREAKPOINTS;exports.BREAKPOINT_ORDER=T.BREAKPOINT_ORDER;exports.ConfigProvider=e.ConfigProvider;exports.DEFAULT_FONT_FAMILY=e.DEFAULT_FONT_FAMILY;exports.DEFAULT_NESTED_TAB_QUERY_KEY=e.DEFAULT_NESTED_TAB_QUERY_KEY;exports.DEFAULT_STEP_QUERY_KEY=e.DEFAULT_STEP_QUERY_KEY;exports.DEFAULT_TABS_QUERY_KEY=e.DEFAULT_TABS_QUERY_KEY;exports.applyTheme=e.applyTheme;exports.useHeaderConfig=e.useHeaderConfig;exports.useLocales=e.useLocales;exports.useNestedTabQueryKey=e.useNestedTabQueryKey;exports.useStepQueryKey=e.useStepQueryKey;exports.useTableQueryConfig=e.useTableQueryConfig;exports.useTabsQueryKey=e.useTabsQueryKey;exports.useTheme=e.useTheme;exports.useTranslationsNamespace=e.useTranslationsNamespace;
2
2
  //# sourceMappingURL=theme.cjs.map
@@ -1,2 +1,2 @@
1
- export { applyTheme, ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, } from '../theme';
2
- export type { ThemePalette, ThemeColor, Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from '../theme';
1
+ export { applyTheme, ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, BREAKPOINTS, BREAKPOINT_ORDER, } from '../theme';
2
+ export type { ThemePalette, ThemeColor, Breakpoint, Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from '../theme';
@@ -1,2 +1,2 @@
1
- export { applyTheme, ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, } from '../theme';
2
- export type { ThemePalette, ThemeColor, Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from '../theme';
1
+ export { applyTheme, ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, BREAKPOINTS, BREAKPOINT_ORDER, } from '../theme';
2
+ export type { ThemePalette, ThemeColor, Breakpoint, Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from '../theme';
@@ -1,18 +1,21 @@
1
- import { C as a, D as T, c as E, d as u, e as _, f as r, g as o, h as y, i as A, j as Q, k as U, l as Y, m as i, n } from "../ConfigProvider-2c94kUOk.js";
1
+ import { B as a, a as T } from "../breakpoints-o3dzSzrU.js";
2
+ import { C as _, D as r, c as u, d as o, e as A, f as y, g as K, h as D, i as Q, j as R, k as U, l as Y, m as f, n as i } from "../ConfigProvider-2c94kUOk.js";
2
3
  export {
3
- a as ConfigProvider,
4
- T as DEFAULT_FONT_FAMILY,
5
- E as DEFAULT_NESTED_TAB_QUERY_KEY,
6
- u as DEFAULT_STEP_QUERY_KEY,
7
- _ as DEFAULT_TABS_QUERY_KEY,
8
- r as applyTheme,
9
- o as useHeaderConfig,
10
- y as useLocales,
11
- A as useNestedTabQueryKey,
12
- Q as useStepQueryKey,
4
+ a as BREAKPOINTS,
5
+ T as BREAKPOINT_ORDER,
6
+ _ as ConfigProvider,
7
+ r as DEFAULT_FONT_FAMILY,
8
+ u as DEFAULT_NESTED_TAB_QUERY_KEY,
9
+ o as DEFAULT_STEP_QUERY_KEY,
10
+ A as DEFAULT_TABS_QUERY_KEY,
11
+ y as applyTheme,
12
+ K as useHeaderConfig,
13
+ D as useLocales,
14
+ Q as useNestedTabQueryKey,
15
+ R as useStepQueryKey,
13
16
  U as useTableQueryConfig,
14
17
  Y as useTabsQueryKey,
15
- i as useTheme,
16
- n as useTranslationsNamespace
18
+ f as useTheme,
19
+ i as useTranslationsNamespace
17
20
  };
18
21
  //# sourceMappingURL=theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"theme.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./Form-Bz2xgkEm.cjs"),i=require("./useForm-C7erBHt0.cjs"),m=require("./useLockBodyScroll-CIXHZo-Q.cjs"),y=require("./useMediaQuery-BCsNfMA1.cjs"),o=require("./access-DPUHbE-S.cjs"),e=require("./ConfigProvider-ByOFXVyP.cjs"),t=require("./messages-Cy-qK5xU.cjs"),r=require("./translations-CXEeeUDL.cjs"),s=require("./table-CZRQGNdk.cjs"),a=require("./Icon-CXTl_QAP.cjs"),u=require("./Accordion-Dy_dM79Y.cjs"),A=require("./Alert-DKIjM-9x.cjs"),S=require("./Avatar-_ufXh3AY.cjs"),C=require("./AvatarGroup-TW1pt4tj.cjs"),E=require("./Badge-BQpr2Jee.cjs"),b=require("./Blockquote-CxHwOecc.cjs"),D=require("./Breadcrumbs-CHONper7.cjs"),L=require("./Button-D4bfVNNa.cjs"),h=require("./Card-CfyaerZZ.cjs"),P=require("./Checkbox-DXOzYIAz.cjs"),_=require("./Chip-DSrdXLBU.cjs"),c=require("./ChoiceCardGroup-6eFM1eL0.cjs"),B=require("./Code-CUdpWlY5.cjs"),R=require("./CodeBlock-CgXOjKS-.cjs"),n=require("./Col-R5mAy8T9.cjs"),k=require("./ColorPicker-BwmaXCOy.cjs"),N=require("./DatePicker-DF4Epkn8.cjs"),U=require("./DateTimePicker-C557OjBU.cjs"),M=require("./Divider-CzbhdCiD.cjs"),I=require("./Dropdown-DygP50OB.cjs"),Q=require("./EmptyState-CCCpZ-ZA.cjs"),v=require("./FileUploader-B4TJHyoi.cjs"),l=require("./Sidebar-AaIlRzgk.cjs"),K=require("./Flag-EPZOrH-U.cjs"),x=require("./Flex-CqL3Ghda.cjs"),G=require("./FullscreenToggle-DDKN5n8B.cjs"),O=require("./Grid-Bw95bKkJ.cjs"),T=require("./names-C2Yj1p3u.cjs"),Y=require("./IconButton-D6TenQZ_.cjs"),f=require("./List-CNz2M3-q.cjs"),w=require("./ListItem-RH-D-Wey.cjs"),H=require("./Loader-D1MtlQOH.cjs"),j=require("./Masonry-DlD-rIQX.cjs"),z=require("./Modal-B2YSCVVt.cjs"),J=require("./MultiSelect-CSJKSWpA.cjs"),V=require("./MultilineTextField-Dz6Fg8RJ.cjs"),W=require("./NumberField-DBpO-Z_7.cjs"),X=require("./OtpField-BUBYyorC.cjs"),Z=require("./PageLayout-Dfbjw6jD.cjs"),$=require("./Pagination-DRwTLPh8.cjs"),ee=require("./Popover-CBI1icIM.cjs"),d=require("./RadioGroup-C8u7eNBS.cjs"),re=require("./RemoveDialog-ClyZKyUG.cjs"),oe=require("./RichTextEditor-CAYt1Zm1.cjs"),te=require("./RootLayout-Cp-9CVjP.cjs"),ie=require("./Select-_6WogC0u.cjs"),se=require("./Slider-dxYVXRev.cjs"),q=require("./SpeedDial-C4jxIXTr.cjs"),ae=require("./Stepper-7pPEBRLI.cjs"),ue=require("./SwatchPicker-DbAU9-ux.cjs"),ce=require("./Switch-DRkZ6kHJ.cjs"),ne=require("./Table-BeOumGng.cjs"),le=require("./Tabs-BZcMnjdC.cjs"),Te=require("./TagsField-kknWiJZZ.cjs"),de=require("./TextField-BPefnD5M.cjs"),qe=require("./ThemeToggle-DTal3RX5.cjs"),pe=require("./TimePicker-CfGrCH9T.cjs"),p=require("./Timeline-CoxW0Ia_.cjs"),ge=require("./Toaster-Bk5GtPjX.cjs"),g=require("./ToggleButtonGroup-DYRLwKKh.cjs"),Fe=require("./Tooltip-Ao7az09p.cjs"),me=require("./TranslatedFields-DT3bYse6.cjs"),ye=require("./Typography-BFatE1_A.cjs"),Ae=require("./UserCard-OlLeyyS0.cjs"),Se=require("./toastStore-B4Tk2Xk7.cjs");exports.Form=F.Form;exports.useDisclosure=i.useDisclosure;exports.useForm=i.useForm;exports.useLockBodyScroll=m.useLockBodyScroll;exports.useMediaQuery=y.useMediaQuery;exports.getAccessKeys=o.getAccessKeys;exports.hasAccess=o.hasAccess;exports.setAccessKeys=o.setAccessKeys;exports.useAccessKeys=o.useAccessKeys;exports.ConfigProvider=e.ConfigProvider;exports.DEFAULT_FONT_FAMILY=e.DEFAULT_FONT_FAMILY;exports.DEFAULT_NESTED_TAB_QUERY_KEY=e.DEFAULT_NESTED_TAB_QUERY_KEY;exports.DEFAULT_STEP_QUERY_KEY=e.DEFAULT_STEP_QUERY_KEY;exports.DEFAULT_TABS_QUERY_KEY=e.DEFAULT_TABS_QUERY_KEY;exports.applyTheme=e.applyTheme;exports.useHeaderConfig=e.useHeaderConfig;exports.useLanguage=e.useLanguage;exports.useLocales=e.useLocales;exports.useNestedTabQueryKey=e.useNestedTabQueryKey;exports.useStepQueryKey=e.useStepQueryKey;exports.useT=e.useT;exports.useTableQueryConfig=e.useTableQueryConfig;exports.useTabsQueryKey=e.useTabsQueryKey;exports.useTheme=e.useTheme;exports.useTranslations=e.useTranslations;exports.useTranslationsNamespace=e.useTranslationsNamespace;exports.createAppTranslator=t.createAppTranslator;exports.createTranslator=t.createTranslator;exports.flagFor=t.flagFor;exports.DEFAULT_TRANSLATIONS_NAMESPACE=r.DEFAULT_TRANSLATIONS_NAMESPACE;exports.buildTranslationName=r.buildTranslationName;exports.buildTranslations=r.buildTranslations;exports.flattenTranslations=r.flattenTranslations;exports.nestTranslations=r.nestTranslations;exports.toFormData=r.toFormData;exports.buildTableQuery=s.buildTableQuery;exports.parseTableQuery=s.parseTableQuery;exports.Icon=a.Icon;exports.icons=a.icons;exports.Accordion=u.Accordion;exports.AccordionItem=u.AccordionItem;exports.Alert=A.Alert;exports.Avatar=S.Avatar;exports.AvatarGroup=C.AvatarGroup;exports.Badge=E.Badge;exports.Blockquote=b.Blockquote;exports.Breadcrumbs=D.Breadcrumbs;exports.Button=L.Button;exports.Card=h.Card;exports.Checkbox=P.Checkbox;exports.Chip=_.Chip;exports.ChoiceCard=c.ChoiceCard;exports.ChoiceCardGroup=c.ChoiceCardGroup;exports.Code=B.Code;exports.CodeBlock=R.CodeBlock;exports.Col=n.Col;exports.Row=n.Row;exports.ColorPicker=k.ColorPicker;exports.DatePicker=N.DatePicker;exports.DateTimePicker=U.DateTimePicker;exports.Divider=M.Divider;exports.Dropdown=I.Dropdown;exports.EmptyState=Q.EmptyState;exports.FileUploader=v.FileUploader;exports.FirstRouteRedirect=l.FirstRouteRedirect;exports.Sidebar=l.Sidebar;exports.Flag=K.Flag;exports.Flex=x.Flex;exports.FullscreenToggle=G.FullscreenToggle;exports.Grid=O.Grid;exports.ICON_COUNT=T.ICON_COUNT;exports.ICON_NAMES=T.ICON_NAMES;exports.IconButton=Y.IconButton;exports.List=f.List;exports.ListItem=w.ListItem;exports.Loader=H.Loader;exports.Masonry=j.Masonry;exports.Modal=z.Modal;exports.MultiSelect=J.MultiSelect;exports.MultilineTextField=V.MultilineTextField;exports.NumberField=W.NumberField;exports.OtpField=X.OtpField;exports.PageLayout=Z.PageLayout;exports.Pagination=$.Pagination;exports.Popover=ee.Popover;exports.Radio=d.Radio;exports.RadioGroup=d.RadioGroup;exports.RemoveDialog=re.RemoveDialog;exports.RichTextEditor=oe.RichTextEditor;exports.RootLayout=te.RootLayout;exports.Select=ie.Select;exports.Slider=se.Slider;exports.SpeedDial=q.SpeedDial;exports.SpeedDialAction=q.SpeedDialAction;exports.Stepper=ae.Stepper;exports.SwatchPicker=ue.SwatchPicker;exports.Switch=ce.Switch;exports.Table=ne.Table;exports.Tabs=le.Tabs;exports.TagsField=Te.TagsField;exports.TextField=de.TextField;exports.ThemeToggle=qe.ThemeToggle;exports.TimePicker=pe.TimePicker;exports.Timeline=p.Timeline;exports.TimelineItem=p.TimelineItem;exports.Toaster=ge.Toaster;exports.ToggleButton=g.ToggleButton;exports.ToggleButtonGroup=g.ToggleButtonGroup;exports.Tooltip=Fe.Tooltip;exports.TranslatedFields=me.TranslatedFields;exports.Typography=ye.Typography;exports.UserCard=Ae.UserCard;exports.toast=Se.toast;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./Form-Bz2xgkEm.cjs"),i=require("./useForm-C7erBHt0.cjs"),S=require("./useLockBodyScroll-CIXHZo-Q.cjs"),m=require("./useMediaQuery-BCsNfMA1.cjs"),o=require("./access-DPUHbE-S.cjs"),e=require("./ConfigProvider-ByOFXVyP.cjs"),t=require("./messages-Cy-qK5xU.cjs"),r=require("./translations-CXEeeUDL.cjs"),s=require("./table-CZRQGNdk.cjs"),a=require("./Icon-CXTl_QAP.cjs"),u=require("./Accordion-Dy_dM79Y.cjs"),y=require("./Alert-DKIjM-9x.cjs"),C=require("./Avatar-_ufXh3AY.cjs"),E=require("./AvatarGroup-TW1pt4tj.cjs"),c=require("./breakpoints-BNPC2_Te.cjs"),b=require("./Badge-BQpr2Jee.cjs"),D=require("./Blockquote-CxHwOecc.cjs"),L=require("./Breadcrumbs-CHONper7.cjs"),P=require("./Button-D4bfVNNa.cjs"),R=require("./Card-CfyaerZZ.cjs"),B=require("./Checkbox-DXOzYIAz.cjs"),_=require("./Chip-DSrdXLBU.cjs"),n=require("./ChoiceCardGroup-6eFM1eL0.cjs"),h=require("./Code-CUdpWlY5.cjs"),N=require("./CodeBlock-CgXOjKS-.cjs"),l=require("./Col-R5mAy8T9.cjs"),k=require("./ColorPicker-BwmaXCOy.cjs"),I=require("./DatePicker-DF4Epkn8.cjs"),U=require("./DateTimePicker-C557OjBU.cjs"),K=require("./Divider-CzbhdCiD.cjs"),M=require("./Dropdown-DygP50OB.cjs"),Q=require("./EmptyState-CCCpZ-ZA.cjs"),O=require("./FileUploader-B4TJHyoi.cjs"),T=require("./Sidebar-AaIlRzgk.cjs"),v=require("./Flag-EPZOrH-U.cjs"),x=require("./Flex-CqL3Ghda.cjs"),G=require("./FullscreenToggle-DDKN5n8B.cjs"),Y=require("./Grid-Bw95bKkJ.cjs"),d=require("./names-C2Yj1p3u.cjs"),f=require("./IconButton-D6TenQZ_.cjs"),w=require("./List-CNz2M3-q.cjs"),H=require("./ListItem-RH-D-Wey.cjs"),j=require("./Loader-D1MtlQOH.cjs"),z=require("./Masonry-Bl1Mlzqw.cjs"),J=require("./Modal-B2YSCVVt.cjs"),V=require("./MultiSelect-CSJKSWpA.cjs"),W=require("./MultilineTextField-Dz6Fg8RJ.cjs"),X=require("./NumberField-DBpO-Z_7.cjs"),Z=require("./OtpField-BUBYyorC.cjs"),$=require("./PageLayout-Dfbjw6jD.cjs"),ee=require("./Pagination-DRwTLPh8.cjs"),re=require("./Popover-CBI1icIM.cjs"),q=require("./RadioGroup-C8u7eNBS.cjs"),oe=require("./RemoveDialog-ClyZKyUG.cjs"),te=require("./RichTextEditor-CAYt1Zm1.cjs"),ie=require("./RootLayout-Cp-9CVjP.cjs"),se=require("./Select-_6WogC0u.cjs"),ae=require("./Slider-dxYVXRev.cjs"),p=require("./SpeedDial-C4jxIXTr.cjs"),ue=require("./Stepper-7pPEBRLI.cjs"),ce=require("./SwatchPicker-DbAU9-ux.cjs"),ne=require("./Switch-DRkZ6kHJ.cjs"),le=require("./Table-BeOumGng.cjs"),Te=require("./Tabs-BZcMnjdC.cjs"),de=require("./TagsField-kknWiJZZ.cjs"),qe=require("./TextField-BPefnD5M.cjs"),pe=require("./ThemeToggle-DTal3RX5.cjs"),ge=require("./TimePicker-CfGrCH9T.cjs"),g=require("./Timeline-CoxW0Ia_.cjs"),Ae=require("./Toaster-Bk5GtPjX.cjs"),A=require("./ToggleButtonGroup-DYRLwKKh.cjs"),Fe=require("./Tooltip-Ao7az09p.cjs"),Se=require("./TranslatedFields-DT3bYse6.cjs"),me=require("./Typography-BFatE1_A.cjs"),ye=require("./UserCard-OlLeyyS0.cjs"),Ce=require("./toastStore-B4Tk2Xk7.cjs");exports.Form=F.Form;exports.useDisclosure=i.useDisclosure;exports.useForm=i.useForm;exports.useLockBodyScroll=S.useLockBodyScroll;exports.useMediaQuery=m.useMediaQuery;exports.getAccessKeys=o.getAccessKeys;exports.hasAccess=o.hasAccess;exports.setAccessKeys=o.setAccessKeys;exports.useAccessKeys=o.useAccessKeys;exports.ConfigProvider=e.ConfigProvider;exports.DEFAULT_FONT_FAMILY=e.DEFAULT_FONT_FAMILY;exports.DEFAULT_NESTED_TAB_QUERY_KEY=e.DEFAULT_NESTED_TAB_QUERY_KEY;exports.DEFAULT_STEP_QUERY_KEY=e.DEFAULT_STEP_QUERY_KEY;exports.DEFAULT_TABS_QUERY_KEY=e.DEFAULT_TABS_QUERY_KEY;exports.applyTheme=e.applyTheme;exports.useHeaderConfig=e.useHeaderConfig;exports.useLanguage=e.useLanguage;exports.useLocales=e.useLocales;exports.useNestedTabQueryKey=e.useNestedTabQueryKey;exports.useStepQueryKey=e.useStepQueryKey;exports.useT=e.useT;exports.useTableQueryConfig=e.useTableQueryConfig;exports.useTabsQueryKey=e.useTabsQueryKey;exports.useTheme=e.useTheme;exports.useTranslations=e.useTranslations;exports.useTranslationsNamespace=e.useTranslationsNamespace;exports.createAppTranslator=t.createAppTranslator;exports.createTranslator=t.createTranslator;exports.flagFor=t.flagFor;exports.DEFAULT_TRANSLATIONS_NAMESPACE=r.DEFAULT_TRANSLATIONS_NAMESPACE;exports.buildTranslationName=r.buildTranslationName;exports.buildTranslations=r.buildTranslations;exports.flattenTranslations=r.flattenTranslations;exports.nestTranslations=r.nestTranslations;exports.toFormData=r.toFormData;exports.buildTableQuery=s.buildTableQuery;exports.parseTableQuery=s.parseTableQuery;exports.Icon=a.Icon;exports.icons=a.icons;exports.Accordion=u.Accordion;exports.AccordionItem=u.AccordionItem;exports.Alert=y.Alert;exports.Avatar=C.Avatar;exports.AvatarGroup=E.AvatarGroup;exports.BREAKPOINTS=c.BREAKPOINTS;exports.BREAKPOINT_ORDER=c.BREAKPOINT_ORDER;exports.Badge=b.Badge;exports.Blockquote=D.Blockquote;exports.Breadcrumbs=L.Breadcrumbs;exports.Button=P.Button;exports.Card=R.Card;exports.Checkbox=B.Checkbox;exports.Chip=_.Chip;exports.ChoiceCard=n.ChoiceCard;exports.ChoiceCardGroup=n.ChoiceCardGroup;exports.Code=h.Code;exports.CodeBlock=N.CodeBlock;exports.Col=l.Col;exports.Row=l.Row;exports.ColorPicker=k.ColorPicker;exports.DatePicker=I.DatePicker;exports.DateTimePicker=U.DateTimePicker;exports.Divider=K.Divider;exports.Dropdown=M.Dropdown;exports.EmptyState=Q.EmptyState;exports.FileUploader=O.FileUploader;exports.FirstRouteRedirect=T.FirstRouteRedirect;exports.Sidebar=T.Sidebar;exports.Flag=v.Flag;exports.Flex=x.Flex;exports.FullscreenToggle=G.FullscreenToggle;exports.Grid=Y.Grid;exports.ICON_COUNT=d.ICON_COUNT;exports.ICON_NAMES=d.ICON_NAMES;exports.IconButton=f.IconButton;exports.List=w.List;exports.ListItem=H.ListItem;exports.Loader=j.Loader;exports.Masonry=z.Masonry;exports.Modal=J.Modal;exports.MultiSelect=V.MultiSelect;exports.MultilineTextField=W.MultilineTextField;exports.NumberField=X.NumberField;exports.OtpField=Z.OtpField;exports.PageLayout=$.PageLayout;exports.Pagination=ee.Pagination;exports.Popover=re.Popover;exports.Radio=q.Radio;exports.RadioGroup=q.RadioGroup;exports.RemoveDialog=oe.RemoveDialog;exports.RichTextEditor=te.RichTextEditor;exports.RootLayout=ie.RootLayout;exports.Select=se.Select;exports.Slider=ae.Slider;exports.SpeedDial=p.SpeedDial;exports.SpeedDialAction=p.SpeedDialAction;exports.Stepper=ue.Stepper;exports.SwatchPicker=ce.SwatchPicker;exports.Switch=ne.Switch;exports.Table=le.Table;exports.Tabs=Te.Tabs;exports.TagsField=de.TagsField;exports.TextField=qe.TextField;exports.ThemeToggle=pe.ThemeToggle;exports.TimePicker=ge.TimePicker;exports.Timeline=g.Timeline;exports.TimelineItem=g.TimelineItem;exports.Toaster=Ae.Toaster;exports.ToggleButton=A.ToggleButton;exports.ToggleButtonGroup=A.ToggleButtonGroup;exports.Tooltip=Fe.Tooltip;exports.TranslatedFields=Se.TranslatedFields;exports.Typography=me.Typography;exports.UserCard=ye.UserCard;exports.toast=Ce.toast;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -3,165 +3,168 @@ import { u as s, a as t } from "./useForm-B_5wDIER.js";
3
3
  import { u as m } from "./useLockBodyScroll-DwBILLPK.js";
4
4
  import { u as x } from "./useMediaQuery-_1EcFoC5.js";
5
5
  import { g as T, h as l, s as u, u as c } from "./access-Db4knwyR.js";
6
- import { C as d, D as A, c as C, d as F, e as S, f as g, g as y, u as D, h as E, i as L, j as b, a as R, k as _, l as B, m as h, b as N, n as P } from "./ConfigProvider-2c94kUOk.js";
7
- import { c as M, a as U, f as k } from "./messages-C-zecFBE.js";
8
- import { D as K, b as O, a as Y, f as v, n as G, t as w } from "./translations-D15tFHM1.js";
6
+ import { C as d, D as A, c as C, d as F, e as S, f as g, g as E, u as D, h as y, i as R, j as B, a as L, k as b, l as _, m as N, b as P, n as h } from "./ConfigProvider-2c94kUOk.js";
7
+ import { c as M, a as U, f as K } from "./messages-C-zecFBE.js";
8
+ import { D as O, b as Q, a as Y, f as v, n as G, t as w } from "./translations-D15tFHM1.js";
9
9
  import { b as q, p as H } from "./table-DF3zTrC3.js";
10
10
  import { I as J, i as V } from "./Icon-CophpkHo.js";
11
11
  import { A as X, a as Z } from "./Accordion-CAxa1I-m.js";
12
12
  import { A as oo } from "./Alert-BQpA48PY.js";
13
13
  import { A as eo } from "./Avatar-BJVCdo-K.js";
14
14
  import { A as so } from "./AvatarGroup-DdJf4aT7.js";
15
- import { B as po } from "./Badge-DSWigoGC.js";
16
- import { B as fo } from "./Blockquote-CNIuJFHq.js";
17
- import { B as io } from "./Breadcrumbs-Bx5UgwDy.js";
18
- import { B as lo } from "./Button-DhEv0YFk.js";
19
- import { C as co } from "./Card-DzClqJuu.js";
20
- import { C as Ao } from "./Checkbox-XKL_Q5qj.js";
21
- import { C as Fo } from "./Chip-Cfo0v3Z8.js";
22
- import { C as go, a as yo } from "./ChoiceCardGroup-CvFzZlgI.js";
23
- import { C as Eo } from "./Code-DaEpXHfF.js";
24
- import { C as bo } from "./CodeBlock-BWxQyKRo.js";
25
- import { C as _o, R as Bo } from "./Col-D2TfZKiM.js";
26
- import { C as No } from "./ColorPicker-2udt1ORM.js";
27
- import { D as Io } from "./DatePicker-WM9TC6L_.js";
28
- import { D as Uo } from "./DateTimePicker-DBtcWK0F.js";
29
- import { D as Qo } from "./Divider-LtH3dLgw.js";
30
- import { D as Oo } from "./Dropdown-DKAXue5_.js";
31
- import { E as vo } from "./EmptyState-CetM49vk.js";
32
- import { F as wo } from "./FileUploader-VtmmwUFE.js";
33
- import { F as qo, S as Ho } from "./Sidebar-DRCs2ygZ.js";
34
- import { F as Jo } from "./Flag-BWCX6oSR.js";
35
- import { F as Wo } from "./Flex-Bj3mMF5A.js";
36
- import { F as Zo } from "./FullscreenToggle-oWzYqUPH.js";
37
- import { G as or } from "./Grid-CY-syhTX.js";
38
- import { I as er, a as ar } from "./names-D8ABK2Wk.js";
39
- import { I as tr } from "./IconButton-CBusrDa9.js";
40
- import { L as mr } from "./List-BHgFI9Ll.js";
41
- import { L as xr } from "./ListItem-B4yqZR-Z.js";
42
- import { L as Tr } from "./Loader-C4JoXOyA.js";
43
- import { M as ur } from "./Masonry--bT8SICO.js";
44
- import { M as nr } from "./Modal-BuaPDlKV.js";
45
- import { M as Ar } from "./MultiSelect-BGRT_B60.js";
46
- import { M as Fr } from "./MultilineTextField-CwNCJ9lZ.js";
47
- import { N as gr } from "./NumberField-DBvhSQCw.js";
48
- import { O as Dr } from "./OtpField-CTq-CUbF.js";
49
- import { P as Lr } from "./PageLayout-DddzYw2B.js";
50
- import { P as Rr } from "./Pagination-CN9V8M5C.js";
51
- import { P as Br } from "./Popover-CgIU4Rhg.js";
52
- import { R as Nr, a as Pr } from "./RadioGroup-DbodUJW8.js";
53
- import { R as Mr } from "./RemoveDialog-Bvt6sH79.js";
54
- import { R as kr } from "./RichTextEditor-BTx8Py3I.js";
55
- import { R as Kr } from "./RootLayout-DCpfuFWF.js";
56
- import { S as Yr } from "./Select-PbTyxB1Q.js";
57
- import { S as Gr } from "./Slider-oGXd5e9X.js";
58
- import { S as jr, a as qr } from "./SpeedDial-DgFj16BQ.js";
59
- import { S as zr } from "./Stepper-COKAyN1L.js";
60
- import { S as Vr } from "./SwatchPicker-D30aSrbY.js";
61
- import { S as Xr } from "./Switch-DMPJ0fhB.js";
62
- import { T as $r } from "./Table-BjPLvMbf.js";
63
- import { T as re } from "./Tabs--DDM-zKe.js";
64
- import { T as ae } from "./TagsField-BTJcZS9P.js";
65
- import { T as te } from "./TextField-DMI1X09n.js";
66
- import { T as me } from "./ThemeToggle-Deh9j8pm.js";
67
- import { T as xe } from "./TimePicker-3JgvK2on.js";
68
- import { T as Te, a as le } from "./Timeline-WkV4k_we.js";
69
- import { T as ce } from "./Toaster-D-eG1xv7.js";
70
- import { T as de, a as Ae } from "./ToggleButtonGroup-BWd7MOcc.js";
71
- import { T as Fe } from "./Tooltip-Cb_FKxT9.js";
72
- import { T as ge } from "./TranslatedFields-CI0F9bHw.js";
73
- import { T as De } from "./Typography-Cta6Rg4L.js";
74
- import { U as Le } from "./UserCard-BhqtX1vU.js";
75
- import { t as Re } from "./toastStore-Cx_JOKwS.js";
15
+ import { B as po, a as mo } from "./breakpoints-o3dzSzrU.js";
16
+ import { B as xo } from "./Badge-DSWigoGC.js";
17
+ import { B as To } from "./Blockquote-CNIuJFHq.js";
18
+ import { B as uo } from "./Breadcrumbs-Bx5UgwDy.js";
19
+ import { B as no } from "./Button-DhEv0YFk.js";
20
+ import { C as Co } from "./Card-DzClqJuu.js";
21
+ import { C as So } from "./Checkbox-XKL_Q5qj.js";
22
+ import { C as Eo } from "./Chip-Cfo0v3Z8.js";
23
+ import { C as yo, a as Ro } from "./ChoiceCardGroup-CvFzZlgI.js";
24
+ import { C as Lo } from "./Code-DaEpXHfF.js";
25
+ import { C as _o } from "./CodeBlock-BWxQyKRo.js";
26
+ import { C as Po, R as ho } from "./Col-D2TfZKiM.js";
27
+ import { C as Mo } from "./ColorPicker-2udt1ORM.js";
28
+ import { D as Ko } from "./DatePicker-WM9TC6L_.js";
29
+ import { D as Oo } from "./DateTimePicker-DBtcWK0F.js";
30
+ import { D as Yo } from "./Divider-LtH3dLgw.js";
31
+ import { D as Go } from "./Dropdown-DKAXue5_.js";
32
+ import { E as jo } from "./EmptyState-CetM49vk.js";
33
+ import { F as Ho } from "./FileUploader-VtmmwUFE.js";
34
+ import { F as Jo, S as Vo } from "./Sidebar-DRCs2ygZ.js";
35
+ import { F as Xo } from "./Flag-BWCX6oSR.js";
36
+ import { F as $o } from "./Flex-Bj3mMF5A.js";
37
+ import { F as rr } from "./FullscreenToggle-oWzYqUPH.js";
38
+ import { G as ar } from "./Grid-CY-syhTX.js";
39
+ import { I as tr, a as pr } from "./names-D8ABK2Wk.js";
40
+ import { I as fr } from "./IconButton-CBusrDa9.js";
41
+ import { L as ir } from "./List-BHgFI9Ll.js";
42
+ import { L as lr } from "./ListItem-B4yqZR-Z.js";
43
+ import { L as cr } from "./Loader-C4JoXOyA.js";
44
+ import { M as dr } from "./Masonry-BTvtDdnt.js";
45
+ import { M as Cr } from "./Modal-BuaPDlKV.js";
46
+ import { M as Sr } from "./MultiSelect-BGRT_B60.js";
47
+ import { M as Er } from "./MultilineTextField-CwNCJ9lZ.js";
48
+ import { N as yr } from "./NumberField-DBvhSQCw.js";
49
+ import { O as Br } from "./OtpField-CTq-CUbF.js";
50
+ import { P as br } from "./PageLayout-DddzYw2B.js";
51
+ import { P as Nr } from "./Pagination-CN9V8M5C.js";
52
+ import { P as hr } from "./Popover-CgIU4Rhg.js";
53
+ import { R as Mr, a as Ur } from "./RadioGroup-DbodUJW8.js";
54
+ import { R as kr } from "./RemoveDialog-Bvt6sH79.js";
55
+ import { R as Qr } from "./RichTextEditor-BTx8Py3I.js";
56
+ import { R as vr } from "./RootLayout-DCpfuFWF.js";
57
+ import { S as wr } from "./Select-PbTyxB1Q.js";
58
+ import { S as qr } from "./Slider-oGXd5e9X.js";
59
+ import { S as zr, a as Jr } from "./SpeedDial-DgFj16BQ.js";
60
+ import { S as Wr } from "./Stepper-COKAyN1L.js";
61
+ import { S as Zr } from "./SwatchPicker-D30aSrbY.js";
62
+ import { S as oe } from "./Switch-DMPJ0fhB.js";
63
+ import { T as ee } from "./Table-BjPLvMbf.js";
64
+ import { T as se } from "./Tabs--DDM-zKe.js";
65
+ import { T as pe } from "./TagsField-BTJcZS9P.js";
66
+ import { T as fe } from "./TextField-DMI1X09n.js";
67
+ import { T as ie } from "./ThemeToggle-Deh9j8pm.js";
68
+ import { T as le } from "./TimePicker-3JgvK2on.js";
69
+ import { T as ce, a as ne } from "./Timeline-WkV4k_we.js";
70
+ import { T as Ae } from "./Toaster-D-eG1xv7.js";
71
+ import { T as Fe, a as Se } from "./ToggleButtonGroup-BWd7MOcc.js";
72
+ import { T as Ee } from "./Tooltip-Cb_FKxT9.js";
73
+ import { T as ye } from "./TranslatedFields-CI0F9bHw.js";
74
+ import { T as Be } from "./Typography-Cta6Rg4L.js";
75
+ import { U as be } from "./UserCard-BhqtX1vU.js";
76
+ import { t as Ne } from "./toastStore-Cx_JOKwS.js";
76
77
  export {
77
78
  X as Accordion,
78
79
  Z as AccordionItem,
79
80
  oo as Alert,
80
81
  eo as Avatar,
81
82
  so as AvatarGroup,
82
- po as Badge,
83
- fo as Blockquote,
84
- io as Breadcrumbs,
85
- lo as Button,
86
- co as Card,
87
- Ao as Checkbox,
88
- Fo as Chip,
89
- go as ChoiceCard,
90
- yo as ChoiceCardGroup,
91
- Eo as Code,
92
- bo as CodeBlock,
93
- _o as Col,
94
- No as ColorPicker,
83
+ po as BREAKPOINTS,
84
+ mo as BREAKPOINT_ORDER,
85
+ xo as Badge,
86
+ To as Blockquote,
87
+ uo as Breadcrumbs,
88
+ no as Button,
89
+ Co as Card,
90
+ So as Checkbox,
91
+ Eo as Chip,
92
+ yo as ChoiceCard,
93
+ Ro as ChoiceCardGroup,
94
+ Lo as Code,
95
+ _o as CodeBlock,
96
+ Po as Col,
97
+ Mo as ColorPicker,
95
98
  d as ConfigProvider,
96
99
  A as DEFAULT_FONT_FAMILY,
97
100
  C as DEFAULT_NESTED_TAB_QUERY_KEY,
98
101
  F as DEFAULT_STEP_QUERY_KEY,
99
102
  S as DEFAULT_TABS_QUERY_KEY,
100
- K as DEFAULT_TRANSLATIONS_NAMESPACE,
101
- Io as DatePicker,
102
- Uo as DateTimePicker,
103
- Qo as Divider,
104
- Oo as Dropdown,
105
- vo as EmptyState,
106
- wo as FileUploader,
107
- qo as FirstRouteRedirect,
108
- Jo as Flag,
109
- Wo as Flex,
103
+ O as DEFAULT_TRANSLATIONS_NAMESPACE,
104
+ Ko as DatePicker,
105
+ Oo as DateTimePicker,
106
+ Yo as Divider,
107
+ Go as Dropdown,
108
+ jo as EmptyState,
109
+ Ho as FileUploader,
110
+ Jo as FirstRouteRedirect,
111
+ Xo as Flag,
112
+ $o as Flex,
110
113
  e as Form,
111
- Zo as FullscreenToggle,
112
- or as Grid,
113
- er as ICON_COUNT,
114
- ar as ICON_NAMES,
114
+ rr as FullscreenToggle,
115
+ ar as Grid,
116
+ tr as ICON_COUNT,
117
+ pr as ICON_NAMES,
115
118
  J as Icon,
116
- tr as IconButton,
117
- mr as List,
118
- xr as ListItem,
119
- Tr as Loader,
120
- ur as Masonry,
121
- nr as Modal,
122
- Ar as MultiSelect,
123
- Fr as MultilineTextField,
124
- gr as NumberField,
125
- Dr as OtpField,
126
- Lr as PageLayout,
127
- Rr as Pagination,
128
- Br as Popover,
129
- Nr as Radio,
130
- Pr as RadioGroup,
131
- Mr as RemoveDialog,
132
- kr as RichTextEditor,
133
- Kr as RootLayout,
134
- Bo as Row,
135
- Yr as Select,
136
- Ho as Sidebar,
137
- Gr as Slider,
138
- jr as SpeedDial,
139
- qr as SpeedDialAction,
140
- zr as Stepper,
141
- Vr as SwatchPicker,
142
- Xr as Switch,
143
- $r as Table,
144
- re as Tabs,
145
- ae as TagsField,
146
- te as TextField,
147
- me as ThemeToggle,
148
- xe as TimePicker,
149
- Te as Timeline,
150
- le as TimelineItem,
151
- ce as Toaster,
152
- de as ToggleButton,
153
- Ae as ToggleButtonGroup,
154
- Fe as Tooltip,
155
- ge as TranslatedFields,
156
- De as Typography,
157
- Le as UserCard,
119
+ fr as IconButton,
120
+ ir as List,
121
+ lr as ListItem,
122
+ cr as Loader,
123
+ dr as Masonry,
124
+ Cr as Modal,
125
+ Sr as MultiSelect,
126
+ Er as MultilineTextField,
127
+ yr as NumberField,
128
+ Br as OtpField,
129
+ br as PageLayout,
130
+ Nr as Pagination,
131
+ hr as Popover,
132
+ Mr as Radio,
133
+ Ur as RadioGroup,
134
+ kr as RemoveDialog,
135
+ Qr as RichTextEditor,
136
+ vr as RootLayout,
137
+ ho as Row,
138
+ wr as Select,
139
+ Vo as Sidebar,
140
+ qr as Slider,
141
+ zr as SpeedDial,
142
+ Jr as SpeedDialAction,
143
+ Wr as Stepper,
144
+ Zr as SwatchPicker,
145
+ oe as Switch,
146
+ ee as Table,
147
+ se as Tabs,
148
+ pe as TagsField,
149
+ fe as TextField,
150
+ ie as ThemeToggle,
151
+ le as TimePicker,
152
+ ce as Timeline,
153
+ ne as TimelineItem,
154
+ Ae as Toaster,
155
+ Fe as ToggleButton,
156
+ Se as ToggleButtonGroup,
157
+ Ee as Tooltip,
158
+ ye as TranslatedFields,
159
+ Be as Typography,
160
+ be as UserCard,
158
161
  g as applyTheme,
159
162
  q as buildTableQuery,
160
- O as buildTranslationName,
163
+ Q as buildTranslationName,
161
164
  Y as buildTranslations,
162
165
  M as createAppTranslator,
163
166
  U as createTranslator,
164
- k as flagFor,
167
+ K as flagFor,
165
168
  v as flattenTranslations,
166
169
  T as getAccessKeys,
167
170
  l as hasAccess,
@@ -170,22 +173,22 @@ export {
170
173
  H as parseTableQuery,
171
174
  u as setAccessKeys,
172
175
  w as toFormData,
173
- Re as toast,
176
+ Ne as toast,
174
177
  c as useAccessKeys,
175
178
  s as useDisclosure,
176
179
  t as useForm,
177
- y as useHeaderConfig,
180
+ E as useHeaderConfig,
178
181
  D as useLanguage,
179
- E as useLocales,
182
+ y as useLocales,
180
183
  m as useLockBodyScroll,
181
184
  x as useMediaQuery,
182
- L as useNestedTabQueryKey,
183
- b as useStepQueryKey,
184
- R as useT,
185
- _ as useTableQueryConfig,
186
- B as useTabsQueryKey,
187
- h as useTheme,
188
- N as useTranslations,
189
- P as useTranslationsNamespace
185
+ R as useNestedTabQueryKey,
186
+ B as useStepQueryKey,
187
+ L as useT,
188
+ b as useTableQueryConfig,
189
+ _ as useTabsQueryKey,
190
+ N as useTheme,
191
+ P as useTranslations,
192
+ h as useTranslationsNamespace
190
193
  };
191
194
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The library's shared responsive breakpoints — the single source of truth for width thresholds.
3
+ *
4
+ * Mobile-first **min-width** values in px. `xs` is the base (`0`); the two values the component CSS
5
+ * already keys off (`≤575.98px` phones, `≤1279.98px` tablet/overlay) line up with `sm` (576) and `xl`
6
+ * (1280), so this scale is a superset of what the styles already use rather than a new set. Consume
7
+ * these instead of hardcoding pixel thresholds, and derive the `Breakpoint` type from here rather than
8
+ * re-listing the keys locally.
9
+ */
10
+ export declare const BREAKPOINTS: {
11
+ readonly xs: 0;
12
+ readonly sm: 576;
13
+ readonly md: 768;
14
+ readonly lg: 992;
15
+ readonly xl: 1280;
16
+ };
17
+ /** A responsive breakpoint key (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`). */
18
+ export type Breakpoint = keyof typeof BREAKPOINTS;
19
+ /** Breakpoint keys in ascending (mobile-first) order. */
20
+ export declare const BREAKPOINT_ORDER: readonly Breakpoint[];
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The library's shared responsive breakpoints — the single source of truth for width thresholds.
3
+ *
4
+ * Mobile-first **min-width** values in px. `xs` is the base (`0`); the two values the component CSS
5
+ * already keys off (`≤575.98px` phones, `≤1279.98px` tablet/overlay) line up with `sm` (576) and `xl`
6
+ * (1280), so this scale is a superset of what the styles already use rather than a new set. Consume
7
+ * these instead of hardcoding pixel thresholds, and derive the `Breakpoint` type from here rather than
8
+ * re-listing the keys locally.
9
+ */
10
+ export declare const BREAKPOINTS: {
11
+ readonly xs: 0;
12
+ readonly sm: 576;
13
+ readonly md: 768;
14
+ readonly lg: 992;
15
+ readonly xl: 1280;
16
+ };
17
+ /** A responsive breakpoint key (`'xs' | 'sm' | 'md' | 'lg' | 'xl'`). */
18
+ export type Breakpoint = keyof typeof BREAKPOINTS;
19
+ /** Breakpoint keys in ascending (mobile-first) order. */
20
+ export declare const BREAKPOINT_ORDER: readonly Breakpoint[];
@@ -1,5 +1,7 @@
1
1
  export { applyTheme } from './applyTheme';
2
2
  export type { ThemePalette, ThemeColor } from './applyTheme';
3
+ export { BREAKPOINTS, BREAKPOINT_ORDER } from './breakpoints';
4
+ export type { Breakpoint } from './breakpoints';
3
5
  export { ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, useT, useTranslations, useLanguage, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, } from './ConfigProvider';
4
6
  export type { Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from './ConfigProvider';
5
7
  export type { Messages, MessageKey, MessageCatalog, MessageOverrides, Translator, AppMessages, AppTranslator, } from '../i18n/messages';
@@ -1,5 +1,7 @@
1
1
  export { applyTheme } from './applyTheme';
2
2
  export type { ThemePalette, ThemeColor } from './applyTheme';
3
+ export { BREAKPOINTS, BREAKPOINT_ORDER } from './breakpoints';
4
+ export type { Breakpoint } from './breakpoints';
3
5
  export { ConfigProvider, useTheme, useLocales, useTranslationsNamespace, useTabsQueryKey, useNestedTabQueryKey, useStepQueryKey, useTableQueryConfig, useHeaderConfig, useT, useTranslations, useLanguage, DEFAULT_TABS_QUERY_KEY, DEFAULT_NESTED_TAB_QUERY_KEY, DEFAULT_STEP_QUERY_KEY, DEFAULT_FONT_FAMILY, } from './ConfigProvider';
4
6
  export type { Config, ThemeConfig, ThemeColors, ThemeMode, ConfigProviderProps, LocaleConfig, KeysConfig, TableConfig, TableQueryConfig, HeaderConfig, HeaderUser, I18nConfig, } from './ConfigProvider';
5
7
  export type { Messages, MessageKey, MessageCatalog, MessageOverrides, Translator, AppMessages, AppTranslator, } from '../i18n/messages';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techzyapp/ui-library",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Techzy UI — reusable React component library for admin panels.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,80 +0,0 @@
1
- import { jsx as y } from "react/jsx-runtime";
2
- import { forwardRef as D, useMemo as E, Children as G, useState as R, useRef as v, useCallback as b, useLayoutEffect as O, useEffect as _ } from "react";
3
- import { s as C } from "./Flex-Bj3mMF5A.js";
4
- const j = 200, q = (u, r) => u.length === r.length && u.every((l, m) => l === r[m]), W = D(function({ columns: r = 3, minColumnWidth: l, gap: m = "md", padding: I, className: w, style: A, children: g, ...H }, i) {
5
- const h = E(() => G.toArray(g), [g]), n = h.length, [c, T] = R(() => Math.max(1, r)), [x, S] = R([]), p = v(null), d = v([]), k = b(
6
- (e) => {
7
- p.current = e, typeof i == "function" ? i(e) : i && (i.current = e);
8
- },
9
- [i]
10
- ), f = b(() => {
11
- const e = p.current;
12
- if (!e) return;
13
- let o = Math.max(1, r);
14
- if (l != null) {
15
- const t = parseFloat(getComputedStyle(e).columnGap) || 0, a = e.clientWidth;
16
- o = Math.max(1, Math.floor((a + t) / (l + t)));
17
- }
18
- T((t) => t === o ? t : o);
19
- const s = d.current.slice(0, n).map((t) => t ? t.offsetHeight : 0);
20
- S((t) => q(t, s) ? t : s);
21
- }, [r, l, n]);
22
- O(f, [f, h, c]), _(() => {
23
- const e = p.current;
24
- if (!e || typeof ResizeObserver > "u") return;
25
- const o = new ResizeObserver(() => f());
26
- return o.observe(e), d.current.slice(0, n).forEach((s) => s && o.observe(s)), () => o.disconnect();
27
- }, [f, n, c]);
28
- const z = E(() => {
29
- const e = Array.from({ length: c }, () => []), o = new Array(c).fill(0);
30
- for (let s = 0; s < n; s++) {
31
- let t = 0;
32
- for (let a = 1; a < c; a++) o[a] < o[t] && (t = a);
33
- e[t].push(s), o[t] += x[s] || j;
34
- }
35
- return e;
36
- }, [c, n, x]), M = C(m);
37
- return /* @__PURE__ */ y(
38
- "div",
39
- {
40
- ref: k,
41
- className: w,
42
- style: {
43
- display: "flex",
44
- alignItems: "flex-start",
45
- gap: M,
46
- padding: C(I),
47
- ...A
48
- },
49
- ...H,
50
- children: z.map((e, o) => /* @__PURE__ */ y(
51
- "div",
52
- {
53
- style: {
54
- display: "flex",
55
- flexDirection: "column",
56
- gap: M,
57
- flex: "1 1 0",
58
- minWidth: 0
59
- },
60
- children: e.map((s) => /* @__PURE__ */ y(
61
- "div",
62
- {
63
- ref: (t) => {
64
- d.current[s] = t;
65
- },
66
- style: { minWidth: 0 },
67
- children: h[s]
68
- },
69
- s
70
- ))
71
- },
72
- o
73
- ))
74
- }
75
- );
76
- });
77
- export {
78
- W as M
79
- };
80
- //# sourceMappingURL=Masonry--bT8SICO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Masonry--bT8SICO.js","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\n\n// nominal height for a not-yet-measured item, so the first (pre-measure) pass spreads items across\n// columns round-robin instead of dumping them all into the first one; corrected on the layout pass.\nconst ESTIMATED_ITEM_HEIGHT = 200\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /** Fixed number of columns. Defaults to `3`. Ignored when `minColumnWidth` is set. */\n columns?: number\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /** Gap between items, horizontally and vertically (token key, px number, or CSS value). Defaults to `md`. */\n gap?: Spacing\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),\n * so it works with any children. Use a fixed `columns` count or a responsive `minColumnWidth`; `gap`\n * spaces items on both axes. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer\n * `style` merges last. Reading order flows left-to-right across the columns.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n const [colCount, setColCount] = useState(() => Math.max(1, columns))\n const [heights, setHeights] = useState<number[]>([])\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // merge the internal measuring ref with the forwarded ref\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // measure the container width → column count, and each item's height → the balance\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n\n let nextCols = Math.max(1, columns)\n if (minColumnWidth != null) {\n const g = parseFloat(getComputedStyle(root).columnGap) || 0\n const width = root.clientWidth\n nextCols = Math.max(1, Math.floor((width + g) / (minColumnWidth + g)))\n }\n setColCount((prev) => (prev === nextCols ? prev : nextCols))\n\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [columns, minColumnWidth, count])\n\n // measure before paint (mount + whenever the item set or column count changes)\n useLayoutEffect(measure, [measure, items, colCount])\n\n // re-balance on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count, colCount])\n\n // greedily assign each item (in order) to the currently shortest column\n const columnsItems = useMemo(() => {\n const buckets: number[][] = Array.from({ length: colCount }, () => [])\n const acc = new Array(colCount).fill(0)\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (acc[c] < acc[min]) min = c\n buckets[min].push(i)\n acc[min] += heights[i] || ESTIMATED_ITEM_HEIGHT\n }\n return buckets\n }, [colCount, count, heights])\n\n const gapValue = space(gap)\n\n return (\n <div\n ref={setRootRef}\n className={className}\n style={{\n display: 'flex',\n alignItems: 'flex-start',\n gap: gapValue,\n padding: space(padding),\n ...style,\n }}\n {...props}\n >\n {columnsItems.map((indices, c) => (\n <div\n key={c}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: gapValue,\n flex: '1 1 0',\n minWidth: 0,\n }}\n >\n {indices.map((i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={{ minWidth: 0 } as CSSProperties}\n >\n {items[i]}\n </div>\n ))}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["ESTIMATED_ITEM_HEIGHT","arraysEqual","a","b","v","i","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","colCount","setColCount","useState","heights","setHeights","rootRef","useRef","itemRefs","setRootRef","useCallback","node","measure","root","nextCols","g","width","prev","next","el","useLayoutEffect","useEffect","ro","columnsItems","buckets","acc","min","c","gapValue","space","jsx","indices"],"mappings":";;;AAiBA,MAAMA,IAAwB,KAexBC,IAAc,CAACC,GAAaC,MAChCD,EAAE,WAAWC,EAAE,UAAUD,EAAE,MAAM,CAACE,GAAGC,MAAMD,MAAMD,EAAEE,CAAC,CAAC,GAU1CC,IAAUC,EAAyC,SAC9D,EAAE,SAAAC,IAAU,GAAG,gBAAAC,GAAgB,KAAAC,IAAM,MAAM,SAAAC,GAAS,WAAAC,GAAW,OAAAC,GAAO,UAAAC,GAAU,GAAGC,EAAA,GACnFC,GACA;AACA,QAAMC,IAAQC,EAAQ,MAAMC,EAAS,QAAQL,CAAQ,GAAG,CAACA,CAAQ,CAAC,GAC5DM,IAAQH,EAAM,QAEd,CAACI,GAAUC,CAAW,IAAIC,EAAS,MAAM,KAAK,IAAI,GAAGf,CAAO,C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kC;AAAA,cACxB;AAAA,cACA,OAAO,EAAE,UAAU,EAAA;AAAA,cAElB,YAAMlC,CAAC;AAAA,YAAA;AAAA,YANHA;AAAA,UAAA,CAQR;AAAA,QAAA;AAAA,QAnBI0C;AAAA,MAAA,CAqBR;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1,2 +0,0 @@
1
- "use strict";const x=require("react/jsx-runtime"),r=require("react"),E=require("./Flex-CqL3Ghda.cjs"),H=200,S=(h,o)=>h.length===o.length&&h.every((u,m)=>u===o[m]),T=r.forwardRef(function({columns:o=3,minColumnWidth:u,gap:m="md",padding:b,className:v,style:C,children:g,...I},i){const y=r.useMemo(()=>r.Children.toArray(g),[g]),c=y.length,[a,j]=r.useState(()=>Math.max(1,o)),[M,q]=r.useState([]),d=r.useRef(null),p=r.useRef([]),w=r.useCallback(t=>{d.current=t,typeof i=="function"?i(t):i&&(i.current=t)},[i]),f=r.useCallback(()=>{const t=d.current;if(!t)return;let n=Math.max(1,o);if(u!=null){const e=parseFloat(getComputedStyle(t).columnGap)||0,l=t.clientWidth;n=Math.max(1,Math.floor((l+e)/(u+e)))}j(e=>e===n?e:n);const s=p.current.slice(0,c).map(e=>e?e.offsetHeight:0);q(e=>S(e,s)?e:s)},[o,u,c]);r.useLayoutEffect(f,[f,y,a]),r.useEffect(()=>{const t=d.current;if(!t||typeof ResizeObserver>"u")return;const n=new ResizeObserver(()=>f());return n.observe(t),p.current.slice(0,c).forEach(s=>s&&n.observe(s)),()=>n.disconnect()},[f,c,a]);const A=r.useMemo(()=>{const t=Array.from({length:a},()=>[]),n=new Array(a).fill(0);for(let s=0;s<c;s++){let e=0;for(let l=1;l<a;l++)n[l]<n[e]&&(e=l);t[e].push(s),n[e]+=M[s]||H}return t},[a,c,M]),R=E.space(m);return x.jsx("div",{ref:w,className:v,style:{display:"flex",alignItems:"flex-start",gap:R,padding:E.space(b),...C},...I,children:A.map((t,n)=>x.jsx("div",{style:{display:"flex",flexDirection:"column",gap:R,flex:"1 1 0",minWidth:0},children:t.map(s=>x.jsx("div",{ref:e=>{p.current[s]=e},style:{minWidth:0},children:y[s]},s))},n))})});exports.Masonry=T;
2
- //# sourceMappingURL=Masonry-DlD-rIQX.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Masonry-DlD-rIQX.cjs","sources":["../src/components/Masonry/Masonry.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { space, type Spacing } from '../Flex/Flex'\n\n// nominal height for a not-yet-measured item, so the first (pre-measure) pass spreads items across\n// columns round-robin instead of dumping them all into the first one; corrected on the layout pass.\nconst ESTIMATED_ITEM_HEIGHT = 200\n\nexport interface MasonryProps extends HTMLAttributes<HTMLDivElement> {\n /** Fixed number of columns. Defaults to `3`. Ignored when `minColumnWidth` is set. */\n columns?: number\n /** Responsive: fit as many equal columns as this min pixel width allows (overrides `columns`). */\n minColumnWidth?: number\n /** Gap between items, horizontally and vertically (token key, px number, or CSS value). Defaults to `md`. */\n gap?: Spacing\n /** Padding around the grid (token key, px number, or CSS value). */\n padding?: Spacing\n /** The items to lay out. */\n children?: ReactNode\n}\n\nconst arraysEqual = (a: number[], b: number[]) =>\n a.length === b.length && a.every((v, i) => v === b[i])\n\n/**\n * A masonry layout — packs items of varying heights into balanced columns, always adding the next item\n * to the **shortest** column (Pinterest-style), so columns stay level rather than following a fixed\n * grid. Item heights are measured in the DOM (a `ResizeObserver` re-balances on content/size changes),\n * so it works with any children. Use a fixed `columns` count or a responsive `minColumnWidth`; `gap`\n * spaces items on both axes. Inline-styled like the other layout primitives (`Flex` / `Grid`); consumer\n * `style` merges last. Reading order flows left-to-right across the columns.\n */\nexport const Masonry = forwardRef<HTMLDivElement, MasonryProps>(function Masonry(\n { columns = 3, minColumnWidth, gap = 'md', padding, className, style, children, ...props },\n ref,\n) {\n const items = useMemo(() => Children.toArray(children), [children])\n const count = items.length\n\n const [colCount, setColCount] = useState(() => Math.max(1, columns))\n const [heights, setHeights] = useState<number[]>([])\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const itemRefs = useRef<Array<HTMLDivElement | null>>([])\n\n // merge the internal measuring ref with the forwarded ref\n const setRootRef = useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n\n // measure the container width → column count, and each item's height → the balance\n const measure = useCallback(() => {\n const root = rootRef.current\n if (!root) return\n\n let nextCols = Math.max(1, columns)\n if (minColumnWidth != null) {\n const g = parseFloat(getComputedStyle(root).columnGap) || 0\n const width = root.clientWidth\n nextCols = Math.max(1, Math.floor((width + g) / (minColumnWidth + g)))\n }\n setColCount((prev) => (prev === nextCols ? prev : nextCols))\n\n const next = itemRefs.current.slice(0, count).map((el) => (el ? el.offsetHeight : 0))\n setHeights((prev) => (arraysEqual(prev, next) ? prev : next))\n }, [columns, minColumnWidth, count])\n\n // measure before paint (mount + whenever the item set or column count changes)\n useLayoutEffect(measure, [measure, items, colCount])\n\n // re-balance on container resize and on any item resizing (image loads, dynamic content, …)\n useEffect(() => {\n const root = rootRef.current\n if (!root || typeof ResizeObserver === 'undefined') return\n const ro = new ResizeObserver(() => measure())\n ro.observe(root)\n itemRefs.current.slice(0, count).forEach((el) => el && ro.observe(el))\n return () => ro.disconnect()\n }, [measure, count, colCount])\n\n // greedily assign each item (in order) to the currently shortest column\n const columnsItems = useMemo(() => {\n const buckets: number[][] = Array.from({ length: colCount }, () => [])\n const acc = new Array(colCount).fill(0)\n for (let i = 0; i < count; i++) {\n let min = 0\n for (let c = 1; c < colCount; c++) if (acc[c] < acc[min]) min = c\n buckets[min].push(i)\n acc[min] += heights[i] || ESTIMATED_ITEM_HEIGHT\n }\n return buckets\n }, [colCount, count, heights])\n\n const gapValue = space(gap)\n\n return (\n <div\n ref={setRootRef}\n className={className}\n style={{\n display: 'flex',\n alignItems: 'flex-start',\n gap: gapValue,\n padding: space(padding),\n ...style,\n }}\n {...props}\n >\n {columnsItems.map((indices, c) => (\n <div\n key={c}\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: gapValue,\n flex: '1 1 0',\n minWidth: 0,\n }}\n >\n {indices.map((i) => (\n <div\n key={i}\n ref={(el) => {\n itemRefs.current[i] = el\n }}\n style={{ minWidth: 0 } as CSSProperties}\n >\n {items[i]}\n </div>\n ))}\n </div>\n ))}\n </div>\n )\n})\n"],"names":["ESTIMATED_ITEM_HEIGHT","arraysEqual","a","b","v","i","Masonry","forwardRef","columns","minColumnWidth","gap","padding","className","style","children","props","ref","items","useMemo","Children","count","colCount","setColCount","useState","heights","setHeights","rootRef","useRef","itemRefs","setRootRef","useCallback","node","measure","root","nextCols","g","width","prev","next","el","useLayoutEffect","useEffect","ro","columnsItems","buckets","acc","min","c","gapValue","space","jsx","indices"],"mappings":"sGAiBMA,EAAwB,IAexBC,EAAc,CAACC,EAAaC,IAChCD,EAAE,SAAWC,EAAE,QAAUD,EAAE,MAAM,CAACE,EAAGC,IAAMD,IAAMD,EAAEE,CAAC,CAAC,EAU1CC,EAAUC,EAAAA,WAAyC,SAC9D,CAAE,QAAAC,EAAU,EAAG,eAAAC,EAAgB,IAAAC,EAAM,KAAM,QAAAC,EAAS,UAAAC,EAAW,MAAAC,EAAO,SAAAC,EAAU,GAAGC,CAAA,EACnFC,EACA,CACA,MAAMC,EAAQC,EAAAA,QAAQ,IAAMC,EAAAA,SAAS,QAAQL,CAAQ,EAAG,CAACA,CAAQ,CAAC,EAC5DM,EAAQH,EAAM,OAEd,CAACI,EAAUC,CAAW,EAAIC,EAAAA,SAAS,IAAM,KAAK,IAAI,EAAGf,CAAO,CAAC,EAC7D,CAACgB,EAASC,CAAU,EAAIF,EAAAA,SAAmB,CAAA,CAAE,EAE7CG,EAAUC,EAAAA,OAA8B,IAAI,EAC5CC,EAAWD,EAAAA,OAAqC,EAAE,EAGl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