@homebound/beam 2.284.0 → 2.285.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,5 +1,7 @@
1
1
  import { Dispatch, ReactNode, SetStateAction } from "react";
2
- export interface AccordionProps {
2
+ import { Only, Padding, Xss } from "../Css";
3
+ type AccordionXss = Xss<Padding>;
4
+ export interface AccordionProps<X = AccordionXss> {
3
5
  title: ReactNode;
4
6
  children: ReactNode;
5
7
  disabled?: boolean;
@@ -17,6 +19,9 @@ export interface AccordionProps {
17
19
  setExpandedIndex?: Dispatch<SetStateAction<number | undefined>>;
18
20
  /** Used by Accordion list. Sets default padding to 0 for nested accordions */
19
21
  omitPadding?: boolean;
22
+ /** Styles overrides for padding */
23
+ xss?: X;
20
24
  }
21
- export declare function Accordion(props: AccordionProps): import("@emotion/react/jsx-runtime").JSX.Element;
25
+ export declare function Accordion<X extends Only<AccordionXss, X>>(props: AccordionProps<X>): import("@emotion/react/jsx-runtime").JSX.Element;
22
26
  export type AccordionSize = "xs" | "sm" | "md" | "lg";
27
+ export {};
@@ -9,7 +9,7 @@ const Icon_1 = require("./Icon");
9
9
  const Css_1 = require("../Css");
10
10
  const utils_2 = require("../utils");
11
11
  function Accordion(props) {
12
- const { title, children, size, disabled = false, defaultExpanded = false, topBorder = true, bottomBorder = false, index, setExpandedIndex, omitPadding = false, } = props;
12
+ const { title, children, size, disabled = false, defaultExpanded = false, topBorder = true, bottomBorder = false, index, setExpandedIndex, omitPadding = false, xss, } = props;
13
13
  const testIds = (0, utils_2.useTestIds)(props, "accordion");
14
14
  const id = (0, utils_1.useId)();
15
15
  const [expanded, setExpanded] = (0, react_1.useState)(defaultExpanded && !disabled);
@@ -43,6 +43,7 @@ function Accordion(props) {
43
43
  ...Css_1.Css.df.jcsb.gap2.aic.w100.p2.baseMd.outline("none").addIn(":hover", Css_1.Css.bgGray100.$).$,
44
44
  ...(disabled && Css_1.Css.gray500.$),
45
45
  ...(isFocusVisible && Css_1.Css.boxShadow(`inset 0 0 0 2px ${Css_1.Palette.LightBlue700}`).$),
46
+ ...xss,
46
47
  }, onClick: () => {
47
48
  setExpanded(!expanded);
48
49
  if (setExpandedIndex)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.284.0",
3
+ "version": "2.285.0",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",