@deephaven/components 0.82.1-beta.3 → 0.82.1-beta.5

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.
@@ -2,20 +2,34 @@
2
2
  import { type ViewProps as SpectrumViewProps } from '@adobe/react-spectrum';
3
3
  import type { DOMRefValue } from '@react-types/shared';
4
4
  import { type ColorValue } from '../theme/colorUtils';
5
- export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {
5
+ export type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor' | 'borderColor' | 'borderStartColor' | 'borderEndColor' | 'borderTopColor' | 'borderBottomColor' | 'borderXColor' | 'borderYColor'> & {
6
6
  backgroundColor?: ColorValue;
7
+ borderColor?: ColorValue;
8
+ borderStartColor?: ColorValue;
9
+ borderEndColor?: ColorValue;
10
+ borderTopColor?: ColorValue;
11
+ borderBottomColor?: ColorValue;
12
+ borderXColor?: ColorValue;
13
+ borderYColor?: ColorValue;
7
14
  };
8
15
  /**
9
16
  * A View component that re-exports the Spectrum View component.
10
17
  * However, it overrides ColorValues to accept CSS color strings and
11
- * our custom variable names from our color paletee and semantic colors.
18
+ * our custom variable names from our color palette and semantic colors.
12
19
  *
13
20
  * @param props The props for the View component
14
21
  * @returns The View component
15
22
  *
16
23
  */
