@buffercreations/levelsui 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.
- package/01. Elements/.gitkeep +0 -0
- package/01. Elements/actions/controls/button/api.json +106 -0
- package/01. Elements/actions/controls/button/button.definition.json +38 -0
- package/01. Elements/actions/controls/button/button.scss +80 -0
- package/01. Elements/actions/controls/button/docs.md +41 -0
- package/01. Elements/actions/controls/button/examples/contexts/code.html +3 -0
- package/01. Elements/actions/controls/button/examples/contexts/preview.html +3 -0
- package/01. Elements/actions/controls/button/examples/icons/code.html +6 -0
- package/01. Elements/actions/controls/button/examples/icons/preview.html +5 -0
- package/01. Elements/actions/controls/button/examples/index.json +51 -0
- package/01. Elements/actions/controls/button/examples/links/code.html +1 -0
- package/01. Elements/actions/controls/button/examples/links/preview.html +3 -0
- package/01. Elements/actions/controls/button/examples/native-default/code.html +9 -0
- package/01. Elements/actions/controls/button/examples/native-default/preview.html +9 -0
- package/01. Elements/actions/controls/button/examples/sizes/code.html +1 -0
- package/01. Elements/actions/controls/button/examples/sizes/preview.html +7 -0
- package/01. Elements/actions/controls/button/examples/states/code.html +1 -0
- package/01. Elements/actions/controls/button/examples/states/preview.html +5 -0
- package/01. Elements/actions/controls/button/examples/treatments/code.html +1 -0
- package/01. Elements/actions/controls/button/examples/treatments/preview.html +5 -0
- package/01. Elements/media/identity/avatar/api.json +126 -0
- package/01. Elements/media/identity/avatar/avatar.definition.json +38 -0
- package/01. Elements/media/identity/avatar/avatar.scss +80 -0
- package/01. Elements/media/identity/avatar/docs.md +64 -0
- package/01. Elements/media/identity/avatar/examples/badges/code.html +10 -0
- package/01. Elements/media/identity/avatar/examples/badges/preview.html +29 -0
- package/01. Elements/media/identity/avatar/examples/fallbacks/code.html +5 -0
- package/01. Elements/media/identity/avatar/examples/fallbacks/preview.html +23 -0
- package/01. Elements/media/identity/avatar/examples/index.json +37 -0
- package/01. Elements/media/identity/avatar/examples/presence/code.html +6 -0
- package/01. Elements/media/identity/avatar/examples/presence/preview.html +26 -0
- package/01. Elements/media/identity/avatar/examples/shapes/code.html +5 -0
- package/01. Elements/media/identity/avatar/examples/shapes/preview.html +17 -0
- package/01. Elements/media/identity/avatar/examples/sizes/code.html +5 -0
- package/01. Elements/media/identity/avatar/examples/sizes/preview.html +32 -0
- package/02. Layouts/.gitkeep +0 -0
- package/02. Layouts/UTILITY-RECIPES.md +55 -0
- package/02. Layouts/application/app-shell/api.json +46 -0
- package/02. Layouts/application/app-shell/app-shell.definition.json +25 -0
- package/02. Layouts/application/app-shell/app-shell.scss +68 -0
- package/02. Layouts/application/app-shell/docs.md +31 -0
- package/02. Layouts/application/app-shell/examples/basic/code.html +17 -0
- package/02. Layouts/application/app-shell/examples/basic/preview.html +17 -0
- package/02. Layouts/application/app-shell/examples/collapsed/code.html +17 -0
- package/02. Layouts/application/app-shell/examples/collapsed/preview.html +17 -0
- package/02. Layouts/application/app-shell/examples/hidden/code.html +17 -0
- package/02. Layouts/application/app-shell/examples/hidden/preview.html +17 -0
- package/02. Layouts/application/app-shell/examples/index.json +23 -0
- package/02. Layouts/composition/stack/api.json +1 -0
- package/02. Layouts/composition/stack/docs.md +5 -0
- package/02. Layouts/composition/stack/examples/basic/code.html +4 -0
- package/02. Layouts/composition/stack/examples/basic/preview.html +4 -0
- package/02. Layouts/composition/stack/examples/index.json +1 -0
- package/02. Layouts/composition/stack/stack.definition.json +7 -0
- package/02. Layouts/composition/stack/stack.html +4 -0
- package/02. Layouts/content/grid/api.json +23 -0
- package/02. Layouts/content/grid/docs.md +19 -0
- package/02. Layouts/content/grid/examples/basic/code.html +5 -0
- package/02. Layouts/content/grid/examples/basic/preview.html +5 -0
- package/02. Layouts/content/grid/examples/index.json +9 -0
- package/02. Layouts/content/grid/grid.definition.json +25 -0
- package/02. Layouts/content/grid/grid.scss +5 -0
- package/02. Layouts/content/split/api.json +23 -0
- package/02. Layouts/content/split/docs.md +18 -0
- package/02. Layouts/content/split/examples/basic/code.html +4 -0
- package/02. Layouts/content/split/examples/basic/preview.html +4 -0
- package/02. Layouts/content/split/examples/index.json +9 -0
- package/02. Layouts/content/split/split.definition.json +25 -0
- package/02. Layouts/content/split/split.scss +7 -0
- package/02. Layouts/primitives/overlay/api.json +23 -0
- package/02. Layouts/primitives/overlay/docs.md +19 -0
- package/02. Layouts/primitives/overlay/examples/basic/code.html +5 -0
- package/02. Layouts/primitives/overlay/examples/basic/preview.html +5 -0
- package/02. Layouts/primitives/overlay/examples/index.json +9 -0
- package/02. Layouts/primitives/overlay/overlay.definition.json +25 -0
- package/02. Layouts/primitives/overlay/overlay.scss +4 -0
- package/02. Layouts/sections/section/api.json +23 -0
- package/02. Layouts/sections/section/docs.md +19 -0
- package/02. Layouts/sections/section/examples/basic/code.html +5 -0
- package/02. Layouts/sections/section/examples/basic/preview.html +5 -0
- package/02. Layouts/sections/section/examples/index.json +9 -0
- package/02. Layouts/sections/section/section.definition.json +25 -0
- package/02. Layouts/sections/section/section.scss +4 -0
- package/02. Layouts/sections/sidebar/api.json +23 -0
- package/02. Layouts/sections/sidebar/docs.md +18 -0
- package/02. Layouts/sections/sidebar/examples/basic/code.html +4 -0
- package/02. Layouts/sections/sidebar/examples/basic/preview.html +4 -0
- package/02. Layouts/sections/sidebar/examples/index.json +9 -0
- package/02. Layouts/sections/sidebar/sidebar.definition.json +25 -0
- package/02. Layouts/sections/sidebar/sidebar.scss +7 -0
- package/03. Components/.gitkeep +0 -0
- package/04. Templates/.gitkeep +0 -0
- package/05. Pages/.gitkeep +0 -0
- package/LICENSE +17 -0
- package/README.md +95 -2
- package/dist/components/app-shell.css +95 -0
- package/dist/components/avatar.css +232 -0
- package/dist/components/button.css +150 -0
- package/dist/components/grid.css +22 -0
- package/dist/components/overlay.css +17 -0
- package/dist/components/section.css +14 -0
- package/dist/components/sidebar.css +22 -0
- package/dist/components/split.css +22 -0
- package/package.json +48 -4
- package/schemas/reusable-ui.schema.json +351 -0
- package/tooling/cli/build.mjs +82 -0
- package/tooling/cli/cli.mjs +56 -0
- package/tooling/cli/migrate.mjs +57 -0
- package/tooling/cli/project.mjs +261 -0
- package/tooling/cli/registry-location.mjs +32 -0
- package/tooling/cli/registry.mjs +3 -0
- package/tooling/registry/definitions.mjs +69 -0
- package/tooling/registry/index.mjs +3 -0
- package/tooling/registry/paths.mjs +15 -0
- package/tools/build-css.mjs +75 -0
- package/tools/validate.mjs +6 -0
|
File without changes
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"variants": [
|
|
3
|
+
{
|
|
4
|
+
"id": "solid",
|
|
5
|
+
"className": "bce-button",
|
|
6
|
+
"default": true
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "outline",
|
|
10
|
+
"className": "bce-button--outline"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "ghost",
|
|
14
|
+
"className": "bce-button--ghost"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"sizes": [
|
|
18
|
+
{
|
|
19
|
+
"id": "56",
|
|
20
|
+
"className": "bce-button--56"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "48",
|
|
24
|
+
"className": "bce-button--48"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "40",
|
|
28
|
+
"className": "bce-button--40",
|
|
29
|
+
"default": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "32",
|
|
33
|
+
"className": "bce-button--32"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "24",
|
|
37
|
+
"className": "bce-button--24"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"anatomy": [
|
|
41
|
+
"label",
|
|
42
|
+
"icon (optional)"
|
|
43
|
+
],
|
|
44
|
+
"properties": [
|
|
45
|
+
{
|
|
46
|
+
"name": "Native button default",
|
|
47
|
+
"type": "HTML element selector",
|
|
48
|
+
"default": "on",
|
|
49
|
+
"description": "Every <button> is styled automatically when the Button asset CSS is loaded; .bce-button remains available explicitly."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "Treatment",
|
|
53
|
+
"type": "CSS class",
|
|
54
|
+
"default": "solid",
|
|
55
|
+
"description": "Solid by default; optional outline or ghost modifier."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "Size",
|
|
59
|
+
"type": "CSS class",
|
|
60
|
+
"default": "40",
|
|
61
|
+
"description": "Preset heights: 56, 48, 40, 32 and 24."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "Icon-only",
|
|
65
|
+
"type": "CSS class",
|
|
66
|
+
"default": "off",
|
|
67
|
+
"description": "Apply bce-button--icon-only and provide an accessible name."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "Disabled",
|
|
71
|
+
"type": "native attribute",
|
|
72
|
+
"default": "false",
|
|
73
|
+
"description": "Use the native disabled attribute on button elements."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "ARIA-disabled",
|
|
77
|
+
"type": "ARIA attribute",
|
|
78
|
+
"default": "false",
|
|
79
|
+
"description": "Only if the action must remain focusable; prevent activation in app code."
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "Colour context",
|
|
83
|
+
"type": "inherited class",
|
|
84
|
+
"default": "inherited",
|
|
85
|
+
"description": "Inherits bc-is-* context from an ancestor; use a local context class only where necessary."
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"accessibility": [
|
|
89
|
+
"Prefer <button type=\"button\"> for actions and <a href=\"...\"> for navigation.",
|
|
90
|
+
"Give icon-only buttons an accessible name via aria-label or visually hidden text.",
|
|
91
|
+
"Use native disabled on buttons; aria-disabled alone does not block clicks or keyboard activation.",
|
|
92
|
+
"Do not replace native focus-visible styling without equivalent contrast."
|
|
93
|
+
],
|
|
94
|
+
"tags": [
|
|
95
|
+
"actions",
|
|
96
|
+
"forms",
|
|
97
|
+
"application-ui",
|
|
98
|
+
"marketing"
|
|
99
|
+
],
|
|
100
|
+
"notes": [
|
|
101
|
+
"CSS-only Element: no mount script or Behaviour dependency.",
|
|
102
|
+
"Button Groups and Segmented Controls are separate Level 04 Components.",
|
|
103
|
+
"Icon markup is consumer-provided; no icon pack is required.",
|
|
104
|
+
"Hover, active and focus-visible states are native CSS pseudo-classes; disabled is native HTML."
|
|
105
|
+
]
|
|
106
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "button",
|
|
4
|
+
"displayName": "Button",
|
|
5
|
+
"description": "Context-aware native HTML button styling by default, with explicit bce-button class support, solid/outline/ghost treatments, five sizes, icons and native interaction states.",
|
|
6
|
+
"level": "elements",
|
|
7
|
+
"category": [
|
|
8
|
+
"actions",
|
|
9
|
+
"controls"
|
|
10
|
+
],
|
|
11
|
+
"className": "bce-button",
|
|
12
|
+
"source": {
|
|
13
|
+
"scss": "01. Elements/actions/controls/button/button.scss",
|
|
14
|
+
"css": "dist/components/button.css"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"css": [
|
|
18
|
+
"foundations"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"documentation": {
|
|
22
|
+
"guide": "docs.md",
|
|
23
|
+
"api": "api.json",
|
|
24
|
+
"examples": "examples/index.json"
|
|
25
|
+
},
|
|
26
|
+
"previewControls": {
|
|
27
|
+
"colourContexts": [
|
|
28
|
+
"primary",
|
|
29
|
+
"secondary",
|
|
30
|
+
"accent",
|
|
31
|
+
"neutral",
|
|
32
|
+
"success",
|
|
33
|
+
"warning",
|
|
34
|
+
"error",
|
|
35
|
+
"info"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* BufferCore — Level 02 / Button. CSS-compatible SCSS source.
|
|
2
|
+
Requires Foundations semantics + context utilities; no primitive tokens.
|
|
3
|
+
Native buttons are styled by default when this asset is loaded.
|
|
4
|
+
Primary is the demo/app root context, not a local Button override. */
|
|
5
|
+
:where(button, .bce-button) {
|
|
6
|
+
--bce-button-height: var(--bc-size-ui-40);
|
|
7
|
+
--bce-button-pad-y: 0;
|
|
8
|
+
--bce-button-pad-x: var(--bc-size-ui-12);
|
|
9
|
+
--bce-button-colour: var(--bc-color-text-context-inverse-strong);
|
|
10
|
+
--bce-button-background: var(--bc-color-fill-context);
|
|
11
|
+
--bce-button-outline: var(--bc-color-fill-context);
|
|
12
|
+
--bce-button-hover-background: var(--bc-color-fill-context-strong);
|
|
13
|
+
--bce-button-active-background: var(--bc-color-fill-context-bold);
|
|
14
|
+
--bce-button-hover-outline: var(--bc-color-fill-context-strong);
|
|
15
|
+
--bce-button-active-outline: var(--bc-color-fill-context-bold);
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
min-height: var(--bce-button-height);
|
|
19
|
+
max-width: 100%;
|
|
20
|
+
padding: var(--bce-button-pad-y) var(--bce-button-pad-x);
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--bc-size-ui-6);
|
|
24
|
+
border-radius: var(--bc-radius-sm);
|
|
25
|
+
border: var(--bc-border-width-sm) solid var(--bce-button-outline);
|
|
26
|
+
background: var(--bce-button-background);
|
|
27
|
+
color: var(--bce-button-colour);
|
|
28
|
+
font-family: var(--bc-type-label-2-font-family);
|
|
29
|
+
font-size: var(--bc-type-label-2-font-size);
|
|
30
|
+
font-weight: var(--bc-type-label-2-font-weight);
|
|
31
|
+
line-height: var(--bc-type-label-2-line-height);
|
|
32
|
+
padding-block: max(0px, calc((var(--bce-button-height) - 1lh - 2 * var(--bc-border-width-sm)) / 2));
|
|
33
|
+
letter-spacing: var(--bc-type-label-2-letter-spacing);
|
|
34
|
+
text-align: center;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
vertical-align: middle;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
user-select: none;
|
|
39
|
+
touch-action: manipulation;
|
|
40
|
+
transition: background-color var(--bc-motion-interaction), border-color var(--bc-motion-interaction), color var(--bc-motion-interaction);
|
|
41
|
+
}
|
|
42
|
+
.bce-button__icon { display: inline-flex; flex: none; align-items: center; justify-content: center; }
|
|
43
|
+
.bce-button__icon svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
|
|
44
|
+
.bce-button__label { min-width: 0; }
|
|
45
|
+
.bce-button--outline, .bce-button--ghost {
|
|
46
|
+
--bce-button-colour: var(--bc-color-text-context);
|
|
47
|
+
--bce-button-background: transparent;
|
|
48
|
+
--bce-button-hover-background: var(--bc-color-fill-context-subtle);
|
|
49
|
+
--bce-button-active-background: var(--bc-color-fill-context-soft);
|
|
50
|
+
--bce-button-hover-outline: var(--bc-color-border-context-strong);
|
|
51
|
+
--bce-button-active-outline: var(--bc-color-border-context-bold);
|
|
52
|
+
}
|
|
53
|
+
.bce-button--outline { --bce-button-outline: var(--bc-color-border-context); }
|
|
54
|
+
.bce-button--ghost { --bce-button-outline: transparent; --bce-button-hover-outline: transparent; --bce-button-active-outline: transparent; }
|
|
55
|
+
.bce-button--56 { --bce-button-height: var(--bc-size-ui-56); --bce-button-pad-y: var(--bc-size-ui-8); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
56
|
+
.bce-button--48 { --bce-button-height: var(--bc-size-ui-48); --bce-button-pad-y: var(--bc-size-ui-6); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
57
|
+
.bce-button--40 { --bce-button-height: var(--bc-size-ui-40); --bce-button-pad-y: var(--bc-size-ui-6); --bce-button-pad-x: var(--bc-size-ui-12); }
|
|
58
|
+
.bce-button--32 { font-size: var(--bc-type-label-3-font-size); --bce-button-height: var(--bc-size-ui-32); --bce-button-pad-y: var(--bc-size-ui-4); --bce-button-pad-x: var(--bc-size-ui-8); }
|
|
59
|
+
.bce-button--24 { font-size: var(--bc-type-label-4-font-size); line-height: 1; --bce-button-height: var(--bc-size-ui-24); --bce-button-pad-y: var(--bc-size-ui-2); --bce-button-pad-x: var(--bc-size-ui-6); }
|
|
60
|
+
.bce-button--icon-only { aspect-ratio: 1; min-inline-size: var(--bce-button-height); padding-inline: 0; }
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
:where(button, .bce-button):not(:disabled):not([aria-disabled="true"]):hover {
|
|
63
|
+
background: var(--bce-button-hover-background);
|
|
64
|
+
border-color: var(--bce-button-hover-outline);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
:where(button, .bce-button):not(:disabled):not([aria-disabled="true"]):active {
|
|
68
|
+
background: var(--bce-button-active-background);
|
|
69
|
+
border-color: var(--bce-button-active-outline);
|
|
70
|
+
}
|
|
71
|
+
:where(button, .bce-button):focus-visible {
|
|
72
|
+
outline: var(--bc-border-width-sm) solid var(--bc-color-border-context-strong);
|
|
73
|
+
outline-offset: var(--bc-size-ui-2);
|
|
74
|
+
}
|
|
75
|
+
:where(button, .bce-button):disabled, :where(button, .bce-button)[aria-disabled="true"] {
|
|
76
|
+
opacity: var(--bc-interaction-disabled-opacity);
|
|
77
|
+
cursor: not-allowed;
|
|
78
|
+
}
|
|
79
|
+
@media (prefers-reduced-motion: reduce) { :where(button, .bce-button) { transition: none; } }
|
|
80
|
+
/* The Button is CSS-only; consumers own their interaction logic. */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
category 01 Element. Use a Button for an action; use an `<a href>` with the same `bce-button` class for navigation. A Button Group or Segmented Control is a **separate category 03 Component**, not a Button modifier.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install Foundations using `@buffercreations/buffercore`, then add this Button asset with the BufferCore CLI (which handles styling and dependencies). The library asset is not included in the default Foundations npm package. The exact CLI command depends on your local or published CLI installation.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<!-- Automatically styled by the Button asset; no class required -->
|
|
13
|
+
<button type="button">Label</button>
|
|
14
|
+
|
|
15
|
+
<!-- Explicit class is still supported -->
|
|
16
|
+
<button class="bce-button" type="button">Label</button>
|
|
17
|
+
|
|
18
|
+
<!-- Modifiers may be used without the base class on native buttons -->
|
|
19
|
+
<button class="bce-button--outline" type="button">Outline</button>
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The Button asset styles **all native `<button>` elements** in its CSS scope by default (including form submit/reset buttons). The explicit `.bce-button` class still works for links and other supported markup. Use `type="button"` for actions that should not submit a form.
|
|
24
|
+
|
|
25
|
+
Native styling is included in the normal Button CSS; it is not a separate installation mode. Loading the Button asset means accepting its native `<button>` default in that CSS scope. No per-element opt-out or alternative installation mode is provided.
|
|
26
|
+
|
|
27
|
+
Solid is the default. Add `bce-button--outline` or `bce-button--ghost` for alternate treatments. Size modifiers are `--56`, `--48`, `--40`, `--32`, and `--24`; `--40` is the default height. Avoid setting two size modifiers simultaneously.
|
|
28
|
+
|
|
29
|
+
Buttons inherit their semantic colour context (`bc-is-*`), so they should work inside themed sections without changing their own implementation.
|
|
30
|
+
|
|
31
|
+
## States
|
|
32
|
+
|
|
33
|
+
Normal, hover, pressed and keyboard focus are handled in CSS. Use the actual `disabled` attribute when an action is unavailable. A loading state is not provided by this CSS-only version; any future loading feature should use a `data-loading` semantic state and prevent repeated actions in the consuming code.
|
|
34
|
+
|
|
35
|
+
## Icons
|
|
36
|
+
|
|
37
|
+
Use the `.bce-button__icon` slot for icons from any library or inline SVG. For icon-only buttons add `bce-button--icon-only` and `aria-label`. BufferCore never requires Iconify.
|
|
38
|
+
|
|
39
|
+
## No JavaScript
|
|
40
|
+
|
|
41
|
+
This Element does not load any JavaScript. Event handlers are supplied by the application.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
+
<div class="bc-is-accent"><button class="bce-button" type="button">Accent</button><button class="bce-button bce-button--outline" type="button">Outline</button><button class="bce-button bce-button--ghost" type="button">Ghost</button></div>
|
|
3
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
+
<button class="bce-button" type="button"><span class="bce-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14"/></svg></span><span class="bce-button__label">Add item</span></button>
|
|
3
|
+
<button class="bce-button bce-button--outline" type="button"><span class="bce-button__label">Add item</span><span class="bce-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14"/></svg></span></button>
|
|
4
|
+
<button class="bce-button bce-button--icon-only" type="button" aria-label="Add item"><span class="bce-button__icon" aria-hidden="true"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14"/></svg></span></button>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "native-default",
|
|
4
|
+
"title": "Native button default",
|
|
5
|
+
"description": "A plain HTML button receives the default Button appearance automatically without a class; explicit classes and modifiers remain available.",
|
|
6
|
+
"preview": "examples/native-default/preview.html",
|
|
7
|
+
"code": "examples/native-default/code.html"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"id": "treatments",
|
|
11
|
+
"title": "Treatments",
|
|
12
|
+
"description": "Solid, outline and ghost treatments.",
|
|
13
|
+
"preview": "examples/treatments/preview.html",
|
|
14
|
+
"code": "examples/treatments/code.html"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "sizes",
|
|
18
|
+
"title": "Sizes",
|
|
19
|
+
"description": "Five token-based button heights.",
|
|
20
|
+
"preview": "examples/sizes/preview.html",
|
|
21
|
+
"code": "examples/sizes/code.html"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "states",
|
|
25
|
+
"title": "States",
|
|
26
|
+
"description": "Normal and disabled; use hover, focus and press to inspect native interaction states.",
|
|
27
|
+
"preview": "examples/states/preview.html",
|
|
28
|
+
"code": "examples/states/code.html"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "icons",
|
|
32
|
+
"title": "Icons",
|
|
33
|
+
"description": "Optional leading, trailing and icon-only content.",
|
|
34
|
+
"preview": "examples/icons/preview.html",
|
|
35
|
+
"code": "examples/icons/code.html"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "contexts",
|
|
39
|
+
"title": "Colour contexts",
|
|
40
|
+
"description": "Buttons inherit semantic colour contexts.",
|
|
41
|
+
"preview": "examples/contexts/preview.html",
|
|
42
|
+
"code": "examples/contexts/code.html"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "links",
|
|
46
|
+
"title": "Link buttons",
|
|
47
|
+
"description": "A navigation link styled as a Button.",
|
|
48
|
+
"preview": "examples/links/preview.html",
|
|
49
|
+
"code": "examples/links/code.html"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<a class="bce-button bce-button--outline" href="/about">Learn more</a>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- A plain HTML button automatically uses the BufferCore Button design. -->
|
|
2
|
+
<button type="button">Default button — no class</button>
|
|
3
|
+
|
|
4
|
+
<!-- Modifiers also work on native buttons without the base class. -->
|
|
5
|
+
<button class="bce-button--outline" type="button">Outline modifier</button>
|
|
6
|
+
|
|
7
|
+
<!-- Explicit class remains useful for links styled as buttons. -->
|
|
8
|
+
<a class="bce-button" href="#example">Button link</a>
|
|
9
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- A plain HTML button automatically uses the BufferCore Button design. -->
|
|
2
|
+
<button type="button">Default button — no class</button>
|
|
3
|
+
|
|
4
|
+
<!-- Modifiers also work on native buttons without the base class. -->
|
|
5
|
+
<button class="bce-button--outline" type="button">Outline modifier</button>
|
|
6
|
+
|
|
7
|
+
<!-- Explicit class remains useful for links styled as buttons. -->
|
|
8
|
+
<a class="bce-button" href="#example">Button link</a>
|
|
9
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<button class="bce-button bce-button--48" type="button">Label</button>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
+
<button class="bce-button bce-button--56" type="button">Label</button>
|
|
3
|
+
<button class="bce-button bce-button--48" type="button">Label</button>
|
|
4
|
+
<button class="bce-button bce-button--40" type="button">Label</button>
|
|
5
|
+
<button class="bce-button bce-button--32" type="button">Label</button>
|
|
6
|
+
<button class="bce-button bce-button--24" type="button">Label</button>
|
|
7
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<button class="bce-button" type="button" disabled>Label</button>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
+
<button class="bce-button" type="button">Label</button>
|
|
3
|
+
<button class="bce-button" type="button" disabled>Label</button>
|
|
4
|
+
<button class="bce-button bce-button--outline" type="button" disabled>Label</button>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<button class="bce-button" type="button">Label</button>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="bc-flex bc-flex-wrap bc-items-center bc-gap-md">
|
|
2
|
+
<button class="bce-button" type="button">Solid</button>
|
|
3
|
+
<button class="bce-button bce-button--outline" type="button">Outline</button>
|
|
4
|
+
<button class="bce-button bce-button--ghost" type="button">Ghost</button>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
{
|
|
2
|
+
"variants": [
|
|
3
|
+
{
|
|
4
|
+
"id": "circle",
|
|
5
|
+
"className": "bce-avatar",
|
|
6
|
+
"default": true
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "rounded",
|
|
10
|
+
"className": "bce-avatar--rounded"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"sizes": [
|
|
14
|
+
{
|
|
15
|
+
"id": "xs",
|
|
16
|
+
"className": "bce-avatar--xs"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "sm",
|
|
20
|
+
"className": "bce-avatar--sm"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "md",
|
|
24
|
+
"className": "bce-avatar--md",
|
|
25
|
+
"default": true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "lg",
|
|
29
|
+
"className": "bce-avatar--lg"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "xl",
|
|
33
|
+
"className": "bce-avatar--xl"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "2xl",
|
|
37
|
+
"className": "bce-avatar--2xl"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"anatomy": [
|
|
41
|
+
"image (optional)",
|
|
42
|
+
"initials (fallback)",
|
|
43
|
+
"placeholder (fallback)",
|
|
44
|
+
"status indicator (optional)",
|
|
45
|
+
"verified indicator (optional)",
|
|
46
|
+
"notification badge (optional)",
|
|
47
|
+
"custom badge (optional)"
|
|
48
|
+
],
|
|
49
|
+
"properties": [
|
|
50
|
+
{
|
|
51
|
+
"name": "Size",
|
|
52
|
+
"type": "CSS class",
|
|
53
|
+
"default": "md",
|
|
54
|
+
"description": "Named scale xs, sm, md, lg, xl and 2xl (md is the default and requires no class)."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "Shape",
|
|
58
|
+
"type": "CSS class",
|
|
59
|
+
"default": "circle",
|
|
60
|
+
"description": "Circular by default; --rounded for a rounded square."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "Border",
|
|
64
|
+
"type": "CSS class",
|
|
65
|
+
"default": "none",
|
|
66
|
+
"description": "--bordered adds a subtle outer outline."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "Presence",
|
|
70
|
+
"type": "data attribute",
|
|
71
|
+
"default": "not shown",
|
|
72
|
+
"description": "data-status=\"online|offline|away|busy\". Requires a .bce-avatar__status child to render."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "Verification",
|
|
76
|
+
"type": "data attribute",
|
|
77
|
+
"default": "not shown",
|
|
78
|
+
"description": "data-verified=\"true\" with .bce-avatar__verified child."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "Notifications",
|
|
82
|
+
"type": "HTML child",
|
|
83
|
+
"default": "not shown",
|
|
84
|
+
"description": "Optional .bce-avatar__notifications child containing the actual number or formatted count. Do not use CSS generated content for meaningful counts."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "Company or custom badge",
|
|
88
|
+
"type": "HTML child",
|
|
89
|
+
"default": "not shown",
|
|
90
|
+
"description": "Optional .bce-avatar__badge containing a logo or other authorised markup."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "Fallback",
|
|
94
|
+
"type": "HTML content",
|
|
95
|
+
"default": "initials or placeholder",
|
|
96
|
+
"description": "Initials or an icon are shown when no image exists, or when the consuming application sets data-image-error=\"true\" after a failed image."
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "Colour context",
|
|
100
|
+
"type": "inherited class",
|
|
101
|
+
"default": "inherited",
|
|
102
|
+
"description": "Inherits bc-is-*; CSS surfaces and neutral treatments use existing Foundations semantics."
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"accessibility": [
|
|
106
|
+
"Provide an accessible name on a meaningful image; use alt=\"\" for decorative images when the user name is supplied elsewhere.",
|
|
107
|
+
"Supply accessible text for presence and verified state via surrounding text or screen-reader-only content; coloured dots and data attributes alone do not convey information.",
|
|
108
|
+
"Render notification values as real text; ensure assistive-technology context is available if the number has meaning.",
|
|
109
|
+
"Do not make the avatar interactive by adding tabindex or role=\"button\" to its decorative container; wrap in a native link or button where the product requires an action.",
|
|
110
|
+
"Avoid putting the meaningful alt or status label inside an aria-hidden wrapper."
|
|
111
|
+
],
|
|
112
|
+
"tags": [
|
|
113
|
+
"identity",
|
|
114
|
+
"people",
|
|
115
|
+
"media",
|
|
116
|
+
"application-ui"
|
|
117
|
+
],
|
|
118
|
+
"notes": [
|
|
119
|
+
"CSS-only Element; no mandatory JavaScript or Behaviour dependency.",
|
|
120
|
+
"Image load failure cannot be detected by CSS alone; an optional tiny onerror fallback example is documented.",
|
|
121
|
+
"A single avatar is Level 02; Avatar Group and Avatar Label Group are distinct future Level 04 compositions.",
|
|
122
|
+
"The design uses semantic Foundations tokens and keeps verification independent from presence and notifications.",
|
|
123
|
+
"All examples separate multi-variation previews from a single clean, formatted code snippet.",
|
|
124
|
+
"No inline style attributes are permitted in canonical Avatar examples; use Foundation utilities for composition and Avatar classes only for its own design responsibilities."
|
|
125
|
+
]
|
|
126
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"id": "avatar",
|
|
4
|
+
"displayName": "Avatar",
|
|
5
|
+
"description": "A responsive identity Element supporting images, initials, accessible placeholders, semantic presence states, verification and optional badges.",
|
|
6
|
+
"level": "elements",
|
|
7
|
+
"category": [
|
|
8
|
+
"media",
|
|
9
|
+
"identity"
|
|
10
|
+
],
|
|
11
|
+
"className": "bce-avatar",
|
|
12
|
+
"source": {
|
|
13
|
+
"scss": "01. Elements/media/identity/avatar/avatar.scss",
|
|
14
|
+
"css": "dist/components/avatar.css"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"css": [
|
|
18
|
+
"foundations"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"documentation": {
|
|
22
|
+
"guide": "docs.md",
|
|
23
|
+
"api": "api.json",
|
|
24
|
+
"examples": "examples/index.json"
|
|
25
|
+
},
|
|
26
|
+
"previewControls": {
|
|
27
|
+
"colourContexts": [
|
|
28
|
+
"primary",
|
|
29
|
+
"secondary",
|
|
30
|
+
"accent",
|
|
31
|
+
"neutral",
|
|
32
|
+
"success",
|
|
33
|
+
"warning",
|
|
34
|
+
"error",
|
|
35
|
+
"info"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|