@lukso/web-components 1.3.1 → 1.4.0
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/CHANGELOG.md +14 -0
- package/README.md +33 -7
- package/dist/color-palette/index.js +705 -0
- package/dist/color-palette/index.umd.cjs +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +5344 -1760
- package/dist/components/index.umd.cjs +2997 -72
- package/dist/components/lukso-button/index.d.ts +10 -1
- package/dist/components/lukso-button/index.js +234 -185
- package/dist/components/lukso-button/index.umd.cjs +32 -21
- package/dist/components/lukso-card/index.d.ts +4 -4
- package/dist/components/lukso-card/index.js +81 -72
- package/dist/components/lukso-card/index.umd.cjs +9 -9
- package/dist/components/lukso-icon/icons/add-photo.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-down-lg.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-down-sm.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-left-lg.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-left-sm.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-right-lg.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-right-sm.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-up-lg.d.ts +3 -0
- package/dist/components/lukso-icon/icons/arrow-up-sm.d.ts +3 -0
- package/dist/components/lukso-icon/icons/barbell-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/bulb-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/camera.d.ts +3 -0
- package/dist/components/lukso-icon/icons/clipboard.d.ts +3 -0
- package/dist/components/lukso-icon/icons/clock.d.ts +3 -0
- package/dist/components/lukso-icon/icons/close-lg.d.ts +3 -0
- package/dist/components/lukso-icon/icons/close-sm.d.ts +3 -0
- package/dist/components/lukso-icon/icons/cloud.d.ts +3 -0
- package/dist/components/lukso-icon/icons/compass-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/complete-filled.d.ts +3 -0
- package/dist/components/lukso-icon/icons/complete-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/connect.d.ts +3 -0
- package/dist/components/lukso-icon/icons/connections.d.ts +3 -0
- package/dist/components/lukso-icon/icons/contract-lock.d.ts +3 -0
- package/dist/components/lukso-icon/icons/controller.d.ts +3 -0
- package/dist/components/lukso-icon/icons/copy.d.ts +3 -0
- package/dist/components/lukso-icon/icons/cross-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/dots.d.ts +3 -0
- package/dist/components/lukso-icon/icons/edit.d.ts +3 -0
- package/dist/components/lukso-icon/icons/error.d.ts +3 -0
- package/dist/components/lukso-icon/icons/eth-logo.d.ts +3 -0
- package/dist/components/lukso-icon/icons/expand.d.ts +3 -0
- package/dist/components/lukso-icon/icons/extension.d.ts +3 -0
- package/dist/components/lukso-icon/icons/eye-hide.d.ts +3 -0
- package/dist/components/lukso-icon/icons/eye-show.d.ts +3 -0
- package/dist/components/lukso-icon/icons/filter.d.ts +3 -0
- package/dist/components/lukso-icon/icons/fish-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/flip.d.ts +3 -0
- package/dist/components/lukso-icon/icons/globe.d.ts +3 -0
- package/dist/components/lukso-icon/icons/google-color.d.ts +3 -0
- package/dist/components/lukso-icon/icons/hamburger.d.ts +3 -0
- package/dist/components/lukso-icon/icons/infinite.d.ts +3 -0
- package/dist/components/lukso-icon/icons/information.d.ts +3 -0
- package/dist/components/lukso-icon/icons/key-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/link.d.ts +3 -0
- package/dist/components/lukso-icon/icons/link1.d.ts +3 -0
- package/dist/components/lukso-icon/icons/link2.d.ts +3 -0
- package/dist/components/lukso-icon/icons/link3.d.ts +3 -0
- package/dist/components/lukso-icon/icons/link4.d.ts +3 -0
- package/dist/components/lukso-icon/icons/loading.d.ts +3 -0
- package/dist/components/lukso-icon/icons/location.d.ts +3 -0
- package/dist/components/lukso-icon/icons/locked.d.ts +3 -0
- package/dist/components/lukso-icon/icons/login-2.d.ts +3 -0
- package/dist/components/lukso-icon/icons/login-3.d.ts +3 -0
- package/dist/components/lukso-icon/icons/login.d.ts +3 -0
- package/dist/components/lukso-icon/icons/logo-chrome.d.ts +3 -0
- package/dist/components/lukso-icon/icons/lyx-logo.d.ts +3 -0
- package/dist/components/lukso-icon/icons/mail.d.ts +3 -0
- package/dist/components/lukso-icon/icons/menu-1.d.ts +3 -0
- package/dist/components/lukso-icon/icons/menu-2.d.ts +3 -0
- package/dist/components/lukso-icon/icons/migrate.d.ts +3 -0
- package/dist/components/lukso-icon/icons/minimize.d.ts +3 -0
- package/dist/components/lukso-icon/icons/network.d.ts +3 -0
- package/dist/components/lukso-icon/icons/notifications.d.ts +3 -0
- package/dist/components/lukso-icon/icons/phone-portrait-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/pin.d.ts +3 -0
- package/dist/components/lukso-icon/icons/play-filled.d.ts +3 -0
- package/dist/components/lukso-icon/icons/play-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/plus.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-add.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-export.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-import.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-recovery-2.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-recovery.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile-restore.d.ts +3 -0
- package/dist/components/lukso-icon/icons/profile.d.ts +3 -0
- package/dist/components/lukso-icon/icons/qr-code.d.ts +3 -0
- package/dist/components/lukso-icon/icons/relayer.d.ts +3 -0
- package/dist/components/lukso-icon/icons/reload.d.ts +3 -0
- package/dist/components/lukso-icon/icons/return-down.d.ts +3 -0
- package/dist/components/lukso-icon/icons/return-left.d.ts +3 -0
- package/dist/components/lukso-icon/icons/return-right.d.ts +3 -0
- package/dist/components/lukso-icon/icons/return-up.d.ts +3 -0
- package/dist/components/lukso-icon/icons/search.d.ts +3 -0
- package/dist/components/lukso-icon/icons/settings.d.ts +3 -0
- package/dist/components/lukso-icon/icons/smart-contract-doc.d.ts +3 -0
- package/dist/components/lukso-icon/icons/smart-contract.d.ts +3 -0
- package/dist/components/lukso-icon/icons/star-filled.d.ts +3 -0
- package/dist/components/lukso-icon/icons/star-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/step-dot.d.ts +3 -0
- package/dist/components/lukso-icon/icons/step-progress.d.ts +3 -0
- package/dist/components/lukso-icon/icons/steps.d.ts +3 -0
- package/dist/components/lukso-icon/icons/tick.d.ts +3 -0
- package/dist/components/lukso-icon/icons/timer-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/transaction-receive.d.ts +3 -0
- package/dist/components/lukso-icon/icons/transaction-send.d.ts +3 -0
- package/dist/components/lukso-icon/icons/transfer.d.ts +3 -0
- package/dist/components/lukso-icon/icons/trash.d.ts +3 -0
- package/dist/components/lukso-icon/icons/turn-down.d.ts +3 -0
- package/dist/components/lukso-icon/icons/turn-left.d.ts +3 -0
- package/dist/components/lukso-icon/icons/turn-right.d.ts +3 -0
- package/dist/components/lukso-icon/icons/turn-up.d.ts +3 -0
- package/dist/components/lukso-icon/icons/unlocked.d.ts +3 -0
- package/dist/components/lukso-icon/icons/wallet-outline.d.ts +3 -0
- package/dist/components/lukso-icon/icons/warning-round.d.ts +3 -0
- package/dist/components/lukso-icon/icons/warning-triangle.d.ts +3 -0
- package/dist/components/lukso-icon/index.d.ts +23 -0
- package/dist/components/lukso-icon/index.js +4500 -0
- package/dist/components/lukso-icon/index.umd.cjs +2928 -0
- package/dist/components/lukso-input/index.d.ts +36 -0
- package/dist/components/lukso-input/index.js +1305 -0
- package/dist/components/lukso-input/index.umd.cjs +104 -0
- package/dist/components/lukso-navbar/index.d.ts +1 -1
- package/dist/components/lukso-navbar/index.js +23 -23
- package/dist/components/lukso-navbar/index.umd.cjs +7 -7
- package/dist/components/lukso-profile/index.d.ts +1 -1
- package/dist/components/lukso-profile/index.js +82 -73
- package/dist/components/lukso-profile/index.umd.cjs +10 -10
- package/dist/components/lukso-sanitize/index.d.ts +2 -2
- package/dist/components/lukso-sanitize/index.js +96 -93
- package/dist/components/lukso-sanitize/index.umd.cjs +9 -9
- package/dist/components/lukso-tag/index.d.ts +1 -1
- package/dist/components/lukso-tag/index.js +28 -25
- package/dist/components/lukso-tag/index.umd.cjs +8 -8
- package/dist/components/lukso-test/index.d.ts +1 -1
- package/dist/components/lukso-test/index.js +619 -619
- package/dist/components/lukso-test/index.umd.cjs +25 -25
- package/dist/components/lukso-username/index.d.ts +1 -1
- package/dist/components/lukso-username/index.js +49 -50
- package/dist/components/lukso-username/index.umd.cjs +14 -14
- package/dist/components/lukso-wizard/index.d.ts +2 -2
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/components/lukso-wizard/index.umd.cjs +1 -1
- package/dist/index.js +5344 -1760
- package/dist/index.umd.cjs +2997 -72
- package/dist/sass/color-palette.ts +1 -1
- package/dist/sass/colors.scss +91 -0
- package/{src/shared/utils → dist/sass}/hslColorMap.ts +0 -0
- package/dist/sass/main.scss +1 -0
- package/dist/shared/directives/custom-class-map/index.d.ts +1 -1
- package/dist/shared/styles/color-palette.d.ts +43 -0
- package/dist/shared/styles/hslColorMap.d.ts +10 -0
- package/dist/shared/tailwind-element/index.js +99 -99
- package/dist/shared/tailwind-element/index.umd.cjs +11 -11
- package/dist/shared/tailwind-element.js +99 -99
- package/dist/shared/tailwind-element.umd.cjs +11 -11
- package/dist/styles/main.css +91 -0
- package/package.json +18 -1
- package/src/components/index.ts +3 -1
- package/src/components/lukso-button/index.ts +70 -3
- package/src/components/lukso-button/lukso-button.stories.ts +101 -3
- package/src/components/lukso-card/lukso-card.stories.ts +6 -2
- package/src/components/lukso-icon/icons/add-photo.ts +46 -0
- package/src/components/lukso-icon/icons/arrow-down-lg.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-down-sm.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-left-lg.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-left-sm.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-right-lg.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-right-sm.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-up-lg.ts +26 -0
- package/src/components/lukso-icon/icons/arrow-up-sm.ts +26 -0
- package/src/components/lukso-icon/icons/barbell-outline.ts +54 -0
- package/src/components/lukso-icon/icons/bulb-outline.ts +54 -0
- package/src/components/lukso-icon/icons/camera.ts +40 -0
- package/src/components/lukso-icon/icons/clipboard.ts +59 -0
- package/src/components/lukso-icon/icons/clock.ts +31 -0
- package/src/components/lukso-icon/icons/close-lg.ts +33 -0
- package/src/components/lukso-icon/icons/close-sm.ts +33 -0
- package/src/components/lukso-icon/icons/cloud.ts +25 -0
- package/src/components/lukso-icon/icons/compass-outline.ts +29 -0
- package/src/components/lukso-icon/icons/complete-filled.ts +32 -0
- package/src/components/lukso-icon/icons/complete-outline.ts +31 -0
- package/src/components/lukso-icon/icons/connect.ts +33 -0
- package/src/components/lukso-icon/icons/connections.ts +34 -0
- package/src/components/lukso-icon/icons/contract-lock.ts +43 -0
- package/src/components/lukso-icon/icons/controller.ts +55 -0
- package/src/components/lukso-icon/icons/copy.ts +31 -0
- package/src/components/lukso-icon/icons/cross-outline.ts +38 -0
- package/src/components/lukso-icon/icons/dots.ts +22 -0
- package/src/components/lukso-icon/icons/edit.ts +30 -0
- package/src/components/lukso-icon/icons/error.ts +31 -0
- package/src/components/lukso-icon/icons/eth-logo.ts +50 -0
- package/src/components/lukso-icon/icons/expand.ts +31 -0
- package/src/components/lukso-icon/icons/extension.ts +31 -0
- package/src/components/lukso-icon/icons/eye-hide.ts +47 -0
- package/src/components/lukso-icon/icons/eye-show.ts +37 -0
- package/src/components/lukso-icon/icons/filter.ts +43 -0
- package/src/components/lukso-icon/icons/fish-outline.ts +36 -0
- package/src/components/lukso-icon/icons/flip.ts +45 -0
- package/src/components/lukso-icon/icons/globe.ts +61 -0
- package/src/components/lukso-icon/icons/google-color.ts +35 -0
- package/src/components/lukso-icon/icons/hamburger.ts +40 -0
- package/src/components/lukso-icon/icons/infinite.ts +33 -0
- package/src/components/lukso-icon/icons/information.ts +38 -0
- package/src/components/lukso-icon/icons/key-outline.ts +25 -0
- package/src/components/lukso-icon/icons/link.ts +33 -0
- package/src/components/lukso-icon/icons/link1.ts +39 -0
- package/src/components/lukso-icon/icons/link2.ts +46 -0
- package/src/components/lukso-icon/icons/link3.ts +32 -0
- package/src/components/lukso-icon/icons/link4.ts +52 -0
- package/src/components/lukso-icon/icons/loading.ts +50 -0
- package/src/components/lukso-icon/icons/location.ts +33 -0
- package/src/components/lukso-icon/icons/locked.ts +44 -0
- package/src/components/lukso-icon/icons/login-2.ts +55 -0
- package/src/components/lukso-icon/icons/login-3.ts +53 -0
- package/src/components/lukso-icon/icons/login.ts +39 -0
- package/src/components/lukso-icon/icons/logo-chrome.ts +35 -0
- package/src/components/lukso-icon/icons/lyx-logo.ts +41 -0
- package/src/components/lukso-icon/icons/mail.ts +33 -0
- package/src/components/lukso-icon/icons/menu-1.ts +71 -0
- package/src/components/lukso-icon/icons/menu-2.ts +61 -0
- package/src/components/lukso-icon/icons/migrate.ts +47 -0
- package/src/components/lukso-icon/icons/minimize.ts +53 -0
- package/src/components/lukso-icon/icons/network.ts +49 -0
- package/src/components/lukso-icon/icons/notifications.ts +33 -0
- package/src/components/lukso-icon/icons/phone-portrait-outline.ts +33 -0
- package/src/components/lukso-icon/icons/pin.ts +25 -0
- package/src/components/lukso-icon/icons/play-filled.ts +23 -0
- package/src/components/lukso-icon/icons/play-outline.ts +24 -0
- package/src/components/lukso-icon/icons/plus.ts +33 -0
- package/src/components/lukso-icon/icons/profile-add.ts +43 -0
- package/src/components/lukso-icon/icons/profile-export.ts +42 -0
- package/src/components/lukso-icon/icons/profile-import.ts +42 -0
- package/src/components/lukso-icon/icons/profile-recovery-2.ts +62 -0
- package/src/components/lukso-icon/icons/profile-recovery.ts +55 -0
- package/src/components/lukso-icon/icons/profile-restore.ts +50 -0
- package/src/components/lukso-icon/icons/profile.ts +29 -0
- package/src/components/lukso-icon/icons/qr-code.ts +122 -0
- package/src/components/lukso-icon/icons/relayer.ts +40 -0
- package/src/components/lukso-icon/icons/reload.ts +32 -0
- package/src/components/lukso-icon/icons/return-down.ts +33 -0
- package/src/components/lukso-icon/icons/return-left.ts +33 -0
- package/src/components/lukso-icon/icons/return-right.ts +33 -0
- package/src/components/lukso-icon/icons/return-up.ts +33 -0
- package/src/components/lukso-icon/icons/search.ts +28 -0
- package/src/components/lukso-icon/icons/settings.ts +33 -0
- package/src/components/lukso-icon/icons/smart-contract-doc.ts +40 -0
- package/src/components/lukso-icon/icons/smart-contract.ts +31 -0
- package/src/components/lukso-icon/icons/star-filled.ts +23 -0
- package/src/components/lukso-icon/icons/star-outline.ts +24 -0
- package/src/components/lukso-icon/icons/step-dot.ts +34 -0
- package/src/components/lukso-icon/icons/step-progress.ts +31 -0
- package/src/components/lukso-icon/icons/steps.ts +40 -0
- package/src/components/lukso-icon/icons/tick.ts +26 -0
- package/src/components/lukso-icon/icons/timer-outline.ts +47 -0
- package/src/components/lukso-icon/icons/transaction-receive.ts +39 -0
- package/src/components/lukso-icon/icons/transaction-send.ts +39 -0
- package/src/components/lukso-icon/icons/transfer.ts +47 -0
- package/src/components/lukso-icon/icons/trash.ts +40 -0
- package/src/components/lukso-icon/icons/turn-down.ts +33 -0
- package/src/components/lukso-icon/icons/turn-left.ts +33 -0
- package/src/components/lukso-icon/icons/turn-right.ts +33 -0
- package/src/components/lukso-icon/icons/turn-up.ts +33 -0
- package/src/components/lukso-icon/icons/unlocked.ts +41 -0
- package/src/components/lukso-icon/icons/wallet-outline.ts +35 -0
- package/src/components/lukso-icon/icons/warning-round.ts +32 -0
- package/src/components/lukso-icon/icons/warning-triangle.ts +32 -0
- package/src/components/lukso-icon/index.ts +299 -0
- package/src/components/lukso-icon/lukso-icon.stories.ts +96 -0
- package/src/components/lukso-input/index.ts +188 -0
- package/src/components/lukso-input/lukso-input.stories.ts +183 -0
- package/src/components/lukso-navbar/index.ts +1 -1
- package/src/components/lukso-navbar/lukso-navbar.stories.ts +18 -1
- package/src/components/lukso-profile/index.ts +9 -3
- package/src/components/lukso-profile/lukso-profile.stories.ts +18 -1
- package/src/components/lukso-sanitize/index.ts +1 -1
- package/src/components/lukso-sanitize/lukso-sanitize.stories.ts +5 -1
- package/src/components/lukso-tag/index.ts +4 -4
- package/src/components/lukso-tag/lukso-tag.stories.ts +28 -5
- package/src/components/lukso-username/index.ts +3 -3
- package/src/components/lukso-username/lukso-username.stories.ts +10 -2
- package/src/components/lukso-wizard/index.ts +1 -1
- package/src/components/lukso-wizard/lukso-wizard.stories.ts +4 -1
- package/src/shared/styles/color-palette.ts +1 -1
- package/src/shared/styles/colors.scss +91 -0
- package/src/shared/styles/hslColorMap.ts +20 -0
- package/src/shared/styles/main.scss +1 -0
- package/src/shared/utils/__tests__/sliceAddress.spec.ts +1 -1
- package/tools/color-palette.cjs +2 -2
- package/tools/color-palette.d.ts +2 -2
- package/tools/color-palette.d.ts.map +1 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { html } from 'lit'
|
|
2
|
+
import { customElement, property } from 'lit/decorators.js'
|
|
3
|
+
|
|
4
|
+
import { TailwindElement } from '@/shared/tailwind-element'
|
|
5
|
+
import { addPhoto } from './icons/add-photo.js'
|
|
6
|
+
import { arrowDownLg } from './icons/arrow-down-lg.js'
|
|
7
|
+
import { arrowDownSm } from './icons/arrow-down-sm.js'
|
|
8
|
+
import { arrowLeftLg } from './icons/arrow-left-lg.js'
|
|
9
|
+
import { arrowLeftSm } from './icons/arrow-left-sm.js'
|
|
10
|
+
import { arrowRightLg } from './icons/arrow-right-lg.js'
|
|
11
|
+
import { arrowRightSm } from './icons/arrow-right-sm.js'
|
|
12
|
+
import { arrowUpLg } from './icons/arrow-up-lg.js'
|
|
13
|
+
import { arrowUpSm } from './icons/arrow-up-sm.js'
|
|
14
|
+
import { barbellOutline } from './icons/barbell-outline.js'
|
|
15
|
+
import { bulbOutline } from './icons/bulb-outline.js'
|
|
16
|
+
import { camera } from './icons/camera.js'
|
|
17
|
+
import { clipboard } from './icons/clipboard.js'
|
|
18
|
+
import { clock } from './icons/clock.js'
|
|
19
|
+
import { closeLg } from './icons/close-lg.js'
|
|
20
|
+
import { closeSm } from './icons/close-sm.js'
|
|
21
|
+
import { cloud } from './icons/cloud.js'
|
|
22
|
+
import { compassOutline } from './icons/compass-outline.js'
|
|
23
|
+
import { completeFilled } from './icons/complete-filled.js'
|
|
24
|
+
import { completeOutline } from './icons/complete-outline.js'
|
|
25
|
+
import { contractLock } from './icons/contract-lock.js'
|
|
26
|
+
import { connect } from './icons/connect.js'
|
|
27
|
+
import { connections } from './icons/connections.js'
|
|
28
|
+
import { controller } from './icons/controller.js'
|
|
29
|
+
import { copy } from './icons/copy.js'
|
|
30
|
+
import { crossOutline } from './icons/cross-outline.js'
|
|
31
|
+
import { dots } from './icons/dots.js'
|
|
32
|
+
import { edit } from './icons/edit.js'
|
|
33
|
+
import { error } from './icons/error.js'
|
|
34
|
+
import { expand } from './icons/expand.js'
|
|
35
|
+
import { extension } from './icons/extension.js'
|
|
36
|
+
import { eyeHide } from './icons/eye-hide.js'
|
|
37
|
+
import { eyeShow } from './icons/eye-show.js'
|
|
38
|
+
import { filter } from './icons/filter.js'
|
|
39
|
+
import { fishOutline } from './icons/fish-outline.js'
|
|
40
|
+
import { flip } from './icons/flip.js'
|
|
41
|
+
import { globe } from './icons/globe.js'
|
|
42
|
+
import { hamburger } from './icons/hamburger.js'
|
|
43
|
+
import { infinite } from './icons/infinite.js'
|
|
44
|
+
import { information } from './icons/information.js'
|
|
45
|
+
import { keyOutline } from './icons/key-outline.js'
|
|
46
|
+
import { link } from './icons/link.js'
|
|
47
|
+
import { link1 } from './icons/link1.js'
|
|
48
|
+
import { link2 } from './icons/link2.js'
|
|
49
|
+
import { link3 } from './icons/link3.js'
|
|
50
|
+
import { link4 } from './icons/link4.js'
|
|
51
|
+
import { loading } from './icons/loading.js'
|
|
52
|
+
import { location } from './icons/location.js'
|
|
53
|
+
import { locked } from './icons/locked.js'
|
|
54
|
+
import { login } from './icons/login.js'
|
|
55
|
+
import { login2 } from './icons/login-2.js'
|
|
56
|
+
import { login3 } from './icons/login-3.js'
|
|
57
|
+
import { logoChrome } from './icons/logo-chrome.js'
|
|
58
|
+
import { mail } from './icons/mail.js'
|
|
59
|
+
import { menu1 } from './icons/menu-1.js'
|
|
60
|
+
import { menu2 } from './icons/menu-2.js'
|
|
61
|
+
import { migrate } from './icons/migrate.js'
|
|
62
|
+
import { minimize } from './icons/minimize.js'
|
|
63
|
+
import { network } from './icons/network.js'
|
|
64
|
+
import { notifications } from './icons/notifications.js'
|
|
65
|
+
import { phonePortraitOutline } from './icons/phone-portrait-outline.js'
|
|
66
|
+
import { pin } from './icons/pin.js'
|
|
67
|
+
import { playFilled } from './icons/play-filled.js'
|
|
68
|
+
import { playOutline } from './icons/play-outline.js'
|
|
69
|
+
import { plus } from './icons/plus.js'
|
|
70
|
+
import { profileAdd } from './icons/profile-add.js'
|
|
71
|
+
import { profileExport } from './icons/profile-export.js'
|
|
72
|
+
import { profileImport } from './icons/profile-import.js'
|
|
73
|
+
import { profileRecovery } from './icons/profile-recovery.js'
|
|
74
|
+
import { profileRecovery2 } from './icons/profile-recovery-2.js'
|
|
75
|
+
import { profileRestore } from './icons/profile-restore.js'
|
|
76
|
+
import { profile } from './icons/profile.js'
|
|
77
|
+
import { qrCode } from './icons/qr-code.js'
|
|
78
|
+
import { relayer } from './icons/relayer.js'
|
|
79
|
+
import { reload } from './icons/reload.js'
|
|
80
|
+
import { returnDown } from './icons/return-down.js'
|
|
81
|
+
import { returnLeft } from './icons/return-left.js'
|
|
82
|
+
import { returnRight } from './icons/return-right.js'
|
|
83
|
+
import { returnUp } from './icons/return-up.js'
|
|
84
|
+
import { search } from './icons/search.js'
|
|
85
|
+
import { settings } from './icons/settings.js'
|
|
86
|
+
import { smartContractDoc } from './icons/smart-contract-doc.js'
|
|
87
|
+
import { smartContract } from './icons/smart-contract.js'
|
|
88
|
+
import { starFilled } from './icons/star-filled.js'
|
|
89
|
+
import { starOutline } from './icons/star-outline.js'
|
|
90
|
+
import { stepDot } from './icons/step-dot.js'
|
|
91
|
+
import { stepProgress } from './icons/step-progress.js'
|
|
92
|
+
import { steps } from './icons/steps.js'
|
|
93
|
+
import { tick } from './icons/tick.js'
|
|
94
|
+
import { timerOutline } from './icons/timer-outline.js'
|
|
95
|
+
import { transactionReceive } from './icons/transaction-receive.js'
|
|
96
|
+
import { transactionSend } from './icons/transaction-send.js'
|
|
97
|
+
import { transfer } from './icons/transfer.js'
|
|
98
|
+
import { trash } from './icons/trash.js'
|
|
99
|
+
import { turnDown } from './icons/turn-down.js'
|
|
100
|
+
import { turnLeft } from './icons/turn-left.js'
|
|
101
|
+
import { turnRight } from './icons/turn-right.js'
|
|
102
|
+
import { turnUp } from './icons/turn-up.js'
|
|
103
|
+
import { unlocked } from './icons/unlocked.js'
|
|
104
|
+
import { walletOutline } from './icons/wallet-outline.js'
|
|
105
|
+
import { warningRound } from './icons/warning-round.js'
|
|
106
|
+
import { warningTriangle } from './icons/warning-triangle.js'
|
|
107
|
+
import { googleColor } from './icons/google-color.js'
|
|
108
|
+
import { ethLogo } from './icons/eth-logo.js'
|
|
109
|
+
import { lyxLogo } from './icons/lyx-logo.js'
|
|
110
|
+
|
|
111
|
+
export type IconOptions = {
|
|
112
|
+
width: number
|
|
113
|
+
height: number
|
|
114
|
+
color: string
|
|
115
|
+
strokeWidth: number
|
|
116
|
+
secondaryColor?: string
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type IconSize = 'small' | 'medium' | 'large' | 'x-large'
|
|
120
|
+
|
|
121
|
+
type IconSizeDef = {
|
|
122
|
+
width: number
|
|
123
|
+
height: number
|
|
124
|
+
strokeWidth: number
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const iconMap = {
|
|
128
|
+
'add-photo': addPhoto,
|
|
129
|
+
'arrow-down-lg': arrowDownLg,
|
|
130
|
+
'arrow-down-sm': arrowDownSm,
|
|
131
|
+
'arrow-left-lg': arrowLeftLg,
|
|
132
|
+
'arrow-left-sm': arrowLeftSm,
|
|
133
|
+
'arrow-right-lg': arrowRightLg,
|
|
134
|
+
'arrow-right-sm': arrowRightSm,
|
|
135
|
+
'arrow-up-lg': arrowUpLg,
|
|
136
|
+
'arrow-up-sm': arrowUpSm,
|
|
137
|
+
'barbell-outline': barbellOutline,
|
|
138
|
+
'bulb-outline': bulbOutline,
|
|
139
|
+
camera,
|
|
140
|
+
clipboard,
|
|
141
|
+
clock,
|
|
142
|
+
'close-lg': closeLg,
|
|
143
|
+
'close-sm': closeSm,
|
|
144
|
+
cloud,
|
|
145
|
+
'compass-outline': compassOutline,
|
|
146
|
+
'complete-filled': completeFilled,
|
|
147
|
+
'complete-outline': completeOutline,
|
|
148
|
+
connect,
|
|
149
|
+
connections,
|
|
150
|
+
'contract-lock': contractLock,
|
|
151
|
+
controller,
|
|
152
|
+
copy,
|
|
153
|
+
'cross-outline': crossOutline,
|
|
154
|
+
dots,
|
|
155
|
+
edit,
|
|
156
|
+
error,
|
|
157
|
+
expand,
|
|
158
|
+
extension,
|
|
159
|
+
'eye-hide': eyeHide,
|
|
160
|
+
'eye-show': eyeShow,
|
|
161
|
+
filter,
|
|
162
|
+
'fish-outline': fishOutline,
|
|
163
|
+
flip,
|
|
164
|
+
globe,
|
|
165
|
+
hamburger,
|
|
166
|
+
infinite,
|
|
167
|
+
information,
|
|
168
|
+
'key-outline': keyOutline,
|
|
169
|
+
link,
|
|
170
|
+
'link-1': link1,
|
|
171
|
+
'link-2': link2,
|
|
172
|
+
'link-3': link3,
|
|
173
|
+
'link-4': link4,
|
|
174
|
+
loading,
|
|
175
|
+
location,
|
|
176
|
+
locked,
|
|
177
|
+
login,
|
|
178
|
+
'login-2': login2,
|
|
179
|
+
'login-3': login3,
|
|
180
|
+
'logo-chrome': logoChrome,
|
|
181
|
+
mail,
|
|
182
|
+
'menu-1': menu1,
|
|
183
|
+
'menu-2': menu2,
|
|
184
|
+
migrate,
|
|
185
|
+
minimize,
|
|
186
|
+
network,
|
|
187
|
+
notifications,
|
|
188
|
+
'phone-portrait-outline': phonePortraitOutline,
|
|
189
|
+
pin,
|
|
190
|
+
'play-filled': playFilled,
|
|
191
|
+
'play-outline': playOutline,
|
|
192
|
+
plus,
|
|
193
|
+
'profile-add': profileAdd,
|
|
194
|
+
'profile-export': profileExport,
|
|
195
|
+
'profile-import': profileImport,
|
|
196
|
+
'profile-recovery': profileRecovery,
|
|
197
|
+
'profile-recovery-2': profileRecovery2,
|
|
198
|
+
'profile-restore': profileRestore,
|
|
199
|
+
profile,
|
|
200
|
+
'qr-code': qrCode,
|
|
201
|
+
relayer,
|
|
202
|
+
reload,
|
|
203
|
+
'return-down': returnDown,
|
|
204
|
+
'return-left': returnLeft,
|
|
205
|
+
'return-right': returnRight,
|
|
206
|
+
'return-up': returnUp,
|
|
207
|
+
search,
|
|
208
|
+
settings,
|
|
209
|
+
'smart-contract-doc': smartContractDoc,
|
|
210
|
+
'smart-contract': smartContract,
|
|
211
|
+
'star-filled': starFilled,
|
|
212
|
+
'star-outline': starOutline,
|
|
213
|
+
'step-dot': stepDot,
|
|
214
|
+
'step-progress': stepProgress,
|
|
215
|
+
steps,
|
|
216
|
+
tick,
|
|
217
|
+
'timer-outline': timerOutline,
|
|
218
|
+
'transaction-receive': transactionReceive,
|
|
219
|
+
'transaction-send': transactionSend,
|
|
220
|
+
transfer,
|
|
221
|
+
trash,
|
|
222
|
+
'turn-down': turnDown,
|
|
223
|
+
'turn-left': turnLeft,
|
|
224
|
+
'turn-right': turnRight,
|
|
225
|
+
'turn-up': turnUp,
|
|
226
|
+
unlocked,
|
|
227
|
+
'wallet-outline': walletOutline,
|
|
228
|
+
'warning-round': warningRound,
|
|
229
|
+
'warning-triangle': warningTriangle,
|
|
230
|
+
'google-color': googleColor,
|
|
231
|
+
'eth-logo': ethLogo,
|
|
232
|
+
'lyx-logo': lyxLogo,
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@customElement('lukso-icon')
|
|
236
|
+
export class LuksoIcon extends TailwindElement {
|
|
237
|
+
@property({ type: String })
|
|
238
|
+
name = ''
|
|
239
|
+
|
|
240
|
+
@property({ type: String })
|
|
241
|
+
size = 'medium'
|
|
242
|
+
|
|
243
|
+
@property({ type: String })
|
|
244
|
+
color = 'neutral-20'
|
|
245
|
+
|
|
246
|
+
@property({ type: String, attribute: 'secondary-color' })
|
|
247
|
+
secondaryColor = ''
|
|
248
|
+
|
|
249
|
+
private sizes: { [key in IconSize]: IconSizeDef } = {
|
|
250
|
+
small: {
|
|
251
|
+
width: 16,
|
|
252
|
+
height: 16,
|
|
253
|
+
strokeWidth: 2,
|
|
254
|
+
},
|
|
255
|
+
medium: {
|
|
256
|
+
width: 24,
|
|
257
|
+
height: 24,
|
|
258
|
+
strokeWidth: 1.5,
|
|
259
|
+
},
|
|
260
|
+
large: {
|
|
261
|
+
width: 32,
|
|
262
|
+
height: 32,
|
|
263
|
+
strokeWidth: 1.5,
|
|
264
|
+
},
|
|
265
|
+
'x-large': {
|
|
266
|
+
width: 40,
|
|
267
|
+
height: 40,
|
|
268
|
+
strokeWidth: 1.5,
|
|
269
|
+
},
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
render() {
|
|
273
|
+
const icon = iconMap[this.name]
|
|
274
|
+
|
|
275
|
+
if (!icon) {
|
|
276
|
+
console.warn(`Icon ${this.name} not found`)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const size = this.sizes[this.size]
|
|
280
|
+
|
|
281
|
+
if (!size) {
|
|
282
|
+
console.warn(`Size ${this.size} not found`)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return html`${icon({
|
|
286
|
+
width: size.width,
|
|
287
|
+
height: size.height,
|
|
288
|
+
color: this.color,
|
|
289
|
+
strokeWidth: size.strokeWidth,
|
|
290
|
+
secondaryColor: this.secondaryColor,
|
|
291
|
+
})}`
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare global {
|
|
296
|
+
interface HTMLElementTagNameMap {
|
|
297
|
+
'lukso-icon': LuksoIcon
|
|
298
|
+
}
|
|
299
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { html } from 'lit-html'
|
|
2
|
+
import './index'
|
|
3
|
+
|
|
4
|
+
/** Documentation and examples of `lukso-icon` component. Icons comes in `small`, `medium`, `large` and `x-large` size that is set in `size` property.
|
|
5
|
+
* Please check all available icons in Icons Showcase.
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Design System/Components/lukso-icon',
|
|
9
|
+
component: 'lukso-icon',
|
|
10
|
+
argTypes: {
|
|
11
|
+
name: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: ['small', 'medium', 'large', 'x-large'],
|
|
17
|
+
},
|
|
18
|
+
color: {
|
|
19
|
+
control: { type: 'text' },
|
|
20
|
+
},
|
|
21
|
+
secondaryColor: {
|
|
22
|
+
control: { type: 'text' },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
args: {
|
|
26
|
+
name: 'profile-recovery',
|
|
27
|
+
size: 'medium',
|
|
28
|
+
color: 'neutral-20',
|
|
29
|
+
secondaryColor: '',
|
|
30
|
+
},
|
|
31
|
+
parameters: {
|
|
32
|
+
controls: {
|
|
33
|
+
exclude: ['sizes', 'secondary-color'],
|
|
34
|
+
},
|
|
35
|
+
design: {
|
|
36
|
+
type: 'figma',
|
|
37
|
+
url: 'https://www.figma.com/file/NFCh20xAq3Jg2g8A0DNC9I/UI-Library?node-id=52%3A1473&t=loplCvndobu6AA6P-4',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Template = ({ name, size, color, secondaryColor }) =>
|
|
43
|
+
html`<lukso-icon
|
|
44
|
+
name=${name}
|
|
45
|
+
size=${size}
|
|
46
|
+
color=${color}
|
|
47
|
+
secondary-color=${secondaryColor}
|
|
48
|
+
></lukso-icon>`
|
|
49
|
+
|
|
50
|
+
/** By default icon comes in `medium` size of `24x24` pixels with `neutral-20` color. */
|
|
51
|
+
export const DefaultIcon = Template.bind({})
|
|
52
|
+
DefaultIcon.args = {
|
|
53
|
+
name: 'profile-recovery',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Example of `small` size of `16x16` pixels. */
|
|
57
|
+
export const SmallIcon = Template.bind({})
|
|
58
|
+
SmallIcon.args = {
|
|
59
|
+
name: 'profile-recovery',
|
|
60
|
+
size: 'small',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Example of `large` size of `32x32` pixels. */
|
|
64
|
+
export const LargeIcon = Template.bind({})
|
|
65
|
+
LargeIcon.args = {
|
|
66
|
+
name: 'profile-recovery',
|
|
67
|
+
size: 'large',
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Example of `x-large` size of `40x40` pixels. */
|
|
71
|
+
export const XLargeIcon = Template.bind({})
|
|
72
|
+
XLargeIcon.args = {
|
|
73
|
+
name: 'profile-recovery',
|
|
74
|
+
size: 'x-large',
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** You can change color to any from the palette with `color` property. */
|
|
78
|
+
export const CustomColorIcon = Template.bind({})
|
|
79
|
+
CustomColorIcon.args = {
|
|
80
|
+
name: 'profile-recovery',
|
|
81
|
+
color: 'coral-65',
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Some icons contain secondary color that is applied with `secondary-color` property. */
|
|
85
|
+
export const SecondaryColorIcon = Template.bind({})
|
|
86
|
+
SecondaryColorIcon.args = {
|
|
87
|
+
name: 'complete-filled',
|
|
88
|
+
color: 'coral-65',
|
|
89
|
+
secondaryColor: 'honey-72',
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Some icons contain multiple colors and they don't use `color` property. You can still use different sizes tho. */
|
|
93
|
+
export const ColoredIcon = Template.bind({})
|
|
94
|
+
ColoredIcon.args = {
|
|
95
|
+
name: 'google-color',
|
|
96
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { html, nothing } from 'lit'
|
|
2
|
+
import { customElement, property, state } from 'lit/decorators.js'
|
|
3
|
+
import { HTMLInputTypeAttribute } from 'react'
|
|
4
|
+
|
|
5
|
+
import { TailwindElement } from '@/shared/tailwind-element'
|
|
6
|
+
import { customClassMap } from '@/shared/directives'
|
|
7
|
+
|
|
8
|
+
@customElement('lukso-input')
|
|
9
|
+
export class LuksoInput extends TailwindElement {
|
|
10
|
+
@property({ type: String })
|
|
11
|
+
value = ''
|
|
12
|
+
|
|
13
|
+
@property({ type: String })
|
|
14
|
+
name = ''
|
|
15
|
+
|
|
16
|
+
@property({ type: String })
|
|
17
|
+
type: HTMLInputTypeAttribute = 'text'
|
|
18
|
+
|
|
19
|
+
@property({ type: String })
|
|
20
|
+
placeholder = ''
|
|
21
|
+
|
|
22
|
+
@property({ type: String })
|
|
23
|
+
label = ''
|
|
24
|
+
|
|
25
|
+
@property({ type: String })
|
|
26
|
+
description = ''
|
|
27
|
+
|
|
28
|
+
@property({ type: String })
|
|
29
|
+
error = ''
|
|
30
|
+
|
|
31
|
+
@property({ type: String })
|
|
32
|
+
unit = ''
|
|
33
|
+
|
|
34
|
+
@property({ type: Boolean, attribute: 'is-full-width' })
|
|
35
|
+
isFullWidth = false
|
|
36
|
+
|
|
37
|
+
@property({ type: Boolean })
|
|
38
|
+
autofocus = false
|
|
39
|
+
|
|
40
|
+
@property({ type: Number })
|
|
41
|
+
max: number | undefined = undefined
|
|
42
|
+
|
|
43
|
+
@property({ type: Number })
|
|
44
|
+
min: number | undefined = undefined
|
|
45
|
+
|
|
46
|
+
@state()
|
|
47
|
+
private hasHocus = false
|
|
48
|
+
|
|
49
|
+
private defaultInputStyles = `bg-neutral-100 text-neutral-20 paragraph-16-regular px-4 py-3
|
|
50
|
+
border border-solid border-neutral-90 h-[48px] placeholder:neutral-70
|
|
51
|
+
outline-none transition transition-all duration-250 appearance-none`
|
|
52
|
+
|
|
53
|
+
private defaultUnitStyles = `paragraph-12-regular text-neutral-60 flex px-3.5 items-center relative
|
|
54
|
+
border border-solid border-neutral-90 h-[48px] transition transition-all duration-250
|
|
55
|
+
rounded-r-xl border-l-0 before:bg-neutral-90 before:absolute before:top-[calc(50%-12px)] before:left-0
|
|
56
|
+
before:w-[1px] before:h-[24px] whitespace-nowrap`
|
|
57
|
+
|
|
58
|
+
inputTemplate() {
|
|
59
|
+
return html`
|
|
60
|
+
<input
|
|
61
|
+
data-testid="input"
|
|
62
|
+
id=${this.name}
|
|
63
|
+
type=${this.type}
|
|
64
|
+
value=${this.value}
|
|
65
|
+
placeholder=${this.placeholder}
|
|
66
|
+
?autofocus=${this.autofocus}
|
|
67
|
+
min=${this.min}
|
|
68
|
+
max=${this.max}
|
|
69
|
+
class=${customClassMap({
|
|
70
|
+
[this.defaultInputStyles]: true,
|
|
71
|
+
['border-red-85 text-red-65 focus:border-red-65']: this.error !== '',
|
|
72
|
+
['border-neutral-35']: this.hasHocus,
|
|
73
|
+
['rounded-l-xl border-r-0']: this.unit !== '',
|
|
74
|
+
['rounded-xl']: this.unit === '',
|
|
75
|
+
['w-full']: this.isFullWidth,
|
|
76
|
+
['w-[350px]']: !this.isFullWidth && this.unit === '',
|
|
77
|
+
['w-[300px]']: !this.isFullWidth && this.unit !== '',
|
|
78
|
+
})}
|
|
79
|
+
@focus=${this.handleFocus}
|
|
80
|
+
@blur=${this.handleBlur}
|
|
81
|
+
@keyup=${this.handleKeyUp}
|
|
82
|
+
@keydown=${this.handleKeyDown}
|
|
83
|
+
@keypress=${this.handleKeyPress}
|
|
84
|
+
/>
|
|
85
|
+
`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
labelTemplate() {
|
|
89
|
+
return html`
|
|
90
|
+
<label for=${this.name} class="heading-h5 text-neutral-20 pb-2 block"
|
|
91
|
+
>${this.label}</label
|
|
92
|
+
>
|
|
93
|
+
`
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
descriptionTemplate() {
|
|
97
|
+
return html`
|
|
98
|
+
<div class="paragraph-12-regular text-neutral-20 pb-2">
|
|
99
|
+
${this.description ?? nothing}
|
|
100
|
+
</div>
|
|
101
|
+
`
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
errorTemplate() {
|
|
105
|
+
return html`<div class="paragraph-12-regular text-red-65 pt-2">
|
|
106
|
+
${this.error}
|
|
107
|
+
</div>`
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
unitTemplate() {
|
|
111
|
+
return html`<div
|
|
112
|
+
class=${customClassMap({
|
|
113
|
+
[this.defaultUnitStyles]: true,
|
|
114
|
+
['border-red-85']: this.error !== '',
|
|
115
|
+
['border-neutral-35']: this.hasHocus && this.error === '',
|
|
116
|
+
['border-red-65']: this.hasHocus && this.error !== '',
|
|
117
|
+
})}
|
|
118
|
+
>
|
|
119
|
+
${this.unit}
|
|
120
|
+
</div>`
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private handleFocus() {
|
|
124
|
+
this.hasHocus = true
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
private handleBlur() {
|
|
128
|
+
this.hasHocus = false
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private handleKeyUp(event: KeyboardEvent) {
|
|
132
|
+
const target = event.target as HTMLInputElement
|
|
133
|
+
const keyEvent = new CustomEvent('on-key-up', {
|
|
134
|
+
detail: {
|
|
135
|
+
value: target.value,
|
|
136
|
+
event,
|
|
137
|
+
},
|
|
138
|
+
bubbles: true,
|
|
139
|
+
composed: true,
|
|
140
|
+
})
|
|
141
|
+
this.dispatchEvent(keyEvent)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private handleKeyDown(event: KeyboardEvent) {
|
|
145
|
+
const target = event.target as HTMLInputElement
|
|
146
|
+
const keyEvent = new CustomEvent('on-key-down', {
|
|
147
|
+
detail: {
|
|
148
|
+
value: target.value,
|
|
149
|
+
event,
|
|
150
|
+
},
|
|
151
|
+
bubbles: true,
|
|
152
|
+
composed: true,
|
|
153
|
+
})
|
|
154
|
+
this.dispatchEvent(keyEvent)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private handleKeyPress(event: KeyboardEvent) {
|
|
158
|
+
const target = event.target as HTMLInputElement
|
|
159
|
+
const keyEvent = new CustomEvent('on-key-press', {
|
|
160
|
+
detail: {
|
|
161
|
+
value: target.value,
|
|
162
|
+
event,
|
|
163
|
+
},
|
|
164
|
+
bubbles: true,
|
|
165
|
+
composed: true,
|
|
166
|
+
})
|
|
167
|
+
this.dispatchEvent(keyEvent)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
render() {
|
|
171
|
+
return html`
|
|
172
|
+
<div>
|
|
173
|
+
${this.label ? this.labelTemplate() : nothing}
|
|
174
|
+
${this.description ? this.descriptionTemplate() : nothing}
|
|
175
|
+
<div class="flex">
|
|
176
|
+
${this.inputTemplate()} ${this.unit ? this.unitTemplate() : nothing}
|
|
177
|
+
</div>
|
|
178
|
+
${this.error ? this.errorTemplate() : nothing}
|
|
179
|
+
</div>
|
|
180
|
+
`
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
declare global {
|
|
185
|
+
interface HTMLElementTagNameMap {
|
|
186
|
+
'lukso-input': LuksoInput
|
|
187
|
+
}
|
|
188
|
+
}
|