17
- export declare const View: import("react").ForwardRefExoticComponent<Omit<SpectrumViewProps<6>, "backgroundColor"> & {
24
+ export declare const View: import("react").ForwardRefExoticComponent<Omit<SpectrumViewProps<6>, "backgroundColor" | "borderColor" | "borderStartColor" | "borderEndColor" | "borderTopColor" | "borderBottomColor" | "borderXColor" | "borderYColor"> & {
18
25
  backgroundColor?: ColorValue;
26
+ borderColor?: ColorValue;
27
+ borderStartColor?: ColorValue;
28
+ borderEndColor?: ColorValue;
29
+ borderTopColor?: ColorValue;
30
+ borderBottomColor?: ColorValue;
31
+ borderXColor?: ColorValue;
32
+ borderYColor?: ColorValue;
19
33
  } & import("react").RefAttributes<DOMRefValue<HTMLElement>>>;
20
34
  export default View;
21
35
  //# sourceMappingURL=View.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,EAEL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC;CAC9B,CAAC;AAEF;;;;;;;;GAQG;AAEH,eAAO,MAAM,IAAI;sBAbG,UAAU;4DA0B7B,CAAC;AAIF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../src/spectrum/View.tsx"],"names":[],"mappings":";AAEA,OAAO,EAGL,KAAK,SAAS,IAAI,iBAAiB,EACpC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,iBAAiB,CAAC,CAAC,CAAC,EAClB,iBAAiB,GACjB,aAAa,GACb,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,cAAc,CACjB,GAAG;IACF,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI;sBAnBG,UAAU;kBACd,UAAU;uBACL,UAAU;qBACZ,UAAU;qBACV,UAAU;wBACP,UAAU;mBACf,UAAU;mBACV,UAAU;4DA8E1B,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
- var _excluded = ["backgroundColor", "UNSAFE_style"];
1
+ var _excluded = ["backgroundColor", "borderColor", "borderStartColor", "borderEndColor", "borderTopColor", "borderBottomColor", "borderXColor", "borderYColor", "UNSAFE_style"];
2
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -8,28 +8,63 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
8
8
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
9
  /* eslint-disable react/jsx-props-no-spreading */
10
10
  import { forwardRef, useMemo } from 'react';
11
- import { View as SpectrumView } from '@adobe/react-spectrum';
11
+ import { useLocale, View as SpectrumView } from '@adobe/react-spectrum';
12
12
  import { colorValueStyle } from "../theme/colorUtils.js";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  /**
15
15
  * A View component that re-exports the Spectrum View component.
16
16
  * However, it overrides ColorValues to accept CSS color strings and
17
- * our custom variable names from our color paletee and semantic colors.
17
+ * our custom variable names from our color palette and semantic colors.
18
18
  *
19
19
  * @param props The props for the View component
20
20
  * @returns The View component
21
21
  *
22
22
  */
23
-
24
23
  export var View = /*#__PURE__*/forwardRef((props, forwardedRef) => {
25
24
  var {
26
25
  backgroundColor,
26
+ borderColor,
27
+ borderStartColor,
28
+ borderEndColor,
29
+ borderTopColor,
30
+ borderBottomColor,
31
+ borderXColor,
32
+ borderYColor,
27
33
  UNSAFE_style
28
34
  } = props,
29
35
  rest = _objectWithoutProperties(props, _excluded);
30
- var style = useMemo(() => _objectSpread(_objectSpread({}, UNSAFE_style), {}, {
31
- backgroundColor: colorValueStyle(backgroundColor)
32
- }), [backgroundColor, UNSAFE_style]);
36
+ var {
37
+ direction
38
+ } = useLocale();
39
+ var style = useMemo(() => {
40
+ var borderStyle = {};
41
+ if (borderColor !== undefined) {
42
+ borderStyle.borderColor = colorValueStyle(borderColor);
43
+ }
44
+ if (borderXColor !== undefined) {
45
+ borderStyle.borderLeftColor = colorValueStyle(borderXColor);
46
+ borderStyle.borderRightColor = colorValueStyle(borderXColor);
47
+ }
48
+ if (borderYColor !== undefined) {
49
+ borderStyle.borderTopColor = colorValueStyle(borderYColor);
50
+ borderStyle.borderBottomColor = colorValueStyle(borderYColor);
51
+ }
52
+ if (borderStartColor !== undefined) {
53
+ borderStyle[direction === 'rtl' ? 'borderRightColor' : 'borderLeftColor'] = colorValueStyle(borderStartColor);
54
+ }
55
+ if (borderEndColor !== undefined) {
56
+ borderStyle[direction === 'rtl' ? 'borderLeftColor' : 'borderRightColor'] = colorValueStyle(borderEndColor);
57
+ }
58
+ if (borderTopColor !== undefined) {
59
+ borderStyle.borderTopColor = colorValueStyle(borderTopColor);
60
+ }
61
+ if (borderBottomColor !== undefined) {
62
+ borderStyle.borderBottomColor = colorValueStyle(borderBottomColor);
63
+ }
64
+ return _objectSpread(_objectSpread({}, UNSAFE_style), {}, {
65
+ backgroundColor: colorValueStyle(backgroundColor)
66
+ }, borderStyle);
67
+ }, [backgroundColor, UNSAFE_style, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderXColor, borderYColor, direction]);
33
68
  return /*#__PURE__*/_jsx(SpectrumView, _objectSpread(_objectSpread({}, rest), {}, {
34
69
  ref: forwardedRef,
35
70
  UNSAFE_style: style
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","names":["forwardRef","useMemo","View","SpectrumView","colorValueStyle","jsx","_jsx","props","forwardedRef","backgroundColor","UNSAFE_style","rest","_objectWithoutProperties","_excluded","style","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/View.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { forwardRef, useMemo } from 'react';\nimport {\n View as SpectrumView,\n type ViewProps as SpectrumViewProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type ViewProps = Omit<SpectrumViewProps<6>, 'backgroundColor'> & {\n backgroundColor?: ColorValue;\n};\n\n/**\n * A View component that re-exports the Spectrum View component.\n * However, it overrides ColorValues to accept CSS color strings and\n * our custom variable names from our color paletee and semantic colors.\n *\n * @param props The props for the View component\n * @returns The View component\n *\n */\n\nexport const View = forwardRef<DOMRefValue<HTMLElement>, ViewProps>(\n (props, forwardedRef): JSX.Element => {\n const { backgroundColor, UNSAFE_style, ...rest } = props;\n const style = useMemo(\n () => ({\n ...UNSAFE_style,\n backgroundColor: colorValueStyle(backgroundColor),\n }),\n [backgroundColor, UNSAFE_style]\n );\n\n return <SpectrumView {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n }\n);\n\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,SACEC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,IAAMJ,IAAI,gBAAGF,UAAU,CAC5B,CAACO,KAAK,EAAEC,YAAY,KAAkB;EACpC,IAAM;MAAEC,eAAe;MAAEC;IAAsB,CAAC,GAAGH,KAAK;IAAdI,IAAI,GAAAC,wBAAA,CAAKL,KAAK,EAAAM,SAAA;EACxD,IAAMC,KAAK,GAAGb,OAAO,CACnB,MAAAc,aAAA,CAAAA,aAAA,KACKL,YAAY;IACfD,eAAe,EAAEL,eAAe,CAACK,eAAe;EAAC,EACjD,EACF,CAACA,eAAe,EAAEC,YAAY,CAChC,CAAC;EAED,oBAAOJ,IAAA,CAACH,YAAY,EAAAY,aAAA,CAAAA,aAAA,KAAKJ,IAAI;IAAEK,GAAG,EAAER,YAAa;IAACE,YAAY,EAAEI;EAAM,EAAE,CAAC;AAC3E,CACF,CAAC;AAEDZ,IAAI,CAACe,WAAW,GAAG,MAAM;AAEzB,eAAef,IAAI"}
1
+ {"version":3,"file":"View.js","names":["forwardRef","useMemo","useLocale","View","SpectrumView","colorValueStyle","jsx","_jsx","props","forwardedRef","backgroundColor","borderColor","borderStartColor","borderEndColor","borderTopColor","borderBottomColor","borderXColor","borderYColor","UNSAFE_style","rest","_objectWithoutProperties","_excluded","direction","style","borderStyle","undefined","borderLeftColor","borderRightColor","_objectSpread","ref","displayName"],"sources":["../../src/spectrum/View.tsx"],"sourcesContent":["/* eslint-disable react/jsx-props-no-spreading */\nimport { CSSProperties, forwardRef, useMemo } from 'react';\nimport {\n useLocale,\n View as SpectrumView,\n type ViewProps as SpectrumViewProps,\n} from '@adobe/react-spectrum';\nimport type { DOMRefValue } from '@react-types/shared';\nimport { type ColorValue, colorValueStyle } from '../theme/colorUtils';\n\nexport type ViewProps = Omit<\n SpectrumViewProps<6>,\n | 'backgroundColor'\n | 'borderColor'\n | 'borderStartColor'\n | 'borderEndColor'\n | 'borderTopColor'\n | 'borderBottomColor'\n | 'borderXColor'\n | 'borderYColor'\n> & {\n backgroundColor?: ColorValue;\n borderColor?: ColorValue;\n borderStartColor?: ColorValue;\n borderEndColor?: ColorValue;\n borderTopColor?: ColorValue;\n borderBottomColor?: ColorValue;\n borderXColor?: ColorValue;\n borderYColor?: ColorValue;\n};\n\n/**\n * A View component that re-exports the Spectrum View component.\n * However, it overrides ColorValues to accept CSS color strings and\n * our custom variable names from our color palette and semantic colors.\n *\n * @param props The props for the View component\n * @returns The View component\n *\n */\nexport const View = forwardRef<DOMRefValue<HTMLElement>, ViewProps>(\n (props, forwardedRef): JSX.Element => {\n const {\n backgroundColor,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderXColor,\n borderYColor,\n UNSAFE_style,\n ...rest\n } = props;\n\n const { direction } = useLocale();\n const style = useMemo(() => {\n const borderStyle: CSSProperties = {};\n if (borderColor !== undefined) {\n borderStyle.borderColor = colorValueStyle(borderColor);\n }\n if (borderXColor !== undefined) {\n borderStyle.borderLeftColor = colorValueStyle(borderXColor);\n borderStyle.borderRightColor = colorValueStyle(borderXColor);\n }\n if (borderYColor !== undefined) {\n borderStyle.borderTopColor = colorValueStyle(borderYColor);\n borderStyle.borderBottomColor = colorValueStyle(borderYColor);\n }\n if (borderStartColor !== undefined) {\n borderStyle[\n direction === 'rtl' ? 'borderRightColor' : 'borderLeftColor'\n ] = colorValueStyle(borderStartColor);\n }\n if (borderEndColor !== undefined) {\n borderStyle[\n direction === 'rtl' ? 'borderLeftColor' : 'borderRightColor'\n ] = colorValueStyle(borderEndColor);\n }\n if (borderTopColor !== undefined) {\n borderStyle.borderTopColor = colorValueStyle(borderTopColor);\n }\n if (borderBottomColor !== undefined) {\n borderStyle.borderBottomColor = colorValueStyle(borderBottomColor);\n }\n\n return {\n ...UNSAFE_style,\n backgroundColor: colorValueStyle(backgroundColor),\n ...borderStyle,\n };\n }, [\n backgroundColor,\n UNSAFE_style,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderXColor,\n borderYColor,\n direction,\n ]);\n\n return <SpectrumView {...rest} ref={forwardedRef} UNSAFE_style={style} />;\n }\n);\n\nView.displayName = 'View';\n\nexport default View;\n"],"mappings":";;;;;;;;AAAA;AACA,SAAwBA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC1D,SACEC,SAAS,EACTC,IAAI,IAAIC,YAAY,QAEf,uBAAuB;AAAC,SAELC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAuBzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMJ,IAAI,gBAAGH,UAAU,CAC5B,CAACQ,KAAK,EAAEC,YAAY,KAAkB;EACpC,IAAM;MACJC,eAAe;MACfC,WAAW;MACXC,gBAAgB;MAChBC,cAAc;MACdC,cAAc;MACdC,iBAAiB;MACjBC,YAAY;MACZC,YAAY;MACZC;IAEF,CAAC,GAAGV,KAAK;IADJW,IAAI,GAAAC,wBAAA,CACLZ,KAAK,EAAAa,SAAA;EAET,IAAM;IAAEC;EAAU,CAAC,GAAGpB,SAAS,CAAC,CAAC;EACjC,IAAMqB,KAAK,GAAGtB,OAAO,CAAC,MAAM;IAC1B,IAAMuB,WAA0B,GAAG,CAAC,CAAC;IACrC,IAAIb,WAAW,KAAKc,SAAS,EAAE;MAC7BD,WAAW,CAACb,WAAW,GAAGN,eAAe,CAACM,WAAW,CAAC;IACxD;IACA,IAAIK,YAAY,KAAKS,SAAS,EAAE;MAC9BD,WAAW,CAACE,eAAe,GAAGrB,eA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,eAAe3B,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/components",
3
- "version": "0.82.1-beta.3+4eb38dd2",
3
+ "version": "0.82.1-beta.5+a91e4f34",
4
4
  "description": "Deephaven React component library",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@adobe/react-spectrum": "3.35.1",
28
- "@deephaven/icons": "^0.82.1-beta.3+4eb38dd2",
29
- "@deephaven/log": "^0.82.1-beta.3+4eb38dd2",
30
- "@deephaven/react-hooks": "^0.82.1-beta.3+4eb38dd2",
31
- "@deephaven/utils": "^0.82.1-beta.3+4eb38dd2",
28
+ "@deephaven/icons": "^0.82.1-beta.5+a91e4f34",
29
+ "@deephaven/log": "^0.82.1-beta.5+a91e4f34",
30
+ "@deephaven/react-hooks": "^0.82.1-beta.5+a91e4f34",
31
+ "@deephaven/utils": "^0.82.1-beta.5+a91e4f34",
32
32
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
33
33
  "@fortawesome/react-fontawesome": "^0.2.0",
34
34
  "@react-spectrum/theme-default": "^3.5.1",
@@ -56,7 +56,7 @@
56
56
  "react-dom": ">=16.8.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@deephaven/mocks": "^0.82.1-beta.3+4eb38dd2"
59
+ "@deephaven/mocks": "^0.82.1-beta.5+a91e4f34"
60
60
  },
61
61
  "files": [
62
62
  "dist",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "4eb38dd2c47071516269662f8a975044e6bb0a9a"
73
+ "gitHead": "a91e4f348fc23618f10ac1d8c3a87bf237eb7bbd"
74
74
  }