@atomic-ui/blocks 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +82 -18
- package/dist/{chunk-B6I3GVJ5.js → chunk-3G3NP4UC.js} +9 -4
- package/dist/chunk-3G3NP4UC.js.map +1 -0
- package/dist/{chunk-H262HKSL.js → chunk-7OFH762N.js} +53 -23
- package/dist/chunk-7OFH762N.js.map +1 -0
- package/dist/{chunk-WIVKJL64.js → chunk-BW5ZMKES.js} +65 -29
- package/dist/chunk-BW5ZMKES.js.map +1 -0
- package/dist/{chunk-WTVF3JRL.js → chunk-GDATDR2Q.js} +24 -7
- package/dist/chunk-GDATDR2Q.js.map +1 -0
- package/dist/{chunk-IT2NA25D.js → chunk-GZTBAT6P.js} +6 -3
- package/dist/chunk-GZTBAT6P.js.map +1 -0
- package/dist/{chunk-FNGN2F6Y.js → chunk-NZQZRBKV.js} +17 -4
- package/dist/chunk-NZQZRBKV.js.map +1 -0
- package/dist/{chunk-53V2GY6L.js → chunk-Q366ZM2X.js} +60 -29
- package/dist/chunk-Q366ZM2X.js.map +1 -0
- package/dist/{chunk-MMADM6OW.js → chunk-ZM2HLQOG.js} +3 -2
- package/dist/{chunk-MMADM6OW.js.map → chunk-ZM2HLQOG.js.map} +1 -1
- package/dist/components/changelog.js +1 -1
- package/dist/components/estimator.js +1 -1
- package/dist/components/g2-case.d.ts +8 -1
- package/dist/components/g2-case.js +1 -1
- package/dist/components/g2-site.d.ts +22 -1
- package/dist/components/g2-site.js +1 -1
- package/dist/components/journey.d.ts +13 -2
- package/dist/components/journey.js +1 -1
- package/dist/components/organisms.js +1 -1
- package/dist/components/site.d.ts +2 -1
- package/dist/components/site.js +1 -1
- package/dist/components/studio.d.ts +32 -3
- package/dist/components/studio.js +1 -1
- package/dist/index.js +8 -8
- package/dist/standalone/atomic-ui-blocks.js +1173 -1072
- package/dist/standalone/atomic-ui-blocks.js.map +3 -3
- package/package.json +3 -3
- package/dist/chunk-53V2GY6L.js.map +0 -1
- package/dist/chunk-B6I3GVJ5.js.map +0 -1
- package/dist/chunk-FNGN2F6Y.js.map +0 -1
- package/dist/chunk-H262HKSL.js.map +0 -1
- package/dist/chunk-IT2NA25D.js.map +0 -1
- package/dist/chunk-WIVKJL64.js.map +0 -1
- package/dist/chunk-WTVF3JRL.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -2099,7 +2099,7 @@
|
|
|
2099
2099
|
"declarations": [
|
|
2100
2100
|
{
|
|
2101
2101
|
"kind": "class",
|
|
2102
|
-
"description": "A project's process drawn as one main line that dips to a different depth\nfor each phase, like a branch in version control: hollow rings for each\npoint, the current one larger and filled in the accent and each flagged one\nfilled in the accent too, a mono label by each (above a\npoint on the main line, below one that dips) and accent flags such as\n\"Build merged\" and \"v1.0 launch\". A flag on the main line stands in for\nits point's label there. Between two points that dip to different depths\nthe line comes back up to the main line, so each phase is its own valley,\nas in the Sprint progress component (`10:483`).\n\n**The drawing is decoration; the list is the content.** A screen reader\nmeets an ordered list of the points, in order, with their flags and the\ncurrent one marked as the current step (1.1.1, 1.3.1). On a narrow column,\nmeasured against its own width, the same list is drawn as a vertical rail\nand the drawing is not shown, so nothing is lost at 320px (1.4.10).\n\nIt is drawn for an ink band and takes the band's colours, and the band's\npattern, such as its column lines, shows through it; outside a band it draws\nits own ink panel. Give a point `at` to place it where its phase falls, and\nleave a point's label empty for one with no words. The current point keeps a ring in the band's text\ncolour, so it is not told by its colour alone (1.4.1, 1.4.11).",
|
|
2102
|
+
"description": "A project's process drawn as one main line that dips to a different depth\nfor each phase, like a branch in version control: hollow rings for each\npoint, the current one larger and filled in the accent and each flagged one\nfilled in the accent too, a mono label by each (above a\npoint on the main line, below one that dips) and accent flags such as\n\"Build merged\" and \"v1.0 launch\". A flag on the main line stands in for\nits point's label there. Between two points that dip to different depths\nthe line comes back up to the main line, so each phase is its own valley,\nas in the Sprint progress component (`10:483`): each valley has a flat\nfloor, joined to the main line by short, steep bends.\n\n**The drawing is decoration; the list is the content.** A screen reader\nmeets an ordered list of the points, in order, with their flags and the\ncurrent one marked as the current step (1.1.1, 1.3.1). On a narrow column,\nmeasured against its own width, the same list is drawn as a vertical rail\nand the drawing is not shown, so nothing is lost at 320px (1.4.10).\n\nIt is drawn for an ink band and takes the band's colours, and the band's\npattern, such as its column lines, shows through it; outside a band it draws\nits own ink panel. Give a point `at` to place it where its phase falls, and\nleave a point's label empty for one with no words. The current point keeps a ring in the band's text\ncolour, so it is not told by its colour alone (1.4.1, 1.4.11).\n\n**It draws itself once** (impkt-web#51), for a brand with the reveal set on:\nas it reaches the middle of the screen the line strokes on from left to\nright in 640ms, the points and their words appear in order 60ms apart, and\nthe flagged points fill with the accent last. The list a screen reader meets\nnever moves. With no script and with reduced motion it is drawn as it ends.",
|
|
2103
2103
|
"name": "ImpaktProcessLine",
|
|
2104
2104
|
"members": [
|
|
2105
2105
|
{
|
|
@@ -2871,7 +2871,7 @@
|
|
|
2871
2871
|
},
|
|
2872
2872
|
{
|
|
2873
2873
|
"kind": "class",
|
|
2874
|
-
"description": "A small square mono tag that says which stage of a project a section shows,\nsuch as \"01 Discover Note\": the number in the accent, the phase in paper and\nthe stage's name quieter, on ink.\n\nSet `stage` for one of the five stages, or `index`, `phase` and `label` for\nyour own words; each one set wins over the stage's. The tag is drawn on the\nraised ink with a hairline round it, on paper and on an ink band alike, as\nthe Stage tag component (`8:320`) is; `on-ink` is kept for pages that set it\nand draws the same tag.\n\n**It is decoration.** The section's heading says what the section is, so the\ntag is hidden from a screen reader unless `announce` is set (1.3.1). The tag\nstays ink in both themes, so the yellow on it stays readable (1.4.3).",
|
|
2874
|
+
"description": "A small square mono tag that says which stage of a project a section shows,\nsuch as \"01 Discover Note\": the number in the accent, the phase in paper and\nthe stage's name quieter, on ink.\n\nSet `stage` for one of the five stages, or `index`, `phase` and `label` for\nyour own words; each one set wins over the stage's. The tag is drawn on the\nraised ink with a hairline round it, on paper and on an ink band alike, as\nthe Stage tag component (`8:320`) is; `on-ink` is kept for pages that set it\nand draws the same tag.\n\n**It is decoration.** The section's heading says what the section is, so the\ntag is hidden from a screen reader unless `announce` is set (1.3.1). The tag\nstays ink in both themes, so the yellow on it stays readable (1.4.3).\n\nFor a brand with the reveal set on, it types its words in once as its\nsection arrives (impkt-web#51); with no script and with reduced motion it is\nsimply there.",
|
|
2875
2875
|
"name": "ImpaktStageTag",
|
|
2876
2876
|
"members": [
|
|
2877
2877
|
{
|
|
@@ -3010,7 +3010,7 @@
|
|
|
3010
3010
|
},
|
|
3011
3011
|
{
|
|
3012
3012
|
"kind": "class",
|
|
3013
|
-
"description": "The head of a section: a mono label such as \"# Services\" with an optional\nstage tag on the right, then a display heading and a lead.\n\n`size` sets the heading: `xl` (120px) for a page's hero, `l` (64px), and `m`\n(52px) for a section. Give the heading as `heading`, or in the `heading` slot\nwhen part of it is picked out with `impakt-highlight` or an accent word. The\nlead goes under the heading, or with `lead-position=\"side\"` at the foot of a\n340px column on the right. The `aside` slot holds a picture on the right,\nsuch as a journey object at 448 by 288, with the heading and lead level with\nits middle. A page drawn on the server sets `aside` when it fills the slot,\nsince the head cannot see its children there; in a browser the head sets it\nitself.\n\n**One heading, at the level the page needs.** `level` is 1 for a page's hero\nand 2 for a section (1.3.1, 2.4.6). The \"#\" before the label is decoration.\n\n**It stacks in a narrow column**, measured against its own width: the label\nrow, the heading, the lead and the aside, in reading order (1.4.10). It takes\nits colours from the band it is on, so it reads on paper, ink and accent.",
|
|
3013
|
+
"description": "The head of a section: a mono label such as \"# Services\" with an optional\nstage tag on the right, then a display heading and a lead.\n\n`size` sets the heading: `xl` (120px) for a page's hero, `l` (64px), and `m`\n(52px) for a section. Give the heading as `heading`, or in the `heading` slot\nwhen part of it is picked out with `impakt-highlight` or an accent word. The\nlead goes under the heading, or with `lead-position=\"side\"` at the foot of a\n340px column on the right. The `aside` slot holds a picture on the right,\nsuch as a journey object at 448 by 288, with the heading and lead level with\nits middle. A page drawn on the server sets `aside` when it fills the slot,\nsince the head cannot see its children there; in a browser the head sets it\nitself.\n\n**One heading, at the level the page needs.** `level` is 1 for a page's hero\nand 2 for a section (1.3.1, 2.4.6). The \"#\" before the label is decoration.\n\nFor a brand with the reveal set on, the label types itself in once as the\nsection arrives, and a stage tag beside it does the same (impkt-web#51); the\nheading and the lead never move.\n\n**It stacks in a narrow column**, measured against its own width: the label\nrow, the heading, the lead and the aside, in reading order (1.4.10). It takes\nits colours from the band it is on, so it reads on paper, ink and accent.",
|
|
3014
3014
|
"name": "ImpaktSectionHead",
|
|
3015
3015
|
"slots": [
|
|
3016
3016
|
{
|
|
@@ -3304,7 +3304,7 @@
|
|
|
3304
3304
|
},
|
|
3305
3305
|
{
|
|
3306
3306
|
"kind": "class",
|
|
3307
|
-
"description": "A service on the services grid: a number and a dot at the top, then at the\nfoot its name, a line about it, mono tags such as \"React Native · Expo\" and\n\"Learn more\".\n\n**The card is one link.** The link is on the service's name, a heading, and\nstretched over the card (2.4.4, 2.5.8). The number, dot and \"Learn more\"\nline are decoration. Pointing at the card and focusing it look the same: it\nturns to ink with paper words and the dot and \"Learn more\" in the accent,\nwhich holds 4.5:1 on ink, and the focus ring is drawn round it (2.4.7).\n\n`featured` draws a card inked all the time, as it is when pointed at, for\nthe one service a page picks out or a sheet that shows the state.\n\nPut cards in a four-column grid with a 10px gap. On a phone the words sit at\nthe top and the card is as tall as they are.",
|
|
3307
|
+
"description": "A service on the services grid: a number and a dot at the top, then at the\nfoot its name, a line about it, mono tags such as \"React Native · Expo\" and\n\"Learn more\".\n\n**The card is one link.** The link is on the service's name, a heading, and\nstretched over the card (2.4.4, 2.5.8). The number, dot and \"Learn more\"\nline are decoration. Pointing at the card and focusing it look the same: it\nturns to ink with paper words and the dot and \"Learn more\" in the accent,\nwhich holds 4.5:1 on ink, and the focus ring is drawn round it (2.4.7).\nFor a brand with the reveal set on (impkt-web#51) the ink wipes in from the\nleft in 180ms and the arrow slides 4px forward, on hover or focus only; the\ncard drops 12px into place, once, as it is reached.\n\n`featured` draws a card inked all the time, as it is when pointed at, for\nthe one service a page picks out or a sheet that shows the state.\n\nPut cards in a four-column grid with a 10px gap. On a phone the words sit at\nthe top and the card is as tall as they are.",
|
|
3308
3308
|
"name": "ImpaktServiceCard",
|
|
3309
3309
|
"members": [
|
|
3310
3310
|
{
|
|
@@ -3677,8 +3677,8 @@
|
|
|
3677
3677
|
"type": {
|
|
3678
3678
|
"text": "'sm' | 'md' | 'lg' | 'xl'"
|
|
3679
3679
|
},
|
|
3680
|
-
"description": "The values' size: `sm` 16px, `md` 18px, `lg` 24px, `xl` 32px. An item can set its own.",
|
|
3681
|
-
"default": "'
|
|
3680
|
+
"description": "The values' size: `sm` 16px on 1.45, the G2 facts' Body M and the default (21:1336, 34:627), `md` 18px, `lg` 24px, `xl` 32px. An item can set its own.",
|
|
3681
|
+
"default": "'sm'",
|
|
3682
3682
|
"attribute": "size",
|
|
3683
3683
|
"reflects": true
|
|
3684
3684
|
},
|
|
@@ -3718,8 +3718,8 @@
|
|
|
3718
3718
|
"type": {
|
|
3719
3719
|
"text": "'sm' | 'md' | 'lg' | 'xl'"
|
|
3720
3720
|
},
|
|
3721
|
-
"description": "The values' size: `sm` 16px, `md` 18px, `lg` 24px, `xl` 32px. An item can set its own.",
|
|
3722
|
-
"default": "'
|
|
3721
|
+
"description": "The values' size: `sm` 16px on 1.45, the G2 facts' Body M and the default (21:1336, 34:627), `md` 18px, `lg` 24px, `xl` 32px. An item can set its own.",
|
|
3722
|
+
"default": "'sm'",
|
|
3723
3723
|
"fieldName": "size"
|
|
3724
3724
|
},
|
|
3725
3725
|
{
|
|
@@ -3743,7 +3743,7 @@
|
|
|
3743
3743
|
},
|
|
3744
3744
|
{
|
|
3745
3745
|
"kind": "class",
|
|
3746
|
-
"description": "A numbered list under an ink rule, each row split by a hairline: the number,\na heading and a line of quieter text in three columns. \"Three rules we don't\nbreak\", the steps of a project, a tool's features.\n\nAn ordered list, so a screen reader says how many rows there are and which\none this is, and the drawn numbers are hidden from it (1.3.1). Each heading\nis at the level the page asks for. It stacks in a narrow column, measured\nagainst its own width (1.4.10), and takes its colours from its band.",
|
|
3746
|
+
"description": "A numbered list under an ink rule, each row split by a hairline: the number,\na heading and a line of quieter text in three columns. \"Three rules we don't\nbreak\", the steps of a project, a tool's features.\n\nThe columns are 60px, then the heading and the text 40px apart, split 520\nto 420 as on a case study (`21:1389`). `split=\"text\"` gives the text the\nwider share, 460 to 480, as the tools pages do (`34:714`).\n\nAn ordered list, so a screen reader says how many rows there are and which\none this is, and the drawn numbers are hidden from it (1.3.1). Each heading\nis at the level the page asks for. It stacks in a narrow column, measured\nagainst its own width (1.4.10), and takes its colours from its band.",
|
|
3747
3747
|
"name": "ImpaktNumberedList",
|
|
3748
3748
|
"members": [
|
|
3749
3749
|
{
|
|
@@ -3756,6 +3756,18 @@
|
|
|
3756
3756
|
"default": "[]",
|
|
3757
3757
|
"attribute": "items"
|
|
3758
3758
|
},
|
|
3759
|
+
{
|
|
3760
|
+
"kind": "field",
|
|
3761
|
+
"name": "split",
|
|
3762
|
+
"privacy": "public",
|
|
3763
|
+
"type": {
|
|
3764
|
+
"text": "'heading' | 'text'"
|
|
3765
|
+
},
|
|
3766
|
+
"description": "How the heading and the text share the row: `heading` 520 to 420 (`21:1389`), `text` 460 to 480 (`34:714`).",
|
|
3767
|
+
"default": "'heading'",
|
|
3768
|
+
"attribute": "split",
|
|
3769
|
+
"reflects": true
|
|
3770
|
+
},
|
|
3759
3771
|
{
|
|
3760
3772
|
"kind": "field",
|
|
3761
3773
|
"name": "start",
|
|
@@ -3823,6 +3835,15 @@
|
|
|
3823
3835
|
"description": "A name for the list, for a screen reader. Leave empty for none.",
|
|
3824
3836
|
"default": "''",
|
|
3825
3837
|
"fieldName": "label"
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
"name": "split",
|
|
3841
|
+
"type": {
|
|
3842
|
+
"text": "'heading' | 'text'"
|
|
3843
|
+
},
|
|
3844
|
+
"description": "How the heading and the text share the row: `heading` 520 to 420 (`21:1389`), `text` 460 to 480 (`34:714`).",
|
|
3845
|
+
"default": "'heading'",
|
|
3846
|
+
"fieldName": "split"
|
|
3826
3847
|
}
|
|
3827
3848
|
],
|
|
3828
3849
|
"superclass": {
|
|
@@ -4359,7 +4380,7 @@
|
|
|
4359
4380
|
},
|
|
4360
4381
|
{
|
|
4361
4382
|
"kind": "class",
|
|
4362
|
-
"description": "A call to action drawn as the thing it once was: a sticky note from a\nworkshop, a wireframe box, a designed component, the code that renders it,\nand at last the live button. A page shows it at the stage each section is\nabout, so the same button is seen being made as the page is read.\n\n**It is the same link at every stage.** Whatever it is drawn as, it is one\n`<a>` whose name is its words, so a screen reader and a keyboard meet an\nordinary link; the note, the wireframe cross, the measuring marks and the\nlines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its\ntarget is at least 44px tall at every stage (2.5.8).\n\n**A page that shows it more than once sets `decorative` on the copies.** A\ndecorative one is a picture of the button, not a control: it has no link\nand is hidden from a screen reader, so the page does not hold five links\nthat say the same thing (2.4.4).\n\n**It keeps its shape as it scales.** The drawing is about 14 wide to 9\ntall at any width, 560 by 360 on a wide page and 347 by 223 on a phone, and\neverything in it is sized from its own width.\n\n**One button can follow the page.** Give `track` a selector for the page's\nsections, each carrying `data-journey-stage`, and the button takes the stage\nof whichever section is across the middle of the screen. Between two\nsections the whole morph is scrubbed by the scroll, as the motion spec\n(`11:830`) asks: the shapes, the words and the design notes all follow the\nscroll, and the move is complete as the next section crosses the middle of\nthe screen. Scrolling back halfway leaves it halfway.\n\nWhere the browser has scroll-driven animations, the scroll drives the stage\nitself through a scroll timeline, with no script running as the page moves;\nthe button only measures where the sections are, again when the page is\nresized. Elsewhere a frame loop reads the scroll at most once a frame, and\nonly while the page scrolls. Either way each move between two sections is\nshaped by that move's easing, so ship overshoots near the end of its range.\n\n**One button can travel.** Set `travel` and the button stays in view while\nits sections scroll past, as the spec's one moving object does. It is sticky,\nso put it in a column as tall as the tracked sections, beside them, such as\nthe second column of a grid whose first holds the sections. It sits\n`--impakt-journey-travel-top` from the top of the screen, a fifth of the\nscreen unless the page sets it. On a phone, where the sections stack, leave\n`travel` off and give each section its own decorative copy.\n\n**A page can drive the morph itself.** Set `progress`, a number from 0 (the\nnote) to 4 (live), and the button draws the morph at that point with no\ntransition, for a page that scrubs it over scroll ranges of its own, such as\none that rests the button in each section's aside in turn. Set `stage` to the\nnearest stage as well, so the link takes that stage's shape.\n\n**Each move has its own timing**, from the motion spec: flatten 640ms, ink\nin 560ms, compile 720ms, ship 600ms with an overshoot, lift 180ms on hover\nand press 140ms. Each is read from `--impakt-motion-journey-<move>-duration`\nand `-easing`. When `stage` is set by hand the move runs on that timing.\n**Only transforms, opacity and colour move**, so a change of stage costs no\nlayout.\n\n**With reduced motion asked for** each stage cuts straight to its final\nstate: there is no morph, no scale and no change of position. A tracked\nbutton swaps to a section's stage as soon as the section enters the screen,\nand pointing at the live button changes its colour only (2.3.3).\n\n**`annotations` draws the design notes around it**, as the site's motion\nframes show: the stage's caption above, a handwritten note in the margin at\nthe note stage, the
|
|
4383
|
+
"description": "A call to action drawn as the thing it once was: a sticky note from a\nworkshop, a wireframe box, a designed component, the code that renders it,\nand at last the live button. A page shows it at the stage each section is\nabout, so the same button is seen being made as the page is read.\n\n**It is the same link at every stage.** Whatever it is drawn as, it is one\n`<a>` whose name is its words, so a screen reader and a keyboard meet an\nordinary link; the note, the wireframe cross, the measuring marks and the\nlines of code around it are decoration and are hidden (1.3.1, 4.1.2). Its\ntarget is at least 44px tall at every stage (2.5.8).\n\n**A page that shows it more than once sets `decorative` on the copies.** A\ndecorative one is a picture of the button, not a control: it has no link\nand is hidden from a screen reader, so the page does not hold five links\nthat say the same thing (2.4.4).\n\n**It keeps its shape as it scales.** The drawing is about 14 wide to 9\ntall at any width, 560 by 360 on a wide page and 347 by 223 on a phone, and\neverything in it is sized from its own width.\n\n**One button can follow the page.** Give `track` a selector for the page's\nsections, each carrying `data-journey-stage`, and the button takes the stage\nof whichever section is across the middle of the screen. Between two\nsections the whole morph is scrubbed by the scroll, as the motion spec\n(`11:830`) asks: the shapes, the words and the design notes all follow the\nscroll, and the move is complete as the next section crosses the middle of\nthe screen. Scrolling back halfway leaves it halfway.\n\nWhere the browser has scroll-driven animations, the scroll drives the stage\nitself through a scroll timeline, with no script running as the page moves;\nthe button only measures where the sections are, again when the page is\nresized. Elsewhere a frame loop reads the scroll at most once a frame, and\nonly while the page scrolls. Either way each move between two sections is\nshaped by that move's easing, so ship overshoots near the end of its range.\n\n**One button can travel.** Set `travel` and the button stays in view while\nits sections scroll past, as the spec's one moving object does. It is sticky,\nso put it in a column as tall as the tracked sections, beside them, such as\nthe second column of a grid whose first holds the sections. It sits\n`--impakt-journey-travel-top` from the top of the screen, a fifth of the\nscreen unless the page sets it. On a phone, where the sections stack, leave\n`travel` off and give each section its own decorative copy.\n\n**A page can drive the morph itself.** Set `progress`, a number from 0 (the\nnote) to 4 (live), and the button draws the morph at that point with no\ntransition, for a page that scrubs it over scroll ranges of its own, such as\none that rests the button in each section's aside in turn. Set `stage` to the\nnearest stage as well, so the link takes that stage's shape.\n\n**Each move has its own timing**, from the motion spec: flatten 640ms, ink\nin 560ms, compile 720ms, ship 600ms with an overshoot, lift 180ms on hover\nand press 140ms. Each is read from `--impakt-motion-journey-<move>-duration`\nand `-easing`. When `stage` is set by hand the move runs on that timing.\n**Only transforms, opacity and colour move**, so a change of stage costs no\nlayout.\n\n**With reduced motion asked for** each stage cuts straight to its final\nstate: there is no morph, no scale and no change of position. A tracked\nbutton swaps to a section's stage as soon as the section enters the screen,\nand pointing at the live button changes its colour only (2.3.3).\n\n**`annotations` draws the design notes around it**, as the site's motion\nframes show: the stage's caption above, a handwritten note in the margin at\nthe note stage (unless the brand or `margin-note-shown` leaves it out), the\nwidth and height marks at the wireframe and component, the spec tags under\nthe component and a pointer at the live button. They\nare decoration and are hidden from a screen reader. Leave it off when the\nbutton is a plain call to action.\n\nThe words on every fill are a pair the tokens already measured: the accent\nwith its own text colour, and the text colour with the card colour (1.4.3).\nA brand whose ink is dark may colour the words in the code window by\nsetting `--impakt-journey-code-words`.",
|
|
4363
4384
|
"name": "ImpaktJourneyButton",
|
|
4364
4385
|
"cssProperties": [
|
|
4365
4386
|
{
|
|
@@ -4482,6 +4503,18 @@
|
|
|
4482
4503
|
"default": "''",
|
|
4483
4504
|
"attribute": "margin-note"
|
|
4484
4505
|
},
|
|
4506
|
+
{
|
|
4507
|
+
"kind": "field",
|
|
4508
|
+
"name": "marginNoteShown",
|
|
4509
|
+
"privacy": "public",
|
|
4510
|
+
"type": {
|
|
4511
|
+
"text": "'' | 'yes' | 'no'"
|
|
4512
|
+
},
|
|
4513
|
+
"description": "With `annotations`: whether the handwritten note is drawn. Left empty, the brand decides through its\n`journey.margin-note` shape, which Impakt sets to `none`; `yes` draws it and `no` leaves it out.",
|
|
4514
|
+
"default": "''",
|
|
4515
|
+
"attribute": "margin-note-shown",
|
|
4516
|
+
"reflects": true
|
|
4517
|
+
},
|
|
4485
4518
|
{
|
|
4486
4519
|
"kind": "field",
|
|
4487
4520
|
"name": "specs",
|
|
@@ -4883,6 +4916,15 @@
|
|
|
4883
4916
|
"default": "''",
|
|
4884
4917
|
"fieldName": "marginNote"
|
|
4885
4918
|
},
|
|
4919
|
+
{
|
|
4920
|
+
"name": "margin-note-shown",
|
|
4921
|
+
"type": {
|
|
4922
|
+
"text": "'' | 'yes' | 'no'"
|
|
4923
|
+
},
|
|
4924
|
+
"description": "With `annotations`: whether the handwritten note is drawn. Left empty, the brand decides through its\n`journey.margin-note` shape, which Impakt sets to `none`; `yes` draws it and `no` leaves it out.",
|
|
4925
|
+
"default": "''",
|
|
4926
|
+
"fieldName": "marginNoteShown"
|
|
4927
|
+
},
|
|
4886
4928
|
{
|
|
4887
4929
|
"name": "specs",
|
|
4888
4930
|
"type": {
|
|
@@ -11460,9 +11502,9 @@
|
|
|
11460
11502
|
"name": "presence",
|
|
11461
11503
|
"privacy": "public",
|
|
11462
11504
|
"type": {
|
|
11463
|
-
"text": "Array<{ name: string; initials?: string; accent?: boolean }>"
|
|
11505
|
+
"text": "Array<{ name: string; initials?: string; accent?: boolean; ink?: boolean }>"
|
|
11464
11506
|
},
|
|
11465
|
-
"description": "The people in the file, drawn as small overlapping avatars. `
|
|
11507
|
+
"description": "The people in the file, drawn as small overlapping avatars. `ink` fills one in ink, as the first of 9:285, and `accent` in the accent.",
|
|
11466
11508
|
"default": "[]",
|
|
11467
11509
|
"attribute": "presence"
|
|
11468
11510
|
},
|
|
@@ -11766,9 +11808,9 @@
|
|
|
11766
11808
|
{
|
|
11767
11809
|
"name": "presence",
|
|
11768
11810
|
"type": {
|
|
11769
|
-
"text": "Array<{ name: string; initials?: string; accent?: boolean }>"
|
|
11811
|
+
"text": "Array<{ name: string; initials?: string; accent?: boolean; ink?: boolean }>"
|
|
11770
11812
|
},
|
|
11771
|
-
"description": "The people in the file, drawn as small overlapping avatars. `
|
|
11813
|
+
"description": "The people in the file, drawn as small overlapping avatars. `ink` fills one in ink, as the first of 9:285, and `accent` in the accent.",
|
|
11772
11814
|
"default": "[]",
|
|
11773
11815
|
"fieldName": "presence"
|
|
11774
11816
|
},
|
|
@@ -12294,7 +12336,7 @@
|
|
|
12294
12336
|
"declarations": [
|
|
12295
12337
|
{
|
|
12296
12338
|
"kind": "class",
|
|
12297
|
-
"description": "A numbered list of projects, each name set large: the work on a studio's\nhome page, or the index on its work page.\n\n**Each row is one link.** The link sits on the project's name, which is a\nheading, and is stretched over the row, so the whole row can be pressed\nwhile a screen reader meets one link with one name (2.4.4, 2.5.8). The\nnumber and the arrow are decoration and are hidden from it; the list itself\nsays how many projects there are and which one this is (1.3.1).\n\n**Pointing at a row and focusing it look the same.** The row turns to the\ntext colour with the card colour on it, a pair every brand's tokens already\nhold at 4.5:1, so the state never depends on a colour of its own (1.4.3,\n1.4.11). The focus ring is still drawn over it (2.4.7).\n\nThe names shrink with the block's own width, not the window's, so the list\nreads the same in a narrow column as on a phone (1.4.10).\n\n**A row can say more.** `text` adds a description column, `badge` a status\nword in capitals and `price` a line under it, so the same list sets out a\nstudio's work or a shop of tools. A `featured` row stays in ink with its\nbadge and arrow in the accent. `columns` draws a line of column names above\nthe rows, such as \"No.\", \"Project\" and \"Type · Sector\"; it is decoration,\nsince each row's own words already say what they are.\n\n**A row can show a picture as it is pointed at.** Give it `preview` and a\ncard with the picture follows the pointer, tilted. It is shown only to a\nmouse, never on touch or with reduced motion asked for, and it is hidden\nfrom a screen reader: the row's name already says what it is.",
|
|
12339
|
+
"description": "A numbered list of projects, each name set large: the work on a studio's\nhome page, or the index on its work page.\n\n**Each row is one link.** The link sits on the project's name, which is a\nheading, and is stretched over the row, so the whole row can be pressed\nwhile a screen reader meets one link with one name (2.4.4, 2.5.8). The\nnumber and the arrow are decoration and are hidden from it; the list itself\nsays how many projects there are and which one this is (1.3.1).\n\n**Pointing at a row and focusing it look the same.** The row turns to the\ntext colour with the card colour on it, a pair every brand's tokens already\nhold at 4.5:1, so the state never depends on a colour of its own (1.4.3,\n1.4.11). The focus ring is still drawn over it (2.4.7).\n\nFor a brand with the reveal set on (impkt-web#51) the ink wipes in from the\nleft in 180ms and the arrow slides 4px on, on hover or focus only, and the\nrows drop into place one after another, once, as the list is reached. No row\nis inked until it is pointed at or focused, unless it is `featured`.\n\nThe names shrink with the block's own width, not the window's, so the list\nreads the same in a narrow column as on a phone (1.4.10).\n\n**A row can say more.** `text` adds a description column, `badge` a status\nword in capitals and `price` a line under it, so the same list sets out a\nstudio's work or a shop of tools. A `featured` row stays in ink with its\nbadge and arrow in the accent. `columns` draws a line of column names above\nthe rows, such as \"No.\", \"Project\" and \"Type · Sector\"; it is decoration,\nsince each row's own words already say what they are.\n\n**A row can show a picture as it is pointed at.** Give it `preview` and a\ncard with the picture follows the pointer, tilted. It is shown only to a\nmouse, never on touch or with reduced motion asked for, and it is hidden\nfrom a screen reader: the row's name already says what it is.",
|
|
12298
12340
|
"name": "ImpaktWorkList",
|
|
12299
12341
|
"members": [
|
|
12300
12342
|
{
|
|
@@ -12512,7 +12554,7 @@
|
|
|
12512
12554
|
},
|
|
12513
12555
|
{
|
|
12514
12556
|
"kind": "class",
|
|
12515
|
-
"description": "A row of figures under a rule, each with what it counts: \"4 live products\",\n\"161 ms response time\".\n\nThe figures are a list, so a screen reader says how many there are, and each\nis read as one phrase, \"161 ms response time\", not a bare number followed\nsome way off by its label (1.3.1). The row wraps by its own width: four\nacross, then two (a phone 350px wide shows two by two), then one, with\nnothing to scroll sideways at 320px (1.4.10).",
|
|
12557
|
+
"description": "A row of figures under a rule, each with what it counts: \"4 live products\",\n\"161 ms response time\".\n\nFor a brand with the reveal set on (impkt-web#51) each figure counts up\nonce, over 900ms, as the row is reached. The count is drawn over the figure,\nso the real figure is the text a screen reader reads throughout; with no\nscript and with reduced motion the figure is simply there.\n\nThe figures are a list, so a screen reader says how many there are, and each\nis read as one phrase, \"161 ms response time\", not a bare number followed\nsome way off by its label (1.3.1). The row wraps by its own width: four\nacross, then two (a phone 350px wide shows two by two), then one, with\nnothing to scroll sideways at 320px (1.4.10).",
|
|
12516
12558
|
"name": "ImpaktStatRow",
|
|
12517
12559
|
"members": [
|
|
12518
12560
|
{
|
|
@@ -12607,8 +12649,30 @@
|
|
|
12607
12649
|
},
|
|
12608
12650
|
{
|
|
12609
12651
|
"kind": "class",
|
|
12610
|
-
"description": "The questions at the foot of a page, under a heading: a title, a line of\nintroduction, and the questions as sections that open.\n\nIt is `impakt-accordion` with the heading a page always writes above it, so\nthe levels cannot drift: the questions are always one level below the\nblock's own heading (1.3.1). With a heading, the block is a region named by\nit, so a screen reader can jump straight to the questions (2.4.1).\n\nAn answer that is more than words is slotted as `panel-<id>`, exactly as\non the accordion, and is passed through to it.",
|
|
12652
|
+
"description": "The questions at the foot of a page, under a heading: a title, a line of\nintroduction, and the questions as sections that open.\n\nIt is `impakt-accordion` with the heading a page always writes above it, so\nthe levels cannot drift: the questions are always one level below the\nblock's own heading (1.3.1). With a heading, the block is a region named by\nit, so a screen reader can jump straight to the questions (2.4.1).\n\nAn answer that is more than words is slotted as `panel-<id>`, exactly as\non the accordion, and is passed through to it. The accordion's parts are\npassed out too, as `item`, `head`, `header` and `panel`, so a page can style\na row as it would on the accordion itself.\n\nEach row is 92px with its rule, the question centred beside its \"+\", as\nthe FAQ item of `10:670` and `21:1220` is.",
|
|
12611
12653
|
"name": "ImpaktFaq",
|
|
12654
|
+
"cssParts": [
|
|
12655
|
+
{
|
|
12656
|
+
"description": "The accordion that holds the questions.",
|
|
12657
|
+
"name": "questions"
|
|
12658
|
+
},
|
|
12659
|
+
{
|
|
12660
|
+
"description": "A question and its answer, passed out from the accordion.",
|
|
12661
|
+
"name": "item"
|
|
12662
|
+
},
|
|
12663
|
+
{
|
|
12664
|
+
"description": "A question's row.",
|
|
12665
|
+
"name": "head"
|
|
12666
|
+
},
|
|
12667
|
+
{
|
|
12668
|
+
"description": "The button that opens a question.",
|
|
12669
|
+
"name": "header"
|
|
12670
|
+
},
|
|
12671
|
+
{
|
|
12672
|
+
"description": "An answer.",
|
|
12673
|
+
"name": "panel"
|
|
12674
|
+
}
|
|
12675
|
+
],
|
|
12612
12676
|
"members": [
|
|
12613
12677
|
{
|
|
12614
12678
|
"kind": "field",
|
|
@@ -13355,7 +13419,7 @@
|
|
|
13355
13419
|
},
|
|
13356
13420
|
{
|
|
13357
13421
|
"kind": "class",
|
|
13358
|
-
"description": "A word or two of a heading picked out as if selected in a design tool: the\naccent colour behind it, an outline and four handles.\n\nIt is decoration round real text. The words stay in the heading, in the\npage, so they are read, found and translated as the rest of it is; the\nhandles and the optional label are hidden from a screen reader (1.3.1).\nThe words on the accent are the colour the tokens measured against it\n(1.4.3)
|
|
13422
|
+
"description": "A word or two of a heading picked out as if selected in a design tool: the\naccent colour behind it, an outline and four handles.\n\nIt is decoration round real text. The words stay in the heading, in the\npage, so they are read, found and translated as the rest of it is; the\nhandles and the optional label are hidden from a screen reader (1.3.1).\nThe words on the accent are the colour the tokens measured against it\n(1.4.3).\n\n**It draws itself once** (impkt-web#51), for a brand with the reveal set on:\nwhen its section reaches the middle of the screen the frame is drawn round\nthe words in 260ms, the 8px handles appear at its corners and the size in\nthe label counts up to the real size. The words never move. With no script\nand with reduced motion it is drawn as it ends.\n\n`cursor` draws a pointer at the bottom-right handle, as if someone in the\nfile had just picked the words; its value, if any, is the name tag beside\nit. `hide-label-on=\"phone\"` leaves the label out on a phone, where it would\ncrowd the line below.\n\nThe box is drawn 0.1em outside the words at each side, as the Selection in\nthe home frame is (`9:306`), so the words keep their place in the heading\nand the box hangs into the space round them. At its end it also gives back\nthe display type's -0.05em tracking after the last letter\n(`--impakt-highlight-trail`), and the word after it is pushed along by the\noverhang, so a space still follows the box (`9:302`, `21:1322`).",
|
|
13359
13423
|
"name": "ImpaktHighlight",
|
|
13360
13424
|
"slots": [
|
|
13361
13425
|
{
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { css, html, nothing, unsafeCSS } from "lit";
|
|
3
3
|
import {
|
|
4
4
|
ImpaktElement,
|
|
5
|
+
R,
|
|
5
6
|
pageLocale,
|
|
6
7
|
say,
|
|
7
8
|
focusRing,
|
|
@@ -142,6 +143,10 @@ var ImpaktEstimator = class extends ImpaktElement {
|
|
|
142
143
|
button, .send { ${targetSize} display: inline-flex; align-items: center; justify-content: center; gap: ${space(2)}; padding: ${space(2.5)} ${space(5)}; border-radius: ${t.radiusLg}; font: inherit; font-weight: ${fontWeight("semibold")}; cursor: pointer; text-decoration: none; border: ${t.borderThin} solid transparent; }
|
|
143
144
|
.primary, .send { background: ${t.brand}; color: ${t.onBrand}; }
|
|
144
145
|
.primary:hover, .send:hover { background: ${t.brandHover}; }
|
|
146
|
+
/* The arrow slides forward when its button or link is pointed at or focused (impkt-web#51), 4px for Impakt and not at all for a brand that derives it. */
|
|
147
|
+
.go { display: inline-block; flex: none; transition: translate ${R.arrowDuration} ${R.arrowEasing}; }
|
|
148
|
+
:is(a, button):is(:hover, :focus-visible) .go { translate: ${R.arrowDistance} 0; }
|
|
149
|
+
@media (prefers-reduced-motion: reduce) { .go { transition: none; } }
|
|
145
150
|
.secondary { background: transparent; color: ${t.text}; border-color: ${t.borderStrong}; }
|
|
146
151
|
.secondary:hover { background: ${t.surfaceSubtle}; }
|
|
147
152
|
|
|
@@ -417,7 +422,7 @@ var ImpaktEstimator = class extends ImpaktElement {
|
|
|
417
422
|
${r.way ? html`<div><dt class="mono">${say("Way of working")}</dt><dd>${r.way}</dd></div>` : nothing}
|
|
418
423
|
</dl>
|
|
419
424
|
<div class="actions">
|
|
420
|
-
${this.contactHref ? html`<a class="send" href=${this.contactHref} @click=${(e) => this.send(e)}>${this.sendLabel} <span aria-hidden="true">→</span></a>` : nothing}
|
|
425
|
+
${this.contactHref ? html`<a class="send" href=${this.contactHref} @click=${(e) => this.send(e)}>${this.sendLabel} <span class="go" aria-hidden="true">→</span></a>` : nothing}
|
|
421
426
|
<button type="button" class="secondary" @click=${() => this.copy()}>${say("Copy summary")}</button>
|
|
422
427
|
<button type="button" class="secondary" @click=${() => {
|
|
423
428
|
this.reset();
|
|
@@ -432,7 +437,7 @@ var ImpaktEstimator = class extends ImpaktElement {
|
|
|
432
437
|
renderAll(r) {
|
|
433
438
|
const qs = this.questions ?? [];
|
|
434
439
|
const weeks = phaseWeeks(this.phases ?? [], r.weeks);
|
|
435
|
-
const arrow = html`<svg viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false"><path d="M0 6h18M13 1l5 5-5 5" /></svg>`;
|
|
440
|
+
const arrow = html`<svg class="go" viewBox="0 0 20 12" width="20" height="12" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" focusable="false"><path d="M0 6h18M13 1l5 5-5 5" /></svg>`;
|
|
436
441
|
return html`<div class="all">
|
|
437
442
|
<div class="questions" part="questions">
|
|
438
443
|
${qs.map((q, i) => {
|
|
@@ -483,7 +488,7 @@ var ImpaktEstimator = class extends ImpaktElement {
|
|
|
483
488
|
${this.renderResult(r)}
|
|
484
489
|
${done ? nothing : html`<div class="nav">
|
|
485
490
|
${this.at > 0 ? html`<button type="button" class="secondary" @click=${() => this.go(this.at - 1)}>${say("Back")}</button>` : nothing}
|
|
486
|
-
<button type="button" class="primary" @click=${() => this.go(this.at + 1)}>${this.at === total - 1 ? say("See my estimate") : say("Next")} <span aria-hidden="true">→</span></button>
|
|
491
|
+
<button type="button" class="primary" @click=${() => this.go(this.at + 1)}>${this.at === total - 1 ? say("See my estimate") : say("Next")} <span class="go" aria-hidden="true">→</span></button>
|
|
487
492
|
</div>`}
|
|
488
493
|
</div>
|
|
489
494
|
<aside class="panel" part="panel" style=${`--s:${scale}`}>
|
|
@@ -503,4 +508,4 @@ export {
|
|
|
503
508
|
phaseWeeks,
|
|
504
509
|
ImpaktEstimator
|
|
505
510
|
};
|
|
506
|
-
//# sourceMappingURL=chunk-
|
|
511
|
+
//# sourceMappingURL=chunk-3G3NP4UC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/estimator.ts"],"sourcesContent":["/**\n * A cost estimator: a few questions, one at a time, with a budget beside them\n * that moves as the answers change, and then a result with a timeline, a team\n * and a way of working.\n *\n * Every number is content. Each choice says what it adds to the cost and the\n * weeks, or what it multiplies them by, and the bands say how big a team a\n * cost needs. The arithmetic lives here, in code, because a binding never\n * computes (ADR 0003): a studio changes its rates in the CMS, not the rules.\n */\nimport { css, html, nothing, unsafeCSS, type TemplateResult } from 'lit';\nimport {\n ImpaktElement,\n R,\n pageLocale,\n say,\n focusRing,\n targetSize,\n visuallyHidden,\n fontSize,\n fontWeight,\n space,\n spaceAround,\n t,\n token,\n type,\n toneOf,\n} from '@atomic-ui/ui';\n\n/** One answer to a question, and what it does to the estimate. */\nexport interface EstimatorChoice {\n id: string;\n label: string;\n /** A line under the label, such as \"iPhone and Android\". */\n hint?: string;\n /** Added to the cost, counted in units (see `unit`). */\n cost?: number;\n /** Added to the weeks. */\n weeks?: number;\n /** Multiplies the cost, such as 1.35 for a more polished first version. */\n costFactor?: number;\n /** Multiplies the weeks. */\n weeksFactor?: number;\n /** Engineers added to the team, such as one more to go faster. */\n engineers?: number;\n /** Shown beside the budget when it is picked. */\n tip?: string;\n /** How the summary names it, such as \"a SaaS platform\" or \"payments\". The label when left out. */\n phrase?: string;\n}\n\n/** One question. */\nexport interface EstimatorQuestion {\n id: string;\n heading: string;\n hint?: string;\n /** `one` picks one card, `many` picks any number, and `scale` is a slider across the choices in order. */\n kind: 'one' | 'many' | 'scale';\n choices: EstimatorChoice[];\n /** The choices picked at the start. A `one` or `scale` question takes the first id; with none, its first choice. */\n start?: string[];\n /** A short name for the question in the summary that is sent on, such as \"Polish\". Left out of it when there is none. */\n short?: string;\n /** For a `many` question, whether the summary lists what was picked, as in \"with payments and AI features\". Yes when left out. */\n inSummary?: boolean;\n}\n\n/** A band of cost: the first band whose `below` the cost is under applies, or the last one. */\nexport interface EstimatorBand {\n below?: number;\n /** For a team band, how many engineers. */\n engineers?: number;\n /** For a way-of-working band, what it is called. */\n text?: string;\n}\n\n/** One part of the timeline. The part with no share takes the weeks the others leave. */\nexport interface EstimatorPhase {\n label: string;\n /** Its share of the weeks, such as 0.1. At least one week either way. */\n share?: number;\n}\n\n/** What an estimate came to, as the `impakt-estimate` event carries it. */\nexport interface EstimateResult {\n low: number;\n high: number;\n weeks: number;\n engineers: number;\n way: string;\n summary: string;\n /** The ids picked for each question. */\n answers: Record<string, string[]>;\n}\n\nconst sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0);\nconst bandFor = (bands: EstimatorBand[], cost: number): EstimatorBand | undefined =>\n bands.find((b) => typeof b.below === 'number' && cost < b.below) ?? bands.at(-1);\n\n/** The arithmetic, apart from the element so it can be checked on its own. */\nexport function estimate(\n questions: EstimatorQuestion[],\n answers: Record<string, string[]>,\n rules: { low: number; high: number; minWeeks: number; teams: EstimatorBand[]; ways: EstimatorBand[] },\n): { cost: number; low: number; high: number; weeks: number; engineers: number; way: string } {\n const chosen = questions.flatMap((q) => (answers[q.id] ?? []).flatMap((id) => q.choices.filter((c) => c.id === id)));\n let cost = sum(chosen.map((c) => c.cost ?? 0));\n let weeks = sum(chosen.map((c) => c.weeks ?? 0));\n for (const c of chosen) {\n cost *= c.costFactor ?? 1;\n weeks *= c.weeksFactor ?? 1;\n }\n const engineers = (bandFor(rules.teams, cost)?.engineers ?? 1) + sum(chosen.map((c) => c.engineers ?? 0));\n return {\n cost,\n low: Math.round(cost * rules.low),\n high: Math.round(cost * rules.high),\n weeks: Math.max(rules.minWeeks, Math.round(weeks)),\n engineers,\n way: bandFor(rules.ways, cost)?.text ?? '',\n };\n}\n\n/** The weeks each part of the timeline takes, adding up to the whole. */\nexport function phaseWeeks(phases: EstimatorPhase[], weeks: number): number[] {\n const fixed = phases.map((p) => (typeof p.share === 'number' ? Math.max(1, Math.round(weeks * p.share)) : 0));\n const rest = Math.max(1, weeks - sum(fixed));\n return phases.map((p, i) => (typeof p.share === 'number' ? fixed[i]! : rest));\n}\n\n/**\n * Asks a few questions one at a time and keeps a budget beside them that moves\n * with every answer, then shows the estimate: the range, the weeks, how long\n * each part takes, the team and the way of working. The visitor can send the\n * estimate on to a contact page, where a message box can start with it.\n *\n * **`layout=\"all\"` asks every question at once.** Each is a numbered row of\n * square chips (`impakt-chip-group`, radios for one answer and checkboxes for\n * several) under a monospace label such as \"01 · What are you building?\", and\n * the result sits beside them as an ink panel: the budget in the accent, the\n * weeks to a first release, each part of the timeline as a row, a full-width\n * button to send it and the suggested way of working. The note goes under the\n * chips on a wide screen and under the panel on a phone, where the chips and\n * the panel stack with no gap. The wizard stays the default.\n *\n * @category form\n * @icon calculator\n * @fires {CustomEvent<EstimateResult>} impakt-estimate - When the estimate is sent on. The result is in detail.\n */\nexport class ImpaktEstimator extends ImpaktElement {\n static properties = {\n questions: { type: Array },\n teams: { type: Array },\n ways: { type: Array },\n phases: { type: Array },\n low: { type: Number },\n high: { type: Number },\n minWeeks: { type: Number, attribute: 'min-weeks' },\n currency: { type: String },\n unit: { type: Number },\n intro: { type: String },\n budgetLabel: { type: String, attribute: 'budget-label' },\n resultHeading: { type: String, attribute: 'result-heading' },\n teamText: { type: String, attribute: 'team-text' },\n teamTextOne: { type: String, attribute: 'team-text-one' },\n note: { type: String },\n contactHref: { type: String, attribute: 'contact-href' },\n sendLabel: { type: String, attribute: 'send-label' },\n layout: { type: String, reflect: true },\n wayLabel: { type: String, attribute: 'way-label' },\n headingLevel: { type: Number, attribute: 'heading-level' },\n spaceAbove: { type: String, reflect: true, attribute: 'space-above' },\n spaceBelow: { type: String, reflect: true, attribute: 'space-below' },\n };\n\n /** The questions, in the order they are asked. */\n declare questions: EstimatorQuestion[];\n /** How many engineers each band of cost needs. */\n declare teams: EstimatorBand[];\n /** The way of working for each band of cost. */\n declare ways: EstimatorBand[];\n /** The parts of the timeline, in order. */\n declare phases: EstimatorPhase[];\n /** The low end of the range, as a share of the cost. */\n declare low: number;\n /** The high end of the range, as a share of the cost. */\n declare high: number;\n /** The fewest weeks an estimate says. */\n declare minWeeks: number;\n /** The currency the cost is in, such as GBP. */\n declare currency: string;\n /** What one unit of cost is worth, such as 1000 when the costs are in thousands. */\n declare unit: number;\n /** Beside the budget before anything is picked, such as \"Start by telling us what you are building.\" */\n declare intro: string;\n declare budgetLabel: string;\n declare resultHeading: string;\n /** The team, with {n} for the number of engineers. */\n declare teamText: string;\n /** The team when it has one engineer. */\n declare teamTextOne: string;\n /** A line under the result, such as how accurate it is. */\n declare note: string;\n /** Where the estimate is sent on to. With none, there is no button to send it. */\n declare contactHref: string;\n declare sendLabel: string;\n /** `wizard` asks one question at a time. `all` asks every question at once, with the result beside them as an ink panel. */\n declare layout: 'wizard' | 'all';\n /** With `all`: the words before the way of working under the panel, such as \"Suggested way to work\". */\n declare wayLabel: string;\n /** The level of each question's heading. */\n declare headingLevel: number;\n declare spaceAbove: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n declare spaceBelow: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n private at = 0;\n private answers: Record<string, string[]> = {};\n private tip = '';\n private copied = '';\n private started = false;\n\n constructor() {\n super();\n this.questions = [];\n this.teams = [];\n this.ways = [];\n this.phases = [];\n this.low = 0.85;\n this.high = 1.25;\n this.minWeeks = 1;\n this.currency = 'GBP';\n this.unit = 1;\n this.intro = '';\n this.budgetLabel = 'Indicative budget';\n this.resultHeading = 'Your estimate';\n this.teamText = '{n} engineers';\n this.teamTextOne = '1 engineer';\n this.note = '';\n this.contactHref = '';\n this.sendLabel = 'Send this to us';\n this.layout = 'wizard';\n this.wayLabel = '';\n this.headingLevel = 2;\n this.spaceAbove = 'none';\n this.spaceBelow = 'none';\n }\n\n static styles = [\n ...ImpaktElement.styles,\n spaceAround,\n focusRing,\n css`\n :host { display: block; container-type: inline-size; }\n [hidden] { display: none !important; }\n .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: ${space(10)}; align-items: start; }\n .mono { font-family: ${t.fontMono}; font-size: ${fontSize('xs')}; letter-spacing: 0.04em; text-transform: uppercase; color: ${t.textMuted}; margin: 0; }\n .sr-only { ${visuallyHidden} }\n\n .progress { display: grid; gap: ${space(2)}; margin-block-end: ${space(6)}; }\n .bar { block-size: 4px; border-radius: 2px; background: color-mix(in srgb, currentColor 12%, transparent); overflow: hidden; }\n .bar i { display: block; block-size: 100%; background: ${t.brand}; transition: inline-size 300ms ease; }\n\n fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }\n legend { padding: 0; margin-block-end: ${space(2)}; }\n .q { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; ${type('3xl')} letter-spacing: ${t.trackingTight}; color: ${t.textHeading}; outline: none; }\n .hint { margin: 0 0 ${space(6)}; color: ${t.textMuted}; }\n\n .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(3)}; }\n .choices.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n .choice { position: relative; display: grid; gap: ${space(1)}; align-content: start; padding: ${space(4)}; border: ${t.borderThin} solid ${t.border}; border-radius: ${t.radiusLg}; background: ${t.surfaceCard}; cursor: pointer; transition: border-color 120ms ease, background 120ms ease; }\n .choice:hover { border-color: ${t.borderStrong}; }\n .choice input { ${visuallyHidden} }\n .choice:has(input:checked) { border-color: ${t.brand}; box-shadow: inset 0 0 0 1px ${t.brand}; background: ${t.brandSubtle}; }\n .choice:has(input:focus-visible) { box-shadow: ${t.focusShadow}; }\n .many .choice { padding: ${space(3)}; }\n .label { font-weight: ${fontWeight('semibold')}; }\n .small { ${type('sm')} color: ${t.textMuted}; }\n /* A tick for a picked feature, drawn in the corner. */\n .many .choice:has(input:checked)::after { content: '✓'; position: absolute; inset-block-start: ${space(2)}; inset-inline-end: ${space(3)}; color: ${t.brand}; font-weight: ${fontWeight('bold')}; }\n\n .scale { display: grid; gap: ${space(3)}; }\n .scale input { inline-size: 100%; accent-color: ${t.brand}; ${targetSize} }\n .ticks { display: flex; justify-content: space-between; ${type('sm')} color: ${t.textMuted}; }\n .ticks span[aria-current] { color: ${t.text}; font-weight: ${fontWeight('semibold')}; }\n .now { margin: 0; }\n\n .nav { display: flex; gap: ${space(3)}; margin-block-start: ${space(8)}; }\n button, .send { ${targetSize} display: inline-flex; align-items: center; justify-content: center; gap: ${space(2)}; padding: ${space(2.5)} ${space(5)}; border-radius: ${t.radiusLg}; font: inherit; font-weight: ${fontWeight('semibold')}; cursor: pointer; text-decoration: none; border: ${t.borderThin} solid transparent; }\n .primary, .send { background: ${t.brand}; color: ${t.onBrand}; }\n .primary:hover, .send:hover { background: ${t.brandHover}; }\n /* The arrow slides forward when its button or link is pointed at or focused (impkt-web#51), 4px for Impakt and not at all for a brand that derives it. */\n .go { display: inline-block; flex: none; transition: translate ${R.arrowDuration} ${R.arrowEasing}; }\n :is(a, button):is(:hover, :focus-visible) .go { translate: ${R.arrowDistance} 0; }\n @media (prefers-reduced-motion: reduce) { .go { transition: none; } }\n .secondary { background: transparent; color: ${t.text}; border-color: ${t.borderStrong}; }\n .secondary:hover { background: ${t.surfaceSubtle}; }\n\n .panel { position: sticky; inset-block-start: ${space(6)}; overflow: hidden; isolation: isolate; padding: ${space(8)}; border-radius: ${t.radiusXl}; background: ${t.surfaceCard}; box-shadow: ${t.shadowMd}; display: grid; gap: ${space(2)}; }\n /* The glow behind the budget grows as the product does. */\n .glow { position: absolute; z-index: -1; inset-block-start: -40%; inset-inline-end: -30%; inline-size: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, ${unsafeCSS(toneOf(1, 0))} 45%, transparent), color-mix(in srgb, ${unsafeCSS(toneOf(2, 1))} 25%, transparent) 45%, transparent 70%); transform: scale(var(--s, 0.7)); transform-origin: 70% 30%; transition: transform 500ms cubic-bezier(.2, .8, .2, 1); pointer-events: none; }\n .range { margin: 0; font-family: ${t.fontHeading}; font-weight: ${fontWeight('bold')}; font-size: ${fontSize('5xl')}; line-height: 1; letter-spacing: ${t.trackingTight}; color: ${t.textHeading}; }\n .weeks { margin: 0; ${type('lg')} }\n .tip { margin: ${space(4)} 0 0; padding-block-start: ${space(4)}; border-block-start: 1px solid color-mix(in srgb, currentColor 15%, transparent); color: ${t.textMuted}; }\n\n .result { display: grid; gap: ${space(6)}; }\n .summary { margin: 0; ${type('xl')} text-wrap: pretty; }\n .phases { display: flex; gap: 3px; block-size: 14px; border-radius: 7px; overflow: hidden; }\n .phases i { display: block; }\n .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: ${space(2)} ${space(5)}; }\n .legend li { display: inline-flex; align-items: center; gap: ${space(2)}; }\n .legend li::before { content: ''; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--c); }\n dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: ${space(4)}; }\n dt { margin: 0 0 ${space(1)}; }\n dd { margin: 0; font-weight: ${fontWeight('semibold')}; }\n .actions { display: flex; flex-wrap: wrap; gap: ${space(3)}; }\n .note { margin: 0; ${type('sm')} color: ${t.textMuted}; }\n .status { margin: 0; ${type('sm')} }\n\n @container (max-width: 48rem) {\n .wrap { grid-template-columns: minmax(0, 1fr); gap: ${space(8)}; }\n /* Not sticky once the panel is under the questions, but still the glow's containing block, so the panel clips it\n and it never widens the page (1.4.10). */\n .panel { position: relative; inset-block-start: auto; }\n .choices.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n }\n @container (max-width: 30rem) {\n .choices { grid-template-columns: minmax(0, 1fr); }\n .range { font-size: ${fontSize('4xl')}; }\n }\n /*\n * layout=\"all\": every question at once, and the result as an ink panel beside them, as the Estimator component\n * (10:544) draws them: the options 642px wide and the budget 430px, 10px apart. The options are 32px inside with\n * their parts 16px apart; the budget is 32px inside with its parts 14px apart, its lines 12px under their rules.\n */\n .all { --accent: ${token('color.accent.default', '#ffd43b')}; --on-accent: ${token('color.accent.on', '#111111')}; --gap: 14px; display: grid; grid-template-columns: minmax(0, 642fr) minmax(0, 430fr); grid-template-areas: 'questions panel' 'note panel'; grid-template-rows: auto 1fr; column-gap: ${space(2.5)}; align-items: stretch; }\n .all .questions { grid-area: questions; display: grid; align-content: start; gap: ${space(4)}; padding: ${space(8)} ${space(8)} 0; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.text}; border-block-end: 0; }\n .all .questions impakt-chip-group { margin: 0; --impakt-chip-group-gap: ${space(2)}; }\n .all .questions impakt-chip-group::part(label) { margin-block-end: ${space(4)}; line-height: 1.4; }\n .all .foot { grid-area: note; padding: ${space(4)} ${space(8)} ${space(8)}; background: ${t.surfaceCard}; border: ${t.borderThin} solid ${t.text}; border-block-start: 0; }\n /* The note in G2 Body S, 14px at 1.4. */\n .all .note { font-size: 0.875rem; line-height: 1.4; }\n .all .ink { grid-area: panel; display: flex; flex-direction: column; gap: var(--gap); padding: ${space(8)}; background: ${t.text}; color: ${t.surfaceCard}; --muted: color-mix(in srgb, ${t.surfaceCard} 72%, ${t.text}); --line: color-mix(in srgb, ${t.surfaceCard} 18%, ${t.text}); }\n .all .ink .mono { color: var(--muted); font-size: 0.6875rem; font-weight: ${fontWeight('medium')}; line-height: 1.4; letter-spacing: 0.06em; }\n /* The accent on ink only where the theme says the pair reads; in dark the panel turns to paper and the range keeps its words. Display M: 52px at 1.04 on the 1080px estimator, 40px tall on a phone. */\n .all .ink .range { color: var(--impakt-color-accent-on-ink, var(--impakt-site-menu-current, currentColor)); font-size: clamp(2.25rem, 11cqi, 3.25rem); font-weight: ${fontWeight('semibold')}; line-height: 1.04; letter-spacing: -0.04em; }\n .all .ink .weeks { font-size: 1rem; line-height: 1.45; }\n .all .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }\n .all .rows li { display: flex; justify-content: space-between; align-items: baseline; gap: ${space(4)}; padding-block-start: ${space(3)}; border-block-start: ${t.borderThin} solid var(--line); font-size: 0.875rem; line-height: 1.4; }\n .all .rows .length { font-family: ${t.fontMono}; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); white-space: nowrap; }\n .all .cta { ${targetSize} display: flex; align-items: center; justify-content: space-between; gap: ${space(4)}; box-sizing: border-box; min-block-size: 47px; padding: 14px ${space(5)}; font-size: 1rem; line-height: 1.2; font-weight: ${fontWeight('medium')}; color: var(--on-accent); background: var(--accent); text-decoration: none; }\n .all .cta:hover { background: color-mix(in srgb, var(--accent) 88%, #ffffff); }\n .all .cta:focus-visible { outline: none; box-shadow: 0 0 0 2px ${t.text}, 0 0 0 4px ${t.surfaceCard}; }\n .all .way { margin: 0; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }\n /* On a phone (15:943, 15:974): the options 20px inside with their parts 14px apart, the budget 24 by 20 inside with its parts 12px apart, its lines 11px under their rules, and the note under the budget's action. */\n @container (max-width: 48rem) {\n .all { --gap: 12px; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'questions' 'panel'; grid-template-rows: auto; column-gap: 0; }\n .all .questions { gap: 14px; padding: ${space(5)}; border-block-end: ${t.borderThin} solid ${t.text}; }\n .all .questions impakt-chip-group::part(label) { margin-block-start: 0; margin-block-end: 14px; }\n .all .foot { display: none; }\n .all .ink { padding: ${space(6)} ${space(5)}; }\n .all .rows li { padding-block-start: 11px; }\n }\n .all .ink .note { display: none; color: var(--muted); }\n @container (max-width: 48rem) { .all .ink .note { display: block; } }\n @media (forced-colors: active) {\n .all .ink { border: 1px solid CanvasText; }\n .all .cta { border: 1px solid ButtonText; }\n .choice:has(input:checked) { outline: 3px solid Highlight; }\n .bar i, .phases i, .legend li::before { background: CanvasText !important; }\n .glow { display: none; }\n }\n `,\n ];\n\n /** The answers each question starts with. */\n private reset(): void {\n this.answers = Object.fromEntries(\n (this.questions ?? []).map((q) => {\n const ids = (q.start ?? []).filter((id) => q.choices.some((c) => c.id === id));\n if (q.kind === 'many') return [q.id, ids];\n return [q.id, [ids[0] ?? q.choices[0]?.id].filter((x): x is string => Boolean(x))];\n }),\n );\n this.at = 0;\n this.tip = '';\n this.copied = '';\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n if (changed.has('questions') || !this.started) {\n this.reset();\n this.started = true;\n }\n }\n\n private get rules() {\n return { low: this.low, high: this.high, minWeeks: this.minWeeks, teams: this.teams ?? [], ways: this.ways ?? [] };\n }\n\n private money(n: number): string {\n try {\n return new Intl.NumberFormat(pageLocale(this), {\n style: 'currency',\n currency: this.currency || 'GBP',\n notation: 'compact',\n maximumFractionDigits: 0,\n }).format(n * (this.unit || 1));\n } catch {\n return String(n * (this.unit || 1));\n }\n }\n\n private listOf(words: string[]): string {\n try {\n return new Intl.ListFormat(pageLocale(this), { type: 'conjunction' }).format(words);\n } catch {\n return words.join(', ');\n }\n }\n\n private weeksWord(n: number): string {\n return n === 1 ? say('{n} week', { n }) : say('{n} weeks', { n });\n }\n\n /** The largest the budget can be, so the glow is full size at it. */\n private get most(): number {\n const qs = this.questions ?? [];\n const answers = Object.fromEntries(\n qs.map((q) => {\n if (q.kind === 'many') return [q.id, q.choices.map((c) => c.id)];\n const best = [...q.choices].sort((a, b) => (b.cost ?? 0) * (b.costFactor ?? 1) - (a.cost ?? 0) * (a.costFactor ?? 1))[0];\n return [q.id, best ? [best.id] : []];\n }),\n );\n return estimate(qs, answers, this.rules).high || 1;\n }\n\n private summaryOf(r: ReturnType<typeof estimate>): string {\n const qs = this.questions ?? [];\n const one = qs.find((q) => q.kind === 'one');\n const thing = one ? one.choices.find((c) => c.id === this.answers[one.id]?.[0]) : undefined;\n const many = qs\n .filter((q) => q.kind === 'many' && q.inSummary !== false)\n .flatMap((q) =>\n (this.answers[q.id] ?? []).map((id) => {\n const c = q.choices.find((x) => x.id === id);\n return c ? c.phrase || c.label : id;\n }),\n );\n const name = thing ? thing.phrase || thing.label : '';\n const first = !name\n ? ''\n : many.length\n ? say('You are building {thing} with {list}.', { thing: name, list: this.listOf(many) })\n : say('You are building {thing}.', { thing: name });\n const rest = say('Expect {range} and about {weeks} to a first release.', { range: this.rangeOf(r), weeks: this.weeksWord(r.weeks) });\n return first ? `${first} ${rest}` : rest;\n }\n\n private rangeOf(r: { low: number; high: number }): string {\n return say('{low} to {high}', { low: this.money(r.low), high: this.money(r.high) });\n }\n private teamOf(n: number): string {\n return n === 1 ? this.teamTextOne : this.teamText.replace('{n}', String(n));\n }\n\n private pick(q: EstimatorQuestion, choice: EstimatorChoice, on: boolean): void {\n const now = this.answers[q.id] ?? [];\n this.answers = {\n ...this.answers,\n [q.id]: q.kind === 'many' ? (on ? [...now.filter((id) => id !== choice.id), choice.id] : now.filter((id) => id !== choice.id)) : [choice.id],\n };\n if (on && choice.tip) this.tip = choice.tip;\n this.requestUpdate();\n }\n\n private go(to: number): void {\n const last = (this.questions ?? []).length;\n this.at = Math.max(0, Math.min(last, to));\n this.copied = '';\n this.requestUpdate();\n void this.updateComplete.then(() => (this.renderRoot.querySelector('.current .q') as HTMLElement | null)?.focus({ preventScroll: true }));\n }\n\n private result(): EstimateResult {\n const r = estimate(this.questions ?? [], this.answers, this.rules);\n return {\n low: r.low * (this.unit || 1),\n high: r.high * (this.unit || 1),\n weeks: r.weeks,\n engineers: r.engineers,\n way: r.way,\n summary: this.textOf(r),\n answers: this.answers,\n };\n }\n\n /** The estimate as words to send or copy. */\n private textOf(r: ReturnType<typeof estimate>): string {\n const parts = [this.summaryOf(r), `${this.teamOf(r.engineers)}.`];\n if (r.way) parts.push(`${r.way}.`);\n const picked = (this.questions ?? [])\n .filter((q) => q.short && q.kind !== 'many')\n .map((q) => {\n const c = q.choices.find((x) => x.id === this.answers[q.id]?.[0]);\n return c ? `${q.short}: ${c.label}.` : '';\n })\n .filter(Boolean);\n const many = (this.questions ?? [])\n .filter((q) => q.short && q.kind === 'many' && q.inSummary === false)\n .map((q) => {\n const labels = (this.answers[q.id] ?? []).map((id) => q.choices.find((x) => x.id === id)?.label ?? id);\n return labels.length ? `${q.short}: ${this.listOf(labels)}.` : '';\n })\n .filter(Boolean);\n return [...parts, ...many, ...picked].join(' ');\n }\n\n private send(e: Event): void {\n const result = this.result();\n try {\n sessionStorage.setItem('impakt.estimate', result.summary);\n } catch {\n /* storage can be blocked; the link still goes */\n }\n const go = this.dispatchEvent(new CustomEvent('impakt-estimate', { detail: result, bubbles: true, composed: true, cancelable: true }));\n if (!go) e.preventDefault();\n }\n\n private async copy(): Promise<void> {\n const text = this.result().summary;\n try {\n await navigator.clipboard.writeText(text);\n this.copied = say('Summary copied.');\n } catch {\n this.copied = say('Copying is blocked here. Select the summary above instead.');\n }\n this.requestUpdate();\n }\n\n private heading(text: string): TemplateResult {\n const l = Math.min(Math.max(this.headingLevel || 2, 2), 6);\n return html`<div class=\"q\" role=\"heading\" aria-level=${l} tabindex=\"-1\">${text}</div>`;\n }\n\n private renderQuestion(q: EstimatorQuestion, i: number): TemplateResult {\n const picked = this.answers[q.id] ?? [];\n const current = i === this.at;\n if (q.kind === 'scale') {\n const index = Math.max(\n 0,\n q.choices.findIndex((c) => c.id === picked[0]),\n );\n const chosen = q.choices[index];\n return html`<fieldset class=${current ? 'current' : ''} ?hidden=${!current}>\n <legend>${this.heading(q.heading)}</legend>\n ${q.hint ? html`<p class=\"hint\">${q.hint}</p>` : nothing}\n <div class=\"scale\">\n <input type=\"range\" min=\"0\" max=${Math.max(0, q.choices.length - 1)} step=\"1\" .value=${String(index)} aria-label=${q.heading} aria-valuetext=${chosen?.label ?? ''}\n @input=${(e: Event) => {\n const c = q.choices[Number((e.target as HTMLInputElement).value)];\n if (c) this.pick(q, c, true);\n }}>\n <div class=\"ticks\" aria-hidden=\"true\">${q.choices.map((c, k) => html`<span aria-current=${k === index ? 'true' : nothing}>${c.label}</span>`)}</div>\n ${chosen?.hint ? html`<p class=\"now\">${chosen.hint}</p>` : nothing}\n </div>\n </fieldset>`;\n }\n const many = q.kind === 'many';\n return html`<fieldset class=${current ? 'current' : ''} ?hidden=${!current}>\n <legend>${this.heading(q.heading)}</legend>\n ${q.hint ? html`<p class=\"hint\">${q.hint}</p>` : nothing}\n <div class=\"choices ${many ? 'many' : ''}\">\n ${q.choices.map(\n (c) => html`<label class=\"choice\">\n <input type=${many ? 'checkbox' : 'radio'} name=${`${this.uid}-${q.id}`} value=${c.id} .checked=${picked.includes(c.id)}\n @change=${(e: Event) => this.pick(q, c, (e.target as HTMLInputElement).checked)}>\n <span class=\"label\">${c.label}</span>\n ${c.hint ? html`<span class=\"small\">${c.hint}</span>` : nothing}\n </label>`,\n )}\n </div>\n </fieldset>`;\n }\n\n private renderResult(r: ReturnType<typeof estimate>): TemplateResult {\n const weeks = phaseWeeks(this.phases ?? [], r.weeks);\n const current = this.at === (this.questions ?? []).length;\n return html`<div class=\"result ${current ? 'current' : ''}\" ?hidden=${!current}>\n ${this.heading(this.resultHeading)}\n <p class=\"summary\">${this.summaryOf(r)}</p>\n ${\n (this.phases ?? []).length\n ? html`\n <div class=\"phases\" aria-hidden=\"true\">${(this.phases ?? []).map((_, i) => html`<i style=${`flex-grow:${weeks[i]};background:${toneOf(undefined, i)}`}></i>`)}</div>\n <ul class=\"legend\">${(this.phases ?? []).map((p, i) => html`<li style=${`--c:${toneOf(undefined, i)}`}>${p.label} <b>${this.weeksWord(weeks[i]!)}</b></li>`)}</ul>`\n : nothing\n }\n <dl>\n <div><dt class=\"mono\">${say('Your team')}</dt><dd>${this.teamOf(r.engineers)}</dd></div>\n ${r.way ? html`<div><dt class=\"mono\">${say('Way of working')}</dt><dd>${r.way}</dd></div>` : nothing}\n </dl>\n <div class=\"actions\">\n ${this.contactHref ? html`<a class=\"send\" href=${this.contactHref} @click=${(e: Event) => this.send(e)}>${this.sendLabel} <span class=\"go\" aria-hidden=\"true\">→</span></a>` : nothing}\n <button type=\"button\" class=\"secondary\" @click=${() => this.copy()}>${say('Copy summary')}</button>\n <button type=\"button\" class=\"secondary\" @click=${() => {\n this.reset();\n this.go(0);\n }}>${say('Start again')}</button>\n </div>\n <p class=\"status\" role=\"status\">${this.copied}</p>\n ${this.note ? html`<p class=\"note\">${this.note}</p>` : nothing}\n </div>`;\n }\n\n /** Every question at once, as rows of chips, with the result beside them in ink. */\n private renderAll(r: ReturnType<typeof estimate>): TemplateResult {\n const qs = this.questions ?? [];\n const weeks = phaseWeeks(this.phases ?? [], r.weeks);\n const arrow = html`<svg class=\"go\" viewBox=\"0 0 20 12\" width=\"20\" height=\"12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M0 6h18M13 1l5 5-5 5\" /></svg>`;\n return html`<div class=\"all\">\n <div class=\"questions\" part=\"questions\">\n ${qs.map((q, i) => {\n const picked = this.answers[q.id] ?? [];\n const many = q.kind === 'many';\n const options = q.choices.map((c) => ({ value: c.id, label: c.label }));\n return html`<impakt-chip-group look=\"site\" part=\"question\" .label=${`${String(i + 1).padStart(2, '0')} · ${q.heading}`} .description=${q.hint ?? ''}\n .options=${options} ?multiple=${many} .values=${many ? picked : []} .value=${many ? '' : (picked[0] ?? '')}\n @impakt-change=${(e: CustomEvent<{ value: string }>) => this.chipsChanged(q, e)}></impakt-chip-group>`;\n })}\n </div>\n <aside class=\"ink\" part=\"panel\">\n <p class=\"mono\">${this.budgetLabel}</p>\n <p class=\"range\" aria-live=\"polite\" aria-atomic=\"true\">${this.rangeOf(r)}</p>\n <p class=\"weeks\">${say('About {weeks} to a first release', { weeks: this.weeksWord(r.weeks) })}</p>\n ${\n (this.phases ?? []).length\n ? html`<ul class=\"rows\" role=\"list\">${(this.phases ?? []).map((phase, i) => html`<li><span>${phase.label}</span><span class=\"length\">${this.weeksWord(weeks[i]!)}</span></li>`)}</ul>`\n : nothing\n }\n ${this.contactHref ? html`<a class=\"cta\" href=${this.contactHref} part=\"send\" @click=${(e: Event) => this.send(e)}><span>${this.sendLabel}</span>${arrow}</a>` : nothing}\n ${r.way ? html`<p class=\"way\">${this.wayLabel || say('Way of working')}: ${r.way}</p>` : nothing}\n ${this.note ? html`<p class=\"note\">${this.note}</p>` : nothing}\n </aside>\n ${this.note ? html`<div class=\"foot\"><p class=\"note\">${this.note}</p></div>` : nothing}\n </div>`;\n }\n\n /** A row of chips changed: one answer, or the set of them. */\n private chipsChanged(q: EstimatorQuestion, e: CustomEvent<{ value: string }>): void {\n const group = e.target as HTMLElement & { values?: string[] };\n const ids = q.kind === 'many' ? [...(group.values ?? [])] : [e.detail?.value].filter((x): x is string => Boolean(x));\n this.answers = { ...this.answers, [q.id]: ids };\n const last = ids.at(-1);\n const tip = q.choices.find((c) => c.id === last)?.tip;\n if (tip) this.tip = tip;\n this.requestUpdate();\n }\n\n render(): TemplateResult {\n const qs = this.questions ?? [];\n if (this.layout === 'all') return this.renderAll(estimate(qs, this.answers, this.rules));\n const total = qs.length;\n const r = estimate(qs, this.answers, this.rules);\n const done = this.at >= total;\n const scale = (0.6 + Math.min(1, r.high / this.most) * 1.1).toFixed(2);\n return html`<div class=\"wrap\">\n <div>\n <div class=\"progress\">\n <p class=\"mono\">${done ? this.resultHeading : say('Step {step} of {steps}', { step: this.at + 1, steps: total })}</p>\n <div class=\"bar\" aria-hidden=\"true\"><i style=${`inline-size:${total ? (done ? 100 : ((this.at + 1) / (total + 1)) * 100) : 0}%`}></i></div>\n </div>\n ${qs.map((q, i) => this.renderQuestion(q, i))}\n ${this.renderResult(r)}\n ${\n done\n ? nothing\n : html`<div class=\"nav\">\n ${this.at > 0 ? html`<button type=\"button\" class=\"secondary\" @click=${() => this.go(this.at - 1)}>${say('Back')}</button>` : nothing}\n <button type=\"button\" class=\"primary\" @click=${() => this.go(this.at + 1)}>${this.at === total - 1 ? say('See my estimate') : say('Next')} <span class=\"go\" aria-hidden=\"true\">→</span></button>\n </div>`\n }\n </div>\n <aside class=\"panel\" part=\"panel\" style=${`--s:${scale}`}>\n <div class=\"glow\" aria-hidden=\"true\"></div>\n <p class=\"mono\">${this.budgetLabel}</p>\n <p class=\"range\" aria-live=\"polite\" aria-atomic=\"true\">${this.rangeOf(r)}</p>\n <p class=\"weeks\">${say('About {weeks} to a first release', { weeks: this.weeksWord(r.weeks) })}</p>\n <p class=\"tip\" aria-live=\"polite\">${this.tip || this.intro}</p>\n </aside>\n </div>`;\n }\n}\n\ncustomElements.define('impakt-estimator', ImpaktEstimator);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'impakt-estimator': ImpaktEstimator;\n }\n}\n"],"mappings":";AAUA,SAAS,KAAK,MAAM,SAAS,iBAAsC;AACnE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoEP,IAAM,MAAM,CAAC,OAAiB,GAAG,OAAO,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC;AAC1D,IAAM,UAAU,CAAC,OAAwB,SACvC,MAAM,KAAK,CAAC,MAAM,OAAO,EAAE,UAAU,YAAY,OAAO,EAAE,KAAK,KAAK,MAAM,GAAG,EAAE;AAG1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C;AAAA,4CAC1D,KAAK,OAAO,KAAK,KAAK;AAAA;AAAA;AAAA,EAGhE;AACF;AAEA,eAAe,OAAO,oBAAoB,eAAe;","names":[]}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
|
|
17
17
|
// packages/blocks/src/components/g2-case.ts
|
|
18
18
|
import { css, html, nothing, svg } from "lit";
|
|
19
|
-
import { ImpaktElement, fontWeight, say, space, t, visuallyHidden } from "@atomic-ui/ui";
|
|
19
|
+
import { ImpaktElement, R, fontWeight, revealAt, revealStyles, say, space, t, visuallyHidden } from "@atomic-ui/ui";
|
|
20
20
|
var STEP = 40;
|
|
21
21
|
var TOP = 40;
|
|
22
22
|
var ImpaktProcessLine = class extends ImpaktElement {
|
|
@@ -71,7 +71,16 @@ var ImpaktProcessLine = class extends ImpaktElement {
|
|
|
71
71
|
li::after { background: CanvasText; }
|
|
72
72
|
.flag { border: 1px solid CanvasText; }
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
/* Line draw (impkt-web#51): the line strokes on left to right, the points and their words appear in order, and the flagged points fill last. */
|
|
75
|
+
:host([data-motion]) .visual svg { animation: ik-line-draw ${R.line} ${R.shape} ${revealAt(0)} both; }
|
|
76
|
+
:host([data-motion]) .lineLabel { animation: ik-reveal-type ${R.type} ${R.arrive} ${revealAt(0)} both; }
|
|
77
|
+
:host([data-motion]) .ring { animation: ik-reveal-mark ${R.mark} ${R.arrive} ${revealAt()} both; }
|
|
78
|
+
:host([data-motion]) :is(.vlabel, .visual .flag) { animation: ik-reveal-fade ${R.mark} ${R.arrive} ${revealAt()} both; }
|
|
79
|
+
:host([data-motion]) .ring.flagged { animation: ik-reveal-mark ${R.mark} ${R.arrive} ${revealAt()} both, ik-line-fill ${R.mark} ${R.arrive} calc(var(--ik-reveal-delay, 0ms) + max(var(--n, 0) * ${R.stagger}, ${R.line})) both; }
|
|
80
|
+
@keyframes ik-line-draw { from { clip-path: inset(-12px 100% -12px -12px); } to { clip-path: inset(-12px -12px -12px -12px); } }
|
|
81
|
+
@keyframes ik-line-fill { from { background: ${band}; } }
|
|
82
|
+
`,
|
|
83
|
+
revealStyles
|
|
75
84
|
];
|
|
76
85
|
}
|
|
77
86
|
render() {
|
|
@@ -82,23 +91,42 @@ var ImpaktProcessLine = class extends ImpaktElement {
|
|
|
82
91
|
const maxDepth = Math.max(...nodes.map(depthOf));
|
|
83
92
|
const height = Math.round(TOP + maxDepth * STEP + 55);
|
|
84
93
|
const xs = nodes.map((node, i) => {
|
|
85
|
-
const
|
|
86
|
-
return node.at != null && Number.isFinite(
|
|
94
|
+
const at2 = Number(node.at);
|
|
95
|
+
return node.at != null && Number.isFinite(at2) ? Math.max(0, Math.min(1, at2)) : (i + 0.5) / n;
|
|
87
96
|
});
|
|
88
97
|
const pts = nodes.map((node, i) => ({ x: xs[i] * 1e3, y: TOP + depthOf(node) * STEP }));
|
|
98
|
+
const run = pts.map((p, i) => {
|
|
99
|
+
let k = 1;
|
|
100
|
+
for (let j = i - 1; j >= 0 && pts[j].y === p.y; j--) k++;
|
|
101
|
+
for (let j = i + 1; j < n && pts[j].y === p.y; j++) k++;
|
|
102
|
+
return k;
|
|
103
|
+
});
|
|
104
|
+
const BEND = 40 / 1080 * 1e3;
|
|
105
|
+
const at = (x) => Math.round(x * 100) / 100;
|
|
106
|
+
const bend = (fromX, fromY, toX, toY) => {
|
|
107
|
+
const mid = at((fromX + toX) / 2);
|
|
108
|
+
return ` L${at(fromX)} ${fromY} C${mid} ${fromY} ${mid} ${toY} ${at(toX)} ${toY}`;
|
|
109
|
+
};
|
|
89
110
|
let d = `M0 ${pts[0].y} L${pts[0].x} ${pts[0].y}`;
|
|
90
111
|
for (let i = 1; i < n; i++) {
|
|
91
112
|
const a = pts[i - 1];
|
|
92
113
|
const b = pts[i];
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
d +=
|
|
101
|
-
|
|
114
|
+
const gap = b.x - a.x;
|
|
115
|
+
if (a.y === b.y) {
|
|
116
|
+
d += ` L${b.x} ${b.y}`;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (a.y > TOP && b.y > TOP) {
|
|
120
|
+
const w2 = Math.min(BEND, gap / 2);
|
|
121
|
+
d += bend(a.x, a.y, a.x + w2, TOP) + bend(b.x - w2, TOP, b.x, b.y);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const w = Math.min(BEND, gap);
|
|
125
|
+
const down = b.y > a.y;
|
|
126
|
+
const lone = down ? run[i] === 1 : run[i - 1] === 1;
|
|
127
|
+
const atStart = down ? !lone : lone;
|
|
128
|
+
d += atStart ? bend(a.x, a.y, a.x + w, b.y) : bend(b.x - w, a.y, b.x, b.y);
|
|
129
|
+
d += ` L${b.x} ${b.y}`;
|
|
102
130
|
}
|
|
103
131
|
d += ` L1000 ${pts[n - 1].y}`;
|
|
104
132
|
const pct = (i) => `${xs[i] * 100}%`;
|
|
@@ -108,17 +136,17 @@ var ImpaktProcessLine = class extends ImpaktElement {
|
|
|
108
136
|
return placed ? `calc(${near * 100}cqi + 0.25rem)` : `calc(${100 / n}cqi - 0.5rem)`;
|
|
109
137
|
};
|
|
110
138
|
const listed = nodes.filter((node) => node.label || node.flag);
|
|
111
|
-
return html`<div class="visual" part="drawing" aria-hidden="true" style="block-size:${height}px">
|
|
139
|
+
return html`<div class="visual" part="drawing" aria-hidden="true" style="block-size:${height}px;--n:${n}">
|
|
112
140
|
<svg viewBox="0 0 1000 ${height}" preserveAspectRatio="none" focusable="false">${svg`<path d=${d} />`}</svg>
|
|
113
141
|
${this.lineLabel ? html`<span class="lineLabel" style="inset-block-start:${TOP - 66}px">${this.lineLabel}</span>` : nothing}
|
|
114
142
|
${nodes.map((node, i) => {
|
|
115
143
|
const y = pts[i].y;
|
|
116
144
|
const onMain = depthOf(node) === 0;
|
|
117
|
-
const style = (edge) => `inset-inline-start:${pct(i)};${edge};--slot:${slot(i)}`;
|
|
145
|
+
const style = (edge) => `inset-inline-start:${pct(i)};${edge};--slot:${slot(i)};--i:${i}`;
|
|
118
146
|
const label = !node.label ? nothing : onMain ? node.flag ? nothing : html`<span class="vlabel" style=${style(`inset-block-end:${height - y + 12}px`)}>${node.label}</span>` : html`<span class="vlabel" style=${style(`inset-block-start:${y + 14}px`)}>${node.label}</span>`;
|
|
119
|
-
return html`<span class="ring${node.current ? " current" : ""}${node.flag ? " flagged" : ""}" style="inset-inline-start:${pct(i)};inset-block-start:${y}px"></span>
|
|
147
|
+
return html`<span class="ring${node.current ? " current" : ""}${node.flag ? " flagged" : ""}" style="inset-inline-start:${pct(i)};inset-block-start:${y}px;--i:${i}"></span>
|
|
120
148
|
${label}
|
|
121
|
-
${node.flag ? html`<span class="flag" style="inset-inline-start:${pct(i)};inset-block-start:${y - 15}px">${node.flag}</span>` : nothing}`;
|
|
149
|
+
${node.flag ? html`<span class="flag" style="inset-inline-start:${pct(i)};inset-block-start:${y - 15}px;--i:${i}">${node.flag}</span>` : nothing}`;
|
|
122
150
|
})}
|
|
123
151
|
</div>
|
|
124
152
|
<ol part="list" role="list" aria-label=${this.label || nothing}>
|
|
@@ -191,9 +219,10 @@ var ImpaktCallout = class extends ImpaktElement {
|
|
|
191
219
|
...ImpaktElement.styles,
|
|
192
220
|
css`
|
|
193
221
|
:host { display: block; }
|
|
194
|
-
|
|
195
|
-
.
|
|
196
|
-
.
|
|
222
|
+
/* The "How might we" panel of 21:1381: 32px inside its edge, the label 12px over the question, and the question in Display S, 32px on 1.1 at -3%, at most 900px wide. */
|
|
223
|
+
.panel { padding: calc(${space(8)} - 1px); background: ${ink}; color: ${paper}; border: 1px solid ${ink}; }
|
|
224
|
+
.label { margin: 0 0 12px; ${monoLabel}; font-weight: ${fontWeight("medium")}; color: ${accentOnInk}; }
|
|
225
|
+
.text { margin: 0; max-inline-size: 28.125em; font-family: ${t.fontHeading}; font-size: clamp(1.5rem, 1rem + 2vw, 2rem); font-weight: ${fontWeight("semibold")}; line-height: 1.1; letter-spacing: -0.03em; }
|
|
197
226
|
@media (prefers-color-scheme: dark) { .panel { border-color: ${inkLine}; } }
|
|
198
227
|
@media (max-width: 30rem) { .panel { padding: ${space(6)}; } }
|
|
199
228
|
@media (forced-colors: active) { .panel { border-color: CanvasText; } }
|
|
@@ -230,12 +259,13 @@ var ImpaktHypothesisCard = class extends ImpaktElement {
|
|
|
230
259
|
...ImpaktElement.styles,
|
|
231
260
|
css`
|
|
232
261
|
:host { display: block; block-size: 100%; }
|
|
233
|
-
|
|
262
|
+
/* The hypothesis of 21:1417: 24px inside, its parts 14px apart, the statement 20px on 1.2, so a two-line card is 164px. */
|
|
263
|
+
article { box-sizing: border-box; block-size: 100%; display: grid; align-content: start; gap: 14px; padding: ${space(6)}; background: ${t.surfaceCard}; color: ${t.text}; border: 1px solid ${t.text}; }
|
|
234
264
|
.top { display: flex; justify-content: space-between; align-items: center; gap: ${space(2)}; flex-wrap: wrap; min-block-size: 22px; }
|
|
235
265
|
.number { font-family: ${t.fontMono}; font-size: 0.75rem; letter-spacing: 0.06em; }
|
|
236
266
|
.impact { margin: 0; padding: 3px 7px; ${monoLabel}; font-weight: ${fontWeight("medium")}; border: 1px solid ${t.text}; color: ${t.text}; }
|
|
237
267
|
:host([impact='high']) .impact { background: ${accent}; color: ${accentOn}; border-color: ${accentOn}; }
|
|
238
|
-
.statement { margin: 0; font-family: ${t.fontHeading}; font-size: 1.25rem; line-height: 1.
|
|
268
|
+
.statement { margin: 0; font-family: ${t.fontHeading}; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.01em; }
|
|
239
269
|
.metric { margin: 0; ${monoLabel}; color: ${t.textMuted}; }
|
|
240
270
|
@media (forced-colors: active) { article, .impact { border-color: CanvasText; } }
|
|
241
271
|
`
|
|
@@ -313,4 +343,4 @@ export {
|
|
|
313
343
|
ImpaktHypothesisCard,
|
|
314
344
|
ImpaktBrowserFrame
|
|
315
345
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
346
|
+
//# sourceMappingURL=chunk-7OFH762N.js.map
|