@aquera/nile-elements 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1103 -629
- package/dist/internal/enum.cjs.js +1 -1
- package/dist/internal/enum.cjs.js.map +1 -1
- package/dist/internal/enum.esm.js +1 -1
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-carousel/index.cjs.js +1 -1
- package/dist/nile-carousel/index.esm.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js.map +1 -1
- package/dist/nile-carousel/nile-carousel.esm.js +1 -1
- package/dist/nile-dialog/index.cjs.js +1 -1
- package/dist/nile-dialog/index.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.esm.js +1 -1
- package/dist/nile-drawer/index.cjs.js +1 -1
- package/dist/nile-drawer/index.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.esm.js +1 -1
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/index.esm.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js.map +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.css.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.css.cjs.js.map +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.css.esm.js +137 -21
- package/dist/nile-floating-panel/nile-floating-panel.esm.js +1 -1
- package/dist/nile-icon/icons/svg/folder_delete.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/folder_delete.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/folder_delete.esm.js +1 -0
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/icons/svg/layers-three-02.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/layers-three-02.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/layers-three-02.esm.js +1 -1
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +1 -1
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/index.esm.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.esm.js +1 -1
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-otp-input/index.cjs.js +2 -0
- package/dist/nile-otp-input/index.cjs.js.map +1 -0
- package/dist/nile-otp-input/index.esm.js +1 -0
- package/dist/nile-otp-input/nile-otp-input.cjs.js +2 -0
- package/dist/nile-otp-input/nile-otp-input.cjs.js.map +1 -0
- package/dist/nile-otp-input/nile-otp-input.css.cjs.js +2 -0
- package/dist/nile-otp-input/nile-otp-input.css.cjs.js.map +1 -0
- package/dist/nile-otp-input/nile-otp-input.css.esm.js +257 -0
- package/dist/nile-otp-input/nile-otp-input.enum.cjs.js +2 -0
- package/dist/nile-otp-input/nile-otp-input.enum.cjs.js.map +1 -0
- package/dist/nile-otp-input/nile-otp-input.enum.esm.js +1 -0
- package/dist/nile-otp-input/nile-otp-input.esm.js +103 -0
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +1 -1
- package/dist/nile-side-bar-action-menu-item/index.cjs.js +1 -1
- package/dist/nile-side-bar-action-menu-item/index.esm.js +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.cjs.js +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.cjs.js.map +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.esm.js +1 -1
- package/dist/nile-tab/index.cjs.js +1 -1
- package/dist/nile-tab/index.esm.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.esm.js +1 -1
- package/dist/nile-tab-group/index.cjs.js +1 -1
- package/dist/nile-tab-group/index.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/nile-toast/index.cjs.js +1 -1
- package/dist/nile-toast/index.esm.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.esm.js +1 -1
- package/dist/nile-tree/index.cjs.js +1 -1
- package/dist/nile-tree/index.esm.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
- package/dist/nile-tree/nile-tree.esm.js +1 -1
- package/dist/nile-tree-item/index.cjs.js +1 -1
- package/dist/nile-tree-item/index.esm.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -1
- package/dist/nile-tree-item/nile-tree-item.esm.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/index.esm.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/enum.d.ts +21 -0
- package/dist/src/internal/enum.js +23 -1
- package/dist/src/internal/enum.js.map +1 -1
- package/dist/src/nile-floating-panel/index.js.map +1 -1
- package/dist/src/nile-floating-panel/nile-floating-panel.css.d.ts +1 -1
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js +147 -20
- package/dist/src/nile-floating-panel/nile-floating-panel.css.js.map +1 -1
- package/dist/src/nile-floating-panel/nile-floating-panel.d.ts +92 -24
- package/dist/src/nile-floating-panel/nile-floating-panel.js +489 -159
- package/dist/src/nile-floating-panel/nile-floating-panel.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/folder_delete.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/folder_delete.js +5 -0
- package/dist/src/nile-icon/icons/svg/folder_delete.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/index.d.ts +1 -0
- package/dist/src/nile-icon/icons/svg/index.js +1 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/layers-three-02.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/layers-three-02.js +1 -1
- package/dist/src/nile-icon/icons/svg/layers-three-02.js.map +1 -1
- package/dist/src/nile-otp-input/index.d.ts +1 -0
- package/dist/src/nile-otp-input/index.js +2 -0
- package/dist/src/nile-otp-input/index.js.map +1 -0
- package/dist/src/nile-otp-input/nile-otp-input.css.d.ts +12 -0
- package/dist/src/nile-otp-input/nile-otp-input.css.js +269 -0
- package/dist/src/nile-otp-input/nile-otp-input.css.js.map +1 -0
- package/dist/src/nile-otp-input/nile-otp-input.d.ts +156 -0
- package/dist/src/nile-otp-input/nile-otp-input.enum.d.ts +26 -0
- package/dist/src/nile-otp-input/nile-otp-input.enum.js +32 -0
- package/dist/src/nile-otp-input/nile-otp-input.enum.js.map +1 -0
- package/dist/src/nile-otp-input/nile-otp-input.js +762 -0
- package/dist/src/nile-otp-input/nile-otp-input.js.map +1 -0
- package/dist/src/nile-otp-input/nile-otp-input.test.d.ts +1 -0
- package/dist/src/nile-otp-input/nile-otp-input.test.js +493 -0
- package/dist/src/nile-otp-input/nile-otp-input.test.js.map +1 -0
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tippy.esm-57628c2b.esm.js +1 -0
- package/dist/tippy.esm-78baa8f2.cjs.js +2 -0
- package/dist/tippy.esm-78baa8f2.cjs.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/plop-templates/lit/index.ts.hbs +1 -1
- package/plop-templates/lit/lit.css.ts.hbs +1 -1
- package/plop-templates/lit/lit.ts.hbs +1 -1
- package/src/index.ts +3 -2
- package/src/internal/enum.ts +23 -1
- package/src/nile-floating-panel/index.ts +0 -1
- package/src/nile-floating-panel/nile-floating-panel.css.ts +149 -21
- package/src/nile-floating-panel/nile-floating-panel.ts +498 -190
- package/src/nile-icon/icons/svg/folder_delete.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +1 -0
- package/src/nile-icon/icons/svg/layers-three-02.ts +1 -1
- package/src/nile-otp-input/index.ts +1 -0
- package/src/nile-otp-input/nile-otp-input.css.ts +271 -0
- package/src/nile-otp-input/nile-otp-input.enum.ts +30 -0
- package/src/nile-otp-input/nile-otp-input.test.ts +732 -0
- package/src/nile-otp-input/nile-otp-input.ts +835 -0
- package/vscode-html-custom-data.json +383 -23
- package/dist/nile-floating-panel/anchor-manager.cjs.js +0 -2
- package/dist/nile-floating-panel/anchor-manager.cjs.js.map +0 -1
- package/dist/nile-floating-panel/anchor-manager.esm.js +0 -1
- package/dist/nile-floating-panel/content-manager.cjs.js +0 -2
- package/dist/nile-floating-panel/content-manager.cjs.js.map +0 -1
- package/dist/nile-floating-panel/content-manager.esm.js +0 -1
- package/dist/nile-floating-panel/event-manager.cjs.js +0 -2
- package/dist/nile-floating-panel/event-manager.cjs.js.map +0 -1
- package/dist/nile-floating-panel/event-manager.esm.js +0 -1
- package/dist/nile-floating-panel/position-manager.cjs.js +0 -2
- package/dist/nile-floating-panel/position-manager.cjs.js.map +0 -1
- package/dist/nile-floating-panel/position-manager.esm.js +0 -1
- package/dist/nile-floating-panel/style-manager.cjs.js +0 -2
- package/dist/nile-floating-panel/style-manager.cjs.js.map +0 -1
- package/dist/nile-floating-panel/style-manager.esm.js +0 -1
- package/dist/nile-floating-panel/types.cjs.js +0 -2
- package/dist/nile-floating-panel/types.cjs.js.map +0 -1
- package/dist/nile-floating-panel/types.esm.js +0 -1
- package/dist/src/nile-floating-panel/anchor-manager.d.ts +0 -6
- package/dist/src/nile-floating-panel/anchor-manager.js +0 -27
- package/dist/src/nile-floating-panel/anchor-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/content-manager.d.ts +0 -5
- package/dist/src/nile-floating-panel/content-manager.js +0 -44
- package/dist/src/nile-floating-panel/content-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/event-manager.d.ts +0 -14
- package/dist/src/nile-floating-panel/event-manager.js +0 -52
- package/dist/src/nile-floating-panel/event-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/position-manager.d.ts +0 -17
- package/dist/src/nile-floating-panel/position-manager.js +0 -72
- package/dist/src/nile-floating-panel/position-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/style-manager.d.ts +0 -9
- package/dist/src/nile-floating-panel/style-manager.js +0 -44
- package/dist/src/nile-floating-panel/style-manager.js.map +0 -1
- package/dist/src/nile-floating-panel/types.d.ts +0 -11
- package/dist/src/nile-floating-panel/types.js +0 -2
- package/dist/src/nile-floating-panel/types.js.map +0 -1
- package/src/nile-floating-panel/anchor-manager.ts +0 -33
- package/src/nile-floating-panel/content-manager.ts +0 -54
- package/src/nile-floating-panel/event-manager.ts +0 -74
- package/src/nile-floating-panel/position-manager.ts +0 -102
- package/src/nile-floating-panel/style-manager.ts +0 -54
- package/src/nile-floating-panel/types.ts +0 -15
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
/**
|
|
9
|
+
* OTP input CSS
|
|
10
|
+
*/
|
|
11
|
+
export const styles = css `
|
|
12
|
+
:host {
|
|
13
|
+
display: block;
|
|
14
|
+
--ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;
|
|
15
|
+
-webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));
|
|
16
|
+
-moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));
|
|
17
|
+
text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.form-control {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.form-control .form-control__label {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.form-control--has-label .form-control__label {
|
|
32
|
+
display: inline-block;
|
|
33
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));
|
|
34
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));
|
|
35
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));
|
|
38
|
+
line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));
|
|
39
|
+
letter-spacing: 0.2px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([required]) .form-control--has-label .form-control__label::after {
|
|
43
|
+
content: '*';
|
|
44
|
+
margin-inline-start: -2px;
|
|
45
|
+
color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.otp {
|
|
49
|
+
position: relative;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: var(--nile-spacing-md, var(--ng-spacing-2));
|
|
53
|
+
width: fit-content;
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ---- Base cell ---- */
|
|
58
|
+
|
|
59
|
+
.otp__cell {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
width: var(--nile-spacing-5xl, var(--ng-spacing-10));
|
|
62
|
+
height: var(--nile-spacing-5xl, var(--ng-spacing-10));
|
|
63
|
+
min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));
|
|
64
|
+
padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));
|
|
65
|
+
border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));
|
|
66
|
+
border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));
|
|
67
|
+
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
68
|
+
box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));
|
|
69
|
+
outline: var(--nile-outline-none, var(--ng-private-outline-transparent));
|
|
70
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));
|
|
71
|
+
text-align: center;
|
|
72
|
+
font-family: var(--nile-font-family, var(--ng-font-family-display));
|
|
73
|
+
font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));
|
|
74
|
+
font-style: normal;
|
|
75
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));
|
|
76
|
+
line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));
|
|
77
|
+
letter-spacing: 0.2px;
|
|
78
|
+
overflow: clip;
|
|
79
|
+
caret-color: transparent;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.otp__cell[type='password'] {
|
|
85
|
+
font-family: caption;
|
|
86
|
+
letter-spacing: 0;
|
|
87
|
+
}
|
|
88
|
+
/* ---- Hover (mirrors .input--standard:hover) ---- */
|
|
89
|
+
|
|
90
|
+
.otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {
|
|
91
|
+
border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.otp--warning:not(.otp--disabled) .otp__cell:hover {
|
|
95
|
+
border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.otp--error:not(.otp--disabled) .otp__cell:hover {
|
|
99
|
+
border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.otp--success:not(.otp--disabled) .otp__cell:hover {
|
|
103
|
+
border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */
|
|
107
|
+
|
|
108
|
+
.otp__cell:focus {
|
|
109
|
+
outline: none;
|
|
110
|
+
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
111
|
+
border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));
|
|
112
|
+
box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.otp__cell--active {
|
|
116
|
+
position: relative;
|
|
117
|
+
cursor: text;
|
|
118
|
+
caret-color: auto;
|
|
119
|
+
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));
|
|
120
|
+
border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));
|
|
121
|
+
box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.otp__cell--active::before {
|
|
125
|
+
content: "";
|
|
126
|
+
position: absolute;
|
|
127
|
+
inset: 0;
|
|
128
|
+
pointer-events: none;
|
|
129
|
+
border-radius: inherit;
|
|
130
|
+
box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.otp--warning .otp__cell:focus,
|
|
134
|
+
.otp--warning .otp__cell--active {
|
|
135
|
+
border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));
|
|
136
|
+
box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));
|
|
137
|
+
outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.otp--warning .otp__cell--active::before {
|
|
141
|
+
box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.otp--success .otp__cell:focus,
|
|
145
|
+
.otp--success .otp__cell--active {
|
|
146
|
+
border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));
|
|
147
|
+
box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));
|
|
148
|
+
outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.otp--success .otp__cell--active::before {
|
|
152
|
+
box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.otp--error .otp__cell:focus,
|
|
156
|
+
.otp--error .otp__cell--active {
|
|
157
|
+
border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));
|
|
158
|
+
box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));
|
|
159
|
+
outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.otp--error .otp__cell--active::before {
|
|
163
|
+
box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.otp__cell::selection {
|
|
167
|
+
background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));
|
|
168
|
+
color: var(--nile-colors-white-base, var(--ng-colors-fg-white));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.otp__cell::placeholder {
|
|
172
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));
|
|
173
|
+
opacity: 0.9;
|
|
174
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* ---- Separator ---- */
|
|
178
|
+
|
|
179
|
+
.otp__separator {
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
flex-shrink: 0;
|
|
184
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));
|
|
185
|
+
font-family: var(--nile-font-family, var(--ng-font-family-display ));
|
|
186
|
+
font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));
|
|
187
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));
|
|
188
|
+
line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));
|
|
189
|
+
user-select: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* ---- State: warning ---- */
|
|
193
|
+
|
|
194
|
+
.otp--warning .otp__cell {
|
|
195
|
+
border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* ---- State: error ---- */
|
|
199
|
+
|
|
200
|
+
.otp--error .otp__cell {
|
|
201
|
+
border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* ---- State: success ---- */
|
|
205
|
+
|
|
206
|
+
.otp--success .otp__cell {
|
|
207
|
+
border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* ---- State: readonly ---- */
|
|
211
|
+
|
|
212
|
+
.otp--readonly .otp__cell {
|
|
213
|
+
cursor: default;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */
|
|
217
|
+
|
|
218
|
+
.otp--disabled .otp__cell {
|
|
219
|
+
cursor: not-allowed;
|
|
220
|
+
color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));
|
|
221
|
+
border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));
|
|
222
|
+
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.otp--disabled .otp__cell::placeholder {
|
|
226
|
+
color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* ---- Hidden value input ---- */
|
|
230
|
+
|
|
231
|
+
.otp__value-input {
|
|
232
|
+
position: absolute;
|
|
233
|
+
top: 0;
|
|
234
|
+
left: 0;
|
|
235
|
+
width: 100%;
|
|
236
|
+
height: 100%;
|
|
237
|
+
padding: 0;
|
|
238
|
+
margin: 0;
|
|
239
|
+
opacity: 0;
|
|
240
|
+
z-index: -1;
|
|
241
|
+
pointer-events: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ---- Help text ---- */
|
|
245
|
+
|
|
246
|
+
.form-control__help-text {
|
|
247
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));
|
|
248
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));
|
|
249
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));
|
|
250
|
+
font-style: normal;
|
|
251
|
+
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));
|
|
252
|
+
line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));
|
|
253
|
+
letter-spacing: 0.2px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* ---- Error message ---- */
|
|
257
|
+
|
|
258
|
+
.form-control__error-message {
|
|
259
|
+
display: block;
|
|
260
|
+
color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));
|
|
261
|
+
margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));
|
|
262
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));
|
|
263
|
+
font-style: normal;
|
|
264
|
+
line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));
|
|
265
|
+
letter-spacing: 0.2px;
|
|
266
|
+
}
|
|
267
|
+
`;
|
|
268
|
+
export default [styles];
|
|
269
|
+
//# sourceMappingURL=nile-otp-input.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nile-otp-input.css.js","sourceRoot":"","sources":["../../../src/nile-otp-input/nile-otp-input.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQxB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * OTP input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));\n }\n\n .form-control {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));\n align-items: flex-start;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));\n line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n .otp {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-2));\n width: fit-content;\n max-width: 100%;\n }\n\n /* ---- Base cell ---- */\n\n .otp__cell {\n box-sizing: border-box;\n width: var(--nile-spacing-5xl, var(--ng-spacing-10));\n height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));\n border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n text-align: center;\n font-family: var(--nile-font-family, var(--ng-font-family-display));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));\n letter-spacing: 0.2px;\n overflow: clip;\n caret-color: transparent;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;\n }\n\n .otp__cell[type='password'] {\n font-family: caption;\n letter-spacing: 0;\n }\n /* ---- Hover (mirrors .input--standard:hover) ---- */\n\n .otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n }\n\n .otp--warning:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));\n }\n\n .otp--error:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));\n }\n\n .otp--success:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));\n }\n\n /* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */\n\n .otp__cell:focus {\n outline: none;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active {\n position: relative;\n cursor: text;\n caret-color: auto;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));\n }\n\n .otp--warning .otp__cell:focus,\n .otp--warning .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));\n }\n\n .otp--warning .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .otp--success .otp__cell:focus,\n .otp--success .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));\n }\n\n .otp--success .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));\n }\n\n .otp--error .otp__cell:focus,\n .otp--error .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));\n }\n\n .otp--error .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));\n }\n\n .otp__cell::selection {\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));\n color: var(--nile-colors-white-base, var(--ng-colors-fg-white));\n }\n\n .otp__cell::placeholder {\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n opacity: 0.9;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n }\n\n /* ---- Separator ---- */\n\n .otp__separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n font-family: var(--nile-font-family, var(--ng-font-family-display ));\n font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));\n user-select: none;\n }\n\n /* ---- State: warning ---- */\n\n .otp--warning .otp__cell {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));\n }\n\n /* ---- State: error ---- */\n\n .otp--error .otp__cell {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));\n }\n\n /* ---- State: success ---- */\n\n .otp--success .otp__cell {\n border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));\n }\n\n /* ---- State: readonly ---- */\n\n .otp--readonly .otp__cell {\n cursor: default;\n }\n\n /* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */\n\n .otp--disabled .otp__cell {\n cursor: not-allowed;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));\n }\n\n .otp--disabled .otp__cell::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));\n }\n\n /* ---- Hidden value input ---- */\n\n .otp__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n /* ---- Help text ---- */\n\n .form-control__help-text {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));\n line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n /* ---- Error message ---- */\n\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Aquera Inc 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import NileElement from '../internal/nile-element';
|
|
8
|
+
import type { CSSResultGroup } from 'lit';
|
|
9
|
+
import type { NileFormControl } from '../internal/nile-element';
|
|
10
|
+
import '../nile-form-help-text';
|
|
11
|
+
import '../nile-form-error-message';
|
|
12
|
+
/**
|
|
13
|
+
* @summary OTP input renders a segmented set of cells but behaves like a single logical form control.
|
|
14
|
+
* @tag nile-otp-input
|
|
15
|
+
*
|
|
16
|
+
* @slot label - The input label. Alternatively, use the `label` attribute.
|
|
17
|
+
* @slot help-text - Helpful guidance text. Alternatively, use the `help-text` attribute.
|
|
18
|
+
*
|
|
19
|
+
* @event nile-input - Emitted whenever the OTP value changes from user input.
|
|
20
|
+
* @event nile-change - Emitted whenever the OTP value changes from user input.
|
|
21
|
+
* @event nile-complete - Emitted when all OTP cells are filled.
|
|
22
|
+
* @event nile-focus - Emitted when focus enters the component.
|
|
23
|
+
* @event nile-blur - Emitted when focus leaves the component.
|
|
24
|
+
* @event nile-paste - Emitted when OTP text is pasted.
|
|
25
|
+
* @event nile-invalid - Emitted when the control is invalid.
|
|
26
|
+
*
|
|
27
|
+
* @csspart form-control - Wrapper for label, input, and help/error content.
|
|
28
|
+
* @csspart form-control-label - Label wrapper.
|
|
29
|
+
* @csspart form-control-input - Input wrapper.
|
|
30
|
+
* @csspart form-control-help-text - Help text wrapper.
|
|
31
|
+
* @csspart form-control-error-message - Error message wrapper.
|
|
32
|
+
* @csspart base - OTP cell container.
|
|
33
|
+
* @csspart cell - Individual OTP cell.
|
|
34
|
+
* @csspart separator - Separator element between cell groups.
|
|
35
|
+
*/
|
|
36
|
+
export declare class NileOtpInput extends NileElement implements NileFormControl {
|
|
37
|
+
static styles: CSSResultGroup;
|
|
38
|
+
private readonly formControlController;
|
|
39
|
+
private readonly hasSlotController;
|
|
40
|
+
private customValidationMessage;
|
|
41
|
+
private wasComplete;
|
|
42
|
+
valueInput: HTMLInputElement;
|
|
43
|
+
cellInputs: NodeListOf<HTMLInputElement>;
|
|
44
|
+
private hasFocus;
|
|
45
|
+
private activeIndex;
|
|
46
|
+
private cells;
|
|
47
|
+
/** The name of the input, submitted as a name/value pair with form data. */
|
|
48
|
+
name: string;
|
|
49
|
+
/** The current value of the OTP control. */
|
|
50
|
+
value: string;
|
|
51
|
+
/** The default value of the form control. Primarily used for resetting the form control. */
|
|
52
|
+
defaultValue: string;
|
|
53
|
+
/** Number of OTP cells. Values below 4 are clamped to 4. */
|
|
54
|
+
length: number;
|
|
55
|
+
/** Restricts input to numeric digits when true. Overridden by `alphanumeric`. */
|
|
56
|
+
numericOnly: boolean;
|
|
57
|
+
/** Allows both letters and digits. When present, overrides `numeric-only`. */
|
|
58
|
+
alphanumeric: boolean;
|
|
59
|
+
/** The input's label. */
|
|
60
|
+
label: string;
|
|
61
|
+
helpText: string;
|
|
62
|
+
errorMessage: string;
|
|
63
|
+
/** Placeholder shown inside each OTP cell. */
|
|
64
|
+
placeholder: string;
|
|
65
|
+
/** Optional separator text rendered between configured OTP groups (for example "-"). */
|
|
66
|
+
separator: string;
|
|
67
|
+
/** Renders a separator after each N cells when `separator` is set. */
|
|
68
|
+
separatorEvery: number;
|
|
69
|
+
/** Comma-separated zero-based cell indexes after which separators are rendered. */
|
|
70
|
+
separatorPositions: string;
|
|
71
|
+
/** Masks filled cells with dots, showing each character briefly while typing. */
|
|
72
|
+
masked: boolean;
|
|
73
|
+
/** Sets the input to a warning state, changing its visual appearance. */
|
|
74
|
+
warning: boolean;
|
|
75
|
+
/** Sets the input to an error state, changing its visual appearance. */
|
|
76
|
+
error: boolean;
|
|
77
|
+
/** Sets the input to a success state, changing its visual appearance. */
|
|
78
|
+
success: boolean;
|
|
79
|
+
/** Disables the control. */
|
|
80
|
+
disabled: boolean;
|
|
81
|
+
/** Makes the control readonly. */
|
|
82
|
+
readonly: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
|
|
85
|
+
* to place the form control outside of a form and associate it with the form that has this `id`.
|
|
86
|
+
*/
|
|
87
|
+
form: string;
|
|
88
|
+
/** Makes this field required. */
|
|
89
|
+
required: boolean;
|
|
90
|
+
/** Optional regex pattern for full OTP validation. */
|
|
91
|
+
pattern: string;
|
|
92
|
+
/** Indicates that the input should receive focus on page load. */
|
|
93
|
+
autofocus: boolean;
|
|
94
|
+
/** Controls keyboard type shown on supporting virtual keyboards. */
|
|
95
|
+
inputmode: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
96
|
+
/** The autocomplete mode used on the first OTP cell. */
|
|
97
|
+
autocomplete: string;
|
|
98
|
+
connectedCallback(): void;
|
|
99
|
+
disconnectedCallback(): void;
|
|
100
|
+
firstUpdated(): void;
|
|
101
|
+
/** Gets the validity state object. */
|
|
102
|
+
get validity(): ValidityState;
|
|
103
|
+
/** Gets the validation message. */
|
|
104
|
+
get validationMessage(): string;
|
|
105
|
+
/** Returns true when all OTP cells have values. */
|
|
106
|
+
get complete(): boolean;
|
|
107
|
+
private getNormalizedLength;
|
|
108
|
+
private isNumericMode;
|
|
109
|
+
private getResolvedInputMode;
|
|
110
|
+
private getValidationPattern;
|
|
111
|
+
private isAllowedCharacter;
|
|
112
|
+
private toOtpCharacters;
|
|
113
|
+
private normalizeValue;
|
|
114
|
+
private createCells;
|
|
115
|
+
private syncCellsFromValue;
|
|
116
|
+
private isComplete;
|
|
117
|
+
private getFirstEmptyIndex;
|
|
118
|
+
private getSeparatorIndices;
|
|
119
|
+
private getCellPlaceholder;
|
|
120
|
+
private focusCell;
|
|
121
|
+
private updateCell;
|
|
122
|
+
private fillFromIndex;
|
|
123
|
+
private commitUserValueUpdate;
|
|
124
|
+
private handleInvalid;
|
|
125
|
+
private handleCellFocus;
|
|
126
|
+
private handleCellBlur;
|
|
127
|
+
private handleCellInput;
|
|
128
|
+
private handleCellPaste;
|
|
129
|
+
private handleCellKeyDown;
|
|
130
|
+
handleLengthChange(): void;
|
|
131
|
+
handleValueChange(): void;
|
|
132
|
+
handleDisabledChange(): void;
|
|
133
|
+
handleNumericOnlyChange(): void;
|
|
134
|
+
handlePatternChange(): void;
|
|
135
|
+
/** Checks validity without showing browser UI. */
|
|
136
|
+
checkValidity(): boolean;
|
|
137
|
+
/** Returns associated form if one exists. */
|
|
138
|
+
getForm(): HTMLFormElement | null;
|
|
139
|
+
/** Checks validity and shows browser UI when invalid. */
|
|
140
|
+
reportValidity(): boolean;
|
|
141
|
+
/** Sets a custom validation message. Pass empty string to restore validity. */
|
|
142
|
+
setCustomValidity(message: string): void;
|
|
143
|
+
/** Focuses the first empty cell, or the last one when complete. */
|
|
144
|
+
focus(options?: FocusOptions): void;
|
|
145
|
+
/** Removes focus from whichever OTP cell is currently focused. */
|
|
146
|
+
blur(): void;
|
|
147
|
+
/** Clears all OTP cells. */
|
|
148
|
+
clear(): void;
|
|
149
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
150
|
+
}
|
|
151
|
+
export default NileOtpInput;
|
|
152
|
+
declare global {
|
|
153
|
+
interface HTMLElementTagNameMap {
|
|
154
|
+
'nile-otp-input': NileOtpInput;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare enum OtpInputMode {
|
|
2
|
+
NONE = "none",
|
|
3
|
+
TEXT = "text",
|
|
4
|
+
DECIMAL = "decimal",
|
|
5
|
+
NUMERIC = "numeric",
|
|
6
|
+
TEL = "tel",
|
|
7
|
+
SEARCH = "search",
|
|
8
|
+
EMAIL = "email",
|
|
9
|
+
URL = "url"
|
|
10
|
+
}
|
|
11
|
+
export declare enum OtpInputType {
|
|
12
|
+
TEXT = "text",
|
|
13
|
+
PASSWORD = "password"
|
|
14
|
+
}
|
|
15
|
+
export declare enum OtpEnterKeyHint {
|
|
16
|
+
DONE = "done",
|
|
17
|
+
NEXT = "next"
|
|
18
|
+
}
|
|
19
|
+
export declare enum OtpAutoComplete {
|
|
20
|
+
ONE_TIME_CODE = "one-time-code",
|
|
21
|
+
OFF = "off"
|
|
22
|
+
}
|
|
23
|
+
export declare enum OtpCellPattern {
|
|
24
|
+
NUMERIC = "[0-9]*",
|
|
25
|
+
ALPHANUMERIC = "[A-Za-z0-9]*"
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var OtpInputMode;
|
|
2
|
+
(function (OtpInputMode) {
|
|
3
|
+
OtpInputMode["NONE"] = "none";
|
|
4
|
+
OtpInputMode["TEXT"] = "text";
|
|
5
|
+
OtpInputMode["DECIMAL"] = "decimal";
|
|
6
|
+
OtpInputMode["NUMERIC"] = "numeric";
|
|
7
|
+
OtpInputMode["TEL"] = "tel";
|
|
8
|
+
OtpInputMode["SEARCH"] = "search";
|
|
9
|
+
OtpInputMode["EMAIL"] = "email";
|
|
10
|
+
OtpInputMode["URL"] = "url";
|
|
11
|
+
})(OtpInputMode || (OtpInputMode = {}));
|
|
12
|
+
export var OtpInputType;
|
|
13
|
+
(function (OtpInputType) {
|
|
14
|
+
OtpInputType["TEXT"] = "text";
|
|
15
|
+
OtpInputType["PASSWORD"] = "password";
|
|
16
|
+
})(OtpInputType || (OtpInputType = {}));
|
|
17
|
+
export var OtpEnterKeyHint;
|
|
18
|
+
(function (OtpEnterKeyHint) {
|
|
19
|
+
OtpEnterKeyHint["DONE"] = "done";
|
|
20
|
+
OtpEnterKeyHint["NEXT"] = "next";
|
|
21
|
+
})(OtpEnterKeyHint || (OtpEnterKeyHint = {}));
|
|
22
|
+
export var OtpAutoComplete;
|
|
23
|
+
(function (OtpAutoComplete) {
|
|
24
|
+
OtpAutoComplete["ONE_TIME_CODE"] = "one-time-code";
|
|
25
|
+
OtpAutoComplete["OFF"] = "off";
|
|
26
|
+
})(OtpAutoComplete || (OtpAutoComplete = {}));
|
|
27
|
+
export var OtpCellPattern;
|
|
28
|
+
(function (OtpCellPattern) {
|
|
29
|
+
OtpCellPattern["NUMERIC"] = "[0-9]*";
|
|
30
|
+
OtpCellPattern["ALPHANUMERIC"] = "[A-Za-z0-9]*";
|
|
31
|
+
})(OtpCellPattern || (OtpCellPattern = {}));
|
|
32
|
+
//# sourceMappingURL=nile-otp-input.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nile-otp-input.enum.js","sourceRoot":"","sources":["../../../src/nile-otp-input/nile-otp-input.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,iCAAiB,CAAA;IACjB,+BAAe,CAAA;IACf,2BAAW,CAAA;AACb,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,qCAAqB,CAAA;AACvB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kDAA+B,CAAA;IAC/B,8BAAW,CAAA;AACb,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,+CAA6B,CAAA;AAC/B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB","sourcesContent":["export enum OtpInputMode {\n NONE = 'none',\n TEXT = 'text',\n DECIMAL = 'decimal',\n NUMERIC = 'numeric',\n TEL = 'tel',\n SEARCH = 'search',\n EMAIL = 'email',\n URL = 'url',\n}\n\nexport enum OtpInputType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport enum OtpEnterKeyHint {\n DONE = 'done',\n NEXT = 'next',\n}\n\nexport enum OtpAutoComplete {\n ONE_TIME_CODE = 'one-time-code',\n OFF = 'off',\n}\n\nexport enum OtpCellPattern {\n NUMERIC = '[0-9]*',\n ALPHANUMERIC = '[A-Za-z0-9]*',\n}\n"]}
|