@entur/utils 0.4.6-alpha.0 → 0.4.6-beta.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.
- package/dist/index.d.ts +0 -2
- package/dist/utils.cjs.development.js +0 -55
- package/dist/utils.cjs.development.js.map +1 -1
- package/dist/utils.cjs.production.min.js +1 -1
- package/dist/utils.cjs.production.min.js.map +1 -1
- package/dist/utils.esm.js +2 -55
- package/dist/utils.esm.js.map +1 -1
- package/package.json +9 -6
- package/CHANGELOG.md +0 -97
- package/dist/ConditionalWrapper.d.ts +0 -1
- package/dist/useOnClickOutside.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -93,59 +93,6 @@ var mergeRefs = function mergeRefs() {
|
|
|
93
93
|
};
|
|
94
94
|
};
|
|
95
95
|
|
|
96
|
-
var useOnClickOutside = function useOnClickOutside(refs, handler) {
|
|
97
|
-
React.useEffect(function () {
|
|
98
|
-
var listener = function listener(event) {
|
|
99
|
-
// If the ref contains the clicked element, then the click is not outside
|
|
100
|
-
if (refs.some(function (ref) {
|
|
101
|
-
return elementContainsEventTarget(ref.current, event);
|
|
102
|
-
})) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
handler();
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
document.addEventListener('mousedown', listener);
|
|
110
|
-
document.addEventListener('touchstart', listener);
|
|
111
|
-
return function () {
|
|
112
|
-
document.removeEventListener('mousedown', listener);
|
|
113
|
-
document.removeEventListener('touchstart', listener);
|
|
114
|
-
};
|
|
115
|
-
}, [refs, handler]);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
var elementContainsEventTarget = function elementContainsEventTarget(element, event) {
|
|
119
|
-
if (!element) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (element.contains(event.target)) {
|
|
124
|
-
return true;
|
|
125
|
-
} // For elements inside a Shadow DOM we need to check the composedPath
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (event.composed && event.composedPath) {
|
|
129
|
-
var contains = event.composedPath().find(function (target) {
|
|
130
|
-
if (target === window) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return element.contains(target);
|
|
135
|
-
});
|
|
136
|
-
return contains ? true : false;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return false;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var ConditionalWrapper = function ConditionalWrapper(_ref) {
|
|
143
|
-
var condition = _ref.condition,
|
|
144
|
-
wrapper = _ref.wrapper,
|
|
145
|
-
children = _ref.children;
|
|
146
|
-
return condition ? wrapper(children) : React__default["default"].createElement(React__default["default"].Fragment, null, children);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
96
|
var packagesToCheck = /*#__PURE__*/new Set();
|
|
150
97
|
var checkTimeoutId;
|
|
151
98
|
|
|
@@ -182,10 +129,8 @@ function warnAboutMissingStyles() {
|
|
|
182
129
|
checkTimeoutId = window.setTimeout(checkAndWarn, 1000);
|
|
183
130
|
}
|
|
184
131
|
|
|
185
|
-
exports.ConditionalWrapper = ConditionalWrapper;
|
|
186
132
|
exports.debounce = debounce;
|
|
187
133
|
exports.mergeRefs = mergeRefs;
|
|
188
|
-
exports.useOnClickOutside = useOnClickOutside;
|
|
189
134
|
exports.useOnMount = useOnMount;
|
|
190
135
|
exports.useRandomId = useRandomId;
|
|
191
136
|
exports.warnAboutMissingStyles = warnAboutMissingStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs.development.js","sources":["../src/debounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/
|
|
1
|
+
{"version":3,"file":"utils.cjs.development.js","sources":["../src/debounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/warnAboutMissingStyles.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => any>(\n fn: T,\n delay: number,\n): (...args: Parameters<T>) => void {\n let id: any;\n return (...args) => {\n clearTimeout(id);\n id = setTimeout(() => fn(...args), delay);\n };\n}\n","import React from 'react';\n\nexport const useRandomId = (prefix?: string): string => {\n const ref = React.useRef(String(Math.random()).substring(2));\n return `${prefix}-${ref.current}`;\n};\n","import React from 'react';\n\nexport function useOnMount(callback: () => void): void {\n const hasRun = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n if (!hasRun.current) {\n hasRun.current = true;\n callback();\n }\n }, [callback]);\n}\n","export const mergeRefs = <T extends HTMLElement>(\n ...refs: React.MutableRefObject<T>[] | React.ForwardedRef<T>[]\n) => {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) ref.current = node;\n }\n };\n};\n","import warning from 'tiny-warning';\n\nconst packagesToCheck: Set<string> = new Set();\nlet checkTimeoutId: number;\n\nfunction checkAndWarn() {\n const missingImports = Array.from(packagesToCheck)\n .filter(\n namespace =>\n parseInt(\n window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(`--eds-${namespace}`),\n ) !== 1,\n )\n .sort();\n\n // Finally, we warn about those pesky imports\n const singleMissingImport = missingImports.length === 1;\n warning(\n missingImports.length === 0,\n `You are missing ${\n singleMissingImport\n ? 'a CSS import'\n : `${missingImports.length} CSS imports`\n }!\n\nPlease add the following CSS import${\n singleMissingImport ? '' : 's'\n } somewhere in your app:\n\n${missingImports\n .map(namespace => `\\t@import '~@entur/${namespace}/dist/styles.css';`)\n .join('\\n')}\n`,\n );\n}\n\n/** Warns the developer if they have forgotten to include styles */\nexport function warnAboutMissingStyles(...namespaces: string[]): void {\n // We skip this check in production, and when we build static sites\n if (!__DEV__ || typeof window === 'undefined') {\n return;\n }\n // First, let's clear earlier calls to setTimeout\n window.clearTimeout(checkTimeoutId);\n\n // Next, let's add all namespaces to the set of packages to check\n namespaces.forEach(namespace => packagesToCheck.add(namespace));\n\n // Finally. let's trigger a run of the checker.\n checkTimeoutId = window.setTimeout(checkAndWarn, 1000);\n}\n"],"names":["debounce","fn","delay","id","args","clearTimeout","setTimeout","useRandomId","prefix","ref","React","useRef","String","Math","random","substring","current","useOnMount","callback","hasRun","useEffect","mergeRefs","refs","node","packagesToCheck","Set","checkTimeoutId","checkAndWarn","missingImports","Array","from","filter","namespace","parseInt","window","getComputedStyle","document","documentElement","getPropertyValue","sort","singleMissingImport","length","warning","map","join","warnAboutMissingStyles","namespaces","forEach","add"],"mappings":";;;;;;;;;;;;SAAgBA,SACdC,IACAC;AAEA,MAAIC,EAAJ;AACA,SAAO;sCAAIC;AAAAA,MAAAA;;;AACTC,IAAAA,YAAY,CAACF,EAAD,CAAZ;AACAA,IAAAA,EAAE,GAAGG,UAAU,CAAC;AAAA,aAAML,EAAE,MAAF,SAAMG,IAAN,CAAN;AAAA,KAAD,EAAoBF,KAApB,CAAf;AACD,GAHD;AAID;;ICPYK,WAAW,GAAG,SAAdA,WAAc,CAACC,MAAD;AACzB,MAAMC,GAAG,GAAGC,yBAAK,CAACC,MAAN,CAAaC,MAAM,CAACC,IAAI,CAACC,MAAL,EAAD,CAAN,CAAsBC,SAAtB,CAAgC,CAAhC,CAAb,CAAZ;AACA,SAAUP,MAAV,SAAoBC,GAAG,CAACO,OAAxB;AACD;;SCHeC,WAAWC;AACzB,MAAMC,MAAM,GAAGT,yBAAK,CAACC,MAAN,CAAsB,KAAtB,CAAf;AAEAD,EAAAA,yBAAK,CAACU,SAAN,CAAgB;AACd,QAAI,CAACD,MAAM,CAACH,OAAZ,EAAqB;AACnBG,MAAAA,MAAM,CAACH,OAAP,GAAiB,IAAjB;AACAE,MAAAA,QAAQ;AACT;AACF,GALD,EAKG,CAACA,QAAD,CALH;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICXYG,SAAS,GAAG,SAAZA,SAAY;oCACpBC;AAAAA,IAAAA;;;AAEH,SAAO,UAACC,IAAD;AACL,yDAAkBD,IAAlB,wCAAwB;AAAA,U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AjB;AACD;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("tiny-warning");var t=r(e);function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function o(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}exports.debounce=function(e,r){var t;return function(){for(var n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];clearTimeout(t),t=setTimeout((function(){return e.apply(void 0,o)}),r)}},exports.mergeRefs=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return function(e){for(var t,n=o(r);!(t=n()).done;){var u=t.value;"function"==typeof u?u(e):u&&(u.current=e)}}},exports.useOnMount=function(e){var r=t.default.useRef(!1);t.default.useEffect((function(){r.current||(r.current=!0,e())}),[e])},exports.useRandomId=function(e){return e+"-"+t.default.useRef(String(Math.random()).substring(2)).current},exports.warnAboutMissingStyles=function(){};
|
|
2
2
|
//# sourceMappingURL=utils.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs.production.min.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"utils.cjs.production.min.js","sources":["../src/debounce.ts","../src/mergeRefs.ts","../src/useOnMount.ts","../src/useRandomId.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => any>(\n fn: T,\n delay: number,\n): (...args: Parameters<T>) => void {\n let id: any;\n return (...args) => {\n clearTimeout(id);\n id = setTimeout(() => fn(...args), delay);\n };\n}\n","export const mergeRefs = <T extends HTMLElement>(\n ...refs: React.MutableRefObject<T>[] | React.ForwardedRef<T>[]\n) => {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) ref.current = node;\n }\n };\n};\n","import React from 'react';\n\nexport function useOnMount(callback: () => void): void {\n const hasRun = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n if (!hasRun.current) {\n hasRun.current = true;\n callback();\n }\n }, [callback]);\n}\n","import React from 'react';\n\nexport const useRandomId = (prefix?: string): string => {\n const ref = React.useRef(String(Math.random()).substring(2));\n return `${prefix}-${ref.current}`;\n};\n"],"names":["fn","delay","id","args","clearTimeout","setTimeout","refs","node","ref","current","callback","hasRun","React","useRef","useEffect","prefix","String","Math","random","substring"],"mappings":"shCACEA,EACAC,OAEIC,SACG,sCAAIC,2BAAAA,kBACTC,aAAaF,GACbA,EAAKG,YAAW,kBAAML,eAAMG,KAAOF,uBCPd,sCACpBK,2BAAAA,yBAEI,SAACC,iBACYD,kBAAM,KAAbE,UACU,mBAARA,EACTA,EAAID,GACKC,IAAKA,EAAIC,QAAUF,kCCLTG,OACnBC,EAASC,UAAMC,QAAgB,GAErCD,UAAME,WAAU,WACTH,EAAOF,UACVE,EAAOF,SAAU,EACjBC,OAED,CAACA,yBCRqB,SAACK,UAEhBA,MADEH,UAAMC,OAAOG,OAAOC,KAAKC,UAAUC,UAAU,IACjCV"}
|
package/dist/utils.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import warning from 'tiny-warning';
|
|
3
3
|
|
|
4
4
|
function debounce(fn, delay) {
|
|
@@ -84,59 +84,6 @@ var mergeRefs = function mergeRefs() {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
var useOnClickOutside = function useOnClickOutside(refs, handler) {
|
|
88
|
-
useEffect(function () {
|
|
89
|
-
var listener = function listener(event) {
|
|
90
|
-
// If the ref contains the clicked element, then the click is not outside
|
|
91
|
-
if (refs.some(function (ref) {
|
|
92
|
-
return elementContainsEventTarget(ref.current, event);
|
|
93
|
-
})) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
handler();
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
document.addEventListener('mousedown', listener);
|
|
101
|
-
document.addEventListener('touchstart', listener);
|
|
102
|
-
return function () {
|
|
103
|
-
document.removeEventListener('mousedown', listener);
|
|
104
|
-
document.removeEventListener('touchstart', listener);
|
|
105
|
-
};
|
|
106
|
-
}, [refs, handler]);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
var elementContainsEventTarget = function elementContainsEventTarget(element, event) {
|
|
110
|
-
if (!element) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (element.contains(event.target)) {
|
|
115
|
-
return true;
|
|
116
|
-
} // For elements inside a Shadow DOM we need to check the composedPath
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (event.composed && event.composedPath) {
|
|
120
|
-
var contains = event.composedPath().find(function (target) {
|
|
121
|
-
if (target === window) {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return element.contains(target);
|
|
126
|
-
});
|
|
127
|
-
return contains ? true : false;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return false;
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
var ConditionalWrapper = function ConditionalWrapper(_ref) {
|
|
134
|
-
var condition = _ref.condition,
|
|
135
|
-
wrapper = _ref.wrapper,
|
|
136
|
-
children = _ref.children;
|
|
137
|
-
return condition ? wrapper(children) : React.createElement(React.Fragment, null, children);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
87
|
var packagesToCheck = /*#__PURE__*/new Set();
|
|
141
88
|
var checkTimeoutId;
|
|
142
89
|
|
|
@@ -173,5 +120,5 @@ function warnAboutMissingStyles() {
|
|
|
173
120
|
checkTimeoutId = window.setTimeout(checkAndWarn, 1000);
|
|
174
121
|
}
|
|
175
122
|
|
|
176
|
-
export {
|
|
123
|
+
export { debounce, mergeRefs, useOnMount, useRandomId, warnAboutMissingStyles };
|
|
177
124
|
//# sourceMappingURL=utils.esm.js.map
|
package/dist/utils.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../src/debounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../src/debounce.ts","../src/useRandomId.ts","../src/useOnMount.ts","../src/mergeRefs.ts","../src/warnAboutMissingStyles.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => any>(\n fn: T,\n delay: number,\n): (...args: Parameters<T>) => void {\n let id: any;\n return (...args) => {\n clearTimeout(id);\n id = setTimeout(() => fn(...args), delay);\n };\n}\n","import React from 'react';\n\nexport const useRandomId = (prefix?: string): string => {\n const ref = React.useRef(String(Math.random()).substring(2));\n return `${prefix}-${ref.current}`;\n};\n","import React from 'react';\n\nexport function useOnMount(callback: () => void): void {\n const hasRun = React.useRef<boolean>(false);\n\n React.useEffect(() => {\n if (!hasRun.current) {\n hasRun.current = true;\n callback();\n }\n }, [callback]);\n}\n","export const mergeRefs = <T extends HTMLElement>(\n ...refs: React.MutableRefObject<T>[] | React.ForwardedRef<T>[]\n) => {\n return (node: T) => {\n for (const ref of refs) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) ref.current = node;\n }\n };\n};\n","import warning from 'tiny-warning';\n\nconst packagesToCheck: Set<string> = new Set();\nlet checkTimeoutId: number;\n\nfunction checkAndWarn() {\n const missingImports = Array.from(packagesToCheck)\n .filter(\n namespace =>\n parseInt(\n window\n .getComputedStyle(document.documentElement)\n .getPropertyValue(`--eds-${namespace}`),\n ) !== 1,\n )\n .sort();\n\n // Finally, we warn about those pesky imports\n const singleMissingImport = missingImports.length === 1;\n warning(\n missingImports.length === 0,\n `You are missing ${\n singleMissingImport\n ? 'a CSS import'\n : `${missingImports.length} CSS imports`\n }!\n\nPlease add the following CSS import${\n singleMissingImport ? '' : 's'\n } somewhere in your app:\n\n${missingImports\n .map(namespace => `\\t@import '~@entur/${namespace}/dist/styles.css';`)\n .join('\\n')}\n`,\n );\n}\n\n/** Warns the developer if they have forgotten to include styles */\nexport function warnAboutMissingStyles(...namespaces: string[]): void {\n // We skip this check in production, and when we build static sites\n if (!__DEV__ || typeof window === 'undefined') {\n return;\n }\n // First, let's clear earlier calls to setTimeout\n window.clearTimeout(checkTimeoutId);\n\n // Next, let's add all namespaces to the set of packages to check\n namespaces.forEach(namespace => packagesToCheck.add(namespace));\n\n // Finally. let's trigger a run of the checker.\n checkTimeoutId = window.setTimeout(checkAndWarn, 1000);\n}\n"],"names":["debounce","fn","delay","id","args","clearTimeout","setTimeout","useRandomId","prefix","ref","React","useRef","String","Math","random","substring","current","useOnMount","callback","hasRun","useEffect","mergeRefs","refs","node","packagesToCheck","Set","checkTimeoutId","checkAndWarn","missingImports","Array","from","filter","namespace","parseInt","window","getComputedStyle","document","documentElement","getPropertyValue","sort","singleMissingImport","length","warning","map","join","warnAboutMissingStyles","namespaces","forEach","add"],"mappings":";;;SAAgBA,SACdC,IACAC;AAEA,MAAIC,EAAJ;AACA,SAAO;sCAAIC;AAAAA,MAAAA;;;AACTC,IAAAA,YAAY,CAACF,EAAD,CAAZ;AACAA,IAAAA,EAAE,GAAGG,UAAU,CAAC;AAAA,aAAML,EAAE,MAAF,SAA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,GAFU,EASpBO,IAToB,EAAvB;;AAYA,MAAMC,mBAAmB,GAAGZ,cAAc,CAACa,MAAf,KAA0B,CAAtD;AACA,0CAAAC,OAAO,CACLd,cAAc,CAACa,MAAf,KAA0B,CADrB,wBAGHD,mBAAmB,GACf,cADe,GAEZZ,cAAc,CAACa,MAFH,iBAHhB,kDASHD,mBAAmB,GAAG,EAAH,GAAQ,GATxB,oCAYPZ,cAAc,CACbe,GADD,CACK,UAAAX,SAAS;AAAA,mCAA0BA,SAA1B;AAAA,GADd,EAECY,IAFD,CAEM,IAFN,CAZO,QAAP;AAiBD;AAED;;;SACgBC;AACd;AACA,MAAI,4CAAY,OAAOX,MAAP,KAAkB,WAAlC,EAA+C;AAC7C;AACD;;;AAEDA,EAAAA,MAAM,CAAC7B,YAAP,CAAoBqB,cAApB;;oCANwCoB;AAAAA,IAAAA;;;AASxCA,EAAAA,UAAU,CAACC,OAAX,CAAmB,UAAAf,SAAS;AAAA,WAAIR,eAAe,CAACwB,GAAhB,CAAoBhB,SAApB,CAAJ;AAAA,GAA5B;;AAGAN,EAAAA,cAAc,GAAGQ,MAAM,CAAC5B,UAAP,CAAkBqB,YAAlB,EAAgC,IAAhC,CAAjB;AACD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"//": "Add a change to utils",
|
|
2
3
|
"name": "@entur/utils",
|
|
3
|
-
"version": "0.4.6-
|
|
4
|
+
"version": "0.4.6-beta.2",
|
|
4
5
|
"license": "EUPL-1.2",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"module": "dist/utils.esm.js",
|
|
@@ -17,10 +18,9 @@
|
|
|
17
18
|
"access": "public"
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
|
-
"start": "dts watch --noClean",
|
|
21
|
-
"build": "dts build && cp src/*.scss dist",
|
|
22
|
-
"
|
|
23
|
-
"lint": "dts lint"
|
|
21
|
+
"start": "yarn run dts watch --noClean",
|
|
22
|
+
"build": "yarn run dts build && cp src/*.scss dist",
|
|
23
|
+
"lint": "yarn run dts lint"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": ">=16.8.0",
|
|
@@ -30,5 +30,8 @@
|
|
|
30
30
|
"react-polymorphic-types": "^1.1.0",
|
|
31
31
|
"tiny-warning": "^1.0.3"
|
|
32
32
|
},
|
|
33
|
-
"
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"dts-cli": "^1.1.6"
|
|
35
|
+
},
|
|
36
|
+
"gitHead": "89c8eee86c247794134c34484a205e0f7f65d0a5"
|
|
34
37
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [0.4.6-alpha.0](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.5...@entur/utils@0.4.6-alpha.0) (2022-10-20)
|
|
7
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
- **locale:** wip fix for locale not working ([0ff0912](https://bitbucket.org/enturas/design-system/commits/0ff0912405e015abb50c9cb6103c5f9827d8bd7b))
|
|
11
|
-
|
|
12
|
-
## [0.4.5](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.4...@entur/utils@0.4.5) (2022-08-31)
|
|
13
|
-
|
|
14
|
-
**Note:** Version bump only for package @entur/utils
|
|
15
|
-
|
|
16
|
-
## [0.4.4](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.3...@entur/utils@0.4.4) (2022-08-24)
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
- add parameter and return types ([861b878](https://bitbucket.org/enturas/design-system/commits/861b8782b1fae34242d64371a8af7887ac545df6))
|
|
21
|
-
|
|
22
|
-
## [0.4.3](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.2...@entur/utils@0.4.3) (2022-02-09)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @entur/utils
|
|
25
|
-
|
|
26
|
-
## [0.4.2](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.1...@entur/utils@0.4.2) (2021-06-25)
|
|
27
|
-
|
|
28
|
-
### Bug Fixes
|
|
29
|
-
|
|
30
|
-
- update dependencies ([80b9175](https://bitbucket.org/enturas/design-system/commits/80b9175b193d1154aa4ee6977c765e2c19b73415))
|
|
31
|
-
|
|
32
|
-
## [0.4.1](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.4.0...@entur/utils@0.4.1) (2021-02-17)
|
|
33
|
-
|
|
34
|
-
### Bug Fixes
|
|
35
|
-
|
|
36
|
-
- **dependency:** remove old polymorphism from dependencies ([c170645](https://bitbucket.org/enturas/design-system/commits/c1706459b36048952e9ca14cc51148054bf12bdc))
|
|
37
|
-
- **polymorphic:** add new polymorphism dependency ([7bf79cc](https://bitbucket.org/enturas/design-system/commits/7bf79cca1feccf7cfee11fc9f8ff1e5f1025a47f))
|
|
38
|
-
- **polymorphic:** remove old dependency as exports ([eb5f431](https://bitbucket.org/enturas/design-system/commits/eb5f43171cdc8099f9479bd6a7210c0a5fa2daa4))
|
|
39
|
-
|
|
40
|
-
# [0.4.0](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.3.0...@entur/utils@0.4.0) (2020-12-04)
|
|
41
|
-
|
|
42
|
-
### Features
|
|
43
|
-
|
|
44
|
-
- add polymorphic component dependecy as export ([5384642](https://bitbucket.org/enturas/design-system/commits/53846421f66f4b6193238d0d6cced8b09658d3b6))
|
|
45
|
-
|
|
46
|
-
# [0.3.0](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.9...@entur/utils@0.3.0) (2020-10-09)
|
|
47
|
-
|
|
48
|
-
### Features
|
|
49
|
-
|
|
50
|
-
- add useOnMount hook ([0f1fc26](https://bitbucket.org/enturas/design-system/commits/0f1fc2658a1263179be80b656828cf6373834702))
|
|
51
|
-
|
|
52
|
-
## [0.2.9](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.8...@entur/utils@0.2.9) (2020-06-17)
|
|
53
|
-
|
|
54
|
-
**Note:** Version bump only for package @entur/utils
|
|
55
|
-
|
|
56
|
-
## [0.2.8](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.7...@entur/utils@0.2.8) (2020-05-27)
|
|
57
|
-
|
|
58
|
-
**Note:** Version bump only for package @entur/utils
|
|
59
|
-
|
|
60
|
-
## [0.2.7](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.6...@entur/utils@0.2.7) (2020-05-26)
|
|
61
|
-
|
|
62
|
-
**Note:** Version bump only for package @entur/utils
|
|
63
|
-
|
|
64
|
-
## [0.2.6](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.5...@entur/utils@0.2.6) (2020-05-20)
|
|
65
|
-
|
|
66
|
-
**Note:** Version bump only for package @entur/utils
|
|
67
|
-
|
|
68
|
-
## [0.2.5](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.4...@entur/utils@0.2.5) (2020-04-27)
|
|
69
|
-
|
|
70
|
-
**Note:** Version bump only for package @entur/utils
|
|
71
|
-
|
|
72
|
-
## [0.2.4](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.3...@entur/utils@0.2.4) (2020-04-23)
|
|
73
|
-
|
|
74
|
-
**Note:** Version bump only for package @entur/utils
|
|
75
|
-
|
|
76
|
-
## [0.2.3](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.2...@entur/utils@0.2.3) (2020-02-05)
|
|
77
|
-
|
|
78
|
-
### Bug Fixes
|
|
79
|
-
|
|
80
|
-
- add new breakpoint mixin for new breakpoint token ([eb6cc7a](https://bitbucket.org/enturas/design-system/commits/eb6cc7a63ff345e9835ab209f035dd2d615d20f8))
|
|
81
|
-
- remove test-files from build process ([e0b24af](https://bitbucket.org/enturas/design-system/commits/e0b24af05d5c2ad8de4ae587d83c389495235890))
|
|
82
|
-
|
|
83
|
-
## [0.2.2](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.1...@entur/utils@0.2.2) (2020-01-27)
|
|
84
|
-
|
|
85
|
-
### Bug Fixes
|
|
86
|
-
|
|
87
|
-
- **types:** place types in the correct place ([acace09](https://bitbucket.org/enturas/design-system/commits/acace09ec0e258c5cff3a65e13ab29d6603780d9))
|
|
88
|
-
|
|
89
|
-
## [0.2.1](https://bitbucket.org/enturas/design-system/compare/@entur/utils@0.2.0...@entur/utils@0.2.1) (2020-01-14)
|
|
90
|
-
|
|
91
|
-
**Note:** Version bump only for package @entur/utils
|
|
92
|
-
|
|
93
|
-
# 0.2.0 (2020-01-08)
|
|
94
|
-
|
|
95
|
-
### Features
|
|
96
|
-
|
|
97
|
-
- add function to warn about missing style imports ([535e06c](https://bitbucket.org/enturas/design-system/commits/535e06c627708c3c69b002ceacaeba36950915be))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ConditionalWrapper: ({ condition, wrapper, children }: any) => any;
|