@scalewing/react 0.7.0 → 1.1.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 (96) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +12 -2
  3. package/dist/components/Badge.d.ts +2 -1
  4. package/dist/components/Badge.js +2 -1
  5. package/dist/components/Box.d.ts +3 -2
  6. package/dist/components/Box.js +3 -2
  7. package/dist/components/Button.js +1 -1
  8. package/dist/components/DenominationGrid.d.ts +3 -0
  9. package/dist/components/DenominationGrid.js +12 -0
  10. package/dist/components/FilterChips.d.ts +1 -0
  11. package/dist/components/FilterChips.js +9 -3
  12. package/dist/components/Grid.d.ts +11 -0
  13. package/dist/components/Grid.js +21 -0
  14. package/dist/components/Inline.js +1 -1
  15. package/dist/components/Stack.js +1 -1
  16. package/dist/components/Text.d.ts +3 -0
  17. package/dist/components/Text.js +2 -2
  18. package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -0
  19. package/dist/components/denomination-grid/DenominationStrip.js +10 -0
  20. package/dist/components/denomination-grid/DenominationTiles.d.ts +4 -0
  21. package/dist/components/denomination-grid/DenominationTiles.js +13 -0
  22. package/dist/components/denomination-grid/types.d.ts +25 -0
  23. package/dist/components/denomination-grid/types.js +1 -0
  24. package/dist/components/denomination-grid/validate.d.ts +2 -0
  25. package/dist/components/denomination-grid/validate.js +18 -0
  26. package/dist/css/breakpoints.d.ts +8 -0
  27. package/dist/css/breakpoints.js +11 -0
  28. package/dist/css/css-accordion.d.ts +2 -0
  29. package/dist/css/css-accordion.js +33 -0
  30. package/dist/css/css-action-menu.d.ts +2 -0
  31. package/dist/css/css-action-menu.js +95 -0
  32. package/dist/css/css-button.d.ts +7 -0
  33. package/dist/css/css-button.js +68 -0
  34. package/dist/css/css-chart.d.ts +2 -0
  35. package/dist/css/css-chart.js +98 -0
  36. package/dist/css/css-checkbox.d.ts +2 -0
  37. package/dist/css/css-checkbox.js +127 -0
  38. package/dist/css/css-chrome.d.ts +2 -0
  39. package/dist/css/css-chrome.js +59 -0
  40. package/dist/css/css-components.d.ts +1 -0
  41. package/dist/css/css-components.js +148 -0
  42. package/dist/css/css-data.d.ts +7 -0
  43. package/dist/css/css-data.js +189 -0
  44. package/dist/css/css-date-field.d.ts +2 -0
  45. package/dist/css/css-date-field.js +77 -0
  46. package/dist/css/css-denomination-grid.d.ts +2 -0
  47. package/dist/css/css-denomination-grid.js +213 -0
  48. package/dist/css/css-dialog.d.ts +2 -0
  49. package/dist/css/css-dialog.js +29 -0
  50. package/dist/css/css-document.d.ts +1 -0
  51. package/dist/css/css-document.js +102 -0
  52. package/dist/css/css-field.d.ts +2 -0
  53. package/dist/css/css-field.js +33 -0
  54. package/dist/css/css-filter-chips.d.ts +2 -0
  55. package/dist/css/css-filter-chips.js +116 -0
  56. package/dist/css/css-grid.d.ts +7 -0
  57. package/dist/css/css-grid.js +31 -0
  58. package/dist/css/css-palettes.d.ts +4 -0
  59. package/dist/css/css-palettes.js +52 -0
  60. package/dist/css/css-progress.d.ts +2 -0
  61. package/dist/css/css-progress.js +77 -0
  62. package/dist/css/css-radio-group.d.ts +2 -0
  63. package/dist/css/css-radio-group.js +148 -0
  64. package/dist/css/css-responsive.d.ts +2 -0
  65. package/dist/css/css-responsive.js +12 -0
  66. package/dist/css/css-select.d.ts +2 -0
  67. package/dist/css/css-select.js +134 -0
  68. package/dist/css/css-separator.d.ts +2 -0
  69. package/dist/css/css-separator.js +26 -0
  70. package/dist/css/css-spinner.d.ts +2 -0
  71. package/dist/css/css-spinner.js +45 -0
  72. package/dist/css/css-split.d.ts +2 -0
  73. package/dist/css/css-split.js +67 -0
  74. package/dist/css/css-switch.d.ts +2 -0
  75. package/dist/css/css-switch.js +115 -0
  76. package/dist/css/css-toast.d.ts +2 -0
  77. package/dist/css/css-toast.js +92 -0
  78. package/dist/css/css-tooltip.d.ts +2 -0
  79. package/dist/css/css-tooltip.js +35 -0
  80. package/dist/css/css-utilities.d.ts +1 -0
  81. package/dist/css/css-utilities.js +57 -0
  82. package/dist/css/css-variables.d.ts +2 -0
  83. package/dist/css/css-variables.js +61 -0
  84. package/dist/css/spacing-classes.d.ts +10 -0
  85. package/dist/css/spacing-classes.js +40 -0
  86. package/dist/css/stylesheet.d.ts +3 -0
  87. package/dist/css/stylesheet.js +82 -0
  88. package/dist/denomination-cells.d.ts +12 -0
  89. package/dist/denomination-cells.js +15 -0
  90. package/dist/index.d.ts +8 -2
  91. package/dist/index.js +5 -2
  92. package/dist/spacing-classes.js +1 -1
  93. package/dist/styles.css +231 -0
  94. package/dist/visibility-classes.d.ts +6 -0
  95. package/dist/visibility-classes.js +7 -0
  96. package/package.json +3 -3
