@scalewing/react 0.7.0 → 1.0.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 (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  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/Inline.js +1 -1
  9. package/dist/components/Stack.js +1 -1
  10. package/dist/css/breakpoints.d.ts +8 -0
  11. package/dist/css/breakpoints.js +11 -0
  12. package/dist/css/css-accordion.d.ts +2 -0
  13. package/dist/css/css-accordion.js +33 -0
  14. package/dist/css/css-action-menu.d.ts +2 -0
  15. package/dist/css/css-action-menu.js +95 -0
  16. package/dist/css/css-button.d.ts +7 -0
  17. package/dist/css/css-button.js +68 -0
  18. package/dist/css/css-chart.d.ts +2 -0
  19. package/dist/css/css-chart.js +98 -0
  20. package/dist/css/css-checkbox.d.ts +2 -0
  21. package/dist/css/css-checkbox.js +127 -0
  22. package/dist/css/css-chrome.d.ts +2 -0
  23. package/dist/css/css-chrome.js +59 -0
  24. package/dist/css/css-components.d.ts +1 -0
  25. package/dist/css/css-components.js +130 -0
  26. package/dist/css/css-data.d.ts +7 -0
  27. package/dist/css/css-data.js +189 -0
  28. package/dist/css/css-date-field.d.ts +2 -0
  29. package/dist/css/css-date-field.js +77 -0
  30. package/dist/css/css-dialog.d.ts +2 -0
  31. package/dist/css/css-dialog.js +29 -0
  32. package/dist/css/css-document.d.ts +1 -0
  33. package/dist/css/css-document.js +102 -0
  34. package/dist/css/css-field.d.ts +2 -0
  35. package/dist/css/css-field.js +33 -0
  36. package/dist/css/css-filter-chips.d.ts +2 -0
  37. package/dist/css/css-filter-chips.js +92 -0
  38. package/dist/css/css-palettes.d.ts +4 -0
  39. package/dist/css/css-palettes.js +52 -0
  40. package/dist/css/css-progress.d.ts +2 -0
  41. package/dist/css/css-progress.js +77 -0
  42. package/dist/css/css-radio-group.d.ts +2 -0
  43. package/dist/css/css-radio-group.js +148 -0
  44. package/dist/css/css-responsive.d.ts +2 -0
  45. package/dist/css/css-responsive.js +12 -0
  46. package/dist/css/css-select.d.ts +2 -0
  47. package/dist/css/css-select.js +134 -0
  48. package/dist/css/css-separator.d.ts +2 -0
  49. package/dist/css/css-separator.js +26 -0
  50. package/dist/css/css-spinner.d.ts +2 -0
  51. package/dist/css/css-spinner.js +45 -0
  52. package/dist/css/css-split.d.ts +2 -0
  53. package/dist/css/css-split.js +67 -0
  54. package/dist/css/css-switch.d.ts +2 -0
  55. package/dist/css/css-switch.js +115 -0
  56. package/dist/css/css-toast.d.ts +2 -0
  57. package/dist/css/css-toast.js +92 -0
  58. package/dist/css/css-tooltip.d.ts +2 -0
  59. package/dist/css/css-tooltip.js +35 -0
  60. package/dist/css/css-utilities.d.ts +1 -0
  61. package/dist/css/css-utilities.js +57 -0
  62. package/dist/css/css-variables.d.ts +2 -0
  63. package/dist/css/css-variables.js +61 -0
  64. package/dist/css/spacing-classes.d.ts +10 -0
  65. package/dist/css/spacing-classes.js +40 -0
  66. package/dist/css/stylesheet.d.ts +3 -0
  67. package/dist/css/stylesheet.js +75 -0
  68. package/dist/index.d.ts +3 -1
  69. package/dist/index.js +2 -1
  70. package/dist/spacing-classes.js +1 -1
  71. package/dist/styles.css +8 -0
  72. package/dist/visibility-classes.d.ts +6 -0
  73. package/dist/visibility-classes.js +7 -0
  74. package/package.json +3 -3
@@ -0,0 +1,130 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ import { cssActionMenuClasses } from './css-action-menu.js';
3
+ import { cssAccordionClasses } from './css-accordion.js';
4
+ import { cssButtonClasses } from './css-button.js';
5
+ import { cssChartClasses } from './css-chart.js';
6
+ import { cssCheckboxClasses } from './css-checkbox.js';
7
+ import { cssRadioGroupClasses } from './css-radio-group.js';
8
+ import { cssChromeClasses } from './css-chrome.js';
9
+ import { cssDataClasses } from './css-data.js';
10
+ import { cssDateFieldClasses } from './css-date-field.js';
11
+ import { cssDialogClasses } from './css-dialog.js';
12
+ import { cssSelectClasses } from './css-select.js';
13
+ import { cssSplitClasses } from './css-split.js';
14
+ import { cssSwitchClasses } from './css-switch.js';
15
+ import { cssSpinnerClasses } from './css-spinner.js';
16
+ import { cssProgressClasses } from './css-progress.js';
17
+ import { cssTooltipClasses } from './css-tooltip.js';
18
+ import { cssSeparatorClasses } from './css-separator.js';
19
+ import { cssResponsiveClasses } from './css-responsive.js';
20
+ import { cssFilterChipsClasses } from './css-filter-chips.js';
21
+ import { cssFieldClasses } from './css-field.js';
22
+ import { cssToastClasses } from './css-toast.js';
23
+ function textVariantRules() {
24
+ return Object.entries(typographyVariants)
25
+ .map(([name, variant]) => {
26
+ const tabular = 'tabularNums' in variant && variant.tabularNums
27
+ ? ' font-variant-numeric: tabular-nums;'
28
+ : '';
29
+ 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} }`;
30
+ })
31
+ .join('\n');
32
+ }
33
+ export function cssComponentClasses() {
34
+ return `.sw-card {
35
+ border-radius: var(--sw-radius-lg);
36
+ color: var(--sw-color-text);
37
+ }
38
+
39
+ .sw-card-glass {
40
+ background: var(--sw-glass-fill);
41
+ border: 1px solid var(--sw-glass-border);
42
+ box-shadow: inset 0 1px 0 var(--sw-glass-specular);
43
+ backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
44
+ -webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
45
+ }
46
+
47
+ .sw-card-outlined {
48
+ background: var(--sw-color-surface);
49
+ border: 1px solid var(--sw-color-border);
50
+ }
51
+
52
+ .sw-card-elevated {
53
+ background: var(--sw-color-surface);
54
+ border-color: transparent;
55
+ box-shadow: var(--sw-elevation-sm);
56
+ }
57
+
58
+ @media (prefers-reduced-transparency: reduce) {
59
+ .sw-card-glass,
60
+ .sw-app-header,
61
+ .sw-button-secondary,
62
+ .sw-badge-neutral,
63
+ .sw-segmented,
64
+ .sw-table-sticky thead th,
65
+ .sw-bar-chart-track,
66
+ .sw-dialog,
67
+ .sw-accordion,
68
+ .sw-select-list,
69
+ .sw-action-menu-list,
70
+ .sw-toast {
71
+ background: var(--sw-color-surface);
72
+ backdrop-filter: none;
73
+ -webkit-backdrop-filter: none;
74
+ }
75
+ }
76
+
77
+ .sw-truncate {
78
+ overflow: hidden;
79
+ text-overflow: ellipsis;
80
+ white-space: nowrap;
81
+ }
82
+
83
+ .sw-tabular {
84
+ font-variant-numeric: tabular-nums;
85
+ }
86
+
87
+ ${textVariantRules()}
88
+
89
+ ${cssButtonClasses()}
90
+
91
+ ${cssCheckboxClasses()}
92
+
93
+ ${cssRadioGroupClasses()}
94
+
95
+ ${cssDataClasses()}
96
+
97
+ ${cssDateFieldClasses()}
98
+
99
+ ${cssChartClasses()}
100
+
101
+ ${cssChromeClasses()}
102
+
103
+ ${cssDialogClasses()}
104
+
105
+ ${cssAccordionClasses()}
106
+
107
+ ${cssSelectClasses()}
108
+
109
+ ${cssActionMenuClasses()}
110
+
111
+ ${cssSwitchClasses()}
112
+
113
+ ${cssSpinnerClasses()}
114
+
115
+ ${cssProgressClasses()}
116
+
117
+ ${cssTooltipClasses()}
118
+
119
+ ${cssSeparatorClasses()}
120
+
121
+ ${cssFilterChipsClasses()}
122
+
123
+ ${cssFieldClasses()}
124
+
125
+ ${cssSplitClasses()}
126
+
127
+ ${cssToastClasses()}
128
+
129
+ ${cssResponsiveClasses()}`;
130
+ }
@@ -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[];
@@ -0,0 +1,77 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const body = typographyVariants.body;
3
+ const label = typographyVariants.label;
4
+ const caption = typographyVariants.caption;
5
+ export function cssDateFieldClasses() {
6
+ return `.sw-date-field {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: var(--sw-space-1);
10
+ max-width: 100%;
11
+ min-width: 0;
12
+ width: max-content;
13
+ }
14
+
15
+ .sw-date-field-label {
16
+ color: var(--sw-color-text);
17
+ font-family: var(--sw-font-sans);
18
+ font-size: ${label.fontSize}px;
19
+ font-weight: ${label.fontWeight};
20
+ line-height: ${label.lineHeight}px;
21
+ }
22
+
23
+ .sw-date-field-input {
24
+ background: var(--sw-glass-fill);
25
+ border: 1px solid var(--sw-color-border);
26
+ border-radius: var(--sw-radius-sm);
27
+ box-sizing: border-box;
28
+ color: var(--sw-color-text);
29
+ font-family: var(--sw-font-sans);
30
+ font-size: ${body.fontSize}px;
31
+ min-height: var(--sw-control-md-min-height);
32
+ min-width: 0;
33
+ padding-inline: var(--sw-control-md-padding-inline);
34
+ width: 100%;
35
+ }
36
+
37
+ .sw-date-field-input:focus-visible {
38
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
39
+ outline-offset: var(--sw-focus-ring-offset);
40
+ }
41
+
42
+ .sw-date-field-input[aria-invalid='true'] {
43
+ border-color: var(--sw-color-danger);
44
+ }
45
+
46
+ .sw-date-field-input:disabled {
47
+ cursor: not-allowed;
48
+ opacity: var(--sw-disabled-opacity);
49
+ }
50
+
51
+ .sw-date-field-description,
52
+ .sw-date-field-error {
53
+ font-family: var(--sw-font-sans);
54
+ font-size: ${caption.fontSize}px;
55
+ line-height: ${caption.lineHeight}px;
56
+ }
57
+
58
+ .sw-date-field-description { color: var(--sw-color-muted); }
59
+ .sw-date-field-error { color: var(--sw-color-danger); }
60
+
61
+ @media (prefers-reduced-transparency: reduce) {
62
+ .sw-date-field-input { background: var(--sw-color-surface); }
63
+ }
64
+
65
+ @media (forced-colors: active) {
66
+ .sw-date-field-input[aria-invalid='true'] { border-color: CanvasText; }
67
+ }`;
68
+ }
69
+ export function dateFieldClassCatalog() {
70
+ return [
71
+ 'sw-date-field',
72
+ 'sw-date-field-label',
73
+ 'sw-date-field-input',
74
+ 'sw-date-field-description',
75
+ 'sw-date-field-error',
76
+ ];
77
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssDialogClasses(): string;
2
+ export declare function dialogClassCatalog(): string[];
@@ -0,0 +1,29 @@
1
+ export function cssDialogClasses() {
2
+ return `.sw-dialog {
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
+ margin: auto;
12
+ max-height: min(100vh - var(--sw-space-8), 100dvh - var(--sw-space-8));
13
+ max-width: min(var(--sw-dialog-max), calc(100vw - var(--sw-space-8)));
14
+ overflow: auto;
15
+ width: calc(100% - var(--sw-space-8));
16
+ }
17
+
18
+ .sw-dialog::backdrop {
19
+ background: color-mix(in srgb, var(--sw-color-text) 28%, transparent);
20
+ }
21
+
22
+ .sw-dialog:focus-visible {
23
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
24
+ outline-offset: var(--sw-focus-ring-offset);
25
+ }`;
26
+ }
27
+ export function dialogClassCatalog() {
28
+ return ['sw-dialog'];
29
+ }
@@ -0,0 +1 @@
1
+ export declare function cssDocumentCanvas(): string;
@@ -0,0 +1,102 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const body = typographyVariants.body;
3
+ const typedInputs = [
4
+ "input[type='text']",
5
+ "input[type='email']",
6
+ "input[type='number']",
7
+ "input[type='search']",
8
+ "input[type='url']",
9
+ "input[type='password']",
10
+ 'input:not([type])',
11
+ 'textarea',
12
+ ].join(', ');
13
+ const controlSurface = `background-color: var(--sw-glass-fill);
14
+ border: 1px solid var(--sw-color-border);
15
+ border-radius: var(--sw-radius-sm);
16
+ color: inherit;
17
+ font-family: inherit;
18
+ font-size: inherit;
19
+ padding-inline: var(--sw-control-md-padding-inline);`;
20
+ export function cssDocumentCanvas() {
21
+ return `html,
22
+ body {
23
+ margin: 0;
24
+ }
25
+
26
+ [data-theme] {
27
+ background-color: var(--sw-color-background);
28
+ color: var(--sw-color-text);
29
+ font-family: var(--sw-font-sans);
30
+ font-size: ${body.fontSize}px;
31
+ letter-spacing: ${body.letterSpacing}px;
32
+ line-height: ${body.lineHeight}px;
33
+ min-height: 100vh;
34
+ min-height: 100dvh;
35
+ -webkit-font-smoothing: antialiased;
36
+ -moz-osx-font-smoothing: grayscale;
37
+ }
38
+
39
+ [data-theme] [data-theme] {
40
+ min-height: 0;
41
+ }
42
+
43
+ [data-theme='light'] {
44
+ color-scheme: light;
45
+ }
46
+
47
+ [data-theme='dark'] {
48
+ color-scheme: dark;
49
+ }
50
+
51
+ [data-theme] a {
52
+ color: var(--sw-color-accent);
53
+ text-decoration: none;
54
+ }
55
+
56
+ [data-theme] a:hover {
57
+ color: var(--sw-color-text);
58
+ }
59
+
60
+ [data-theme] a:focus-visible {
61
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
62
+ outline-offset: var(--sw-focus-ring-offset);
63
+ }
64
+
65
+ [data-theme] :is(${typedInputs}) {
66
+ ${controlSurface}
67
+ box-sizing: border-box;
68
+ min-height: var(--sw-control-md-min-height);
69
+ }
70
+
71
+ [data-theme] select {
72
+ ${controlSurface}
73
+ appearance: none;
74
+ background-image:
75
+ linear-gradient(45deg, transparent 50%, var(--sw-color-muted) 50%),
76
+ linear-gradient(135deg, var(--sw-color-muted) 50%, transparent 50%);
77
+ background-position:
78
+ calc(100% - var(--sw-space-4)) calc(50% - 1px),
79
+ calc(100% - calc(var(--sw-space-4) - var(--sw-space-1))) calc(50% - 1px);
80
+ background-repeat: no-repeat;
81
+ background-size: var(--sw-space-1) var(--sw-space-1),
82
+ var(--sw-space-1) var(--sw-space-1);
83
+ box-sizing: content-box;
84
+ height: calc(var(--sw-control-md-min-height) - 1px - 1px);
85
+ min-height: 0;
86
+ padding-inline-end: calc(
87
+ var(--sw-control-md-padding-inline) + var(--sw-space-5)
88
+ );
89
+ }
90
+
91
+ [data-theme] :is(${typedInputs}):focus,
92
+ [data-theme] select:focus {
93
+ box-shadow: none;
94
+ outline: none;
95
+ }
96
+
97
+ [data-theme] :is(${typedInputs}):focus-visible,
98
+ [data-theme] select:focus-visible {
99
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
100
+ outline-offset: var(--sw-focus-ring-offset);
101
+ }`;
102
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssFieldClasses(): string;
2
+ export declare function fieldClassCatalog(): string[];
@@ -0,0 +1,33 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const caption = typographyVariants.caption;
3
+ export function cssFieldClasses() {
4
+ return `.sw-field-required { color: var(--sw-color-danger); }
5
+
6
+ .sw-field-description,
7
+ .sw-field-error {
8
+ font-family: var(--sw-font-sans);
9
+ font-size: ${caption.fontSize}px;
10
+ line-height: ${caption.lineHeight}px;
11
+ }
12
+
13
+ .sw-field-description { color: var(--sw-color-muted); }
14
+ .sw-field-error { color: var(--sw-color-danger); }
15
+
16
+ [data-theme] .sw-field-invalid :is(input, select, textarea) {
17
+ border-color: var(--sw-color-danger);
18
+ }
19
+
20
+ @media (forced-colors: active) {
21
+ [data-theme] .sw-field-invalid :is(input, select, textarea) { border-color: Mark; }
22
+ .sw-field-error, .sw-field-required { color: Mark; }
23
+ }`;
24
+ }
25
+ export function fieldClassCatalog() {
26
+ return [
27
+ 'sw-field',
28
+ 'sw-field-required',
29
+ 'sw-field-description',
30
+ 'sw-field-error',
31
+ 'sw-field-invalid',
32
+ ];
33
+ }
@@ -0,0 +1,2 @@
1
+ export declare function cssFilterChipsClasses(): string;
2
+ export declare function filterChipsClassCatalog(): string[];
@@ -0,0 +1,92 @@
1
+ import { typographyVariants } from '@scalewing/tokens';
2
+ const label = typographyVariants.label;
3
+ export function cssFilterChipsClasses() {
4
+ return `.sw-filter-chips {
5
+ border: 0;
6
+ margin: 0;
7
+ max-width: 100%;
8
+ min-width: 0;
9
+ padding: 0;
10
+ }
11
+
12
+ .sw-filter-chips-legend {
13
+ color: var(--sw-color-text);
14
+ font-family: var(--sw-font-sans);
15
+ font-size: ${label.fontSize}px;
16
+ font-weight: ${label.fontWeight};
17
+ line-height: ${label.lineHeight}px;
18
+ padding: 0 0 var(--sw-space-2);
19
+ }
20
+
21
+ .sw-filter-chips-options {
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ gap: var(--sw-space-2);
25
+ min-width: 0;
26
+ }
27
+
28
+ .sw-filter-chip {
29
+ cursor: pointer;
30
+ display: inline-flex;
31
+ max-width: 100%;
32
+ position: relative;
33
+ }
34
+
35
+ .sw-filter-chip-input {
36
+ cursor: inherit;
37
+ height: 100%;
38
+ inset: 0;
39
+ margin: 0;
40
+ opacity: 0;
41
+ position: absolute;
42
+ width: 100%;
43
+ }
44
+
45
+ .sw-filter-chip-face {
46
+ align-items: center;
47
+ background: var(--sw-glass-fill);
48
+ border: 1px solid var(--sw-color-border);
49
+ border-radius: var(--sw-radius-pill);
50
+ color: var(--sw-color-text);
51
+ display: inline-flex;
52
+ font-family: var(--sw-font-sans);
53
+ font-size: ${label.fontSize}px;
54
+ line-height: ${label.lineHeight}px;
55
+ min-height: var(--sw-control-md-min-height);
56
+ min-width: 0;
57
+ overflow-wrap: anywhere;
58
+ padding: var(--sw-space-1) var(--sw-space-3);
59
+ }
60
+
61
+ .sw-filter-chip-input:checked + .sw-filter-chip-face {
62
+ background: var(--sw-color-accent);
63
+ border-color: var(--sw-color-accent);
64
+ color: var(--sw-color-onAccent);
65
+ }
66
+
67
+ .sw-filter-chip-input:focus-visible + .sw-filter-chip-face {
68
+ outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
69
+ outline-offset: var(--sw-focus-ring-offset);
70
+ }
71
+
72
+ .sw-filter-chip:has(.sw-filter-chip-input:disabled) {
73
+ cursor: not-allowed;
74
+ opacity: var(--sw-disabled-opacity);
75
+ }
76
+
77
+ @media (forced-colors: active) {
78
+ .sw-filter-chip-face { background: Canvas; border-color: CanvasText; color: CanvasText; }
79
+ .sw-filter-chip-input:checked + .sw-filter-chip-face { background: Highlight; border-color: Highlight; color: HighlightText; }
80
+ .sw-filter-chip-input:focus-visible + .sw-filter-chip-face { outline-color: Highlight; }
81
+ }`;
82
+ }
83
+ export function filterChipsClassCatalog() {
84
+ return [
85
+ 'sw-filter-chips',
86
+ 'sw-filter-chips-legend',
87
+ 'sw-filter-chips-options',
88
+ 'sw-filter-chip',
89
+ 'sw-filter-chip-input',
90
+ 'sw-filter-chip-face',
91
+ ];
92
+ }
@@ -0,0 +1,4 @@
1
+ import { type PaletteId } from '@scalewing/tokens';
2
+ export declare function cssPaletteAttributes(): string;
3
+ export declare function generatePaletteStylesheet(id: PaletteId): string;
4
+ export declare function paletteStylesheetIds(): PaletteId[];