@stenajs-webui/core 20.6.6 → 20.6.7

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":"index.es.js","sources":["../src/components/decorators/separatorline/SeparatorLine.tsx","../src/components/interaction/Clickable.tsx","../src/utils/BooleanOrNumberToNumber.ts","../src/components/layout/box/Box.tsx","../src/components/layout/column/Column.tsx","../src/hooks/UseElementDimensions.ts","../src/components/layout/box/ResizeAwareBox.tsx","../src/components/layout/row/Row.tsx","../src/components/layout/indent/Indent.tsx","../src/components/layout/spacing/Spacing.tsx","../src/components/layout/space/Space.tsx","../src/components/util/Nest.tsx","../src/utils/PropsForwarder.ts","../src/components/accessibility/ScreenReaderOnlyText.tsx","../src/components/text/Text.tsx","../src/components/deprecated-text/SmallText.tsx","../src/components/deprecated-text/SmallerText.tsx","../src/components/deprecated-text/StandardText.tsx","../src/components/deprecated-text/LargeText.tsx","../src/components/heading/Heading.tsx","../src/components/deprecated-text/HeaderText.tsx","../src/hooks/UseArraySet.ts","../src/hooks/UseBoolean.ts","../src/hooks/UseDebounce.ts","../src/hooks/UseDelayedFalse.ts","../src/hooks/UseDomId.ts","../src/hooks/UseEventListener.ts","../src/hooks/UseElementFocus.ts","../src/hooks/UseMouseIsOver.ts","../src/hooks/UseMouseIsEntered.ts","../src/hooks/UseMultiOnClickOutside.ts","../src/hooks/UseOnClickOutside.ts","../src/hooks/UseOnNoMouseInput.ts","../src/hooks/UseOnScreen.ts","../src/hooks/UseForwardedRef.ts","../src/hooks/UseTimeoutState.ts","../src/utils/SwitchCaseExhauster.ts","../src/utils/TruthyKeysAsList.ts","../src/utils/parsers/NumberParser.ts"],"sourcesContent":["import { Property } from \"csstype\";\nimport * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport styles from \"./SeparatorLine.module.css\";\n\nexport interface SeparatorLineProps {\n color?: Property.Color;\n vertical?: boolean;\n size?: string;\n width?: string;\n}\n\nexport const SeparatorLine = forwardRef<HTMLHRElement, SeparatorLineProps>(\n (\n {\n color = cssColor(\"--lhds-color-ui-300\"),\n size = \"100%\",\n width = \"1px\",\n vertical = false,\n },\n ref\n ) => {\n return (\n <hr\n className={styles.separatorLine}\n aria-hidden={true}\n color={color}\n style={{\n backgroundColor: color,\n height: vertical ? size || \"100%\" : width || \"1px\",\n width: vertical ? width || \"1px\" : size || \"100%\",\n }}\n ref={ref}\n />\n );\n }\n);\n","import styled from \"@emotion/styled\";\nimport * as React from \"react\";\nimport { CSSProperties, forwardRef, MouseEventHandler } from \"react\";\nimport { ButtonElementProps } from \"../../types/ElementProps\";\n\nexport interface ClickableProps extends ButtonElementProps {\n /** Callback function called when clicking on click area. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Callback function called when double clicking on click area. */\n onDblClick?: MouseEventHandler<HTMLButtonElement>;\n /** Adds a title to the click area. */\n tooltip?: string;\n /** If set, there is no opacity applies when clicking on the click area. */\n disableOpacityOnClick?: boolean;\n /** Mouse does not turn into pointer when hovering over click area. */\n disablePointer?: boolean;\n /** When set, click area receives opacity when mouse hovers over it. */\n opacityOnHover?: boolean;\n /** Custom style on div with click event. */\n style?: CSSProperties;\n /** Disables shadow when element is focused. */\n disableFocusHighlight?: boolean;\n /** Disables the HTML button element. */\n disabled?: boolean;\n /**\n * Sets the background of the box.\n */\n background?: string;\n /**\n * Sets the background of the box when the box is in focus.\n */\n focusBackground?: string;\n /**\n * Sets the background of the box when hovering with mouse.\n */\n hoverBackground?: string;\n /**\n * The width.\n */\n width?: string;\n /**\n * The height.\n */\n height?: string;\n /**\n * Border radius\n */\n borderRadius?: string;\n}\n\ninterface ClickableElementProps {\n disableOpacityOnClick?: boolean;\n opacityOnHover?: boolean;\n disableFocusHighlight?: boolean;\n pointer?: boolean;\n background?: string;\n focusBackground?: string;\n hoverBackground?: string;\n width?: string;\n height?: string;\n borderRadius?: string;\n}\n\nconst ClickableElement = styled.button<ClickableElementProps>`\n display: inline-block;\n user-select: none;\n border: 0;\n padding: 0;\n background: ${({ background }) => background};\n ${({ pointer }) => (pointer ? \"cursor: pointer;\" : \"\")}\n\n :hover {\n ${(props) => (props.opacityOnHover ? \"opacity: 0.7;\" : \"\")};\n ${({ hoverBackground }) => `background: ${hoverBackground};`}\n }\n :active {\n ${({ disableOpacityOnClick }) =>\n !disableOpacityOnClick ? \"opacity: 0.5;\" : \"\"}\n }\n :focus {\n outline: 0;\n ${({ disableFocusHighlight }) =>\n disableFocusHighlight\n ? \"\"\n : \"box-shadow: 0 0 3pt 2pt rgba(0, 0, 100, 0.3);\"}\n ${({ focusBackground }) => `background: ${focusBackground};`}\n }\n ${({ width }) => (width ? `width: ${width};` : \"\")}\n ${({ height }) => (height ? `height: ${height};` : \"\")}\n ${({ borderRadius }) =>\n borderRadius ? `border-radius: ${borderRadius};` : \"\"}\n`;\n\nexport const Clickable = forwardRef<HTMLButtonElement, ClickableProps>(\n (\n {\n disableFocusHighlight,\n onClick,\n onDblClick,\n tooltip,\n disableOpacityOnClick,\n disablePointer,\n opacityOnHover,\n disabled,\n children,\n background = \"transparent\",\n hoverBackground,\n focusBackground,\n type = \"button\",\n ...restProps\n },\n ref\n ) => {\n const hasClickHandler = !!(onClick || onDblClick);\n\n return (\n <ClickableElement\n opacityOnHover={opacityOnHover}\n title={tooltip}\n disabled={disabled}\n disableOpacityOnClick={disableOpacityOnClick}\n onClick={onClick}\n onDoubleClick={onDblClick}\n disableFocusHighlight={disableFocusHighlight}\n pointer={hasClickHandler && !disablePointer}\n ref={ref}\n background={background}\n hoverBackground={hoverBackground}\n focusBackground={focusBackground}\n type={type}\n {...restProps}\n >\n {children}\n </ClickableElement>\n );\n }\n);\n","export const booleanOrNumberToNumber = (\n num: number | boolean | undefined\n): number => {\n if (num == null) {\n return 0;\n }\n if (typeof num === \"boolean\") {\n return num ? 1 : 0;\n }\n return num;\n};\n\nexport const numberToMetricCalc = (num: number): string | undefined => {\n if (num === 0) {\n return undefined;\n }\n return `calc(${num} * var(--swui-metrics-space))`;\n};\n\nexport const booleanOrNumberToMetricCalc = (\n num: number | boolean | undefined\n): string | undefined => numberToMetricCalc(booleanOrNumberToNumber(num));\n","import isPropValid from \"@emotion/is-prop-valid\";\nimport styled from \"@emotion/styled\";\nimport { Property } from \"csstype\";\n\nimport {\n background,\n BackgroundProps,\n border,\n borderBottom,\n BorderBottomProps,\n borderColor,\n borderLeft,\n BorderLeftProps,\n borderRadius,\n BorderRadiusProps,\n borderRight,\n BorderRightProps,\n borderStyle,\n BorderStyleProps,\n borderTop,\n BorderTopProps,\n borderWidth,\n BorderWidthProps,\n bottom,\n BottomProps,\n boxShadow,\n BoxShadowProps,\n flexbox,\n FlexboxProps,\n layout,\n LayoutProps,\n left,\n LeftProps,\n overflow,\n OverflowProps,\n position,\n PositionProps,\n ResponsiveValue,\n right,\n RightProps,\n system,\n TLengthStyledSystem,\n top,\n TopProps,\n zIndex,\n ZIndexProps,\n} from \"styled-system\";\nimport { DivProps } from \"../../../types/ElementProps\";\nimport {\n booleanOrNumberToMetricCalc,\n booleanOrNumberToNumber,\n} from \"../../../utils/BooleanOrNumberToNumber\";\n\ninterface StyledSystemProps\n extends BorderRadiusProps,\n BorderStyleProps,\n BorderWidthProps,\n BorderLeftProps,\n BorderRightProps,\n BorderTopProps,\n BorderBottomProps,\n FlexboxProps,\n LayoutProps,\n OverflowProps,\n PositionProps,\n ZIndexProps,\n LeftProps,\n RightProps,\n TopProps,\n BottomProps {}\n\nconst shadows = {\n box: \"var(--swui-shadow-box)\",\n popover: \"var(--swui-shadow-popover)\",\n modal: \"var(--swui-shadow-modal)\",\n bottom: \"var(--swui-shadow-bottom)\",\n};\n\ntype ShadowType = keyof typeof shadows;\n\nexport interface BoxProps extends StyledSystemProps, DivProps {\n /**\n * If true, children are placed in a row.\n */\n row?: ResponsiveValue<boolean>;\n\n /**\n * Adds spacing over and under content.\n */\n spacing?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds spacing left and right of content.\n */\n indent?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds spacing between children.\n */\n gap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds gap between columns.\n */\n columnGap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds gap between rows.\n */\n rowGap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds a shadow around the box.\n */\n shadow?: ResponsiveValue<Property.BoxShadow | ShadowType>;\n\n /**\n * Sets the background of the box.\n */\n background?: ResponsiveValue<Property.Background<TLengthStyledSystem>>;\n\n /**\n * Sets the border of the box.\n */\n border?: ResponsiveValue<Property.Border<TLengthStyledSystem>>;\n\n /**\n * Sets the border color of the box.\n */\n borderColor?: ResponsiveValue<Property.BorderColor>;\n\n /**\n * Sets the background of the box when hovering with mouse.\n */\n hoverBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when hovering with mouse.\n */\n hoverBorder?: Property.Border<TLengthStyledSystem>;\n\n /**\n * Sets the background of the box when the box is in focus.\n */\n focusBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when the box is in focus.\n */\n focusBorder?: Property.Border<TLengthStyledSystem>;\n\n /**\n * Sets the background of the box when focus is within the box.\n */\n focusWithinBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when focus is within the box.\n */\n focusWithinBorder?: Property.Border<TLengthStyledSystem>;\n}\n\nconst excludedProps = [\n \"spacing\",\n \"indent\",\n \"gap\",\n \"width\",\n \"height\",\n \"overflow\",\n \"display\",\n];\n\nconst isExcludedWebUiProp = (propName: string) =>\n excludedProps.includes(propName);\n\nconst box = system({\n row: {\n property: \"flexDirection\",\n transform: (row: boolean) => (row ? \"row\" : \"column\"),\n },\n indent: {\n // @ts-ignore\n property: \"--current-indent\",\n transform: booleanOrNumberToNumber,\n },\n spacing: {\n // @ts-ignore\n property: \"--current-spacing\",\n transform: booleanOrNumberToNumber,\n },\n gap: {\n // @ts-ignore\n property: \"--current-gap\",\n transform: booleanOrNumberToNumber,\n },\n columnGap: {\n property: \"columnGap\",\n transform: booleanOrNumberToMetricCalc,\n },\n rowGap: {\n property: \"rowGap\",\n transform: booleanOrNumberToMetricCalc,\n },\n shadow: {\n property: \"boxShadow\",\n transform: (value) => shadows[value] ?? value,\n },\n});\n\ntype InnerProps = BoxProps & BoxShadowProps & BackgroundProps;\n\nexport const Box = styled(\"div\", {\n shouldForwardProp: (propName) =>\n typeof propName === \"string\"\n ? isExcludedWebUiProp(propName)\n ? false\n : isPropValid(propName)\n : false,\n})<InnerProps>`\n --current-spacing: 0;\n --current-indent: 0;\n --current-gap: 0;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n ${box};\n ${background};\n ${border};\n ${borderRight};\n ${borderLeft};\n ${borderTop};\n ${borderBottom};\n ${borderColor};\n ${borderRadius};\n ${borderStyle};\n ${borderWidth};\n ${boxShadow};\n ${flexbox};\n ${overflow};\n ${position};\n ${layout};\n ${zIndex};\n ${left};\n ${right};\n ${top};\n ${bottom};\n\n gap: calc(var(--current-gap) * var(--swui-metrics-space));\n\n padding: calc(var(--current-spacing) * var(--swui-metrics-spacing))\n calc(var(--current-indent) * var(--swui-metrics-indent));\n\n :hover {\n ${({ hoverBackground }) =>\n hoverBackground ? `background: ${hoverBackground};` : \"\"}\n ${({ hoverBorder }) => (hoverBorder ? `border: ${hoverBorder};` : \"\")}\n }\n\n :focus {\n ${({ focusBackground }) =>\n focusBackground ? `background: ${focusBackground};` : \"\"}\n ${({ focusBorder }) => (focusBorder ? `border: ${focusBorder};` : \"\")}\n }\n\n :focus-within {\n ${({ focusWithinBackground }) =>\n focusWithinBackground ? `background: ${focusWithinBackground};` : \"\"}\n ${({ focusWithinBorder }) =>\n focusWithinBorder ? `border: ${focusWithinBorder};` : \"\"}\n }\n`;\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\n\nexport const Column = forwardRef<HTMLDivElement, BoxProps>(function Column(\n props,\n ref\n) {\n return <Box ref={ref} {...props} />;\n});\n","import { RefObject, useCallback, useLayoutEffect, useState } from \"react\";\n\nexport interface ElementDimensions {\n width: number;\n height: number;\n top: number;\n left: number;\n x: number;\n y: number;\n right: number;\n bottom: number;\n}\n\nexport const getDimensionObject = (node: HTMLElement): ElementDimensions => {\n const { x, y, width, height, bottom, top, left, right } =\n node.getBoundingClientRect();\n\n return {\n width,\n height,\n top,\n left,\n x,\n y,\n right,\n bottom,\n };\n};\n\nconst isEqualDimensions = (\n a: ElementDimensions,\n b: ElementDimensions\n): boolean =>\n a.x === b.x &&\n a.y === b.y &&\n a.width === b.width &&\n a.height === b.height &&\n a.bottom === b.bottom &&\n a.top === b.top &&\n a.left === b.left &&\n a.right === b.right;\n\nexport const useElementDimensions = (\n ref: RefObject<HTMLElement>,\n onResizeElement?: (dimensions: ElementDimensions) => void\n) => {\n const [dimensions, setDimensions] = useState<ElementDimensions | undefined>();\n\n const updateDimensions = useCallback(() => {\n window.requestAnimationFrame(() => {\n if (ref.current) {\n const newDimensions = getDimensionObject(ref.current);\n if (!dimensions || !isEqualDimensions(dimensions, newDimensions)) {\n if (onResizeElement) {\n onResizeElement(newDimensions);\n }\n }\n setDimensions(newDimensions);\n }\n });\n }, [ref, dimensions, setDimensions, onResizeElement]);\n\n useLayoutEffect(() => {\n updateDimensions();\n }, [updateDimensions]);\n\n return {\n dimensions,\n };\n};\n","import * as React from \"react\";\nimport { forwardRef, RefObject, useRef } from \"react\";\nimport { Box, BoxProps } from \"./Box\";\nimport {\n ElementDimensions,\n useElementDimensions,\n} from \"../../../hooks/UseElementDimensions\";\n\nexport interface ResizeAwareBoxProps extends BoxProps {\n onResize?: (dimensions: ElementDimensions) => void;\n}\n\nexport const ResizeAwareBox = forwardRef<HTMLDivElement, ResizeAwareBoxProps>(\n function ResizeAwareBox({ onResize, ...boxProps }, ref) {\n const localRef = useRef<HTMLDivElement>(null);\n const currentRef = (ref as RefObject<HTMLDivElement>) ?? localRef;\n useElementDimensions(currentRef, onResize);\n\n return <Box {...boxProps} ref={ref} />;\n }\n);\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\n\nexport const Row = forwardRef<HTMLDivElement, BoxProps>(function Row(\n props,\n ref\n) {\n return <Box row ref={ref} {...props} />;\n});\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\nimport { ResponsiveValue, TLengthStyledSystem } from \"styled-system\";\n\nexport interface IndentProps extends BoxProps {\n num?: ResponsiveValue<boolean | TLengthStyledSystem>;\n}\n\nexport const Indent = forwardRef<HTMLDivElement, IndentProps>(function Indent(\n { num = 1, ...props },\n ref\n) {\n return <Box indent={num} ref={ref} {...props} />;\n});\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\nimport { ResponsiveValue, TLengthStyledSystem } from \"styled-system\";\n\nexport interface SpacingProps extends BoxProps {\n num?: ResponsiveValue<boolean | TLengthStyledSystem>;\n}\n\nexport const Spacing = forwardRef<HTMLDivElement, SpacingProps>(\n function Spacing({ num = 1, ...props }, ref) {\n return <Box spacing={num} ref={ref} {...props} />;\n }\n);\n","import styled from \"@emotion/styled\";\nimport * as React from \"react\";\n\nexport interface SpaceProps {\n half?: boolean;\n horizontal?: boolean;\n num?: number;\n vertical?: boolean;\n}\n\nconst InnerSpace = styled.div`\n --current-size: 1;\n flex: none;\n width: calc(var(--current-size) * var(--swui-metrics-space));\n height: calc(var(--current-size) * var(--swui-metrics-space));\n`;\n\nexport const Space: React.VFC<SpaceProps> = ({\n half = false,\n horizontal = false,\n num = 1,\n vertical = false,\n}) => {\n const size = num * (half ? 0.5 : 1);\n\n return (\n <InnerSpace\n style={{\n [\"--current-size\" as string]: size,\n height: horizontal ? 1 : undefined,\n width: vertical ? 1 : undefined,\n }}\n />\n );\n};\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\n\ninterface Props {\n nest?: boolean;\n render: (children: ReactNode) => ReactNode;\n children?: ReactNode;\n}\n\nexport const Nest: React.FC<Props> = ({ children, nest, render }) => {\n if (nest) {\n return <>{render(children)}</>;\n }\n return <>{children}</>;\n};\n","import { pickBy } from \"lodash-es\";\n\nexport const getDataProps = <T extends Record<string, unknown>>(\n props: Record<string, unknown> | {}\n): T => pickBy(props, isDataPropMapper) as T;\n\nconst isDataPropMapper = (_: unknown, key: string): boolean => isDataProp(key);\n\nconst isDataProp = <TProp extends string>(propName: TProp): boolean =>\n propName.startsWith(\"data-\") || propName.startsWith(\"aria-\");\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport styles from \"./ScreenReaderOnlyText.module.css\";\nimport { getDataProps } from \"../../utils/PropsForwarder\";\n\nexport interface ScreenReaderOnlyTextProps {\n children?: ReactNode;\n}\n\nexport const ScreenReaderOnlyText: React.FC<ScreenReaderOnlyTextProps> = ({\n children,\n ...props\n}) => {\n return (\n <span className={styles.visuallyHidden} {...getDataProps(props)}>\n {children}\n </span>\n );\n};\n","import * as React from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./Text.module.css\";\nimport { SpanProps } from \"../../types/ElementProps\";\nimport { Property } from \"csstype\";\nimport { forwardRef } from \"react\";\n\nexport interface TextProps extends SpanProps {\n variant?: TextVariant;\n size?: TextSize;\n userSelect?: Property.UserSelect;\n whiteSpace?: Property.WhiteSpace;\n wordBreak?: Property.WordBreak;\n textAlign?: Property.TextAlign;\n color?: string;\n}\n\nexport type TextVariant = \"standard\" | \"caption\" | \"overline\" | \"bold\";\nexport type TextSize = \"large\" | \"medium\" | \"small\" | \"smaller\";\n\nexport const Text = forwardRef<HTMLSpanElement, TextProps>(\n (\n {\n children,\n variant = \"standard\",\n size = \"medium\",\n className,\n color,\n userSelect,\n whiteSpace,\n wordBreak,\n textAlign,\n style,\n ...spanProps\n },\n ref\n ) => {\n return (\n <span\n className={cx(styles.text, styles[variant], styles[size], className)}\n ref={ref}\n style={{\n color,\n userSelect,\n whiteSpace,\n wordBreak,\n textAlign,\n ...style,\n }}\n {...spanProps}\n >\n {children}\n </span>\n );\n }\n);\n\nexport const Txt = Text;\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const SmallText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"small\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const SmallerText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"smaller\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const StandardText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"medium\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const LargeText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"large\"} {...props} />;\n};\n","import cx from \"classnames\";\nimport { Property } from \"csstype\";\nimport * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { H1Props } from \"../../types/ElementProps\";\nimport styles from \"./Heading.module.css\";\n\nexport interface HeadingProps extends H1Props {\n variant?: HeadingVariant;\n whiteSpace?: Property.WhiteSpace;\n wordBreak?: Property.WordBreak;\n as?: HeadingVariant;\n}\n\nexport type HeadingVariant = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(\n (\n {\n variant = \"h3\",\n className,\n color,\n whiteSpace,\n wordBreak,\n style,\n children,\n as,\n ...hProps\n },\n ref\n ) => {\n const Element = as ?? variant;\n return (\n <Element\n className={cx(styles.heading, styles[variant], className)}\n style={{ color, whiteSpace, wordBreak, ...style }}\n ref={ref}\n {...hProps}\n >\n {children}\n </Element>\n );\n }\n);\n","import * as React from \"react\";\nimport { Heading, HeadingProps } from \"../heading/Heading\";\n\n/**\n * @deprecated Please use `Heading` instead.\n */\nexport const HeaderText: React.FC<Omit<HeadingProps, \"variant\">> = (props) => {\n return <Heading variant={\"h2\"} {...props} />;\n};\n","import { useCallback } from \"react\";\n\ntype ArrayItemEqualsComparator<T> = (a: T, b: T) => boolean;\n\nconst defaultComparator = <T>(a: T, b: T) => a === b;\n\nexport const useArraySet = <T>(\n list: Array<T>,\n setList: (list: Array<T>) => void,\n comparator: ArrayItemEqualsComparator<T> = defaultComparator\n) => {\n const add = useCallback(\n (item: T) => {\n if (!list.some((l) => comparator(l, item))) {\n setList([...list, item]);\n }\n },\n [list, setList, comparator]\n );\n\n const addMultiple = useCallback(\n (items: Array<T>) => {\n setList(\n items.reduce((list, item) => {\n if (!list.some((l) => comparator(l, item))) {\n return [...list, item];\n }\n return list;\n }, list)\n );\n },\n [list, setList, comparator]\n );\n\n const remove = useCallback(\n (item: T) => {\n const index = list.findIndex((l) => comparator(l, item));\n if (index >= 0) {\n setList(list.filter((_, i) => i !== index));\n }\n },\n [list, setList, comparator]\n );\n\n const removeMultiple = useCallback(\n (items: Array<T>) => {\n setList(list.filter((item) => !items.some((l) => comparator(l, item))));\n },\n [list, setList, comparator]\n );\n\n const toggle = useCallback(\n (item: T) => {\n const found = list.some((l) => comparator(l, item));\n if (found) {\n remove(item);\n } else {\n add(item);\n }\n },\n [list, add, remove, comparator]\n );\n\n return {\n add,\n addMultiple,\n remove,\n removeMultiple,\n toggle,\n };\n};\n","import { useCallback, useState } from \"react\";\n\ntype Value = boolean;\ntype SetTrue = () => void;\ntype SetFalse = () => void;\ntype ToggleValue = () => void;\ntype BooleanHook = [Value, SetTrue, SetFalse, ToggleValue];\n\nexport const useBoolean = (initialValue: Value): BooleanHook => {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, [setValue]);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, [setValue]);\n\n const toggle = useCallback(() => {\n setValue((v) => !v);\n }, [setValue]);\n\n return [value, setTrue, setFalse, toggle];\n};\n","import { useEffect, useState } from \"react\";\n\nexport const useDebounce = <T>(value: T, delay: number): T => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]); // Only re-call effect if value or delay changes\n\n return debouncedValue;\n};\n","import { useEffect, useState } from \"react\";\n\nexport const useDelayedFalse = (value: boolean, delay: number) => {\n const [debouncedValue, setDebouncedValue] = useState<boolean>(value);\n\n useEffect(() => {\n if (value) {\n setDebouncedValue(true);\n }\n\n const handler = setTimeout(() => {\n if (!value) {\n setDebouncedValue(value);\n }\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n};\n","import { useEffect, useState } from \"react\";\n\nlet id = 0;\nconst genId = (componentName?: string) =>\n `webui-${componentName ? componentName + \"-\" : \"\"}${++id}`;\n\n/** @deprecated use useId-hook from React 18 */\nexport const useDomId = (componentName?: string): string => {\n const [id, setId] = useState<string | null>(() => genId(componentName));\n useEffect(() => setId(genId(componentName)), [componentName]);\n return id!;\n};\n","import { RefObject, useEffect, useRef } from \"react\";\n\ntype EventHandler<TEventName extends keyof HTMLElementEventMap> = (\n event: HTMLElementEventMap[TEventName]\n) => void;\n\nexport const useEventListener = <TEventName extends keyof HTMLElementEventMap>(\n ref: RefObject<HTMLElement>,\n eventName: TEventName,\n handler: EventHandler<TEventName>\n) => {\n // Create a ref that stores handler\n const savedHandler = useRef<EventHandler<TEventName>>();\n\n // Update ref.current value if handler changes.\n // This allows our effect below to always get latest handler ...\n // ... without us needing to pass it in effect deps array ...\n // ... and potentially cause effect to re-run every render.\n useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n // Make sure element supports addEventListener\n const isSupported = ref.current && ref.current.addEventListener;\n if (!isSupported) return;\n\n // Create event listener that calls handler function stored in ref\n const eventListener: EventHandler<TEventName> = (event) => {\n if (savedHandler.current) {\n return savedHandler.current(event);\n }\n };\n\n // Add event listener\n if (!ref.current) {\n return;\n }\n\n const element = ref.current;\n element.addEventListener(eventName, eventListener);\n\n // Remove event listener on cleanup\n return () => {\n if (element) {\n element.removeEventListener(eventName, eventListener);\n }\n };\n }, [eventName, ref]); // Re-run if eventName or element changes\n};\n","import { RefObject, useCallback, useEffect } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useElementFocus = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [isInFocus, setIsInFocus, setIsNotInFocus] = useBoolean(false);\n\n useEffect(() => {\n if (document.activeElement === ReactDOM.findDOMNode(ref.current)) {\n setIsInFocus();\n } else {\n setIsNotInFocus();\n }\n }, [ref, setIsNotInFocus, setIsInFocus]);\n\n useEventListener(ref, \"focus\", setIsInFocus);\n useEventListener(ref, \"blur\", setIsNotInFocus);\n\n const focus = useCallback(() => {\n if (ref.current) {\n ref.current.focus();\n }\n }, [ref]);\n\n const blur = useCallback(() => {\n if (ref.current) {\n ref.current.blur();\n }\n }, [ref]);\n\n return { isInFocus, focus, blur };\n};\n","import { RefObject } from \"react\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useMouseIsOver = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [mouseIsOver, setMouseIsOver, setMouseIsNotOver] = useBoolean(false);\n\n useEventListener(ref, \"mouseover\", setMouseIsOver);\n useEventListener(ref, \"mouseout\", setMouseIsNotOver);\n\n return mouseIsOver;\n};\n","import { RefObject } from \"react\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useMouseIsEntered = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [mouseIsEntered, setMouseIsEntered, setMouseIsNotEntered] =\n useBoolean(false);\n\n useEventListener(ref, \"mouseenter\", setMouseIsEntered);\n useEventListener(ref, \"mouseleave\", setMouseIsNotEntered);\n\n return mouseIsEntered;\n};\n","import * as React from \"react\";\nimport { useEffect, useRef } from \"react\";\n\nexport const useMultiOnClickOutside = (\n refs: Array<React.RefObject<any>>,\n handler: (event: TouchEvent | MouseEvent) => void\n) => {\n const eventHandler = useRef<(event: TouchEvent | MouseEvent) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n const listener = (event: TouchEvent | MouseEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n\n const allNotContains = refs\n .filter((ref) => ref.current)\n .every((ref) => {\n return ref.current && !ref.current.contains(event.target);\n });\n\n if (!allNotContains) {\n return;\n }\n\n eventHandler.current(event);\n };\n\n document.addEventListener(\"mousedown\", listener);\n document.addEventListener(\"touchstart\", listener);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener);\n document.removeEventListener(\"touchstart\", listener);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...refs]);\n};\n","import * as React from \"react\";\nimport { useEffect, useRef } from \"react\";\n\nexport const useOnClickOutside = (\n ref: React.RefObject<any>,\n handler: (event: TouchEvent | MouseEvent) => void,\n options?: AddEventListenerOptions\n) => {\n const eventHandler = useRef<(event: TouchEvent | MouseEvent) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n const listener = (event: TouchEvent | MouseEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n if (!ref.current || ref.current.contains(event.target)) {\n return;\n }\n\n eventHandler.current(event);\n };\n\n document.addEventListener(\"mousedown\", listener, options);\n document.addEventListener(\"touchstart\", listener, options);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener, options);\n document.removeEventListener(\"touchstart\", listener, options);\n };\n }, [ref, options]);\n};\n","import { debounce } from \"lodash-es\";\nimport { useEffect, useRef } from \"react\";\n\nconst events = [\"mousemove\", \"mousedown\", \"keydown\", \"touchstart\", \"scroll\"];\n\nexport const useOnNoMouseMovement = (callback: () => void, delay: number) => {\n const eventHandler = useRef<(event: Event) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = callback;\n }, [callback]);\n\n useEffect(() => {\n const onIdleChange = debounce(eventHandler.current, delay);\n events.forEach((event) => window.addEventListener(event, onIdleChange));\n\n return () => {\n events.forEach((event) =>\n window.removeEventListener(event, onIdleChange)\n );\n };\n }, [delay]);\n};\n","import { RefObject, useEffect, useMemo, useState } from \"react\";\n\nexport const useOnScreen = (\n ref: RefObject<Element>,\n options?: IntersectionObserverInit\n) => {\n const [isVisible, setIsVisible] = useState(false);\n\n const { rootMargin, root, threshold } = options || {};\n\n const observer = useMemo(() => {\n return new IntersectionObserver(\n ([entry]) => setIsVisible(entry.isIntersecting),\n {\n rootMargin,\n root,\n threshold,\n }\n );\n }, [setIsVisible, rootMargin, root, threshold]);\n\n useEffect(() => {\n if (ref.current) {\n observer.observe(ref.current);\n }\n return () => {\n observer.disconnect();\n };\n }, [observer, ref]);\n\n return isVisible;\n};\n","import {\n MutableRefObject,\n RefCallback,\n RefObject,\n useEffect,\n useRef,\n} from \"react\";\n\nexport const useForwardedRef = <T>(\n ref: RefCallback<T> | MutableRefObject<T> | null\n): RefObject<NonNullable<T>> => {\n const innerRef = useRef<T>(null) as MutableRefObject<NonNullable<T>>;\n\n useEffect(() => {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(innerRef.current);\n } else {\n ref.current = innerRef.current;\n }\n });\n\n return innerRef;\n};\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport const useTimeoutState = <S>(\n initialValue: S,\n defaultTimeout: number,\n clearTimeoutOnSetValue = true\n): [S, (v: S) => void] => {\n const [value, setValue] = useState<S>(initialValue);\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n const wrappedSetter = useCallback(\n (newValue: S, timeout = defaultTimeout) => {\n setValue(newValue);\n if (clearTimeoutOnSetValue) {\n clearTimeout(timeoutRef.current!);\n }\n timeoutRef.current = setTimeout(() => setValue(initialValue), timeout);\n },\n [defaultTimeout, clearTimeoutOnSetValue, initialValue]\n );\n\n useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current!);\n };\n }, []);\n\n return [value, wrappedSetter];\n};\n","export const exhaustSwitchCaseElseThrow = (arg: never) => {\n throw new Error(`Switch unhandled case: ${arg}`);\n};\n\nexport const exhaustSwitchCase = <T>(_arg: never, fallback: T) => {\n return fallback;\n};\n","export const truthyKeysAsList = (r: Record<string, boolean>): Array<string> =>\n Object.keys(r).filter((key) => r[key]);\n","export const parseFloatElseUndefined = (s: string): number | undefined => {\n try {\n const f = parseFloat(s);\n if (isNaN(f)) {\n return undefined;\n }\n if (f == null) {\n return undefined;\n }\n return f;\n } catch (e) {}\n return undefined;\n};\n\nexport const parseIntElseUndefined = (s: string): number | undefined => {\n try {\n const f = parseInt(s, 10);\n if (isNaN(f)) {\n return undefined;\n }\n if (f == null) {\n return undefined;\n }\n return f;\n } catch (e) {}\n return undefined;\n};\n"],"names":["SeparatorLine","forwardRef","color","cssColor","size","width","vertical","ref","jsx","styles","ClickableElement","styled","background","pointer","props","hoverBackground","disableOpacityOnClick","disableFocusHighlight","focusBackground","height","borderRadius","Clickable","onClick","onDblClick","tooltip","disablePointer","opacityOnHover","disabled","children","type","restProps","booleanOrNumberToNumber","num","numberToMetricCalc","booleanOrNumberToMetricCalc","shadows","excludedProps","isExcludedWebUiProp","propName","box","system","row","value","Box","isPropValid","border","borderRight","borderLeft","borderTop","borderBottom","borderColor","borderStyle","borderWidth","boxShadow","flexbox","overflow","position","layout","zIndex","left","right","top","bottom","hoverBorder","focusBorder","focusWithinBackground","focusWithinBorder","Column","getDimensionObject","node","x","y","isEqualDimensions","a","b","useElementDimensions","onResizeElement","dimensions","setDimensions","useState","updateDimensions","useCallback","newDimensions","useLayoutEffect","ResizeAwareBox","onResize","boxProps","localRef","useRef","Row","Indent","Spacing","InnerSpace","Space","half","horizontal","Nest","nest","render","Fragment","getDataProps","pickBy","isDataPropMapper","_","key","isDataProp","ScreenReaderOnlyText","Text","variant","className","userSelect","whiteSpace","wordBreak","textAlign","style","spanProps","cx","Txt","SmallText","SmallerText","StandardText","LargeText","Heading","as","hProps","HeaderText","defaultComparator","useArraySet","list","setList","comparator","add","item","l","addMultiple","items","remove","index","i","removeMultiple","toggle","useBoolean","initialValue","setValue","setTrue","setFalse","v","useDebounce","delay","debouncedValue","setDebouncedValue","useEffect","handler","useDelayedFalse","id","genId","componentName","useDomId","setId","useEventListener","eventName","savedHandler","eventListener","event","element","useElementFocus","isInFocus","setIsInFocus","setIsNotInFocus","ReactDOM","focus","blur","useMouseIsOver","mouseIsOver","setMouseIsOver","setMouseIsNotOver","useMouseIsEntered","mouseIsEntered","setMouseIsEntered","setMouseIsNotEntered","useMultiOnClickOutside","refs","eventHandler","listener","useOnClickOutside","options","events","useOnNoMouseMovement","callback","onIdleChange","debounce","useOnScreen","isVisible","setIsVisible","rootMargin","root","threshold","observer","useMemo","entry","useForwardedRef","innerRef","useTimeoutState","defaultTimeout","clearTimeoutOnSetValue","timeoutRef","wrappedSetter","newValue","timeout","exhaustSwitchCaseElseThrow","arg","exhaustSwitchCase","_arg","fallback","truthyKeysAsList","r","parseFloatElseUndefined","s","f","parseIntElseUndefined"],"mappings":";;;;;;;;;;;GAaaA,KAAgBC;AAAA,EAC3B,CACE;AAAA,IACE,OAAAC,IAAQC,EAAS,qBAAqB;AAAA,IACtC,MAAAC,IAAO;AAAA,IACP,OAAAC,IAAQ;AAAA,IACR,UAAAC,IAA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,MAAA;AACI,UAAAC,IAAI,WAAWD,CAAC;AAItB,WAHI,MAAMC,CAAC,KAGPA,KAAK,OACA,SAEFA;AAAA,UACG;AAAA,EAAC;AAEf,GAEaC,KAAwB,CAACF,MAAkC;AAClE,MAAA;AACI,UAAAC,IAAI,SAASD,GAAG,EAAE;AAIxB,WAHI,MAAMC,CAAC,KAGPA,KAAK,OACA,SAEFA;AAAA,UACG;AAAA,EAAC;AAEf;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/components/decorators/separatorline/SeparatorLine.tsx","../src/components/interaction/Clickable.tsx","../src/utils/BooleanOrNumberToNumber.ts","../src/components/util/IsPropValid.ts","../src/components/layout/box/Box.tsx","../src/components/layout/column/Column.tsx","../src/hooks/UseElementDimensions.ts","../src/components/layout/box/ResizeAwareBox.tsx","../src/components/layout/row/Row.tsx","../src/components/layout/indent/Indent.tsx","../src/components/layout/spacing/Spacing.tsx","../src/components/layout/space/Space.tsx","../src/components/util/Nest.tsx","../src/utils/PropsForwarder.ts","../src/components/accessibility/ScreenReaderOnlyText.tsx","../src/components/text/Text.tsx","../src/components/deprecated-text/SmallText.tsx","../src/components/deprecated-text/SmallerText.tsx","../src/components/deprecated-text/StandardText.tsx","../src/components/deprecated-text/LargeText.tsx","../src/components/heading/Heading.tsx","../src/components/deprecated-text/HeaderText.tsx","../src/hooks/UseArraySet.ts","../src/hooks/UseBoolean.ts","../src/hooks/UseDebounce.ts","../src/hooks/UseDelayedFalse.ts","../src/hooks/UseDomId.ts","../src/hooks/UseEventListener.ts","../src/hooks/UseElementFocus.ts","../src/hooks/UseMouseIsOver.ts","../src/hooks/UseMouseIsEntered.ts","../src/hooks/UseMultiOnClickOutside.ts","../src/hooks/UseOnClickOutside.ts","../src/hooks/UseOnNoMouseInput.ts","../src/hooks/UseOnScreen.ts","../src/hooks/UseForwardedRef.ts","../src/hooks/UseTimeoutState.ts","../src/utils/SwitchCaseExhauster.ts","../src/utils/TruthyKeysAsList.ts","../src/utils/parsers/NumberParser.ts"],"sourcesContent":["import { Property } from \"csstype\";\nimport * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { cssColor } from \"@stenajs-webui/theme\";\nimport styles from \"./SeparatorLine.module.css\";\n\nexport interface SeparatorLineProps {\n color?: Property.Color;\n vertical?: boolean;\n size?: string;\n width?: string;\n}\n\nexport const SeparatorLine = forwardRef<HTMLHRElement, SeparatorLineProps>(\n (\n {\n color = cssColor(\"--lhds-color-ui-300\"),\n size = \"100%\",\n width = \"1px\",\n vertical = false,\n },\n ref\n ) => {\n return (\n <hr\n className={styles.separatorLine}\n aria-hidden={true}\n color={color}\n style={{\n backgroundColor: color,\n height: vertical ? size || \"100%\" : width || \"1px\",\n width: vertical ? width || \"1px\" : size || \"100%\",\n }}\n ref={ref}\n />\n );\n }\n);\n","import styled from \"@emotion/styled\";\nimport * as React from \"react\";\nimport { CSSProperties, forwardRef, MouseEventHandler } from \"react\";\nimport { ButtonElementProps } from \"../../types/ElementProps\";\n\nexport interface ClickableProps extends ButtonElementProps {\n /** Callback function called when clicking on click area. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n /** Callback function called when double clicking on click area. */\n onDblClick?: MouseEventHandler<HTMLButtonElement>;\n /** Adds a title to the click area. */\n tooltip?: string;\n /** If set, there is no opacity applies when clicking on the click area. */\n disableOpacityOnClick?: boolean;\n /** Mouse does not turn into pointer when hovering over click area. */\n disablePointer?: boolean;\n /** When set, click area receives opacity when mouse hovers over it. */\n opacityOnHover?: boolean;\n /** Custom style on div with click event. */\n style?: CSSProperties;\n /** Disables shadow when element is focused. */\n disableFocusHighlight?: boolean;\n /** Disables the HTML button element. */\n disabled?: boolean;\n /**\n * Sets the background of the box.\n */\n background?: string;\n /**\n * Sets the background of the box when the box is in focus.\n */\n focusBackground?: string;\n /**\n * Sets the background of the box when hovering with mouse.\n */\n hoverBackground?: string;\n /**\n * The width.\n */\n width?: string;\n /**\n * The height.\n */\n height?: string;\n /**\n * Border radius\n */\n borderRadius?: string;\n}\n\ninterface ClickableElementProps {\n disableOpacityOnClick?: boolean;\n opacityOnHover?: boolean;\n disableFocusHighlight?: boolean;\n pointer?: boolean;\n background?: string;\n focusBackground?: string;\n hoverBackground?: string;\n width?: string;\n height?: string;\n borderRadius?: string;\n}\n\nconst ClickableElement = styled.button<ClickableElementProps>`\n display: inline-block;\n user-select: none;\n border: 0;\n padding: 0;\n background: ${({ background }) => background};\n ${({ pointer }) => (pointer ? \"cursor: pointer;\" : \"\")}\n\n :hover {\n ${(props) => (props.opacityOnHover ? \"opacity: 0.7;\" : \"\")};\n ${({ hoverBackground }) => `background: ${hoverBackground};`}\n }\n :active {\n ${({ disableOpacityOnClick }) =>\n !disableOpacityOnClick ? \"opacity: 0.5;\" : \"\"}\n }\n :focus {\n outline: 0;\n ${({ disableFocusHighlight }) =>\n disableFocusHighlight\n ? \"\"\n : \"box-shadow: 0 0 3pt 2pt rgba(0, 0, 100, 0.3);\"}\n ${({ focusBackground }) => `background: ${focusBackground};`}\n }\n ${({ width }) => (width ? `width: ${width};` : \"\")}\n ${({ height }) => (height ? `height: ${height};` : \"\")}\n ${({ borderRadius }) =>\n borderRadius ? `border-radius: ${borderRadius};` : \"\"}\n`;\n\nexport const Clickable = forwardRef<HTMLButtonElement, ClickableProps>(\n (\n {\n disableFocusHighlight,\n onClick,\n onDblClick,\n tooltip,\n disableOpacityOnClick,\n disablePointer,\n opacityOnHover,\n disabled,\n children,\n background = \"transparent\",\n hoverBackground,\n focusBackground,\n type = \"button\",\n ...restProps\n },\n ref\n ) => {\n const hasClickHandler = !!(onClick || onDblClick);\n\n return (\n <ClickableElement\n opacityOnHover={opacityOnHover}\n title={tooltip}\n disabled={disabled}\n disableOpacityOnClick={disableOpacityOnClick}\n onClick={onClick}\n onDoubleClick={onDblClick}\n disableFocusHighlight={disableFocusHighlight}\n pointer={hasClickHandler && !disablePointer}\n ref={ref}\n background={background}\n hoverBackground={hoverBackground}\n focusBackground={focusBackground}\n type={type}\n {...restProps}\n >\n {children}\n </ClickableElement>\n );\n }\n);\n","export const booleanOrNumberToNumber = (\n num: number | boolean | undefined\n): number => {\n if (num == null) {\n return 0;\n }\n if (typeof num === \"boolean\") {\n return num ? 1 : 0;\n }\n return num;\n};\n\nexport const numberToMetricCalc = (num: number): string | undefined => {\n if (num === 0) {\n return undefined;\n }\n return `calc(${num} * var(--swui-metrics-space))`;\n};\n\nexport const booleanOrNumberToMetricCalc = (\n num: number | boolean | undefined\n): string | undefined => numberToMetricCalc(booleanOrNumberToNumber(num));\n","import { memoize } from \"lodash-es\";\n\nconst validPropsRecord = {\n // react props\n // https://github.com/facebook/react/blob/5495a7f24aef85ba6937truetrue1ce962673ca9f5fde6/src/renderers/dom/shared/hooks/ReactDOMUnknownPropertyHook.js\n children: true,\n dangerouslySetInnerHTML: true,\n key: true,\n ref: true,\n autoFocus: true,\n defaultValue: true,\n defaultChecked: true,\n innerHTML: true,\n suppressContentEditableWarning: true,\n suppressHydrationWarning: true,\n // deprecated react prop\n valueLink: true,\n\n // https://github.com/facebook/react/blob/d7157651f7b72d9888ctrue123e191f9b88cd8f41e9/src/renderers/dom/shared/HTMLDOMPropertyConfig.js\n /**\n * Standard Properties\n */\n\n abbr: true,\n accept: true,\n acceptCharset: true,\n accessKey: true,\n action: true,\n allow: true,\n allowUserMedia: true,\n allowPaymentRequest: true,\n allowFullScreen: true,\n allowTransparency: true,\n alt: true,\n // specifies target context for links with `preload` type\n // as: true,\n async: true,\n autoComplete: true,\n // autoFocus is polyfilled/normalized by AutoFocusUtils\n // autoFocus: true,\n autoPlay: true,\n capture: true,\n cellPadding: true,\n cellSpacing: true,\n // keygen prop\n challenge: true,\n charSet: true,\n checked: true,\n cite: true,\n classID: true,\n className: true,\n cols: true,\n colSpan: true,\n content: true,\n contentEditable: true,\n contextMenu: true,\n controls: true,\n controlsList: true,\n coords: true,\n crossOrigin: true,\n data: true, // For `<object />` acts as `src`.\n dateTime: true,\n decoding: true,\n default: true,\n defer: true,\n dir: true,\n disabled: true,\n disablePictureInPicture: true,\n disableRemotePlayback: true,\n download: true,\n draggable: true,\n encType: true,\n enterKeyHint: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n frameBorder: true,\n headers: true,\n height: true,\n hidden: true,\n high: true,\n href: true,\n hrefLang: true,\n htmlFor: true,\n httpEquiv: true,\n id: true,\n inputMode: true,\n integrity: true,\n is: true,\n keyParams: true,\n keyType: true,\n kind: true,\n label: true,\n lang: true,\n list: true,\n loading: true,\n loop: true,\n low: true,\n // manifest: true,\n marginHeight: true,\n marginWidth: true,\n max: true,\n maxLength: true,\n media: true,\n mediaGroup: true,\n method: true,\n min: true,\n minLength: true,\n // Caution; `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`.\n multiple: true,\n muted: true,\n name: true,\n nonce: true,\n noValidate: true,\n open: true,\n optimum: true,\n pattern: true,\n placeholder: true,\n playsInline: true,\n poster: true,\n preload: true,\n profile: true,\n radioGroup: true,\n readOnly: true,\n referrerPolicy: true,\n rel: true,\n required: true,\n reversed: true,\n role: true,\n rows: true,\n rowSpan: true,\n sandbox: true,\n scope: true,\n scoped: true,\n scrolling: true,\n seamless: true,\n selected: true,\n shape: true,\n size: true,\n sizes: true,\n // support for projecting regular DOM Elements via V1 named slots ( shadow dom )\n slot: true,\n span: true,\n spellCheck: true,\n src: true,\n srcDoc: true,\n srcLang: true,\n srcSet: true,\n start: true,\n step: true,\n style: true,\n summary: true,\n tabIndex: true,\n target: true,\n title: true,\n translate: true,\n // Setting .type throws on non-<input> tags\n type: true,\n useMap: true,\n value: true,\n width: true,\n wmode: true,\n wrap: true,\n\n /**\n * RDFa Properties\n */\n about: true,\n datatype: true,\n inlist: true,\n prefix: true,\n // property is also supported for OpenGraph in meta tags.\n property: true,\n resource: true,\n typeof: true,\n vocab: true,\n\n /**\n * Non-standard Properties\n */\n // autoCapitalize and autoCorrect are supported in Mobile Safari for\n // keyboard hints.\n autoCapitalize: true,\n autoCorrect: true,\n // autoSave allows WebKit/Blink to persist values of input fields on page reloads\n autoSave: true,\n // color is for Safari mask-icon link\n color: true,\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search#incremental_This_API_has_not_been_standardized\n incremental: true,\n // used in amp html for indicating the fallback behavior\n // https://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/placeholders/\n fallback: true,\n // https://html.spec.whatwg.org/multipage/interaction.html#inert\n inert: true,\n // itemProp, itemScope, itemType are for\n // Microdata support. See http://schema.org/docs/gs.html\n itemProp: true,\n itemScope: true,\n itemType: true,\n // itemID and itemRef are for Microdata support as well but\n // only specified in the WHATWG spec document. See\n // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api\n itemID: true,\n itemRef: true,\n // used in amp html for eventing purposes\n // https://amp.dev/documentation/guides-and-tutorials/learn/common_attributes/\n on: true,\n // used in amp html for indicating that the option is selectable\n // https://amp.dev/documentation/components/amp-selector/\n option: true,\n // results show looking glass icon and recent searches on input\n // search fields in WebKit/Blink\n results: true,\n // IE-only attribute that specifies security restrictions on an iframe\n // as an alternative to the sandbox attribute on IE<1true\n security: true,\n // IE-only attribute that controls focus behavior\n unselectable: true,\n //\n // SVG properties: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute\n // The following \"onX\" events have been omitted:\n //\n // onabort\n // onactivate\n // onbegin\n // onclick\n // onend\n // onerror\n // onfocusin\n // onfocusout\n // onload\n // onmousedown\n // onmousemove\n // onmouseout\n // onmouseover\n // onmouseup\n // onrepeat\n // onresize\n // onscroll\n // onunload\n accentHeight: true,\n accumulate: true,\n additive: true,\n alignmentBaseline: true,\n allowReorder: true,\n alphabetic: true,\n amplitude: true,\n arabicForm: true,\n ascent: true,\n attributeName: true,\n attributeType: true,\n autoReverse: true,\n azimuth: true,\n baseFrequency: true,\n baselineShift: true,\n baseProfile: true,\n bbox: true,\n begin: true,\n bias: true,\n by: true,\n calcMode: true,\n capHeight: true,\n clip: true,\n clipPathUnits: true,\n clipPath: true,\n clipRule: true,\n colorInterpolation: true,\n colorInterpolationFilters: true,\n colorProfile: true,\n colorRendering: true,\n contentScriptType: true,\n contentStyleType: true,\n cursor: true,\n cx: true,\n cy: true,\n d: true,\n decelerate: true,\n descent: true,\n diffuseConstant: true,\n direction: true,\n display: true,\n divisor: true,\n dominantBaseline: true,\n dur: true,\n dx: true,\n dy: true,\n edgeMode: true,\n elevation: true,\n enableBackground: true,\n end: true,\n exponent: true,\n externalResourcesRequired: true,\n fill: true,\n fillOpacity: true,\n fillRule: true,\n filter: true,\n filterRes: true,\n filterUnits: true,\n floodColor: true,\n floodOpacity: true,\n focusable: true,\n fontFamily: true,\n fontSize: true,\n fontSizeAdjust: true,\n fontStretch: true,\n fontStyle: true,\n fontVariant: true,\n fontWeight: true,\n format: true,\n from: true,\n fr: true, // valid SVG element but React will ask for removal\n fx: true,\n fy: true,\n g1: true,\n g2: true,\n glyphName: true,\n glyphOrientationHorizontal: true,\n glyphOrientationVertical: true,\n glyphRef: true,\n gradientTransform: true,\n gradientUnits: true,\n hanging: true,\n horizAdvX: true,\n horizOriginX: true,\n ideographic: true,\n imageRendering: true,\n in: true,\n in2: true,\n intercept: true,\n k: true,\n k1: true,\n k2: true,\n k3: true,\n k4: true,\n kernelMatrix: true,\n kernelUnitLength: true,\n kerning: true,\n keyPoints: true,\n keySplines: true,\n keyTimes: true,\n lengthAdjust: true,\n letterSpacing: true,\n lightingColor: true,\n limitingConeAngle: true,\n local: true,\n markerEnd: true,\n markerMid: true,\n markerStart: true,\n markerHeight: true,\n markerUnits: true,\n markerWidth: true,\n mask: true,\n maskContentUnits: true,\n maskUnits: true,\n mathematical: true,\n mode: true,\n numOctaves: true,\n offset: true,\n opacity: true,\n operator: true,\n order: true,\n orient: true,\n orientation: true,\n origin: true,\n overflow: true,\n overlinePosition: true,\n overlineThickness: true,\n panose1: true,\n paintOrder: true,\n pathLength: true,\n patternContentUnits: true,\n patternTransform: true,\n patternUnits: true,\n pointerEvents: true,\n points: true,\n pointsAtX: true,\n pointsAtY: true,\n pointsAtZ: true,\n preserveAlpha: true,\n preserveAspectRatio: true,\n primitiveUnits: true,\n r: true,\n radius: true,\n refX: true,\n refY: true,\n renderingIntent: true,\n repeatCount: true,\n repeatDur: true,\n requiredExtensions: true,\n requiredFeatures: true,\n restart: true,\n result: true,\n rotate: true,\n rx: true,\n ry: true,\n scale: true,\n seed: true,\n shapeRendering: true,\n slope: true,\n spacing: true,\n specularConstant: true,\n specularExponent: true,\n speed: true,\n spreadMethod: true,\n startOffset: true,\n stdDeviation: true,\n stemh: true,\n stemv: true,\n stitchTiles: true,\n stopColor: true,\n stopOpacity: true,\n strikethroughPosition: true,\n strikethroughThickness: true,\n string: true,\n stroke: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeLinecap: true,\n strokeLinejoin: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true,\n surfaceScale: true,\n systemLanguage: true,\n tableValues: true,\n targetX: true,\n targetY: true,\n textAnchor: true,\n textDecoration: true,\n textRendering: true,\n textLength: true,\n to: true,\n transform: true,\n u1: true,\n u2: true,\n underlinePosition: true,\n underlineThickness: true,\n unicode: true,\n unicodeBidi: true,\n unicodeRange: true,\n unitsPerEm: true,\n vAlphabetic: true,\n vHanging: true,\n vIdeographic: true,\n vMathematical: true,\n values: true,\n vectorEffect: true,\n version: true,\n vertAdvY: true,\n vertOriginX: true,\n vertOriginY: true,\n viewBox: true,\n viewTarget: true,\n visibility: true,\n widths: true,\n wordSpacing: true,\n writingMode: true,\n x: true,\n xHeight: true,\n x1: true,\n x2: true,\n xChannelSelector: true,\n xlinkActuate: true,\n xlinkArcrole: true,\n xlinkHref: true,\n xlinkRole: true,\n xlinkShow: true,\n xlinkTitle: true,\n xlinkType: true,\n xmlBase: true,\n xmlns: true,\n xmlnsXlink: true,\n xmlLang: true,\n xmlSpace: true,\n y: true,\n y1: true,\n y2: true,\n yChannelSelector: true,\n z: true,\n zoomAndPan: true,\n\n // For preact. We have this code here even though Emotion doesn't support\n // Preact, since @emotion/is-prop-valid is used by some libraries outside of\n // the context of Emotion.\n for: true,\n class: true,\n autofocus: true,\n};\n\nconst validProps = `/^((${Object.keys(validPropsRecord).join(\n \"|\"\n)})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/`;\n\nconst r = new RegExp(validProps);\n\nexport const isPropValid: (prop: string) => boolean = memoize(\n (prop: string) =>\n r.test(prop) ||\n (prop.charCodeAt(0) === 111 /* o */ &&\n prop.charCodeAt(1) === 110 /* n */ &&\n prop.charCodeAt(2) < 91) /* Z+1 */\n);\n","import styled from \"@emotion/styled\";\nimport { Property } from \"csstype\";\n\nimport {\n background,\n BackgroundProps,\n border,\n borderBottom,\n BorderBottomProps,\n borderColor,\n borderLeft,\n BorderLeftProps,\n borderRadius,\n BorderRadiusProps,\n borderRight,\n BorderRightProps,\n borderStyle,\n BorderStyleProps,\n borderTop,\n BorderTopProps,\n borderWidth,\n BorderWidthProps,\n bottom,\n BottomProps,\n boxShadow,\n BoxShadowProps,\n flexbox,\n FlexboxProps,\n layout,\n LayoutProps,\n left,\n LeftProps,\n overflow,\n OverflowProps,\n position,\n PositionProps,\n ResponsiveValue,\n right,\n RightProps,\n system,\n TLengthStyledSystem,\n top,\n TopProps,\n zIndex,\n ZIndexProps,\n} from \"styled-system\";\nimport { DivProps } from \"../../../types/ElementProps\";\nimport {\n booleanOrNumberToMetricCalc,\n booleanOrNumberToNumber,\n} from \"../../../utils/BooleanOrNumberToNumber\";\nimport { isPropValid } from \"../../util/IsPropValid\";\n\ninterface StyledSystemProps\n extends BorderRadiusProps,\n BorderStyleProps,\n BorderWidthProps,\n BorderLeftProps,\n BorderRightProps,\n BorderTopProps,\n BorderBottomProps,\n FlexboxProps,\n LayoutProps,\n OverflowProps,\n PositionProps,\n ZIndexProps,\n LeftProps,\n RightProps,\n TopProps,\n BottomProps {}\n\nconst shadows = {\n box: \"var(--swui-shadow-box)\",\n popover: \"var(--swui-shadow-popover)\",\n modal: \"var(--swui-shadow-modal)\",\n bottom: \"var(--swui-shadow-bottom)\",\n};\n\ntype ShadowType = keyof typeof shadows;\n\nexport interface BoxProps extends StyledSystemProps, DivProps {\n /**\n * If true, children are placed in a row.\n */\n row?: ResponsiveValue<boolean>;\n\n /**\n * Adds spacing over and under content.\n */\n spacing?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds spacing left and right of content.\n */\n indent?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds spacing between children.\n */\n gap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds gap between columns.\n */\n columnGap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds gap between rows.\n */\n rowGap?: ResponsiveValue<boolean | TLengthStyledSystem>;\n\n /**\n * Adds a shadow around the box.\n */\n shadow?: ResponsiveValue<Property.BoxShadow | ShadowType>;\n\n /**\n * Sets the background of the box.\n */\n background?: ResponsiveValue<Property.Background<TLengthStyledSystem>>;\n\n /**\n * Sets the border of the box.\n */\n border?: ResponsiveValue<Property.Border<TLengthStyledSystem>>;\n\n /**\n * Sets the border color of the box.\n */\n borderColor?: ResponsiveValue<Property.BorderColor>;\n\n /**\n * Sets the background of the box when hovering with mouse.\n */\n hoverBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when hovering with mouse.\n */\n hoverBorder?: Property.Border<TLengthStyledSystem>;\n\n /**\n * Sets the background of the box when the box is in focus.\n */\n focusBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when the box is in focus.\n */\n focusBorder?: Property.Border<TLengthStyledSystem>;\n\n /**\n * Sets the background of the box when focus is within the box.\n */\n focusWithinBackground?: Property.Background<TLengthStyledSystem>;\n\n /**\n * Sets the border of the box when focus is within the box.\n */\n focusWithinBorder?: Property.Border<TLengthStyledSystem>;\n}\n\nconst excludedProps = [\n \"spacing\",\n \"indent\",\n \"gap\",\n \"width\",\n \"height\",\n \"overflow\",\n \"display\",\n];\n\nconst isExcludedWebUiProp = (propName: string) =>\n excludedProps.includes(propName);\n\nconst box = system({\n row: {\n property: \"flexDirection\",\n transform: (row: boolean) => (row ? \"row\" : \"column\"),\n },\n indent: {\n // @ts-ignore\n property: \"--current-indent\",\n transform: booleanOrNumberToNumber,\n },\n spacing: {\n // @ts-ignore\n property: \"--current-spacing\",\n transform: booleanOrNumberToNumber,\n },\n gap: {\n // @ts-ignore\n property: \"--current-gap\",\n transform: booleanOrNumberToNumber,\n },\n columnGap: {\n property: \"columnGap\",\n transform: booleanOrNumberToMetricCalc,\n },\n rowGap: {\n property: \"rowGap\",\n transform: booleanOrNumberToMetricCalc,\n },\n shadow: {\n property: \"boxShadow\",\n transform: (value) => shadows[value] ?? value,\n },\n});\n\ntype InnerProps = BoxProps & BoxShadowProps & BackgroundProps;\n\nexport const Box = styled(\"div\", {\n shouldForwardProp: (propName) =>\n typeof propName === \"string\"\n ? isExcludedWebUiProp(propName)\n ? false\n : isPropValid(propName)\n : false,\n})<InnerProps>`\n --current-spacing: 0;\n --current-indent: 0;\n --current-gap: 0;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n ${box};\n ${background};\n ${border};\n ${borderRight};\n ${borderLeft};\n ${borderTop};\n ${borderBottom};\n ${borderColor};\n ${borderRadius};\n ${borderStyle};\n ${borderWidth};\n ${boxShadow};\n ${flexbox};\n ${overflow};\n ${position};\n ${layout};\n ${zIndex};\n ${left};\n ${right};\n ${top};\n ${bottom};\n\n gap: calc(var(--current-gap) * var(--swui-metrics-space));\n\n padding: calc(var(--current-spacing) * var(--swui-metrics-spacing))\n calc(var(--current-indent) * var(--swui-metrics-indent));\n\n :hover {\n ${({ hoverBackground }) =>\n hoverBackground ? `background: ${hoverBackground};` : \"\"}\n ${({ hoverBorder }) => (hoverBorder ? `border: ${hoverBorder};` : \"\")}\n }\n\n :focus {\n ${({ focusBackground }) =>\n focusBackground ? `background: ${focusBackground};` : \"\"}\n ${({ focusBorder }) => (focusBorder ? `border: ${focusBorder};` : \"\")}\n }\n\n :focus-within {\n ${({ focusWithinBackground }) =>\n focusWithinBackground ? `background: ${focusWithinBackground};` : \"\"}\n ${({ focusWithinBorder }) =>\n focusWithinBorder ? `border: ${focusWithinBorder};` : \"\"}\n }\n`;\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\n\nexport const Column = forwardRef<HTMLDivElement, BoxProps>(function Column(\n props,\n ref\n) {\n return <Box ref={ref} {...props} />;\n});\n","import { RefObject, useCallback, useLayoutEffect, useState } from \"react\";\n\nexport interface ElementDimensions {\n width: number;\n height: number;\n top: number;\n left: number;\n x: number;\n y: number;\n right: number;\n bottom: number;\n}\n\nexport const getDimensionObject = (node: HTMLElement): ElementDimensions => {\n const { x, y, width, height, bottom, top, left, right } =\n node.getBoundingClientRect();\n\n return {\n width,\n height,\n top,\n left,\n x,\n y,\n right,\n bottom,\n };\n};\n\nconst isEqualDimensions = (\n a: ElementDimensions,\n b: ElementDimensions\n): boolean =>\n a.x === b.x &&\n a.y === b.y &&\n a.width === b.width &&\n a.height === b.height &&\n a.bottom === b.bottom &&\n a.top === b.top &&\n a.left === b.left &&\n a.right === b.right;\n\nexport const useElementDimensions = (\n ref: RefObject<HTMLElement>,\n onResizeElement?: (dimensions: ElementDimensions) => void\n) => {\n const [dimensions, setDimensions] = useState<ElementDimensions | undefined>();\n\n const updateDimensions = useCallback(() => {\n window.requestAnimationFrame(() => {\n if (ref.current) {\n const newDimensions = getDimensionObject(ref.current);\n if (!dimensions || !isEqualDimensions(dimensions, newDimensions)) {\n if (onResizeElement) {\n onResizeElement(newDimensions);\n }\n }\n setDimensions(newDimensions);\n }\n });\n }, [ref, dimensions, setDimensions, onResizeElement]);\n\n useLayoutEffect(() => {\n updateDimensions();\n }, [updateDimensions]);\n\n return {\n dimensions,\n };\n};\n","import * as React from \"react\";\nimport { forwardRef, RefObject, useRef } from \"react\";\nimport { Box, BoxProps } from \"./Box\";\nimport {\n ElementDimensions,\n useElementDimensions,\n} from \"../../../hooks/UseElementDimensions\";\n\nexport interface ResizeAwareBoxProps extends BoxProps {\n onResize?: (dimensions: ElementDimensions) => void;\n}\n\nexport const ResizeAwareBox = forwardRef<HTMLDivElement, ResizeAwareBoxProps>(\n function ResizeAwareBox({ onResize, ...boxProps }, ref) {\n const localRef = useRef<HTMLDivElement>(null);\n const currentRef = (ref as RefObject<HTMLDivElement>) ?? localRef;\n useElementDimensions(currentRef, onResize);\n\n return <Box {...boxProps} ref={ref} />;\n }\n);\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\n\nexport const Row = forwardRef<HTMLDivElement, BoxProps>(function Row(\n props,\n ref\n) {\n return <Box row ref={ref} {...props} />;\n});\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\nimport { ResponsiveValue, TLengthStyledSystem } from \"styled-system\";\n\nexport interface IndentProps extends BoxProps {\n num?: ResponsiveValue<boolean | TLengthStyledSystem>;\n}\n\nexport const Indent = forwardRef<HTMLDivElement, IndentProps>(function Indent(\n { num = 1, ...props },\n ref\n) {\n return <Box indent={num} ref={ref} {...props} />;\n});\n","import * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { Box, BoxProps } from \"../box/Box\";\nimport { ResponsiveValue, TLengthStyledSystem } from \"styled-system\";\n\nexport interface SpacingProps extends BoxProps {\n num?: ResponsiveValue<boolean | TLengthStyledSystem>;\n}\n\nexport const Spacing = forwardRef<HTMLDivElement, SpacingProps>(\n function Spacing({ num = 1, ...props }, ref) {\n return <Box spacing={num} ref={ref} {...props} />;\n }\n);\n","import styled from \"@emotion/styled\";\nimport * as React from \"react\";\n\nexport interface SpaceProps {\n half?: boolean;\n horizontal?: boolean;\n num?: number;\n vertical?: boolean;\n}\n\nconst InnerSpace = styled.div`\n --current-size: 1;\n flex: none;\n width: calc(var(--current-size) * var(--swui-metrics-space));\n height: calc(var(--current-size) * var(--swui-metrics-space));\n`;\n\nexport const Space: React.VFC<SpaceProps> = ({\n half = false,\n horizontal = false,\n num = 1,\n vertical = false,\n}) => {\n const size = num * (half ? 0.5 : 1);\n\n return (\n <InnerSpace\n style={{\n [\"--current-size\" as string]: size,\n height: horizontal ? 1 : undefined,\n width: vertical ? 1 : undefined,\n }}\n />\n );\n};\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\n\ninterface Props {\n nest?: boolean;\n render: (children: ReactNode) => ReactNode;\n children?: ReactNode;\n}\n\nexport const Nest: React.FC<Props> = ({ children, nest, render }) => {\n if (nest) {\n return <>{render(children)}</>;\n }\n return <>{children}</>;\n};\n","import { pickBy } from \"lodash-es\";\n\nexport const getDataProps = <T extends Record<string, unknown>>(\n props: Record<string, unknown> | {}\n): T => pickBy(props, isDataPropMapper) as T;\n\nconst isDataPropMapper = (_: unknown, key: string): boolean => isDataProp(key);\n\nconst isDataProp = <TProp extends string>(propName: TProp): boolean =>\n propName.startsWith(\"data-\") || propName.startsWith(\"aria-\");\n","import * as React from \"react\";\nimport { ReactNode } from \"react\";\nimport styles from \"./ScreenReaderOnlyText.module.css\";\nimport { getDataProps } from \"../../utils/PropsForwarder\";\n\nexport interface ScreenReaderOnlyTextProps {\n children?: ReactNode;\n}\n\nexport const ScreenReaderOnlyText: React.FC<ScreenReaderOnlyTextProps> = ({\n children,\n ...props\n}) => {\n return (\n <span className={styles.visuallyHidden} {...getDataProps(props)}>\n {children}\n </span>\n );\n};\n","import * as React from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./Text.module.css\";\nimport { SpanProps } from \"../../types/ElementProps\";\nimport { Property } from \"csstype\";\nimport { forwardRef } from \"react\";\n\nexport interface TextProps extends SpanProps {\n variant?: TextVariant;\n size?: TextSize;\n userSelect?: Property.UserSelect;\n whiteSpace?: Property.WhiteSpace;\n wordBreak?: Property.WordBreak;\n textAlign?: Property.TextAlign;\n color?: string;\n}\n\nexport type TextVariant = \"standard\" | \"caption\" | \"overline\" | \"bold\";\nexport type TextSize = \"large\" | \"medium\" | \"small\" | \"smaller\";\n\nexport const Text = forwardRef<HTMLSpanElement, TextProps>(\n (\n {\n children,\n variant = \"standard\",\n size = \"medium\",\n className,\n color,\n userSelect,\n whiteSpace,\n wordBreak,\n textAlign,\n style,\n ...spanProps\n },\n ref\n ) => {\n return (\n <span\n className={cx(styles.text, styles[variant], styles[size], className)}\n ref={ref}\n style={{\n color,\n userSelect,\n whiteSpace,\n wordBreak,\n textAlign,\n ...style,\n }}\n {...spanProps}\n >\n {children}\n </span>\n );\n }\n);\n\nexport const Txt = Text;\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const SmallText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"small\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const SmallerText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"smaller\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const StandardText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"medium\"} {...props} />;\n};\n","import * as React from \"react\";\nimport { Text, TextProps } from \"../text/Text\";\n\n/**\n * @deprecated Please use `Text` instead.\n */\nexport const LargeText: React.FC<Omit<TextProps, \"size\">> = (props) => {\n return <Text size={\"large\"} {...props} />;\n};\n","import cx from \"classnames\";\nimport { Property } from \"csstype\";\nimport * as React from \"react\";\nimport { forwardRef } from \"react\";\nimport { H1Props } from \"../../types/ElementProps\";\nimport styles from \"./Heading.module.css\";\n\nexport interface HeadingProps extends H1Props {\n variant?: HeadingVariant;\n whiteSpace?: Property.WhiteSpace;\n wordBreak?: Property.WordBreak;\n as?: HeadingVariant;\n}\n\nexport type HeadingVariant = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(\n (\n {\n variant = \"h3\",\n className,\n color,\n whiteSpace,\n wordBreak,\n style,\n children,\n as,\n ...hProps\n },\n ref\n ) => {\n const Element = as ?? variant;\n return (\n <Element\n className={cx(styles.heading, styles[variant], className)}\n style={{ color, whiteSpace, wordBreak, ...style }}\n ref={ref}\n {...hProps}\n >\n {children}\n </Element>\n );\n }\n);\n","import * as React from \"react\";\nimport { Heading, HeadingProps } from \"../heading/Heading\";\n\n/**\n * @deprecated Please use `Heading` instead.\n */\nexport const HeaderText: React.FC<Omit<HeadingProps, \"variant\">> = (props) => {\n return <Heading variant={\"h2\"} {...props} />;\n};\n","import { useCallback } from \"react\";\n\ntype ArrayItemEqualsComparator<T> = (a: T, b: T) => boolean;\n\nconst defaultComparator = <T>(a: T, b: T) => a === b;\n\nexport const useArraySet = <T>(\n list: Array<T>,\n setList: (list: Array<T>) => void,\n comparator: ArrayItemEqualsComparator<T> = defaultComparator\n) => {\n const add = useCallback(\n (item: T) => {\n if (!list.some((l) => comparator(l, item))) {\n setList([...list, item]);\n }\n },\n [list, setList, comparator]\n );\n\n const addMultiple = useCallback(\n (items: Array<T>) => {\n setList(\n items.reduce((list, item) => {\n if (!list.some((l) => comparator(l, item))) {\n return [...list, item];\n }\n return list;\n }, list)\n );\n },\n [list, setList, comparator]\n );\n\n const remove = useCallback(\n (item: T) => {\n const index = list.findIndex((l) => comparator(l, item));\n if (index >= 0) {\n setList(list.filter((_, i) => i !== index));\n }\n },\n [list, setList, comparator]\n );\n\n const removeMultiple = useCallback(\n (items: Array<T>) => {\n setList(list.filter((item) => !items.some((l) => comparator(l, item))));\n },\n [list, setList, comparator]\n );\n\n const toggle = useCallback(\n (item: T) => {\n const found = list.some((l) => comparator(l, item));\n if (found) {\n remove(item);\n } else {\n add(item);\n }\n },\n [list, add, remove, comparator]\n );\n\n return {\n add,\n addMultiple,\n remove,\n removeMultiple,\n toggle,\n };\n};\n","import { useCallback, useState } from \"react\";\n\ntype Value = boolean;\ntype SetTrue = () => void;\ntype SetFalse = () => void;\ntype ToggleValue = () => void;\ntype BooleanHook = [Value, SetTrue, SetFalse, ToggleValue];\n\nexport const useBoolean = (initialValue: Value): BooleanHook => {\n const [value, setValue] = useState(initialValue);\n\n const setTrue = useCallback(() => {\n setValue(true);\n }, [setValue]);\n\n const setFalse = useCallback(() => {\n setValue(false);\n }, [setValue]);\n\n const toggle = useCallback(() => {\n setValue((v) => !v);\n }, [setValue]);\n\n return [value, setTrue, setFalse, toggle];\n};\n","import { useEffect, useState } from \"react\";\n\nexport const useDebounce = <T>(value: T, delay: number): T => {\n // State and setters for debounced value\n const [debouncedValue, setDebouncedValue] = useState<T>(value);\n\n useEffect(() => {\n // Update debounced value after delay\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n // Cancel the timeout if value changes (also on delay change or unmount)\n // This is how we prevent debounced value from updating if value is changed ...\n // .. within the delay period. Timeout gets cleared and restarted.\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]); // Only re-call effect if value or delay changes\n\n return debouncedValue;\n};\n","import { useEffect, useState } from \"react\";\n\nexport const useDelayedFalse = (value: boolean, delay: number) => {\n const [debouncedValue, setDebouncedValue] = useState<boolean>(value);\n\n useEffect(() => {\n if (value) {\n setDebouncedValue(true);\n }\n\n const handler = setTimeout(() => {\n if (!value) {\n setDebouncedValue(value);\n }\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n};\n","import { useEffect, useState } from \"react\";\n\nlet id = 0;\nconst genId = (componentName?: string) =>\n `webui-${componentName ? componentName + \"-\" : \"\"}${++id}`;\n\n/** @deprecated use useId-hook from React 18 */\nexport const useDomId = (componentName?: string): string => {\n const [id, setId] = useState<string | null>(() => genId(componentName));\n useEffect(() => setId(genId(componentName)), [componentName]);\n return id!;\n};\n","import { RefObject, useEffect, useRef } from \"react\";\n\ntype EventHandler<TEventName extends keyof HTMLElementEventMap> = (\n event: HTMLElementEventMap[TEventName]\n) => void;\n\nexport const useEventListener = <TEventName extends keyof HTMLElementEventMap>(\n ref: RefObject<HTMLElement>,\n eventName: TEventName,\n handler: EventHandler<TEventName>\n) => {\n // Create a ref that stores handler\n const savedHandler = useRef<EventHandler<TEventName>>();\n\n // Update ref.current value if handler changes.\n // This allows our effect below to always get latest handler ...\n // ... without us needing to pass it in effect deps array ...\n // ... and potentially cause effect to re-run every render.\n useEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n // Make sure element supports addEventListener\n const isSupported = ref.current && ref.current.addEventListener;\n if (!isSupported) return;\n\n // Create event listener that calls handler function stored in ref\n const eventListener: EventHandler<TEventName> = (event) => {\n if (savedHandler.current) {\n return savedHandler.current(event);\n }\n };\n\n // Add event listener\n if (!ref.current) {\n return;\n }\n\n const element = ref.current;\n element.addEventListener(eventName, eventListener);\n\n // Remove event listener on cleanup\n return () => {\n if (element) {\n element.removeEventListener(eventName, eventListener);\n }\n };\n }, [eventName, ref]); // Re-run if eventName or element changes\n};\n","import { RefObject, useCallback, useEffect } from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useElementFocus = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [isInFocus, setIsInFocus, setIsNotInFocus] = useBoolean(false);\n\n useEffect(() => {\n if (document.activeElement === ReactDOM.findDOMNode(ref.current)) {\n setIsInFocus();\n } else {\n setIsNotInFocus();\n }\n }, [ref, setIsNotInFocus, setIsInFocus]);\n\n useEventListener(ref, \"focus\", setIsInFocus);\n useEventListener(ref, \"blur\", setIsNotInFocus);\n\n const focus = useCallback(() => {\n if (ref.current) {\n ref.current.focus();\n }\n }, [ref]);\n\n const blur = useCallback(() => {\n if (ref.current) {\n ref.current.blur();\n }\n }, [ref]);\n\n return { isInFocus, focus, blur };\n};\n","import { RefObject } from \"react\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useMouseIsOver = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [mouseIsOver, setMouseIsOver, setMouseIsNotOver] = useBoolean(false);\n\n useEventListener(ref, \"mouseover\", setMouseIsOver);\n useEventListener(ref, \"mouseout\", setMouseIsNotOver);\n\n return mouseIsOver;\n};\n","import { RefObject } from \"react\";\nimport { useBoolean } from \"./UseBoolean\";\nimport { useEventListener } from \"./UseEventListener\";\n\nexport const useMouseIsEntered = <TElement extends HTMLElement>(\n ref: RefObject<TElement>\n) => {\n const [mouseIsEntered, setMouseIsEntered, setMouseIsNotEntered] =\n useBoolean(false);\n\n useEventListener(ref, \"mouseenter\", setMouseIsEntered);\n useEventListener(ref, \"mouseleave\", setMouseIsNotEntered);\n\n return mouseIsEntered;\n};\n","import * as React from \"react\";\nimport { useEffect, useRef } from \"react\";\n\nexport const useMultiOnClickOutside = (\n refs: Array<React.RefObject<any>>,\n handler: (event: TouchEvent | MouseEvent) => void\n) => {\n const eventHandler = useRef<(event: TouchEvent | MouseEvent) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n const listener = (event: TouchEvent | MouseEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n\n const allNotContains = refs\n .filter((ref) => ref.current)\n .every((ref) => {\n return ref.current && !ref.current.contains(event.target);\n });\n\n if (!allNotContains) {\n return;\n }\n\n eventHandler.current(event);\n };\n\n document.addEventListener(\"mousedown\", listener);\n document.addEventListener(\"touchstart\", listener);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener);\n document.removeEventListener(\"touchstart\", listener);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [...refs]);\n};\n","import * as React from \"react\";\nimport { useEffect, useRef } from \"react\";\n\nexport const useOnClickOutside = (\n ref: React.RefObject<any>,\n handler: (event: TouchEvent | MouseEvent) => void,\n options?: AddEventListenerOptions\n) => {\n const eventHandler = useRef<(event: TouchEvent | MouseEvent) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n const listener = (event: TouchEvent | MouseEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n if (!ref.current || ref.current.contains(event.target)) {\n return;\n }\n\n eventHandler.current(event);\n };\n\n document.addEventListener(\"mousedown\", listener, options);\n document.addEventListener(\"touchstart\", listener, options);\n\n return () => {\n document.removeEventListener(\"mousedown\", listener, options);\n document.removeEventListener(\"touchstart\", listener, options);\n };\n }, [ref, options]);\n};\n","import { debounce } from \"lodash-es\";\nimport { useEffect, useRef } from \"react\";\n\nconst events = [\"mousemove\", \"mousedown\", \"keydown\", \"touchstart\", \"scroll\"];\n\nexport const useOnNoMouseMovement = (callback: () => void, delay: number) => {\n const eventHandler = useRef<(event: Event) => void>(() => {\n return;\n });\n\n useEffect(() => {\n eventHandler.current = callback;\n }, [callback]);\n\n useEffect(() => {\n const onIdleChange = debounce(eventHandler.current, delay);\n events.forEach((event) => window.addEventListener(event, onIdleChange));\n\n return () => {\n events.forEach((event) =>\n window.removeEventListener(event, onIdleChange)\n );\n };\n }, [delay]);\n};\n","import { RefObject, useEffect, useMemo, useState } from \"react\";\n\nexport const useOnScreen = (\n ref: RefObject<Element>,\n options?: IntersectionObserverInit\n) => {\n const [isVisible, setIsVisible] = useState(false);\n\n const { rootMargin, root, threshold } = options || {};\n\n const observer = useMemo(() => {\n return new IntersectionObserver(\n ([entry]) => setIsVisible(entry.isIntersecting),\n {\n rootMargin,\n root,\n threshold,\n }\n );\n }, [setIsVisible, rootMargin, root, threshold]);\n\n useEffect(() => {\n if (ref.current) {\n observer.observe(ref.current);\n }\n return () => {\n observer.disconnect();\n };\n }, [observer, ref]);\n\n return isVisible;\n};\n","import {\n MutableRefObject,\n RefCallback,\n RefObject,\n useEffect,\n useRef,\n} from \"react\";\n\nexport const useForwardedRef = <T>(\n ref: RefCallback<T> | MutableRefObject<T> | null\n): RefObject<NonNullable<T>> => {\n const innerRef = useRef<T>(null) as MutableRefObject<NonNullable<T>>;\n\n useEffect(() => {\n if (!ref) return;\n if (typeof ref === \"function\") {\n ref(innerRef.current);\n } else {\n ref.current = innerRef.current;\n }\n });\n\n return innerRef;\n};\n","import { useCallback, useEffect, useRef, useState } from \"react\";\n\nexport const useTimeoutState = <S>(\n initialValue: S,\n defaultTimeout: number,\n clearTimeoutOnSetValue = true\n): [S, (v: S) => void] => {\n const [value, setValue] = useState<S>(initialValue);\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n const wrappedSetter = useCallback(\n (newValue: S, timeout = defaultTimeout) => {\n setValue(newValue);\n if (clearTimeoutOnSetValue) {\n clearTimeout(timeoutRef.current!);\n }\n timeoutRef.current = setTimeout(() => setValue(initialValue), timeout);\n },\n [defaultTimeout, clearTimeoutOnSetValue, initialValue]\n );\n\n useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current!);\n };\n }, []);\n\n return [value, wrappedSetter];\n};\n","export const exhaustSwitchCaseElseThrow = (arg: never) => {\n throw new Error(`Switch unhandled case: ${arg}`);\n};\n\nexport const exhaustSwitchCase = <T>(_arg: never, fallback: T) => {\n return fallback;\n};\n","export const truthyKeysAsList = (r: Record<string, boolean>): Array<string> =>\n Object.keys(r).filter((key) => r[key]);\n","export const parseFloatElseUndefined = (s: string): number | undefined => {\n try {\n const f = parseFloat(s);\n if (isNaN(f)) {\n return undefined;\n }\n if (f == null) {\n return undefined;\n }\n return f;\n } catch (e) {}\n return undefined;\n};\n\nexport const parseIntElseUndefined = (s: string): number | undefined => {\n try {\n const f = parseInt(s, 10);\n if (isNaN(f)) {\n return undefined;\n }\n if (f == null) {\n return undefined;\n }\n return f;\n } catch (e) {}\n return undefined;\n};\n"],"names":["SeparatorLine","forwardRef","color","cssColor","size","width","vertical","ref","jsx","styles","ClickableElement","styled","background","pointer","props","hoverBackground","disableOpacityOnClick","disableFocusHighlight","focusBackground","height","borderRadius","Clickable","onClick","onDblClick","tooltip","disablePointer","opacityOnHover","disabled","children","type","restProps","booleanOrNumberToNumber","num","numberToMetricCalc","booleanOrNumberToMetricCalc","validPropsRecord","validProps","r","isPropValid","memoize","prop","shadows","excludedProps","isExcludedWebUiProp","propName","box","system","row","value","Box","border","borderRight","borderLeft","borderTop","borderBottom","borderColor","borderStyle","borderWidth","boxShadow","flexbox","overflow","position","layout","zIndex","left","right","top","bottom","hoverBorder","focusBorder","focusWithinBackground","focusWithinBorder","Column","getDimensionObject","node","x","y","isEqualDimensions","a","b","useElementDimensions","onResizeElement","dimensions","setDimensions","useState","updateDimensions","useCallback","newDimensions","useLayoutEffect","ResizeAwareBox","onResize","boxProps","localRef","useRef","Row","Indent","Spacing","InnerSpace","Space","half","horizontal","Nest","nest","render","Fragment","getDataProps","pickBy","isDataPropMapper","_","key","isDataProp","ScreenReaderOnlyText","Text","variant","className","userSelect","whiteSpace","wordBreak","textAlign","style","spanProps","cx","Txt","SmallText","SmallerText","StandardText","LargeText","Heading","as","hProps","HeaderText","defaultComparator","useArraySet","list","setList","comparator","add","item","addMultiple","items","l","remove","index","i","removeMultiple","toggle","useBoolean","initialValue","setValue","setTrue","setFalse","v","useDebounce","delay","debouncedValue","setDebouncedValue","useEffect","handler","useDelayedFalse","id","genId","componentName","useDomId","setId","useEventListener","eventName","savedHandler","eventListener","event","element","useElementFocus","isInFocus","setIsInFocus","setIsNotInFocus","ReactDOM","focus","blur","useMouseIsOver","mouseIsOver","setMouseIsOver","setMouseIsNotOver","useMouseIsEntered","mouseIsEntered","setMouseIsEntered","setMouseIsNotEntered","useMultiOnClickOutside","refs","eventHandler","listener","useOnClickOutside","options","events","useOnNoMouseMovement","callback","onIdleChange","debounce","useOnScreen","isVisible","setIsVisible","rootMargin","root","threshold","observer","useMemo","entry","useForwardedRef","innerRef","useTimeoutState","defaultTimeout","clearTimeoutOnSetValue","timeoutRef","wrappedSetter","newValue","timeout","exhaustS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AKrJ,MACD,OAAOA,KAAQ,aACjBA,EAAIuM,EAAS,OAAO,IAEpBvM,EAAI,UAAUuM,EAAS;AAAA,EACzB,CACD,GAEMA;AACT,GCrBaC,KAAkB,CAC7B5D,GACA6D,GACAC,IAAyB,OACD;AACxB,QAAM,CAACjK,GAAOoG,CAAQ,IAAIhE,EAAY+D,CAAY,GAC5C+D,IAAarH,KAEbsH,IAAgB7H;AAAA,IACpB,CAAC8H,GAAaC,IAAUL,MAAmB;AACzC,MAAA5D,EAASgE,CAAQ,GACbH,KACF,aAAaC,EAAW,OAAQ,GAElCA,EAAW,UAAU,WAAW,MAAM9D,EAASD,CAAY,GAAGkE,CAAO;AAAA,IACvE;AAAA,IACA,CAACL,GAAgBC,GAAwB9D,CAAY;AAAA,EAAA;AAGvD,SAAAS,EAAU,MACD,MAAM;AACX,iBAAasD,EAAW,OAAQ;AAAA,EAAA,GAEjC,CAAE,CAAA,GAEE,CAAClK,GAAOmK,CAAa;AAC9B,GC5BaG,KAA6B,CAACC,MAAe;AACxD,QAAM,IAAI,MAAM,0BAA0BA,CAAG,EAAE;AACjD,GAEaC,KAAoB,CAAIC,GAAaC,MACzCA,GCLIC,KAAmB,CAACtL,MAC/B,OAAO,KAAKA,CAAC,EAAE,OAAO,CAACwE,MAAQxE,EAAEwE,CAAG,CAAC,GCD1B+G,KAA0B,CAACC,MAAkC;AACpE,MAAA;AACI,UAAAC,IAAI,WAAWD,CAAC;AAItB,WAHI,MAAMC,CAAC,KAGPA,KAAK,OACA,SAEFA;AAAA,UACG;AAAA,EAAC;AAEf,GAEaC,KAAwB,CAACF,MAAkC;AAClE,MAAA;AACI,UAAAC,IAAI,SAASD,GAAG,EAAE;AAIxB,WAHI,MAAMC,CAAC,KAGPA,KAAK,OACA,SAEFA;AAAA,UACG;AAAA,EAAC;AAEf;"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._separatorLine_nzfcz_1{display:flex;border:0;margin:0;flex:none}._visuallyHidden_1gevf_1{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._text_1iisw_1{--swui-text-color: var(--swui-text-primary-color);--swui-text-color-caption: var(--lhds-color-ui-600);--swui-text-color-overline: var(--lhds-color-ui-600);--swui-text-font-family: var(--swui-font-primary);--swui-text-font-weight: var(--swui-font-weight-text);--current-color: var(--swui-text-color);--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium);--current-font-weight: var(--swui-text-font-weight);--current-letter-spacing: var(--swui-text-letter-spacing);font-size:var(--current-font-size);line-height:var(--current-line-height);color:var(--current-color);letter-spacing:var(--current-letter-spacing);font-family:var(--swui-text-font-family);font-weight:var(--current-font-weight)}._text_1iisw_1._bold_1iisw_27{--current-font-weight: var(--swui-font-weight-text-bold)}._text_1iisw_1._caption_1iisw_31{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small);--current-color: var(--swui-text-color-caption);--current-letter-spacing: 0;font-style:italic}._text_1iisw_1._overline_1iisw_39{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller);--current-color: var(--swui-text-color-overline);--current-font-weight: var(--swui-font-weight-text-bold);--current-letter-spacing: .1rem;text-transform:uppercase}._text_1iisw_1._large_1iisw_48{--current-font-size: var(--swui-font-size-large);--current-line-height: var(--swui-line-height-large)}._text_1iisw_1._medium_1iisw_53{--current-font-size: var(--swui-font-size-medium);--current-line-height: var(--swui-line-height-medium)}._text_1iisw_1._small_1iisw_58{--current-font-size: var(--swui-font-size-small);--current-line-height: var(--swui-line-height-small)}._text_1iisw_1._smaller_1iisw_63{--current-font-size: var(--swui-font-size-smaller);--current-line-height: var(--swui-line-height-smaller)}._heading_1cnsg_1{font-size:2rem;color:var(--swui-text-primary-color);letter-spacing:0;margin:0;line-height:var(--swui-line-height);font-family:var(--swui-font-primary);font-weight:var(--swui-font-weight-text-bold)}._heading_1cnsg_1._h1_1cnsg_10{font-size:2.8rem}._heading_1cnsg_1._h2_1cnsg_14{font-size:2.4rem}._heading_1cnsg_1._h3_1cnsg_18{font-size:2rem}._heading_1cnsg_1._h4_1cnsg_22{font-size:1.8rem}._heading_1cnsg_1._h5_1cnsg_26{font-size:1.6rem}._heading_1cnsg_1._h6_1cnsg_30{font-size:1.4rem}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("@stenajs-webui/theme"),d=require("react/jsx-runtime"),r=require("react"),_=require("@emotion/styled"),N=require("@emotion/is-prop-valid"),i=require("styled-system"),C=require("lodash-es"),O=require("classnames"),z=require("react-dom");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const q=H(z),P="_separatorLine_nzfcz_1",A={separatorLine:P},V=r.forwardRef(({color:e=F.cssColor("--lhds-color-ui-300"),size:t="100%",width:n="1px",vertical:s=!1},o)=>d.jsx("hr",{className:A.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:s?t||"100%":n||"1px",width:s?n||"1px":t||"100%"},ref:o})),U=_.button`
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@stenajs-webui/theme"),l=require("react/jsx-runtime"),n=require("react"),w=require("@emotion/styled"),c=require("styled-system"),k=require("lodash-es"),$=require("classnames"),A=require("react-dom");function z(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const u=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,u.get?u:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const H=z(A),F="_separatorLine_nzfcz_1",N={separatorLine:F},q=n.forwardRef(({color:e=P.cssColor("--lhds-color-ui-300"),size:t="100%",width:r="1px",vertical:u=!1},s)=>l.jsx("hr",{className:N.separatorLine,"aria-hidden":!0,color:e,style:{backgroundColor:e,height:u?t||"100%":r||"1px",width:u?r||"1px":t||"100%"},ref:s})),U=w.button`
3
3
  display: inline-block;
