@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,98 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const caption = typographyVariants.caption;
3
+ const data = typographyVariants.data;
4
+ export function cssChartClasses() {
5
+ return `.sw-bar-chart {
6
+ display: grid;
7
+ gap: var(--sw-space-2);
8
+ }
9
+
10
+ .sw-bar-chart-plot {
11
+ display: grid;
12
+ gap: var(--sw-space-2);
13
+ list-style: none;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ .sw-bar-chart-row,
19
+ .sw-bar-chart-axis {
20
+ align-items: center;
21
+ display: grid;
22
+ gap: var(--sw-space-3);
23
+ grid-template-columns: minmax(0, 2fr) minmax(0, 5fr) minmax(var(--sw-space-8), max-content);
24
+ }
25
+
26
+ .sw-bar-chart-label {
27
+ color: var(--sw-color-muted);
28
+ font-family: var(--sw-font-sans);
29
+ font-size: ${caption.fontSize}px;
30
+ font-weight: 400;
31
+ letter-spacing: ${caption.letterSpacing}px;
32
+ line-height: ${caption.lineHeight}px;
33
+ min-width: 0;
34
+ overflow: hidden;
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ }
38
+
39
+ .sw-bar-chart-track {
40
+ background: var(--sw-glass-fill);
41
+ border: 1px solid var(--sw-color-border);
42
+ border-radius: var(--sw-radius-pill);
43
+ height: var(--sw-space-3);
44
+ min-width: 0;
45
+ overflow: hidden;
46
+ }
47
+
48
+ .sw-bar-chart-fill {
49
+ background: var(--sw-color-accent);
50
+ border-radius: inherit;
51
+ display: block;
52
+ height: 100%;
53
+ width: calc(var(--sw-bar-fill, 0) * 100%);
54
+ }
55
+
56
+ .sw-bar-chart-fill-negative {
57
+ background: var(--sw-color-danger);
58
+ }
59
+
60
+ .sw-bar-chart-value {
61
+ color: var(--sw-color-text);
62
+ font-family: var(--sw-font-sans);
63
+ font-size: ${data.fontSize}px;
64
+ font-variant-numeric: tabular-nums;
65
+ font-weight: ${data.fontWeight};
66
+ letter-spacing: ${data.letterSpacing}px;
67
+ line-height: ${data.lineHeight}px;
68
+ text-align: end;
69
+ }
70
+
71
+ .sw-bar-chart-axis {
72
+ color: var(--sw-color-muted);
73
+ font-family: var(--sw-font-sans);
74
+ font-size: ${caption.fontSize}px;
75
+ font-weight: 400;
76
+ letter-spacing: ${caption.letterSpacing}px;
77
+ line-height: ${caption.lineHeight}px;
78
+ }
79
+
80
+ .sw-bar-chart-axis-track {
81
+ display: flex;
82
+ justify-content: space-between;
83
+ }`;
84
+ }
85
+ export function chartClassCatalog() {
86
+ return [
87
+ 'sw-bar-chart',
88
+ 'sw-bar-chart-plot',
89
+ 'sw-bar-chart-row',
90
+ 'sw-bar-chart-axis',
91
+ 'sw-bar-chart-label',
92
+ 'sw-bar-chart-track',
93
+ 'sw-bar-chart-fill',
94
+ 'sw-bar-chart-fill-negative',
95
+ 'sw-bar-chart-value',
96
+ 'sw-bar-chart-axis-track',
97
+ ];
98
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssCheckboxClasses(): string;
2
+ export declare function checkboxClassCatalog(): string[];
@@ -0,0 +1,127 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const label = typographyVariants.label;
3
+ const caption = typographyVariants.caption;
4
+ export function cssCheckboxClasses() {
5
+ return `.sw-checkbox {
6
+ display: flex;
7
+ flex-direction: column;
8
+ gap: var(--sw-space-1);
9
+ max-width: 100%;
10
+ }
11
+
12
+ .sw-checkbox-label {
13
+ align-items: center;
14
+ cursor: pointer;
15
+ display: inline-flex;
16
+ gap: var(--sw-space-2);
17
+ max-width: 100%;
18
+ min-height: var(--sw-control-md-min-height);
19
+ width: max-content;
20
+ }
21
+
22
+ .sw-checkbox-control {
23
+ align-items: center;
24
+ display: inline-flex;
25
+ flex: 0 0 var(--sw-space-5);
26
+ height: var(--sw-space-5);
27
+ position: relative;
28
+ }
29
+
30
+ .sw-checkbox-input {
31
+ cursor: inherit;
32
+ height: 100%;
33
+ inset: 0;
34
+ margin: 0;
35
+ opacity: 0;
36
+ position: absolute;
37
+ width: 100%;
38
+ }
39
+
40
+ .sw-checkbox-mark {
41
+ background: var(--sw-glass-fill);
42
+ border: 1px solid var(--sw-color-border);
43
+ border-radius: var(--sw-radius-sm);
44
+ box-sizing: border-box;
45
+ height: var(--sw-space-5);
46
+ pointer-events: none;
47
+ position: relative;
48
+ width: var(--sw-space-5);
49
+ }
50
+
51
+ .sw-checkbox-mark::after {
52
+ border-bottom: 2px solid var(--sw-color-surface);
53
+ border-right: 2px solid var(--sw-color-surface);
54
+ content: '';
55
+ display: none;
56
+ height: var(--sw-space-2);
57
+ inset-block-start: var(--sw-space-1);
58
+ inset-inline-start: var(--sw-space-2);
59
+ position: absolute;
60
+ transform: rotate(45deg);
61
+ width: var(--sw-space-1);
62
+ }
63
+
64
+ .sw-checkbox-input:checked + .sw-checkbox-mark {
65
+ background: var(--sw-color-accent);
66
+ border-color: var(--sw-color-accent);
67
+ }
68
+
69
+ .sw-checkbox-input:checked + .sw-checkbox-mark::after { display: block; }
70
+
71
+ .sw-checkbox-input:focus-visible + .sw-checkbox-mark {
72
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
73
+ outline-offset: var(--sw-focus-ring-offset);
74
+ }
75
+
76
+ .sw-checkbox-input[aria-invalid='true'] + .sw-checkbox-mark {
77
+ border-color: var(--sw-color-danger);
78
+ }
79
+
80
+ .sw-checkbox-label:has(.sw-checkbox-input:disabled) {
81
+ cursor: not-allowed;
82
+ opacity: var(--sw-disabled-opacity);
83
+ }
84
+
85
+ .sw-checkbox-text {
86
+ color: var(--sw-color-text);
87
+ font-family: var(--sw-font-sans);
88
+ font-size: ${label.fontSize}px;
89
+ font-weight: ${label.fontWeight};
90
+ line-height: ${label.lineHeight}px;
91
+ min-width: 0;
92
+ }
93
+
94
+ .sw-checkbox-description,
95
+ .sw-checkbox-error {
96
+ font-family: var(--sw-font-sans);
97
+ font-size: ${caption.fontSize}px;
98
+ line-height: ${caption.lineHeight}px;
99
+ }
100
+
101
+ .sw-checkbox-description { color: var(--sw-color-muted); }
102
+ .sw-checkbox-error { color: var(--sw-color-danger); }
103
+
104
+ @media (prefers-reduced-transparency: reduce) {
105
+ .sw-checkbox-mark { background: var(--sw-color-surface); }
106
+ .sw-checkbox-input:checked + .sw-checkbox-mark { background: var(--sw-color-accent); }
107
+ }
108
+
109
+ @media (forced-colors: active) {
110
+ .sw-checkbox-mark { background: Canvas; border-color: CanvasText; }
111
+ .sw-checkbox-input:checked + .sw-checkbox-mark { background: Highlight; border-color: Highlight; }
112
+ .sw-checkbox-input:checked + .sw-checkbox-mark::after { border-color: HighlightText; }
113
+ .sw-checkbox-input[aria-invalid='true'] + .sw-checkbox-mark { border-color: CanvasText; }
114
+ }`;
115
+ }
116
+ export function checkboxClassCatalog() {
117
+ return [
118
+ 'sw-checkbox',
119
+ 'sw-checkbox-label',
120
+ 'sw-checkbox-control',
121
+ 'sw-checkbox-input',
122
+ 'sw-checkbox-mark',
123
+ 'sw-checkbox-text',
124
+ 'sw-checkbox-description',
125
+ 'sw-checkbox-error',
126
+ ];
127
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssChromeClasses(): string;
2
+ export declare function chromeClassCatalog(): string[];
@@ -0,0 +1,59 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const caption = typographyVariants.caption;
3
+ const label = typographyVariants.label;
4
+ export function cssChromeClasses() {
5
+ return `.sw-app-header {
6
+ background: var(--sw-glass-fill);
7
+ border: 1px solid var(--sw-glass-border);
8
+ border-radius: var(--sw-radius-lg);
9
+ box-shadow: inset 0 1px 0 var(--sw-glass-specular);
10
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
11
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
12
+ }
13
+
14
+ .sw-app-header-sticky {
15
+ position: sticky;
16
+ top: 0;
17
+ z-index: 2;
18
+ }
19
+
20
+ .sw-nav {
21
+ align-items: center;
22
+ display: inline-flex;
23
+ flex-wrap: wrap;
24
+ gap: var(--sw-space-3);
25
+ }
26
+
27
+ .sw-nav a {
28
+ font-size: ${label.fontSize}px;
29
+ font-weight: ${label.fontWeight};
30
+ letter-spacing: ${label.letterSpacing}px;
31
+ line-height: ${label.lineHeight}px;
32
+ }
33
+
34
+ .sw-nav a[aria-current='page'] {
35
+ color: var(--sw-color-text);
36
+ }
37
+
38
+ .sw-field-xs :is(select, input, textarea) {
39
+ font-size: ${caption.fontSize}px;
40
+ letter-spacing: ${caption.letterSpacing}px;
41
+ line-height: ${caption.lineHeight}px;
42
+ min-height: var(--sw-control-xs-min-height);
43
+ padding-inline: var(--sw-control-xs-padding-inline);
44
+ }
45
+
46
+ .sw-field-xs select {
47
+ background-position:
48
+ calc(100% - var(--sw-space-3)) calc(50% - 1px),
49
+ calc(100% - calc(var(--sw-space-3) - var(--sw-space-1))) calc(50% - 1px);
50
+ height: calc(var(--sw-control-xs-min-height) - 1px - 1px);
51
+ min-height: 0;
52
+ padding-inline-end: calc(
53
+ var(--sw-control-xs-padding-inline) + var(--sw-space-5)
54
+ );
55
+ }`;
56
+ }
57
+ export function chromeClassCatalog() {
58
+ return ['sw-app-header', 'sw-app-header-sticky', 'sw-nav', 'sw-field-xs'];
59
+ }
@@ -0,0 +1 @@
1
+ export declare function cssComponentClasses(): string;
@@ -0,0 +1,148 @@
1
+ import { compactTypographyVariants, typographyVariants, } from '@scalewing/tokens';
2
+ import { breakpointQuery } from './breakpoints.js';
3
+ import { cssActionMenuClasses } from './css-action-menu.js';
4
+ import { cssAccordionClasses } from './css-accordion.js';
5
+ import { cssButtonClasses } from './css-button.js';
6
+ import { cssChartClasses } from './css-chart.js';
7
+ import { cssCheckboxClasses } from './css-checkbox.js';
8
+ import { cssRadioGroupClasses } from './css-radio-group.js';
9
+ import { cssChromeClasses } from './css-chrome.js';
10
+ import { cssDataClasses } from './css-data.js';
11
+ import { cssDateFieldClasses } from './css-date-field.js';
12
+ import { cssDialogClasses } from './css-dialog.js';
13
+ import { cssSelectClasses } from './css-select.js';
14
+ import { cssSplitClasses } from './css-split.js';
15
+ import { cssSwitchClasses } from './css-switch.js';
16
+ import { cssSpinnerClasses } from './css-spinner.js';
17
+ import { cssProgressClasses } from './css-progress.js';
18
+ import { cssTooltipClasses } from './css-tooltip.js';
19
+ import { cssSeparatorClasses } from './css-separator.js';
20
+ import { cssResponsiveClasses } from './css-responsive.js';
21
+ import { cssFilterChipsClasses } from './css-filter-chips.js';
22
+ import { cssGridClasses } from './css-grid.js';
23
+ import { cssDenominationGridClasses } from './css-denomination-grid.js';
24
+ import { cssFieldClasses } from './css-field.js';
25
+ import { cssToastClasses } from './css-toast.js';
26
+ function textVariantRules() {
27
+ return Object.entries(typographyVariants)
28
+ .map(([name, variant]) => {
29
+ const tabular = 'tabularNums' in variant && variant.tabularNums
30
+ ? ' font-variant-numeric: tabular-nums;'
31
+ : '';
32
+ return `.sw-text-${name} { font-family: var(--sw-font-sans); font-size: ${variant.fontSize}px; line-height: ${variant.lineHeight}px; font-weight: ${variant.fontWeight}; letter-spacing: ${variant.letterSpacing}px;${tabular} }`;
33
+ })
34
+ .join('\n');
35
+ }
36
+ function compactTextVariantRules() {
37
+ const rules = Object.entries(compactTypographyVariants)
38
+ .map(([name, variant]) => ` .sw-text-${name} { font-size: ${variant.fontSize}px; line-height: ${variant.lineHeight}px; letter-spacing: ${variant.letterSpacing}px; }`)
39
+ .join('\n');
40
+ return `@media ${breakpointQuery('below', 'md')} {\n${rules}\n}`;
41
+ }
42
+ export function cssComponentClasses() {
43
+ return `.sw-card {
44
+ border-radius: var(--sw-radius-lg);
45
+ color: var(--sw-color-text);
46
+ }
47
+
48
+ .sw-card-glass {
49
+ background: var(--sw-glass-fill);
50
+ border: 1px solid var(--sw-glass-border);
51
+ box-shadow: inset 0 1px 0 var(--sw-glass-specular);
52
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
53
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
54
+ }
55
+
56
+ .sw-card-outlined {
57
+ background: var(--sw-color-surface);
58
+ border: 1px solid var(--sw-color-border);
59
+ }
60
+
61
+ .sw-card-elevated {
62
+ background: var(--sw-color-surface);
63
+ border-color: transparent;
64
+ box-shadow: var(--sw-elevation-sm);
65
+ }
66
+
67
+ @media (prefers-reduced-transparency: reduce) {
68
+ .sw-card-glass,
69
+ .sw-app-header,
70
+ .sw-button-secondary,
71
+ .sw-badge-neutral,
72
+ .sw-segmented,
73
+ .sw-table-sticky thead th,
74
+ .sw-bar-chart-track,
75
+ .sw-dialog,
76
+ .sw-accordion,
77
+ .sw-select-list,
78
+ .sw-action-menu-list,
79
+ .sw-toast {
80
+ background: var(--sw-color-surface);
81
+ backdrop-filter: none;
82
+ -webkit-backdrop-filter: none;
83
+ }
84
+ }
85
+
86
+ .sw-text-align-start { text-align: start; }
87
+ .sw-text-align-center { text-align: center; }
88
+ .sw-text-align-end { text-align: end; }
89
+
90
+ .sw-truncate {
91
+ overflow: hidden;
92
+ text-overflow: ellipsis;
93
+ white-space: nowrap;
94
+ }
95
+
96
+ .sw-tabular {
97
+ font-variant-numeric: tabular-nums;
98
+ }
99
+
100
+ ${textVariantRules()}
101
+
102
+ ${compactTextVariantRules()}
103
+
104
+ ${cssButtonClasses()}
105
+
106
+ ${cssCheckboxClasses()}
107
+
108
+ ${cssRadioGroupClasses()}
109
+
110
+ ${cssDataClasses()}
111
+
112
+ ${cssDateFieldClasses()}
113
+
114
+ ${cssChartClasses()}
115
+
116
+ ${cssChromeClasses()}
117
+
118
+ ${cssDialogClasses()}
119
+
120
+ ${cssAccordionClasses()}
121
+
122
+ ${cssSelectClasses()}
123
+
124
+ ${cssActionMenuClasses()}
125
+
126
+ ${cssSwitchClasses()}
127
+
128
+ ${cssSpinnerClasses()}
129
+
130
+ ${cssProgressClasses()}
131
+
132
+ ${cssTooltipClasses()}
133
+
134
+ ${cssSeparatorClasses()}
135
+
136
+ ${cssFilterChipsClasses()}
137
+
138
+ ${cssGridClasses()}
139
+ ${cssDenominationGridClasses()}
140
+
141
+ ${cssFieldClasses()}
142
+
143
+ ${cssSplitClasses()}
144
+
145
+ ${cssToastClasses()}
146
+
147
+ ${cssResponsiveClasses()}`;
148
+ }
@@ -0,0 +1,7 @@
1
+ export declare const badgeTones: readonly ["neutral", "accent", "success", "danger"];
2
+ export type BadgeTone = (typeof badgeTones)[number];
3
+ export declare const badgeSizes: readonly ["sm", "md"];
4
+ export type BadgeSize = (typeof badgeSizes)[number];
5
+ export declare function badgeClassNames(tone: BadgeTone, size?: BadgeSize): string[];
6
+ export declare function cssDataClasses(): string;
7
+ export declare function dataClassCatalog(): string[];
@@ -0,0 +1,189 @@
1
+ import { trackInset, typographyVariants } from '@scalewing/tokens';
2
+ export const badgeTones = ['neutral', 'accent', 'success', 'danger'];
3
+ export const badgeSizes = ['sm', 'md'];
4
+ const caption = typographyVariants.caption;
5
+ const data = typographyVariants.data;
6
+ export function badgeClassNames(tone, size = 'md') {
7
+ return ['sw-badge', `sw-badge-${tone}`, `sw-badge-${size}`];
8
+ }
9
+ export function cssDataClasses() {
10
+ return `.sw-badge {
11
+ align-items: center;
12
+ border: 1px solid transparent;
13
+ border-radius: var(--sw-radius-pill);
14
+ box-sizing: border-box;
15
+ display: inline-flex;
16
+ font-family: var(--sw-font-sans);
17
+ font-size: ${caption.fontSize}px;
18
+ font-weight: 600;
19
+ letter-spacing: ${caption.letterSpacing}px;
20
+ line-height: ${caption.lineHeight}px;
21
+ }
22
+
23
+ .sw-badge-md {
24
+ min-height: var(--sw-control-xs-min-height);
25
+ padding-inline: var(--sw-control-xs-padding-inline);
26
+ }
27
+
28
+ .sw-badge-sm {
29
+ padding-inline: var(--sw-space-2);
30
+ }
31
+
32
+ .sw-badge-neutral {
33
+ background: var(--sw-glass-fill);
34
+ border-color: var(--sw-color-border);
35
+ color: var(--sw-color-text);
36
+ }
37
+
38
+ .sw-badge-accent {
39
+ background: transparent;
40
+ border-color: var(--sw-color-accent);
41
+ color: var(--sw-color-accent);
42
+ }
43
+
44
+ .sw-badge-success {
45
+ background: transparent;
46
+ border-color: var(--sw-color-success);
47
+ color: var(--sw-color-success);
48
+ }
49
+
50
+ .sw-badge-danger {
51
+ background: transparent;
52
+ border-color: var(--sw-color-danger);
53
+ color: var(--sw-color-danger);
54
+ }
55
+
56
+ .sw-segmented {
57
+ background: var(--sw-glass-fill);
58
+ border: 1px solid var(--sw-glass-border);
59
+ border-radius: var(--sw-radius-pill);
60
+ box-sizing: border-box;
61
+ display: inline-flex;
62
+ gap: ${trackInset}px;
63
+ padding: ${trackInset}px;
64
+ }
65
+
66
+ .sw-segmented-item {
67
+ appearance: none;
68
+ background: transparent;
69
+ border: 0;
70
+ border-radius: var(--sw-radius-pill);
71
+ color: var(--sw-color-muted);
72
+ cursor: pointer;
73
+ font-family: var(--sw-font-sans);
74
+ font-size: ${data.fontSize}px;
75
+ font-weight: 600;
76
+ letter-spacing: ${data.letterSpacing}px;
77
+ line-height: ${data.lineHeight}px;
78
+ min-height: var(--sw-control-xs-min-height);
79
+ padding-inline: var(--sw-control-xs-padding-inline);
80
+ }
81
+
82
+ .sw-segmented-item:focus-visible {
83
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
84
+ outline-offset: var(--sw-focus-ring-offset);
85
+ }
86
+
87
+ .sw-segmented-item-selected {
88
+ background: var(--sw-color-surface);
89
+ color: var(--sw-color-text);
90
+ }
91
+
92
+ .sw-table-wrap {
93
+ overflow: auto;
94
+ width: 100%;
95
+ }
96
+
97
+ .sw-table {
98
+ border-collapse: collapse;
99
+ width: 100%;
100
+ }
101
+
102
+ .sw-table th,
103
+ .sw-table td {
104
+ border-bottom: 1px solid var(--sw-color-border);
105
+ padding: var(--sw-space-2) var(--sw-space-3);
106
+ text-align: start;
107
+ vertical-align: middle;
108
+ }
109
+
110
+ .sw-table th {
111
+ color: var(--sw-color-muted);
112
+ font-family: var(--sw-font-sans);
113
+ font-size: ${caption.fontSize}px;
114
+ font-weight: 600;
115
+ letter-spacing: ${caption.letterSpacing}px;
116
+ line-height: ${caption.lineHeight}px;
117
+ }
118
+
119
+ .sw-table-end {
120
+ text-align: end;
121
+ }
122
+
123
+ .sw-table-numeric {
124
+ font-variant-numeric: tabular-nums;
125
+ text-align: end;
126
+ }
127
+
128
+ .sw-table-clip {
129
+ max-width: 0;
130
+ overflow: hidden;
131
+ }
132
+
133
+ .sw-table-sticky thead th {
134
+ background: var(--sw-glass-fill);
135
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
136
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
137
+ position: sticky;
138
+ top: 0;
139
+ z-index: 1;
140
+ }
141
+
142
+ .sw-table-compact th,
143
+ .sw-table-compact td {
144
+ padding: var(--sw-space-1) var(--sw-space-2);
145
+ }
146
+
147
+ .sw-table-row-selected > :first-child {
148
+ padding-inline-start: var(--sw-space-5);
149
+ position: relative;
150
+ }
151
+
152
+ .sw-table-compact .sw-table-row-selected > :first-child {
153
+ padding-inline-start: var(--sw-space-4);
154
+ }
155
+
156
+ .sw-table-row-selected > :first-child::before {
157
+ background: var(--sw-color-accent);
158
+ border-radius: var(--sw-radius-pill);
159
+ content: '';
160
+ height: var(--sw-space-2);
161
+ inset-block-start: 50%;
162
+ inset-inline-start: var(--sw-space-2);
163
+ position: absolute;
164
+ transform: translateY(-50%);
165
+ width: var(--sw-space-2);
166
+ }
167
+
168
+ .sw-table-compact .sw-table-row-selected > :first-child::before {
169
+ inset-inline-start: var(--sw-space-1);
170
+ }`;
171
+ }
172
+ export function dataClassCatalog() {
173
+ return [
174
+ 'sw-badge',
175
+ ...badgeTones.map((tone) => `sw-badge-${tone}`),
176
+ ...badgeSizes.map((size) => `sw-badge-${size}`),
177
+ 'sw-segmented',
178
+ 'sw-segmented-item',
179
+ 'sw-segmented-item-selected',
180
+ 'sw-table-wrap',
181
+ 'sw-table',
182
+ 'sw-table-end',
183
+ 'sw-table-numeric',
184
+ 'sw-table-clip',
185
+ 'sw-table-sticky',
186
+ 'sw-table-compact',
187
+ 'sw-table-row-selected',
188
+ ];
189
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssDateFieldClasses(): string;
2
+ export declare function dateFieldClassCatalog(): string[];