@gtivr4/a1-design-system-react 0.14.0 → 0.15.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.
@@ -0,0 +1,229 @@
1
+ /* ══════════════════════════════════════════════════════════════════════════
2
+ Toolbar
3
+ ══════════════════════════════════════════════════════════════════════════ */
4
+
5
+ /* ── Labelled field wrapper ────────────────────────────────────────────────── */
6
+ /* Optional caption above the bar — matches the compact ChoiceGroup label so a
7
+ Toolbar sits naturally next to form controls. */
8
+ .a1-toolbar-field {
9
+ display: flex;
10
+ flex-direction: column;
11
+ /* Keep the label and bar at their natural width so a stretching flex parent
12
+ (e.g. a column Stack with the default `align-items: stretch`) doesn't force
13
+ the bar to full width. A `fullWidth` bar still fills (it sets its own
14
+ `inline-size: 100%`). */
15
+ align-items: flex-start;
16
+ gap: var(--component-choice-group-compact-group-gap);
17
+ }
18
+
19
+ .a1-toolbar-field__label {
20
+ font-family: var(--component-paragraph-font-family);
21
+ /* The smallest body step. */
22
+ font-size: var(--semantic-font-size-body-xs);
23
+ font-weight: var(--component-field-label-font-weight);
24
+ color: var(--semantic-color-text-default);
25
+ line-height: var(--semantic-font-line-height-body);
26
+ }
27
+
28
+ .a1-toolbar {
29
+ /* Variant layer — every value resolves to a Style Dictionary token. */
30
+ --a1-toolbar-item-size: var(--base-spacing-32);
31
+ --a1-toolbar-bg: var(--semantic-color-surface-raised);
32
+ /* Unselected tools sit back in muted text; the selected tool steps forward
33
+ with default text on a darker neutral background — low-contrast, neutral. */
34
+ --a1-toolbar-fg: var(--semantic-color-text-muted);
35
+ --a1-toolbar-hover-bg: color-mix(in srgb, var(--semantic-color-text-default) 8%, transparent);
36
+ --a1-toolbar-selected-bg: color-mix(in srgb, var(--semantic-color-text-default) 16%, transparent);
37
+ --a1-toolbar-selected-fg: var(--semantic-color-text-default);
38
+ /* No boundary by default; the accessible theme and high-contrast modes raise
39
+ it so the bar is clearly delimited against the page surface. */
40
+ --a1-toolbar-border-width: 0;
41
+ --a1-toolbar-border-color: var(--semantic-color-border-default);
42
+
43
+ display: inline-flex;
44
+ align-items: center;
45
+ /* Tools wrap onto new rows when they run out of width — never overflow the
46
+ container and never scroll horizontally. */
47
+ flex-wrap: wrap;
48
+ max-inline-size: 100%;
49
+ gap: var(--base-spacing-2);
50
+ padding: var(--base-spacing-2);
51
+ background: var(--a1-toolbar-bg);
52
+ border: var(--a1-toolbar-border-width) solid var(--a1-toolbar-border-color);
53
+ border-radius: var(--base-radius-md);
54
+ }
55
+
56
+ /* Accessible theme: add a clear boundary at high contrast. */
57
+ [data-theme='accessible'] .a1-toolbar {
58
+ --a1-toolbar-border-width: var(--component-divider-size-sm);
59
+ }
60
+
61
+ /* OS high-contrast / forced-colors: add the same boundary. */
62
+ @media (prefers-contrast: more) {
63
+ .a1-toolbar {
64
+ --a1-toolbar-border-width: var(--component-divider-size-sm);
65
+ }
66
+ }
67
+
68
+ @media (forced-colors: active) {
69
+ .a1-toolbar {
70
+ --a1-toolbar-border-width: var(--component-divider-size-sm);
71
+ }
72
+ }
73
+
74
+ /* ── Full width (fill container, tools share the space) ────────────────────── */
75
+ .a1-toolbar--full-width {
76
+ display: flex;
77
+ inline-size: 100%;
78
+ }
79
+
80
+ /* Tools grow to share the available space; dividers keep their natural size. */
81
+ .a1-toolbar--full-width > :not(.a1-toolbar__divider) {
82
+ flex: 1 1 0;
83
+ }
84
+
85
+ /* A stretched (non-grid) group distributes its own buttons across its share. */
86
+ .a1-toolbar--full-width .a1-toolbar__group:not(.a1-toolbar__group--grid) > .a1-toolbar__button {
87
+ flex: 1 1 0;
88
+ }
89
+
90
+ /* ── Overlay (floating, elevated bar over page content) ────────────────────── */
91
+ .a1-toolbar--overlay {
92
+ background: var(--semantic-color-surface-card);
93
+ border: var(--component-divider-size-xs) solid var(--semantic-color-border-default);
94
+ box-shadow: var(--semantic-shadow-lg);
95
+ }
96
+
97
+ /* ── Buttons (toggle / action / group items) ───────────────────────────────── */
98
+
99
+ .a1-toolbar__button {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ gap: var(--base-spacing-4);
104
+ min-inline-size: var(--a1-toolbar-item-size);
105
+ block-size: var(--a1-toolbar-item-size);
106
+ padding-inline: var(--base-spacing-6);
107
+ margin: 0;
108
+ border: none;
109
+ border-radius: var(--base-radius-sm);
110
+ background: transparent;
111
+ color: var(--a1-toolbar-fg);
112
+ font-family: var(--component-paragraph-font-family);
113
+ font-size: var(--semantic-font-size-body-xs);
114
+ line-height: 1;
115
+ cursor: pointer;
116
+ }
117
+
118
+ .a1-toolbar__button:hover {
119
+ background: var(--a1-toolbar-hover-bg);
120
+ }
121
+
122
+ .a1-toolbar__button:focus-visible {
123
+ outline: none;
124
+ box-shadow: 0 0 0 var(--component-button-focus-ring-width) var(--component-field-focus-ring-color);
125
+ }
126
+
127
+ /* Selected state for toggles (aria-pressed) and group items (aria-checked) —
128
+ default text on a darker neutral fill. */
129
+ .a1-toolbar__button[aria-pressed="true"],
130
+ .a1-toolbar__button[aria-checked="true"] {
131
+ background: var(--a1-toolbar-selected-bg);
132
+ color: var(--a1-toolbar-selected-fg);
133
+ }
134
+
135
+ /* A toggle (aria-pressed) can be turned off, so it keeps hover feedback when on.
136
+ A radio group item (aria-checked) can't be deselected, so it shows no hover or
137
+ active change — clicking it does nothing. */
138
+ .a1-toolbar__button[aria-pressed="true"]:hover {
139
+ background: color-mix(in srgb, var(--semantic-color-text-default) 22%, transparent);
140
+ }
141
+
142
+ .a1-toolbar__button[aria-checked="true"]:hover,
143
+ .a1-toolbar__button[aria-checked="true"]:active {
144
+ background: var(--a1-toolbar-selected-bg);
145
+ }
146
+
147
+ .a1-toolbar__button:disabled {
148
+ opacity: 0.5;
149
+ cursor: not-allowed;
150
+ }
151
+
152
+ .a1-toolbar__label {
153
+ white-space: nowrap;
154
+ }
155
+
156
+ /* Colour swatch shown inside a tool to preview a specific colour. The border
157
+ keeps a light swatch from bleeding into the toolbar surface. */
158
+ .a1-toolbar__swatch {
159
+ flex: none;
160
+ inline-size: var(--base-spacing-16);
161
+ block-size: var(--base-spacing-16);
162
+ border-radius: var(--base-radius-sm);
163
+ border: var(--component-divider-size-xs) solid var(--semantic-color-border-default);
164
+ }
165
+
166
+ /* Responsive label visibility (showLabel/showLabels as a breakpoint object).
167
+ The component emits one cascading class per breakpoint (xs → xl); the last
168
+ matching media query wins, mirroring Divider's responsive pattern. */
169
+ .a1-toolbar__label--hide-xs { display: none; }
170
+ .a1-toolbar__label--show-xs { display: inline; }
171
+
172
+ @media (--bp-sm-up) {
173
+ .a1-toolbar__label--hide-sm { display: none; }
174
+ .a1-toolbar__label--show-sm { display: inline; }
175
+ }
176
+
177
+ @media (--bp-md-up) {
178
+ .a1-toolbar__label--hide-md { display: none; }
179
+ .a1-toolbar__label--show-md { display: inline; }
180
+ }
181
+
182
+ @media (--bp-lg-up) {
183
+ .a1-toolbar__label--hide-lg { display: none; }
184
+ .a1-toolbar__label--show-lg { display: inline; }
185
+ }
186
+
187
+ @media (--bp-xl) {
188
+ .a1-toolbar__label--hide-xl { display: none; }
189
+ .a1-toolbar__label--show-xl { display: inline; }
190
+ }
191
+
192
+ /* ── Menu button (opens a dropdown Menu) ───────────────────────────────────── */
193
+
194
+ .a1-toolbar__menu-button {
195
+ inline-size: auto;
196
+ }
197
+
198
+ .a1-toolbar__caret {
199
+ /* Pull the caret tight to the icon/label so the menu button stays compact. */
200
+ margin-inline-start: calc(-1 * var(--base-spacing-2));
201
+ }
202
+
203
+ /* ── Group (segmented) + grid ──────────────────────────────────────────────── */
204
+
205
+ .a1-toolbar__group {
206
+ display: inline-flex;
207
+ align-items: center;
208
+ /* A wide single group wraps its own buttons rather than overflowing the bar. */
209
+ flex-wrap: wrap;
210
+ gap: var(--base-spacing-2);
211
+ }
212
+
213
+ .a1-toolbar__group--grid {
214
+ display: grid;
215
+ grid-template-columns: repeat(var(--a1-toolbar-grid-columns, 3), var(--a1-toolbar-item-size));
216
+ gap: var(--base-spacing-2);
217
+ }
218
+
219
+ /* ── Divider ───────────────────────────────────────────────────────────────── */
220
+
221
+ .a1-toolbar__divider {
222
+ align-self: stretch;
223
+ inline-size: var(--component-divider-size-xs);
224
+ min-block-size: var(--a1-toolbar-item-size);
225
+ margin-inline: var(--base-spacing-2);
226
+ background: var(--semantic-color-border-default);
227
+ border-radius: var(--base-radius-pill);
228
+ }
229
+
package/src/index.js CHANGED
@@ -12,7 +12,9 @@ export { CircularProgress } from "./components/circular-progress/CircularProgres
12
12
  export { StepTracker } from "./components/step-tracker/StepTracker.jsx";