@@ -0,0 +1,92 @@
1
+ export function cssToastClasses() {
2
+ return `.sw-toast {
3
+ background: var(--sw-glass-fill);
4
+ border: 1px solid var(--sw-glass-border);
5
+ border-radius: var(--sw-radius-lg);
6
+ box-shadow: inset 0 1px 0 var(--sw-glass-specular);
7
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
8
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
9
+ box-sizing: border-box;
10
+ color: var(--sw-color-text);
11
+ inset: unset;
12
+ bottom: var(--sw-space-6);
13
+ left: 50%;
14
+ margin: 0;
15
+ overflow: visible;
16
+ pointer-events: none;
17
+ position: fixed;
18
+ translate: -50% 0;
19
+ width: max-content;
20
+ }
21
+
22
+ .sw-toast:popover-open {
23
+ animation: sw-toast-float var(--sw-motion-default) var(--sw-motion-easing);
24
+ }
25
+
26
+ .sw-toast-travel {
27
+ bottom: auto;
28
+ left: 0;
29
+ top: 0;
30
+ translate: var(--sw-toast-from-x) var(--sw-toast-from-y);
31
+ }
32
+
33
+ .sw-toast-travel:popover-open {
34
+ animation: sw-toast-travel var(--sw-motion-travel)
35
+ var(--sw-motion-travel-easing) forwards;
36
+ }
37
+
38
+ @keyframes sw-toast-float {
39
+ from {
40
+ opacity: 0;
41
+ translate: -50% var(--sw-space-3);
42
+ }
43
+ to {
44
+ opacity: 1;
45
+ translate: -50% 0;
46
+ }
47
+ }
48
+
49
+ @keyframes sw-toast-travel {
50
+ 0% {
51
+ opacity: 1;
52
+ scale: 0.6;
53
+ translate: var(--sw-toast-from-x) var(--sw-toast-from-y);
54
+ }
55
+ 16% {
56
+ opacity: 1;
57
+ scale: 1.2;
58
+ translate: var(--sw-toast-from-x) var(--sw-toast-from-y);
59
+ }
60
+ 42% {
61
+ opacity: 1;
62
+ scale: 1;
63
+ translate: var(--sw-toast-to-x) var(--sw-toast-to-y);
64
+ }
65
+ 78% {
66
+ opacity: 1;
67
+ scale: 1;
68
+ translate: var(--sw-toast-to-x) var(--sw-toast-to-y);
69
+ }
70
+ 100% {
71
+ opacity: 0;
72
+ scale: 0.94;
73
+ translate: var(--sw-toast-to-x) var(--sw-toast-to-y);
74
+ }
75
+ }
76
+
77
+ @media (prefers-reduced-motion: reduce) {
78
+ .sw-toast:popover-open,
79
+ .sw-toast-travel:popover-open {
80
+ animation: none;
81
+ }
82
+
83
+ .sw-toast-travel:popover-open {
84
+ opacity: 1;
85
+ scale: 1;
86
+ translate: var(--sw-toast-to-x) var(--sw-toast-to-y);
87
+ }
88
+ }`;
89
+ }
90
+ export function toastClassCatalog() {
91
+ return ['sw-toast', 'sw-toast-travel'];
92
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssTooltipClasses(): string;
2
+ export declare function tooltipClassCatalog(): string[];
@@ -0,0 +1,35 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const caption = typographyVariants.caption;
3
+ export function cssTooltipClasses() {
4
+ return `.sw-tooltip-anchor {
5
+ display: inline-flex;
6
+ position: relative;
7
+ }
8
+
9
+ .sw-tooltip {
10
+ background: var(--sw-color-surface);
11
+ border: 1px solid var(--sw-color-border);
12
+ border-radius: var(--sw-radius-sm);
13
+ box-shadow: var(--sw-elevation-sm);
14
+ color: var(--sw-color-text);
15
+ font-family: var(--sw-font-sans);
16
+ font-size: ${caption.fontSize}px;
17
+ line-height: ${caption.lineHeight}px;
18
+ inset-block-start: calc(100% + var(--sw-space-1));
19
+ inset-inline-start: 0;
20
+ max-width: min(18rem, calc(100vw - 2 * var(--sw-space-3)));
21
+ padding: var(--sw-space-2);
22
+ position: absolute;
23
+ width: max-content;
24
+ z-index: 10;
25
+ }
26
+
27
+ .sw-tooltip[hidden] { display: none; }
28
+
29
+ @media (forced-colors: active) {
30
+ .sw-tooltip { border-color: CanvasText; box-shadow: none; }
31
+ }`;
32
+ }
33
+ export function tooltipClassCatalog() {
34
+ return ['sw-tooltip-anchor', 'sw-tooltip'];
35
+ }
@@ -0,0 +1 @@
1
+ export declare function cssUtilities(): string;
@@ -0,0 +1,57 @@
1
+ import { spacingSteps } from '@scalewing/tokens';
2
+ import { gapAxes, layoutClassNames, paddingAxes, spacingClass, } from './spacing-classes.js';
3
+ function paddingRule(axis, step) {
4
+ const className = spacingClass('padding', axis, step);
5
+ const value = `var(--sw-space-${step})`;
6
+ switch (axis) {
7
+ case 'all':
8
+ return `.${className} { padding: ${value}; }`;
9
+ case 'x':
10
+ return `.${className} { padding-inline: ${value}; }`;
11
+ case 'y':
12
+ return `.${className} { padding-block: ${value}; }`;
13
+ case 'top':
14
+ return `.${className} { padding-top: ${value}; }`;
15
+ case 'right':
16
+ return `.${className} { padding-right: ${value}; }`;
17
+ case 'bottom':
18
+ return `.${className} { padding-bottom: ${value}; }`;
19
+ case 'left':
20
+ return `.${className} { padding-left: ${value}; }`;
21
+ }
22
+ }
23
+ function gapRule(axis, step) {
24
+ const className = spacingClass('gap', axis, step);
25
+ const value = `var(--sw-space-${step})`;
26
+ switch (axis) {
27
+ case 'all':
28
+ return `.${className} { gap: ${value}; }`;
29
+ case 'x':
30
+ return `.${className} { column-gap: ${value}; }`;
31
+ case 'y':
32
+ return `.${className} { row-gap: ${value}; }`;
33
+ }
34
+ }
35
+ const layoutRules = {
36
+ 'sw-stack': '.sw-stack { display: flex; flex-direction: column; min-width: 0; }',
37
+ 'sw-inline': '.sw-inline { display: flex; flex-direction: row; align-items: center; min-width: 0; }',
38
+ 'sw-wrap': '.sw-wrap { flex-wrap: wrap; }',
39
+ 'sw-grow': '.sw-grow { flex-grow: 1; }',
40
+ 'sw-full-width': '.sw-full-width { width: 100%; }',
41
+ 'sw-container': '.sw-container { width: 100%; max-width: var(--sw-container-max); margin-inline: auto; }',
42
+ 'sw-sr-only': '.sw-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }',
43
+ 'sw-align-start': '.sw-align-start { align-items: flex-start; }',
44
+ 'sw-align-center': '.sw-align-center { align-items: center; }',
45
+ 'sw-align-end': '.sw-align-end { align-items: flex-end; }',
46
+ 'sw-align-stretch': '.sw-align-stretch { align-items: stretch; }',
47
+ 'sw-justify-start': '.sw-justify-start { justify-content: flex-start; }',
48
+ 'sw-justify-center': '.sw-justify-center { justify-content: center; }',
49
+ 'sw-justify-end': '.sw-justify-end { justify-content: flex-end; }',
50
+ 'sw-justify-between': '.sw-justify-between { justify-content: space-between; }',
51
+ };
52
+ export function cssUtilities() {
53
+ const padding = paddingAxes.flatMap((axis) => spacingSteps.map((step) => paddingRule(axis, step)));
54
+ const gap = gapAxes.flatMap((axis) => spacingSteps.map((step) => gapRule(axis, step)));
55
+ const layout = layoutClassNames.map((name) => layoutRules[name]);
56
+ return [...padding, ...gap, ...layout].join('\n');
57
+ }
@@ -0,0 +1,2 @@
1
+ import { type Theme } from '@scalewing/tokens';
2
+ export declare function cssVariables(light: Theme, dark: Theme): string;
@@ -0,0 +1,61 @@
1
+ import { controlScale, disabledOpacity, focusRing, quietOpacity, radiusScale, semanticColorKeys, spacingScale, spacingSteps, splitScale, } from '@scalewing/tokens';
2
+ function colorDeclarations(theme) {
3
+ return semanticColorKeys
4
+ .map((key) => ` --sw-color-${key}: ${theme.colors[key]};`)
5
+ .join('\n');
6
+ }
7
+ function glassDeclarations(theme) {
8
+ return ` --sw-glass-blur: ${theme.glass.blur}px;
9
+ --sw-glass-saturate: ${theme.glass.saturate};
10
+ --sw-glass-fill: ${theme.glass.fill};
11
+ --sw-glass-border: ${theme.glass.border};
12
+ --sw-glass-specular: ${theme.glass.specular};`;
13
+ }
14
+ function sharedDeclarations(theme) {
15
+ const space = spacingSteps
16
+ .map((step) => ` --sw-space-${step}: ${spacingScale[step]}px;`)
17
+ .join('\n');
18
+ const radius = Object.entries(radiusScale)
19
+ .map(([name, value]) => ` --sw-radius-${name}: ${value}px;`)
20
+ .join('\n');
21
+ const control = Object.entries(controlScale)
22
+ .flatMap(([size, value]) => [
23
+ ` --sw-control-${size}-min-height: ${value.minHeight}px;`,
24
+ ` --sw-control-${size}-padding-inline: ${value.paddingInline}px;`,
25
+ ])
26
+ .join('\n');
27
+ return `${space}
28
+ ${radius}
29
+ ${control}
30
+ --sw-font-sans: ${theme.fontFamily};
31
+ --sw-elevation-sm: ${theme.elevation.sm};
32
+ --sw-elevation-md: ${theme.elevation.md};
33
+ --sw-disabled-opacity: ${disabledOpacity};
34
+ --sw-quiet-opacity: ${quietOpacity};
35
+ --sw-focus-ring-width: ${focusRing.width}px;
36
+ --sw-focus-ring-offset: ${focusRing.offset}px;
37
+ --sw-container-max: 72rem;
38
+ --sw-dialog-max: 32rem;
39
+ --sw-select-max: 16rem;
40
+ --sw-split-min: ${splitScale.min}rem;
41
+ --sw-split-size: ${splitScale.size}rem;
42
+ --sw-split-max: ${splitScale.max}rem;
43
+ --sw-motion-fast: ${theme.motion.duration.fast};
44
+ --sw-motion-default: ${theme.motion.duration.default};
45
+ --sw-motion-travel: ${theme.motion.duration.travel};
46
+ --sw-motion-easing: ${theme.motion.easing.standard};
47
+ --sw-motion-travel-easing: ${theme.motion.easing.travel};
48
+ ${glassDeclarations(theme)}`;
49
+ }
50
+ export function cssVariables(light, dark) {
51
+ return `:root,
52
+ [data-theme='light'] {
53
+ ${colorDeclarations(light)}
54
+ ${sharedDeclarations(light)}
55
+ }
56
+
57
+ [data-theme='dark'] {
58
+ ${colorDeclarations(dark)}
59
+ ${sharedDeclarations(dark)}
60
+ }`;
61
+ }
@@ -0,0 +1,10 @@
1
+ import { type SpacingStep } from '@scalewing/tokens';
2
+ export declare const paddingAxes: readonly ["all", "x", "y", "top", "right", "bottom", "left"];
3
+ export type PaddingAxis = (typeof paddingAxes)[number];
4
+ export declare const gapAxes: readonly ["all", "x", "y"];
5
+ export type GapAxis = (typeof gapAxes)[number];
6
+ export type SpacingKind = 'padding' | 'gap';
7
+ export declare function spacingClass(kind: SpacingKind, axis: PaddingAxis | GapAxis, step: SpacingStep): string;
8
+ export declare function paddingClassNames(): string[];
9
+ export declare function gapClassNames(): string[];
10
+ export declare const layoutClassNames: readonly ["sw-stack", "sw-inline", "sw-wrap", "sw-grow", "sw-full-width", "sw-container", "sw-sr-only", "sw-align-start", "sw-align-center", "sw-align-end", "sw-align-stretch", "sw-justify-start", "sw-justify-center", "sw-justify-end", "sw-justify-between"];
@@ -0,0 +1,40 @@
1
+ import { spacingSteps } from '@scalewing/tokens';
2
+ export const paddingAxes = [
3
+ 'all',
4
+ 'x',
5
+ 'y',
6
+ 'top',
7
+ 'right',
8
+ 'bottom',
9
+ 'left',
10
+ ];
11
+ export const gapAxes = ['all', 'x', 'y'];
12
+ export function spacingClass(kind, axis, step) {
13
+ if (axis === 'all') {
14
+ return `sw-${kind}-${step}`;
15
+ }
16
+ return `sw-${kind}-${axis}-${step}`;
17
+ }
18
+ export function paddingClassNames() {
19
+ return paddingAxes.flatMap((axis) => spacingSteps.map((step) => spacingClass('padding', axis, step)));
20
+ }
21
+ export function gapClassNames() {
22
+ return gapAxes.flatMap((axis) => spacingSteps.map((step) => spacingClass('gap', axis, step)));
23
+ }
24
+ export const layoutClassNames = [
25
+ 'sw-stack',
26
+ 'sw-inline',
27
+ 'sw-wrap',
28
+ 'sw-grow',
29
+ 'sw-full-width',
30
+ 'sw-container',
31
+ 'sw-sr-only',
32
+ 'sw-align-start',
33
+ 'sw-align-center',
34
+ 'sw-align-end',
35
+ 'sw-align-stretch',
36
+ 'sw-justify-start',
37
+ 'sw-justify-center',
38
+ 'sw-justify-end',
39
+ 'sw-justify-between',
40
+ ];
@@ -0,0 +1,3 @@
1
+ export declare function utilityClassCatalog(): string[];
2
+ export { generatePaletteStylesheet, paletteStylesheetIds, } from './css-palettes.js';
3
+ export declare function generateStylesheet(): string;
@@ -0,0 +1,82 @@
1
+ import { cardVariants, darkTheme, lightTheme, typographyVariants, } from '@scalewing/tokens';
2
+ import { actionMenuClassCatalog } from './css-action-menu.js';
3
+ import { accordionClassCatalog } from './css-accordion.js';
4
+ import { switchClassCatalog } from './css-switch.js';
5
+ import { dateFieldClassCatalog } from './css-date-field.js';
6
+ import { checkboxClassCatalog } from './css-checkbox.js';
7
+ import { radioGroupClassCatalog } from './css-radio-group.js';
8
+ import { spinnerClassCatalog } from './css-spinner.js';
9
+ import { progressClassCatalog } from './css-progress.js';
10
+ import { tooltipClassCatalog } from './css-tooltip.js';
11
+ import { separatorClassCatalog } from './css-separator.js';
12
+ import { responsiveClassCatalog } from './css-responsive.js';
13
+ import { filterChipsClassCatalog } from './css-filter-chips.js';
14
+ import { gridClassCatalog } from './css-grid.js';
15
+ import { denominationGridClassCatalog } from './css-denomination-grid.js';
16
+ import { fieldClassCatalog } from './css-field.js';
17
+ import { cssComponentClasses } from './css-components.js';
18
+ import { buttonClassCatalog } from './css-button.js';
19
+ import { chartClassCatalog } from './css-chart.js';
20
+ import { dataClassCatalog } from './css-data.js';
21
+ import { chromeClassCatalog } from './css-chrome.js';
22
+ import { dialogClassCatalog } from './css-dialog.js';
23
+ import { selectClassCatalog } from './css-select.js';
24
+ import { splitClassCatalog } from './css-split.js';
25
+ import { toastClassCatalog } from './css-toast.js';
26
+ import { cssDocumentCanvas } from './css-document.js';
27
+ import { cssPaletteAttributes } from './css-palettes.js';
28
+ import { cssUtilities } from './css-utilities.js';
29
+ import { cssVariables } from './css-variables.js';
30
+ import { gapClassNames, layoutClassNames, paddingClassNames, } from './spacing-classes.js';
31
+ export function utilityClassCatalog() {
32
+ return [
33
+ ...paddingClassNames(),
34
+ ...gapClassNames(),
35
+ ...layoutClassNames,
36
+ 'sw-card',
37
+ ...cardVariants.map((variant) => `sw-card-${variant}`),
38
+ 'sw-truncate',
39
+ 'sw-text-align-start',
40
+ 'sw-text-align-center',
41
+ 'sw-text-align-end',
42
+ 'sw-tabular',
43
+ ...Object.keys(typographyVariants).map((name) => `sw-text-${name}`),
44
+ ...buttonClassCatalog(),
45
+ ...dataClassCatalog(),
46
+ ...chartClassCatalog(),
47
+ ...chromeClassCatalog(),
48
+ ...dialogClassCatalog(),
49
+ ...accordionClassCatalog(),
50
+ ...selectClassCatalog(),
51
+ ...actionMenuClassCatalog(),
52
+ ...switchClassCatalog(),
53
+ ...dateFieldClassCatalog(),
54
+ ...checkboxClassCatalog(),
55
+ ...radioGroupClassCatalog(),
56
+ ...spinnerClassCatalog(),
57
+ ...progressClassCatalog(),
58
+ ...tooltipClassCatalog(),
59
+ ...separatorClassCatalog(),
60
+ ...filterChipsClassCatalog(),
61
+ ...gridClassCatalog(),
62
+ ...denominationGridClassCatalog(),
63
+ ...fieldClassCatalog(),
64
+ ...splitClassCatalog(),
65
+ ...toastClassCatalog(),
66
+ ...responsiveClassCatalog(),
67
+ ];
68
+ }
69
+ export { generatePaletteStylesheet, paletteStylesheetIds, } from './css-palettes.js';
70
+ export function generateStylesheet() {
71
+ return `/* Generated by @scalewing/tokens. Do not edit by hand. */
72
+ ${cssVariables(lightTheme, darkTheme)}
73
+
74
+ ${cssPaletteAttributes()}
75
+
76
+ ${cssDocumentCanvas()}
77
+
78
+ ${cssUtilities()}
79
+
80
+ ${cssComponentClasses()}
81
+ `;
82
+ }
@@ -0,0 +1,12 @@
1
+ export type DenominationCellState = 'zero' | 'positive' | 'negative';
2
+ export type DenominationCellView = {
3
+ state: DenominationCellState;
4
+ text: string;
5
+ };
6
+ /**
7
+ * Classifies one count for display. A null or zero count renders the zero
8
+ * label; a signed row prefixes positive counts with "+" so movement reads as
9
+ * a delta. Formatting stays plain digits: the consumer owns locale grouping.
10
+ */
11
+ export declare function denominationCellView(count: number | null, signed: boolean, zeroLabel: string): DenominationCellView;
12
+ export declare function isDenominationCount(count: number | null): boolean;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Classifies one count for display. A null or zero count renders the zero
3
+ * label; a signed row prefixes positive counts with "+" so movement reads as
4
+ * a delta. Formatting stays plain digits: the consumer owns locale grouping.
5
+ */
6
+ export function denominationCellView(count, signed, zeroLabel) {
7
+ if (count === null || count === 0)
8
+ return { state: 'zero', text: zeroLabel };
9
+ if (count < 0)
10
+ return { state: 'negative', text: String(count) };
11
+ return { state: 'positive', text: signed ? `+${count}` : String(count) };
12
+ }
13
+ export function isDenominationCount(count) {
14
+ return count === null || Number.isInteger(count);
15
+ }
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export { Progress, type ProgressProps, type ProgressTone, } from './components/P
9
9
  export { Tooltip, type TooltipProps } from './components/Tooltip.js';
10
10
  export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
11
11
  export { AppHeader, type AppHeaderProps } from './components/AppHeader.js';
12
- export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, } from './components/Badge.js';
12
+ export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeSizes, badgeTones, } from './components/Badge.js';
13
13
  export { BarChart, type BarChartItem, type BarChartProps, } from './components/BarChart.js';
