@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,81 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <div class="og-accordion">
|
|
4
|
+
// <details name="faq" open>
|
|
5
|
+
// <summary>What is OG UI?</summary>
|
|
6
|
+
// <div class="og-accordion__content">…</div>
|
|
7
|
+
// </details>
|
|
8
|
+
// </div>
|
|
9
|
+
// Native <details>: keyboard and screen readers work with no JS. Same `name` = only one open.
|
|
10
|
+
.og-accordion {
|
|
11
|
+
@include surface(raised);
|
|
12
|
+
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
border-radius: var(--og-radius-lg);
|
|
15
|
+
color: var(--og-color-text);
|
|
16
|
+
font-family: var(--og-font);
|
|
17
|
+
|
|
18
|
+
details + details {
|
|
19
|
+
border-top: 1px solid color-mix(in oklab, var(--og-color-text) 10%, transparent);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
summary {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
gap: 1rem;
|
|
27
|
+
padding: 0.875rem var(--og-card-pad);
|
|
28
|
+
font-size: 0.9375rem;
|
|
29
|
+
font-weight: var(--og-font-weight-strong);
|
|
30
|
+
list-style: none;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
|
|
33
|
+
&::-webkit-details-marker {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&::after {
|
|
38
|
+
@include icon($icon-chevron);
|
|
39
|
+
flex: none;
|
|
40
|
+
color: var(--og-color-text-muted);
|
|
41
|
+
transition: transform var(--og-motion-duration) var(--og-easing);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
background: color-mix(in oklab, var(--og-color-text) 4%, transparent);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
outline: 2px solid var(--og-color-focus-ring);
|
|
50
|
+
outline-offset: -2px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
details[open] > summary::after {
|
|
55
|
+
transform: rotate(180deg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Smooth open/close where the browser supports animating details content.
|
|
59
|
+
details::details-content {
|
|
60
|
+
height: 0;
|
|
61
|
+
overflow: clip;
|
|
62
|
+
transition:
|
|
63
|
+
height var(--og-motion-duration) var(--og-easing),
|
|
64
|
+
content-visibility var(--og-motion-duration) allow-discrete;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
details[open]::details-content {
|
|
68
|
+
height: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&__content {
|
|
72
|
+
padding: 0 var(--og-card-pad) var(--og-card-pad);
|
|
73
|
+
color: var(--og-color-text-muted);
|
|
74
|
+
font-size: 0.875rem;
|
|
75
|
+
line-height: 1.6;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:root {
|
|
80
|
+
interpolate-size: allow-keywords;
|
|
81
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// <div class="og-alert og-alert--warning" role="status">
|
|
2
|
+
// <p class="og-alert__title">Payment pending</p>
|
|
3
|
+
// <p class="og-alert__description">We'll retry tomorrow.</p>
|
|
4
|
+
// </div>
|
|
5
|
+
// Variants: --accent --success --warning --danger. Use role="alert" only for urgent errors.
|
|
6
|
+
.og-alert {
|
|
7
|
+
--_c: var(--og-color-text-muted);
|
|
8
|
+
|
|
9
|
+
position: relative;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 0.25rem;
|
|
13
|
+
padding: 0.875rem 1rem 0.875rem 1.25rem;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
border: var(--og-border-width) solid color-mix(in oklab, var(--_c) 35%, transparent);
|
|
16
|
+
border-radius: var(--og-radius-md);
|
|
17
|
+
background: color-mix(in oklab, var(--_c) 10%, var(--og-surface-raised-fill));
|
|
18
|
+
color: var(--og-color-text);
|
|
19
|
+
font-family: var(--og-font);
|
|
20
|
+
font-size: 0.875rem;
|
|
21
|
+
|
|
22
|
+
&::before {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset: 0 auto 0 0;
|
|
26
|
+
width: 4px;
|
|
27
|
+
background: var(--_c);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__title {
|
|
31
|
+
margin: 0;
|
|
32
|
+
font-weight: var(--og-font-weight-strong);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__description {
|
|
36
|
+
margin: 0;
|
|
37
|
+
color: var(--og-color-text-muted);
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--accent {
|
|
42
|
+
--_c: var(--og-color-accent);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--success {
|
|
46
|
+
--_c: var(--og-color-success);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--warning {
|
|
50
|
+
--_c: var(--og-color-warning);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--danger {
|
|
54
|
+
--_c: var(--og-color-danger);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// <span class="og-avatar"><img src="…" alt="Omkar" /></span>
|
|
2
|
+
// <span class="og-avatar og-avatar--2" aria-label="Omkar">OM</span> (initials, palette colour 1–6)
|
|
3
|
+
// Sizes: --sm --lg. Group: <div class="og-avatar-group">…</div>
|
|
4
|
+
.og-avatar {
|
|
5
|
+
--_s: 2.25rem;
|
|
6
|
+
--_c: var(--og-palette-1);
|
|
7
|
+
|
|
8
|
+
display: inline-grid;
|
|
9
|
+
place-items: center;
|
|
10
|
+
flex: none;
|
|
11
|
+
width: var(--_s);
|
|
12
|
+
height: var(--_s);
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
border: var(--og-border-width) solid var(--og-surface-raised-border);
|
|
15
|
+
border-radius: var(--og-radius-full);
|
|
16
|
+
background: color-mix(in oklab, var(--_c) 22%, var(--og-surface-raised-fill));
|
|
17
|
+
color: color-mix(in oklab, var(--_c) 50%, var(--og-color-text));
|
|
18
|
+
font-family: var(--og-font);
|
|
19
|
+
font-size: calc(var(--_s) * 0.38);
|
|
20
|
+
font-weight: var(--og-font-weight-strong);
|
|
21
|
+
line-height: 1;
|
|
22
|
+
user-select: none;
|
|
23
|
+
|
|
24
|
+
img {
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
object-fit: cover;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@for $i from 1 through 6 {
|
|
31
|
+
&--#{$i} {
|
|
32
|
+
--_c: var(--og-palette-#{$i});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--sm {
|
|
37
|
+
--_s: 1.75rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&--lg {
|
|
41
|
+
--_s: 3rem;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.og-avatar-group {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
|
|
48
|
+
.og-avatar + .og-avatar {
|
|
49
|
+
margin-left: calc(var(--_s, 2.25rem) * -0.18);
|
|
50
|
+
box-shadow: 0 0 0 2px var(--og-color-bg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// <span class="og-badge og-badge--success">Paid</span>
|
|
2
|
+
// Variants: --accent --success --warning --danger --solid (combine: og-badge--accent og-badge--solid)
|
|
3
|
+
.og-badge {
|
|
4
|
+
--_c: var(--og-color-text-muted);
|
|
5
|
+
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.25rem;
|
|
9
|
+
height: 1.375rem;
|
|
10
|
+
padding: 0 0.5rem;
|
|
11
|
+
border: var(--og-border-width) solid color-mix(in oklab, var(--_c) 35%, transparent);
|
|
12
|
+
border-radius: var(--og-radius-full);
|
|
13
|
+
background: color-mix(in oklab, var(--_c) 14%, transparent);
|
|
14
|
+
// Mixing in the text colour keeps light accents (yellow, lime) readable on light pages.
|
|
15
|
+
// 50% keeps pastel palettes (brutal) at 4.5:1; scripts/contrast.ts checks it.
|
|
16
|
+
color: color-mix(in oklab, var(--_c) 50%, var(--og-color-text));
|
|
17
|
+
font-family: var(--og-font);
|
|
18
|
+
font-size: 0.75rem;
|
|
19
|
+
font-weight: var(--og-font-weight-strong);
|
|
20
|
+
line-height: 1;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
|
|
23
|
+
&--accent {
|
|
24
|
+
--_c: var(--og-color-accent);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--success {
|
|
28
|
+
--_c: var(--og-color-success);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--warning {
|
|
32
|
+
--_c: var(--og-color-warning);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--danger {
|
|
36
|
+
--_c: var(--og-color-danger);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Categorical colours from the theme palette: og-badge--1 … og-badge--6
|
|
40
|
+
@for $i from 1 through 6 {
|
|
41
|
+
&--#{$i} {
|
|
42
|
+
--_c: var(--og-palette-#{$i});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&--solid {
|
|
47
|
+
border-color: var(--og-color-accent-border);
|
|
48
|
+
background: var(--_c);
|
|
49
|
+
color: var(--og-color-bg);
|
|
50
|
+
|
|
51
|
+
&.og-badge--accent {
|
|
52
|
+
color: var(--og-color-accent-contrast);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <button class="og-button">Save</button>
|
|
4
|
+
// Variants: --primary --ghost --danger Sizes: --sm --lg Shape: --icon
|
|
5
|
+
.og-button {
|
|
6
|
+
@include surface(raised);
|
|
7
|
+
@include interactive-transition;
|
|
8
|
+
|
|
9
|
+
--_h: var(--og-control-h-md);
|
|
10
|
+
--_px: var(--og-control-px);
|
|
11
|
+
--_fs: 0.875rem;
|
|
12
|
+
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
height: var(--_h);
|
|
18
|
+
padding: 0 var(--_px);
|
|
19
|
+
border-radius: var(--og-radius-control);
|
|
20
|
+
color: var(--og-color-text);
|
|
21
|
+
font: inherit;
|
|
22
|
+
font-family: var(--og-font);
|
|
23
|
+
font-size: var(--_fs);
|
|
24
|
+
font-weight: var(--og-font-weight-strong);
|
|
25
|
+
line-height: 1;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
user-select: none;
|
|
30
|
+
-webkit-tap-highlight-color: transparent;
|
|
31
|
+
|
|
32
|
+
// Mixins with nested rules go after the declarations, or Sass splits the rule in two.
|
|
33
|
+
@include effect-slot(raised);
|
|
34
|
+
@include focus-ring;
|
|
35
|
+
@include disabled;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background: color-mix(in oklab, var(--og-surface-raised-fill), var(--og-color-text) 5%);
|
|
39
|
+
transform: var(--og-motion-hover);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:active {
|
|
43
|
+
box-shadow: var(--og-surface-inset-shadow);
|
|
44
|
+
transform: var(--og-motion-press);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Variants -------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
&--primary {
|
|
50
|
+
background: var(--og-color-accent);
|
|
51
|
+
border-color: var(--og-color-accent-border);
|
|
52
|
+
box-shadow: var(--og-effect-glow), var(--og-surface-raised-shadow);
|
|
53
|
+
color: var(--og-color-accent-contrast);
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
background: color-mix(in oklab, var(--og-color-accent), var(--og-color-text) 12%);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&--danger {
|
|
61
|
+
background: var(--og-color-danger);
|
|
62
|
+
border-color: var(--og-color-accent-border);
|
|
63
|
+
// Page colour on danger reads well in both modes (dark ink on light red, white on deep red).
|
|
64
|
+
color: var(--og-color-bg);
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
background: color-mix(in oklab, var(--og-color-danger), #000 12%);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&--ghost {
|
|
72
|
+
background: transparent;
|
|
73
|
+
border-color: transparent;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
-webkit-backdrop-filter: none;
|
|
76
|
+
backdrop-filter: none;
|
|
77
|
+
|
|
78
|
+
&::before {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
background: color-mix(in oklab, var(--og-color-text) 8%, transparent);
|
|
84
|
+
transform: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:active {
|
|
88
|
+
box-shadow: none;
|
|
89
|
+
background: color-mix(in oklab, var(--og-color-text) 12%, transparent);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Sizes ------------------------------------------------------------------
|
|
94
|
+
|
|
95
|
+
&--sm {
|
|
96
|
+
--_h: var(--og-control-h-sm);
|
|
97
|
+
--_px: calc(var(--og-control-px) * 0.75);
|
|
98
|
+
--_fs: 0.8125rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--lg {
|
|
102
|
+
--_h: var(--og-control-h-lg);
|
|
103
|
+
--_px: calc(var(--og-control-px) * 1.5);
|
|
104
|
+
--_fs: 1rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--icon {
|
|
108
|
+
width: var(--_h);
|
|
109
|
+
padding: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--block {
|
|
113
|
+
display: flex;
|
|
114
|
+
width: 100%;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <article class="og-card">
|
|
4
|
+
// <header class="og-card__header">
|
|
5
|
+
// <h3 class="og-card__title">Title</h3>
|
|
6
|
+
// <p class="og-card__description">Supporting text</p>
|
|
7
|
+
// </header>
|
|
8
|
+
// <div class="og-card__body">…</div>
|
|
9
|
+
// <footer class="og-card__footer">…</footer>
|
|
10
|
+
// </article>
|
|
11
|
+
.og-card {
|
|
12
|
+
@include surface(raised);
|
|
13
|
+
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--og-gap);
|
|
17
|
+
padding: var(--og-card-pad);
|
|
18
|
+
border-radius: var(--og-radius-lg);
|
|
19
|
+
color: var(--og-color-text);
|
|
20
|
+
|
|
21
|
+
@include effect-slot(raised);
|
|
22
|
+
|
|
23
|
+
&__header {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 0.25rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&__title {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-family: var(--og-font-display);
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
font-weight: var(--og-font-weight-strong);
|
|
34
|
+
line-height: 1.3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__description {
|
|
38
|
+
margin: 0;
|
|
39
|
+
color: var(--og-color-text-muted);
|
|
40
|
+
font-size: 0.875rem;
|
|
41
|
+
line-height: 1.5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__body {
|
|
45
|
+
font-size: 0.875rem;
|
|
46
|
+
line-height: 1.6;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__footer {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 0.5rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Palette tints: og-card--tint-1 … og-card--tint-6. Subtle in most themes,
|
|
57
|
+
// a full colour fill in brutalism (the theme's tintStrength decides).
|
|
58
|
+
@for $i from 1 through 6 {
|
|
59
|
+
&--tint-#{$i} {
|
|
60
|
+
background: color-mix(
|
|
61
|
+
in oklab,
|
|
62
|
+
var(--og-palette-#{$i}) var(--og-tint-strength),
|
|
63
|
+
var(--og-surface-raised-fill)
|
|
64
|
+
);
|
|
65
|
+
--og-color-text-muted: color-mix(in oklab, var(--og-color-on-tint) 72%, transparent);
|
|
66
|
+
color: var(--og-color-on-tint);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// A card that floats over content (popover-like). Uses the overlay material,
|
|
71
|
+
// which is the only one allowed to blur.
|
|
72
|
+
&--floating {
|
|
73
|
+
@include surface(overlay);
|
|
74
|
+
|
|
75
|
+
&::before {
|
|
76
|
+
background: var(--og-surface-overlay-highlight);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <label class="og-check"><input type="checkbox" class="og-checkbox" /> Remember me</label>
|
|
4
|
+
// <label class="og-check"><input type="radio" name="plan" class="og-radio" /> Monthly</label>
|
|
5
|
+
// Native inputs, restyled: keyboard and forms behave exactly as the browser does.
|
|
6
|
+
.og-check {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 0.5rem;
|
|
10
|
+
color: var(--og-color-text);
|
|
11
|
+
font-family: var(--og-font);
|
|
12
|
+
font-size: 0.875rem;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
|
|
15
|
+
&:has(:disabled) {
|
|
16
|
+
opacity: 0.5;
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.og-checkbox,
|
|
22
|
+
.og-radio {
|
|
23
|
+
@include surface(inset);
|
|
24
|
+
@include interactive-transition;
|
|
25
|
+
|
|
26
|
+
display: inline-grid;
|
|
27
|
+
place-items: center;
|
|
28
|
+
flex: none;
|
|
29
|
+
width: 1.25rem;
|
|
30
|
+
height: 1.25rem;
|
|
31
|
+
margin: 0;
|
|
32
|
+
color: var(--og-color-accent-contrast);
|
|
33
|
+
appearance: none;
|
|
34
|
+
cursor: inherit;
|
|
35
|
+
|
|
36
|
+
@include focus-ring;
|
|
37
|
+
|
|
38
|
+
&::before {
|
|
39
|
+
content: '';
|
|
40
|
+
transform: scale(0);
|
|
41
|
+
transition: transform var(--og-motion-duration) var(--og-easing);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:checked,
|
|
45
|
+
&:indeterminate {
|
|
46
|
+
background: var(--og-color-accent);
|
|
47
|
+
border-color: var(--og-color-accent-border);
|
|
48
|
+
box-shadow: var(--og-surface-raised-shadow);
|
|
49
|
+
|
|
50
|
+
&::before {
|
|
51
|
+
transform: scale(1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.og-checkbox {
|
|
57
|
+
border-radius: calc(var(--og-radius-sm) * 0.75);
|
|
58
|
+
|
|
59
|
+
&::before {
|
|
60
|
+
@include icon($icon-check, 0.875rem);
|
|
61
|
+
transform: scale(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:indeterminate::before {
|
|
65
|
+
-webkit-mask-image: $icon-dash;
|
|
66
|
+
mask-image: $icon-dash;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.og-radio {
|
|
71
|
+
border-radius: var(--og-radius-full);
|
|
72
|
+
|
|
73
|
+
&::before {
|
|
74
|
+
width: 0.5rem;
|
|
75
|
+
height: 0.5rem;
|
|
76
|
+
border-radius: var(--og-radius-full);
|
|
77
|
+
background: currentColor;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// <fieldset class="og-radio-group"><legend class="og-label">Billing</legend>…labels…</fieldset>
|
|
82
|
+
.og-radio-group {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: 0.625rem;
|
|
86
|
+
margin: 0;
|
|
87
|
+
padding: 0;
|
|
88
|
+
border: 0;
|
|
89
|
+
|
|
90
|
+
legend {
|
|
91
|
+
margin-bottom: 0.5rem;
|
|
92
|
+
padding: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&--row {
|
|
96
|
+
flex-direction: row;
|
|
97
|
+
flex-wrap: wrap;
|
|
98
|
+
gap: 1rem;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@use '../mixins' as *;
|
|
2
|
+
|
|
3
|
+
// <dialog class="og-dialog" id="confirm" aria-labelledby="confirm-title">
|
|
4
|
+
// <header class="og-dialog__header">
|
|
5
|
+
// <h2 class="og-dialog__title" id="confirm-title">Delete project?</h2>
|
|
6
|
+
// <button class="og-dialog__close" data-og-close aria-label="Close"></button>
|
|
7
|
+
// </header>
|
|
8
|
+
// <div class="og-dialog__body">…</div>
|
|
9
|
+
// <footer class="og-dialog__footer">…</footer>
|
|
10
|
+
// </dialog>
|
|
11
|
+
// Open with dialog.showModal() or <button data-og-open="confirm">. The browser handles
|
|
12
|
+
// focus trapping, Esc and the top layer; og-ui.js adds close buttons and click-outside.
|
|
13
|
+
.og-dialog {
|
|
14
|
+
@include surface(overlay);
|
|
15
|
+
|
|
16
|
+
width: min(32rem, calc(100vw - 2rem));
|
|
17
|
+
max-height: calc(100dvh - 2rem);
|
|
18
|
+
padding: 0;
|
|
19
|
+
border-radius: var(--og-radius-lg);
|
|
20
|
+
color: var(--og-color-text);
|
|
21
|
+
font-family: var(--og-font);
|
|
22
|
+
overflow: auto;
|
|
23
|
+
|
|
24
|
+
@include enter;
|
|
25
|
+
|
|
26
|
+
&::backdrop {
|
|
27
|
+
background: color-mix(in oklab, var(--og-color-bg) 35%, rgb(0 0 0 / 0.45));
|
|
28
|
+
transition:
|
|
29
|
+
opacity var(--og-motion-duration) var(--og-easing),
|
|
30
|
+
overlay var(--og-motion-duration) allow-discrete,
|
|
31
|
+
display var(--og-motion-duration) allow-discrete;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&[open]::backdrop {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
|
|
38
|
+
@starting-style {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// The effect slot needs a positioned box; dialogs already are one.
|
|
44
|
+
&::before {
|
|
45
|
+
content: '';
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset: 0;
|
|
48
|
+
border-radius: inherit;
|
|
49
|
+
background: var(--og-surface-overlay-highlight);
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
> * {
|
|
54
|
+
position: relative;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__header {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: flex-start;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
gap: 1rem;
|
|
62
|
+
padding: var(--og-card-pad) var(--og-card-pad) 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__title {
|
|
66
|
+
margin: 0;
|
|
67
|
+
font-family: var(--og-font-display);
|
|
68
|
+
font-size: 1.125rem;
|
|
69
|
+
font-weight: var(--og-font-weight-strong);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__description {
|
|
73
|
+
margin: 0.25rem 0 0;
|
|
74
|
+
color: var(--og-color-text-muted);
|
|
75
|
+
font-size: 0.875rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__body {
|
|
79
|
+
padding: var(--og-gap) var(--og-card-pad);
|
|
80
|
+
font-size: 0.875rem;
|
|
81
|
+
line-height: 1.6;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__footer {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-wrap: wrap;
|
|
87
|
+
justify-content: flex-end;
|
|
88
|
+
gap: 0.5rem;
|
|
89
|
+
padding: 0 var(--og-card-pad) var(--og-card-pad);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&__close {
|
|
93
|
+
display: inline-grid;
|
|
94
|
+
place-items: center;
|
|
95
|
+
flex: none;
|
|
96
|
+
width: 2rem;
|
|
97
|
+
height: 2rem;
|
|
98
|
+
border: 0;
|
|
99
|
+
border-radius: var(--og-radius-sm);
|
|
100
|
+
background: transparent;
|
|
101
|
+
color: var(--og-color-text-muted);
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
|
|
104
|
+
&::after {
|
|
105
|
+
@include icon($icon-close);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:hover {
|
|
109
|
+
background: color-mix(in oklab, var(--og-color-text) 8%, transparent);
|
|
110
|
+
color: var(--og-color-text);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@include focus-ring;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// <dialog class="og-dialog og-drawer"> (slides from the right; add --left or --bottom)
|
|
118
|
+
.og-drawer {
|
|
119
|
+
width: min(24rem, 100vw);
|
|
120
|
+
max-width: 100vw;
|
|
121
|
+
height: 100dvh;
|
|
122
|
+
max-height: 100dvh;
|
|
123
|
+
margin: 0 0 0 auto;
|
|
124
|
+
border-radius: var(--og-radius-lg) 0 0 var(--og-radius-lg);
|
|
125
|
+
|
|
126
|
+
@include enter(translateX(100%));
|
|
127
|
+
|
|
128
|
+
&--left {
|
|
129
|
+
margin: 0 auto 0 0;
|
|
130
|
+
border-radius: 0 var(--og-radius-lg) var(--og-radius-lg) 0;
|
|
131
|
+
@include enter(translateX(-100%));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&--bottom {
|
|
135
|
+
width: 100vw;
|
|
136
|
+
height: auto;
|
|
137
|
+
max-height: 85dvh;
|
|
138
|
+
margin: auto 0 0;
|
|
139
|
+
border-radius: var(--og-radius-lg) var(--og-radius-lg) 0 0;
|
|
140
|
+
@include enter(translateY(100%));
|
|
141
|
+
}
|
|
142
|
+
}
|