@salt-ds/core 1.0.0 → 1.1.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/border-item/BorderItem.js +2 -6
- package/dist-cjs/packages/core/src/border-item/BorderItem.js.map +1 -1
- package/dist-cjs/packages/core/src/border-layout/BorderLayout.js +2 -6
- package/dist-cjs/packages/core/src/border-layout/BorderLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/button/Button.js +2 -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 +36 -0
- package/dist-cjs/packages/core/src/card/Card.js.map +1 -0
- package/dist-cjs/packages/core/src/flex-item/FlexItem.js +2 -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 +3 -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 +2 -6
- package/dist-cjs/packages/core/src/grid-item/GridItem.js.map +1 -1
- package/dist-cjs/packages/core/src/grid-layout/GridLayout.js +2 -6
- package/dist-cjs/packages/core/src/grid-layout/GridLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/index.js +4 -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 +2 -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 +25 -0
- package/dist-cjs/packages/core/src/panel/Panel.js.map +1 -0
- package/dist-cjs/packages/core/src/salt-provider/SaltProvider.js +3 -4
- package/dist-cjs/packages/core/src/salt-provider/SaltProvider.js.map +1 -1
- 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 +37 -3
- package/dist-cjs/packages/core/src/stack-layout/StackLayout.js.map +1 -1
- package/dist-cjs/packages/core/src/status-indicator/StatusIndicator.js +2 -6
- package/dist-cjs/packages/core/src/status-indicator/StatusIndicator.js.map +1 -1
- package/dist-cjs/packages/core/src/text/Display.js +4 -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 +2 -6
- 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/viewport/ViewportProvider.js +4 -1
- package/dist-cjs/packages/core/src/viewport/ViewportProvider.js.map +1 -1
- package/dist-es/packages/core/src/border-item/BorderItem.js +2 -2
- package/dist-es/packages/core/src/border-item/BorderItem.js.map +1 -1
- package/dist-es/packages/core/src/border-layout/BorderLayout.js +2 -2
- package/dist-es/packages/core/src/border-layout/BorderLayout.js.map +1 -1
- package/dist-es/packages/core/src/button/Button.js +2 -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 +32 -0
- package/dist-es/packages/core/src/card/Card.js.map +1 -0
- package/dist-es/packages/core/src/flex-item/FlexItem.js +2 -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 +4 -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 +2 -2
- package/dist-es/packages/core/src/grid-item/GridItem.js.map +1 -1
- package/dist-es/packages/core/src/grid-layout/GridLayout.js +2 -2
- package/dist-es/packages/core/src/grid-layout/GridLayout.js.map +1 -1
- package/dist-es/packages/core/src/index.js +2 -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 +2 -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 +21 -0
- package/dist-es/packages/core/src/panel/Panel.js.map +1 -0
- package/dist-es/packages/core/src/salt-provider/SaltProvider.js +3 -3
- package/dist-es/packages/core/src/salt-provider/SaltProvider.js.map +1 -1
- 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 +37 -3
- package/dist-es/packages/core/src/stack-layout/StackLayout.js.map +1 -1
- package/dist-es/packages/core/src/status-indicator/StatusIndicator.js +2 -2
- package/dist-es/packages/core/src/status-indicator/StatusIndicator.js.map +1 -1
- package/dist-es/packages/core/src/text/Display.js +4 -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 +2 -2
- 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/viewport/ViewportProvider.js +5 -2
- package/dist-es/packages/core/src/viewport/ViewportProvider.js.map +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 +2 -0
- package/dist-types/panel/Panel.d.ts +20 -0
- package/dist-types/panel/index.d.ts +1 -0
- package/dist-types/stack-layout/StackLayout.d.ts +14 -6
- package/dist-types/theme/Theme.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = "/* Main css class. Style for body text */\n.saltText {\n
|
|
3
|
+
var css_248z = "/* Main css class. Style for body text */\n.saltText {\n color: var(--saltText-color, var(--text-color));\n}\n\n/* Allows truncation */\n.saltText-lineClamp {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: var(--text-max-rows, 0);\n overflow: hidden;\n word-break: break-word;\n}\n\n/* Primary variant */\n.saltText-primary {\n --text-color: var(--salt-text-primary-foreground);\n}\n\n/* Secondary variant */\n.saltText-secondary {\n --text-color: var(--salt-text-secondary-foreground);\n}\n\n/* Body emphasis strong */\n.saltText strong {\n font-weight: var(--salt-text-fontWeight-strong);\n}\n/* Body emphasis small */\n.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-fontWeight-small);\n}\n\n/* Display 1 */\n.saltText-display1.saltText {\n font-size: var(--salt-text-display1-fontSize);\n font-weight: var(--salt-text-display1-fontWeight);\n line-height: var(--salt-text-display1-lineHeight);\n}\n\n/* Display 2 */\n.saltText-display2.saltText {\n font-size: var(--salt-text-display2-fontSize);\n font-weight: var(--salt-text-display2-fontWeight);\n line-height: var(--salt-text-display2-lineHeight);\n}\n\n/* Display 3 */\n.saltText-display3.saltText {\n font-size: var(--salt-text-display3-fontSize);\n font-weight: var(--salt-text-display3-fontWeight);\n line-height: var(--salt-text-display3-lineHeight);\n}\n\n/* Heading 1 */\nh1.saltText,\n.saltText-h1.saltText {\n font-size: var(--salt-text-h1-fontSize);\n font-weight: var(--salt-text-h1-fontWeight);\n line-height: var(--salt-text-h1-lineHeight);\n}\n\n/* H1 emphasis strong */\nh1.saltText strong,\n.saltText-h1.saltText strong {\n font-weight: var(--salt-text-h1-fontWeight-strong);\n}\n/* H1 emphasis small */\nh1.saltText small,\n.saltText-h1.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-h1-fontWeight-small);\n}\n\n/* Heading 2 */\nh2.saltText,\n.saltText-h2.saltText {\n font-size: var(--salt-text-h2-fontSize);\n font-weight: var(--salt-text-h2-fontWeight);\n line-height: var(--salt-text-h2-lineHeight);\n}\n\n/* H2 emphasis strong */\nh2.saltText strong,\n.saltText-h2.saltText strong {\n font-weight: var(--salt-text-h2-fontWeight-strong);\n}\n/* H2 emphasis small */\nh2.saltText small,\n.saltText-h2.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-h2-fontWeight-small);\n}\n\n/* Heading 3 */\nh3.saltText,\n.saltText-h3.saltText {\n font-size: var(--salt-text-h3-fontSize);\n font-weight: var(--salt-text-h3-fontWeight);\n line-height: var(--salt-text-h3-lineHeight);\n}\n\n/* H3 emphasis strong */\nh3.saltText strong,\n.saltText-h3.saltText strong {\n font-weight: var(--salt-text-h3-fontWeight-strong);\n}\n/* H3 emphasis small */\nh3.saltText small,\n.saltText-h3.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-h3-fontWeight-small);\n}\n\n/* Heading 4 */\nh4.saltText,\n.saltText-h4.saltText {\n font-size: var(--salt-text-h4-fontSize);\n font-weight: var(--salt-text-h4-fontWeight);\n line-height: var(--salt-text-h4-lineHeight);\n}\n\n/* H4 emphasis strong */\nh4.saltText strong,\n.saltText-h4.saltText strong {\n font-weight: var(--salt-text-h4-fontWeight-strong);\n}\n/* H4 emphasis small */\nh4.saltText small,\n.saltText-h4.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-h4-fontWeight-small);\n}\n\n/* Label */\nlabel.saltText,\n.saltText-label.saltText {\n font-size: var(--salt-text-label-fontSize);\n line-height: var(--salt-text-label-lineHeight);\n font-weight: var(--salt-text-fontWeight);\n}\n\n/* Label emphasis strong */\nlabel.saltText strong,\n.saltText-label.saltText strong {\n font-weight: var(--salt-text-fontWeight-strong);\n}\n/* Label emphasis small */\nlabel.saltText small,\n.saltText-label.saltText small {\n font-size: inherit;\n font-weight: var(--salt-text-fontWeight-small);\n}\n";
|
|
4
4
|
styleInject(css_248z);
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
@@ -4,7 +4,7 @@ import { makePrefixer } from '../utils/makePrefixer.js';
|
|
|
4
4
|
import '../utils/useId.js';
|
|
5
5
|
import '../salt-provider/SaltProvider.js';
|
|
6
6
|
import '../viewport/ViewportProvider.js';
|
|
7
|
-
import
|
|
7
|
+
import { clsx } from 'clsx';
|
|
8
8
|
import './Text.css.js';
|
|
9
9
|
|
|
10
10
|
const withBaseName = makePrefixer("saltText");
|
|
@@ -22,7 +22,7 @@ const Text = forwardRef(
|
|
|
22
22
|
const Component = as || "div";
|
|
23
23
|
const textStyles = { "--text-max-rows": maxRows, ...style };
|
|
24
24
|
return /* @__PURE__ */ jsx(Component, {
|
|
25
|
-
className:
|
|
25
|
+
className: clsx(withBaseName(), className, {
|
|
26
26
|
[withBaseName("lineClamp")]: maxRows,
|
|
27
27
|
[withBaseName(styleAs || "")]: styleAs,
|
|
28
28
|
[withBaseName(variant)]: variant
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sources":["../src/text/Text.tsx"],"sourcesContent":["import {\n makePrefixer,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\nimport
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../src/text/Text.tsx"],"sourcesContent":["import {\n makePrefixer,\n PolymorphicComponentPropWithRef,\n PolymorphicRef,\n} from \"../utils\";\nimport { clsx } from \"clsx\";\nimport { ElementType, forwardRef, ReactElement } from \"react\";\n\nimport \"./Text.css\";\n\nexport type TextProps<T extends ElementType> = PolymorphicComponentPropWithRef<\n T,\n {\n /**\n * Apply text truncation by mentioning number of rows to be displayed\n */\n maxRows?: number;\n /**\n * Match styling to another text component's style\n */\n styleAs?:\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"label\"\n | \"display1\"\n | \"display2\"\n | \"display3\";\n /**\n * Change text color palette\n */\n variant?: \"primary\" | \"secondary\";\n }\n>;\n\ntype TextComponent = <T extends ElementType = \"div\">(\n props: TextProps<T>\n) => ReactElement | null;\n\nconst withBaseName = makePrefixer(\"saltText\");\n\nexport const Text: TextComponent = forwardRef(\n <T extends ElementType = \"div\">(\n {\n children,\n className,\n as,\n maxRows,\n styleAs,\n variant = \"primary\",\n style,\n ...restProps\n }: TextProps<T>,\n ref?: PolymorphicRef<T>\n ) => {\n const Component = as || \"div\";\n\n const textStyles = { \"--text-max-rows\": maxRows, ...style };\n\n return (\n <Component\n className={clsx(withBaseName(), className, {\n [withBaseName(\"lineClamp\")]: maxRows,\n [withBaseName(styleAs || \"\")]: styleAs,\n [withBaseName(variant)]: variant,\n })}\n {...restProps}\n ref={ref}\n style={textStyles}\n >\n {children}\n </Component>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;AAwCA,MAAM,YAAA,GAAe,aAAa,UAAU,CAAA,CAAA;AAErC,MAAM,IAAsB,GAAA,UAAA;AAAA,EACjC,CACE;AAAA,IACE,QAAA;AAAA,IACA,SAAA;AAAA,IACA,EAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAU,GAAA,SAAA;AAAA,IACV,KAAA;AAAA,IACG,GAAA,SAAA;AAAA,KAEL,GACG,KAAA;AACH,IAAA,MAAM,YAAY,EAAM,IAAA,KAAA,CAAA;AAExB,IAAA,MAAM,UAAa,GAAA,EAAE,iBAAmB,EAAA,OAAA,EAAS,GAAG,KAAM,EAAA,CAAA;AAE1D,IAAA,uBACG,GAAA,CAAA,SAAA,EAAA;AAAA,MACC,SAAW,EAAA,IAAA,CAAK,YAAa,EAAA,EAAG,SAAW,EAAA;AAAA,QACzC,CAAC,YAAa,CAAA,WAAW,CAAI,GAAA,OAAA;AAAA,QAC7B,CAAC,YAAA,CAAa,OAAW,IAAA,EAAE,CAAI,GAAA,OAAA;AAAA,QAC/B,CAAC,YAAa,CAAA,OAAO,CAAI,GAAA,OAAA;AAAA,OAC1B,CAAA;AAAA,MACA,GAAG,SAAA;AAAA,MACJ,GAAA;AAAA,MACA,KAAO,EAAA,UAAA;AAAA,MAEN,QAAA;AAAA,KACH,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.js","sources":["../src/theme/Theme.ts"],"sourcesContent":["export type characteristic =\n | \"accent\"\n | \"actionable\"\n | \"container\"\n | \"
|
|
1
|
+
{"version":3,"file":"Theme.js","sources":["../src/theme/Theme.ts"],"sourcesContent":["export type characteristic =\n | \"accent\"\n | \"actionable\"\n | \"container\"\n | \"differential\"\n | \"draggable\"\n | \"editable\"\n | \"focused\"\n | \"measured\"\n | \"navigable\"\n | \"overlayable\"\n | \"selectable\"\n | \"separable\"\n | \"status\"\n | \"taggable\"\n | \"target\"\n | \"text\";\n\nexport type ThemeName = string;\n\nexport const getCharacteristicValue = (\n themeName: ThemeName,\n characteristicName: characteristic,\n variant: string,\n scopeElement?: HTMLElement\n): string | null => {\n const cssVariableName = `--salt-${characteristicName}-${variant}`;\n const scopeTarget =\n scopeElement || document.body.querySelector(`.${themeName}`);\n if (scopeTarget) {\n const style = getComputedStyle(scopeTarget);\n const variableValue = style.getPropertyValue(cssVariableName);\n if (variableValue) {\n return variableValue;\n }\n }\n return null;\n};\n"],"names":[],"mappings":"AAoBO,MAAM,sBAAyB,GAAA,CACpC,SACA,EAAA,kBAAA,EACA,SACA,YACkB,KAAA;AAClB,EAAM,MAAA,eAAA,GAAkB,UAAU,kBAAsB,CAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACxD,EAAA,MAAM,cACJ,YAAgB,IAAA,QAAA,CAAS,IAAK,CAAA,aAAA,CAAc,IAAI,SAAW,CAAA,CAAA,CAAA,CAAA;AAC7D,EAAA,IAAI,WAAa,EAAA;AACf,IAAM,MAAA,KAAA,GAAQ,iBAAiB,WAAW,CAAA,CAAA;AAC1C,IAAM,MAAA,aAAA,GAAgB,KAAM,CAAA,gBAAA,CAAiB,eAAe,CAAA,CAAA;AAC5D,IAAA,IAAI,aAAe,EAAA;AACjB,MAAO,OAAA,aAAA,CAAA;AAAA,KACT;AAAA,GACF;AACA,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useContext, useState
|
|
2
|
+
import { createContext, useContext, useState } from 'react';
|
|
3
|
+
import '../utils/useId.js';
|
|
4
|
+
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect.js';
|
|
5
|
+
import '../salt-provider/SaltProvider.js';
|
|
3
6
|
|
|
4
7
|
const ViewportContext = createContext(null);
|
|
5
8
|
const ViewportProvider = ({ children }) => {
|
|
@@ -7,7 +10,7 @@ const ViewportProvider = ({ children }) => {
|
|
|
7
10
|
const [viewport, setViewport] = useState(existingViewport);
|
|
8
11
|
const noExistingViewport = existingViewport === null;
|
|
9
12
|
const viewportValue = existingViewport || viewport || 0;
|
|
10
|
-
|
|
13
|
+
useIsomorphicLayoutEffect(() => {
|
|
11
14
|
let observer = null;
|
|
12
15
|
if (noExistingViewport) {
|
|
13
16
|
observer = new ResizeObserver(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportProvider.js","sources":["../src/viewport/ViewportProvider.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ViewportProvider.js","sources":["../src/viewport/ViewportProvider.tsx"],"sourcesContent":["import { createContext, useState, useContext, ReactNode } from \"react\";\nimport { useIsomorphicLayoutEffect } from \"../utils\";\n\nconst ViewportContext = createContext<number | null>(null);\n\ntype ViewportProviderProps = {\n children?: ReactNode;\n};\n\nconst ViewportProvider = ({ children }: ViewportProviderProps) => {\n // Get value directly from the ViewportContext so we can detect if the value is null (no inherited ViewportProvider)\n const existingViewport = useContext(ViewportContext);\n const [viewport, setViewport] = useState(existingViewport);\n\n const noExistingViewport = existingViewport === null;\n const viewportValue = existingViewport || viewport || 0;\n\n useIsomorphicLayoutEffect(() => {\n let observer: ResizeObserver | null = null;\n\n if (noExistingViewport) {\n observer = new ResizeObserver(\n (observerEntries: ResizeObserverEntry[]) => {\n setViewport(observerEntries[0].contentRect.width);\n }\n );\n\n observer.observe(document.body);\n }\n\n return () => {\n if (observer) {\n observer.disconnect();\n }\n };\n }, [noExistingViewport]);\n\n return (\n <ViewportContext.Provider value={viewportValue}>\n {children}\n </ViewportContext.Provider>\n );\n};\n\nconst useViewport = (): number => {\n const value = useContext(ViewportContext);\n return value === null ? 0 : value;\n};\n\nexport { ViewportProvider, ViewportContext, useViewport };\n"],"names":[],"mappings":";;;;;;AAGM,MAAA,eAAA,GAAkB,cAA6B,IAAI,EAAA;AAMzD,MAAM,gBAAmB,GAAA,CAAC,EAAE,QAAA,EAAsC,KAAA;AAEhE,EAAM,MAAA,gBAAA,GAAmB,WAAW,eAAe,CAAA,CAAA;AACnD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,gBAAgB,CAAA,CAAA;AAEzD,EAAA,MAAM,qBAAqB,gBAAqB,KAAA,IAAA,CAAA;AAChD,EAAM,MAAA,aAAA,GAAgB,oBAAoB,QAAY,IAAA,CAAA,CAAA;AAEtD,EAAA,yBAAA,CAA0B,MAAM;AAC9B,IAAA,IAAI,QAAkC,GAAA,IAAA,CAAA;AAEtC,IAAA,IAAI,kBAAoB,EAAA;AACtB,MAAA,QAAA,GAAW,IAAI,cAAA;AAAA,QACb,CAAC,eAA2C,KAAA;AAC1C,UAAY,WAAA,CAAA,eAAA,CAAgB,CAAG,CAAA,CAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAAA,SAClD;AAAA,OACF,CAAA;AAEA,MAAS,QAAA,CAAA,OAAA,CAAQ,SAAS,IAAI,CAAA,CAAA;AAAA,KAChC;AAEA,IAAA,OAAO,MAAM;AACX,MAAA,IAAI,QAAU,EAAA;AACZ,QAAA,QAAA,CAAS,UAAW,EAAA,CAAA;AAAA,OACtB;AAAA,KACF,CAAA;AAAA,GACF,EAAG,CAAC,kBAAkB,CAAC,CAAA,CAAA;AAEvB,EACE,uBAAA,GAAA,CAAC,gBAAgB,QAAhB,EAAA;AAAA,IAAyB,KAAO,EAAA,aAAA;AAAA,IAC9B,QAAA;AAAA,GACH,CAAA,CAAA;AAEJ,EAAA;AAEA,MAAM,cAAc,MAAc;AAChC,EAAM,MAAA,KAAA,GAAQ,WAAW,eAAe,CAAA,CAAA;AACxC,EAAO,OAAA,KAAA,KAAU,OAAO,CAAI,GAAA,KAAA,CAAA;AAC9B;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import "./Card.css";
|
|
3
|
+
export interface CardProps extends ComponentPropsWithoutRef<"div"> {
|
|
4
|
+
/**
|
|
5
|
+
* If `true`, the card will be disabled.
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, interactive styles will be applied to `Card`. These styles give prominence to certain content
|
|
10
|
+
* on the page.
|
|
11
|
+
*/
|
|
12
|
+
interactable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Card component is a sheet if material that serves as an entry point to more detailed information.
|
|
16
|
+
* Cards display content composed of different elements whose size or supported actions vary.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Card";
|
|
@@ -25,6 +25,8 @@ export declare type FlexLayoutProps<T extends ElementType> = PolymorphicComponen
|
|
|
25
25
|
*/
|
|
26
26
|
justify?: FlexContentAlignment;
|
|
27
27
|
/**
|
|
28
|
+
* **Deprecated:** For separators see `StackLayout` component instead.
|
|
29
|
+
*
|
|
28
30
|
* Adds a separator between elements if wrap is not active, default is false.
|
|
29
31
|
*/
|
|
30
32
|
separators?: LayoutSeparator | true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ElementType,
|
|
1
|
+
import { ElementType, ReactElement } from "react";
|
|
2
2
|
import { FlexLayoutProps } from "../flex-layout";
|
|
3
|
-
|
|
3
|
+
import { PolymorphicComponentPropWithRef } from "../utils";
|
|
4
|
+
export declare type FlowLayoutProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
|
|
4
5
|
/**
|
|
5
6
|
* Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is "stretch".
|
|
6
7
|
*/
|
|
@@ -13,5 +14,7 @@ export interface FlowLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
14
|
* Defines the alignment along the main axis, default is "start"
|
|
14
15
|
*/
|
|
15
16
|
justify?: FlexLayoutProps<ElementType>["justify"];
|
|
16
|
-
}
|
|
17
|
-
|
|
17
|
+
}>;
|
|
18
|
+
declare type FlowLayoutComponent = <T extends ElementType = "div">(props: FlowLayoutProps<T>) => ReactElement | null;
|
|
19
|
+
export declare const FlowLayout: FlowLayoutComponent;
|
|
20
|
+
export {};
|
package/dist-types/index.d.ts
CHANGED
|
@@ -3,12 +3,14 @@ export * from "./border-item";
|
|
|
3
3
|
export * from "./border-layout";
|
|
4
4
|
export * from "./breakpoints";
|
|
5
5
|
export * from "./button";
|
|
6
|
+
export * from "./card";
|
|
6
7
|
export * from "./flex-item";
|
|
7
8
|
export * from "./flex-layout";
|
|
8
9
|
export * from "./flow-layout";
|
|
9
10
|
export * from "./grid-item";
|
|
10
11
|
export * from "./grid-layout";
|
|
11
12
|
export * from "./link";
|
|
13
|
+
export * from "./panel";
|
|
12
14
|
export * from "./stack-layout";
|
|
13
15
|
export * from "./status-indicator";
|
|
14
16
|
export * from "./text";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import "./Panel.css";
|
|
3
|
+
/**
|
|
4
|
+
* Panel component that acts as wrapper around a node
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const PanelExample = () => (
|
|
8
|
+
* <Panel>
|
|
9
|
+
* <p>This is a panel around some text.</p>
|
|
10
|
+
* </Panel>
|
|
11
|
+
* );
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export interface PanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
/**
|
|
16
|
+
* Styling variant; defaults to "primary".
|
|
17
|
+
*/
|
|
18
|
+
variant?: "primary" | "secondary";
|
|
19
|
+
}
|
|
20
|
+
export declare const Panel: import("react").ForwardRefExoticComponent<PanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Panel";
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { ElementType,
|
|
2
|
-
import { FlexLayoutProps } from "../flex-layout";
|
|
3
|
-
|
|
1
|
+
import { ElementType, ReactElement } from "react";
|
|
2
|
+
import { FlexLayoutProps, LayoutDirection, LayoutSeparator } from "../flex-layout";
|
|
3
|
+
import { PolymorphicComponentPropWithRef, ResponsiveProp } from "../utils";
|
|
4
|
+
import "./StackLayout.css";
|
|
5
|
+
export declare type StackLayoutProps<T extends ElementType> = PolymorphicComponentPropWithRef<T, {
|
|
4
6
|
/**
|
|
5
7
|
* Defines the default behavior for how flex items are laid out along the cross axis on the current line, default is "stretch".
|
|
6
8
|
*/
|
|
7
9
|
align?: FlexLayoutProps<ElementType>["align"];
|
|
10
|
+
/**
|
|
11
|
+
* Establishes the main-axis, defining the direction children are placed. Default is "column".
|
|
12
|
+
*/
|
|
13
|
+
direction?: ResponsiveProp<LayoutDirection>;
|
|
8
14
|
/**
|
|
9
15
|
* Controls the space between items, default is 3.
|
|
10
16
|
*/
|
|
@@ -12,6 +18,8 @@ export interface StackLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
18
|
/**
|
|
13
19
|
* Adds a separator between elements, default is false.
|
|
14
20
|
*/
|
|
15
|
-
separators?:
|
|
16
|
-
}
|
|
17
|
-
|
|
21
|
+
separators?: LayoutSeparator | boolean;
|
|
22
|
+
}>;
|
|
23
|
+
declare type StackLayoutComponent = <T extends ElementType = "div">(props: StackLayoutProps<T>) => ReactElement | null;
|
|
24
|
+
export declare const StackLayout: StackLayoutComponent;
|
|
25
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare type characteristic = "accent" | "actionable" | "container" | "
|
|
1
|
+
export declare type characteristic = "accent" | "actionable" | "container" | "differential" | "draggable" | "editable" | "focused" | "measured" | "navigable" | "overlayable" | "selectable" | "separable" | "status" | "taggable" | "target" | "text";
|
|
2
2
|
export declare type ThemeName = string;
|
|
3
3
|
export declare const getCharacteristicValue: (themeName: ThemeName, characteristicName: characteristic, variant: string, scopeElement?: HTMLElement | undefined) => string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salt-ds/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist-cjs/packages/core/src/index.js",
|
|
6
6
|
"sideEffects": [
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"module": "dist-es/packages/core/src/index.js",
|
|
24
24
|
"typings": "dist-types/index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"
|
|
27
|
-
"@salt-ds/icons": "1.
|
|
26
|
+
"clsx": "^1.2.1",
|
|
27
|
+
"@salt-ds/icons": "1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist-cjs",
|