@stackone/malachite 2.85.0 → 2.86.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.
@@ -1 +1 @@
1
- {"version":3,"file":"buttonStyles.js","sources":["../../src/components/buttonStyles.ts"],"sourcesContent":["import type { ButtonRadius, ButtonSize, ButtonVariant } from './Button';\n\n// Geometry from the Figma component library, which is variant-independent.\n// `min-h` not `h`: Tailwind emits `h-*` after `min-h-*`, so a hard height would beat a\n// consumer's own `h-*`. Paired with `whitespace-nowrap` (as Figma has it) so a long label\n// cannot wrap into a line the height would clip.\nexport const getSizeClasses = (size: ButtonSize) => {\n switch (size) {\n // Figma has no text X-Small button, only the icon-only square — nothing to align to.\n case 'xsmall':\n return '[--btn-px:calc(var(--spacing)*2)] px-[var(--btn-px)] py-1 text-xs';\n case 'small':\n return 'min-h-[var(--malachite-control-height-small,28px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'medium':\n return 'min-h-[var(--malachite-control-height-medium,32px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'large':\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n default:\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n }\n};\n\n// `rounded-*` reads the malachite radius tokens via `@theme`, so these follow the theme.\n// An explicit `radius` prop still wins, via getRadiusClass.\nexport const getDefaultRadiusClass = (size: ButtonSize, iconOnly: boolean): string => {\n switch (size) {\n // Only the square rounds at 8px — text buttons at this size keep their 6px corner.\n case 'xsmall':\n return iconOnly ? 'rounded-lg' : 'rounded-md';\n case 'small':\n return 'rounded-[var(--malachite-radius-10,10px)]';\n case 'medium':\n return 'rounded-xl';\n case 'large':\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n default:\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n }\n};\n\n// Figma pairs a 6px icon gap with the 13px tiers and 8px with the 15px tier.\nexport const getIconGapClass = (size: ButtonSize, position: 'start' | 'end'): string => {\n const start = position === 'start';\n switch (size) {\n case 'small':\n case 'medium':\n return start ? 'mr-[6px]' : 'ml-[6px]';\n default:\n return start ? 'mr-2' : 'ml-2';\n }\n};\n\nexport const getRadiusClass = (radius: ButtonRadius): string => {\n switch (radius) {\n case 'md':\n return 'rounded-md';\n case 'lg':\n return 'rounded-lg';\n case 'xl':\n return 'rounded-xl';\n default:\n return 'rounded-xl';\n }\n};\n\n// Focus ring: a `focus-visible` outline (keyboard only), coloured to match the variant.\n// Uses `outline` rather than Tailwind's `ring-*` because ring composes `--tw-ring-*`\n// custom properties via box-shadow that rely on document-level @property registration\n// and silently don't paint inside a shadow root (same class of issue as transform\n// utilities). The classes are full literals so Tailwind's JIT can generate them.\nconst FOCUS_OUTLINE = {\n neutral: 'focus-visible:[outline:2px_solid_var(--malachite-text-primary)]',\n destructive: 'focus-visible:[outline:2px_solid_var(--malachite-text-destructive)]',\n success: 'focus-visible:[outline:2px_solid_var(--malachite-text-success)]',\n warning: 'focus-visible:[outline:2px_solid_var(--malachite-text-warning)]',\n error: 'focus-visible:[outline:2px_solid_var(--malachite-text-error)]',\n assistant: 'focus-visible:[outline:2px_solid_var(--malachite-assistant-foreground)]',\n accent: 'focus-visible:[outline:2px_solid_var(--malachite-accent-foreground)]',\n};\n\nexport const getVariantClasses = (variant: ButtonVariant, radiusClass: string): string => {\n const baseClasses = `font-medium transition-[color,background-color,border-color,opacity,box-shadow] duration-200 ease-in-out outline-none focus-visible:outline-offset-2 border border-solid ${radiusClass} cursor-pointer`;\n\n switch (variant) {\n case 'filled':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n\n case 'outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-outline shadow-default`;\n\n case 'surface':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-surface shadow-default`;\n\n case 'assistant':\n return `${baseClasses} ${FOCUS_OUTLINE.assistant} btn-assistant shadow-default`;\n\n case 'destructive':\n return `${baseClasses} ${FOCUS_OUTLINE.destructive} btn-destructive`;\n\n case 'success':\n return `${baseClasses} ${FOCUS_OUTLINE.success} btn-glass-success`;\n\n case 'warning':\n return `${baseClasses} ${FOCUS_OUTLINE.warning} btn-glass-warning`;\n\n case 'error':\n return `${baseClasses} ${FOCUS_OUTLINE.error} btn-glass-error`;\n\n case 'ghost':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-ghost`;\n\n case 'quiet':\n return `${baseClasses} ${FOCUS_OUTLINE.accent} btn-quiet`;\n\n case 'muted':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-muted`;\n\n case 'no-style':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-no-style border-none`;\n\n default:\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n }\n};\n"],"names":["getSizeClasses","size","getDefaultRadiusClass","iconOnly","getIconGapClass","position","start","getRadiusClass","radius","FOCUS_OUTLINE","getVariantClasses","variant","radiusClass","baseClasses"],"mappings":"AAMO,MAAMA,IAAiB,CAACC,MAAqB;AAChD,UAAQA,GAAA;AAAA;AAAA,IAEJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EAAA;AAEnB,GAIaC,IAAwB,CAACD,GAAkBE,MAA8B;AAClF,UAAQF,GAAA;AAAA;AAAA,IAEJ,KAAK;AACD,aAAOE,IAAW,eAAe;AAAA,IACrC,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AAC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D,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,MAAM;AAAA,IAEjD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD;AACI,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,EAAA;AAE1D;"}
1
+ {"version":3,"file":"buttonStyles.js","sources":["../../src/components/buttonStyles.ts"],"sourcesContent":["import type { ButtonRadius, ButtonSize, ButtonVariant } from './Button';\n\n// Geometry from the Figma component library, which is variant-independent.\n// `min-h` not `h`: Tailwind emits `h-*` after `min-h-*`, so a hard height would beat a\n// consumer's own `h-*`. Paired with `whitespace-nowrap` (as Figma has it) so a long label\n// cannot wrap into a line the height would clip.\nexport const getSizeClasses = (size: ButtonSize) => {\n switch (size) {\n // Figma has no text X-Small button, only the icon-only square — nothing to align to.\n case 'xsmall':\n return '[--btn-px:calc(var(--spacing)*2)] px-[var(--btn-px)] py-1 text-xs';\n case 'small':\n return 'min-h-[var(--malachite-control-height-small,28px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'medium':\n return 'min-h-[var(--malachite-control-height-medium,32px)] [--btn-px:10px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-small,13px)] leading-[16px] whitespace-nowrap';\n case 'large':\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n default:\n return 'min-h-[var(--malachite-control-height-large,42px)] [--btn-px:12px] px-[var(--btn-px)] text-[length:var(--malachite-font-size-15,15px)] leading-[18px] whitespace-nowrap';\n }\n};\n\n// `rounded-*` reads the malachite radius tokens via `@theme`, so these follow the theme.\n// An explicit `radius` prop still wins, via getRadiusClass.\nexport const getDefaultRadiusClass = (size: ButtonSize, iconOnly: boolean): string => {\n switch (size) {\n // Only the square rounds at 8px — text buttons at this size keep their 6px corner.\n case 'xsmall':\n return iconOnly ? 'rounded-lg' : 'rounded-md';\n case 'small':\n return 'rounded-[var(--malachite-radius-10,10px)]';\n case 'medium':\n return 'rounded-xl';\n case 'large':\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n default:\n return 'rounded-[var(--malachite-radius-xxl,14px)]';\n }\n};\n\n// Figma pairs a 6px icon gap with the 13px tiers and 8px with the 15px tier.\nexport const getIconGapClass = (size: ButtonSize, position: 'start' | 'end'): string => {\n const start = position === 'start';\n switch (size) {\n case 'small':\n case 'medium':\n return start ? 'mr-[6px]' : 'ml-[6px]';\n default:\n return start ? 'mr-2' : 'ml-2';\n }\n};\n\nexport const getRadiusClass = (radius: ButtonRadius): string => {\n switch (radius) {\n case 'md':\n return 'rounded-md';\n case 'lg':\n return 'rounded-lg';\n case 'xl':\n return 'rounded-xl';\n default:\n return 'rounded-xl';\n }\n};\n\n// Focus ring: a `focus-visible` outline (keyboard only), coloured to match the variant.\n// Uses `outline` rather than Tailwind's `ring-*` because ring composes `--tw-ring-*`\n// custom properties via box-shadow that rely on document-level @property registration\n// and silently don't paint inside a shadow root (same class of issue as transform\n// utilities). The classes are full literals so Tailwind's JIT can generate them.\nconst FOCUS_OUTLINE = {\n neutral: 'focus-visible:[outline:2px_solid_var(--malachite-text-primary)]',\n destructive: 'focus-visible:[outline:2px_solid_var(--malachite-text-destructive)]',\n success: 'focus-visible:[outline:2px_solid_var(--malachite-text-success)]',\n warning: 'focus-visible:[outline:2px_solid_var(--malachite-text-warning)]',\n error: 'focus-visible:[outline:2px_solid_var(--malachite-text-error)]',\n assistant: 'focus-visible:[outline:2px_solid_var(--malachite-assistant-foreground)]',\n accent: 'focus-visible:[outline:2px_solid_var(--malachite-accent-foreground)]',\n};\n\nexport const getVariantClasses = (variant: ButtonVariant, radiusClass: string): string => {\n const baseClasses = `font-medium transition-[color,background-color,border-color,opacity,box-shadow] duration-200 ease-in-out outline-none focus-visible:outline-offset-2 border border-solid ${radiusClass} cursor-pointer`;\n\n switch (variant) {\n case 'filled':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n\n case 'outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-outline shadow-default`;\n\n case 'surface':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-surface shadow-default`;\n\n case 'assistant':\n return `${baseClasses} ${FOCUS_OUTLINE.assistant} btn-assistant shadow-default`;\n\n case 'destructive':\n return `${baseClasses} ${FOCUS_OUTLINE.destructive} btn-destructive`;\n\n case 'success':\n return `${baseClasses} ${FOCUS_OUTLINE.success} btn-glass-success`;\n\n case 'warning':\n return `${baseClasses} ${FOCUS_OUTLINE.warning} btn-glass-warning`;\n\n case 'error':\n return `${baseClasses} ${FOCUS_OUTLINE.error} btn-glass-error`;\n\n case 'ghost':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-ghost`;\n\n case 'row-outline':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-row-outline`;\n\n case 'quiet':\n return `${baseClasses} ${FOCUS_OUTLINE.accent} btn-quiet`;\n\n case 'muted':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-muted`;\n\n case 'no-style':\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-no-style border-none`;\n\n default:\n return `${baseClasses} ${FOCUS_OUTLINE.neutral} btn-filled shadow-default`;\n }\n};\n"],"names":["getSizeClasses","size","getDefaultRadiusClass","iconOnly","getIconGapClass","position","start","getRadiusClass","radius","FOCUS_OUTLINE","getVariantClasses","variant","radiusClass","baseClasses"],"mappings":"AAMO,MAAMA,IAAiB,CAACC,MAAqB;AAChD,UAAQA,GAAA;AAAA;AAAA,IAEJ,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX,KAAK;AACD,aAAO;AAAA,IACX;AACI,aAAO;AAA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AA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,KAAK;AAAA,IAEhD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,MAAM;AAAA,IAEjD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD,KAAK;AACD,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,IAElD;AACI,aAAO,GAAGI,CAAW,IAAIJ,EAAc,OAAO;AAAA,EAAA;AAE1D;"}
@@ -1,11 +1,12 @@
1
- const o = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]", e = "outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]", i = "pointer-events-none absolute inset-0 z-[2] hidden group-focus-visible:block [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]", t = "outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]", s = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]", l = "outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]", n = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]";
1
+ const e = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]", i = "outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]", o = "pointer-events-none absolute inset-0 hidden [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]", t = `${o} z-[2] group-focus-visible:block`, s = "outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]", n = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]", l = "outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]", u = "outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]";
2
2
  export {
3
- o as FOCUS_RING,
4
- n as FOCUS_RING_CLOSE_BUTTON_INVERSE,
3
+ e as FOCUS_RING,
4
+ u as FOCUS_RING_CLOSE_BUTTON_INVERSE,
5
5
  l as FOCUS_RING_INLINE_CONFIRM_INSET,
6
- e as FOCUS_RING_INSET,
7
- i as FOCUS_RING_INSET_OVERLAY,
8
- s as FOCUS_RING_SELECTION_BAR,
9
- t as FOCUS_RING_WITHIN_RADIO
6
+ i as FOCUS_RING_INSET,
7
+ t as FOCUS_RING_INSET_OVERLAY,
8
+ o as FOCUS_RING_INSET_OVERLAY_HIDDEN,
9
+ n as FOCUS_RING_SELECTION_BAR,
10
+ s as FOCUS_RING_WITHIN_RADIO
10
11
  };
