@scalewing/react 1.40.0 → 1.41.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 (105) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +154 -6
  3. package/dist/calendar-labels.d.ts +2 -0
  4. package/dist/calendar-labels.js +7 -0
  5. package/dist/components/BarChart.d.ts +20 -4
  6. package/dist/components/BarChart.js +13 -6
  7. package/dist/components/ButtonGroup.d.ts +8 -1
  8. package/dist/components/ButtonGroup.js +11 -2
  9. package/dist/components/DateField.d.ts +14 -2
  10. package/dist/components/DateField.js +14 -11
  11. package/dist/components/DenominationGrid.d.ts +3 -2
  12. package/dist/components/DenominationGrid.js +21 -3
  13. package/dist/components/Dialog.d.ts +29 -13
  14. package/dist/components/Dialog.js +22 -20
  15. package/dist/components/Field.d.ts +13 -2
  16. package/dist/components/Field.js +14 -38
  17. package/dist/components/FilterChips.d.ts +7 -37
  18. package/dist/components/FilterChips.js +32 -24
  19. package/dist/components/ListRow.d.ts +11 -2
  20. package/dist/components/ListRow.js +3 -2
  21. package/dist/components/SegmentedControl.d.ts +17 -1
  22. package/dist/components/SegmentedControl.js +11 -3
  23. package/dist/components/Switch.d.ts +16 -1
  24. package/dist/components/Switch.js +17 -6
  25. package/dist/components/action-bar/ActionBarSummary.d.ts +10 -2
  26. package/dist/components/action-bar/ActionBarSummary.js +11 -2
  27. package/dist/components/date-field/CalendarEntryButton.d.ts +24 -0
  28. package/dist/components/date-field/CalendarEntryButton.js +16 -0
  29. package/dist/components/date-field/TypedEntry.d.ts +26 -0
  30. package/dist/components/date-field/TypedEntry.js +13 -0
  31. package/dist/components/denomination-grid/CountCell.d.ts +16 -0
  32. package/dist/components/denomination-grid/CountCell.js +14 -0
  33. package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -1
  34. package/dist/components/denomination-grid/DenominationStrip.js +2 -2
  35. package/dist/components/denomination-grid/EntryCell.d.ts +3 -1
  36. package/dist/components/denomination-grid/EntryCell.js +2 -2
  37. package/dist/components/denomination-grid/StripRow.js +1 -10
  38. package/dist/components/denomination-grid/TransposedStrip.d.ts +17 -0
  39. package/dist/components/denomination-grid/TransposedStrip.js +43 -0
  40. package/dist/components/denomination-grid/types.d.ts +31 -0
  41. package/dist/components/denomination-grid/types.js +7 -1
  42. package/dist/components/denomination-grid/validate-options.d.ts +7 -0
  43. package/dist/components/denomination-grid/validate-options.js +27 -0
  44. package/dist/components/dialog/DialogFooter.d.ts +6 -5
  45. package/dist/components/dialog/DialogFooter.js +6 -6
  46. package/dist/components/dialog/validate.d.ts +24 -0
  47. package/dist/components/dialog/validate.js +23 -0
  48. package/dist/components/field/field-checks.d.ts +34 -0
  49. package/dist/components/field/field-checks.js +42 -0
  50. package/dist/components/filter-chips/FilterChip.d.ts +16 -0
  51. package/dist/components/filter-chips/FilterChip.js +20 -0
  52. package/dist/components/filter-chips/options.d.ts +75 -0
  53. package/dist/components/filter-chips/options.js +11 -0
  54. package/dist/components/filter-chips/validate.d.ts +9 -0
  55. package/dist/components/filter-chips/validate.js +48 -0
  56. package/dist/components/list/ListRowContent.d.ts +3 -1
  57. package/dist/components/list/ListRowContent.js +3 -2
  58. package/dist/css/chart-tones.d.ts +2 -0
  59. package/dist/css/chart-tones.js +5 -1
  60. package/dist/css/css-bar-chart.d.ts +17 -2
  61. package/dist/css/css-bar-chart.js +38 -7
  62. package/dist/css/css-button-group-attached.d.ts +3 -0
  63. package/dist/css/css-button-group-attached.js +18 -1
  64. package/dist/css/css-canvas-grouped.d.ts +17 -0
  65. package/dist/css/css-canvas-grouped.js +40 -0
  66. package/dist/css/css-components.js +6 -0
  67. package/dist/css/css-date-field-calendar-entry.d.ts +11 -0
  68. package/dist/css/css-date-field-calendar-entry.js +50 -0
  69. package/dist/css/css-date-field.js +4 -0
  70. package/dist/css/css-denomination-grid.js +4 -0
  71. package/dist/css/css-denomination-transposed.d.ts +4 -0
  72. package/dist/css/css-denomination-transposed.js +178 -0
  73. package/dist/css/css-dialog-canvas.d.ts +3 -0
  74. package/dist/css/css-dialog-canvas.js +20 -0
  75. package/dist/css/css-dialog-frame.js +19 -2
  76. package/dist/css/css-dialog-grabber.d.ts +4 -0
  77. package/dist/css/css-dialog-grabber.js +56 -0
  78. package/dist/css/css-dialog.js +3 -2
  79. package/dist/css/css-document.js +3 -0
  80. package/dist/css/css-field-width.d.ts +12 -0
  81. package/dist/css/css-field-width.js +49 -0
  82. package/dist/css/css-field.js +4 -0
  83. package/dist/css/css-filter-chips-layout.d.ts +2 -0
  84. package/dist/css/css-filter-chips-layout.js +42 -0
  85. package/dist/css/css-filter-chips.js +4 -0
  86. package/dist/css/css-list-row.d.ts +6 -0
  87. package/dist/css/css-list-row.js +19 -3
  88. package/dist/css/css-segmented-sizing.d.ts +13 -0
  89. package/dist/css/css-segmented-sizing.js +66 -0
  90. package/dist/css/css-segmented.js +4 -0
  91. package/dist/css/css-switch.d.ts +6 -0
  92. package/dist/css/css-switch.js +39 -0
  93. package/dist/css/stacking.d.ts +1 -0
  94. package/dist/css/stacking.js +4 -1
  95. package/dist/css/stylesheet.js +4 -0
  96. package/dist/date-field-labels.d.ts +5 -0
  97. package/dist/date-field-labels.js +1 -0
  98. package/dist/index.d.ts +10 -8
  99. package/dist/index.js +8 -6
  100. package/dist/list-options.d.ts +8 -7
  101. package/dist/list-options.js +15 -8
  102. package/dist/styles.css +343 -2
  103. package/dist/theme/ThemeProvider.d.ts +11 -1
  104. package/dist/theme/ThemeProvider.js +4 -2
  105. package/package.json +1 -1
