@db-vincent/components 0.0.0-stage → 0.1.1

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 (86) hide show
  1. package/package.json +28 -4
  2. package/src/astro/Accordion.astro +37 -0
  3. package/src/astro/Alert.astro +73 -0
  4. package/src/astro/Avatar.astro +88 -0
  5. package/src/astro/AvatarGroup.astro +63 -0
  6. package/src/astro/Badge.astro +23 -0
  7. package/src/astro/Breadcrumbs.astro +45 -0
  8. package/src/astro/Button.astro +125 -0
  9. package/src/astro/Card.astro +63 -0
  10. package/src/astro/Checkbox.astro +61 -0
  11. package/src/astro/Chip.astro +135 -0
  12. package/src/astro/CodeBlock.astro +17 -0
  13. package/src/astro/Drawer.astro +30 -0
  14. package/src/astro/EmptyState.astro +45 -0
  15. package/src/astro/Example.astro +37 -0
  16. package/src/astro/Grid.astro +56 -0
  17. package/src/astro/GridItem.astro +25 -0
  18. package/src/astro/Icon.astro +52 -0
  19. package/src/astro/Menu.astro +151 -0
  20. package/src/astro/MenuItem.astro +57 -0
  21. package/src/astro/Modal.astro +124 -0
  22. package/src/astro/Navbar.astro +756 -0
  23. package/src/astro/PageHeader.astro +34 -0
  24. package/src/astro/Pagination.astro +212 -0
  25. package/src/astro/Popover.astro +51 -0
  26. package/src/astro/Progress.astro +71 -0
  27. package/src/astro/Radio.astro +58 -0
  28. package/src/astro/RadioGroup.astro +25 -0
  29. package/src/astro/Section.astro +25 -0
  30. package/src/astro/Select.astro +420 -0
  31. package/src/astro/Sidebar.astro +215 -0
  32. package/src/astro/Skeleton.astro +41 -0
  33. package/src/astro/Spinner.astro +20 -0
  34. package/src/astro/Stepper.astro +82 -0
  35. package/src/astro/Switch.astro +78 -0
  36. package/src/astro/Table.astro +268 -0
  37. package/src/astro/Tabs.astro +83 -0
  38. package/src/astro/TextField.astro +305 -0
  39. package/src/astro/ThemeToggle.astro +66 -0
  40. package/src/astro/Toast.astro +181 -0
  41. package/src/astro/Tooltip.astro +54 -0
  42. package/src/astro/TopBar.astro +29 -0
  43. package/src/data/icons.ts +120 -0
  44. package/src/scripts/avatar.ts +33 -0
  45. package/src/scripts/menu.ts +218 -0
  46. package/src/scripts/tabs.ts +127 -0
  47. package/src/scripts/toast.ts +565 -0
  48. package/src/scripts/tooltip.ts +127 -0
  49. package/src/styles/accordion.css +79 -0
  50. package/src/styles/alert.css +108 -0
  51. package/src/styles/avatar.css +131 -0
  52. package/src/styles/badge.css +48 -0
  53. package/src/styles/base.css +205 -0
  54. package/src/styles/breadcrumbs.css +54 -0
  55. package/src/styles/button.css +174 -0
  56. package/src/styles/card.css +112 -0
  57. package/src/styles/chip.css +106 -0
  58. package/src/styles/choice.css +143 -0
  59. package/src/styles/code.css +44 -0
  60. package/src/styles/empty.css +59 -0
  61. package/src/styles/example.css +57 -0
  62. package/src/styles/grid.css +64 -0
  63. package/src/styles/input.css +208 -0
  64. package/src/styles/menu.css +151 -0
  65. package/src/styles/modal.css +285 -0
  66. package/src/styles/motion.css +114 -0
  67. package/src/styles/nav.css +232 -0
  68. package/src/styles/navbar.css +658 -0
  69. package/src/styles/page-header.css +62 -0
  70. package/src/styles/pagination.css +81 -0
  71. package/src/styles/popover.css +134 -0
  72. package/src/styles/progress.css +95 -0
  73. package/src/styles/section.css +38 -0
  74. package/src/styles/select.css +246 -0
  75. package/src/styles/skeleton.css +66 -0
  76. package/src/styles/spinner.css +44 -0
  77. package/src/styles/sr-only.css +14 -0
  78. package/src/styles/stepper.css +169 -0
  79. package/src/styles/switch.css +143 -0
  80. package/src/styles/table.css +177 -0
  81. package/src/styles/tabs.css +120 -0
  82. package/src/styles/theme-toggle.css +31 -0
  83. package/src/styles/toast.css +225 -0
  84. package/src/styles/tooltip.css +63 -0
  85. package/src/styles/topbar.css +32 -0
  86. package/README.md +0 -3
