@warp-ds/elements 2.0.0-next.1 → 2.0.0-next.3
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/api.js +3 -6
- package/dist/api.js.map +1 -1
- package/dist/index.js +290 -320
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/index.d.ts +1 -1
- package/dist/packages/affix/index.js +35 -49
- package/dist/packages/affix/index.js.map +3 -3
- package/dist/packages/alert/index.js +39 -55
- package/dist/packages/alert/index.js.map +3 -3
- package/dist/packages/attention/index.js +140 -126
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/locales/da/messages.d.mts +1 -0
- package/dist/packages/badge/index.js +3 -7
- package/dist/packages/badge/index.js.map +2 -2
- package/dist/packages/box/index.d.ts +1 -1
- package/dist/packages/box/index.js +2 -5
- package/dist/packages/box/index.js.map +2 -2
- package/dist/packages/breadcrumbs/index.js +56 -68
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.d.mts +1 -0
- package/dist/packages/broadcast/index.js +2 -6
- package/dist/packages/broadcast/index.js.map +1 -1
- package/dist/packages/button/index.js +56 -69
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.d.mts +1 -0
- package/dist/packages/card/index.d.ts +2 -2
- package/dist/packages/card/index.js +3 -7
- package/dist/packages/card/index.js.map +2 -2
- package/dist/packages/expandable/index.d.ts +2 -2
- package/dist/packages/expandable/index.js +52 -68
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/i18n.d.ts +4 -4
- package/dist/packages/modal/index.js +45 -69
- package/dist/packages/modal/index.js.map +3 -3
- package/dist/packages/modal/modal-header.d.ts +1 -1
- package/dist/packages/modal/modal-main.d.ts +3 -3
- package/dist/packages/pill/index.js +58 -71
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/locales/da/messages.d.mts +1 -0
- package/dist/packages/select/index.js +76 -104
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/locales/da/messages.d.mts +1 -0
- package/dist/packages/textfield/index.js +7 -15
- package/dist/packages/textfield/index.js.map +2 -2
- package/dist/packages/toast/api.d.ts +1 -1
- package/dist/packages/toast/index.js +88 -125
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/locales/da/messages.d.mts +1 -0
- package/dist/packages/toast/toast-container.d.ts +1 -1
- package/dist/packages/toast/toast.d.ts +2 -2
- package/dist/packages/utils/index.d.ts +1 -1
- package/package.json +27 -28
package/dist/api.js
CHANGED
|
@@ -20,8 +20,7 @@ var windowExists = typeof window !== "undefined";
|
|
|
20
20
|
|
|
21
21
|
// packages/toast/api.js
|
|
22
22
|
function toast(message, options) {
|
|
23
|
-
if (!windowExists)
|
|
24
|
-
return;
|
|
23
|
+
if (!windowExists) return;
|
|
25
24
|
const toast2 = customElements.get("w-toast-container").init();
|
|
26
25
|
const data = __spreadValues({
|
|
27
26
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
|
|
@@ -33,14 +32,12 @@ function toast(message, options) {
|
|
|
33
32
|
return data;
|
|
34
33
|
}
|
|
35
34
|
function removeToast(id) {
|
|
36
|
-
if (!windowExists)
|
|
37
|
-
return;
|
|
35
|
+
if (!windowExists) return;
|
|
38
36
|
const toast2 = customElements.get("w-toast-container").init();
|
|
39
37
|
return toast2.del(id);
|
|
40
38
|
}
|
|
41
39
|
function updateToast(id, options) {
|
|
42
|
-
if (!windowExists)
|
|
43
|
-
return;
|
|
40
|
+
if (!windowExists) return;
|
|
44
41
|
const toast2 = customElements.get("w-toast-container").init();
|
|
45
42
|
toast2.set(__spreadValues(__spreadValues({}, toast2.get(id)), options));
|
|
46
43
|
return toast2.get(id);
|
package/dist/api.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../packages/utils/window-exists.js", "../packages/toast/api.js"],
|
|
4
4
|
"sourcesContent": ["export const windowExists = typeof window !== 'undefined';\n", "import { windowExists } from '../utils/window-exists';\n\n/**\n * Toast helper function options\n * @typedef {Object} ToastOptions\n * @property {(number|string)} [id] Custom identifier\n * @property {('success'|'error'|'warning')} [type] Type of toast\n * @property {String} [text] The toast message. Only needed when updating text on existing toast\n * @property {(number|string)} [duration] Duration of toast in milliseconds. Defaults to 5000. For accessibility reasons, toasts should never be interactive and therefore need to auto remove. If you must disable auto remove, set duration to Number.POSITIVE_INFINITY.\n * @property {Boolean} [canclose] Whether the toast can be dismissed. Defaults to false. WARNING! For accessibility reasons, toasts should not be interactive and canclose should always be false. If the toast absolutely must be dismissable, set this to true.\n */\n\n/**\n * Creates a new toast\n * @param {String} message Message\n * @param {ToastOptions?} options Toast options\n * @returns {ToastOptions} Toast details\n */\nexport function toast(message, options) {\n if (!windowExists) return;\n const toast = customElements.get('w-toast-container').init();\n\n const data = {\n id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),\n text: message,\n duration: 5000,\n type: 'success',\n ...options,\n };\n\n toast.set(data);\n return data;\n}\n\n/**\n * Remove an existing toast\n * @param {String|Number} id Toast identifier\n * @return {Promise<Boolean>} Resolves to true if deleted, false if not found\n */\nexport function removeToast(id) {\n if (!windowExists) return;\n const toast = customElements.get('w-toast-container').init();\n return toast.del(id);\n}\n\n/**\n * Update an existing toast\n * @param {String|Number} id Toast identifier\n * @param {ToastOptions?} options Toast options\n * @returns {WarpToastContainer} Toast details\n */\nexport function updateToast(id, options) {\n if (!windowExists) return;\n const toast = customElements.get('w-toast-container').init();\n toast.set({ ...toast.get(id), ...options });\n return toast.get(id);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAO,IAAM,eAAe,OAAO,WAAW;;;ACkBvC,SAAS,MAAM,SAAS,SAAS;AACtC,MAAI,CAAC;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAO,IAAM,eAAe,OAAO,WAAW;;;ACkBvC,SAAS,MAAM,SAAS,SAAS;AACtC,MAAI,CAAC,aAAc;AACnB,QAAMA,SAAQ,eAAe,IAAI,mBAAmB,EAAE,KAAK;AAE3D,QAAM,OAAO;AAAA,IACX,IAAI,KAAK,IAAI,EAAE,SAAS,EAAE,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC;AAAA,IACnE,MAAM;AAAA,IACN,UAAU;AAAA,IACV,MAAM;AAAA,KACH;AAGL,EAAAA,OAAM,IAAI,IAAI;AACd,SAAO;AACT;AAOO,SAAS,YAAY,IAAI;AAC9B,MAAI,CAAC,aAAc;AACnB,QAAMA,SAAQ,eAAe,IAAI,mBAAmB,EAAE,KAAK;AAC3D,SAAOA,OAAM,IAAI,EAAE;AACrB;AAQO,SAAS,YAAY,IAAI,SAAS;AACvC,MAAI,CAAC,aAAc;AACnB,QAAMA,SAAQ,eAAe,IAAI,mBAAmB,EAAE,KAAK;AAC3D,EAAAA,OAAM,IAAI,kCAAKA,OAAM,IAAI,EAAE,IAAM,QAAS;AAC1C,SAAOA,OAAM,IAAI,EAAE;AACrB;",
|
|
6
6
|
"names": ["toast"]
|
|
7
7
|
}
|