@stackone/malachite 2.123.0 → 2.124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/COMPONENTS.md +4 -3
  2. package/dist/ShadowRootWrapper.js +22 -22
  3. package/dist/ShadowRootWrapper.js.map +1 -1
  4. package/dist/components/ActionMenu.js +4 -3
  5. package/dist/components/ActionMenu.js.map +1 -1
  6. package/dist/components/Card.js +88 -78
  7. package/dist/components/Card.js.map +1 -1
  8. package/dist/components/Flex.js +10 -8
  9. package/dist/components/Flex.js.map +1 -1
  10. package/dist/components/FrameHeader.js +26 -19
  11. package/dist/components/FrameHeader.js.map +1 -1
  12. package/dist/components/PageLayout/index.js +8 -7
  13. package/dist/components/PageLayout/index.js.map +1 -1
  14. package/dist/components/PageLayout/pageColumns.js +23 -0
  15. package/dist/components/PageLayout/pageColumns.js.map +1 -0
  16. package/dist/components/Table/Table.js +491 -472
  17. package/dist/components/Table/Table.js.map +1 -1
  18. package/dist/components/ToastProvider.js +32 -42
  19. package/dist/components/ToastProvider.js.map +1 -1
  20. package/dist/components/Typography/PathText.js +48 -55
  21. package/dist/components/Typography/PathText.js.map +1 -1
  22. package/dist/components/VisuallyHidden.js +8 -0
  23. package/dist/components/VisuallyHidden.js.map +1 -0
  24. package/dist/components/actionMenuStyles.js +33 -42
  25. package/dist/components/actionMenuStyles.js.map +1 -1
  26. package/dist/components/flexTypes.js +1 -1
  27. package/dist/components/flexTypes.js.map +1 -1
  28. package/dist/components/visuallyHiddenStyle.js +16 -0
  29. package/dist/components/visuallyHiddenStyle.js.map +1 -0
  30. package/dist/index.d.ts +32 -0
  31. package/dist/index.js +394 -392
  32. package/dist/index.js.map +1 -1
  33. package/dist/tailwind.css.js +1 -1
  34. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../src/components/Card.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport FrameHeader, { HeaderRow } from './FrameHeader';\nimport { FRAME_CLASS, FRAME_SECTION_STYLE, frameToneBackground } from './frameStyles';\nimport { GLASS_SURFACE_STYLE } from './glassSurface';\nimport { hasHeaderContent } from './headerContent';\nimport type { ModalTrayTone } from './modalTray';\nimport { FOREGROUND_RESET } from './selectedRow';\n\n/**\n * `framed` draws the detached Table's frame: the title row sits on a grey frame and the children\n * in a bordered section inside it, so a card above a table reads as part of the same set.\n * `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to it.\n */\nexport type CardVariant = 'default' | 'framed';\nexport type CardTone = ModalTrayTone;\n\nexport interface CardProps {\n variant?: CardVariant;\n /** Only a framed card takes a tone; see `FramedCardProps`. */\n tone?: never;\n title?: string | React.ReactNode;\n /** Dimmed text beside the title, such as a count or a unit. */\n subtitle?: React.ReactNode;\n /** Actions at the right of the title row. */\n extra?: React.ReactNode;\n padding?: string;\n children?: React.ReactNode;\n size?: 'default' | 'small';\n width?: string;\n minWidth?: string;\n direction?: 'row' | 'column';\n align?: 'center';\n dimmed?: boolean;\n fullHeight?: boolean;\n border?: 'base' | 'rounded';\n alignSelf?: 'center';\n height?: string;\n footer?: React.ReactNode;\n glassFooter?: boolean;\n className?: string;\n style?: React.CSSProperties;\n headerConfig?: {\n padding?: string;\n };\n}\n\n/** A framed card, which alone takes a `tone`. A second interface so `CardProps` keeps its shape. */\nexport interface FramedCardProps extends Omit<CardProps, 'variant' | 'tone'> {\n variant: Extract<CardVariant, 'framed'>;\n /**\n * Paints the frame in the tray colour of the outcome it reports, as `Modal`'s `tray` does.\n * `neutral` keeps the default grey frame, so it still matches a detached Table.\n */\n tone?: CardTone;\n}\n\nexport type AnyCardProps = CardProps | FramedCardProps;\n\nconst PLAIN_LENGTH = /^\\d*\\.?\\d+(px|rem|em)$/;\n\n// Only plain positive lengths are copied: calc() and var() can't be split from a shorthand, and a\n// zero inset would put the title against the border, so those keep the header's own 12px.\nconst horizontalInset = (padding: string): React.CSSProperties | undefined => {\n const parts = padding.trim().split(/\\s+/);\n if (parts.length > 4 || !parts.every((part) => PLAIN_LENGTH.test(part))) {\n return undefined;\n }\n const [top, right = top, , left = right] = parts;\n return parseFloat(left) > 0 && parseFloat(right) > 0\n ? { paddingLeft: left, paddingRight: right }\n : undefined;\n};\n\nconst Card: React.FC<AnyCardProps> = ({\n variant = 'default',\n tone = 'neutral',\n title,\n subtitle,\n extra,\n children,\n padding = '20px',\n size = 'default',\n width,\n minWidth,\n dimmed = false,\n direction,\n align,\n fullHeight = false,\n border = 'base',\n alignSelf,\n height,\n footer,\n glassFooter = false,\n className = '',\n style = {},\n headerConfig = {},\n}) => {\n const footerRef = useRef<HTMLDivElement>(null);\n const [footerHeight, setFooterHeight] = useState(0);\n\n useEffect(() => {\n if (glassFooter && footer && footerRef.current) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setFooterHeight(entry.contentRect.height);\n }\n });\n\n observer.observe(footerRef.current);\n setFooterHeight(footerRef.current.offsetHeight);\n\n return () => observer.disconnect();\n }\n }, [glassFooter, footer]);\n\n // Size-specific padding\n const sizeClasses = size === 'small' ? 'text-sm' : '';\n\n // Dynamic classes based on props\n const cardClasses = [\n 'card-base',\n dimmed ? 'card-dimmed' : '',\n border === 'rounded' ? 'card-rounded' : '',\n fullHeight ? 'h-full' : '',\n height ? 'flex flex-col' : '',\n sizeClasses,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const headerInset = headerConfig?.padding ? undefined : horizontalInset(padding);\n\n // Content styles\n const paddingValue = parseInt(padding) || 20;\n const extraPadding = 10;\n const contentStyles: React.CSSProperties = {\n padding,\n // The card clips overflow, so a long token in flowing text breaks rather than vanishing.\n // Flex and grid items keep their min-content width; those need their own wrapping.\n overflowWrap: 'break-word',\n display: direction ? 'flex' : undefined,\n flexDirection: direction,\n alignItems: align,\n ...(height && { overflow: 'auto', height: '100%' }),\n ...(glassFooter &&\n footer &&\n footerHeight > 0 && {\n paddingBottom: `${paddingValue + footerHeight + extraPadding}px`,\n }),\n };\n\n if (variant === 'framed') {\n return (\n <div\n className={`${FRAME_CLASS} flex flex-col ${className}`}\n style={{\n // The frame drops `card-base`, which carried the text colour.\n ...FOREGROUND_RESET,\n backgroundColor: frameToneBackground(tone),\n width,\n minWidth,\n alignSelf,\n ...(fullHeight && { height: '100%' }),\n ...(height && { height }),\n ...style,\n }}\n >\n {hasHeaderContent({ title, subtitle, extra }) && (\n <FrameHeader title={title} subtitle={subtitle} extra={extra} />\n )}\n <div\n className=\"min-h-0 flex-1\"\n style={{\n ...FRAME_SECTION_STYLE,\n padding,\n overflowWrap: 'break-word',\n display: direction ? 'flex' : undefined,\n flexDirection: direction,\n alignItems: align,\n ...(height && { overflow: 'auto' }),\n }}\n >\n {children}\n </div>\n {footer && <div className=\"px-4 py-3\">{footer}</div>}\n </div>\n );\n }\n\n // Card container styles\n const cardContainerStyles: React.CSSProperties = {\n width,\n minWidth,\n alignSelf,\n ...(fullHeight && { height: '100%' }),\n ...(height && { height, display: 'flex', flexDirection: 'column' }),\n ...(glassFooter && footer && { position: 'relative' }),\n overflow: 'hidden',\n ...style,\n };\n\n return (\n <div className={cardClasses} style={cardContainerStyles}>\n {/* Header */}\n {hasHeaderContent({ title, subtitle, extra }) && (\n <div\n className={headerInset ? 'card-header py-2' : 'card-header px-3 py-2'}\n style={{\n marginBottom: '1px',\n fontSize: size === 'small' ? '12px' : '13px',\n fontWeight: 'normal',\n ...(headerConfig?.padding\n ? { padding: headerConfig.padding }\n : headerInset),\n }}\n >\n <HeaderRow\n title={title}\n subtitle={subtitle}\n extra={extra}\n titleClassName=\"font-normal overflow-visible\"\n />\n </div>\n )}\n\n {/* Body */}\n <div\n className=\"flex-1\"\n style={{\n ...contentStyles,\n ...(glassFooter && footer && { position: 'relative' }),\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <div\n ref={glassFooter ? footerRef : undefined}\n className=\"card-footer px-4 py-3\"\n style={\n glassFooter\n ? {\n ...GLASS_SURFACE_STYLE,\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n borderBottomLeftRadius: border === 'rounded' ? '20px' : '12px',\n borderBottomRightRadius: border === 'rounded' ? '20px' : '12px',\n }\n : undefined\n }\n >\n {footer}\n </div>\n )}\n </div>\n );\n};\n\nexport default Card;\nexport { Card };\n"],"names":["PLAIN_LENGTH","horizontalInset","padding","parts","part","top","right","left","Card","variant","tone","title","subtitle","extra","children","size","width","minWidth","dimmed","direction","align","fullHeight","border","alignSelf","height","footer","glassFooter","className","style","headerConfig","footerRef","useRef","footerHeight","setFooterHeight","useState","useEffect","observer","entries","entry","cardClasses","headerInset","paddingValue","contentStyles","jsxs","FRAME_CLASS","FOREGROUND_RESET","frameToneBackground","hasHeaderContent","jsx","FrameHeader","FRAME_SECTION_STYLE","cardContainerStyles","HeaderRow","GLASS_SURFACE_STYLE"],"mappings":";;;;;;;AA0DA,MAAMA,IAAe,0BAIfC,IAAkB,CAACC,MAAqD;AAC1E,QAAMC,IAAQD,EAAQ,KAAA,EAAO,MAAM,KAAK;AACxC,MAAIC,EAAM,SAAS,KAAK,CAACA,EAAM,MAAM,CAACC,MAASJ,EAAa,KAAKI,CAAI,CAAC;AAClE;AAEJ,QAAM,CAACC,GAAKC,IAAQD,KAAOE,IAAOD,CAAK,IAAIH;AAC3C,SAAO,WAAWI,CAAI,IAAI,KAAK,WAAWD,CAAK,IAAI,IAC7C,EAAE,aAAaC,GAAM,cAAcD,MACnC;AACV,GAEME,KAA+B,CAAC;AAAA,EAClC,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAZ,IAAU;AAAA,EACV,MAAAa,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAC,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.tsx"],"sourcesContent":["import React, { useRef, useEffect, useState } from 'react';\nimport FrameHeader, { HeaderRow } from './FrameHeader';\nimport { FRAME_CLASS, FRAME_SECTION_STYLE, frameToneBackground } from './frameStyles';\nimport { GLASS_SURFACE_STYLE } from './glassSurface';\nimport { hasHeaderContent } from './headerContent';\nimport type { ModalTrayTone } from './modalTray';\nimport { FOREGROUND_RESET } from './selectedRow';\n\n/**\n * `framed` draws the detached Table's frame: the title row sits on a grey frame and the children\n * in a bordered section inside it, so a card above a table reads as part of the same set.\n * `dimmed`, `border`, `size`, `glassFooter` and `headerConfig` do not apply to it.\n */\nexport type CardVariant = 'default' | 'framed';\nexport type CardTone = ModalTrayTone;\n\nexport interface CardProps {\n variant?: CardVariant;\n /** Only a framed card takes a tone; see `FramedCardProps`. */\n tone?: never;\n title?: string | React.ReactNode;\n /** Dimmed text beside the title, such as a count or a unit. */\n subtitle?: React.ReactNode;\n /** Actions at the right of the title row. */\n extra?: React.ReactNode;\n /**\n * Move `extra` onto a line of its own, under the title and still at the right, when the title\n * and subtitle do not fit on one line beside it, rather than shrinking the title to fit, which\n * on a framed card cuts it short. The header grows by that line, so leave room for it in a card\n * of fixed height. On a framed card it also adds 6px above and below the title row, so an\n * `extra` taller than 32px makes the header taller than 44px; use a small or medium control.\n * Keep text that changes width, such as a live save status, out of a wrapping `extra`.\n */\n wrapExtra?: boolean;\n padding?: string;\n children?: React.ReactNode;\n size?: 'default' | 'small';\n width?: string;\n minWidth?: string;\n direction?: 'row' | 'column';\n align?: 'center';\n dimmed?: boolean;\n fullHeight?: boolean;\n border?: 'base' | 'rounded';\n alignSelf?: 'center';\n height?: string;\n footer?: React.ReactNode;\n glassFooter?: boolean;\n className?: string;\n style?: React.CSSProperties;\n headerConfig?: {\n padding?: string;\n };\n}\n\n/** A framed card, which alone takes a `tone`. A second interface so `CardProps` keeps its shape. */\nexport interface FramedCardProps extends Omit<CardProps, 'variant' | 'tone'> {\n variant: Extract<CardVariant, 'framed'>;\n /**\n * Paints the frame in the tray colour of the outcome it reports, as `Modal`'s `tray` does.\n * `neutral` keeps the default grey frame, so it still matches a detached Table.\n */\n tone?: CardTone;\n}\n\nexport type AnyCardProps = CardProps | FramedCardProps;\n\nconst PLAIN_LENGTH = /^\\d*\\.?\\d+(px|rem|em)$/;\n\n// Only plain positive lengths are copied: calc() and var() can't be split from a shorthand, and a\n// zero inset would put the title against the border, so those keep the header's own 12px.\nconst horizontalInset = (padding: string): React.CSSProperties | undefined => {\n const parts = padding.trim().split(/\\s+/);\n if (parts.length > 4 || !parts.every((part) => PLAIN_LENGTH.test(part))) {\n return undefined;\n }\n const [top, right = top, , left = right] = parts;\n return parseFloat(left) > 0 && parseFloat(right) > 0\n ? { paddingLeft: left, paddingRight: right }\n : undefined;\n};\n\nconst Card: React.FC<AnyCardProps> = ({\n variant = 'default',\n tone = 'neutral',\n title,\n subtitle,\n extra,\n wrapExtra = false,\n children,\n padding = '20px',\n size = 'default',\n width,\n minWidth,\n dimmed = false,\n direction,\n align,\n fullHeight = false,\n border = 'base',\n alignSelf,\n height,\n footer,\n glassFooter = false,\n className = '',\n style = {},\n headerConfig = {},\n}) => {\n const footerRef = useRef<HTMLDivElement>(null);\n const [footerHeight, setFooterHeight] = useState(0);\n\n useEffect(() => {\n if (glassFooter && footer && footerRef.current) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setFooterHeight(entry.contentRect.height);\n }\n });\n\n observer.observe(footerRef.current);\n setFooterHeight(footerRef.current.offsetHeight);\n\n return () => observer.disconnect();\n }\n }, [glassFooter, footer]);\n\n // Size-specific padding\n const sizeClasses = size === 'small' ? 'text-sm' : '';\n\n // Dynamic classes based on props\n const cardClasses = [\n 'card-base',\n dimmed ? 'card-dimmed' : '',\n border === 'rounded' ? 'card-rounded' : '',\n fullHeight ? 'h-full' : '',\n height ? 'flex flex-col' : '',\n sizeClasses,\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const headerInset = headerConfig?.padding ? undefined : horizontalInset(padding);\n\n // Content styles\n const paddingValue = parseInt(padding) || 20;\n const extraPadding = 10;\n const contentStyles: React.CSSProperties = {\n padding,\n // The card clips overflow, so a long token in flowing text breaks rather than vanishing.\n // Flex and grid items keep their min-content width; those need their own wrapping.\n overflowWrap: 'break-word',\n display: direction ? 'flex' : undefined,\n flexDirection: direction,\n alignItems: align,\n ...(height && { overflow: 'auto', height: '100%' }),\n ...(glassFooter &&\n footer &&\n footerHeight > 0 && {\n paddingBottom: `${paddingValue + footerHeight + extraPadding}px`,\n }),\n };\n\n if (variant === 'framed') {\n return (\n <div\n className={`${FRAME_CLASS} flex flex-col ${className}`}\n style={{\n // The frame drops `card-base`, which carried the text colour.\n ...FOREGROUND_RESET,\n backgroundColor: frameToneBackground(tone),\n width,\n minWidth,\n alignSelf,\n ...(fullHeight && { height: '100%' }),\n ...(height && { height }),\n ...style,\n }}\n >\n {hasHeaderContent({ title, subtitle, extra }) && (\n <FrameHeader\n title={title}\n subtitle={subtitle}\n extra={extra}\n wrapExtra={wrapExtra}\n />\n )}\n <div\n className=\"min-h-0 flex-1\"\n style={{\n ...FRAME_SECTION_STYLE,\n padding,\n overflowWrap: 'break-word',\n display: direction ? 'flex' : undefined,\n flexDirection: direction,\n alignItems: align,\n ...(height && { overflow: 'auto' }),\n }}\n >\n {children}\n </div>\n {footer && <div className=\"px-4 py-3\">{footer}</div>}\n </div>\n );\n }\n\n // Card container styles\n const cardContainerStyles: React.CSSProperties = {\n width,\n minWidth,\n alignSelf,\n ...(fullHeight && { height: '100%' }),\n ...(height && { height, display: 'flex', flexDirection: 'column' }),\n ...(glassFooter && footer && { position: 'relative' }),\n overflow: 'hidden',\n ...style,\n };\n\n return (\n <div className={cardClasses} style={cardContainerStyles}>\n {/* Header */}\n {hasHeaderContent({ title, subtitle, extra }) && (\n <div\n className={headerInset ? 'card-header py-2' : 'card-header px-3 py-2'}\n style={{\n marginBottom: '1px',\n fontSize: size === 'small' ? '12px' : '13px',\n fontWeight: 'normal',\n ...(headerConfig?.padding\n ? { padding: headerConfig.padding }\n : headerInset),\n }}\n >\n <HeaderRow\n title={title}\n subtitle={subtitle}\n extra={extra}\n wrapExtra={wrapExtra}\n titleClassName=\"font-normal overflow-visible\"\n />\n </div>\n )}\n\n {/* Body */}\n <div\n className=\"flex-1\"\n style={{\n ...contentStyles,\n ...(glassFooter && footer && { position: 'relative' }),\n }}\n >\n {children}\n </div>\n\n {/* Footer */}\n {footer && (\n <div\n ref={glassFooter ? footerRef : undefined}\n className=\"card-footer px-4 py-3\"\n style={\n glassFooter\n ? {\n ...GLASS_SURFACE_STYLE,\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n borderBottomLeftRadius: border === 'rounded' ? '20px' : '12px',\n borderBottomRightRadius: border === 'rounded' ? '20px' : '12px',\n }\n : undefined\n }\n >\n {footer}\n </div>\n )}\n </div>\n );\n};\n\nexport default Card;\nexport { Card };\n"],"names":["PLAIN_LENGTH","horizontalInset","padding","parts","part","top","right","left","Card","variant","tone","title","subtitle","extra","wrapExtra","children","size","width","minWidth","dimmed","direction","align","fullHeight","border","alignSelf","height","footer","glassFooter","className","style","headerConfig","footerRef","useRef","footerHeight","setFooterHeight","useState","useEffect","observer","entries","entry","cardClasses","headerInset","paddingValue","contentStyles","jsxs","FRAME_CLASS","FOREGROUND_RESET","frameToneBackground","hasHeaderContent","jsx","FrameHeader","FRAME_SECTION_STYLE","cardContainerStyles","HeaderRow","GLASS_SURFACE_STYLE"],"mappings":";;;;;;;AAmEA,MAAMA,IAAe,0BAIfC,IAAkB,CAACC,MAAqD;AAC1E,QAAMC,IAAQD,EAAQ,KAAA,EAAO,MAAM,KAAK;AACxC,MAAIC,EAAM,SAAS,KAAK,CAACA,EAAM,MAAM,CAACC,MAASJ,EAAa,KAAKI,CAAI,CAAC;AAClE;AAEJ,QAAM,CAACC,GAAKC,IAAQD,KAAOE,IAAOD,CAAK,IAAIH;AAC3C,SAAO,WAAWI,CAAI,IAAI,KAAK,WAAWD,CAAK,I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AAAA,QAAW;AAAA,QAGvD,UAAAX;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJW,KACG,gBAAAuB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKtB,IAAcI,IAAY;AAAA,QAC/B,WAAU;AAAA,QACV,OACIJ,IACM;AAAA,UACI,GAAG2B;AAAA,UACH,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,MAAM;AAAA,UACN,OAAO;AAAA,UACP,wBAAwB/B,MAAW,YAAY,SAAS;AAAA,UACxD,yBAAyBA,MAAW,YAAY,SAAS;AAAA,QAAA,IAE7D;AAAA,QAGT,UAAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EACL,GAER;AAER;"}