11
12
  //# sourceMappingURL=focusRing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusRing.js","sources":["../../src/components/focusRing.ts"],"sourcesContent":["// Shared keyboard focus indicator for interactive components.\n\n/** Standard focus ring — sits 2px outside the control. */\nexport const FOCUS_RING =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * Inset focus ring — drawn 2px inside the element edge. Use for full-bleed elements\n * inside an `overflow-hidden` container (e.g. Surface.Row) where an outset outline\n * would be clipped.\n */\nexport const FOCUS_RING_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]';\n\n/** `FOCUS_RING_INSET` drawn by an overlay while its `group` ancestor has keyboard focus. */\nexport const FOCUS_RING_INSET_OVERLAY =\n 'pointer-events-none absolute inset-0 z-[2] hidden group-focus-visible:block [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]';\n\n/** Ring drawn on a wrapper when a control *inside* it takes focus. */\nexport const FOCUS_RING_WITHIN =\n 'outline-none has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * As `FOCUS_RING_WITHIN`, for a card whose control is a `role=\"radio\"` beside its links:\n * `:has(:focus-visible)` would also match a focused link and draw a second ring.\n */\nexport const FOCUS_RING_WITHIN_RADIO =\n 'outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/** Ring for a control on the SelectionBar, where `FOCUS_RING` would be invisible. */\nexport const FOCUS_RING_SELECTION_BAR =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]';\n\n/** Inset ring for a control on the InlineConfirm chip. */\nexport const FOCUS_RING_INLINE_CONFIRM_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]';\n\n/** Ring for `CloseButton surface=\"inverse\"`, where `FOCUS_RING` would be invisible on the dark panel. */\nexport const FOCUS_RING_CLOSE_BUTTON_INVERSE =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]';\n"],"names":["FOCUS_RING","FOCUS_RING_INSET","FOCUS_RING_INSET_OVERLAY","FOCUS_RING_WITHIN_RADIO","FOCUS_RING_SELECTION_BAR","FOCUS_RING_INLINE_CONFIRM_INSET","FOCUS_RING_CLOSE_BUTTON_INVERSE"],"mappings":"AAGO,MAAMA,IACT,+GAOSC,IACT,oHAGSC,IACT,uJAUSC,IACT,qJAGSC,IACT,2HAGSC,IACT,iIAGSC,IACT;"}
