@useblu/ocean-react 1.28.0 → 1.29.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/Badge/Badge.d.ts CHANGED
@@ -5,8 +5,8 @@ export declare type BadgeProps = {
5
5
  count?: number;
6
6
  } & React.ComponentPropsWithoutRef<'div'>;
7
7
  declare const Badge: React.ForwardRefExoticComponent<{
8
- variation?: "tiny" | "small" | "medium" | undefined;
9
- color?: "brand" | "complementary" | "alert" | "neutral" | undefined;
8
+ variation?: "small" | "tiny" | "medium" | undefined;
9
+ color?: "alert" | "complementary" | "brand" | "neutral" | undefined;
10
10
  count?: number | undefined;
11
11
  } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
12
12
  export default Badge;
@@ -6,8 +6,9 @@ export declare type ButtonProps<P extends React.ElementType = 'button'> = {
6
6
  variant?: 'primary' | 'primaryCritical' | 'secondary' | 'text' | 'textCritical' | 'inverse';
7
7
  size?: 'sm' | 'md' | 'lg';
8
8
  blocked?: boolean;
9
+ loading?: boolean;
9
10
  }>;
10
- declare function ButtonBase<T extends React.ElementType = 'button'>({ children, className, size, variant, blocked, component, ...rest }: ButtonProps<T>, ref: React.Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
+ declare function ButtonBase<T extends React.ElementType = 'button'>({ children, className, size, variant, blocked, loading, component, ...rest }: ButtonProps<T>, ref: React.Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
11
12
  declare const Button: typeof ButtonBase;
12
13
  export default Button;
13
14
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAA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CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF,iBAAS,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EACxD,EACE,QAAQ,EACR,SAAS,EACT,IAAW,EACX,OAAmB,EACnB,OAAe,EACf,OAAe,EACf,SAAS,EACT,GAAG,IAAI,EACR,EAAE,WAAW,CAAC,CAAC,CAAC,EACjB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,sEA4BlC;AAED,QAAA,MAAM,MAAM,mBAA+D,CAAC;AAE5E,eAAe,MAAM,CAAC"}
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.29.0](https://github.com/ocean-ds/ocean-web/compare/v1.28.0...v1.29.0) (2022-02-24)
7
+
8
+ ### Features
9
+
10
+ - **progress:** add progress and other fixes ([#922](https://github.com/ocean-ds/ocean-web/issues/922)) ([5888456](https://github.com/ocean-ds/ocean-web/commit/5888456c5618d73ca891005b743fdfacd0ab1c30))
11
+
6
12
  # [1.28.0](https://github.com/ocean-ds/ocean-web/compare/v1.27.3...v1.28.0) (2022-02-23)
7
13
 
8
14
  ### Features
@@ -1,7 +1,11 @@
1
1
  import React from 'react';
2
2
  export declare type ProgressProps = {
3
3
  size?: 'md' | 'lg' | 'sm';
4
- };
5
- declare const Progress: React.FC<ProgressProps>;
4
+ onColor?: boolean;
5
+ } & React.ComponentPropsWithoutRef<'div'>;
6
+ declare const Progress: React.ForwardRefExoticComponent<{
7
+ size?: "md" | "lg" | "sm" | undefined;
8
+ onColor?: boolean | undefined;
9
+ } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
6
10
  export default Progress;
7
11
  //# sourceMappingURL=Progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,aAAa,GAAG;IAK1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAerC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../../src/Progress/Progress.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,oBAAY,aAAa,GAAG;IAK1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAM1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAE1C,QAAA,MAAM,QAAQ;;;kLAwBb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const IconLg: React.FunctionComponent;
3
+ export default IconLg;
4
+ //# sourceMappingURL=IconLg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconLg.d.ts","sourceRoot":"","sources":["../../../src/Progress/img/IconLg.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,iBAwBnB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const IconMd: React.FunctionComponent;
3
+ export default IconMd;
4
+ //# sourceMappingURL=IconMd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconMd.d.ts","sourceRoot":"","sources":["../../../src/Progress/img/IconMd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,iBAwBnB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const IconSm: React.FunctionComponent;
3
+ export default IconSm;
4
+ //# sourceMappingURL=IconSm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconSm.d.ts","sourceRoot":"","sources":["../../../src/Progress/img/IconSm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,iBAwBnB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/Search/Search.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG/D,oBAAY,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GACzD,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAE1C,QAAA,MAAM,MAAM,uQAyCV,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Search.d.ts","sourceRoot":"","sources":["../../src/Search/Search.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG/D,oBAAY,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GACzD,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAE1C,QAAA,MAAM,MAAM,uQAwCV,CAAC;AAEH,eAAe,MAAM,CAAC"}
package/index.es.js CHANGED
@@ -302,9 +302,34 @@ var Alert = e$1.forwardRef(function Alert(_a, ref) {
302
302
  e$1.createElement("div", { className: "ods-alert__content" }, children)));
303
303
  });
304
304
 
305
+ var IconSm = function () { return (e$1.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
306
+ e$1.createElement("circle", { opacity: "0.4", cx: "8", cy: "8", r: "6", stroke: "#B8C3FF", strokeWidth: "4" }),
307
+ e$1.createElement("path", { d: "M8 2C8.78793 2 9.56815 2.15519 10.2961 2.45672C11.0241 2.75825 11.6855 3.20021 12.2426 3.75736C12.7998 4.31451 13.2417 4.97595 13.5433 5.7039C13.8448 6.43185 14 7.21207 14 8", stroke: "#0025E0", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }))); };
308
+
309
+ var IconMd = function () { return (e$1.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
310
+ e$1.createElement("circle", { opacity: "0.4", cx: "12", cy: "12", r: "10", stroke: "#B8C3FF", strokeWidth: "4" }),
311
+ e$1.createElement("path", { d: "M12 2C13.3132 2 14.6136 2.25866 15.8268 2.7612C17.0401 3.26375 18.1425 4.00035 19.0711 4.92893C19.9997 5.85752 20.7362 6.95991 21.2388 8.17317C21.7413 9.38642 22 10.6868 22 12", stroke: "#0025E0", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }))); };
312
+
313
+ var IconLg = function () { return (e$1.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
314
+ e$1.createElement("circle", { opacity: "0.4", cx: "16", cy: "16", r: "14", stroke: "#B8C3FF", strokeWidth: "4" }),
315
+ e$1.createElement("path", { d: "M16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76925 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2307 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16", stroke: "#0025E0", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }))); };
316
+
317
+ var Progress = e$1.forwardRef(function OceanProgress(_a, ref) {
318
+ var _b = _a.onColor, onColor = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, className = _a.className, rest = __rest(_a, ["onColor", "size", "className"]);
319
+ return (e$1.createElement("div", __assign({ ref: ref, className: classNames('ods-progress', "ods-progress--" + size, className, {
320
+ 'ods-progress--on-color': onColor,
321
+ }) }, rest),
322
+ size === 'sm' && e$1.createElement(IconSm, null),
323
+ size === 'md' && e$1.createElement(IconMd, null),
324
+ size === 'lg' && e$1.createElement(IconLg, null)));
325
+ });
326
+
305
327
  function ButtonBase(_a, ref) {
306
- var children = _a.children, className = _a.className, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.variant, variant = _c === void 0 ? 'primary' : _c, _d = _a.blocked, blocked = _d === void 0 ? false : _d, component = _a.component, rest = __rest(_a, ["children", "className", "size", "variant", "blocked", "component"]);
307
- return e$1.createElement(component || 'button', __assign({ ref: ref, className: classNames('ods-btn', "ods-btn--" + size, "ods-btn--" + variant.replace(/[A-Z]/g, function (m) { return '-' + m.toLowerCase(); }), blocked && 'ods-btn--blocked', className) }, rest), children);
328
+ var children = _a.children, className = _a.className, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.variant, variant = _c === void 0 ? 'primary' : _c, _d = _a.blocked, blocked = _d === void 0 ? false : _d, _e = _a.loading, loading = _e === void 0 ? false : _e, component = _a.component, rest = __rest(_a, ["children", "className", "size", "variant", "blocked", "loading", "component"]);
329
+ var onColor = ['primary', 'primaryCritical', 'inverse'].includes(variant);
330
+ return e$1.createElement(component || 'button', __assign(__assign({ ref: ref, className: classNames('ods-btn', "ods-btn--" + size, "ods-btn--" + variant.replace(/[A-Z]/g, function (m) { return '-' + m.toLowerCase(); }), blocked && 'ods-btn--blocked', className, { 'ods-btn--loading': loading }) }, rest), { onClick: loading ? function () { return false; } : rest.onClick }), loading ? (e$1.createElement(e$1.Fragment, null,
331
+ e$1.createElement(Progress, { size: size, onColor: onColor }),
332
+ e$1.createElement("span", null, children))) : (children));
308
333
  }
