@datarobot/design-system 30.8.0 → 30.10.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.
Files changed (40) hide show
  1. package/cjs/hooks/use-file-structure/utilities.d.ts +1 -1
  2. package/cjs/hooks/use-file-structure/utilities.js +1 -1
  3. package/cjs/index.d.ts +1 -0
  4. package/cjs/index.js +11 -0
  5. package/cjs/radio-button/types.d.ts +2 -2
  6. package/cjs/scoped-theme/index.d.ts +1 -0
  7. package/cjs/scoped-theme/index.js +24 -0
  8. package/cjs/scoped-theme/scoped-theme.d.ts +14 -0
  9. package/cjs/scoped-theme/scoped-theme.js +46 -0
  10. package/esm/hooks/use-file-structure/utilities.d.ts +1 -1
  11. package/esm/hooks/use-file-structure/utilities.js +1 -1
  12. package/esm/index.d.ts +1 -0
  13. package/esm/index.js +1 -0
  14. package/esm/radio-button/types.d.ts +2 -2
  15. package/esm/scoped-theme/index.d.ts +1 -0
  16. package/esm/scoped-theme/index.js +1 -0
  17. package/esm/scoped-theme/scoped-theme.d.ts +14 -0
  18. package/esm/scoped-theme/scoped-theme.js +37 -0
  19. package/js/alpine-light/alpine-light.min.js +1 -1
  20. package/js/bundle/bundle.js +37761 -35143
  21. package/js/bundle/bundle.min.js +1 -1
  22. package/js/bundle/bundle.min.js.LICENSE.txt +2 -13
  23. package/js/bundle/index.d.ts +16 -1
  24. package/js/light/light.min.js +1 -1
  25. package/js/main/main.min.js +1 -1
  26. package/js/midnight-gray/midnight-gray.min.js +1 -1
  27. package/package.json +2 -2
  28. package/scoped-theme/package.json +7 -0
  29. package/styles/index.css +10070 -10066
  30. package/styles/index.min.css +1 -1
  31. package/styles/scoped/index.css +14132 -0
  32. package/styles/scoped/index.min.css +1 -0
  33. package/styles/scoped/themes/alpine-light.css +1100 -0
  34. package/styles/scoped/themes/alpine-light.min.css +1 -0
  35. package/styles/scoped/themes/light.css +484 -0
  36. package/styles/scoped/themes/light.min.css +1 -0
  37. package/styles/scoped/themes/midnight-gray.css +1082 -0
  38. package/styles/scoped/themes/midnight-gray.min.css +1 -0
  39. package/styles/themes/light.min.css +1 -1
  40. package/styles/themes/midnight-gray.min.css +1 -1
@@ -28,7 +28,7 @@ declare const getEntryFileAsync: (itemEntry: FileSystemFileEntry) => Promise<voi
28
28
  /**
29
29
  * Check for feature support
30
30
  */
31
- declare const isItemsFileStructureSupported: (items: DataTransferItemList) => any;
31
+ declare const isItemsFileStructureSupported: (items: DataTransferItemList) => boolean;
32
32
  /**
33
33
  * Default file structure adaptor
34
34
  */
@@ -67,7 +67,7 @@ itemEntry.file(resolve, () => resolve()));
67
67
  exports.getEntryFileAsync = getEntryFileAsync;
68
68
  const isItemsFileStructureSupported = items => {
69
69
  const browserSupports = !!window.DataTransfer && !!window.DataTransferItemList && !!window.DataTransferItem;
70
- const itemsAllow = (0, _get.default)(items, '[0].webkitGetAsEntry');
70
+ const itemsAllow = typeof (0, _get.default)(items, '[0].webkitGetAsEntry') === 'function';
71
71
  // Cypress does not support webkitGetAsEntry, so fileUploader becomes impossible to test
72
72
  return browserSupports && itemsAllow && !window.Cypress;
73
73
  };
package/cjs/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export * from './range-slider';
73
73
  export * from './react-popper';
74
74
  export * from './refresh-button';
75
75
  export * from './scheduler';
76
+ export * from './scoped-theme';
76
77
  export * from './search';
77
78
  export * from './searchable-list';
78
79
  export * from './selectable-tiles';
