@scalewing/react 1.35.1 → 1.37.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +7 -3
  3. package/dist/components/ActionMenu.js +2 -1
  4. package/dist/components/Box.js +5 -2
  5. package/dist/components/Button.js +3 -2
  6. package/dist/components/DateField.js +2 -1
  7. package/dist/components/DenominationGrid.d.ts +1 -1
  8. package/dist/components/DenominationGrid.js +2 -0
  9. package/dist/components/FilterChips.js +3 -1
  10. package/dist/components/MultiSelect.js +2 -1
  11. package/dist/components/RadioGroup.js +3 -1
  12. package/dist/components/SectionNav.js +2 -1
  13. package/dist/components/SegmentedControl.js +5 -1
  14. package/dist/components/Select.js +2 -1
  15. package/dist/components/Stepper.d.ts +5 -0
  16. package/dist/components/Stepper.js +4 -2
  17. package/dist/components/Steps.d.ts +11 -2
  18. package/dist/components/Steps.js +5 -3
  19. package/dist/components/Switch.js +2 -1
  20. package/dist/components/checkbox/CheckboxControl.d.ts +1 -1
  21. package/dist/components/checkbox/CheckboxControl.js +3 -2
  22. package/dist/components/date-field/CalendarHeader.js +2 -1
  23. package/dist/components/denomination-grid/DenominationStrip.js +3 -1
  24. package/dist/components/denomination-grid/EntryCell.d.ts +3 -1
  25. package/dist/components/denomination-grid/EntryCell.js +2 -2
  26. package/dist/components/denomination-grid/StripRow.d.ts +8 -2
  27. package/dist/components/denomination-grid/StripRow.js +14 -5
  28. package/dist/components/denomination-grid/StripTotal.d.ts +11 -0
  29. package/dist/components/denomination-grid/StripTotal.js +12 -0
  30. package/dist/components/denomination-grid/StripValueRow.d.ts +25 -0
  31. package/dist/components/denomination-grid/StripValueRow.js +27 -0
  32. package/dist/components/denomination-grid/types.d.ts +19 -0
  33. package/dist/components/denomination-grid/validate-value-row.d.ts +6 -0
  34. package/dist/components/denomination-grid/validate-value-row.js +30 -0
  35. package/dist/components/field/SearchFrame.js +2 -1
  36. package/dist/components/radio-group/RadioGroupOptionLabel.d.ts +3 -1
  37. package/dist/components/radio-group/RadioGroupOptionLabel.js +3 -2
  38. package/dist/components/steps/Step.d.ts +4 -2
  39. package/dist/components/steps/Step.js +15 -7
  40. package/dist/components/steps/steps-context.d.ts +5 -3
  41. package/dist/components/table/TableCell.js +2 -1
  42. package/dist/css/css-button.js +17 -5
  43. package/dist/css/css-denomination-grid.js +4 -0
  44. package/dist/css/css-denomination-value-row.d.ts +3 -0
  45. package/dist/css/css-denomination-value-row.js +54 -0
  46. package/dist/css/css-steps.d.ts +3 -1
  47. package/dist/css/css-steps.js +18 -3
  48. package/dist/index.d.ts +1 -1
  49. package/dist/styles.css +58 -5
  50. package/dist/tab-stop.d.ts +22 -0
  51. package/dist/tab-stop.js +23 -0
  52. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -914,18 +914,21 @@ body {
914
914
  outline-offset: var(--sw-focus-ring-offset);
915
915
  }
916
916
 
