baseline-foundry 0.1.3
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/LICENSE +21 -0
- package/README.md +588 -0
- package/config/experiments/ibm-plex-engine-smoke.json +115 -0
- package/config/experiments/ubuntu-engine-smoke.json +115 -0
- package/config/foundation-theme.json +117 -0
- package/config/tiers/app.json +120 -0
- package/config/tiers/documentation.json +120 -0
- package/config/tiers/editorial.json +120 -0
- package/config/tiers/os.json +120 -0
- package/dist/accordion.d.ts +5 -0
- package/dist/accordion.js +32 -0
- package/dist/application-layout.d.ts +4 -0
- package/dist/application-layout.js +181 -0
- package/dist/baseline-grid-overlay.d.ts +5 -0
- package/dist/baseline-grid-overlay.js +50 -0
- package/dist/baseline-grid-theme.d.ts +3 -0
- package/dist/baseline-grid-theme.js +3 -0
- package/dist/baseline-grid.d.ts +7 -0
- package/dist/baseline-grid.js +35 -0
- package/dist/build.d.ts +21 -0
- package/dist/build.js +440 -0
- package/dist/code-snippet.d.ts +6 -0
- package/dist/code-snippet.js +95 -0
- package/dist/contextual-menu.d.ts +4 -0
- package/dist/contextual-menu.js +156 -0
- package/dist/css-app-tier.d.ts +1 -0
- package/dist/css-app-tier.js +77 -0
- package/dist/css-components/article-pagination.d.ts +13 -0
- package/dist/css-components/article-pagination.js +151 -0
- package/dist/css-components/button-actions.d.ts +7 -0
- package/dist/css-components/button-actions.js +165 -0
- package/dist/css-components/cards-options.d.ts +6 -0
- package/dist/css-components/cards-options.js +180 -0
- package/dist/css-components/chip-badge-status.d.ts +10 -0
- package/dist/css-components/chip-badge-status.js +162 -0
- package/dist/css-components/content-card.d.ts +25 -0
- package/dist/css-components/content-card.js +517 -0
- package/dist/css-components/control-row.d.ts +2 -0
- package/dist/css-components/control-row.js +18 -0
- package/dist/css-components/cta-figure-aspect.d.ts +1 -0
- package/dist/css-components/cta-figure-aspect.js +123 -0
- package/dist/css-components/document-navigation.d.ts +13 -0
- package/dist/css-components/document-navigation.js +400 -0
- package/dist/css-components/editorial-content.d.ts +6 -0
- package/dist/css-components/editorial-content.js +52 -0
- package/dist/css-components/icon.d.ts +1 -0
- package/dist/css-components/icon.js +75 -0
- package/dist/css-components/interactive-feedback.d.ts +2 -0
- package/dist/css-components/interactive-feedback.js +230 -0
- package/dist/css-components/interactive-tables.d.ts +7 -0
- package/dist/css-components/interactive-tables.js +164 -0
- package/dist/css-components/linked-logo-site-layout.d.ts +21 -0
- package/dist/css-components/linked-logo-site-layout.js +214 -0
- package/dist/css-components/list-tree.d.ts +5 -0
- package/dist/css-components/list-tree.js +98 -0
- package/dist/css-components/list.d.ts +3 -0
- package/dist/css-components/list.js +119 -0
- package/dist/css-components/logo-media.d.ts +16 -0
- package/dist/css-components/logo-media.js +219 -0
- package/dist/css-components/navigation-layout.d.ts +5 -0
- package/dist/css-components/navigation-layout.js +151 -0
- package/dist/css-components/panel.d.ts +6 -0
- package/dist/css-components/panel.js +148 -0
- package/dist/css-components/search-box-and-filter.d.ts +9 -0
- package/dist/css-components/search-box-and-filter.js +267 -0
- package/dist/css-components/sites-editorial-ports.d.ts +19 -0
- package/dist/css-components/sites-editorial-ports.js +264 -0
- package/dist/css-components/sites-foundation.d.ts +17 -0
- package/dist/css-components/sites-foundation.js +173 -0
- package/dist/css-components/sites-rich-lists.d.ts +18 -0
- package/dist/css-components/sites-rich-lists.js +364 -0
- package/dist/css-components/static-content-ports.d.ts +14 -0
- package/dist/css-components/static-content-ports.js +206 -0
- package/dist/css-components/tab-section.d.ts +19 -0
- package/dist/css-components/tab-section.js +103 -0
- package/dist/css-components/table.d.ts +7 -0
- package/dist/css-components/table.js +79 -0
- package/dist/css-components/tabs-choice-breadcrumbs.d.ts +9 -0
- package/dist/css-components/tabs-choice-breadcrumbs.js +307 -0
- package/dist/css-components/tiered-list-equal-height-row.d.ts +1 -0
- package/dist/css-components/tiered-list-equal-height-row.js +286 -0
- package/dist/css-components.d.ts +2 -0
- package/dist/css-components.js +2701 -0
- package/dist/css-grid.d.ts +1 -0
- package/dist/css-grid.js +179 -0
- package/dist/css.d.ts +6 -0
- package/dist/css.js +431 -0
- package/dist/experiments/ibm-plex-engine-smoke/styles.css +8969 -0
- package/dist/experiments/ibm-plex-engine-smoke/surfaces.json +604 -0
- package/dist/experiments/ibm-plex-engine-smoke/tokens.json +217 -0
- package/dist/in-page-navigation.d.ts +7 -0
- package/dist/in-page-navigation.js +136 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +18 -0
- package/dist/interactive-feedback.d.ts +14 -0
- package/dist/interactive-feedback.js +96 -0
- package/dist/interactive-tables.d.ts +28 -0
- package/dist/interactive-tables.js +184 -0
- package/dist/list-tree.d.ts +4 -0
- package/dist/list-tree.js +44 -0
- package/dist/panel-drawer.d.ts +4 -0
- package/dist/panel-drawer.js +171 -0
- package/dist/presets/app-tier/styles.css +9459 -0
- package/dist/presets/app-tier/surfaces.json +1225 -0
- package/dist/presets/app-tier/tokens.json +221 -0
- package/dist/presets/prose/styles.css +9442 -0
- package/dist/presets/prose/surfaces.json +1225 -0
- package/dist/presets/prose/tokens.json +221 -0
- package/dist/presets.d.ts +6 -0
- package/dist/presets.js +27 -0
- package/dist/range-controls.d.ts +9 -0
- package/dist/range-controls.js +73 -0
- package/dist/resizable-aside.d.ts +4 -0
- package/dist/resizable-aside.js +328 -0
- package/dist/side-navigation.d.ts +4 -0
- package/dist/side-navigation.js +219 -0
- package/dist/styles.css +9442 -0
- package/dist/surfaces.json +1225 -0
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.js +88 -0
- package/dist/tier-registry.d.ts +10 -0
- package/dist/tier-registry.js +25 -0
- package/dist/tiers/app/styles.css +9459 -0
- package/dist/tiers/app/surfaces.json +1225 -0
- package/dist/tiers/app/tokens.json +221 -0
- package/dist/tiers/documentation/styles.css +9442 -0
- package/dist/tiers/documentation/surfaces.json +1225 -0
- package/dist/tiers/documentation/tokens.json +221 -0
- package/dist/tiers/editorial/styles.css +9442 -0
- package/dist/tiers/editorial/surfaces.json +1225 -0
- package/dist/tiers/editorial/tokens.json +221 -0
- package/dist/tiers/os/styles.css +9442 -0
- package/dist/tiers/os/surfaces.json +1225 -0
- package/dist/tiers/os/tokens.json +221 -0
- package/dist/tokens.json +221 -0
- package/dist/tooltip.d.ts +4 -0
- package/dist/tooltip.js +70 -0
- package/dist/top-navigation.d.ts +4 -0
- package/dist/top-navigation.js +354 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.js +1 -0
- package/dist/vanilla-theme-colors.d.ts +5 -0
- package/dist/vanilla-theme-colors.js +208 -0
- package/docs/publishing.md +66 -0
- package/package.json +108 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
const TOGGLE_SELECTOR = ".bf-contextual-menu-toggle";
|
|
2
|
+
const DROPDOWN_SELECTOR = ".bf-contextual-menu-dropdown";
|
|
3
|
+
const MENU_SELECTOR = ".bf-contextual-menu";
|
|
4
|
+
const LINK_SELECTOR = ".bf-contextual-menu-link";
|
|
5
|
+
function queryAllWithinRoot(root, selector) {
|
|
6
|
+
const elements = Array.from(root.querySelectorAll(selector));
|
|
7
|
+
if (root instanceof Element && root.matches(selector)) {
|
|
8
|
+
elements.unshift(root);
|
|
9
|
+
}
|
|
10
|
+
return elements;
|
|
11
|
+
}
|
|
12
|
+
function getMenus(root) {
|
|
13
|
+
return queryAllWithinRoot(root, MENU_SELECTOR);
|
|
14
|
+
}
|
|
15
|
+
function getToggle(menu) {
|
|
16
|
+
return menu.querySelector(TOGGLE_SELECTOR);
|
|
17
|
+
}
|
|
18
|
+
function getMenuItems(menu) {
|
|
19
|
+
return Array.from(menu.querySelectorAll(LINK_SELECTOR)).filter(item => {
|
|
20
|
+
return !item.matches(".is-disabled, [aria-disabled='true']");
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function closeMenu(menu, restoreFocus = false) {
|
|
24
|
+
const dropdown = menu.querySelector(DROPDOWN_SELECTOR);
|
|
25
|
+
if (dropdown) {
|
|
26
|
+
dropdown.setAttribute("aria-hidden", "true");
|
|
27
|
+
}
|
|
28
|
+
const toggle = getToggle(menu);
|
|
29
|
+
if (toggle) {
|
|
30
|
+
toggle.setAttribute("aria-expanded", "false");
|
|
31
|
+
}
|
|
32
|
+
if (restoreFocus && toggle) {
|
|
33
|
+
toggle.focus();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function openMenu(menu, focusIndex) {
|
|
37
|
+
const dropdown = menu.querySelector(DROPDOWN_SELECTOR);
|
|
38
|
+
if (dropdown) {
|
|
39
|
+
dropdown.setAttribute("aria-hidden", "false");
|
|
40
|
+
}
|
|
41
|
+
const toggle = getToggle(menu);
|
|
42
|
+
if (toggle) {
|
|
43
|
+
toggle.setAttribute("aria-expanded", "true");
|
|
44
|
+
}
|
|
45
|
+
if (focusIndex !== undefined) {
|
|
46
|
+
const items = getMenuItems(menu);
|
|
47
|
+
items[focusIndex]?.focus();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function isMenuOpen(menu) {
|
|
51
|
+
const dropdown = menu.querySelector(DROPDOWN_SELECTOR);
|
|
52
|
+
return dropdown?.getAttribute("aria-hidden") !== "true";
|
|
53
|
+
}
|
|
54
|
+
export function initContextualMenus(options = {}) {
|
|
55
|
+
const root = options.root ?? document;
|
|
56
|
+
const onClick = (event) => {
|
|
57
|
+
const target = event.target;
|
|
58
|
+
if (!(target instanceof Element)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const toggle = target.closest(TOGGLE_SELECTOR);
|
|
62
|
+
if (toggle) {
|
|
63
|
+
const menu = toggle.closest(MENU_SELECTOR);
|
|
64
|
+
if (menu) {
|
|
65
|
+
if (isMenuOpen(menu)) {
|
|
66
|
+
closeMenu(menu);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
for (const otherMenu of getMenus(root)) {
|
|
70
|
+
if (otherMenu !== menu && isMenuOpen(otherMenu)) {
|
|
71
|
+
closeMenu(otherMenu);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
openMenu(menu);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const link = target.closest(LINK_SELECTOR);
|
|
81
|
+
if (link) {
|
|
82
|
+
const menu = link.closest(MENU_SELECTOR);
|
|
83
|
+
if (menu) {
|
|
84
|
+
closeMenu(menu);
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
for (const menu of getMenus(root)) {
|
|
89
|
+
if (isMenuOpen(menu) && !menu.contains(target)) {
|
|
90
|
+
closeMenu(menu);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const onKeyDown = (event) => {
|
|
95
|
+
if (!(event instanceof KeyboardEvent)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const target = event.target;
|
|
99
|
+
if (!(target instanceof Element)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const menu = target.closest(MENU_SELECTOR);
|
|
103
|
+
const toggle = target.closest(TOGGLE_SELECTOR);
|
|
104
|
+
const link = target.closest(LINK_SELECTOR);
|
|
105
|
+
if (event.key === "Escape") {
|
|
106
|
+
for (const openMenuElement of getMenus(root)) {
|
|
107
|
+
if (isMenuOpen(openMenuElement)) {
|
|
108
|
+
closeMenu(openMenuElement, true);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (toggle && menu) {
|
|
114
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
openMenu(menu, 0);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (event.key === "ArrowUp") {
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
const items = getMenuItems(menu);
|
|
122
|
+
openMenu(menu, items.length - 1);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (link && menu && isMenuOpen(menu)) {
|
|
127
|
+
const items = getMenuItems(menu);
|
|
128
|
+
const index = items.indexOf(link);
|
|
129
|
+
if (index === -1) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (event.key === "ArrowDown") {
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
items[(index + 1) % items.length]?.focus();
|
|
135
|
+
}
|
|
136
|
+
else if (event.key === "ArrowUp") {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
items[(index - 1 + items.length) % items.length]?.focus();
|
|
139
|
+
}
|
|
140
|
+
else if (event.key === "Home") {
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
items[0]?.focus();
|
|
143
|
+
}
|
|
144
|
+
else if (event.key === "End") {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
items[items.length - 1]?.focus();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
root.addEventListener("click", onClick);
|
|
151
|
+
root.addEventListener("keydown", onKeyDown);
|
|
152
|
+
return () => {
|
|
153
|
+
root.removeEventListener("click", onClick);
|
|
154
|
+
root.removeEventListener("keydown", onKeyDown);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function appTierPresetCss(scopes: string[]): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export function appTierPresetCss(scopes) {
|
|
2
|
+
const scoped = (suffix = "") => scopes.map(scope => `${scope}${suffix}`).join(",\n");
|
|
3
|
+
return `/* Canonical app-tier preset: light application chrome, Ubuntu Sans, and app-surface control overrides. */
|
|
4
|
+
${scoped()} {
|
|
5
|
+
--bf-app-demo-page-bg: var(--vf-color-background-alt, #f7f7f7);
|
|
6
|
+
--bf-radius: 0;
|
|
7
|
+
color-scheme: light;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
${scoped(" :where(.bf-form-label, .bf-form-help, .bf-button, .bf-button.is-base, .bf-status-label, .bf-chip, .bf-checkbox-label, .bf-radio-label, .bf-tabs-link, .bf-accordion-tab, .bf-validation-message)")} {
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
font-size: 0.875rem;
|
|
13
|
+
font-style: normal;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
line-height: 1.25rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${scoped(" :where(.bf-input, .bf-button, .bf-button.is-base)")} {
|
|
19
|
+
font-family: inherit;
|
|
20
|
+
font-size: 0.875rem;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 400;
|
|
23
|
+
line-height: 1.25rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${scoped(" :where(.bf-application)")} {
|
|
27
|
+
background: var(--bf-app-demo-page-bg);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
${scoped(" :where(.bf-navigation-drawer)")},
|
|
31
|
+
${scoped(" :where(.bf-navigation:not(.is-collapsed)) > :where(.bf-navigation-drawer)")},
|
|
32
|
+
${scoped(" :where(.bf-aside.is-overlay, .bf-aside.is-drawer)")} {
|
|
33
|
+
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 0 0 3px rgba(0, 0, 0, 0.12);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
${scoped(" :where(.bf-panel-header)")} {
|
|
37
|
+
align-items: start;
|
|
38
|
+
gap: calc(var(--bf-baseline) * 1.5);
|
|
39
|
+
padding-block-end: var(--bf-panel-padding-block);
|
|
40
|
+
padding-block-start: var(--bf-panel-padding-block);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${scoped(" :where(.bf-panel-header.is-navigation-brand)")} {
|
|
44
|
+
gap: 0;
|
|
45
|
+
padding-block: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
${scoped(" :where(.bf-navigation-bar) :where(.bf-panel-header)")} {
|
|
49
|
+
padding-block-end: calc(var(--bf-panel-padding-block) - var(--bf-border-width));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
${scoped(" :where(.bf-panel-controls)")} {
|
|
53
|
+
gap: calc(var(--bf-baseline) * 1.5);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
${scoped(" :where(.bf-navigation-bar, .bf-navigation-drawer, .bf-aside) :where(.bf-panel-title)")} {
|
|
57
|
+
font-family: inherit;
|
|
58
|
+
font-size: 1rem;
|
|
59
|
+
font-style: normal;
|
|
60
|
+
font-weight: 400;
|
|
61
|
+
line-height: 1.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
${scoped(" :where(.bf-side-navigation-link.is-active, .bf-side-navigation-link[aria-current='page'], .bf-side-navigation-link[aria-current='true'])")} {
|
|
65
|
+
background: transparent;
|
|
66
|
+
box-shadow: inset var(--bf-bar-thickness) 0 0 var(--vf-color-link-default, #0066cc);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
${scoped(" :where(.bf-navigation-bar)")},
|
|
70
|
+
${scoped(" :where(.bf-navigation-drawer)")},
|
|
71
|
+
${scoped(" :where(.bf-aside)")},
|
|
72
|
+
${scoped(" :where(.bf-panel)")} {
|
|
73
|
+
background: var(--vf-color-background-default, #ffffff);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type ArticlePaginationCssOptions = {
|
|
2
|
+
bodyCaseTypeStyles: string;
|
|
3
|
+
titleTypeStyles: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Sequential documentation navigation. This intentionally does not share the
|
|
7
|
+
* numbered-pagination API: article destinations need their direction and full
|
|
8
|
+
* title in the accessible name at every container width. Current Vanilla's
|
|
9
|
+
* persistent row, directional halves and compact previous link are retained;
|
|
10
|
+
* BF typography and metric compensation keep the occupied block on-grid.
|
|
11
|
+
*/
|
|
12
|
+
export declare function articlePaginationCss(options: ArticlePaginationCssOptions): string;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sequential documentation navigation. This intentionally does not share the
|
|
3
|
+
* numbered-pagination API: article destinations need their direction and full
|
|
4
|
+
* title in the accessible name at every container width. Current Vanilla's
|
|
5
|
+
* persistent row, directional halves and compact previous link are retained;
|
|
6
|
+
* BF typography and metric compensation keep the occupied block on-grid.
|
|
7
|
+
*/
|
|
8
|
+
export function articlePaginationCss(options) {
|
|
9
|
+
const { bodyCaseTypeStyles, titleTypeStyles } = options;
|
|
10
|
+
return `:where(.bf-theme) :where(.bf-article-pagination) {
|
|
11
|
+
container-name: bf-article-pagination;
|
|
12
|
+
container-type: inline-size;
|
|
13
|
+
display: grid;
|
|
14
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
15
|
+
margin-block-end: var(--bf-section-space-shallow);
|
|
16
|
+
min-inline-size: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:where(.bf-theme) :where(.bf-article-pagination-link) {
|
|
20
|
+
background-color: var(--bf-color-background-default);
|
|
21
|
+
border: var(--bf-border-width) solid transparent;
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
color: var(--bf-color-text-default);
|
|
24
|
+
display: grid;
|
|
25
|
+
column-gap: var(--bf-space-2);
|
|
26
|
+
grid-template-rows: auto auto;
|
|
27
|
+
inline-size: calc((100cqi - var(--bf-space-2)) / 2);
|
|
28
|
+
min-inline-size: 0;
|
|
29
|
+
padding-block: calc(var(--bf-space-2) + (var(--bf-baseline) / 4) - var(--bf-border-width));
|
|
30
|
+
position: relative;
|
|
31
|
+
row-gap: var(--bf-space-half);
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:where(.bf-theme) :where(.bf-article-pagination-link:hover) {
|
|
36
|
+
background-color: var(--bf-color-background-hover);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:where(.bf-theme) :where(.bf-article-pagination-link:focus:not(:focus-visible)) {
|
|
40
|
+
outline: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:where(.bf-theme) :where(.bf-article-pagination-link:focus-visible) {
|
|
44
|
+
outline: 2px solid var(--bf-color-focus);
|
|
45
|
+
outline-offset: 2px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous) {
|
|
49
|
+
grid-column: 1;
|
|
50
|
+
grid-template-columns: var(--bf-icon-size-default) minmax(0, 1fr);
|
|
51
|
+
padding-inline: var(--bf-space-1) var(--bf-space-2);
|
|
52
|
+
text-align: start;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-next) {
|
|
56
|
+
grid-column: 2;
|
|
57
|
+
grid-template-columns: minmax(0, 1fr) var(--bf-icon-size-default);
|
|
58
|
+
justify-self: end;
|
|
59
|
+
padding-inline: var(--bf-space-2) var(--bf-space-1);
|
|
60
|
+
text-align: end;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(.bf-theme) :where(.bf-article-pagination-direction) {
|
|
64
|
+
${bodyCaseTypeStyles} color: inherit;
|
|
65
|
+
display: contents;
|
|
66
|
+
margin: 0;
|
|
67
|
+
min-inline-size: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous .bf-icon) {
|
|
71
|
+
align-self: center;
|
|
72
|
+
grid-column: 1;
|
|
73
|
+
grid-row: 1;
|
|
74
|
+
justify-self: start;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous .bf-article-pagination-label),
|
|
78
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous .bf-article-pagination-title) {
|
|
79
|
+
grid-column: 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-next .bf-icon) {
|
|
83
|
+
align-self: center;
|
|
84
|
+
grid-column: 2;
|
|
85
|
+
grid-row: 1;
|
|
86
|
+
justify-self: end;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-next .bf-article-pagination-label),
|
|
90
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-next .bf-article-pagination-title) {
|
|
91
|
+
grid-column: 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:where(.bf-theme) :where(.bf-article-pagination-direction > .bf-icon) {
|
|
95
|
+
--bf-icon-size: var(--bf-icon-size-default);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:where(.bf-theme) .bf-article-pagination:dir(rtl) .bf-article-pagination-link.is-previous .bf-icon {
|
|
99
|
+
--bf-icon-transform: rotate(-90deg);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:where(.bf-theme) .bf-article-pagination:dir(rtl) .bf-article-pagination-link.is-next .bf-icon {
|
|
103
|
+
--bf-icon-transform: rotate(90deg);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:where(.bf-theme) :where(.bf-article-pagination-label) {
|
|
107
|
+
grid-row: 1;
|
|
108
|
+
min-inline-size: 0;
|
|
109
|
+
overflow-wrap: anywhere;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
:where(.bf-theme) :where(.bf-article-pagination-title) {
|
|
113
|
+
${titleTypeStyles} color: inherit;
|
|
114
|
+
grid-row: 2;
|
|
115
|
+
margin: 0;
|
|
116
|
+
overflow-wrap: anywhere;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@container bf-article-pagination (width < 28.75rem) {
|
|
120
|
+
:where(.bf-theme) :where(.bf-article-pagination-link:only-child) {
|
|
121
|
+
grid-column: 1 / -1;
|
|
122
|
+
inline-size: 100%;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous:not(:only-child)) {
|
|
126
|
+
grid-template-columns: var(--bf-icon-size-default);
|
|
127
|
+
inline-size: calc(var(--bf-space-6) + var(--bf-space-1));
|
|
128
|
+
padding-inline: var(--bf-space-1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-next:not(:only-child)) {
|
|
132
|
+
inline-size: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous:not(:only-child) .bf-article-pagination-label),
|
|
136
|
+
:where(.bf-theme) :where(.bf-article-pagination-link.is-previous:not(:only-child) .bf-article-pagination-title) {
|
|
137
|
+
block-size: 1px;
|
|
138
|
+
border: 0;
|
|
139
|
+
clip: rect(0 0 0 0);
|
|
140
|
+
clip-path: inset(50%);
|
|
141
|
+
inline-size: 1px;
|
|
142
|
+
margin: -1px;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
padding: 0;
|
|
145
|
+
position: absolute;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export function buttonActionsCss(options) {
|
|
2
|
+
const { bodyTypeStyles, buttonMarginBottom, buttonPadding } = options;
|
|
3
|
+
return `:where(.bf-theme) :where(.bf-button, .bf-button.is-base) {
|
|
4
|
+
${bodyTypeStyles} appearance: none;
|
|
5
|
+
background-color: var(--bf-color-background-default);
|
|
6
|
+
border: var(--bf-border-width) solid var(--bf-color-border-high-contrast);
|
|
7
|
+
border-radius: var(--bf-radius);
|
|
8
|
+
color: var(--bf-color-text-default);
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
display: inline-block;
|
|
11
|
+
margin-bottom: ${buttonMarginBottom};
|
|
12
|
+
${buttonPadding} padding-inline: var(--bf-control-inline-padding-action);
|
|
13
|
+
text-align: center;
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:where(.bf-theme) :where(.bf-button) {
|
|
18
|
+
background-color: var(--bf-color-background-default);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:where(.bf-theme) :where(.bf-button.is-base) {
|
|
22
|
+
background-color: transparent;
|
|
23
|
+
border-color: transparent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:where(.bf-theme) :where(.bf-button:hover, .bf-button.is-base:hover) {
|
|
27
|
+
background-color: var(--bf-color-background-hover);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:where(.bf-theme) :where(.bf-button:not(.is-base):is(:active, [aria-pressed='true'])) {
|
|
31
|
+
background-color: var(--bf-color-background-active);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:where(.bf-theme) :where(.bf-button, .bf-button.is-base):focus:not(:focus-visible) {
|
|
35
|
+
outline: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:where(.bf-theme) :where(.bf-button, .bf-button.is-base):focus-visible {
|
|
39
|
+
outline: 2px solid var(--bf-color-focus);
|
|
40
|
+
outline-offset: 2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ------------------------------------------------------------------ */
|
|
44
|
+
/* Button — semantic positive modifier (Vanilla parity). */
|
|
45
|
+
/* Vanilla uses themed positive tokens for default/hover/active */
|
|
46
|
+
/* backgrounds plus a white text colour on a coloured surface. */
|
|
47
|
+
/* ------------------------------------------------------------------ */
|
|
48
|
+
|
|
49
|
+
:where(.bf-theme) :where(.bf-button.is-positive) {
|
|
50
|
+
background-color: var(--bf-color-button-positive-default);
|
|
51
|
+
border-color: var(--bf-color-button-positive-default);
|
|
52
|
+
color: var(--bf-color-button-positive-text);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:where(.bf-theme) :where(.bf-button.is-positive:hover) {
|
|
56
|
+
background-color: var(--bf-color-button-positive-hover);
|
|
57
|
+
border-color: var(--bf-color-button-positive-hover);
|
|
58
|
+
color: var(--bf-color-button-positive-text);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where(.bf-theme) :where(.bf-button.is-positive:is(:active, [aria-pressed='true'])) {
|
|
62
|
+
background-color: var(--bf-color-button-positive-active);
|
|
63
|
+
border-color: var(--bf-color-button-positive-active);
|
|
64
|
+
color: var(--bf-color-button-positive-text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ------------------------------------------------------------------ */
|
|
68
|
+
/* Button — semantic negative modifier (Vanilla parity). */
|
|
69
|
+
/* Vanilla uses themed negative tokens for default/hover/active */
|
|
70
|
+
/* backgrounds plus a white text colour on a coloured surface. */
|
|
71
|
+
/* ------------------------------------------------------------------ */
|
|
72
|
+
|
|
73
|
+
:where(.bf-theme) :where(.bf-button.is-negative) {
|
|
74
|
+
background-color: var(--bf-color-button-negative-default);
|
|
75
|
+
border-color: var(--bf-color-button-negative-default);
|
|
76
|
+
color: var(--bf-color-button-negative-text);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where(.bf-theme) :where(.bf-button.is-negative:hover) {
|
|
80
|
+
background-color: var(--bf-color-button-negative-hover);
|
|
81
|
+
border-color: var(--bf-color-button-negative-hover);
|
|
82
|
+
color: var(--bf-color-button-negative-text);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:where(.bf-theme) :where(.bf-button.is-negative:is(:active, [aria-pressed='true'])) {
|
|
86
|
+
background-color: var(--bf-color-button-negative-active);
|
|
87
|
+
border-color: var(--bf-color-button-negative-active);
|
|
88
|
+
color: var(--bf-color-button-negative-text);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ------------------------------------------------------------------ */
|
|
92
|
+
/* Button — link-style modifier (Vanilla parity). */
|
|
93
|
+
/* BF starts from the shared button control contract, so the modifier */
|
|
94
|
+
/* has to strip control chrome and padding back down to inline-link */
|
|
95
|
+
/* behavior while reusing the shared link tokens. */
|
|
96
|
+
/* ------------------------------------------------------------------ */
|
|
97
|
+
|
|
98
|
+
:where(.bf-theme) :where(.bf-button.is-link) {
|
|
99
|
+
background-color: transparent;
|
|
100
|
+
border: 0;
|
|
101
|
+
border-radius: 0;
|
|
102
|
+
color: var(--bf-color-link-default);
|
|
103
|
+
margin-bottom: 0;
|
|
104
|
+
padding-block: 0;
|
|
105
|
+
padding-inline: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where(.bf-theme) :where(.bf-button.is-link:hover) {
|
|
109
|
+
background-color: transparent;
|
|
110
|
+
color: var(--bf-color-link-default);
|
|
111
|
+
text-decoration: underline;
|
|
112
|
+
text-decoration-thickness: 1px;
|
|
113
|
+
text-underline-offset: 0.075em;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:where(.bf-theme) :where(.bf-button.is-link:focus-visible) {
|
|
117
|
+
outline-offset: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ------------------------------------------------------------------ */
|
|
121
|
+
/* Button — icon-spacing modifier (Vanilla parity). */
|
|
122
|
+
/* Icon buttons make the icon/label relationship explicit. Bare text */
|
|
123
|
+
/* nodes cannot be distinguished from icon-only buttons in CSS because */
|
|
124
|
+
/* :first-child/:last-child ignore text nodes. A real label slot lets */
|
|
125
|
+
/* the component use one truthful, token-driven gap in either order. */
|
|
126
|
+
/* ------------------------------------------------------------------ */
|
|
127
|
+
|
|
128
|
+
:where(.bf-theme) :where(.bf-button.is-icon) > :where(.bf-icon) {
|
|
129
|
+
margin: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where(.bf-theme) :where(.bf-button.is-icon) {
|
|
133
|
+
align-items: center;
|
|
134
|
+
column-gap: var(--bf-space-1);
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:where(.bf-theme) :where(.bf-button-label) {
|
|
140
|
+
min-inline-size: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:where(.bf-theme) :where(.bf-actions) {
|
|
144
|
+
align-items: center;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-wrap: wrap;
|
|
147
|
+
gap: var(--bf-field-gap);
|
|
148
|
+
min-inline-size: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:where(.bf-theme) :where(.bf-actions.is-end) {
|
|
152
|
+
justify-content: flex-end;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
:where(.bf-theme) :where(.bf-actions.is-nowrap) {
|
|
156
|
+
flex-wrap: nowrap;
|
|
157
|
+
overflow-x: auto;
|
|
158
|
+
scrollbar-width: thin;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:where(.bf-theme) :where(.bf-actions.is-nowrap) > * {
|
|
162
|
+
flex: 0 0 auto;
|
|
163
|
+
}
|
|
164
|
+
`;
|
|
165
|
+
}
|