@@ -0,0 +1,66 @@
1
+ import { breakpointQuery } from './breakpoints.js';
2
+ /** The class that stretches a SegmentedControl's field below a breakpoint. */
3
+ export function segmentedFullWidthClass(breakpoint) {
4
+ return `sw-segmented-field-full-below-${breakpoint}`;
5
+ }
6
+ /**
7
+ * `md` (the default) is each track's own segment padding; `sm` pads every
8
+ * segment a step less and keeps its label on one line, ending in an
9
+ * ellipsis past its share, so a few segments fit a phone's card.
10
+ */
11
+ export const segmentedSizes = ['md', 'sm'];
12
+ export const segmentedSmClass = 'sw-segmented-sm';
13
+ /*
14
+ * Below the breakpoint a full-width field fills its column and its track
15
+ * shares that width equally among its segments (the filled track's grid),
16
+ * whatever its variant, a raised one included (three classes, after the
17
+ * raised and Inline rules that size it to its segments).
18
+ *
19
+ * A small track pads each segment without a mark a space-2 step on both
20
+ * sides (a segment with a mark keeps its variant's padding), never wraps a
21
+ * label and ends a label that does not fit its segment in an ellipsis on
22
+ * the label's own block box (`sw-segmented-item-label`; an inline box
23
+ * cannot clip), so a plain segment and a flex item (a
24
+ * filled or marked segment) truncate too; the radio's name still reads
25
+ * the whole label. After every variant's padding.
26
+ */
27
+ export function cssSegmentedSizingClasses() {
28
+ const full = segmentedFullWidthClass('md');
29
+ return `@media ${breakpointQuery('below', 'md')} {
30
+ .sw-segmented-field.${full} {
31
+ align-self: stretch;
32
+ display: flex;
33
+ width: 100%;
34
+ }
35
+ .sw-segmented-field.${full} > .sw-segmented {
36
+ align-self: stretch;
37
+ display: grid;
38
+ grid-auto-columns: minmax(0, 1fr);
39
+ grid-auto-flow: column;
40
+ }
41
+ }
42
+
43
+ .sw-segmented.${segmentedSmClass} .sw-segmented-item {
44
+ min-width: 0;
45
+ overflow: hidden;
46
+ white-space: nowrap;
47
+ }
48
+
49
+ .sw-segmented.${segmentedSmClass}:not(.sw-segmented-with-icons) .sw-segmented-item {
50
+ padding-inline: var(--sw-space-2);
51
+ }
52
+
53
+ .${segmentedSmClass} .sw-segmented-item-label {
54
+ display: block;
55
+ min-width: 0;
56
+ overflow: hidden;
57
+ text-overflow: ellipsis;
58
+ }`;
59
+ }
60
+ export function segmentedSizingClassCatalog() {
61
+ return [
62
+ segmentedFullWidthClass('md'),
63
+ segmentedSmClass,
64
+ 'sw-segmented-item-label',
65
+ ];
66
+ }
@@ -1,5 +1,6 @@
1
1
  import { trackInset, typographyVariants } from '@scalewing/tokens';
