@scalewing/react 1.31.0 → 1.33.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 (92) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +20 -6
  3. package/dist/components/ActionMenu.d.ts +10 -1
  4. package/dist/components/ActionMenu.js +7 -2
  5. package/dist/components/AppHeader.d.ts +9 -1
  6. package/dist/components/AppHeader.js +6 -2
  7. package/dist/components/Box.d.ts +28 -2
  8. package/dist/components/Box.js +4 -2
  9. package/dist/components/Button.d.ts +27 -2
  10. package/dist/components/Button.js +5 -3
  11. package/dist/components/ButtonGroup.d.ts +9 -1
  12. package/dist/components/ButtonGroup.js +8 -2
  13. package/dist/components/Combobox.js +2 -2
  14. package/dist/components/DateField.d.ts +9 -1
  15. package/dist/components/DateField.js +4 -3
  16. package/dist/components/DenominationGrid.d.ts +5 -3
  17. package/dist/components/DenominationGrid.js +21 -11
  18. package/dist/components/Dialog.d.ts +9 -1
  19. package/dist/components/Dialog.js +8 -4
  20. package/dist/components/Field.d.ts +8 -0
  21. package/dist/components/Field.js +4 -3
  22. package/dist/components/FieldLabelText.d.ts +21 -3
  23. package/dist/components/FieldLabelText.js +16 -4
  24. package/dist/components/FilterChips.d.ts +9 -1
  25. package/dist/components/FilterChips.js +4 -2
  26. package/dist/components/Nav.d.ts +14 -2
  27. package/dist/components/Nav.js +6 -2
  28. package/dist/components/SegmentedControl.d.ts +5 -2
  29. package/dist/components/SegmentedControl.js +2 -1
  30. package/dist/components/Select.d.ts +9 -1
  31. package/dist/components/Select.js +4 -3
  32. package/dist/components/Stepper.d.ts +13 -0
  33. package/dist/components/Stepper.js +8 -2
  34. package/dist/components/combobox/types.d.ts +8 -0
  35. package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -2
  36. package/dist/components/denomination-grid/DenominationStrip.js +3 -2
  37. package/dist/components/denomination-grid/DenominationTiles.d.ts +1 -1
  38. package/dist/components/denomination-grid/EntryCell.js +1 -1
  39. package/dist/components/denomination-grid/StripRow.js +5 -2
  40. package/dist/components/denomination-grid/types.d.ts +35 -1
  41. package/dist/components/dialog/DialogTitle.d.ts +5 -3
  42. package/dist/components/dialog/DialogTitle.js +4 -4
  43. package/dist/css/css-action-menu-trigger.d.ts +11 -0
  44. package/dist/css/css-action-menu-trigger.js +66 -0
  45. package/dist/css/css-action-menu.js +7 -2
  46. package/dist/css/css-app-header-bar.d.ts +10 -0
  47. package/dist/css/css-app-header-bar.js +26 -0
  48. package/dist/css/css-box-border.d.ts +6 -1
  49. package/dist/css/css-box-border.js +8 -4
  50. package/dist/css/css-box-link.d.ts +13 -0
  51. package/dist/css/css-box-link.js +50 -0
  52. package/dist/css/css-button-group-attached.js +5 -2
  53. package/dist/css/css-button-group-track.d.ts +11 -0
  54. package/dist/css/css-button-group-track.js +48 -0
  55. package/dist/css/css-button.d.ts +19 -2
  56. package/dist/css/css-button.js +31 -1
  57. package/dist/css/css-chrome.js +14 -1
  58. package/dist/css/css-combobox.js +2 -1
  59. package/dist/css/css-components.js +3 -0
  60. package/dist/css/css-data.js +3 -2
  61. package/dist/css/css-date-field.js +2 -1
  62. package/dist/css/css-denomination-appearance.d.ts +21 -0
  63. package/dist/css/css-denomination-appearance.js +114 -0
  64. package/dist/css/css-denomination-cell-tones.d.ts +8 -0
  65. package/dist/css/css-denomination-cell-tones.js +20 -1
  66. package/dist/css/css-denomination-grid.js +4 -0
  67. package/dist/css/css-dialog-banded.d.ts +11 -0
  68. package/dist/css/css-dialog-banded.js +84 -0
  69. package/dist/css/css-document.js +3 -0
  70. package/dist/css/css-multi-select.js +2 -1
  71. package/dist/css/css-nav-words.d.ts +13 -0
  72. package/dist/css/css-nav-words.js +51 -0
  73. package/dist/css/css-notice.d.ts +4 -11
  74. package/dist/css/css-notice.js +6 -22
  75. package/dist/css/css-scroll-region.d.ts +7 -3
  76. package/dist/css/css-scroll-region.js +8 -3
  77. package/dist/css/css-segmented-raised.d.ts +3 -0
  78. package/dist/css/css-segmented-raised.js +72 -0
  79. package/dist/css/css-segmented.js +9 -3
  80. package/dist/css/css-select.js +2 -1
  81. package/dist/css/css-split.js +2 -1
  82. package/dist/css/css-stepper.js +7 -0
  83. package/dist/css/quiet-fill.d.ts +7 -0
  84. package/dist/css/quiet-fill.js +7 -0
  85. package/dist/css/stacking.js +2 -1
  86. package/dist/css/stylesheet.js +4 -0
  87. package/dist/css/tone-tint.d.ts +21 -0
  88. package/dist/css/tone-tint.js +23 -0
  89. package/dist/index.d.ts +13 -10
  90. package/dist/index.js +10 -7
  91. package/dist/styles.css +313 -10
  92. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