4
4
  user-select: none;
5
5
  border: 0;
@@ -22,7 +22,7 @@
22
22
  ${({width:e})=>e?`width: ${e};`:""}
23
23
  ${({height:e})=>e?`height: ${e};`:""}
24
24
  ${({borderRadius:e})=>e?`border-radius: ${e};`:""}
25
- `,B=r.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:n,tooltip:s,disableOpacityOnClick:o,disablePointer:c,opacityOnHover:u,disabled:l,children:a,background:f="transparent",hoverBackground:m,focusBackground:h,type:j="button",...D},M)=>{const L=!!(t||n);return d.jsx(U,{opacityOnHover:u,title:s,disabled:l,disableOpacityOnClick:o,onClick:t,onDoubleClick:n,disableFocusHighlight:e,pointer:L&&!c,ref:M,background:f,hoverBackground:m,focusBackground:h,type:j,...D,children:a})}),g=e=>e==null?0:typeof e=="boolean"?e?1:0:e,G=e=>{if(e!==0)return`calc(${e} * var(--swui-metrics-space))`},y=e=>G(g(e)),K={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)",bottom:"var(--swui-shadow-bottom)"},W=["spacing","indent","gap","width","height","overflow","display"],J=e=>W.includes(e),Q=i.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:g},spacing:{property:"--current-spacing",transform:g},gap:{property:"--current-gap",transform:g},columnGap:{property:"columnGap",transform:y},rowGap:{property:"rowGap",transform:y},shadow:{property:"boxShadow",transform:e=>K[e]??e}}),b=_("div",{shouldForwardProp:e=>typeof e=="string"?J(e)?!1:N(e):!1})`
25
+ `,V=n.forwardRef(({disableFocusHighlight:e,onClick:t,onDblClick:r,tooltip:u,disableOpacityOnClick:s,disablePointer:o,opacityOnHover:i,disabled:d,children:a,background:f="transparent",hoverBackground:p,focusBackground:m,type:M="button",...L},D)=>{const j=!!(t||r);return l.jsx(U,{opacityOnHover:i,title:u,disabled:d,disableOpacityOnClick:s,onClick:t,onDoubleClick:r,disableFocusHighlight:e,pointer:j&&!o,ref:D,background:f,hoverBackground:p,focusBackground:m,type:M,...L,children:a})}),y=e=>e==null?0:typeof e=="boolean"?e?1:0:e,B=e=>{if(e!==0)return`calc(${e} * var(--swui-metrics-space))`},S=e=>B(y(e)),W={children:!0,dangerouslySetInnerHTML:!0,key:!0,ref:!0,autoFocus:!0,defaultValue:!0,defaultChecked:!0,innerHTML:!0,suppressContentEditableWarning:!0,suppressHydrationWarning:!0,valueLink:!0,abbr:!0,accept:!0,acceptCharset:!0,accessKey:!0,action:!0,allow:!0,allowUserMedia:!0,allowPaymentRequest:!0,allowFullScreen:!0,allowTransparency:!0,alt:!0,async:!0,autoComplete:!0,autoPlay:!0,capture:!0,cellPadding:!0,cellSpacing:!0,challenge:!0,charSet:!0,checked:!0,cite:!0,classID:!0,className:!0,cols:!0,colSpan:!0,content:!0,contentEditable:!0,contextMenu:!0,controls:!0,controlsList:!0,coords:!0,crossOrigin:!0,data:!0,dateTime:!0,decoding:!0,default:!0,defer:!0,dir:!0,disabled:!0,disablePictureInPicture:!0,disableRemotePlayback:!0,download:!0,draggable:!0,encType:!0,enterKeyHint:!0,form:!0,formAction:!0,formEncType:!0,formMethod:!0,formNoValidate:!0,formTarget:!0,frameBorder:!0,headers:!0,height:!0,hidden:!0,high:!0,href:!0,hrefLang:!0,htmlFor:!0,httpEquiv:!0,id:!0,inputMode:!0,integrity:!0,is:!0,keyParams:!0,keyType:!0,kind:!0,label:!0,lang:!0,list:!0,loading:!0,loop:!0,low:!0,marginHeight:!0,marginWidth:!0,max:!0,maxLength:!0,media:!0,mediaGroup:!0,method:!0,min:!0,minLength:!0,multiple:!0,muted:!0,name:!0,nonce:!0,noValidate:!0,open:!0,optimum:!0,pattern:!0,placeholder:!0,playsInline:!0,poster:!0,preload:!0,profile:!0,radioGroup:!0,readOnly:!0,referrerPolicy:!0,rel:!0,required:!0,reversed:!0,role:!0,rows:!0,rowSpan:!0,sandbox:!0,scope:!0,scoped:!0,scrolling:!0,seamless:!0,selected:!0,shape:!0,size:!0,sizes:!0,slot:!0,span:!0,spellCheck:!0,src:!0,srcDoc:!0,srcLang:!0,srcSet:!0,start:!0,step:!0,style:!0,summary:!0,tabIndex:!0,target:!0,title:!0,translate:!0,type:!0,useMap:!0,value:!0,width:!0,wmode:!0,wrap:!0,about:!0,datatype:!0,inlist:!0,prefix:!0,property:!0,resource:!0,typeof:!0,vocab:!0,autoCapitalize:!0,autoCorrect:!0,autoSave:!0,color:!0,incremental:!0,fallback:!0,inert:!0,itemProp:!0,itemScope:!0,itemType:!0,itemID:!0,itemRef:!0,on:!0,option:!0,results:!0,security:!0,unselectable:!0,accentHeight:!0,accumulate:!0,additive:!0,alignmentBaseline:!0,allowReorder:!0,alphabetic:!0,amplitude:!0,arabicForm:!0,ascent:!0,attributeName:!0,attributeType:!0,autoReverse:!0,azimuth:!0,baseFrequency:!0,baselineShift:!0,baseProfile:!0,bbox:!0,begin:!0,bias:!0,by:!0,calcMode:!0,capHeight:!0,clip:!0,clipPathUnits:!0,clipPath:!0,clipRule:!0,colorInterpolation:!0,colorInterpolationFilters:!0,colorProfile:!0,colorRendering:!0,contentScriptType:!0,contentStyleType:!0,cursor:!0,cx:!0,cy:!0,d:!0,decelerate:!0,descent:!0,diffuseConstant:!0,direction:!0,display:!0,divisor:!0,dominantBaseline:!0,dur:!0,dx:!0,dy:!0,edgeMode:!0,elevation:!0,enableBackground:!0,end:!0,exponent:!0,externalResourcesRequired:!0,fill:!0,fillOpacity:!0,fillRule:!0,filter:!0,filterRes:!0,filterUnits:!0,floodColor:!0,floodOpacity:!0,focusable:!0,fontFamily:!0,fontSize:!0,fontSizeAdjust:!0,fontStretch:!0,fontStyle:!0,fontVariant:!0,fontWeight:!0,format:!0,from:!0,fr:!0,fx:!0,fy:!0,g1:!0,g2:!0,glyphName:!0,glyphOrientationHorizontal:!0,glyphOrientationVertical:!0,glyphRef:!0,gradientTransform:!0,gradientUnits:!0,hanging:!0,horizAdvX:!0,horizOriginX:!0,ideographic:!0,imageRendering:!0,in:!0,in2:!0,intercept:!0,k:!0,k1:!0,k2:!0,k3:!0,k4:!0,kernelMatrix:!0,kernelUnitLength:!0,kerning:!0,keyPoints:!0,keySplines:!0,keyTimes:!0,lengthAdjust:!0,letterSpacing:!0,lightingColor:!0,limitingConeAngle:!0,local:!0,markerEnd:!0,markerMid:!0,markerStart:!0,markerHeight:!0,markerUnits:!0,markerWidth:!0,mask:!0,maskContentUnits:!0,maskUnits:!0,mathematical:!0,mode:!0,numOctaves:!0,offset:!0,opacity:!0,operator:!0,order:!0,orient:!0,orientation:!0,origin:!0,overflow:!0,overlinePosition:!0,overlineThickness:!0,panose1:!0,paintOrder:!0,pathLength:!0,patternContentUnits:!0,patternTransform:!0,patternUnits:!0,pointerEvents:!0,points:!0,pointsAtX:!0,pointsAtY:!0,pointsAtZ:!0,preserveAlpha:!0,preserveAspectRatio:!0,primitiveUnits:!0,r:!0,radius:!0,refX:!0,refY:!0,renderingIntent:!0,repeatCount:!0,repeatDur:!0,requiredExtensions:!0,requiredFeatures:!0,restart:!0,result:!0,rotate:!0,rx:!0,ry:!0,scale:!0,seed:!0,shapeRendering:!0,slope:!0,spacing:!0,specularConstant:!0,specularExponent:!0,speed:!0,spreadMethod:!0,startOffset:!0,stdDeviation:!0,stemh:!0,stemv:!0,stitchTiles:!0,stopColor:!0,stopOpacity:!0,strikethroughPosition:!0,strikethroughThickness:!0,string:!0,stroke:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeLinecap:!0,strokeLinejoin:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,surfaceScale:!0,systemLanguage:!0,tableValues:!0,targetX:!0,targetY:!0,textAnchor:!0,textDecoration:!0,textRendering:!0,textLength:!0,to:!0,transform:!0,u1:!0,u2:!0,underlinePosition:!0,underlineThickness:!0,unicode:!0,unicodeBidi:!0,unicodeRange:!0,unitsPerEm:!0,vAlphabetic:!0,vHanging:!0,vIdeographic:!0,vMathematical:!0,values:!0,vectorEffect:!0,version:!0,vertAdvY:!0,vertOriginX:!0,vertOriginY:!0,viewBox:!0,viewTarget:!0,visibility:!0,widths:!0,wordSpacing:!0,writingMode:!0,x:!0,xHeight:!0,x1:!0,x2:!0,xChannelSelector:!0,xlinkActuate:!0,xlinkArcrole:!0,xlinkHref:!0,xlinkRole:!0,xlinkShow:!0,xlinkTitle:!0,xlinkType:!0,xmlBase:!0,xmlns:!0,xmlnsXlink:!0,xmlLang:!0,xmlSpace:!0,y:!0,y1:!0,y2:!0,yChannelSelector:!0,z:!0,zoomAndPan:!0,for:!0,class:!0,autofocus:!0},X=`/^((${Object.keys(W).join("|")})|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/`,G=new RegExp(X),Y=k.memoize(e=>G.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91),K={box:"var(--swui-shadow-box)",popover:"var(--swui-shadow-popover)",modal:"var(--swui-shadow-modal)",bottom:"var(--swui-shadow-bottom)"},Z=["spacing","indent","gap","width","height","overflow","display"],J=e=>Z.includes(e),Q=c.system({row:{property:"flexDirection",transform:e=>e?"row":"column"},indent:{property:"--current-indent",transform:y},spacing:{property:"--current-spacing",transform:y},gap:{property:"--current-gap",transform:y},columnGap:{property:"columnGap",transform:S},rowGap:{property:"rowGap",transform:S},shadow:{property:"boxShadow",transform:e=>K[e]??e}}),g=w("div",{shouldForwardProp:e=>typeof e=="string"?J(e)?!1:Y(e):!1})`
26
26
  --current-spacing: 0;
27
27
  --current-indent: 0;
28
28
  --current-gap: 0;
@@ -30,26 +30,26 @@
30
30
  display: flex;
31
31
  flex-direction: column;
32
32
  ${Q};
33
- ${i.background};
34
- ${i.border};
35
- ${i.borderRight};
36
- ${i.borderLeft};
37
- ${i.borderTop};
38
- ${i.borderBottom};
39
- ${i.borderColor};
40
- ${i.borderRadius};
41
- ${i.borderStyle};
42
- ${i.borderWidth};
43
- ${i.boxShadow};
44
- ${i.flexbox};
45
- ${i.overflow};
46
- ${i.position};
47
- ${i.layout};
48
- ${i.zIndex};
49
- ${i.left};
50
- ${i.right};
51
- ${i.top};
52
- ${i.bottom};
33
+ ${c.background};
34
+ ${c.border};
35
+ ${c.borderRight};
36
+ ${c.borderLeft};
37
+ ${c.borderTop};
38
+ ${c.borderBottom};
39
+ ${c.borderColor};
40
+ ${c.borderRadius};
41
+ ${c.borderStyle};
42
+ ${c.borderWidth};
43
+ ${c.boxShadow};
44
+ ${c.flexbox};
45
+ ${c.overflow};
46
+ ${c.position};
47
+ ${c.layout};
48
+ ${c.zIndex};
49
+ ${c.left};
50
+ ${c.right};
51
+ ${c.top};
52
+ ${c.bottom};
53
53
 
54
54
  gap: calc(var(--current-gap) * var(--swui-metrics-space));
55
55
 
@@ -70,10 +70,10 @@
70
70
  ${({focusWithinBackground:e})=>e?`background: ${e};`:""}
71
71
  ${({focusWithinBorder:e})=>e?`border: ${e};`:""}
72
72
  }
