@gtivr4/a1-design-system-react 0.12.1 → 0.14.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.
- package/package.json +1 -1
- package/src/components/accordion/Accordion.jsx +2 -0
- package/src/components/banner/Banner.jsx +4 -1
- package/src/components/blockquote/blockquote.css +0 -2
- package/src/components/bottom-drawer/BottomDrawer.jsx +2 -2
- package/src/components/button/Button.d.ts +4 -0
- package/src/components/button/Button.jsx +15 -3
- package/src/components/button/button.css +39 -0
- package/src/components/calendar/calendar.css +0 -2
- package/src/components/card/card.css +1 -0
- package/src/components/checkbox-group/CheckboxGroup.jsx +1 -1
- package/src/components/checkbox-group/checkbox-group.css +3 -3
- package/src/components/choice-group/ChoiceGroup.d.ts +23 -0
- package/src/components/choice-group/ChoiceGroup.jsx +22 -10
- package/src/components/choice-group/choice-group.css +53 -7
- package/src/components/code/Code.d.ts +4 -0
- package/src/components/code/Code.jsx +44 -8
- package/src/components/code/code.css +29 -0
- package/src/components/context-menu/ContextMenu.d.ts +56 -0
- package/src/components/context-menu/ContextMenu.jsx +146 -0
- package/src/components/context-menu/context-menu.css +107 -0
- package/src/components/data-table/DataTable.jsx +1 -1
- package/src/components/definition-list/definition-list.css +15 -0
- package/src/components/divider/Divider.d.ts +4 -2
- package/src/components/divider/Divider.jsx +6 -1
- package/src/components/divider/divider.css +9 -5
- package/src/components/field/DateField.jsx +17 -2
- package/src/components/field/SelectField.jsx +1 -1
- package/src/components/field/TextField.d.ts +2 -0
- package/src/components/field/TextField.jsx +1 -1
- package/src/components/field/TextareaField.jsx +1 -1
- package/src/components/field/TimeField.jsx +17 -2
- package/src/components/field/field.css +12 -5
- package/src/components/field/textarea-field.css +1 -2
- package/src/components/fieldset/fieldset.css +2 -0
- package/src/components/icon-button/IconButton.d.ts +8 -0
- package/src/components/icon-button/IconButton.jsx +9 -4
- package/src/components/inline-editable/InlineEditable.d.ts +25 -0
- package/src/components/inline-editable/InlineEditable.jsx +77 -1
- package/src/components/inline-editable/inline-editable.css +44 -1
- package/src/components/message/Message.jsx +15 -9
- package/src/components/page-layout/page-layout.css +13 -0
- package/src/components/page-nav/page-nav.css +0 -2
- package/src/components/pagination/Pagination.jsx +3 -1
- package/src/components/radio-group/RadioGroup.jsx +1 -1
- package/src/components/radio-group/radio-group.css +3 -3
- package/src/components/section/Section.d.ts +8 -0
- package/src/components/section/Section.jsx +24 -0
- package/src/components/section/section.css +28 -0
- package/src/components/snackbar/Snackbar.d.ts +24 -0
- package/src/components/snackbar/Snackbar.jsx +11 -8
- package/src/components/snackbar/snackbar.css +7 -22
- package/src/components/stack/Stack.jsx +2 -1
- package/src/components/tabs/Tabs.d.ts +2 -0
- package/src/components/tabs/Tabs.jsx +3 -3
- package/src/components/tabs/tabs.css +95 -0
- package/src/components/top-header/TopHeader.jsx +2 -0
- package/src/components/tree-menu/TreeMenu.d.ts +54 -0
- package/src/components/tree-menu/TreeMenu.jsx +500 -0
- package/src/components/tree-menu/tree-menu.css +254 -0
- package/src/index.js +2 -0
- package/src/tokens.css +16 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/* ── Root ─────────────────────────────────────────────────────────────────── */
|
|
2
|
+
|
|
3
|
+
.a1-tree-menu-root {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.a1-tree-menu,
|
|
9
|
+
.a1-tree-menu__group {
|
|
10
|
+
list-style: none;
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--base-spacing-2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ── Group expand / collapse (CSS grid trick, same as Accordion / SideNav) ── */
|
|
19
|
+
|
|
20
|
+
.a1-tree-menu__group-wrapper {
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-rows: 0fr;
|
|
23
|
+
transition: grid-template-rows var(--semantic-motion-duration-normal) var(--semantic-motion-easing-standard);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.a1-tree-menu__group-wrapper--open {
|
|
27
|
+
grid-template-rows: 1fr;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.a1-tree-menu__group-inner {
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* ── Row container ────────────────────────────────────────────────────────── */
|
|
35
|
+
|
|
36
|
+
.a1-tree-menu__row {
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding-inline-start: calc(
|
|
41
|
+
var(--component-tree-menu-item-padding-inline) +
|
|
42
|
+
var(--component-tree-menu-item-indent) * var(--a1-tree-depth, 0)
|
|
43
|
+
);
|
|
44
|
+
border-radius: var(--component-tree-menu-item-border-radius);
|
|
45
|
+
color: var(--semantic-color-text-default);
|
|
46
|
+
transition:
|
|
47
|
+
background var(--semantic-motion-duration-fast) var(--semantic-motion-easing-standard),
|
|
48
|
+
color var(--semantic-motion-duration-fast) var(--semantic-motion-easing-standard);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.a1-tree-menu__row:hover {
|
|
52
|
+
background: color-mix(in srgb, transparent, var(--semantic-color-text-default) 6%);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.a1-tree-menu__row:active {
|
|
56
|
+
background: color-mix(in srgb, transparent, var(--semantic-color-text-default) 10%);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* ── Selected row ─────────────────────────────────────────────────────────── */
|
|
60
|
+
|
|
61
|
+
.a1-tree-menu__row--selected {
|
|
62
|
+
background: var(--semantic-color-action-background);
|
|
63
|
+
color: var(--semantic-color-action-foreground);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.a1-tree-menu__row--selected:hover {
|
|
67
|
+
background: var(--semantic-color-action-background-hover);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.a1-tree-menu__row--selected:active {
|
|
71
|
+
background: var(--semantic-color-action-background-pressed);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ── Disabled row ─────────────────────────────────────────────────────────── */
|
|
75
|
+
|
|
76
|
+
.a1-tree-menu__row--disabled {
|
|
77
|
+
opacity: 0.4;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* ── Toggle button (expand / collapse — branch nodes only) ────────────────── */
|
|
83
|
+
|
|
84
|
+
.a1-tree-menu__toggle {
|
|
85
|
+
flex-shrink: 0;
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
width: var(--component-tree-menu-item-chevron-size);
|
|
90
|
+
height: var(--component-tree-menu-item-chevron-size);
|
|
91
|
+
padding: 0;
|
|
92
|
+
border: none;
|
|
93
|
+
background: transparent;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
color: var(--semantic-color-text-muted);
|
|
96
|
+
font-size: var(--component-tree-menu-item-chevron-size);
|
|
97
|
+
border-radius: var(--base-radius-sm);
|
|
98
|
+
transition: color var(--semantic-motion-duration-fast) var(--semantic-motion-easing-standard);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.a1-tree-menu__toggle:hover {
|
|
102
|
+
color: var(--semantic-color-text-default);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.a1-tree-menu__row--selected .a1-tree-menu__toggle {
|
|
106
|
+
color: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Suppress native focus ring — toggle is mouse-only (tabIndex=-1). */
|
|
110
|
+
.a1-tree-menu__toggle:focus {
|
|
111
|
+
outline: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* ── Toggle spacer (leaf nodes — keeps label aligned with branch labels) ──── */
|
|
115
|
+
|
|
116
|
+
.a1-tree-menu__toggle-spacer {
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
display: block;
|
|
119
|
+
width: var(--component-tree-menu-item-chevron-size);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* ── Label button (the selectable surface) ────────────────────────────────── */
|
|
123
|
+
|
|
124
|
+
.a1-tree-menu__label-btn {
|
|
125
|
+
flex: 1 1 auto;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
gap: var(--component-tree-menu-item-gap);
|
|
130
|
+
padding-block: var(--base-spacing-2);
|
|
131
|
+
padding-inline-end: var(--component-tree-menu-item-padding-inline);
|
|
132
|
+
min-height: var(--component-tree-menu-item-height);
|
|
133
|
+
border: none;
|
|
134
|
+
background: transparent;
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
color: inherit;
|
|
137
|
+
font-family: var(--component-paragraph-font-family, inherit);
|
|
138
|
+
font-size: var(--semantic-font-size-body-sm);
|
|
139
|
+
font-weight: var(--base-font-weight-regular);
|
|
140
|
+
line-height: var(--component-tree-menu-item-line-height);
|
|
141
|
+
text-decoration: none;
|
|
142
|
+
text-align: start;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
overflow: hidden;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.a1-tree-menu__label-btn:focus-visible {
|
|
148
|
+
outline: var(--component-tree-menu-item-focus-ring-width) solid var(--semantic-color-text-accent);
|
|
149
|
+
outline-offset: var(--component-tree-menu-item-focus-ring-offset);
|
|
150
|
+
border-radius: var(--base-radius-sm);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.a1-tree-menu__row--selected .a1-tree-menu__label-btn {
|
|
154
|
+
font-weight: var(--base-font-weight-medium);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.a1-tree-menu__row--selected .a1-tree-menu__label-btn:focus-visible {
|
|
158
|
+
outline-color: var(--semantic-color-action-foreground);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.a1-tree-menu__label-btn--disabled {
|
|
162
|
+
cursor: not-allowed;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* ── Icon ─────────────────────────────────────────────────────────────────── */
|
|
166
|
+
|
|
167
|
+
.a1-tree-menu__icon {
|
|
168
|
+
flex-shrink: 0;
|
|
169
|
+
font-size: var(--component-tree-menu-item-icon-size);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* ── Label text ───────────────────────────────────────────────────────────── */
|
|
173
|
+
|
|
174
|
+
.a1-tree-menu__label {
|
|
175
|
+
flex: 1 1 auto;
|
|
176
|
+
min-width: 0;
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
text-overflow: ellipsis;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* ── Expand all / Collapse all controls ───────────────────────────────────── */
|
|
182
|
+
|
|
183
|
+
.a1-tree-menu__controls {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: var(--base-spacing-4);
|
|
187
|
+
padding-block-end: var(--base-spacing-4);
|
|
188
|
+
padding-inline: var(--component-tree-menu-item-padding-inline);
|
|
189
|
+
border-block-end: 1px solid var(--semantic-color-border-subtle);
|
|
190
|
+
margin-block-end: var(--base-spacing-4);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.a1-tree-menu__control-btn {
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: var(--base-spacing-4);
|
|
197
|
+
padding: 0;
|
|
198
|
+
border: none;
|
|
199
|
+
background: transparent;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
color: var(--semantic-color-text-muted);
|
|
202
|
+
font-family: var(--component-paragraph-font-family, inherit);
|
|
203
|
+
font-size: var(--semantic-font-size-body-sm);
|
|
204
|
+
line-height: 1;
|
|
205
|
+
transition: color var(--semantic-motion-duration-fast) var(--semantic-motion-easing-standard);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.a1-tree-menu__control-btn:hover {
|
|
209
|
+
color: var(--semantic-color-text-default);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.a1-tree-menu__control-btn:focus-visible {
|
|
213
|
+
outline: 2px solid var(--semantic-color-text-accent);
|
|
214
|
+
outline-offset: 2px;
|
|
215
|
+
border-radius: var(--base-radius-sm);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/* ── Drag and drop ─────────────────────────────────────────────────────────── */
|
|
219
|
+
|
|
220
|
+
/* The item being dragged — faded so the ghost reads as a copy, not an absence. */
|
|
221
|
+
.a1-tree-menu__row--dragging {
|
|
222
|
+
opacity: 0.4;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Drop-before / drop-after: accent insertion line. */
|
|
226
|
+
.a1-tree-menu__row--drop-before,
|
|
227
|
+
.a1-tree-menu__row--drop-after {
|
|
228
|
+
position: relative;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.a1-tree-menu__row--drop-before::before,
|
|
232
|
+
.a1-tree-menu__row--drop-after::after {
|
|
233
|
+
content: '';
|
|
234
|
+
position: absolute;
|
|
235
|
+
inset-inline: 0;
|
|
236
|
+
block-size: 2px;
|
|
237
|
+
background: var(--semantic-color-action-background);
|
|
238
|
+
pointer-events: none;
|
|
239
|
+
z-index: 1;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.a1-tree-menu__row--drop-before::before {
|
|
243
|
+
inset-block-start: -1px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.a1-tree-menu__row--drop-after::after {
|
|
247
|
+
inset-block-end: -1px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Drop-into: tinted background + inset ring to show "nest inside" intent. */
|
|
251
|
+
.a1-tree-menu__row--drop-into {
|
|
252
|
+
background: color-mix(in srgb, var(--semantic-color-action-background) 12%, transparent);
|
|
253
|
+
box-shadow: inset 0 0 0 2px var(--semantic-color-action-background);
|
|
254
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { Accordion } from "./components/accordion/Accordion.jsx";
|
|
2
|
+
export { ContextMenu } from "./components/context-menu/ContextMenu.jsx";
|
|
3
|
+
export { TreeMenu } from "./components/tree-menu/TreeMenu.jsx";
|
|
2
4
|
export { Calendar } from "./components/calendar/Calendar.jsx";
|
|
3
5
|
export { PageNav } from "./components/page-nav/PageNav.jsx";
|
|
4
6
|
export { Blockquote } from "./components/blockquote/Blockquote.jsx";
|
package/src/tokens.css
CHANGED
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
--base-radius-control: 0.375rem;
|
|
101
101
|
--base-radius-lg: 0.5rem;
|
|
102
102
|
--base-radius-xl: 0.75rem;
|
|
103
|
+
--base-radius-pill: 624.9375rem;
|
|
103
104
|
--base-space-button-padding-block: 0.625rem;
|
|
104
105
|
--base-space-button-padding-inline: 0.75rem;
|
|
105
106
|
--base-space-button-min-height: 2.5rem;
|
|
@@ -145,6 +146,7 @@
|
|
|
145
146
|
--base-font-size-user-medium: 1rem;
|
|
146
147
|
--base-font-size-user-large: 1.125rem;
|
|
147
148
|
--base-font-size-user-xl: 1.25rem;
|
|
149
|
+
--base-font-size-scale-50: 0.625rem;
|
|
148
150
|
--base-font-size-scale-100: 0.75rem;
|
|
149
151
|
--base-font-size-scale-150: 0.875rem;
|
|
150
152
|
--base-font-size-scale-200: 1rem;
|
|
@@ -239,11 +241,15 @@
|
|
|
239
241
|
--semantic-spacing-gap-md: 1rem;
|
|
240
242
|
--semantic-spacing-gap-lg: 1.5rem;
|
|
241
243
|
--semantic-spacing-gap-xl: 2.5rem;
|
|
244
|
+
--semantic-font-size-body-2xs: 0.625rem;
|
|
242
245
|
--semantic-font-size-body-xs: 0.75rem;
|
|
243
246
|
--semantic-font-size-body-sm: 0.875rem;
|
|
244
247
|
--semantic-font-size-body-md: 1rem;
|
|
245
248
|
--semantic-font-size-body-lg: 1.125rem;
|
|
246
249
|
--semantic-font-size-body-xl: 1.25rem;
|
|
250
|
+
--semantic-font-size-form-label-compact: 0.75rem;
|
|
251
|
+
--semantic-font-size-form-label-default: 0.875rem;
|
|
252
|
+
--semantic-font-size-form-label-comfortable: 1rem;
|
|
247
253
|
--semantic-font-size-heading-xxl: 2.5rem;
|
|
248
254
|
--semantic-font-size-heading-xl: 2rem;
|
|
249
255
|
--semantic-font-size-heading-lg: 1.75rem;
|
|
@@ -763,6 +769,16 @@
|
|
|
763
769
|
--component-top-header-padding-inline: 1.5rem;
|
|
764
770
|
--component-top-header-border-width: 1px;
|
|
765
771
|
--component-top-header-z-index: 100;
|
|
772
|
+
--component-tree-menu-item-height: 2rem;
|
|
773
|
+
--component-tree-menu-item-gap: 0.5rem;
|
|
774
|
+
--component-tree-menu-item-indent: 0.75rem;
|
|
775
|
+
--component-tree-menu-item-padding-inline: 0.5rem;
|
|
776
|
+
--component-tree-menu-item-border-radius: 0.375rem;
|
|
777
|
+
--component-tree-menu-item-icon-size: 1.125rem;
|
|
778
|
+
--component-tree-menu-item-chevron-size: 1rem;
|
|
779
|
+
--component-tree-menu-item-line-height: 1.5;
|
|
780
|
+
--component-tree-menu-item-focus-ring-width: 0.125rem;
|
|
781
|
+
--component-tree-menu-item-focus-ring-offset: -2px;
|
|
766
782
|
--component-paragraph-font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
767
783
|
--component-paragraph-font-weight: 400;
|
|
768
784
|
--component-paragraph-font-line-height: 1.75em;
|