@og-ui/core 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/base.css +81 -0
- package/dist/components/accordion.css +69 -0
- package/dist/components/alert.css +44 -0
- package/dist/components/avatar.css +57 -0
- package/dist/components/badge.css +56 -0
- package/dist/components/button.css +114 -0
- package/dist/components/card.css +93 -0
- package/dist/components/checkbox.css +104 -0
- package/dist/components/dialog.css +170 -0
- package/dist/components/input.css +67 -0
- package/dist/components/pagination.css +52 -0
- package/dist/components/popover.css +71 -0
- package/dist/components/progress.css +53 -0
- package/dist/components/select.css +51 -0
- package/dist/components/skeleton.css +33 -0
- package/dist/components/slider.css +56 -0
- package/dist/components/surface.css +40 -0
- package/dist/components/switch.css +44 -0
- package/dist/components/table.css +48 -0
- package/dist/components/tabs.css +62 -0
- package/dist/components/toast.css +106 -0
- package/dist/components/tooltip.css +40 -0
- package/dist/og-ui.css +1507 -0
- package/dist/og-ui.js +312 -0
- package/dist/og-ui.min.css +2 -0
- package/package.json +32 -6
- package/src/_mixins.scss +90 -0
- package/src/base.scss +100 -0
- package/src/components/_accordion.scss +81 -0
- package/src/components/_alert.scss +56 -0
- package/src/components/_avatar.scss +52 -0
- package/src/components/_badge.scss +55 -0
- package/src/components/_button.scss +116 -0
- package/src/components/_card.scss +79 -0
- package/src/components/_checkbox.scss +100 -0
- package/src/components/_dialog.scss +142 -0
- package/src/components/_input.scss +70 -0
- package/src/components/_pagination.scss +58 -0
- package/src/components/_popover.scss +78 -0
- package/src/components/_progress.scss +68 -0
- package/src/components/_select.scss +45 -0
- package/src/components/_skeleton.scss +44 -0
- package/src/components/_slider.scss +71 -0
- package/src/components/_surface.scss +27 -0
- package/src/components/_switch.scss +46 -0
- package/src/components/_table.scss +59 -0
- package/src/components/_tabs.scss +69 -0
- package/src/components/_toast.scss +113 -0
- package/src/components/_tooltip.scss +52 -0
- package/src/js/og-ui.js +312 -0
- package/src/og-ui.scss +28 -0
- package/README.md +0 -5
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <label class="og-field">
|
|
4
|
+
// <span class="og-label">Email</span>
|
|
5
|
+
// <input class="og-input" type="email" placeholder="you@example.com" />
|
|
6
|
+
// <span class="og-hint">We never share it.</span>
|
|
7
|
+
// </label>
|
|
8
|
+
.og-input {
|
|
9
|
+
@include surface(inset);
|
|
10
|
+
@include interactive-transition;
|
|
11
|
+
|
|
12
|
+
display: block;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: var(--og-control-h-md);
|
|
15
|
+
padding: 0 calc(var(--og-control-px) * 0.875);
|
|
16
|
+
border-radius: var(--og-radius-control);
|
|
17
|
+
color: var(--og-color-text);
|
|
18
|
+
font: inherit;
|
|
19
|
+
font-family: var(--og-font);
|
|
20
|
+
font-size: 0.875rem;
|
|
21
|
+
line-height: 1.4;
|
|
22
|
+
appearance: none;
|
|
23
|
+
|
|
24
|
+
@include disabled;
|
|
25
|
+
|
|
26
|
+
&::placeholder {
|
|
27
|
+
color: var(--og-color-text-muted);
|
|
28
|
+
opacity: 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:focus-visible {
|
|
32
|
+
outline: 2px solid var(--og-color-focus-ring);
|
|
33
|
+
outline-offset: 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[aria-invalid='true'] {
|
|
37
|
+
border-color: var(--og-color-danger);
|
|
38
|
+
outline-color: var(--og-color-danger);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// <textarea class="og-input og-input--multiline">
|
|
42
|
+
&--multiline {
|
|
43
|
+
height: auto;
|
|
44
|
+
min-height: 6rem;
|
|
45
|
+
padding: 0.625rem calc(var(--og-control-px) * 0.875);
|
|
46
|
+
border-radius: var(--og-radius-md);
|
|
47
|
+
resize: vertical;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.og-field {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: 0.375rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.og-label {
|
|
58
|
+
color: var(--og-color-text);
|
|
59
|
+
font-size: 0.8125rem;
|
|
60
|
+
font-weight: var(--og-font-weight-strong);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.og-hint {
|
|
64
|
+
color: var(--og-color-text-muted);
|
|
65
|
+
font-size: 0.75rem;
|
|
66
|
+
|
|
67
|
+
[aria-invalid='true'] ~ & {
|
|
68
|
+
color: var(--og-color-danger);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <nav class="og-pagination" aria-label="Pagination">
|
|
4
|
+
// <a class="og-pagination__item" href="?p=1" aria-label="Previous page">‹</a>
|
|
5
|
+
// <a class="og-pagination__item" href="?p=1">1</a>
|
|
6
|
+
// <a class="og-pagination__item" href="?p=2" aria-current="page">2</a>
|
|
7
|
+
// <span class="og-pagination__gap">…</span>
|
|
8
|
+
// </nav>
|
|
9
|
+
// On the first page mark Previous aria-disabled="true"; og-ui.js stops it activating.
|
|
10
|
+
.og-pagination {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: 0.25rem;
|
|
15
|
+
font-family: var(--og-font);
|
|
16
|
+
|
|
17
|
+
&__item {
|
|
18
|
+
@include interactive-transition;
|
|
19
|
+
|
|
20
|
+
display: inline-grid;
|
|
21
|
+
place-items: center;
|
|
22
|
+
min-width: var(--og-control-h-sm);
|
|
23
|
+
height: var(--og-control-h-sm);
|
|
24
|
+
padding: 0 0.5rem;
|
|
25
|
+
border: var(--og-border-width) solid transparent;
|
|
26
|
+
border-radius: var(--og-radius-control);
|
|
27
|
+
background: transparent;
|
|
28
|
+
color: var(--og-color-text-muted);
|
|
29
|
+
font: inherit;
|
|
30
|
+
font-size: 0.875rem;
|
|
31
|
+
font-variant-numeric: tabular-nums;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
|
|
35
|
+
@include focus-ring;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background: color-mix(in oklab, var(--og-color-text) 8%, transparent);
|
|
39
|
+
color: var(--og-color-text);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[aria-current='page'] {
|
|
43
|
+
@include surface(raised);
|
|
44
|
+
color: var(--og-color-text);
|
|
45
|
+
font-weight: var(--og-font-weight-strong);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[aria-disabled='true'] {
|
|
49
|
+
opacity: 0.4;
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__gap {
|
|
55
|
+
padding: 0 0.25rem;
|
|
56
|
+
color: var(--og-color-text-muted);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <button popovertarget="share">Share</button>
|
|
4
|
+
// <div popover id="share" class="og-popover">…</div>
|
|
5
|
+
// Uses the native popover API (light dismiss, Esc, top layer). og-ui.js places it
|
|
6
|
+
// next to its trigger; browsers with CSS anchor positioning get that for free later.
|
|
7
|
+
.og-popover {
|
|
8
|
+
@include surface(overlay);
|
|
9
|
+
|
|
10
|
+
position: fixed;
|
|
11
|
+
inset: auto;
|
|
12
|
+
min-width: 12rem;
|
|
13
|
+
max-width: min(22rem, calc(100vw - 1rem));
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0.75rem;
|
|
16
|
+
border-radius: var(--og-radius-md);
|
|
17
|
+
color: var(--og-color-text);
|
|
18
|
+
font-family: var(--og-font);
|
|
19
|
+
font-size: 0.875rem;
|
|
20
|
+
|
|
21
|
+
@include enter;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Dropdown menu: a popover with role="menu".
|
|
25
|
+
// <button popovertarget="actions" aria-haspopup="menu">Actions</button>
|
|
26
|
+
// <div popover id="actions" class="og-popover og-menu" role="menu" aria-label="Project actions">
|
|
27
|
+
// <button class="og-menu__item" role="menuitem">Rename</button>
|
|
28
|
+
// <hr class="og-menu__separator" />
|
|
29
|
+
// <button class="og-menu__item og-menu__item--danger" role="menuitem">Delete</button>
|
|
30
|
+
// </div>
|
|
31
|
+
// og-ui.js focuses the first item, adds arrow keys, Home/End, and closes the menu after a
|
|
32
|
+
// choice or on Tab. Esc and focus return to the trigger come from the popover API.
|
|
33
|
+
.og-menu {
|
|
34
|
+
display: none;
|
|
35
|
+
min-width: 11rem;
|
|
36
|
+
padding: 0.25rem;
|
|
37
|
+
|
|
38
|
+
&:popover-open {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&__item {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 0.5rem;
|
|
47
|
+
width: 100%;
|
|
48
|
+
padding: 0.5rem 0.625rem;
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: calc(var(--og-radius-md) * 0.6);
|
|
51
|
+
background: transparent;
|
|
52
|
+
color: var(--og-color-text);
|
|
53
|
+
font: inherit;
|
|
54
|
+
text-align: left;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
|
|
57
|
+
&:hover,
|
|
58
|
+
&:focus-visible {
|
|
59
|
+
background: color-mix(in oklab, var(--og-color-text) 8%, transparent);
|
|
60
|
+
outline: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:focus-visible {
|
|
64
|
+
box-shadow: inset 0 0 0 2px var(--og-color-focus-ring);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&--danger {
|
|
68
|
+
color: var(--og-color-danger);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__separator {
|
|
73
|
+
width: 100%;
|
|
74
|
+
margin: 0.25rem 0;
|
|
75
|
+
border: 0;
|
|
76
|
+
border-top: 1px solid color-mix(in oklab, var(--og-color-text) 12%, transparent);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// <progress class="og-progress" value="40" max="100" aria-label="Upload"></progress>
|
|
2
|
+
// Leave out value for an indeterminate (moving) bar.
|
|
3
|
+
.og-progress {
|
|
4
|
+
--_h: 0.5rem;
|
|
5
|
+
|
|
6
|
+
display: block;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: var(--_h);
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
border: 0;
|
|
11
|
+
border-radius: var(--og-radius-full);
|
|
12
|
+
background: var(--og-surface-inset-fill);
|
|
13
|
+
box-shadow: var(--og-surface-inset-shadow);
|
|
14
|
+
color: var(--og-color-accent);
|
|
15
|
+
appearance: none;
|
|
16
|
+
|
|
17
|
+
&::-webkit-progress-bar {
|
|
18
|
+
background: transparent;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&::-webkit-progress-value {
|
|
22
|
+
border-radius: var(--og-radius-full);
|
|
23
|
+
background: var(--og-color-accent);
|
|
24
|
+
transition: width var(--og-motion-duration) var(--og-easing);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&::-moz-progress-bar {
|
|
28
|
+
border-radius: var(--og-radius-full);
|
|
29
|
+
background: var(--og-color-accent);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:indeterminate {
|
|
33
|
+
background-image: linear-gradient(
|
|
34
|
+
90deg,
|
|
35
|
+
transparent 0%,
|
|
36
|
+
var(--og-color-accent) 40%,
|
|
37
|
+
var(--og-color-accent) 60%,
|
|
38
|
+
transparent 100%
|
|
39
|
+
);
|
|
40
|
+
background-repeat: no-repeat;
|
|
41
|
+
background-size: 40% 100%;
|
|
42
|
+
animation: og-progress-slide 1.2s ease-in-out infinite;
|
|
43
|
+
|
|
44
|
+
&::-webkit-progress-bar {
|
|
45
|
+
background: transparent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&::-moz-progress-bar {
|
|
49
|
+
background: transparent;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@keyframes og-progress-slide {
|
|
55
|
+
from {
|
|
56
|
+
background-position: -40% 0;
|
|
57
|
+
}
|
|
58
|
+
to {
|
|
59
|
+
background-position: 140% 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
.og-progress:indeterminate {
|
|
65
|
+
animation: none;
|
|
66
|
+
background-position: 50% 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <label class="og-field">
|
|
4
|
+
// <span class="og-label">Plan</span>
|
|
5
|
+
// <span class="og-select"><select><option>Free</option></select></span>
|
|
6
|
+
// </label>
|
|
7
|
+
// A styled native <select>: keyboard, mobile pickers and screen readers all work for free.
|
|
8
|
+
.og-select {
|
|
9
|
+
position: relative;
|
|
10
|
+
display: block;
|
|
11
|
+
|
|
12
|
+
select {
|
|
13
|
+
@include surface(inset);
|
|
14
|
+
@include interactive-transition;
|
|
15
|
+
|
|
16
|
+
display: block;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: var(--og-control-h-md);
|
|
19
|
+
padding: 0 2.25rem 0 calc(var(--og-control-px) * 0.875);
|
|
20
|
+
border-radius: var(--og-radius-control);
|
|
21
|
+
color: var(--og-color-text);
|
|
22
|
+
font: inherit;
|
|
23
|
+
font-family: var(--og-font);
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
appearance: none;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
|
|
28
|
+
@include disabled;
|
|
29
|
+
|
|
30
|
+
&:focus-visible {
|
|
31
|
+
outline: 2px solid var(--og-color-focus-ring);
|
|
32
|
+
outline-offset: 2px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
@include icon($icon-chevron);
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: 50%;
|
|
40
|
+
right: 0.75rem;
|
|
41
|
+
color: var(--og-color-text-muted);
|
|
42
|
+
transform: translateY(-50%);
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// <div class="og-skeleton" style="height: 1rem; width: 60%"></div>
|
|
2
|
+
// Shapes: --text (one line), --circle. Hide the real content with aria-busy on the parent.
|
|
3
|
+
.og-skeleton {
|
|
4
|
+
display: block;
|
|
5
|
+
height: 1rem;
|
|
6
|
+
border-radius: var(--og-radius-sm);
|
|
7
|
+
background:
|
|
8
|
+
linear-gradient(
|
|
9
|
+
90deg,
|
|
10
|
+
transparent,
|
|
11
|
+
color-mix(in oklab, var(--og-color-text) 6%, transparent),
|
|
12
|
+
transparent
|
|
13
|
+
),
|
|
14
|
+
color-mix(in oklab, var(--og-color-text) 8%, transparent);
|
|
15
|
+
background-size: 200% 100%, auto;
|
|
16
|
+
background-repeat: no-repeat;
|
|
17
|
+
animation: og-skeleton-shimmer 1.4s linear infinite;
|
|
18
|
+
|
|
19
|
+
&--text {
|
|
20
|
+
height: 0.75rem;
|
|
21
|
+
border-radius: var(--og-radius-full);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&--circle {
|
|
25
|
+
width: 2.5rem;
|
|
26
|
+
height: 2.5rem;
|
|
27
|
+
border-radius: var(--og-radius-full);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes og-skeleton-shimmer {
|
|
32
|
+
from {
|
|
33
|
+
background-position: 150% 0, 0 0;
|
|
34
|
+
}
|
|
35
|
+
to {
|
|
36
|
+
background-position: -50% 0, 0 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media (prefers-reduced-motion: reduce) {
|
|
41
|
+
.og-skeleton {
|
|
42
|
+
animation: none;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// <input type="range" class="og-slider" min="0" max="100" value="40" aria-label="Volume" />
|
|
2
|
+
// og-ui.js keeps --_value in sync so the filled part of the track follows the thumb.
|
|
3
|
+
.og-slider {
|
|
4
|
+
--_value: 50%;
|
|
5
|
+
--_track: 0.375rem;
|
|
6
|
+
--_thumb: 1.125rem;
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: var(--_thumb);
|
|
10
|
+
margin: 0;
|
|
11
|
+
background: transparent;
|
|
12
|
+
appearance: none;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
|
|
15
|
+
&:focus-visible {
|
|
16
|
+
outline: 2px solid var(--og-color-focus-ring);
|
|
17
|
+
outline-offset: 4px;
|
|
18
|
+
border-radius: var(--og-radius-full);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:disabled {
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Track
|
|
27
|
+
&::-webkit-slider-runnable-track {
|
|
28
|
+
height: var(--_track);
|
|
29
|
+
border-radius: var(--og-radius-full);
|
|
30
|
+
background: linear-gradient(
|
|
31
|
+
to right,
|
|
32
|
+
var(--og-color-accent) var(--_value),
|
|
33
|
+
var(--og-surface-inset-fill) var(--_value)
|
|
34
|
+
);
|
|
35
|
+
box-shadow: var(--og-surface-inset-shadow);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&::-moz-range-track {
|
|
39
|
+
height: var(--_track);
|
|
40
|
+
border-radius: var(--og-radius-full);
|
|
41
|
+
background: var(--og-surface-inset-fill);
|
|
42
|
+
box-shadow: var(--og-surface-inset-shadow);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&::-moz-range-progress {
|
|
46
|
+
height: var(--_track);
|
|
47
|
+
border-radius: var(--og-radius-full);
|
|
48
|
+
background: var(--og-color-accent);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Thumb
|
|
52
|
+
&::-webkit-slider-thumb {
|
|
53
|
+
width: var(--_thumb);
|
|
54
|
+
height: var(--_thumb);
|
|
55
|
+
margin-top: calc((var(--_track) - var(--_thumb)) / 2);
|
|
56
|
+
border: var(--og-border-width) solid var(--og-surface-raised-border);
|
|
57
|
+
border-radius: var(--og-radius-full);
|
|
58
|
+
background: var(--og-surface-raised-bg-solid);
|
|
59
|
+
box-shadow: var(--og-surface-raised-shadow);
|
|
60
|
+
appearance: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&::-moz-range-thumb {
|
|
64
|
+
width: var(--_thumb);
|
|
65
|
+
height: var(--_thumb);
|
|
66
|
+
border: var(--og-border-width) solid var(--og-surface-raised-border);
|
|
67
|
+
border-radius: var(--og-radius-full);
|
|
68
|
+
background: var(--og-surface-raised-bg-solid);
|
|
69
|
+
box-shadow: var(--og-surface-raised-shadow);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// Utility classes to put any element in a theme material:
|
|
4
|
+
// <div class="og-surface og-surface--overlay">…</div>
|
|
5
|
+
.og-surface {
|
|
6
|
+
@include surface(raised);
|
|
7
|
+
|
|
8
|
+
border-radius: var(--og-radius-lg);
|
|
9
|
+
|
|
10
|
+
@include effect-slot(raised);
|
|
11
|
+
|
|
12
|
+
&--inset {
|
|
13
|
+
@include surface(inset);
|
|
14
|
+
|
|
15
|
+
&::before {
|
|
16
|
+
background: var(--og-surface-inset-highlight);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&--overlay {
|
|
21
|
+
@include surface(overlay);
|
|
22
|
+
|
|
23
|
+
&::before {
|
|
24
|
+
background: var(--og-surface-overlay-highlight);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <label class="og-check"><input type="checkbox" role="switch" class="og-switch" /> Notifications</label>
|
|
4
|
+
.og-switch {
|
|
5
|
+
@include surface(inset);
|
|
6
|
+
|
|
7
|
+
--_w: 2.5rem;
|
|
8
|
+
--_h: 1.5rem;
|
|
9
|
+
--_pad: 3px;
|
|
10
|
+
|
|
11
|
+
position: relative;
|
|
12
|
+
flex: none;
|
|
13
|
+
width: var(--_w);
|
|
14
|
+
height: var(--_h);
|
|
15
|
+
margin: 0;
|
|
16
|
+
border-radius: var(--og-radius-full);
|
|
17
|
+
appearance: none;
|
|
18
|
+
cursor: inherit;
|
|
19
|
+
transition: background-color var(--og-motion-duration) var(--og-easing);
|
|
20
|
+
|
|
21
|
+
@include focus-ring;
|
|
22
|
+
|
|
23
|
+
&::before {
|
|
24
|
+
content: '';
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: var(--_pad);
|
|
27
|
+
left: var(--_pad);
|
|
28
|
+
width: calc(var(--_h) - var(--_pad) * 2 - var(--og-border-width) * 2);
|
|
29
|
+
aspect-ratio: 1;
|
|
30
|
+
border-radius: var(--og-radius-full);
|
|
31
|
+
background: var(--og-surface-raised-bg-solid);
|
|
32
|
+
box-shadow: var(--og-surface-raised-shadow);
|
|
33
|
+
transition: transform var(--og-motion-duration) var(--og-easing);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:checked {
|
|
37
|
+
background: var(--og-color-accent);
|
|
38
|
+
border-color: var(--og-color-accent-border);
|
|
39
|
+
// Inset shadows wash out the accent in soft themes; a filled track reads clearer.
|
|
40
|
+
box-shadow: none;
|
|
41
|
+
|
|
42
|
+
&::before {
|
|
43
|
+
transform: translateX(calc(var(--_w) - var(--_h)));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <div class="og-table-wrap">
|
|
4
|
+
// <table class="og-table">
|
|
5
|
+
// <thead><tr><th>Invoice</th><th class="og-table__num">Amount</th></tr></thead>
|
|
6
|
+
// <tbody><tr><td>#1001</td><td class="og-table__num">₹4,200</td></tr></tbody>
|
|
7
|
+
// </table>
|
|
8
|
+
// </div>
|
|
9
|
+
// The wrapper scrolls sideways on small screens. Density compact tightens rows.
|
|
10
|
+
.og-table-wrap {
|
|
11
|
+
@include surface(raised);
|
|
12
|
+
|
|
13
|
+
width: 100%;
|
|
14
|
+
overflow-x: auto;
|
|
15
|
+
border-radius: var(--og-radius-lg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.og-table {
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
color: var(--og-color-text);
|
|
22
|
+
font-family: var(--og-font);
|
|
23
|
+
font-size: 0.875rem;
|
|
24
|
+
|
|
25
|
+
th,
|
|
26
|
+
td {
|
|
27
|
+
padding: calc(var(--og-gap) * 0.75) var(--og-card-pad);
|
|
28
|
+
text-align: left;
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
th {
|
|
33
|
+
color: var(--og-color-text-muted);
|
|
34
|
+
font-size: 0.75rem;
|
|
35
|
+
font-weight: var(--og-font-weight-strong);
|
|
36
|
+
letter-spacing: 0.02em;
|
|
37
|
+
text-transform: uppercase;
|
|
38
|
+
background: color-mix(in oklab, var(--og-color-text) 3%, transparent);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
tbody tr {
|
|
42
|
+
border-top: 1px solid color-mix(in oklab, var(--og-color-text) 9%, transparent);
|
|
43
|
+
transition: background-color var(--og-motion-duration) var(--og-easing);
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
background: color-mix(in oklab, var(--og-color-text) 4%, transparent);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__num {
|
|
51
|
+
font-family: var(--og-font-mono);
|
|
52
|
+
font-variant-numeric: tabular-nums;
|
|
53
|
+
text-align: right !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--striped tbody tr:nth-child(even) {
|
|
57
|
+
background: color-mix(in oklab, var(--og-color-text) 3%, transparent);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <div class="og-tabs" data-og-tabs>
|
|
4
|
+
// <div class="og-tabs__list" role="tablist" aria-label="Settings">
|
|
5
|
+
// <button class="og-tabs__tab" role="tab" aria-selected="true" aria-controls="t1" id="t1-tab">Profile</button>
|
|
6
|
+
// <button class="og-tabs__tab" role="tab" aria-selected="false" aria-controls="t2" id="t2-tab" tabindex="-1">Billing</button>
|
|
7
|
+
// </div>
|
|
8
|
+
// <div class="og-tabs__panel" role="tabpanel" id="t1" aria-labelledby="t1-tab" tabindex="0">…</div>
|
|
9
|
+
// <div class="og-tabs__panel" role="tabpanel" id="t2" aria-labelledby="t2-tab" tabindex="0" hidden>…</div>
|
|
10
|
+
// tabindex="0" on panels lets Tab reach panels that hold no focusable content.
|
|
11
|
+
// </div>
|
|
12
|
+
// og-ui.js wires clicks and arrow keys (WAI-ARIA tabs pattern, automatic activation).
|
|
13
|
+
.og-tabs {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--og-gap);
|
|
17
|
+
|
|
18
|
+
&__list {
|
|
19
|
+
@include surface(inset);
|
|
20
|
+
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-self: flex-start;
|
|
23
|
+
gap: 0.25rem;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
padding: 0.25rem;
|
|
26
|
+
overflow-x: auto;
|
|
27
|
+
border-radius: calc(var(--og-radius-control) + 0.25rem);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__tab {
|
|
31
|
+
@include interactive-transition;
|
|
32
|
+
|
|
33
|
+
height: calc(var(--og-control-h-md) - 0.5rem);
|
|
34
|
+
padding: 0 calc(var(--og-control-px) * 0.875);
|
|
35
|
+
border: var(--og-border-width) solid transparent;
|
|
36
|
+
border-radius: var(--og-radius-control);
|
|
37
|
+
background: transparent;
|
|
38
|
+
color: var(--og-color-text-muted);
|
|
39
|
+
font: inherit;
|
|
40
|
+
font-family: var(--og-font);
|
|
41
|
+
font-size: 0.875rem;
|
|
42
|
+
font-weight: var(--og-font-weight-strong);
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
|
|
46
|
+
@include focus-ring;
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
color: var(--og-color-text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[aria-selected='true'] {
|
|
53
|
+
@include surface(raised);
|
|
54
|
+
color: var(--og-color-text);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__panel {
|
|
59
|
+
font-family: var(--og-font);
|
|
60
|
+
font-size: 0.875rem;
|
|
61
|
+
line-height: 1.6;
|
|
62
|
+
|
|
63
|
+
&:focus-visible {
|
|
64
|
+
outline: 2px solid var(--og-color-focus-ring);
|
|
65
|
+
outline-offset: 4px;
|
|
66
|
+
border-radius: var(--og-radius-sm);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|