@juspay/svelte-ui-components 2.91.1 → 2.93.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.
@@ -37,6 +37,7 @@
37
37
  onKeyDown = () => {},
38
38
  classes,
39
39
  role,
40
+ ariaLabel,
40
41
  ariaExpanded,
41
42
  ariaAutocomplete,
42
43
  ariaControls,
@@ -256,6 +257,7 @@
256
257
  <textarea
257
258
  {value}
258
259
  {placeholder}
260
+ aria-label={ariaLabel}
259
261
  autocomplete={autoComplete}
260
262
  inputmode={inputMode}
261
263
  {name}
@@ -287,6 +289,7 @@
287
289
  type={dataType}
288
290
  {value}
289
291
  {placeholder}
292
+ aria-label={ariaLabel}
290
293
  autocomplete={autoComplete}
291
294
  inputmode={inputMode}
292
295
  {name}
@@ -52,6 +52,8 @@ export type OptionalInputProperties = {
52
52
  testId?: string;
53
53
  classes?: string;
54
54
  role?: string;
55
+ /** Accessible name applied to the native input/textarea (aria-label). */
56
+ ariaLabel?: string | null;
55
57
  ariaExpanded?: boolean;
56
58
  ariaAutocomplete?: 'none' | 'inline' | 'list' | 'both';
57
59
  ariaControls?: string | null;
@@ -274,6 +274,9 @@
274
274
  {:else if column.type === 'input'}
275
275
  {@const inputData = asInputCellData(value)}
276
276
  {#if inputData}
277
+ {#snippet inputLeadingIcon()}
278
+ <img class="builtin-input-icon" src={inputData.iconUrl} alt="" />
279
+ {/snippet}
277
280
  <!-- svelte-ignore a11y_no_static_element_interactions -->
278
281
  <span
279
282
  class="builtin-interactive"
@@ -283,6 +286,7 @@
283
286
  <Input
284
287
  value={inputData.value ?? ''}
285
288
  placeholder={inputData.placeholder ?? ''}
289
+ ariaLabel={inputData.ariaLabel ?? null}
286
290
  disable={inputData.disabled ?? false}
287
291
  testId={inputData.testId ?? ''}
288
292
  dataType={asInputDataType(inputData.dataType ?? null)}
@@ -292,6 +296,7 @@
292
296
  onErrorMessage={inputData.onErrorMessage ?? null}
293
297
  actionInput={false}
294
298
  onInput={(newValue) => column.onInput?.(rowIndex, newValue, originalIndex)}
299
+ {...inputData.iconUrl ? { leftIcon: inputLeadingIcon } : {}}
295
300
  />
296
301
  </span>
297
302
  {:else}
@@ -589,6 +594,12 @@
589
594
  width: var(--table-interactive-width, auto);
590
595
  }
591
596
 
597
+ .builtin-input-icon {
598
+ display: block;
599
+ width: var(--table-cell-input-icon-size, 16px);
600
+ height: var(--table-cell-input-icon-size, 16px);
601
+ }
602
+
592
603
  .builtin-action-group {
593
604
  gap: var(--table-cell-inline-gap, 8px);
594
605
  }
@@ -669,6 +669,7 @@
669
669
  <th
670
670
  class="table-header"
671
671
  class:table-header-sticky={isStickyHeader}
672
+ class:table-col-highlighted={headerColumn?.highlighted === true}
672
673
  data-pw={headerColumn?.testId ?? null}
673
674
  style:text-align={headerColumn?.align ?? null}
674
675
  style:max-width={headerColumn?.maxWidth ?? null}
@@ -848,6 +849,7 @@
848
849
  typeof cellValue === 'boolean'}
849
850
  <td
850
851
  class="table-content"
852
+ class:table-col-highlighted={keyedColumn?.highlighted === true}
851
853
  data-pw={typeof getCellTestId === 'function'
852
854
  ? getCellTestId(row, cellValue, rowIndex)
853
855
  : null}
@@ -1180,6 +1182,20 @@
1180
1182
  color: var(--table-content-color, var(--table-content-font-color, #111827));
1181
1183
  }
1182
1184
 
1185
+ /* Column highlight (TableColumn.highlighted). Row hover keeps higher
1186
+ specificity and row selection is declared later at equal specificity, so
1187
+ both row states paint over the column wash. */
1188
+ .table-header.table-col-highlighted {
1189
+ background-color: var(
1190
+ --table-col-highlight-header-background,
1191
+ var(--table-col-highlight-background, #f3f9ff)
1192
+ );
1193
+ }
1194
+
1195
+ .table-content.table-col-highlighted {
1196
+ background-color: var(--table-col-highlight-background, #f3f9ff);
1197
+ }
1198
+
1183
1199
  .table-row {
1184
1200
  border-bottom: var(--table-row-border, 1px solid #f3f4f6);
1185
1201
  background-color: var(--table-row-background);
@@ -157,6 +157,12 @@ export const asInputCellData = (value) => {
157
157
  if (typeof record.testId === 'string') {
158
158
  inputData.testId = record.testId;
159
159
  }
160
+ if (typeof record.ariaLabel === 'string') {
161
+ inputData.ariaLabel = record.ariaLabel;
162
+ }
163
+ if (typeof record.iconUrl === 'string') {
164
+ inputData.iconUrl = record.iconUrl;
165
+ }
160
166
  if (typeof record.dataType === 'string') {
161
167
  inputData.dataType = record.dataType;
162
168
  }
@@ -107,6 +107,17 @@ export type TableInputCellData = {
107
107
  placeholder?: string;
108
108
  disabled?: boolean;
109
109
  testId?: string;
110
+ /**
111
+ * Accessible name forwarded to the rendered Input's native element
112
+ * (aria-label). Recommended whenever the cell has no visible label —
113
+ * required in practice for icon-bearing inputs.
114
+ */
115
+ ariaLabel?: string;
116
+ /**
117
+ * URL of a passive leading icon rendered inside the input field (e.g. a
118
+ * currency glyph). Sized via `--table-cell-input-icon-size` (default 16px).
119
+ */
120
+ iconUrl?: string;
110
121
  /** Input dataType forwarded to the rendered Input ('text' | 'tel' | 'number' | …). */
111
122
  dataType?: string;
112
123
  /**
@@ -202,6 +213,14 @@ export type TableColumn = {
202
213
  * ellipsizes with the full value available on the native title tooltip.
203
214
  */
204
215
  maxWidth?: string;
216
+ /**
217
+ * Paints this column's header and body cells with the highlight wash —
218
+ * `--table-col-highlight-background` (body) and
219
+ * `--table-col-highlight-header-background` (header; falls back to the body
220
+ * wash). Use to emphasize a selected/pivot column. Row hover and row
221
+ * selection still paint over the wash.
222
+ */
223
+ highlighted?: boolean;
205
224
  /** Opt-in header filter dropdown (see TableColumnFilterConfig). */
206
225
  filter?: TableColumnFilterConfig;
207
226
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "2.91.1",
3
+ "version": "2.93.0",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",