@dilicorp/ui 0.2.1 → 0.2.2

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.
@@ -3,11 +3,6 @@ declare type Props = {
3
3
  size: 'lg' | 'md' | 'sm';
4
4
  children: ReactNode;
5
5
  };
6
- declare global {
7
- interface Crypto {
8
- randomUUID: () => `${string}-${string}-${string}-${string}-${string}`;
9
- }
10
- }
11
6
  export declare const BaseIcon: ({ children, size }: Props) => JSX.Element;
12
7
  export {};
13
8
  //# sourceMappingURL=base-icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/pluxee-icon/base-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAQD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;KACtE;CACF;AAED,eAAO,MAAM,QAAQ,uBAAwB,KAAK,gBAejD,CAAA"}
1
+ {"version":3,"file":"base-icon.d.ts","sourceRoot":"","sources":["../../../src/atoms/pluxee-icon/base-icon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC,aAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAQD,eAAO,MAAM,QAAQ,uBAAwB,KAAK,gBAejD,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import uuidHelper from '../../utils/uuid-helper';
2
3
  const sizeInfo = {
3
4
  lg: 32,
4
5
  md: 24,
@@ -6,7 +7,7 @@ const sizeInfo = {
6
7
  };
7
8
  export const BaseIcon = ({ children, size }) => {
8
9
  const sizeNumber = sizeInfo[size];
9
- const id = crypto.randomUUID();
10
+ const id = uuidHelper.generateUUID();
10
11
  return (React.createElement("svg", { style: { color: 'inherit' }, width: sizeNumber, height: sizeNumber, viewBox: '0 0 32 32', fill: "none", xmlns: "http://www.w3.org/2000/svg" },
11
12
  React.createElement("g", { clipPath: `url(#${id})` }, children),
12
13
  React.createElement("defs", null,
@@ -0,0 +1,6 @@
1
+ declare class UUIDHelper {
2
+ generateUUID(): string;
3
+ }
4
+ declare const _default: UUIDHelper;
5
+ export default _default;
6
+ //# sourceMappingURL=uuid-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuid-helper.d.ts","sourceRoot":"","sources":["../../src/utils/uuid-helper.ts"],"names":[],"mappings":"AAAA,cAAM,UAAU;IACd,YAAY,IAAK,MAAM;CAOxB;;AAED,wBAA+B"}
@@ -0,0 +1,10 @@
1
+ class UUIDHelper {
2
+ generateUUID() {
3
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
4
+ const r = Math.random() * 16 | 0;
5
+ const v = c === 'x' ? r : (r & 0x3 | 0x8);
6
+ return v.toString(16);
7
+ });
8
+ }
9
+ }
10
+ export default new UUIDHelper();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilicorp/ui",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "A simple UI design for Dilicorp",
5
5
  "repository": {
6
6
  "type": "git",