1
+ {"version":3,"file":"focusRing.js","sources":["../../src/components/focusRing.ts"],"sourcesContent":["// Shared keyboard focus indicator for interactive components.\n\n/** Standard focus ring — sits 2px outside the control. */\nexport const FOCUS_RING =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * Inset focus ring — drawn 2px inside the element edge. Use for full-bleed elements\n * inside an `overflow-hidden` container (e.g. Surface.Row) where an outset outline\n * would be clipped.\n */\nexport const FOCUS_RING_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-text-primary)] focus-visible:[outline-offset:-2px]';\n\nexport const FOCUS_RING_INSET_OVERLAY_HIDDEN =\n 'pointer-events-none absolute inset-0 hidden [outline:2px_solid_var(--malachite-text-primary)] [outline-offset:-2px]';\n\n/** `FOCUS_RING_INSET` drawn by an overlay while its `group` ancestor has keyboard focus. */\nexport const FOCUS_RING_INSET_OVERLAY = `${FOCUS_RING_INSET_OVERLAY_HIDDEN} z-[2] group-focus-visible:block`;\n\n/** Ring drawn on a wrapper when a control *inside* it takes focus. */\nexport const FOCUS_RING_WITHIN =\n 'outline-none has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/**\n * As `FOCUS_RING_WITHIN`, for a card whose control is a `role=\"radio\"` beside its links:\n * `:has(:focus-visible)` would also match a focused link and draw a second ring.\n */\nexport const FOCUS_RING_WITHIN_RADIO =\n 'outline-none has-[[role=radio]:focus-visible]:outline-offset-2 has-[[role=radio]:focus-visible]:[outline:2px_solid_var(--malachite-text-primary)]';\n\n/** Ring for a control on the SelectionBar, where `FOCUS_RING` would be invisible. */\nexport const FOCUS_RING_SELECTION_BAR =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-selection-bar-foreground)]';\n\n/** Inset ring for a control on the InlineConfirm chip. */\nexport const FOCUS_RING_INLINE_CONFIRM_INSET =\n 'outline-none focus-visible:[outline:2px_solid_var(--malachite-inline-confirm-foreground)] focus-visible:[outline-offset:-2px]';\n\n/** Ring for `CloseButton surface=\"inverse\"`, where `FOCUS_RING` would be invisible on the dark panel. */\nexport const FOCUS_RING_CLOSE_BUTTON_INVERSE =\n 'outline-none focus-visible:outline-offset-2 focus-visible:[outline:2px_solid_var(--malachite-close-button-inverse-hover-foreground,rgb(255,255,255))]';\n"],"names":["FOCUS_RING","FOCUS_RING_INSET","FOCUS_RING_INSET_OVERLAY_HIDDEN","FOCUS_RING_INSET_OVERLAY","FOCUS_RING_WITHIN_RADIO","FOCUS_RING_SELECTION_BAR","FOCUS_RING_INLINE_CONFIRM_INSET","FOCUS_RING_CLOSE_BUTTON_INVERSE"],"mappings":"AAGO,MAAMA,IACT,+GAOSC,IACT,oHAESC,IACT,uHAGSC,IAA2B,GAAGD,CAA+B,oCAU7DE,IACT,qJAGSC,IACT,2HAGSC,IACT,iIAGSC,IACT;"}
package/dist/index.d.ts CHANGED
@@ -53,17 +53,10 @@ declare interface AccordionBaseProps {
53
53
  trailing?: default_2.ReactNode;
54
54
  /** Before the title, outside the toggle button. */
55
55
  leading?: default_2.ReactNode;
56
- /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */
57
- arrowPosition?: 'start' | 'end' | 'gutter';
58
56
  /** `false` keeps an open row on the card ground. */
59
57
  highlightExpanded?: boolean;
60
58
  /** `title` starts the body under the title, 16px short of it for a compact `Surface.Row`. */
61
59
  bodyIndent?: 'none' | 'title';
62
- defaultExpanded?: boolean;
63
- isExpanded?: boolean;
64
- onToggle?: (expanded: boolean) => void;
65
- /** Disables the toggle (and its hover). Trailing controls manage their own state. */
66
- disabled?: boolean;
67
60
  /**
68
61
  * Pin the header row to the top of the nearest scroll container so it stays
69
62
  * reachable while the body scrolls. Needs a scroll ancestor that clips without
@@ -78,19 +71,13 @@ declare interface AccordionBaseProps {
78
71
  * `--malachite-ctx-pinned-surround` on an ancestor when the card sits on another ground.
79
72
  */
80
73
  pinnedCorners?: boolean;
81
- /**
82
- * Animate the expand/collapse height (default `true`). Set `false` for an instant
83
- * open — the body isn't clipped, so a `position: sticky` child pins immediately with
84
- * no post-animation settle.
85
- */
86
- animate?: boolean;
87
74
  }