73
- `,X=r.forwardRef(function(t,n){return d.jsx(b,{ref:n,...t})}),R=e=>{const{x:t,y:n,width:s,height:o,bottom:c,top:u,left:l,right:a}=e.getBoundingClientRect();return{width:s,height:o,top:u,left:l,x:t,y:n,right:a,bottom:c}},Y=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.bottom===t.bottom&&e.top===t.top&&e.left===t.left&&e.right===t.right,T=(e,t)=>{const[n,s]=r.useState(),o=r.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const c=R(e.current);(!n||!Y(n,c))&&t&&t(c),s(c)}})},[e,n,s,t]);return r.useLayoutEffect(()=>{o()},[o]),{dimensions:n}},Z=r.forwardRef(function({onResize:t,...n},s){const o=r.useRef(null);return T(s??o,t),d.jsx(b,{...n,ref:s})}),ee=r.forwardRef(function(t,n){return d.jsx(b,{row:!0,ref:n,...t})}),te=r.forwardRef(function({num:t=1,...n},s){return d.jsx(b,{indent:t,ref:s,...n})}),ne=r.forwardRef(function({num:t=1,...n},s){return d.jsx(b,{spacing:t,ref:s,...n})}),se=_.div`
73
+ `,ee=n.forwardRef(function(t,r){return l.jsx(g,{ref:r,...t})}),T=e=>{const{x:t,y:r,width:u,height:s,bottom:o,top:i,left:d,right:a}=e.getBoundingClientRect();return{width:u,height:s,top:i,left:d,x:t,y:r,right:a,bottom:o}},te=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height&&e.bottom===t.bottom&&e.top===t.top&&e.left===t.left&&e.right===t.right,R=(e,t)=>{const[r,u]=n.useState(),s=n.useCallback(()=>{window.requestAnimationFrame(()=>{if(e.current){const o=T(e.current);(!r||!te(r,o))&&t&&t(o),u(o)}})},[e,r,u,t]);return n.useLayoutEffect(()=>{s()},[s]),{dimensions:r}},re=n.forwardRef(function({onResize:t,...r},u){const s=n.useRef(null);return R(u??s,t),l.jsx(g,{...r,ref:u})}),ue=n.forwardRef(function(t,r){return l.jsx(g,{row:!0,ref:r,...t})}),ne=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{indent:t,ref:u,...r})}),se=n.forwardRef(function({num:t=1,...r},u){return l.jsx(g,{spacing:t,ref:u,...r})}),oe=w.div`
74
74
  --current-size: 1;
