@charmland/gem 0.0.0-stage → 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 +177 -0
- package/NOTICE +13 -0
- package/README.md +24 -2
- package/assets/fonts/Hypography-Italic.woff2 +0 -0
- package/assets/fonts/Hypography-Regular.woff2 +0 -0
- package/assets/fonts/PPFraktionMono-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionMonoItalic-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionSans-Variable.ttf +0 -0
- package/assets/fonts/PPFraktionSansItalic-Variable.ttf +0 -0
- package/bin/gem-elm.js +3 -0
- package/dist/browser/boot.d.ts +10 -0
- package/dist/browser/boot.js +14 -0
- package/dist/browser/color-scheme.d.ts +9 -0
- package/dist/browser/color-scheme.js +76 -0
- package/dist/browser/ports.d.ts +37 -0
- package/dist/browser/ports.js +90 -0
- package/dist/browser/router.d.ts +5 -0
- package/dist/browser/router.js +35 -0
- package/dist/browser/runtime.d.ts +12 -0
- package/dist/browser/runtime.js +22 -0
- package/dist/browser/tabs.d.ts +9 -0
- package/dist/browser/tabs.js +69 -0
- package/dist/default/theme.css +4664 -0
- package/dist/default/theme.js +13652 -0
- package/dist/node/build.d.ts +16 -0
- package/dist/node/build.js +48 -0
- package/dist/node/cli.d.ts +2 -0
- package/dist/node/cli.js +21 -0
- package/elm.json +28 -0
- package/package.json +86 -4
- package/src/app/Gem/App.elm +1275 -0
- package/src/app/Gem/CharmSticker.elm +35 -0
- package/src/app/Gem/Components.elm +292 -0
- package/src/app/Gem/Main.elm +17 -0
- package/src/app/Gem/Ports.elm +32 -0
- package/src/app/Gem/Shell.elm +964 -0
- package/src/browser/theme.d.ts +1 -0
- package/src/core/Gem/Node.elm +219 -0
- package/src/core/Gem/Page.elm +409 -0
- package/src/core/Gem/Render.elm +472 -0
- package/src/core/Gem/Slots.elm +11 -0
- package/src/styles/docs.scss +1083 -0
- package/src/styles/fonts.scss +51 -0
- package/src/styles/gem.scss +362 -0
- package/src/styles/theme.scss +8 -0
- package/src/styles/ui/burger.scss +272 -0
- package/src/styles/ui/button.scss +350 -0
- package/src/styles/ui/charmtone.scss +70 -0
- package/src/styles/ui/controls-extra.scss +316 -0
- package/src/styles/ui/controls.scss +110 -0
- package/src/styles/ui/display.scss +359 -0
- package/src/styles/ui/dropdown.scss +341 -0
- package/src/styles/ui/form.scss +314 -0
- package/src/styles/ui/menu.scss +200 -0
- package/src/styles/ui/meter.scss +124 -0
- package/src/styles/ui/modal.scss +545 -0
- package/src/styles/ui/oauth.scss +50 -0
- package/src/styles/ui/page-nav.scss +63 -0
- package/src/styles/ui/reset.scss +111 -0
- package/src/styles/ui/scrollbar.scss +39 -0
- package/src/styles/ui/search.scss +164 -0
- package/src/styles/ui/sidebar.scss +229 -0
- package/src/styles/ui/squircle.scss +60 -0
- package/src/styles/ui/table.scss +97 -0
- package/src/styles/ui/theme.scss +132 -0
- package/src/styles/ui/toast.scss +587 -0
- package/src/styles/ui/toc.scss +128 -0
- package/src/styles/ui/typography.scss +21 -0
- package/src/styles/ui/ui.scss +33 -0
- package/src/ui/Ui/Badge.elm +51 -0
- package/src/ui/Ui/Banner.elm +97 -0
- package/src/ui/Ui/Burger.elm +259 -0
- package/src/ui/Ui/Button.elm +261 -0
- package/src/ui/Ui/Card.elm +32 -0
- package/src/ui/Ui/Cards.elm +15 -0
- package/src/ui/Ui/ChoiceGroup.elm +62 -0
- package/src/ui/Ui/CopyButton.elm +139 -0
- package/src/ui/Ui/Divider.elm +16 -0
- package/src/ui/Ui/Dropdown.elm +600 -0
- package/src/ui/Ui/Empty.elm +41 -0
- package/src/ui/Ui/ErrorBubble.elm +34 -0
- package/src/ui/Ui/Field.elm +45 -0
- package/src/ui/Ui/FormStatus.elm +32 -0
- package/src/ui/Ui/Icon.elm +381 -0
- package/src/ui/Ui/InlineForm.elm +51 -0
- package/src/ui/Ui/Input.elm +113 -0
- package/src/ui/Ui/KeyValue.elm +25 -0
- package/src/ui/Ui/ListRow.elm +67 -0
- package/src/ui/Ui/Loader.elm +32 -0
- package/src/ui/Ui/Logo/Charm.elm +21 -0
- package/src/ui/Ui/Logo/CharmMark.elm +32 -0
- package/src/ui/Ui/Logo/CharmSticker.elm +35 -0
- package/src/ui/Ui/Logo/Discord.elm +26 -0
- package/src/ui/Ui/Logo/GitHub.elm +21 -0
- package/src/ui/Ui/Logo/Google.elm +21 -0
- package/src/ui/Ui/Logo/Hexy.elm +29 -0
- package/src/ui/Ui/Logo/Hyper.elm +42 -0
- package/src/ui/Ui/Logo/Integration.elm +117 -0
- package/src/ui/Ui/Logo/Prism.elm +35 -0
- package/src/ui/Ui/Logos.elm +115 -0
- package/src/ui/Ui/Menu.elm +348 -0
- package/src/ui/Ui/Meter.elm +132 -0
- package/src/ui/Ui/Modal.elm +247 -0
- package/src/ui/Ui/Motion.elm +32 -0
- package/src/ui/Ui/NumberBox.elm +86 -0
- package/src/ui/Ui/OAuthButton.elm +39 -0
- package/src/ui/Ui/PageNav.elm +65 -0
- package/src/ui/Ui/Pager.elm +49 -0
- package/src/ui/Ui/Search.elm +396 -0
- package/src/ui/Ui/SearchBox.elm +78 -0
- package/src/ui/Ui/Section.elm +21 -0
- package/src/ui/Ui/Sidebar.elm +239 -0
- package/src/ui/Ui/Stat.elm +29 -0
- package/src/ui/Ui/Switch.elm +34 -0
- package/src/ui/Ui/Table.elm +89 -0
- package/src/ui/Ui/Tabs.elm +280 -0
- package/src/ui/Ui/ToC.elm +120 -0
- package/src/ui/Ui/Toast.elm +1145 -0
- package/src/ui/Ui/Toolbar.elm +31 -0
- package/src/ui/Ui/TwoStepConfirm.elm +159 -0
- package/src/ui/Ui/Typography.elm +33 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@use "charmtone";
|
|
2
|
+
@use "sass:color";
|
|
3
|
+
@use "controls" as *;
|
|
4
|
+
|
|
5
|
+
html {
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
overscroll-behavior: none;
|
|
8
|
+
// Programmatic scrolls (in-page anchor links scroll via
|
|
9
|
+
// Browser.Dom.setViewport, which lands in window.scroll) glide
|
|
10
|
+
// instead of jumping. Hosts keep an explicit instant override where
|
|
11
|
+
// in-app navigation must snap.
|
|
12
|
+
scroll-behavior: smooth;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (prefers-reduced-motion: reduce) {
|
|
16
|
+
html {
|
|
17
|
+
scroll-behavior: auto;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// The theme's gray roles, one swatch per job. Every structural color in
|
|
22
|
+
// the app reads a role rather than a palette swatch, so a theme swaps
|
|
23
|
+
// the set in one place. Two sets ship, keyed off <html>:
|
|
24
|
+
//
|
|
25
|
+
// dark — bbq page, pepper wells: the mode Gem boots in, and the base
|
|
26
|
+
// :root rules carry it
|
|
27
|
+
// light — the salt set: `data-theme="light"`
|
|
28
|
+
//
|
|
29
|
+
// Gem applies `data-theme="dark"` before the first paint.
|
|
30
|
+
//
|
|
31
|
+
// The local dev Tuner overrides --fg/--bg inline on the layout root
|
|
32
|
+
// while open; when it's closed the theme owns them again.
|
|
33
|
+
:root {
|
|
34
|
+
// We're a dark site by default: native scrollbars and form controls
|
|
35
|
+
// follow suit.
|
|
36
|
+
color-scheme: dark;
|
|
37
|
+
--bg: #{charmtone.$bbq};
|
|
38
|
+
--fg: #{charmtone.$steep};
|
|
39
|
+
--muted: #{charmtone.$steam};
|
|
40
|
+
--tertiary: #{charmtone.$squid};
|
|
41
|
+
--frame: #{charmtone.$iron};
|
|
42
|
+
--well: #{charmtone.$pepper};
|
|
43
|
+
// The plate: the fill of a large content block (code frames, the
|
|
44
|
+
// folded ToC band). Dark keeps it on the well; light lifts it a rung,
|
|
45
|
+
// because a whole block on the well reads heavy on the salt page.
|
|
46
|
+
--plate: var(--well);
|
|
47
|
+
--rule: #{rgba(charmtone.$steam, 0.12)};
|
|
48
|
+
--wash: #{rgba(charmtone.$salt, 0.04)};
|
|
49
|
+
--stripe: #{color.mix(charmtone.$pepper, charmtone.$bbq, 35%)};
|
|
50
|
+
// Status colors: the accents that carry meaning. The dark set is the
|
|
51
|
+
// saturated end of the palette; the light set steps down so text on
|
|
52
|
+
// salt keeps its contrast.
|
|
53
|
+
--ok: #{charmtone.$julep};
|
|
54
|
+
--warn: #{charmtone.$tang};
|
|
55
|
+
--danger: #{charmtone.$coral};
|
|
56
|
+
// Interaction roles, kept apart the way shadcn keeps them: the ring
|
|
57
|
+
// token marks keyboard focus — border and glow together, one hue —
|
|
58
|
+
// and the primary token marks what is chosen. A control can then be
|
|
59
|
+
// selected and focused without the two signals collapsing into one.
|
|
60
|
+
//
|
|
61
|
+
// The ring is charple in both themes by design: focus is a stylized
|
|
62
|
+
// purple, not a neutral. It therefore lives only here — no light
|
|
63
|
+
// override — and destructive controls still ring in the danger token
|
|
64
|
+
// rather than purple, since that distinction is semantic, not
|
|
65
|
+
// thematic. --primary happens to be charple too; the roles stay
|
|
66
|
+
// separate tokens so either can be retuned alone.
|
|
67
|
+
--ring: #{charmtone.$charple};
|
|
68
|
+
--primary: #{charmtone.$charple};
|
|
69
|
+
// Text links. Charple is too dark to read as text on char (2.3:1), and
|
|
70
|
+
// no purple swatch reaches 4.5:1 there, so the dark link is hazy lifted
|
|
71
|
+
// toward salt (4.8:1). Light keeps charple, which reads on salt (4.6:1).
|
|
72
|
+
--link: #{color.mix(charmtone.$hazy, charmtone.$salt, 70%)};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// The deep dark: one rung down the ladder. The page drops to bbq, the
|
|
76
|
+
// wells to pepper, and the stripe mix follows the same step.
|
|
77
|
+
:root[data-theme="dark"] {
|
|
78
|
+
--bg: #{charmtone.$bbq};
|
|
79
|
+
--well: #{charmtone.$pepper};
|
|
80
|
+
--stripe: #{color.mix(charmtone.$pepper, charmtone.$bbq, 35%)};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:root[data-theme="light"] {
|
|
84
|
+
color-scheme: light;
|
|
85
|
+
--bg: #{charmtone.$salt};
|
|
86
|
+
--fg: #{charmtone.$iron};
|
|
87
|
+
--muted: #{charmtone.$oyster};
|
|
88
|
+
--tertiary: #{charmtone.$squid};
|
|
89
|
+
--frame: #{charmtone.$steep};
|
|
90
|
+
// The sash/steep midpoint: between two rungs of the gray ladder. Sash
|
|
91
|
+
// alone sits too close to the salt page to read as a recess, and a
|
|
92
|
+
// full step to steep overshoots — it lands on --frame, flattening the
|
|
93
|
+
// resting hairlines painted on a well (the auth fields' borders, the
|
|
94
|
+
// table headers' rules, the theme tiles' outlines).
|
|
95
|
+
--well: #{color.mix(charmtone.$sash, charmtone.$steep, 50%)};
|
|
96
|
+
// Blocks carry their own --frame hairline, so sash reads as a surface
|
|
97
|
+
// here even though it is too faint for a control's recess.
|
|
98
|
+
--plate: #{charmtone.$sash};
|
|
99
|
+
--rule: #{rgba(charmtone.$oyster, 0.2)};
|
|
100
|
+
--wash: #{rgba(charmtone.$iron, 0.05)};
|
|
101
|
+
--stripe: #{color.mix(charmtone.$sash, charmtone.$salt, 60%)};
|
|
102
|
+
--ok: #{charmtone.$guac};
|
|
103
|
+
--warn: #{color.adjust(charmtone.$tang, $lightness: -18%)};
|
|
104
|
+
--danger: #{charmtone.$cherry};
|
|
105
|
+
--primary: #{charmtone.$charple};
|
|
106
|
+
--link: #{charmtone.$charple};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
html,
|
|
110
|
+
body {
|
|
111
|
+
height: 100%;
|
|
112
|
+
// Charmform on html/body, not a content container, so widgets
|
|
113
|
+
// rendered outside the page (the mobile drawer, toasts, dialogs)
|
|
114
|
+
// inherit it too.
|
|
115
|
+
font-family: $sans;
|
|
116
|
+
font-weight: 500;
|
|
117
|
+
color: var(--fg);
|
|
118
|
+
background: var(--bg);
|
|
119
|
+
-webkit-font-smoothing: antialiased;
|
|
120
|
+
-moz-osx-font-smoothing: grayscale;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
::selection {
|
|
124
|
+
background: charmtone.$zest;
|
|
125
|
+
color: charmtone.$char;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
input,
|
|
129
|
+
textarea {
|
|
130
|
+
font-weight: inherit;
|
|
131
|
+
caret-color: charmtone.$dolly;
|
|
132
|
+
}
|
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
// The toast (src/Toast.elm): six docks, decked, hover fans the stack.
|
|
2
|
+
|
|
3
|
+
@use "charmtone";
|
|
4
|
+
@use "controls" as *;
|
|
5
|
+
|
|
6
|
+
// A soft spring for stack movement: a little overshoot, no wobble.
|
|
7
|
+
$toast-spring: cubic-bezier(0.34, 1.26, 0.64, 1);
|
|
8
|
+
|
|
9
|
+
// The deck sits above the page: a contact shadow, a mid bounce, and a
|
|
10
|
+
// wide ambient falloff, with a hairline highlight on the top edge.
|
|
11
|
+
$toast-shadow:
|
|
12
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.08),
|
|
13
|
+
0 0.125rem 0.25rem rgba(charmtone.$pepper, 0.2),
|
|
14
|
+
0 0.5rem 1rem rgba(charmtone.$pepper, 0.26),
|
|
15
|
+
0 1rem 2rem rgba(charmtone.$pepper, 0.18);
|
|
16
|
+
|
|
17
|
+
.toast-region {
|
|
18
|
+
position: fixed;
|
|
19
|
+
z-index: 210;
|
|
20
|
+
width: 18rem;
|
|
21
|
+
max-width: calc(100vw - 3rem);
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
// pointer-events stays on so the fanned gaps keep the hover.
|
|
25
|
+
pointer-events: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pos-top-left,
|
|
29
|
+
.pos-top-center,
|
|
30
|
+
.pos-top-right {
|
|
31
|
+
top: 1.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pos-bottom-left,
|
|
35
|
+
.pos-bottom-center,
|
|
36
|
+
.pos-bottom-right {
|
|
37
|
+
bottom: 1.5rem;
|
|
38
|
+
flex-direction: column-reverse;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pos-top-left,
|
|
42
|
+
.pos-bottom-left {
|
|
43
|
+
left: 1.5rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pos-top-center,
|
|
47
|
+
.pos-bottom-center {
|
|
48
|
+
left: 50%;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pos-top-right,
|
|
53
|
+
.pos-bottom-right {
|
|
54
|
+
right: 1.5rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// The dock half sets the leave direction.
|
|
58
|
+
.pos-top {
|
|
59
|
+
--leave: -0.7rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pos-bottom {
|
|
63
|
+
--leave: 0.7rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// The deck: child 1 is newest; cards 4+ hide fully until hover
|
|
67
|
+
// fans the stack.
|
|
68
|
+
.toast-item {
|
|
69
|
+
--deck: 3;
|
|
70
|
+
// Matches the desktop pill's min-height, so the stack does not jump
|
|
71
|
+
// between the first frame and the measurement.
|
|
72
|
+
--card-h: 3.25rem;
|
|
73
|
+
--peek: 0.5rem;
|
|
74
|
+
// The collapsed stack takes the front card's measured height, so a
|
|
75
|
+
// description card doesn't distort every peek behind it.
|
|
76
|
+
height: var(--stack-h, var(--card-h));
|
|
77
|
+
pointer-events: auto;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
flex: 0 0 auto;
|
|
80
|
+
width: 100%;
|
|
81
|
+
user-select: none;
|
|
82
|
+
// Keeps the touch from being claimed by page scrolling.
|
|
83
|
+
touch-action: none;
|
|
84
|
+
z-index: calc(10 - var(--deck));
|
|
85
|
+
scale: calc(1 - (var(--deck) - 1) * 0.04);
|
|
86
|
+
transition:
|
|
87
|
+
margin-top 260ms $toast-spring,
|
|
88
|
+
height 260ms $toast-spring,
|
|
89
|
+
transform 260ms $toast-spring,
|
|
90
|
+
scale 260ms $toast-spring;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Behind cards clamp to the front height and hide their content until
|
|
94
|
+
// the stack fans, so collapsed peeks stay even.
|
|
95
|
+
.toast-item:nth-child(n + 2) {
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
|
|
98
|
+
.toast {
|
|
99
|
+
height: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.toast > * {
|
|
103
|
+
opacity: 0;
|
|
104
|
+
transition: opacity 150ms ease;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.toast-item + .toast-item {
|
|
109
|
+
margin-top: calc(var(--peek) - var(--stack-h, var(--card-h)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.toast-item:nth-child(n + 4) {
|
|
113
|
+
margin-top: calc(-1 * var(--stack-h, var(--card-h)));
|
|
114
|
+
visibility: hidden;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// column-reverse puts the overlap on every card's margin-top,
|
|
118
|
+
// front card included.
|
|
119
|
+
.pos-bottom .toast-item {
|
|
120
|
+
margin-top: calc(var(--peek) - var(--stack-h, var(--card-h)));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.pos-bottom .toast-item:nth-child(n + 4) {
|
|
124
|
+
margin-top: calc(-1 * var(--stack-h, var(--card-h)));
|
|
125
|
+
visibility: hidden;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.toast-region.hovered .toast-item + .toast-item,
|
|
129
|
+
.toast-region:has(:focus-visible) .toast-item + .toast-item,
|
|
130
|
+
.toast-region.fanned .toast-item + .toast-item,
|
|
131
|
+
.toast-region.hovered .toast-item:nth-child(n + 4),
|
|
132
|
+
.toast-region:has(:focus-visible) .toast-item:nth-child(n + 4),
|
|
133
|
+
.toast-region.fanned .toast-item:nth-child(n + 4) {
|
|
134
|
+
margin-top: 0.6rem;
|
|
135
|
+
visibility: visible;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.pos-bottom.hovered .toast-item,
|
|
139
|
+
.pos-bottom:has(:focus-visible) .toast-item,
|
|
140
|
+
.pos-bottom.fanned .toast-item {
|
|
141
|
+
margin-top: 0.6rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.toast-region.hovered .toast-item,
|
|
145
|
+
.toast-region:has(:focus-visible) .toast-item,
|
|
146
|
+
.toast-region.fanned .toast-item {
|
|
147
|
+
height: auto;
|
|
148
|
+
overflow: visible;
|
|
149
|
+
scale: 1;
|
|
150
|
+
|
|
151
|
+
.toast {
|
|
152
|
+
height: auto;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.toast > * {
|
|
156
|
+
opacity: 1;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.toast-item:nth-child(1) {
|
|
161
|
+
--deck: 1;
|
|
162
|
+
// The front card shows its full title and description; --stack-h is
|
|
163
|
+
// the one-line height the cards tucked behind it collapse to.
|
|
164
|
+
height: auto;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.toast-item:nth-child(2) {
|
|
168
|
+
--deck: 2;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.toast-item:nth-child(3) {
|
|
172
|
+
--deck: 3;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Frames drive the transform; keep it out of the transition so CSS
|
|
176
|
+
// doesn't lag the spring.
|
|
177
|
+
.toast-item.dragging {
|
|
178
|
+
transition:
|
|
179
|
+
margin-top 260ms $toast-spring,
|
|
180
|
+
scale 260ms $toast-spring;
|
|
181
|
+
cursor: grabbing;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.toast-item.moving {
|
|
185
|
+
transition:
|
|
186
|
+
margin-top 260ms $toast-spring,
|
|
187
|
+
scale 260ms $toast-spring;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.toast-item.leaving {
|
|
191
|
+
animation: toast-leave 220ms ease forwards;
|
|
192
|
+
pointer-events: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes toast-leave {
|
|
196
|
+
to {
|
|
197
|
+
opacity: 0;
|
|
198
|
+
scale: 0.92;
|
|
199
|
+
translate: 0 var(--leave, -0.7rem);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Deck count chip on the front card.
|
|
204
|
+
.toast-count {
|
|
205
|
+
position: absolute;
|
|
206
|
+
right: 0.75rem;
|
|
207
|
+
bottom: -0.55rem;
|
|
208
|
+
z-index: 20;
|
|
209
|
+
padding: 0.1rem 0.5rem;
|
|
210
|
+
border-radius: 999px;
|
|
211
|
+
background: #{charmtone.$hazy};
|
|
212
|
+
color: var(--card-fg, #{charmtone.$salt});
|
|
213
|
+
box-shadow: 0 0.1rem 0.3rem rgba(charmtone.$pepper, 0.28);
|
|
214
|
+
font-family: $mono;
|
|
215
|
+
font-size: 0.625rem;
|
|
216
|
+
font-weight: 620;
|
|
217
|
+
line-height: 1.4;
|
|
218
|
+
pointer-events: none;
|
|
219
|
+
opacity: 0;
|
|
220
|
+
transition: opacity 180ms $toast-spring;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.toast-count.visible {
|
|
224
|
+
opacity: 1;
|
|
225
|
+
animation: toast-count-in 260ms $toast-spring backwards;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@keyframes toast-count-in {
|
|
229
|
+
from {
|
|
230
|
+
opacity: 0;
|
|
231
|
+
scale: 0.9;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.pos-bottom .toast-count {
|
|
236
|
+
bottom: auto;
|
|
237
|
+
top: -0.55rem;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.toast-region.hovered .toast-count,
|
|
241
|
+
.toast-region:has(:focus-visible) .toast-count,
|
|
242
|
+
.toast-region.fanned .toast-count {
|
|
243
|
+
opacity: 0;
|
|
244
|
+
animation: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Icon-first entrance: one icon wide, then open to full width.
|
|
248
|
+
@keyframes toast-grow-x {
|
|
249
|
+
from {
|
|
250
|
+
max-width: 2.75rem;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
to {
|
|
254
|
+
max-width: 18rem;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@keyframes toast-pill-center {
|
|
259
|
+
from {
|
|
260
|
+
padding-inline-start: calc(50% - 0.5rem);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
to {
|
|
264
|
+
padding-inline-start: 1.05rem;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// The center start only makes sense over a center dock.
|
|
269
|
+
.pos-top-center .toast-pill,
|
|
270
|
+
.pos-bottom-center .toast-pill {
|
|
271
|
+
animation: toast-pill-center 340ms $toast-spring 180ms backwards;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.toast {
|
|
275
|
+
position: relative;
|
|
276
|
+
border-radius: calc(0.75rem * var(--squircle-scale, 1));
|
|
277
|
+
background: var(--card, #{charmtone.$charple});
|
|
278
|
+
color: var(--card-fg, #{charmtone.$salt});
|
|
279
|
+
box-shadow: $toast-shadow;
|
|
280
|
+
overflow: hidden;
|
|
281
|
+
margin-inline: auto;
|
|
282
|
+
animation:
|
|
283
|
+
toast-grow-x 340ms $toast-spring 180ms backwards,
|
|
284
|
+
toast-appear 360ms $toast-spring 180ms backwards;
|
|
285
|
+
|
|
286
|
+
&.is-success {
|
|
287
|
+
--sev: #{charmtone.$guac};
|
|
288
|
+
--sev-fg: #{charmtone.$salt};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&.is-error {
|
|
292
|
+
--sev: #{charmtone.$cherry};
|
|
293
|
+
--sev-fg: #{charmtone.$salt};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&.is-info {
|
|
297
|
+
--sev: #{charmtone.$dolly};
|
|
298
|
+
--sev-fg: #{charmtone.$salt};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&.is-warn {
|
|
302
|
+
--sev: #{charmtone.$zest};
|
|
303
|
+
// Lime needs dark text; every other kind reads on white.
|
|
304
|
+
--sev-fg: #{charmtone.$pepper};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.toast-pill {
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: stretch;
|
|
310
|
+
padding: 0.85rem 0.9rem 0.65rem 1.05rem;
|
|
311
|
+
|
|
312
|
+
// Keyed so a state change remounts it.
|
|
313
|
+
.toast-pill-inner {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: stretch;
|
|
316
|
+
flex: 1;
|
|
317
|
+
min-width: 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.toast-pill-row {
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
gap: 0.6rem;
|
|
324
|
+
flex: 1;
|
|
325
|
+
min-width: 0;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// A patch replays the entrance; the card keeps its size.
|
|
329
|
+
.toast-pill-row.morph {
|
|
330
|
+
animation: toast-header-in 300ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.toast-icon {
|
|
334
|
+
display: flex;
|
|
335
|
+
flex: 0 0 auto;
|
|
336
|
+
color: var(--sev, #{charmtone.$guac});
|
|
337
|
+
|
|
338
|
+
svg {
|
|
339
|
+
width: 1rem;
|
|
340
|
+
height: 1rem;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.toast-title {
|
|
345
|
+
flex: 1;
|
|
346
|
+
margin: 0;
|
|
347
|
+
font-weight: 640;
|
|
348
|
+
font-size: 0.875rem;
|
|
349
|
+
line-height: 1.2;
|
|
350
|
+
white-space: nowrap;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
text-overflow: ellipsis;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Mobile only; the desktop dismisses by swiping.
|
|
356
|
+
.toast-close {
|
|
357
|
+
display: none;
|
|
358
|
+
align-items: center;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
flex: 0 0 auto;
|
|
361
|
+
width: 1.5rem;
|
|
362
|
+
height: 1.5rem;
|
|
363
|
+
margin-left: auto;
|
|
364
|
+
margin-right: 0;
|
|
365
|
+
padding: 0;
|
|
366
|
+
border: 0;
|
|
367
|
+
border-radius: 50%;
|
|
368
|
+
background: none;
|
|
369
|
+
color: color-mix(
|
|
370
|
+
in srgb,
|
|
371
|
+
var(--card-fg, #{charmtone.$salt}) 65%,
|
|
372
|
+
transparent
|
|
373
|
+
);
|
|
374
|
+
cursor: pointer;
|
|
375
|
+
transition:
|
|
376
|
+
color 125ms ease,
|
|
377
|
+
background 125ms ease;
|
|
378
|
+
|
|
379
|
+
svg {
|
|
380
|
+
width: 1rem;
|
|
381
|
+
height: 1rem;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
&:hover {
|
|
385
|
+
color: var(--card-fg, #{charmtone.$salt});
|
|
386
|
+
background: color-mix(
|
|
387
|
+
in srgb,
|
|
388
|
+
var(--card-fg, #{charmtone.$salt}) 12%,
|
|
389
|
+
transparent
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&:active {
|
|
394
|
+
background: color-mix(
|
|
395
|
+
in srgb,
|
|
396
|
+
var(--card-fg, #{charmtone.$salt}) 18%,
|
|
397
|
+
transparent
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
&:focus-visible {
|
|
402
|
+
outline: none;
|
|
403
|
+
box-shadow: 0 0 0 3px
|
|
404
|
+
color-mix(
|
|
405
|
+
in srgb,
|
|
406
|
+
var(--card-fg, #{charmtone.$salt}) 30%,
|
|
407
|
+
transparent
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.toast-desc {
|
|
414
|
+
max-height: 8rem;
|
|
415
|
+
opacity: 1;
|
|
416
|
+
overflow: hidden;
|
|
417
|
+
margin: 0;
|
|
418
|
+
padding: 0.15rem 1.05rem 0.75rem;
|
|
419
|
+
font-size: 0.8125rem;
|
|
420
|
+
color: var(--card-fg, #{charmtone.$salt});
|
|
421
|
+
line-height: 1.35;
|
|
422
|
+
box-sizing: border-box;
|
|
423
|
+
|
|
424
|
+
p {
|
|
425
|
+
margin: 0;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// The catalogue's secondary compact button, recolored to the card
|
|
430
|
+
// the way modal.scss recolors it to its surface.
|
|
431
|
+
.toast-desc button.toast-action {
|
|
432
|
+
margin-top: 1rem;
|
|
433
|
+
color: var(--card-fg, #{charmtone.$salt});
|
|
434
|
+
border-color: color-mix(
|
|
435
|
+
in srgb,
|
|
436
|
+
var(--card-fg, #{charmtone.$salt}) 40%,
|
|
437
|
+
transparent
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.toast-desc button.toast-action:hover {
|
|
442
|
+
border-color: #{charmtone.$julep};
|
|
443
|
+
color: #{charmtone.$julep};
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// Without a description the title carries the whole message, so it
|
|
447
|
+
// wraps instead of clipping to the pill's single line.
|
|
448
|
+
&:not(.has-description) .toast-title {
|
|
449
|
+
white-space: normal;
|
|
450
|
+
overflow: visible;
|
|
451
|
+
text-overflow: clip;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Every pill starts the same height on the desktop, so a title-only
|
|
455
|
+
// toast stands as tall as a described one's header. Even block padding
|
|
456
|
+
// centers the row in the extra room rather than hanging it off the
|
|
457
|
+
// described pill's top-heavy padding.
|
|
458
|
+
@media (min-width: 40.0625rem) {
|
|
459
|
+
.toast-pill {
|
|
460
|
+
padding-block: 0.5rem;
|
|
461
|
+
min-height: 3.25rem;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// The description stays collapsed until the pill's entrance finishes
|
|
467
|
+
// (180ms delay + 340ms animation), then unfurls; the fill holds the
|
|
468
|
+
// collapsed state through the delay so nothing reflows mid-growth.
|
|
469
|
+
.toast.has-description .toast-desc {
|
|
470
|
+
animation: toast-desc-open 240ms $toast-spring 520ms both;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
@keyframes toast-desc-open {
|
|
474
|
+
from {
|
|
475
|
+
max-height: 0;
|
|
476
|
+
opacity: 0;
|
|
477
|
+
padding-bottom: 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
to {
|
|
481
|
+
max-height: 8rem;
|
|
482
|
+
opacity: 1;
|
|
483
|
+
padding-top: 0.15rem;
|
|
484
|
+
padding-bottom: 0.75rem;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// Mobile: a slimmer card on the narrow viewport; --card-h moves with
|
|
489
|
+
// the tightened pill padding (0.55rem around the icon, 0.65rem here).
|
|
490
|
+
@media (max-width: 40rem) {
|
|
491
|
+
// The API's dock survives; the geometry is responsive.
|
|
492
|
+
.toast-region {
|
|
493
|
+
width: auto;
|
|
494
|
+
max-width: none;
|
|
495
|
+
left: 0.5rem;
|
|
496
|
+
right: 0.5rem;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.pos-top-center,
|
|
500
|
+
.pos-bottom-center {
|
|
501
|
+
left: 0.5rem;
|
|
502
|
+
transform: none;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.pos-top-left,
|
|
506
|
+
.pos-top-center,
|
|
507
|
+
.pos-top-right {
|
|
508
|
+
top: 0.5rem;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.pos-bottom-left,
|
|
512
|
+
.pos-bottom-center,
|
|
513
|
+
.pos-bottom-right {
|
|
514
|
+
bottom: 0.5rem;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// The icon-width card hugs the dock.
|
|
518
|
+
.pos-top-left .toast,
|
|
519
|
+
.pos-bottom-left .toast {
|
|
520
|
+
margin-inline: 0 auto;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.pos-top-right .toast,
|
|
524
|
+
.pos-bottom-right .toast {
|
|
525
|
+
margin-inline: auto 0;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.toast-item {
|
|
529
|
+
--card-h: 2.2rem;
|
|
530
|
+
--peek: 0.2rem;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.toast .toast-pill {
|
|
534
|
+
padding: 0.55rem 0.45rem 0.55rem 0.9rem;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// The title holds one clipped line through the entrance, then wraps.
|
|
538
|
+
.toast .toast-pill .toast-title {
|
|
539
|
+
white-space: normal;
|
|
540
|
+
animation: toast-unwrap 1ms linear 530ms both;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.toast .toast-pill .toast-close {
|
|
544
|
+
display: flex;
|
|
545
|
+
height: 1.5rem;
|
|
546
|
+
margin-top: 0;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
// The row stays centered as the title unwraps.
|
|
550
|
+
.toast .toast-pill .toast-pill-row {
|
|
551
|
+
align-items: center;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
.toast .toast-desc {
|
|
555
|
+
font-size: 0.75rem;
|
|
556
|
+
padding-inline: 0.9rem;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
@keyframes toast-unwrap {
|
|
561
|
+
from {
|
|
562
|
+
white-space: nowrap;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
to {
|
|
566
|
+
white-space: normal;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@keyframes toast-appear {
|
|
571
|
+
from {
|
|
572
|
+
opacity: 0;
|
|
573
|
+
translate: 0 var(--leave, 0.7rem);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
@keyframes toast-header-in {
|
|
578
|
+
from {
|
|
579
|
+
opacity: 0;
|
|
580
|
+
filter: blur(6px);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
to {
|
|
584
|
+
opacity: 1;
|
|
585
|
+
filter: blur(0);
|
|
586
|
+
}
|
|
587
|
+
}
|