2
  import { chevronStroke } from './chevron.js';
3
3
  import { zIndex } from './stacking.js';
4
+ import { quietFill } from './quiet-fill.js';
4
5
  const caption = typographyVariants.caption;
5
6
  const label = typographyVariants.label;
6
7
  export function cssSelectClasses() {
@@ -172,7 +173,7 @@ export function cssSelectClasses() {
172
173
  }
173
174
 
174
175
  .sw-select-option[data-active='true'] {
175
- background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
176
+ background: ${quietFill};
176
177
  }
177
178
 
178
179
  .sw-select-xs .sw-select-option {
@@ -1,3 +1,4 @@
1
+ import { quietFill } from './quiet-fill.js';
1
2
  export function cssSplitClasses() {
2
3
  return `.sw-split {
3
4
  align-items: stretch;
@@ -39,7 +40,7 @@ export function cssSplitClasses() {
39
40
 
40
41
  .sw-split-handle:hover,
41
42
  .sw-split-handle:focus-visible {
42
- background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
43
+ background: ${quietFill};
43
44
  }
44
45
 
45
46
  .sw-split-handle:focus-visible {
@@ -25,6 +25,12 @@ function stateRules() {
25
25
  background-image: ${changedTintLayer};
26
26
  }
27
27
 
28
+ /* A plain limit: − at min and + at max keep their look, still disabled. */
29
+ .sw-stepper-limit-plain .sw-stepper-button:disabled {
30
+ cursor: default;
31
+ opacity: 1;
32
+ }
33
+
28
34
  /* Read-only: the buttons keep their room, so the count lines up with an editable one. */
29
35
  .sw-stepper-readonly .sw-stepper-button { visibility: hidden; }
30
36
 
@@ -122,5 +128,6 @@ export function stepperClassCatalog() {
122
128
  'sw-stepper-invalid',
123
129
  'sw-stepper-changed',
124
130
  'sw-stepper-readonly',
131
+ 'sw-stepper-limit-plain',
125
132
  ];
126
133
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The quiet grey fill: the muted color at 16 % over whatever is beneath
3
+ * (about #E8E8E9 on white). An open menu or list row, a held separator,
4
+ * today's calendar ring fill, a neutral button and a banded dialog's close
5
+ * button all take it, so they read as one grey.
6
+ */
7
+ export declare const quietFill = "color-mix(in srgb, var(--sw-color-muted) 16%, transparent)";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The quiet grey fill: the muted color at 16 % over whatever is beneath
3
+ * (about #E8E8E9 on white). An open menu or list row, a held separator,
4
+ * today's calendar ring fill, a neutral button and a banded dialog's close
5
+ * button all take it, so they read as one grey.
6
+ */
7
+ export const quietFill = 'color-mix(in srgb, var(--sw-color-muted) 16%, transparent)';
@@ -13,7 +13,8 @@
13
13
  * its popup can only paint as high as the surface does; lifting the surface
14
14
  * over the ActionBar keeps an open list tappable where the bar would cover
15
15
  * it, and over the next surface in the flow.
16
- * 5. `topChrome`: the sticky AppHeader or sticky Tabs strip, over a lifted
16
+ * 5. `topChrome`: the sticky AppHeader or sticky Tabs strip (and a banded
17
+ * Dialog's title band, inside its dialog), over a lifted
17
18
  * surface that scrolls up under it (the header is the page's way back, the
18
19
  * strip its way between sections, and a popup opens downward).
19
20
  * 6. `popup`: a popup outside any lifted surface (Select list, ActionMenu
@@ -27,6 +27,7 @@ import { fieldClassCatalog } from './css-field.js';
27
27
  import { stepperClassCatalog } from './css-stepper.js';
28
28
  import { stepsClassCatalog } from './css-steps.js';
29
29
  import { boxBorderClassCatalog } from './css-box-border.js';
30
+ import { boxLinkClassCatalog } from './css-box-link.js';
30
31
  import { cssComponentClasses } from './css-components.js';
31
32
  import { buttonClassCatalog } from './css-button.js';
32
33
  import { chartClassCatalog } from './css-chart.js';
@@ -36,6 +37,7 @@ import { tableClassCatalog } from './css-table.js';
36
37
  import { chromeClassCatalog } from './css-chrome.js';
37
38
  import { sectionNavClassCatalog } from './css-section-nav.js';
38
39
  import { dialogClassCatalog } from './css-dialog.js';
40
+ import { dialogBandedClassCatalog } from './css-dialog-banded.js';
39
41
  import { dialogFrameClassCatalog } from './css-dialog-frame.js';
40
42
  import { selectClassCatalog } from './css-select.js';
41
43
  import { multiSelectClassCatalog } from './css-multi-select.js';
@@ -71,6 +73,7 @@ export function utilityClassCatalog() {
71
73
  ...sectionNavClassCatalog(),
72
74
  ...dialogClassCatalog(),
73
75
  ...dialogFrameClassCatalog(),
76
+ ...dialogBandedClassCatalog(),
74
77
  ...accordionClassCatalog(),
75
78
  ...selectClassCatalog(),
76
79
  ...actionMenuClassCatalog(),
@@ -104,6 +107,7 @@ export function utilityClassCatalog() {
104
107
  ...toastCardClassCatalog(),
105
108
  ...responsiveClassCatalog(),
106
109
  ...boxBorderClassCatalog(),
110
+ ...boxLinkClassCatalog(),
107
111
  ];
108
112
  }
109
113
  export { generatePaletteStylesheet, paletteStylesheetIds, } from './css-palettes.js';
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The semantic colors a tinted mark can be drawn from: a note's tone or a
3
+ * single count's.
4
+ */
5
+ export type TintColor = 'accent' | 'success' | 'warning' | 'danger';
6
+ /**
7
+ * How much of a tone's color a tint mixes into the surface. The accent uses
8
+ * the derived accent tint instead (ADR 0011), which already keeps the accent
9
+ * readable on every palette.
10
+ */
11
+ export declare const toneTintShare = 0.1;
12
+ /**
13
+ * How far a tint's words move from the tone's color toward the text color,
14
+ * so they read darker than the tone on a light fill (lighter on a dark one)
15
+ * and keep 4.5:1 on the tint (`notice.test.tsx`).
16
+ */
17
+ export declare const toneInkTextShare = 0.3;
18
+ /** A tone's quiet fill: the tone mixed into the surface. */
19
+ export declare function toneTintFill(color: TintColor): string;
20
+ /** The words on that fill: the tone moved toward the text color. */
21
+ export declare function toneTintInk(color: TintColor): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * How much of a tone's color a tint mixes into the surface. The accent uses
3
+ * the derived accent tint instead (ADR 0011), which already keeps the accent
4
+ * readable on every palette.
5
+ */
6
+ export const toneTintShare = 0.1;
7
+ /**
8
+ * How far a tint's words move from the tone's color toward the text color,
9
+ * so they read darker than the tone on a light fill (lighter on a dark one)
10
+ * and keep 4.5:1 on the tint (`notice.test.tsx`).
11
+ */
12
+ export const toneInkTextShare = 0.3;
13
+ /** A tone's quiet fill: the tone mixed into the surface. */
14
+ export function toneTintFill(color) {
15
+ if (color === 'accent')
16
+ return 'var(--sw-color-accentSubtle)';
17
+ return `color-mix(in srgb, var(--sw-color-${color}) ${toneTintShare * 100}%, var(--sw-color-surface))`;
18
+ }
19
+ /** The words on that fill: the tone moved toward the text color. */
20
+ export function toneTintInk(color) {
21
+ const toneShare = Math.round((1 - toneInkTextShare) * 100);
22
+ return `color-mix(in srgb, var(--sw-color-${color}) ${toneShare}%, var(--sw-color-text))`;
23
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { ActionMenu, type ActionMenuAlign, type ActionMenuItem, type ActionMenuProps, } from './components/ActionMenu.js';
1
+ export { ActionMenu, type ActionMenuAlign, type ActionMenuItem, type ActionMenuProps, actionMenuTriggerAppearances, type ActionMenuTriggerAppearance, } from './components/ActionMenu.js';
2
2
  export { ActionBar, type ActionBarProps, type ActionBarSummary, type ActionBarSummaryTone, } from './components/ActionBar.js';
3
3
  export { Accordion } from './components/Accordion.js';
4
4
  export type { AccordionProps, AccordionSize } from './components/Accordion.js';
@@ -13,25 +13,28 @@ export { Progress, progressTones, type ProgressProps, type ProgressTone, } from
13
13
  export { Tooltip, type TooltipProps, type TooltipRelationship, } from './components/Tooltip.js';
14
14
  export { InfoTip, type InfoTipProps } from './components/InfoTip.js';
15
15
  export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
16
- export { AppHeader, type AppHeaderProps } from './components/AppHeader.js';
16
+ export { AppHeader, appHeaderAppearances, type AppHeaderAppearance, type AppHeaderProps, } from './components/AppHeader.js';
17
17
  export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeSizes, badgeTones, } from './components/Badge.js';
18
18
  export { BarChart, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
19
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, } from './components/Button.js';
20
- export { Box, type BoxBorder, type BoxElement, type BoxProps, } from './components/Box.js';
21
- export { ButtonGroup, type ButtonGroupJustify, type ButtonGroupProps, } from './components/ButtonGroup.js';
19
+ export { Button, type ButtonDisabledAppearance, type ButtonProps, type ButtonSize, type ButtonVariant, } from './components/Button.js';
20
+ export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
21
+ export { Box, type BoxBorder, type BoxElement, type BoxLink, type BoxProps, } from './components/Box.js';
22
+ export { boxLinkAppearances } from './css/css-box-link.js';
23
+ export { ButtonGroup, buttonGroupAppearances, type ButtonGroupAppearance, type ButtonGroupJustify, type ButtonGroupProps, } from './components/ButtonGroup.js';
22
24
  export { Card, type CardProps, type CardVariant } from './components/Card.js';
23
- export { Dialog, dialogSizes, type DialogProps, type DialogRole, type DialogSize, type DialogTitleLevel, } from './components/Dialog.js';
25
+ export { Dialog, dialogAppearances, dialogSizes, type DialogAppearance, type DialogProps, type DialogRole, type DialogSize, type DialogTitleLevel, } from './components/Dialog.js';
24
26
  export { StatTile, type StatTileEmphasis, type StatTileProps, type StatTileTone, statTileTones, } from './components/StatTile.js';
25
27
  export { TabPanel, type TabItem, type TabPanelProps, Tabs, type TabsProps, tabId, tabPanelId, } from './components/Tabs.js';
26
28
  export { Toast, toastPlacements, toastTones, type ToastAction, type ToastPlacement, } from './components/Toast.js';
27
29
  export type { ToastProps, ToastTone } from './components/Toast.js';
28
30
  export { Field, fieldVariants, type FieldProps, type FieldSize, type FieldVariant, } from './components/Field.js';
31
+ export { requiredMarks, type RequiredMark, } from './components/FieldLabelText.js';
29
32
  export { Step, type StepHeadingLevel, type StepProps, Steps, type StepsLabels, type StepsProps, type StepStatus, } from './components/Steps.js';
30
- export { Stepper, type StepperProps, type StepperWidth, } from './components/Stepper.js';
33
+ export { Stepper, stepperLimitAppearances, type StepperLimitAppearance, type StepperProps, type StepperWidth, } from './components/Stepper.js';
31
34
  export { Inline, type InlineProps } from './components/Inline.js';
32
35
  export { Split } from './components/Split.js';
33
36
  export type { SplitProps } from './components/Split.js';
34
- export { Nav, type NavProps } from './components/Nav.js';
37
+ export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
35
38
  export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
36
39
  export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, type SegmentedItem, } from './components/SegmentedControl.js';
37
40
  export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
@@ -54,7 +57,7 @@ export { Grid } from './components/Grid.js';
54
57
  export type { GridColumns, GridProps } from './components/Grid.js';
55
58
  export type { GridColumnSpan } from './css/css-grid-span.js';
56
59
  export type { ColumnSpanProps } from './column-span-classes.js';
57
- export { DenominationGrid, denominationLabelAppearances, } from './components/DenominationGrid.js';
58
- export type { DenominationGridColumn, DenominationGridEntry, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationLabelAppearance, DenominationLabelWidth, } from './components/DenominationGrid.js';
60
+ export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
61
+ export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, } from './components/DenominationGrid.js';
59
62
  export { FilterChips } from './components/FilterChips.js';
60
63
  export type { FilterChipOption, FilterChipsProps, } from './components/FilterChips.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { ActionMenu, } from './components/ActionMenu.js';
1
+ export { ActionMenu, actionMenuTriggerAppearances, } from './components/ActionMenu.js';
2
2
  export { ActionBar, } from './components/ActionBar.js';
3
3
  export { Accordion } from './components/Accordion.js';
4
4
  export { Switch } from './components/Switch.js';
@@ -12,23 +12,26 @@ export { Progress, progressTones, } from './components/Progress.js';
12
12
  export { Tooltip, } from './components/Tooltip.js';
13
13
  export { InfoTip } from './components/InfoTip.js';
14
14
  export { RadioGroup, } from './components/RadioGroup.js';
15
- export { AppHeader } from './components/AppHeader.js';
15
+ export { AppHeader, appHeaderAppearances, } from './components/AppHeader.js';
16
16
  export { Badge, badgeSizes, badgeTones, } from './components/Badge.js';
17
17
  export { BarChart, barChartTones, } from './components/BarChart.js';
18
18
  export { Button, } from './components/Button.js';
19
+ export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
19
20
  export { Box, } from './components/Box.js';
20
- export { ButtonGroup, } from './components/ButtonGroup.js';
21
+ export { boxLinkAppearances } from './css/css-box-link.js';
22
+ export { ButtonGroup, buttonGroupAppearances, } from './components/ButtonGroup.js';
21
23
  export { Card } from './components/Card.js';
22
- export { Dialog, dialogSizes, } from './components/Dialog.js';
24
+ export { Dialog, dialogAppearances, dialogSizes, } from './components/Dialog.js';
23
25
  export { StatTile, statTileTones, } from './components/StatTile.js';
24
26
  export { TabPanel, Tabs, tabId, tabPanelId, } from './components/Tabs.js';
25
27
  export { Toast, toastPlacements, toastTones, } from './components/Toast.js';
26
28
  export { Field, fieldVariants, } from './components/Field.js';
29
+ export { requiredMarks, } from './components/FieldLabelText.js';
27
30
  export { Step, Steps, } from './components/Steps.js';
28
- export { Stepper, } from './components/Stepper.js';
31
+ export { Stepper, stepperLimitAppearances, } from './components/Stepper.js';
29
32
  export { Inline } from './components/Inline.js';
30
33
  export { Split } from './components/Split.js';
31
- export { Nav } from './components/Nav.js';
34
+ export { Nav, navAppearances, } from './components/Nav.js';
32
35
  export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
33
36
  export { SegmentedControl, } from './components/SegmentedControl.js';
34
37
  export { Combobox, comboboxSizes, } from './components/Combobox.js';
@@ -43,5 +46,5 @@ export { breakpointQuery } from './css/breakpoints.js';
43
46
  export { Separator } from './components/Separator.js';
44
47
  export { DescriptionItem, DescriptionList, } from './components/DescriptionList.js';
45
48
  export { Grid } from './components/Grid.js';
46
- export { DenominationGrid, denominationLabelAppearances, } from './components/DenominationGrid.js';
49
+ export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
47
50
  export { FilterChips } from './components/FilterChips.js';