@valentinkolb/cloud 0.3.1 → 0.5.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/package.json +18 -8
- package/scripts/preload.ts +78 -23
- package/src/_internal/define-app.ts +119 -47
- package/src/_internal/runtime-context.ts +1 -0
- package/src/api/accounts-entities.ts +4 -0
- package/src/api/admin-core-settings.ts +98 -0
- package/src/api/announcements.ts +131 -0
- package/src/api/auth/schemas.ts +24 -0
- package/src/api/auth.ts +113 -10
- package/src/api/index.ts +15 -25
- package/src/api/me.ts +203 -14
- package/src/api/search/schemas.ts +1 -0
- package/src/api/search.ts +62 -8
- package/src/config/ssr.ts +2 -9
- package/src/contracts/announcements.test.ts +37 -0
- package/src/contracts/announcements.ts +121 -0
- package/src/contracts/app.ts +4 -0
- package/src/contracts/index.ts +3 -2
- package/src/contracts/registry.ts +4 -0
- package/src/contracts/shared.ts +108 -1
- package/src/desktop/index.ts +704 -0
- package/src/desktop/solid.tsx +938 -0
- package/src/server/api/index.ts +1 -1
- package/src/server/api/respond.ts +50 -10
- package/src/server/index.ts +44 -38
- package/src/server/middleware/auth.ts +98 -9
- package/src/server/middleware/index.ts +2 -1
- package/src/server/middleware/settings.ts +26 -0
- package/src/server/services/access.test.ts +197 -0
- package/src/server/services/access.ts +254 -6
- package/src/server/services/index.ts +14 -11
- package/src/server/services/pagination.ts +22 -0
- package/src/server/time.ts +45 -0
- package/src/services/account-lifecycle/index.ts +142 -18
- package/src/services/accounts/app.ts +658 -170
- package/src/services/accounts/authz.test.ts +77 -0
- package/src/services/accounts/authz.ts +22 -0
- package/src/services/accounts/entities.ts +84 -5
- package/src/services/accounts/groups.ts +30 -24
- package/src/services/accounts/model.test.ts +30 -0
- package/src/services/accounts/switching.test.ts +14 -0
- package/src/services/accounts/switching.ts +15 -6
- package/src/services/accounts/users.ts +75 -52
- package/src/services/announcements/index.test.ts +32 -0
- package/src/services/announcements/index.ts +224 -0
- package/src/services/audit/index.test.ts +84 -0
- package/src/services/audit/index.ts +431 -0
- package/src/services/auth-flows/index.ts +9 -2
- package/src/services/auth-flows/ipa.ts +0 -2
- package/src/services/auth-flows/magic-link.ts +3 -2
- package/src/services/auth-flows/password-reset.ts +284 -0
- package/src/services/auth-flows/proxy-return.test.ts +24 -0
- package/src/services/auth-flows/proxy-return.ts +49 -0
- package/src/services/gateway.ts +162 -0
- package/src/services/index.ts +44 -2
- package/src/services/ipa/effective-groups.test.ts +33 -0
- package/src/services/ipa/effective-groups.ts +70 -0
- package/src/services/ipa/profile.ts +45 -3
- package/src/services/ipa/search.ts +3 -5
- package/src/services/ipa/service-account.ts +15 -0
- package/src/services/ipa/sync-planning.test.ts +32 -0
- package/src/services/ipa/sync-planning.ts +22 -0
- package/src/services/ipa/sync.ts +110 -38
- package/src/services/oauth-tokens.ts +104 -0
- package/src/services/postgres.ts +21 -6
- package/src/services/providers/local/auth.test.ts +22 -0
- package/src/services/providers/local/auth.ts +46 -3
- package/src/services/secrets.ts +10 -0
- package/src/services/service-account-credentials.test.ts +210 -0
- package/src/services/service-account-credentials.ts +715 -0
- package/src/services/service-accounts.ts +188 -0
- package/src/services/session/index.ts +7 -8
- package/src/services/settings/app.ts +4 -20
- package/src/services/settings/defaults.ts +64 -22
- package/src/services/settings/store.ts +47 -0
- package/src/services/weather/forecast.ts +40 -7
- package/src/services/webauthn.test.ts +36 -0
- package/src/services/webauthn.ts +384 -0
- package/src/shared/icons.ts +391 -100
- package/src/shared/index.ts +7 -0
- package/src/shared/markdown/extensions/code.ts +38 -1
- package/src/shared/markdown/extensions/images.ts +39 -3
- package/src/shared/markdown/extensions/info-blocks.ts +5 -5
- package/src/shared/markdown/extensions/mark.ts +48 -0
- package/src/shared/markdown/extensions/sub-sup.ts +60 -0
- package/src/shared/markdown/extensions/tables.ts +79 -58
- package/src/shared/markdown/formula.test.ts +1089 -0
- package/src/shared/markdown/formula.ts +1187 -0
- package/src/shared/markdown/index.ts +76 -2
- package/src/shared/mock-cover.ts +130 -0
- package/src/shared/redirect.test.ts +49 -0
- package/src/shared/redirect.ts +52 -0
- package/src/shared/theme.test.ts +24 -0
- package/src/shared/theme.ts +68 -0
- package/src/shared/time.ts +13 -0
- package/src/ssr/AdminLayout.tsx +7 -3
- package/src/ssr/AdminSidebar.tsx +115 -49
- package/src/ssr/AppLaunchpad.island.tsx +176 -0
- package/src/ssr/Footer.island.tsx +3 -8
- package/src/ssr/GlobalAnnouncements.island.tsx +141 -0
- package/src/ssr/GlobalSearchDialog.tsx +545 -117
- package/src/ssr/HotkeysHelpRail.island.tsx +3 -70
- package/src/ssr/Layout.tsx +74 -66
- package/src/ssr/LayoutBreadcrumbs.island.tsx +44 -0
- package/src/ssr/LayoutHelp.tsx +266 -0
- package/src/ssr/NavMenu.island.tsx +0 -39
- package/src/ssr/ThemeToggleRail.island.tsx +3 -3
- package/src/ssr/TimezoneCookie.island.tsx +23 -0
- package/src/ssr/islands/index.ts +13 -0
- package/src/styles/base-popover.css +5 -2
- package/src/styles/effects.css +87 -6
- package/src/styles/global.css +146 -9
- package/src/styles/input.css +3 -1
- package/src/styles/utilities-buttons.css +133 -27
- package/src/styles/utilities-code-display.css +67 -0
- package/src/styles/utilities-completion.css +223 -0
- package/src/styles/utilities-detail.css +73 -0
- package/src/styles/utilities-feedback.css +16 -15
- package/src/styles/utilities-layout.css +42 -2
- package/src/styles/utilities-markdown-editor.css +472 -0
- package/src/styles/utilities-navigation.css +63 -8
- package/src/styles/utilities-script.css +84 -0
- package/src/styles/utilities-table-tile.css +229 -0
- package/src/types/ambient.d.ts +9 -0
- package/src/ui/completion/behaviors.test.ts +95 -0
- package/src/ui/completion/behaviors.ts +205 -0
- package/src/ui/completion/engine.ts +368 -0
- package/src/ui/completion/index.ts +40 -0
- package/src/ui/completion/overlay.ts +92 -0
- package/src/ui/dialog-core.ts +173 -45
- package/src/ui/filter/FilterChip.tsx +42 -40
- package/src/ui/index.ts +11 -12
- package/src/ui/input/AutocompleteEditor.tsx +656 -0
- package/src/ui/input/CheckboxCard.tsx +91 -0
- package/src/ui/input/Combobox.tsx +375 -0
- package/src/ui/input/DatePicker.tsx +846 -0
- package/src/ui/input/DateTimeInput.tsx +29 -4
- package/src/ui/input/FileDropzone.tsx +116 -0
- package/src/ui/input/IconInput.tsx +116 -0
- package/src/ui/input/ImageInput.tsx +19 -2
- package/src/ui/input/MultiSelectInput.tsx +448 -0
- package/src/ui/input/NumberInput.tsx +417 -61
- package/src/ui/input/SegmentedControl.tsx +2 -2
- package/src/ui/input/Select.tsx +172 -10
- package/src/ui/input/Slider.tsx +3 -4
- package/src/ui/input/Switch.tsx +3 -2
- package/src/ui/input/TemplateEditor.tsx +212 -0
- package/src/ui/input/TextInput.tsx +144 -13
- package/src/ui/input/index.ts +53 -8
- package/src/ui/input/markdown/MarkdownEditor.tsx +774 -0
- package/src/ui/input/markdown/Toolbar.tsx +90 -0
- package/src/ui/input/markdown/actions.ts +233 -0
- package/src/ui/input/markdown/active-formats.ts +94 -0
- package/src/ui/input/markdown/behaviors.ts +193 -0
- package/src/ui/input/markdown/code-zone.ts +23 -0
- package/src/ui/input/markdown/highlight.ts +316 -0
- package/src/ui/layout.ts +22 -0
- package/src/ui/misc/AppOverview.tsx +105 -0
- package/src/ui/misc/AppWorkspace.tsx +607 -0
- package/src/ui/misc/Calendar.tsx +1291 -0
- package/src/ui/misc/Chart.tsx +162 -0
- package/src/ui/misc/CodeDisplay.tsx +54 -0
- package/src/ui/misc/ContextMenu.tsx +2 -2
- package/src/ui/misc/DataTable.tsx +269 -0
- package/src/ui/misc/DockWorkspace.tsx +425 -0
- package/src/ui/misc/Docs.tsx +153 -0
- package/src/ui/misc/Dropdown.tsx +2 -2
- package/src/ui/misc/EntitySearch.tsx +260 -129
- package/src/ui/misc/LinkCard.tsx +14 -2
- package/src/ui/misc/LogEntriesTable.tsx +34 -31
- package/src/ui/misc/Pagination.tsx +31 -12
- package/src/ui/misc/PanelDialog.tsx +109 -0
- package/src/ui/misc/Panes.tsx +873 -0
- package/src/ui/misc/PermissionEditor.tsx +358 -262
- package/src/ui/misc/Placeholder.tsx +40 -0
- package/src/ui/misc/ProgressBar.tsx +1 -1
- package/src/ui/misc/ResourceApiKeys.tsx +260 -0
- package/src/ui/misc/SettingsModal.tsx +150 -0
- package/src/ui/misc/StatCell.tsx +182 -40
- package/src/ui/misc/StatGrid.tsx +149 -0
- package/src/ui/misc/StructuredDataPreview.tsx +107 -0
- package/src/ui/misc/code-highlight.ts +213 -0
- package/src/ui/misc/index.ts +93 -12
- package/src/ui/prompts.tsx +362 -312
- package/src/ui/toast.ts +384 -0
- package/src/ui/widgets/Widget.tsx +12 -4
- package/src/ssr/MoreAppsDropdown.island.tsx +0 -61
- package/src/ui/ipa/GroupView.tsx +0 -36
- package/src/ui/ipa/LoginBtn.tsx +0 -16
- package/src/ui/ipa/UserView.tsx +0 -58
- package/src/ui/ipa/index.ts +0 -4
- package/src/ui/navigation.ts +0 -32
- package/src/ui/sidebar.tsx +0 -468
- /package/src/ui/{ipa → misc}/Avatar.tsx +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createSignal } from "solid-js";
|
|
1
|
+
import { createSignal, Show, type JSX } from "solid-js";
|
|
2
2
|
import { InputWrapper, createInputA11y } from "./util";
|
|
3
|
+
import MarkdownEditor, { type Completion } from "./markdown/MarkdownEditor";
|
|
3
4
|
|
|
4
5
|
type TextInputProps = {
|
|
5
6
|
name?: string;
|
|
@@ -18,6 +19,8 @@ type TextInputProps = {
|
|
|
18
19
|
clearLabel?: string;
|
|
19
20
|
error?: () => string | undefined;
|
|
20
21
|
multiline?: boolean;
|
|
22
|
+
/** Use a monospace font. Intended for code-like text such as queries. */
|
|
23
|
+
monospace?: boolean;
|
|
21
24
|
required?: boolean;
|
|
22
25
|
disabled?: boolean;
|
|
23
26
|
password?: boolean;
|
|
@@ -27,12 +30,66 @@ type TextInputProps = {
|
|
|
27
30
|
*/
|
|
28
31
|
markdown?: boolean;
|
|
29
32
|
/**
|
|
30
|
-
* Called when
|
|
31
|
-
*
|
|
33
|
+
* Called when the user submits the field. The trigger differs by mode:
|
|
34
|
+
*
|
|
35
|
+
* - `multiline` (plain textarea): bare Enter fires onSubmit;
|
|
36
|
+
* Shift+Enter inserts a newline.
|
|
37
|
+
* - `markdown`: Cmd/Ctrl+Enter fires onSubmit. Bare Enter is reserved
|
|
38
|
+
* for newlines and smart list continuation — submitting on bare
|
|
39
|
+
* Enter would be hostile in a prose / multi-paragraph editor.
|
|
40
|
+
* - Single-line: not fired (the form's own Enter handling applies).
|
|
32
41
|
*/
|
|
33
42
|
onSubmit?: () => void;
|
|
34
43
|
/** Approximate visible lines for multiline mode. Overrides default height. */
|
|
35
44
|
lines?: number;
|
|
45
|
+
/**
|
|
46
|
+
* AutoText dictionary for markdown mode — convenience shortcut for
|
|
47
|
+
* the most common shape: a `{ short: long }` map. Typing a key
|
|
48
|
+
* followed by a word boundary replaces the key with its value
|
|
49
|
+
* (case-insensitive, exact-case preferred). Ignored outside
|
|
50
|
+
* `markdown={true}`. For richer behaviour (triggered completions,
|
|
51
|
+
* live search, ghost preview) use `completions` instead.
|
|
52
|
+
*/
|
|
53
|
+
abbreviations?: Record<string, string>;
|
|
54
|
+
/**
|
|
55
|
+
* Full completion definitions for markdown mode. Each completion
|
|
56
|
+
* provides ghost-previewable suggestions (zinc-400 + → arrow at the
|
|
57
|
+
* caret) and optionally a `trigger` char (`#`, `@`, `:`). Tab
|
|
58
|
+
* inserts the active ghost. Sync suggestions also drive the blue
|
|
59
|
+
* dotted-underline highlight for recognised labels in the body.
|
|
60
|
+
* Combine with `abbreviations` if you want both — they're merged
|
|
61
|
+
* automatically.
|
|
62
|
+
*/
|
|
63
|
+
completions?: Completion[];
|
|
64
|
+
/**
|
|
65
|
+
* Mobile keyboard hint. Pass-through to the underlying `<input>`.
|
|
66
|
+
* Use "numeric" for digits-only inputs, "decimal" for floats,
|
|
67
|
+
* "email"/"url"/"tel"/"search" mirror the platform hints. Doesn't
|
|
68
|
+
* change the rendered keyboard on desktop.
|
|
69
|
+
*/
|
|
70
|
+
inputMode?: "text" | "numeric" | "decimal" | "tel" | "search" | "email" | "url" | "none";
|
|
71
|
+
/** Hard cap on input length. Pass-through to the underlying `<input>` / `<textarea>`. */
|
|
72
|
+
maxLength?: number;
|
|
73
|
+
/** Browser autocomplete hint, e.g. "email", "current-password", "off". */
|
|
74
|
+
autocomplete?: string;
|
|
75
|
+
/** Browser spellcheck. Defaults to the platform behaviour. */
|
|
76
|
+
spellcheck?: boolean;
|
|
77
|
+
/** Browser autocapitalization hint. Use "off" for code-like inputs. */
|
|
78
|
+
autocapitalize?: JSX.HTMLAutocapitalize;
|
|
79
|
+
/**
|
|
80
|
+
* JSX slot rendered between the (optional) left icon and the input.
|
|
81
|
+
* Use for short inline labels like a currency symbol or a unit
|
|
82
|
+
* prefix that shouldn't take the icon slot. Caller is responsible
|
|
83
|
+
* for keeping it short; long content crowds the input.
|
|
84
|
+
*/
|
|
85
|
+
prefix?: JSX.Element;
|
|
86
|
+
/**
|
|
87
|
+
* JSX slot rendered between the input and the right-edge buttons
|
|
88
|
+
* (clear / password reveal). Use for unit suffixes ("kg", "/min").
|
|
89
|
+
* When `clearable` triggers the ✕ button, the suffix slides left
|
|
90
|
+
* to make room.
|
|
91
|
+
*/
|
|
92
|
+
suffix?: JSX.Element;
|
|
36
93
|
};
|
|
37
94
|
|
|
38
95
|
/**
|
|
@@ -57,6 +114,7 @@ const TextInput = (props: TextInputProps) => {
|
|
|
57
114
|
const activeIcon = () => props.activeIcon ?? "ti ti-pencil";
|
|
58
115
|
const multiline = () => props.multiline ?? markdown(); // markdown implies multiline
|
|
59
116
|
const disabled = () => props.disabled ?? false;
|
|
117
|
+
const monospaceClass = () => (props.monospace ? "font-mono text-sm leading-6" : "");
|
|
60
118
|
const canClear = () => props.clearable && !multiline() && !props.password && !disabled();
|
|
61
119
|
const currentValue = () => props.value?.() ?? "";
|
|
62
120
|
const hasValue = () => currentValue().length > 0;
|
|
@@ -72,6 +130,42 @@ const TextInput = (props: TextInputProps) => {
|
|
|
72
130
|
props.onChange?.("");
|
|
73
131
|
};
|
|
74
132
|
|
|
133
|
+
// Markdown editor takes over entirely — no icon overlay, no clear
|
|
134
|
+
// button, no prefix/suffix. The editor owns its own toolbar + chrome.
|
|
135
|
+
if (markdown()) {
|
|
136
|
+
return (
|
|
137
|
+
<InputWrapper
|
|
138
|
+
label={props.label}
|
|
139
|
+
description={props.description}
|
|
140
|
+
error={props.error?.()}
|
|
141
|
+
required={props.required}
|
|
142
|
+
inputId={a11y.inputId}
|
|
143
|
+
descriptionId={a11y.descriptionId}
|
|
144
|
+
errorId={a11y.errorId}
|
|
145
|
+
>
|
|
146
|
+
<MarkdownEditor
|
|
147
|
+
id={a11y.inputId}
|
|
148
|
+
name={props.name}
|
|
149
|
+
value={() => props.value?.() ?? ""}
|
|
150
|
+
onInput={props.onInput}
|
|
151
|
+
onChange={props.onChange}
|
|
152
|
+
onSubmit={props.onSubmit}
|
|
153
|
+
placeholder={props.placeholder}
|
|
154
|
+
disabled={disabled()}
|
|
155
|
+
lines={props.lines}
|
|
156
|
+
maxLength={props.maxLength}
|
|
157
|
+
abbreviations={props.abbreviations}
|
|
158
|
+
completions={props.completions}
|
|
159
|
+
error={!!props.error?.()}
|
|
160
|
+
ariaLabel={!props.label ? (props.ariaLabel ?? props.placeholder) : undefined}
|
|
161
|
+
ariaDescribedBy={a11y.ariaDescribedBy()}
|
|
162
|
+
ariaInvalid={!!props.error?.()}
|
|
163
|
+
ariaRequired={props.required}
|
|
164
|
+
/>
|
|
165
|
+
</InputWrapper>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
75
169
|
return (
|
|
76
170
|
<InputWrapper
|
|
77
171
|
label={props.label}
|
|
@@ -91,11 +185,23 @@ const TextInput = (props: TextInputProps) => {
|
|
|
91
185
|
<i class={`${icon()} group-focus-within:hidden`} />
|
|
92
186
|
<i class={`${activeIcon()} hidden text-blue-500 group-focus-within:block`} />
|
|
93
187
|
</div>
|
|
188
|
+
{/* Prefix slot — rendered after the icon, before the input.
|
|
189
|
+
Adds left padding via the input's pl-12 (icon+prefix) or
|
|
190
|
+
pl-9 (prefix-only, no icon). Suffix slot mirrors this on
|
|
191
|
+
the right edge, sliding left when a clear / password
|
|
192
|
+
button takes the right-3 anchor. */}
|
|
193
|
+
<Show when={props.prefix}>
|
|
194
|
+
<span
|
|
195
|
+
class="absolute z-10 flex items-center pointer-events-none text-sm text-zinc-500 dark:text-zinc-400 inset-y-0 left-9"
|
|
196
|
+
>
|
|
197
|
+
{props.prefix}
|
|
198
|
+
</span>
|
|
199
|
+
</Show>
|
|
94
200
|
{multiline() ? (
|
|
95
201
|
<textarea
|
|
96
202
|
id={a11y.inputId}
|
|
97
203
|
name={props.name}
|
|
98
|
-
class={`input w-full pl-9 ${disabled() ? "cursor-not-allowed opacity-50" : ""}`}
|
|
204
|
+
class={`input w-full pl-9 ${monospaceClass()} ${disabled() ? "cursor-not-allowed opacity-50" : ""}`}
|
|
99
205
|
style={props.lines ? `min-height: ${props.lines * 1.5}em; max-height: ${Math.max(props.lines * 1.5, 20)}em` : "min-height: 3.75rem; height: 5rem; max-height: 12.5rem"}
|
|
100
206
|
placeholder={props.placeholder}
|
|
101
207
|
value={props.value?.() ?? ""}
|
|
@@ -108,6 +214,10 @@ const TextInput = (props: TextInputProps) => {
|
|
|
108
214
|
}
|
|
109
215
|
}}
|
|
110
216
|
disabled={disabled()}
|
|
217
|
+
maxLength={props.maxLength}
|
|
218
|
+
spellcheck={props.spellcheck}
|
|
219
|
+
autocapitalize={props.autocapitalize}
|
|
220
|
+
autocomplete={props.autocomplete}
|
|
111
221
|
aria-label={!props.label ? (props.ariaLabel ?? props.placeholder) : undefined}
|
|
112
222
|
aria-describedby={a11y.ariaDescribedBy()}
|
|
113
223
|
aria-invalid={!!props.error?.()}
|
|
@@ -119,12 +229,17 @@ const TextInput = (props: TextInputProps) => {
|
|
|
119
229
|
id={a11y.inputId}
|
|
120
230
|
name={props.name}
|
|
121
231
|
type={props.password && !showPassword() ? "password" : (props.type ?? "text")}
|
|
122
|
-
class={`input w-full pl-9 ${props.password || canClear() ? "pr-9" : ""} ${disabled() ? "cursor-not-allowed opacity-50" : ""}`}
|
|
232
|
+
class={`input w-full ${props.prefix ? "pl-12" : "pl-9"} ${props.password || canClear() || props.suffix ? "pr-9" : ""} ${monospaceClass()} ${disabled() ? "cursor-not-allowed opacity-50" : ""}`}
|
|
123
233
|
placeholder={props.placeholder}
|
|
124
234
|
value={currentValue()}
|
|
125
235
|
onChange={(e) => props.onChange?.(e.target.value)}
|
|
126
236
|
onInput={(e) => props.onInput?.(e.target.value)}
|
|
127
237
|
disabled={disabled()}
|
|
238
|
+
inputMode={props.inputMode}
|
|
239
|
+
maxLength={props.maxLength}
|
|
240
|
+
autocomplete={props.autocomplete}
|
|
241
|
+
spellcheck={props.spellcheck}
|
|
242
|
+
autocapitalize={props.autocapitalize}
|
|
128
243
|
aria-label={!props.label ? (props.ariaLabel ?? props.placeholder) : undefined}
|
|
129
244
|
aria-describedby={a11y.ariaDescribedBy()}
|
|
130
245
|
aria-invalid={!!props.error?.()}
|
|
@@ -132,15 +247,31 @@ const TextInput = (props: TextInputProps) => {
|
|
|
132
247
|
aria-disabled={disabled()}
|
|
133
248
|
/>
|
|
134
249
|
)}
|
|
250
|
+
{/* Right-edge stack — order: suffix → clear → password.
|
|
251
|
+
Each takes the right-3 anchor exclusively; siblings shift
|
|
252
|
+
left to right-9 (and right-15 for the rare triple) so
|
|
253
|
+
nothing overlaps. */}
|
|
254
|
+
<Show when={props.suffix && !canClear() && !props.password}>
|
|
255
|
+
<span class="absolute inset-y-0 right-3 z-10 flex items-center pointer-events-none text-sm text-zinc-500 dark:text-zinc-400">
|
|
256
|
+
{props.suffix}
|
|
257
|
+
</span>
|
|
258
|
+
</Show>
|
|
135
259
|
{canClear() && hasValue() && (
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
260
|
+
<>
|
|
261
|
+
<Show when={props.suffix}>
|
|
262
|
+
<span class="absolute inset-y-0 right-9 z-10 flex items-center pointer-events-none text-sm text-zinc-500 dark:text-zinc-400">
|
|
263
|
+
{props.suffix}
|
|
264
|
+
</span>
|
|
265
|
+
</Show>
|
|
266
|
+
<button
|
|
267
|
+
type="button"
|
|
268
|
+
class="absolute inset-y-0 right-3 flex items-center text-zinc-400 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300"
|
|
269
|
+
onClick={handleClear}
|
|
270
|
+
aria-label={props.clearLabel ?? "Clear input"}
|
|
271
|
+
>
|
|
272
|
+
<i class="ti ti-x" />
|
|
273
|
+
</button>
|
|
274
|
+
</>
|
|
144
275
|
)}
|
|
145
276
|
{props.password && !multiline() && (
|
|
146
277
|
<button
|
package/src/ui/input/index.ts
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
abbreviations,
|
|
3
|
+
type Completion,
|
|
4
|
+
type SuggestContext,
|
|
5
|
+
type Suggestion,
|
|
6
|
+
} from "../completion";
|
|
7
|
+
export {
|
|
8
|
+
type AutocompleteEditorProps,
|
|
9
|
+
default as AutocompleteEditor,
|
|
10
|
+
} from "./AutocompleteEditor";
|
|
3
11
|
export { Checkbox, CheckboxInput } from "./Checkbox";
|
|
12
|
+
export { CheckboxCard, type CheckboxCardProps, default as CheckboxCardInput } from "./CheckboxCard";
|
|
13
|
+
export { default as ColorInput } from "./ColorInput";
|
|
14
|
+
export type { ComboboxOption, ComboboxProps } from "./Combobox";
|
|
15
|
+
export { default as Combobox } from "./Combobox";
|
|
16
|
+
export {
|
|
17
|
+
DatePicker,
|
|
18
|
+
type DatePickerProps,
|
|
19
|
+
type DatePreset,
|
|
20
|
+
DateRangePicker,
|
|
21
|
+
type DateRangePickerProps,
|
|
22
|
+
type DateRangeValue,
|
|
23
|
+
DateTimePicker,
|
|
24
|
+
type DateTimePickerProps,
|
|
25
|
+
type DurationPreset,
|
|
26
|
+
} from "./DatePicker";
|
|
27
|
+
export { default as DateTimeInput } from "./DateTimeInput";
|
|
28
|
+
export { default as FileDropzone, type FileDropzoneProps } from "./FileDropzone";
|
|
29
|
+
export { default as IconInput } from "./IconInput";
|
|
30
|
+
export { default as ImageInput } from "./ImageInput";
|
|
31
|
+
export {
|
|
32
|
+
default as MultiSelectInput,
|
|
33
|
+
type MultiSelectFetchDataFn,
|
|
34
|
+
MultiSelectInput as MultiSelect,
|
|
35
|
+
type MultiSelectInputProps,
|
|
36
|
+
type MultiSelectOption,
|
|
37
|
+
} from "./MultiSelectInput";
|
|
38
|
+
export { default as MarkdownEditor, type MarkdownEditorProps } from "./markdown/MarkdownEditor";
|
|
39
|
+
export { default as NumberInput } from "./NumberInput";
|
|
40
|
+
export { default as PinInput } from "./PinInput";
|
|
41
|
+
export { default as SegmentedControl } from "./SegmentedControl";
|
|
4
42
|
export { Select, SelectInput } from "./Select";
|
|
5
43
|
export { default as SelectChip } from "./SelectChip";
|
|
44
|
+
export { default as Slider } from "./Slider";
|
|
6
45
|
export { Switch, SwitchInput } from "./Switch";
|
|
7
|
-
export { default as DateTimeInput } from "./DateTimeInput";
|
|
8
|
-
export { default as SegmentedControl } from "./SegmentedControl";
|
|
9
|
-
export { default as ColorInput } from "./ColorInput";
|
|
10
46
|
export { default as TagsInput } from "./TagsInput";
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
47
|
+
export {
|
|
48
|
+
createTemplateEditorPanesValue,
|
|
49
|
+
default as TemplateEditor,
|
|
50
|
+
type TemplateEditorProps,
|
|
51
|
+
TemplatePreview,
|
|
52
|
+
type TemplatePreviewProps,
|
|
53
|
+
TemplateSampleData,
|
|
54
|
+
type TemplateSampleDataProps,
|
|
55
|
+
type TemplateVariable,
|
|
56
|
+
type TemplateVariableKind,
|
|
57
|
+
} from "./TemplateEditor";
|
|
58
|
+
export { default as TextInput } from "./TextInput";
|