@happyvertical/smrt-svelte 0.60.15 → 0.60.17

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.
Files changed (92) hide show
  1. package/AGENTS.md +1 -0
  2. package/dist/browser-ai/svelte/components/DownloadProgress.svelte +61 -48
  3. package/dist/browser-ai/svelte/components/ModelStatusControl.svelte +32 -31
  4. package/dist/browser-ai/svelte/components/STTTest.svelte +95 -91
  5. package/dist/browser-ai/svelte/components/VoiceInput.svelte +64 -66
  6. package/dist/components/app/AppShell.svelte +137 -29
  7. package/dist/components/app/DockToggles.svelte +34 -24
  8. package/dist/components/app/OwnerSetupForm.svelte +11 -5
  9. package/dist/components/app/ShellColorSchemeToggle.svelte +8 -1
  10. package/dist/components/app/ShellSettingsPage.svelte +5 -1
  11. package/dist/components/audit/AuditList.svelte +11 -2
  12. package/dist/components/audit/RecordHistory.svelte +43 -31
  13. package/dist/components/board/Board.svelte +127 -22
  14. package/dist/components/command-palette/CommandPaletteDialog.svelte +97 -93
  15. package/dist/components/command-palette/CommandPaletteTrigger.svelte +15 -11
  16. package/dist/components/cookbook/CookbookSectionOverview.svelte +1 -1
  17. package/dist/components/cookbook/CookbookSectionPage.svelte +30 -27
  18. package/dist/components/forms/AddressInput.svelte +73 -71
  19. package/dist/components/forms/CheckboxInput.svelte +57 -49
  20. package/dist/components/forms/DateRangeInput.svelte +110 -121
  21. package/dist/components/forms/DateTimeInput.svelte +68 -64
  22. package/dist/components/forms/FileUpload.svelte +96 -81
  23. package/dist/components/forms/Form.svelte +78 -79
  24. package/dist/components/forms/FormMicButton.svelte +53 -44
  25. package/dist/components/forms/FormScope.svelte +7 -3
  26. package/dist/components/forms/MeasurementInput.svelte +59 -53
  27. package/dist/components/forms/MoneyInput.svelte +37 -33
  28. package/dist/components/forms/NumberInput.svelte +37 -32
  29. package/dist/components/forms/PhoneInput.svelte +107 -101
  30. package/dist/components/forms/SearchInput.svelte +98 -95
  31. package/dist/components/forms/SelectInput.svelte +68 -61
  32. package/dist/components/forms/TextInput.svelte +87 -77
  33. package/dist/components/forms/TextareaInput.svelte +85 -75
  34. package/dist/components/import-export/ImportExport.svelte +32 -21
  35. package/dist/components/module/ModulePanel.svelte +33 -24
  36. package/dist/components/notifications/NotificationBell.svelte +92 -22
  37. package/dist/components/overview/OverviewAssistantUndo.svelte +8 -5
  38. package/dist/components/overview/OverviewGrid.svelte +230 -58
  39. package/dist/components/overview/WidgetOptionsForm.svelte +25 -8
  40. package/dist/components/overview/widgets/LineItemsWidget.svelte +92 -28
  41. package/dist/components/overview/widgets/MetricWidget.svelte +46 -11
  42. package/dist/components/overview/widgets/NoteWidget.svelte +57 -15
  43. package/dist/components/overview/widgets/RecordListWidget.svelte +79 -19
  44. package/dist/components/overview/widgets/RecordTable.svelte +22 -6
  45. package/dist/components/overview/widgets/RelatedWidget.svelte +35 -9
  46. package/dist/components/overview/widgets/ShortcutsWidget.svelte +120 -25
  47. package/dist/components/screens/DetailScreen.svelte +43 -33
  48. package/dist/components/screens/EditForm.svelte +17 -9
  49. package/dist/components/screens/ListScreen.svelte +8 -4
  50. package/dist/components/screens/RecordHeader.svelte +101 -28
  51. package/dist/components/screens/RecordScreen.svelte +37 -29
  52. package/dist/components/settings/SettingsCatalog.svelte +62 -56
  53. package/dist/components/sortable/Sortable.svelte +148 -31
  54. package/dist/components/workspace/Breadcrumbs.svelte +30 -28
  55. package/dist/components/workspace/NavTree.svelte +120 -115
  56. package/dist/components/workspace/RoleShell.svelte +26 -15
  57. package/dist/components/workspace/WorkspaceShell.svelte +277 -290
  58. package/dist/components/workspace/admin-shell/ActivityItem.svelte +18 -16
  59. package/dist/components/workspace/admin-shell/ActivityList.svelte +7 -2
  60. package/dist/components/workspace/admin-shell/ActivityTicker.svelte +76 -23
  61. package/dist/components/workspace/admin-shell/ActivityToasts.svelte +14 -14
  62. package/dist/components/workspace/admin-shell/AdminShell.svelte +626 -604
  63. package/dist/components/workspace/admin-shell/AppScopePanel.svelte +11 -13
  64. package/dist/components/workspace/admin-shell/HotkeyInput.svelte +8 -3
  65. package/dist/components/workspace/admin-shell/PhoneBottomBar.svelte +83 -59
  66. package/dist/components/workspace/admin-shell/PhoneTopBar.svelte +22 -17
  67. package/dist/components/workspace/admin-shell/ShellBrand.svelte +43 -19
  68. package/dist/components/workspace/admin-shell/ShellCorner.svelte +5 -2
  69. package/dist/components/workspace/admin-shell/ShellIconButton.svelte +37 -9
  70. package/dist/components/workspace/admin-shell/ShellLayoutEditor.svelte +98 -26
  71. package/dist/components/workspace/admin-shell/ShellNavEditor.svelte +204 -45
  72. package/dist/components/workspace/admin-shell/ShellNavToggle.svelte +8 -4
  73. package/dist/components/workspace/admin-shell/ShellSectionIcon.svelte +9 -1
  74. package/dist/components/workspace/admin-shell/ShellSectionMenu.svelte +281 -62
  75. package/dist/components/workspace/admin-shell/ShellSettingsPanel.svelte +20 -26
  76. package/dist/components/workspace/admin-shell/ShellTitle.svelte +9 -5
  77. package/dist/components/workspace/admin-shell/ShortcutsOverlay.svelte +5 -4
  78. package/dist/components/workspace/admin-shell/SystemScopePanel.svelte +22 -22
  79. package/dist/components/workspace/admin-shell/SystemStatusChips.svelte +31 -17
  80. package/dist/components/workspace/admin-shell/TenantNav.svelte +144 -103
  81. package/dist/components/workspace/admin-shell/WorkspaceAccountMenu.svelte +109 -80
  82. package/dist/components/workspace/tools-dock/ToolsDock.svelte +167 -159
  83. package/dist/components/workspace/types.d.ts +1 -1
  84. package/dist/mcp-apps/McpAppsBridge.svelte +15 -11
  85. package/dist/smrt-knowledge.okf.md +3 -2
  86. package/dist/svelte/playground/ShellStylelessPreview.svelte +47 -0
  87. package/dist/svelte/playground/ShellStylelessPreview.svelte.d.ts +4 -0
  88. package/dist/svelte/playground/ShellStylelessPreview.svelte.d.ts.map +1 -0
  89. package/dist/svelte/playground.d.ts +18 -0
  90. package/dist/svelte/playground.d.ts.map +1 -0
  91. package/dist/svelte/playground.js +14 -0
  92. package/package.json +21 -16