88
75
 
89
76
  /**
90
77
  * Requires at least one of `title` (simple text header) or `header` (rich ReactNode
91
78
  * content for the toggle area, e.g. avatar + badges) so the toggle is never empty.
92
79
  */
93
- export declare type AccordionProps = AccordionBaseProps & ({
80
+ export declare type AccordionProps = AccordionBaseProps & AccordionToggleProps & ({
94
81
  title: string;
95
82
  header?: default_2.ReactNode;
96
83
  } | {
@@ -98,6 +85,24 @@ export declare type AccordionProps = AccordionBaseProps & ({
98
85
  header: default_2.ReactNode;
99
86
  });
100
87
 
88
+ declare interface AccordionToggleProps {
89
+ /** `false` is a section that never closes; the toggle props are then ignored. */
90
+ collapsible?: boolean;
91
+ /** `gutter` puts the arrow before `leading` as its own mouse toggle; the title stays the keyboard one. */
92
+ arrowPosition?: 'start' | 'end' | 'gutter';
93
+ defaultExpanded?: boolean;
94
+ isExpanded?: boolean;
95
+ onToggle?: (expanded: boolean) => void;
96
+ /** Disables the toggle (and its hover). Trailing controls manage their own state. */
97
+ disabled?: boolean;
98
+ /**
99
+ * Animate the expand/collapse height (default `true`). Set `false` for an instant
100
+ * open — the body isn't clipped, so a `position: sticky` child pins immediately with
101
+ * no post-animation settle.
102
+ */
103
+ animate?: boolean;
104
+ }
105
+
101
106
  export declare const AccountIcon: React.FC<IconProps>;
102
107
 
103
108
  export declare const AccountsIcon: React.FC<IconProps_2>;
@@ -511,6 +516,8 @@ export declare type ButtonVariant = 'filled' | 'outline'
511
516
  * that anything is wrong.
512
517
  */
513
518
  | 'assistant' | 'destructive' | 'success' | 'warning' | 'error' | 'ghost'
519
+ /** `ghost` until its `Surface.Row` is hovered or focused, or its menu opens. For `trailing` only. */
520
+ | 'row-outline'
514
521
  /** Text only, in the accent colour, for a secondary action beside a primary one. */
515
522
  | 'quiet'
516
523
  /**
@@ -4975,7 +4982,7 @@ declare interface SpinnerProps {
4975
4982
  export declare const SplitButton: default_2.ForwardRefExoticComponent<SplitButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
4976
4983
 
4977
4984
  export declare interface SplitButtonProps {
4978
- variant?: ButtonVariant;
4985
+ variant?: Exclude<ButtonVariant, 'row-outline'>;
4979
4986
  size?: ButtonSize;
4980
4987
  children?: default_2.ReactNode;
4981
4988
  leading?: default_2.ReactNode;
@@ -5288,6 +5295,10 @@ export declare interface SurfaceRowProps extends SurfaceRowChromeProps {
5288
5295
  * which has no hover, always shows it.
5289
5296
  */
5290
5297
  revealTrailing?: boolean;
5298
+ /** The row's indicator, before the children. */
5299
+ leading?: default_2.ReactNode;
5300
+ /** Fades the children, not `leading` or `trailing`. */
5301
+ dimmed?: boolean;
5291
5302
  /** ARIA role for a clickable row, e.g. `radio`/`checkbox` (wrap the list in a `radiogroup`). */
5292
5303
  role?: default_2.AriaRole;
5293
5304
  'aria-label'?: string;