@baravak/risloo-profile-cli 4.83.0 → 4.85.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.
@@ -0,0 +1,131 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ {{! Teal wash behind the plot area (Figma "Bar Back Total") }}
5
+ <linearGradient id="jssWash" x1="0" y1="0" x2="1" y2="0">
6
+ <stop stop-color="#F0FDFA"/>
7
+ <stop offset="1" stop-color="#CCFBF1"/>
8
+ </linearGradient>
9
+
10
+ {{! Factor bar: Figma anchors the gradient to each bar's own width, so bounding-box
11
+ units reproduce all nine bars from one definition. }}
12
+ <linearGradient id="jssBar" x1="0" y1="0" x2="1" y2="0">
13
+ <stop stop-color="#99F6E4"/>
14
+ <stop offset="1" stop-color="#0F766E"/>
15
+ </linearGradient>
16
+
17
+ {{! Total bar: Figma runs the gradient 194 % of the fill height up from the foot of
18
+ the bar, i.e. from bounding-box y = 1 to y = 1 − 1.94, so the visible tip keeps
19
+ the same tone at every score. }}
20
+ <linearGradient id="jssTotal" x1="0" y1="1" x2="0" y2="-0.94">
21
+ <stop stop-color="#94A3B8"/>
22
+ <stop offset="1" stop-color="#334155"/>
23
+ </linearGradient>
24
+
25
+ {{! Shadow of the white 0 % baseline (offset right, soft blur) }}
26
+ <filter id="jssBaseShadow" x="171" y="27" width="7" height="390" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
27
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
28
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
29
+ <feOffset dx="1"/>
30
+ <feGaussianBlur stdDeviation="1.5"/>
31
+ <feComposite in2="hardAlpha" operator="out"/>
32
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
33
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1"/>
34
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1" result="shape"/>
35
+ </filter>
36
+
37
+ {{! Same treatment under the foot of the total bar }}
38
+ <filter id="jssTotalBaseShadow" x="711" y="390" width="34" height="14" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
39
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
40
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
41
+ <feOffset dx="2"/>
42
+ <feGaussianBlur stdDeviation="3"/>
43
+ <feComposite in2="hardAlpha" operator="out"/>
44
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0"/>
45
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1"/>
46
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1" result="shape"/>
47
+ </filter>
48
+ </defs>
49
+
50
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
51
+
52
+ {{! ===================== Plot area wash ===================== }}
53
+ <rect x="175" y="30" width="399" height="384" fill="url(#jssWash)" fill-opacity="0.25"/>
54
+
55
+ {{! ===================== Raw-score boxes ===================== }}
56
+ {{#each items as |item|}}
57
+ <rect x="587.5" y="{{math item.top '+' 0.5}}" width="31" height="15" rx="3.5" fill="none" stroke="#059669"/>
58
+ <text x="603" y="{{item.baseline}}" text-anchor="middle" font-size="13" font-weight="500" fill="#047857">{{item.mark}}</text>
59
+ {{/each}}
60
+
61
+ {{! ===================== Gridlines (10 % … 100 %) ===================== }}
62
+ <line x1="213.5" y1="30.5" x2="213.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
63
+ <line x1="253.5" y1="30.5" x2="253.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
64
+ <line x1="293.5" y1="30.5" x2="293.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
65
+ <line x1="333.5" y1="30.5" x2="333.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
66
+ <line x1="373.5" y1="30.5" x2="373.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
67
+ <line x1="413.5" y1="30.5" x2="413.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
68
+ <line x1="453.5" y1="30.5" x2="453.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
69
+ <line x1="493.5" y1="30.5" x2="493.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
70
+ <line x1="533.5" y1="30.5" x2="533.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
71
+ <line x1="573.5" y1="30.5" x2="573.5" y2="413.5" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
72
+
73
+ {{! ===================== Bar tracks ===================== }}
74
+ {{#each items as |item|}}
75
+ <g transform="translate(174, {{item.top}})">
76
+ {{bar 400 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill="black" fill-opacity="0.04"}}
77
+ </g>
78
+ {{/each}}
79
+
80
+ {{! ===================== Bars + percentage inside the tip ===================== }}
81
+ {{#each items as |item|}}
82
+ <g transform="translate(174, {{item.top}})">
83
+ {{#if item.width}}{{bar item.width 16 (object tl=0 bl=0 tr=2 br=2) (toRad 0) fill="url(#jssBar)"}}{{/if}}
84
+ </g>
85
+ <text x="{{item.labelX}}" y="{{item.baseline}}" text-anchor="end" direction="ltr" font-size="13" font-weight="500" fill="white">٪ {{item.pct}}</text>
86
+ {{/each}}
87
+
88
+ {{! ===================== Factor names ===================== }}
89
+ {{#each items as |item|}}
90
+ <text x="165" y="{{item.baseline}}" text-anchor="start" font-size="13" fill="#475569">{{item.title}}</text>
91
+ {{/each}}
92
+
93
+ {{! ===================== White shadowed 0 % baseline ===================== }}
94
+ <g opacity="0.5" filter="url(#jssBaseShadow)">
95
+ <line x1="173.5" y1="30.5" x2="173.5" y2="413.5" stroke="white" stroke-linecap="round"/>
96
+ </g>
97
+
98
+ {{! ===================== Axis labels ===================== }}
99
+ <text x="173.5" y="18.06" text-anchor="middle" font-size="12" fill="#94A3B8">0</text>
100
+ <text x="373.5" y="18.06" text-anchor="middle" direction="ltr" font-size="12" fill="#94A3B8">٪ 50</text>
101
+ <text x="563" y="18.06" text-anchor="middle" direction="ltr" font-size="12" fill="#94A3B8">٪ 100</text>
102
+ <text x="603" y="10.06" text-anchor="middle" font-size="12" fill="#94A3B8">نمره خام</text>
103
+ <text x="603" y="24.06" text-anchor="middle" font-size="12" fill="#94A3B8">از 20</text>
104
+
105
+ {{! ===================== Total score column ===================== }}
106
+ <g transform="translate(717, 46)">
107
+ {{bar 18 350 (object tl=2 tr=2 bl=0 br=0) (toRad 0) fill="#F1F5F9"}}
108
+ </g>
109
+ {{#if total.height}}
110
+ <g transform="translate(717, {{total.tip}})">
111
+ {{bar 18 total.height (object tl=2 tr=2 bl=0 br=0) (toRad 0) fill="url(#jssTotal)"}}
112
+ </g>
113
+ {{/if}}
114
+
115
+ {{! Readout travelling with the tip of the bar }}
116
+ <text x="743" y="{{total.pctBaseline}}" text-anchor="start" direction="ltr" font-size="18" font-weight="600" fill="#334155">٪ {{total.pct}}</text>
117
+ <text x="743" y="{{total.fractionBaseline}}" text-anchor="end" font-size="12" fill="#64748B">{{total.mark}} از {{total.max}}</text>
118
+
119
+ {{! Column title, reading bottom-up along the bar }}
120
+ <text x="0" y="0" transform="translate(707.02, 296.2) rotate(-90)" text-anchor="start" font-size="12" fill="#475569">نمره کل رضایت شغلی</text>
121
+
122
+ {{! Foot of the total bar }}
123
+ <g opacity="0.5" filter="url(#jssTotalBaseShadow)">
124
+ <path d="M716 397H736" stroke="white" stroke-width="2" stroke-linecap="round"/>
125
+ </g>
126
+
127
+ <text x="711" y="49.06" text-anchor="end" direction="ltr" font-size="12" fill="#475569">٪ 100</text>
128
+
129
+ </g>
130
+
131
+ {{/layout}}
@@ -0,0 +1,110 @@
1
+ {{#> layout}}
2
+
3
+ <defs>
4
+ {{! Component bar: grows left → right, so the gradient runs from the 0 guide (light)
5
+ to the tip (dark) in each bar's own bounding box. One hue for all seven — a
6
+ per-component colour would read as a class the scoring does not define. }}
7
+ <linearGradient id="psqiBar" x1="0" y1="0" x2="1" y2="0">
8
+ <stop stop-color="#A5B4FC"/>
9
+ <stop offset="1" stop-color="#4338CA"/>
10
+ </linearGradient>
11
+
12
+ {{! Total track, fully rounded; the fill is clipped to it so any width keeps the ends. }}
13
+ <clipPath id="psqiTotalTrack">
14
+ <rect x="713" y="260" width="130" height="10" rx="5"/>
15
+ </clipPath>
16
+ </defs>
17
+
18
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
19
+
20
+ {{#if valid}}
21
+
22
+ {{! ===================== Components: heading (over the chart, right-aligned to it) ===================== }}
23
+ <text x="660" y="24" text-anchor="start" font-size="16" font-weight="600" fill="#1E293B">مولفه‌های کیفیت خواب</text>
24
+ <text x="660" y="46" text-anchor="start" font-size="12" fill="#64748B">نمره هر مولفه از 0 تا 3؛ نمره بالاتر یعنی مشکل بیشتر</text>
25
+
26
+ {{! Axis values over the 0–3 guides, and the raw-score column header }}
27
+ {{#each ticks as |tick|}}
28
+ <text x="{{tick.x}}" y="72" text-anchor="middle" font-size="12" fill="#94A3B8">{{tick.v}}</text>
29
+ {{/each}}
30
+ <text x="644" y="72" text-anchor="middle" font-size="12" fill="#94A3B8">نمره</text>
31
+
32
+ {{! ===================== Gridlines (1, 2, 3) ===================== }}
33
+ <line x1="312.5" y1="78" x2="312.5" y2="366" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
34
+ <line x1="462.5" y1="78" x2="462.5" y2="366" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
35
+ <line x1="612.5" y1="78" x2="612.5" y2="366" stroke="#E2E8F0" stroke-linecap="round" stroke-dasharray="6 6"/>
36
+
37
+ {{! ===================== Tracks ===================== }}
38
+ {{#each items as |item|}}
39
+ <g transform="translate(162, {{item.top}})">
40
+ {{bar 450 18 (object tl=0 bl=0 tr=3 br=3) (toRad 0) fill="black" fill-opacity="0.04"}}
41
+ </g>
42
+ {{/each}}
43
+
44
+ {{! ===================== Bars ===================== }}
45
+ {{#each items as |item|}}
46
+ {{#if item.width}}
47
+ <g transform="translate({{item.x}}, {{item.top}})">
48
+ {{bar item.width 18 (object tl=0 bl=0 tr=3 br=3) (toRad 0) fill="url(#psqiBar)"}}
49
+ </g>
50
+ {{/if}}
51
+ {{/each}}
52
+
53
+ {{! 0 guide }}
54
+ <line x1="161.5" y1="78" x2="161.5" y2="366" stroke="#CBD5E1" stroke-linecap="round"/>
55
+
56
+ {{! ===================== Component names (left of the 0 guide) and raw scores (after 3) ===================== }}
57
+ {{#each items as |item|}}
58
+ <text x="150" y="{{item.baseline}}" text-anchor="start" font-size="14" fill="#334155">{{item.title}}</text>
59
+ <rect x="628.5" y="{{math item.top '+' 0.5}}" width="31" height="17" rx="4" fill="white" stroke="#6366F1"/>
60
+ <text x="644" y="{{item.baseline}}" text-anchor="middle" font-size="13" font-weight="600" fill="#3730A3">{{item.mark}}</text>
61
+ {{/each}}
62
+
63
+ {{! ===================== Total card (right of the chart) ===================== }}
64
+ <rect x="693.5" y="78.5" width="169" height="287" rx="8" fill="#F8FAFC" stroke="#E2E8F0"/>
65
+ <text x="778" y="136" text-anchor="middle" font-size="14" font-weight="600" fill="#475569">نمره کل</text>
66
+ <text x="778" y="206" text-anchor="middle" font-size="48" font-weight="700" fill="#1E293B">{{total.mark}}</text>
67
+ <text x="778" y="232" text-anchor="middle" font-size="13" fill="#64748B">از {{total.max}}</text>
68
+
69
+ {{! Neutral 0–21 bar, filling left → right; deliberately no cut mark or colour change }}
70
+ <rect x="713" y="260" width="130" height="10" rx="5" fill="#E2E8F0"/>
71
+ {{#if total.width}}
72
+ <rect x="{{total.x}}" y="260" width="{{total.width}}" height="10" fill="#475569" clip-path="url(#psqiTotalTrack)"/>
73
+ {{/if}}
74
+ <text x="713" y="288" text-anchor="middle" font-size="11" fill="#94A3B8">0</text>
75
+ <text x="843" y="288" text-anchor="middle" font-size="11" fill="#94A3B8">21</text>
76
+ <text x="778" y="322" text-anchor="middle" font-size="12" fill="#94A3B8">جمع هفت مولفه</text>
77
+
78
+ {{! ===================== Interpretation panel ===================== }}
79
+ {{! Every sentence here is approved fixed text; the screening result appears nowhere else. }}
80
+ <rect x="0.5" y="410.5" width="862" height="263" rx="8" fill="#F8FAFC" stroke="#E2E8F0"/>
81
+ <text x="843" y="452" text-anchor="start" font-size="15" font-weight="600" fill="#1E293B">تفسیر نتیجه</text>
82
+
83
+ <text x="843" y="{{lines.direction}}" text-anchor="start" font-size="13.5" fill="#334155"><tspan font-weight="600">جهت نمره</tspan>: نمره بالاتر نشان‌دهنده مشکلات بیشتر در ابعاد سنجیده‌شده است.</text>
84
+
85
+ <text x="843" y="{{lines.screen}}" text-anchor="start" font-size="13.5" fill="#334155"><tspan font-weight="600">نتیجه غربال (غربال، نه تشخیص)</tspan>: نمره کل {{total.mark}} از {{total.max}} — <tspan font-weight="600">{{screen.text}}</tspan>.</text>
86
+
87
+ <text x="843" y="{{lines.cutoff}}" text-anchor="start" font-size="13.5" fill="#334155"><tspan font-weight="600">برش غربال</tspan>: نمره کل 6 یا بیشتر؛ برش فقط بر نمره کل اعمال می‌شود و مولفه‌ها طبقه‌بندی نمی‌شوند.</text>
88
+
89
+ {{#if screen.positive}}
90
+ <text x="843" y="{{lines.falsePositive}}" text-anchor="start" font-size="13.5" fill="#334155"><tspan font-weight="600">مثبت کاذب</tspan>: ویژگی این برش 72.2 درصد است؛ بخشی از افراد بالای برش در واقع مشکل ندارند و نمره زیر برش اطلاع‌بخش‌تر است.</text>
91
+ {{/if}}
92
+
93
+ <text x="843" y="{{lines.limits1}}" text-anchor="start" font-size="13.5" fill="#334155"><tspan font-weight="600">محدودیت</tspan>: این نتیجه بر پایه گزارش خود فرد درباره ماه گذشته است و تشخیص نیست؛ ابزار تصمیم‌یار است</text>
94
+ <text x="843" y="{{lines.limits2}}" text-anchor="start" font-size="13.5" fill="#334155">و جای مصاحبه بالینی و اندازه‌گیری عینی خواب را نمی‌گیرد.</text>
95
+
96
+ {{else}}
97
+
98
+ {{! ===================== No result (all-or-nothing) ===================== }}
99
+ <rect x="181.5" y="237.5" width="500" height="199" rx="12" fill="#F8FAFC" stroke="#E2E8F0"/>
100
+ <circle cx="431.5" cy="288" r="17" fill="none" stroke="#64748B" stroke-width="2"/>
101
+ <line x1="431.5" y1="279" x2="431.5" y2="291" stroke="#64748B" stroke-width="2.5" stroke-linecap="round"/>
102
+ <circle cx="431.5" cy="297.5" r="1.6" fill="#64748B"/>
103
+ <text x="431.5" y="344" text-anchor="middle" font-size="17" font-weight="600" fill="#1E293B">نتیجه تولید نشد؛ پاسخ ناقص یا نامعتبر است</text>
104
+ <text x="431.5" y="376" text-anchor="middle" font-size="13" fill="#64748B">برای این پاسخ‌نامه هیچ نمره‌ای، حتی نمره جزئی، گزارش نمی‌شود.</text>
105
+
106
+ {{/if}}
107
+
108
+ </g>
109
+
110
+ {{/layout}}