@@ -58,9 +58,9 @@ function handleKeydown(e: KeyboardEvent) {
58
58
 
59
59
  {#if isSmrt && formContext}
60
60
  <span
61
- class="form-mic-icon {className}"
62
- class:listening={isListening}
63
- class:extracting={isExtracting}
61
+ class="smrt-form-mic-button__root {className}"
62
+ class:smrt-form-mic-button__listening={isListening}
63
+ class:smrt-form-mic-button__extracting={isExtracting}
64
64
  onclick={handleClick}
65
65
  onkeydown={handleKeydown}
66
66
  role="button"
@@ -75,7 +75,8 @@ function handleKeydown(e: KeyboardEvent) {
75
75
  fill="none"
76
76
  stroke="currentColor"
77
77
  stroke-width="2"
78
- class="spinner"
78
+ class="smrt-form-mic-button__spinner"
79
+ data-smrt-part="spinner"
79
80
  >
80
81
  <circle cx="12" cy="12" r="10" stroke-dasharray="32" stroke-dashoffset="12"/>
81
82
  </svg>
@@ -96,90 +97,98 @@ function handleKeydown(e: KeyboardEvent) {
96
97
  </svg>
97
98
  {/if}
98
99
  {#if isListening}
99
- <span class="tooltip">{t(M['ui.form_mic_button.tooltip'])}</span>
100
+ <span class="smrt-form-mic-button__tooltip" data-smrt-part="description">{t(M['ui.form_mic_button.tooltip'])}</span>
100
101
  {/if}
101
102
  </span>
102
103
  {/if}
103
104
 
104
105
  <style>
105
106
  @layer smrt.reset, smrt.structure, smrt.theme;
106
- @layer smrt.theme {
107
- .form-mic-icon {
107
+ @layer smrt.structure {
108
+ .smrt-form-mic-button__root {
108
109
  display: inline-flex;
109
110
  align-items: center;
110
111
  justify-content: center;
111
112
  position: relative;
112
- color: var(--smrt-color-on-surface-variant);
113
113
  cursor: pointer;
114
- transition: color var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
115
- vertical-align: middle;
116
114
  margin-left: 0.5rem;
117
115
  }
116
+ .smrt-form-mic-button__tooltip {
117
+ position: absolute;
118
+ top: 100%;
119
+ left: 50%;
120
+ margin-top: 0.5rem;
121
+ padding: 0.5rem 0.75rem;
122
+ white-space: nowrap;
123
+ z-index: var(--smrt-z-index-tooltip, 1600);
124
+ transform: translateX(-50%);
125
+ }
126
+ .smrt-form-mic-button__tooltip::before {
127
+ position: absolute;
128
+ bottom: 100%;
129
+ left: 50%;
130
+ content: '';
131
+ transform: translateX(-50%);
132
+ }
133
+ }
118
134
 
119
- .form-mic-icon:hover {
135
+ @layer smrt.theme {
136
+ .smrt-form-mic-button__root {
137
+ color: var(--smrt-color-on-surface-variant);
138
+ transition: color var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
139
+ vertical-align: middle;
140
+ }
141
+ .smrt-form-mic-button__root:hover {
120
142
  color: var(--smrt-color-on-surface-variant);
121
143
  }
122
-
123
- .form-mic-icon.listening {
144
+ .smrt-form-mic-button__root.smrt-form-mic-button__listening {
124
145
  color: var(--smrt-color-primary);
125
146
  animation: pulse 1.5s ease-in-out infinite;
126
147
  }
127
-
128
- .form-mic-icon.extracting {
148
+ .smrt-form-mic-button__root.smrt-form-mic-button__extracting {
129
149
  color: var(--smrt-color-primary);
130
150
  }
131
-
132
- .tooltip {
133
- position: absolute;
134
- top: 100%;
135
- left: 50%;
136
- transform: translateX(-50%);
137
- margin-top: 0.5rem;
138
- padding: 0.5rem 0.75rem;
151
+ .smrt-form-mic-button__tooltip {
139
152
  background: var(--smrt-color-inverse-surface, var(--smrt-color-on-surface));
140
153
  color: var(--smrt-color-inverse-on-surface);
141
154
  font-size: var(--smrt-typography-label-medium-size, 0.75rem);
142
155
  font-weight: var(--smrt-typography-weight-normal, 400);
143
156
  border-radius: 0.375rem;
144
- white-space: nowrap;
145
- z-index: var(--smrt-z-index-tooltip, 1600);
146
157
  box-shadow: var(--smrt-elevation-2, 0 4px 6px -1px color-mix(in srgb, var(--smrt-color-shadow) 10%, transparent));
147
158
  }
148
-
149
- .tooltip::before {
150
- content: '';
151
- position: absolute;
152
- bottom: 100%;
153
- left: 50%;
154
- transform: translateX(-50%);
159
+ .smrt-form-mic-button__tooltip::before {
155
160
  border: 6px solid transparent;
156
161
  border-bottom-color: var(--smrt-color-inverse-surface, var(--smrt-color-on-surface));
157
162
  }
158
-
159
163
  @keyframes pulse {
160
- 0%, 100% { opacity: 1; }
161
- 50% { opacity: 0.6; }
164
+ 0%, 100% {
165
+ opacity: 1;
166
+ }
167
+ 50% {
168
+ opacity: 0.6;
169
+ }
162
170
  }
163
-
164
171
  @media (prefers-reduced-motion: reduce) {
165
- .form-mic-icon.listening {
172
+ .smrt-form-mic-button__root.smrt-form-mic-button__listening {
166
173
  animation: none;
167
174
  }
168
175
  }
169
-
170
- .spinner {
176
+ .smrt-form-mic-button__spinner {
171
177
  animation: spin 1s linear infinite;
172
178
  }
173
-
174
179
  @keyframes spin {
175
- from { transform: rotate(0deg); }
176
- to { transform: rotate(360deg); }
180
+ from {
181
+ transform: rotate(0deg);
182
+ }
183
+ to {
184
+ transform: rotate(360deg);
185
+ }
177
186
  }
178
-
179
187
  @media (prefers-reduced-motion: reduce) {
180
- .spinner {
188
+ .smrt-form-mic-button__spinner {
181
189
  animation: none;
182
190
  }
183
191
  }
184
192
  }
193
+
185
194
  </style>
@@ -189,17 +189,21 @@ useWebMcpTool(
189
189
  );
190
190
  </script>
191
191
 
192
- <div class="smrt-form-scope" data-smrt-form-scope={formId} bind:this={scope} data-smrt-component="FormScope">
192
+ <div class="smrt-form-scope__root" data-smrt-form-scope={formId} bind:this={scope} data-smrt-component="FormScope">
193
193
  {@render children()}
194
194
  <StagedControlReview {registry} {formId} {formElement} summary={stagedReview} />
195
195
  </div>
196
196
 
197
197
  <style>
198
198
  @layer smrt.reset, smrt.structure, smrt.theme;
199
- @layer smrt.theme {
199
+ @layer smrt.structure {
200
200
  /* Layout-neutral: the wrapped content lays out exactly as before. */
201
- .smrt-form-scope {
201
+ .smrt-form-scope__root {
202
202
  display: contents;
203
203
  }
204
204
  }
205
+
206
+ @layer smrt.theme {
207
+ }
208
+
205
209
  </style>
@@ -441,12 +441,12 @@ function handleUnitChange(e: Event) {
441
441
  }
442
442
  </script>
443
443
 
444
- <div class="smrt-measurement" data-smrt-field-owner={fieldOwnerToken} data-smrt-component="MeasurementInput">
444
+ <div class="smrt-measurement-input__root" data-smrt-field-owner={fieldOwnerToken} data-smrt-component="MeasurementInput">
445
445
  {#if label}
446
446
  <FieldLabel for={name} {label} {required} />
447
447
  {/if}
448
448
 
449
- <div class="input-wrapper" class:smrt-mode={isSmrt}>
449
+ <div class="smrt-measurement-input__input-wrapper" class:smrt-measurement-input__mode={isSmrt} data-smrt-part="field">
450
450
  <input
451
451
  id={name}
452
452
  name={name}
@@ -458,8 +458,9 @@ function handleUnitChange(e: Event) {
458
458
  {step}
459
459
  {disabled}
460
460
  {required}
461
- class="smrt-input"
462
- class:invalid={showInvalid}
461
+ class="smrt-measurement-input__input"
462
+ data-smrt-part="input"
463
+ class:smrt-measurement-input__invalid={showInvalid}
463
464
  aria-invalid={showInvalid ? 'true' : undefined}
464
465
  aria-describedby={showInvalid ? `${name}-error` : undefined}
465
466
  oninput={handleInput}
@@ -469,8 +470,9 @@ function handleUnitChange(e: Event) {
469
470
  name="{name}_unit"
470
471
  value={unit}
471
472
  {disabled}
472
- class="unit-select"
473
- class:smrt-mode={isSmrt}
473
+ class="smrt-measurement-input__unit-select"
474
+ data-smrt-part="input"
475
+ class:smrt-measurement-input__mode={isSmrt}
474
476
  aria-label={label ? `${label} unit` : 'Unit'}
475
477
  onchange={handleUnitChange}
476
478
  >
@@ -484,9 +486,9 @@ function handleUnitChange(e: Event) {
484
486
  <input type="hidden" name="{name}_combined" value={value !== null ? `${value} ${unit}` : ''} />
485
487
 
486
488
  {#if error}
487
- <div id={`${name}-error`} class="validation-error" role="alert">{error}</div>
489
+ <div id={`${name}-error`} class="smrt-measurement-input__validation-error" data-smrt-part="error" role="alert">{error}</div>
488
490
  {:else if showInvalid && !isInRange}
489
- <div id={`${name}-error`} class="validation-error" role="alert">
491
+ <div id={`${name}-error`} class="smrt-measurement-input__validation-error" data-smrt-part="error" role="alert">
490
492
  {#if min !== undefined && value !== null && value < min}
491
493
  {t(M['ui.measurement_input.value_at_least'], { min, unit: unitAbbreviations[unit] })}
492
494
  {:else if max !== undefined && value !== null && value > max}
@@ -498,107 +500,111 @@ function handleUnitChange(e: Event) {
498
500
 
499
501
  <style>
500
502
  @layer smrt.reset, smrt.structure, smrt.theme;
501
- @layer smrt.theme {
502
- .smrt-measurement {
503
+ @layer smrt.structure {
504
+ .smrt-measurement-input__root {
503
505
  display: flex;
504
506
  flex-direction: column;
505
507
  gap: var(--smrt-spacing-1);
506
508
  }
507
-
508
- .input-wrapper {
509
+ .smrt-measurement-input__input-wrapper {
509
510
  display: flex;
510
511
  gap: var(--smrt-spacing-2);
511
512
  }
513
+ .smrt-measurement-input__input-wrapper.smrt-measurement-input__mode {
514
+ padding: var(--smrt-spacing-1);
515
+ }
516
+ .smrt-measurement-input__input {
517
+ flex: 1;
518
+ padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
519
+ min-width: 0;
520
+ }
521
+ .smrt-measurement-input__input:disabled {
522
+ cursor: not-allowed;
523
+ }
524
+ /* Hide spinner buttons */
525
+ .smrt-measurement-input__input::-webkit-outer-spin-button,
526
+ .smrt-measurement-input__input::-webkit-inner-spin-button {
527
+ margin: 0;
528
+ }
529
+ .smrt-measurement-input__unit-select {
530
+ padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
531
+ cursor: pointer;
532
+ min-width: 100px;
533
+ }
534
+ .smrt-measurement-input__unit-select:disabled {
535
+ cursor: not-allowed;
536
+ }
537
+ .smrt-measurement-input__validation-error {
538
+ margin-top: var(--smrt-spacing-1);
539
+ }
540
+ }
512
541
 
513
- .input-wrapper.smrt-mode {
542
+ @layer smrt.theme {
543
+ .smrt-measurement-input__input-wrapper.smrt-measurement-input__mode {
514
544
  border: 1px solid var(--smrt-color-tertiary);
515
545
  border-radius: var(--smrt-radius-small);
516
- padding: var(--smrt-spacing-1);
517
546
  background: var(--smrt-color-tertiary-container);
518
547
  }
519
-
520
- .smrt-input {
521
- flex: 1;
522
- padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
548
+ .smrt-measurement-input__input {
523
549
  font-size: var(--smrt-typography-body-large-size, 1rem);
524
550
  border: var(--smrt-hairline);
525
551
  border-radius: var(--smrt-radius-small);
526
552
  background: var(--smrt-color-surface);
527
553
  transition: all var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
528
- min-width: 0;
529
554
  }
530
-
531
- .input-wrapper.smrt-mode .smrt-input {
555
+ .smrt-measurement-input__input-wrapper.smrt-measurement-input__mode .smrt-measurement-input__input {
532
556
  border: none;
533
557
  background: transparent;
534
558
  }
535
-
536
- .smrt-input:focus {
559
+ .smrt-measurement-input__input:focus {
537
560
  outline: none;
538
561
  border-color: var(--smrt-color-primary);
539
562
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-primary) 10%, transparent);
540
563
  }
541
-
542
- .input-wrapper.smrt-mode .smrt-input:focus {
564
+ .smrt-measurement-input__input-wrapper.smrt-measurement-input__mode .smrt-measurement-input__input:focus {
543
565
  box-shadow: none;
544
566
  }
545
-
546
- .smrt-input:disabled {
567
+ .smrt-measurement-input__input:disabled {
547
568
  background: var(--smrt-color-surface-container-high);
548
- cursor: not-allowed;
549
569
  }
550
-
551
- .smrt-input.invalid {
570
+ .smrt-measurement-input__input.smrt-measurement-input__invalid {
552
571
  border-color: var(--smrt-color-error);
553
572
  }
554
-
555
573
  /* Hide spinner buttons */
556
- .smrt-input::-webkit-outer-spin-button,
557
- .smrt-input::-webkit-inner-spin-button {
574
+ .smrt-measurement-input__input::-webkit-outer-spin-button,
575
+ .smrt-measurement-input__input::-webkit-inner-spin-button {
558
576
  -webkit-appearance: none;
559
- margin: 0;
560
577
  }
561
-
562
- .smrt-input[type=number] {
578
+ .smrt-measurement-input__input[type=number] {
563
579
  appearance: textfield;
564
580
  -moz-appearance: textfield;
565
581
  }
566
-
567
- .unit-select {
568
- padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
582
+ .smrt-measurement-input__unit-select {
569
583
  font-size: var(--smrt-typography-body-medium-size, 0.875rem);
570
584
  border: var(--smrt-hairline);
571
585
  border-radius: var(--smrt-radius-small);
572
586
  background: var(--smrt-color-surface);
573
- cursor: pointer;
574
- min-width: 100px;
575
587
  transition: all var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
576
588
  }
577
-
578
- .unit-select.smrt-mode {
589
+ .smrt-measurement-input__unit-select.smrt-measurement-input__mode {
579
590
  border: none;
580
591
  background: transparent;
581
592
  }
582
-
583
- .unit-select:focus {
593
+ .smrt-measurement-input__unit-select:focus {
584
594
  outline: none;
585
595
  border-color: var(--smrt-color-primary);
586
596
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-primary) 10%, transparent);
587
597
  }
588
-
589
- .unit-select.smrt-mode:focus {
598
+ .smrt-measurement-input__unit-select.smrt-measurement-input__mode:focus {
590
599
  box-shadow: none;
591
600
  }
592
-
593
- .unit-select:disabled {
601
+ .smrt-measurement-input__unit-select:disabled {
594
602
  background: var(--smrt-color-surface-container);
595
- cursor: not-allowed;
596
603
  }
597
-
598
- .validation-error {
604
+ .smrt-measurement-input__validation-error {
599
605
  font-size: var(--smrt-typography-body-small-size, 0.75rem);
600
606
  color: var(--smrt-color-error);
601
- margin-top: var(--smrt-spacing-1);
602
607
  }
603
608
  }
609
+
604
610
  </style>
@@ -308,12 +308,12 @@ function handleBlur() {
308
308
  }
309
309
  </script>
310
310
 
311
- <div class="smrt-money" data-smrt-component="MoneyInput">
311
+ <div class="smrt-money-input__root" data-smrt-component="MoneyInput">
312
312
  {#if label}
313
313
  <FieldLabel id={labelId} for={name} {label} {required} />
314
314
  {/if}
315
315
 
316
- <div class="input-wrapper">
316
+ <div class="smrt-money-input__input-wrapper" data-smrt-part="field">
317
317
  <input
318
318
  id={name}
319
319
  aria-labelledby={label ? labelId : undefined}
@@ -324,25 +324,26 @@ function handleBlur() {
324
324
  value={displayValue}
325
325
  {disabled}
326
326
  {required}
327
- class="smrt-input"
328
- class:smrt-mode={isSmrt}
329
- class:invalid={showInvalid}
327
+ class="smrt-money-input__input"
328
+ data-smrt-part="input"
329
+ class:smrt-money-input__mode={isSmrt}
330
+ class:smrt-money-input__invalid={showInvalid}
330
331
  aria-invalid={showInvalid ? 'true' : undefined}
331
332
  aria-describedby={showInvalid ? `${name}-error` : undefined}
332
333
  oninput={handleInput}
333
334
  onfocus={handleFocus}
334
335
  onblur={handleBlur}
335
336
  />
336
- <span class="currency-code">{currency}</span>
337
+ <span class="smrt-money-input__currency-code" data-smrt-part="unit">{currency}</span>
337
338
  </div>
338
339
 
339
340
  <!-- Hidden input for form submission with cents value -->
340
341
  <input type="hidden" name="{name}_cents" value={value ?? ''} />
341
342
 
342
343
  {#if error}
343
- <div id={`${name}-error`} class="validation-error" role="alert">{error}</div>
344
+ <div id={`${name}-error`} class="smrt-money-input__validation-error" data-smrt-part="error" role="alert">{error}</div>
344
345
  {:else if showInvalid && !isInRange}
345
- <div id={`${name}-error`} class="validation-error" role="alert">
346
+ <div id={`${name}-error`} class="smrt-money-input__validation-error" data-smrt-part="error" role="alert">
346
347
  {#if min !== undefined && value !== null && value < min}
347
348
  {t(M['ui.money_input.value_at_least'], { min: `${currencySymbol}${(min / 100).toFixed(2)}` })}
348
349
  {:else if max !== undefined && value !== null && value > max}
@@ -354,31 +355,41 @@ function handleBlur() {
354
355
 
355
356
  <style>
356
357
  @layer smrt.reset, smrt.structure, smrt.theme;
357
- @layer smrt.theme {
358
- .smrt-money {
358
+ @layer smrt.structure {
359
+ .smrt-money-input__root {
359
360
  display: flex;
360
361
  flex-direction: column;
361
362
  gap: var(--smrt-spacing-1);
362
363
  }
363
-
364
- .input-wrapper {
364
+ .smrt-money-input__input-wrapper {
365
365
  display: flex;
366
366
  position: relative;
367
367
  align-items: center;
368
368
  }
369
-
370
- .currency-code {
369
+ .smrt-money-input__currency-code {
371
370
  position: absolute;
372
371
  right: 12px;
373
- color: var(--smrt-color-on-surface-variant);
374
- font-size: var(--smrt-typography-label-medium-size, 0.75rem);
375
- text-transform: uppercase;
376
372
  pointer-events: none;
377
373
  }
378
-
379
- .smrt-input {
374
+ .smrt-money-input__input {
380
375
  flex: 1;
381
376
  padding: var(--smrt-spacing-2) var(--smrt-spacing-12) var(--smrt-spacing-2) var(--smrt-spacing-3);
377
+ }
378
+ .smrt-money-input__input:disabled {
379
+ cursor: not-allowed;
380
+ }
381
+ .smrt-money-input__validation-error {
382
+ margin-top: var(--smrt-spacing-1);
383
+ }
384
+ }
385
+
386
+ @layer smrt.theme {
387
+ .smrt-money-input__currency-code {
388
+ color: var(--smrt-color-on-surface-variant);
389
+ font-size: var(--smrt-typography-label-medium-size, 0.75rem);
390
+ text-transform: uppercase;
391
+ }
392
+ .smrt-money-input__input {
382
393
  font-size: var(--smrt-typography-body-large-size, 1rem);
383
394
  border: var(--smrt-hairline);
384
395
  border-radius: var(--smrt-radius-small);
@@ -386,35 +397,28 @@ function handleBlur() {
386
397
  transition: all var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
387
398
  text-align: right;
388
399
  }
389
-
390
- .smrt-input:focus {
400
+ .smrt-money-input__input:focus {
391
401
  outline: none;
392
402
  border-color: var(--smrt-color-primary);
393
403
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-primary) 10%, transparent);
394
404
  }
395
-
396
- .smrt-input:disabled {
405
+ .smrt-money-input__input:disabled {
397
406
  background: var(--smrt-color-surface-container-high);
398
- cursor: not-allowed;
399
407
  }
400
-
401
- .smrt-input.smrt-mode {
408
+ .smrt-money-input__input.smrt-money-input__mode {
402
409
  border-color: var(--smrt-color-tertiary);
403
410
  }
404
-
405
- .smrt-input.invalid {
411
+ .smrt-money-input__input.smrt-money-input__invalid {
406
412
  border-color: var(--smrt-color-error);
407
413
  }
408
-
409
- .smrt-input.invalid:focus {
414
+ .smrt-money-input__input.smrt-money-input__invalid:focus {
410
415
  border-color: var(--smrt-color-error);
411
416
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-error) 10%, transparent);
412
417
  }
413
-
414
- .validation-error {
418
+ .smrt-money-input__validation-error {
415
419
  font-size: var(--smrt-typography-body-small-size, 0.75rem);
416
420
  color: var(--smrt-color-error);
417
- margin-top: var(--smrt-spacing-1);
418
421
  }
419
422
  }
423
+
420
424
  </style>
@@ -233,12 +233,12 @@ function handleInput(e: Event) {
233
233
  }
234
234
  </script>
235
235
 
236
- <div class="smrt-number" data-smrt-component="NumberInput">
236
+ <div class="smrt-number-input__root" data-smrt-component="NumberInput">
237
237
  {#if label}
238
238
  <FieldLabel id={labelId} for={name} {label} {required} />
239
239
  {/if}
240
240
 
241
- <div class="input-wrapper">
241
+ <div class="smrt-number-input__input-wrapper" data-smrt-part="field">
242
242
  <input
243
243
  id={name}
244
244
  aria-labelledby={label ? labelId : undefined}
@@ -251,9 +251,10 @@ function handleInput(e: Event) {
251
251
  {step}
252
252
  {disabled}
253
253
  {required}
254
- class="smrt-input"
255
- class:smrt-mode={isSmrt}
256
- class:invalid={showInvalid}
254
+ class="smrt-number-input__input"
255
+ data-smrt-part="input"
256
+ class:smrt-number-input__mode={isSmrt}
257
+ class:smrt-number-input__invalid={showInvalid}
257
258
  aria-invalid={showInvalid ? 'true' : undefined}
258
259
  aria-describedby={showInvalid ? `${name}-error` : undefined}
259
260
  oninput={handleInput}
@@ -261,7 +262,7 @@ function handleInput(e: Event) {
261
262
  </div>
262
263
 
263
264
  {#if showInvalid}
264
- <div id={`${name}-error`} class="validation-error" role="alert">
265
+ <div id={`${name}-error`} class="smrt-number-input__validation-error" data-smrt-part="error" role="alert">
265
266
  {#if min !== undefined && value !== null && value < min}
266
267
  {t(M['ui.number_input.value_at_least'], { min })}
267
268
  {:else if max !== undefined && value !== null && value > max}
@@ -273,73 +274,77 @@ function handleInput(e: Event) {
273
274
 
274
275
  <style>
275
276
  @layer smrt.reset, smrt.structure, smrt.theme;
276
- @layer smrt.theme {
277
- .smrt-number {
277
+ @layer smrt.structure {
278
+ .smrt-number-input__root {
278
279
  display: flex;
279
280
  flex-direction: column;
280
281
  width: 100%;
281
282
  min-width: 0;
282
283
  gap: var(--smrt-spacing-1);
283
284
  }
284
-
285
- .input-wrapper {
285
+ .smrt-number-input__input-wrapper {
286
286
  display: flex;
287
287
  position: relative;
288
288
  }
289
-
290
- .smrt-input {
289
+ .smrt-number-input__input {
291
290
  flex: 1;
292
291
  box-sizing: border-box;
293
292
  min-width: 0;
294
293
  width: 100%;
295
294
  padding: var(--smrt-spacing-2) var(--smrt-spacing-3);
295
+ }
296
+ .smrt-number-input__input:disabled {
297
+ cursor: not-allowed;
298
+ }
299
+ /* Hide spinner buttons */
300
+ .smrt-number-input__input::-webkit-outer-spin-button,
301
+ .smrt-number-input__input::-webkit-inner-spin-button {
302
+ margin: 0;
303
+ }
304
+ .smrt-number-input__validation-error {
305
+ margin-top: var(--smrt-spacing-1);
306
+ }
307
+ }
308
+
309
+ @layer smrt.theme {
310
+ .smrt-number-input__input {
296
311
  font-size: var(--smrt-typography-body-large-size, 1rem);
297
312
  border: var(--smrt-hairline);
298
313
  border-radius: var(--smrt-radius-small);
299
314
  background: var(--smrt-color-surface);
300
315
  transition: all var(--smrt-duration-short2, 150ms) var(--smrt-easing-standard, ease);
301
316
  }
302
-
303
- .smrt-input:focus {
317
+ .smrt-number-input__input:focus {
304
318
  outline: none;
305
319
  border-color: var(--smrt-color-primary);
306
320
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-primary) 10%, transparent);
307
321
  }
308
-
309
- .smrt-input:disabled {
322
+ .smrt-number-input__input:disabled {
310
323
  background: var(--smrt-color-surface-container-high);
311
- cursor: not-allowed;
312
324
  }
313
-
314
- .smrt-input.smrt-mode {
325
+ .smrt-number-input__input.smrt-number-input__mode {
315
326
  border-color: var(--smrt-color-tertiary);
316
327
  }
317
-
318
- .smrt-input.invalid {
328
+ .smrt-number-input__input.smrt-number-input__invalid {
319
329
  border-color: var(--smrt-color-error);
320
330
  }
321
-
322
- .smrt-input.invalid:focus {
331
+ .smrt-number-input__input.smrt-number-input__invalid:focus {
323
332
  border-color: var(--smrt-color-error);
324
333
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--smrt-color-error) 10%, transparent);
325
334
  }
326
-
327
335
  /* Hide spinner buttons */
328
- .smrt-input::-webkit-outer-spin-button,
329
- .smrt-input::-webkit-inner-spin-button {
336
+ .smrt-number-input__input::-webkit-outer-spin-button,
337
+ .smrt-number-input__input::-webkit-inner-spin-button {
330
338
  -webkit-appearance: none;
331
- margin: 0;
332
339
  }
333
-
334
- .smrt-input[type=number] {
340
+ .smrt-number-input__input[type=number] {
335
341
  appearance: textfield;
336
342
  -moz-appearance: textfield;
337
343
  }
338
-
339
- .validation-error {
344
+ .smrt-number-input__validation-error {
340
345
  font-size: var(--smrt-typography-body-small-size, 0.75rem);
341
346
  color: var(--smrt-color-error);
342
- margin-top: var(--smrt-spacing-1);
343
347
  }
344
348
  }
349
+
345
350
  </style>