@happyvertical/smrt-messages 0.60.16 → 0.60.18
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/chunks/{AccountCollection-BqxfVklR.js → AccountCollection-4ZT8LimZ.js} +2 -2
- package/dist/chunks/{AccountCollection-BqxfVklR.js.map → AccountCollection-4ZT8LimZ.js.map} +1 -1
- package/dist/chunks/{Email-pFuK_41u.js → Email-NNmas_WR.js} +3 -3
- package/dist/chunks/{Email-pFuK_41u.js.map → Email-NNmas_WR.js.map} +1 -1
- package/dist/chunks/{EmailFolder-BgQXYiFu.js → EmailFolder-DzNpDmjC.js} +2 -2
- package/dist/chunks/{EmailFolder-BgQXYiFu.js.map → EmailFolder-DzNpDmjC.js.map} +1 -1
- package/dist/chunks/{Message-CN0p80pA.js → Message-CHAl820M.js} +4 -4
- package/dist/chunks/{Message-CN0p80pA.js.map → Message-CHAl820M.js.map} +1 -1
- package/dist/chunks/{MessageCollection-BugOEL4f.js → MessageCollection-l7DpPn_N.js} +2 -2
- package/dist/chunks/{MessageCollection-BugOEL4f.js.map → MessageCollection-l7DpPn_N.js.map} +1 -1
- package/dist/chunks/__smrt-register__-zH3JfarO.js +6 -0
- package/dist/chunks/__smrt-register__-zH3JfarO.js.map +1 -0
- package/dist/index.js +9 -9
- package/dist/manifest.json +213 -11
- package/dist/smrt-knowledge.json +85 -7
- package/dist/svelte/components/AccountAvatar.svelte +34 -30
- package/dist/svelte/components/AccountCard.svelte +72 -63
- package/dist/svelte/components/AccountList.svelte +15 -9
- package/dist/svelte/components/AttachmentChip.svelte +54 -39
- package/dist/svelte/components/AttachmentUpload.svelte +55 -48
- package/dist/svelte/components/ComposeForm.svelte +105 -83
- package/dist/svelte/components/EmailAccountManager.svelte +245 -230
- package/dist/svelte/components/EmailFilterManager.svelte +250 -228
- package/dist/svelte/components/FolderNav.svelte +60 -50
- package/dist/svelte/components/ForwardForm.svelte +40 -34
- package/dist/svelte/components/MessageCard.svelte +116 -110
- package/dist/svelte/components/MessageDetail.svelte +107 -92
- package/dist/svelte/components/MessageFilters.svelte +73 -48
- package/dist/svelte/components/MessageList.svelte +20 -13
- package/dist/svelte/components/MessageStatusIndicator.svelte +24 -22
- package/dist/svelte/components/MessageToolbar.svelte +48 -36
- package/dist/svelte/components/MessageTypeBadge.svelte +8 -5
- package/dist/svelte/components/MessagingSettingsPanel.svelte +97 -32
- package/dist/svelte/components/RecipientInput.svelte +63 -43
- package/dist/svelte/components/ReplyForm.svelte +40 -34
- package/dist/svelte/components/SendStatusBadge.svelte +21 -14
- package/dist/svelte/components/ThreadView.svelte +68 -55
- package/package.json +16 -16
- package/dist/chunks/__smrt-register__-D5RmYQK6.js +0 -6
- package/dist/chunks/__smrt-register__-D5RmYQK6.js.map +0 -1
|
@@ -32,29 +32,29 @@ const _lastSyncFormatted = $derived.by(() => {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<Card>
|
|
35
|
-
<div class="account-
|
|
36
|
-
<div class="account-
|
|
35
|
+
<div class="smrt-account-card__body" data-smrt-part="body">
|
|
36
|
+
<div class="smrt-account-card__header" data-smrt-part="header">
|
|
37
37
|
<AccountAvatar providerType={account.providerType} name={account.name} size="lg" />
|
|
38
|
-
<div class="
|
|
39
|
-
<h3 class="
|
|
38
|
+
<div class="smrt-account-card__content" data-smrt-part="body">
|
|
39
|
+
<h3 class="smrt-account-card__name" data-smrt-part="title">{account.name}</h3>
|
|
40
40
|
{#if account.email}
|
|
41
|
-
<span class="
|
|
41
|
+
<span class="smrt-account-card__email" data-smrt-part="meta">{account.email}</span>
|
|
42
42
|
{/if}
|
|
43
|
-
<span class="
|
|
43
|
+
<span class="smrt-account-card__provider" data-smrt-part="meta">{account.providerType}</span>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
<div class="
|
|
48
|
-
<span class="
|
|
47
|
+
<div class="smrt-account-card__meta" data-smrt-part="meta">
|
|
48
|
+
<span class="smrt-account-card__status" class:smrt-account-card__status--active={account.isActive} class:smrt-account-card__status--inactive={!account.isActive} data-smrt-part="badge">
|
|
49
49
|
{account.isActive ? 'Active' : 'Inactive'}
|
|
50
50
|
</span>
|
|
51
|
-
<span class="
|
|
51
|
+
<span class="smrt-account-card__sync-time" data-smrt-part="time">{_lastSyncFormatted}</span>
|
|
52
52
|
{#if account.unreadCount !== undefined}
|
|
53
|
-
<span class="
|
|
53
|
+
<span class="smrt-account-card__unread-count" data-smrt-part="count">{account.unreadCount} unread</span>
|
|
54
54
|
{/if}
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
|
-
<div class="actions">
|
|
57
|
+
<div class="smrt-account-card__actions" data-smrt-part="actions">
|
|
58
58
|
{#if onsync && account.isActive}
|
|
59
59
|
<Button variant="ghost" size="sm" class="action-btn" onclick={() => onsync?.(account)}>
|
|
60
60
|
Sync
|
|
@@ -81,110 +81,119 @@ const _lastSyncFormatted = $derived.by(() => {
|
|
|
81
81
|
|
|
82
82
|
<style>
|
|
83
83
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
84
|
-
@layer smrt.
|
|
85
|
-
.account-
|
|
84
|
+
@layer smrt.structure {
|
|
85
|
+
.smrt-account-card__body {
|
|
86
86
|
display: flex;
|
|
87
87
|
flex-direction: column;
|
|
88
88
|
gap: 0.75rem;
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
.account-info {
|
|
90
|
+
.smrt-account-card__header {
|
|
92
91
|
display: flex;
|
|
93
92
|
align-items: center;
|
|
94
93
|
gap: 0.75rem;
|
|
95
94
|
}
|
|
96
|
-
|
|
97
|
-
.details {
|
|
95
|
+
.smrt-account-card__content {
|
|
98
96
|
display: flex;
|
|
99
97
|
flex-direction: column;
|
|
100
98
|
gap: 0.125rem;
|
|
101
99
|
min-width: 0;
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
.name {
|
|
101
|
+
.smrt-account-card__name {
|
|
105
102
|
margin: 0;
|
|
106
|
-
font: var(--smrt-typography-title-medium-font, 500 1rem / 1.25 sans-serif);
|
|
107
|
-
color: var(--smrt-color-on-surface);
|
|
108
103
|
}
|
|
109
|
-
|
|
110
|
-
.email {
|
|
111
|
-
font: var(--smrt-typography-body-small-font, 0.75rem / 1.33 sans-serif);
|
|
112
|
-
color: var(--smrt-color-on-surface-variant);
|
|
104
|
+
.smrt-account-card__email {
|
|
113
105
|
overflow: hidden;
|
|
114
106
|
text-overflow: ellipsis;
|
|
115
107
|
white-space: nowrap;
|
|
116
108
|
}
|
|
109
|
+
.smrt-account-card__meta {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: 0.75rem;
|
|
113
|
+
}
|
|
114
|
+
.smrt-account-card__status {
|
|
115
|
+
padding: 0.125rem 0.375rem;
|
|
116
|
+
}
|
|
117
|
+
.smrt-account-card__actions {
|
|
118
|
+
display: flex;
|
|
119
|
+
gap: 0.375rem;
|
|
120
|
+
}
|
|
121
|
+
/*
|
|
122
|
+
* The action buttons now render through smrt-ui's <Button variant="ghost">.
|
|
123
|
+
* Svelte scopes `.action-btn` to this component, but the <button> is emitted
|
|
124
|
+
* inside the Button child, so a plain `.action-btn {}` rule would not match —
|
|
125
|
+
* `.smrt-account-card__actions :global(.action-btn)` anchors on `.smrt-account-card__actions` (a real element here)
|
|
126
|
+
* and pierces into the child (issue #1589). These overrides keep the original
|
|
127
|
+
* outlined-surface look (border/radius/color); the modifier class is
|
|
128
|
+
* `action-btn--danger`, NOT `danger`, so it never collides with Button's own
|
|
129
|
+
* `.danger` variant class.
|
|
130
|
+
*/
|
|
131
|
+
.smrt-account-card__actions :global(.action-btn) {
|
|
132
|
+
padding: 0.375rem 0.75rem;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
117
135
|
|
|
118
|
-
|
|
136
|
+
@layer smrt.theme {
|
|
137
|
+
.smrt-account-card__name {
|
|
138
|
+
font: var(--smrt-typography-title-medium-font, 500 1rem / 1.25 sans-serif);
|
|
139
|
+
color: var(--smrt-color-on-surface);
|
|
140
|
+
}
|
|
141
|
+
.smrt-account-card__email {
|
|
142
|
+
font: var(--smrt-typography-body-small-font, 0.75rem / 1.33 sans-serif);
|
|
143
|
+
color: var(--smrt-color-on-surface-variant);
|
|
144
|
+
}
|
|
145
|
+
.smrt-account-card__provider {
|
|
119
146
|
font: var(--smrt-typography-label-small-font, 500 0.6875rem / 1 sans-serif);
|
|
120
147
|
color: var(--smrt-color-on-surface-variant);
|
|
121
148
|
text-transform: uppercase;
|
|
122
149
|
letter-spacing: 0.05em;
|
|
123
150
|
}
|
|
124
|
-
|
|
125
|
-
.status-row {
|
|
126
|
-
display: flex;
|
|
127
|
-
align-items: center;
|
|
128
|
-
gap: 0.75rem;
|
|
151
|
+
.smrt-account-card__meta {
|
|
129
152
|
font: var(--smrt-typography-body-small-font, 0.75rem / 1.33 sans-serif);
|
|
130
153
|
}
|
|
131
|
-
|
|
132
|
-
.status {
|
|
133
|
-
padding: 0.125rem 0.375rem;
|
|
154
|
+
.smrt-account-card__status {
|
|
134
155
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
135
156
|
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
136
157
|
}
|
|
137
|
-
|
|
138
|
-
.status--active {
|
|
158
|
+
.smrt-account-card__status--active {
|
|
139
159
|
background: var(--smrt-color-tertiary-container);
|
|
140
160
|
color: var(--smrt-color-on-tertiary-container);
|
|
141
161
|
}
|
|
142
|
-
|
|
143
|
-
.status--inactive {
|
|
162
|
+
.smrt-account-card__status--inactive {
|
|
144
163
|
background: var(--smrt-color-surface-variant);
|
|
145
164
|
color: var(--smrt-color-on-surface-variant);
|
|
146
165
|
}
|
|
147
|
-
|
|
148
|
-
.sync-time {
|
|
166
|
+
.smrt-account-card__sync-time {
|
|
149
167
|
color: var(--smrt-color-on-surface-variant);
|
|
150
168
|
}
|
|
151
|
-
|
|
152
|
-
.unread-count {
|
|
169
|
+
.smrt-account-card__unread-count {
|
|
153
170
|
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
154
171
|
color: var(--smrt-color-primary);
|
|
155
172
|
}
|
|
156
|
-
|
|
157
|
-
.actions {
|
|
158
|
-
display: flex;
|
|
159
|
-
gap: 0.375rem;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
173
|
/*
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
padding: 0.375rem 0.75rem;
|
|
174
|
+
* The action buttons now render through smrt-ui's <Button variant="ghost">.
|
|
175
|
+
* Svelte scopes `.action-btn` to this component, but the <button> is emitted
|
|
176
|
+
* inside the Button child, so a plain `.action-btn {}` rule would not match —
|
|
177
|
+
* `.smrt-account-card__actions :global(.action-btn)` anchors on `.smrt-account-card__actions` (a real element here)
|
|
178
|
+
* and pierces into the child (issue #1589). These overrides keep the original
|
|
179
|
+
* outlined-surface look (border/radius/color); the modifier class is
|
|
180
|
+
* `action-btn--danger`, NOT `danger`, so it never collides with Button's own
|
|
181
|
+
* `.danger` variant class.
|
|
182
|
+
*/
|
|
183
|
+
.smrt-account-card__actions :global(.action-btn) {
|
|
174
184
|
border: var(--smrt-hairline-strong);
|
|
175
185
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
176
186
|
background: var(--smrt-color-surface);
|
|
177
187
|
color: var(--smrt-color-on-surface);
|
|
178
188
|
font: var(--smrt-typography-label-medium-font, 500 0.75rem / 1.33 sans-serif);
|
|
179
189
|
}
|
|
180
|
-
|
|
181
|
-
.actions :global(.action-btn):hover {
|
|
190
|
+
.smrt-account-card__actions :global(.action-btn):hover {
|
|
182
191
|
background: var(--smrt-color-surface-variant);
|
|
183
192
|
}
|
|
184
|
-
|
|
185
|
-
.actions :global(.action-btn--danger) {
|
|
193
|
+
.smrt-account-card__actions :global(.action-btn--danger) {
|
|
186
194
|
color: var(--smrt-color-error);
|
|
187
195
|
border-color: var(--smrt-color-error);
|
|
188
196
|
}
|
|
189
197
|
}
|
|
198
|
+
|
|
190
199
|
</style>
|
|
@@ -56,13 +56,13 @@ function handleAccountKeydown(event: KeyboardEvent, account: AccountData) {
|
|
|
56
56
|
}
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
|
-
<div class="account-
|
|
59
|
+
<div class="smrt-account-list__root" role="list" aria-label={t(M['messages.account_list.accounts'])} data-smrt-component="AccountList">
|
|
60
60
|
{#if loading}
|
|
61
|
-
<div class="
|
|
61
|
+
<div class="smrt-account-list__message" role="status" aria-live="polite" data-smrt-part="message">
|
|
62
62
|
<p>{t(M['messages.account_list.loading'])}</p>
|
|
63
63
|
</div>
|
|
64
64
|
{:else if accounts.length === 0}
|
|
65
|
-
<div class="
|
|
65
|
+
<div class="smrt-account-list__empty" role="status" aria-live="polite" data-smrt-part="empty">
|
|
66
66
|
<p>{t(M['messages.account_list.empty'])}</p>
|
|
67
67
|
</div>
|
|
68
68
|
{:else}
|
|
@@ -91,17 +91,23 @@ function handleAccountKeydown(event: KeyboardEvent, account: AccountData) {
|
|
|
91
91
|
|
|
92
92
|
<style>
|
|
93
93
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
94
|
+
@layer smrt.structure {
|
|
95
|
+
.smrt-account-list__message,
|
|
96
|
+
.smrt-account-list__empty {
|
|
97
|
+
padding: var(--smrt-spacing-3xl, 3rem);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
94
101
|
@layer smrt.theme {
|
|
95
|
-
.
|
|
96
|
-
.
|
|
102
|
+
.smrt-account-list__message,
|
|
103
|
+
.smrt-account-list__empty {
|
|
97
104
|
text-align: center;
|
|
98
|
-
padding: var(--smrt-spacing-3xl, 3rem);
|
|
99
105
|
color: var(--smrt-color-on-surface-variant);
|
|
100
106
|
}
|
|
101
|
-
|
|
102
|
-
.
|
|
103
|
-
.empty p {
|
|
107
|
+
.smrt-account-list__message p,
|
|
108
|
+
.smrt-account-list__empty p {
|
|
104
109
|
font: var(--smrt-typography-body-large-font, 1.125rem / 1.5 sans-serif);
|
|
105
110
|
}
|
|
106
111
|
}
|
|
112
|
+
|
|
107
113
|
</style>
|
|
@@ -42,82 +42,97 @@ const _formattedSize = $derived.by(() => {
|
|
|
42
42
|
onclick={() => onclick?.(attachment)}
|
|
43
43
|
title={`${attachment.filename} (${_formattedSize})`}
|
|
44
44
|
>
|
|
45
|
-
<span class="icon">{_icon}</span>
|
|
46
|
-
<span class="
|
|
47
|
-
<span class="
|
|
45
|
+
<span class="smrt-attachment-chip__icon" data-smrt-part="icon">{_icon}</span>
|
|
46
|
+
<span class="smrt-attachment-chip__name" data-smrt-part="title">{attachment.filename}</span>
|
|
47
|
+
<span class="smrt-attachment-chip__size" data-smrt-part="meta">{_formattedSize}</span>
|
|
48
48
|
</Button>
|
|
49
49
|
{:else}
|
|
50
|
-
<span class="
|
|
51
|
-
<span class="icon">{_icon}</span>
|
|
52
|
-
<span class="
|
|
53
|
-
<span class="
|
|
50
|
+
<span class="smrt-attachment-chip__root" title={`${attachment.filename} (${_formattedSize})`} data-smrt-component="AttachmentChip">
|
|
51
|
+
<span class="smrt-attachment-chip__icon" data-smrt-part="icon">{_icon}</span>
|
|
52
|
+
<span class="smrt-attachment-chip__name" data-smrt-part="title">{attachment.filename}</span>
|
|
53
|
+
<span class="smrt-attachment-chip__size" data-smrt-part="meta">{_formattedSize}</span>
|
|
54
54
|
</span>
|
|
55
55
|
{/if}
|
|
56
56
|
|
|
57
57
|
<style>
|
|
58
58
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
59
|
-
@layer smrt.
|
|
60
|
-
.
|
|
59
|
+
@layer smrt.structure {
|
|
60
|
+
.smrt-attachment-chip__root {
|
|
61
61
|
display: inline-flex;
|
|
62
62
|
align-items: center;
|
|
63
63
|
gap: 0.375rem;
|
|
64
64
|
padding: 0.25rem 0.625rem;
|
|
65
|
-
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
66
|
-
background: var(--smrt-color-surface-variant);
|
|
67
|
-
color: var(--smrt-color-on-surface-variant);
|
|
68
|
-
font: var(--smrt-typography-label-medium-font, 500 0.75rem / 1.33 sans-serif);
|
|
69
|
-
border: none;
|
|
70
65
|
cursor: default;
|
|
71
66
|
max-width: 200px;
|
|
72
67
|
}
|
|
73
|
-
|
|
74
68
|
/*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
* The interactive chip now renders through smrt-ui's <Button variant="ghost">.
|
|
70
|
+
* The <button> is emitted inside the Button child carrying Button's scope hash,
|
|
71
|
+
* so the local `.smrt-attachment-chip__root` rule above no longer reaches it. `:global(.chip--button)`
|
|
72
|
+
* pierces that scope to give the button the same chip styling plus the
|
|
73
|
+
* pressable affordances; `chip--button` is a non-colliding modifier (issue
|
|
74
|
+
* #1589). The non-interactive `<span class="smrt-attachment-chip__root">` branch still uses the
|
|
75
|
+
* scoped `.smrt-attachment-chip__root` rule above.
|
|
76
|
+
*/
|
|
83
77
|
:global(.chip.chip--button) {
|
|
84
78
|
display: inline-flex;
|
|
85
79
|
align-items: center;
|
|
86
80
|
gap: 0.375rem;
|
|
87
81
|
padding: 0.25rem 0.625rem;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
max-width: 200px;
|
|
84
|
+
}
|
|
85
|
+
.smrt-attachment-chip__icon {
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
}
|
|
88
|
+
.smrt-attachment-chip__name {
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
.smrt-attachment-chip__size {
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@layer smrt.theme {
|
|
99
|
+
.smrt-attachment-chip__root {
|
|
100
|
+
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
101
|
+
background: var(--smrt-color-surface-variant);
|
|
102
|
+
color: var(--smrt-color-on-surface-variant);
|
|
103
|
+
font: var(--smrt-typography-label-medium-font, 500 0.75rem / 1.33 sans-serif);
|
|
104
|
+
border: none;
|
|
105
|
+
}
|
|
106
|
+
/*
|
|
107
|
+
* The interactive chip now renders through smrt-ui's <Button variant="ghost">.
|
|
108
|
+
* The <button> is emitted inside the Button child carrying Button's scope hash,
|
|
109
|
+
* so the local `.smrt-attachment-chip__root` rule above no longer reaches it. `:global(.chip--button)`
|
|
110
|
+
* pierces that scope to give the button the same chip styling plus the
|
|
111
|
+
* pressable affordances; `chip--button` is a non-colliding modifier (issue
|
|
112
|
+
* #1589). The non-interactive `<span class="smrt-attachment-chip__root">` branch still uses the
|
|
113
|
+
* scoped `.smrt-attachment-chip__root` rule above.
|
|
114
|
+
*/
|
|
115
|
+
:global(.chip.chip--button) {
|
|
88
116
|
border-radius: var(--smrt-radius-small, 0.25rem);
|
|
89
117
|
background: var(--smrt-color-surface-variant);
|
|
90
118
|
color: var(--smrt-color-on-surface-variant);
|
|
91
119
|
font: var(--smrt-typography-label-medium-font, 500 0.75rem / 1.33 sans-serif);
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
max-width: 200px;
|
|
94
120
|
transition: background var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
|
|
95
121
|
}
|
|
96
|
-
|
|
97
122
|
:global(.chip.chip--button):hover {
|
|
98
123
|
background: color-mix(in srgb, var(--smrt-color-surface-variant) 92%, var(--smrt-color-shadow));
|
|
99
124
|
}
|
|
100
|
-
|
|
101
125
|
:global(.chip.chip--button):focus-visible {
|
|
102
126
|
outline: 2px solid var(--smrt-color-primary);
|
|
103
127
|
outline-offset: 1px;
|
|
104
128
|
}
|
|
105
|
-
|
|
106
|
-
.icon {
|
|
107
|
-
flex-shrink: 0;
|
|
129
|
+
.smrt-attachment-chip__icon {
|
|
108
130
|
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
109
131
|
}
|
|
110
|
-
|
|
111
|
-
.name {
|
|
112
|
-
overflow: hidden;
|
|
113
|
-
text-overflow: ellipsis;
|
|
114
|
-
white-space: nowrap;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.size {
|
|
118
|
-
flex-shrink: 0;
|
|
132
|
+
.smrt-attachment-chip__size {
|
|
119
133
|
opacity: 0.7;
|
|
120
134
|
font-size: var(--smrt-typography-label-small-size, 0.6875rem);
|
|
121
135
|
}
|
|
122
136
|
}
|
|
137
|
+
|
|
123
138
|
</style>
|
|
@@ -57,13 +57,13 @@ export interface Props {
|
|
|
57
57
|
}
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
|
-
<div class="attachment-
|
|
60
|
+
<div class="smrt-attachment-upload__root" data-smrt-component="AttachmentUpload">
|
|
61
61
|
{#if attachments.length > 0}
|
|
62
|
-
<div class="attachment-list">
|
|
62
|
+
<div class="smrt-attachment-upload__list" data-smrt-part="list">
|
|
63
63
|
{#each attachments as attachment, i}
|
|
64
|
-
<div class="attachment-item">
|
|
65
|
-
<span class="
|
|
66
|
-
<span class="
|
|
64
|
+
<div class="smrt-attachment-upload__item" data-smrt-part="item">
|
|
65
|
+
<span class="smrt-attachment-upload__name" data-smrt-part="title">{attachment.filename}</span>
|
|
66
|
+
<span class="smrt-attachment-upload__size" data-smrt-part="meta">{formatSize(attachment.size)}</span>
|
|
67
67
|
<Button
|
|
68
68
|
variant="ghost"
|
|
69
69
|
size="sm"
|
|
@@ -77,103 +77,110 @@ export interface Props {
|
|
|
77
77
|
|
|
78
78
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
79
79
|
<div
|
|
80
|
-
class="
|
|
81
|
-
class:
|
|
80
|
+
class="smrt-attachment-upload__field"
|
|
81
|
+
class:smrt-attachment-upload__drag-over={isDragOver}
|
|
82
82
|
ondrop={handleDrop}
|
|
83
83
|
ondragover={handleDragOver}
|
|
84
|
-
ondragleave={handleDragLeave}
|
|
84
|
+
ondragleave={handleDragLeave} data-smrt-part="field"
|
|
85
85
|
>
|
|
86
|
-
<label class="
|
|
86
|
+
<label class="smrt-attachment-upload__label" data-smrt-part="label">
|
|
87
87
|
<!-- raw-primitive-allow: native file input — the Input primitive binds value, which is invalid for type=file (throws InvalidStateError on the bind write-back) and renders a visible control; this hidden picker behind the drop zone stays native -->
|
|
88
88
|
<input
|
|
89
89
|
type="file"
|
|
90
90
|
multiple
|
|
91
|
-
class="
|
|
91
|
+
class="smrt-attachment-upload__input"
|
|
92
|
+
data-smrt-part="input"
|
|
92
93
|
onchange={(e) => handleFiles((e.currentTarget as HTMLInputElement).files)}
|
|
93
94
|
/>
|
|
94
|
-
<span class="
|
|
95
|
+
<span class="smrt-attachment-upload__message" data-smrt-part="message">{t(M['messages.attachment_upload.drop_files'])}</span>
|
|
95
96
|
</label>
|
|
96
97
|
</div>
|
|
97
98
|
</div>
|
|
98
99
|
|
|
99
100
|
<style>
|
|
100
101
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
101
|
-
@layer smrt.
|
|
102
|
-
.attachment-
|
|
102
|
+
@layer smrt.structure {
|
|
103
|
+
.smrt-attachment-upload__root {
|
|
103
104
|
display: flex;
|
|
104
105
|
flex-direction: column;
|
|
105
106
|
gap: var(--smrt-spacing-2);
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
.attachment-list {
|
|
108
|
+
.smrt-attachment-upload__list {
|
|
109
109
|
display: flex;
|
|
110
110
|
flex-wrap: wrap;
|
|
111
111
|
gap: var(--smrt-spacing-1);
|
|
112
112
|
}
|
|
113
|
-
|
|
114
|
-
.attachment-item {
|
|
113
|
+
.smrt-attachment-upload__item {
|
|
115
114
|
display: inline-flex;
|
|
116
115
|
align-items: center;
|
|
117
116
|
gap: var(--smrt-spacing-2);
|
|
118
117
|
padding: var(--smrt-spacing-1) var(--smrt-spacing-2);
|
|
118
|
+
}
|
|
119
|
+
/*
|
|
120
|
+
* The remove button now renders through smrt-ui's <Button variant="ghost">.
|
|
121
|
+
* The <button> lives inside the Button child, so `.smrt-attachment-upload__item :global(.remove)`
|
|
122
|
+
* anchors on the real `.smrt-attachment-upload__item` element and pierces the child scope to
|
|
123
|
+
* keep the compact error-colored icon styling (issue #1589).
|
|
124
|
+
*/
|
|
125
|
+
.smrt-attachment-upload__item :global(.remove) {
|
|
126
|
+
padding: 0 var(--smrt-spacing-1);
|
|
127
|
+
}
|
|
128
|
+
.smrt-attachment-upload__field {
|
|
129
|
+
padding: var(--smrt-spacing-3);
|
|
130
|
+
}
|
|
131
|
+
.smrt-attachment-upload__label {
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
}
|
|
134
|
+
/*
|
|
135
|
+
* The native file input stays visually hidden — the visible affordance is the
|
|
136
|
+
* `.smrt-attachment-upload__message` label inside the styled drop-zone (issue #1589).
|
|
137
|
+
*/
|
|
138
|
+
.smrt-attachment-upload__label .smrt-attachment-upload__input {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@layer smrt.theme {
|
|
144
|
+
.smrt-attachment-upload__item {
|
|
119
145
|
border-radius: var(--smrt-radius-sm);
|
|
120
146
|
background: var(--smrt-color-surface-variant);
|
|
121
147
|
font-size: var(--smrt-typography-body-medium-size);
|
|
122
148
|
font-family: var(--smrt-font-family, system-ui);
|
|
123
149
|
}
|
|
124
|
-
|
|
125
|
-
.filename {
|
|
150
|
+
.smrt-attachment-upload__name {
|
|
126
151
|
color: var(--smrt-color-on-surface-variant);
|
|
127
152
|
}
|
|
128
|
-
|
|
129
|
-
.size {
|
|
153
|
+
.smrt-attachment-upload__size {
|
|
130
154
|
color: var(--smrt-color-outline);
|
|
131
155
|
font-size: var(--smrt-typography-label-small-size);
|
|
132
156
|
}
|
|
133
|
-
|
|
134
157
|
/*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.attachment-
|
|
158
|
+
* The remove button now renders through smrt-ui's <Button variant="ghost">.
|
|
159
|
+
* The <button> lives inside the Button child, so `.smrt-attachment-upload__item :global(.remove)`
|
|
160
|
+
* anchors on the real `.smrt-attachment-upload__item` element and pierces the child scope to
|
|
161
|
+
* keep the compact error-colored icon styling (issue #1589).
|
|
162
|
+
*/
|
|
163
|
+
.smrt-attachment-upload__item :global(.remove) {
|
|
141
164
|
background: none;
|
|
142
165
|
border: none;
|
|
143
|
-
padding: 0 var(--smrt-spacing-1);
|
|
144
166
|
color: var(--smrt-color-error);
|
|
145
167
|
font-size: var(--smrt-typography-label-large-size);
|
|
146
168
|
}
|
|
147
|
-
|
|
148
|
-
.drop-zone {
|
|
169
|
+
.smrt-attachment-upload__field {
|
|
149
170
|
border: 2px dashed var(--smrt-color-outline-variant);
|
|
150
171
|
border-radius: var(--smrt-radius-md);
|
|
151
|
-
padding: var(--smrt-spacing-3);
|
|
152
172
|
text-align: center;
|
|
153
173
|
transition: border-color var(--smrt-duration-fast, 150ms) var(--smrt-easing-standard, ease);
|
|
154
174
|
}
|
|
155
|
-
|
|
156
|
-
.drop-zone.drag-over {
|
|
175
|
+
.smrt-attachment-upload__field.smrt-attachment-upload__drag-over {
|
|
157
176
|
border-color: var(--smrt-color-primary);
|
|
158
177
|
background: var(--smrt-color-primary-container);
|
|
159
178
|
}
|
|
160
|
-
|
|
161
|
-
.upload-label {
|
|
162
|
-
cursor: pointer;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/*
|
|
166
|
-
* The native file input stays visually hidden — the visible affordance is the
|
|
167
|
-
* `.upload-text` label inside the styled drop-zone (issue #1589).
|
|
168
|
-
*/
|
|
169
|
-
.upload-label .file-input {
|
|
170
|
-
display: none;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.upload-text {
|
|
179
|
+
.smrt-attachment-upload__message {
|
|
174
180
|
color: var(--smrt-color-outline);
|
|
175
181
|
font-size: var(--smrt-typography-body-medium-size);
|
|
176
182
|
font-family: var(--smrt-font-family, system-ui);
|
|
177
183
|
}
|
|
178
184
|
}
|
|
185
|
+
|
|
179
186
|
</style>
|