14
14
  export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, } from './components/Button.js';
15
15
  export { Box, type BoxElement, type BoxProps } from './components/Box.js';
@@ -28,9 +28,15 @@ export { Select } from './components/Select.js';
28
28
  export type { SelectAction, SelectOption, SelectProps, } from './components/Select.js';
29
29
  export { Stack, type Align, type Justify, type StackProps, } from './components/Stack.js';
30
30
  export { Table, TableBody, TableCell, TableHeader, TableRow, type TableBodyProps, type TableCellProps, type TableDensity, type TableHeaderProps, type TableProps, type TableRowProps, } from './components/Table.js';
31
- export { Text, type TextElement, type TextProps } from './components/Text.js';
31
+ export { Text, type TextAlign, type TextElement, type TextProps, } from './components/Text.js';
32
32
  export { ThemeProvider, useTheme, type ThemeProviderProps, } from './theme/ThemeProvider.js';
33
+ export { utilityClassCatalog } from './css/stylesheet.js';
34
+ export type { VisibilityProps } from './visibility-classes.js';
33
35
  export { Separator } from './components/Separator.js';
34
36
  export type { SeparatorOrientation, SeparatorProps, } from './components/Separator.js';
37
+ export { Grid } from './components/Grid.js';
38
+ export type { GridColumns, GridProps } from './components/Grid.js';
39
+ export { DenominationGrid } from './components/DenominationGrid.js';
40
+ export type { DenominationGridColumn, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridTone, } from './components/DenominationGrid.js';
35
41
  export { FilterChips } from './components/FilterChips.js';