package/cjs/index.js CHANGED
@@ -828,6 +828,17 @@ Object.keys(_scheduler).forEach(function (key) {
828
828
  }
829
829
  });
830
830
  });
831
+ var _scopedTheme = require("./scoped-theme");
832
+ Object.keys(_scopedTheme).forEach(function (key) {
833
+ if (key === "default" || key === "__esModule") return;
834
+ if (key in exports && exports[key] === _scopedTheme[key]) return;
835
+ Object.defineProperty(exports, key, {
836
+ enumerable: true,
837
+ get: function () {
838
+ return _scopedTheme[key];
839
+ }
840
+ });
841
+ });
831
842
  var _search = require("./search");
832
843
  Object.keys(_search).forEach(function (key) {
833
844
  if (key === "default" || key === "__esModule") return;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { PopperPlacementsType } from '../react-popper';
2
+ import { TooltipPlacementsType } from '../tooltip';
3
3
  import { ValueOf } from '../types';
4
4
  export declare const RADIO_BUTTON_SIZE: {
5
5
  readonly MD: "md";
@@ -7,7 +7,7 @@ export declare const RADIO_BUTTON_SIZE: {
7
7
  };
8
8
  export type RadioButtonSize = ValueOf<typeof RADIO_BUTTON_SIZE>;
9
9
  export type TooltipShape = {
10
- placement: PopperPlacementsType;
10
+ placement: TooltipPlacementsType;
11
11
  content: ReactNode;
12
12
  };
13
13
  export type RadioButtonOption = {
@@ -0,0 +1 @@
1
+ export { ScopedTheme, useSyncDesignSystemTheme, syncDesignSystemTheme, } from './scoped-theme';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ScopedTheme", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _scopedTheme.ScopedTheme;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "syncDesignSystemTheme", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _scopedTheme.syncDesignSystemTheme;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "useSyncDesignSystemTheme", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _scopedTheme.useSyncDesignSystemTheme;
22
+ }
23
+ });
24
+ var _scopedTheme = require("./scoped-theme");
@@ -0,0 +1,14 @@
1
+ export declare const defaultThemeMapping: {
2
+ 'midnight-gray': string;
3
+ 'alpine-light': string;
4
+ dark: string;
5
+ light: string;
6
+ };
7
+ export declare const syncDesignSystemTheme: (theme: string, themeMapping?: Record<string, string>) => void;
8
+ export declare const useSyncDesignSystemTheme: (theme: string, themeMapping?: Record<string, string>) => void;
9
+ export declare function ScopedTheme(props: {
10
+ children: React.ReactNode;
11
+ theme: keyof typeof defaultThemeMapping;
12
+ className?: string;
13
+ themeMapping?: Record<string, string>;
14
+ } & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ScopedTheme = ScopedTheme;
7
+ exports.useSyncDesignSystemTheme = exports.syncDesignSystemTheme = exports.defaultThemeMapping = void 0;
8
+ var _react = require("react");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ const defaultThemeMapping = exports.defaultThemeMapping = {
11
+ 'midnight-gray': 'midnight-gray',
12
+ 'alpine-light': 'alpine-light',
13
+ dark: 'midnight-gray',
14
+ light: 'alpine-light'
15
+ };
16
+ const syncDesignSystemTheme = (theme, themeMapping = defaultThemeMapping) => {
17
+ if (theme && theme in themeMapping) {
18
+ for (const container of document.querySelectorAll('[data-ds]')) {
19
+ container.setAttribute('data-theme', themeMapping[theme]);
20
+ }
21
+ }
22
+ };
23
+ exports.syncDesignSystemTheme = syncDesignSystemTheme;
24
+ const useSyncDesignSystemTheme = (theme, themeMapping = defaultThemeMapping) => {
25
+ (0, _react.useLayoutEffect)(() => {
26
+ syncDesignSystemTheme(theme, themeMapping);
27
+ }, [theme, themeMapping]);
28
+ };
29
+ exports.useSyncDesignSystemTheme = useSyncDesignSystemTheme;
30
+ function ScopedTheme(props) {
31
+ const {
32
+ children,
33
+ theme,
34
+ className = '',
35
+ themeMapping = defaultThemeMapping,
36
+ ...rest
37
+ } = props;
38
+ const scopedTheme = themeMapping[theme] || theme;
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
40
+ "data-ds": true,
41
+ "data-theme": scopedTheme,
42
+ className: className,
43
+ ...rest,
44
+ children: children
45
+ });
46
+ }
@@ -28,7 +28,7 @@ declare const getEntryFileAsync: (itemEntry: FileSystemFileEntry) => Promise<voi
28
28
  /**
29
29
  * Check for feature support
30
30
  */
