@cloudgrid-io/ui 0.32.0 → 0.32.4
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/README.md +29 -2
- package/dist/badge/bubble.d.ts +6 -1
- package/dist/badge/bubble.d.ts.map +1 -1
- package/dist/badge/bubble.js +10 -5
- package/dist/badge/bubble.js.map +1 -1
- package/dist/badge/css-base.d.ts +9 -2
- package/dist/badge/css-base.d.ts.map +1 -1
- package/dist/badge/css-base.js +49 -2
- package/dist/badge/css-base.js.map +1 -1
- package/dist/badge/css-bubble.d.ts +9 -6
- package/dist/badge/css-bubble.d.ts.map +1 -1
- package/dist/badge/css-bubble.js +17 -16
- package/dist/badge/css-bubble.js.map +1 -1
- package/dist/badge/css-live.d.ts +29 -0
- package/dist/badge/css-live.d.ts.map +1 -0
- package/dist/badge/css-live.js +64 -0
- package/dist/badge/css-live.js.map +1 -0
- package/dist/badge/css-owner.d.ts.map +1 -1
- package/dist/badge/css-owner.js +12 -5
- package/dist/badge/css-owner.js.map +1 -1
- package/dist/badge/css-visitor.d.ts.map +1 -1
- package/dist/badge/css-visitor.js +21 -18
- package/dist/badge/css-visitor.js.map +1 -1
- package/dist/badge/index.d.ts +6 -4
- package/dist/badge/index.d.ts.map +1 -1
- package/dist/badge/index.js +8 -5
- package/dist/badge/index.js.map +1 -1
- package/dist/badge/live.d.ts +56 -0
- package/dist/badge/live.d.ts.map +1 -0
- package/dist/badge/live.js +58 -0
- package/dist/badge/live.js.map +1 -0
- package/dist/badge/marks.d.ts +5 -1
- package/dist/badge/marks.d.ts.map +1 -1
- package/dist/badge/marks.js +11 -1
- package/dist/badge/marks.js.map +1 -1
- package/dist/badge/owner.d.ts.map +1 -1
- package/dist/badge/owner.js +12 -6
- package/dist/badge/owner.js.map +1 -1
- package/dist/badge/palette.d.ts +1 -1
- package/dist/badge/palette.d.ts.map +1 -1
- package/dist/badge/palette.js +10 -1
- package/dist/badge/palette.js.map +1 -1
- package/dist/badge/root.d.ts +1 -1
- package/dist/badge/root.d.ts.map +1 -1
- package/dist/badge/visitor.d.ts +21 -5
- package/dist/badge/visitor.d.ts.map +1 -1
- package/dist/badge/visitor.js +20 -8
- package/dist/badge/visitor.js.map +1 -1
- package/dist/blocks/icons.d.ts +10 -0
- package/dist/blocks/icons.d.ts.map +1 -1
- package/dist/blocks/icons.js +10 -0
- package/dist/blocks/icons.js.map +1 -1
- package/dist/blocks/phosphor-marks.d.ts +4 -0
- package/dist/blocks/phosphor-marks.d.ts.map +1 -1
- package/dist/blocks/phosphor-marks.js +6 -0
- package/dist/blocks/phosphor-marks.js.map +1 -1
- package/dist/console.css +4 -2
- package/dist/tokens/base.json +76 -0
- package/dist/tokens.css +36 -0
- package/dist/tokens.json +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,8 +48,14 @@ The order matters, and getting it wrong fails quietly rather than loudly.
|
|
|
48
48
|
- `console.css` is a **product preset**, not part of the base. It re-declares the body and
|
|
49
49
|
display faces as the UI face, Manrope. The CloudGrid Console imports it; so should any
|
|
50
50
|
product whose type is the UI face rather than the display face. Everyone else leaves the
|
|
51
|
-
line out and keeps the default. It has to sit after `tokens.css
|
|
52
|
-
re-declares
|
|
51
|
+
line out and keeps the default. It has to sit **after `tokens.css`**, which is what it
|
|
52
|
+
re-declares: import it before `tokens.css` and the default face wins at equal specificity,
|
|
53
|
+
silently. Its position relative to `theme.css` does not matter. `theme.css` is
|
|
54
|
+
`@theme inline`, so the utilities it emits are live `var()` references that resolve
|
|
55
|
+
wherever the token ends up, and Tailwind hoists theme output above plain CSS anyway;
|
|
56
|
+
measured with Tailwind 4, `console.css` before or after `theme.css` compiles byte-identical.
|
|
57
|
+
The order above is still the recommended one, because it keeps the presets beside the
|
|
58
|
+
tokens they change.
|
|
53
59
|
- `shadcn.css` must come after whatever `:root` your own `shadcn init` wrote, because it
|
|
54
60
|
overrides those values. Put it earlier and the stock grey palette wins.
|
|
55
61
|
|
|
@@ -190,6 +196,27 @@ are inlined in the component, and also ship as files for any other use:
|
|
|
190
196
|
`@cloudgrid-io/ui/brand/creations/1.webp` to `4.webp` (164x94, 2 to 5KB each). After
|
|
191
197
|
replacing a file, run `node scripts/generate-creation-previews.mjs`.
|
|
192
198
|
|
|
199
|
+
## Pictures in a component: embed or resolve
|
|
200
|
+
|
|
201
|
+
Two components ship pictures, and they do it two ways on purpose. A new component with
|
|
202
|
+
pictures picks one by this rule rather than by whichever example its author read last.
|
|
203
|
+
|
|
204
|
+
- **Embed** small decorative defaults that must work with no consumer wiring. The pictures
|
|
205
|
+
are inlined in the component as data URIs **and** ship as files under
|
|
206
|
+
`@cloudgrid-io/ui/brand/`, with a test that holds the two byte-equal. `EmptyCreations` is
|
|
207
|
+
the example: 4 thumbnails, about 13KB of files, about 18KB once inlined in
|
|
208
|
+
`empty-creations-previews.ts`. It renders correctly the moment it is imported.
|
|
209
|
+
- **Resolve** large sets, or any set the consumer is expected to choose. The pictures ship as
|
|
210
|
+
files only, and the consumer hands the component a URL for each one (`resolveSrc`, or a
|
|
211
|
+
`src` per item) through its own bundler or public folder. `ShowcaseScroll` is the example:
|
|
212
|
+
19 pictures, about 205KB of files. Inlined, they would add over a quarter of a megabyte to
|
|
213
|
+
every bundle that imports the package barrel, whether or not that page shows them.
|
|
214
|
+
|
|
215
|
+
Rough line: embed when it is a handful of pictures and **under about 20KB in total**, and
|
|
216
|
+
the component is useless without them. Past that, resolve. Base64 grows a file by about a
|
|
217
|
+
third, and an inlined picture is paid for by every consumer of the barrel rather than only by
|
|
218
|
+
the page that renders it.
|
|
219
|
+
|
|
193
220
|
## The email layout
|
|
194
221
|
|
|
195
222
|
```ts
|
package/dist/badge/bubble.d.ts
CHANGED
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Kept apart from `visitor.ts` so the owner file can draw the bubble without
|
|
7
7
|
* importing the visitor half.
|
|
8
|
+
*
|
|
9
|
+
* The design is the designer's overlay (ui#322,
|
|
10
|
+
* coolapps.cloudgrid.io/cloudgrid-overlay-acbb): three overlapping 24px discs in
|
|
11
|
+
* a white pill with a purple hairline. Left to right, chat on purple, thumbs-up
|
|
12
|
+
* on cyan, wrench on lime; each paints over the one to its left.
|
|
8
13
|
*/
|
|
9
|
-
/** The bubble's three icons in their tones: thumbs-up
|
|
14
|
+
/** The bubble's three icons in their tones, left to right: chat purple, thumbs-up cyan, wrench lime. */
|
|
10
15
|
export declare function bubbleIcons(): string;
|
|
11
16
|
//# sourceMappingURL=bubble.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble.d.ts","sourceRoot":"","sources":["../../src/badge/bubble.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bubble.d.ts","sourceRoot":"","sources":["../../src/badge/bubble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,wGAAwG;AACxG,wBAAgB,WAAW,IAAI,MAAM,CAMpC"}
|
package/dist/badge/bubble.js
CHANGED
|
@@ -5,13 +5,18 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Kept apart from `visitor.ts` so the owner file can draw the bubble without
|
|
7
7
|
* importing the visitor half.
|
|
8
|
+
*
|
|
9
|
+
* The design is the designer's overlay (ui#322,
|
|
10
|
+
* coolapps.cloudgrid.io/cloudgrid-overlay-acbb): three overlapping 24px discs in
|
|
11
|
+
* a white pill with a purple hairline. Left to right, chat on purple, thumbs-up
|
|
12
|
+
* on cyan, wrench on lime; each paints over the one to its left.
|
|
8
13
|
*/
|
|
9
|
-
import {
|
|
14
|
+
import { CHAT_TEARDROP_TEXT, THUMBS_UP, WRENCH } from "./marks.js";
|
|
10
15
|
import { glyph } from "./html.js";
|
|
11
|
-
/** The bubble's three icons in their tones: thumbs-up
|
|
16
|
+
/** The bubble's three icons in their tones, left to right: chat purple, thumbs-up cyan, wrench lime. */
|
|
12
17
|
export function bubbleIcons() {
|
|
13
|
-
return (`<span class="cgb-bubble-ic" data-tone="
|
|
14
|
-
`<span class="cgb-bubble-ic" data-tone="
|
|
15
|
-
`<span class="cgb-bubble-ic" data-tone="
|
|
18
|
+
return (`<span class="cgb-bubble-ic" data-tone="talk">${glyph(CHAT_TEARDROP_TEXT)}</span>` +
|
|
19
|
+
`<span class="cgb-bubble-ic" data-tone="like">${glyph(THUMBS_UP)}</span>` +
|
|
20
|
+
`<span class="cgb-bubble-ic" data-tone="fix">${glyph(WRENCH)}</span>`);
|
|
16
21
|
}
|
|
17
22
|
//# sourceMappingURL=bubble.js.map
|
package/dist/badge/bubble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubble.js","sourceRoot":"","sources":["../../src/badge/bubble.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bubble.js","sourceRoot":"","sources":["../../src/badge/bubble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,wGAAwG;AACxG,MAAM,UAAU,WAAW;IACzB,OAAO,CACL,gDAAgD,KAAK,CAAC,kBAAkB,CAAC,SAAS;QAClF,gDAAgD,KAAK,CAAC,SAAS,CAAC,SAAS;QACzE,+CAA+C,KAAK,CAAC,MAAM,CAAC,SAAS,CACtE,CAAA;AACH,CAAC"}
|
package/dist/badge/css-base.d.ts
CHANGED
|
@@ -12,10 +12,17 @@
|
|
|
12
12
|
* phone panels are a bottom sheet over a scrim (max-width 480px, or
|
|
13
13
|
* `data-cgb-layout="phone"` on the root, which the gallery uses
|
|
14
14
|
* to show a phone frame on a desktop screen)
|
|
15
|
-
* touch the
|
|
16
|
-
* `data-cgb-touch` on the root)
|
|
15
|
+
* touch the close x on the live badge and the bubble always shows
|
|
16
|
+
* (`hover: none`, or `data-cgb-touch` on the root); elsewhere it
|
|
17
|
+
* shows only while the pointer is over its piece or a key has
|
|
18
|
+
* focused it (ui issue 324)
|
|
17
19
|
*
|
|
18
20
|
* `data-cgb-layout="desktop"` pins the desktop answer on a narrow screen.
|
|
21
|
+
*
|
|
22
|
+
* Motion (ui issue 322): `cgb-rise` is the arrival the live badge and the bubble
|
|
23
|
+
* share, and where the browser draws `linear()` easing the root swaps
|
|
24
|
+
* `--cg-ease-spring` for the real damped spring. Reduced motion stops every
|
|
25
|
+
* animation and transition inside the root, so each piece shows at rest at once.
|
|
19
26
|
*/
|
|
20
27
|
/** A phone rule set, written once against `r`, emitted for both roots. */
|
|
21
28
|
export declare function phoneRules(rules: (r: string) => string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-base.d.ts","sourceRoot":"","sources":["../../src/badge/css-base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"css-base.d.ts","sourceRoot":"","sources":["../../src/badge/css-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAQH,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAE/D;AAED,iGAAiG;AACjG,wBAAgB,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAE/D;AAyCD,eAAO,MAAM,cAAc,EAAE,MA8EyC,CAAA"}
|
package/dist/badge/css-base.js
CHANGED
|
@@ -12,10 +12,17 @@
|
|
|
12
12
|
* phone panels are a bottom sheet over a scrim (max-width 480px, or
|
|
13
13
|
* `data-cgb-layout="phone"` on the root, which the gallery uses
|
|
14
14
|
* to show a phone frame on a desktop screen)
|
|
15
|
-
* touch the
|
|
16
|
-
* `data-cgb-touch` on the root)
|
|
15
|
+
* touch the close x on the live badge and the bubble always shows
|
|
16
|
+
* (`hover: none`, or `data-cgb-touch` on the root); elsewhere it
|
|
17
|
+
* shows only while the pointer is over its piece or a key has
|
|
18
|
+
* focused it (ui issue 324)
|
|
17
19
|
*
|
|
18
20
|
* `data-cgb-layout="desktop"` pins the desktop answer on a narrow screen.
|
|
21
|
+
*
|
|
22
|
+
* Motion (ui issue 322): `cgb-rise` is the arrival the live badge and the bubble
|
|
23
|
+
* share, and where the browser draws `linear()` easing the root swaps
|
|
24
|
+
* `--cg-ease-spring` for the real damped spring. Reduced motion stops every
|
|
25
|
+
* animation and transition inside the root, so each piece shows at rest at once.
|
|
19
26
|
*/
|
|
20
27
|
import { BADGE_TOKEN_DECLARATIONS } from "./palette.js";
|
|
21
28
|
/** The two roots a phone rule is written against: the media query's, and the forced one. */
|
|
@@ -30,6 +37,41 @@ export function touchRules(rules) {
|
|
|
30
37
|
return `@media (hover:none){${rules(".cgb")}}${rules(".cgb[data-cgb-touch]")}`;
|
|
31
38
|
}
|
|
32
39
|
const FOCUS = "outline:3px solid var(--cg-focus-ring);outline-offset:2px";
|
|
40
|
+
/**
|
|
41
|
+
* The close x (ui issue 324), one look for every piece that has one: the live
|
|
42
|
+
* badge, the feedback bubble and the bubble's still preview in the owner panel.
|
|
43
|
+
* A 20px ink disc with a 12px bold x, at the top right of its piece's wrap,
|
|
44
|
+
* which is `.cgb-x-host` and leaves 22px above the pill for it, so the x sits
|
|
45
|
+
* 2px above the pill's right end. The hit area reaches 6px out and 2px down,
|
|
46
|
+
* to the pill's edge, so the pointer never crosses a gap between the two.
|
|
47
|
+
*
|
|
48
|
+
* Hidden at rest. It shows while the pointer is over the host (the pill or the
|
|
49
|
+
* x itself), while a key has focused anything in the host, and always where
|
|
50
|
+
* there is no hover (`touchRules`). It stays focusable and clickable while
|
|
51
|
+
* hidden: a pointer over it is over the host, and Tab onto it shows it. The
|
|
52
|
+
* host itself takes no pointer, so the strip above the pill never covers the
|
|
53
|
+
* app behind it. Leaving (`data-leaving` on the host) is the exit both pieces
|
|
54
|
+
* share; reduced motion shows and hides the x with no animation, through the
|
|
55
|
+
* root's rule.
|
|
56
|
+
*/
|
|
57
|
+
const CLOSE_X = `.cgb-x-host{pointer-events:none}
|
|
58
|
+
.cgb-x-host>*{pointer-events:auto}
|
|
59
|
+
.cgb-x{position:absolute;top:0;right:0;z-index:1;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;` +
|
|
60
|
+
`background:var(--cg-text-primary);color:var(--cg-text-on-primary);opacity:0;scale:.85;` +
|
|
61
|
+
`transition:opacity var(--cg-duration) var(--cg-ease-out),scale var(--cg-duration) var(--cg-ease-out),transform 320ms var(--cg-ease-spring)}
|
|
62
|
+
.cgb-x::before{content:"";position:absolute;inset:-6px -6px -2px -6px}
|
|
63
|
+
.cgb-x svg{width:12px;height:12px}
|
|
64
|
+
.cgb-x-host:hover .cgb-x,.cgb-x:focus-visible{opacity:1;scale:1}
|
|
65
|
+
.cgb-x-host:has(:focus-visible) .cgb-x{opacity:1;scale:1}
|
|
66
|
+
@media (hover:hover){.cgb-x:hover{transform:scale(1.12)}}
|
|
67
|
+
.cgb-x:active{transform:scale(.92)}
|
|
68
|
+
.cgb .cgb-x:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
69
|
+
.cgb-x-host[data-leaving]{animation:cgb-leave 260ms var(--cg-ease-in) forwards}
|
|
70
|
+
.cgb-x-host[data-leaving]>*{pointer-events:none}
|
|
71
|
+
@keyframes cgb-pop{from{opacity:0;scale:.4}}
|
|
72
|
+
@keyframes cgb-leave{to{opacity:0;translate:0 12px;scale:.96}}
|
|
73
|
+
@media (prefers-reduced-motion:reduce){.cgb-x:hover,.cgb-x:active{transform:none}}
|
|
74
|
+
`;
|
|
33
75
|
export const BADGE_BASE_CSS = /* @__PURE__ */ (() => `.cgb{all:initial;${BADGE_TOKEN_DECLARATIONS}display:block;position:fixed;inset:0;z-index:2147483000;pointer-events:none;` +
|
|
34
76
|
`font-family:var(--cg-font-body);font-size:var(--cg-body-14);font-weight:var(--cg-weight-regular);line-height:var(--cg-body-line);` +
|
|
35
77
|
`color:var(--cg-text-primary);text-align:left;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
|
|
@@ -86,8 +128,13 @@ export const BADGE_BASE_CSS = /* @__PURE__ */ (() => `.cgb{all:initial;${BADGE_T
|
|
|
86
128
|
.cgb-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:var(--cg-body-14);cursor:pointer}
|
|
87
129
|
.cgb-desc{font-size:var(--cg-body-14);color:var(--cg-text-secondary)}
|
|
88
130
|
.cgb-scrim{display:none}
|
|
131
|
+
@keyframes cgb-rise{from{opacity:0;translate:0 30px}}
|
|
132
|
+
@supports (transition-timing-function:linear(0,1)){.cgb{--cg-ease-spring:var(--cg-ease-spring-damped)}}
|
|
89
133
|
@media (prefers-reduced-motion:reduce){.cgb *{animation:none!important;transition:none!important}}
|
|
90
134
|
` +
|
|
135
|
+
CLOSE_X +
|
|
136
|
+
touchRules((r) => `${r} .cgb-x{opacity:1;scale:1}`) +
|
|
137
|
+
"\n" +
|
|
91
138
|
phoneRules((r) => `${r} .cgb-panel{left:0;right:0;top:auto;bottom:0;width:auto;max-height:88%;transform:none;border-radius:var(--cg-radius-container) var(--cg-radius-container) 0 0;border-bottom:0;animation-name:cgb-up}` +
|
|
92
139
|
`${r} .cgb-scrim{display:block;position:absolute;inset:0;background:var(--cg-scrim)}` +
|
|
93
140
|
`${r} .cgb-panel textarea{font-size:var(--cg-body-md)}` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-base.js","sourceRoot":"","sources":["../../src/badge/css-base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"css-base.js","sourceRoot":"","sources":["../../src/badge/css-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAEvD,4FAA4F;AAC5F,MAAM,WAAW,GAAG,qCAAqC,CAAA;AACzD,MAAM,YAAY,GAAG,6BAA6B,CAAA;AAElD,0EAA0E;AAC1E,MAAM,UAAU,UAAU,CAAC,KAA4B;IACrD,OAAO,4BAA4B,KAAK,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE,CAAA;AAChF,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,UAAU,CAAC,KAA4B;IACrD,OAAO,uBAAuB,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,EAAE,CAAA;AAChF,CAAC;AAED,MAAM,KAAK,GAAG,2DAA2D,CAAA;AAEzE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,GACX;;2HAEyH;IACzH,wFAAwF;IACxF;;;;;;;;;;;;;CAaD,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE,CAC1D,oBAAoB,wBAAwB,8EAA8E;IAC1H,mIAAmI;IACnI;;;;;;;;;;sBAUoB,KAAK;;;;mKAIwI;IACjK,mIAAmI;IACnI;;;;;;;;;;6IAU2I;IAC3I,4LAA4L;IAC5L;;;;;;;;;4IAS0I;IAC1I;;;+IAG6I;IAC7I;;;;;;;;;;;;;;;CAeD;IACC,OAAO;IACP,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,4BAA4B,CAAC;IACnD,IAAI;IACJ,UAAU,CACR,CAAC,CAAC,EAAE,EAAE,CACJ,GAAG,CAAC,sMAAsM;QAC1M,GAAG,CAAC,iFAAiF;QACrF,GAAG,CAAC,mDAAmD;QACvD,sEAAsE;QACtE,yEAAyE;QACzE,yDAAyD;QACzD,GAAG,CAAC,6CAA6C;QACjD,GAAG,CAAC,6BAA6B;QACjC,GAAG,CAAC,wCAAwC;QAC5C,GAAG,CAAC,0CAA0C;QAC9C,GAAG,CAAC,wBAAwB,CAC/B;IACD,iEAAiE,CAAC,EAAE,CAAA"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The feedback bubble's look, written once against a selector: the white
|
|
3
|
-
*
|
|
4
|
-
* stylesheet applies it to the live bubble
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* cannot drift apart.
|
|
2
|
+
* The feedback bubble's look, written once against a selector: the white pill
|
|
3
|
+
* with its purple hairline and the three overlapping discs (ui issue 322, the
|
|
4
|
+
* designer's overlay). The visitor stylesheet applies it to the live bubble
|
|
5
|
+
* (`.cgb-bubble`) and adds the arrival, the hover spread and the close x; the
|
|
6
|
+
* owner stylesheet applies it to the still preview in the "Ask visitors for
|
|
7
|
+
* feedback" explanation (ui issue 316). One source, so the two cannot drift apart.
|
|
8
|
+
*
|
|
9
|
+
* Sizes are the design's: a 40px pill, 8px padding, 24px discs overlapping by
|
|
10
|
+
* 8px (4px on hover), 16px glyphs. The pill is 74px wide at rest.
|
|
8
11
|
*/
|
|
9
12
|
export declare function bubbleLook(s: string): string;
|
|
10
13
|
//# sourceMappingURL=css-bubble.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-bubble.d.ts","sourceRoot":"","sources":["../../src/badge/css-bubble.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"css-bubble.d.ts","sourceRoot":"","sources":["../../src/badge/css-bubble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAW5C"}
|
package/dist/badge/css-bubble.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The feedback bubble's look, written once against a selector: the white
|
|
3
|
-
*
|
|
4
|
-
* stylesheet applies it to the live bubble
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* cannot drift apart.
|
|
2
|
+
* The feedback bubble's look, written once against a selector: the white pill
|
|
3
|
+
* with its purple hairline and the three overlapping discs (ui issue 322, the
|
|
4
|
+
* designer's overlay). The visitor stylesheet applies it to the live bubble
|
|
5
|
+
* (`.cgb-bubble`) and adds the arrival, the hover spread and the close x; the
|
|
6
|
+
* owner stylesheet applies it to the still preview in the "Ask visitors for
|
|
7
|
+
* feedback" explanation (ui issue 316). One source, so the two cannot drift apart.
|
|
8
|
+
*
|
|
9
|
+
* Sizes are the design's: a 40px pill, 8px padding, 24px discs overlapping by
|
|
10
|
+
* 8px (4px on hover), 16px glyphs. The pill is 74px wide at rest.
|
|
8
11
|
*/
|
|
9
12
|
export function bubbleLook(s) {
|
|
10
|
-
return (`${s}{position:relative;display:
|
|
11
|
-
`border-radius:
|
|
12
|
-
`${s}
|
|
13
|
-
`${s} .cgb-bubble-ic{
|
|
14
|
-
`${s} .cgb-bubble-ic
|
|
15
|
-
`${s} .cgb-bubble-ic:
|
|
16
|
-
`${s} .cgb-bubble-ic
|
|
17
|
-
`${s} .cgb-bubble-ic[data-tone=
|
|
18
|
-
`${s} .cgb-bubble-ic[data-tone=fix]{background:var(--cg-cyan-200);color:var(--cg-accent)}\n` +
|
|
19
|
-
`${s} .cgb-bubble-ic[data-tone=talk]{background:var(--cg-lime-200);color:var(--cg-online-strong)}\n`);
|
|
13
|
+
return (`${s}{position:relative;box-sizing:border-box;display:flex;align-items:center;height:40px;padding:8px;border:1px solid var(--cg-border-accent);` +
|
|
14
|
+
`border-radius:var(--cg-radius-pill);background:var(--cg-surface-card);box-shadow:var(--cg-shadow-card)}\n` +
|
|
15
|
+
`${s} .cgb-bubble-ic{position:relative;flex:none;display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--cg-surface-card);border-radius:50%}\n` +
|
|
16
|
+
`${s} .cgb-bubble-ic+.cgb-bubble-ic{margin-left:-8px}\n` +
|
|
17
|
+
`${s} .cgb-bubble-ic svg{width:16px;height:16px}\n` +
|
|
18
|
+
`${s} .cgb-bubble-ic[data-tone=talk]{z-index:1;background:var(--cg-primary);color:var(--cg-text-on-primary)}\n` +
|
|
19
|
+
`${s} .cgb-bubble-ic[data-tone=like]{z-index:2;background:var(--cg-tertiary);color:var(--cg-text-on-accent)}\n` +
|
|
20
|
+
`${s} .cgb-bubble-ic[data-tone=fix]{z-index:3;background:var(--cg-secondary);color:var(--cg-text-on-accent)}\n`);
|
|
20
21
|
}
|
|
21
22
|
//# sourceMappingURL=css-bubble.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-bubble.js","sourceRoot":"","sources":["../../src/badge/css-bubble.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"css-bubble.js","sourceRoot":"","sources":["../../src/badge/css-bubble.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,OAAO,CACL,GAAG,CAAC,4IAA4I;QAChJ,2GAA2G;QAC3G,GAAG,CAAC,iKAAiK;QACrK,GAAG,CAAC,oDAAoD;QACxD,GAAG,CAAC,+CAA+C;QACnD,GAAG,CAAC,2GAA2G;QAC/G,GAAG,CAAC,2GAA2G;QAC/G,GAAG,CAAC,2GAA2G,CAChH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live badge's stylesheet (ui issue 322), after `BADGE_BASE_CSS`.
|
|
3
|
+
*
|
|
4
|
+
* The design's sizes: a 28px pill, 4px padding, a 20px sign, the label 4px
|
|
5
|
+
* after the sign with 8px after it (12px to the pill's end). The label is the
|
|
6
|
+
* caption size (13px, the type floor; the design draws 12) in the UI face.
|
|
7
|
+
*
|
|
8
|
+
* The sign is ONE white box under three mask layers: the plug glyph, a cover
|
|
9
|
+
* that fills the box, and a disc. The mask is glyph + (cover x disc). At rest
|
|
10
|
+
* the cover sits above the box, so only the glyph shows; the arrival starts it
|
|
11
|
+
* over the box, so the whole disc is white, and slides it up and out, which
|
|
12
|
+
* cuts the plug out of the disc from the bottom up.
|
|
13
|
+
*
|
|
14
|
+
* Arrival (from `--cgb-start`, default 300ms): the pill rises 500ms; the sign
|
|
15
|
+
* swells from 70% at +150ms and the cut starts at +200ms; the pill opens to
|
|
16
|
+
* the label's width the moment the rise lands (a 0fr to 1fr grid column, so it
|
|
17
|
+
* opens to the real width of whatever face loaded); the label slides in 80ms
|
|
18
|
+
* after. Hover swells the sign to 108%; the pill itself stays still.
|
|
19
|
+
*
|
|
20
|
+
* The label's line is the sign's 20px, not 1: the clip that lets the pill open
|
|
21
|
+
* cuts at the line box, and a 13px line cut the bottom of the g (ui issue 324).
|
|
22
|
+
* At 20px the face's whole height, ascent to descent, sits inside it.
|
|
23
|
+
*
|
|
24
|
+
* The wrap places the badge and holds the close x, the base stylesheet's
|
|
25
|
+
* `.cgb-x`, 2px above the pill's right end (ui issue 324). On a touch screen,
|
|
26
|
+
* where the x always shows, it pops in once the label has landed.
|
|
27
|
+
*/
|
|
28
|
+
export declare const BADGE_LIVE_CSS: string;
|
|
29
|
+
//# sourceMappingURL=css-live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-live.d.ts","sourceRoot":"","sources":["../../src/badge/css-live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAoBH,eAAO,MAAM,cAAc,EAAE,MAwBpB,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live badge's stylesheet (ui issue 322), after `BADGE_BASE_CSS`.
|
|
3
|
+
*
|
|
4
|
+
* The design's sizes: a 28px pill, 4px padding, a 20px sign, the label 4px
|
|
5
|
+
* after the sign with 8px after it (12px to the pill's end). The label is the
|
|
6
|
+
* caption size (13px, the type floor; the design draws 12) in the UI face.
|
|
7
|
+
*
|
|
8
|
+
* The sign is ONE white box under three mask layers: the plug glyph, a cover
|
|
9
|
+
* that fills the box, and a disc. The mask is glyph + (cover x disc). At rest
|
|
10
|
+
* the cover sits above the box, so only the glyph shows; the arrival starts it
|
|
11
|
+
* over the box, so the whole disc is white, and slides it up and out, which
|
|
12
|
+
* cuts the plug out of the disc from the bottom up.
|
|
13
|
+
*
|
|
14
|
+
* Arrival (from `--cgb-start`, default 300ms): the pill rises 500ms; the sign
|
|
15
|
+
* swells from 70% at +150ms and the cut starts at +200ms; the pill opens to
|
|
16
|
+
* the label's width the moment the rise lands (a 0fr to 1fr grid column, so it
|
|
17
|
+
* opens to the real width of whatever face loaded); the label slides in 80ms
|
|
18
|
+
* after. Hover swells the sign to 108%; the pill itself stays still.
|
|
19
|
+
*
|
|
20
|
+
* The label's line is the sign's 20px, not 1: the clip that lets the pill open
|
|
21
|
+
* cuts at the line box, and a 13px line cut the bottom of the g (ui issue 324).
|
|
22
|
+
* At 20px the face's whole height, ascent to descent, sits inside it.
|
|
23
|
+
*
|
|
24
|
+
* The wrap places the badge and holds the close x, the base stylesheet's
|
|
25
|
+
* `.cgb-x`, 2px above the pill's right end (ui issue 324). On a touch screen,
|
|
26
|
+
* where the x always shows, it pops in once the label has landed.
|
|
27
|
+
*/
|
|
28
|
+
import { SIGN_GLYPH_PATH } from "./brand.js";
|
|
29
|
+
import { touchRules } from "./css-base.js";
|
|
30
|
+
/**
|
|
31
|
+
* The glyph in a 20px box, where the design draws it: the sign's socket glyph
|
|
32
|
+
* is the design's symbol at 2.05 times the size, so a 41-unit viewBox from
|
|
33
|
+
* (53, 14.977) lands it on the design's coordinates.
|
|
34
|
+
*/
|
|
35
|
+
const GLYPH_MASK = 'url("data:image/svg+xml,' +
|
|
36
|
+
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='53 14.977 41 41'><path d='${SIGN_GLYPH_PATH}'/></svg>`) +
|
|
37
|
+
'")';
|
|
38
|
+
// A mask reads only alpha, so any opaque token draws "keep"; the ink is one.
|
|
39
|
+
const MASK = `${GLYPH_MASK},linear-gradient(var(--cg-text-primary) 0 0),radial-gradient(circle at 10.04px 10.1px,var(--cg-text-primary) 9.25px,transparent 9.75px)`;
|
|
40
|
+
export const BADGE_LIVE_CSS = /* @__PURE__ */ (() => `.cgb-live-wrap{--cgb-t0:var(--cgb-start,300ms);position:absolute;left:calc(12px + env(safe-area-inset-left,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px));padding-top:22px}
|
|
41
|
+
.cgb-live{position:relative;display:flex;align-items:center;width:max-content;height:28px;padding:4px;border-radius:var(--cg-radius-pill);background:var(--cg-primary);color:var(--cg-text-on-primary);` +
|
|
42
|
+
`text-decoration:none;box-shadow:var(--cg-shadow-card);cursor:pointer;animation:cgb-rise 500ms var(--cg-ease-out-expo) var(--cgb-t0) both}
|
|
43
|
+
.cgb-live:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
44
|
+
.cgb-live-icon{flex:none;width:20px;height:20px;background:var(--cg-text-on-primary);` +
|
|
45
|
+
`-webkit-mask-image:${MASK};mask-image:${MASK};-webkit-mask-size:20px 20px;mask-size:20px 20px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;` +
|
|
46
|
+
`-webkit-mask-composite:source-over,source-in,source-over;mask-composite:add,intersect,add;-webkit-mask-position:0 0,0 -20px,0 0;mask-position:0 0,0 -20px,0 0;` +
|
|
47
|
+
`animation:cgb-plug 480ms var(--cg-ease-in-out-cubic) calc(var(--cgb-t0) + 200ms) both,cgb-swell 560ms var(--cg-ease-spring) calc(var(--cgb-t0) + 150ms) both;` +
|
|
48
|
+
`transition:transform 420ms var(--cg-ease-spring)}
|
|
49
|
+
@media (hover:hover){.cgb-live:hover .cgb-live-icon{transform:scale(1.08)}}
|
|
50
|
+
.cgb-live:focus-visible .cgb-live-icon{transform:scale(1.08)}
|
|
51
|
+
.cgb-live:active .cgb-live-icon{transform:scale(.94);transition-duration:var(--cg-duration-fast)}
|
|
52
|
+
.cgb-live-label{display:grid;grid-template-columns:1fr;animation:cgb-grow 560ms var(--cg-ease-out-quint) calc(var(--cgb-t0) + 500ms) both}
|
|
53
|
+
.cgb-live-clip{min-width:0;overflow:hidden}
|
|
54
|
+
.cgb-live-text{display:block;padding:0 8px 0 4px;white-space:nowrap;font-family:var(--cg-font-ui);font-size:var(--cg-caption);font-weight:var(--cg-weight-regular);line-height:20px;` +
|
|
55
|
+
`letter-spacing:0;animation:cgb-label 440ms var(--cg-ease-out-expo) calc(var(--cgb-t0) + 580ms) both}
|
|
56
|
+
@keyframes cgb-plug{from{-webkit-mask-position:0 0,0 0,0 0;mask-position:0 0,0 0,0 0}}
|
|
57
|
+
@keyframes cgb-swell{from{scale:.7}}
|
|
58
|
+
@keyframes cgb-grow{from{grid-template-columns:0fr}}
|
|
59
|
+
@keyframes cgb-label{from{opacity:0;translate:-8px 0}}
|
|
60
|
+
@media (prefers-reduced-motion:reduce){.cgb-live:hover .cgb-live-icon,.cgb-live:focus-visible .cgb-live-icon,.cgb-live:active .cgb-live-icon{transform:none}}
|
|
61
|
+
` +
|
|
62
|
+
touchRules((r) => `${r} .cgb-live-x{animation:cgb-pop 520ms var(--cg-ease-spring) calc(var(--cgb-t0) + 1020ms) both}`) +
|
|
63
|
+
"\n")();
|
|
64
|
+
//# sourceMappingURL=css-live.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-live.js","sourceRoot":"","sources":["../../src/badge/css-live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C;;;;GAIG;AACH,MAAM,UAAU,GACd,0BAA0B;IAC1B,kBAAkB,CAChB,qGAAqG,eAAe,WAAW,CAChI;IACD,IAAI,CAAA;AAEN,6EAA6E;AAC7E,MAAM,IAAI,GAAG,GAAG,UAAU,yIAAyI,CAAA;AAEnK,MAAM,CAAC,MAAM,cAAc,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE,CAC1D;wMACsM;IACtM;;sFAEoF;IACpF,sBAAsB,IAAI,eAAe,IAAI,uGAAuG;IACpJ,gKAAgK;IAChK,+JAA+J;IAC/J;;;;;;qLAMmL;IACnL;;;;;;CAMD;IACC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,+FAA+F,CAAC;IACtH,IAAI,CAAC,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-owner.d.ts","sourceRoot":"","sources":["../../src/badge/css-owner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"css-owner.d.ts","sourceRoot":"","sources":["../../src/badge/css-owner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,eAAe,EAAE,MAgKxB,CAAA"}
|
package/dist/badge/css-owner.js
CHANGED
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { phoneRules } from "./css-base.js";
|
|
7
7
|
import { bubbleLook } from "./css-bubble.js";
|
|
8
|
-
export const BADGE_OWNER_CSS = /* @__PURE__ */ (() =>
|
|
8
|
+
export const BADGE_OWNER_CSS = /* @__PURE__ */ (() =>
|
|
9
|
+
// One length for every step (cloudgrid-console 868): the owner panel is the
|
|
10
|
+
// main step's height on main, Edit and Share alike, so switching steps never
|
|
11
|
+
// resizes it. 506px is the main step measured on desktop (505.1), 415px on a
|
|
12
|
+
// phone (414.1); a step longer than that scrolls inside the panel, and the
|
|
13
|
+
// panel never grows. The visitor's panels keep their own heights.
|
|
14
|
+
`.cgb-panel[data-step]{height:min(506px,calc(100% - 32px))}
|
|
15
|
+
.cgb-tab{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:8px;height:56px;max-width:46px;padding:0 10px 0 12px;` +
|
|
9
16
|
`overflow:hidden;white-space:nowrap;background:var(--cg-surface-card);color:var(--cg-text-primary);border:1px solid var(--cg-border-hairline);border-right:0;` +
|
|
10
17
|
`border-radius:var(--cg-radius-lg) 0 0 var(--cg-radius-lg);box-shadow:var(--cg-shadow-card),var(--cg-shadow-hover);cursor:grab;touch-action:none;user-select:none;` +
|
|
11
18
|
`transition:max-width var(--cg-duration-slow) var(--cg-ease-out),padding var(--cg-duration-slow) var(--cg-ease-out)}
|
|
@@ -63,7 +70,7 @@ export const BADGE_OWNER_CSS = /* @__PURE__ */ (() => `.cgb-tab{position:absolut
|
|
|
63
70
|
`background:var(--cg-surface-card);border:1px solid var(--cg-border-control);border-bottom-color:var(--cg-border-hairline);border-radius:var(--cg-radius-md) var(--cg-radius-md) 0 0;` +
|
|
64
71
|
`box-shadow:var(--cg-shadow-card);font-family:var(--cg-font-body);font-weight:var(--cg-weight-regular);animation:cgb-in var(--cg-duration) var(--cg-ease-out)}
|
|
65
72
|
.cgb-info-art{position:relative;flex:none;width:88px;height:60px;overflow:hidden;border-radius:var(--cg-radius-sm);background:var(--cg-surface-raised)}
|
|
66
|
-
` + bubbleLook(".cgb-info-bubble") + `.cgb-info-
|
|
73
|
+
` + bubbleLook(".cgb-info-bubble") + `.cgb-info-wrap{position:absolute;right:8px;bottom:8px;padding-top:22px;transform:scale(.8);transform-origin:100% 100%}
|
|
67
74
|
.cgb-info-copy{min-width:0;font-size:var(--cg-caption);line-height:1.4;color:var(--cg-text-secondary);text-wrap:pretty}
|
|
68
75
|
.cgb-info-copy::before{content:"";float:right;width:22px;height:18px}
|
|
69
76
|
.cgb-info-copy span{color:var(--cg-text-primary)}
|
|
@@ -121,7 +128,7 @@ export const BADGE_OWNER_CSS = /* @__PURE__ */ (() => `.cgb-tab{position:absolut
|
|
|
121
128
|
.cgb-wt b{color:var(--cg-text-accent);font-weight:inherit}
|
|
122
129
|
.cgb-wd{margin-top:2px;font-size:var(--cg-caption);color:var(--cg-text-secondary)}
|
|
123
130
|
.cgb-prompt{position:relative;padding:12px 48px 12px 14px;border:1px solid var(--cg-border-control);border-radius:var(--cg-radius-sm);background:var(--cg-hover)}
|
|
124
|
-
.cgb-prompt pre{margin:0;font-family:var(--cg-font-mono);font-size:var(--cg-
|
|
131
|
+
.cgb-prompt pre{margin:0;font-family:var(--cg-font-mono);font-size:var(--cg-caption);line-height:1.5;color:var(--cg-text-secondary);white-space:pre-wrap;overflow-wrap:anywhere}
|
|
125
132
|
.cgb-prompt pre b{font-weight:var(--cg-weight-medium);color:var(--cg-text-accent)}
|
|
126
133
|
.cgb-prompt pre i{font-style:normal;color:var(--cg-text-muted)}
|
|
127
134
|
.cgb-prompt-copy{position:absolute;top:10px;right:10px;width:28px;height:28px;display:grid;place-items:center;border:1px solid var(--cg-border-control);border-radius:var(--cg-radius-sm);` +
|
|
@@ -135,7 +142,8 @@ export const BADGE_OWNER_CSS = /* @__PURE__ */ (() => `.cgb-tab{position:absolut
|
|
|
135
142
|
.cgb-who svg{width:16px;height:16px;margin-top:1px;color:var(--cg-text-secondary)}
|
|
136
143
|
.cgb-who button{color:var(--cg-text-accent);text-decoration:underline;text-underline-offset:2px}
|
|
137
144
|
` +
|
|
138
|
-
phoneRules((r) => `${r} .cgb-
|
|
145
|
+
phoneRules((r) => `${r} .cgb-panel[data-step]{height:min(415px,88%)}` +
|
|
146
|
+
`${r} .cgb-tab{height:52px}` +
|
|
139
147
|
`${r} .cgb-row{min-height:40px;padding:0 12px}` +
|
|
140
148
|
`${r} .cgb-acts .cgb-btn{height:28px}` +
|
|
141
149
|
`${r} .cgb-panel[data-step] .cgb-title{font-size:var(--cg-body-14)}` +
|
|
@@ -153,7 +161,6 @@ export const BADGE_OWNER_CSS = /* @__PURE__ */ (() => `.cgb-tab{position:absolut
|
|
|
153
161
|
`${r} .cgb-aslot .cgb-confirm{padding:0 6px 0 10px}` +
|
|
154
162
|
`${r} .cgb-ways{gap:6px}` +
|
|
155
163
|
`${r} .cgb-prompt{padding:10px 44px 10px 12px}` +
|
|
156
|
-
`${r} .cgb-prompt pre{font-size:var(--cg-caption);line-height:1.5}` +
|
|
157
164
|
`${r} .cgb-prompt-copy{top:8px;right:8px}` +
|
|
158
165
|
`${r} .cgb-link-box{height:40px}`))();
|
|
159
166
|
//# sourceMappingURL=css-owner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-owner.js","sourceRoot":"","sources":["../../src/badge/css-owner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"css-owner.js","sourceRoot":"","sources":["../../src/badge/css-owner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,eAAe,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE;AAC3D,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,kEAAkE;AAClE;gKAC8J;IAC9J,8JAA8J;IAC9J,mKAAmK;IACnK;;;;;;;;;;;;;qKAamK;IACnK,oOAAoO;IACpO;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BD;IACC,4EAA4E;IAC5E,6EAA6E;IAC7E,oEAAoE;IACpE,2EAA2E;IAC3E,iDAAiD;IACjD;;;;8JAI4J;IAC5J,sLAAsL;IACtL;;CAED,GAAG,UAAU,CAAC,kBAAkB,CAAC,GAAG;;;;;;;;;6JASwH;IAC3J;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uJA+BqJ;IACrJ;;;;;;;;;;;;;;;;;;;2LAmByL;IACzL;;;;;;;;;CASD;IACC,UAAU,CACR,CAAC,CAAC,EAAE,EAAE,CACJ,GAAG,CAAC,+CAA+C;QACnD,GAAG,CAAC,wBAAwB;QAC5B,GAAG,CAAC,2CAA2C;QAC/C,GAAG,CAAC,kCAAkC;QACtC,GAAG,CAAC,gEAAgE;QACpE,sEAAsE;QACtE,4CAA4C;QAC5C,GAAG,CAAC,gDAAgD;QACpD,GAAG,CAAC,gCAAgC;QACpC,GAAG,CAAC,6BAA6B;QACjC,GAAG,CAAC,0BAA0B;QAC9B,GAAG,CAAC,yCAAyC;QAC7C,GAAG,CAAC,8BAA8B;QAClC,GAAG,CAAC,2CAA2C;QAC/C,GAAG,CAAC,8CAA8C;QAClD,GAAG,CAAC,8CAA8C;QAClD,GAAG,CAAC,gDAAgD;QACpD,GAAG,CAAC,qBAAqB;QACzB,GAAG,CAAC,2CAA2C;QAC/C,GAAG,CAAC,sCAAsC;QAC1C,GAAG,CAAC,6BAA6B,CACpC,CAAC,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-visitor.d.ts","sourceRoot":"","sources":["../../src/badge/css-visitor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"css-visitor.d.ts","sourceRoot":"","sources":["../../src/badge/css-visitor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,iBAAiB,EAAE,MAkE1B,CAAA"}
|
|
@@ -5,22 +5,27 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { phoneRules, touchRules } from "./css-base.js";
|
|
7
7
|
import { bubbleLook } from "./css-bubble.js";
|
|
8
|
-
export const BADGE_VISITOR_CSS = /* @__PURE__ */ (() =>
|
|
8
|
+
export const BADGE_VISITOR_CSS = /* @__PURE__ */ (() =>
|
|
9
|
+
// The bubble (ui issue 322, the designer's overlay). It rises in 600ms after it is
|
|
10
|
+
// inserted (`--cgb-start`, which `bubble({ delay })` sets), the three discs
|
|
11
|
+
// follow 80ms apart from the left. Hover spreads the discs from an 8px
|
|
12
|
+
// overlap to 4px and deepens the shadow; a press shrinks the pill to 97%.
|
|
13
|
+
// The x is the base stylesheet's `.cgb-x` (ui issue 324): 2px above the
|
|
14
|
+
// pill's right end, shown on hover or keyboard focus, and on a touch screen
|
|
15
|
+
// always, where it pops in last.
|
|
16
|
+
`.cgb-bubble-wrap{--cgb-t0:var(--cgb-start,600ms);position:absolute;right:calc(12px + env(safe-area-inset-right,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px));padding-top:22px}
|
|
9
17
|
` +
|
|
10
18
|
bubbleLook(".cgb-bubble") +
|
|
11
|
-
`.cgb-bubble{animation:cgb-
|
|
12
|
-
.cgb-bubble:
|
|
13
|
-
.cgb-bubble
|
|
14
|
-
.cgb-bubble
|
|
15
|
-
.cgb-bubble
|
|
16
|
-
@
|
|
17
|
-
.cgb-bubble-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.cgb-bubble
|
|
21
|
-
.cgb-bubble-x:focus-visible{outline:none}
|
|
22
|
-
.cgb-bubble-x:focus-visible::before{box-shadow:0 0 0 1.5px var(--cg-surface-card),0 0 0 4.5px var(--cg-focus-ring)}
|
|
23
|
-
.cgb-bubble-wrap:hover .cgb-bubble-x,.cgb-bubble-x:focus-visible{opacity:1;pointer-events:auto}
|
|
19
|
+
`.cgb-bubble{cursor:pointer;animation:cgb-rise 640ms var(--cg-ease-out-expo) var(--cgb-t0) both;transition:box-shadow 240ms ease,scale 320ms var(--cg-ease-spring)}
|
|
20
|
+
.cgb-bubble:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
21
|
+
.cgb-bubble .cgb-bubble-ic{--cgb-i:0;animation:cgb-item 560ms var(--cg-ease-out-expo) calc(var(--cgb-t0) + 220ms + var(--cgb-i) * 80ms) both;transition:margin-left 380ms var(--cg-ease-out-quart)}
|
|
22
|
+
.cgb-bubble .cgb-bubble-ic[data-tone=like]{--cgb-i:1}
|
|
23
|
+
.cgb-bubble .cgb-bubble-ic[data-tone=fix]{--cgb-i:2}
|
|
24
|
+
@media (hover:hover){.cgb-bubble:hover{box-shadow:var(--cg-shadow-card-hover)}.cgb-bubble:hover .cgb-bubble-ic+.cgb-bubble-ic{margin-left:-4px}}
|
|
25
|
+
.cgb-bubble:focus-visible .cgb-bubble-ic+.cgb-bubble-ic{margin-left:-4px}
|
|
26
|
+
.cgb-bubble:active{scale:.97;transition:scale var(--cg-duration-fast) ease,box-shadow 240ms ease}
|
|
27
|
+
@keyframes cgb-item{from{opacity:0;translate:0 10px}}
|
|
28
|
+
@media (prefers-reduced-motion:reduce){.cgb-bubble:active{scale:none}}
|
|
24
29
|
.cgb-rx{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
|
|
25
30
|
.cgb-rxb{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:52px;padding:8px 0 6px;border:1px solid var(--cg-border-control);` +
|
|
26
31
|
`border-radius:var(--cg-radius-md);background:var(--cg-surface-card);color:var(--cg-text-secondary);font-family:var(--cg-font-ui);font-size:var(--cg-caption);font-weight:var(--cg-weight-bold);line-height:1;` +
|
|
@@ -56,10 +61,8 @@ export const BADGE_VISITOR_CSS = /* @__PURE__ */ (() => `.cgb-bubble-wrap{positi
|
|
|
56
61
|
.cgb-field-label{font-size:var(--cg-caption);font-weight:var(--cg-weight-medium);color:var(--cg-text-secondary)}
|
|
57
62
|
.cgb-link{justify-self:start;font-size:var(--cg-caption);color:var(--cg-text-accent);text-decoration:underline;text-underline-offset:2px}
|
|
58
63
|
` +
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// The tab's own pattern, `.cgb-tab[data-hidden]`.
|
|
62
|
-
touchRules((r) => `${r} .cgb-bubble-x{opacity:1;pointer-events:auto}`) +
|
|
64
|
+
touchRules((r) => `${r} .cgb-bubble-x{animation:cgb-pop 520ms var(--cg-ease-spring) calc(var(--cgb-t0) + 680ms) both}`) +
|
|
65
|
+
"\n" +
|
|
63
66
|
phoneRules((r) => `${r} .cgb-rxb{min-height:46px;padding:6px 0 4px}` +
|
|
64
67
|
`${r} .cgb-note{gap:6px;padding-top:10px}` +
|
|
65
68
|
`${r} .cgb-textarea{min-height:64px}` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-visitor.js","sourceRoot":"","sources":["../../src/badge/css-visitor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"css-visitor.js","sourceRoot":"","sources":["../../src/badge/css-visitor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE;AAC7D,mFAAmF;AACnF,4EAA4E;AAC5E,uEAAuE;AACvE,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,iCAAiC;AACjC;CACD;IACC,UAAU,CAAC,aAAa,CAAC;IACzB;;;;;;;;;;;2KAWyK;IACzK,+MAA+M;IAC/M;;;;;;;;;sJASoJ;IACpJ;;;;;;;;;;;;;yLAauL;IACvL;;;;;;;CAOD;IACC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,gGAAgG,CAAC;IACvH,IAAI;IACJ,UAAU,CACR,CAAC,CAAC,EAAE,EAAE,CACJ,GAAG,CAAC,8CAA8C;QAClD,GAAG,CAAC,sCAAsC;QAC1C,GAAG,CAAC,iCAAiC;QACrC,GAAG,CAAC,uBAAuB;QAC3B,GAAG,CAAC,2BAA2B;QAC/B,GAAG,CAAC,0BAA0B,CACjC,CAAC,EAAE,CAAA"}
|
package/dist/badge/index.d.ts
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* the stylesheet `BADGE_BASE_CSS`, `BADGE_VISITOR_CSS`, `BADGE_OWNER_CSS`,
|
|
10
10
|
* strings for a `<style>` in the shadow root, generated from
|
|
11
11
|
* the library's tokens (`palette.ts`)
|
|
12
|
-
* the markup builders that return HTML strings: the
|
|
13
|
-
* (main, edit, share), the feedback
|
|
12
|
+
* the markup builders that return HTML strings: the live badge (ui#322),
|
|
13
|
+
* the owner tab and panel (main, edit, share), the feedback
|
|
14
|
+
* bubble and panel, the
|
|
14
15
|
* sign-in step, and the Select, switch and `PromptBlock`
|
|
15
16
|
* looks they use
|
|
16
17
|
* the glyphs Phosphor path data, generated with the library's marks
|
|
@@ -24,7 +25,8 @@
|
|
|
24
25
|
* ```
|
|
25
26
|
*
|
|
26
27
|
* Three entries, so each of the badge's two files takes only its half:
|
|
27
|
-
* `@cloudgrid-io/ui/badge/visitor` for the main file (25 KB gzip budget
|
|
28
|
+
* `@cloudgrid-io/ui/badge/visitor` for the main file (25 KB gzip budget; it
|
|
29
|
+
* also carries `liveBadge` and `BADGE_LIVE_CSS`, which every viewer gets),
|
|
28
30
|
* `@cloudgrid-io/ui/badge/owner` for the owner file it lazy-loads, and this one,
|
|
29
31
|
* which carries both. Every export is side-effect free and every glyph is its
|
|
30
32
|
* own export, so a bundler keeps only what a file draws.
|
|
@@ -38,6 +40,6 @@ export * from "./owner.js";
|
|
|
38
40
|
export * from "./marks.js";
|
|
39
41
|
export { BADGE_FONT_BODY, BADGE_FONT_FACES, BADGE_FONT_UI, BADGE_TOKEN_DECLARATIONS, BADGE_TOKENS } from "./palette.js";
|
|
40
42
|
export { WORDMARK_PATHS, SIGN_BOX, SIGN_GLYPH_OFFSET, SIGN_GLYPH_PATH, SIGN_RADIUS } from "./brand.js";
|
|
41
|
-
/** The whole stylesheet: base, visitor and owner. */
|
|
43
|
+
/** The whole stylesheet: base, the live badge, visitor and owner. */
|
|
42
44
|
export declare const BADGE_CSS: string;
|
|
43
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAOH,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACvH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAEtG,qEAAqE;AACrE,eAAO,MAAM,SAAS,EAAE,MAA8E,CAAA"}
|
package/dist/badge/index.js
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
* the stylesheet `BADGE_BASE_CSS`, `BADGE_VISITOR_CSS`, `BADGE_OWNER_CSS`,
|
|
10
10
|
* strings for a `<style>` in the shadow root, generated from
|
|
11
11
|
* the library's tokens (`palette.ts`)
|
|
12
|
-
* the markup builders that return HTML strings: the
|
|
13
|
-
* (main, edit, share), the feedback
|
|
12
|
+
* the markup builders that return HTML strings: the live badge (ui#322),
|
|
13
|
+
* the owner tab and panel (main, edit, share), the feedback
|
|
14
|
+
* bubble and panel, the
|
|
14
15
|
* sign-in step, and the Select, switch and `PromptBlock`
|
|
15
16
|
* looks they use
|
|
16
17
|
* the glyphs Phosphor path data, generated with the library's marks
|
|
@@ -24,7 +25,8 @@
|
|
|
24
25
|
* ```
|
|
25
26
|
*
|
|
26
27
|
* Three entries, so each of the badge's two files takes only its half:
|
|
27
|
-
* `@cloudgrid-io/ui/badge/visitor` for the main file (25 KB gzip budget
|
|
28
|
+
* `@cloudgrid-io/ui/badge/visitor` for the main file (25 KB gzip budget; it
|
|
29
|
+
* also carries `liveBadge` and `BADGE_LIVE_CSS`, which every viewer gets),
|
|
28
30
|
* `@cloudgrid-io/ui/badge/owner` for the owner file it lazy-loads, and this one,
|
|
29
31
|
* which carries both. Every export is side-effect free and every glyph is its
|
|
30
32
|
* own export, so a bundler keeps only what a file draws.
|
|
@@ -36,11 +38,12 @@
|
|
|
36
38
|
import { BADGE_BASE_CSS } from "./css-base.js";
|
|
37
39
|
import { BADGE_OWNER_CSS } from "./css-owner.js";
|
|
38
40
|
import { BADGE_VISITOR_CSS } from "./css-visitor.js";
|
|
41
|
+
import { BADGE_LIVE_CSS } from "./css-live.js";
|
|
39
42
|
export * from "./visitor.js";
|
|
40
43
|
export * from "./owner.js";
|
|
41
44
|
export * from "./marks.js";
|
|
42
45
|
export { BADGE_FONT_BODY, BADGE_FONT_FACES, BADGE_FONT_UI, BADGE_TOKEN_DECLARATIONS, BADGE_TOKENS } from "./palette.js";
|
|
43
46
|
export { WORDMARK_PATHS, SIGN_BOX, SIGN_GLYPH_OFFSET, SIGN_GLYPH_PATH, SIGN_RADIUS } from "./brand.js";
|
|
44
|
-
/** The whole stylesheet: base, visitor and owner. */
|
|
45
|
-
export const BADGE_CSS = BADGE_BASE_CSS + BADGE_VISITOR_CSS + BADGE_OWNER_CSS;
|
|
47
|
+
/** The whole stylesheet: base, the live badge, visitor and owner. */
|
|
48
|
+
export const BADGE_CSS = BADGE_BASE_CSS + BADGE_LIVE_CSS + BADGE_VISITOR_CSS + BADGE_OWNER_CSS;
|
|
46
49
|
//# sourceMappingURL=index.js.map
|