2
2
  import { cssSegmentedRaisedClasses, segmentedRaisedClassCatalog, } from './css-segmented-raised.js';
3
+ import { cssSegmentedSizingClasses, segmentedSizingClassCatalog, } from './css-segmented-sizing.js';
3
4
  const body = typographyVariants.body;
4
5
  const data = typographyVariants.data;
5
6
  const label = typographyVariants.label;
@@ -167,6 +168,8 @@ ${iconRules()}
167
168
 
168
169
  ${cssSegmentedRaisedClasses()}
169
170
 
171
+ ${cssSegmentedSizingClasses()}
172
+
170
173
  .sw-segmented-disabled {
171
174
  opacity: var(--sw-disabled-opacity);
172
175
  }
@@ -187,5 +190,6 @@ export function segmentedClassCatalog() {
187
190
  'sw-segmented-item-icon',
188
191
  'sw-segmented-disabled',
189
192
  ...segmentedRaisedClassCatalog(),
193
+ ...segmentedSizingClassCatalog(),
190
194
  ];
191
195
  }
@@ -1,2 +1,8 @@
1
+ /** Where the control sits: before its label, or at the row's end after it. */
2
+ export declare const switchLayouts: readonly ["leading", "trailing"];
3
+ export type SwitchLayout = (typeof switchLayouts)[number];
4
+ /** The track's colour while on. */
5
+ export declare const switchCheckedTones: readonly ["accent", "success"];
6
+ export type SwitchCheckedTone = (typeof switchCheckedTones)[number];
1
7
  export declare function cssSwitchClasses(): string;
2
8
  export declare function switchClassCatalog(): string[];
@@ -1,6 +1,41 @@
1
1
  import { typographyVariants } from '@scalewing/tokens';
2
2
  const label = typographyVariants.label;
3
3
  const caption = typographyVariants.caption;