36
42
  export type { FilterChipOption, FilterChipsProps, } from './components/FilterChips.js';
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ export { Progress, } from './components/Progress.js';
8
8
  export { Tooltip } from './components/Tooltip.js';
9
9
  export { RadioGroup, } from './components/RadioGroup.js';
10
10
  export { AppHeader } from './components/AppHeader.js';
11
- export { Badge, } from './components/Badge.js';
11
+ export { Badge, badgeSizes, badgeTones, } from './components/Badge.js';
12
12
  export { BarChart, } from './components/BarChart.js';
13
13
  export { Button, } from './components/Button.js';
14
14
  export { Box } from './components/Box.js';
@@ -23,7 +23,10 @@ export { SegmentedControl, } from './components/SegmentedControl.js';
23
23
  export { Select } from './components/Select.js';
24
24
  export { Stack, } from './components/Stack.js';
25
25
  export { Table, TableBody, TableCell, TableHeader, TableRow, } from './components/Table.js';
26
- export { Text } from './components/Text.js';
26
+ export { Text, } from './components/Text.js';
27
27
  export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
28
+ export { utilityClassCatalog } from './css/stylesheet.js';
28
29
  export { Separator } from './components/Separator.js';
30
+ export { Grid } from './components/Grid.js';
31
+ export { DenominationGrid } from './components/DenominationGrid.js';
29
32
  export { FilterChips } from './components/FilterChips.js';
@@ -1,4 +1,4 @@
1
- import { spacingClass, } from '@scalewing/tokens';
1
+ import { spacingClass } from './css/spacing-classes.js';
2
2
  const paddingPropToAxis = {
3
3
  padding: 'all',
4
4
  paddingX: 'x',