31
- declare const isItemsFileStructureSupported: (items: DataTransferItemList) => any;
31
+ declare const isItemsFileStructureSupported: (items: DataTransferItemList) => boolean;
32
32
  /**
33
33
  * Default file structure adaptor
34
34
  */
@@ -55,7 +55,7 @@ itemEntry.file(resolve, () => resolve()));
55
55
  */
56
56
  const isItemsFileStructureSupported = items => {
57
57
  const browserSupports = !!window.DataTransfer && !!window.DataTransferItemList && !!window.DataTransferItem;
58
- const itemsAllow = get(items, '[0].webkitGetAsEntry');
58
+ const itemsAllow = typeof get(items, '[0].webkitGetAsEntry') === 'function';
59
59
  // Cypress does not support webkitGetAsEntry, so fileUploader becomes impossible to test
60
60
  return browserSupports && itemsAllow && !window.Cypress;
61
61
  };
package/esm/index.d.ts CHANGED
@@ -73,6 +73,7 @@ export * from './range-slider';
73
73
  export * from './react-popper';
74
74
  export * from './refresh-button';
75
75
  export * from './scheduler';
76
+ export * from './scoped-theme';
76
77
  export * from './search';
77
78
  export * from './searchable-list';
78
79
  export * from './selectable-tiles';
package/esm/index.js CHANGED
@@ -73,6 +73,7 @@ export * from './range-slider';
73
73
  export * from './react-popper';
74
74
  export * from './refresh-button';
75
75
  export * from './scheduler';
76
+ export * from './scoped-theme';
76
77
  export * from './search';
77
78
  export * from './searchable-list';
78
79
  export * from './selectable-tiles';
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { PopperPlacementsType } from '../react-popper';
2
+ import { TooltipPlacementsType } from '../tooltip';
3
3
  import { ValueOf } from '../types';