75
75
  flex: none;
76
76
  width: calc(var(--current-size) * var(--swui-metrics-space));
77
77
  height: calc(var(--current-size) * var(--swui-metrics-space));
78
- `,re=({half:e=!1,horizontal:t=!1,num:n=1,vertical:s=!1})=>{const o=n*(e?.5:1);return d.jsx(se,{style:{"--current-size":o,height:t?1:void 0,width:s?1:void 0}})},oe=({children:e,nest:t,render:n})=>t?d.jsx(d.Fragment,{children:n(e)}):d.jsx(d.Fragment,{children:e}),ce="_visuallyHidden_1gevf_1",ue={visuallyHidden:ce},I=e=>C.pickBy(e,ae),ae=(e,t)=>ie(t),ie=e=>e.startsWith("data-")||e.startsWith("aria-"),de=({children:e,...t})=>d.jsx("span",{className:ue.visuallyHidden,...I(t),children:e}),le="_text_1iisw_1",fe="_standard_1iisw_24",me="_bold_1iisw_27",he="_caption_1iisw_31",pe="_overline_1iisw_39",be="_large_1iisw_48",we="_medium_1iisw_53",ge="_small_1iisw_58",ve="_smaller_1iisw_63",x={text:le,standard:fe,bold:me,caption:he,overline:pe,large:be,medium:we,small:ge,smaller:ve},w=r.forwardRef(({children:e,variant:t="standard",size:n="medium",className:s,color:o,userSelect:c,whiteSpace:u,wordBreak:l,textAlign:a,style:f,...m},h)=>d.jsx("span",{className:O(x.text,x[t],x[n],s),ref:h,style:{color:o,userSelect:c,whiteSpace:u,wordBreak:l,textAlign:a,...f},...m,children:e})),xe=w,_e=e=>d.jsx(w,{size:"small",...e}),ye=e=>d.jsx(w,{size:"smaller",...e}),$e=e=>d.jsx(w,{size:"medium",...e}),Ee=e=>d.jsx(w,{size:"large",...e}),Se="_heading_1cnsg_1",Ce="_h1_1cnsg_10",Oe="_h2_1cnsg_14",Re="_h3_1cnsg_18",Te="_h4_1cnsg_22",Ie="_h5_1cnsg_26",ke="_h6_1cnsg_30",$={heading:Se,h1:Ce,h2:Oe,h3:Re,h4:Te,h5:Ie,h6:ke},k=r.forwardRef(({variant:e="h3",className:t,color:n,whiteSpace:s,wordBreak:o,style:c,children:u,as:l,...a},f)=>{const m=l??e;return d.jsx(m,{className:O($.heading,$[e],t),style:{color:n,whiteSpace:s,wordBreak:o,...c},ref:f,...a,children:u})}),je=e=>d.jsx(k,{variant:"h2",...e}),De=(e,t)=>e===t,Me=(e,t,n=De)=>{const s=r.useCallback(a=>{e.some(f=>n(f,a))||t([...e,a])},[e,t,n]),o=r.useCallback(a=>{t(a.reduce((f,m)=>f.some(h=>n(h,m))?f:[...f,m],e))},[e,t,n]),c=r.useCallback(a=>{const f=e.findIndex(m=>n(m,a));f>=0&&t(e.filter((m,h)=>h!==f))},[e,t,n]),u=r.useCallback(a=>{t(e.filter(f=>!a.some(m=>n(m,f))))},[e,t,n]),l=r.useCallback(a=>{e.some(m=>n(m,a))?c(a):s(a)},[e,s,c,n]);return{add:s,addMultiple:o,remove:c,removeMultiple:u,toggle:l}},v=e=>{const[t,n]=r.useState(e),s=r.useCallback(()=>{n(!0)},[n]),o=r.useCallback(()=>{n(!1)},[n]),c=r.useCallback(()=>{n(u=>!u)},[n]);return[t,s,o,c]},Le=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{const o=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Fe=(e,t)=>{const[n,s]=r.useState(e);return r.useEffect(()=>{e&&s(!0);const o=setTimeout(()=>{e||s(e)},t);return()=>{clearTimeout(o)}},[e,t]),n};let Ne=0;const E=e=>`webui-${e?e+"-":""}${++Ne}`,ze=e=>{const[t,n]=r.useState(()=>E(e));return r.useEffect(()=>n(E(e)),[e]),t},p=(e,t,n)=>{const s=r.useRef();r.useEffect(()=>{s.current=n},[n]),r.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const c=l=>{if(s.current)return s.current(l)};if(!e.current)return;const u=e.current;return u.addEventListener(t,c),()=>{u&&u.removeEventListener(t,c)}},[t,e])},He=e=>{const[t,n,s]=v(!1);r.useEffect(()=>{document.activeElement===q.findDOMNode(e.current)?n():s()},[e,s,n]),p(e,"focus",n),p(e,"blur",s);const o=r.useCallback(()=>{e.current&&e.current.focus()},[e]),c=r.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:o,blur:c}},qe=e=>{const[t,n,s]=v(!1);return p(e,"mouseover",n),p(e,"mouseout",s),t},Pe=e=>{const[t,n,s]=v(!1);return p(e,"mouseenter",n),p(e,"mouseleave",s),t},Ae=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=t},[t]),r.useEffect(()=>{const s=o=>{e.filter(u=>u.current).every(u=>u.current&&!u.current.contains(o.target))&&n.current(o)};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[...e])},Ve=(e,t,n)=>{const s=r.useRef(()=>{});r.useEffect(()=>{s.current=t},[t]),r.useEffect(()=>{const o=c=>{!e.current||e.current.contains(c.target)||s.current(c)};return document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),()=>{document.removeEventListener("mousedown",o,n),document.removeEventListener("touchstart",o,n)}},[e,n])},S=["mousemove","mousedown","keydown","touchstart","scroll"],Ue=(e,t)=>{const n=r.useRef(()=>{});r.useEffect(()=>{n.current=e},[e]),r.useEffect(()=>{const s=C.debounce(n.current,t);return S.forEach(o=>window.addEventListener(o,s)),()=>{S.forEach(o=>window.removeEventListener(o,s))}},[t])},Be=(e,t)=>{const[n,s]=r.useState(!1),{rootMargin:o,root:c,threshold:u}=t||{},l=r.useMemo(()=>new IntersectionObserver(([a])=>s(a.isIntersecting),{rootMargin:o,root:c,threshold:u}),[s,o,c,u]);return r.useEffect(()=>(e.current&&l.observe(e.current),()=>{l.disconnect()}),[l,e]),n},Ge=e=>{const t=r.useRef(null);return r.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ke=(e,t,n=!0)=>{const[s,o]=r.useState(e),c=r.useRef(),u=r.useCallback((l,a=t)=>{o(l),n&&clearTimeout(c.current),c.current=setTimeout(()=>o(e),a)},[t,n,e]);return r.useEffect(()=>()=>{clearTimeout(c.current)},[]),[s,u]},We=e=>{throw new Error(`Switch unhandled case: ${e}`)},Je=(e,t)=>t,Qe=e=>Object.keys(e).filter(t=>e[t]),Xe=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},Ye=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};exports.Box=b;exports.Clickable=B;exports.Column=X;exports.HeaderText=je;exports.Heading=k;exports.Indent=te;exports.LargeText=Ee;exports.Nest=oe;exports.ResizeAwareBox=Z;exports.Row=ee;exports.ScreenReaderOnlyText=de;exports.SeparatorLine=V;exports.SmallText=_e;exports.SmallerText=ye;exports.Space=re;exports.Spacing=ne;exports.StandardText=$e;exports.Text=w;exports.Txt=xe;exports.booleanOrNumberToNumber=g;exports.exhaustSwitchCase=Je;exports.exhaustSwitchCaseElseThrow=We;exports.getDataProps=I;exports.getDimensionObject=R;exports.parseFloatElseUndefined=Xe;exports.parseIntElseUndefined=Ye;exports.truthyKeysAsList=Qe;exports.useArraySet=Me;exports.useBoolean=v;exports.useDebounce=Le;exports.useDelayedFalse=Fe;exports.useDomId=ze;exports.useElementDimensions=T;exports.useElementFocus=He;exports.useEventListener=p;exports.useForwardedRef=Ge;exports.useMouseIsEntered=Pe;exports.useMouseIsOver=qe;exports.useMultiOnClickOutside=Ae;exports.useOnClickOutside=Ve;exports.useOnNoMouseMovement=Ue;exports.useOnScreen=Be;exports.useTimeoutState=Ke;
78
+ `,ie=({half:e=!1,horizontal:t=!1,num:r=1,vertical:u=!1})=>{const s=r*(e?.5:1);return l.jsx(oe,{style:{"--current-size":s,height:t?1:void 0,width:u?1:void 0}})},ae=({children:e,nest:t,render:r})=>t?l.jsx(l.Fragment,{children:r(e)}):l.jsx(l.Fragment,{children:e}),ce="_visuallyHidden_1gevf_1",le={visuallyHidden:ce},O=e=>k.pickBy(e,de),de=(e,t)=>fe(t),fe=e=>e.startsWith("data-")||e.startsWith("aria-"),pe=({children:e,...t})=>l.jsx("span",{className:le.visuallyHidden,...O(t),children:e}),me="_text_1iisw_1",he="_standard_1iisw_24",ge="_bold_1iisw_27",be="_caption_1iisw_31",ye="_overline_1iisw_39",xe="_large_1iisw_48",ve="_medium_1iisw_53",we="_small_1iisw_58",ke="_smaller_1iisw_63",v={text:me,standard:he,bold:ge,caption:be,overline:ye,large:xe,medium:ve,small:we,smaller:ke},b=n.forwardRef(({children:e,variant:t="standard",size:r="medium",className:u,color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,style:f,...p},m)=>l.jsx("span",{className:$(v.text,v[t],v[r],u),ref:m,style:{color:s,userSelect:o,whiteSpace:i,wordBreak:d,textAlign:a,...f},...p,children:e})),Se=b,Ee=e=>l.jsx(b,{size:"small",...e}),_e=e=>l.jsx(b,{size:"smaller",...e}),Ce=e=>l.jsx(b,{size:"medium",...e}),$e=e=>l.jsx(b,{size:"large",...e}),Te="_heading_1cnsg_1",Re="_h1_1cnsg_10",Oe="_h2_1cnsg_14",Ie="_h3_1cnsg_18",Me="_h4_1cnsg_22",Le="_h5_1cnsg_26",De="_h6_1cnsg_30",E={heading:Te,h1:Re,h2:Oe,h3:Ie,h4:Me,h5:Le,h6:De},I=n.forwardRef(({variant:e="h3",className:t,color:r,whiteSpace:u,wordBreak:s,style:o,children:i,as:d,...a},f)=>{const p=d??e;return l.jsx(p,{className:$(E.heading,E[e],t),style:{color:r,whiteSpace:u,wordBreak:s,...o},ref:f,...a,children:i})}),je=e=>l.jsx(I,{variant:"h2",...e}),Pe=(e,t)=>e===t,Ae=(e,t,r=Pe)=>{const u=n.useCallback(a=>{e.some(f=>r(f,a))||t([...e,a])},[e,t,r]),s=n.useCallback(a=>{t(a.reduce((f,p)=>f.some(m=>r(m,p))?f:[...f,p],e))},[e,t,r]),o=n.useCallback(a=>{const f=e.findIndex(p=>r(p,a));f>=0&&t(e.filter((p,m)=>m!==f))},[e,t,r]),i=n.useCallback(a=>{t(e.filter(f=>!a.some(p=>r(p,f))))},[e,t,r]),d=n.useCallback(a=>{e.some(p=>r(p,a))?o(a):u(a)},[e,u,o,r]);return{add:u,addMultiple:s,remove:o,removeMultiple:i,toggle:d}},x=e=>{const[t,r]=n.useState(e),u=n.useCallback(()=>{r(!0)},[r]),s=n.useCallback(()=>{r(!1)},[r]),o=n.useCallback(()=>{r(i=>!i)},[r]);return[t,u,s,o]},ze=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{const s=setTimeout(()=>{u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r},He=(e,t)=>{const[r,u]=n.useState(e);return n.useEffect(()=>{e&&u(!0);const s=setTimeout(()=>{e||u(e)},t);return()=>{clearTimeout(s)}},[e,t]),r};let Fe=0;const _=e=>`webui-${e?e+"-":""}${++Fe}`,Ne=e=>{const[t,r]=n.useState(()=>_(e));return n.useEffect(()=>r(_(e)),[e]),t},h=(e,t,r)=>{const u=n.useRef();n.useEffect(()=>{u.current=r},[r]),n.useEffect(()=>{if(!(e.current&&e.current.addEventListener))return;const o=d=>{if(u.current)return u.current(d)};if(!e.current)return;const i=e.current;return i.addEventListener(t,o),()=>{i&&i.removeEventListener(t,o)}},[t,e])},qe=e=>{const[t,r,u]=x(!1);n.useEffect(()=>{document.activeElement===H.findDOMNode(e.current)?r():u()},[e,u,r]),h(e,"focus",r),h(e,"blur",u);const s=n.useCallback(()=>{e.current&&e.current.focus()},[e]),o=n.useCallback(()=>{e.current&&e.current.blur()},[e]);return{isInFocus:t,focus:s,blur:o}},Ue=e=>{const[t,r,u]=x(!1);return h(e,"mouseover",r),h(e,"mouseout",u),t},Ve=e=>{const[t,r,u]=x(!1);return h(e,"mouseenter",r),h(e,"mouseleave",u),t},Be=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=t},[t]),n.useEffect(()=>{const u=s=>{e.filter(i=>i.current).every(i=>i.current&&!i.current.contains(s.target))&&r.current(s)};return document.addEventListener("mousedown",u),document.addEventListener("touchstart",u),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("touchstart",u)}},[...e])},We=(e,t,r)=>{const u=n.useRef(()=>{});n.useEffect(()=>{u.current=t},[t]),n.useEffect(()=>{const s=o=>{!e.current||e.current.contains(o.target)||u.current(o)};return document.addEventListener("mousedown",s,r),document.addEventListener("touchstart",s,r),()=>{document.removeEventListener("mousedown",s,r),document.removeEventListener("touchstart",s,r)}},[e,r])},C=["mousemove","mousedown","keydown","touchstart","scroll"],Xe=(e,t)=>{const r=n.useRef(()=>{});n.useEffect(()=>{r.current=e},[e]),n.useEffect(()=>{const u=k.debounce(r.current,t);return C.forEach(s=>window.addEventListener(s,u)),()=>{C.forEach(s=>window.removeEventListener(s,u))}},[t])},Ge=(e,t)=>{const[r,u]=n.useState(!1),{rootMargin:s,root:o,threshold:i}=t||{},d=n.useMemo(()=>new IntersectionObserver(([a])=>u(a.isIntersecting),{rootMargin:s,root:o,threshold:i}),[u,s,o,i]);return n.useEffect(()=>(e.current&&d.observe(e.current),()=>{d.disconnect()}),[d,e]),r},Ye=e=>{const t=n.useRef(null);return n.useEffect(()=>{e&&(typeof e=="function"?e(t.current):e.current=t.current)}),t},Ke=(e,t,r=!0)=>{const[u,s]=n.useState(e),o=n.useRef(),i=n.useCallback((d,a=t)=>{s(d),r&&clearTimeout(o.current),o.current=setTimeout(()=>s(e),a)},[t,r,e]);return n.useEffect(()=>()=>{clearTimeout(o.current)},[]),[u,i]},Ze=e=>{throw new Error(`Switch unhandled case: ${e}`)},Je=(e,t)=>t,Qe=e=>Object.keys(e).filter(t=>e[t]),et=e=>{try{const t=parseFloat(e);return isNaN(t)||t==null?void 0:t}catch{}},tt=e=>{try{const t=parseInt(e,10);return isNaN(t)||t==null?void 0:t}catch{}};exports.Box=g;exports.Clickable=V;exports.Column=ee;exports.HeaderText=je;exports.Heading=I;exports.Indent=ne;exports.LargeText=$e;exports.Nest=ae;exports.ResizeAwareBox=re;exports.Row=ue;exports.ScreenReaderOnlyText=pe;exports.SeparatorLine=q;exports.SmallText=Ee;exports.SmallerText=_e;exports.Space=ie;exports.Spacing=se;exports.StandardText=Ce;exports.Text=b;exports.Txt=Se;exports.booleanOrNumberToNumber=y;exports.exhaustSwitchCase=Je;exports.exhaustSwitchCaseElseThrow=Ze;exports.getDataProps=O;exports.getDimensionObject=T;exports.parseFloatElseUndefined=et;exports.parseIntElseUndefined=tt;exports.truthyKeysAsList=Qe;exports.useArraySet=Ae;exports.useBoolean=x;exports.useDebounce=ze;exports.useDelayedFalse=He;exports.useDomId=Ne;exports.useElementDimensions=R;exports.useElementFocus=qe;exports.useEventListener=h;exports.useForwardedRef=Ye;exports.useMouseIsEntered=Ve;exports.useMouseIsOver=Ue;exports.useMultiOnClickOutside=Be;exports.useOnClickOutside=We;exports.useOnNoMouseMovement=Xe;exports.useOnScreen=Ge;exports.useTimeoutState=Ke;
79
79
  //# sourceMappingURL=index.js.map