@cloudgrid-io/ui 0.32.0 → 0.32.3
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/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 +5 -0
- package/dist/badge/css-base.d.ts.map +1 -1
- package/dist/badge/css-base.js +7 -0
- 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 +21 -0
- package/dist/badge/css-live.d.ts.map +1 -0
- package/dist/badge/css-live.js +53 -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 +28 -19
- 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 +41 -0
- package/dist/badge/live.d.ts.map +1 -0
- package/dist/badge/live.js +41 -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 +4 -3
- 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/visitor.d.ts +19 -5
- package/dist/badge/visitor.d.ts.map +1 -1
- package/dist/badge/visitor.js +18 -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/tokens/base.json +76 -0
- package/dist/tokens.css +36 -0
- package/dist/tokens.json +8 -0
- package/package.json +1 -1
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
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* `data-cgb-touch` on the root)
|
|
17
17
|
*
|
|
18
18
|
* `data-cgb-layout="desktop"` pins the desktop answer on a narrow screen.
|
|
19
|
+
*
|
|
20
|
+
* Motion (ui issue 322): `cgb-rise` is the arrival the live badge and the bubble
|
|
21
|
+
* share, and where the browser draws `linear()` easing the root swaps
|
|
22
|
+
* `--cg-ease-spring` for the real damped spring. Reduced motion stops every
|
|
23
|
+
* animation and transition inside the root, so each piece shows at rest at once.
|
|
19
24
|
*/
|
|
20
25
|
/** A phone rule set, written once against `r`, emitted for both roots. */
|
|
21
26
|
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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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;AAID,eAAO,MAAM,cAAc,EAAE,MA2EyC,CAAA"}
|
package/dist/badge/css-base.js
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* `data-cgb-touch` on the root)
|
|
17
17
|
*
|
|
18
18
|
* `data-cgb-layout="desktop"` pins the desktop answer on a narrow screen.
|
|
19
|
+
*
|
|
20
|
+
* Motion (ui issue 322): `cgb-rise` is the arrival the live badge and the bubble
|
|
21
|
+
* share, and where the browser draws `linear()` easing the root swaps
|
|
22
|
+
* `--cg-ease-spring` for the real damped spring. Reduced motion stops every
|
|
23
|
+
* animation and transition inside the root, so each piece shows at rest at once.
|
|
19
24
|
*/
|
|
20
25
|
import { BADGE_TOKEN_DECLARATIONS } from "./palette.js";
|
|
21
26
|
/** The two roots a phone rule is written against: the media query's, and the forced one. */
|
|
@@ -86,6 +91,8 @@ export const BADGE_BASE_CSS = /* @__PURE__ */ (() => `.cgb{all:initial;${BADGE_T
|
|
|
86
91
|
.cgb-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:var(--cg-body-14);cursor:pointer}
|
|
87
92
|
.cgb-desc{font-size:var(--cg-body-14);color:var(--cg-text-secondary)}
|
|
88
93
|
.cgb-scrim{display:none}
|
|
94
|
+
@keyframes cgb-rise{from{opacity:0;translate:0 30px}}
|
|
95
|
+
@supports (transition-timing-function:linear(0,1)){.cgb{--cg-ease-spring:var(--cg-ease-spring-damped)}}
|
|
89
96
|
@media (prefers-reduced-motion:reduce){.cgb *{animation:none!important;transition:none!important}}
|
|
90
97
|
` +
|
|
91
98
|
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}` +
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;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,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,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,21 @@
|
|
|
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
|
+
export declare const BADGE_LIVE_CSS: string;
|
|
21
|
+
//# 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;;;;;;;;;;;;;;;;;;GAkBG;AAmBH,eAAO,MAAM,cAAc,EAAE,MAsBzB,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { SIGN_GLYPH_PATH } from "./brand.js";
|
|
21
|
+
/**
|
|
22
|
+
* The glyph in a 20px box, where the design draws it: the sign's socket glyph
|
|
23
|
+
* is the design's symbol at 2.05 times the size, so a 41-unit viewBox from
|
|
24
|
+
* (53, 14.977) lands it on the design's coordinates.
|
|
25
|
+
*/
|
|
26
|
+
const GLYPH_MASK = 'url("data:image/svg+xml,' +
|
|
27
|
+
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>`) +
|
|
28
|
+
'")';
|
|
29
|
+
// A mask reads only alpha, so any opaque token draws "keep"; the ink is one.
|
|
30
|
+
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)`;
|
|
31
|
+
export const BADGE_LIVE_CSS = /* @__PURE__ */ (() => `.cgb-live{--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));` +
|
|
32
|
+
`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);` +
|
|
33
|
+
`text-decoration:none;box-shadow:var(--cg-shadow-card);cursor:pointer;animation:cgb-rise 500ms var(--cg-ease-out-expo) var(--cgb-t0) both}
|
|
34
|
+
.cgb-live:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
35
|
+
.cgb-live-icon{flex:none;width:20px;height:20px;background:var(--cg-text-on-primary);` +
|
|
36
|
+
`-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;` +
|
|
37
|
+
`-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;` +
|
|
38
|
+
`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;` +
|
|
39
|
+
`transition:transform 420ms var(--cg-ease-spring)}
|
|
40
|
+
@media (hover:hover){.cgb-live:hover .cgb-live-icon{transform:scale(1.08)}}
|
|
41
|
+
.cgb-live:focus-visible .cgb-live-icon{transform:scale(1.08)}
|
|
42
|
+
.cgb-live:active .cgb-live-icon{transform:scale(.94);transition-duration:var(--cg-duration-fast)}
|
|
43
|
+
.cgb-live-label{display:grid;grid-template-columns:1fr;animation:cgb-grow 560ms var(--cg-ease-out-quint) calc(var(--cgb-t0) + 500ms) both}
|
|
44
|
+
.cgb-live-clip{min-width:0;overflow:hidden}
|
|
45
|
+
.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:1;` +
|
|
46
|
+
`letter-spacing:0;animation:cgb-label 440ms var(--cg-ease-out-expo) calc(var(--cgb-t0) + 580ms) both}
|
|
47
|
+
@keyframes cgb-plug{from{-webkit-mask-position:0 0,0 0,0 0;mask-position:0 0,0 0,0 0}}
|
|
48
|
+
@keyframes cgb-swell{from{scale:.7}}
|
|
49
|
+
@keyframes cgb-grow{from{grid-template-columns:0fr}}
|
|
50
|
+
@keyframes cgb-label{from{opacity:0;translate:-8px 0}}
|
|
51
|
+
@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}}
|
|
52
|
+
`)();
|
|
53
|
+
//# 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;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C;;;;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,kKAAkK;IAClK,6KAA6K;IAC7K;;sFAEoF;IACpF,sBAAsB,IAAI,eAAe,IAAI,uGAAuG;IACpJ,gKAAgK;IAChK,+JAA+J;IAC/J;;;;;;kLAMgL;IAChL;;;;;;CAMD,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-art .cgb-info-bubble{position:absolute;right:
|
|
73
|
+
` + bubbleLook(".cgb-info-bubble") + `.cgb-info-art .cgb-info-bubble{position:absolute;right:8px;bottom:8px;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,MAwE1B,CAAA"}
|
|
@@ -3,24 +3,37 @@
|
|
|
3
3
|
* the feedback panel and its sign-in step. Ships in the badge's main file,
|
|
4
4
|
* after `BADGE_BASE_CSS`.
|
|
5
5
|
*/
|
|
6
|
-
import { phoneRules
|
|
6
|
+
import { phoneRules } 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, and the x pops in last. Hover spreads the
|
|
12
|
+
// discs from an 8px overlap to 4px and deepens the shadow; a press shrinks
|
|
13
|
+
// the pill to 97%. The x sits 2px above the pill's right end, always shown.
|
|
14
|
+
`.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
15
|
` +
|
|
10
16
|
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
|
-
.cgb-bubble-x
|
|
20
|
-
|
|
21
|
-
.cgb-bubble-x:
|
|
22
|
-
.cgb-bubble-x
|
|
23
|
-
|
|
17
|
+
`.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)}
|
|
18
|
+
.cgb-bubble:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
19
|
+
.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)}
|
|
20
|
+
.cgb-bubble .cgb-bubble-ic[data-tone=like]{--cgb-i:1}
|
|
21
|
+
.cgb-bubble .cgb-bubble-ic[data-tone=fix]{--cgb-i:2}
|
|
22
|
+
@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}}
|
|
23
|
+
.cgb-bubble:focus-visible .cgb-bubble-ic+.cgb-bubble-ic{margin-left:-4px}
|
|
24
|
+
.cgb-bubble:active{scale:.97;transition:scale var(--cg-duration-fast) ease,box-shadow 240ms ease}
|
|
25
|
+
.cgb-bubble-x{position:absolute;top:0;right:0;z-index:1;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;` +
|
|
26
|
+
`background:var(--cg-text-primary);color:var(--cg-text-on-primary);animation:cgb-pop 520ms var(--cg-ease-spring) calc(var(--cgb-t0) + 680ms) both;transition:transform 320ms var(--cg-ease-spring)}
|
|
27
|
+
.cgb-bubble-x::before{content:"";position:absolute;inset:-6px -6px -2px -6px}
|
|
28
|
+
.cgb-bubble-x svg{width:12px;height:12px}
|
|
29
|
+
@media (hover:hover){.cgb-bubble-x:hover{transform:scale(1.12)}}
|
|
30
|
+
.cgb-bubble-x:active{transform:scale(.92)}
|
|
31
|
+
.cgb-bubble-x:focus-visible{outline:2px solid var(--cg-primary);outline-offset:2px}
|
|
32
|
+
.cgb-bubble-wrap[data-leaving]{animation:cgb-leave 260ms var(--cg-ease-in) forwards;pointer-events:none}
|
|
33
|
+
@keyframes cgb-item{from{opacity:0;translate:0 10px}}
|
|
34
|
+
@keyframes cgb-pop{from{opacity:0;scale:.4}}
|
|
35
|
+
@keyframes cgb-leave{to{opacity:0;translate:0 12px;scale:.96}}
|
|
36
|
+
@media (prefers-reduced-motion:reduce){.cgb-bubble:active{scale:none}.cgb-bubble-x:hover,.cgb-bubble-x:active{transform:none}}
|
|
24
37
|
.cgb-rx{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
|
|
25
38
|
.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
39
|
`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 +69,6 @@ export const BADGE_VISITOR_CSS = /* @__PURE__ */ (() => `.cgb-bubble-wrap{positi
|
|
|
56
69
|
.cgb-field-label{font-size:var(--cg-caption);font-weight:var(--cg-weight-medium);color:var(--cg-text-secondary)}
|
|
57
70
|
.cgb-link{justify-self:start;font-size:var(--cg-caption);color:var(--cg-text-accent);text-decoration:underline;text-underline-offset:2px}
|
|
58
71
|
` +
|
|
59
|
-
// Hidden means not clickable too (Gilad, on PR 300): a device that reports
|
|
60
|
-
// hover:hover but gets taps would otherwise hit an invisible 32px target.
|
|
61
|
-
// The tab's own pattern, `.cgb-tab[data-hidden]`.
|
|
62
|
-
touchRules((r) => `${r} .cgb-bubble-x{opacity:1;pointer-events:auto}`) +
|
|
63
72
|
phoneRules((r) => `${r} .cgb-rxb{min-height:46px;padding:6px 0 4px}` +
|
|
64
73
|
`${r} .cgb-note{gap:6px;padding-top:10px}` +
|
|
65
74
|
`${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,
|
|
1
|
+
{"version":3,"file":"css-visitor.js","sourceRoot":"","sources":["../../src/badge/css-visitor.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,iBAAiB,GAAW,eAAe,CAAC,CAAC,GAAG,EAAE;AAC7D,mFAAmF;AACnF,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E;CACD;IACC,UAAU,CAAC,aAAa,CAAC;IACzB;;;;;;;;kIAQgI;IAChI;;;;;;;;;;;;2KAYyK;IACzK,+MAA+M;IAC/M;;;;;;;;;sJASoJ;IACpJ;;;;;;;;;;;;;yLAauL;IACvL;;;;;;;CAOD;IACC,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
|
package/dist/badge/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/badge/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,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,MAAM,CAAC,MAAM,SAAS,GAAW,cAAc,GAAG,cAAc,GAAG,iBAAiB,GAAG,eAAe,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live badge (ui#322): the purple pill in the bottom-left corner of every
|
|
3
|
+
* live app, the CloudGrid sign and "Live on the grid", linking to CloudGrid.
|
|
4
|
+
* The platform calls it the watermark (`branding.attribution`). Markup only.
|
|
5
|
+
*
|
|
6
|
+
* The design and its arrival are the designer's overlay
|
|
7
|
+
* (coolapps.cloudgrid.io/cloudgrid-overlay-acbb): the circle rises in, the plug
|
|
8
|
+
* is cut out of the white disc from the bottom up, the pill opens to the
|
|
9
|
+
* label's width and the label slides in. Reduced motion shows it at rest.
|
|
10
|
+
*
|
|
11
|
+
* Renders inside `badgeRoot()`, with `BADGE_BASE_CSS + BADGE_LIVE_CSS` in the
|
|
12
|
+
* shadow root, like every other piece of the badge.
|
|
13
|
+
*/
|
|
14
|
+
export { BADGE_LIVE_CSS } from "./css-live.js";
|
|
15
|
+
/**
|
|
16
|
+
* The label today's badge shows ("Live on the grid", the platform's
|
|
17
|
+
* `DEFAULT_WATERMARK_TEXT`). The platform resolves the real copy per grid on
|
|
18
|
+
* the server and passes it in; this is only the default. The designer's page
|
|
19
|
+
* reads "Live on Grid"; the product copy is kept until the founder rules.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LIVE_LABEL = "Live on the grid";
|
|
22
|
+
export interface LiveBadgeOptions {
|
|
23
|
+
/** Where the badge links. Opens in a new tab. A non-http(s) URL becomes `#`. */
|
|
24
|
+
href: string;
|
|
25
|
+
/** The label. Default `LIVE_LABEL`. */
|
|
26
|
+
label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* When the arrival starts, in ms after insertion. Default 300 (the bubble's
|
|
29
|
+
* default is 300ms later, so the two arrive in turn). `0` for a re-show.
|
|
30
|
+
*/
|
|
31
|
+
delay?: number;
|
|
32
|
+
}
|
|
33
|
+
/** A non-negative whole number of milliseconds, as a `--cgb-start` declaration. */
|
|
34
|
+
export declare function startStyle(delay: number | undefined): string;
|
|
35
|
+
/**
|
|
36
|
+
* The live badge: a link holding the sign (a white plug glyph, drawn as a
|
|
37
|
+
* mask so the cut-out can animate), the label, and a screen-reader note that
|
|
38
|
+
* it opens a new tab.
|
|
39
|
+
*/
|
|
40
|
+
export declare function liveBadge({ href: url, label, delay }: LiveBadgeOptions): string;
|
|
41
|
+
//# sourceMappingURL=live.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../src/badge/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,qBAAqB,CAAA;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;IACZ,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAkB,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAQ5F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live badge (ui#322): the purple pill in the bottom-left corner of every
|
|
3
|
+
* live app, the CloudGrid sign and "Live on the grid", linking to CloudGrid.
|
|
4
|
+
* The platform calls it the watermark (`branding.attribution`). Markup only.
|
|
5
|
+
*
|
|
6
|
+
* The design and its arrival are the designer's overlay
|
|
7
|
+
* (coolapps.cloudgrid.io/cloudgrid-overlay-acbb): the circle rises in, the plug
|
|
8
|
+
* is cut out of the white disc from the bottom up, the pill opens to the
|
|
9
|
+
* label's width and the label slides in. Reduced motion shows it at rest.
|
|
10
|
+
*
|
|
11
|
+
* Renders inside `badgeRoot()`, with `BADGE_BASE_CSS + BADGE_LIVE_CSS` in the
|
|
12
|
+
* shadow root, like every other piece of the badge.
|
|
13
|
+
*/
|
|
14
|
+
import { esc, href } from "./html.js";
|
|
15
|
+
export { BADGE_LIVE_CSS } from "./css-live.js";
|
|
16
|
+
/**
|
|
17
|
+
* The label today's badge shows ("Live on the grid", the platform's
|
|
18
|
+
* `DEFAULT_WATERMARK_TEXT`). The platform resolves the real copy per grid on
|
|
19
|
+
* the server and passes it in; this is only the default. The designer's page
|
|
20
|
+
* reads "Live on Grid"; the product copy is kept until the founder rules.
|
|
21
|
+
*/
|
|
22
|
+
export const LIVE_LABEL = "Live on the grid";
|
|
23
|
+
/** A non-negative whole number of milliseconds, as a `--cgb-start` declaration. */
|
|
24
|
+
export function startStyle(delay) {
|
|
25
|
+
if (delay === undefined || !Number.isFinite(delay))
|
|
26
|
+
return "";
|
|
27
|
+
return ` style="--cgb-start:${Math.max(0, Math.round(delay))}ms"`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The live badge: a link holding the sign (a white plug glyph, drawn as a
|
|
31
|
+
* mask so the cut-out can animate), the label, and a screen-reader note that
|
|
32
|
+
* it opens a new tab.
|
|
33
|
+
*/
|
|
34
|
+
export function liveBadge({ href: url, label = LIVE_LABEL, delay }) {
|
|
35
|
+
return (`<a class="cgb-live" href="${href(url)}" target="_blank" rel="noopener noreferrer"${startStyle(delay)}>` +
|
|
36
|
+
`<span class="cgb-live-icon" aria-hidden="true"></span>` +
|
|
37
|
+
`<span class="cgb-live-label"><span class="cgb-live-clip"><span class="cgb-live-text">${esc(label)}</span></span></span>` +
|
|
38
|
+
`<span class="cgb-sr"> (opens in a new tab)</span>` +
|
|
39
|
+
`</a>`);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=live.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live.js","sourceRoot":"","sources":["../../src/badge/live.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAA;AAc5C,mFAAmF;AACnF,MAAM,UAAU,UAAU,CAAC,KAAyB;IAClD,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAC7D,OAAO,uBAAuB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAA;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,UAAU,EAAE,KAAK,EAAoB;IAClF,OAAO,CACL,6BAA6B,IAAI,CAAC,GAAG,CAAC,8CAA8C,UAAU,CAAC,KAAK,CAAC,GAAG;QACxG,wDAAwD;QACxD,wFAAwF,GAAG,CAAC,KAAK,CAAC,uBAAuB;QACzH,mDAAmD;QACnD,MAAM,CACP,CAAA;AACH,CAAC"}
|
package/dist/badge/marks.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export declare const SHARE_NETWORK: readonly string[];
|
|
|
42
42
|
export declare const GOOGLE_LOGO: readonly string[];
|
|
43
43
|
/** Phosphor `info`, regular. */
|
|
44
44
|
export declare const INFO: readonly string[];
|
|
45
|
-
/**
|
|
45
|
+
/** Phosphor `chat-teardrop-text`, regular. */
|
|
46
|
+
export declare const CHAT_TEARDROP_TEXT: readonly string[];
|
|
47
|
+
/** Phosphor `x`, bold. */
|
|
48
|
+
export declare const X_BOLD: readonly string[];
|
|
49
|
+
/** Where each glyph above came from: the Phosphor file stem (`x-bold` is `x` at bold). Read by the tests and the gallery, not by the badge. */
|
|
46
50
|
export declare const BADGE_MARK_SOURCES: Record<string, string>;
|
|
47
51
|
//# sourceMappingURL=marks.d.ts.map
|