@pathscale/ui 1.1.34 → 1.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button/Button.css +10 -1
- package/dist/components/button/Button.d.ts +2 -0
- package/dist/components/button/Button.js +31 -6
- package/dist/components/button-group/ButtonGroup.css +117 -0
- package/dist/components/button-group/ButtonGroup.d.ts +23 -0
- package/dist/components/button-group/ButtonGroup.js +91 -0
- package/dist/components/button-group/context.d.ts +8 -0
- package/dist/components/button-group/context.js +3 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.js +6 -0
- package/dist/components/card/Card.css +110 -0
- package/dist/components/card/Card.d.ts +26 -26
- package/dist/components/card/Card.js +131 -70
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/card/index.js +6 -1
- package/dist/components/checkbox/Checkbox.js +18 -4
- package/dist/components/checkbox-group/CheckboxGroup.css +10 -0
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +18 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +97 -0
- package/dist/components/checkbox-group/context.d.ts +11 -0
- package/dist/components/checkbox-group/context.js +3 -0
- package/dist/components/checkbox-group/index.d.ts +4 -0
- package/dist/components/checkbox-group/index.js +4 -0
- package/dist/components/chip/Chip.css +11 -9
- package/dist/components/chip/Chip.d.ts +2 -2
- package/dist/components/chip/Chip.js +38 -30
- package/dist/components/close-button/CloseButton.css +81 -0
- package/dist/components/close-button/CloseButton.d.ts +14 -0
- package/dist/components/close-button/CloseButton.js +76 -0
- package/dist/components/close-button/index.d.ts +1 -0
- package/dist/components/close-button/index.js +3 -0
- package/dist/components/combo-box/ComboBox.css +344 -0
- package/dist/components/combo-box/ComboBox.d.ts +86 -0
- package/dist/components/combo-box/ComboBox.js +708 -0
- package/dist/components/combo-box/index.d.ts +1 -0
- package/dist/components/combo-box/index.js +10 -0
- package/dist/components/date-field/DateField.css +215 -0
- package/dist/components/date-field/DateField.d.ts +64 -0
- package/dist/components/date-field/DateField.js +341 -0
- package/dist/components/date-field/index.d.ts +1 -0
- package/dist/components/date-field/index.js +11 -0
- package/dist/components/description/Description.css +10 -0
- package/dist/components/description/Description.d.ts +11 -0
- package/dist/components/{form/Label.js → description/Description.js} +23 -14
- package/dist/components/description/index.d.ts +1 -0
- package/dist/components/description/index.js +5 -0
- package/dist/components/drawer/Drawer.css +15 -0
- package/dist/components/drawer/Drawer.d.ts +2 -0
- package/dist/components/drawer/Drawer.js +24 -16
- package/dist/components/error-message/ErrorMessage.css +20 -0
- package/dist/components/error-message/ErrorMessage.d.ts +11 -0
- package/dist/components/error-message/ErrorMessage.js +40 -0
- package/dist/components/error-message/index.d.ts +1 -0
- package/dist/components/error-message/index.js +5 -0
- package/dist/components/field-error/FieldError.css +27 -0
- package/dist/components/field-error/FieldError.d.ts +21 -0
- package/dist/components/field-error/FieldError.js +69 -0
- package/dist/components/field-error/index.d.ts +1 -0
- package/dist/components/field-error/index.js +5 -0
- package/dist/components/fieldset/Fieldset.css +30 -0
- package/dist/components/fieldset/Fieldset.d.ts +22 -9
- package/dist/components/fieldset/Fieldset.js +88 -44
- package/dist/components/fieldset/index.d.ts +1 -2
- package/dist/components/fieldset/index.js +7 -2
- package/dist/components/form/Form.css +5 -0
- package/dist/components/form/Form.d.ts +10 -16
- package/dist/components/form/Form.js +33 -16
- package/dist/components/form/index.d.ts +1 -4
- package/dist/components/form/index.js +3 -4
- package/dist/components/header/Header.css +13 -0
- package/dist/components/header/Header.d.ts +9 -0
- package/dist/components/{menu/MenuDetails.js → header/Header.js} +17 -20
- package/dist/components/header/index.d.ts +1 -0
- package/dist/components/header/index.js +5 -0
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +62 -68
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +58 -64
- package/dist/components/input/Input.css +3 -2
- package/dist/components/input/Input.d.ts +2 -2
- package/dist/components/input/Input.js +7 -7
- package/dist/components/input-group/InputGroup.css +172 -0
- package/dist/components/input-group/InputGroup.d.ts +44 -0
- package/dist/components/input-group/InputGroup.js +227 -0
- package/dist/components/input-group/index.d.ts +1 -0
- package/dist/components/input-group/index.js +9 -0
- package/dist/components/input-otp/InputOTP.css +170 -0
- package/dist/components/input-otp/InputOTP.d.ts +46 -0
- package/dist/components/input-otp/InputOTP.js +385 -0
- package/dist/components/input-otp/index.d.ts +1 -0
- package/dist/components/input-otp/index.js +11 -0
- package/dist/components/label/Label.css +30 -0
- package/dist/components/label/Label.d.ts +17 -0
- package/dist/components/label/Label.js +64 -0
- package/dist/components/label/index.d.ts +1 -0
- package/dist/components/label/index.js +5 -0
- package/dist/components/list-box/ListBox.css +148 -0
- package/dist/components/list-box/ListBox.d.ts +23 -0
- package/dist/components/list-box/ListBox.js +224 -0
- package/dist/components/list-box/ListBoxItem.d.ts +28 -0
- package/dist/components/list-box/ListBoxItem.js +231 -0
- package/dist/components/list-box/ListBoxSection.d.ts +11 -0
- package/dist/components/list-box/ListBoxSection.js +48 -0
- package/dist/components/list-box/context.d.ts +27 -0
- package/dist/components/list-box/context.js +3 -0
- package/dist/components/list-box/index.d.ts +17 -0
- package/dist/components/list-box/index.js +17 -0
- package/dist/components/menu/Menu.css +199 -0
- package/dist/components/menu/Menu.d.ts +32 -20
- package/dist/components/menu/Menu.js +213 -39
- package/dist/components/menu/MenuItem.d.ts +35 -5
- package/dist/components/menu/MenuItem.js +270 -19
- package/dist/components/menu/MenuSection.d.ts +11 -0
- package/dist/components/menu/MenuSection.js +48 -0
- package/dist/components/menu/context.d.ts +26 -0
- package/dist/components/menu/context.js +3 -0
- package/dist/components/menu/index.d.ts +4 -3
- package/dist/components/menu/index.js +11 -2
- package/dist/components/number-field/NumberField.css +198 -0
- package/dist/components/number-field/NumberField.d.ts +48 -0
- package/dist/components/number-field/NumberField.js +350 -0
- package/dist/components/number-field/index.d.ts +1 -0
- package/dist/components/number-field/index.js +9 -0
- package/dist/components/search-field/SearchField.css +183 -0
- package/dist/components/search-field/SearchField.d.ts +53 -0
- package/dist/components/search-field/SearchField.js +303 -0
- package/dist/components/search-field/index.d.ts +1 -0
- package/dist/components/search-field/index.js +9 -0
- package/dist/components/select/Select.css +16 -10
- package/dist/components/select/Select.d.ts +10 -2
- package/dist/components/select/Select.js +119 -33
- package/dist/components/separator/Separator.css +35 -0
- package/dist/components/separator/Separator.d.ts +12 -0
- package/dist/components/separator/Separator.js +57 -0
- package/dist/components/separator/index.d.ts +1 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/sidenav/Sidenav.js +2 -2
- package/dist/components/surface/Surface.css +37 -0
- package/dist/components/surface/Surface.d.ts +12 -0
- package/dist/components/surface/Surface.js +41 -0
- package/dist/components/surface/index.d.ts +1 -0
- package/dist/components/surface/index.js +4 -0
- package/dist/components/table/hooks/index.d.ts +1 -9
- package/dist/components/table/hooks/index.js +1 -18
- package/dist/components/tag/Tag.css +121 -0
- package/dist/components/tag/Tag.d.ts +33 -0
- package/dist/components/tag/Tag.js +241 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/tag/index.js +6 -0
- package/dist/components/tag-group/TagGroup.css +22 -0
- package/dist/components/tag-group/TagGroup.d.ts +32 -0
- package/dist/components/tag-group/TagGroup.js +177 -0
- package/dist/components/tag-group/context.d.ts +15 -0
- package/dist/components/tag-group/context.js +3 -0
- package/dist/components/tag-group/index.d.ts +2 -0
- package/dist/components/tag-group/index.js +6 -0
- package/dist/components/text/Text.css +66 -0
- package/dist/components/text/Text.d.ts +17 -0
- package/dist/components/text/Text.js +46 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/index.js +5 -0
- package/dist/components/text-area/TextArea.css +95 -0
- package/dist/components/text-area/TextArea.d.ts +19 -0
- package/dist/components/text-area/TextArea.js +64 -0
- package/dist/components/text-area/index.d.ts +1 -0
- package/dist/components/text-area/index.js +5 -0
- package/dist/components/text-field/TextField.css +33 -0
- package/dist/components/text-field/TextField.d.ts +34 -0
- package/dist/components/text-field/TextField.js +85 -0
- package/dist/components/text-field/index.d.ts +1 -0
- package/dist/components/text-field/index.js +7 -0
- package/dist/components/textarea/Textarea.d.ts +8 -13
- package/dist/components/textarea/Textarea.js +14 -45
- package/dist/components/textarea/index.d.ts +2 -1
- package/dist/components/textarea/index.js +4 -1
- package/dist/components/time-field/TimeField.css +215 -0
- package/dist/components/time-field/TimeField.d.ts +64 -0
- package/dist/components/time-field/TimeField.js +341 -0
- package/dist/components/time-field/index.d.ts +1 -0
- package/dist/components/time-field/index.js +11 -0
- package/dist/components/utils.d.ts +2 -2
- package/dist/components/utils.js +3 -17
- package/dist/hooks/form/index.d.ts +5 -0
- package/dist/hooks/form/index.js +12 -0
- package/dist/hooks/form/useField.d.ts +11 -0
- package/dist/hooks/form/useField.js +20 -0
- package/dist/hooks/form/useFieldError.d.ts +3 -0
- package/dist/hooks/form/useFieldError.js +3 -0
- package/dist/hooks/form/useFieldMeta.d.ts +20 -0
- package/dist/hooks/form/useFieldMeta.js +49 -0
- package/dist/hooks/form/useFieldProps.d.ts +10 -0
- package/dist/hooks/form/useFieldProps.js +51 -0
- package/dist/hooks/form/useForm.d.ts +27 -0
- package/dist/hooks/form/useForm.js +54 -0
- package/dist/hooks/form/utils.d.ts +4 -0
- package/dist/hooks/form/utils.js +30 -0
- package/dist/hooks/layout/index.d.ts +1 -0
- package/dist/hooks/layout/index.js +3 -0
- package/dist/hooks/layout/useDesktop.d.ts +1 -0
- package/dist/hooks/layout/useDesktop.js +17 -0
- package/dist/hooks/table/index.d.ts +9 -0
- package/dist/hooks/table/index.js +18 -0
- package/dist/index.d.ts +59 -7
- package/dist/index.js +140 -15
- package/dist/styles/icons/generated-icons.css +1 -1
- package/package.json +1 -1
- package/dist/components/card/CardActions.d.ts +0 -4
- package/dist/components/card/CardActions.js +0 -15
- package/dist/components/card/CardBody.d.ts +0 -4
- package/dist/components/card/CardBody.js +0 -15
- package/dist/components/card/CardImage.d.ts +0 -3
- package/dist/components/card/CardImage.js +0 -10
- package/dist/components/card/CardTitle.d.ts +0 -6
- package/dist/components/card/CardTitle.js +0 -13
- package/dist/components/card/card.css +0 -171
- package/dist/components/form/FormBase.d.ts +0 -8
- package/dist/components/form/FormBase.js +0 -74
- package/dist/components/form/FormDropdown.d.ts +0 -25
- package/dist/components/form/FormDropdown.js +0 -139
- package/dist/components/form/FormField.d.ts +0 -14
- package/dist/components/form/FormField.js +0 -78
- package/dist/components/form/Label.d.ts +0 -7
- package/dist/components/form/NumberField.d.ts +0 -20
- package/dist/components/form/NumberField.js +0 -109
- package/dist/components/form/PasswordField.d.ts +0 -16
- package/dist/components/form/PasswordField.js +0 -113
- package/dist/components/form/ValidatedForm.d.ts +0 -26
- package/dist/components/form/ValidatedForm.js +0 -55
- package/dist/components/menu/MenuDetails.d.ts +0 -8
- package/dist/components/menu/MenuDropdown.d.ts +0 -12
- package/dist/components/menu/MenuDropdown.js +0 -48
- package/dist/components/menu/MenuTitle.d.ts +0 -8
- package/dist/components/menu/MenuTitle.js +0 -22
- package/dist/components/menu/menu.css +0 -364
- package/dist/components/textarea/textarea.css +0 -191
- /package/dist/{components/table/hooks → hooks/table}/helpers.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/helpers.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useAnchoredOverlayPosition.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useAnchoredOverlayPosition.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableExpansion.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableExpansion.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableFiltering.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableFiltering.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableModel.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableModel.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTablePagination.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTablePagination.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSelection.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSelection.js +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSorting.d.ts +0 -0
- /package/dist/{components/table/hooks → hooks/table}/useTableSorting.js +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.input-group {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
min-height: 2.25rem;
|
|
6
|
+
align-items: center;
|
|
7
|
+
border-radius: var(--radius-field, 0.75rem);
|
|
8
|
+
border: var(--border-width-field, 1px) solid var(--color-field-border, var(--color-base-300));
|
|
9
|
+
background-color: var(--color-field, var(--color-base-100));
|
|
10
|
+
color: var(--color-field-foreground, var(--color-base-content));
|
|
11
|
+
box-shadow:
|
|
12
|
+
0 1px 0 color-mix(in oklab, var(--color-base-content) 8%, transparent),
|
|
13
|
+
0 1px 0 color-mix(in oklab, var(--color-base-100) 60%, transparent) inset;
|
|
14
|
+
outline: none;
|
|
15
|
+
transition:
|
|
16
|
+
background-color 150ms var(--ease-smooth),
|
|
17
|
+
border-color 150ms var(--ease-smooth),
|
|
18
|
+
box-shadow 150ms var(--ease-out);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.input-group:has([data-slot="input-group-textarea"]) {
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
height: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (prefers-reduced-motion: reduce) {
|
|
27
|
+
.input-group {
|
|
28
|
+
transition: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (hover: hover) {
|
|
33
|
+
.input-group:hover:not(:focus-within):not([data-invalid="true"]):not([data-disabled="true"]) {
|
|
34
|
+
background-color: var(--color-field-hover, var(--color-base-200));
|
|
35
|
+
border-color: var(--color-field-border-hover, color-mix(in oklab, var(--color-base-content) 22%, transparent));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.input-group:focus-within {
|
|
40
|
+
border-color: var(--color-field-border-focus, var(--color-accent));
|
|
41
|
+
background-color: var(--color-field-focus, var(--color-base-100));
|
|
42
|
+
box-shadow:
|
|
43
|
+
0 0 0 3px color-mix(in oklab, var(--color-accent) 22%, transparent),
|
|
44
|
+
0 1px 0 color-mix(in oklab, var(--color-accent) 24%, transparent);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.input-group[data-invalid="true"] {
|
|
48
|
+
border-color: var(--color-field-border-invalid, var(--color-danger));
|
|
49
|
+
background-color: var(--color-field-focus, var(--color-base-100));
|
|
50
|
+
box-shadow:
|
|
51
|
+
0 0 0 3px color-mix(in oklab, var(--color-danger) 20%, transparent),
|
|
52
|
+
0 1px 0 color-mix(in oklab, var(--color-danger) 20%, transparent);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.input-group[data-disabled="true"],
|
|
56
|
+
.input-group[aria-disabled="true"] {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
border-color: var(--color-base-300);
|
|
59
|
+
background-color: var(--color-base-200);
|
|
60
|
+
color: color-mix(in oklab, var(--color-base-content) 45%, transparent);
|
|
61
|
+
opacity: var(--disabled-opacity, 0.6);
|
|
62
|
+
box-shadow: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.input-group__input {
|
|
66
|
+
min-width: 0;
|
|
67
|
+
flex: 1;
|
|
68
|
+
border: 0;
|
|
69
|
+
border-radius: 0;
|
|
70
|
+
background: transparent;
|
|
71
|
+
padding-block: 0.5rem;
|
|
72
|
+
padding-inline: 0.75rem;
|
|
73
|
+
font-size: 0.875rem;
|
|
74
|
+
line-height: 1.25rem;
|
|
75
|
+
color: inherit;
|
|
76
|
+
box-shadow: none;
|
|
77
|
+
outline: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.input-group__input::placeholder {
|
|
81
|
+
color: var(--color-field-placeholder, color-mix(in oklab, var(--color-base-content) 45%, transparent));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.input-group:has([data-slot="input-group-prefix"]) .input-group__input {
|
|
85
|
+
border-top-left-radius: 0;
|
|
86
|
+
border-bottom-left-radius: 0;
|
|
87
|
+
padding-inline-start: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.input-group:has([data-slot="input-group-suffix"]) .input-group__input {
|
|
91
|
+
border-top-right-radius: 0;
|
|
92
|
+
border-bottom-right-radius: 0;
|
|
93
|
+
padding-inline-end: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.input-group__input:focus,
|
|
97
|
+
.input-group__input:focus-visible {
|
|
98
|
+
outline: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.input-group__input[data-slot="input-group-textarea"] {
|
|
102
|
+
min-height: 2.375rem;
|
|
103
|
+
resize: vertical;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.input-group__prefix,
|
|
107
|
+
.input-group__suffix {
|
|
108
|
+
display: flex;
|
|
109
|
+
height: 100%;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
padding-inline: 0.75rem;
|
|
115
|
+
color: var(--color-field-placeholder, color-mix(in oklab, var(--color-base-content) 45%, transparent));
|
|
116
|
+
border-style: solid;
|
|
117
|
+
border-color: var(--color-field-border, var(--color-base-300));
|
|
118
|
+
border-width: 0;
|
|
119
|
+
transition:
|
|
120
|
+
background-color 150ms var(--ease-smooth),
|
|
121
|
+
border-color 150ms var(--ease-smooth);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@media (prefers-reduced-motion: reduce) {
|
|
125
|
+
.input-group__prefix,
|
|
126
|
+
.input-group__suffix {
|
|
127
|
+
transition: none;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.input-group__prefix {
|
|
132
|
+
border-top-left-radius: var(--radius-field, 0.75rem);
|
|
133
|
+
border-bottom-left-radius: var(--radius-field, 0.75rem);
|
|
134
|
+
border-inline-end-width: var(--border-width-field, 1px);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.input-group__suffix {
|
|
138
|
+
border-top-right-radius: var(--radius-field, 0.75rem);
|
|
139
|
+
border-bottom-right-radius: var(--radius-field, 0.75rem);
|
|
140
|
+
border-inline-start-width: var(--border-width-field, 1px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.input-group:has([data-slot="input-group-textarea"]) .input-group__prefix,
|
|
144
|
+
.input-group:has([data-slot="input-group-textarea"]) .input-group__suffix {
|
|
145
|
+
align-items: flex-start;
|
|
146
|
+
padding-top: 0.5rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.input-group--secondary {
|
|
150
|
+
box-shadow: none;
|
|
151
|
+
background-color: var(--input-group-bg, var(--color-base-200));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@media (hover: hover) {
|
|
155
|
+
.input-group--secondary:hover:not(:focus-within):not([data-invalid="true"]):not([data-disabled="true"]) {
|
|
156
|
+
background-color: var(--input-group-bg-hover, var(--color-base-300));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.input-group--secondary:focus-within {
|
|
161
|
+
background-color: var(--input-group-bg-focus, var(--color-base-200));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.input-group--secondary[data-invalid="true"] {
|
|
165
|
+
border-color: var(--color-field-border-invalid, var(--color-danger));
|
|
166
|
+
background-color: var(--input-group-bg-focus, var(--color-base-200));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.input-group--full-width {
|
|
170
|
+
width: 100%;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "./InputGroup.css";
|
|
2
|
+
import { type Component, type JSX, type ParentComponent } from "solid-js";
|
|
3
|
+
import { type TextFieldVariant } from "../text-field";
|
|
4
|
+
import type { IComponentBaseProps } from "../types";
|
|
5
|
+
export type InputGroupVariant = TextFieldVariant;
|
|
6
|
+
export type InputGroupRootProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
7
|
+
children?: JSX.Element;
|
|
8
|
+
variant?: InputGroupVariant;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
isInvalid?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type InputGroupInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "disabled"> & IComponentBaseProps & {
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
isInvalid?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type InputGroupTextAreaProps = Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, "disabled"> & IComponentBaseProps & {
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
isInvalid?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type InputGroupPrefixProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
25
|
+
children?: JSX.Element;
|
|
26
|
+
};
|
|
27
|
+
export type InputGroupSuffixProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
28
|
+
children?: JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
declare const InputGroupRoot: ParentComponent<InputGroupRootProps>;
|
|
31
|
+
declare const InputGroupInput: Component<InputGroupInputProps>;
|
|
32
|
+
declare const InputGroupTextArea: Component<InputGroupTextAreaProps>;
|
|
33
|
+
declare const InputGroupPrefix: ParentComponent<InputGroupPrefixProps>;
|
|
34
|
+
declare const InputGroupSuffix: ParentComponent<InputGroupSuffixProps>;
|
|
35
|
+
declare const InputGroup: ParentComponent<InputGroupRootProps> & {
|
|
36
|
+
Root: ParentComponent<InputGroupRootProps>;
|
|
37
|
+
Input: Component<InputGroupInputProps>;
|
|
38
|
+
TextArea: Component<InputGroupTextAreaProps>;
|
|
39
|
+
Prefix: ParentComponent<InputGroupPrefixProps>;
|
|
40
|
+
Suffix: ParentComponent<InputGroupSuffixProps>;
|
|
41
|
+
};
|
|
42
|
+
export default InputGroup;
|
|
43
|
+
export { InputGroup, InputGroupRoot, InputGroupInput, InputGroupTextArea, InputGroupPrefix, InputGroupSuffix, };
|
|
44
|
+
export type { InputGroupRootProps as InputGroupProps };
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import "./InputGroup.css";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__text_field_index_js_54530d22__ from "../text-field/index.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<input>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<textarea>");
|
|
7
|
+
const VARIANT_CLASS_MAP = {
|
|
8
|
+
primary: "input-group--primary",
|
|
9
|
+
secondary: "input-group--secondary"
|
|
10
|
+
};
|
|
11
|
+
const InputGroupContext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createContext)();
|
|
12
|
+
const invokeEventHandler = (handler, event)=>{
|
|
13
|
+
if ("function" == typeof handler) return void handler(event);
|
|
14
|
+
if (Array.isArray(handler) && "function" == typeof handler[0]) handler[0](handler[1], event);
|
|
15
|
+
};
|
|
16
|
+
const InputGroupRoot = (props)=>{
|
|
17
|
+
const textFieldContext = (0, __WEBPACK_EXTERNAL_MODULE__text_field_index_js_54530d22__.useTextFieldContext)();
|
|
18
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
19
|
+
"children",
|
|
20
|
+
"class",
|
|
21
|
+
"className",
|
|
22
|
+
"dataTheme",
|
|
23
|
+
"style",
|
|
24
|
+
"variant",
|
|
25
|
+
"fullWidth",
|
|
26
|
+
"isDisabled",
|
|
27
|
+
"disabled",
|
|
28
|
+
"isInvalid",
|
|
29
|
+
"onClick",
|
|
30
|
+
"ref",
|
|
31
|
+
"aria-invalid"
|
|
32
|
+
]);
|
|
33
|
+
let groupRef;
|
|
34
|
+
const variant = ()=>local.variant ?? textFieldContext?.variant?.() ?? "primary";
|
|
35
|
+
const fullWidth = ()=>Boolean(local.fullWidth) || Boolean(textFieldContext?.fullWidth?.());
|
|
36
|
+
const isDisabled = ()=>Boolean(local.isDisabled) || Boolean(local.disabled) || Boolean(textFieldContext?.isDisabled?.());
|
|
37
|
+
const isInvalid = ()=>Boolean(local.isInvalid) || Boolean(textFieldContext?.isInvalid?.()) || Boolean(local["aria-invalid"]) || "true" === local["aria-invalid"];
|
|
38
|
+
const handleClick = (event)=>{
|
|
39
|
+
if (!isDisabled()) {
|
|
40
|
+
const target = event.target;
|
|
41
|
+
const input = groupRef?.querySelector('[data-slot="input-group-input"], [data-slot="input-group-textarea"]');
|
|
42
|
+
if (input && target !== input && !input.contains(target)) input.focus();
|
|
43
|
+
}
|
|
44
|
+
invokeEventHandler(local.onClick, event);
|
|
45
|
+
};
|
|
46
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(InputGroupContext.Provider, {
|
|
47
|
+
value: {
|
|
48
|
+
variant,
|
|
49
|
+
fullWidth,
|
|
50
|
+
isDisabled,
|
|
51
|
+
isInvalid
|
|
52
|
+
},
|
|
53
|
+
get children () {
|
|
54
|
+
var _el$ = _tmpl$();
|
|
55
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)((node)=>{
|
|
56
|
+
groupRef = node;
|
|
57
|
+
if ("function" == typeof local.ref) local.ref(node);
|
|
58
|
+
}, _el$);
|
|
59
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
60
|
+
get ["class"] () {
|
|
61
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("input-group", VARIANT_CLASS_MAP[variant()], fullWidth() && "input-group--full-width", local.class, local.className);
|
|
62
|
+
},
|
|
63
|
+
"data-slot": "input-group",
|
|
64
|
+
get ["data-disabled"] () {
|
|
65
|
+
return isDisabled() ? "true" : void 0;
|
|
66
|
+
},
|
|
67
|
+
get ["data-invalid"] () {
|
|
68
|
+
return isInvalid() ? "true" : void 0;
|
|
69
|
+
},
|
|
70
|
+
get ["aria-disabled"] () {
|
|
71
|
+
return isDisabled() ? "true" : void 0;
|
|
72
|
+
},
|
|
73
|
+
get ["aria-invalid"] () {
|
|
74
|
+
return isInvalid() ? "true" : void 0;
|
|
75
|
+
},
|
|
76
|
+
get ["data-theme"] () {
|
|
77
|
+
return local.dataTheme;
|
|
78
|
+
},
|
|
79
|
+
get style () {
|
|
80
|
+
return local.style;
|
|
81
|
+
},
|
|
82
|
+
onClick: handleClick
|
|
83
|
+
}), false, true);
|
|
84
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
85
|
+
return _el$;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
const InputGroupInput = (props)=>{
|
|
90
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(InputGroupContext);
|
|
91
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
92
|
+
"class",
|
|
93
|
+
"className",
|
|
94
|
+
"dataTheme",
|
|
95
|
+
"style",
|
|
96
|
+
"isDisabled",
|
|
97
|
+
"disabled",
|
|
98
|
+
"isInvalid"
|
|
99
|
+
]);
|
|
100
|
+
const isDisabled = ()=>Boolean(local.isDisabled) || Boolean(local.disabled) || Boolean(context?.isDisabled());
|
|
101
|
+
const isInvalid = ()=>Boolean(local.isInvalid) || Boolean(context?.isInvalid());
|
|
102
|
+
return (()=>{
|
|
103
|
+
var _el$2 = _tmpl$2();
|
|
104
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
105
|
+
get ["class"] () {
|
|
106
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("input-group__input", local.class, local.className);
|
|
107
|
+
},
|
|
108
|
+
"data-slot": "input-group-input",
|
|
109
|
+
get ["data-theme"] () {
|
|
110
|
+
return local.dataTheme;
|
|
111
|
+
},
|
|
112
|
+
get style () {
|
|
113
|
+
return local.style;
|
|
114
|
+
},
|
|
115
|
+
get disabled () {
|
|
116
|
+
return isDisabled();
|
|
117
|
+
},
|
|
118
|
+
get ["aria-disabled"] () {
|
|
119
|
+
return isDisabled() ? "true" : void 0;
|
|
120
|
+
},
|
|
121
|
+
get ["aria-invalid"] () {
|
|
122
|
+
return isInvalid() ? "true" : void 0;
|
|
123
|
+
}
|
|
124
|
+
}), false, false);
|
|
125
|
+
return _el$2;
|
|
126
|
+
})();
|
|
127
|
+
};
|
|
128
|
+
const InputGroupTextArea = (props)=>{
|
|
129
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(InputGroupContext);
|
|
130
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
131
|
+
"class",
|
|
132
|
+
"className",
|
|
133
|
+
"dataTheme",
|
|
134
|
+
"style",
|
|
135
|
+
"isDisabled",
|
|
136
|
+
"disabled",
|
|
137
|
+
"isInvalid"
|
|
138
|
+
]);
|
|
139
|
+
const isDisabled = ()=>Boolean(local.isDisabled) || Boolean(local.disabled) || Boolean(context?.isDisabled());
|
|
140
|
+
const isInvalid = ()=>Boolean(local.isInvalid) || Boolean(context?.isInvalid());
|
|
141
|
+
return (()=>{
|
|
142
|
+
var _el$3 = _tmpl$3();
|
|
143
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
144
|
+
get ["class"] () {
|
|
145
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("input-group__input", local.class, local.className);
|
|
146
|
+
},
|
|
147
|
+
"data-slot": "input-group-textarea",
|
|
148
|
+
get ["data-theme"] () {
|
|
149
|
+
return local.dataTheme;
|
|
150
|
+
},
|
|
151
|
+
get style () {
|
|
152
|
+
return local.style;
|
|
153
|
+
},
|
|
154
|
+
get disabled () {
|
|
155
|
+
return isDisabled();
|
|
156
|
+
},
|
|
157
|
+
get ["aria-disabled"] () {
|
|
158
|
+
return isDisabled() ? "true" : void 0;
|
|
159
|
+
},
|
|
160
|
+
get ["aria-invalid"] () {
|
|
161
|
+
return isInvalid() ? "true" : void 0;
|
|
162
|
+
}
|
|
163
|
+
}), false, false);
|
|
164
|
+
return _el$3;
|
|
165
|
+
})();
|
|
166
|
+
};
|
|
167
|
+
const InputGroupPrefix = (props)=>{
|
|
168
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
169
|
+
"children",
|
|
170
|
+
"class",
|
|
171
|
+
"className",
|
|
172
|
+
"dataTheme",
|
|
173
|
+
"style"
|
|
174
|
+
]);
|
|
175
|
+
return (()=>{
|
|
176
|
+
var _el$4 = _tmpl$();
|
|
177
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$4, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
178
|
+
get ["class"] () {
|
|
179
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("input-group__prefix", local.class, local.className);
|
|
180
|
+
},
|
|
181
|
+
"data-slot": "input-group-prefix",
|
|
182
|
+
get ["data-theme"] () {
|
|
183
|
+
return local.dataTheme;
|
|
184
|
+
},
|
|
185
|
+
get style () {
|
|
186
|
+
return local.style;
|
|
187
|
+
}
|
|
188
|
+
}), false, true);
|
|
189
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, ()=>local.children);
|
|
190
|
+
return _el$4;
|
|
191
|
+
})();
|
|
192
|
+
};
|
|
193
|
+
const InputGroupSuffix = (props)=>{
|
|
194
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
195
|
+
"children",
|
|
196
|
+
"class",
|
|
197
|
+
"className",
|
|
198
|
+
"dataTheme",
|
|
199
|
+
"style"
|
|
200
|
+
]);
|
|
201
|
+
return (()=>{
|
|
202
|
+
var _el$5 = _tmpl$();
|
|
203
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
204
|
+
get ["class"] () {
|
|
205
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("input-group__suffix", local.class, local.className);
|
|
206
|
+
},
|
|
207
|
+
"data-slot": "input-group-suffix",
|
|
208
|
+
get ["data-theme"] () {
|
|
209
|
+
return local.dataTheme;
|
|
210
|
+
},
|
|
211
|
+
get style () {
|
|
212
|
+
return local.style;
|
|
213
|
+
}
|
|
214
|
+
}), false, true);
|
|
215
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, ()=>local.children);
|
|
216
|
+
return _el$5;
|
|
217
|
+
})();
|
|
218
|
+
};
|
|
219
|
+
const InputGroup = Object.assign(InputGroupRoot, {
|
|
220
|
+
Root: InputGroupRoot,
|
|
221
|
+
Input: InputGroupInput,
|
|
222
|
+
TextArea: InputGroupTextArea,
|
|
223
|
+
Prefix: InputGroupPrefix,
|
|
224
|
+
Suffix: InputGroupSuffix
|
|
225
|
+
});
|
|
226
|
+
const input_group_InputGroup = InputGroup;
|
|
227
|
+
export { InputGroup, InputGroupInput, InputGroupPrefix, InputGroupRoot, InputGroupSuffix, InputGroupTextArea, input_group_InputGroup as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, InputGroup, InputGroupRoot, InputGroupInput, InputGroupTextArea, InputGroupPrefix, InputGroupSuffix, type InputGroupProps, type InputGroupRootProps, type InputGroupInputProps, type InputGroupTextAreaProps, type InputGroupPrefixProps, type InputGroupSuffixProps, type InputGroupVariant, } from "./InputGroup";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__ from "./InputGroup.js";
|
|
2
|
+
var __webpack_exports__InputGroup = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroup;
|
|
3
|
+
var __webpack_exports__InputGroupInput = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroupInput;
|
|
4
|
+
var __webpack_exports__InputGroupPrefix = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroupPrefix;
|
|
5
|
+
var __webpack_exports__InputGroupRoot = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroupRoot;
|
|
6
|
+
var __webpack_exports__InputGroupSuffix = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroupSuffix;
|
|
7
|
+
var __webpack_exports__InputGroupTextArea = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__.InputGroupTextArea;
|
|
8
|
+
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__InputGroup_js_50b8d472__["default"];
|
|
9
|
+
export { __webpack_exports__InputGroup as InputGroup, __webpack_exports__InputGroupInput as InputGroupInput, __webpack_exports__InputGroupPrefix as InputGroupPrefix, __webpack_exports__InputGroupRoot as InputGroupRoot, __webpack_exports__InputGroupSuffix as InputGroupSuffix, __webpack_exports__InputGroupTextArea as InputGroupTextArea, __webpack_exports__default as default };
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.input-otp {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 0.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.input-otp[data-disabled="true"] {
|
|
10
|
+
cursor: not-allowed;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.input-otp__input {
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 1px;
|
|
17
|
+
height: 1px;
|
|
18
|
+
padding: 0;
|
|
19
|
+
margin: -1px;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
clip: rect(0 0 0 0);
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
border: 0;
|
|
24
|
+
opacity: 0;
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.input-otp__group {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 0.5rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.input-otp__slot {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: flex;
|
|
37
|
+
width: 2.375rem;
|
|
38
|
+
height: 2.5rem;
|
|
39
|
+
flex: 1;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
border-radius: var(--radius-field, 0.75rem);
|
|
43
|
+
border: var(--border-width-field, 1px) solid var(--color-field-border, var(--color-base-300));
|
|
44
|
+
background-color: var(--color-field, var(--color-base-100));
|
|
45
|
+
color: var(--color-field-foreground, var(--color-base-content));
|
|
46
|
+
font-size: 0.875rem;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 1.25rem;
|
|
49
|
+
box-shadow:
|
|
50
|
+
0 1px 0 color-mix(in oklab, var(--color-base-content) 8%, transparent),
|
|
51
|
+
0 1px 0 color-mix(in oklab, var(--color-base-100) 60%, transparent) inset;
|
|
52
|
+
outline: none;
|
|
53
|
+
transition:
|
|
54
|
+
background-color 150ms var(--ease-smooth),
|
|
55
|
+
border-color 150ms var(--ease-smooth),
|
|
56
|
+
box-shadow 150ms var(--ease-out);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (prefers-reduced-motion: reduce) {
|
|
60
|
+
.input-otp__slot {
|
|
61
|
+
transition: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media (hover: hover) {
|
|
66
|
+
.input-otp__slot:hover:not([data-disabled="true"]) {
|
|
67
|
+
background-color: var(--color-field-hover, var(--color-base-200));
|
|
68
|
+
border-color: var(--color-field-border-hover, color-mix(in oklab, var(--color-base-content) 22%, transparent));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.input-otp__slot[data-active="true"] {
|
|
73
|
+
z-index: 1;
|
|
74
|
+
border-color: var(--color-field-border-focus, var(--color-accent));
|
|
75
|
+
background-color: var(--color-field-focus, var(--color-base-100));
|
|
76
|
+
box-shadow:
|
|
77
|
+
0 0 0 3px color-mix(in oklab, var(--color-accent) 22%, transparent),
|
|
78
|
+
0 1px 0 color-mix(in oklab, var(--color-accent) 24%, transparent);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.input-otp__slot[data-filled="true"] {
|
|
82
|
+
background-color: var(--color-field-focus, var(--color-base-100));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.input-otp__slot[data-disabled="true"] {
|
|
86
|
+
cursor: not-allowed;
|
|
87
|
+
border-color: var(--color-base-300);
|
|
88
|
+
background-color: var(--color-base-200);
|
|
89
|
+
color: color-mix(in oklab, var(--color-base-content) 45%, transparent);
|
|
90
|
+
box-shadow: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.input-otp__slot[data-invalid="true"] {
|
|
94
|
+
border-color: var(--color-field-border-invalid, var(--color-danger));
|
|
95
|
+
background-color: var(--color-field-focus, var(--color-base-100));
|
|
96
|
+
box-shadow:
|
|
97
|
+
0 0 0 3px color-mix(in oklab, var(--color-danger) 20%, transparent),
|
|
98
|
+
0 1px 0 color-mix(in oklab, var(--color-danger) 20%, transparent);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.input-otp__slot-value {
|
|
102
|
+
font-size: 1.125rem;
|
|
103
|
+
line-height: 1.5rem;
|
|
104
|
+
letter-spacing: -0.27px;
|
|
105
|
+
transform-origin: bottom center;
|
|
106
|
+
animation: input-otp-slot-value-in 250ms var(--ease-smooth) both;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.input-otp__caret {
|
|
110
|
+
position: absolute;
|
|
111
|
+
width: 2px;
|
|
112
|
+
height: 1rem;
|
|
113
|
+
border-radius: 4px;
|
|
114
|
+
background-color: var(--color-field-placeholder, color-mix(in oklab, var(--color-base-content) 45%, transparent));
|
|
115
|
+
animation: input-otp-caret-blink 1.1s step-end infinite;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.input-otp__separator {
|
|
119
|
+
width: 6px;
|
|
120
|
+
height: 2px;
|
|
121
|
+
flex-shrink: 0;
|
|
122
|
+
border-radius: 4px;
|
|
123
|
+
background-color: var(--color-separator, var(--color-base-300));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.input-otp--secondary .input-otp__slot {
|
|
127
|
+
box-shadow: none;
|
|
128
|
+
background-color: var(--input-otp-slot-bg, var(--color-base-200));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (hover: hover) {
|
|
132
|
+
.input-otp--secondary .input-otp__slot:hover:not([data-disabled="true"]) {
|
|
133
|
+
background-color: var(--input-otp-slot-bg-hover, var(--color-base-300));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.input-otp--secondary .input-otp__slot[data-active="true"],
|
|
138
|
+
.input-otp--secondary .input-otp__slot[data-filled="true"] {
|
|
139
|
+
background-color: var(--input-otp-slot-bg-focus, var(--color-base-200));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@media (prefers-reduced-motion: reduce) {
|
|
143
|
+
.input-otp__slot-value,
|
|
144
|
+
.input-otp__caret {
|
|
145
|
+
animation: none;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@keyframes input-otp-slot-value-in {
|
|
150
|
+
0% {
|
|
151
|
+
opacity: 0;
|
|
152
|
+
transform: translateY(8px) scale(0.8);
|
|
153
|
+
}
|
|
154
|
+
100% {
|
|
155
|
+
opacity: 1;
|
|
156
|
+
transform: translateY(0) scale(1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@keyframes input-otp-caret-blink {
|
|
161
|
+
0%,
|
|
162
|
+
50% {
|
|
163
|
+
opacity: 1;
|
|
164
|
+
}
|
|
165
|
+
50.01%,
|
|
166
|
+
100% {
|
|
167
|
+
opacity: 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "./InputOTP.css";
|
|
2
|
+
import { type Component, type JSX, type ParentComponent } from "solid-js";
|
|
3
|
+
import type { IComponentBaseProps } from "../types";
|
|
4
|
+
export type InputOTPVariant = "primary" | "secondary";
|
|
5
|
+
export declare const REGEXP_ONLY_DIGITS = "^\\d+$";
|
|
6
|
+
export declare const REGEXP_ONLY_CHARS = "^[a-zA-Z]+$";
|
|
7
|
+
export declare const REGEXP_ONLY_DIGITS_AND_CHARS = "^[a-zA-Z0-9]+$";
|
|
8
|
+
export type InputOTPRootProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "onInput"> & IComponentBaseProps & {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
onComplete?: (value: string) => void;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
variant?: InputOTPVariant;
|
|
16
|
+
pattern?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
autoFocus?: boolean;
|
|
19
|
+
isDisabled?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
isInvalid?: boolean;
|
|
22
|
+
inputClassName?: string;
|
|
23
|
+
inputMode?: JSX.InputHTMLAttributes<HTMLInputElement>["inputMode"];
|
|
24
|
+
};
|
|
25
|
+
export type InputOTPGroupProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
26
|
+
children?: JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export type InputOTPSlotProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
29
|
+
index: number;
|
|
30
|
+
};
|
|
31
|
+
export type InputOTPSeparatorProps = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> & IComponentBaseProps & {
|
|
32
|
+
children?: JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
declare const InputOTPRoot: ParentComponent<InputOTPRootProps>;
|
|
35
|
+
declare const InputOTPGroup: ParentComponent<InputOTPGroupProps>;
|
|
36
|
+
declare const InputOTPSlot: Component<InputOTPSlotProps>;
|
|
37
|
+
declare const InputOTPSeparator: ParentComponent<InputOTPSeparatorProps>;
|
|
38
|
+
declare const InputOTP: ParentComponent<InputOTPRootProps> & {
|
|
39
|
+
Root: ParentComponent<InputOTPRootProps>;
|
|
40
|
+
Group: ParentComponent<InputOTPGroupProps>;
|
|
41
|
+
Slot: Component<InputOTPSlotProps>;
|
|
42
|
+
Separator: ParentComponent<InputOTPSeparatorProps>;
|
|
43
|
+
};
|
|
44
|
+
export default InputOTP;
|
|
45
|
+
export { InputOTP, InputOTPRoot, InputOTPGroup, InputOTPSlot, InputOTPSeparator, };
|
|
46
|
+
export type { InputOTPRootProps as InputOTPProps };
|