309
334
  var Button = e$1.forwardRef(ButtonBase);
310
335
 
@@ -8048,17 +8073,6 @@ function IconButtonBase(_a, ref) {
8048
8073
  }
8049
8074
  var IconButton = e$1.forwardRef(IconButtonBase);
8050
8075
 
8051
- var Progress = function (_a) {
8052
- var _b = _a.size, size = _b === void 0 ? 'md' : _b, rest = __rest(_a, ["size"]);
8053
- return (e$1.createElement("div", __assign({ className: "ods-progress" }, rest),
8054
- e$1.createElement("span", { className: "ods-progress__primary ods-progress--" + size },
8055
- e$1.createElement("svg", { className: "ods-progress-svg", viewBox: "22 22 44 44" },
8056
- e$1.createElement("circle", { cx: "44", cy: "44", r: "18", fill: "none" }))),
8057
- e$1.createElement("span", { className: "ods-progress__secondary ods-progress--" + size },
8058
- e$1.createElement("svg", { viewBox: "22 22 44 44" },
8059
- e$1.createElement("circle", { cx: "44", cy: "44", r: "18", fill: "none" })))));
8060
- };
8061
-
8062
8076
  var Search = e$1.forwardRef(function Input(_a, ref) {
8063
8077
  var className = _a.className, blocked = _a.blocked, id = _a.id, disabled = _a.disabled, value = _a.value, defaultValue = _a.defaultValue, rest = __rest(_a, ["className", "blocked", "id", "disabled", "value", "defaultValue"]);
8064
8078
  var _b = useState(defaultValue || value), inputValue = _b[0], setInputValue = _b[1];
@@ -8069,7 +8083,7 @@ var Search = e$1.forwardRef(function Input(_a, ref) {
8069
8083
  e$1.createElement("input", __assign({ ref: ref, type: "text", id: id, disabled: disabled, onChange: function (_a) {
8070
8084
  var target = _a.target;
8071
8085
  return setInputValue(target.value);
8072
- }, defaultValue: defaultValue, value: inputValue }, rest)),
8086
+ }, value: inputValue }, rest)),
8073
8087
  e$1.createElement("div", { "data-testid": "close", onClick: function () { return setInputValue(''); }, className: "ods-search__clean" }, inputValue && e$1.createElement(ha, null)))));
8074
8088
  });
8075
8089