@@ -1,7 +1,9 @@
1
1
  import { jsx as v } from "react/jsx-runtime";
2
- import { FlexDirection as a, FlexAlign as h, FlexJustify as y, FlexGapSize as e } from "./flexTypes.js";
3
- const F = (t) => {
2
+ import { FlexDirection as a, FlexAlign as S, FlexJustify as h, FlexGapSize as e } from "./flexTypes.js";
3
+ const y = (t) => {
4
4
  switch (t) {
5
+ case e.XXSmall:
6
+ return 4;
5
7
  case e.XSmall:
6
8
  return 8;
7
9
  case e.Small:
@@ -12,10 +14,10 @@ const F = (t) => {
12
14
  return 36;
13
15
  }
14
16
  }, D = ({
15
- justify: t = y.Center,
16
- align: o = h.Center,
17
+ justify: t = h.Center,
18
+ align: r = S.Center,
17
19
  gapSize: i,
18
- direction: r = a.Horizontal,
20
+ direction: o = a.Horizontal,
19
21
  fullHeight: n = !1,
20
22
  grow: s = !1,
21
23
  shrink: c = !1,
@@ -26,12 +28,12 @@ const F = (t) => {
26
28
  children: m,
27
29
  className: p = ""
28
30
  }) => {
29
- const l = i ? F(i) : void 0, g = {
31
+ const l = i ? y(i) : void 0, g = {
30
32
  display: "flex",
31
- flexDirection: r === a.Vertical ? "column" : "row",
33
+ flexDirection: o === a.Vertical ? "column" : "row",
32
34
  flexWrap: f ? "wrap" : void 0,
33
35
  justifyContent: t,
34
- alignItems: o,
36
+ alignItems: r,
35
37
  gap: l ? `${l}px` : void 0,
36
38
  height: n ? "100%" : void 0,
37
39
  flex: s ? 1 : void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\ninterface FlexProps {\n justify?: FlexJustify;\n align?: FlexAlign;\n gapSize?: FlexGapSize;\n direction?: FlexDirection;\n fullHeight?: boolean;\n grow?: boolean;\n shrink?: boolean;\n wrap?: boolean;\n width?: string;\n id?: string;\n /** `span` for content inside a button, such as a clickable `Surface.Row`. */\n as?: 'div' | 'span';\n children?: React.ReactNode;\n className?: string;\n}\n\nconst getGapSize = (size: FlexGapSize): number => {\n switch (size) {\n case FlexGapSize.XSmall:\n return 8;\n case FlexGapSize.Small:\n return 12;\n case FlexGapSize.Medium:\n return 24;\n case FlexGapSize.Large:\n return 36;\n }\n};\n\nconst Flex: React.FC<FlexProps> = ({\n justify = FlexJustify.Center,\n align = FlexAlign.Center,\n gapSize,\n direction = FlexDirection.Horizontal,\n fullHeight = false,\n grow = false,\n shrink = false,\n wrap = false,\n width,\n as = 'div',\n id,\n children,\n className = '',\n}) => {\n const gapSizeValue = gapSize ? getGapSize(gapSize) : undefined;\n\n // Convert direction to CSS flex-direction\n const flexDirection = direction === FlexDirection.Vertical ? 'column' : 'row';\n\n const baseStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection,\n flexWrap: wrap ? 'wrap' : undefined,\n justifyContent: justify,\n alignItems: align,\n gap: gapSizeValue ? `${gapSizeValue}px` : undefined,\n height: fullHeight ? '100%' : undefined,\n flex: grow ? 1 : undefined,\n minWidth: shrink ? 0 : undefined,\n width: width || undefined,\n };\n\n const Tag = as;\n return (\n <Tag id={id} className={className} style={baseStyle}>\n {children}\n </Tag>\n );\n};\n\nexport default Flex;\n"],"names":["getGapSize","size","FlexGapSize","Flex","justify","FlexJustify","align","FlexAlign","gapSize","direction","FlexDirection","fullHeight","grow","shrink","wrap","width","as","id","children","className","gapSizeValue","baseStyle"],"mappings":";;AAoBA,MAAMA,IAAa,CAACC,MAA8B;AAC9C,UAAQA,GAAA;AAAA,IACJ,KAAKC,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAA4B,CAAC;AAAA,EAC/B,SAAAC,IAAUC,EAAY;AAAA,EACtB,OAAAC,IAAQC,EAAU;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAYC,EAAc;AAAA,EAC1B,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAeZ,IAAUR,EAAWQ,CAAO,IAAI,QAK/Ca,IAAiC;AAAA,IACnC,SAAS;AAAA,IACT,eAJkBZ,MAAcC,EAAc,WAAW,WAAW;AAAA,IAKpE,UAAUI,IAAO,SAAS;AAAA,IAC1B,gBAAgBV;AAAA,IAChB,YAAYE;AAAA,IACZ,KAAKc,IAAe,GAAGA,CAAY,OAAO;AAAA,IAC1C,QAAQT,IAAa,SAAS;AAAA,IAC9B,MAAMC,IAAO,IAAI;AAAA,IACjB,UAAUC,IAAS,IAAI;AAAA,IACvB,OAAOE,KAAS;AAAA,EAAA;AAIpB,2BADYC,GAEP,EAAI,IAAAC,GAAQ,WAAAE,GAAsB,OAAOE,GACrC,UAAAH,GACL;AAER;"}
1
+ {"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react';\nimport { FlexAlign, FlexDirection, FlexGapSize, FlexJustify } from './flexTypes';\n\ninterface FlexProps {\n justify?: FlexJustify;\n align?: FlexAlign;\n gapSize?: FlexGapSize;\n direction?: FlexDirection;\n fullHeight?: boolean;\n grow?: boolean;\n shrink?: boolean;\n wrap?: boolean;\n width?: string;\n id?: string;\n /** `span` for content inside a button, such as a clickable `Surface.Row`. */\n as?: 'div' | 'span';\n children?: React.ReactNode;\n className?: string;\n}\n\nconst getGapSize = (size: FlexGapSize): number => {\n switch (size) {\n case FlexGapSize.XXSmall:\n return 4;\n case FlexGapSize.XSmall:\n return 8;\n case FlexGapSize.Small:\n return 12;\n case FlexGapSize.Medium:\n return 24;\n case FlexGapSize.Large:\n return 36;\n }\n};\n\nconst Flex: React.FC<FlexProps> = ({\n justify = FlexJustify.Center,\n align = FlexAlign.Center,\n gapSize,\n direction = FlexDirection.Horizontal,\n fullHeight = false,\n grow = false,\n shrink = false,\n wrap = false,\n width,\n as = 'div',\n id,\n children,\n className = '',\n}) => {\n const gapSizeValue = gapSize ? getGapSize(gapSize) : undefined;\n\n // Convert direction to CSS flex-direction\n const flexDirection = direction === FlexDirection.Vertical ? 'column' : 'row';\n\n const baseStyle: React.CSSProperties = {\n display: 'flex',\n flexDirection,\n flexWrap: wrap ? 'wrap' : undefined,\n justifyContent: justify,\n alignItems: align,\n gap: gapSizeValue ? `${gapSizeValue}px` : undefined,\n height: fullHeight ? '100%' : undefined,\n flex: grow ? 1 : undefined,\n minWidth: shrink ? 0 : undefined,\n width: width || undefined,\n };\n\n const Tag = as;\n return (\n <Tag id={id} className={className} style={baseStyle}>\n {children}\n </Tag>\n );\n};\n\nexport default Flex;\n"],"names":["getGapSize","size","FlexGapSize","Flex","justify","FlexJustify","align","FlexAlign","gapSize","direction","FlexDirection","fullHeight","grow","shrink","wrap","width","as","id","children","className","gapSizeValue","baseStyle"],"mappings":";;AAoBA,MAAMA,IAAa,CAACC,MAA8B;AAC9C,UAAQA,GAAA;AAAA,IACJ,KAAKC,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,IACX,KAAKA,EAAY;AACb,aAAO;AAAA,EAAA;AAEnB,GAEMC,IAA4B,CAAC;AAAA,EAC/B,SAAAC,IAAUC,EAAY;AAAA,EACtB,OAAAC,IAAQC,EAAU;AAAA,EAClB,SAAAC;AAAA,EACA,WAAAC,IAAYC,EAAc;AAAA,EAC1B,YAAAC,IAAa;AAAA,EACb,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,OAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAChB,MAAM;AACF,QAAMC,IAAeZ,IAAUR,EAAWQ,CAAO,IAAI,QAK/Ca,IAAiC;AAAA,IACnC,SAAS;AAAA,IACT,eAJkBZ,MAAcC,EAAc,WAAW,WAAW;AAAA,IAKpE,UAAUI,IAAO,SAAS;AAAA,IAC1B,gBAAgBV;AAAA,IAChB,YAAYE;AAAA,IACZ,KAAKc,IAAe,GAAGA,CAAY,OAAO;AAAA,IAC1C,QAAQT,IAAa,SAAS;AAAA,IAC9B,MAAMC,IAAO,IAAI;AAAA,IACjB,UAAUC,IAAS,IAAI;AAAA,IACvB,OAAOE,KAAS;AAAA,EAAA;AAIpB,2BADYC,GAEP,EAAI,IAAAC,GAAQ,WAAAE,GAAsB,OAAOE,GACrC,UAAAH,GACL;AAER;"}
@@ -1,36 +1,43 @@
1
1
  import { jsx as m, jsxs as t } from "react/jsx-runtime";
2
- import d from "./TruncatedTooltip.js";
2
+ import f from "./TruncatedTooltip.js";
3
3
  import { isShown as i } from "./headerContent.js";
4
- const l = (e, a) => a ? /* @__PURE__ */ m(d, { text: e, describesTrigger: !1, children: e }) : e, x = ({
4
+ const c = (e, a) => a ? /* @__PURE__ */ m(f, { text: e, describesTrigger: !1, children: e }) : e, x = ({
5
5
  title: e,
6
6
  subtitle: a,
7
7
  extra: r,
8
- truncate: s = !1,
9
- titleClassName: c = "",
10
- className: n = ""
11
- }) => /* @__PURE__ */ t("div", { className: `flex items-center gap-2 ${n}`, children: [
12
- (i(e) || i(a)) && /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-baseline gap-2", children: [
13
- i(e) && /* @__PURE__ */ m(
14
- "div",
15
- {
16
- className: `min-w-0 ${i(a) ? "" : "flex-1"} ${c}`,
17
- children: l(e, s)
18
- }
19
- ),
20
- i(a) && /* @__PURE__ */ m("div", { className: "min-w-0 text-[var(--malachite-text-dimmed,#a1a1a1)]", children: l(a, s) })
21
- ] }),
8
+ truncate: l = !1,
9
+ wrapExtra: s = !1,
10
+ titleClassName: n = "",
11
+ className: d = ""
12
+ }) => /* @__PURE__ */ t("div", { className: `flex items-center gap-2 ${s ? "flex-wrap" : ""} ${d}`, children: [
13
+ (i(e) || i(a)) && /* @__PURE__ */ t(
14
+ "div",
15
+ {
16
+ className: `flex min-w-0 items-baseline gap-2 ${s ? "flex-auto" : "flex-1"}`,
17
+ children: [
18
+ i(e) && /* @__PURE__ */ m(
19
+ "div",
20
+ {
21
+ className: `min-w-0 ${i(a) ? "" : "flex-1"} ${n}`,
22
+ children: c(e, l)
23
+ }
24
+ ),
25
+ i(a) && /* @__PURE__ */ m("div", { className: "min-w-0 text-[var(--malachite-text-dimmed,#a1a1a1)]", children: c(a, l) })
26
+ ]
27
+ }
28
+ ),
22
29
  i(r) && /* @__PURE__ */ m("div", { className: "ml-auto flex shrink-0 items-center gap-1", children: r })
23
- ] }), h = (e) => /* @__PURE__ */ m(
30
+ ] }), v = (e) => /* @__PURE__ */ m(
24
31
  x,
25
32
  {
26
33
  ...e,
27
34
  truncate: !0,
28
- className: "min-h-11 w-full pl-4 pr-2 text-[13px]",
35
+ className: `min-h-11 w-full pl-4 pr-2 text-[13px] ${e.wrapExtra ? "py-1.5" : ""}`,
29
36
  titleClassName: "font-medium tracking-[0.13px] text-[var(--malachite-text-primary,#0a0a0a)]"
30
37
  }
31
38
  );
32
39
  export {
33
40
  x as HeaderRow,
34
- h as default
41
+ v as default
35
42
  };
36
43
  //# sourceMappingURL=FrameHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FrameHeader.js","sources":["../../src/components/FrameHeader.tsx"],"sourcesContent":["import type React from 'react';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { isShown } from './headerContent';\n\ninterface HeaderRowProps {\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n extra?: React.ReactNode;\n /** Cut a long title or subtitle short, with the full text in a tooltip, rather than wrap it. */\n truncate?: boolean;\n titleClassName?: string;\n className?: string;\n}\n\nconst fitted = (node: React.ReactNode, truncate: boolean) =>\n truncate ? (\n <TruncatedTooltip text={node} describesTrigger={false}>\n {node}\n </TruncatedTooltip>\n ) : (\n node\n );\n\n/**\n * A title, a dimmed subtitle beside it and `extra` at the right edge: the header of a Card and\n * of the frame a framed Card and the detached Table share. Without a subtitle the title cell\n * takes the row's width, so a title node laid out across the header keeps doing so.\n */\nexport const HeaderRow: React.FC<HeaderRowProps> = ({\n title,\n subtitle,\n extra,\n truncate = false,\n titleClassName = '',\n className = '',\n}) => (\n <div className={`flex items-center gap-2 ${className}`}>\n {(isShown(title) || isShown(subtitle)) && (\n <div className=\"flex min-w-0 flex-1 items-baseline gap-2\">\n {isShown(title) && (\n <div\n className={`min-w-0 ${isShown(subtitle) ? '' : 'flex-1'} ${titleClassName}`}\n >\n {fitted(title, truncate)}\n </div>\n )}\n {isShown(subtitle) && (\n <div className=\"min-w-0 text-[var(--malachite-text-dimmed,#a1a1a1)]\">\n {fitted(subtitle, truncate)}\n </div>\n )}\n </div>\n )}\n {isShown(extra) && <div className=\"ml-auto flex shrink-0 items-center gap-1\">{extra}</div>}\n </div>\n);\n\n/**\n * The title row on a frame, above its section, with the title in the detached Table's\n * column-header type. A title or subtitle too long for the row is cut short, with the full text\n * in a tooltip.\n */\nconst FrameHeader: React.FC<Omit<HeaderRowProps, 'truncate' | 'titleClassName' | 'className'>> = (\n props,\n) => (\n <HeaderRow\n {...props}\n truncate\n className=\"min-h-11 w-full pl-4 pr-2 text-[13px]\"\n titleClassName=\"font-medium tracking-[0.13px] text-[var(--malachite-text-primary,#0a0a0a)]\"\n />\n);\n\nexport default FrameHeader;\n"],"names":["fitted","node","truncate","jsx","TruncatedTooltip","HeaderRow","title","subtitle","extra","titleClassName","className","jsxs","isShown","FrameHeader","props"],"mappings":";;;AAcA,MAAMA,IAAS,CAACC,GAAuBC,MACnCA,IACI,gBAAAC,EAACC,GAAA,EAAiB,MAAMH,GAAM,kBAAkB,IAC3C,UAAAA,EAAA,CACL,IAEAA,GAQKI,IAAsC,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAN,IAAW;AAAA,EACX,gBAAAO,IAAiB;AAAA,EACjB,WAAAC,IAAY;AAChB,MACI,gBAAAC,EAAC,OAAA,EAAI,WAAW,2BAA2BD,CAAS,IAC9C,UAAA;AAAA,GAAAE,EAAQN,CAAK,KAAKM,EAAQL,CAAQ,MAChC,gBAAAI,EAAC,OAAA,EAAI,WAAU,4CACV,UAAA;AAAA,IAAAC,EAAQN,CAAK,KACV,gBAAAH;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAW,WAAWS,EAAQL,CAAQ,IAAI,KAAK,QAAQ,IAAIE,CAAc;AAAA,QAExE,UAAAT,EAAOM,GAAOJ,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,IAG9BU,EAAQL,CAAQ,KACb,gBAAAJ,EAAC,OAAA,EAAI,WAAU,uDACV,UAAAH,EAAOO,GAAUL,CAAQ,EAAA,CAC9B;AAAA,EAAA,GAER;AAAA,EAEHU,EAAQJ,CAAK,uBAAM,OAAA,EAAI,WAAU,4CAA4C,UAAAA,EAAA,CAAM;AAAA,EAAA,CACxF,GAQEK,IAA2F,CAC7FC,MAEA,gBAAAX;AAAA,EAACE;AAAA,EAAA;AAAA,IACI,GAAGS;AAAA,IACJ,UAAQ;AAAA,IACR,WAAU;AAAA,IACV,gBAAe;AAAA,EAAA;AACnB;"}
1
+ {"version":3,"file":"FrameHeader.js","sources":["../../src/components/FrameHeader.tsx"],"sourcesContent":["import type React from 'react';\nimport TruncatedTooltip from './TruncatedTooltip';\nimport { isShown } from './headerContent';\n\ninterface HeaderRowProps {\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n extra?: React.ReactNode;\n /** Cut a long title or subtitle short, with the full text in a tooltip, rather than wrap it. */\n truncate?: boolean;\n /** Move `extra` onto a line of its own, under the title, when the two do not fit on one. */\n wrapExtra?: boolean;\n titleClassName?: string;\n className?: string;\n}\n\nconst fitted = (node: React.ReactNode, truncate: boolean) =>\n truncate ? (\n <TruncatedTooltip text={node} describesTrigger={false}>\n {node}\n </TruncatedTooltip>\n ) : (\n node\n );\n\n/**\n * A title, a dimmed subtitle beside it and `extra` at the right edge: the header of a Card and\n * of the frame a framed Card and the detached Table share. Without a subtitle the title cell\n * takes the row's width, so a title node laid out across the header keeps doing so. With\n * `wrapExtra`, a title and subtitle that together do not fit on one line beside `extra` keep the\n * row to themselves and `extra` wraps under them, still at the right edge; without it they share\n * the row and the title cell shrinks to whatever `extra` leaves.\n */\nexport const HeaderRow: React.FC<HeaderRowProps> = ({\n title,\n subtitle,\n extra,\n truncate = false,\n wrapExtra = false,\n titleClassName = '',\n className = '',\n}) => (\n <div className={`flex items-center gap-2 ${wrapExtra ? 'flex-wrap' : ''} ${className}`}>\n {(isShown(title) || isShown(subtitle)) && (\n <div\n className={`flex min-w-0 items-baseline gap-2 ${wrapExtra ? 'flex-auto' : 'flex-1'}`}\n >\n {isShown(title) && (\n <div\n className={`min-w-0 ${isShown(subtitle) ? '' : 'flex-1'} ${titleClassName}`}\n >\n {fitted(title, truncate)}\n </div>\n )}\n {isShown(subtitle) && (\n <div className=\"min-w-0 text-[var(--malachite-text-dimmed,#a1a1a1)]\">\n {fitted(subtitle, truncate)}\n </div>\n )}\n </div>\n )}\n {isShown(extra) && <div className=\"ml-auto flex shrink-0 items-center gap-1\">{extra}</div>}\n </div>\n);\n\n/**\n * The title row on a frame, above its section, with the title in the detached Table's\n * column-header type. A title or subtitle too long for the row is cut short, with the full text\n * in a tooltip; with `wrapExtra`, `extra` wraps under them first, so only one wider than the\n * whole row is.\n */\nconst FrameHeader: React.FC<Omit<HeaderRowProps, 'truncate' | 'titleClassName' | 'className'>> = (\n props,\n) => (\n <HeaderRow\n {...props}\n truncate\n className={`min-h-11 w-full pl-4 pr-2 text-[13px] ${props.wrapExtra ? 'py-1.5' : ''}`}\n titleClassName=\"font-medium tracking-[0.13px] text-[var(--malachite-text-primary,#0a0a0a)]\"\n />\n);\n\nexport default FrameHeader;\n"],"names":["fitted","node","truncate","jsx","TruncatedTooltip","HeaderRow","title","subtitle","extra","wrapExtra","titleClassName","className","jsxs","isShown","FrameHeader","props"],"mappings":";;;AAgBA,MAAMA,IAAS,CAACC,GAAuBC,MACnCA,IACI,gBAAAC,EAACC,GAAA,EAAiB,MAAMH,GAAM,kBAAkB,IAC3C,UAAAA,EAAA,CACL,IAEAA,GAWKI,IAAsC,CAAC;AAAA,EAChD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAN,IAAW;AAAA,EACX,WAAAO,IAAY;AAAA,EACZ,gBAAAC,IAAiB;AAAA,EACjB,WAAAC,IAAY;AAChB,MACI,gBAAAC,EAAC,SAAI,WAAW,2BAA2BH,IAAY,cAAc,EAAE,IAAIE,CAAS,IAC9E,UAAA;AAAA,GAAAE,EAAQP,CAAK,KAAKO,EAAQN,CAAQ,MAChC,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAW,qCAAqCH,IAAY,cAAc,QAAQ;AAAA,MAEjF,UAAA;AAAA,QAAAI,EAAQP,CAAK,KACV,gBAAAH;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,WAAW,WAAWU,EAAQN,CAAQ,IAAI,KAAK,QAAQ,IAAIG,CAAc;AAAA,YAExE,UAAAV,EAAOM,GAAOJ,CAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAG9BW,EAAQN,CAAQ,KACb,gBAAAJ,EAAC,OAAA,EAAI,WAAU,uDACV,UAAAH,EAAOO,GAAUL,CAAQ,EAAA,CAC9B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAAA,EAIXW,EAAQL,CAAK,uBAAM,OAAA,EAAI,WAAU,4CAA4C,UAAAA,EAAA,CAAM;AAAA,EAAA,CACxF,GASEM,IAA2F,CAC7FC,MAEA,gBAAAZ;AAAA,EAACE;AAAA,EAAA;AAAA,IACI,GAAGU;AAAA,IACJ,UAAQ;AAAA,IACR,WAAW,yCAAyCA,EAAM,YAAY,WAAW,EAAE;AAAA,IACnF,gBAAe;AAAA,EAAA;AACnB;"}
@@ -1,11 +1,12 @@
1
1
  import { EmptyLayout as o } from "./emptyLayout.js";
2
- import { PageColumn as t } from "./pageColumn.js";
3
- import { RegularLayout as m } from "./regularLayout.js";
4
- import { PageActions as g } from "./regularLayout.js";
5
- const u = { Regular: m, Empty: o, Column: t };
2
+ import { PageColumn as m } from "./pageColumn.js";
3
+ import { PageColumns as t } from "./pageColumns.js";
4
+ import { RegularLayout as r } from "./regularLayout.js";
5
+ import { PageActions as n } from "./regularLayout.js";
6
+ const l = { Regular: r, Empty: o, Column: m, Columns: t };
6
7
  export {
7
- g as PageActions,
8
- u as PageLayout,
9
- u as default
8
+ n as PageActions,
9
+ l as PageLayout,
10
+ l as default
10
11
  };
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import Empty from './emptyLayout';\nimport Column from './pageColumn';\nimport Regular from './regularLayout';\n\nexport const PageLayout = { Regular, Empty, Column };\n\nexport default PageLayout;\nexport type { BreadcrumbLink, PageAction, RenderLink } from './types';\nexport { PageActions } from './regularLayout';\nexport type { PageContentGap, PageContentWidth, RegularLayoutProps } from './regularLayout';\nexport type { EmptyLayoutProps } from './emptyLayout';\nexport type { PageColumnProps } from './pageColumn';\n"],"names":["PageLayout","Regular","Empty","Column"],"mappings":";;;;AAIO,MAAMA,IAAa,EAAA,SAAEC,GAAA,OAASC,WAAOC,EAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/PageLayout/index.tsx"],"sourcesContent":["import Empty from './emptyLayout';\nimport Column from './pageColumn';\nimport Columns from './pageColumns';\nimport Regular from './regularLayout';\n\nexport const PageLayout = { Regular, Empty, Column, Columns };\n\nexport default PageLayout;\nexport type { BreadcrumbLink, PageAction, RenderLink } from './types';\nexport { PageActions } from './regularLayout';\nexport type { PageContentGap, PageContentWidth, RegularLayoutProps } from './regularLayout';\nexport type { EmptyLayoutProps } from './emptyLayout';\nexport type { PageColumnProps } from './pageColumn';\nexport type { PageColumnsProps } from './pageColumns';\n"],"names":["PageLayout","Regular","Empty","Column","Columns"],"mappings":";;;;;AAKO,MAAMA,IAAa,EAAA,SAAEC,UAASC,GAAA,QAAOC,YAAQC,EAAA;"}
@@ -0,0 +1,23 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { CONTENT_INSET_VAR as t } from "./constants.js";
3
+ import { CONTENT_GAPS as a } from "./pageColumn.js";
4
+ const c = ({ gap: s = "xlarge", children: l, className: o = "" }) => /* @__PURE__ */ r(
5
+ "div",
6
+ {
7
+ className: `@container w-full ${o}`,
8
+ style: { [t]: "0px" },
9
+ children: /* @__PURE__ */ r(
10
+ "div",
11
+ {
12
+ className: "grid grid-cols-1 items-start @[768px]:grid-cols-2",
13
+ style: { gap: a[s] },
14
+ children: l
15
+ }
16
+ )
17
+ }
18
+ );
19
+ export {
20
+ c as PageColumns,
21
+ c as default
22
+ };
23
+ //# sourceMappingURL=pageColumns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageColumns.js","sources":["../../../src/components/PageLayout/pageColumns.tsx"],"sourcesContent":["import React from 'react';\nimport { CONTENT_INSET_VAR } from './constants';\nimport { CONTENT_GAPS, type PageContentGap } from './pageColumn';\n\nexport interface PageColumnsProps {\n /** Space between the columns, and between them once stacked. Defaults to `xlarge`. */\n gap?: PageContentGap;\n /** Exactly two children, one per column; a third wraps onto a new row. */\n children: React.ReactNode;\n className?: string;\n}\n\n/**\n * Two equal columns that stack into one when the content area, not the viewport, is narrower\n * than 768px, so a page beside the app sidebar stacks at the width it actually has. Needs a\n * parent with a definite width, such as a page body: it measures its container, so inside a\n * box that sizes to its content it collapses. Inside `contentWidth=\"narrow\"` it always stacks.\n */\nconst PageColumns: React.FC<PageColumnsProps> = ({ gap = 'xlarge', children, className = '' }) => (\n <div\n className={`@container w-full ${className}`}\n style={{ [CONTENT_INSET_VAR]: '0px' } as React.CSSProperties}\n >\n <div\n className=\"grid grid-cols-1 items-start @[768px]:grid-cols-2\"\n style={{ gap: CONTENT_GAPS[gap] }}\n >\n {children}\n </div>\n </div>\n);\n\nexport default PageColumns;\nexport { PageColumns };\n"],"names":["PageColumns","gap","children","className","jsx","CONTENT_INSET_VAR","CONTENT_GAPS"],"mappings":";;;AAkBA,MAAMA,IAA0C,CAAC,EAAE,KAAAC,IAAM,UAAU,UAAAC,GAAU,WAAAC,IAAY,SACrF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,WAAW,qBAAqBD,CAAS;AAAA,IACzC,OAAO,EAAE,CAACE,CAAiB,GAAG,MAAA;AAAA,IAE9B,UAAA,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,OAAO,EAAE,KAAKE,EAAaL,CAAG,EAAA;AAAA,QAE7B,UAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACL;AACJ;"}