@@ -0,0 +1,169 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-stepper {
5
+ display: grid;
6
+ grid-auto-columns: minmax(0, 1fr);
7
+ grid-auto-flow: column;
8
+ list-style: none;
9
+ margin: 0;
10
+ padding: 0;
11
+ width: 100%;
12
+ }
13
+
14
+ .ds-stepper__item {
15
+ --ds-stepper-marker-bg: var(--stepper-marker-bg-upcoming);
16
+ --ds-stepper-marker-border: var(--stepper-marker-border-upcoming);
17
+ --ds-stepper-marker-fg: var(--stepper-marker-fg-upcoming);
18
+ --ds-stepper-label-fg: var(--stepper-label-fg-upcoming);
19
+ --ds-stepper-description-fg: var(--stepper-description-fg);
20
+ --ds-stepper-connector: var(--stepper-connector-bg);
21
+
22
+ align-content: start;
23
+ display: grid;
24
+ grid-template-columns: auto minmax(0, 1fr);
25
+ }
26
+
27
+ .ds-stepper__item[data-state="current"] {
28
+ --ds-stepper-marker-bg: var(--stepper-marker-bg-current);
29
+ --ds-stepper-marker-border: var(--stepper-marker-border-current);
30
+ --ds-stepper-marker-fg: var(--stepper-marker-fg-current);
31
+ --ds-stepper-label-fg: var(--stepper-label-fg);
32
+ }
33
+
34
+ .ds-stepper__item[data-state="complete"] {
35
+ --ds-stepper-marker-bg: var(--stepper-marker-bg-complete);
36
+ --ds-stepper-marker-border: var(--stepper-marker-border-complete);
37
+ --ds-stepper-marker-fg: var(--stepper-marker-fg-complete);
38
+ --ds-stepper-label-fg: var(--stepper-label-fg);
39
+ --ds-stepper-connector: var(--stepper-connector-bg-complete);
40
+ }
41
+
42
+ .ds-stepper__item[data-state="error"] {
43
+ --ds-stepper-marker-bg: var(--stepper-marker-bg-error);
44
+ --ds-stepper-marker-border: var(--stepper-marker-border-error);
45
+ --ds-stepper-marker-fg: var(--stepper-marker-fg-error);
46
+ --ds-stepper-label-fg: var(--stepper-label-fg-error);
47
+ --ds-stepper-description-fg: var(--stepper-description-fg-error);
48
+ }
49
+
50
+ .ds-stepper__marker {
51
+ align-items: center;
52
+ background: var(--ds-stepper-marker-bg);
53
+ border: var(--stepper-marker-border-width) solid
54
+ var(--ds-stepper-marker-border);
55
+ border-radius: var(--radius-full);
56
+ box-sizing: border-box;
57
+ color: var(--ds-stepper-marker-fg);
58
+ display: inline-flex;
59
+ font-family: var(--stepper-marker-font);
60
+ font-size: var(--stepper-marker-font-size);
61
+ font-variant-numeric: tabular-nums;
62
+ grid-column: 1;
63
+ grid-row: 1;
64
+ height: var(--stepper-marker-size);
65
+ justify-content: center;
66
+ line-height: 1;
67
+ transition:
68
+ background-color var(--stepper-duration) var(--stepper-ease),
69
+ border-color var(--stepper-duration) var(--stepper-ease),
70
+ color var(--stepper-duration) var(--stepper-ease);
71
+ width: var(--stepper-marker-size);
72
+ }
73
+
74
+ .ds-stepper__item::after {
75
+ background: var(--ds-stepper-connector);
76
+ content: "";
77
+ transition: background-color var(--stepper-duration) var(--stepper-ease);
78
+ }
79
+
80
+ .ds-stepper__item:last-child::after {
81
+ display: none;
82
+ }
83
+
84
+ .ds-stepper__body {
85
+ display: grid;
86
+ gap: var(--space-0-5);
87
+ grid-column: 1 / -1;
88
+ grid-row: 2;
89
+ min-width: 0;
90
+ padding-block-start: var(--stepper-gap);
91
+ }
92
+
93
+ .ds-stepper__label {
94
+ color: var(--ds-stepper-label-fg);
95
+ font-size: var(--type-label-size);
96
+ font-weight: var(--type-label-weight);
97
+ letter-spacing: var(--type-label-tracking);
98
+ line-height: var(--type-label-leading);
99
+ overflow-wrap: anywhere;
100
+ transition: color var(--stepper-duration) var(--stepper-ease);
101
+ }
102
+
103
+ .ds-stepper__item[data-state="current"] .ds-stepper__label {
104
+ font-weight: var(--weight-semibold);
105
+ }
106
+
107
+ .ds-stepper__description {
108
+ color: var(--ds-stepper-description-fg);
109
+ font-size: var(--type-caption-size);
110
+ line-height: var(--type-caption-leading);
111
+ overflow-wrap: anywhere;
112
+ transition: color var(--stepper-duration) var(--stepper-ease);
113
+ }
114
+
115
+ /* Horizontal: the connector runs along the marker's row to the next step. */
116
+ .ds-stepper:not(.ds-stepper--vertical) .ds-stepper__item::after {
117
+ align-self: center;
118
+ block-size: var(--stepper-connector-size);
119
+ grid-column: 2;
120
+ grid-row: 1;
121
+ margin-inline: var(--stepper-connector-gap);
122
+ }
123
+
124
+ .ds-stepper:not(.ds-stepper--vertical) .ds-stepper__body {
125
+ padding-inline-end: var(--stepper-connector-gap);
126
+ }
127
+
128
+ .ds-stepper--vertical {
129
+ grid-auto-columns: auto;
130
+ grid-auto-flow: row;
131
+ }
132
+
133
+ .ds-stepper--vertical .ds-stepper__item {
134
+ column-gap: var(--stepper-gap);
135
+ grid-template-rows: auto 1fr;
136
+ }
137
+
138
+ /* Vertical: the body sits beside the marker; the connector drops below it
139
+ and stretches with the body. */
140
+ .ds-stepper--vertical .ds-stepper__body {
141
+ grid-column: 2;
142
+ grid-row: 1 / span 2;
143
+ padding-block-end: var(--stepper-step-gap);
144
+ padding-block-start: calc(
145
+ (var(--stepper-marker-size) - var(--type-label-leading)) / 2
146
+ );
147
+ }
148
+
149
+ .ds-stepper--vertical .ds-stepper__item:last-child .ds-stepper__body {
150
+ padding-block-end: 0;
151
+ }
152
+
153
+ .ds-stepper--vertical .ds-stepper__item::after {
154
+ grid-column: 1;
155
+ grid-row: 2;
156
+ inline-size: var(--stepper-connector-size);
157
+ justify-self: center;
158
+ margin-block: var(--stepper-connector-gap);
159
+ }
160
+
161
+ @media (prefers-reduced-motion: reduce) {
162
+ .ds-stepper__marker,
163
+ .ds-stepper__item::after,
164
+ .ds-stepper__label,
165
+ .ds-stepper__description {
166
+ transition: none;
167
+ }
168
+ }
169
+ }
@@ -0,0 +1,143 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-switch {
5
+ --ds-switch-w: var(--switch-track-width-md);
6
+ --ds-switch-h: var(--switch-track-height-md);
7
+ align-items: flex-start;
8
+ cursor: pointer;
9
+ display: inline-flex;
10
+ gap: var(--switch-gap);
11
+ position: relative;
12
+ }
13
+
14
+ .ds-switch--sm {
15
+ --ds-switch-w: var(--switch-track-width-sm);
16
+ --ds-switch-h: var(--switch-track-height-sm);
17
+ }
18
+
19
+ .ds-switch__input {
20
+ height: var(--ds-switch-h);
21
+ margin: 0;
22
+ opacity: 0;
23
+ position: absolute;
24
+ width: var(--ds-switch-w);
25
+ }
26
+
27
+ .ds-switch__track {
28
+ align-items: center;
29
+ background: var(--switch-track-bg);
30
+ border-radius: var(--radius-full);
31
+ display: inline-flex;
32
+ flex: none;
33
+ height: var(--ds-switch-h);
34
+ padding: var(--switch-thumb-inset);
35
+ transition:
36
+ background-color var(--switch-duration) var(--switch-ease),
37
+ transform var(--duration-fast) var(--switch-ease);
38
+ width: var(--ds-switch-w);
39
+ }
40
+
41
+ .ds-switch__thumb {
42
+ background: var(--switch-thumb-bg);
43
+ border-radius: var(--radius-full);
44
+ height: calc(var(--ds-switch-h) - var(--switch-thumb-inset) * 2);
45
+ transition:
46
+ background-color var(--switch-duration) var(--switch-ease),
47
+ transform var(--switch-duration) var(--switch-ease);
48
+ width: calc(var(--ds-switch-h) - var(--switch-thumb-inset) * 2);
49
+ }
50
+
51
+ .ds-switch__input:checked + .ds-switch__track {
52
+ background: var(--switch-track-bg-checked);
53
+ }
54
+
55
+ .ds-switch__input:checked + .ds-switch__track .ds-switch__thumb {
56
+ background: var(--switch-thumb-bg-checked);
57
+ transform: translateX(calc(var(--ds-switch-w) - var(--ds-switch-h)));
58
+ }
59
+
60
+ @media (hover: hover) and (pointer: fine) {
61
+ .ds-switch:hover .ds-switch__input:not(:disabled) + .ds-switch__track {
62
+ background: var(--switch-track-bg-hover);
63
+ }
64
+
65
+ .ds-switch:hover
66
+ .ds-switch__input:not(:disabled):checked
67
+ + .ds-switch__track {
68
+ background: var(--switch-track-bg-checked-hover);
69
+ }
70
+ }
71
+
72
+ .ds-switch:has(.ds-switch__input:not(:disabled)):active .ds-switch__track {
73
+ transform: scale(var(--switch-press-scale));
74
+ }
75
+
76
+ .ds-switch__input:focus-visible + .ds-switch__track {
77
+ outline: var(--switch-focus-width) solid var(--switch-focus-color);
78
+ outline-offset: var(--switch-focus-offset);
79
+ }
80
+
81
+ .ds-switch__input[aria-invalid="true"] + .ds-switch__track {
82
+ box-shadow: inset 0 0 0 1px var(--switch-track-border-invalid);
83
+ }
84
+
85
+ .ds-switch__input:disabled + .ds-switch__track {
86
+ background: var(--switch-track-bg-disabled);
87
+ box-shadow: inset 0 0 0 1px var(--switch-track-border-disabled);
88
+ }
89
+
90
+ .ds-switch__input:disabled + .ds-switch__track .ds-switch__thumb {
91
+ background: var(--switch-thumb-bg-disabled);
92
+ }
93
+
94
+ .ds-switch:has(.ds-switch__input:disabled) {
95
+ cursor: not-allowed;
96
+ }
97
+
98
+ .ds-switch__label {
99
+ color: var(--switch-label-fg);
100
+ font-size: var(--text-sm);
101
+ line-height: var(--leading-sm);
102
+ /* Centre the first line on the track. */
103
+ padding-block-start: calc((var(--ds-switch-h) - var(--leading-sm)) / 2);
104
+ }
105
+
106
+ .ds-switch:has(.ds-switch__input:disabled) .ds-switch__label {
107
+ color: var(--switch-label-fg-disabled);
108
+ }
109
+
110
+ .ds-switch__hint,
111
+ .ds-switch__error {
112
+ display: block;
113
+ font-size: var(--text-sm);
114
+ line-height: var(--leading-sm);
115
+ margin-block-start: var(--space-0-5);
116
+ }
117
+
118
+ .ds-switch__hint {
119
+ color: var(--switch-hint-fg);
120
+ }
121
+
122
+ .ds-switch__error {
123
+ align-items: flex-start;
124
+ color: var(--switch-error-fg);
125
+ display: flex;
126
+ font-weight: var(--weight-medium);
127
+ gap: var(--space-1);
128
+ }
129
+
130
+ @media (prefers-reduced-motion: reduce) {
131
+ .ds-switch__thumb {
132
+ transition-property: background-color;
133
+ }
134
+
135
+ .ds-switch__track {
136
+ transition-property: background-color;
137
+ }
138
+
139
+ .ds-switch:has(.ds-switch__input:not(:disabled)):active .ds-switch__track {
140
+ transform: none;
141
+ }
142
+ }
143
+ }
@@ -0,0 +1,177 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-table-wrap {
5
+ border: 1px solid var(--table-border);
6
+ border-radius: var(--table-radius);
7
+ overflow-x: auto;
8
+ width: 100%;
9
+ }
10
+
11
+ .ds-table__toolbar {
12
+ align-items: center;
13
+ background: var(--table-toolbar-bg);
14
+ border-bottom: 1px solid var(--table-border);
15
+ display: flex;
16
+ gap: var(--table-toolbar-gap);
17
+ padding: var(--table-toolbar-padding);
18
+ }
19
+
20
+ .ds-table__filter {
21
+ max-width: var(--table-filter-width);
22
+ }
23
+
24
+ .ds-table__count {
25
+ color: var(--table-caption-fg);
26
+ font-family: var(--table-numeric-font);
27
+ font-size: var(--text-sm);
28
+ margin-inline-start: auto;
29
+ white-space: nowrap;
30
+ }
31
+
32
+ .ds-table {
33
+ background: var(--table-bg);
34
+ border-collapse: collapse;
35
+ font-size: var(--table-cell-size);
36
+ width: 100%;
37
+ }
38
+
39
+ .ds-table--wide {
40
+ min-width: var(--table-min-width);
41
+ }
42
+
43
+ .ds-table__caption {
44
+ color: var(--table-caption-fg);
45
+ font-size: var(--table-caption-size);
46
+ padding: var(--space-3) var(--table-cell-padding-x);
47
+ text-align: start;
48
+ }
49
+
50
+ .ds-table thead {
51
+ background: var(--table-header-bg);
52
+ }
53
+
54
+ .ds-table th {
55
+ color: var(--table-header-fg);
56
+ font-family: var(--font-body);
57
+ font-size: var(--table-header-size);
58
+ font-weight: var(--type-overline-weight);
59
+ letter-spacing: var(--type-overline-tracking);
60
+ padding: var(--space-2-5) var(--table-cell-padding-x);
61
+ text-align: start;
62
+ text-transform: uppercase;
63
+ white-space: nowrap;
64
+ }
65
+
66
+ .ds-table td {
67
+ border-top: 1px solid var(--table-row-border);
68
+ color: var(--table-cell-fg);
69
+ padding: var(--table-cell-padding-y) var(--table-cell-padding-x);
70
+ vertical-align: middle;
71
+ }
72
+
73
+ .ds-table tbody tr {
74
+ transition: background-color var(--duration-fast) var(--ease-standard);
75
+ }
76
+
77
+ .ds-table tbody tr:hover {
78
+ background: var(--table-row-hover);
79
+ }
80
+
81
+ .ds-table tbody tr[aria-selected="true"] {
82
+ background: var(--table-row-selected);
83
+ }
84
+
85
+ .ds-table__sort-button {
86
+ align-items: center;
87
+ background: transparent;
88
+ border: 0;
89
+ border-radius: var(--radius-xs);
90
+ color: inherit;
91
+ cursor: pointer;
92
+ display: inline-flex;
93
+ font: inherit;
94
+ gap: var(--space-1);
95
+ letter-spacing: inherit;
96
+ padding: 0;
97
+ text-transform: inherit;
98
+ }
99
+
100
+ .ds-table__sort-button:hover {
101
+ color: var(--table-sort-hover);
102
+ }
103
+
104
+ .ds-table__sort-button:focus-visible {
105
+ outline: var(--table-focus-width) solid var(--table-focus-color);
106
+ outline-offset: var(--table-focus-offset);
107
+ }
108
+
109
+ .ds-table__sort {
110
+ color: var(--table-cell-fg-muted);
111
+ display: inline-flex;
112
+ transition: transform var(--duration-fast) var(--ease-standard);
113
+ }
114
+
115
+ .ds-table__sort-dir,
116
+ th[aria-sort="ascending"] .ds-table__sort-idle,
117
+ th[aria-sort="descending"] .ds-table__sort-idle {
118
+ display: none;
119
+ }
120
+
121
+ th[aria-sort="ascending"] .ds-table__sort-dir,
122
+ th[aria-sort="descending"] .ds-table__sort-dir {
123
+ display: block;
124
+ }
125
+
126
+ th[aria-sort="ascending"] .ds-table__sort,
127
+ th[aria-sort="descending"] .ds-table__sort {
128
+ color: var(--table-sort-hover);
129
+ }
130
+
131
+ th[aria-sort="ascending"] .ds-table__sort-dir {
132
+ transform: rotate(180deg);
133
+ }
134
+
135
+ .ds-table .is-numeric {
136
+ font-family: var(--table-numeric-font);
137
+ font-variant-numeric: tabular-nums;
138
+ text-align: end;
139
+ white-space: nowrap;
140
+ }
141
+
142
+ .ds-table .is-end {
143
+ text-align: end;
144
+ }
145
+
146
+ .ds-table th.is-numeric .ds-table__sort-button,
147
+ .ds-table th.is-end .ds-table__sort-button {
148
+ flex-direction: row-reverse;
149
+ }
150
+
151
+ .ds-table__muted {
152
+ color: var(--table-cell-fg-muted);
153
+ }
154
+
155
+ .ds-table__mono {
156
+ font-family: var(--table-numeric-font);
157
+ font-size: var(--text-sm);
158
+ font-variant-numeric: tabular-nums;
159
+ white-space: nowrap;
160
+ }
161
+
162
+ .ds-table__swatch {
163
+ border: 1px solid var(--table-border);
164
+ border-radius: var(--radius-xs);
165
+ display: inline-block;
166
+ height: var(--space-3);
167
+ margin-inline-end: var(--space-2);
168
+ vertical-align: -0.1em;
169
+ width: var(--space-3);
170
+ }
171
+
172
+ .ds-table__empty {
173
+ color: var(--table-cell-fg-muted);
174
+ padding: var(--space-10) var(--table-cell-padding-x);
175
+ text-align: center;
176
+ }
177
+ }
@@ -0,0 +1,120 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-tabs {
5
+ display: grid;
6
+ width: 100%;
7
+ }
8
+
9
+ .ds-tabs__list {
10
+ border-block-end: 1px solid var(--tabs-list-border);
11
+ display: flex;
12
+ gap: var(--tabs-list-gap);
13
+ overflow-x: auto;
14
+ position: relative;
15
+ scrollbar-width: none;
16
+ }
17
+
18
+ .ds-tabs__tab {
19
+ align-items: center;
20
+ background: transparent;
21
+ border: 0;
22
+ border-radius: var(--tabs-tab-radius);
23
+ color: var(--tabs-tab-fg);
24
+ cursor: pointer;
25
+ display: inline-flex;
26
+ flex: none;
27
+ font-family: var(--font-body);
28
+ font-size: var(--tabs-tab-font-size);
29
+ font-weight: var(--tabs-tab-font-weight);
30
+ height: var(--tabs-tab-height);
31
+ line-height: var(--leading-sm);
32
+ padding-inline: var(--tabs-tab-padding-x);
33
+ position: relative;
34
+ transition:
35
+ background-color var(--duration-fast) var(--tabs-ease),
36
+ color var(--duration-fast) var(--tabs-ease),
37
+ transform var(--duration-fast) var(--tabs-ease);
38
+ white-space: nowrap;
39
+ }
40
+
41
+ .ds-tabs__tab[aria-selected="true"] {
42
+ color: var(--tabs-tab-fg-selected);
43
+ }
44
+
45
+ @media (hover: hover) and (pointer: fine) {
46
+ .ds-tabs__tab:hover:not(:disabled):not([aria-selected="true"]) {
47
+ background: var(--tabs-tab-bg-hover);
48
+ color: var(--tabs-tab-fg-hover);
49
+ }
50
+ }
51
+
52
+ .ds-tabs__tab:active:not(:disabled) {
53
+ transform: scale(0.97);
54
+ }
55
+
56
+ .ds-tabs__tab:focus-visible {
57
+ outline: var(--tabs-focus-width) solid var(--tabs-focus-color);
58
+ outline-offset: var(--tabs-focus-offset);
59
+ }
60
+
61
+ .ds-tabs__tab:disabled {
62
+ color: var(--tabs-tab-fg-disabled);
63
+ cursor: not-allowed;
64
+ }
65
+
66
+ /* Without script the selected tab carries its own underline. */
67
+ .ds-tabs__list:not([data-indicator])
68
+ .ds-tabs__tab[aria-selected="true"]::after {
69
+ background: var(--tabs-indicator-bg);
70
+ content: "";
71
+ height: var(--tabs-indicator-height);
72
+ inset-block-end: 0;
73
+ inset-inline: 0;
74
+ position: absolute;
75
+ }
76
+
77
+ /*
78
+ * Script measures the selected tab and sets --ds-tabs-x (px) and
79
+ * --ds-tabs-scale (unitless) against the full scroll width (--ds-tabs-track).
80
+ */
81
+ .ds-tabs__indicator {
82
+ background: var(--tabs-indicator-bg);
83
+ height: var(--tabs-indicator-height);
84
+ inset-block-end: 0;
85
+ left: 0;
86
+ pointer-events: none;
87
+ position: absolute;
88
+ transform: translateX(var(--ds-tabs-x, 0)) scaleX(var(--ds-tabs-scale, 0));
89
+ transform-origin: left;
90
+ width: var(--ds-tabs-track, 100%);
91
+ }
92
+
93
+ .ds-tabs__list[data-indicator="ready"] .ds-tabs__indicator {
94
+ transition: transform var(--tabs-duration) var(--tabs-ease);
95
+ }
96
+
97
+ .ds-tabs__panel {
98
+ padding-block-start: var(--tabs-panel-padding);
99
+ }
100
+
101
+ .ds-tabs__panel:focus-visible {
102
+ border-radius: var(--tabs-tab-radius);
103
+ outline: var(--tabs-focus-width) solid var(--tabs-focus-color);
104
+ outline-offset: var(--tabs-focus-width);
105
+ }
106
+
107
+ .ds-tabs__panel[hidden] {
108
+ display: none;
109
+ }
110
+
111
+ @media (prefers-reduced-motion: reduce) {
112
+ .ds-tabs__tab:active:not(:disabled) {
113
+ transform: none;
114
+ }
115
+
116
+ .ds-tabs__list[data-indicator="ready"] .ds-tabs__indicator {
117
+ transition: none;
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,31 @@
1
+ @layer reset, tokens, base, components, motion, utilities;
2
+
3
+ @layer components {
4
+ .ds-theme-toggle__sun,
5
+ .ds-theme-toggle__moon {
6
+ align-items: center;
7
+ display: inline-flex;
8
+ }
9
+
10
+ .ds-theme-toggle__sun {
11
+ display: none;
12
+ }
13
+
14
+ [data-theme="dark"] .ds-theme-toggle__sun {
15
+ display: inline-flex;
16
+ }
17
+
18
+ [data-theme="dark"] .ds-theme-toggle__moon {
19
+ display: none;
20
+ }
21
+
22
+ @media (prefers-color-scheme: dark) {
23
+ :root:not([data-theme="light"]) .ds-theme-toggle__sun {
24
+ display: inline-flex;
25
+ }
26
+
27
+ :root:not([data-theme="light"]) .ds-theme-toggle__moon {
28
+ display: none;
29
+ }
30
+ }
31
+ }