4
4
  export declare const RADIO_BUTTON_SIZE: {
5
5
  readonly MD: "md";
@@ -7,7 +7,7 @@ export declare const RADIO_BUTTON_SIZE: {
7
7
  };
8
8
  export type RadioButtonSize = ValueOf<typeof RADIO_BUTTON_SIZE>;
9
9
  export type TooltipShape = {
10
- placement: PopperPlacementsType;
10
+ placement: TooltipPlacementsType;
11
11
  content: ReactNode;
12
12
  };
13
13
  export type RadioButtonOption = {
@@ -0,0 +1 @@
1
+ export { ScopedTheme, useSyncDesignSystemTheme, syncDesignSystemTheme, } from './scoped-theme';
@@ -0,0 +1 @@
1
+ export { ScopedTheme, useSyncDesignSystemTheme, syncDesignSystemTheme } from './scoped-theme';
@@ -0,0 +1,14 @@
1
+ export declare const defaultThemeMapping: {
2
+ 'midnight-gray': string;
3
+ 'alpine-light': string;
4
+ dark: string;
5
+ light: string;
6
+ };
7
+ export declare const syncDesignSystemTheme: (theme: string, themeMapping?: Record<string, string>) => void;
8
+ export declare const useSyncDesignSystemTheme: (theme: string, themeMapping?: Record<string, string>) => void;
9
+ export declare function ScopedTheme(props: {
10
+ children: React.ReactNode;
11
+ theme: keyof typeof defaultThemeMapping;
12
+ className?: string;
13
+ themeMapping?: Record<string, string>;
14
+ } & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { useLayoutEffect } from 'react';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export const defaultThemeMapping = {
4
+ 'midnight-gray': 'midnight-gray',
5
+ 'alpine-light': 'alpine-light',
6
+ dark: 'midnight-gray',
7
+ light: 'alpine-light'
8
+ };
9
+ export const syncDesignSystemTheme = (theme, themeMapping = defaultThemeMapping) => {
10
+ if (theme && theme in themeMapping) {
11
+ for (const container of document.querySelectorAll('[data-ds]')) {
12
+ container.setAttribute('data-theme', themeMapping[theme]);
13
+ }
14
+ }
15
+ };
16
+ export const useSyncDesignSystemTheme = (theme, themeMapping = defaultThemeMapping) => {
17
+ useLayoutEffect(() => {
18
+ syncDesignSystemTheme(theme, themeMapping);
19
+ }, [theme, themeMapping]);
20
+ };
21
+ export function ScopedTheme(props) {
22
+ const {
23
+ children,
24
+ theme,
25
+ className = '',
26
+ themeMapping = defaultThemeMapping,
27
+ ...rest
28
+ } = props;
29
+ const scopedTheme = themeMapping[theme] || theme;
30
+ return /*#__PURE__*/_jsx("div", {
31
+ "data-ds": true,
32
+ "data-theme": scopedTheme,
33
+ className: className,
34
+ ...rest,
35
+ children: children
36
+ });
37
+ }
@@ -1 +1 @@
1
- !function(o,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DataRobot=t():(o.DataRobot=o.DataRobot||{},o.DataRobot["alpine-light"]=t())}(this,(()=>(()=>{var o,t={7252:()=>{}},e={};function r(o){var a=e[o];if(void 0!==a)return a.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,r),n.exports}r.m=t,o=[],r.O=(t,e,a,n)=>{if(!e){var i=1/0;for(b=0;b<o.length;b++){for(var[e,a,n]=o[b],p=!0,f=0;f<e.length;f++)(!1&n||i>=n)&&Object.keys(r.O).every((o=>r.O[o](e[f])))?e.splice(f--,1):(p=!1,n<i&&(i=n));if(p){o.splice(b--,1);var s=a();void 0!==s&&(t=s)}}return t}n=n||0;for(var b=o.length;b>0&&o[b-1][2]>n;b--)o[b]=o[b-1];o[b]=[e,a,n]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={457:0,726:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var a,n,[i,p,f]=e,s=0;if(i.some((t=>0!==o[t]))){for(a in p)r.o(p,a)&&(r.m[a]=p[a]);if(f)var b=f(r)}for(t&&t(e);s<i.length;s++)n=i[s],r.o(o,n)&&o[n]&&o[n][0](),o[n]=0;return r.O(b)},e=this.webpackChunkDataRobot=this.webpackChunkDataRobot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var a=r.O(void 0,[726],(()=>r(7252)));return r.O(a)})()));
1
+ !function(o,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.DataRobot=t():(o.DataRobot=o.DataRobot||{},o.DataRobot["alpine-light"]=t())}(this,()=>(()=>{var o,t={7252:()=>{}},e={};function r(o){var a=e[o];if(void 0!==a)return a.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,r),n.exports}r.m=t,o=[],r.O=(t,e,a,n)=>{if(!e){var i=1/0;for(b=0;b<o.length;b++){for(var[e,a,n]=o[b],p=!0,f=0;f<e.length;f++)(!1&n||i>=n)&&Object.keys(r.O).every(o=>r.O[o](e[f]))?e.splice(f--,1):(p=!1,n<i&&(i=n));if(p){o.splice(b--,1);var s=a();void 0!==s&&(t=s)}}return t}n=n||0;for(var b=o.length;b>0&&o[b-1][2]>n;b--)o[b]=o[b-1];o[b]=[e,a,n]},r.o=(o,t)=>Object.prototype.hasOwnProperty.call(o,t),(()=>{var o={457:0,726:0};r.O.j=t=>0===o[t];var t=(t,e)=>{var a,n,[i,p,f]=e,s=0;if(i.some(t=>0!==o[t])){for(a in p)r.o(p,a)&&(r.m[a]=p[a]);if(f)var b=f(r)}for(t&&t(e);s<i.length;s++)n=i[s],r.o(o,n)&&o[n]&&o[n][0](),o[n]=0;return r.O(b)},e=this.webpackChunkDataRobot=this.webpackChunkDataRobot||[];e.forEach(t.bind(null,0)),e.push=t.bind(null,e.push.bind(e))})();var a=r.O(void 0,[726],()=>r(7252));return r.O(a)})());