@warp-ds/elements 2.2.0-next.4 → 2.2.0-next.5
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/README.md +27 -17
- package/dist/.storybook/utilities.d.ts +28 -0
- package/dist/api.js +1 -49
- package/dist/api.js.map +2 -2
- package/dist/custom-elements.json +2799 -313
- package/dist/index.css +2 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +415 -7146
- package/dist/index.js.map +4 -4
- package/dist/packages/affix/affix.stories.d.ts +10 -0
- package/dist/packages/affix/affix.test.d.ts +1 -0
- package/dist/packages/affix/index.d.ts +52 -24
- package/dist/packages/affix/index.js +2448 -2241
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/affix/react.d.ts +2 -0
- package/dist/packages/affix/react.js +2482 -0
- package/dist/packages/affix/react.js.map +7 -0
- package/dist/packages/affix/styles.d.ts +1 -0
- package/dist/packages/alert/alert.stories.d.ts +15 -0
- package/dist/packages/alert/index.d.ts +16 -1
- package/dist/packages/alert/index.js +2472 -0
- package/dist/packages/alert/index.js.map +7 -0
- package/dist/packages/alert/react.d.ts +2 -0
- package/dist/packages/alert/react.js +2492 -0
- package/dist/packages/alert/react.js.map +7 -0
- package/dist/packages/alert/styles.d.ts +1 -0
- package/dist/packages/attention/attention.stories.d.ts +10 -0
- package/dist/packages/attention/index.d.ts +14 -1
- package/dist/packages/attention/index.js +17 -3977
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/badge/badge.stories.d.ts +17 -0
- package/dist/packages/badge/badge.test.d.ts +1 -0
- package/dist/packages/badge/index.d.ts +17 -12
- package/dist/packages/badge/index.js +2441 -300
- package/dist/packages/badge/index.js.map +4 -4
- package/dist/packages/badge/react.d.ts +2 -0
- package/dist/packages/badge/react.js +2465 -0
- package/dist/packages/badge/react.js.map +7 -0
- package/dist/packages/badge/styles.d.ts +1 -0
- package/dist/packages/box/box.stories.d.ts +14 -0
- package/dist/packages/box/box.test.d.ts +1 -0
- package/dist/packages/box/index.d.ts +21 -21
- package/dist/packages/box/index.js +2441 -304
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/box/react.d.ts +2 -0
- package/dist/packages/box/react.js +2465 -0
- package/dist/packages/box/react.js.map +7 -0
- package/dist/packages/box/slot.test.d.ts +1 -0
- package/dist/packages/box/styles.d.ts +1 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +12 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -0
- package/dist/packages/breadcrumbs/index.d.ts +24 -16
- package/dist/packages/breadcrumbs/index.js +2402 -2049
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/react.d.ts +2 -0
- package/dist/packages/breadcrumbs/react.js +2475 -0
- package/dist/packages/breadcrumbs/react.js.map +7 -0
- package/dist/packages/breadcrumbs/styles.d.ts +1 -0
- package/dist/packages/button/button.stories.d.ts +21 -0
- package/dist/packages/button/index.d.ts +82 -7
- package/dist/packages/button/index.js +2460 -0
- package/dist/packages/button/index.js.map +7 -0
- package/dist/packages/button/react.d.ts +2 -0
- package/dist/packages/button/react.js +2480 -0
- package/dist/packages/button/react.js.map +7 -0
- package/dist/packages/button/styles.d.ts +1 -0
- package/dist/packages/card/card.stories.d.ts +15 -0
- package/dist/packages/card/index.d.ts +27 -1
- package/dist/packages/card/index.js +2467 -0
- package/dist/packages/card/index.js.map +7 -0
- package/dist/packages/card/react.d.ts +2 -0
- package/dist/packages/card/react.js +2487 -0
- package/dist/packages/card/react.js.map +7 -0
- package/dist/packages/card/styles.d.ts +1 -0
- package/dist/packages/dead-toggle/dead-toggle.stories.d.ts +10 -0
- package/dist/packages/dead-toggle/dead-toggle.test.d.ts +1 -0
- package/dist/packages/dead-toggle/index.d.ts +21 -0
- package/dist/packages/dead-toggle/index.js +2487 -0
- package/dist/packages/dead-toggle/index.js.map +7 -0
- package/dist/packages/dead-toggle/react.d.ts +2 -0
- package/dist/packages/dead-toggle/react.js +2507 -0
- package/dist/packages/dead-toggle/react.js.map +7 -0
- package/dist/packages/expandable/expandable.stories.d.ts +19 -0
- package/dist/packages/expandable/index.d.ts +43 -0
- package/dist/packages/expandable/index.js +2475 -0
- package/dist/packages/expandable/index.js.map +7 -0
- package/dist/packages/expandable/react.d.ts +2 -0
- package/dist/packages/expandable/react.js +2495 -0
- package/dist/packages/expandable/react.js.map +7 -0
- package/dist/packages/expandable/styles.d.ts +1 -0
- package/dist/packages/modal/index.d.ts +5 -6
- package/dist/packages/modal/index.js +2568 -2445
- package/dist/packages/modal/index.js.map +4 -4
- package/dist/packages/modal/modal-footer.d.ts +17 -10
- package/dist/packages/modal/modal-header.d.ts +20 -13
- package/dist/packages/modal/modal-main.d.ts +18 -7
- package/dist/packages/modal/modal.stories.d.ts +19 -0
- package/dist/packages/modal/react.d.ts +4 -0
- package/dist/packages/modal/react.js +2754 -0
- package/dist/packages/modal/react.js.map +7 -0
- package/dist/packages/modal/util.d.ts +7 -17
- package/dist/packages/pagination/index.d.ts +34 -0
- package/dist/packages/pagination/index.js +2486 -0
- package/dist/packages/pagination/index.js.map +7 -0
- package/dist/packages/pagination/locales/da/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/en/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/fi/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/nb/messages.d.mts +1 -0
- package/dist/packages/pagination/locales/sv/messages.d.mts +1 -0
- package/dist/packages/pagination/pagination.stories.d.ts +14 -0
- package/dist/packages/pagination/pagination.test.d.ts +1 -0
- package/dist/packages/pagination/react.d.ts +2 -0
- package/dist/packages/pagination/react.js +2506 -0
- package/dist/packages/pagination/react.js.map +7 -0
- package/dist/packages/pagination/styles.d.ts +1 -0
- package/dist/packages/pill/index.d.ts +44 -23
- package/dist/packages/pill/index.js +2408 -2173
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/pill.stories.d.ts +12 -0
- package/dist/packages/pill/pill.test.d.ts +1 -0
- package/dist/packages/pill/styles.d.ts +1 -0
- package/dist/packages/rip-and-tear-checkbox/checkbox.d.ts +64 -0
- package/dist/packages/rip-and-tear-checkbox/index.css +2 -0
- package/dist/packages/rip-and-tear-checkbox/index.css.map +7 -0
- package/dist/packages/rip-and-tear-checkbox/index.d.ts +6 -0
- package/dist/packages/rip-and-tear-checkbox/index.js +36 -0
- package/dist/packages/rip-and-tear-checkbox/index.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/base-element.d.ts +46 -0
- package/dist/packages/rip-and-tear-radio/custom-error-validator.d.ts +6 -0
- package/dist/packages/rip-and-tear-radio/form-associated-element.d.ts +103 -0
- package/dist/packages/rip-and-tear-radio/index.css +2 -0
- package/dist/packages/rip-and-tear-radio/index.css.map +7 -0
- package/dist/packages/rip-and-tear-radio/index.d.ts +8 -0
- package/dist/packages/rip-and-tear-radio/index.js +34 -0
- package/dist/packages/rip-and-tear-radio/index.js.map +7 -0
- package/dist/packages/rip-and-tear-radio/invalid.d.ts +8 -0
- package/dist/packages/rip-and-tear-radio/math.d.ts +1 -0
- package/dist/packages/rip-and-tear-radio/radio-group.d.ts +72 -0
- package/dist/packages/rip-and-tear-radio/radio.d.ts +38 -0
- package/dist/packages/rip-and-tear-radio/required-validator.d.ts +11 -0
- package/dist/packages/rip-and-tear-radio/slot.d.ts +20 -0
- package/dist/packages/rip-and-tear-radio/watch.d.ts +26 -0
- package/dist/packages/select/index.d.ts +59 -58
- package/dist/packages/select/index.js +2421 -2531
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/react.d.ts +2 -0
- package/dist/packages/select/react.js +2494 -0
- package/dist/packages/select/react.js.map +7 -0
- package/dist/packages/select/select.stories.d.ts +10 -0
- package/dist/packages/select/select.test.d.ts +1 -0
- package/dist/packages/select/styles.d.ts +1 -0
- package/dist/packages/textfield/index.d.ts +70 -72
- package/dist/packages/textfield/index.js +2455 -701
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/textfield/react.d.ts +2 -0
- package/dist/packages/textfield/react.js +2490 -0
- package/dist/packages/textfield/react.js.map +7 -0
- package/dist/packages/textfield/styles.d.ts +1 -0
- package/dist/packages/textfield/textfield.stories.d.ts +17 -0
- package/dist/packages/textfield/textfield.test.d.ts +1 -0
- package/dist/packages/toast/index.js +24 -2782
- package/dist/packages/toast/index.js.map +4 -4
- package/dist/packages/toast/toast-container.d.ts +16 -0
- package/dist/packages/toast/toast.d.ts +20 -0
- package/dist/packages/toast/toast.stories.d.ts +12 -0
- package/dist/packages/utils/index.d.ts +1 -1
- package/dist/packages/utils/unstyled-heading.d.ts +1 -1
- package/dist/setup-tests.d.ts +1 -0
- package/dist/vscode.css-custom-data.json +6 -0
- package/dist/vscode.html-custom-data.json +313 -0
- package/dist/web-types.json +707 -0
- package/package.json +47 -13
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ This project builds both the whole Elements package and separate component packa
|
|
|
38
38
|
```js
|
|
39
39
|
import '@warp-ds/elements';
|
|
40
40
|
```
|
|
41
|
-
or a specific component:
|
|
41
|
+
or a specific component:
|
|
42
42
|
```js
|
|
43
43
|
import '@warp-ds/elements/components/toast';
|
|
44
44
|
```
|
|
@@ -48,30 +48,40 @@ import '@warp-ds/elements/components/toast';
|
|
|
48
48
|
For information on the components available in the package and how to use them,
|
|
49
49
|
see the [Warp Design System documentation](https://warp-ds.github.io/tech-docs/).
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
This project is continuously published to [NPM](https://www.npmjs.com/package/@warp-ds/elements) and [Eik](https://assets.finn.no/pkg/@warp-ds/elements) using a `next` tag (e.g. `1.1.0-next.1`).
|
|
54
|
-
Anyone needing to use the latest changes of this package can point to the `next` version while waiting for the stable release.
|
|
55
|
-
|
|
56
|
-
## Changelog
|
|
51
|
+
### Editor integration
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
#### Visual Studio Code
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
This module includes [Custom HTML and CSS data for Visual Studio Code](https://code.visualstudio.com/blogs/2020/02/24/custom-data-format).
|
|
61
56
|
|
|
62
|
-
|
|
57
|
+
Add this to your `settings.json` and restart VS Code to get IntelliSense and inline documentation for Warp elements.
|
|
63
58
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"html.customData": [
|
|
62
|
+
"./node_modules/@warp-ds/elements/dist/vscode.html-custom-data.json"
|
|
63
|
+
],
|
|
64
|
+
"css.customData": [
|
|
65
|
+
"./node_modules/@warp-ds/elements/dist/vscode.css-custom-data.json"
|
|
69
66
|
]
|
|
67
|
+
}
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
#### JetBrains products
|
|
71
|
+
|
|
72
|
+
We ship `web-types.json` which should get picked up automatically by JetBrains IDEA and similar products.
|
|
73
|
+
|
|
74
|
+
You should see code completions and inline docs for Warp elements when writing HTML.
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
|
|
77
|
+
## Releases
|
|
78
|
+
|
|
79
|
+
This project is continuously published to [NPM](https://www.npmjs.com/package/@warp-ds/elements) and [Eik](https://assets.finn.no/pkg/@warp-ds/elements) using a `next` tag (e.g. `1.1.0-next.1`).
|
|
80
|
+
Anyone needing to use the latest changes of this package can point to the `next` version while waiting for the stable release.
|
|
81
|
+
|
|
82
|
+
## Changelog
|
|
83
|
+
|
|
84
|
+
Detailed changes for each release can be found in the [CHANGELOG](CHANGELOG.md) file.
|
|
75
85
|
|
|
76
86
|
## License
|
|
77
87
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Massages storybook args before being spread to HTML attributes.
|
|
3
|
+
*
|
|
4
|
+
* - Empty strings are treated as not set.
|
|
5
|
+
* - Boolean false don't get set.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { html } from 'lit';
|
|
10
|
+
* import { spread } from '@open-wc/lit-helpers';
|
|
11
|
+
* import { prespread } from '../../.storybook/utilities.js';
|
|
12
|
+
*
|
|
13
|
+
* type Args = {
|
|
14
|
+
* required: boolean;
|
|
15
|
+
* };
|
|
16
|
+
*
|
|
17
|
+
* const meta: Meta<Args> = {
|
|
18
|
+
* component: 'w-component',
|
|
19
|
+
* render(args) {
|
|
20
|
+
* return html`<w-component ${spread(prespread(args))}></w-component>`;
|
|
21
|
+
* },
|
|
22
|
+
* argTypes: {
|
|
23
|
+
* required: { type: 'boolean' },
|
|
24
|
+
* },
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function prespread(args: Record<string, unknown>): Record<string, unknown>;
|
package/dist/api.js
CHANGED
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// packages/utils/window-exists.js
|
|
19
|
-
var windowExists = typeof window !== "undefined";
|
|
20
|
-
|
|
21
|
-
// packages/toast/api.js
|
|
22
|
-
function toast(message, options) {
|
|
23
|
-
if (!windowExists) return;
|
|
24
|
-
const toast2 = customElements.get("w-toast-container").init();
|
|
25
|
-
const data = __spreadValues({
|
|
26
|
-
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 5),
|
|
27
|
-
text: message,
|
|
28
|
-
duration: 5e3,
|
|
29
|
-
type: "success"
|
|
30
|
-
}, options);
|
|
31
|
-
toast2.set(data);
|
|
32
|
-
return data;
|
|
33
|
-
}
|
|
34
|
-
function removeToast(id) {
|
|
35
|
-
if (!windowExists) return;
|
|
36
|
-
const toast2 = customElements.get("w-toast-container").init();
|
|
37
|
-
return toast2.del(id);
|
|
38
|
-
}
|
|
39
|
-
function updateToast(id, options) {
|
|
40
|
-
if (!windowExists) return;
|
|
41
|
-
const toast2 = customElements.get("w-toast-container").init();
|
|
42
|
-
toast2.set(__spreadValues(__spreadValues({}, toast2.get(id)), options));
|
|
43
|
-
return toast2.get(id);
|
|
44
|
-
}
|
|
45
|
-
export {
|
|
46
|
-
removeToast,
|
|
47
|
-
toast,
|
|
48
|
-
updateToast
|
|
49
|
-
};
|
|
1
|
+
var e=typeof window!="undefined";function a(t,n){if(!e)return;let o=customElements.get("w-toast-container").init(),s={id:Date.now().toString(36)+Math.random().toString(36).slice(2,5),text:t,duration:5e3,type:"success",...n};return o.set(s),s}function c(t){return e?customElements.get("w-toast-container").init().del(t):void 0}function u(t,n){if(!e)return;let o=customElements.get("w-toast-container").init();return o.set({...o.get(t),...n}),o.get(t)}export{c as removeToast,a as toast,u as updateToast};
|
|
50
2
|
//# sourceMappingURL=api.js.map
|
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": "
|
|
6
|
-
"names": ["toast"]
|
|
5
|
+
"mappings": "AAAO,IAAMA,EAAe,OAAO,QAAW,YCkBvC,SAASC,EAAMC,EAASC,EAAS,CACtC,GAAI,CAACC,EAAc,OACnB,IAAMH,EAAQ,eAAe,IAAI,mBAAmB,EAAE,KAAK,EAErDI,EAAO,CACX,GAAI,KAAK,IAAI,EAAE,SAAS,EAAE,EAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAG,CAAC,EACnE,KAAMH,EACN,SAAU,IACV,KAAM,UACN,GAAGC,CACL,EAEA,OAAAF,EAAM,IAAII,CAAI,EACPA,CACT,CAOO,SAASC,EAAYC,EAAI,CAC9B,OAAKH,EACS,eAAe,IAAI,mBAAmB,EAAE,KAAK,EAC9C,IAAIG,CAAE,EAFA,MAGrB,CAQO,SAASC,EAAYD,EAAIJ,EAAS,CACvC,GAAI,CAACC,EAAc,OACnB,IAAMH,EAAQ,eAAe,IAAI,mBAAmB,EAAE,KAAK,EAC3D,OAAAA,EAAM,IAAI,CAAE,GAAGA,EAAM,IAAIM,CAAE,EAAG,GAAGJ,CAAQ,CAAC,EACnCF,EAAM,IAAIM,CAAE,CACrB",
|
|
6
|
+
"names": ["windowExists", "toast", "message", "options", "windowExists", "data", "removeToast", "id", "updateToast"]
|
|
7
7
|
}
|