13
13
  export { Bleed } from "./components/bleed/Bleed.jsx";
14
14
  export { IconButton } from "./components/icon-button/IconButton.jsx";
15
- export { Button } from "./components/button/Button.jsx";export { ButtonContainer } from "./components/button-container/ButtonContainer.jsx";
15
+ export { Button } from "./components/button/Button.jsx";
16
+ export { SplitButton } from "./components/split-button/SplitButton.jsx";
17
+ export { ButtonContainer } from "./components/button-container/ButtonContainer.jsx";
16
18
  export { Card } from "./components/card/Card.jsx";
17
19
  export { Cluster } from "./components/cluster/Cluster.jsx";
18
20
  export { Code } from "./components/code/Code.jsx";
@@ -46,6 +48,16 @@ export { MessageBadge, MessageEmptyState } from "./components/message/Message.js
46
48
 
47
49
  export { Pagination } from "./components/pagination/Pagination.jsx";
48
50
  export { SegmentedControl } from "./components/segmented-control/SegmentedControl.jsx";
51
+ export { Slider } from "./components/slider/Slider.jsx";
52
+ export {
53
+ Toolbar,
54
+ ToolbarToggle,
55
+ ToolbarButton,
56
+ ToolbarGroup,
57
+ ToolbarMenu,
58
+ ToolbarDivider,
59
+ TOOLBAR_NONE_ICON,
60
+ } from "./components/toolbar/Toolbar.jsx";
49
61
  export { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs.jsx";
50
62
  export { Grid, GridItem } from "./components/grid/Grid.jsx";
51
63
  export { Inverse } from "./components/inverse/Inverse.jsx";
package/src/tokens.css CHANGED
@@ -109,7 +109,7 @@
109
109
  --base-space-button-focus-ring-width: 0.1875rem;
110
110
  --base-space-button-focus-ring-offset: 0.125rem;
111
111
  --base-space-button-disabled-opacity: 0.55;
112
- --base-space-card-padding: 1.25rem;
112
+ --base-space-card-padding: 1rem;
113
113
  --base-space-card-border-width: 1px;
114
114
  --base-shadow-100: 0px 1px 2px 0px rgba(6, 11, 20, 0.05);
115
115
  --base-shadow-200: 0px 1px 3px 0px rgba(6, 11, 20, 0.10), 0px 1px 2px -1px rgba(6, 11, 20, 0.06);
@@ -146,6 +146,7 @@
146
146
  --base-font-size-user-medium: 1rem;
147
147
  --base-font-size-user-large: 1.125rem;
148
148
  --base-font-size-user-xl: 1.25rem;
149
+ --base-font-size-scale-25: 0.5rem;
149
150
  --base-font-size-scale-50: 0.625rem;
150
151
  --base-font-size-scale-100: 0.75rem;
151
152
  --base-font-size-scale-150: 0.875rem;
@@ -241,6 +242,7 @@
241
242
  --semantic-spacing-gap-md: 1rem;
242
243
  --semantic-spacing-gap-lg: 1.5rem;
243
244
  --semantic-spacing-gap-xl: 2.5rem;
245
+ --semantic-font-size-body-3xs: 0.5rem;
244
246
  --semantic-font-size-body-2xs: 0.625rem;
245
247
  --semantic-font-size-body-xs: 0.75rem;
246
248
  --semantic-font-size-body-sm: 0.875rem;
@@ -355,7 +357,7 @@
355
357
  --component-calendar-cell-size: 2rem;
356
358
  --component-calendar-cell-size-compact: 1.5rem;
357
359
  --component-calendar-cell-border-radius: 0.25rem;
358
- --component-card-padding: 1.25rem;
360
+ --component-card-padding: 1rem;
359
361
  --component-card-border-radius: 0.5rem;
360
362
  --component-card-border-width: 1px;
361
363
  --component-card-icon-size: 1.25rem;