4
+ /** Where the control sits: before its label, or at the row's end after it. */
5
+ export const switchLayouts = ['leading', 'trailing'];
6
+ /** The track's colour while on. */
7
+ export const switchCheckedTones = ['accent', 'success'];
8
+ /*
9
+ * A trailing switch is a row as wide as its column: the label and its
10
+ * description take the room, the control sits at the end, a step apart,
11
+ * lined up with the label's first line. A success switch fills its track
12
+ * with the success colour while on (3:1 or more against the surface in
13
+ * every palette, as the accent is); forced colours keep Highlight.
14
+ */
15
+ function optionRules() {
16
+ return `.sw-switch-trailing {
17
+ align-items: flex-start;
18
+ display: flex;
19
+ gap: var(--sw-space-3);
20
+ justify-content: space-between;
21
+ width: 100%;
22
+ }
23
+
24
+ .sw-switch-trailing .sw-switch-copy {
25
+ flex: 1 1 auto;
26
+ min-width: 0;
27
+ padding-block: calc((var(--sw-control-md-min-height) - ${label.lineHeight}px) / 2);
28
+ }
29
+
30
+ .sw-switch-success .sw-switch-input:checked + .sw-switch-track {
31
+ background: var(--sw-color-success);
32
+ border-color: var(--sw-color-success);
33
+ }
34
+
35
+ @media (forced-colors: active) {
36
+ .sw-switch-success .sw-switch-input:checked + .sw-switch-track { background: Highlight; border-color: Highlight; }
37
+ }`;
38
+ }
4
39
  export function cssSwitchClasses() {
5
40
  return `.sw-switch {
6
41
  align-items: center;
@@ -90,6 +125,8 @@ export function cssSwitchClasses() {
90
125
  line-height: ${caption.lineHeight}px;
91
126
  }
92
127
 
128
+ ${optionRules()}
129
+
93
130
  @media (prefers-reduced-motion: reduce) {
94
131
  .sw-switch-thumb { transition: none; }
95
132
  }
@@ -111,5 +148,7 @@ export function switchClassCatalog() {
111
148
  'sw-switch-copy',
112
149
  'sw-switch-label',
113
150
  'sw-switch-description',
151
+ 'sw-switch-trailing',
152
+ 'sw-switch-success',
114
153
  ];
115
154
  }
@@ -4,6 +4,7 @@ export declare const stackingOrder: {
4
4
  readonly bottomChrome: 3;
5
5
  readonly popupHost: 4;
6
6
  readonly topChrome: 5;
7
+ readonly sheetGrabber: 6;
7
8
  readonly popup: 10;
8
9
  };
9
10
  export type StackingLayer = keyof typeof stackingOrder;
@@ -17,7 +17,9 @@
17
17
  * Dialog's title band, inside its dialog), over a lifted
18
18
  * surface that scrolls up under it (the header is the page's way back, the
19
19
  * strip its way between sections, and a popup opens downward).
20
- * 6. `popup`: a popup outside any lifted surface (Select list, ActionMenu
20
+ * 6. `sheetGrabber`: a bottom sheet's grabber, inside its dialog, over the
21
+ * banded title band that sticks under it.
22
+ * 7. `popup`: a popup outside any lifted surface (Select list, ActionMenu
21
23
  * list, MultiSelect panel, Combobox list, Tooltip, the DateField and CalendarButton
22
24
  * calendar) over everything in the page.
23
25
  *
@@ -29,6 +31,7 @@ export const stackingOrder = {
29
31
  bottomChrome: 3,
30
32
  popupHost: 4,
31
33
  topChrome: 5,
34
+ sheetGrabber: 6,
32
35
  popup: 10,
33
36
  };
34
37
  /*
@@ -48,6 +48,8 @@ import { sectionNavClassCatalog } from './css-section-nav.js';
48
48
  import { dialogClassCatalog } from './css-dialog.js';
49
49
  import { dialogBandedClassCatalog } from './css-dialog-banded.js';
50
50
  import { dialogFrameClassCatalog } from './css-dialog-frame.js';
51
+ import { dialogCanvasClassCatalog } from './css-dialog-canvas.js';
52
+ import { dialogGrabberClassCatalog } from './css-dialog-grabber.js';
51
53
  import { selectClassCatalog } from './css-select.js';
52
54
  import { multiSelectClassCatalog } from './css-multi-select.js';
53
55
  import { comboboxClassCatalog } from './css-combobox.js';
@@ -89,6 +91,8 @@ export function utilityClassCatalog() {
89
91
  ...dialogClassCatalog(),
90
92
  ...dialogFrameClassCatalog(),
91
93
  ...dialogBandedClassCatalog(),
94
+ ...dialogCanvasClassCatalog(),
95
+ ...dialogGrabberClassCatalog(),
92
96
  ...accordionClassCatalog(),
93
97
  ...selectClassCatalog(),
94
98
  ...actionMenuClassCatalog(),
@@ -28,6 +28,11 @@ export type DateFieldLabels = {
28
28
  * outside `min` and `max`.
29
29
  */
30
30
  outOfRange: string;
31
+ /**
32
+ * Said after a calendar entry's name while the field is required (a
33
+ * button has no required state of its own), such as "Required".
34
+ */
35
+ required: string;
31
36
  /** Placeholder letters, arranged in the locale's field order. */
32
37
  dayPlaceholder: string;
33
38
  monthPlaceholder: string;
@@ -8,6 +8,7 @@ export const defaultDateFieldLabels = {
8
8
  clear: 'Clear',
9
9
  invalidEntry: 'Enter a valid date.',
10
10
  outOfRange: 'Choose a date in the allowed range.',
11
+ required: 'Required',
11
12
  dayPlaceholder: 'DD',
12
13
  monthPlaceholder: 'MM',
13
14
  yearPlaceholder: 'YYYY',
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { ActionMenu, type ActionMenuAlign, type ActionMenuItem, type ActionMenuP
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';
5
- export { Switch, type SwitchProps } from './components/Switch.js';
6
- export { DateField, type DateFieldLabels, type DateFieldProps, type WeekStart, } from './components/DateField.js';
5
+ export { Switch, switchCheckedTones, switchLayouts, type SwitchCheckedTone, type SwitchLayout, type SwitchProps, } from './components/Switch.js';
6
+ export { DateField, dateFieldEntries, type DateFieldEntry, type DateFieldLabels, type DateFieldProps, type WeekStart, } from './components/DateField.js';
7
7
  export { CalendarButton, type CalendarButtonLabels, type CalendarButtonProps, type CalendarButtonRange, } from './components/CalendarButton.js';
8
8
  export { DateRangeButton, type DateRangeButtonLabels, type DateRangeButtonProps, type DateRangeButtonValue, type DateRangePreset, } from './components/DateRangeButton.js';
9
9
  export { ListGroup, type ListGroupProps } from './components/ListGroup.js';
@@ -19,7 +19,7 @@ export { InfoTip, type InfoTipProps } from './components/InfoTip.js';
19
19
  export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
20
20
  export { AppHeader, appHeaderAppearances, type AppHeaderAppearance, type AppHeaderProps, } from './components/AppHeader.js';
21
21
  export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeSizes, badgeTones, } from './components/Badge.js';
22
- export { BarChart, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
22
+ export { BarChart, barChartAppearances, type BarChartAppearance, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
23
23
  export { ChartLegend, type ChartFillTone, type ChartLegendItem, type ChartLegendProps, type ChartLegendSwatch, type ChartStrokeTone, type ChartTone, chartFillTones, chartLegendSwatches, chartStrokeTones, } from './components/ChartLegend.js';
24
24
  export { ColumnChart, type ColumnChartCallout, type ColumnChartLine, type ColumnChartMode, type ColumnChartProps, type ColumnChartSeries, columnChartModes, } from './components/ColumnChart.js';
25
25
  export { LineChart, type LineChartCurve, type LineChartMarker, type LineChartPeriod, type LineChartPoint, type LineChartProps, lineChartCurves, } from './components/LineChart.js';
@@ -37,6 +37,7 @@ export { TabPanel, type TabItem, type TabPanelProps, Tabs, type TabsProps, tabId
37
37
  export { Toast, toastPlacements, toastTones, type ToastAction, type ToastPlacement, } from './components/Toast.js';
38
38
  export type { ToastProps, ToastTone } from './components/Toast.js';
39
39
  export { Field, fieldVariants, type FieldProps, type FieldSize, type FieldVariant, } from './components/Field.js';
40
+ export { fieldWidths, type FieldWidth } from './css/css-field-width.js';
40
41
  export { requiredMarks, type RequiredMark, } from './components/FieldLabelText.js';
41
42
  export { Step, type StepHeadingLevel, type StepProps, Steps, type StepsLabels, type StepsProps, type StepStatus, } from './components/Steps.js';
42
43
  export { Stepper, stepperLimitAppearances, type StepperLimitAppearance, type StepperProps, type StepperWidth, } from './components/Stepper.js';
@@ -46,7 +47,7 @@ export type { SplitProps } from './components/Split.js';
46
47
  export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
47
48
  export { NavCount, type NavCountProps } from './components/NavCount.js';
48
49
  export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
49
- export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, type SegmentedItem, } from './components/SegmentedControl.js';
50
+ export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, segmentedSizes, type SegmentedSize, type SegmentedItem, } from './components/SegmentedControl.js';
50
51
  export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
51
52
  export { Select } from './components/Select.js';
52
53
  export type { SelectAction, SelectOption, SelectProps, SelectWidth, } from './components/Select.js';
@@ -55,6 +56,7 @@ export { Stack, type Align, type Justify, type StackProps, } from './components/
55
56
  export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow, tableCellTones, tableRowVariants, type TableBodyProps, type TableCellProps, type TableCellTone, type TableColumnWidth, type TableDensity, type TableFooterProps, type TableHeaderProps, type TableLayout, type TableMaxHeight, type TableProps, type TableRowProps, type TableRowVariant, type TableSort, type TableStickyHeader, type TableVerticalAlign, } from './components/Table.js';
56
57
  export { Text, type TextAlign, type TextElement, type TextProps, } from './components/Text.js';
57
58
  export { ThemeProvider, useTheme, type ThemeProviderProps, } from './theme/ThemeProvider.js';
59
+ export { themeCanvases, type ThemeCanvas } from './css/css-canvas-grouped.js';
58
60
  export { utilityClassCatalog } from './css/stylesheet.js';
59
61
  export type { VisibilityProps } from './visibility-classes.js';
60
62
  export type { Breakpoint, BreakpointDirection, VisibilityBreakpoint, } from './css/breakpoints.js';
@@ -67,7 +69,7 @@ export { Grid } from './components/Grid.js';
67
69
  export type { GridColumns, GridProps } from './components/Grid.js';
68
70
  export type { GridColumnSpan } from './css/css-grid-span.js';
69
71
  export type { ColumnSpanProps } from './column-span-classes.js';
70
- export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
71
- export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationGridValueRow, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, } from './components/DenominationGrid.js';
72
- export { FilterChips } from './components/FilterChips.js';
73
- export type { FilterChipOption, FilterChipsProps, } from './components/FilterChips.js';
72
+ export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationNegativeAppearances, denominationTotalEmphases, denominationTransposeBreakpoints, } from './components/DenominationGrid.js';
73
+ export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridNegativeAppearance, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationGridValueRow, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, DenominationTransposeBreakpoint, } from './components/DenominationGrid.js';
74
+ export { FilterChips, filterChipCountAppearances, filterChipsOverflows, } from './components/FilterChips.js';
75
+ export type { FilterChipCountAppearance, FilterChipOption, FilterChipsOverflow, FilterChipsProps, } from './components/FilterChips.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
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
- export { Switch } from './components/Switch.js';
5
- export { DateField, } from './components/DateField.js';
4
+ export { Switch, switchCheckedTones, switchLayouts, } from './components/Switch.js';
5
+ export { DateField, dateFieldEntries, } from './components/DateField.js';
6
6
  export { CalendarButton, } from './components/CalendarButton.js';
7
7
  export { DateRangeButton, } from './components/DateRangeButton.js';
8
8
  export { ListGroup } from './components/ListGroup.js';
@@ -18,7 +18,7 @@ export { InfoTip } from './components/InfoTip.js';
18
18
  export { RadioGroup, } from './components/RadioGroup.js';
19
19
  export { AppHeader, appHeaderAppearances, } from './components/AppHeader.js';
20
20
  export { Badge, badgeSizes, badgeTones, } from './components/Badge.js';
21
- export { BarChart, barChartTones, } from './components/BarChart.js';
21
+ export { BarChart, barChartAppearances, barChartTones, } from './components/BarChart.js';
22
22
  export { ChartLegend, chartFillTones, chartLegendSwatches, chartStrokeTones, } from './components/ChartLegend.js';
23
23
  export { ColumnChart, columnChartModes, } from './components/ColumnChart.js';
24
24
  export { LineChart, lineChartCurves, } from './components/LineChart.js';
@@ -35,6 +35,7 @@ export { StatTile, statTileAppearances, statTileTones, } from './components/Stat
35
35
  export { TabPanel, Tabs, tabId, tabPanelId, } from './components/Tabs.js';
36
36
  export { Toast, toastPlacements, toastTones, } from './components/Toast.js';
37
37
  export { Field, fieldVariants, } from './components/Field.js';
38
+ export { fieldWidths } from './css/css-field-width.js';
38
39
  export { requiredMarks, } from './components/FieldLabelText.js';
39
40
  export { Step, Steps, } from './components/Steps.js';
40
41
  export { Stepper, stepperLimitAppearances, } from './components/Stepper.js';
@@ -43,7 +44,7 @@ export { Split } from './components/Split.js';
43
44
  export { Nav, navAppearances, } from './components/Nav.js';
44
45
  export { NavCount } from './components/NavCount.js';
45
46
  export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
46
- export { SegmentedControl, } from './components/SegmentedControl.js';
47
+ export { SegmentedControl, segmentedSizes, } from './components/SegmentedControl.js';
47
48
  export { Combobox, comboboxSizes, } from './components/Combobox.js';
48
49
  export { Select } from './components/Select.js';
49
50
  export { MultiSelect, } from './components/MultiSelect.js';
@@ -51,10 +52,11 @@ export { Stack, } from './components/Stack.js';
51
52
  export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow, tableCellTones, tableRowVariants, } from './components/Table.js';
52
53
  export { Text, } from './components/Text.js';
53
54
  export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
55
+ export { themeCanvases } from './css/css-canvas-grouped.js';
54
56
  export { utilityClassCatalog } from './css/stylesheet.js';
55
57
  export { breakpointQuery } from './css/breakpoints.js';
56
58
  export { Separator } from './components/Separator.js';
57
59
  export { DescriptionItem, DescriptionList, } from './components/DescriptionList.js';
58
60
  export { Grid } from './components/Grid.js';
59
- export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
60
- export { FilterChips } from './components/FilterChips.js';
61
+ export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationNegativeAppearances, denominationTotalEmphases, denominationTransposeBreakpoints, } from './components/DenominationGrid.js';
62
+ export { FilterChips, filterChipCountAppearances, filterChipsOverflows, } from './components/FilterChips.js';
@@ -1,5 +1,6 @@
1
1
  import { type CSSProperties } from 'react';
2
- import { type TableCellTone } from './css/css-table-ledger.js';
2
+ import { type BadgeTone } from './css/css-data.js';
3
+ import { listRowValueTones, type ListRowValueTone } from './css/css-list-row.js';
3
4
  /**
4
5
  * `panel` (the default) is one bordered panel on the surface; `plain`
5
6
  * draws no panel and a hairline above the first row too, for rows inside
@@ -21,9 +22,7 @@ export type ListRowTone = (typeof listRowTones)[number];
21
22
  /** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
22
23
  export declare const listRowTitleAppearances: readonly ["strong", "plain"];
23
24
  export type ListRowTitleAppearance = (typeof listRowTitleAppearances)[number];
24
- /** The colours a row's value can take, as a table cell's. */
25
- export declare const listRowValueTones: readonly ["success", "danger", "muted", "accent"];
26
- export type ListRowValueTone = TableCellTone;
25
+ export { listRowValueTones, type ListRowValueTone };
27
26
  /** What ends a row: a chevron (it opens something), a check (chosen), or none. */
28
27
  export type ListRowAccessory = 'chevron' | 'check' | 'none';
29
28
  export type ListGroupInput = {
@@ -48,14 +47,16 @@ export type ListRowInput = {
48
47
  accessory: unknown;
49
48
  value: string | undefined;
50
49
  valueDetail: string | undefined;
50
+ valueBadge: BadgeTone | undefined;
51
51
  selected: boolean | undefined;
52
52
  pressable: boolean;
53
53
  };
54
54
  /**
55
55
  * Fails closed on a ListRow it cannot draw: an empty title or value, an
56
- * unknown tone, title appearance, value tone or accessory, a `valueDetail`
57
- * or `valueTone` with no value, or `selected` on a row that is not a
58
- * button or link (its check would be a state nothing can read).
56
+ * unknown tone, title appearance, value tone, badge tone or accessory, a
57
+ * `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
58
+ * toned and a badge, or `selected` on a row that is not a button or link
59
+ * (its check would be a state nothing can read).
59
60
  */
60
61
  export declare function assertListRow(input: ListRowInput): void;
61
62
  /**
@@ -1,4 +1,5 @@
1
- import { tableCellTones } from './css/css-table-ledger.js';
1
+ import { badgeTones } from './css/css-data.js';
2
+ import { listRowValueTones, } from './css/css-list-row.js';
2
3
  import { isOneOf } from './is-one-of.js';
3
4
  /**
4
5
  * `panel` (the default) is one bordered panel on the surface; `plain`
@@ -10,8 +11,7 @@ export const listGroupVariants = ['panel', 'plain'];
10
11
  export const listRowTones = ['default', 'danger'];
11
12
  /** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
12
13
  export const listRowTitleAppearances = ['strong', 'plain'];
13
- /** The colours a row's value can take, as a table cell's. */
14
- export const listRowValueTones = tableCellTones;
14
+ export { listRowValueTones };
15
15
  function isBlank(text) {
16
16
  return typeof text !== 'string' || text.trim() === '';
17
17
  }
@@ -39,9 +39,10 @@ export function listMaxHeightStyle(maxHeight) {
39
39
  }
40
40
  /**
41
41
  * Fails closed on a ListRow it cannot draw: an empty title or value, an
42
- * unknown tone, title appearance, value tone or accessory, a `valueDetail`
43
- * or `valueTone` with no value, or `selected` on a row that is not a
44
- * button or link (its check would be a state nothing can read).
42
+ * unknown tone, title appearance, value tone, badge tone or accessory, a
43
+ * `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
44
+ * toned and a badge, or `selected` on a row that is not a button or link
45
+ * (its check would be a state nothing can read).
45
46
  */
46
47
  export function assertListRow(input) {
47
48
  if (isBlank(input.title))
@@ -55,13 +56,19 @@ export function assertListRow(input) {
55
56
  throw new RangeError(`Unknown ListRow valueTone: ${String(input.valueTone)}`);
56
57
  if (!isOneOf(['chevron', 'none'], input.accessory))
57
58
  throw new RangeError(`Unknown ListRow accessory: ${String(input.accessory)}`);
59
+ if (input.valueBadge !== undefined && !isOneOf(badgeTones, input.valueBadge))
60
+ throw new RangeError(`Unknown ListRow valueBadge: ${String(input.valueBadge)}`);
61
+ if (input.valueBadge !== undefined && input.valueTone !== undefined)
62
+ throw new RangeError('A ListRow value is a toned figure or a badge, not both');
58
63
  if (input.value !== undefined && isBlank(input.value))
59
64
  throw new RangeError('ListRow value must be non-empty text');
60
65
  if (input.selected !== undefined && !input.pressable)
61
66
  throw new RangeError('A ListRow choice (selected) needs onPress or href to say its state');
62
67
  if (input.value === undefined &&
63
- (input.valueDetail !== undefined || input.valueTone !== undefined))
64
- throw new RangeError('ListRow valueDetail and valueTone need a value');
68
+ (input.valueDetail !== undefined ||
69
+ input.valueTone !== undefined ||
70
+ input.valueBadge !== undefined))
71
+ throw new RangeError('ListRow valueDetail, valueTone and valueBadge need a value');
65
72
  }
66
73
  /**
67
74
  * The row's end: a check while `selected`, nothing for an unchosen choice,