@warp-ds/elements 2.2.0-next.3 → 2.2.0-next.30
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 +217 -28
- package/dist/.storybook/utilities.d.ts +28 -0
- package/dist/.storybook/utilities.js +52 -0
- package/dist/api.js +1 -49
- package/dist/api.js.map +4 -4
- package/dist/custom-elements.json +3059 -0
- package/dist/index.d.ts +942 -18
- package/dist/packages/affix/affix.react.stories.d.ts +9 -0
- package/dist/packages/affix/affix.react.stories.js +10 -0
- package/dist/packages/affix/affix.stories.d.ts +10 -0
- package/dist/packages/affix/affix.stories.js +25 -0
- package/dist/packages/affix/affix.test.d.ts +1 -0
- package/dist/packages/affix/affix.test.js +9 -0
- package/dist/packages/affix/index.d.ts +47 -24
- package/dist/packages/affix/index.js +2448 -2240
- package/dist/packages/affix/index.js.map +4 -4
- package/dist/packages/affix/react.d.ts +2 -0
- package/dist/packages/affix/react.js +15 -0
- package/dist/packages/affix/styles.d.ts +1 -0
- package/dist/packages/affix/styles.js +2 -0
- package/dist/packages/alert/alert.react.stories.d.ts +13 -0
- package/dist/packages/alert/alert.react.stories.js +44 -0
- package/dist/packages/alert/alert.stories.d.ts +15 -0
- package/dist/packages/alert/alert.stories.js +68 -0
- package/dist/packages/alert/alert.test.d.ts +1 -0
- package/dist/packages/alert/alert.test.js +18 -0
- package/dist/packages/alert/index.d.ts +23 -17
- package/dist/packages/alert/index.js +2452 -2446
- package/dist/packages/alert/index.js.map +4 -4
- package/dist/packages/alert/react.d.ts +2 -0
- package/dist/packages/alert/react.js +11 -0
- package/dist/packages/alert/styles.d.ts +1 -0
- package/dist/packages/alert/styles.js +2 -0
- package/dist/packages/attention/attention.react.stories.d.ts +15 -0
- package/dist/packages/attention/attention.react.stories.js +92 -0
- package/dist/packages/attention/attention.stories.d.ts +16 -0
- package/dist/packages/attention/attention.stories.js +180 -0
- package/dist/packages/attention/attention.test.d.ts +1 -0
- package/dist/packages/attention/attention.test.js +11 -0
- package/dist/packages/attention/index.d.ts +61 -89
- package/dist/packages/attention/index.js +3530 -3924
- package/dist/packages/attention/index.js.map +4 -4
- package/dist/packages/attention/layout-styles.d.ts +1 -0
- package/dist/packages/attention/layout-styles.js +905 -0
- package/dist/packages/attention/locales/da/messages.mjs +1 -0
- package/dist/packages/attention/locales/en/messages.mjs +1 -0
- package/dist/packages/attention/locales/fi/messages.mjs +1 -0
- package/dist/packages/attention/locales/nb/messages.mjs +1 -0
- package/dist/packages/attention/locales/sv/messages.mjs +1 -0
- package/dist/packages/attention/react.d.ts +15 -0
- package/dist/packages/attention/react.js +17 -0
- package/dist/packages/attention/styles.d.ts +1 -0
- package/dist/packages/attention/styles.js +2 -0
- package/dist/packages/badge/badge.react.stories.d.ts +18 -0
- package/dist/packages/badge/badge.react.stories.js +60 -0
- package/dist/packages/badge/badge.stories.d.ts +17 -0
- package/dist/packages/badge/badge.stories.js +68 -0
- package/dist/packages/badge/badge.test.d.ts +1 -0
- package/dist/packages/badge/badge.test.js +9 -0
- package/dist/packages/badge/index.d.ts +12 -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 +11 -0
- package/dist/packages/badge/styles.d.ts +1 -0
- package/dist/packages/badge/styles.js +2 -0
- package/dist/packages/box/box.react.stories.d.ts +15 -0
- package/dist/packages/box/box.react.stories.js +45 -0
- package/dist/packages/box/box.stories.d.ts +14 -0
- package/dist/packages/box/box.stories.js +59 -0
- package/dist/packages/box/box.test.d.ts +1 -0
- package/dist/packages/box/box.test.js +9 -0
- package/dist/packages/box/index.d.ts +16 -21
- package/dist/packages/box/index.js +2443 -299
- package/dist/packages/box/index.js.map +4 -4
- package/dist/packages/box/react.d.ts +2 -0
- package/dist/packages/box/react.js +11 -0
- package/dist/packages/box/slot.test.d.ts +1 -0
- package/dist/packages/box/slot.test.js +9 -0
- package/dist/packages/box/styles.d.ts +1 -0
- package/dist/packages/box/styles.js +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.d.ts +13 -0
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +40 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +12 -0
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +60 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.d.ts +1 -0
- package/dist/packages/breadcrumbs/breadcrumbs.test.js +16 -0
- package/dist/packages/breadcrumbs/index.d.ts +19 -16
- package/dist/packages/breadcrumbs/index.js +2402 -2051
- package/dist/packages/breadcrumbs/index.js.map +4 -4
- package/dist/packages/breadcrumbs/locales/da/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/en/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/fi/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/nb/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/locales/sv/messages.mjs +1 -0
- package/dist/packages/breadcrumbs/react.d.ts +2 -0
- package/dist/packages/breadcrumbs/react.js +11 -0
- package/dist/packages/breadcrumbs/styles.d.ts +1 -0
- package/dist/packages/breadcrumbs/styles.js +2 -0
- package/dist/packages/button/button.react.stories.d.ts +22 -0
- package/dist/packages/button/button.react.stories.js +102 -0
- package/dist/packages/button/button.stories.d.ts +25 -0
- package/dist/packages/button/button.stories.js +151 -0
- package/dist/packages/button/button.test.d.ts +1 -1
- package/dist/packages/button/button.test.js +25 -0
- package/dist/packages/button/index.d.ts +83 -9
- package/dist/packages/button/index.js +2614 -2422
- package/dist/packages/button/index.js.map +4 -4
- package/dist/packages/button/locales/da/messages.mjs +1 -0
- package/dist/packages/button/locales/en/messages.mjs +1 -0
- package/dist/packages/button/locales/fi/messages.mjs +1 -0
- package/dist/packages/button/locales/nb/messages.mjs +1 -0
- package/dist/packages/button/locales/sv/messages.mjs +1 -0
- package/dist/packages/button/react.d.ts +2 -0
- package/dist/packages/button/react.js +11 -0
- package/dist/packages/button/styles.d.ts +1 -0
- package/dist/packages/button/styles.js +2 -0
- package/dist/packages/card/card.react.stories.d.ts +16 -0
- package/dist/packages/card/card.react.stories.js +63 -0
- package/dist/packages/card/card.stories.d.ts +15 -0
- package/dist/packages/card/card.stories.js +82 -0
- package/dist/packages/card/card.test.d.ts +1 -0
- package/dist/packages/card/card.test.js +9 -0
- package/dist/packages/card/index.d.ts +27 -16
- package/dist/packages/card/index.js +2403 -2067
- package/dist/packages/card/index.js.map +4 -4
- package/dist/packages/card/locales/da/messages.mjs +1 -0
- package/dist/packages/card/locales/en/messages.mjs +1 -0
- package/dist/packages/card/locales/fi/messages.mjs +1 -0
- package/dist/packages/card/locales/nb/messages.mjs +1 -0
- package/dist/packages/card/locales/sv/messages.mjs +1 -0
- package/dist/packages/card/react.d.ts +2 -0
- package/dist/packages/card/react.js +11 -0
- package/dist/packages/card/styles.d.ts +1 -0
- package/dist/packages/card/styles.js +2 -0
- package/dist/packages/expandable/expandable.react.stories.d.ts +18 -0
- package/dist/packages/expandable/expandable.react.stories.js +103 -0
- package/dist/packages/expandable/expandable.stories.d.ts +19 -0
- package/dist/packages/expandable/expandable.stories.js +132 -0
- package/dist/packages/expandable/expandable.test.d.ts +1 -0
- package/dist/packages/expandable/expandable.test.js +24 -0
- package/dist/packages/expandable/index.d.ts +52 -50
- package/dist/packages/expandable/index.js +2424 -2286
- package/dist/packages/expandable/index.js.map +4 -4
- package/dist/packages/expandable/react.d.ts +2 -0
- package/dist/packages/expandable/react.js +11 -0
- package/dist/packages/expandable/styles.d.ts +1 -0
- package/dist/packages/expandable/styles.js +2 -0
- package/dist/packages/i18n.js +45 -0
- package/dist/packages/link/index.d.ts +34 -0
- package/dist/packages/link/index.js +99 -0
- package/dist/packages/link/styles.d.ts +1 -0
- package/dist/packages/link/styles.js +200 -0
- package/dist/packages/modal/index.d.ts +5 -6
- package/dist/packages/modal/index.js +5 -2611
- package/dist/packages/modal/locales/da/messages.mjs +1 -0
- package/dist/packages/modal/locales/en/messages.mjs +1 -0
- package/dist/packages/modal/locales/fi/messages.mjs +1 -0
- package/dist/packages/modal/locales/nb/messages.mjs +1 -0
- package/dist/packages/modal/locales/sv/messages.mjs +1 -0
- package/dist/packages/modal/modal-footer.d.ts +12 -10
- package/dist/packages/modal/modal-footer.js +2460 -0
- package/dist/packages/modal/modal-footer.js.map +7 -0
- package/dist/packages/modal/modal-header.d.ts +15 -13
- package/dist/packages/modal/modal-header.js +2567 -0
- package/dist/packages/modal/modal-header.js.map +7 -0
- package/dist/packages/modal/modal-main.d.ts +14 -8
- package/dist/packages/modal/modal-main.js +2572 -0
- package/dist/packages/modal/modal-main.js.map +7 -0
- package/dist/packages/modal/modal.react.stories.d.ts +14 -0
- package/dist/packages/modal/modal.react.stories.js +27 -0
- package/dist/packages/modal/modal.stories.d.ts +19 -0
- package/dist/packages/modal/modal.stories.js +254 -0
- package/dist/packages/modal/react.d.ts +12 -0
- package/dist/packages/modal/react.js +31 -0
- package/dist/packages/modal/util.d.ts +7 -17
- package/dist/packages/modal/util.js +21 -0
- package/dist/packages/pill/index.d.ts +39 -23
- package/dist/packages/pill/index.js +2408 -2175
- package/dist/packages/pill/index.js.map +4 -4
- package/dist/packages/pill/locales/da/messages.mjs +1 -0
- package/dist/packages/pill/locales/en/messages.mjs +1 -0
- package/dist/packages/pill/locales/fi/messages.mjs +1 -0
- package/dist/packages/pill/locales/nb/messages.mjs +1 -0
- package/dist/packages/pill/locales/sv/messages.mjs +1 -0
- package/dist/packages/pill/pill.react.stories.d.ts +23 -0
- package/dist/packages/pill/pill.react.stories.js +22 -0
- package/dist/packages/pill/pill.stories.d.ts +12 -0
- package/dist/packages/pill/pill.stories.js +33 -0
- package/dist/packages/pill/pill.test.d.ts +1 -0
- package/dist/packages/pill/pill.test.js +25 -0
- package/dist/packages/pill/react.d.ts +7 -0
- package/dist/packages/pill/react.js +17 -0
- package/dist/packages/pill/styles.d.ts +1 -0
- package/dist/packages/pill/styles.js +2 -0
- package/dist/packages/select/index.d.ts +56 -60
- package/dist/packages/select/index.js +2428 -2533
- package/dist/packages/select/index.js.map +4 -4
- package/dist/packages/select/locales/da/messages.mjs +1 -0
- package/dist/packages/select/locales/en/messages.mjs +1 -0
- package/dist/packages/select/locales/fi/messages.mjs +1 -0
- package/dist/packages/select/locales/nb/messages.mjs +1 -0
- package/dist/packages/select/locales/sv/messages.mjs +1 -0
- package/dist/packages/select/react.d.ts +6 -0
- package/dist/packages/select/react.js +20 -0
- package/dist/packages/select/select.react.stories.d.ts +18 -0
- package/dist/packages/select/select.react.stories.js +28 -0
- package/dist/packages/select/select.stories.d.ts +17 -0
- package/dist/packages/select/select.stories.js +100 -0
- package/dist/packages/select/select.test.d.ts +1 -0
- package/dist/packages/select/select.test.js +31 -0
- package/dist/packages/select/styles.d.ts +1 -0
- package/dist/packages/select/styles.js +2 -0
- package/dist/packages/styles.js +2442 -0
- package/dist/packages/textfield/index.d.ts +78 -74
- package/dist/packages/textfield/index.js +2522 -707
- package/dist/packages/textfield/index.js.map +4 -4
- package/dist/packages/textfield/react.d.ts +11 -0
- package/dist/packages/textfield/react.js +21 -0
- package/dist/packages/textfield/styles/w-textfield.styles.d.ts +1 -0
- package/dist/packages/textfield/styles/w-textfield.styles.js +55 -0
- package/dist/packages/textfield/styles.d.ts +1 -0
- package/dist/packages/textfield/styles.js +2 -0
- package/dist/packages/textfield/textfield.react.stories.d.ts +37 -0
- package/dist/packages/textfield/textfield.react.stories.js +88 -0
- package/dist/packages/textfield/textfield.stories.d.ts +18 -0
- package/dist/packages/textfield/textfield.stories.js +105 -0
- package/dist/packages/textfield/textfield.test.d.ts +2 -0
- package/dist/packages/textfield/textfield.test.js +68 -0
- package/dist/packages/toast/api.d.ts +4 -45
- package/dist/packages/toast/api.js +41 -0
- package/dist/packages/toast/index.d.ts +3 -3
- package/dist/packages/toast/index.js +3 -2804
- package/dist/packages/toast/locales/da/messages.mjs +1 -0
- package/dist/packages/toast/locales/en/messages.mjs +1 -0
- package/dist/packages/toast/locales/fi/messages.mjs +1 -0
- package/dist/packages/toast/locales/nb/messages.mjs +1 -0
- package/dist/packages/toast/locales/sv/messages.mjs +1 -0
- package/dist/packages/toast/styles.d.ts +1 -0
- package/dist/packages/toast/styles.js +2 -0
- package/dist/packages/toast/toast-container.d.ts +13 -63
- package/dist/packages/toast/toast-container.js +2458 -0
- package/dist/packages/toast/toast-container.js.map +7 -0
- package/dist/packages/toast/toast.d.ts +36 -29
- package/dist/packages/toast/toast.js +2466 -0
- package/dist/packages/toast/toast.js.map +7 -0
- package/dist/packages/toast/toast.stories.d.ts +12 -0
- package/dist/packages/toast/toast.stories.js +50 -0
- package/dist/packages/toast/types.d.ts +15 -0
- package/dist/packages/toast/types.js +1 -0
- package/dist/packages/utils/expand-transition.d.ts +3 -3
- package/dist/packages/utils/expand-transition.js +59 -0
- package/dist/packages/utils/index.d.ts +1 -1
- package/dist/packages/utils/index.js +37 -0
- package/dist/packages/utils/unstyled-heading.d.ts +3 -4
- package/dist/packages/utils/unstyled-heading.js +22 -0
- package/dist/packages/utils/window-exists.js +1 -0
- package/dist/setup-tests.d.ts +1 -0
- package/dist/setup-tests.js +1 -0
- package/dist/vscode.css-custom-data.json +6 -0
- package/dist/vscode.html-custom-data.json +296 -0
- package/dist/web-types.json +661 -0
- package/package.json +89 -36
- package/dist/index.js +0 -9820
- package/dist/index.js.map +0 -7
- package/dist/packages/modal/index.js.map +0 -7
- package/dist/packages/toast/index.js.map +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"attention.aria.callout\":[\"En grøn taleboble der introducerer noget nyt\"],\"attention.aria.close\":[\"Luk\"],\"attention.aria.highlight\":[\"En opmærksomhedsskabende taleboble med vigtig information\"],\"attention.aria.pointingDown\":[\"peger nedad\"],\"attention.aria.pointingLeft\":[\"peger til venstre\"],\"attention.aria.pointingRight\":[\"peger til højre\"],\"attention.aria.pointingUp\":[\"peger opad\"],\"attention.aria.popover\":[\"En hvid taleboble med mere information\"],\"attention.aria.tooltip\":[\"En sort taleboble med flere oplysninger\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"attention.aria.callout\":[\"A green speech bubble introducing something new\"],\"attention.aria.close\":[\"Close\"],\"attention.aria.highlight\":[\"An attention speech bubble with important information\"],\"attention.aria.pointingDown\":[\"pointing down\"],\"attention.aria.pointingLeft\":[\"pointing left\"],\"attention.aria.pointingRight\":[\"pointing right\"],\"attention.aria.pointingUp\":[\"pointing up\"],\"attention.aria.popover\":[\"A white speech bubble providing additional information\"],\"attention.aria.tooltip\":[\"A black speech bubble providing complementary information\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"attention.aria.callout\":[\"Vihreä puhekupla, joka esittelee jotain uutta\"],\"attention.aria.close\":[\"Sulje\"],\"attention.aria.highlight\":[\"Puhekupla, joka sisältää tärkeää tietoa\"],\"attention.aria.pointingDown\":[\"osoittaa alas\"],\"attention.aria.pointingLeft\":[\"osoittaa vasemmalle\"],\"attention.aria.pointingRight\":[\"osoittaa oikealle\"],\"attention.aria.pointingUp\":[\"osoittaa ylös\"],\"attention.aria.popover\":[\"Valkoinen puhekupla, joka tarjoaa lisätietoa\"],\"attention.aria.tooltip\":[\"Musta puhekupla, joka tarjoaa täydentävää tietoa\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"attention.aria.callout\":[\"Grønn taleboble som introduserer noe nytt\"],\"attention.aria.close\":[\"Lukk\"],\"attention.aria.highlight\":[\"En uthevet taleboble med viktig informasjon\"],\"attention.aria.pointingDown\":[\"peker ned\"],\"attention.aria.pointingLeft\":[\"peker til venstre\"],\"attention.aria.pointingRight\":[\"peker til høyre\"],\"attention.aria.pointingUp\":[\"peker opp\"],\"attention.aria.popover\":[\"En hvit taleboble som gir tilleggsinformasjon\"],\"attention.aria.tooltip\":[\"En svart taleboble som forklarer konteksten\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"attention.aria.callout\":[\"En grön pratbubbla som introducerar något nytt\"],\"attention.aria.close\":[\"Stäng\"],\"attention.aria.highlight\":[\"En pratbubbla med viktig information\"],\"attention.aria.pointingDown\":[\"pekar ned\"],\"attention.aria.pointingLeft\":[\"pekar vänster\"],\"attention.aria.pointingRight\":[\"pekar höger\"],\"attention.aria.pointingUp\":[\"pekar upp\"],\"attention.aria.popover\":[\"En vit pratbubbla som ger ytterligare information\"],\"attention.aria.tooltip\":[\"En svart pratbubbla som ger kompletterande information\"]}");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { WarpAttention } from './index';
|
|
4
|
+
declare class Component extends LitElement {
|
|
5
|
+
}
|
|
6
|
+
declare const BaseAttention: import("@lit/react").ReactWebComponent<Component, {
|
|
7
|
+
onClose: string;
|
|
8
|
+
onclose: string;
|
|
9
|
+
}>;
|
|
10
|
+
type BaseProps = React.ComponentProps<typeof BaseAttention>;
|
|
11
|
+
export type AttentionProps = Omit<BaseProps, 'popover'> & {
|
|
12
|
+
popover?: boolean;
|
|
13
|
+
} & Partial<Omit<WarpAttention, keyof HTMLElement>>;
|
|
14
|
+
export declare const Attention: React.FC<AttentionProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
// decouple from CDN by providing a dummy class
|
|
5
|
+
class Component extends LitElement {
|
|
6
|
+
}
|
|
7
|
+
const BaseAttention = createComponent({
|
|
8
|
+
tagName: 'w-attention',
|
|
9
|
+
elementClass: Component,
|
|
10
|
+
react: React,
|
|
11
|
+
events: {
|
|
12
|
+
onClose: 'close',
|
|
13
|
+
// additionally support React v19 syntax for CE events
|
|
14
|
+
onclose: 'close',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
export const Attention = BaseAttention;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hover\\:bg-clip-padding:hover{-webkit-background-clip:padding-box;background-clip:padding-box}.bg-transparent{background-color:#0000}.bg-\\[--w-color-button-primary-background\\]{background-color:var(--w-color-button-primary-background)}.bg-\\[--w-color-callout-background\\]{background-color:var(--w-color-callout-background)}.bg-\\[--w-s-color-surface-elevated-300\\]{background-color:var(--w-s-color-surface-elevated-300)}.hover\\:bg-\\[--w-color-button-pill-background-hover\\]:hover{background-color:var(--w-color-button-pill-background-hover)}.hover\\:bg-\\[--w-color-button-primary-background-hover\\]:hover{background-color:var(--w-color-button-primary-background-hover)}.active\\:bg-\\[--w-color-button-pill-background-active\\]:active{background-color:var(--w-color-button-pill-background-active)}.active\\:bg-\\[--w-color-button-primary-background-active\\]:active{background-color:var(--w-color-button-primary-background-active)}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-b-0{border-bottom-width:0}.border-r-0{border-right-width:0}.border-\\[--w-color-callout-border\\]{border-color:var(--w-color-callout-border)}.border-\\[--w-s-color-background-inverted\\]{border-color:var(--w-s-color-background-inverted)}.border-\\[--w-s-color-surface-elevated-300\\]{border-color:var(--w-s-color-surface-elevated-300)}.rounded-4{border-radius:4px}.rounded-8{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-tl-4{border-top-left-radius:4px}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.contents{display:contents}.hidden{display:none}.hover\\:underline:hover,.focus\\:underline:focus,.active\\:underline:active{text-decoration-line:underline}.focusable:focus{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:focus-visible{outline:2px solid var(--w-s-color-border-focus);outline-offset:var(--w-outline-offset,1px)}.focusable:not(:focus-visible){outline:none}.items-start{align-items:flex-start}.items-center{align-items:center}.-bottom-\\[8px\\]{bottom:-8px}.-left-\\[8px\\]{left:-8px}.-right-\\[8px\\]{right:-8px}.-top-\\[8px\\]{top:-8px}.justify-center{justify-content:center}.justify-self-end{justify-self:end}.absolute{position:absolute}.relative{position:relative}.static{position:static}.z-50{z-index:50}.s-bg{background-color:var(--w-s-color-background)}.s-bg-disabled{background-color:var(--w-s-color-background-disabled)}.s-bg-inverted{background-color:var(--w-s-color-background-inverted)}.s-bg-negative{background-color:var(--w-s-color-background-negative)}.s-bg-subtle{background-color:var(--w-s-color-background-subtle)}.hover\\:s-bg-hover:hover{background-color:var(--w-s-color-background-hover)}.hover\\:s-bg-negative-hover:hover{background-color:var(--w-s-color-background-negative-hover)}.hover\\:s-bg-negative-subtle-hover:hover{background-color:var(--w-s-color-background-negative-subtle-hover)}.active\\:s-bg-active:active{background-color:var(--w-s-color-background-active)}.active\\:s-bg-negative-active:active{background-color:var(--w-s-color-background-negative-active)}.active\\:s-bg-negative-subtle-active:active{background-color:var(--w-s-color-background-negative-subtle-active)}.s-text{color:var(--w-s-color-text)}.s-text-inverted{color:var(--w-s-color-text-inverted)}.s-text-inverted-static{color:var(--w-s-color-text-inverted-static)}.s-text-link{color:var(--w-s-color-text-link)}.s-text-negative{color:var(--w-s-color-text-negative)}.s-icon{color:var(--w-s-color-icon)}.hover\\:s-icon-hover:hover{color:var(--w-s-color-icon-hover)}.active\\:s-icon-active:active{color:var(--w-s-color-icon-active)}.s-border{border-color:var(--w-s-color-border)}.hover\\:s-border-hover:hover{border-color:var(--w-s-color-border-hover)}.active\\:s-border-active:active{border-color:var(--w-s-color-border-active)}.drop-shadow-m{filter:drop-shadow(0 3px 8px #4040403d)drop-shadow(0 3px 6px #40404029)}.shadow-m{box-shadow:var(--w-shadow-m)}.h-\\[14px\\]{height:14px}.w-\\[14px\\]{width:14px}.-mr-8{margin-right:-.8rem}.last-child\\:mb-0>:last-child{margin-bottom:0}.ml-8{margin-left:.8rem}.p-16{padding:1.6rem}.p-4{padding:.4rem}.px-16{padding-left:1.6rem;padding-right:1.6rem}.px-8{padding-left:.8rem;padding-right:.8rem}.py-6{padding-top:.6rem;padding-bottom:.6rem}.py-8{padding-top:.8rem;padding-bottom:.8rem}.font-bold{font-weight:700}.resize{resize:both}.translate-z-0{--w-translate-z:0rem;transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transform{transform:translateX(var(--w-translate-x))translateY(var(--w-translate-y))translateZ(var(--w-translate-z))rotate(var(--w-rotate))rotateX(var(--w-rotate-x))rotateY(var(--w-rotate-y))rotateZ(var(--w-rotate-z))skewX(var(--w-skew-x))skewY(var(--w-skew-y))scaleX(var(--w-scale-x))scaleY(var(--w-scale-y))scaleZ(var(--w-scale-z))}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.text-m{font-size:var(--w-font-size-m);line-height:var(--w-line-height-m)}.text-xs{font-size:var(--w-font-size-xs);line-height:var(--w-line-height-xs)}.leading-\\[24\\]{line-height:2.4rem}`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StoryObj } from '@storybook/react';
|
|
3
|
+
import { Badge } from './react';
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: import("@lit/react").ReactWebComponent<import(".").WarpBadge, {}>;
|
|
7
|
+
render(args: Omit<React.HTMLAttributes<import(".").WarpBadge>, "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "variant" | "position" | "_class"> & {} & Partial<Omit<import(".").WarpBadge, keyof HTMLElement>> & React.RefAttributes<import(".").WarpBadge>): React.JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
export type Story = StoryObj<typeof Badge>;
|
|
11
|
+
export declare const Neutral: Story;
|
|
12
|
+
export declare const Info: Story;
|
|
13
|
+
export declare const Positive: Story;
|
|
14
|
+
export declare const Warning: Story;
|
|
15
|
+
export declare const Negative: Story;
|
|
16
|
+
export declare const Price: Story;
|
|
17
|
+
export declare const Sponsored: Story;
|
|
18
|
+
export declare const Positioned: Story;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Badge } from './react';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/Badge',
|
|
5
|
+
component: Badge,
|
|
6
|
+
render(args) {
|
|
7
|
+
return React.createElement(Badge, { ...args }, "Badge Text");
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export const Neutral = {
|
|
11
|
+
args: {
|
|
12
|
+
variant: 'neutral',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
export const Info = {
|
|
16
|
+
args: {
|
|
17
|
+
variant: 'info',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const Positive = {
|
|
21
|
+
args: {
|
|
22
|
+
variant: 'positive',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const Warning = {
|
|
26
|
+
args: {
|
|
27
|
+
variant: 'warning',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export const Negative = {
|
|
31
|
+
args: {
|
|
32
|
+
variant: 'negative',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
export const Price = {
|
|
36
|
+
args: {
|
|
37
|
+
variant: 'price',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const Sponsored = {
|
|
41
|
+
args: {
|
|
42
|
+
variant: 'sponsored',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export const Positioned = {
|
|
46
|
+
args: {
|
|
47
|
+
variant: 'price',
|
|
48
|
+
position: 'top-right',
|
|
49
|
+
},
|
|
50
|
+
render(args) {
|
|
51
|
+
return (React.createElement("div", { style: {
|
|
52
|
+
position: 'relative',
|
|
53
|
+
width: '200px',
|
|
54
|
+
height: '100px',
|
|
55
|
+
background: '#f0f0f0',
|
|
56
|
+
borderRadius: '8px',
|
|
57
|
+
} },
|
|
58
|
+
React.createElement(Badge, { ...args }, "Badge")));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import type { WarpBadge } from './index.js';
|
|
3
|
+
import './index.js';
|
|
4
|
+
declare const args: Partial<WarpBadge> & {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
declare const meta: Meta<typeof args>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof args>;
|
|
10
|
+
export declare const Neutral: Story;
|
|
11
|
+
export declare const Info: Story;
|
|
12
|
+
export declare const Positive: Story;
|
|
13
|
+
export declare const Warning: Story;
|
|
14
|
+
export declare const Negative: Story;
|
|
15
|
+
export declare const Price: Story;
|
|
16
|
+
export declare const Sponsored: Story;
|
|
17
|
+
export declare const Positioned: Story;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { spread } from '@open-wc/lit-helpers';
|
|
2
|
+
import { getStorybookHelpers } from '@wc-toolkit/storybook-helpers';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { prespread } from '../../.storybook/utilities.js';
|
|
5
|
+
import './index.js';
|
|
6
|
+
const { events, args, argTypes } = getStorybookHelpers('w-badge');
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Layout/Badge',
|
|
9
|
+
render(args) {
|
|
10
|
+
return html `<w-badge ${spread(prespread(args))}>Badge text</w-badge>`;
|
|
11
|
+
},
|
|
12
|
+
args,
|
|
13
|
+
argTypes,
|
|
14
|
+
parameters: {
|
|
15
|
+
actions: {
|
|
16
|
+
handles: events,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
export const Neutral = {
|
|
22
|
+
args: {
|
|
23
|
+
variant: 'neutral',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const Info = {
|
|
27
|
+
args: {
|
|
28
|
+
variant: 'info',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export const Positive = {
|
|
32
|
+
args: {
|
|
33
|
+
variant: 'positive',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const Warning = {
|
|
37
|
+
args: {
|
|
38
|
+
variant: 'warning',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export const Negative = {
|
|
42
|
+
args: {
|
|
43
|
+
variant: 'negative',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export const Price = {
|
|
47
|
+
args: {
|
|
48
|
+
variant: 'price',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export const Sponsored = {
|
|
52
|
+
args: {
|
|
53
|
+
variant: 'sponsored',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const Positioned = {
|
|
57
|
+
args: {
|
|
58
|
+
variant: 'price',
|
|
59
|
+
position: 'top-right',
|
|
60
|
+
},
|
|
61
|
+
render(args) {
|
|
62
|
+
return html `
|
|
63
|
+
<div style="position: relative; width: 200px; height: 100px; background: #f0f0f0; border-radius: 8px;">
|
|
64
|
+
<w-badge ${spread(prespread(args))}>Badge</w-badge>
|
|
65
|
+
</div>
|
|
66
|
+
`;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { expect, test } from 'vitest';
|
|
3
|
+
import { render } from 'vitest-browser-lit';
|
|
4
|
+
import './index.js';
|
|
5
|
+
test('renders the slotted label', async () => {
|
|
6
|
+
const component = html `<w-badge>This is also not a button</w-badge>`;
|
|
7
|
+
const page = render(component);
|
|
8
|
+
await expect.element(page.getByText('This is also not a button')).toBeVisible();
|
|
9
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static styles:
|
|
11
|
-
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* `w-badge` is used for showing a small amount of non-interactive color-categorized metadata, like a status or count.
|
|
4
|
+
*
|
|
5
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/layout-badge--docs)
|
|
6
|
+
*/
|
|
7
|
+
declare class WarpBadge extends LitElement {
|
|
8
|
+
variant: 'neutral' | 'info' | 'positive' | 'warning' | 'negative' | 'disabled' | 'price' | 'sponsored';
|
|
9
|
+
position: 'top-left' | 'top-right' | 'bottom-right' | 'bottom-left';
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
/** @internal */
|
|
12
12
|
get _class(): string;
|
|
13
13
|
render(): import("lit").TemplateResult<1>;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
export { WarpBadge };
|