@photon-ai/pho-ui 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/animated-height-I44sUq0n.js +48 -0
- package/dist/chunks/animated-height-I44sUq0n.js.map +1 -0
- package/dist/chunks/{basic-page-C3qjXfBe.js → basic-page-OrUVXKrx.js} +407 -407
- package/dist/chunks/basic-page-OrUVXKrx.js.map +1 -0
- package/dist/chunks/card-N-tvFsuV.js +64 -0
- package/dist/chunks/card-N-tvFsuV.js.map +1 -0
- package/dist/chunks/collapsible-Dv306QOT.js +40 -0
- package/dist/chunks/collapsible-Dv306QOT.js.map +1 -0
- package/dist/chunks/{command-CTYrSz9a.js → command-Cn000hMK.js} +3 -3
- package/dist/chunks/{command-CTYrSz9a.js.map → command-Cn000hMK.js.map} +1 -1
- package/dist/chunks/{data-table-BeUwsjmX.js → data-table-Mog6m3d9.js} +2 -2
- package/dist/chunks/{data-table-BeUwsjmX.js.map → data-table-Mog6m3d9.js.map} +1 -1
- package/dist/chunks/date-picker-CZbcNIe-.js +428 -0
- package/dist/chunks/date-picker-CZbcNIe-.js.map +1 -0
- package/dist/chunks/{dialog-BwfUFn6B.js → dialog-BOz_xOrn.js} +47 -51
- package/dist/chunks/{dialog-BwfUFn6B.js.map → dialog-BOz_xOrn.js.map} +1 -1
- package/dist/chunks/{filter-bar-D9lBBr4z.js → filter-bar-Cr_1zBFq.js} +2 -2
- package/dist/chunks/{filter-bar-D9lBBr4z.js.map → filter-bar-Cr_1zBFq.js.map} +1 -1
- package/dist/chunks/{sidebar-DRPe5CAh.js → sidebar-bLsjo_yb.js} +2 -2
- package/dist/chunks/{sidebar-DRPe5CAh.js.map → sidebar-bLsjo_yb.js.map} +1 -1
- package/dist/chunks/{trace-Hku-rImp.js → trace-CjOi3_IP.js} +2 -2
- package/dist/chunks/{trace-Hku-rImp.js.map → trace-CjOi3_IP.js.map} +1 -1
- package/dist/components/accordion.js +3 -3
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/filter-bar.js +1 -1
- package/dist/components/trace.js +1 -1
- package/dist/index.js +8 -8
- package/dist/sections/basic-page.js +2 -2
- package/dist/sections/sidebar.js +1 -1
- package/dist/src/components/card/card.d.ts +20 -4
- package/dist/src/components/collapsible/collapsible.d.ts +1 -1
- package/dist/src/components/date-picker/date-picker.d.ts +25 -2
- package/dist/src/components/date-picker/index.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/sections/basic-page/basic-page.d.ts +5 -5
- package/dist/src/utils/animated-height.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/animated-height-CCO-Ocoz.js +0 -48
- package/dist/chunks/animated-height-CCO-Ocoz.js.map +0 -1
- package/dist/chunks/basic-page-C3qjXfBe.js.map +0 -1
- package/dist/chunks/card-DhDwtSi9.js +0 -56
- package/dist/chunks/card-DhDwtSi9.js.map +0 -1
- package/dist/chunks/collapsible-if7ncPbI.js +0 -28
- package/dist/chunks/collapsible-if7ncPbI.js.map +0 -1
- package/dist/chunks/date-picker-Ddeo1fNE.js +0 -422
- package/dist/chunks/date-picker-Ddeo1fNE.js.map +0 -1
|
@@ -8,21 +8,21 @@ var i = {
|
|
|
8
8
|
item: "py-3",
|
|
9
9
|
hit: "before:-top-3 before:-bottom-3",
|
|
10
10
|
question: "text-base",
|
|
11
|
-
gap: "pt-1",
|
|
11
|
+
gap: "pt-1 pb-1",
|
|
12
12
|
answer: "text-xs"
|
|
13
13
|
},
|
|
14
14
|
md: {
|
|
15
15
|
item: "py-4",
|
|
16
16
|
hit: "before:-top-4 before:-bottom-4",
|
|
17
17
|
question: "text-md",
|
|
18
|
-
gap: "pt-1.5",
|
|
18
|
+
gap: "pt-1.5 pb-1.5",
|
|
19
19
|
answer: "text-base"
|
|
20
20
|
},
|
|
21
21
|
lg: {
|
|
22
22
|
item: "py-5",
|
|
23
23
|
hit: "before:-top-5 before:-bottom-5",
|
|
24
24
|
question: "text-xl leading-7",
|
|
25
|
-
gap: "pt-2",
|
|
25
|
+
gap: "pt-2 pb-2",
|
|
26
26
|
answer: "text-lg"
|
|
27
27
|
}
|
|
28
28
|
}, p = d("md");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":[],"sources":["../../src/components/accordion/accordion.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type ElementType,\n} from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nexport type AccordionSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Three sizes, one step of the type scale apart. `lg` is photon.codes's\n * FAQ to the pixel: the question at 20/28, the answer at 18/28, 20px\n * above and below, 8px between. `md` and `sm` step the type, the\n * padding, and the gap down together; the chevron is the same small\n * glyph in the same 24px box at every size, so a row is never shorter\n * than it.\n */\nconst SIZE: Record<\n AccordionSize,\n { item: string; hit: string; question: string; gap: string; answer: string }\n> = {\n sm: {\n item: \"py-3\",\n hit: \"before:-top-3 before:-bottom-3\",\n question: \"text-base\",\n gap: \"pt-1\",\n answer: \"text-xs\",\n },\n md: {\n item: \"py-4\",\n hit: \"before:-top-4 before:-bottom-4\",\n question: \"text-md\",\n gap: \"pt-1.5\",\n answer: \"text-base\",\n },\n lg: {\n item: \"py-5\",\n hit: \"before:-top-5 before:-bottom-5\",\n question: \"text-xl leading-7\",\n gap: \"pt-2\",\n answer: \"text-lg\",\n },\n};\n\nconst SizeContext = createContext<AccordionSize>(\"md\");\n\nexport interface AccordionRootProps extends StyledProps<\n typeof BaseAccordion.Root\n> {\n /** @default \"md\" */\n size?: AccordionSize;\n}\n\n/**\n * The list — bare, so the page decides the surface: on photon.codes the\n * FAQ card is the section's, 32px around the list; in a settings page it\n * is a `Card`. Items divide with a hairline and the list has no outer\n * lines. Items are independent, as on the site, so `multiple` is on\n * unless said otherwise.\n */\nfunction Root({\n className,\n multiple = true,\n size = \"md\",\n ...props\n}: AccordionRootProps) {\n return (\n <SizeContext.Provider value={size}>\n <BaseAccordion.Root\n multiple={multiple}\n data-size={size}\n className={cn(\"w-full\", className)}\n {...props}\n />\n </SizeContext.Provider>\n );\n}\n\n/**\n * One question, padded above and below, whatever is open inside. The\n * hairline under it overlaps the next item by its own pixel, the way\n * Framer draws a border inside the box, so an item advances by exactly\n * its padding and its rows: 68px at `lg`, the site's figure. The last\n * item draws none.\n */\nfunction Item({ className, ...props }: StyledProps<typeof BaseAccordion.Item>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Item\n className={cn(\n \"border-pho-secondary -mb-px border-b last:mb-0 last:border-b-0\",\n SIZE[size].item,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Header({\n className,\n ...props\n}: StyledProps<typeof BaseAccordion.Header>) {\n return <BaseAccordion.Header className={cn(\"flex\", className)} {...props} />;\n}\n\n/**\n * The question row: the question in medium with the chevron at the row's\n * end. The chevron is the site's small one (a 6.5×3.5 stroke in a 24px\n * box, weight 1.5) and the trigger wears it itself — pass only the\n * question. Open, the question settles to the description tone and the\n * chevron makes a half turn, both on the section spring; the chevron keeps\n * the primary ink. The whole item is the target, as on the site: the hit\n * area reaches through the item's padding above and below the row.\n */\nfunction Trigger({\n className,\n children,\n ...props\n}: StyledProps<typeof BaseAccordion.Trigger>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Trigger\n className={cn(\n \"group/trigger text-pho-primary outline-pho-brand relative flex flex-1 cursor-pointer items-center justify-between gap-3 text-left font-medium tracking-[-0.1px]\",\n \"ease-pho-spring-reveal data-[panel-open]:text-pho-description transition-colors duration-500\",\n \"focus-visible:outline-2 focus-visible:outline-offset-4\",\n \"before:absolute before:inset-x-0\",\n SIZE[size].question,\n SIZE[size].hit,\n className,\n )}\n {...props}\n >\n {children}\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n data-accordion-chevron=\"\"\n className=\"text-pho-primary ease-pho-spring-reveal size-6 shrink-0 transition-[rotate] duration-500 group-data-[panel-open]/trigger:rotate-180\"\n >\n <path d=\"M 6.5 0 L 3.25 3.5 L 0 0\" transform=\"translate(8.75 10.75)\" />\n </svg>\n </BaseAccordion.Trigger>\n );\n}\n\n/**\n * The answer: medium in the primary ink, one type step under the\n * question, a short gap below it. Opening, the panel's height rides the\n * section spring while the answer arrives 100ms later on the appear\n * spring, fading in as it rises 20px. Closing, the answer is gone at once\n * and the height settles on the section spring — the site's way round.\n */\nfunction Panel({\n className,\n children,\n ...props\n}: StyledProps<typeof BaseAccordion.Panel>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Panel\n className={cn(\n \"group/panel ease-pho-spring-reveal h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-500\",\n \"data-[ending-style]:h-0 data-[starting-style]:h-0\",\n className,\n )}\n {...props}\n >\n {/* The gap and the clip live on one wrapper, the rise on another:\n the panel measures its height from layout, and a translated\n child would count its 20px of overflow into that measure. */}\n <div className={cn(\"overflow-clip\", SIZE[size].gap)}>\n <div\n data-accordion-answer=\"\"\n className={cn(\n \"text-pho-primary font-medium tracking-[-0.1px]\",\n \"ease-pho-spring-appear transition-[opacity,translate] delay-100 duration-700\",\n \"group-data-[starting-style]/panel:translate-y-5 group-data-[starting-style]/panel:opacity-0\",\n \"group-data-[ending-style]/panel:opacity-0 group-data-[ending-style]/panel:transition-none\",\n SIZE[size].answer,\n )}\n >\n {children}\n </div>\n </div>\n </BaseAccordion.Panel>\n );\n}\n\n/**\n * Questions that each reveal an answer — photon.codes's FAQ, as a\n * component, built on Base UI `Accordion`. Each `Accordion.Item` needs a\n * `value`; control the open set with `value` / `onValueChange` or\n * `defaultValue`. Items are independent by default; `multiple={false}`\n * opens one at a time. Three sizes; `lg` is the site's.\n */\nexport const Accordion = { Root, Item, Header, Trigger, Panel };\n"],"mappings":";;;;;AA2BA,IAAM,IAGF;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACF,GAEM,IAAc,EAA6B,IAAI;AAgBrD,SAAS,EAAK,EACZ,WAAA,GACA,UAAA,IAAW,IACX,MAAA,IAAO,MACP,GAAG,EAAA,GACkB;AACrB,SACE,gBAAA,EAAC,EAAY,UAAb;AAAA,IAAsB,OAAO;AAAA,IAC3B,UAAA,gBAAA,EAAC,EAAc,MAAf;AAAA,MACY,UAAA;AAAA,MACV,aAAW;AAAA,MACX,WAAW,EAAG,UAAU,CAAS;AAAA,MACjC,GAAI;AAAA,IACL,CAAA;AAAA,EACmB,CAAA;AAE1B;AASA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAAiD;AAC7E,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,MAAf;AAAA,IACE,WAAW,EACT,kEACA,EAAK,CAAA,EAAM,MACX,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAO,EACd,WAAA,GACA,GAAG,EAAA,GACwC;AAC3C,SAAO,gBAAA,EAAC,EAAc,QAAf;AAAA,IAAsB,WAAW,EAAG,QAAQ,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAC7E;AAWA,SAAS,EAAQ,EACf,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACyC;AAC5C,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,SAAf;AAAA,IACE,WAAW,EACT,mKACA,gGACA,0DACA,oCACA,EAAK,CAAA,EAAM,UACX,EAAK,CAAA,EAAM,KACX,CACF;AAAA,IACA,GAAI;AAAA,IAVN,UAAA,CAYG,GACD,gBAAA,EAAC,OAAD;AAAA,MACE,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,0BAAuB;AAAA,MACvB,WAAU;AAAA,MAEV,UAAA,gBAAA,EAAC,QAAD;AAAA,QAAM,GAAE;AAAA,QAA2B,WAAU;AAAA,MAAyB,CAAA;AAAA,IACnE,CAAA,CACgB;AAAA;AAE3B;AASA,SAAS,EAAM,EACb,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACuC;AAC1C,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,OAAf;AAAA,IACE,WAAW,EACT,yHACA,qDACA,CACF;AAAA,IACA,GAAI;AAAA,
|
|
1
|
+
{"version":3,"file":"accordion.js","names":[],"sources":["../../src/components/accordion/accordion.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type ElementType,\n} from \"react\";\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { cn } from \"../../utils/cn\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\nexport type AccordionSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * Three sizes, one step of the type scale apart. `lg` is photon.codes's\n * FAQ to the pixel: the question at 20/28, the answer at 18/28, 20px\n * above and below, 8px between. `md` and `sm` step the type, the\n * padding, and the gap down together; the chevron is the same small\n * glyph in the same 24px box at every size, so a row is never shorter\n * than it.\n */\nconst SIZE: Record<\n AccordionSize,\n { item: string; hit: string; question: string; gap: string; answer: string }\n> = {\n sm: {\n item: \"py-3\",\n hit: \"before:-top-3 before:-bottom-3\",\n question: \"text-base\",\n gap: \"pt-1 pb-1\",\n answer: \"text-xs\",\n },\n md: {\n item: \"py-4\",\n hit: \"before:-top-4 before:-bottom-4\",\n question: \"text-md\",\n gap: \"pt-1.5 pb-1.5\",\n answer: \"text-base\",\n },\n lg: {\n item: \"py-5\",\n hit: \"before:-top-5 before:-bottom-5\",\n question: \"text-xl leading-7\",\n gap: \"pt-2 pb-2\",\n answer: \"text-lg\",\n },\n};\n\nconst SizeContext = createContext<AccordionSize>(\"md\");\n\nexport interface AccordionRootProps extends StyledProps<\n typeof BaseAccordion.Root\n> {\n /** @default \"md\" */\n size?: AccordionSize;\n}\n\n/**\n * The list — bare, so the page decides the surface: on photon.codes the\n * FAQ card is the section's, 32px around the list; in a settings page it\n * is a `Card`. Items divide with a hairline and the list has no outer\n * lines. Items are independent, as on the site, so `multiple` is on\n * unless said otherwise.\n */\nfunction Root({\n className,\n multiple = true,\n size = \"md\",\n ...props\n}: AccordionRootProps) {\n return (\n <SizeContext.Provider value={size}>\n <BaseAccordion.Root\n multiple={multiple}\n data-size={size}\n className={cn(\"w-full\", className)}\n {...props}\n />\n </SizeContext.Provider>\n );\n}\n\n/**\n * One question, padded above and below, whatever is open inside. The\n * hairline under it overlaps the next item by its own pixel, the way\n * Framer draws a border inside the box, so an item advances by exactly\n * its padding and its rows: 68px at `lg`, the site's figure. The last\n * item draws none.\n */\nfunction Item({ className, ...props }: StyledProps<typeof BaseAccordion.Item>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Item\n className={cn(\n \"border-pho-secondary -mb-px border-b last:mb-0 last:border-b-0\",\n SIZE[size].item,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Header({\n className,\n ...props\n}: StyledProps<typeof BaseAccordion.Header>) {\n return <BaseAccordion.Header className={cn(\"flex\", className)} {...props} />;\n}\n\n/**\n * The question row: the question in medium with the chevron at the row's\n * end. The chevron is the site's small one (a 6.5×3.5 stroke in a 24px\n * box, weight 1.5) and the trigger wears it itself — pass only the\n * question. Open, the question settles to the description tone and the\n * chevron makes a half turn, both on the section spring; the chevron keeps\n * the primary ink. The whole item is the target, as on the site: the hit\n * area reaches through the item's padding above and below the row.\n */\nfunction Trigger({\n className,\n children,\n ...props\n}: StyledProps<typeof BaseAccordion.Trigger>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Trigger\n className={cn(\n \"group/trigger text-pho-primary outline-pho-brand relative flex flex-1 cursor-pointer items-center justify-between gap-3 text-left font-medium tracking-[-0.1px]\",\n \"ease-pho-spring-reveal data-[panel-open]:text-pho-description transition-colors duration-500\",\n \"focus-visible:outline-2 focus-visible:outline-offset-4\",\n \"before:absolute before:inset-x-0\",\n SIZE[size].question,\n SIZE[size].hit,\n className,\n )}\n {...props}\n >\n {children}\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n data-accordion-chevron=\"\"\n className=\"text-pho-primary ease-pho-spring-reveal size-6 shrink-0 transition-[rotate] duration-500 group-data-[panel-open]/trigger:rotate-180\"\n >\n <path d=\"M 6.5 0 L 3.25 3.5 L 0 0\" transform=\"translate(8.75 10.75)\" />\n </svg>\n </BaseAccordion.Trigger>\n );\n}\n\n/**\n * The answer: medium in the primary ink, one type step under the\n * question, a short gap below it. Opening, the panel's height rides the\n * section spring while the answer arrives 100ms later on the appear\n * spring, fading in as it rises 20px. Closing, the answer is gone at once\n * and the height settles on the section spring — the site's way round.\n */\nfunction Panel({\n className,\n children,\n ...props\n}: StyledProps<typeof BaseAccordion.Panel>) {\n const size = useContext(SizeContext);\n return (\n <BaseAccordion.Panel\n className={cn(\n \"group/panel ease-pho-spring-reveal h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-500\",\n \"data-[ending-style]:h-0 data-[starting-style]:h-0\",\n className,\n )}\n {...props}\n >\n {/* The gap is symmetric: the panel clips, so the answer's last line\n needs room below it for a link's focus ring, not just above.\n The gap and the clip live on one wrapper, the rise on another:\n the panel measures its height from layout, and a translated\n child would count its 20px of overflow into that measure. */}\n <div className={cn(\"overflow-clip\", SIZE[size].gap)}>\n <div\n data-accordion-answer=\"\"\n className={cn(\n \"text-pho-primary font-medium tracking-[-0.1px]\",\n \"ease-pho-spring-appear transition-[opacity,translate] delay-100 duration-700\",\n \"group-data-[starting-style]/panel:translate-y-5 group-data-[starting-style]/panel:opacity-0\",\n \"group-data-[ending-style]/panel:opacity-0 group-data-[ending-style]/panel:transition-none\",\n SIZE[size].answer,\n )}\n >\n {children}\n </div>\n </div>\n </BaseAccordion.Panel>\n );\n}\n\n/**\n * Questions that each reveal an answer — photon.codes's FAQ, as a\n * component, built on Base UI `Accordion`. Each `Accordion.Item` needs a\n * `value`; control the open set with `value` / `onValueChange` or\n * `defaultValue`. Items are independent by default; `multiple={false}`\n * opens one at a time. Three sizes; `lg` is the site's.\n */\nexport const Accordion = { Root, Item, Header, Trigger, Panel };\n"],"mappings":";;;;;AA2BA,IAAM,IAGF;AAAA,EACF,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AAAA,EACA,IAAI;AAAA,IACF,MAAM;AAAA,IACN,KAAK;AAAA,IACL,UAAU;AAAA,IACV,KAAK;AAAA,IACL,QAAQ;AAAA,EACV;AACF,GAEM,IAAc,EAA6B,IAAI;AAgBrD,SAAS,EAAK,EACZ,WAAA,GACA,UAAA,IAAW,IACX,MAAA,IAAO,MACP,GAAG,EAAA,GACkB;AACrB,SACE,gBAAA,EAAC,EAAY,UAAb;AAAA,IAAsB,OAAO;AAAA,IAC3B,UAAA,gBAAA,EAAC,EAAc,MAAf;AAAA,MACY,UAAA;AAAA,MACV,aAAW;AAAA,MACX,WAAW,EAAG,UAAU,CAAS;AAAA,MACjC,GAAI;AAAA,IACL,CAAA;AAAA,EACmB,CAAA;AAE1B;AASA,SAAS,EAAK,EAAE,WAAA,GAAW,GAAG,EAAA,GAAiD;AAC7E,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,MAAf;AAAA,IACE,WAAW,EACT,kEACA,EAAK,CAAA,EAAM,MACX,CACF;AAAA,IACA,GAAI;AAAA,EACL,CAAA;AAEL;AAEA,SAAS,EAAO,EACd,WAAA,GACA,GAAG,EAAA,GACwC;AAC3C,SAAO,gBAAA,EAAC,EAAc,QAAf;AAAA,IAAsB,WAAW,EAAG,QAAQ,CAAS;AAAA,IAAG,GAAI;AAAA,EAAQ,CAAA;AAC7E;AAWA,SAAS,EAAQ,EACf,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACyC;AAC5C,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,SAAf;AAAA,IACE,WAAW,EACT,mKACA,gGACA,0DACA,oCACA,EAAK,CAAA,EAAM,UACX,EAAK,CAAA,EAAM,KACX,CACF;AAAA,IACA,GAAI;AAAA,IAVN,UAAA,CAYG,GACD,gBAAA,EAAC,OAAD;AAAA,MACE,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAa;AAAA,MACb,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,0BAAuB;AAAA,MACvB,WAAU;AAAA,MAEV,UAAA,gBAAA,EAAC,QAAD;AAAA,QAAM,GAAE;AAAA,QAA2B,WAAU;AAAA,MAAyB,CAAA;AAAA,IACnE,CAAA,CACgB;AAAA;AAE3B;AASA,SAAS,EAAM,EACb,WAAA,GACA,UAAA,GACA,GAAG,EAAA,GACuC;AAC1C,QAAM,IAAO,EAAW,CAAW;AACnC,SACE,gBAAA,EAAC,EAAc,OAAf;AAAA,IACE,WAAW,EACT,yHACA,qDACA,CACF;AAAA,IACA,GAAI;AAAA,IAOJ,UAAA,gBAAA,EAAC,OAAD;AAAA,MAAK,WAAW,EAAG,iBAAiB,EAAK,CAAA,EAAM,GAAG;AAAA,MAChD,UAAA,gBAAA,EAAC,OAAD;AAAA,QACE,yBAAsB;AAAA,QACtB,WAAW,EACT,kDACA,gFACA,+FACA,6FACA,EAAK,CAAA,EAAM,MACb;AAAA,QAEC,UAAA;AAAA,MACE,CAAA;AAAA,IACF,CAAA;AAAA,EACc,CAAA;AAEzB;AASA,IAAa,IAAY;AAAA,EAAE,MAAA;AAAA,EAAM,MAAA;AAAA,EAAM,QAAA;AAAA,EAAQ,SAAA;AAAA,EAAS,OAAA;AAAM"}
|
package/dist/components/card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, i as t, n as o, o as r, r as s, t as c } from "../chunks/data-table-
|
|
2
|
+
import { a as e, i as t, n as o, o as r, r as s, t as c } from "../chunks/data-table-Mog6m3d9.js";
|
|
3
3
|
import { t as T } from "../chunks/ghost-search-AmVXd0zE.js";
|
|
4
4
|
export {
|
|
5
5
|
c as DATA_TABLE_SURFACE,
|
package/dist/components/trace.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as s, B as e, C as i, D as n, E as l, F as r, I as t, L as o, M as p, N as c, O as T, P as u, R as I, S, T as m, V as d, _ as v, a as b, b as V, c as w, d as f, f as D, g as L, h as _, i as k, j as x, k as g, l as A, m as E, n as F, o as N, p as y, r as z, s as B, t as O, u as P, v as R, w as W, x as C, y as G, z as K } from "../chunks/trace-
|
|
2
|
+
import { A as s, B as e, C as i, D as n, E as l, F as r, I as t, L as o, M as p, N as c, O as T, P as u, R as I, S, T as m, V as d, _ as v, a as b, b as V, c as w, d as f, f as D, g as L, h as _, i as k, j as x, k as g, l as A, m as E, n as F, o as N, p as y, r as z, s as B, t as O, u as P, v as R, w as W, x as C, y as G, z as K } from "../chunks/trace-CjOi3_IP.js";
|
|
3
3
|
export {
|
|
4
4
|
i as FULL_VIEW,
|
|
5
5
|
y as GEN_AI_KINDS,
|
package/dist/index.js
CHANGED
|
@@ -9,22 +9,22 @@ import { n as b, t as F } from "./chunks/use-copy-D6JwKUll.js";
|
|
|
9
9
|
import "./utils.js";
|
|
10
10
|
import { a as h, c as k, d as v, i as w, l as W, n as x, o as H, r as y, s as z, t as K, u as X } from "./chunks/button-CdqS_t5a.js";
|
|
11
11
|
import { a as Z, c as j, i as J, l as Q, n as q, o as $, r as aa, s as sa, t as ta } from "./chunks/error-BAQgnde7.js";
|
|
12
|
-
import { A as oa, B as ea, C as ia, D as Ea, E as Sa, F as _a, I as na, L as ma, M as Ia, N as Ta, O as pa, P as Aa, R as Ra, S as la, T as Ca, V as Ba, _ as fa, a as Na, b as Pa, c as ua, d as La, f as ca, g as Da, h as Oa, i as Va, j as da, k as Ua, l as Ga, m as ba, n as Fa, o as Ma, p as ga, r as ha, s as ka, t as va, u as wa, v as Wa, w as xa, x as Ha, y as ya, z as za } from "./chunks/trace-
|
|
13
|
-
import { n as Xa, t as Ya } from "./chunks/date-picker-
|
|
12
|
+
import { A as oa, B as ea, C as ia, D as Ea, E as Sa, F as _a, I as na, L as ma, M as Ia, N as Ta, O as pa, P as Aa, R as Ra, S as la, T as Ca, V as Ba, _ as fa, a as Na, b as Pa, c as ua, d as La, f as ca, g as Da, h as Oa, i as Va, j as da, k as Ua, l as Ga, m as ba, n as Fa, o as Ma, p as ga, r as ha, s as ka, t as va, u as wa, v as Wa, w as xa, x as Ha, y as ya, z as za } from "./chunks/trace-CjOi3_IP.js";
|
|
13
|
+
import { n as Xa, t as Ya } from "./chunks/date-picker-CZbcNIe-.js";
|
|
14
14
|
import { n as ja, t as Ja } from "./chunks/copy-button-B_B15mEi.js";
|
|
15
|
-
import { a as qa, c as $a, d as as, i as ss, l as ts, n as rs, o as os, r as es, s as is, t as Es, u as Ss } from "./chunks/sidebar-
|
|
15
|
+
import { a as qa, c as $a, d as as, i as ss, l as ts, n as rs, o as os, r as es, s as is, t as Es, u as Ss } from "./chunks/sidebar-bLsjo_yb.js";
|
|
16
16
|
import { t as ns } from "./chunks/input-DjvZoF8v.js";
|
|
17
|
-
import { i as Is, n as Ts, r as ps, t as As } from "./chunks/filter-bar-
|
|
18
|
-
import { a as ls } from "./chunks/data-table-
|
|
17
|
+
import { i as Is, n as Ts, r as ps, t as As } from "./chunks/filter-bar-Cr_1zBFq.js";
|
|
18
|
+
import { a as ls } from "./chunks/data-table-Mog6m3d9.js";
|
|
19
19
|
import { n as Bs, t as fs } from "./chunks/code-block-BuDIo8Q0.js";
|
|
20
20
|
import { n as Ps, t as us } from "./chunks/stat-hnNqjWVG.js";
|
|
21
21
|
import { t as cs } from "./chunks/calendar-4OFiCLAv.js";
|
|
22
22
|
import { t as Os } from "./chunks/close-button-GvqWbLl0.js";
|
|
23
23
|
import { t as ds } from "./chunks/input-group-fc9_jD4d.js";
|
|
24
|
-
import { n as Gs, t as bs } from "./chunks/card-
|
|
25
|
-
import { n as Ms, t as gs } from "./chunks/dialog-
|
|
24
|
+
import { n as Gs, t as bs } from "./chunks/card-N-tvFsuV.js";
|
|
25
|
+
import { n as Ms, t as gs } from "./chunks/dialog-BOz_xOrn.js";
|
|
26
26
|
import { i as ks, n as vs, r as ws, t as Ws } from "./chunks/status-view-C8tabjDu.js";
|
|
27
|
-
import { a as Hs, c as ys, d as zs, f as Ks, i as Xs, l as Ys, m as Zs, n as js, o as Js, p as Qs, r as qs, s as $s, t as at, u as st } from "./chunks/basic-page-
|
|
27
|
+
import { a as Hs, c as ys, d as zs, f as Ks, i as Xs, l as Ys, m as Zs, n as js, o as Js, p as Qs, r as qs, s as $s, t as at, u as st } from "./chunks/basic-page-OrUVXKrx.js";
|
|
28
28
|
import { i as rt, n as ot, r as et, t as it } from "./chunks/legend-C0mU7dqd.js";
|
|
29
29
|
import "./components/chart.js";
|
|
30
30
|
import { t as _t } from "./chunks/bar-chart-DIALC2_z.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as s } from "../chunks/data-table-
|
|
3
|
-
import { a as E, c as a, d as C, f as S, i as I, l as e, m as o, n as B, o as P, p as N, r, s as t, t as D, u as R } from "../chunks/basic-page-
|
|
2
|
+
import { a as s } from "../chunks/data-table-Mog6m3d9.js";
|
|
3
|
+
import { a as E, c as a, d as C, f as S, i as I, l as e, m as o, n as B, o as P, p as N, r, s as t, t as D, u as R } from "../chunks/basic-page-OrUVXKrx.js";
|
|
4
4
|
export {
|
|
5
5
|
D as AUTO_SAVE_DELAY_MS,
|
|
6
6
|
B as BASIC_PAGE_CALLOUT,
|
package/dist/sections/sidebar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as I, c as _, d as S, i as R, l as A, n as B, o as T, r as a, s, t as D, u as N } from "../chunks/sidebar-
|
|
2
|
+
import { a as I, c as _, d as S, i as R, l as A, n as B, o as T, r as a, s, t as D, u as N } from "../chunks/sidebar-bLsjo_yb.js";
|
|
3
3
|
export {
|
|
4
4
|
D as SIDEBAR_HEADER_INSET,
|
|
5
5
|
B as SIDEBAR_ITEM,
|
|
@@ -6,7 +6,10 @@ import { ComponentProps, Ref } from 'react';
|
|
|
6
6
|
* (menus, dialogs); see the same rule on Input and Select.
|
|
7
7
|
* - Radius sits at the `lg` stop (16px) like Dialog — a standalone content
|
|
8
8
|
* panel reads bigger than a control, so it takes the panel radius rather
|
|
9
|
-
* than the control default (`base`).
|
|
9
|
+
* than the control default (`base`). `overflow-hidden` clips with it:
|
|
10
|
+
* a flush `Stat.Group` (opaque tiles, `pt-0`) would otherwise paint
|
|
11
|
+
* square over the curve. The same clip is what makes an edge-to-edge
|
|
12
|
+
* image or table follow the panel, the way `BasicPage.Card` already does.
|
|
10
13
|
* - Vertical rhythm: `pt-5` / `pb-4`, `gap-4` between parts. Parts carry
|
|
11
14
|
* `px-5`, so a child without padding (an image, a table, a `Separator`)
|
|
12
15
|
* runs edge-to-edge on its own. A `Stat` / `Stat.Group` already pads
|
|
@@ -18,12 +21,16 @@ import { ComponentProps, Ref } from 'react';
|
|
|
18
21
|
* tone. Sizing belongs to the layout that places the card.
|
|
19
22
|
*/
|
|
20
23
|
/** Surface chrome — exported for hosts that need the look on another element. */
|
|
21
|
-
export declare const CARD_SURFACE = "border-pho-secondary bg-pho-primary rounded-lg border";
|
|
24
|
+
export declare const CARD_SURFACE = "border-pho-secondary bg-pho-primary overflow-hidden rounded-lg border";
|
|
22
25
|
/** The panel: bordered surface, vertical rhythm between parts. */
|
|
23
26
|
declare function Root({ className, ...props }: ComponentProps<"div"> & {
|
|
24
27
|
ref?: Ref<HTMLDivElement>;
|
|
25
28
|
}): import("react").JSX.Element;
|
|
26
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Title row + optional description. The title and a trailing `Value`
|
|
31
|
+
* share the first line; the description sits on the next with no row
|
|
32
|
+
* gap — title and subtitle read as one block.
|
|
33
|
+
*/
|
|
27
34
|
declare function Header({ className, ...props }: ComponentProps<"div"> & {
|
|
28
35
|
ref?: Ref<HTMLDivElement>;
|
|
29
36
|
}): import("react").JSX.Element;
|
|
@@ -34,7 +41,14 @@ declare function Header({ className, ...props }: ComponentProps<"div"> & {
|
|
|
34
41
|
declare function Title({ className, children, ...props }: ComponentProps<"h3"> & {
|
|
35
42
|
ref?: Ref<HTMLHeadingElement>;
|
|
36
43
|
}): import("react").JSX.Element;
|
|
37
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* A count or figure at the end of the title row. One display step above
|
|
46
|
+
* the title, primary ink — the number is the loud thing on the line.
|
|
47
|
+
*/
|
|
48
|
+
declare function Value({ className, ...props }: ComponentProps<"div"> & {
|
|
49
|
+
ref?: Ref<HTMLDivElement>;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
/** Supporting copy under the title — Dialog's description: same step, description ink. */
|
|
38
52
|
declare function Description({ className, ...props }: ComponentProps<"p"> & {
|
|
39
53
|
ref?: Ref<HTMLParagraphElement>;
|
|
40
54
|
}): import("react").JSX.Element;
|
|
@@ -59,6 +73,7 @@ declare function Footer({ className, ...props }: ComponentProps<"div"> & {
|
|
|
59
73
|
* <Card.Root>
|
|
60
74
|
* <Card.Header>
|
|
61
75
|
* <Card.Title>Usage</Card.Title>
|
|
76
|
+
* <Card.Value>1.2k</Card.Value>
|
|
62
77
|
* <Card.Description>Since Aug 1.</Card.Description>
|
|
63
78
|
* </Card.Header>
|
|
64
79
|
* <Card.Content>…</Card.Content>
|
|
@@ -72,6 +87,7 @@ export declare const Card: {
|
|
|
72
87
|
Root: typeof Root;
|
|
73
88
|
Header: typeof Header;
|
|
74
89
|
Title: typeof Title;
|
|
90
|
+
Value: typeof Value;
|
|
75
91
|
Description: typeof Description;
|
|
76
92
|
Content: typeof Content;
|
|
77
93
|
Footer: typeof Footer;
|
|
@@ -5,7 +5,7 @@ type StyledProps<T extends ElementType> = Omit<ComponentProps<T>, "className"> &
|
|
|
5
5
|
className?: string;
|
|
6
6
|
};
|
|
7
7
|
declare function Trigger({ className, ...props }: StyledProps<typeof BaseCollapsible.Trigger>): import("react").JSX.Element;
|
|
8
|
-
declare function Panel({ className, ...props }: StyledProps<typeof BaseCollapsible.Panel>): import("react").JSX.Element;
|
|
8
|
+
declare function Panel({ className, onTransitionRun, onTransitionEnd, onTransitionCancel, ...props }: StyledProps<typeof BaseCollapsible.Panel>): import("react").JSX.Element;
|
|
9
9
|
/**
|
|
10
10
|
* Show/hide a region of content, built on Base UI `Collapsible` with a smooth
|
|
11
11
|
* height animation. Control with `open` / `onOpenChange` or leave uncontrolled
|
|
@@ -34,6 +34,10 @@ export interface DatePickerPreset<T> {
|
|
|
34
34
|
label: string;
|
|
35
35
|
value: T | (() => T);
|
|
36
36
|
}
|
|
37
|
+
/** Extra about a change — present when the value came from a named window. */
|
|
38
|
+
export interface DatePickerChangeDetails<T> {
|
|
39
|
+
preset: DatePickerPreset<T>;
|
|
40
|
+
}
|
|
37
41
|
interface DatePickerBaseProps {
|
|
38
42
|
/** Field label (associated for accessibility). */
|
|
39
43
|
label?: ReactNode;
|
|
@@ -75,13 +79,32 @@ interface DatePickerBaseProps {
|
|
|
75
79
|
id?: string;
|
|
76
80
|
/** Class applied to the trigger. */
|
|
77
81
|
className?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Accessible name when there is no visible label — a toolbar control
|
|
84
|
+
* beside a page title, which already says what the field is for.
|
|
85
|
+
*/
|
|
86
|
+
"aria-label"?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The named window the field should read. A page that already knows the
|
|
89
|
+
* name (`Last 24 hours` in the URL) passes it so a remount, and a rolling
|
|
90
|
+
* window recomputed each render, still write the name rather than the
|
|
91
|
+
* figures. The name drops the moment the value is no longer that window
|
|
92
|
+
* — a day picked by hand, or the page clearing this.
|
|
93
|
+
*/
|
|
94
|
+
selectedPreset?: string;
|
|
95
|
+
/**
|
|
96
|
+
* How the popover lines up with the field. A hug field on the right of a
|
|
97
|
+
* header wants `end`, so the calendar grows left instead of off-screen.
|
|
98
|
+
* @default "start"
|
|
99
|
+
*/
|
|
100
|
+
align?: "start" | "center" | "end";
|
|
78
101
|
}
|
|
79
102
|
export interface DatePickerSingleProps extends DatePickerBaseProps {
|
|
80
103
|
/** @default "single" */
|
|
81
104
|
mode?: "single";
|
|
82
105
|
value?: Date;
|
|
83
106
|
defaultValue?: Date;
|
|
84
|
-
onValueChange?: (value: Date | undefined) => void;
|
|
107
|
+
onValueChange?: (value: Date | undefined, details?: DatePickerChangeDetails<Date>) => void;
|
|
85
108
|
/** Named days offered beside the calendar. */
|
|
86
109
|
presets?: DatePickerPreset<Date>[];
|
|
87
110
|
}
|
|
@@ -89,7 +112,7 @@ export interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
|
89
112
|
mode: "range";
|
|
90
113
|
value?: DateRange;
|
|
91
114
|
defaultValue?: DateRange;
|
|
92
|
-
onValueChange?: (value: DateRange | undefined) => void;
|
|
115
|
+
onValueChange?: (value: DateRange | undefined, details?: DatePickerChangeDetails<DateRange>) => void;
|
|
93
116
|
/** Named windows offered beside the calendar — `Last 7 days`, and so on. */
|
|
94
117
|
presets?: DatePickerPreset<DateRange>[];
|
|
95
118
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, } from './date-picker';
|
|
1
|
+
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, type DatePickerPreset, type DatePickerChangeDetails, } from './date-picker';
|
|
2
2
|
export type { DateRange } from 'react-day-picker';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export * from './utils';
|
|
|
9
9
|
export * from './motion';
|
|
10
10
|
export * from './components/button';
|
|
11
11
|
export * from './components/calendar';
|
|
12
|
-
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, } from './components/date-picker';
|
|
12
|
+
export { DatePicker, formatDateLabel, type DatePickerProps, type DatePickerSingleProps, type DatePickerRangeProps, type DatePickerSize, type DatePickerPreset, type DatePickerChangeDetails, } from './components/date-picker';
|
|
13
13
|
export * from './components/input';
|
|
14
14
|
export * from './components/input-group';
|
|
15
15
|
export * from './components/card';
|
|
@@ -878,9 +878,9 @@ export interface BasicPageAsideProps {
|
|
|
878
878
|
onClose?: () => void;
|
|
879
879
|
/**
|
|
880
880
|
* How wide the panel is on a pane that can host it. `default` (unsaid)
|
|
881
|
-
* is two fifths of the pane, 20–28rem. `wide` is
|
|
882
|
-
* — a request body or a waterfall. Below `md` the subpage is
|
|
883
|
-
* and this does not apply.
|
|
881
|
+
* is two fifths of the pane, 20–28rem. `wide` is two thirds of the pane,
|
|
882
|
+
* 28–48rem — a request body or a waterfall. Below `md` the subpage is
|
|
883
|
+
* the page and this does not apply.
|
|
884
884
|
*/
|
|
885
885
|
width?: BasicPageAsideWidth;
|
|
886
886
|
/**
|
|
@@ -923,8 +923,8 @@ export interface BasicPageAsideProps {
|
|
|
923
923
|
* steps aside, the subpage takes the pane with its own `Back` — so one
|
|
924
924
|
* subpage component serves both. Works under either `Root` width: the
|
|
925
925
|
* page keeps its own column cap beside the panel, and leftover space is
|
|
926
|
-
* margin. `width="wide"` opens the panel itself (
|
|
927
|
-
*
|
|
926
|
+
* margin. `width="wide"` opens the panel itself (two thirds of the pane,
|
|
927
|
+
* up to 48rem); the page's column cap does not follow.
|
|
928
928
|
*
|
|
929
929
|
* Panel or page is presentation, not routing: the URL is the subpage's
|
|
930
930
|
* either way. Left to itself the aside reads how it was reached — a
|
|
@@ -4,6 +4,12 @@ import { ValueAnimationTransition } from 'motion/react';
|
|
|
4
4
|
* Animates its own height to follow the measured height of `children`, so
|
|
5
5
|
* content swaps (search filtering, skeleton → data) glide instead of jumping.
|
|
6
6
|
* Honors `prefers-reduced-motion` by snapping height with no spring.
|
|
7
|
+
*
|
|
8
|
+
* The container clips only while the spring is in flight. ResizeObserver
|
|
9
|
+
* callbacks run after layout but before paint, so the clip lands before the
|
|
10
|
+
* swap frame can show; once the spring settles it is lifted again, so a focus
|
|
11
|
+
* ring, an effect button's rim, or any other overhang on the last row paints
|
|
12
|
+
* normally at rest instead of being cut off at the container's edge.
|
|
7
13
|
*/
|
|
8
14
|
export declare function AnimatedHeight({ className, transition, children, }: {
|
|
9
15
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { SPRING_SETTLE as v } from "../motion.js";
|
|
3
|
-
import { useEffect as R, useRef as a } from "react";
|
|
4
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
5
|
-
import { animate as x, motion as S, useMotionValue as g, useReducedMotion as E } from "motion/react";
|
|
6
|
-
var H = v;
|
|
7
|
-
function N({ className: d, transition: r, children: p }) {
|
|
8
|
-
const s = a(null), i = a(null), t = g("auto"), c = E();
|
|
9
|
-
return R(() => {
|
|
10
|
-
const h = s.current, o = i.current;
|
|
11
|
-
if (!h || !o) return;
|
|
12
|
-
let e = null;
|
|
13
|
-
const u = new ResizeObserver((b) => {
|
|
14
|
-
const l = b[0]?.borderBoxSize?.[0], n = l ? l.blockSize : o.offsetHeight, f = t.get();
|
|
15
|
-
if (f === "auto" || c) {
|
|
16
|
-
e?.stop(), e = null, t.set(n);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
!e && Math.abs(f - n) < 0.5 || (e?.stop(), e = x(t, n, {
|
|
20
|
-
...r ?? H,
|
|
21
|
-
onComplete: () => {
|
|
22
|
-
e = null;
|
|
23
|
-
}
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
return u.observe(o), () => {
|
|
27
|
-
u.disconnect(), e?.stop();
|
|
28
|
-
};
|
|
29
|
-
}, [
|
|
30
|
-
t,
|
|
31
|
-
c,
|
|
32
|
-
r
|
|
33
|
-
]), /* @__PURE__ */ m(S.div, {
|
|
34
|
-
ref: s,
|
|
35
|
-
className: "min-h-0 overflow-hidden",
|
|
36
|
-
style: { height: t },
|
|
37
|
-
children: /* @__PURE__ */ m("div", {
|
|
38
|
-
ref: i,
|
|
39
|
-
className: d,
|
|
40
|
-
children: p
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
N as t
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=animated-height-CCO-Ocoz.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animated-height-CCO-Ocoz.js","names":[],"sources":["../../src/utils/animated-height.tsx"],"sourcesContent":["import { useEffect, useRef, type ReactNode } from \"react\";\nimport { SPRING_SETTLE } from \"../motion\";\nimport {\n animate,\n motion,\n useMotionValue,\n useReducedMotion,\n type ValueAnimationTransition,\n} from \"motion/react\";\n\n/**\n * Height spring for container-size transitions — same feel as the onboarding /\n * invite card and BasicPage footer reveal: quick, critically damped (no\n * overshoot that would flash clipped content).\n */\nconst HEIGHT_SPRING = SPRING_SETTLE;\n\n/**\n * Animates its own height to follow the measured height of `children`, so\n * content swaps (search filtering, skeleton → data) glide instead of jumping.\n * Honors `prefers-reduced-motion` by snapping height with no spring.\n */\nexport function AnimatedHeight({\n className,\n transition,\n children,\n}: {\n className?: string;\n /** Spring override for the height follow. @default the Command spring */\n transition?: ValueAnimationTransition<number | \"auto\">;\n children: ReactNode;\n}) {\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const height = useMotionValue<number | \"auto\">(\"auto\");\n const reduceMotion = useReducedMotion();\n\n useEffect(() => {\n const container = containerRef.current;\n const content = contentRef.current;\n if (!container || !content) return;\n\n let animation: ReturnType<typeof animate> | null = null;\n\n const observer = new ResizeObserver((entries) => {\n const box = entries[0]?.borderBoxSize?.[0];\n const next = box ? box.blockSize : content.offsetHeight;\n const current = height.get();\n if (current === \"auto\" || reduceMotion) {\n animation?.stop();\n animation = null;\n height.set(next);\n return;\n }\n if (!animation && Math.abs(current - next) < 0.5) return;\n animation?.stop();\n animation = animate(height, next, {\n ...(transition ?? HEIGHT_SPRING),\n onComplete: () => {\n animation = null;\n },\n });\n });\n observer.observe(content);\n\n return () => {\n observer.disconnect();\n animation?.stop();\n };\n }, [height, reduceMotion, transition]);\n\n return (\n <motion.div\n ref={containerRef}\n // Stack (and other flex parents) set `min-height: auto` on children,\n // which sizes to content and swallows the height spring. Clip and\n // allow shrinking so the measured height can actually animate.\n className=\"min-h-0 overflow-hidden\"\n style={{ height }}\n >\n <div ref={contentRef} className={className}>\n {children}\n </div>\n </motion.div>\n );\n}\n"],"mappings":";;;;;AAeA,IAAM,IAAgB;AAOtB,SAAgB,EAAe,EAC7B,WAAA,GACA,YAAA,GACA,UAAA,EAAA,GAMC;AACD,QAAM,IAAe,EAAuB,IAAI,GAC1C,IAAa,EAAuB,IAAI,GACxC,IAAS,EAAgC,MAAM,GAC/C,IAAe,EAAiB;AAEtC,SAAA,EAAA,MAAgB;AACd,UAAM,IAAY,EAAa,SACzB,IAAU,EAAW;AAC3B,QAAI,CAAC,KAAa,CAAC,EAAS;AAE5B,QAAI,IAA+C;AAEnD,UAAM,IAAW,IAAI,eAAA,CAAgB,MAAY;AAC/C,YAAM,IAAM,EAAQ,CAAA,GAAI,gBAAgB,CAAA,GAClC,IAAO,IAAM,EAAI,YAAY,EAAQ,cACrC,IAAU,EAAO,IAAI;AAC3B,UAAI,MAAY,UAAU,GAAc;AACtC,QAAA,GAAW,KAAK,GAChB,IAAY,MACZ,EAAO,IAAI,CAAI;AACf;AAAA,MACF;AACA,MAAI,CAAC,KAAa,KAAK,IAAI,IAAU,CAAI,IAAI,QAC7C,GAAW,KAAK,GAChB,IAAY,EAAQ,GAAQ,GAAM;AAAA,QAChC,GAAI,KAAc;AAAA,QAClB,YAAA,MAAkB;AAChB,UAAA,IAAY;AAAA,QACd;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AACD,WAAA,EAAS,QAAQ,CAAO,GAExB,MAAa;AACX,MAAA,EAAS,WAAW,GACpB,GAAW,KAAK;AAAA,IAClB;AAAA,EACF,GAAG;AAAA,IAAC;AAAA,IAAQ;AAAA,IAAc;AAAA,EAAU,CAAC,GAGnC,gBAAA,EAAC,EAAO,KAAR;AAAA,IACE,KAAK;AAAA,IAIL,WAAU;AAAA,IACV,OAAO,EAAE,QAAA,EAAO;AAAA,IAEhB,UAAA,gBAAA,EAAC,OAAD;AAAA,MAAK,KAAK;AAAA,MAAuB,WAAA;AAAA,MAC9B,UAAA;AAAA,IACE,CAAA;AAAA,EACK,CAAA;AAEhB"}
|