@gtivr4/a1-design-system-react 0.1.0 → 0.2.4
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/guidelines/Guidelines.md +228 -0
- package/package.json +4 -1
- package/src/breakpoints.css +29 -0
- package/src/color-scheme.css +586 -24
- package/src/components/accordion/Accordion.jsx +80 -0
- package/src/components/accordion/accordion.css +118 -0
- package/src/components/banner/Banner.jsx +66 -0
- package/src/components/banner/banner.css +205 -0
- package/src/components/bleed/Bleed.jsx +27 -0
- package/src/components/bleed/bleed.css +5 -0
- package/src/components/blockquote/Blockquote.jsx +40 -0
- package/src/components/blockquote/blockquote.css +166 -0
- package/src/components/breadcrumb/Breadcrumb.jsx +82 -0
- package/src/components/breadcrumb/breadcrumb.css +133 -0
- package/src/components/button/button.css +42 -12
- package/src/components/button-container/ButtonContainer.jsx +20 -1
- package/src/components/button-container/button-container.css +19 -1
- package/src/components/calendar/Calendar.jsx +383 -0
- package/src/components/calendar/calendar.css +225 -0
- package/src/components/card/Card.jsx +50 -12
- package/src/components/card/card.css +178 -14
- package/src/components/checkbox-group/CheckboxGroup.jsx +120 -0
- package/src/components/checkbox-group/checkbox-group.css +304 -0
- package/src/components/cluster/Cluster.jsx +52 -0
- package/src/components/cluster/cluster.css +9 -0
- package/src/components/code/Code.jsx +135 -0
- package/src/components/code/code.css +60 -0
- package/src/components/data-table/DataTable.jsx +721 -0
- package/src/components/data-table/DataTableFilters.jsx +339 -0
- package/src/components/data-table/data-table-filters.css +259 -0
- package/src/components/data-table/data-table.css +425 -0
- package/src/components/dialog/Dialog.jsx +45 -2
- package/src/components/dialog/dialog.css +13 -4
- package/src/components/divider/Divider.jsx +64 -0
- package/src/components/divider/divider.css +170 -0
- package/src/components/field/CreditCardField.jsx +131 -0
- package/src/components/field/DateField.jsx +11 -0
- package/src/components/field/NumberField.jsx +11 -0
- package/src/components/field/PhoneField.jsx +107 -0
- package/src/components/field/SelectField.jsx +86 -0
- package/src/components/field/TextField.jsx +83 -0
- package/src/components/field/TextareaField.jsx +147 -0
- package/src/components/field/TimeField.jsx +11 -0
- package/src/components/field/ZipField.jsx +114 -0
- package/src/components/field/credit-card.css +30 -0
- package/src/components/field/field.css +380 -0
- package/src/components/field/textarea-field.css +185 -0
- package/src/components/field-row/FieldRow.jsx +23 -0
- package/src/components/field-row/field-row.css +51 -0
- package/src/components/fieldset/Fieldset.jsx +49 -0
- package/src/components/fieldset/fieldset.css +75 -0
- package/src/components/figure/Figure.jsx +63 -0
- package/src/components/figure/figure.css +97 -0
- package/src/components/grid/Grid.jsx +36 -2
- package/src/components/grid/grid.css +129 -4
- package/src/components/heading/Heading.jsx +41 -1
- package/src/components/heading/heading.css +65 -4
- package/src/components/icon/icon.css +1 -0
- package/src/components/icon-button/icon-button.css +1 -0
- package/src/components/inline/inline.css +51 -0
- package/src/components/inline-editable/InlineEditable.jsx +77 -0
- package/src/components/inline-editable/inline-editable.css +47 -0
- package/src/components/inset/Inset.jsx +27 -0
- package/src/components/inset/inset.css +6 -0
- package/src/components/labels/Labels.jsx +5 -5
- package/src/components/link/Link.jsx +2 -3
- package/src/components/link/link.css +30 -1
- package/src/components/list/List.jsx +92 -0
- package/src/components/list/list.css +178 -0
- package/src/components/menu/Menu.jsx +243 -10
- package/src/components/menu/menu.css +157 -17
- package/src/components/message/Message.jsx +25 -50
- package/src/components/message/message.css +50 -33
- package/src/components/notification/Notification.jsx +1 -1
- package/src/components/page-layout/PageLayout.jsx +16 -1
- package/src/components/page-layout/page-layout.css +97 -4
- package/src/components/page-nav/PageNav.jsx +110 -0
- package/src/components/page-nav/page-nav.css +167 -0
- package/src/components/paragraph/Paragraph.jsx +35 -2
- package/src/components/paragraph/paragraph.css +38 -1
- package/src/components/radio-group/RadioGroup.jsx +121 -0
- package/src/components/radio-group/radio-group.css +268 -0
- package/src/components/section/Section.jsx +108 -0
- package/src/components/section/section.css +280 -0
- package/src/components/segmented-control/SegmentedControl.jsx +4 -0
- package/src/components/segmented-control/segmented.css +13 -0
- package/src/components/side-nav/SideNav.jsx +29 -9
- package/src/components/side-nav/scrim.css +1 -1
- package/src/components/side-nav/side-nav.css +70 -32
- package/src/components/snackbar/Snackbar.jsx +56 -0
- package/src/components/snackbar/snackbar.css +113 -0
- package/src/components/spacer/Spacer.jsx +36 -0
- package/src/components/spacer/spacer.css +44 -0
- package/src/components/stack/Stack.jsx +100 -0
- package/src/components/stack/stack.css +37 -0
- package/src/components/switch/Switch.jsx +114 -0
- package/src/components/switch/switch.css +276 -0
- package/src/components/system-banner/SystemBanner.jsx +57 -0
- package/src/components/system-banner/system-banner.css +118 -0
- package/src/components/tabs/Tabs.jsx +96 -28
- package/src/components/tabs/tabs.css +352 -15
- package/src/components/token-select/TokenSelect.jsx +159 -0
- package/src/components/token-select/token-select.css +110 -0
- package/src/components/top-header/TopHeader.jsx +641 -0
- package/src/components/top-header/top-header.css +337 -0
- package/src/illustrations/ComponentThumbnails.jsx +227 -0
- package/src/index.js +41 -5
- package/src/themes.css +256 -5
- package/src/tokens.css +919 -0
- package/src/utilities/spacing.css +8 -0
- package/src/utilities/sr-only.css +16 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════════════════
|
|
2
|
+
Blockquote
|
|
3
|
+
═══════════════════════════════════════════════════════════════════════════ */
|
|
4
|
+
|
|
5
|
+
/* ── Base ─────────────────────────────────────────────────────────────────── */
|
|
6
|
+
|
|
7
|
+
.a1-blockquote {
|
|
8
|
+
margin: var(--base-spacing-32) 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.a1-blockquote__quote {
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
font-family: var(--component-paragraph-font-family);
|
|
15
|
+
font-size: var(--semantic-font-size-body-lg);
|
|
16
|
+
font-weight: var(--semantic-font-weight-body);
|
|
17
|
+
line-height: var(--semantic-font-line-height-body);
|
|
18
|
+
color: var(--semantic-color-text-default);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.a1-blockquote__cite {
|
|
22
|
+
display: block;
|
|
23
|
+
margin-top: var(--base-spacing-12);
|
|
24
|
+
font-size: var(--semantic-font-size-body-sm);
|
|
25
|
+
font-weight: var(--component-blockquote-cite-font-weight);
|
|
26
|
+
font-style: normal;
|
|
27
|
+
color: var(--semantic-color-text-muted);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.a1-blockquote__cite::before {
|
|
31
|
+
content: "\2014\00a0";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.a1-blockquote__cite-link {
|
|
35
|
+
color: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.a1-blockquote__cite-link:hover {
|
|
39
|
+
color: var(--semantic-color-text-default);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ── Variant: border ──────────────────────────────────────────────────────── */
|
|
43
|
+
|
|
44
|
+
.a1-blockquote--border {
|
|
45
|
+
padding-block: var(--component-blockquote-padding-block);
|
|
46
|
+
padding-inline-start: var(--component-blockquote-padding-inline);
|
|
47
|
+
border-inline-start: var(--component-blockquote-border-width) solid
|
|
48
|
+
var(--semantic-color-action-background);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ── Variant: filled ──────────────────────────────────────────────────────── */
|
|
52
|
+
|
|
53
|
+
.a1-blockquote--filled {
|
|
54
|
+
padding: var(--component-blockquote-padding-block)
|
|
55
|
+
var(--component-blockquote-padding-inline);
|
|
56
|
+
background: var(--semantic-color-surface-panel);
|
|
57
|
+
border: 1px solid var(--semantic-color-border-subtle);
|
|
58
|
+
border-radius: var(--component-blockquote-border-radius);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ── Variant: feature ─────────────────────────────────────────────────────── */
|
|
62
|
+
|
|
63
|
+
.a1-blockquote--feature {
|
|
64
|
+
padding-block: var(--component-blockquote-padding-block);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.a1-blockquote--feature .a1-blockquote__quote {
|
|
68
|
+
font-size: var(--semantic-font-size-display-sm);
|
|
69
|
+
font-weight: var(--semantic-font-weight-display);
|
|
70
|
+
line-height: 1.75em;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.a1-blockquote--feature .a1-blockquote__quote::before {
|
|
74
|
+
content: "\201C";
|
|
75
|
+
display: block;
|
|
76
|
+
font-size: var(--component-blockquote-mark-size);
|
|
77
|
+
line-height: 0.75;
|
|
78
|
+
color: var(--semantic-color-action-background);
|
|
79
|
+
margin-bottom: var(--base-spacing-8);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.a1-blockquote--feature .a1-blockquote__cite {
|
|
83
|
+
text-transform: uppercase;
|
|
84
|
+
letter-spacing: 0.06em;
|
|
85
|
+
font-size: var(--semantic-font-size-body-xs);
|
|
86
|
+
margin-top: var(--base-spacing-20);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.a1-blockquote--feature .a1-blockquote__cite::before {
|
|
90
|
+
content: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* ── Variant: minimal ─────────────────────────────────────────────────────── */
|
|
94
|
+
|
|
95
|
+
.a1-blockquote--minimal {
|
|
96
|
+
padding-block-start: var(--component-blockquote-padding-block);
|
|
97
|
+
border-block-start: 1px solid var(--semantic-color-border-subtle);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.a1-blockquote--minimal .a1-blockquote__quote {
|
|
101
|
+
font-style: italic;
|
|
102
|
+
color: var(--semantic-color-text-muted);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* ── Variant: accent ──────────────────────────────────────────────────────── */
|
|
106
|
+
|
|
107
|
+
.a1-blockquote--accent {
|
|
108
|
+
padding: var(--component-blockquote-padding-block)
|
|
109
|
+
var(--component-blockquote-padding-inline);
|
|
110
|
+
background: var(--semantic-color-action-background);
|
|
111
|
+
border-radius: var(--component-blockquote-border-radius);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.a1-blockquote--accent .a1-blockquote__quote {
|
|
115
|
+
color: var(--semantic-color-text-inverse);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.a1-blockquote--accent .a1-blockquote__cite {
|
|
119
|
+
color: color-mix(in srgb, var(--semantic-color-text-inverse), transparent 10%);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.a1-blockquote--accent .a1-blockquote__cite-link:hover {
|
|
123
|
+
color: var(--semantic-color-text-inverse);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ── Variant: pull ────────────────────────────────────────────────────────── */
|
|
127
|
+
|
|
128
|
+
.a1-blockquote--pull {
|
|
129
|
+
padding-block: var(--component-blockquote-padding-block);
|
|
130
|
+
text-align: center;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.a1-blockquote--pull .a1-blockquote__quote {
|
|
134
|
+
font-size: var(--semantic-font-size-display-sm);
|
|
135
|
+
font-style: italic;
|
|
136
|
+
line-height: var(--semantic-font-line-height-body);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.a1-blockquote--pull .a1-blockquote__quote::before {
|
|
140
|
+
content: "\201C";
|
|
141
|
+
color: var(--semantic-color-text-muted);
|
|
142
|
+
margin-inline-end: 0.05em;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.a1-blockquote--pull .a1-blockquote__quote::after {
|
|
146
|
+
content: "\201D";
|
|
147
|
+
color: var(--semantic-color-text-muted);
|
|
148
|
+
margin-inline-start: 0.05em;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.a1-blockquote--pull .a1-blockquote__cite {
|
|
152
|
+
text-align: center;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* ── Variant: ruled ───────────────────────────────────────────────────────── */
|
|
156
|
+
|
|
157
|
+
.a1-blockquote--ruled {
|
|
158
|
+
padding-block: var(--component-blockquote-padding-block);
|
|
159
|
+
border-block-start: 1px solid var(--semantic-color-border-default);
|
|
160
|
+
border-block-end: 1px solid var(--semantic-color-border-default);
|
|
161
|
+
text-align: center;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.a1-blockquote--ruled .a1-blockquote__cite {
|
|
165
|
+
text-align: center;
|
|
166
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import "./breadcrumb.css";
|
|
2
|
+
import { Icon } from "../icon/Icon.jsx";
|
|
3
|
+
import { Link } from "../link/Link.jsx";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hierarchical navigation breadcrumb.
|
|
7
|
+
*
|
|
8
|
+
* Pass an `items` array where each entry is `{ label, href?, onClick? }`.
|
|
9
|
+
* The last item is always the current page (non-interactive). All others
|
|
10
|
+
* render as links (anchor when href is set, button when only onClick).
|
|
11
|
+
*
|
|
12
|
+
* Responsive behavior via container query:
|
|
13
|
+
* - ≥ 480px: full breadcrumb trail with separators
|
|
14
|
+
* - < 480px: "← Back" link pointing to the immediate parent item
|
|
15
|
+
*
|
|
16
|
+
* @param {{ label: string, href?: string, onClick?: function }[]} items
|
|
17
|
+
*/
|
|
18
|
+
export function Breadcrumb({ items = [], backLabel = "Back", className = "", ...props }) {
|
|
19
|
+
const parentItem = items.length >= 2 ? items[items.length - 2] : null;
|
|
20
|
+
const backTarget = (parentItem?.href || parentItem?.onClick) ? parentItem : null;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<nav
|
|
24
|
+
aria-label="Breadcrumb"
|
|
25
|
+
className={["a1-breadcrumb", className].filter(Boolean).join(" ")}
|
|
26
|
+
{...props}
|
|
27
|
+
>
|
|
28
|
+
<ol className="a1-breadcrumb__list">
|
|
29
|
+
{items.map((item, i) => {
|
|
30
|
+
const isLast = i === items.length - 1;
|
|
31
|
+
return (
|
|
32
|
+
<li
|
|
33
|
+
key={i}
|
|
34
|
+
className={[
|
|
35
|
+
"a1-breadcrumb__item",
|
|
36
|
+
isLast && "a1-breadcrumb__item--current",
|
|
37
|
+
].filter(Boolean).join(" ")}
|
|
38
|
+
>
|
|
39
|
+
{isLast ? (
|
|
40
|
+
<span className="a1-breadcrumb__current" aria-current="page">
|
|
41
|
+
{item.label}
|
|
42
|
+
</span>
|
|
43
|
+
) : item.href ? (
|
|
44
|
+
<Link href={item.href} onClick={item.onClick} className="a1-breadcrumb__link">
|
|
45
|
+
{item.label}
|
|
46
|
+
</Link>
|
|
47
|
+
) : item.onClick ? (
|
|
48
|
+
<button type="button" className="a1-breadcrumb__link" onClick={item.onClick}>
|
|
49
|
+
{item.label}
|
|
50
|
+
</button>
|
|
51
|
+
) : (
|
|
52
|
+
<span className="a1-breadcrumb__ancestor">{item.label}</span>
|
|
53
|
+
)}
|
|
54
|
+
</li>
|
|
55
|
+
);
|
|
56
|
+
})}
|
|
57
|
+
</ol>
|
|
58
|
+
|
|
59
|
+
{backTarget && (
|
|
60
|
+
backTarget.href ? (
|
|
61
|
+
<Link
|
|
62
|
+
href={backTarget.href}
|
|
63
|
+
onClick={backTarget.onClick}
|
|
64
|
+
icon="arrow_back"
|
|
65
|
+
className="a1-breadcrumb__back"
|
|
66
|
+
>
|
|
67
|
+
{backLabel}
|
|
68
|
+
</Link>
|
|
69
|
+
) : (
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
className="a1-breadcrumb__back"
|
|
73
|
+
onClick={backTarget.onClick}
|
|
74
|
+
>
|
|
75
|
+
<Icon name="arrow_back" className="a1-breadcrumb__back-icon" />
|
|
76
|
+
<span className="a1-breadcrumb__back-label">{backLabel}</span>
|
|
77
|
+
</button>
|
|
78
|
+
)
|
|
79
|
+
)}
|
|
80
|
+
</nav>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/* ── Shell ──────────────────────────────────────────────────────────────── */
|
|
2
|
+
|
|
3
|
+
.a1-breadcrumb {
|
|
4
|
+
container: a1-breadcrumb / inline-size;
|
|
5
|
+
font-size: var(--semantic-font-size-body-sm);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* ── Full list ──────────────────────────────────────────────────────────── */
|
|
9
|
+
|
|
10
|
+
.a1-breadcrumb__list {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
list-style: none;
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.a1-breadcrumb__item {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
min-width: 0;
|
|
24
|
+
flex-shrink: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Separator between items */
|
|
28
|
+
.a1-breadcrumb__item + .a1-breadcrumb__item::before {
|
|
29
|
+
content: "/";
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
padding-inline: var(--base-spacing-6);
|
|
32
|
+
color: var(--semantic-color-text-muted);
|
|
33
|
+
user-select: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* ── Item content: link, button, current, ancestor ─────────────────────── */
|
|
37
|
+
|
|
38
|
+
.a1-breadcrumb__link,
|
|
39
|
+
.a1-breadcrumb__current,
|
|
40
|
+
.a1-breadcrumb__ancestor {
|
|
41
|
+
display: block;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
text-overflow: ellipsis;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Anchor (Link component) */
|
|
49
|
+
a.a1-breadcrumb__link {
|
|
50
|
+
/* color/underline handled by .a1-link; block-level display above enables truncation */
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Button variant: style to match Link */
|
|
54
|
+
button.a1-breadcrumb__link {
|
|
55
|
+
background: none;
|
|
56
|
+
border: none;
|
|
57
|
+
padding: 0;
|
|
58
|
+
font: inherit;
|
|
59
|
+
font-family: var(--component-paragraph-font-family);
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
color: var(--component-link-color);
|
|
62
|
+
text-align: left;
|
|
63
|
+
text-decoration: underline;
|
|
64
|
+
text-decoration-color: currentColor;
|
|
65
|
+
text-underline-offset: var(--component-link-underline-offset);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
button.a1-breadcrumb__link:hover { color: var(--component-link-color-hover); }
|
|
69
|
+
button.a1-breadcrumb__link:active { color: var(--component-link-color-pressed); }
|
|
70
|
+
|
|
71
|
+
button.a1-breadcrumb__link:focus-visible {
|
|
72
|
+
outline: var(--component-link-focus-ring-width) solid currentColor;
|
|
73
|
+
outline-offset: var(--component-link-focus-ring-offset);
|
|
74
|
+
border-radius: var(--component-link-focus-ring-radius);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Current page */
|
|
78
|
+
.a1-breadcrumb__current {
|
|
79
|
+
color: var(--semantic-color-text-default);
|
|
80
|
+
font-weight: var(--base-font-weight-semibold);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Non-linked ancestor text */
|
|
84
|
+
.a1-breadcrumb__ancestor {
|
|
85
|
+
color: var(--semantic-color-text-muted);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ── Back link — hidden by default; shown in narrow containers ──────────── */
|
|
89
|
+
|
|
90
|
+
/* Higher specificity than .a1-link--has-icon to ensure display: none wins */
|
|
91
|
+
.a1-breadcrumb .a1-breadcrumb__back {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ── Responsive: narrow container ──────────────────────────────────────── */
|
|
96
|
+
|
|
97
|
+
@container a1-breadcrumb (max-width: 480px) {
|
|
98
|
+
.a1-breadcrumb__list {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.a1-breadcrumb .a1-breadcrumb__back {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
gap: var(--component-link-icon-gap, 0.25em);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Button variant back link */
|
|
109
|
+
button.a1-breadcrumb__back {
|
|
110
|
+
background: none;
|
|
111
|
+
border: none;
|
|
112
|
+
padding: 0;
|
|
113
|
+
font: inherit;
|
|
114
|
+
font-family: var(--component-paragraph-font-family);
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
color: var(--component-link-color);
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
button.a1-breadcrumb__back:hover { color: var(--component-link-color-hover); }
|
|
121
|
+
button.a1-breadcrumb__back:active { color: var(--component-link-color-pressed); }
|
|
122
|
+
|
|
123
|
+
.a1-breadcrumb__back-icon {
|
|
124
|
+
font-size: 1.1em;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.a1-breadcrumb__back-label {
|
|
129
|
+
text-decoration: underline;
|
|
130
|
+
text-decoration-color: currentColor;
|
|
131
|
+
text-underline-offset: var(--component-link-underline-offset);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
|
-
gap: var(--component-button-gap);
|
|
9
|
+
gap: var(--a1-button-gap, var(--component-button-gap));
|
|
10
10
|
border-width: var(--a1-button-border-width, var(--component-button-border-width));
|
|
11
11
|
border-style: solid;
|
|
12
12
|
border-radius: var(--a1-button-border-radius, var(--component-button-border-radius));
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
font-family: var(--component-button-font-family);
|
|
16
16
|
font-size: var(--a1-button-font-size, var(--component-button-font-size));
|
|
17
17
|
font-weight: var(--a1-button-font-weight, var(--component-button-font-weight));
|
|
18
|
+
--a1-icon-weight: 700;
|
|
18
19
|
line-height: var(--component-button-font-line-height);
|
|
19
20
|
text-decoration: none;
|
|
20
21
|
white-space: nowrap;
|
|
@@ -23,21 +24,33 @@
|
|
|
23
24
|
background: var(--a1-button-background);
|
|
24
25
|
border-color: var(--a1-button-border);
|
|
25
26
|
color: var(--a1-button-foreground);
|
|
27
|
+
box-shadow: var(--component-button-box-shadow, none);
|
|
28
|
+
transform: var(--component-button-hover-transform, none);
|
|
29
|
+
transition:
|
|
30
|
+
background var(--semantic-motion-duration-normal) var(--semantic-motion-easing-standard),
|
|
31
|
+
border-color var(--semantic-motion-duration-normal) var(--semantic-motion-easing-standard),
|
|
32
|
+
color var(--semantic-motion-duration-normal) var(--semantic-motion-easing-standard),
|
|
33
|
+
box-shadow var(--semantic-motion-duration-quick, 100ms) var(--semantic-motion-easing-standard),
|
|
34
|
+
transform var(--semantic-motion-duration-quick, 100ms) var(--semantic-motion-easing-standard);
|
|
26
35
|
}
|
|
27
36
|
|
|
28
|
-
.a1-button:hover {
|
|
37
|
+
.a1-button:not(:disabled):not([aria-disabled="true"]):hover {
|
|
29
38
|
background: var(--a1-button-background-hover);
|
|
30
39
|
border-color: var(--a1-button-border-hover, var(--a1-button-border));
|
|
31
40
|
color: var(--a1-button-foreground-hover, var(--a1-button-foreground));
|
|
41
|
+
box-shadow: var(--component-button-box-shadow-hover, var(--component-button-box-shadow, none));
|
|
42
|
+
transform: var(--component-button-hover-transform, none);
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
.a1-button:active {
|
|
45
|
+
.a1-button:not(:disabled):not([aria-disabled="true"]):active {
|
|
35
46
|
background: var(--a1-button-background-pressed);
|
|
36
47
|
border-color: var(--a1-button-border-pressed, var(--a1-button-border));
|
|
37
48
|
color: var(--a1-button-foreground-pressed, var(--a1-button-foreground));
|
|
49
|
+
box-shadow: var(--component-button-box-shadow-active, var(--component-button-box-shadow, none));
|
|
50
|
+
transform: var(--component-button-press-transform, none);
|
|
38
51
|
}
|
|
39
52
|
|
|
40
|
-
.a1-button:focus-visible {
|
|
53
|
+
.a1-button:not(:disabled):not([aria-disabled="true"]):focus-visible {
|
|
41
54
|
outline: var(--component-button-focus-ring-width) solid var(--component-button-focus-ring);
|
|
42
55
|
outline-offset: var(--component-button-focus-ring-offset);
|
|
43
56
|
}
|
|
@@ -46,6 +59,7 @@
|
|
|
46
59
|
.a1-button[aria-disabled="true"] {
|
|
47
60
|
cursor: not-allowed;
|
|
48
61
|
opacity: var(--component-button-disabled-opacity);
|
|
62
|
+
pointer-events: none;
|
|
49
63
|
}
|
|
50
64
|
|
|
51
65
|
.a1-button--primary {
|
|
@@ -114,22 +128,38 @@
|
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
.a1-button--sm {
|
|
117
|
-
--a1-button-height:
|
|
131
|
+
--a1-button-height: var(--component-button-small-height);
|
|
118
132
|
--a1-button-font-size: var(--semantic-font-size-body-sm);
|
|
119
133
|
--a1-button-font-weight: var(--base-font-weight-medium);
|
|
120
|
-
--a1-button-border-radius:
|
|
134
|
+
--a1-button-border-radius: var(--component-button-small-border-radius);
|
|
121
135
|
--a1-button-padding-inline: var(--base-spacing-8);
|
|
136
|
+
--a1-button-gap: var(--base-spacing-6);
|
|
137
|
+
--a1-button-icon-size: var(--component-button-small-icon-size);
|
|
138
|
+
--a1-button-icon-opsz: var(--component-button-small-icon-optical-size);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.a1-button--md {
|
|
142
|
+
--a1-button-font-weight: var(--base-font-weight-semibold);
|
|
143
|
+
--a1-button-icon-size: var(--component-button-medium-icon-size);
|
|
144
|
+
--a1-button-icon-opsz: var(--component-button-medium-icon-optical-size);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.a1-button--lg.a1-button--secondary {
|
|
148
|
+
--a1-button-border-width: var(--component-button-large-secondary-border-width);
|
|
122
149
|
}
|
|
123
150
|
|
|
124
151
|
.a1-button--lg {
|
|
125
|
-
--a1-
|
|
152
|
+
--a1-icon-weight: 900;
|
|
153
|
+
--a1-button-height: var(--component-button-large-height);
|
|
126
154
|
--a1-button-font-size: var(--semantic-font-size-body-lg);
|
|
127
155
|
--a1-button-font-weight: var(--base-font-weight-extra-bold);
|
|
128
|
-
--a1-button-border-radius: var(--base-radius-lg);
|
|
129
|
-
--a1-button-padding-inline: var(--base-spacing-
|
|
156
|
+
--a1-button-border-radius: var(--component-button-large-border-radius, var(--base-radius-lg));
|
|
157
|
+
--a1-button-padding-inline: var(--base-spacing-20);
|
|
158
|
+
--a1-button-icon-size: var(--component-button-icon-size);
|
|
159
|
+
--a1-button-icon-opsz: var(--component-button-icon-optical-size);
|
|
130
160
|
}
|
|
131
161
|
|
|
132
|
-
.a1-button__icon {
|
|
133
|
-
font-size: var(--component-button-icon-size);
|
|
134
|
-
--a1-icon-opsz: var(--component-button-icon-optical-size);
|
|
162
|
+
.a1-button .a1-button__icon {
|
|
163
|
+
font-size: var(--a1-button-icon-size, var(--component-button-icon-size));
|
|
164
|
+
--a1-icon-opsz: var(--a1-button-icon-opsz, var(--component-button-icon-optical-size));
|
|
135
165
|
}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
1
|
import "./button-container.css";
|
|
2
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
3
|
+
import { Button } from "../button/Button.jsx";
|
|
2
4
|
|
|
3
5
|
const alignments = ["start", "center", "end"];
|
|
6
|
+
const sizes = ["sm", "md", "lg"];
|
|
7
|
+
|
|
8
|
+
function applyButtonSize(children, size) {
|
|
9
|
+
if (!size) return children;
|
|
10
|
+
|
|
11
|
+
return Children.map(children, (child) => {
|
|
12
|
+
if (!isValidElement(child) || child.type !== Button || child.props.size) {
|
|
13
|
+
return child;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return cloneElement(child, { size });
|
|
17
|
+
});
|
|
18
|
+
}
|
|
4
19
|
|
|
5
20
|
export function ButtonContainer({
|
|
6
21
|
align = "start",
|
|
22
|
+
size,
|
|
7
23
|
className = "",
|
|
8
24
|
children,
|
|
9
25
|
...props
|
|
10
26
|
}) {
|
|
11
27
|
const resolvedAlign = alignments.includes(align) ? align : "start";
|
|
28
|
+
const resolvedSize = sizes.includes(size) ? size : null;
|
|
12
29
|
const classes = [
|
|
13
30
|
"a1-button-container",
|
|
14
31
|
`a1-button-container--${resolvedAlign}`,
|
|
32
|
+
resolvedSize && `a1-button-container--${resolvedSize}`,
|
|
15
33
|
className
|
|
16
34
|
]
|
|
17
35
|
.filter(Boolean)
|
|
18
36
|
.join(" ");
|
|
37
|
+
const resolvedChildren = applyButtonSize(children, resolvedSize);
|
|
19
38
|
|
|
20
39
|
return (
|
|
21
40
|
<div className={classes} {...props}>
|
|
22
41
|
<div className="a1-button-container__inner">
|
|
23
|
-
{
|
|
42
|
+
{resolvedChildren}
|
|
24
43
|
</div>
|
|
25
44
|
</div>
|
|
26
45
|
);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
.a1-button-container {
|
|
2
|
+
box-sizing: border-box;
|
|
2
3
|
container: a1-button-container / inline-size;
|
|
4
|
+
inline-size: 100%;
|
|
5
|
+
max-inline-size: 100%;
|
|
6
|
+
min-inline-size: 0;
|
|
3
7
|
}
|
|
4
8
|
|
|
5
9
|
.a1-button-container__inner {
|
|
@@ -13,6 +17,11 @@
|
|
|
13
17
|
width: 100%;
|
|
14
18
|
}
|
|
15
19
|
|
|
20
|
+
/* Links sit inline alongside buttons; vertically centered in row layout */
|
|
21
|
+
.a1-button-container__inner > .a1-link {
|
|
22
|
+
align-self: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
@container a1-button-container (min-width: 480px) {
|
|
17
26
|
.a1-button-container__inner {
|
|
18
27
|
flex-direction: row;
|
|
@@ -33,6 +42,15 @@
|
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
.a1-button-container--end .a1-button-container__inner {
|
|
36
|
-
|
|
45
|
+
/* row-reverse flips visual order so primary lands rightmost.
|
|
46
|
+
flex-start = pack toward the visual right in a reversed row. */
|
|
47
|
+
flex-direction: row-reverse;
|
|
48
|
+
justify-content: flex-start;
|
|
37
49
|
}
|
|
38
50
|
}
|
|
51
|
+
|
|
52
|
+
/* ── Size modifiers ──────────────────────────────────────────────────────── */
|
|
53
|
+
|
|
54
|
+
.a1-button-container--lg .a1-button-container__inner {
|
|
55
|
+
gap: var(--base-spacing-16) var(--base-spacing-24);
|
|
56
|
+
}
|