917
- .sw-button:disabled {
917
+ /* A button that is off but still pressed and focused (`aria-disabled`,
918
+ for a submit that, pressed while off, shows what to fix) looks as a
919
+ disabled one; forced colors grey it too, after the pressed rules. */
920
+ .sw-button:disabled,
921
+ .sw-button[aria-disabled='true'] {
918
922
  cursor: not-allowed;
919
923
  opacity: var(--sw-disabled-opacity);
920
924
  }
921
-
922
925
  .sw-button-primary { background: var(--sw-color-accent); border-color: transparent; color: var(--sw-color-onAccent); }
923
926
  .sw-button-secondary { background: var(--sw-color-secondary); border-color: var(--sw-button-secondary-border); color: var(--sw-color-onSecondary); }
924
927
  .sw-button-tertiary { background: var(--sw-color-tertiary); border-color: transparent; color: var(--sw-color-onTertiary); }
925
928
  .sw-button-ghost { background: transparent; border-color: transparent; color: var(--sw-color-accent); }
926
929
  .sw-button-danger { background: var(--sw-color-danger); border-color: transparent; color: var(--sw-color-onDanger); }
927
930
  .sw-button-neutral { background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent); border-color: transparent; color: var(--sw-color-text); }
928
- .sw-button-disabled-neutral:disabled:not(.sw-button-ghost) {
931
+ .sw-button-disabled-neutral:is(:disabled, [aria-disabled='true']):not(.sw-button-ghost) {
929
932
  background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
930
933
  border-color: transparent;
931
934
  color: color-mix(in srgb, var(--sw-color-muted) 48%, transparent);
@@ -937,6 +940,10 @@ body {
937
940
  .sw-button[aria-pressed='true'] { border-color: Highlight; position: relative; }
938
941
  .sw-button[aria-pressed='true']::after { border: 2px solid Highlight; border-radius: inherit; content: ''; inset: calc(-1px - 4px); pointer-events: none; position: absolute; }
939
942
  }
943
+ @media (forced-colors: active) {
944
+ .sw-button[aria-disabled='true'],
945
+ .sw-button-disabled-neutral[aria-disabled='true']:not(.sw-button-ghost) { border-color: GrayText; color: GrayText; }
946
+ }
940
947
  .sw-button-xs { min-height: 28px; padding-inline: 10px; }
941
948
  .sw-button-sm { min-height: 32px; padding-inline: 12px; }
942
949
  .sw-button-md { min-height: 44px; padding-inline: 16px; }
@@ -4900,6 +4907,41 @@ body {
4900
4907
  color: var(--sw-color-text);
4901
4908
  }
4902
4909
 
4910
+ .sw-denomination-strip .sw-denomination-value-row,
4911
+ .sw-denomination-strip .sw-denomination-value-row .sw-denomination-label {
4912
+ background: var(--sw-color-subtle);
4913
+ }
4914
+
4915
+ .sw-denomination-strip .sw-denomination-value-row :is(th, td) {
4916
+ padding-block: var(--sw-space-2);
4917
+ }
4918
+
4919
+ .sw-denomination-strip .sw-denomination-value-row .sw-denomination-value {
4920
+ color: var(--sw-color-text);
4921
+ font-size: 15px;
4922
+ font-variant-numeric: tabular-nums;
4923
+ font-weight: 500;
4924
+ letter-spacing: -0.2px;
4925
+ line-height: 20px;
4926
+ text-align: center;
4927
+ white-space: nowrap;
4928
+ }
4929
+
4930
+ .sw-denomination-strip .sw-denomination-value-row.sw-denomination-row-disabled .sw-denomination-value {
4931
+ opacity: var(--sw-disabled-opacity);
4932
+ }
4933
+
4934
+ @media not all and (min-width: 48rem) {
4935
+ .sw-denomination-strip .sw-denomination-value-row :is(th, td) { padding-block: var(--sw-space-1); }
4936
+ .sw-denomination-strip .sw-denomination-value-row .sw-denomination-total { padding: 0; }
4937
+ }
4938
+
4939
+ @media (forced-colors: active) {
4940
+ .sw-denomination-strip .sw-denomination-value-row,
4941
+ .sw-denomination-strip .sw-denomination-value-row .sw-denomination-label { background: Canvas; }
4942
+ .sw-denomination-strip .sw-denomination-value-row .sw-denomination-value { color: CanvasText; }
4943
+ }
4944
+
4903
4945
  @media (forced-colors: active) {
4904
4946
  .sw-denomination-label { border-inline-start-color: CanvasText; color: CanvasText; }
4905
4947
  .sw-denomination-strip .sw-denomination-label::before { background: CanvasText; forced-color-adjust: none; }
@@ -5259,10 +5301,20 @@ body {
5259
5301
  }
5260
5302
 
5261
5303
  .sw-steps-item-current,
5262
- .sw-steps-item-error {
5304
+ .sw-steps-item-error,
5305
+ .sw-steps-open > .sw-steps-item {
5263
5306
  --sw-steps-padding: var(--sw-space-4);
5264
5307
  }
5265
5308
 
5309
+ /* An open list's step is a region holding its header and body, spaced as
5310
+ the item spaces them in a stepped list. */
5311
+ .sw-steps-region {
5312
+ display: flex;
5313
+ flex-direction: column;
5314
+ gap: var(--sw-space-4);
5315
+ min-width: 0;
5316
+ }
5317
+
5266
5318
  /* The marker sits at the top of the header, so the connector always starts
5267
5319
  under it; each line of the header is centred on the marker's height. */
5268
5320
  .sw-steps-header {
@@ -5301,7 +5353,8 @@ body {
5301
5353
  }
5302
5354
 
5303
5355
  .sw-steps-item-current .sw-steps-title,
5304
- .sw-steps-item-error .sw-steps-title {
5356
+ .sw-steps-item-error .sw-steps-title,
5357
+ .sw-steps-open > .sw-steps-item .sw-steps-title {
5305
5358
  font-size: 20px;
5306
5359
  letter-spacing: -0.3px;
5307
5360
  line-height: 28px;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The `tabIndex` every Scalewing press control and link renders by default.
3
+ *
4
+ * Safari leaves a `<button>`, a link, a checkbox and a radio out of the Tab
5
+ * order unless the element carries an explicit `tabindex` (its "Press Tab to
6
+ * highlight each item" setting is off by default), so a keyboard user there
7
+ * Tabs past them to the address bar. An explicit `0` puts them in the same
8
+ * order every other browser already gives them. A control that is
9
+ * deliberately not a tab stop (a Stepper's − and +, a roving item) keeps its
10
+ * own `-1`, and a consumer's `tabIndex` always wins.
11
+ */
12
+ export declare const tabStop = 0;
13
+ /**
14
+ * Which radio of a group carries the explicit tab stop: the checked one, or
15
+ * the first enabled one while none is. Browsers move between a group's
16
+ * radios with the arrow keys and Tab only into the group, so the others keep
17
+ * no `tabindex` and each browser's own group rule stands.
18
+ */
19
+ export declare function radioTabStopValue(options: readonly {
20
+ value: string;
21
+ disabled?: boolean;
22
+ }[], value: string | undefined): string | undefined;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The `tabIndex` every Scalewing press control and link renders by default.
3
+ *
4
+ * Safari leaves a `<button>`, a link, a checkbox and a radio out of the Tab
5
+ * order unless the element carries an explicit `tabindex` (its "Press Tab to
6
+ * highlight each item" setting is off by default), so a keyboard user there
7
+ * Tabs past them to the address bar. An explicit `0` puts them in the same
8
+ * order every other browser already gives them. A control that is
9
+ * deliberately not a tab stop (a Stepper's − and +, a roving item) keeps its
10
+ * own `-1`, and a consumer's `tabIndex` always wins.
11
+ */
12
+ export const tabStop = 0;
13
+ /**
14
+ * Which radio of a group carries the explicit tab stop: the checked one, or
15
+ * the first enabled one while none is. Browsers move between a group's
16
+ * radios with the arrow keys and Tab only into the group, so the others keep
17
+ * no `tabindex` and each browser's own group rule stands.
18
+ */
19
+ export function radioTabStopValue(options, value) {
20
+ const enabled = options.filter((option) => !option.disabled);
21
+ return (enabled.find((option) => option.value === value) ?? enabled[0])
22
+ ?.value;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalewing/react",
3
- "version": "1.35.1",
3
+ "version": "1.37.0",
4
4
  "description": "Scalewing DOM components and package-owned CSS utilities.",
5
5
  "type": "module",
6
6
  "license": "MIT",