@salt-ds/core 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/packages/core/src/aria-announcer/useAriaAnnouncer.js +1 -0
- package/dist-cjs/packages/core/src/aria-announcer/useAriaAnnouncer.js.map +1 -1
- package/dist-cjs/packages/core/src/border-item/BorderItem.js +3 -6
- package/dist-cjs/packages/core/src/border-item/BorderItem.js.map +1 -1
- package/dist-cjs/packages/core/src/border-layout/BorderLayout.js +3 -6
- package/dist-cjs/packages/core/src/border-layout/BorderLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/button/Button.js +3 -6
- package/dist-cjs/packages/core/src/button/Button.js.map +1 -1
- package/dist-cjs/packages/core/src/card/Card.css.js +9 -0
- package/dist-cjs/packages/core/src/card/Card.css.js.map +1 -0
- package/dist-cjs/packages/core/src/card/Card.js +37 -0
- package/dist-cjs/packages/core/src/card/Card.js.map +1 -0
- package/dist-cjs/packages/core/src/flex-item/FlexItem.js +3 -6
- package/dist-cjs/packages/core/src/flex-item/FlexItem.js.map +1 -1
- package/dist-cjs/packages/core/src/flex-layout/FlexLayout.css.js +1 -1
- package/dist-cjs/packages/core/src/flex-layout/FlexLayout.js +4 -10
- package/dist-cjs/packages/core/src/flex-layout/FlexLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/flow-layout/FlowLayout.js +3 -2
- package/dist-cjs/packages/core/src/flow-layout/FlowLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/grid-item/GridItem.js +3 -6
- package/dist-cjs/packages/core/src/grid-item/GridItem.js.map +1 -1
- package/dist-cjs/packages/core/src/grid-layout/GridLayout.js +3 -6
- package/dist-cjs/packages/core/src/grid-layout/GridLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/index.js +16 -0
- package/dist-cjs/packages/core/src/index.js.map +1 -1
- package/dist-cjs/packages/core/src/link/Link.css.js +1 -1
- package/dist-cjs/packages/core/src/link/Link.js +3 -6
- package/dist-cjs/packages/core/src/link/Link.js.map +1 -1
- package/dist-cjs/packages/core/src/panel/Panel.css.js +9 -0
- package/dist-cjs/packages/core/src/panel/Panel.css.js.map +1 -0
- package/dist-cjs/packages/core/src/panel/Panel.js +26 -0
- package/dist-cjs/packages/core/src/panel/Panel.js.map +1 -0
- package/dist-cjs/packages/core/src/salt-provider/SaltProvider.js +4 -4
- package/dist-cjs/packages/core/src/salt-provider/SaltProvider.js.map +1 -1
- package/dist-cjs/packages/core/src/spinner/Spinner.css.js +9 -0
- package/dist-cjs/packages/core/src/spinner/Spinner.css.js.map +1 -0
- package/dist-cjs/packages/core/src/spinner/Spinner.js +81 -0
- package/dist-cjs/packages/core/src/spinner/Spinner.js.map +1 -0
- package/dist-cjs/packages/core/src/spinner/svgSpinners/SpinnerSVG.js +80 -0
- package/dist-cjs/packages/core/src/spinner/svgSpinners/SpinnerSVG.js.map +1 -0
- package/dist-cjs/packages/core/src/split-layout/SplitLayout.js +25 -0
- package/dist-cjs/packages/core/src/split-layout/SplitLayout.js.map +1 -0
- package/dist-cjs/packages/core/src/stack-layout/StackLayout.css.js +9 -0
- package/dist-cjs/packages/core/src/stack-layout/StackLayout.css.js.map +1 -0
- package/dist-cjs/packages/core/src/stack-layout/StackLayout.js +38 -3
- package/dist-cjs/packages/core/src/stack-layout/StackLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/status-indicator/StatusIndicator.js +3 -6
- package/dist-cjs/packages/core/src/status-indicator/StatusIndicator.js.map +1 -1
- package/dist-cjs/packages/core/src/text/Display.js +5 -8
- package/dist-cjs/packages/core/src/text/Display.js.map +1 -1
- package/dist-cjs/packages/core/src/text/Text.css.js +1 -1
- package/dist-cjs/packages/core/src/text/Text.js +7 -8
- package/dist-cjs/packages/core/src/text/Text.js.map +1 -1
- package/dist-cjs/packages/core/src/theme/Theme.js.map +1 -1
- package/dist-cjs/packages/core/src/tooltip/Tooltip.css.js +9 -0
- package/dist-cjs/packages/core/src/tooltip/Tooltip.css.js.map +1 -0
- package/dist-cjs/packages/core/src/tooltip/Tooltip.js +91 -0
- package/dist-cjs/packages/core/src/tooltip/Tooltip.js.map +1 -0
- package/dist-cjs/packages/core/src/tooltip/useAriaAnnounce.js +94 -0
- package/dist-cjs/packages/core/src/tooltip/useAriaAnnounce.js.map +1 -0
- package/dist-cjs/packages/core/src/tooltip/useTooltip.js +106 -0
- package/dist-cjs/packages/core/src/tooltip/useTooltip.js.map +1 -0
- package/dist-cjs/packages/core/src/utils/marginMiddleware.js.map +1 -1
- package/dist-cjs/packages/core/src/utils/useFloatingUI.js +38 -0
- package/dist-cjs/packages/core/src/utils/useFloatingUI.js.map +1 -0
- package/dist-cjs/packages/core/src/viewport/ViewportProvider.js +5 -1
- package/dist-cjs/packages/core/src/viewport/ViewportProvider.js.map +1 -1
- package/dist-es/packages/core/src/aria-announcer/useAriaAnnouncer.js +1 -0
- package/dist-es/packages/core/src/aria-announcer/useAriaAnnouncer.js.map +1 -1
- package/dist-es/packages/core/src/border-item/BorderItem.js +3 -2
- package/dist-es/packages/core/src/border-item/BorderItem.js.map +1 -1
- package/dist-es/packages/core/src/border-layout/BorderLayout.js +3 -2
- package/dist-es/packages/core/src/border-layout/BorderLayout.js.map +1 -1
- package/dist-es/packages/core/src/button/Button.js +3 -2
- package/dist-es/packages/core/src/button/Button.js.map +1 -1
- package/dist-es/packages/core/src/card/Card.css.js +7 -0
- package/dist-es/packages/core/src/card/Card.css.js.map +1 -0
- package/dist-es/packages/core/src/card/Card.js +33 -0
- package/dist-es/packages/core/src/card/Card.js.map +1 -0
- package/dist-es/packages/core/src/flex-item/FlexItem.js +3 -2
- package/dist-es/packages/core/src/flex-item/FlexItem.js.map +1 -1
- package/dist-es/packages/core/src/flex-layout/FlexLayout.css.js +1 -1
- package/dist-es/packages/core/src/flex-layout/FlexLayout.js +5 -7
- package/dist-es/packages/core/src/flex-layout/FlexLayout.js.map +1 -1
- package/dist-es/packages/core/src/flow-layout/FlowLayout.js +3 -2
- package/dist-es/packages/core/src/flow-layout/FlowLayout.js.map +1 -1
- package/dist-es/packages/core/src/grid-item/GridItem.js +3 -2
- package/dist-es/packages/core/src/grid-item/GridItem.js.map +1 -1
- package/dist-es/packages/core/src/grid-layout/GridLayout.js +3 -2
- package/dist-es/packages/core/src/grid-layout/GridLayout.js.map +1 -1
- package/dist-es/packages/core/src/index.js +7 -0
- package/dist-es/packages/core/src/index.js.map +1 -1
- package/dist-es/packages/core/src/link/Link.css.js +1 -1
- package/dist-es/packages/core/src/link/Link.js +3 -2
- package/dist-es/packages/core/src/link/Link.js.map +1 -1
- package/dist-es/packages/core/src/panel/Panel.css.js +7 -0
- package/dist-es/packages/core/src/panel/Panel.css.js.map +1 -0
- package/dist-es/packages/core/src/panel/Panel.js +22 -0
- package/dist-es/packages/core/src/panel/Panel.js.map +1 -0
- package/dist-es/packages/core/src/salt-provider/SaltProvider.js +4 -3
- package/dist-es/packages/core/src/salt-provider/SaltProvider.js.map +1 -1
- package/dist-es/packages/core/src/spinner/Spinner.css.js +7 -0
- package/dist-es/packages/core/src/spinner/Spinner.css.js.map +1 -0
- package/dist-es/packages/core/src/spinner/Spinner.js +76 -0
- package/dist-es/packages/core/src/spinner/Spinner.js.map +1 -0
- package/dist-es/packages/core/src/spinner/svgSpinners/SpinnerSVG.js +76 -0
- package/dist-es/packages/core/src/spinner/svgSpinners/SpinnerSVG.js.map +1 -0
- package/dist-es/packages/core/src/split-layout/SplitLayout.js +21 -0
- package/dist-es/packages/core/src/split-layout/SplitLayout.js.map +1 -0
- package/dist-es/packages/core/src/stack-layout/StackLayout.css.js +7 -0
- package/dist-es/packages/core/src/stack-layout/StackLayout.css.js.map +1 -0
- package/dist-es/packages/core/src/stack-layout/StackLayout.js +38 -3
- package/dist-es/packages/core/src/stack-layout/StackLayout.js.map +1 -1
- package/dist-es/packages/core/src/status-indicator/StatusIndicator.js +3 -2
- package/dist-es/packages/core/src/status-indicator/StatusIndicator.js.map +1 -1
- package/dist-es/packages/core/src/text/Display.js +5 -4
- package/dist-es/packages/core/src/text/Display.js.map +1 -1
- package/dist-es/packages/core/src/text/Text.css.js +1 -1
- package/dist-es/packages/core/src/text/Text.js +7 -4
- package/dist-es/packages/core/src/text/Text.js.map +1 -1
- package/dist-es/packages/core/src/theme/Theme.js.map +1 -1
- package/dist-es/packages/core/src/tooltip/Tooltip.css.js +7 -0
- package/dist-es/packages/core/src/tooltip/Tooltip.css.js.map +1 -0
- package/dist-es/packages/core/src/tooltip/Tooltip.js +87 -0
- package/dist-es/packages/core/src/tooltip/Tooltip.js.map +1 -0
- package/dist-es/packages/core/src/tooltip/useAriaAnnounce.js +90 -0
- package/dist-es/packages/core/src/tooltip/useAriaAnnounce.js.map +1 -0
- package/dist-es/packages/core/src/tooltip/useTooltip.js +102 -0
- package/dist-es/packages/core/src/tooltip/useTooltip.js.map +1 -0
- package/dist-es/packages/core/src/utils/marginMiddleware.js.map +1 -1
- package/dist-es/packages/core/src/utils/useFloatingUI.js +33 -0
- package/dist-es/packages/core/src/utils/useFloatingUI.js.map +1 -0
- package/dist-es/packages/core/src/viewport/ViewportProvider.js +6 -2
- package/dist-es/packages/core/src/viewport/ViewportProvider.js.map +1 -1
- package/dist-types/border-item/BorderItem.d.ts +1 -1
- package/dist-types/card/Card.d.ts +18 -0
- package/dist-types/card/index.d.ts +1 -0
- package/dist-types/flex-layout/FlexLayout.d.ts +2 -0
- package/dist-types/flow-layout/FlowLayout.d.ts +7 -4
- package/dist-types/index.d.ts +5 -0
- package/dist-types/link/Link.d.ts +2 -2
- package/dist-types/panel/Panel.d.ts +20 -0
- package/dist-types/panel/index.d.ts +1 -0
- package/dist-types/spinner/Spinner.d.ts +45 -0
- package/dist-types/spinner/index.d.ts +1 -0
- package/dist-types/spinner/svgSpinners/SpinnerSVG.d.ts +5 -0
- package/dist-types/split-layout/SplitLayout.d.ts +28 -0
- package/dist-types/split-layout/index.d.ts +1 -0
- package/dist-types/stack-layout/StackLayout.d.ts +14 -6
- package/dist-types/text/Display.d.ts +3 -3
- package/dist-types/text/Headings.d.ts +4 -4
- package/dist-types/text/Label.d.ts +1 -1
- package/dist-types/text/Text.d.ts +4 -0
- package/dist-types/theme/Theme.d.ts +1 -1
- package/dist-types/tooltip/Tooltip.d.ts +47 -0
- package/dist-types/tooltip/index.d.ts +2 -0
- package/dist-types/tooltip/useAriaAnnounce.d.ts +9 -0
- package/dist-types/tooltip/useTooltip.d.ts +36 -0
- package/dist-types/utils/index.d.ts +1 -0
- package/dist-types/utils/useFloatingUI.d.ts +34 -0
- package/package.json +4 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, Children, useEffect } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { GridLayout } from '../grid-layout/GridLayout.js';
|
|
5
5
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
6
|
+
import '../utils/useFloatingUI.js';
|
|
6
7
|
import '../utils/useId.js';
|
|
7
8
|
import '../salt-provider/SaltProvider.js';
|
|
8
9
|
import '../viewport/ViewportProvider.js';
|
|
@@ -36,7 +37,7 @@ const BorderLayout = forwardRef(
|
|
|
36
37
|
"--gridLayout-gridTemplate": gridTemplateAreas
|
|
37
38
|
};
|
|
38
39
|
return /* @__PURE__ */ jsx(GridLayout, {
|
|
39
|
-
className:
|
|
40
|
+
className: clsx(withBaseName(), className, "saltGridLayout-area"),
|
|
40
41
|
columns: numberOfColumns,
|
|
41
42
|
gap: gap || 0,
|
|
42
43
|
style: borderLayoutStyles,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BorderLayout.js","sources":["../src/border-layout/BorderLayout.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n ReactElement,\n useEffect,\n ElementType,\n} from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"BorderLayout.js","sources":["../src/border-layout/BorderLayout.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n ReactElement,\n useEffect,\n ElementType,\n} from \"react\";\nimport { clsx } from \"clsx\";\n\nimport { GridLayout, GridLayoutProps } from \"../grid-layout\";\nimport {\n makePrefixer,\n PolymorphicRef,\n PolymorphicComponentPropWithRef,\n} from \"../utils\";\nimport { BorderItemProps } from \"../border-item\";\n\nexport type BorderLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the size of the gutter between the columns and the rows by setting a density multiplier. Defaults to 0\n */\n gap?: GridLayoutProps<T>[\"gap\"];\n /**\n * Defines the size of the gutter between the columns by setting a density multiplier. Defaults to 0\n */\n columnGap?: GridLayoutProps<T>[\"columnGap\"];\n /**\n * Defines the size of the gutter between the rows by setting a density multiplier. Defaults to 0\n */\n rowGap?: GridLayoutProps<T>[\"rowGap\"];\n /**\n * Border item components to be rendered.\n */\n children: ReactElement<BorderItemProps<T>>[];\n }\n >;\n\nconst withBaseName = makePrefixer(\"saltBorderLayout\");\n\nconst numberOfColumns = 3;\n\ntype BorderLayoutComponent = <T extends ElementType = \"div\">(\n props: BorderLayoutProps<T>\n) => ReactElement | null;\n\nexport const BorderLayout: BorderLayoutComponent = forwardRef(\n <T extends ElementType>(\n { children, className, gap, style, ...rest }: BorderLayoutProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const borderAreas = Children.map(\n children,\n (child: ReactElement<BorderItemProps<T>>) => child.props.position\n );\n\n const topSection = borderAreas.includes(\"north\")\n ? \"north \".repeat(numberOfColumns)\n : \"none \".repeat(numberOfColumns);\n\n const leftSection = borderAreas.includes(\"west\") ? \"west\" : \"center\";\n\n const rightSection = borderAreas.includes(\"east\") ? \"east\" : \"center\";\n\n const midSection = `${leftSection} center ${rightSection}`;\n\n const bottomSection = borderAreas.includes(\"south\")\n ? \"south \".repeat(numberOfColumns)\n : \"none \".repeat(numberOfColumns);\n\n const gridTemplateAreas = `\"${topSection}\" \"${midSection}\" \"${bottomSection}\"`;\n\n const hasMainSection = borderAreas.includes(\"center\");\n\n useEffect(() => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!hasMainSection) {\n console.warn(\n \"No main section has been found. A main section should be provided.\"\n );\n }\n }\n }, [hasMainSection]);\n\n const borderLayoutStyles = {\n ...style,\n \"--gridLayout-gridTemplate\": gridTemplateAreas,\n };\n\n return (\n <GridLayout\n className={clsx(withBaseName(), className, \"saltGridLayout-area\")}\n columns={numberOfColumns}\n gap={gap || 0}\n style={borderLayoutStyles}\n ref={ref}\n {...rest}\n >\n {children}\n </GridLayout>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;;AAwCA,MAAM,YAAA,GAAe,aAAa,kBAAkB,CAAA,CAAA;AAEpD,MAAM,eAAkB,GAAA,CAAA,CAAA;AAMjB,MAAM,YAAsC,GAAA,UAAA;AAAA,EACjD,CACE,EAAE,QAAU,EAAA,SAAA,EAAW,KAAK,KAAU,EAAA,GAAA,IAAA,IACtC,GACG,KAAA;AACH,IAAA,MAAM,cAAc,QAAS,CAAA,GAAA;AAAA,MAC3B,QAAA;AAAA,MACA,CAAC,KAA4C,KAAA,KAAA,CAAM,KAAM,CAAA,QAAA;AAAA,KAC3D,CAAA;AAEA,IAAM,MAAA,UAAA,GAAa,WAAY,CAAA,QAAA,CAAS,OAAO,CAAA,GAC3C,QAAS,CAAA,MAAA,CAAO,eAAe,CAAA,GAC/B,OAAQ,CAAA,MAAA,CAAO,eAAe,CAAA,CAAA;AAElC,IAAA,MAAM,WAAc,GAAA,WAAA,CAAY,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA,QAAA,CAAA;AAE5D,IAAA,MAAM,YAAe,GAAA,WAAA,CAAY,QAAS,CAAA,MAAM,IAAI,MAAS,GAAA,QAAA,CAAA;AAE7D,IAAM,MAAA,UAAA,GAAa,GAAG,WAAsB,CAAA,QAAA,EAAA,YAAA,CAAA,CAAA,CAAA;AAE5C,IAAM,MAAA,aAAA,GAAgB,WAAY,CAAA,QAAA,CAAS,OAAO,CAAA,GAC9C,QAAS,CAAA,MAAA,CAAO,eAAe,CAAA,GAC/B,OAAQ,CAAA,MAAA,CAAO,eAAe,CAAA,CAAA;AAElC,IAAM,MAAA,iBAAA,GAAoB,CAAI,CAAA,EAAA,UAAA,CAAA,GAAA,EAAgB,UAAgB,CAAA,GAAA,EAAA,aAAA,CAAA,CAAA,CAAA,CAAA;AAE9D,IAAM,MAAA,cAAA,GAAiB,WAAY,CAAA,QAAA,CAAS,QAAQ,CAAA,CAAA;AAEpD,IAAA,SAAA,CAAU,MAAM;AACd,MAAI,IAAA,OAAA,CAAQ,GAAI,CAAA,QAAA,KAAa,YAAc,EAAA;AACzC,QAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,UAAQ,OAAA,CAAA,IAAA;AAAA,YACN,oEAAA;AAAA,WACF,CAAA;AAAA,SACF;AAAA,OACF;AAAA,KACF,EAAG,CAAC,cAAc,CAAC,CAAA,CAAA;AAEnB,IAAA,MAAM,kBAAqB,GAAA;AAAA,MACzB,GAAG,KAAA;AAAA,MACH,2BAA6B,EAAA,iBAAA;AAAA,KAC/B,CAAA;AAEA,IAAA,uBACG,GAAA,CAAA,UAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,WAAW,qBAAqB,CAAA;AAAA,MAChE,OAAS,EAAA,eAAA;AAAA,MACT,KAAK,GAAO,IAAA,CAAA;AAAA,MACZ,KAAO,EAAA,kBAAA;AAAA,MACP,GAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
5
6
|
import '../utils/useId.js';
|
|
6
7
|
import '../salt-provider/SaltProvider.js';
|
|
7
8
|
import '../viewport/ViewportProvider.js';
|
|
@@ -35,7 +36,7 @@ const Button = forwardRef(
|
|
|
35
36
|
const { tabIndex, ...restButtonProps } = buttonProps;
|
|
36
37
|
return /* @__PURE__ */ jsx("button", {
|
|
37
38
|
...restButtonProps,
|
|
38
|
-
className:
|
|
39
|
+
className: clsx(withBaseName(), className, withBaseName(variant), {
|
|
39
40
|
[withBaseName("disabled")]: disabled,
|
|
40
41
|
[withBaseName("active")]: active
|
|
41
42
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../src/button/Button.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef, forwardRef, ReactElement } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../src/button/Button.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef, forwardRef, ReactElement } from \"react\";\nimport { clsx } from \"clsx\";\nimport { makePrefixer } from \"../utils\";\n\nimport \"./Button.css\";\nimport { useButton } from \"./useButton\";\n\nconst withBaseName = makePrefixer(\"saltButton\");\n\nexport const ButtonVariantValues = [\"primary\", \"secondary\", \"cta\"] as const;\nexport type ButtonVariant = typeof ButtonVariantValues[number];\n\nexport interface ButtonProps extends ComponentPropsWithoutRef<\"button\"> {\n /**\n * If `true`, the button will be disabled.\n */\n disabled?: boolean;\n /**\n * If `true`, the button will be focusable when disabled.\n */\n focusableWhenDisabled?: boolean;\n /**\n * The variant to use. Options are 'primary', 'secondary' and 'cta'.\n * 'primary' is the default value.\n */\n variant?: ButtonVariant;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n children,\n className,\n disabled,\n focusableWhenDisabled,\n onKeyUp,\n onKeyDown,\n onBlur,\n onClick,\n type = \"button\",\n variant = \"primary\",\n ...restProps\n },\n ref?\n ): ReactElement<ButtonProps> {\n const { active, buttonProps } = useButton({\n disabled,\n focusableWhenDisabled,\n onKeyUp,\n onKeyDown,\n onBlur,\n onClick,\n });\n // we do not want to spread tab index in this case because the button element\n // does not require tabindex=\"0\" attribute\n const { tabIndex, ...restButtonProps } = buttonProps;\n return (\n <button\n {...restButtonProps}\n className={clsx(withBaseName(), className, withBaseName(variant), {\n [withBaseName(\"disabled\")]: disabled,\n [withBaseName(\"active\")]: active,\n })}\n {...restProps}\n ref={ref}\n type={type}\n >\n {children}\n </button>\n );\n }\n);\n"],"names":["Button"],"mappings":";;;;;;;;;;;AAOA,MAAM,YAAA,GAAe,aAAa,YAAY,CAAA,CAAA;AAEvC,MAAM,mBAAsB,GAAA,CAAC,SAAW,EAAA,WAAA,EAAa,KAAK,EAAA;AAmB1D,MAAM,MAAS,GAAA,UAAA;AAAA,EACpB,SAASA,OACP,CAAA;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,qBAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,IAAO,GAAA,QAAA;AAAA,IACP,OAAU,GAAA,SAAA;AAAA,IACP,GAAA,SAAA;AAAA,KAEL,GAC2B,EAAA;AAC3B,IAAA,MAAM,EAAE,MAAA,EAAQ,WAAY,EAAA,GAAI,SAAU,CAAA;AAAA,MACxC,QAAA;AAAA,MACA,qBAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,EAAE,QAAa,EAAA,GAAA,eAAA,EAAoB,GAAA,WAAA,CAAA;AACzC,IAAA,uBACG,GAAA,CAAA,QAAA,EAAA;AAAA,MACE,GAAG,eAAA;AAAA,MACJ,WAAW,IAAK,CAAA,YAAA,IAAgB,SAAW,EAAA,YAAA,CAAa,OAAO,CAAG,EAAA;AAAA,QAChE,CAAC,YAAa,CAAA,UAAU,CAAI,GAAA,QAAA;AAAA,QAC5B,CAAC,YAAa,CAAA,QAAQ,CAAI,GAAA,MAAA;AAAA,OAC3B,CAAA;AAAA,MACA,GAAG,SAAA;AAAA,MACJ,GAAA;AAAA,MACA,IAAA;AAAA,MAEC,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "/* Styles applied to the root element */\n.saltCard {\n --card-borderColor: var(--salt-container-primary-borderColor);\n --card-shadow: var(--salt-overlayable-shadow);\n\n background: var(--saltCard-background, var(--salt-container-primary-background));\n border-width: var(--saltCard-borderWidth, var(--salt-size-border));\n border-style: var(--saltCard-borderStyle, var(--salt-container-borderStyle));\n border-color: var(--saltCard-borderColor, var(--card-borderColor));\n border-radius: var(--saltCard-borderRadius, 0);\n box-shadow: var(--saltCard-boxShadow, var(--card-shadow));\n overflow: hidden;\n transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* TODO: this should possibly be moved to animation.css? */\n}\n\n/* Styles applied to Card content */\n.saltCard-content {\n color: var(--saltCard-color, var(--salt-text-primary-foreground));\n min-height: var(--salt-text-minHeight);\n padding: var(--saltCard-padding, calc(var(--salt-size-unit) * 3));\n}\n\n/* Styles applied if `interactable={true}` */\n.saltCard-interactable {\n display: block;\n transition: none;\n}\n\n/* Styles applied on hover if `interactable={true}` */\na:focus .saltCard-interactable,\n.saltCard-interactable:hover {\n --card-borderColor: var(--salt-selectable-borderColor-hover);\n --card-shadow: var(--salt-overlayable-shadow-hover);\n\n cursor: var(--saltCard-cursor-hover, var(--salt-selectable-cursor-hover));\n position: relative;\n}\n\n/* Styles applied on active state if `interactable={true}` */\n.saltCard-interactable:active {\n --card-borderColor: var(--salt-selectable-borderColor-selected);\n --card-shadow: var(--salt-overlayable-shadow-hover);\n\n outline: var(--salt-focused-outline);\n outline-offset: var(--salt-focused-outlineOffset);\n}\n\n/* Styles applied on hover if `interactable={true}` and `disabled={true}` */\na:focus .saltCard-interactable.saltCard-disabled,\n.saltCard-interactable.saltCard-disabled:hover,\n.saltCard-interactable.saltCard-disabled:active {\n --card-shadow: var(--salt-overlayable-shadow);\n}\n\n/* Styles applied if `disabled={true}` */\n.saltCard-disabled,\n.saltCard-disabled.saltCard-interactable,\na:focus .saltCard-interactable.saltCard-disabled {\n --card-borderColor: var(--salt-container-primary-borderColor-disabled);\n\n color: var(--saltCard-color-disabled, var(--salt-text-primary-foreground-disabled));\n cursor: var(--saltCard-cursor-disabled, var(--salt-selectable-cursor-disabled));\n outline: none;\n}\n\n/* Styles applied to nested divs if `disabled={true}` */\n.saltCard-disabled div {\n pointer-events: none;\n}\n";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
7
|
+
//# sourceMappingURL=Card.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
6
|
+
import '../utils/useId.js';
|
|
7
|
+
import '../salt-provider/SaltProvider.js';
|
|
8
|
+
import '../viewport/ViewportProvider.js';
|
|
9
|
+
import './Card.css.js';
|
|
10
|
+
|
|
11
|
+
const withBaseName = makePrefixer("saltCard");
|
|
12
|
+
const Card = forwardRef(function Card2(props, ref) {
|
|
13
|
+
const { className, disabled, interactable, children, ...rest } = props;
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: clsx(
|
|
16
|
+
withBaseName(),
|
|
17
|
+
{
|
|
18
|
+
[withBaseName("disabled")]: disabled,
|
|
19
|
+
[withBaseName("interactable")]: interactable
|
|
20
|
+
},
|
|
21
|
+
className
|
|
22
|
+
),
|
|
23
|
+
ref,
|
|
24
|
+
...rest,
|
|
25
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: withBaseName("content"),
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { Card };
|
|
33
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../src/card/Card.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { ComponentPropsWithoutRef, forwardRef } from \"react\";\nimport { makePrefixer } from \"../utils\";\nimport \"./Card.css\";\n\nconst withBaseName = makePrefixer(\"saltCard\");\n\nexport interface CardProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * If `true`, the card will be disabled.\n */\n disabled?: boolean;\n /**\n * If `true`, interactive styles will be applied to `Card`. These styles give prominence to certain content\n * on the page.\n */\n interactable?: boolean;\n}\n\n/**\n * Card component is a sheet if material that serves as an entry point to more detailed information.\n * Cards display content composed of different elements whose size or supported actions vary.\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n props,\n ref\n) {\n const { className, disabled, interactable, children, ...rest } = props;\n\n return (\n <div\n className={clsx(\n withBaseName(),\n {\n [withBaseName(\"disabled\")]: disabled,\n [withBaseName(\"interactable\")]: interactable,\n },\n className\n )}\n ref={ref}\n {...rest}\n >\n <div className={withBaseName(\"content\")}>{children}</div>\n </div>\n );\n});\n"],"names":["Card"],"mappings":";;;;;;;;;;AAKA,MAAM,YAAA,GAAe,aAAa,UAAU,CAAA,CAAA;AAkBrC,MAAM,IAAO,GAAA,UAAA,CAAsC,SAASA,KAAAA,CACjE,OACA,GACA,EAAA;AACA,EAAA,MAAM,EAAE,SAAW,EAAA,QAAA,EAAU,YAAc,EAAA,QAAA,EAAA,GAAa,MAAS,GAAA,KAAA,CAAA;AAEjE,EAAA,uBACG,GAAA,CAAA,KAAA,EAAA;AAAA,IACC,SAAW,EAAA,IAAA;AAAA,MACT,YAAa,EAAA;AAAA,MACb;AAAA,QACE,CAAC,YAAa,CAAA,UAAU,CAAI,GAAA,QAAA;AAAA,QAC5B,CAAC,YAAa,CAAA,cAAc,CAAI,GAAA,YAAA;AAAA,OAClC;AAAA,MACA,SAAA;AAAA,KACF;AAAA,IACA,GAAA;AAAA,IACC,GAAG,IAAA;AAAA,IAEJ,QAAC,kBAAA,GAAA,CAAA,KAAA,EAAA;AAAA,MAAI,SAAA,EAAW,aAAa,SAAS,CAAA;AAAA,MAAI,QAAA;AAAA,KAAS,CAAA;AAAA,GACrD,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
4
|
+
import '../utils/useFloatingUI.js';
|
|
4
5
|
import '../utils/useId.js';
|
|
5
6
|
import { useResponsiveProp } from '../utils/useResponsiveProp.js';
|
|
6
7
|
import './FlexItem.css.js';
|
|
7
|
-
import
|
|
8
|
+
import { clsx } from 'clsx';
|
|
8
9
|
|
|
9
10
|
const withBaseName = makePrefixer("saltFlexItem");
|
|
10
11
|
const FLEX_ITEM_ALIGNMENTS = [
|
|
@@ -34,7 +35,7 @@ const FlexItem = forwardRef(
|
|
|
34
35
|
...style
|
|
35
36
|
};
|
|
36
37
|
return /* @__PURE__ */ jsx(Component, {
|
|
37
|
-
className:
|
|
38
|
+
className: clsx(className, withBaseName()),
|
|
38
39
|
ref,
|
|
39
40
|
style: itemStyle,
|
|
40
41
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexItem.js","sources":["../src/flex-item/FlexItem.tsx"],"sourcesContent":["import { forwardRef, ElementType, ReactElement } from \"react\";\nimport {\n makePrefixer,\n ResponsiveProp,\n useResponsiveProp,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\nimport \"./FlexItem.css\";\nimport
|
|
1
|
+
{"version":3,"file":"FlexItem.js","sources":["../src/flex-item/FlexItem.tsx"],"sourcesContent":["import { forwardRef, ElementType, ReactElement } from \"react\";\nimport {\n makePrefixer,\n ResponsiveProp,\n useResponsiveProp,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\nimport \"./FlexItem.css\";\nimport { clsx } from \"clsx\";\n\nconst withBaseName = makePrefixer(\"saltFlexItem\");\nexport const FLEX_ITEM_ALIGNMENTS = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\nexport type flexItemAlignment = typeof FLEX_ITEM_ALIGNMENTS[number];\n\nexport type FlexItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Allows the alignment specified by parent to be overridden for individual items, default is \"start\".\n */\n align?: flexItemAlignment;\n /**\n * Defines the ability for an item to shrink x times more compared to it's siblings, default is 1.\n\n */\n shrink?: ResponsiveProp<number>;\n /**\n * Defines the ability for an item to grow x times more compared to it's siblings, default is 0.\n */\n grow?: ResponsiveProp<number>;\n }\n >;\n\ntype FlexItemComponent = <T extends ElementType = \"div\">(\n props: FlexItemProps<T>\n) => ReactElement | null;\n\nexport const FlexItem: FlexItemComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n align,\n children,\n className,\n shrink,\n grow,\n style,\n ...rest\n }: FlexItemProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const Component = as || \"div\";\n const flexItemShrink = useResponsiveProp(shrink, 1);\n const flexItemGrow = useResponsiveProp(grow, 0);\n\n const itemStyle = {\n \"--saltFlexItem-alignment\": align,\n \"--saltFlexItem-shrink\": flexItemShrink,\n \"--saltFlexItem-grow\": flexItemGrow,\n ...style,\n };\n return (\n <Component\n className={clsx(className, withBaseName())}\n ref={ref}\n style={itemStyle}\n {...rest}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AAWA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA,CAAA;AACzC,MAAM,oBAAuB,GAAA;AAAA,EAClC,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AACF,EAAA;AA4BO,MAAM,QAA8B,GAAA,UAAA;AAAA,EACzC,CACE;AAAA,IACE,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA,KAAA;AAAA,IACG,GAAA,IAAA;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA,CAAA;AACxB,IAAM,MAAA,cAAA,GAAiB,iBAAkB,CAAA,MAAA,EAAQ,CAAC,CAAA,CAAA;AAClD,IAAM,MAAA,YAAA,GAAe,iBAAkB,CAAA,IAAA,EAAM,CAAC,CAAA,CAAA;AAE9C,IAAA,MAAM,SAAY,GAAA;AAAA,MAChB,0BAA4B,EAAA,KAAA;AAAA,MAC5B,uBAAyB,EAAA,cAAA;AAAA,MACzB,qBAAuB,EAAA,YAAA;AAAA,MACvB,GAAG,KAAA;AAAA,KACL,CAAA;AACA,IAAA,uBACG,GAAA,CAAA,SAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,SAAW,EAAA,YAAA,EAAc,CAAA;AAAA,MACzC,GAAA;AAAA,MACA,KAAO,EAAA,SAAA;AAAA,MACN,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".salt-density-touch {\n --flexLayout-gap-density-multiplier: 2;\n}\n\n/* Default variables applied to the root element */\n.saltFlexLayout {\n --flexLayout-gap-multiplier: var(--flexLayout-gap-density-multiplier, 3);\n --flexLayout-layout-display: flex;\n --flexLayout-direction: row;\n --flexLayout-wrap: nowrap;\n --flexLayout-justify: flex-start;\n --flexLayout-align: stretch;\n --flexLayout-separator: var(--salt-size-border);\n --flexLayout-gap: calc(var(--salt-size-unit) * var(--flexLayout-gap-multiplier));\n}\n\n/* Style applied to the root element */\n.saltFlexLayout {\n gap: var(--flexLayout-gap);\n display: var(--flexLayout-layout-display);\n flex-direction: var(--flexLayout-direction);\n flex-wrap: var(--flexLayout-wrap);\n justify-content: var(--flexLayout-justify);\n align-items: var(--flexLayout-align);\n}\n\n.saltFlexLayout-separator-
|
|
3
|
+
var css_248z = ".salt-density-touch {\n --flexLayout-gap-density-multiplier: 2;\n}\n\n/* Default variables applied to the root element */\n.saltFlexLayout {\n --flexLayout-gap-multiplier: var(--flexLayout-gap-density-multiplier, 3);\n --flexLayout-layout-display: flex;\n --flexLayout-direction: row;\n --flexLayout-wrap: nowrap;\n --flexLayout-justify: flex-start;\n --flexLayout-align: stretch;\n --flexLayout-separator: var(--salt-size-border);\n --flexLayout-gap: calc(var(--salt-size-unit) * var(--flexLayout-gap-multiplier));\n}\n\n/* Style applied to the root element */\n.saltFlexLayout {\n gap: var(--flexLayout-gap);\n display: var(--flexLayout-layout-display);\n flex-direction: var(--flexLayout-direction);\n flex-wrap: var(--flexLayout-wrap);\n justify-content: var(--flexLayout-justify);\n align-items: var(--flexLayout-align);\n}\n\n.saltFlexLayout-separator {\n gap: calc(var(--flexLayout-gap) * 2);\n}\n\n.saltFlexLayout-separator > * {\n position: relative;\n}\n.saltFlexLayout-separator > *:not(:last-child)::after {\n position: absolute;\n display: block;\n content: \"\";\n background-color: var(--salt-separable-secondary-borderColor);\n}\n\n/* Row separator */\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n height: 100%;\n}\n\n.saltFlexLayout-separator-row > *:not(:last-child)::after {\n width: var(--flexLayout-separator);\n top: 0;\n}\n.saltFlexLayout-separator-row-start > *:not(:last-child)::after {\n right: 0;\n}\n.saltFlexLayout-separator-row-center > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-row-end > *:not(:last-child)::after {\n right: calc(var(--flexLayout-gap) * -2);\n}\n\n/* Column separator */\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n width: 100%;\n}\n\n.saltFlexLayout-separator-column > *:not(:last-child)::after {\n height: var(--flexLayout-separator);\n left: 0;\n width: 100%;\n}\n.saltFlexLayout-separator-column-start > *:not(:last-child)::after {\n bottom: 0;\n}\n.saltFlexLayout-separator-column-center > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -1);\n}\n.saltFlexLayout-separator-column-end > *:not(:last-child)::after {\n bottom: calc(var(--flexLayout-gap) * -2);\n}\n";
|
|
4
4
|
styleInject(css_248z);
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
5
6
|
import '../utils/useId.js';
|
|
6
7
|
import { useResponsiveProp } from '../utils/useResponsiveProp.js';
|
|
7
8
|
import './FlexLayout.css.js';
|
|
@@ -45,7 +46,7 @@ const FlexLayout = forwardRef(
|
|
|
45
46
|
"--flexLayout-wrap": flexWrap ? "wrap" : "nowrap"
|
|
46
47
|
};
|
|
47
48
|
return /* @__PURE__ */ jsx(Component, {
|
|
48
|
-
className:
|
|
49
|
+
className: clsx(className, withBaseName(), {
|
|
49
50
|
[withBaseName("separator")]: separatorAlignment && !wrap,
|
|
50
51
|
[withBaseName(
|
|
51
52
|
`separator-${flexDirection || "row"}-${separatorAlignment || "center"}`
|
|
@@ -55,10 +56,7 @@ const FlexLayout = forwardRef(
|
|
|
55
56
|
ref,
|
|
56
57
|
style: flexLayoutStyles,
|
|
57
58
|
...rest,
|
|
58
|
-
children
|
|
59
|
-
className: withBaseName("separator-wrapper"),
|
|
60
|
-
children: child
|
|
61
|
-
})) : children
|
|
59
|
+
children
|
|
62
60
|
});
|
|
63
61
|
}
|
|
64
62
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexLayout.js","sources":["../src/flex-layout/FlexLayout.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"FlexLayout.js","sources":["../src/flex-layout/FlexLayout.tsx"],"sourcesContent":["import { ElementType, forwardRef, ReactElement } from \"react\";\nimport { clsx } from \"clsx\";\n\nimport {\n makePrefixer,\n ResponsiveProp,\n useResponsiveProp,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\n\nimport \"./FlexLayout.css\";\n\nconst withBaseName = makePrefixer(\"saltFlexLayout\");\n\nexport type LayoutSeparator = \"start\" | \"center\" | \"end\";\nexport type LayoutDirection = \"row\" | \"column\";\n\nexport const FLEX_ALIGNMENT_BASE = [\"start\", \"end\", \"center\"] as const;\nexport const FLEX_CONTENT_ALIGNMENT_BASE = [\n ...FLEX_ALIGNMENT_BASE,\n \"space-between\",\n \"space-around\",\n \"space-evenly\",\n] as const;\n\nexport type FlexAlignment = typeof FLEX_ALIGNMENT_BASE[number];\nexport type FlexContentAlignment = typeof FLEX_CONTENT_ALIGNMENT_BASE[number];\n\nexport type FlexLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexAlignment | \"stretch\" | \"baseline\";\n /**\n * Establishes the main-axis, defining the direction children are placed. Default is \"row\".\n */\n direction?: ResponsiveProp<LayoutDirection>;\n /**\n * Controls the space between items, default is 3.\n */\n gap?: ResponsiveProp<number>;\n /**\n * Defines the alignment along the main axis, default is \"start\".\n */\n justify?: FlexContentAlignment;\n /**\n * **Deprecated:** For separators see `StackLayout` component instead.\n *\n * Adds a separator between elements if wrap is not active, default is false.\n */\n separators?: LayoutSeparator | true;\n /**\n * Allow the items to wrap as needed, default is false.\n */\n wrap?: ResponsiveProp<boolean>;\n }\n >;\n\ntype FlexLayoutComponent = <T extends ElementType = \"div\">(\n props: FlexLayoutProps<T>\n) => ReactElement | null;\n\nexport const FlexLayout: FlexLayoutComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n align,\n children,\n className,\n direction,\n gap,\n justify,\n separators,\n style,\n wrap,\n ...rest\n }: FlexLayoutProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const Component = as || \"div\";\n const separatorAlignment = separators === true ? \"center\" : separators;\n const addPrefix = (style: string) => {\n return style === \"start\" || style === \"end\" ? `flex-${style}` : style;\n };\n\n const flexGap = useResponsiveProp(gap, 3);\n const flexDirection = useResponsiveProp(direction, \"row\");\n const flexWrap = useResponsiveProp(wrap, false);\n const flexLayoutStyles = {\n ...style,\n \"--flexLayout-align\": align && addPrefix(align),\n \"--flexLayout-direction\": flexDirection,\n \"--flexLayout-gap-multiplier\": flexGap,\n \"--flexLayout-justify\": justify && addPrefix(justify),\n \"--flexLayout-wrap\": flexWrap ? \"wrap\" : \"nowrap\",\n };\n\n return (\n <Component\n className={clsx(className, withBaseName(), {\n [withBaseName(\"separator\")]: separatorAlignment && !wrap,\n [withBaseName(\n `separator-${flexDirection || \"row\"}-${\n separatorAlignment || \"center\"\n }`\n )]: separatorAlignment && !wrap,\n [withBaseName(`separator-${flexDirection || \"row\"}`)]:\n separatorAlignment && !wrap,\n })}\n ref={ref}\n style={flexLayoutStyles}\n {...rest}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":["style"],"mappings":";;;;;;;;;AAaA,MAAM,YAAA,GAAe,aAAa,gBAAgB,CAAA,CAAA;AAK3C,MAAM,mBAAsB,GAAA,CAAC,OAAS,EAAA,KAAA,EAAO,QAAQ,EAAA;AACrD,MAAM,2BAA8B,GAAA;AAAA,EACzC,GAAG,mBAAA;AAAA,EACH,eAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AACF,EAAA;AA0CO,MAAM,UAAkC,GAAA,UAAA;AAAA,EAC7C,CACE;AAAA,IACE,EAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,SAAA;AAAA,IACA,GAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACG,GAAA,IAAA;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA,CAAA;AACxB,IAAM,MAAA,kBAAA,GAAqB,UAAe,KAAA,IAAA,GAAO,QAAW,GAAA,UAAA,CAAA;AAC5D,IAAM,MAAA,SAAA,GAAY,CAACA,MAAkB,KAAA;AACnC,MAAA,OAAOA,MAAU,KAAA,OAAA,IAAWA,MAAU,KAAA,KAAA,GAAQ,QAAQA,MAAUA,CAAAA,CAAAA,GAAAA,MAAAA,CAAAA;AAAA,KAClE,CAAA;AAEA,IAAM,MAAA,OAAA,GAAU,iBAAkB,CAAA,GAAA,EAAK,CAAC,CAAA,CAAA;AACxC,IAAM,MAAA,aAAA,GAAgB,iBAAkB,CAAA,SAAA,EAAW,KAAK,CAAA,CAAA;AACxD,IAAM,MAAA,QAAA,GAAW,iBAAkB,CAAA,IAAA,EAAM,KAAK,CAAA,CAAA;AAC9C,IAAA,MAAM,gBAAmB,GAAA;AAAA,MACvB,GAAG,KAAA;AAAA,MACH,oBAAA,EAAsB,KAAS,IAAA,SAAA,CAAU,KAAK,CAAA;AAAA,MAC9C,wBAA0B,EAAA,aAAA;AAAA,MAC1B,6BAA+B,EAAA,OAAA;AAAA,MAC/B,sBAAA,EAAwB,OAAW,IAAA,SAAA,CAAU,OAAO,CAAA;AAAA,MACpD,mBAAA,EAAqB,WAAW,MAAS,GAAA,QAAA;AAAA,KAC3C,CAAA;AAEA,IAAA,uBACG,GAAA,CAAA,SAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,SAAW,EAAA,YAAA,EAAgB,EAAA;AAAA,QACzC,CAAC,YAAA,CAAa,WAAW,CAAA,GAAI,sBAAsB,CAAC,IAAA;AAAA,QACpD,CAAC,YAAA;AAAA,UACC,CAAA,UAAA,EAAa,aAAiB,IAAA,KAAA,CAAA,CAAA,EAC5B,kBAAsB,IAAA,QAAA,CAAA,CAAA;AAAA,SAE1B,GAAI,sBAAsB,CAAC,IAAA;AAAA,QAC3B,CAAC,YAAa,CAAA,CAAA,UAAA,EAAa,iBAAiB,KAAO,CAAA,CAAA,CAAA,GACjD,sBAAsB,CAAC,IAAA;AAAA,OAC1B,CAAA;AAAA,MACD,GAAA;AAAA,MACA,KAAO,EAAA,gBAAA;AAAA,MACN,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -3,12 +3,13 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { FlexLayout } from '../flex-layout/FlexLayout.js';
|
|
4
4
|
|
|
5
5
|
const FlowLayout = forwardRef(
|
|
6
|
-
|
|
6
|
+
({ children, ...rest }, ref) => {
|
|
7
7
|
return /* @__PURE__ */ jsx(FlexLayout, {
|
|
8
8
|
direction: "row",
|
|
9
9
|
ref,
|
|
10
10
|
wrap: true,
|
|
11
|
-
...rest
|
|
11
|
+
...rest,
|
|
12
|
+
children
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowLayout.js","sources":["../src/flow-layout/FlowLayout.tsx"],"sourcesContent":["import { ElementType, forwardRef,
|
|
1
|
+
{"version":3,"file":"FlowLayout.js","sources":["../src/flow-layout/FlowLayout.tsx"],"sourcesContent":["import { ElementType, forwardRef, ReactElement } from \"react\";\nimport { FlexLayout, FlexLayoutProps } from \"../flex-layout\";\nimport { PolymorphicComponentPropWithRef, PolymorphicRef } from \"../utils\";\n\nexport type FlowLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is \"stretch\".\n */\n align?: FlexLayoutProps<ElementType>[\"align\"];\n /**\n * Controls the space between items, default is 3.\n */\n gap?: FlexLayoutProps<ElementType>[\"gap\"];\n /**\n * Defines the alignment along the main axis, default is \"start\"\n */\n justify?: FlexLayoutProps<ElementType>[\"justify\"];\n }\n >;\n\ntype FlowLayoutComponent = <T extends ElementType = \"div\">(\n props: FlowLayoutProps<T>\n) => ReactElement | null;\n\nexport const FlowLayout: FlowLayoutComponent = forwardRef(\n <T extends ElementType = \"div\">(\n { children, ...rest }: FlowLayoutProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n return (\n <FlexLayout direction=\"row\" ref={ref} wrap {...rest}>\n {children}\n </FlexLayout>\n );\n }\n);\n"],"names":[],"mappings":";;;;AA2BO,MAAM,UAAkC,GAAA,UAAA;AAAA,EAC7C,CACE,EAAE,QAAa,EAAA,GAAA,IAAA,IACf,GACG,KAAA;AACH,IAAA,uBACG,GAAA,CAAA,UAAA,EAAA;AAAA,MAAW,SAAU,EAAA,KAAA;AAAA,MAAM,GAAA;AAAA,MAAU,IAAI,EAAA,IAAA;AAAA,MAAE,GAAG,IAAA;AAAA,MAC5C,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
5
6
|
import '../utils/useId.js';
|
|
6
7
|
import { useResponsiveProp } from '../utils/useResponsiveProp.js';
|
|
7
8
|
import './GridItem.css.js';
|
|
@@ -46,7 +47,7 @@ const GridItem = forwardRef(
|
|
|
46
47
|
"--gridItem-gridColumnEnd": gridColumnEnd
|
|
47
48
|
};
|
|
48
49
|
return /* @__PURE__ */ jsx(Component, {
|
|
49
|
-
className:
|
|
50
|
+
className: clsx(withBaseName(), className),
|
|
50
51
|
style: gridStyles,
|
|
51
52
|
ref,
|
|
52
53
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridItem.js","sources":["../src/grid-item/GridItem.tsx"],"sourcesContent":["import { forwardRef, ElementType, ReactElement } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"GridItem.js","sources":["../src/grid-item/GridItem.tsx"],"sourcesContent":["import { forwardRef, ElementType, ReactElement } from \"react\";\nimport { clsx } from \"clsx\";\n\nimport {\n makePrefixer,\n ResponsiveProp,\n useResponsiveProp,\n PolymorphicRef,\n PolymorphicComponentPropWithRef,\n} from \"../utils\";\nimport \"./GridItem.css\";\n\nexport const GRID_ALIGNMENT_BASE = [\n \"start\",\n \"end\",\n \"center\",\n \"stretch\",\n] as const;\n\ntype GridAlignment = typeof GRID_ALIGNMENT_BASE[number];\n\ntype GridProperty = number | \"auto\";\nexport type GridItemProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * The item will span across the provided number of grid columns. Defaults to \"auto\"\n */\n colSpan?: ResponsiveProp<GridProperty>;\n /**\n * The item will span across the provided number of grid rows. Defaults to \"auto\"\n */\n rowSpan?: ResponsiveProp<GridProperty>;\n /**\n * Aligns a grid item inside a cell along the inline (row) axis. Defaults to \"stretch\"\n */\n horizontalAlignment?: GridAlignment;\n /**\n * Aligns a grid item inside a cell along the block (column) axis. Defaults to \"stretch\"\n */\n verticalAlignment?: GridAlignment;\n }\n >;\n\nconst withBaseName = makePrefixer(\"saltGridItem\");\n\nconst colStart = \"auto\";\nconst colEnd = \"auto\";\nconst rowStart = \"auto\";\nconst rowEnd = \"auto\";\n\ntype GridItemComponent = <T extends ElementType = \"div\">(\n props: GridItemProps<T>\n) => ReactElement | null;\n\nexport const GridItem: GridItemComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n children,\n className,\n colSpan,\n rowSpan,\n horizontalAlignment = \"stretch\",\n verticalAlignment = \"stretch\",\n style,\n ...rest\n }: GridItemProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const Component = as || \"div\";\n const gridItemColSpan = useResponsiveProp(colSpan, \"auto\");\n\n const gridItemRowSpan = useResponsiveProp(rowSpan, \"auto\");\n\n const gridColumnStart = gridItemColSpan\n ? `span ${gridItemColSpan}`\n : colStart;\n\n const gridColumnEnd = gridItemColSpan ? `span ${gridItemColSpan}` : colEnd;\n\n const gridRowStart = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowStart;\n\n const gridRowEnd = gridItemRowSpan ? `span ${gridItemRowSpan}` : rowEnd;\n\n const gridStyles = {\n ...style,\n \"--gridItem-justifySelf\": horizontalAlignment,\n \"--gridItem-alignSelf\": verticalAlignment,\n \"--gridItem-gridRowStart\": gridRowStart,\n \"--gridItem-gridColumnStart\": gridColumnStart,\n \"--gridItem-gridRowEnd\": gridRowEnd,\n \"--gridItem-gridColumnEnd\": gridColumnEnd,\n };\n\n return (\n <Component\n className={clsx(withBaseName(), className)}\n style={gridStyles}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AAYO,MAAM,mBAAsB,GAAA;AAAA,EACjC,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AACF,EAAA;AA4BA,MAAM,YAAA,GAAe,aAAa,cAAc,CAAA,CAAA;AAEhD,MAAM,QAAW,GAAA,MAAA,CAAA;AACjB,MAAM,MAAS,GAAA,MAAA,CAAA;AACf,MAAM,QAAW,GAAA,MAAA,CAAA;AACjB,MAAM,MAAS,GAAA,MAAA,CAAA;AAMR,MAAM,QAA8B,GAAA,UAAA;AAAA,EACzC,CACE;AAAA,IACE,EAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,mBAAsB,GAAA,SAAA;AAAA,IACtB,iBAAoB,GAAA,SAAA;AAAA,IACpB,KAAA;AAAA,IACG,GAAA,IAAA;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA,CAAA;AACxB,IAAM,MAAA,eAAA,GAAkB,iBAAkB,CAAA,OAAA,EAAS,MAAM,CAAA,CAAA;AAEzD,IAAM,MAAA,eAAA,GAAkB,iBAAkB,CAAA,OAAA,EAAS,MAAM,CAAA,CAAA;AAEzD,IAAM,MAAA,eAAA,GAAkB,eACpB,GAAA,CAAA,KAAA,EAAQ,eACR,CAAA,CAAA,GAAA,QAAA,CAAA;AAEJ,IAAM,MAAA,aAAA,GAAgB,eAAkB,GAAA,CAAA,KAAA,EAAQ,eAAoB,CAAA,CAAA,GAAA,MAAA,CAAA;AAEpE,IAAM,MAAA,YAAA,GAAe,eAAkB,GAAA,CAAA,KAAA,EAAQ,eAAoB,CAAA,CAAA,GAAA,QAAA,CAAA;AAEnE,IAAM,MAAA,UAAA,GAAa,eAAkB,GAAA,CAAA,KAAA,EAAQ,eAAoB,CAAA,CAAA,GAAA,MAAA,CAAA;AAEjE,IAAA,MAAM,UAAa,GAAA;AAAA,MACjB,GAAG,KAAA;AAAA,MACH,wBAA0B,EAAA,mBAAA;AAAA,MAC1B,sBAAwB,EAAA,iBAAA;AAAA,MACxB,yBAA2B,EAAA,YAAA;AAAA,MAC3B,4BAA8B,EAAA,eAAA;AAAA,MAC9B,uBAAyB,EAAA,UAAA;AAAA,MACzB,0BAA4B,EAAA,aAAA;AAAA,KAC9B,CAAA;AAEA,IAAA,uBACG,GAAA,CAAA,SAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MACzC,KAAO,EAAA,UAAA;AAAA,MACP,GAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
5
6
|
import '../utils/useId.js';
|
|
6
7
|
import { useResponsiveProp } from '../utils/useResponsiveProp.js';
|
|
7
8
|
import './GridLayout.css.js';
|
|
@@ -34,7 +35,7 @@ const GridLayout = forwardRef(
|
|
|
34
35
|
"--gridLayout-rowGap": gridRowGap || gridGap
|
|
35
36
|
};
|
|
36
37
|
return /* @__PURE__ */ jsx(Component, {
|
|
37
|
-
className:
|
|
38
|
+
className: clsx(withBaseName(), className),
|
|
38
39
|
style: gridLayoutStyles,
|
|
39
40
|
ref,
|
|
40
41
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridLayout.js","sources":["../src/grid-layout/GridLayout.tsx"],"sourcesContent":["import { forwardRef, ReactElement, ElementType } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"GridLayout.js","sources":["../src/grid-layout/GridLayout.tsx"],"sourcesContent":["import { forwardRef, ReactElement, ElementType } from \"react\";\nimport { clsx } from \"clsx\";\n\nimport {\n makePrefixer,\n ResponsiveProp,\n useResponsiveProp,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\n\nimport \"./GridLayout.css\";\n\nexport type GridLayoutProps<T extends ElementType> =\n PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Number of columns to be displayed. Defaults to 12\n */\n columns?: ResponsiveProp<number>;\n /**\n * Number of rows to be displayed. Defaults to 1\n */\n rows?: ResponsiveProp<number>;\n /**\n * Defines the size of the gutter between the columns and the rows by setting a density multiplier. Defaults to 3\n */\n gap?: ResponsiveProp<number>;\n /**\n * Defines the size of the gutter between the columns by setting a density multiplier. Defaults to 1\n */\n columnGap?: ResponsiveProp<number>;\n /**\n * Defines the size of the gutter between the rows by setting a density multiplier. Defaults to 1\n */\n rowGap?: ResponsiveProp<number>;\n }\n >;\n\ntype GridLayoutComponent = <T extends ElementType = \"div\">(\n props: GridLayoutProps<T>\n) => ReactElement | null;\n\nconst withBaseName = makePrefixer(\"saltGridLayout\");\n\nexport const GridLayout: GridLayoutComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n as,\n children,\n className,\n columns = 12,\n rows = 1,\n gap,\n columnGap,\n rowGap,\n style,\n ...rest\n }: GridLayoutProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const Component = as || \"div\";\n\n const gridColumns = useResponsiveProp(columns, 12);\n\n const gridRows = useResponsiveProp(rows, 1);\n\n const gridGap = useResponsiveProp(gap, 3);\n\n const gridColumnGap = useResponsiveProp(columnGap, 3);\n\n const gridRowGap = useResponsiveProp(rowGap, 3);\n\n const gridLayoutStyles = {\n ...style,\n \"--gridLayout-columns\": gridColumns,\n \"--gridLayout-rows\": gridRows,\n \"--gridLayout-columnGap\": gridColumnGap || gridGap,\n \"--gridLayout-rowGap\": gridRowGap || gridGap,\n };\n\n return (\n <Component\n className={clsx(withBaseName(), className)}\n style={gridLayoutStyles}\n ref={ref}\n {...rest}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AA4CA,MAAM,YAAA,GAAe,aAAa,gBAAgB,CAAA,CAAA;AAE3C,MAAM,UAAkC,GAAA,UAAA;AAAA,EAC7C,CACE;AAAA,IACE,EAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAU,GAAA,EAAA;AAAA,IACV,IAAO,GAAA,CAAA;AAAA,IACP,GAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,KAAA;AAAA,IACG,GAAA,IAAA;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA,CAAA;AAExB,IAAM,MAAA,WAAA,GAAc,iBAAkB,CAAA,OAAA,EAAS,EAAE,CAAA,CAAA;AAEjD,IAAM,MAAA,QAAA,GAAW,iBAAkB,CAAA,IAAA,EAAM,CAAC,CAAA,CAAA;AAE1C,IAAM,MAAA,OAAA,GAAU,iBAAkB,CAAA,GAAA,EAAK,CAAC,CAAA,CAAA;AAExC,IAAM,MAAA,aAAA,GAAgB,iBAAkB,CAAA,SAAA,EAAW,CAAC,CAAA,CAAA;AAEpD,IAAM,MAAA,UAAA,GAAa,iBAAkB,CAAA,MAAA,EAAQ,CAAC,CAAA,CAAA;AAE9C,IAAA,MAAM,gBAAmB,GAAA;AAAA,MACvB,GAAG,KAAA;AAAA,MACH,sBAAwB,EAAA,WAAA;AAAA,MACxB,mBAAqB,EAAA,QAAA;AAAA,MACrB,0BAA0B,aAAiB,IAAA,OAAA;AAAA,MAC3C,uBAAuB,UAAc,IAAA,OAAA;AAAA,KACvC,CAAA;AAEA,IAAA,uBACG,GAAA,CAAA,SAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,MACzC,KAAO,EAAA,gBAAA;AAAA,MACP,GAAA;AAAA,MACC,GAAG,IAAA;AAAA,MAEH,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -7,12 +7,15 @@ export { BorderLayout } from './border-layout/BorderLayout.js';
|
|
|
7
7
|
export { DEFAULT_BREAKPOINTS } from './breakpoints/Breakpoints.js';
|
|
8
8
|
export { Button, ButtonVariantValues } from './button/Button.js';
|
|
9
9
|
export { useButton } from './button/useButton.js';
|
|
10
|
+
export { Card } from './card/Card.js';
|
|
10
11
|
export { FLEX_ITEM_ALIGNMENTS, FlexItem } from './flex-item/FlexItem.js';
|
|
11
12
|
export { FLEX_ALIGNMENT_BASE, FLEX_CONTENT_ALIGNMENT_BASE, FlexLayout } from './flex-layout/FlexLayout.js';
|
|
12
13
|
export { FlowLayout } from './flow-layout/FlowLayout.js';
|
|
13
14
|
export { GRID_ALIGNMENT_BASE, GridItem } from './grid-item/GridItem.js';
|
|
14
15
|
export { GridLayout } from './grid-layout/GridLayout.js';
|
|
15
16
|
export { Link } from './link/Link.js';
|
|
17
|
+
export { Panel } from './panel/Panel.js';
|
|
18
|
+
export { Spinner, SpinnerSizeValues } from './spinner/Spinner.js';
|
|
16
19
|
export { StackLayout } from './stack-layout/StackLayout.js';
|
|
17
20
|
export { StatusIndicator } from './status-indicator/StatusIndicator.js';
|
|
18
21
|
export { VALIDATION_NAMED_STATUS } from './status-indicator/ValidationStatus.js';
|
|
@@ -24,6 +27,9 @@ export { DensityValues } from './theme/Density.js';
|
|
|
24
27
|
export { getCharacteristicValue } from './theme/Theme.js';
|
|
25
28
|
export { ModeValues } from './theme/Mode.js';
|
|
26
29
|
export { BreakpointContext, DEFAULT_DENSITY, DensityContext, SaltProvider, ThemeContext, useBreakpoints, useDensity, useTheme } from './salt-provider/SaltProvider.js';
|
|
30
|
+
export { SplitLayout } from './split-layout/SplitLayout.js';
|
|
31
|
+
export { Tooltip } from './tooltip/Tooltip.js';
|
|
32
|
+
export { useTooltip } from './tooltip/useTooltip.js';
|
|
27
33
|
export { createChainedFunction } from './utils/createChainedFunction.js';
|
|
28
34
|
export { createContext } from './utils/createContext.js';
|
|
29
35
|
export { debounce } from './utils/debounce.js';
|
|
@@ -33,6 +39,7 @@ export { ownerDocument } from './utils/ownerDocument.js';
|
|
|
33
39
|
export { ownerWindow } from './utils/ownerWindow.js';
|
|
34
40
|
export { setRef } from './utils/setRef.js';
|
|
35
41
|
export { useControlled } from './utils/useControlled.js';
|
|
42
|
+
export { DEFAULT_FLOATING_UI_MIDDLEWARE, useFloatingUI } from './utils/useFloatingUI.js';
|
|
36
43
|
export { useForkRef } from './utils/useForkRef.js';
|
|
37
44
|
export { useId, useIdMemo } from './utils/useId.js';
|
|
38
45
|
export { teardown, useIsFocusVisible } from './utils/useIsFocusVisible.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".saltLink {\n --link-color-hover: var(--saltLink-color-hover, var(--salt-text-link-foreground-hover));\n --link-color-active: var(--saltLink-color-active, var(--salt-text-link-foreground-active));\n --link-color-visited: var(--saltLink-color-visited, var(--salt-text-link-foreground-visited));\n /* When focused, we also want hover style */\n --link-color-focus: var(--saltLink-color-focus, var(--link-color-hover));\n --link-
|
|
3
|
+
var css_248z = ".saltLink {\n --link-color-hover: var(--saltLink-color-hover, var(--salt-text-link-foreground-hover));\n --link-color-active: var(--saltLink-color-active, var(--salt-text-link-foreground-active));\n --link-color-visited: var(--saltLink-color-visited, var(--salt-text-link-foreground-visited));\n /* When focused, we also want hover style */\n --link-color-focus: var(--saltLink-color-focus, var(--link-color-hover));\n\n --link-textDecoration: var(--salt-text-link-textDecoration);\n --link-textDecoration-hover: var(--salt-text-link-textDecoration-hover);\n\n --link-fontFamily: var(--salt-text-fontFamily);\n --link-focus-outline: var(--salt-focused-outline);\n}\n\n/* Main css class */\n.saltLink {\n color: var(--link-color);\n letter-spacing: 0px;\n text-decoration: var(--link-textDecoration);\n font-family: var(--link-fontFamily);\n}\n\n/* Primary variant */\n.saltText-primary {\n --link-color: var(--salt-text-primary-foreground);\n}\n\n/* Secondary variant */\n.saltText-secondary {\n --link-color: var(--salt-text-secondary-foreground);\n}\n\n/* External link's icon */\n.saltLink-icon {\n margin-left: calc(var(--salt-size-unit) * 0.75);\n margin-bottom: -2px;\n}\n\n/* Set color for visited link */\n.saltLink:visited {\n --saltIcon-color: var(--link-color-visited);\n color: var(--link-color-visited);\n}\n\n/* Set color for hovered link */\n.saltLink:hover {\n --saltIcon-color: var(--link-color-hover);\n color: var(--link-color-hover);\n text-decoration: var(--link-textDecoration-hover);\n}\n\n/* Set color for active link */\n.saltLink:active {\n --saltIcon-color: var(--link-color-active);\n color: var(--link-color-active);\n}\n\n/* Set color for focused link */\n.saltLink:focus {\n --saltIcon-color: var(--link-color-focus);\n outline: var(--link-focus-outline);\n color: var(--link-color-focus);\n text-decoration: var(--link-textDecoration-hover);\n}\n\n/* Class for ADA content */\n.saltLink-externalLinkADA {\n display: block;\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n top: 0px;\n left: 0px;\n opacity: 0;\n}\n";
|
|
4
4
|
styleInject(css_248z);
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
4
|
import { TearOutIcon } from '@salt-ds/icons';
|
|
5
5
|
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
6
|
+
import '../utils/useFloatingUI.js';
|
|
6
7
|
import '../utils/useId.js';
|
|
7
8
|
import '../salt-provider/SaltProvider.js';
|
|
8
9
|
import '../viewport/ViewportProvider.js';
|
|
@@ -24,7 +25,7 @@ const Link = forwardRef(function Link2({
|
|
|
24
25
|
}, ref) {
|
|
25
26
|
return /* @__PURE__ */ jsxs(Text, {
|
|
26
27
|
as: "a",
|
|
27
|
-
className:
|
|
28
|
+
className: clsx(withBaseName(), className),
|
|
28
29
|
href,
|
|
29
30
|
ref,
|
|
30
31
|
target,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":["../src/link/Link.tsx"],"sourcesContent":["import { ComponentType, forwardRef, ReactElement } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"Link.js","sources":["../src/link/Link.tsx"],"sourcesContent":["import { ComponentType, forwardRef, ReactElement } from \"react\";\nimport { clsx } from \"clsx\";\nimport { IconProps, TearOutIcon } from \"@salt-ds/icons\";\nimport { makePrefixer } from \"../utils\";\nimport { Text, TextProps } from \"../text\";\n\nimport \"./Link.css\";\n\nconst withBaseName = makePrefixer(\"saltLink\");\n\n/**\n * Links are a fundamental navigation element. When clicked, they take the user to an entirely different page.\n *\n * @example\n * <LinkExample to=\"#link\">Action</LinkExample>\n */\nexport interface LinkProps extends Omit<TextProps<\"a\">, \"as\" | \"disabled\"> {\n IconComponent?: ComponentType<IconProps>;\n}\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n {\n IconComponent = TearOutIcon,\n href,\n className,\n children,\n variant = \"primary\",\n target = \"_self\",\n ...rest\n },\n ref\n): ReactElement<LinkProps> {\n return (\n <Text\n as=\"a\"\n className={clsx(withBaseName(), className)}\n href={href}\n ref={ref}\n target={target}\n variant={variant}\n {...rest}\n >\n {children}\n {target === \"_blank\" && (\n <>\n <IconComponent className={withBaseName(\"icon\")} aria-hidden />\n <span className={withBaseName(\"externalLinkADA\")}>External Link</span>\n </>\n )}\n </Text>\n );\n});\n"],"names":["Link"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,YAAA,GAAe,aAAa,UAAU,CAAA,CAAA;AAY/B,MAAA,IAAA,GAAO,UAAyC,CAAA,SAASA,KACpE,CAAA;AAAA,EACE,aAAgB,GAAA,WAAA;AAAA,EAChB,IAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAU,GAAA,SAAA;AAAA,EACV,MAAS,GAAA,OAAA;AAAA,EACN,GAAA,IAAA;AACL,CAAA,EACA,GACyB,EAAA;AACzB,EAAA,uBACG,IAAA,CAAA,IAAA,EAAA;AAAA,IACC,EAAG,EAAA,GAAA;AAAA,IACH,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAS,CAAA;AAAA,IACzC,IAAA;AAAA,IACA,GAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACC,GAAG,IAAA;AAAA,IAEH,QAAA,EAAA;AAAA,MAAA,QAAA;AAAA,MACA,WAAW,QACV,oBAAA,IAAA,CAAA,QAAA,EAAA;AAAA,QACE,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,aAAA,EAAA;AAAA,YAAc,SAAA,EAAW,aAAa,MAAM,CAAA;AAAA,YAAG,aAAW,EAAA,IAAA;AAAA,WAAC,CAAA;AAAA,0BAC3D,GAAA,CAAA,MAAA,EAAA;AAAA,YAAK,SAAA,EAAW,aAAa,iBAAiB,CAAA;AAAA,YAAG,QAAA,EAAA,eAAA;AAAA,WAAa,CAAA;AAAA,SAAA;AAAA,OACjE,CAAA;AAAA,KAAA;AAAA,GAEJ,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "/* Styles applied to the root element when variant=\"primary\" */\n.saltPanel-primary.saltPanel {\n --panel-background: var(--salt-container-primary-background);\n}\n\n/* Styles applied to the root element when variant=\"secondary\" */\n.saltPanel-secondary.saltPanel {\n --panel-background: var(--salt-container-secondary-background);\n}\n\n/* Styles applied to the root element */\n.saltPanel {\n background: var(--saltPanel-background, var(--panel-background));\n color: var(--saltPanel-color, inherit);\n height: var(--saltPanel-height, 100%);\n overflow: auto;\n padding: var(--saltPanel-padding, calc(var(--salt-size-unit) * 3));\n width: var(--saltPanel-width, 100%);\n}\n";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
7
|
+
//# sourceMappingURL=Panel.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { makePrefixer } from '../utils/makePrefixer.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
6
|
+
import '../utils/useId.js';
|
|
7
|
+
import '../salt-provider/SaltProvider.js';
|
|
8
|
+
import '../viewport/ViewportProvider.js';
|
|
9
|
+
import './Panel.css.js';
|
|
10
|
+
|
|
11
|
+
const withBaseName = makePrefixer("saltPanel");
|
|
12
|
+
const Panel = forwardRef(function Panel2({ className, children, variant = "primary", ...restProps }, ref) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: clsx(withBaseName(), withBaseName(variant), className),
|
|
15
|
+
ref,
|
|
16
|
+
...restProps,
|
|
17
|
+
children
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { Panel };
|
|
22
|
+
//# sourceMappingURL=Panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.js","sources":["../src/panel/Panel.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\nimport { forwardRef, HTMLAttributes } from \"react\";\nimport { makePrefixer } from \"../utils\";\n\nimport \"./Panel.css\";\n\n/**\n * Panel component that acts as wrapper around a node\n *\n * @example\n * const PanelExample = () => (\n * <Panel>\n * <p>This is a panel around some text.</p>\n * </Panel>\n * );\n *\n */\n\nexport interface PanelProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Styling variant; defaults to \"primary\".\n */\n variant?: \"primary\" | \"secondary\";\n}\n\nconst withBaseName = makePrefixer(\"saltPanel\");\n\nexport const Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(\n { className, children, variant = \"primary\", ...restProps },\n ref\n) {\n return (\n <div\n className={clsx(withBaseName(), withBaseName(variant), className)}\n ref={ref}\n {...restProps}\n >\n {children}\n </div>\n );\n});\n"],"names":["Panel"],"mappings":";;;;;;;;;;AAyBA,MAAM,YAAA,GAAe,aAAa,WAAW,CAAA,CAAA;AAEhC,MAAA,KAAA,GAAQ,UAAuC,CAAA,SAASA,MACnE,CAAA,EAAE,SAAW,EAAA,QAAA,EAAU,OAAU,GAAA,SAAA,EAAA,GAAc,SAAU,EAAA,EACzD,GACA,EAAA;AACA,EAAA,uBACG,GAAA,CAAA,KAAA,EAAA;AAAA,IACC,WAAW,IAAK,CAAA,YAAA,IAAgB,YAAa,CAAA,OAAO,GAAG,SAAS,CAAA;AAAA,IAChE,GAAA;AAAA,IACC,GAAG,SAAA;AAAA,IAEH,QAAA;AAAA,GACH,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
3
|
import React__default, { createContext, useContext, useMemo } from 'react';
|
|
4
4
|
import '../aria-announcer/AriaAnnouncerContext.js';
|
|
5
|
+
import '../utils/useFloatingUI.js';
|
|
5
6
|
import '../utils/useId.js';
|
|
6
7
|
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';
|
|
7
8
|
import { ViewportProvider } from '../viewport/ViewportProvider.js';
|
|
@@ -26,7 +27,7 @@ const createThemedChildren = (children, themeName, density, mode, applyClassesTo
|
|
|
26
27
|
} else if (applyClassesTo === "child") {
|
|
27
28
|
if (React__default.isValidElement(children)) {
|
|
28
29
|
return React__default.cloneElement(children, {
|
|
29
|
-
className:
|
|
30
|
+
className: clsx(
|
|
30
31
|
(_a = children.props) == null ? void 0 : _a.className,
|
|
31
32
|
...themeNames,
|
|
32
33
|
`salt-density-${density}`
|
|
@@ -44,7 +45,7 @@ SaltProvider can only apply CSS classes for theming to a single nested child ele
|
|
|
44
45
|
}
|
|
45
46
|
} else {
|
|
46
47
|
return /* @__PURE__ */ jsx("div", {
|
|
47
|
-
className:
|
|
48
|
+
className: clsx(
|
|
48
49
|
`salt-provider`,
|
|
49
50
|
...themeNames,
|
|
50
51
|
`salt-density-${density}`
|