z!3A7(6_Apt4mC?&h3BJK$cI!YU%IQsk0YpD-WHR79Vim7`MB>y9_*ecL?V=(~%r_i|*S!v&W&&+tV`|CgGPnbN9UlYg3w5B83mx%!2T%#5QS6
z;<;@D*P&xJXkly1@*4p*t}G+9%=EBploEXAd>L*pQ69Uy(5?{PDfYvRXOx(t+~X4X
zm@!Cv;sh%cfKneMH}$4;MIbU2OP)Jr&t=fVZbH|?0*+FSJ${dYK7ag)C-kNOV~shr
z_1qP{uYdjP;V=H;FZ78WKlzhCIVwvVpRVWI1^?`y{WJX_FYB7NX6Wa4_N8$ToevGO
zp32RE()t~8&{@pq+X6LRhEh8=SVQGKq6TDmzj?
zapG15NsI1sI}zTzgep33i2N<79P0tbO@#|?4y^cg05=LucUhl@vZ_39CZcO~6mEr+
zaI)f4=IPg-C4r}+_g>(!LR+!N_XpO(&&>zg;~f~j^`NolITY9+VdJI%i}Es|{@H6O2HwBC@_X`;YtiPGj3iHSIc2j^D1}9I_W;X>m3F81X
z`V>qz@-`^|^s`wTdyCNnI(&8$!DwSJJ@f-N1vmhaHF{ZIr%;4t?D^9Z#zL<%0(psR
z*WD_nd^UJHCR54_pq(~rh1+NfIce)fa~)ClZftd^emS_6I}cvyv~cW8W)g7>eg0~>
zF~8y)_LNSnnq^)qI`z*0PZo!RYH-c9{!pqWQmX?CKr_=fPoRBVb#?_iK3PtM-l(q2
zGrJ^R=mT;bdB))V$@_QUtF+ZU?7T?(NYQ*|`g=cRK1uetA>i-+d%gt=7A)8oelD^3
zZJApZELgB$KCWs$wM7^fm(X^!PU{DPcrMw4_PRySS;FwVJ%!L=b|@m>Dq`p3wR~AV
zLC2#cc~L>x$u_()lKx0#gQ+ncToc%pKx*1S;6%B>_3}K#$CgR&+7k`ow)1|9C
zuxm|V2UffYjVk2DR%yoanIr}Ay0zx7QhS4GU*e&$bp*M&!Zv#x1taR&3#^fK?VCdnu3pM3I3Ezh;d+9vCfeE2!H2h1jq
zC~CPWP=e`YZPKr`1JebK^+y10t_=fv$P4R{tV;scwza2ZY{z(%9BoL2s?uM0;f29X
z0lxOu*A%laZatS>d$7uAz0@b?wclNY7)e=wF)nR-%BI1y<*=o~Q6}CMRL}K~ntsh;#WyKr$2Sus{_QIM9>Q9GG=YDaI%pSK
zsWXknpyj3j10Gt=+vO+uQv>bBQ_=&V8ISFGUKa-echp$O%4Ojz>0(fOdWmNWrrSPI
zLD~E=Fc$5m0N)e#$^i}d7zABx6PR;nz6pAFbevgZo8U3TPoqrp
z>L+lr9C&CpM3==|>krV;eX}&h)V8Ma~Z(i7^P5HnZ
z=Z8o7+0z
zuY(fJU~LR~`=$Ul1$c~+KafC+4MWLR4al5<*jFONJHp94cN-jp7HTmqvX3avK<
zhKsy)951bTZXE~tn5pHj>o?h%2OY0gQlT-9
zE-#(F{^ZW1&z}=eq+?B>6tO$iC+LFbe0wf3E1l1|$x5tjrPvoNSg_!-uzA)t51V&v
z4-PRGd3|7+*A^^T@J5553n`DyV>z$E%Rp!Sgb##q4QSWXaByCza@q9)XgQa!LUbY?
z-QZl;^h1@idedF7TSBWZE!QbP<1ghE$K*dY@nNV&{~8_ieFSQKY_y!;P?NhZ)O_}+
z`8LL9ZI_8lyF&DoGdDzhY?caWy=)g+i?%6<9tLQ1Fv|m1oV4}VgPP;S65Zm(UpMyG
zgssO>o_j+cckA)yug`NG-d3$Y$ND>O8{@438Rci6Xq(M>c74WlP4iSqTy>Wn`ptDJOkQBhm$0L0?CMq?3mM8m-WE
z*V{iAIRvySmZhxn!l)97zRnhdYQUoygFqE=_Xm1x({_2qyRG^ly!e*&YMW2DmhP~DQhm&R3(&zGKz`77>`ohP
zJYI<$k*kt_W0=EhFd2}`)$~EfR}MaVR+#tIU~-X8Io5?!US;$Q**ior#=KT1k=q@E
zkEIl!*VWPO8v*G}vXhe?lwM*#n2y$Xr|fDQFXI1HZZyUeUrDE@<^JIZsL_31#SsXp
z7#U2?_@EDD4DK5lQz*)J5yZCEn*up%@d9tR8y^|1>o@4~@B0S2>X){X{t`NW^iMTJ
zg2vbDjyEIv<4w8Lx7}mV+s6N$SfnrDq0ZdOJiy5U+fKZ${$|4)F}}fgo9TNV@53Jd
zRrvR?$Bbv%#m>ct-RD*i2e4R5aa~2M=<~L%ykLJ^ML#WAu%Hfq%+-#+e14;D*Q>tG
z_8YmLX5-q=KmI{A3rp!dwmS!o)h6Wp(RE%fx0s0l{?vR?yS!w1DZ%o?-r!|aO)AxH
z3MjRcN0yk{?3PgT(9Sko3o>8l
z^_%HJE*~%P_=q=``r~65OD`Y&?HfzS?`42pR1VB1_?YKjpO58>HfY9^=Xg55b)X??
zVV*n>YncQ2vEkD1a<(A%Z45r978pN!ww=Xur_0LB{qQok^FeBRf(aIy!s0mzjsu&6Dt-c=LVN>)
zl@}fO$**W$Uj&Khp+{$;Q&v`fPe2OkF+TlQ=;G@bOr83b%0N7pR|v9+zwxn3yx}HV
z;$TlrOY#P+&(!KD5#-b-o-!K)iv@WWy%}uKJZ~;%sCA~Hq=P}iqBR4>%dvpP-7kEx
zlbPtgyfo;a1I8FP1n>cWERJq3ok5PN^MfV)-Mn#AClk
zBjO=0>NOvSKu?O9ct!ot+f-vGb}-v^i>vp$1r`s;V+0mw3x;p5mxmsg4QRF7u1}L5
zD+)6(r1d8|W01bHyxNOYqhLin2FxW
z2x{6ch1PLz8m8hg-JTEgnl4^cQPegzX0$0OF+TciBNv9ej~c4|_$I=fdE#M#^@~D$
zAM+kg-=4?&u*ZKD{ypq5+xvp}t
zYI7cRuKT!_?yjK)&{c*?L9X@Mr3g{iiRXIum`YlGX}yjb%N5{#nEMsO^LzNoSzl8$
z+KkfE$bIv5^Uu&aFCRL8Il8=MewWbmNV^)8t---OFJowpH}>zeULRkn4@&XxBE_oM
zy>c|QUd2uv);A;QpWE5B7Ufs^-b0m
z?Spc83|9g3-`mP*)NMVIby3#wG>*jQ0S!4euI>3SwXK;F*H}zm*6Yt@jIUHS?ew_1tsM>EnagI-{Zi0WP9;Bm_2?wMm_pfGH~oh`px)
z(Wbm2EeuggHe(tDocI!x`XL*3HA(P7vZ9PeQ`3R=7C1rE(veihkk-u^(nvF}knn9w
zf!NgXU65aEvxOrL90plwaCv@1i8cm!vBf~)P8ek`kG>PJjSojh9Jm@nAFzYT<$kte
zv)Smu#~xj}b%vzm>}qahV&Ue%$w~B&9JK=7Eq+eLlik1?7r}RaR
zDK6C|OfiML^nI~IlcLTAMWr<4{o4cizMo>-E?0!{mBweWO-LL^(RxuM0@{K&`*^dq
z4%JeyUqT<(2t-xnihkspX=789QfRY04)e=y(nJd&){Pw5VjJGoY{TI-n0|g=fO%nG
zs1{X7p@7s@^J`xm+U{la4P;07N*Kr<8dbeB9E9-@zBym&^H9VbbIoBiLTx)=cQDpg
z!weaVXRe7HhtA7o(E6T0+4JP}>x6oR=~_pmwg=|fwB1ANn}a+y_C_<*+{$78`ELk#)cPI$tu}Vic74>N#uG8e
zm)>p#C=!N&K9^gc52KEIHx1L1On3SsU9N4UklV06uk{aTJ#MjMK8!>3RT#}5D;r8a
z)M#MWU-J%nSqAiSk=D2L@Eox{x3vr9P=CAH6{7ddZVFWMBIJ0T?17(=V&5n*3~P0C
z_9%A(vEb#^wz3XANRqKA*p;lKjjJ7{@sZQ0>t5=9&4G10df-UrMShrf&f48o!(w0^
zk~LA*@PK`w*W$_nUH)}{e0-!IR4&KW=i$16Z~0np`i_jgnqRyQJQP0ln%KYn?QeHC
z1?Ip8e7qp-Ctg$!%%(P|BowH5`8SI=y}JNo4|)Jm7j+fHaVVl#+vP>ul2aVm=EWp%
zP7w8^!GInJ$w6H-iw05*@Wq7NBm%k!;HRDfj(n+2V0Ch?ognqnfb=rJ>oJ}ZybeI!
z`giBVMcQNlD1Vd@8+{}S)5YHG=QdhkKJ>PveBt|U#fsF>fr~ub)VE0Oe)+k8%1lprPxZ)LrPTExUm*_
z%&v@`j5#*N_Ex+3vj}&gmb?5-p*eqT?y31YtNBK`?4S0NM}kv^3h8!P6bRx^LKpVjX8
zj9@_LgjvgS-gxI`A|rgS_4flVi{MjJVE7uqM$O$AZh_kmG6&yxo38L=5QqZTXx-
zc(P;Z&~em`)s|zJc0I-%)ITNhV)8>C)DPJEWi8YX$m%$(43DKeg~3{RI9G7#gCS;V`$EwJ3dM|nPYPr=(nKTu9NKttFtuj
z+km@-|lPAMu>x{&n8f(JGR6@lnZ`rdSP$e7u(fW5`Sxr_#Qq%O3WwrD@klO{R#$PRqI^V}P9dFwcj
z60HRIOc&ho8yo7i*6oFz>YK1T2WA(TE~R0Hq*3%HrHr+hPaB(TyXa!Ngnv0Y|0=My
z7(>isB*obBaWDjpQH~KE`yj%{VEVwgzWp$?mF#3RJB(`fYloTX8Oz}q;$m<`c?bNP
z;)!U@U-PsfDC1`<4o)z<^zVLxB)HkYAimsfee*s)5d9w&K9)h1(e1|PHVMW>fc=F9DP2HF`3qQ
zTkY1s5gARD4aRnB>yO_W|1K`+UC;d<|T3(R8s!C{)-hY&w=lE59oHT)`p>f
zLyWcUVlYnCy;{GuVb1Y()v#lZjk48CsP)ahFnwT-&VA;C>xR#j<+Ma=!M^d<@_X5N
zEytnfQ#+4PwT(IYQGoAHL+cnS;n2sCj%j+$@#j9{?>=^G#|!k<_k}t0LCJ3q^T+cU
zkI}51cq!9N3$(Rd@7sH(!Tig0s*a?)hRYn&EHCx_mMe-*<7@7MkJIBazKj92(T~g#
zK}(LNko%pF7i%w#qgpO%^f9#NZ{P83zD&_Tq&q{>tbIV)lM8aX7E^$7x~BcFyN$3b
z-x_ZndHa-)#5?2}ep8@FYrpN}RI2#BBM+apQE5~@f;s-x@@T$K=eYnE55FbLc#GPi
z-aId@(A*Vd%}3u>@*f)YoZs_!c)l`Eq{ZP8pJWmPCEhg(s0ive&2nE34Q^DJAGLXD
zY`m=g>7V{de2bk{PsA>+DxfJG+P^$$rahN#J?I{G*ZS#=
zhO6pdJ6Fl&)LNGJF?9Y3``CO{yZ9UcRTbN2=Z)Bhb5M&@sZ*f~)7^Xzgco?&QkZ>Eh5zEVOC9TI9Ky6K@OV=C7EuL~GSG7gISf-)boN+=9#6
z^~iPAFvmX+)4#8LE8=3mY;wTo^SHiOXuGsDP2`8iRp+?|wJSQk*3K6p=DAuh1iA8k
zQX0=W&mmB<<1y8q!~2-aj_IIk5Gj`i%k$$M%+n>+gXD3l=O`uwcPlw0MpVTX)88GNa-U|+=JVbS7
z4zKYrnA^V*@twW!t|&Q9#ReRD{yU^L!e|Yp`L{VP8LwV=YN^+A=$KnEW!H4+NTDJE
zHePbtA!C?>Wj@#smbXJ5zl}XH3$5PGvYm|?pMwXTmj^Ybn%~c_;5eGXtiBcO>!Hs9
zaZ-!#l1fm$#$q-iEtAV~S)xs%G0*6YtUdq0mXPPn&aHmV83*m0(`fatHQO48)9L$a
z&~FEf*Q|B#p$WsBN~^R%Yq9LqjKjrd$aAW3r}88+*(&zPU&$}f>>FtGuX}uH+C0!;
zT3XK&TYVh%`3MeeH|-5mHwDJV3(6YZQ$14=x5i*Nq`sZlDroLELCg8`9J}-4jq`{{
zbiLQost=zdZ+tbMEfrKty5{7{BXj#2(a*ge8n2L6-}uHiq%C$@pM>!sTRRxUgK;Wp
zbcS_^VfV9bSZ%l50@2p0uqlp1Ll3P<;8pV-P!~ro;-focq}XY5PsTuN9D>Plnzm`Q
z+qE~BX?VuIA0xGIqtvYOK$vsdC8Kj`&-+IqVnmlGeP
zIjWo13C9#ywCim~7-jYKuYX;2w7wb5g&o8-N3D$??d_qISj;e`uNA#rtxn=lcK5-Q
ziyA}Lf3-o`-XB^$7}P}+*YrvoHfw(Ei$llDGn`xWrK4Dp^O~tSb{9NcIP|!BV8`Wz
zU5_c#W4_z`Wb;xUN9_c;6-Xa)eo=j~SOvP~d3iWY#@mXSd3jKn{e!g@P$!lOeq3EP
zcXMz>d2Y>1>ko>fZE{?BRdU?IswBy6Cz_7uX1m$(UxWJAfLZazVi_r*2X#}R6&gqK
zwTP~*?fj)Rf32W@Ef?0;rF!c)$YsHGK@}l`bwKHp$t}-VjyZZt)-d9t(x9XCz9Kxe^8;q33{AGdJ
zDbwm-EDlgQ-c%pOno?<-bN-_GVzG<{ecn%9)P}jHv_YQ-Y7QRnL#_|h_@~-)sDH6|
zIqVU~lwEYS>TAWJ?W#VQYf7c>II
z0i2WE;+A>lRY!Mu>HA^MZyAinEBY7%lfEUOX+)c%^*AzJE&bt!k(er$`aew&tRbc*IWuC9IAF*PVh^%eYT`i_^JUT{ZAlF~|O`7Y-iSL8U
zqU7(T^ougnR~wSn9anL@wV)-wJTGI%*gpEka43D|^MmjYw7w5M2><5l12z7s_8cw#
z&B24pb1M#Q_d)1;*zvIEPxZ-*txq1}d}Ye6z0WAmggNyu7AIkLJN;7W%6wDc?CdO@
zo}PxyW)mmiiD2iPphQjM`UaR{Z8zP9R@V+~w+Z_%k5~K9E6iEO+TN&WN??1QnrC}@gPA?d`wm^(XR_#Usd`yAN$uauhr0I8Lr&6Nk;nNJ!{9D
z<7f&GGLAWDiul0e>OqZD>`v)y;n@cdB+qSDWvm`P-ZvvGn{U=^wT}Jn_*K@(Z&LZO
z?e$q(PHP{}hegS1(MA?i4Hid@yDiGALu>w8{k%4P^?t;^SfBmDa>?=<#gY
z^5bWxuCLRW6Ymsn3y-1Izj26`r0A;hd?*~+?t{{ICGc~q^<#IedQ}(xmd5);pF5b9335Xlhc9)3l==A$WNxGaG8m`WaE%;4B%m(
zcbiYz_K4%qxm>W|jfVUfxQ==4GQhu@&q{s3$MnOVzXydw=jB1=xitQAwD4RN-Yj`u
z@W#Yt$3C*HW9~ZOW6AxxN?&U^e3)`GhEi_Ea(QT&tsNiq<>4A**MXL?+QPHouoycg
jmi}1qX2x(X4&na?$Swrb?cVSK00000NkvXXu0mjfJVg$K
literal 0
HcmV?d00001
diff --git a/packages/documentation/src/stories/utilities/position/position.docs.mdx b/packages/documentation/src/stories/utilities/position/position.docs.mdx
new file mode 100644
index 0000000000..df7cfc1bd6
--- /dev/null
+++ b/packages/documentation/src/stories/utilities/position/position.docs.mdx
@@ -0,0 +1,47 @@
+import { Canvas, Controls, Meta, Source } from '@storybook/blocks';
+import * as PositionStories from './position.stories';
+
+
+
+# Position
+
+
+ Define the positioning method of an element, as well as its position relative to top, bottom,
+ start and end easily with utility classes.
+
+
+Note that these utility classes are not responsive.
+
+
+
+
+
+
+## Properties
+
+### Positioning method of elements
+
+Here are the different positioning methods available for elements.
+
+- `position-static` (default) positions the element according to the flow of the page.
+- `position-relative` positions the element according to the flow of the page, but you can offset it relatively to itself by settings values for `top`, `bottom`, `start` and `end`.
+- `position-absolute` removes the element from the flow of the page and positions it relatively to its closest positioned element.
+- `position-fixed` removes the element from the flow of the page and positions it relatively to the viewport.
+- `position-sticky` positions the element according to the flow of the page but "sticks" it in place in the case of a scrolling container.
+
+### Arrangement of elements
+
+Some utility classes are here to define the position from the edges of the container more easily.
+
+- `top-{0|50|100}` to set the position of the element from the top of the container by 0, 50% or 100%.
+- `bottom-{0|50|100}` to set the position of the element from the bottom of the container by 0, 50% or 100%.
+- `start-{0|50|100}` to set the position of the element from the start of the container (left in LTR) by 0, 50% or 100%.
+- `end-{0|50|100}` to set the position of the element from the end of the container (right in LTR) by 0, 50% or 100%.
+
+### Translate-middle
+
+The class `.translate-middle` is there to center an element horizontally and vertically on their x and y position. You can also use `.translate-middle-x` to only center the element horizontally and `.translate-middle-y` to center it vertically.
+
+
+
+On the example above, the black dot is the center of the container. Both squares are positioned 50% from the top and 50% from the start. The blue square has the `translate-middle` class and the yellow one doesn't.
diff --git a/packages/documentation/src/stories/utilities/position/position.snapshot.stories.ts b/packages/documentation/src/stories/utilities/position/position.snapshot.stories.ts
new file mode 100644
index 0000000000..9b4d17e3d2
--- /dev/null
+++ b/packages/documentation/src/stories/utilities/position/position.snapshot.stories.ts
@@ -0,0 +1,82 @@
+import type { StoryObj } from '@storybook/web-components';
+import { html } from 'lit';
+import meta from './position.stories';
+import { bombArgs } from '@/utils';
+import './position.styles.scss';
+import { schemes } from '@/shared/snapshots/schemes';
+
+const { id, ...metaWithoutId } = meta;
+
+export default {
+ ...metaWithoutId,
+ title: 'Snapshots',
+};
+
+type Story = StoryObj;
+
+export const Position: Story = {
+ render: () => {
+ return schemes(
+ () => html`
+
+
Position
+
Position methods
+
+ ${(meta.argTypes?.position?.options ?? []).map((position: string) => {
+ return html`
+
Position ${position}
+
+
+
+
I'm ${position}
+
+
+
+
+
+ `;
+ })}
+
Position arrangement with position absolute
+ ${bombArgs({
+ x: ['start-0', 'start-50', 'start-100', 'end-0', 'end-50', 'end-100'],
+ y: ['top-0', 'top-50', 'top-100', 'bottom-0', 'bottom-50', 'bottom-100'],
+ }).map(args => {
+ const xArgName = (args.x as string).split('-')[0];
+ const xArgValue = (args.x as string).split('-')[1];
+ const yArgName = (args.y as string).split('-')[0];
+ const yArgValue = (args.y as string).split('-')[1];
+ return html`
+
${xArgName}: ${xArgValue}% / ${yArgName}: ${yArgValue}%
+
+ `;
+ })}
+
Translate middle with position absolute
+
Start: 50% / Top: 50%
+ ${bombArgs({
+ translateMiddle: ['', 'both', 'x', 'y'],
+ }).map(args => {
+ let translateMiddleValue = '';
+ if (args.translateMiddle === 'both') {
+ translateMiddleValue = ' translate-middle';
+ } else if (args.translateMiddle === 'x') {
+ translateMiddleValue = ' translate-middle-x';
+ } else if (args.translateMiddle === 'y') {
+ translateMiddleValue = ' translate-middle-y';
+ }
+ return html`
+
+ Translate middle: ${args.translateMiddle ? args.translateMiddle : 'none'}
+
+
+ `;
+ })}
+
+
+ `,
+ );
+ },
+};
diff --git a/packages/documentation/src/stories/utilities/position/position.stories.ts b/packages/documentation/src/stories/utilities/position/position.stories.ts
new file mode 100644
index 0000000000..7c4532915a
--- /dev/null
+++ b/packages/documentation/src/stories/utilities/position/position.stories.ts
@@ -0,0 +1,156 @@
+import type { Args, StoryObj } from '@storybook/web-components';
+import { html } from 'lit/static-html.js';
+import { MetaExtended } from '@root/types';
+import './position.styles.scss';
+import { bombArgs } from '@/utils';
+
+const meta: MetaExtended = {
+ id: '803a58e8-c734-4ad7-80a8-62da1bb29d4b',
+ title: 'Utilities/Position',
+ args: {
+ position: 'absolute',
+ start: '50',
+ top: '0',
+ translateMiddle: 'both',
+ },
+ argTypes: {
+ position: {
+ name: 'Position',
+ description: 'Sets the position. ',
+ control: {
+ type: 'select',
+ },
+ options: ['relative', 'static', 'absolute', 'fixed', 'sticky'],
+ table: {
+ category: 'General',
+ },
+ },
+ top: {
+ name: 'Top',
+ description: 'Sets the distance from top. ',
+ control: {
+ type: 'select',
+ },
+ options: ['', '0', '50', '100'],
+ table: {
+ category: 'General',
+ },
+ if: {
+ arg: 'bottom',
+ truthy: false,
+ },
+ },
+ bottom: {
+ name: 'Bottom',
+ description: 'Sets the distance from bottom. ',
+ control: {
+ type: 'select',
+ },
+ options: ['', '0', '50', '100'],
+ table: {
+ category: 'General',
+ },
+ if: {
+ arg: 'top',
+ truthy: false,
+ },
+ },
+ start: {
+ name: 'Start',
+ description: 'Sets the distance from start (left in LTR). ',
+ control: {
+ type: 'select',
+ },
+ options: ['', '0', '50', '100'],
+ table: {
+ category: 'General',
+ },
+ if: {
+ arg: 'end',
+ truthy: false,
+ },
+ },
+ end: {
+ name: 'End',
+ description: 'Sets the distance from end (right in LTR). ',
+ control: {
+ type: 'select',
+ },
+ options: ['', '0', '50', '100'],
+ table: {
+ category: 'General',
+ },
+ if: {
+ arg: 'start',
+ truthy: false,
+ },
+ },
+ translateMiddle: {
+ name: 'Translate middle',
+ description: 'Set to true to center align an element based on its x and y position.',
+ control: {
+ type: 'select',
+ },
+ options: ['', 'both', 'x', 'y'],
+ table: {
+ category: 'General',
+ },
+ },
+ },
+ render: (args: Args) => {
+ let translateMiddleValue = '';
+ if (args.translateMiddle === 'both') {
+ translateMiddleValue = ' translate-middle';
+ } else if (args.translateMiddle === 'x') {
+ translateMiddleValue = ' translate-middle-x';
+ } else if (args.translateMiddle === 'y') {
+ translateMiddleValue = ' translate-middle-y';
+ }
+ return html`
+
+ `;
+ },
+};
+
+export default meta;
+
+type Story = StoryObj;
+
+export const Default: Story = {
+ decorators: [
+ (story, context) =>
+ html`
+
+ ${context.args.position === 'fixed'
+ ? html`
`
+ : ''}
+
+ ${story()}
+ ${bombArgs({
+ start: ['0', '50', '100'],
+ top: ['0', '50', '100'],
+ }).map(
+ args => html`
`,
+ )}
+
+
+ `,
+ ],
+};
+
+export const TranslateMiddle: Story = {
+ decorators: [
+ story =>
+ html` ${story()}
`,
+ ],
+ render: () => {
+ return html`
+
`;
+ },
+};
diff --git a/packages/documentation/src/stories/utilities/position/position.styles.scss b/packages/documentation/src/stories/utilities/position/position.styles.scss
new file mode 100644
index 0000000000..3f4769a3e7
--- /dev/null
+++ b/packages/documentation/src/stories/utilities/position/position.styles.scss
@@ -0,0 +1,135 @@
+@use '@swisspost/design-system-styles/core' as post;
+
+@mixin square {
+ width: 2rem;
+ height: 2rem;
+ opacity: 0.8;
+ border-radius: post.$border-radius;
+}
+
+@mixin centered-dot {
+ &::after {
+ content: '';
+ background-color: post.$dark;
+ width: 0.5rem;
+ height: 0.5rem;
+ border-radius: 100%;
+ position: absolute;
+ left: 50%;
+ top: 50%;
+ transform: translate(-50%, -50%);
+ }
+}
+
+// Docs styling
+.translate-middle-container {
+ height: 20rem;
+ flex: 0 0 50%;
+ @include centered-dot();
+
+ > * {
+ @include square;
+ }
+}
+
+.position-outer-container {
+ margin: 2rem;
+
+ img {
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ }
+
+ .position-container {
+ height: 12rem;
+ background-color: post.$gray;
+
+ .pos-element {
+ width: 0.5rem;
+ height: 0.5rem;
+ border-radius: 100%;
+ position: absolute;
+ transform: translate(-50%, -50%);
+ background-color: post.$dark;
+ }
+
+ .bg-yellow {
+ width: 2rem;
+ height: 2rem;
+ border-radius: post.$border-radius;
+ }
+ }
+
+ &-sticky {
+ overflow-y: scroll;
+ overflow-x: hidden;
+ height: 12rem;
+
+ .position-container {
+ height: 40rem;
+ }
+
+ .pos-element {
+ display: none;
+ }
+ }
+
+ &-fixed {
+ .position-container {
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
+ overflow: hidden;
+ }
+
+ .pos-element {
+ display: none;
+ }
+
+ .position-fixed {
+ position: absolute !important;
+ }
+ }
+}
+
+// Snapshots styling
+.snapshot-outer-container {
+ position: relative;
+ max-height: 8rem;
+ overflow-y: scroll;
+}
+
+.snapshot-container {
+ height: 16rem;
+ margin: 2rem;
+
+ .bg-dark {
+ width: 2rem;
+ height: 2rem;
+ border-radius: post.$border-radius;
+ }
+
+ .bg-yellow {
+ padding: 1rem;
+ display: inline-block;
+ border-radius: post.$border-radius;
+ }
+}
+
+.snapshot-arrange-container,
+.snapshot-translate-middle-container {
+ height: 5rem;
+ border-radius: post.$border-radius;
+ position: relative;
+ background-color: post.$gray;
+ margin: 2rem;
+
+ > * {
+ @include square;
+ position: absolute;
+ }
+}
+
+.snapshot-translate-middle-container {
+ @include centered-dot();
+}
diff --git a/packages/styles/src/themes/bootstrap/_utilities.scss b/packages/styles/src/themes/bootstrap/_utilities.scss
index faed868339..0696634c6c 100644
--- a/packages/styles/src/themes/bootstrap/_utilities.scss
+++ b/packages/styles/src/themes/bootstrap/_utilities.scss
@@ -45,6 +45,13 @@ $utilities: map.remove($utilities, 'float');
$utilities: map.remove($utilities, 'opacity');
+$utilities: map.remove($utilities, 'position');
+$utilities: map.remove($utilities, 'top');
+$utilities: map.remove($utilities, 'bottom');
+$utilities: map.remove($utilities, 'start');
+$utilities: map.remove($utilities, 'end');
+$utilities: map.remove($utilities, 'translate-middle');
+
$utilities: map.remove($utilities, 'overflow');
$utilities: map.remove($utilities, 'overflow-x');
$utilities: map.remove($utilities, 'overflow-y');
diff --git a/packages/styles/src/utilities/_variables.scss b/packages/styles/src/utilities/_variables.scss
index e1df53d7fa..d09cf091b1 100644
--- a/packages/styles/src/utilities/_variables.scss
+++ b/packages/styles/src/utilities/_variables.scss
@@ -21,6 +21,12 @@
Our API is based on bootstrap utility API, more information is available here: https://getbootstrap.com/docs/5.3/utilities/api/
*/
+$position-values: (
+ 0: 0,
+ 50: 50%,
+ 100: 100%,
+);
+
$utilities: (
'align': (
property: vertical-align,
@@ -254,6 +260,37 @@ $utilities: (
values: inline inline-block block grid inline-grid table table-row table-cell flex inline-flex
none,
),
+ 'position': (
+ property: position,
+ values: static relative absolute fixed sticky,
+ ),
+ 'top': (
+ property: top,
+ values: $position-values,
+ ),
+ 'bottom': (
+ property: bottom,
+ values: $position-values,
+ ),
+ 'start': (
+ property: left,
+ class: start,
+ values: $position-values,
+ ),
+ 'end': (
+ property: right,
+ class: end,
+ values: $position-values,
+ ),
+ 'translate-middle': (
+ property: transform,
+ class: translate-middle,
+ values: (
+ null: translate(-50%, -50%),
+ x: translateX(-50%),
+ y: translateY(-50%),
+ ),
+ ),
'overflow': (
property: overflow,
values: auto hidden visible scroll,
From 5cef591c5b4a7895db8455ddc6ab892aa6a7813a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Mon, 9 Dec 2024 11:45:43 +0100
Subject: [PATCH 03/21] fix(components): update generated files (#4180)
---
packages/components/src/components/post-icon/readme.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/components/src/components/post-icon/readme.md b/packages/components/src/components/post-icon/readme.md
index b59e3eab25..8b1c4de7d4 100644
--- a/packages/components/src/components/post-icon/readme.md
+++ b/packages/components/src/components/post-icon/readme.md
@@ -22,8 +22,8 @@ some content
### Used by
- - [post-back-to-top](../post-back-to-top)
- [post-accordion-item](../post-accordion-item)
+ - [post-back-to-top](../post-back-to-top)
- [post-banner](../post-banner)
- [post-breadcrumb-item](../post-breadcrumb-item)
- [post-card-control](../post-card-control)
@@ -34,8 +34,8 @@ some content
### Graph
```mermaid
graph TD;
- post-back-to-top --> post-icon
post-accordion-item --> post-icon
+ post-back-to-top --> post-icon
post-banner --> post-icon
post-breadcrumb-item --> post-icon
post-card-control --> post-icon
From 82de51424b36c06f3a4c352ea083e3492c39bf75 Mon Sep 17 00:00:00 2001
From: Swiss Post Bot <103635272+swisspost-bot@users.noreply.github.com>
Date: Mon, 9 Dec 2024 16:50:17 +0100
Subject: [PATCH 04/21] =?UTF-8?q?chore(changesets):=20=F0=9F=A6=8B?=
=?UTF-8?q?=F0=9F=93=A6=20publish=20packages=20(main)=20(next)=20(#4138)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.
⚠️⚠️⚠️⚠️⚠️⚠️
`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.
⚠️⚠️⚠️⚠️⚠️⚠️
# Releases
## @swisspost/design-system-styles@9.0.0-next.8
### Major Changes
- Removed size variants for textarea form control. The sizing classes
`.form-control-sm`, `.form-control-rg` and `.form-control-lg` for
textarea no longer have any effect and can be removed safely. (by
[@leagrdv](https://github.com/leagrdv) with
[#4062](https://github.com/swisspost/design-system/pull/4062))
### Minor Changes
- Internalized bootstrap position utilities into the design system. (by
[@leagrdv](https://github.com/leagrdv) with
[#3988](https://github.com/swisspost/design-system/pull/3988))
- Implemented simple check list component. (by
[@myrta2302](https://github.com/myrta2302) with
[#4171](https://github.com/swisspost/design-system/pull/4171))
- Created the `search-input` component. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#4099](https://github.com/swisspost/design-system/pull/4099))
- Added list mixins `list-bullet`, `list-revert` and `list-unstyled`.
(by [@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Updated `.form-control` textarea to new Post design. (by
[@leagrdv](https://github.com/leagrdv) with
[#4062](https://github.com/swisspost/design-system/pull/4062))
### Patch Changes
- Fixed ´switch´ alignment for long labels. (by
[@schaertim](https://github.com/schaertim) with
[#4140](https://github.com/swisspost/design-system/pull/4140))
- Updated the ´post-accordion´ styles to match the new Post design. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Reverted `ol` lists to use standard display (not grid). (by
[@leagrdv](https://github.com/leagrdv) with
[#4110](https://github.com/swisspost/design-system/pull/4110))
- Updated fieldset-legend styles with Design Tokens. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
## @swisspost/design-system-components@9.0.0-next.8
### Minor Changes
- Ιmplemented the back-to-top button component. (by
[@myrta2302](https://github.com/myrta2302) with
[#3991](https://github.com/swisspost/design-system/pull/3991))
- Added the capability to use a slotted img as a logo inside
´accordion-items´. (by [@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-icons@9.0.0-next.8
- @swisspost/design-system-styles@9.0.0-next.8
## @swisspost/design-system-icons@9.0.0-next.8
### Minor Changes
- Added icon number 2633. (by [@leagrdv](https://github.com/leagrdv)
with [#4166](https://github.com/swisspost/design-system/pull/4166))
### Patch Changes
- Removed `fill` and `stroke` attributes on the icons output files. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
## @swisspost/design-system-components-angular@9.0.0-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.8
## @swisspost/design-system-components-react@9.0.0-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-components@9.0.0-next.8
## @swisspost/design-system-intranet-header@9.0.0-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
## @swisspost/design-system-styles-primeng@9.0.0-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
## @swisspost/design-system-migrations@9.0.0-next.8
## @swisspost/design-system-tokens@9.0.0-next.8
## @swisspost/design-system-documentation@6.0.0-next.9
### Major Changes
- Removed size variants for textarea form control. The sizing classes
`.form-control-sm`, `.form-control-rg` and `.form-control-lg` for
textarea no longer have any effect and can be removed safely. (by
[@leagrdv](https://github.com/leagrdv) with
[#4062](https://github.com/swisspost/design-system/pull/4062))
### Minor Changes
- Internalized bootstrap position utilities into the design system. (by
[@leagrdv](https://github.com/leagrdv) with
[#3988](https://github.com/swisspost/design-system/pull/3988))
- Implemented simple check list component. (by
[@myrta2302](https://github.com/myrta2302) with
[#4171](https://github.com/swisspost/design-system/pull/4171))
- Ιmplemented the back-to-top button component. (by
[@myrta2302](https://github.com/myrta2302) with
[#3991](https://github.com/swisspost/design-system/pull/3991))
- Created the `search-input` component. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#4099](https://github.com/swisspost/design-system/pull/4099))
- Updated documentation to display the currently selected theme and
channel SCSS file. (by [@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Added a ´post-accordion´ example showing logo usage. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Added list mixins `list-bullet`, `list-revert` and `list-unstyled`.
(by [@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Updated `.form-control` textarea to new Post design. (by
[@leagrdv](https://github.com/leagrdv) with
[#4062](https://github.com/swisspost/design-system/pull/4062))
- Added tokens package icon to the home page (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
### Patch Changes
- Reverted `ol` lists to use standard display (not grid). (by
[@leagrdv](https://github.com/leagrdv) with
[#4110](https://github.com/swisspost/design-system/pull/4110))
- Added ´btn-link´ class to remove inline padding. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Added classes to fix banner sizing in controls. (by
[@leagrdv](https://github.com/leagrdv) with
[#4166](https://github.com/swisspost/design-system/pull/4166))
- Updated dependencies:
- @swisspost/design-system-icons@9.0.0-next.8
- @swisspost/design-system-styles@9.0.0-next.8
- @swisspost/design-system-components@9.0.0-next.8
- @swisspost/internet-header@2.0.0-next.8
- @swisspost/design-system-components-react@9.0.0-next.8
- @swisspost/design-system-tokens@9.0.0-next.8
## @swisspost/design-system-components-angular-workspace@1.1.10-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
- @swisspost/design-system-components@9.0.0-next.8
## @swisspost/internet-header@2.0.0-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
## @swisspost/design-system-intranet-header-workspace@3.0.22-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
## @swisspost/design-system-intranet-header-showcase@1.0.10-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-intranet-header@9.0.0-next.8
## @swisspost/design-system-nextjs-integration@0.1.14-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
- @swisspost/internet-header@2.0.0-next.8
- @swisspost/design-system-components-react@9.0.0-next.8
## @swisspost/design-system-styles-primeng-workspace@1.0.6-next.8
### Patch Changes
- Updated dependencies:
- @swisspost/design-system-styles@9.0.0-next.8
---------
Co-authored-by: github-actions[bot]
---
.changeset/pre.json | 19 ++++++
packages/components-angular/CHANGELOG.md | 8 +++
packages/components-angular/package.json | 6 +-
.../projects/components/CHANGELOG.md | 7 +++
.../projects/components/package.json | 4 +-
packages/components-react/CHANGELOG.md | 7 +++
packages/components-react/package.json | 4 +-
packages/components/CHANGELOG.md | 14 +++++
packages/components/package.json | 6 +-
packages/documentation/CHANGELOG.md | 41 ++++++++++++
packages/documentation/package.json | 18 +++---
packages/documentation/public/_redirects | 1 +
.../documentation/public/assets/versions.json | 62 ++++++++++++++-----
packages/icons/CHANGELOG.md | 10 +++
packages/icons/package.json | 2 +-
packages/internet-header/CHANGELOG.md | 7 +++
packages/internet-header/package.json | 4 +-
.../intranet-header-workspace/CHANGELOG.md | 7 +++
.../intranet-header-workspace/package.json | 4 +-
.../intranet-header-showcase/CHANGELOG.md | 7 +++
.../intranet-header-showcase/package.json | 4 +-
.../projects/intranet-header/CHANGELOG.md | 7 +++
.../projects/intranet-header/package.json | 6 +-
packages/migrations/CHANGELOG.md | 2 +
packages/migrations/package.json | 2 +-
packages/nextjs-integration/CHANGELOG.md | 9 +++
packages/nextjs-integration/package.json | 8 +--
.../styles-primeng-workspace/CHANGELOG.md | 7 +++
.../styles-primeng-workspace/package.json | 4 +-
.../projects/styles-primeng/CHANGELOG.md | 7 +++
.../projects/styles-primeng/package.json | 4 +-
packages/styles/CHANGELOG.md | 28 +++++++++
packages/styles/package.json | 6 +-
packages/tokens/CHANGELOG.md | 2 +
packages/tokens/package.json | 2 +-
pnpm-lock.yaml | 52 ++++++++--------
36 files changed, 303 insertions(+), 85 deletions(-)
diff --git a/.changeset/pre.json b/.changeset/pre.json
index 80d49ff168..dd59e1d095 100644
--- a/.changeset/pre.json
+++ b/.changeset/pre.json
@@ -25,6 +25,7 @@
"2024-10-17-update-icons",
"2024-10-27-update-icons",
"2024-11-10-update-icons",
+ "2024-11-17-update-icons",
"beige-jobs-do",
"big-frogs-admire",
"big-hats-clap",
@@ -34,9 +35,11 @@
"breezy-cups-add",
"brown-badgers-dream",
"chatty-kiwis-travel",
+ "chatty-spoons-unite",
"chilled-owls-walk",
"clean-icons-complain",
"clean-windows-think",
+ "clever-cheetahs-draw",
"cold-baboons-appear",
"cold-panthers-vanish",
"cuddly-bears-check",
@@ -44,6 +47,7 @@
"dirty-mayflies-taste",
"dirty-squids-hunt",
"dry-moons-walk",
+ "dull-falcons-hope",
"eight-turkeys-matter",
"eleven-keys-work",
"empty-islands-kneel",
@@ -53,18 +57,25 @@
"fifty-dodos-wait",
"fifty-students-call",
"five-hornets-sin",
+ "flat-bears-tap",
"friendly-insects-breathe",
"funny-shrimps-care",
"giant-games-swim",
"gold-chairs-grin",
"gold-chefs-rule",
+ "gold-dryers-drop",
"gorgeous-flowers-flow",
"great-humans-talk",
+ "grumpy-lobsters-agree",
"grumpy-parrots-wonder",
"heavy-rats-explode",
+ "hip-gifts-give",
+ "honest-numbers-end",
+ "itchy-meals-drum",
"khaki-cougars-itch",
"kind-buses-trade",
"kind-papayas-provide",
+ "large-hornets-complain",
"lazy-gorillas-admire",
"lemon-clocks-clean",
"long-shrimps-roll",
@@ -78,8 +89,10 @@
"neat-suits-provide",
"nervous-rocks-shop",
"new-goats-impress",
+ "new-pianos-mix",
"nice-ligers-attend",
"ninety-nails-float",
+ "orange-maps-tan",
"pink-weeks-relate",
"plenty-apricots-raise",
"plenty-taxis-hear",
@@ -89,6 +102,7 @@
"proud-cheetahs-act",
"proud-moons-impress",
"purple-impalas-own",
+ "purple-terms-march",
"quick-buses-give",
"quick-eagles-watch",
"quick-mails-joke",
@@ -98,6 +112,7 @@
"red-lies-lick",
"red-moose-do",
"rich-timers-listen",
+ "rotten-bats-look",
"selfish-bats-run",
"selfish-ways-know",
"shaggy-experts-give",
@@ -118,12 +133,16 @@
"strange-mice-bake",
"stupid-walls-tie",
"tame-terms-push",
+ "thirty-cats-juggle",
"three-lies-do",
"tidy-dolls-walk",
"tidy-keys-push",
+ "tidy-paws-type",
"tiny-socks-count",
+ "tricky-crews-agree",
"twenty-items-drum",
"warm-drinks-prove",
+ "weak-falcons-study",
"weak-jars-rhyme",
"wild-bugs-work",
"wise-spies-shave",
diff --git a/packages/components-angular/CHANGELOG.md b/packages/components-angular/CHANGELOG.md
index 38224f9245..dac8ffd293 100644
--- a/packages/components-angular/CHANGELOG.md
+++ b/packages/components-angular/CHANGELOG.md
@@ -1,5 +1,13 @@
# @swisspost/design-system-components-angular-workspace
+## 1.1.10-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+ - @swisspost/design-system-components@9.0.0-next.8
+
## 1.1.10-next.7
### Patch Changes
diff --git a/packages/components-angular/package.json b/packages/components-angular/package.json
index a8d4ab4901..77476b8813 100644
--- a/packages/components-angular/package.json
+++ b/packages/components-angular/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular-workspace",
- "version": "1.1.10-next.7",
+ "version": "1.1.10-next.8",
"scripts": {
"start": "ng serve --port 9210",
"build": "ng build components",
@@ -18,8 +18,8 @@
"@angular/platform-browser": "18.2.13",
"@angular/platform-browser-dynamic": "18.2.13",
"@angular/router": "18.2.13",
- "@swisspost/design-system-components": "workspace:9.0.0-next.7",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-components": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"rxjs": "7.8.1",
"tslib": "2.6.3",
"zone.js": "0.14.8"
diff --git a/packages/components-angular/projects/components/CHANGELOG.md b/packages/components-angular/projects/components/CHANGELOG.md
index c7d9d5bc3e..9711a4ec09 100644
--- a/packages/components-angular/projects/components/CHANGELOG.md
+++ b/packages/components-angular/projects/components/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-components-angular
+## 9.0.0-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-components@9.0.0-next.8
+
## 9.0.0-next.7
### Patch Changes
diff --git a/packages/components-angular/projects/components/package.json b/packages/components-angular/projects/components/package.json
index 744df7dfb4..845bdc6452 100644
--- a/packages/components-angular/projects/components/package.json
+++ b/packages/components-angular/projects/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-angular",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Swiss Post Design System - Angular Wrapper Components",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -19,7 +19,7 @@
},
"dependencies": {
"tslib": "2.6.3",
- "@swisspost/design-system-components": "workspace:9.0.0-next.7"
+ "@swisspost/design-system-components": "workspace:9.0.0-next.8"
},
"peerDependencies": {
"@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0",
diff --git a/packages/components-react/CHANGELOG.md b/packages/components-react/CHANGELOG.md
index 6c731ee1cf..8c9419a1cd 100644
--- a/packages/components-react/CHANGELOG.md
+++ b/packages/components-react/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-components-react
+## 9.0.0-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-components@9.0.0-next.8
+
## 9.0.0-next.7
### Patch Changes
diff --git a/packages/components-react/package.json b/packages/components-react/package.json
index 8d78c35624..6db0c2c351 100644
--- a/packages/components-react/package.json
+++ b/packages/components-react/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components-react",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Design System React Components for easy integration with the React ecosystem",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
"lint": "eslint src/**/*.ts"
},
"dependencies": {
- "@swisspost/design-system-components": "workspace:9.0.0-next.7"
+ "@swisspost/design-system-components": "workspace:9.0.0-next.8"
},
"devDependencies": {
"@types/node": "20.14.14",
diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md
index b75c025c64..22e837531b 100644
--- a/packages/components/CHANGELOG.md
+++ b/packages/components/CHANGELOG.md
@@ -1,5 +1,19 @@
# @swisspost/design-system-components
+## 9.0.0-next.8
+
+### Minor Changes
+
+- Ιmplemented the back-to-top button component. (by [@myrta2302](https://github.com/myrta2302) with [#3991](https://github.com/swisspost/design-system/pull/3991))
+
+- Added the capability to use a slotted img as a logo inside ´accordion-items´. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-icons@9.0.0-next.8
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 9.0.0-next.7
### Minor Changes
diff --git a/packages/components/package.json b/packages/components/package.json
index f8846c8438..db4866c06a 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-components",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
"license": "Apache-2.0",
"main": "dist/index.cjs.js",
@@ -40,8 +40,8 @@
"dependencies": {
"@floating-ui/dom": "1.6.8",
"@oddbird/popover-polyfill": "0.3.7",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
- "@swisspost/design-system-icons": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-icons": "workspace:9.0.0-next.8",
"ally.js": "1.4.1",
"long-press-event": "2.5.0"
},
diff --git a/packages/documentation/CHANGELOG.md b/packages/documentation/CHANGELOG.md
index 8989dd9398..b7c127a363 100644
--- a/packages/documentation/CHANGELOG.md
+++ b/packages/documentation/CHANGELOG.md
@@ -1,5 +1,46 @@
# @swisspost/design-system-documentation
+## 6.0.0-next.9
+
+### Major Changes
+
+- Removed size variants for textarea form control. The sizing classes `.form-control-sm`, `.form-control-rg` and `.form-control-lg` for textarea no longer have any effect and can be removed safely. (by [@leagrdv](https://github.com/leagrdv) with [#4062](https://github.com/swisspost/design-system/pull/4062))
+
+### Minor Changes
+
+- Internalized bootstrap position utilities into the design system. (by [@leagrdv](https://github.com/leagrdv) with [#3988](https://github.com/swisspost/design-system/pull/3988))
+
+- Implemented simple check list component. (by [@myrta2302](https://github.com/myrta2302) with [#4171](https://github.com/swisspost/design-system/pull/4171))
+
+- Ιmplemented the back-to-top button component. (by [@myrta2302](https://github.com/myrta2302) with [#3991](https://github.com/swisspost/design-system/pull/3991))
+
+- Created the `search-input` component. (by [@alionazherdetska](https://github.com/alionazherdetska) with [#4099](https://github.com/swisspost/design-system/pull/4099))
+
+- Updated documentation to display the currently selected theme and channel SCSS file. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Added a ´post-accordion´ example showing logo usage. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Added list mixins `list-bullet`, `list-revert` and `list-unstyled`. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Updated `.form-control` textarea to new Post design. (by [@leagrdv](https://github.com/leagrdv) with [#4062](https://github.com/swisspost/design-system/pull/4062))
+
+- Added tokens package icon to the home page (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+### Patch Changes
+
+- Reverted `ol` lists to use standard display (not grid). (by [@leagrdv](https://github.com/leagrdv) with [#4110](https://github.com/swisspost/design-system/pull/4110))
+
+- Added ´btn-link´ class to remove inline padding. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Added classes to fix banner sizing in controls. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+- Updated dependencies:
+ - @swisspost/design-system-icons@9.0.0-next.8
+ - @swisspost/design-system-styles@9.0.0-next.8
+ - @swisspost/design-system-components@9.0.0-next.8
+ - @swisspost/internet-header@2.0.0-next.8
+ - @swisspost/design-system-components-react@9.0.0-next.8
+ - @swisspost/design-system-tokens@9.0.0-next.8
+
## 6.0.0-next.8
### Major Changes
diff --git a/packages/documentation/package.json b/packages/documentation/package.json
index 5cf18b11dd..6c16faee3d 100644
--- a/packages/documentation/package.json
+++ b/packages/documentation/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-documentation",
- "version": "6.0.0-next.8",
+ "version": "6.0.0-next.9",
"description": "Swiss Post Design System Documentation.",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -28,12 +28,12 @@
"lint": "eslint **/*.{ts,tsx,mdx}"
},
"dependencies": {
- "@swisspost/design-system-components": "workspace:9.0.0-next.7",
- "@swisspost/design-system-components-react": "workspace:9.0.0-next.7",
- "@swisspost/design-system-icons": "workspace:9.0.0-next.7",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
- "@swisspost/design-system-tokens": "workspace:9.0.0-next.7",
- "@swisspost/internet-header": "workspace:2.0.0-next.7",
+ "@swisspost/design-system-components": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-components-react": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-icons": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-tokens": "workspace:9.0.0-next.8",
+ "@swisspost/internet-header": "workspace:2.0.0-next.8",
"bootstrap": "5.3.3"
},
"devDependencies": {
@@ -54,8 +54,8 @@
"@storybook/types": "8.3.6",
"@storybook/web-components": "8.3.6",
"@storybook/web-components-vite": "8.3.6",
- "@swisspost/design-system-components-angular": "workspace:9.0.0-next.7",
- "@swisspost/design-system-intranet-header": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-components-angular": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-intranet-header": "workspace:9.0.0-next.8",
"@types/css-modules": "1.0.5",
"@types/mdx": "2.0.13",
"@types/react": "18.3.3",
diff --git a/packages/documentation/public/_redirects b/packages/documentation/public/_redirects
index 79a6c132ab..9537b51f5f 100644
--- a/packages/documentation/public/_redirects
+++ b/packages/documentation/public/_redirects
@@ -10,3 +10,4 @@
+
diff --git a/packages/documentation/public/assets/versions.json b/packages/documentation/public/assets/versions.json
index c24ab117ec..3aff9f35d1 100644
--- a/packages/documentation/public/assets/versions.json
+++ b/packages/documentation/public/assets/versions.json
@@ -1,7 +1,7 @@
[
{
"title": "Version 9",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.",
"url": "https://design-system.post.ch",
"dependencies": {
@@ -9,22 +9,50 @@
"@ng-bootstrap/ng-bootstrap": "^17.0.0",
"bootstrap": "~5.3.0",
"@swisspost/design-system-changelog-github": "1.0.2",
- "@swisspost/design-system-components": "9.0.0-next.7",
- "@swisspost/design-system-components-angular-workspace": "1.1.10-next.7",
- "@swisspost/design-system-components-angular": "9.0.0-next.7",
- "@swisspost/design-system-components-react": "9.0.0-next.7",
- "@swisspost/design-system-documentation": "6.0.0-next.8",
- "@swisspost/design-system-icons": "9.0.0-next.7",
- "@swisspost/internet-header": "2.0.0-next.7",
- "@swisspost/design-system-intranet-header-workspace": "3.0.22-next.7",
- "@swisspost/design-system-intranet-header": "9.0.0-next.7",
- "@swisspost/design-system-intranet-header-showcase": "1.0.10-next.7",
- "@swisspost/design-system-migrations": "9.0.0-next.7",
- "@swisspost/design-system-nextjs-integration": "0.1.14-next.7",
- "@swisspost/design-system-styles": "9.0.0-next.7",
- "@swisspost/design-system-styles-primeng-workspace": "1.0.6-next.7",
- "@swisspost/design-system-styles-primeng": "9.0.0-next.7",
- "@swisspost/design-system-tokens": "9.0.0-next.7"
+ "@swisspost/design-system-components": "9.0.0-next.8",
+ "@swisspost/design-system-components-angular-workspace": "1.1.10-next.8",
+ "@swisspost/design-system-components-angular": "9.0.0-next.8",
+ "@swisspost/design-system-components-react": "9.0.0-next.8",
+ "@swisspost/design-system-documentation": "6.0.0-next.9",
+ "@swisspost/design-system-icons": "9.0.0-next.8",
+ "@swisspost/internet-header": "2.0.0-next.8",
+ "@swisspost/design-system-intranet-header-workspace": "3.0.22-next.8",
+ "@swisspost/design-system-intranet-header": "9.0.0-next.8",
+ "@swisspost/design-system-intranet-header-showcase": "1.0.10-next.8",
+ "@swisspost/design-system-migrations": "9.0.0-next.8",
+ "@swisspost/design-system-nextjs-integration": "0.1.14-next.8",
+ "@swisspost/design-system-styles": "9.0.0-next.8",
+ "@swisspost/design-system-styles-primeng-workspace": "1.0.6-next.8",
+ "@swisspost/design-system-styles-primeng": "9.0.0-next.8",
+ "@swisspost/design-system-tokens": "9.0.0-next.8"
+ }
+ },
+ {
+ "title": "Version 9",
+ "version": "9.0.0-next.7",
+ "description": "Pattern documentation, code snippets and implementation guidelines for the Design System Styles.",
+ "url": "https://swisspost-design-system-version-9.netlify.app",
+ "dependencies": {
+ "@angular/core": "^18.0.0",
+ "@ng-bootstrap/ng-bootstrap": "^17.0.0",
+ "bootstrap": "~5.3.0",
+ "@swisspost/design-system-changelog-github": "1.0.2",
+ "@swisspost/design-system-components": "9.0.0-next.2",
+ "@swisspost/design-system-components-angular-workspace": "1.1.10-next.2",
+ "@swisspost/design-system-components-angular": "9.0.0-next.2",
+ "@swisspost/design-system-components-react": "9.0.0-next.2",
+ "@swisspost/design-system-documentation": "6.0.0-next.2",
+ "@swisspost/design-system-icons": "9.0.0-next.2",
+ "@swisspost/internet-header": "1.14.6-next.2",
+ "@swisspost/design-system-intranet-header-workspace": "3.0.22-next.2",
+ "@swisspost/design-system-intranet-header": "9.0.0-next.2",
+ "@swisspost/design-system-intranet-header-showcase": "1.0.10-next.2",
+ "@swisspost/design-system-migrations": "9.0.0-next.2",
+ "@swisspost/design-system-nextjs-integration": "0.1.14-next.2",
+ "@swisspost/design-system-styles": "9.0.0-next.2",
+ "@swisspost/design-system-styles-primeng-workspace": "1.0.6-next.2",
+ "@swisspost/design-system-styles-primeng": "9.0.0-next.2",
+ "@swisspost/design-system-tokens": "9.0.0-next.2"
}
},
{
diff --git a/packages/icons/CHANGELOG.md b/packages/icons/CHANGELOG.md
index 2a4fbe2c35..a7bace80e0 100644
--- a/packages/icons/CHANGELOG.md
+++ b/packages/icons/CHANGELOG.md
@@ -1,5 +1,15 @@
# @swisspost/design-system-icons
+## 9.0.0-next.8
+
+### Minor Changes
+
+- Added icon number 2633. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+### Patch Changes
+
+- Removed `fill` and `stroke` attributes on the icons output files. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
## 9.0.0-next.7
### Minor Changes
diff --git a/packages/icons/package.json b/packages/icons/package.json
index 10f7a95fea..b03a924ce3 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-icons",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "A collection of Swiss Post icons intended for use with the Design System.",
"author": "Swiss Post ",
"license": "Apache-2.0",
diff --git a/packages/internet-header/CHANGELOG.md b/packages/internet-header/CHANGELOG.md
index dcccb3d5d6..2db462b044 100644
--- a/packages/internet-header/CHANGELOG.md
+++ b/packages/internet-header/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/internet-header
+## 2.0.0-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 2.0.0-next.7
### Patch Changes
diff --git a/packages/internet-header/package.json b/packages/internet-header/package.json
index 74c981a876..76ecec1354 100644
--- a/packages/internet-header/package.json
+++ b/packages/internet-header/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/internet-header",
- "version": "2.0.0-next.7",
+ "version": "2.0.0-next.8",
"description": "The header for client facing applications.",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -43,7 +43,7 @@
"generate": "stencil generate"
},
"dependencies": {
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"body-scroll-lock": "4.0.0-beta.0",
"iframe-resizer": "4.4.5",
"jquery": "3.7.1",
diff --git a/packages/intranet-header-workspace/CHANGELOG.md b/packages/intranet-header-workspace/CHANGELOG.md
index 429ea175b6..0f5df4ea7d 100644
--- a/packages/intranet-header-workspace/CHANGELOG.md
+++ b/packages/intranet-header-workspace/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-intranet-header-workspace
+## 3.0.22-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 3.0.22-next.7
### Patch Changes
diff --git a/packages/intranet-header-workspace/package.json b/packages/intranet-header-workspace/package.json
index f42dcc11e4..95956f194b 100644
--- a/packages/intranet-header-workspace/package.json
+++ b/packages/intranet-header-workspace/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-intranet-header-workspace",
- "version": "3.0.22-next.7",
+ "version": "3.0.22-next.8",
"license": "Apache-2.0",
"private": true,
"scripts": {
@@ -23,7 +23,7 @@
"@angular/router": "18.2.13",
"@ng-bootstrap/ng-bootstrap": "17.0.0",
"@popperjs/core": "2.11.8",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"rxjs": "7.8.1",
"tslib": "2.6.3",
"watch": "1.0.2",
diff --git a/packages/intranet-header-workspace/projects/intranet-header-showcase/CHANGELOG.md b/packages/intranet-header-workspace/projects/intranet-header-showcase/CHANGELOG.md
index 7e83abd2c0..b21c4ce804 100644
--- a/packages/intranet-header-workspace/projects/intranet-header-showcase/CHANGELOG.md
+++ b/packages/intranet-header-workspace/projects/intranet-header-showcase/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-intranet-header-showcase
+## 1.0.10-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-intranet-header@9.0.0-next.8
+
## 1.0.10-next.7
### Patch Changes
diff --git a/packages/intranet-header-workspace/projects/intranet-header-showcase/package.json b/packages/intranet-header-workspace/projects/intranet-header-showcase/package.json
index 3a9db6d2b7..c18ba6a52f 100644
--- a/packages/intranet-header-workspace/projects/intranet-header-showcase/package.json
+++ b/packages/intranet-header-workspace/projects/intranet-header-showcase/package.json
@@ -1,9 +1,9 @@
{
"name": "@swisspost/design-system-intranet-header-showcase",
- "version": "1.0.10-next.7",
+ "version": "1.0.10-next.8",
"license": "Apache-2.0",
"private": true,
"dependencies": {
- "@swisspost/design-system-intranet-header": "workspace:9.0.0-next.7"
+ "@swisspost/design-system-intranet-header": "workspace:9.0.0-next.8"
}
}
diff --git a/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md b/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md
index 10464b6274..7e2cc17e10 100644
--- a/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md
+++ b/packages/intranet-header-workspace/projects/intranet-header/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-intranet-header
+## 9.0.0-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 9.0.0-next.7
### Patch Changes
diff --git a/packages/intranet-header-workspace/projects/intranet-header/package.json b/packages/intranet-header-workspace/projects/intranet-header/package.json
index 0cc2b40caa..cee0dd96ac 100644
--- a/packages/intranet-header-workspace/projects/intranet-header/package.json
+++ b/packages/intranet-header-workspace/projects/intranet-header/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-intranet-header",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Intranet header for internal Swiss Post applications as an Angular component.",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -18,11 +18,11 @@
"linkDirectory": true
},
"dependencies": {
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"tslib": "2.6.3"
},
"devDependencies": {
- "@swisspost/design-system-intranet-header-workspace": "workspace:3.0.22-next.7"
+ "@swisspost/design-system-intranet-header-workspace": "workspace:3.0.22-next.8"
},
"peerDependencies": {
"@angular/common": "^16.0.0 || ^17.0.0 || ^18.0.0",
diff --git a/packages/migrations/CHANGELOG.md b/packages/migrations/CHANGELOG.md
index 6634e1544e..95272121a5 100644
--- a/packages/migrations/CHANGELOG.md
+++ b/packages/migrations/CHANGELOG.md
@@ -1,5 +1,7 @@
# @swisspost/design-system-migrations
+## 9.0.0-next.8
+
## 9.0.0-next.7
## 9.0.0-next.6
diff --git a/packages/migrations/package.json b/packages/migrations/package.json
index daa2edc015..856c6ed0fa 100644
--- a/packages/migrations/package.json
+++ b/packages/migrations/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-migrations",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Scripts to migrate an Angular application from one Design System version to another.",
"author": "Swiss Post ",
"license": "Apache-2.0",
diff --git a/packages/nextjs-integration/CHANGELOG.md b/packages/nextjs-integration/CHANGELOG.md
index 402b387a50..26d7a15efb 100644
--- a/packages/nextjs-integration/CHANGELOG.md
+++ b/packages/nextjs-integration/CHANGELOG.md
@@ -1,5 +1,14 @@
# @swisspost/design-system-nextjs-integration
+## 0.1.14-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+ - @swisspost/internet-header@2.0.0-next.8
+ - @swisspost/design-system-components-react@9.0.0-next.8
+
## 0.1.14-next.7
### Patch Changes
diff --git a/packages/nextjs-integration/package.json b/packages/nextjs-integration/package.json
index 1a20a1d79b..a343f8f10b 100644
--- a/packages/nextjs-integration/package.json
+++ b/packages/nextjs-integration/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-nextjs-integration",
- "version": "0.1.14-next.7",
+ "version": "0.1.14-next.8",
"private": true,
"scripts": {
"dev": "next dev",
@@ -9,9 +9,9 @@
"lint": "next lint"
},
"dependencies": {
- "@swisspost/design-system-components-react": "workspace:9.0.0-next.7",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
- "@swisspost/internet-header": "workspace:2.0.0-next.7",
+ "@swisspost/design-system-components-react": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
+ "@swisspost/internet-header": "workspace:2.0.0-next.8",
"next": "15.0.1",
"react": "^18",
"react-dom": "^18"
diff --git a/packages/styles-primeng-workspace/CHANGELOG.md b/packages/styles-primeng-workspace/CHANGELOG.md
index 0041f70376..b4d766e1b4 100644
--- a/packages/styles-primeng-workspace/CHANGELOG.md
+++ b/packages/styles-primeng-workspace/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-styles-primeng-workspace
+## 1.0.6-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 1.0.6-next.7
### Patch Changes
diff --git a/packages/styles-primeng-workspace/package.json b/packages/styles-primeng-workspace/package.json
index 46757fc4e2..5a58e45f77 100644
--- a/packages/styles-primeng-workspace/package.json
+++ b/packages/styles-primeng-workspace/package.json
@@ -1,7 +1,7 @@
{
"name": "@swisspost/design-system-styles-primeng-workspace",
"description": "Showcase for a Post like custom prime-ng theme",
- "version": "1.0.6-next.7",
+ "version": "1.0.6-next.8",
"license": "Apache-2.0",
"private": true,
"scripts": {
@@ -22,7 +22,7 @@
"@angular/platform-browser": "18.2.13",
"@angular/platform-browser-dynamic": "18.2.13",
"@angular/router": "18.2.13",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"primeng": "17.18.7",
"rxjs": "7.8.1",
"tslib": "2.6.3",
diff --git a/packages/styles-primeng-workspace/projects/styles-primeng/CHANGELOG.md b/packages/styles-primeng-workspace/projects/styles-primeng/CHANGELOG.md
index 0f6b216972..e384aee8c3 100644
--- a/packages/styles-primeng-workspace/projects/styles-primeng/CHANGELOG.md
+++ b/packages/styles-primeng-workspace/projects/styles-primeng/CHANGELOG.md
@@ -1,5 +1,12 @@
# @swisspost/design-system-styles-primeng
+## 9.0.0-next.8
+
+### Patch Changes
+
+- Updated dependencies:
+ - @swisspost/design-system-styles@9.0.0-next.8
+
## 9.0.0-next.7
### Patch Changes
diff --git a/packages/styles-primeng-workspace/projects/styles-primeng/package.json b/packages/styles-primeng-workspace/projects/styles-primeng/package.json
index 259b594a13..90f2fe1261 100644
--- a/packages/styles-primeng-workspace/projects/styles-primeng/package.json
+++ b/packages/styles-primeng-workspace/projects/styles-primeng/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-styles-primeng",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Swiss Post styles for PrimeNg datatable.",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -23,7 +23,7 @@
"primeng": "^17.18.0"
},
"dependencies": {
- "@swisspost/design-system-styles": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"tslib": "2.6.3"
},
"sideEffects": false,
diff --git a/packages/styles/CHANGELOG.md b/packages/styles/CHANGELOG.md
index 999141bf9d..3edf73590f 100644
--- a/packages/styles/CHANGELOG.md
+++ b/packages/styles/CHANGELOG.md
@@ -1,5 +1,33 @@
# @swisspost/design-system-styles
+## 9.0.0-next.8
+
+### Major Changes
+
+- Removed size variants for textarea form control. The sizing classes `.form-control-sm`, `.form-control-rg` and `.form-control-lg` for textarea no longer have any effect and can be removed safely. (by [@leagrdv](https://github.com/leagrdv) with [#4062](https://github.com/swisspost/design-system/pull/4062))
+
+### Minor Changes
+
+- Internalized bootstrap position utilities into the design system. (by [@leagrdv](https://github.com/leagrdv) with [#3988](https://github.com/swisspost/design-system/pull/3988))
+
+- Implemented simple check list component. (by [@myrta2302](https://github.com/myrta2302) with [#4171](https://github.com/swisspost/design-system/pull/4171))
+
+- Created the `search-input` component. (by [@alionazherdetska](https://github.com/alionazherdetska) with [#4099](https://github.com/swisspost/design-system/pull/4099))
+
+- Added list mixins `list-bullet`, `list-revert` and `list-unstyled`. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Updated `.form-control` textarea to new Post design. (by [@leagrdv](https://github.com/leagrdv) with [#4062](https://github.com/swisspost/design-system/pull/4062))
+
+### Patch Changes
+
+- Fixed ´switch´ alignment for long labels. (by [@schaertim](https://github.com/schaertim) with [#4140](https://github.com/swisspost/design-system/pull/4140))
+
+- Updated the ´post-accordion´ styles to match the new Post design. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
+- Reverted `ol` lists to use standard display (not grid). (by [@leagrdv](https://github.com/leagrdv) with [#4110](https://github.com/swisspost/design-system/pull/4110))
+
+- Updated fieldset-legend styles with Design Tokens. (by [@leagrdv](https://github.com/leagrdv) with [#4166](https://github.com/swisspost/design-system/pull/4166))
+
## 9.0.0-next.7
### Major Changes
diff --git a/packages/styles/package.json b/packages/styles/package.json
index 10ee2bb47e..2c1fd2a663 100644
--- a/packages/styles/package.json
+++ b/packages/styles/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-styles",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Design System Styles for the Swiss Post web platform.",
"author": "Swiss Post ",
"license": "Apache-2.0",
@@ -49,8 +49,8 @@
"gulp-sourcemaps": "3.0.0"
},
"devDependencies": {
- "@swisspost/design-system-icons": "workspace:9.0.0-next.7",
- "@swisspost/design-system-tokens": "workspace:9.0.0-next.7",
+ "@swisspost/design-system-icons": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-tokens": "workspace:9.0.0-next.8",
"@types/node": "20.14.14",
"autoprefixer": "10.4.19",
"copyfiles": "2.4.1",
diff --git a/packages/tokens/CHANGELOG.md b/packages/tokens/CHANGELOG.md
index bf2d92a020..ee303ee4eb 100644
--- a/packages/tokens/CHANGELOG.md
+++ b/packages/tokens/CHANGELOG.md
@@ -1,5 +1,7 @@
# @swisspost/design-system-tokens
+## 9.0.0-next.8
+
## 9.0.0-next.7
## 9.0.0-next.6
diff --git a/packages/tokens/package.json b/packages/tokens/package.json
index 363280d4ba..ed53edebf7 100644
--- a/packages/tokens/package.json
+++ b/packages/tokens/package.json
@@ -1,6 +1,6 @@
{
"name": "@swisspost/design-system-tokens",
- "version": "9.0.0-next.7",
+ "version": "9.0.0-next.8",
"description": "Design Tokens for the Swiss Post Design System.",
"author": "Swiss Post ",
"license": "Apache-2.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d4d7f41d09..fb076973e5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -47,10 +47,10 @@ importers:
specifier: 0.3.7
version: 0.3.7
'@swisspost/design-system-icons':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../icons
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
ally.js:
specifier: 1.4.1
@@ -156,10 +156,10 @@ importers:
specifier: 18.2.13
version: 18.2.13(@angular/common@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@18.2.13(@angular/animations@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8)))(rxjs@7.8.1)
'@swisspost/design-system-components':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
rxjs:
specifier: 7.8.1
@@ -238,7 +238,7 @@ importers:
specifier: ^16.0.0 || ^17.0.0 || ^18.0.0
version: 18.1.1(rxjs@7.8.1)(zone.js@0.14.8)
'@swisspost/design-system-components':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../../../components
tslib:
specifier: 2.6.3
@@ -248,7 +248,7 @@ importers:
packages/components-react:
dependencies:
'@swisspost/design-system-components':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components
devDependencies:
'@types/node':
@@ -300,22 +300,22 @@ importers:
packages/documentation:
dependencies:
'@swisspost/design-system-components':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components
'@swisspost/design-system-components-react':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components-react
'@swisspost/design-system-icons':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../icons
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
'@swisspost/design-system-tokens':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../tokens/dist
'@swisspost/internet-header':
- specifier: workspace:2.0.0-next.7
+ specifier: workspace:2.0.0-next.8
version: link:../internet-header
bootstrap:
specifier: 5.3.3
@@ -373,10 +373,10 @@ importers:
specifier: 8.3.6
version: 8.3.6(lit@3.1.4)(storybook@8.2.7(@babel/preset-env@7.25.3(@babel/core@7.25.2)))(typescript@5.5.4)(vite@5.4.8(@types/node@22.7.9)(less@4.2.0)(sass-embedded@1.78.0)(sass@1.78.0)(terser@5.31.6))
'@swisspost/design-system-components-angular':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components-angular/dist/components
'@swisspost/design-system-intranet-header':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../intranet-header-workspace/dist/intranet-header
'@types/css-modules':
specifier: 1.0.5
@@ -517,7 +517,7 @@ importers:
packages/internet-header:
dependencies:
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
body-scroll-lock:
specifier: 4.0.0-beta.0
@@ -668,7 +668,7 @@ importers:
specifier: 2.11.8
version: 2.11.8
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
rxjs:
specifier: 7.8.1
@@ -762,21 +762,21 @@ importers:
specifier: ^16.0.0 || ^17.0.0 || ^18.0.0
version: 18.1.1(rxjs@7.8.1)(zone.js@0.14.8)
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../../../styles/dist
tslib:
specifier: 2.6.3
version: 2.6.3
devDependencies:
'@swisspost/design-system-intranet-header-workspace':
- specifier: workspace:3.0.22-next.7
+ specifier: workspace:3.0.22-next.8
version: link:../..
publishDirectory: ../../dist/intranet-header
packages/intranet-header-workspace/projects/intranet-header-showcase:
dependencies:
'@swisspost/design-system-intranet-header':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../../dist/intranet-header
packages/migrations:
@@ -822,13 +822,13 @@ importers:
packages/nextjs-integration:
dependencies:
'@swisspost/design-system-components-react':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../components-react
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
'@swisspost/internet-header':
- specifier: workspace:2.0.0-next.7
+ specifier: workspace:2.0.0-next.8
version: link:../internet-header
next:
specifier: 15.0.1
@@ -890,10 +890,10 @@ importers:
version: 3.0.0
devDependencies:
'@swisspost/design-system-icons':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../icons
'@swisspost/design-system-tokens':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../tokens/dist
'@types/node':
specifier: 20.14.14
@@ -984,7 +984,7 @@ importers:
specifier: 18.2.13
version: 18.2.13(@angular/common@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(@angular/platform-browser@18.2.13(@angular/animations@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8)))(@angular/common@18.2.13(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8))(rxjs@7.8.1))(@angular/core@18.2.13(rxjs@7.8.1)(zone.js@0.14.8)))(rxjs@7.8.1)
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../styles/dist
primeng:
specifier: 17.18.7
@@ -1060,7 +1060,7 @@ importers:
specifier: ^18.0.0
version: 18.1.1(rxjs@7.8.1)(zone.js@0.14.8)
'@swisspost/design-system-styles':
- specifier: workspace:9.0.0-next.7
+ specifier: workspace:9.0.0-next.8
version: link:../../../styles/dist
primeng:
specifier: ^17.18.0
From 041d6fe4a0f5cae786c311ecd3bc6af71688cb8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Tue, 10 Dec 2024 10:50:24 +0100
Subject: [PATCH 05/21] fix(components): update post-list component (#4137)
- Reflected the `horizontal` property on the host to allow updating the
orientation with `document.querySelector('post-list).horizontal = true;`
- Reduced the selectors specificity to allow flexible styling
- Gave a default value to all CSS custom properties
---
.changeset/tough-cheetahs-clean.md | 5 +++++
.../src/components/post-list/post-list.scss | 16 ++++++++--------
.../src/components/post-list/post-list.tsx | 4 ++--
3 files changed, 15 insertions(+), 10 deletions(-)
create mode 100644 .changeset/tough-cheetahs-clean.md
diff --git a/.changeset/tough-cheetahs-clean.md b/.changeset/tough-cheetahs-clean.md
new file mode 100644
index 0000000000..431ddce686
--- /dev/null
+++ b/.changeset/tough-cheetahs-clean.md
@@ -0,0 +1,5 @@
+---
+'@swisspost/design-system-components': patch
+---
+
+Fixed an issue with the post-list component where the `horizontal` property could not be set programmatically. Also, reduced the specificity of the component's styles to make customization easier.
diff --git a/packages/components/src/components/post-list/post-list.scss b/packages/components/src/components/post-list/post-list.scss
index d492599b77..015930ea35 100644
--- a/packages/components/src/components/post-list/post-list.scss
+++ b/packages/components/src/components/post-list/post-list.scss
@@ -2,20 +2,20 @@
post-list {
display: flex;
- gap: var(--post-list-title-gap);
flex-direction: column;
- align-items: flex-start;
+ gap: var(--post-list-title-gap, 0);
- & > div[role='list'] {
- flex-direction: column;
+ > [role='list'] {
display: flex;
- gap: var(--post-list-item-gap);
+ flex-direction: column;
+ gap: var(--post-list-item-gap, 0);
}
- &[horizontal]:not([horizontal='false']) {
+ &:where([horizontal]:not([horizontal='false'])) {
flex-direction: row;
- align-items: baseline;
- & > div[role='list'] {
+ align-items: center;
+
+ > [role='list'] {
flex-direction: row;
align-items: center;
}
diff --git a/packages/components/src/components/post-list/post-list.tsx b/packages/components/src/components/post-list/post-list.tsx
index bdccc14ab8..47efe5a797 100644
--- a/packages/components/src/components/post-list/post-list.tsx
+++ b/packages/components/src/components/post-list/post-list.tsx
@@ -27,7 +27,7 @@ export class PostList {
/**
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
*/
- @Prop() readonly horizontal: boolean = false;
+ @Prop({ reflect: true }) readonly horizontal: boolean = false;
private titleEl: HTMLElement;
@@ -35,7 +35,7 @@ export class PostList {
/**
* Get the id set on the host element or use a random id by default
*/
- this.titleId = `list-${crypto.randomUUID()}`;
+ this.titleId = `title-${this.host.id || crypto.randomUUID()}`;
}
componentDidLoad() {
From c24101c3bd2f8ceb7e3f33558db6d518f1b2524b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Tue, 10 Dec 2024 11:00:40 +0100
Subject: [PATCH 06/21] feat(component): add main navigation styles (#4148)
This PR is only about styling the main navigation according to the
design.
The behavior will come with another PR.
---------
Co-authored-by: Philipp Gfeller
---
.../components/post-header/post-header.scss | 74 ++++++++----
.../components/post-header/post-header.tsx | 15 +--
.../post-mainnavigation.scss | 113 +++++++++++-------
.../post-mainnavigation.tsx | 2 +-
packages/components/src/index.html | 11 +-
.../header/components/header.markup.ts | 9 +-
6 files changed, 142 insertions(+), 82 deletions(-)
diff --git a/packages/components/src/components/post-header/post-header.scss b/packages/components/src/components/post-header/post-header.scss
index 9703e1e3ea..5879d615d4 100644
--- a/packages/components/src/components/post-header/post-header.scss
+++ b/packages/components/src/components/post-header/post-header.scss
@@ -1,4 +1,5 @@
@use '@swisspost/design-system-styles/mixins/media';
+@use '@swisspost/design-system-styles/variables/animation';
*,
::before,
@@ -24,6 +25,13 @@
justify-content: space-between;
}
+// ensures the global-header and title-header are above the main-navigation
+.global-header,
+.title-header {
+ position: relative;
+ z-index: 1;
+}
+
.global-header {
background-color: #ffcc00;
display: flex;
@@ -79,18 +87,12 @@ slot[name='post-logo'] {
gap: 1rem;
}
-.title-header,
-.main-navigation {
+.title-header {
display: flex;
align-items: center;
padding-inline: 12px;
background: white;
-}
-
-.title-header {
height: var(--main-header-height);
- display: flex;
- align-items: center;
@include media.max(lg) {
border-bottom: 1px solid black;
@@ -105,32 +107,54 @@ slot[name='post-logo'] {
font-size: 28px !important;
}
-.main-navigation {
- position: sticky;
- top: 24px;
- height: var(--main-header-height);
-
+.mobile-toggle {
@include media.min(lg) {
- border-bottom: 1px solid black;
+ display: none;
}
+}
- @include media.max(lg) {
- display: none;
+.navigation {
+ background: var(--post-core-color-brand-white);
+ box-shadow: var(--post-core-elevation-3);
+}
+
+// only for tablet and mobile
+@include media.max(lg) {
+ .navigation {
position: absolute;
- top: var(--header-height);
- bottom: 0;
- width: 100%;
- background-color: white;
- height: auto;
+ inset-inline: 0;
+ inset-block-end: calc(100vh - var(--header-height));
+ transition: transform animation.$transition-time-area-medium animation.$transition-easing-accelerate;
&.extended {
- display: block;
+ transform: translateY(100%);
+ transition-timing-function: animation.$transition-easing-decelerate;
}
}
-}
-.mobile-toggle {
- @include media.min(lg) {
- display: none;
+ ::slotted(post-mainnavigation),
+ .navigation-footer {
+ display: flex;
+ flex-direction: column;
+ padding-block: var(--post-core-dimension-16) var(--post-core-dimension-24);
+ padding-inline: var(--post-core-dimension-32);
+ opacity: 0;
+ transition-property: opacity;
+ transition-delay: animation.$transition-time-area-medium;
+
+ .navigation.extended & {
+ opacity: 1;
+ transition-delay: 0s;
+ }
+ }
+
+ ::slotted(post-mainnavigation) {
+ background-color: var(--post-core-color-sandgrey-002);
+ gap: var(--post-core-dimension-32);
+ }
+
+ .navigation-footer {
+ background-color: var(--post-core-color-sandgrey-006);
+ gap: var(--post-core-dimension-24);
}
}
diff --git a/packages/components/src/components/post-header/post-header.tsx b/packages/components/src/components/post-header/post-header.tsx
index 7fa2a51450..0dc1a9a233 100644
--- a/packages/components/src/components/post-header/post-header.tsx
+++ b/packages/components/src/components/post-header/post-header.tsx
@@ -83,9 +83,9 @@ export class PostHeader {
}
render() {
- const mainNavClasses = ['main-navigation'];
+ const navigationClasses = ['navigation'];
if (this.mobileMenuExtended) {
- mainNavClasses.push('extended');
+ navigationClasses.push('extended');
}
return (
@@ -114,13 +114,14 @@ export class PostHeader {
-
+
+
{(this.device === 'mobile' || this.device === 'tablet') && (
-
- )}
- {(this.device === 'mobile' || this.device === 'tablet') && (
-
+
)}
diff --git a/packages/components/src/components/post-mainnavigation/post-mainnavigation.scss b/packages/components/src/components/post-mainnavigation/post-mainnavigation.scss
index df9a46e239..7496c6c553 100644
--- a/packages/components/src/components/post-mainnavigation/post-mainnavigation.scss
+++ b/packages/components/src/components/post-mainnavigation/post-mainnavigation.scss
@@ -1,60 +1,87 @@
+@use '@swisspost/design-system-styles/mixins/button';
+@use '@swisspost/design-system-styles/mixins/icons';
@use '@swisspost/design-system-styles/mixins/media';
@use '@swisspost/design-system-styles/mixins/utilities';
+@use '@swisspost/design-system-styles/functions/tokens';
+@use '@swisspost/design-system-styles/tokens/elements';
+@use '@swisspost/design-system-styles/variables/animation';
-*,
-::before,
-::after {
- box-sizing: border-box;
-}
+post-mainnavigation {
+ // reset links and buttons
+ post-list-item {
+ a {
+ text-decoration: none;
+ border-radius: 0;
+ }
-slot[name='back-button'],
-[slot='back-button'] {
- @include media.min(lg) {
- display: none;
- }
-}
+ button {
+ @include button.reset-button;
+ text-align: start;
+ }
-h2 {
- @include media.min(lg) {
- @include utilities.visuallyhidden();
+ a,
+ button {
+ &:hover {
+ color: tokens.get('post-link-hover-fg', elements.$post-link);
+ }
+ }
}
-}
-post-mainnavigation {
- height: 100%;
-}
+ // desktop styles
+ @include media.min(lg) {
+ post-list > [role="list"] {
+ flex-direction: row;
+ }
-:host {
- height: 100%;
- display: block;
-}
+ post-list-item {
+ a,
+ button {
+ padding-inline: var(--post-core-dimension-12);
+ height: var(--post-core-dimension-56);
+ border-block: var(--post-core-dimension-4) solid transparent;
+ display: flex;
+ align-items: center;
+ gap: var(--post-core-dimension-4);
+ font-size: var(--post-core-font-size-16);
+ }
-.main-navigation {
- margin-block: 0;
- list-style: none;
- display: flex;
- padding-left: 0;
- gap: 1rem;
+ // styles specific to for the mega-dropdown buttons
+ button {
+ padding-inline-end: var(--post-core-dimension-12);
+ transition: border-block-end-color animation.$transition-base-timing;
- @include media.max(lg) {
- flex-direction: column;
- }
+ &::after {
+ content: '';
+ @include icons.icon(2113);
+ height: var(--post-core-dimension-24);
+ width: var(--post-core-dimension-24);
+ transition: transform animation.$transition-base-timing;
+ }
- > post-list {
- display: flex;
- align-items: stretch;
- gap: 1rem;
- height: 100%;
+ &.selected {
+ border-block-end-color: currentColor;
+ font-weight: var(--post-core-font-weight-700);
- @include media.max(lg) {
- flex-direction: column;
+ &::after {
+ transform: rotate(180deg);
+ }
+ }
+ }
}
}
- a,
- post-megadropdown-toggle {
- height: 100%;
- display: flex;
- align-items: center;
+ // tablet/mobile styles
+ @include media.max(lg) {
+ post-list-item {
+ a,
+ button {
+ display: block;
+ width: 100%;
+ padding-block: var(--post-core-dimension-12);
+ padding-inline-end: var(--post-core-dimension-12);
+ border-bottom: var(--post-core-dimension-1) solid currentColor;
+ font-weight: var(--post-core-font-weight-700);
+ }
+ }
}
}
diff --git a/packages/components/src/components/post-mainnavigation/post-mainnavigation.tsx b/packages/components/src/components/post-mainnavigation/post-mainnavigation.tsx
index c78965cd44..dc82772c1b 100644
--- a/packages/components/src/components/post-mainnavigation/post-mainnavigation.tsx
+++ b/packages/components/src/components/post-mainnavigation/post-mainnavigation.tsx
@@ -36,7 +36,7 @@ export class PostMainnavigation {
this.handleBackButtonClick()} class="back-button">
-
+
diff --git a/packages/components/src/index.html b/packages/components/src/index.html
index bf61af6af2..ca9c2ba3e2 100644
--- a/packages/components/src/index.html
+++ b/packages/components/src/index.html
@@ -52,11 +52,16 @@ Application title
- <- Back
-
-
+
+ Back
+
+
+
+ Main Navigation
+
Briefe
+ Pakete
diff --git a/packages/documentation/src/stories/components/header/components/header.markup.ts b/packages/documentation/src/stories/components/header/components/header.markup.ts
index 0f320929dd..bcf707bab0 100644
--- a/packages/documentation/src/stories/components/header/components/header.markup.ts
+++ b/packages/documentation/src/stories/components/header/components/header.markup.ts
@@ -40,11 +40,14 @@ export default html`
- <- Back
-
-
+
+ Back
+
+
+ Main Navigation
Briefe
+ Pakete
From 4934d3d8a81414ea551eb23256ad6e154ca4caab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Tue, 10 Dec 2024 11:01:00 +0100
Subject: [PATCH 07/21] chore: stop running snapshot tests on changeset branch
(#4197)
---
.github/workflows/snapshot-tests.yaml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/.github/workflows/snapshot-tests.yaml b/.github/workflows/snapshot-tests.yaml
index 2cc7df4fd7..6bd047bed4 100644
--- a/.github/workflows/snapshot-tests.yaml
+++ b/.github/workflows/snapshot-tests.yaml
@@ -9,9 +9,6 @@
name: Run snapshot tests
on:
workflow_dispatch:
- push:
- branches:
- - 'changeset-release/main'
jobs:
snapshots:
From 416b4a4a1c02f46720bbfd566e1c7e4026788a3e Mon Sep 17 00:00:00 2001
From: Swiss Post Bot <103635272+swisspost-bot@users.noreply.github.com>
Date: Tue, 10 Dec 2024 14:25:58 +0100
Subject: [PATCH 08/21] chore(tokens): :art: update tokens (#4162)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Merge this PR to update the tokens in the main branch.
---------
Co-authored-by: Travaglini Alessio <158268546+Vandapanda@users.noreply.github.com>
Co-authored-by: Oliver Schürch
Co-authored-by: Alizé Debray
Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com>
Co-authored-by: Myrta Sakellariou
---
.../post-breadcrumb-item.scss | 4 +-
.../styles/src/components/validation.scss | 4 --
.../tokens/tokensstudio-generated/tokens.json | 58 +++++++++++--------
3 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/packages/components/src/components/post-breadcrumb-item/post-breadcrumb-item.scss b/packages/components/src/components/post-breadcrumb-item/post-breadcrumb-item.scss
index b701ee7d87..a1c5c021e7 100644
--- a/packages/components/src/components/post-breadcrumb-item/post-breadcrumb-item.scss
+++ b/packages/components/src/components/post-breadcrumb-item/post-breadcrumb-item.scss
@@ -21,8 +21,8 @@ tokens.$default-map: components.$post-breadcrumb;
text-decoration: tokens.get('breadcrumb-link-enabled-text-decoration');
post-icon {
- height: tokens.get('breadcrum-icon-size');
- width: tokens.get('breadcrum-icon-size');
+ height: tokens.get('breadcrumb-icon-size');
+ width: tokens.get('breadcrumb-icon-size');
}
&:hover {
diff --git a/packages/styles/src/components/validation.scss b/packages/styles/src/components/validation.scss
index 10ae689995..e0f6f9de9b 100644
--- a/packages/styles/src/components/validation.scss
+++ b/packages/styles/src/components/validation.scss
@@ -66,11 +66,7 @@ input[type='range'],
:has(input[type='radio']) {
~ .invalid-feedback,
~ .valid-feedback {
- padding: tokens.get('post-validation-group-padding-block-text');
-
&::before {
- margin-top: calc(-1 * #{tokens.get('post-validation-group-padding-block-text')});
- margin-bottom: calc(-1 * #{tokens.get('post-validation-group-padding-block-text')});
height: tokens.get('post-validation-group-icon-size');
width: tokens.get('post-validation-group-icon-size');
display: inline-block;
diff --git a/packages/tokens/tokensstudio-generated/tokens.json b/packages/tokens/tokensstudio-generated/tokens.json
index 7951a72803..f9f4255a0d 100644
--- a/packages/tokens/tokensstudio-generated/tokens.json
+++ b/packages/tokens/tokensstudio-generated/tokens.json
@@ -4307,11 +4307,15 @@
"$type": "color",
"$value": "{post.scheme.color.interactive.primary.disabled.fg1}"
}
+ },
+ "hint": {
+ "spacing": {
+ "block": {
+ "$type": "spacing",
+ "$value": "{post.core.dimension.6}"
+ }
+ }
}
- },
- "post-hint-spacing-block": {
- "$type": "spacing",
- "$value": "{post.core.dimension.6}"
}
},
"Components/Avatar": {
@@ -4711,9 +4715,7 @@
"$value": "{post.core.text-decoration.none}"
}
}
- }
- },
- "breadcrum": {
+ },
"icon": {
"size": {
"$type": "sizing",
@@ -7739,22 +7741,28 @@
"$value": "{post.device.spacing.gap.inline.10}"
}
},
- "padding": {
+ "icon": {
+ "size": {
+ "$type": "sizing",
+ "$value": "{post.device.sizing.interactive.icon.size4}"
+ },
"block": {
- "text": {
+ "start": {
"$type": "spacing",
- "$value": "{post.device.spacing.padding.12}"
+ "$value": "{post.core.dimension.2}"
+ },
+ "end": {
+ "$type": "spacing",
+ "$value": "{post.core.dimension.3}"
}
}
},
- "icon": {
- "size": {
- "$type": "sizing",
- "$value": "{post.device.sizing.interactive.icon.size}"
- },
- "padding": {
- "$type": "spacing",
- "$value": "{post.device.spacing.padding.1}"
+ "padding": {
+ "inline": {
+ "start": {
+ "$type": "spacing",
+ "$value": "{post.core.dimension.4}"
+ }
}
}
},
@@ -9971,7 +9979,7 @@
"post.assist.font-size": "c42fdefaa61b7c5d6916a6b6768599b19da3fd4d",
"post.assist.enabled-fg": "72f5b4238dee1bf68e93e9731b4fd8f2e5e38fd5",
"post.assist.disabled-fg": "511343125c5a9ce9901570e967e37962ab1eca6d",
- "post-hint-spacing-block": "a991d75103776c3686418a2e6004246f2d0a9000",
+ "post.hint.spacing.block": "3165d98279644e157898945596f89c99ca404b5c",
"post.avatar.size": "fdc1484ed63e645974c9a435ca62dd46b26a84e0",
"post.avatar.enabled-bg": "1863e011a6589c655c1f6ce1b3fa63e4153719e2",
"post.avatar.enabled-fg": "9fbe58313d6bf87fab98be4e81191e79f1a038b0",
@@ -10038,7 +10046,7 @@
"post.breadcrumb.gap.inline.outer": "a27d40f4b9b6ff82fb67a17af041b2fa748f8052",
"post.breadcrumb.gap.inline.inner": "395509fba5bd7e8b56a54b41135824ef83aa3ebd",
"post.breadcrumb.selected.font-weight": "c26e16ce48b87d25d173a722ccbc4f7c3c438841",
- "post.breadcrum.icon.size": "72338131139ad3c76c52523326371d15f5284ac5",
+ "post.breadcrumb.icon.size": "72338131139ad3c76c52523326371d15f5284ac5",
"post.button.gap.block.1": "3e82d61efc18438a6b93f41164d21274625669f9",
"post.button.gap.block.2": "8a0326da592650c30bcb20142232098e0ad98fa5",
"post.button.gap.inline.switch": "17e19389cbcf9f145dcbbe0f663f31df65206e62",
@@ -10355,7 +10363,7 @@
"post.input.search.label.empty.padding.inline.end": "86ee6eb34d947957e558ec6f2eff1c74e350412e",
"post.input.search.label.filled.padding.inline.end": "374f2471e81aba44b09a6f6f31f51b47ce87d9a8",
"post.input.search.icon.border-radius": "cd54dafcf43f1524a4759289263baffa23699e17",
- "post.search.position.inline.end.icon": "c9cb98cb13f74d863fc6c426b34a9182866eb17f",
+ "post.search.position.inline.end.icon": "7dec1a6368f3f33341da9c53c8af35b4f649702d",
"post.button-segmented.horizontal.border-radius": "fd01f5b8308c2c2826717c59169509fa33da4431",
"post.button-segmented.vertical.border-radius": "bb62d30e7b32d7c62d6a825888a8248af47f3532",
"post.button-segmented.selected-fg": "23623d928ead25f0bcf0b42baed2bfdf8345daad",
@@ -10521,6 +10529,7 @@
"post.textarea.position.block.start.validation": "7d3d68f9b92e710e7441d84c31b27639e13e301a",
"post.textarea.assist.font-size": "8fb89a9effda2d25fe148de62b52eb6ddc9a280b",
"post.textarea.validated.padding.inline.end": "82e187d41e38dad89946c46aa1d8875e096accfd",
+ "post.textarea.placeholder-fg": "b77a1c8e294ec724d8298a7c4c6c965d2c763610",
"post.text-highlighted.bg": "27774fb04cb78f58f13895b833a4851be7e3486b",
"post.text-highlighted.fg": "8416d4e5337654acf592f5345f7c151d3cd63a4d",
"post.text-highlighted.padding.text": "e5e01d5010f1a45ce796d305a526ce01fa5d7a7b",
@@ -10587,14 +10596,15 @@
"post.toast.color.error-stroke": "3432663173b4389104a12a668043e3681e2faa69",
"post.toast.color.error-icon": "3096bb0553257be18a766df213ba83685ab63040",
"post.validation.group.gap.inline": "a76607434c393d743d38b71824d9d76e533acca2",
- "post.validation.group.padding.block.text": "37b3685608b0a7ee4bdc297d80ea55c77856c2ee",
"post.validation.group.icon.size": "ce5d0ae47c1f80a7ea39a6e5b25a00055c450e7d",
- "post.validation.group.icon.padding": "4c33e15ce67a9e7398af3f45682774c919629a17",
"post.validation.error": "796bdb2fc917b5948438070371ae60d214216795",
"post.validation.success": "b59a525aa81840396e6310baa880de4a66d23371",
"post.validation.input.padding.block": "4006573d3a03f1b053a844aaf89e14742a3d3646",
"post.validation.input.padding.inline": "8df0e5f5587acbb1f7acb67a97e200e2175d6469",
- "post.validation.font-size": "67f550629b478f48c1579f8acb13edceabbaee4f"
+ "post.validation.font-size": "67f550629b478f48c1579f8acb13edceabbaee4f",
+ "post.validation.group.padding.inline.start": "37c8364dbc202912a5a557a5f8cc026e1f84a3bf",
+ "post.validation.group.icon.block.start": "e52e3d301a820f000d2cd339f1fab72a5f09ce81",
+ "post.validation.group.icon.block.end": "f30710c36d79b96b33c33ad8e67524cc1ae3cd7a"
}
},
{
From 456317c33eddfc1680b6ec81961be555766ecb5b Mon Sep 17 00:00:00 2001
From: Myrta Sakellariou <66249294+myrta2302@users.noreply.github.com>
Date: Tue, 10 Dec 2024 16:55:54 +0200
Subject: [PATCH 09/21] feat(styles): validation feedback with hint and single
radio/check (#4147)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Travaglini Alessio <158268546+Vandapanda@users.noreply.github.com>
Co-authored-by: Oliver Schürch
Co-authored-by: Swiss Post Bot <103635272+swisspost-bot@users.noreply.github.com>
Co-authored-by: Alizé Debray
Co-authored-by: Alizé Debray <33580481+alizedebray@users.noreply.github.com>
---
.../forms/validation/validation.stories.ts | 6 +--
packages/styles/src/components/form-hint.scss | 3 +-
.../styles/src/components/validation.scss | 53 +++++++++++++++----
3 files changed, 47 insertions(+), 15 deletions(-)
diff --git a/packages/documentation/src/stories/components/forms/validation/validation.stories.ts b/packages/documentation/src/stories/components/forms/validation/validation.stories.ts
index 19eaad8f00..bde17a7162 100644
--- a/packages/documentation/src/stories/components/forms/validation/validation.stories.ts
+++ b/packages/documentation/src/stories/components/forms/validation/validation.stories.ts
@@ -120,11 +120,11 @@ export const Input: Story = {
placeholder="Placeholder"
/>
Label
+ ${feedbackTemplate}
Hintus textus elare volare cantare hendrerit in vulputate velit esse molestie consequat, vel
illum dolore eu feugiat nulla facilisis.
- ${feedbackTemplate}
`;
},
};
@@ -239,11 +239,11 @@ export const Select: Story = {
Label
+ ${feedbackTemplate}
Hintus textus elare volare cantare hendrerit in vulputate velit esse molestie consequat, vel
illum dolore eu feugiat nulla facilisis.
- ${feedbackTemplate}
`;
},
};
@@ -301,11 +301,11 @@ export const TextArea: Story = {
>Label
+ ${feedbackTemplate}
Hintus textus elare volare cantare hendrerit in vulputate velit esse molestie consequat, vel
illum dolore eu feugiat nulla facilisis.
- ${feedbackTemplate}
`;
},
};
diff --git a/packages/styles/src/components/form-hint.scss b/packages/styles/src/components/form-hint.scss
index d3afda686f..0a52c325c3 100644
--- a/packages/styles/src/components/form-hint.scss
+++ b/packages/styles/src/components/form-hint.scss
@@ -6,9 +6,8 @@ tokens.$default-map: components.$post-assist;
.form-hint {
color: tokens.get('assist-enabled-fg');
padding-inline: tokens.get('assist-padding-inline');
- padding-block: tokens.get('assist-padding-block');
+ margin-block: tokens.get('post-assist-padding-block') !important;
font-size: tokens.get('assist-font-size');
- margin-block-start: 0;
}
.form-control:disabled .form-hint {
diff --git a/packages/styles/src/components/validation.scss b/packages/styles/src/components/validation.scss
index e0f6f9de9b..46385f00a0 100644
--- a/packages/styles/src/components/validation.scss
+++ b/packages/styles/src/components/validation.scss
@@ -12,11 +12,9 @@ Default feedback message classes
.valid-feedback,
.invalid-feedback {
display: none;
- align-items: center;
+ align-items: flex-start;
width: 100%;
margin: 0;
- padding: tokens.get('post-validation-input-padding-block')
- tokens.get('post-validation-input-padding-inline');
font-size: tokens.get('post-validation-font-size');
}
@@ -56,24 +54,59 @@ Default feedback message classes
}
}
+input[type='text'],
+select,
+textarea {
+ ~ .invalid-feedback,
+ ~ .valid-feedback {
+ margin-block: tokens.get('assist-padding-block', components.$post-assist) !important;
+ padding-inline: tokens.get('validation-input-padding-inline');
+ }
+}
+
/*
Checkbox and Radio box specific classes
*/
input[type='checkbox'],
input[type='radio'],
-input[type='range'],
:has(input[type='checkbox']),
:has(input[type='radio']) {
~ .invalid-feedback,
~ .valid-feedback {
+ padding-inline-start: tokens.get('validation-group-padding-inline-start');
+
&::before {
- height: tokens.get('post-validation-group-icon-size');
- width: tokens.get('post-validation-group-icon-size');
- display: inline-block;
- margin-inline-end: tokens.get('post-validation-group-gap-inline');
- background-color: currentColor;
- color: currentColor;
+ height: tokens.get('validation-group-icon-size');
+ width: tokens.get('validation-group-icon-size');
+ margin-block-start: tokens.get('validation-group-icon-block-start');
+ margin-block-end: tokens.get('validation-group-icon-block-end');
+ margin-inline-end: tokens.get('validation-group-gap-inline');
content: '';
+ flex-shrink: 0;
+ mask-size: contain;
+ mask-position: center;
+ mask-repeat: no-repeat;
+ }
+ }
+
+ input[type='radio'],
+ :has(input[type='radio']) {
+ ~ .invalid-feedback,
+ ~ .valid-feedback {
+ margin-block-start: tokens.get('radio-button-gap-block-group', components.$post-radio-button);
+ margin-block-end: tokens.get(
+ 'radio-button-padding-block-group',
+ components.$post-radio-button
+ );
+ }
+ }
+
+ input[type='checkbox'],
+ :has(input[type='checkbox']) {
+ ~ .invalid-feedback,
+ ~ .valid-feedback {
+ margin-block-start: tokens.get('checkbox-gap-block-group', components.$post-checkbox);
+ margin-block-end: tokens.get('checkbox-padding-block-group', components.$post-checkbox);
}
}
From 6c79d1c866b4a3e8a79cdf084a3dd3ec7417ad72 Mon Sep 17 00:00:00 2001
From: Lea
Date: Wed, 11 Dec 2024 23:12:30 +0100
Subject: [PATCH 10/21] feat(components): post-language-switch web component
(#4044)
Co-authored-by: Philipp Gfeller <1659006+gfellerph@users.noreply.github.com>
---
.changeset/yellow-gifts-sit.md | 6 +
packages/components/package.json | 5 +-
packages/components/src/components.d.ts | 63 ++++++++
.../components/post-header/post-header.tsx | 27 +++-
.../src/components/post-icon/readme.md | 2 +
.../post-language-option.scss | 39 +++++
.../post-language-option.tsx | 8 +
.../components/post-language-option/readme.md | 14 +-
.../post-language-switch.scss | 40 +++++
.../post-language-switch.tsx | 148 ++++++++++++++++++
.../components/post-language-switch/readme.md | 36 +++++
.../post-language-switch/switch-variants.ts | 3 +
.../post-menu-trigger/post-menu-trigger.tsx | 16 +-
.../components/post-menu-trigger/readme.md | 13 ++
.../src/components/post-menu/readme.md | 5 +
packages/components/src/index.html | 45 +++---
packages/components/src/index.ts | 1 +
.../components/language-switch.snapshot.ts | 7 +
.../header/components/header.markup.ts | 24 ++-
.../language-switch/language-switch.docs.mdx | 30 ++++
.../language-switch.snapshot.stories.ts | 37 +++++
.../language-switch.stories.ts | 85 ++++++++++
.../cypress/e2e/language-detection.cy.ts | 2 +-
...e-switch.cy.ts => language-switch-2.cy.ts} | 18 +--
.../cypress/e2e/main-slot.cy.ts | 2 +-
packages/internet-header/src/components.d.ts | 32 ++--
.../post-internet-header.tsx | 12 +-
.../components/post-internet-header/readme.md | 4 +-
.../components/post-language-switch-list.tsx | 0
.../post-language-switch-2.scss} | 0
.../post-language-switch-2.tsx} | 8 +-
.../readme.md | 8 +-
packages/internet-header/src/index.ts | 2 +-
pnpm-lock.yaml | 26 +--
34 files changed, 662 insertions(+), 106 deletions(-)
create mode 100644 .changeset/yellow-gifts-sit.md
create mode 100644 packages/components/src/components/post-language-switch/post-language-switch.scss
create mode 100644 packages/components/src/components/post-language-switch/post-language-switch.tsx
create mode 100644 packages/components/src/components/post-language-switch/readme.md
create mode 100644 packages/components/src/components/post-language-switch/switch-variants.ts
create mode 100644 packages/documentation/cypress/snapshots/components/language-switch.snapshot.ts
create mode 100644 packages/documentation/src/stories/components/header/language-switch/language-switch.docs.mdx
create mode 100644 packages/documentation/src/stories/components/header/language-switch/language-switch.snapshot.stories.ts
create mode 100644 packages/documentation/src/stories/components/header/language-switch/language-switch.stories.ts
rename packages/internet-header/cypress/e2e/{language-switch.cy.ts => language-switch-2.cy.ts} (91%)
rename packages/internet-header/src/components/{post-language-switch => post-language-switch-2}/components/post-language-switch-list.tsx (100%)
rename packages/internet-header/src/components/{post-language-switch/post-language-switch.scss => post-language-switch-2/post-language-switch-2.scss} (100%)
rename packages/internet-header/src/components/{post-language-switch/post-language-switch.tsx => post-language-switch-2/post-language-switch-2.tsx} (96%)
rename packages/internet-header/src/components/{post-language-switch => post-language-switch-2}/readme.md (91%)
diff --git a/.changeset/yellow-gifts-sit.md b/.changeset/yellow-gifts-sit.md
new file mode 100644
index 0000000000..6ad9f49882
--- /dev/null
+++ b/.changeset/yellow-gifts-sit.md
@@ -0,0 +1,6 @@
+---
+'@swisspost/design-system-documentation': minor
+'@swisspost/design-system-components': minor
+---
+
+Added the `post-language-switch` component that enables users to change the language of a page.
diff --git a/packages/components/package.json b/packages/components/package.json
index db4866c06a..2068ff5214 100644
--- a/packages/components/package.json
+++ b/packages/components/package.json
@@ -40,10 +40,11 @@
"dependencies": {
"@floating-ui/dom": "1.6.8",
"@oddbird/popover-polyfill": "0.3.7",
- "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"@swisspost/design-system-icons": "workspace:9.0.0-next.8",
+ "@swisspost/design-system-styles": "workspace:9.0.0-next.8",
"ally.js": "1.4.1",
- "long-press-event": "2.5.0"
+ "long-press-event": "2.5.0",
+ "nanoid": "5.0.9"
},
"devDependencies": {
"@percy/cli": "1.29.1",
diff --git a/packages/components/src/components.d.ts b/packages/components/src/components.d.ts
index d1a32e53ee..9acbc7fda6 100644
--- a/packages/components/src/components.d.ts
+++ b/packages/components/src/components.d.ts
@@ -7,9 +7,11 @@
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { HeadingLevel } from "./types/index";
import { BannerType } from "./components/post-banner/banner-types";
+import { SwitchVariant } from "./components/post-language-switch/switch-variants";
import { Placement } from "@floating-ui/dom";
export { HeadingLevel } from "./types/index";
export { BannerType } from "./components/post-banner/banner-types";
+export { SwitchVariant } from "./components/post-language-switch/switch-variants";
export { Placement } from "@floating-ui/dom";
export namespace Components {
interface PostAccordion {
@@ -216,6 +218,10 @@ export namespace Components {
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
*/
"code": string;
+ /**
+ * Used on parent component (post-language-switch) to detect elements that are manually added
+ */
+ "generated": boolean;
/**
* The full name of the language. For example, "Deutsch".
*/
@@ -228,6 +234,28 @@ export namespace Components {
* The URL used for the href attribute of the internal anchor. This field is optional; if not provided, a button will be used internally instead of an anchor.
*/
"url": string;
+ /**
+ * The variant of the post-language-switch parent (dynamically set by the parent)
+ */
+ "variant"?: SwitchVariant | null;
+ }
+ interface PostLanguageSwitch {
+ /**
+ * A title for the list of language options
+ */
+ "caption": string;
+ /**
+ * A descriptive text for the list of language options
+ */
+ "description": string;
+ /**
+ * The name of the language switch, which will be used on the dropdown as an ID
+ */
+ "name": string;
+ /**
+ * Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
+ */
+ "variant": SwitchVariant;
}
interface PostList {
/**
@@ -617,6 +645,12 @@ declare global {
prototype: HTMLPostLanguageOptionElement;
new (): HTMLPostLanguageOptionElement;
};
+ interface HTMLPostLanguageSwitchElement extends Components.PostLanguageSwitch, HTMLStencilElement {
+ }
+ var HTMLPostLanguageSwitchElement: {
+ prototype: HTMLPostLanguageSwitchElement;
+ new (): HTMLPostLanguageSwitchElement;
+ };
interface HTMLPostListElement extends Components.PostList, HTMLStencilElement {
}
var HTMLPostListElement: {
@@ -806,6 +840,7 @@ declare global {
"post-header": HTMLPostHeaderElement;
"post-icon": HTMLPostIconElement;
"post-language-option": HTMLPostLanguageOptionElement;
+ "post-language-switch": HTMLPostLanguageSwitchElement;
"post-list": HTMLPostListElement;
"post-list-item": HTMLPostListItemElement;
"post-logo": HTMLPostLogoElement;
@@ -1011,6 +1046,10 @@ declare namespace LocalJSX {
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
*/
"code": string;
+ /**
+ * Used on parent component (post-language-switch) to detect elements that are manually added
+ */
+ "generated"?: boolean;
/**
* The full name of the language. For example, "Deutsch".
*/
@@ -1023,6 +1062,28 @@ declare namespace LocalJSX {
* The URL used for the href attribute of the internal anchor. This field is optional; if not provided, a button will be used internally instead of an anchor.
*/
"url"?: string;
+ /**
+ * The variant of the post-language-switch parent (dynamically set by the parent)
+ */
+ "variant"?: SwitchVariant | null;
+ }
+ interface PostLanguageSwitch {
+ /**
+ * A title for the list of language options
+ */
+ "caption"?: string;
+ /**
+ * A descriptive text for the list of language options
+ */
+ "description"?: string;
+ /**
+ * The name of the language switch, which will be used on the dropdown as an ID
+ */
+ "name"?: string;
+ /**
+ * Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
+ */
+ "variant"?: SwitchVariant;
}
interface PostList {
/**
@@ -1202,6 +1263,7 @@ declare namespace LocalJSX {
"post-header": PostHeader;
"post-icon": PostIcon;
"post-language-option": PostLanguageOption;
+ "post-language-switch": PostLanguageSwitch;
"post-list": PostList;
"post-list-item": PostListItem;
"post-logo": PostLogo;
@@ -1245,6 +1307,7 @@ declare module "@stencil/core" {
*/
"post-icon": LocalJSX.PostIcon & JSXBase.HTMLAttributes;
"post-language-option": LocalJSX.PostLanguageOption & JSXBase.HTMLAttributes;
+ "post-language-switch": LocalJSX.PostLanguageSwitch & JSXBase.HTMLAttributes;
"post-list": LocalJSX.PostList & JSXBase.HTMLAttributes;
"post-list-item": LocalJSX.PostListItem & JSXBase.HTMLAttributes;
"post-logo": LocalJSX.PostLogo & JSXBase.HTMLAttributes;
diff --git a/packages/components/src/components/post-header/post-header.tsx b/packages/components/src/components/post-header/post-header.tsx
index 0dc1a9a233..c8a62dfbce 100644
--- a/packages/components/src/components/post-header/post-header.tsx
+++ b/packages/components/src/components/post-header/post-header.tsx
@@ -1,6 +1,9 @@
import { Component, h, Host, State, Element, Listen } from '@stencil/core';
import { throttle } from 'throttle-debounce';
import { version } from '@root/package.json';
+import { SwitchVariant } from '@/components';
+
+type DEVICE_SIZE = 'mobile' | 'tablet' | 'desktop' | null;
@Component({
tag: 'post-header',
@@ -9,7 +12,7 @@ import { version } from '@root/package.json';
})
export class PostHeader {
@Element() host: HTMLPostHeaderElement;
- @State() device: 'mobile' | 'tablet' | 'desktop' = null;
+ @State() device: DEVICE_SIZE = null;
@State() mobileMenuExtended: boolean = false;
private scrollParent = null;
@@ -67,17 +70,33 @@ export class PostHeader {
}
private handleResize() {
+ const previousDevice = this.device;
+ let newDevice: DEVICE_SIZE;
const width = window?.innerWidth;
+
if (width >= 1024) {
- this.device = 'desktop';
+ newDevice = 'desktop';
this.mobileMenuExtended = false; // Close any open mobile menu
} else if (width >= 600) {
- this.device = 'tablet';
+ newDevice = 'tablet';
} else {
- this.device = 'mobile';
+ newDevice = 'mobile';
+ }
+
+ // Apply only on change for doing work only when necessary
+ if (newDevice !== previousDevice) {
+ this.device = newDevice;
+ window.requestAnimationFrame(() => {
+ this.switchLanguageSwitchMode();
+ });
}
}
+ private switchLanguageSwitchMode() {
+ const variant: SwitchVariant = this.device === 'desktop' ? 'dropdown' : 'list';
+ this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
+ }
+
private handleMobileMenuToggle() {
this.mobileMenuExtended = !this.mobileMenuExtended;
}
diff --git a/packages/components/src/components/post-icon/readme.md b/packages/components/src/components/post-icon/readme.md
index 8b1c4de7d4..b5967432b0 100644
--- a/packages/components/src/components/post-icon/readme.md
+++ b/packages/components/src/components/post-icon/readme.md
@@ -28,6 +28,7 @@ some content
- [post-breadcrumb-item](../post-breadcrumb-item)
- [post-card-control](../post-card-control)
- [post-closebutton](../post-closebutton)
+ - [post-language-switch](../post-language-switch)
- [post-rating](../post-rating)
- [post-tag](../post-tag)
@@ -40,6 +41,7 @@ graph TD;
post-breadcrumb-item --> post-icon
post-card-control --> post-icon
post-closebutton --> post-icon
+ post-language-switch --> post-icon
post-rating --> post-icon
post-tag --> post-icon
style post-icon fill:#f9f,stroke:#333,stroke-width:4px
diff --git a/packages/components/src/components/post-language-option/post-language-option.scss b/packages/components/src/components/post-language-option/post-language-option.scss
index 6d81397276..314839d3d8 100644
--- a/packages/components/src/components/post-language-option/post-language-option.scss
+++ b/packages/components/src/components/post-language-option/post-language-option.scss
@@ -23,3 +23,42 @@ a {
width: 100%;
padding: var(--post-language-option-padding);
}
+
+.post-language-option-list {
+ @include post.focus-style;
+ border-radius: 2px;
+ width: 40px;
+ height: 40px;
+
+ &[aria-current='true'],
+ &[aria-current='page'] {
+ background-color: #050400;
+ color: #fff;
+ }
+}
+
+.post-language-option-dropdown {
+ padding-block: 13px;
+ padding-inline: 24px;
+ box-sizing: border-box;
+ position: relative;
+
+ &[aria-current='true'],
+ &[aria-current='page'] {
+ &::after {
+ content: '';
+ left: -2px;
+ height: 3px;
+ background-color: #504f4b;
+ width: calc(100% + 4px);
+ display: block;
+ position: absolute;
+ bottom: 3px;
+ }
+
+ &:focus::after {
+ width: calc(100% - 5px);
+ left: 2px;
+ }
+ }
+}
diff --git a/packages/components/src/components/post-language-option/post-language-option.tsx b/packages/components/src/components/post-language-option/post-language-option.tsx
index d7233c6905..6e8bd502a1 100644
--- a/packages/components/src/components/post-language-option/post-language-option.tsx
+++ b/packages/components/src/components/post-language-option/post-language-option.tsx
@@ -11,6 +11,7 @@ import {
} from '@stencil/core';
import { checkEmptyOrType, checkType } from '@/utils';
import { version } from '@root/package.json';
+import { SwitchVariant } from '../post-language-switch/switch-variants';
/**
* @slot default - Slot for placing the content inside the anchor or button.
@@ -51,6 +52,11 @@ export class PostLanguageOption {
);
}
+ /**
+ * The variant of the post-language-switch parent (dynamically set by the parent)
+ */
+ @Prop() variant?: SwitchVariant | null;
+
/**
* The full name of the language. For example, "Deutsch".
*/
@@ -122,6 +128,7 @@ export class PostLanguageOption {
{this.url ? (
) : (
el.getAttribute('active') == 'true')
+ .getAttribute('code');
+ }
+
+ // Update post-language-option variant to have the correct style
+ private updateChildrenVariant() {
+ this.host.querySelectorAll('post-language-option').forEach(el => {
+ el.setAttribute('variant', this.variant);
+ });
+ }
+
+ componentShouldUpdate() {
+ this.updateChildrenVariant();
+ }
+
+ componentDidLoad() {
+ this.validateCaption();
+ this.validateDescription();
+ this.validateVariant();
+
+ // Detects a change in the active language
+ this.host.addEventListener('postChange', (el: CustomEvent) => {
+ this.activeLang = el.detail;
+
+ // Update the active state in the children post-language-option components
+ this.host.querySelectorAll('post-language-option').forEach(lang => {
+ if (lang.code && lang.code === this.activeLang) {
+ lang.setAttribute('active', 'true');
+ } else {
+ lang.setAttribute('active', 'false');
+ }
+ });
+
+ // Hides the dropdown when an option has been clicked
+ if (this.variant === 'dropdown') {
+ const menu = this.host.shadowRoot.querySelector('post-menu') as HTMLPostMenuElement;
+ menu.toggle(menu);
+ }
+ });
+ }
+
+ private menuId = `p${nanoid(11)}`;
+
+ private renderList() {
+ return (
+
+
+
+ );
+ }
+
+ private renderDropdown() {
+ return (
+
+
+
+ {this.activeLang.toUpperCase()}
+
+
+
+
+
+ );
+ }
+
+ render() {
+ return this.variant === 'list' ? this.renderList() : this.renderDropdown();
+ }
+}
diff --git a/packages/components/src/components/post-language-switch/readme.md b/packages/components/src/components/post-language-switch/readme.md
new file mode 100644
index 0000000000..c2079be7d3
--- /dev/null
+++ b/packages/components/src/components/post-language-switch/readme.md
@@ -0,0 +1,36 @@
+# post-language-switch
+
+
+
+
+## Properties
+
+| Property | Attribute | Description | Type | Default |
+| ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------- |
+| `caption` | `caption` | A title for the list of language options | `string` | `undefined` |
+| `description` | `description` | A descriptive text for the list of language options | `string` | `undefined` |
+| `name` | `name` | The name of the language switch, which will be used on the dropdown as an ID | `string` | `undefined` |
+| `variant` | `variant` | Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header) | `"dropdown" \| "list"` | `'list'` |
+
+
+## Dependencies
+
+### Depends on
+
+- [post-menu-trigger](../post-menu-trigger)
+- [post-icon](../post-icon)
+- [post-menu](../post-menu)
+
+### Graph
+```mermaid
+graph TD;
+ post-language-switch --> post-menu-trigger
+ post-language-switch --> post-icon
+ post-language-switch --> post-menu
+ post-menu --> post-popovercontainer
+ style post-language-switch fill:#f9f,stroke:#333,stroke-width:4px
+```
+
+----------------------------------------------
+
+*Built with [StencilJS](https://stenciljs.com/)*
diff --git a/packages/components/src/components/post-language-switch/switch-variants.ts b/packages/components/src/components/post-language-switch/switch-variants.ts
new file mode 100644
index 0000000000..2473e44f8f
--- /dev/null
+++ b/packages/components/src/components/post-language-switch/switch-variants.ts
@@ -0,0 +1,3 @@
+export const SWITCH_VARIANTS = ['list', 'dropdown'] as const;
+
+export type SwitchVariant = (typeof SWITCH_VARIANTS)[number];
diff --git a/packages/components/src/components/post-menu-trigger/post-menu-trigger.tsx b/packages/components/src/components/post-menu-trigger/post-menu-trigger.tsx
index 1846eaf361..c13a921134 100644
--- a/packages/components/src/components/post-menu-trigger/post-menu-trigger.tsx
+++ b/packages/components/src/components/post-menu-trigger/post-menu-trigger.tsx
@@ -21,7 +21,7 @@ export class PostMenuTrigger {
@State() ariaExpanded: boolean = false;
/**
- * Reference to the slotted button within the trigger, if present.
+ * Reference to the slotted button within the trigger, if present.
* Used to manage click and key events for menu control.
*/
private slottedButton: HTMLButtonElement | null = null;
@@ -62,8 +62,20 @@ export class PostMenuTrigger {
componentDidLoad() {
this.root = getRoot(this.host);
this.validateControlFor();
-
+
this.slottedButton = this.host.querySelector('button');
+
+ // Check if the slottedButton is within a web component
+ if (!this.slottedButton) {
+ const webComponent = this.host.querySelector('.menu-trigger-webc');
+ if (webComponent.shadowRoot) {
+ const slottedButton = webComponent.shadowRoot.querySelector('button');
+ if (slottedButton) {
+ this.slottedButton = slottedButton;
+ }
+ }
+ }
+
if (this.slottedButton) {
this.slottedButton.setAttribute('aria-haspopup', 'menu');
this.slottedButton.addEventListener('click', () => {
diff --git a/packages/components/src/components/post-menu-trigger/readme.md b/packages/components/src/components/post-menu-trigger/readme.md
index 5be3ab3109..5198f2ceaf 100644
--- a/packages/components/src/components/post-menu-trigger/readme.md
+++ b/packages/components/src/components/post-menu-trigger/readme.md
@@ -12,6 +12,19 @@
| `for` _(required)_ | `for` | ID of the menu element that this trigger is linked to. Used to open and close the specified menu. | `string` | `undefined` |
+## Dependencies
+
+### Used by
+
+ - [post-language-switch](../post-language-switch)
+
+### Graph
+```mermaid
+graph TD;
+ post-language-switch --> post-menu-trigger
+ style post-menu-trigger fill:#f9f,stroke:#333,stroke-width:4px
+```
+
----------------------------------------------
*Built with [StencilJS](https://stenciljs.com/)*
diff --git a/packages/components/src/components/post-menu/readme.md b/packages/components/src/components/post-menu/readme.md
index f700878d4c..2372e47c18 100644
--- a/packages/components/src/components/post-menu/readme.md
+++ b/packages/components/src/components/post-menu/readme.md
@@ -66,6 +66,10 @@ Type: `Promise`
## Dependencies
+### Used by
+
+ - [post-language-switch](../post-language-switch)
+
### Depends on
- [post-popovercontainer](../post-popovercontainer)
@@ -74,6 +78,7 @@ Type: `Promise`
```mermaid
graph TD;
post-menu --> post-popovercontainer
+ post-language-switch --> post-menu
style post-menu fill:#f9f,stroke:#333,stroke-width:4px
```
diff --git a/packages/components/src/index.html b/packages/components/src/index.html
index ca9c2ba3e2..172bd137c5 100644
--- a/packages/components/src/index.html
+++ b/packages/components/src/index.html
@@ -17,40 +17,41 @@
+
Homepage
-
-
+
+
+
- = Menu
+
+ = Menu
-
+
+
+ DE
+ FR
+ IT
+ EN
+
+
Application title
-
+
+
+
+
Back
diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts
index 3f7564842a..8dd02245f9 100644
--- a/packages/components/src/index.ts
+++ b/packages/components/src/index.ts
@@ -13,6 +13,7 @@ export { PostCollapsible } from './components/post-collapsible/post-collapsible'
export { PostCollapsibleTrigger } from './components/post-collapsible-trigger/post-collapsible-trigger';
export { PostIcon } from './components/post-icon/post-icon';
export { PostLanguageOption } from './components/post-language-option/post-language-option';
+export { PostLanguageSwitch } from './components/post-language-switch/post-language-switch';
export { PostLogo } from './components/post-logo/post-logo';
export { PostMenu } from './components/post-menu/post-menu';
export { PostMenuTrigger } from './components/post-menu-trigger/post-menu-trigger';
diff --git a/packages/documentation/cypress/snapshots/components/language-switch.snapshot.ts b/packages/documentation/cypress/snapshots/components/language-switch.snapshot.ts
new file mode 100644
index 0000000000..8b610e5145
--- /dev/null
+++ b/packages/documentation/cypress/snapshots/components/language-switch.snapshot.ts
@@ -0,0 +1,7 @@
+describe('LanguageSwitch', () => {
+ it('default', () => {
+ cy.visit('/iframe.html?id=snapshots--language-switch');
+ cy.get('post-language-switch.hydrated', { timeout: 30000 }).should('be.visible');
+ cy.percySnapshot('LanguageSwitch', { widths: [1440] });
+ });
+});
diff --git a/packages/documentation/src/stories/components/header/components/header.markup.ts b/packages/documentation/src/stories/components/header/components/header.markup.ts
index bcf707bab0..f110177cf7 100644
--- a/packages/documentation/src/stories/components/header/components/header.markup.ts
+++ b/packages/documentation/src/stories/components/header/components/header.markup.ts
@@ -14,19 +14,17 @@ export default html`
= Menu
-
-
- DE
-
-
- FR
-
-
- IT
-
-
- EN
-
+
+ DE
+ FR
+ IT
+ EN
diff --git a/packages/documentation/src/stories/components/header/language-switch/language-switch.docs.mdx b/packages/documentation/src/stories/components/header/language-switch/language-switch.docs.mdx
new file mode 100644
index 0000000000..5ca36a2cfe
--- /dev/null
+++ b/packages/documentation/src/stories/components/header/language-switch/language-switch.docs.mdx
@@ -0,0 +1,30 @@
+import { Canvas, Controls, Meta } from '@storybook/blocks';
+import * as languageSwitchStories from './language-switch.stories';
+
+
+
+
+ # Language Switch
+
+
+
+
+
+
+The language option switch is a web component which enables users to select their preferred
+ language.
+
+
+
+
+
+## Installation
+
+The `` element is part of the `@swisspost/design-system-components` package.
+For more information, read the [getting started with components guide](/?path=/docs/edfb619b-fda1-4570-bf25-20830303d483--docs).
+
+## Links
+
+The language options can be used as links, which will navigate to a different page upon selection.
+
+
diff --git a/packages/documentation/src/stories/components/header/language-switch/language-switch.snapshot.stories.ts b/packages/documentation/src/stories/components/header/language-switch/language-switch.snapshot.stories.ts
new file mode 100644
index 0000000000..3b9feb003e
--- /dev/null
+++ b/packages/documentation/src/stories/components/header/language-switch/language-switch.snapshot.stories.ts
@@ -0,0 +1,37 @@
+import type { StoryContext, StoryObj } from '@storybook/web-components';
+import meta from './language-switch.stories';
+import { html } from 'lit';
+import { schemes } from '@/shared/snapshots/schemes';
+
+const { id, ...metaWithoutId } = meta;
+
+export default {
+ ...metaWithoutId,
+ title: 'Snapshots',
+ decorators: [],
+};
+
+type Story = StoryObj;
+
+export const LanguageSwitch: Story = {
+ render: (
+ _args: HTMLPostLanguageSwitchElement,
+ context: StoryContext,
+ ) => {
+ return html`
+
+ ${schemes(
+ () => html`
+
+ ${meta.render?.({ ...context.args }, context)}
+ ${meta.render?.(
+ { ...context.args, variant: 'dropdown', name: `language-switch-example` },
+ context,
+ )}
+
+ `,
+ )}
+
+ `;
+ },
+};
diff --git a/packages/documentation/src/stories/components/header/language-switch/language-switch.stories.ts b/packages/documentation/src/stories/components/header/language-switch/language-switch.stories.ts
new file mode 100644
index 0000000000..013f6d01d9
--- /dev/null
+++ b/packages/documentation/src/stories/components/header/language-switch/language-switch.stories.ts
@@ -0,0 +1,85 @@
+import type { StoryObj } from '@storybook/web-components';
+import { html } from 'lit';
+import { MetaComponent } from '@root/types';
+
+const meta: MetaComponent = {
+ id: 'decbb10c-2b39-4f47-b67d-337d8111a3ae',
+ title: 'Components/Header/Language Switch',
+ tags: ['package:WebComponents'],
+ component: 'post-language-switch',
+ render: renderLanguageSwitch,
+ parameters: {
+ design: {
+ type: 'figma',
+ url: 'https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=7817-52867&t=cw8xiYtq7RyVU0gH-4',
+ },
+ },
+ args: {
+ variant: 'list',
+ caption: 'Caption',
+ description: 'Description',
+ },
+ argTypes: {
+ variant: {
+ description: 'View variant of the language switch.',
+ table: {
+ category: 'content',
+ },
+ },
+ caption: {
+ description: 'Caption of the language switch.',
+ table: {
+ category: 'content',
+ type: {
+ summary: 'string',
+ },
+ },
+ },
+ description: {
+ description: 'Description of the language switch.',
+ table: {
+ category: 'content',
+ type: {
+ summary: 'string',
+ },
+ },
+ },
+ },
+};
+
+export default meta;
+
+function renderLanguageSwitch(args: Partial) {
+ return html`
+ DE
+ EN
+ FR
+ `;
+}
+
+function renderLanguageSwitchAsLinks(args: Partial) {
+ return html`
+ DE
+ EN
+ FR
+ `;
+}
+
+// STORIES
+type Story = StoryObj;
+
+export const Default: Story = {};
+
+export const Links: Story = {
+ render: renderLanguageSwitchAsLinks,
+};
diff --git a/packages/internet-header/cypress/e2e/language-detection.cy.ts b/packages/internet-header/cypress/e2e/language-detection.cy.ts
index 2909104ed6..96ad2bd343 100644
--- a/packages/internet-header/cypress/e2e/language-detection.cy.ts
+++ b/packages/internet-header/cypress/e2e/language-detection.cy.ts
@@ -20,7 +20,7 @@ describe('language detection from storybook', () => {
cy.get('swisspost-internet-header')
.shadow()
- .get('post-language-switch')
+ .get('post-language-switch-2')
.shadow()
.get('.lang-btn span:not(.visually-hidden)')
.should('have.text', 'it');
diff --git a/packages/internet-header/cypress/e2e/language-switch.cy.ts b/packages/internet-header/cypress/e2e/language-switch-2.cy.ts
similarity index 91%
rename from packages/internet-header/cypress/e2e/language-switch.cy.ts
rename to packages/internet-header/cypress/e2e/language-switch-2.cy.ts
index acabc8712a..76e72e4f39 100644
--- a/packages/internet-header/cypress/e2e/language-switch.cy.ts
+++ b/packages/internet-header/cypress/e2e/language-switch-2.cy.ts
@@ -4,7 +4,7 @@ import { NavLangEntity } from '../../src/models/header.model';
import { prepare } from '../support/prepare-story';
import { HEADER } from './shared/variables';
-describe('language-switch', () => {
+describe('language-switch-2', () => {
const languageSwitcherDesktop = '#post-language-switch-desktop';
const languageSwitchDropdown = 'nav.language-switch-dropdown';
@@ -18,30 +18,30 @@ describe('language-switch', () => {
describe('meta: true', () => {
it(`renders language switch in meta menu for desktop`, () => {
cy.changeArg('meta', true);
- cy.get('post-meta-navigation post-language-switch').should('exist');
+ cy.get('post-meta-navigation post-language-switch-2').should('exist');
});
it(`renders language switch in meta menu for mobile`, () => {
cy.viewport('iphone-6+');
cy.changeArg('meta', true);
- cy.get('post-meta-navigation post-language-switch').should('exist');
+ cy.get('post-meta-navigation post-language-switch-2').should('exist');
});
});
describe('meta: false', () => {
it(`renders language switch in main menu for desktop`, () => {
cy.changeArg('meta', false);
- cy.get('.main-navigation-container .main-navigation-controls post-language-switch').should(
- 'exist',
- );
+ cy.get(
+ '.main-navigation-container .main-navigation-controls post-language-switch-2',
+ ).should('exist');
});
it(`renders language switch in main menu for mobile`, () => {
cy.viewport('iphone-6+');
cy.changeArg('meta', false);
- cy.get('.main-navigation-container .main-navigation-controls post-language-switch').should(
- 'exist',
- );
+ cy.get(
+ '.main-navigation-container .main-navigation-controls post-language-switch-2',
+ ).should('exist');
});
});
});
diff --git a/packages/internet-header/cypress/e2e/main-slot.cy.ts b/packages/internet-header/cypress/e2e/main-slot.cy.ts
index 7f8f4855f1..7a0d5868a8 100644
--- a/packages/internet-header/cypress/e2e/main-slot.cy.ts
+++ b/packages/internet-header/cypress/e2e/main-slot.cy.ts
@@ -58,7 +58,7 @@ describe('main-navigation', () => {
cy.get('@custom-content')
.next()
.should('have.prop', 'tagName')
- .should('eq', 'POST-LANGUAGE-SWITCH');
+ .should('eq', 'POST-LANGUAGE-SWITCH-2');
});
it('should show a border on the left of the custom content', () => {
diff --git a/packages/internet-header/src/components.d.ts b/packages/internet-header/src/components.d.ts
index 8c04729f07..faaf3c956a 100644
--- a/packages/internet-header/src/components.d.ts
+++ b/packages/internet-header/src/components.d.ts
@@ -37,7 +37,7 @@ export namespace Components {
*/
"setFocus": () => Promise;
}
- interface PostLanguageSwitch {
+ interface PostLanguageSwitch2 {
/**
* Visualization of the language switch. Possible values: 'dropdown' | 'list'
*/
@@ -183,9 +183,9 @@ export namespace Components {
"stickyness": StickynessOptions;
}
}
-export interface PostLanguageSwitchCustomEvent extends CustomEvent {
+export interface PostLanguageSwitch2CustomEvent extends CustomEvent {
detail: T;
- target: HTMLPostLanguageSwitchElement;
+ target: HTMLPostLanguageSwitch2Element;
}
export interface PostMainNavigationCustomEvent extends CustomEvent {
detail: T;
@@ -222,23 +222,23 @@ declare global {
prototype: HTMLPostKlpLoginWidgetElement;
new (): HTMLPostKlpLoginWidgetElement;
};
- interface HTMLPostLanguageSwitchElementEventMap {
+ interface HTMLPostLanguageSwitch2ElementEventMap {
"dropdownToggled": DropdownEvent;
"languageChanged": string;
}
- interface HTMLPostLanguageSwitchElement extends Components.PostLanguageSwitch, HTMLStencilElement {
- addEventListener(type: K, listener: (this: HTMLPostLanguageSwitchElement, ev: PostLanguageSwitchCustomEvent) => any, options?: boolean | AddEventListenerOptions): void;
+ interface HTMLPostLanguageSwitch2Element extends Components.PostLanguageSwitch2, HTMLStencilElement {
+ addEventListener(type: K, listener: (this: HTMLPostLanguageSwitch2Element, ev: PostLanguageSwitch2CustomEvent) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
- removeEventListener(type: K, listener: (this: HTMLPostLanguageSwitchElement, ev: PostLanguageSwitchCustomEvent) => any, options?: boolean | EventListenerOptions): void;
+ removeEventListener(type: K, listener: (this: HTMLPostLanguageSwitch2Element, ev: PostLanguageSwitch2CustomEvent) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
- var HTMLPostLanguageSwitchElement: {
- prototype: HTMLPostLanguageSwitchElement;
- new (): HTMLPostLanguageSwitchElement;
+ var HTMLPostLanguageSwitch2Element: {
+ prototype: HTMLPostLanguageSwitch2Element;
+ new (): HTMLPostLanguageSwitch2Element;
};
interface HTMLPostMainNavigationElementEventMap {
"dropdownToggled": DropdownEvent;
@@ -320,7 +320,7 @@ declare global {
"focus-trap": HTMLFocusTrapElement;
"post-header-logo": HTMLPostHeaderLogoElement;
"post-klp-login-widget": HTMLPostKlpLoginWidgetElement;
- "post-language-switch": HTMLPostLanguageSwitchElement;
+ "post-language-switch-2": HTMLPostLanguageSwitch2Element;
"post-main-navigation": HTMLPostMainNavigationElement;
"post-meta-navigation": HTMLPostMetaNavigationElement;
"post-search": HTMLPostSearchElement;
@@ -346,7 +346,7 @@ declare namespace LocalJSX {
*/
"logoutUrl"?: string;
}
- interface PostLanguageSwitch {
+ interface PostLanguageSwitch2 {
/**
* Visualization of the language switch. Possible values: 'dropdown' | 'list'
*/
@@ -354,11 +354,11 @@ declare namespace LocalJSX {
/**
* Fires when the dropdown has been toggled.
*/
- "onDropdownToggled"?: (event: PostLanguageSwitchCustomEvent) => void;
+ "onDropdownToggled"?: (event: PostLanguageSwitch2CustomEvent) => void;
/**
* Fires when the language has been changed.
*/
- "onLanguageChanged"?: (event: PostLanguageSwitchCustomEvent) => void;
+ "onLanguageChanged"?: (event: PostLanguageSwitch2CustomEvent) => void;
}
interface PostMainNavigation {
/**
@@ -478,7 +478,7 @@ declare namespace LocalJSX {
"focus-trap": FocusTrap;
"post-header-logo": PostHeaderLogo;
"post-klp-login-widget": PostKlpLoginWidget;
- "post-language-switch": PostLanguageSwitch;
+ "post-language-switch-2": PostLanguageSwitch2;
"post-main-navigation": PostMainNavigation;
"post-meta-navigation": PostMetaNavigation;
"post-search": PostSearch;
@@ -499,7 +499,7 @@ declare module "@stencil/core" {
"focus-trap": LocalJSX.FocusTrap & JSXBase.HTMLAttributes;
"post-header-logo": LocalJSX.PostHeaderLogo & JSXBase.HTMLAttributes;
"post-klp-login-widget": LocalJSX.PostKlpLoginWidget & JSXBase.HTMLAttributes;
- "post-language-switch": LocalJSX.PostLanguageSwitch & JSXBase.HTMLAttributes;
+ "post-language-switch-2": LocalJSX.PostLanguageSwitch2 & JSXBase.HTMLAttributes;
"post-main-navigation": LocalJSX.PostMainNavigation & JSXBase.HTMLAttributes;
"post-meta-navigation": LocalJSX.PostMetaNavigation & JSXBase.HTMLAttributes;
"post-search": LocalJSX.PostSearch & JSXBase.HTMLAttributes;
diff --git a/packages/internet-header/src/components/post-internet-header/post-internet-header.tsx b/packages/internet-header/src/components/post-internet-header/post-internet-header.tsx
index acc03e112f..8266d6302c 100644
--- a/packages/internet-header/src/components/post-internet-header/post-internet-header.tsx
+++ b/packages/internet-header/src/components/post-internet-header/post-internet-header.tsx
@@ -484,11 +484,11 @@ export class PostInternetHeader {
ref={el => (this.metaNav = el)}
>
- this.handleDropdownToggled(e)}
- >
+ >
@@ -512,10 +512,10 @@ export class PostInternetHeader {
-
+ >
@@ -533,11 +533,11 @@ export class PostInternetHeader {
- this.handleDropdownToggled(e)}
mode="dropdown"
- >
+ >
diff --git a/packages/internet-header/src/components/post-internet-header/readme.md b/packages/internet-header/src/components/post-internet-header/readme.md
index 4cee80e180..43a2f19e29 100644
--- a/packages/internet-header/src/components/post-internet-header/readme.md
+++ b/packages/internet-header/src/components/post-internet-header/readme.md
@@ -54,7 +54,7 @@ string
- [post-skiplinks](../post-skiplinks)
- [post-meta-navigation](../post-meta-navigation)
-- [post-language-switch](../post-language-switch)
+- [post-language-switch-2](../post-language-switch-2)
- [post-header-logo](../post-logo)
- [post-main-navigation](../post-main-navigation)
- [post-search](../post-search)
@@ -65,7 +65,7 @@ string
graph TD;
swisspost-internet-header --> post-skiplinks
swisspost-internet-header --> post-meta-navigation
- swisspost-internet-header --> post-language-switch
+ swisspost-internet-header --> post-language-switch-2
swisspost-internet-header --> post-header-logo
swisspost-internet-header --> post-main-navigation
swisspost-internet-header --> post-search
diff --git a/packages/internet-header/src/components/post-language-switch/components/post-language-switch-list.tsx b/packages/internet-header/src/components/post-language-switch-2/components/post-language-switch-list.tsx
similarity index 100%
rename from packages/internet-header/src/components/post-language-switch/components/post-language-switch-list.tsx
rename to packages/internet-header/src/components/post-language-switch-2/components/post-language-switch-list.tsx
diff --git a/packages/internet-header/src/components/post-language-switch/post-language-switch.scss b/packages/internet-header/src/components/post-language-switch-2/post-language-switch-2.scss
similarity index 100%
rename from packages/internet-header/src/components/post-language-switch/post-language-switch.scss
rename to packages/internet-header/src/components/post-language-switch-2/post-language-switch-2.scss
diff --git a/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx b/packages/internet-header/src/components/post-language-switch-2/post-language-switch-2.tsx
similarity index 96%
rename from packages/internet-header/src/components/post-language-switch/post-language-switch.tsx
rename to packages/internet-header/src/components/post-language-switch-2/post-language-switch-2.tsx
index f0fb6af64d..74bce8a6e1 100644
--- a/packages/internet-header/src/components/post-language-switch/post-language-switch.tsx
+++ b/packages/internet-header/src/components/post-language-switch-2/post-language-switch-2.tsx
@@ -19,18 +19,18 @@ import { PostLanguageSwitchList } from './components/post-language-switch-list';
import { IAvailableLanguage } from '../../models/language.model';
@Component({
- tag: 'post-language-switch',
- styleUrl: 'post-language-switch.scss',
+ tag: 'post-language-switch-2',
+ styleUrl: 'post-language-switch-2.scss',
shadow: true,
})
-export class PostLanguageSwitch implements HasDropdown {
+export class PostLanguageSwitch2 implements HasDropdown {
/**
* Visualization of the language switch.
* Possible values: 'dropdown' | 'list'
*/
@Prop() mode: 'dropdown' | 'list';
@State() langSwitchOpen = false;
- @Element() host: HTMLPostLanguageSwitchElement;
+ @Element() host: HTMLPostLanguageSwitch2Element;
/**
* Fires when the dropdown has been toggled.
*/
diff --git a/packages/internet-header/src/components/post-language-switch/readme.md b/packages/internet-header/src/components/post-language-switch-2/readme.md
similarity index 91%
rename from packages/internet-header/src/components/post-language-switch/readme.md
rename to packages/internet-header/src/components/post-language-switch-2/readme.md
index 2e290d1d72..09583052bb 100644
--- a/packages/internet-header/src/components/post-language-switch/readme.md
+++ b/packages/internet-header/src/components/post-language-switch-2/readme.md
@@ -1,6 +1,4 @@
-# post-language-switch
-
-
+# post-language-switch-2
@@ -48,8 +46,8 @@ Boolean indicating new state
### Graph
```mermaid
graph TD;
- swisspost-internet-header --> post-language-switch
- style post-language-switch fill:#f9f,stroke:#333,stroke-width:4px
+ swisspost-internet-header --> post-language-switch-2
+ style post-language-switch-2 fill:#f9f,stroke:#333,stroke-width:4px
```
----------------------------------------------
diff --git a/packages/internet-header/src/index.ts b/packages/internet-header/src/index.ts
index ba5a36d100..84d6cd6f4e 100644
--- a/packages/internet-header/src/index.ts
+++ b/packages/internet-header/src/index.ts
@@ -7,7 +7,7 @@ export { PostInternetFooter } from './components/post-internet-footer/post-inter
export { PostSkiplinks } from './components/post-skiplinks/post-skiplinks';
export { PostMetaNavigation } from './components/post-meta-navigation/post-meta-navigation';
-export { PostLanguageSwitch } from './components/post-language-switch/post-language-switch';
+export { PostLanguageSwitch2 } from './components/post-language-switch-2/post-language-switch-2';
export { PostLogo } from './components/post-logo/post-logo';
export { PostMainNavigation } from './components/post-main-navigation/post-main-navigation';
export { PostSearch } from './components/post-search/post-search';
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fb076973e5..147b78436b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -58,6 +58,9 @@ importers:
long-press-event:
specifier: 2.5.0
version: 2.5.0
+ nanoid:
+ specifier: 5.0.9
+ version: 5.0.9
devDependencies:
'@percy/cli':
specifier: 1.29.1
@@ -8181,6 +8184,11 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true
+ nanoid@5.0.9:
+ resolution: {integrity: sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==}
+ engines: {node: ^18 || >=20}
+ hasBin: true
+
natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
@@ -15795,7 +15803,7 @@ snapshots:
axios@1.7.7:
dependencies:
- follow-redirects: 1.15.6(debug@4.3.6)
+ follow-redirects: 1.15.6(debug@4.3.7)
form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies:
@@ -18505,7 +18513,7 @@ snapshots:
http-proxy-middleware@2.0.6(@types/express@4.17.21):
dependencies:
'@types/http-proxy': 1.17.15
- http-proxy: 1.18.1
+ http-proxy: 1.18.1(debug@4.3.7)
is-glob: 4.0.3
is-plain-obj: 3.0.0
micromatch: 4.0.8
@@ -18525,14 +18533,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- http-proxy@1.18.1:
- dependencies:
- eventemitter3: 4.0.7
- follow-redirects: 1.15.6(debug@4.3.6)
- requires-port: 1.0.0
- transitivePeerDependencies:
- - debug
-
http-proxy@1.18.1(debug@4.3.7):
dependencies:
eventemitter3: 4.0.7
@@ -18548,7 +18548,7 @@ snapshots:
corser: 2.0.1
he: 1.2.0
html-encoding-sniffer: 3.0.0
- http-proxy: 1.18.1
+ http-proxy: 1.18.1(debug@4.3.7)
mime: 1.6.0
minimist: 1.2.8
opener: 1.5.2
@@ -19684,7 +19684,7 @@ snapshots:
dom-serialize: 2.2.1
glob: 7.2.3
graceful-fs: 4.2.11
- http-proxy: 1.18.1
+ http-proxy: 1.18.1(debug@4.3.7)
isbinaryfile: 4.0.10
lodash: 4.17.21
log4js: 6.9.1
@@ -20530,6 +20530,8 @@ snapshots:
nanoid@3.3.7: {}
+ nanoid@5.0.9: {}
+
natural-compare@1.4.0: {}
needle@3.2.0:
From 115909ecf1abe8bc4d4e4fde494013b98d9359c2 Mon Sep 17 00:00:00 2001
From: Alona Zherdetska <138328641+alionazherdetska@users.noreply.github.com>
Date: Thu, 12 Dec 2024 08:56:29 +0100
Subject: [PATCH 11/21] fix(component): fix tab isolation in nested `post-tabs`
component (#4211)
---
.changeset/gorgeous-glasses-end.md | 5 +++++
.../src/components/post-tabs/post-tabs.tsx | 12 +++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
create mode 100644 .changeset/gorgeous-glasses-end.md
diff --git a/.changeset/gorgeous-glasses-end.md b/.changeset/gorgeous-glasses-end.md
new file mode 100644
index 0000000000..9c85b5a1f4
--- /dev/null
+++ b/.changeset/gorgeous-glasses-end.md
@@ -0,0 +1,5 @@
+---
+'@swisspost/design-system-components': patch
+---
+
+Fix tab isolation in nested `post-tabs` components by scoping tab queries and interactions to the current instance.
diff --git a/packages/components/src/components/post-tabs/post-tabs.tsx b/packages/components/src/components/post-tabs/post-tabs.tsx
index b03617b3bc..22f5a8400f 100644
--- a/packages/components/src/components/post-tabs/post-tabs.tsx
+++ b/packages/components/src/components/post-tabs/post-tabs.tsx
@@ -21,9 +21,11 @@ export class PostTabs {
private hiding: Animation;
private isLoaded = false;
- private get tabs(): NodeListOf {
- return this.host.querySelectorAll('post-tab-header');
- }
+ private get tabs(): HTMLPostTabHeaderElement[] {
+ return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab =>
+ tab.closest('post-tabs') === this.host
+ );
+ }
@Element() host: HTMLPostTabsElement;
@@ -45,7 +47,7 @@ export class PostTabs {
this.moveMisplacedTabs();
this.enableTabs();
- const initiallyActivePanel = this.activePanel || this.tabs.item(0).panel;
+ const initiallyActivePanel = this.activePanel || this.tabs[0]?.panel;
void this.show(initiallyActivePanel);
this.isLoaded = true;
@@ -128,7 +130,7 @@ export class PostTabs {
// if the currently active tab was removed from the DOM then select the first one
if (this.activeTab && !this.activeTab.isConnected) {
- void this.show(this.tabs.item(0).panel);
+ void this.show(this.tabs[0]?.panel);
}
}
From 97596917eecb1c68363308d651bd6e61df353a77 Mon Sep 17 00:00:00 2001
From: Alona Zherdetska <138328641+alionazherdetska@users.noreply.github.com>
Date: Thu, 12 Dec 2024 09:20:37 +0100
Subject: [PATCH 12/21] fix(workflow): move create preview comment job to
deploy documentation workflow (#4207)
---
.github/actions/preview/message/create/action.yaml | 10 ++++++++--
.github/workflows/build-documentation.yaml | 5 -----
.github/workflows/deploy-documentation.yaml | 6 ++++++
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/.github/actions/preview/message/create/action.yaml b/.github/actions/preview/message/create/action.yaml
index 3d56790012..61d2e82b8c 100644
--- a/.github/actions/preview/message/create/action.yaml
+++ b/.github/actions/preview/message/create/action.yaml
@@ -5,14 +5,20 @@ inputs:
access-token:
description: The access token to use for commenting.
required: true
+ issue-number:
+ description: The issue number from the caller workflow.
+ required: true
runs:
using: composite
steps:
- uses: actions/github-script@v7
+ env:
+ ISSUE_NUMBER: ${{ inputs.issue-number }}
with:
github-token: ${{ inputs.access-token }}
script: |
+ const { ISSUE_NUMBER } = process.env
const commentTitle = '**Related Previews**'
const commentInitialBody = 'Preview URLs will be added here, once they are ready... ![loader](https://github.com/swisspost/design-system/assets/9716662/49a75898-7093-4ffb-9460-071ff194459d)'
@@ -25,7 +31,7 @@ runs:
await github.rest.issues.createComment({
repo: context.repo.repo,
owner: context.repo.owner,
- issue_number: context.issue.number,
+ issue_number: ISSUE_NUMBER,
body: `${commentTitle}\n${commentInitialBody}`
})
@@ -45,7 +51,7 @@ runs:
comments = (await github.rest.issues.listComments({
repo: context.repo.repo,
owner: context.repo.owner,
- issue_number: context.issue.number
+ issue_number: ISSUE_NUMBER
})).data || []
previewComment = comments.find(c => c.user.login === 'swisspost-bot' && c.body.includes(commentTitle))
diff --git a/.github/workflows/build-documentation.yaml b/.github/workflows/build-documentation.yaml
index 168fd01d45..99783a8e4a 100644
--- a/.github/workflows/build-documentation.yaml
+++ b/.github/workflows/build-documentation.yaml
@@ -25,11 +25,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- - name: Create preview message
- uses: ./.github/actions/preview/message/create
- with:
- access-token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}
-
- name: Setup
uses: ./.github/actions/setup-pnpm
diff --git a/.github/workflows/deploy-documentation.yaml b/.github/workflows/deploy-documentation.yaml
index 1f4043aebc..7b54c52c35 100644
--- a/.github/workflows/deploy-documentation.yaml
+++ b/.github/workflows/deploy-documentation.yaml
@@ -26,6 +26,12 @@ jobs:
name: design-system-documentation
folder: build-output
+ - name: Create preview message
+ uses: ./.github/actions/preview/message/create
+ with:
+ access-token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}
+ issue-number: ${{ steps.build.outputs.id }}
+
- name: Get netlify config
id: netlify-config
uses: actions/github-script@v7
From 2d8248ea48a0fe1f27860f38c669596adb24d4e6 Mon Sep 17 00:00:00 2001
From: Lea
Date: Thu, 12 Dec 2024 16:18:48 +0100
Subject: [PATCH 13/21] chore(styles, documentation): update styles of btn-link
(#4200)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Oliver Schürch
---
.changeset/twenty-chairs-kick.md | 6 +++++
.../components/button/button.stories.ts | 5 ++--
.../web-component/card-control.stories.ts | 4 +++-
.../form-footer/form-footer.stories.ts | 2 +-
packages/styles/src/components/button.scss | 23 ++++++++++++++-----
5 files changed, 30 insertions(+), 10 deletions(-)
create mode 100644 .changeset/twenty-chairs-kick.md
diff --git a/.changeset/twenty-chairs-kick.md b/.changeset/twenty-chairs-kick.md
new file mode 100644
index 0000000000..751cef6c67
--- /dev/null
+++ b/.changeset/twenty-chairs-kick.md
@@ -0,0 +1,6 @@
+---
+'@swisspost/design-system-documentation': minor
+'@swisspost/design-system-styles': minor
+---
+
+Updated `.btn-link` to look like a regular link and old `.btn-link` is now `.btn-tertiary .px-0`.
diff --git a/packages/documentation/src/stories/components/button/button.stories.ts b/packages/documentation/src/stories/components/button/button.stories.ts
index 70c266ea5f..f8d2ba788e 100644
--- a/packages/documentation/src/stories/components/button/button.stories.ts
+++ b/packages/documentation/src/stories/components/button/button.stories.ts
@@ -86,10 +86,11 @@ const meta: MetaComponent = {
'btn-primary': 'Primary',
'btn-secondary': 'Secondary',
'btn-tertiary': 'Tertiary',
- 'btn-link': 'Link (no padding)',
+ 'btn-tertiary px-0': 'Tertiary (no padding)',
+ 'btn-link': 'Link',
},
},
- options: ['btn-primary', 'btn-secondary', 'btn-tertiary', 'btn-link'],
+ options: ['btn-primary', 'btn-secondary', 'btn-tertiary', 'btn-tertiary px-0', 'btn-link'],
table: {
category: 'General',
},
diff --git a/packages/documentation/src/stories/components/card-control/web-component/card-control.stories.ts b/packages/documentation/src/stories/components/card-control/web-component/card-control.stories.ts
index a0d9cf6994..2114493b81 100644
--- a/packages/documentation/src/stories/components/card-control/web-component/card-control.stories.ts
+++ b/packages/documentation/src/stories/components/card-control/web-component/card-control.stories.ts
@@ -310,7 +310,9 @@ export const FormIntegration: Story = {
${args.radioValidity === 'false' ? invalidFeedback : nothing}
-
Reset
+
+ Reset
+
Submit
`;
diff --git a/packages/documentation/src/stories/components/form-footer/form-footer.stories.ts b/packages/documentation/src/stories/components/form-footer/form-footer.stories.ts
index 4d358a5bd1..c7105939c0 100644
--- a/packages/documentation/src/stories/components/form-footer/form-footer.stories.ts
+++ b/packages/documentation/src/stories/components/form-footer/form-footer.stories.ts
@@ -134,7 +134,7 @@ export function render(args: Args) {
? html` `
: null}
${args.showTertiaryButton
- ? html`
+ ? html`
${args.tertiaryButtonText}
`
diff --git a/packages/styles/src/components/button.scss b/packages/styles/src/components/button.scss
index d2560ce8d2..0eaed65339 100644
--- a/packages/styles/src/components/button.scss
+++ b/packages/styles/src/components/button.scss
@@ -19,6 +19,7 @@
@use './../placeholders/button' as button-ph;
@use '../functions/tokens';
@use '../tokens/components';
+@use '../tokens/elements';
tokens.$default-map: components.$post-button;
@@ -39,9 +40,13 @@ tokens.$default-map: components.$post-button;
color: var(--post-gray-80);
font-family: inherit;
font-weight: tokens.get('button-label-font-weight');
- text-decoration: none !important; // For tags, !important for hover
+ text-decoration: none;
white-space: nowrap; // Long content should never break in buttons
+ &:hover {
+ text-decoration: none;
+ }
+
@include button-mx.button-size();
&:disabled {
@@ -88,8 +93,6 @@ tokens.$default-map: components.$post-button;
}
}
-// Tertiary
-.btn-link,
.btn-tertiary {
// Styles to improve accessibility in high contrast mode
@include utilities.high-contrast-mode() {
@@ -105,8 +108,16 @@ tokens.$default-map: components.$post-button;
}
}
-// Tertiary with no padding (overrides the padding defined by the sizing classes above)
.btn-link {
- padding-inline-start: 0;
- padding-inline-end: 0;
+ text-decoration: tokens.get('link-decoration', elements.$post-link);
+ border: 0 none;
+ border-radius: tokens.get('link-border-radius', elements.$post-link);
+ min-height: 0;
+ font-size: inherit;
+ font-weight: inherit;
+ padding: 0;
+
+ &:hover {
+ color: tokens.get('link-hover-fg', elements.$post-link);
+ }
}
From 34f6b54e8f0c7c836d67c785f0aeda6cc6a4df19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oliver=20Sch=C3=BCrch?=
Date: Thu, 12 Dec 2024 16:51:37 +0100
Subject: [PATCH 14/21] revert: deletion of the deplay-demo.yaml file on main
(this is needed here for older versions) (#4234)
---
.github/workflows/deploy-demo.yaml | 53 ++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 .github/workflows/deploy-demo.yaml
diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-demo.yaml
new file mode 100644
index 0000000000..cd2bf08ee3
--- /dev/null
+++ b/.github/workflows/deploy-demo.yaml
@@ -0,0 +1,53 @@
+@@ -1,51 +0,0 @@
+###
+#
+# Not used for v9 anymore
+# But since workflows run always from the `main` branch we need to keep it for older versions
+#
+###
+
+name: Deploy Demo App Preview to Netlify
+on:
+ workflow_run:
+ workflows: ['Build Demo App']
+ types:
+ - completed
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ if: >
+ ${{ github.event.workflow_run.event == 'pull_request' &&
+ github.event.workflow_run.conclusion == 'success' }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup
+ uses: ./.github/actions/setup-pnpm
+
+ - name: Download build artifacts
+ uses: ./.github/actions/artifact-download
+ id: build
+ with:
+ name: design-system-demo
+ folder: build-output
+
+ - name: Deploy demo app to netlify
+ uses: ./.github/actions/deploy-to-netlify
+ id: deploy
+ with:
+ id: ${{ steps.build.outputs.id }}
+ netlify_auth_token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
+ netlify_site_id: ${{ secrets.NETLIFY_SITE_ID }}
+ netlify_site_url: swisspost-web-frontend.netlify.app
+ folder: ${{ steps.build.outputs.folder }}
+ package_name: '@swisspost/design-system-demo'
+
+ - name: Update preview message
+ uses: ./.github/actions/preview/message/update
+ with:
+ access-token: ${{ secrets.SWISSPOSTDEVS_ACCESS_TOKEN }}
+ issue-number: ${{ steps.build.outputs.id }}
+ preview-url: ${{ steps.deploy.outputs.preview-url }}
From 7eb8af8409dc90019eaa289f7eeda841a257bfef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oliver=20Sch=C3=BCrch?=
Date: Thu, 12 Dec 2024 17:04:12 +0100
Subject: [PATCH 15/21] fix: deploy-demo.yaml workflow file (#4240)
---
.github/workflows/deploy-demo.yaml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/deploy-demo.yaml b/.github/workflows/deploy-demo.yaml
index cd2bf08ee3..8dfd3eda6e 100644
--- a/.github/workflows/deploy-demo.yaml
+++ b/.github/workflows/deploy-demo.yaml
@@ -1,4 +1,3 @@
-@@ -1,51 +0,0 @@
###
#
# Not used for v9 anymore
From 2b3010e71f5da72961e65687f05f72286bfe1b8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aliz=C3=A9=20Debray?=
<33580481+alizedebray@users.noreply.github.com>
Date: Thu, 12 Dec 2024 18:05:22 +0100
Subject: [PATCH 16/21] feat(components): update the post-togglebutton (#4223)
---
.changeset/smooth-bugs-explode.md | 6 +
.../components/cypress/e2e/togglebutton.cy.ts | 151 +++++++++---------
.../post-togglebutton/post-togglebutton.scss | 12 ++
.../post-togglebutton/post-togglebutton.tsx | 28 ++--
.../components/post-togglebutton/readme.md | 7 +-
.../togglebutton/togglebutton.docs.mdx | 14 +-
.../togglebutton.snapshot.stories.ts | 2 +-
.../togglebutton/togglebutton.stories.ts | 34 ++--
8 files changed, 139 insertions(+), 115 deletions(-)
create mode 100644 .changeset/smooth-bugs-explode.md
diff --git a/.changeset/smooth-bugs-explode.md b/.changeset/smooth-bugs-explode.md
new file mode 100644
index 0000000000..9a822cca5d
--- /dev/null
+++ b/.changeset/smooth-bugs-explode.md
@@ -0,0 +1,6 @@
+---
+'@swisspost/design-system-components': major
+'@swisspost/design-system-documentation': patch
+---
+
+Updated the `post-togglebutton` component to offer greater flexibility. You can now control the visibility of elements within the `post-togglebutton` using the `data-showwhen="toggled"` and `data-showwhen="untoggled"` attributes. Any content without a `data-showwhen` attribute will always be visible, regardless of the toggle state.
diff --git a/packages/components/cypress/e2e/togglebutton.cy.ts b/packages/components/cypress/e2e/togglebutton.cy.ts
index 3df5fa773f..cdf2ec0895 100644
--- a/packages/components/cypress/e2e/togglebutton.cy.ts
+++ b/packages/components/cypress/e2e/togglebutton.cy.ts
@@ -1,114 +1,113 @@
const TOGGLE_BUTTON_ID = '1a6f47c2-5e8a-45a0-b1c3-9f7e2b834c24';
describe('togglebutton', () => {
- beforeEach(() => {
- cy.visit('/iframe.html?id=snapshots--toggle-button');
- cy.get('post-togglebutton', { timeout: 30000 }).should('be.visible');
- });
+ describe('default', () => {
+ beforeEach(() => {
+ cy.getComponent('togglebutton', TOGGLE_BUTTON_ID);
+ });
- describe('default behavior', () => {
- it('should toggle state when clicked', () => {
- cy.get('post-togglebutton')
- .first()
- .as('button')
- .shadow()
- .find('slot[name="untoggled"]')
- .should('exist');
+ it('should show expected content', () => {
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.hidden');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.visible');
+ });
- cy.get('@button').click();
+ it('should have correct ARIA attributes', () => {
+ cy.get('@togglebutton')
+ .should('have.attr', 'role', 'button')
+ .and('have.attr', 'aria-pressed', 'false')
+ .and('have.attr', 'tabindex', '0');
+ });
+
+ it('should toggle state when clicked', () => {
+ cy.get('@togglebutton').click();
- cy.get('@button').shadow().find('slot[name="toggled"]').should('exist');
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.visible');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.hidden');
+ cy.get('@togglebutton').should('have.attr', 'aria-pressed', 'true');
});
it('should toggle state when pressing Enter key', () => {
- cy.get('post-togglebutton')
- .first()
- .as('button')
- .shadow()
- .find('slot[name="untoggled"]')
- .should('exist');
+ cy.get('@togglebutton').trigger('keydown', { key: 'Enter' });
- cy.get('@button').trigger('keydown', { key: 'Enter' });
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.visible');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.hidden');
+ cy.get('@togglebutton').should('have.attr', 'aria-pressed', 'true');
+ });
+ });
- cy.get('@button').shadow().find('slot[name="toggled"]').should('exist');
+ describe('initially toggled', () => {
+ beforeEach(() => {
+ cy.getComponent('togglebutton', TOGGLE_BUTTON_ID, 'initially-toggled');
+ });
+
+ it('should show expected content', () => {
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.visible');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.hidden');
});
it('should have correct ARIA attributes', () => {
- cy.get('post-togglebutton')
- .first()
- .as('button')
+ cy.get('@togglebutton')
.should('have.attr', 'role', 'button')
- .and('have.attr', 'aria-pressed', 'false')
+ .and('have.attr', 'aria-pressed', 'true')
.and('have.attr', 'tabindex', '0');
-
- cy.get('@button').click();
-
- cy.get('@button').should('have.attr', 'aria-pressed', 'true');
});
- });
- describe('initial state', () => {
- it('should respect initial toggled state', () => {
- cy.get('post-togglebutton[toggled]')
- .first()
- .as('toggledButton')
- .shadow()
- .find('slot[name="toggled"]')
- .should('exist');
+ it('should toggle state when clicked', () => {
+ cy.get('@togglebutton').click();
- cy.get('@toggledButton').should('have.attr', 'aria-pressed', 'true');
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.hidden');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.visible');
+ cy.get('@togglebutton').should('have.attr', 'aria-pressed', 'false');
});
- it('should respect untoggled state', () => {
- cy.get('post-togglebutton:not([toggled])')
- .first()
- .as('untoggledButton')
- .shadow()
- .find('slot[name="untoggled"]')
- .should('exist');
+ it('should toggle state when pressing Enter key', () => {
+ cy.get('@togglebutton').trigger('keydown', { key: 'Enter' });
- cy.get('@untoggledButton').should('have.attr', 'aria-pressed', 'false');
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.hidden');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.visible');
+ cy.get('@togglebutton').should('have.attr', 'aria-pressed', 'false');
});
});
- describe('slot content', () => {
- it('should display correct slot content based on toggle state', () => {
- cy.get('post-togglebutton').first().as('button');
+ describe('content visibility', () => {
+ beforeEach(() => {
+ cy.getComponent('togglebutton', TOGGLE_BUTTON_ID, 'content-visibility');
+ });
- cy.get('@button').shadow().find('slot[name="untoggled"]').should('exist');
+ it('should display correct contents on initial state', () => {
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.hidden');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.visible');
+ cy.get('@togglebutton').find(':not([data-showwhen])').should('be.visible');
+ });
- cy.get('@button').click();
+ it('should display correct contents when clicked', () => {
+ cy.get('@togglebutton').click();
- cy.get('@button').shadow().find('slot[name="toggled"]').should('exist');
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.visible');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.hidden');
+ cy.get('@togglebutton').find(':not([data-showwhen])').should('be.visible');
+ });
- cy.get('@button').click();
+ it('should display correct contents when clicked twice', () => {
+ cy.get('@togglebutton').dblclick();
- cy.get('@button').shadow().find('slot[name="untoggled"]').should('exist');
+ cy.get('@togglebutton').find('[data-showwhen="toggled"]').should('be.hidden');
+ cy.get('@togglebutton').find('[data-showwhen="untoggled"]').should('be.visible');
+ cy.get('@togglebutton').find(':not([data-showwhen])').should('be.visible');
});
});
+});
- describe('version attribute', () => {
- it('should have the correct version data attribute', () => {
- cy.get('post-togglebutton').first().should('have.attr', 'data-version');
- });
+describe('Accessibility', () => {
+ beforeEach(() => {
+ cy.getSnapshots('togglebutton');
});
- describe('Accessibility', () => {
- beforeEach(() => {
- cy.injectAxe();
- });
-
- it('Has no detectable a11y violations on load for all variants', () => {
- cy.checkA11y('#root-inner');
- });
+ it('Has no detectable a11y violations on load for all variants', () => {
+ cy.checkA11y('#root-inner');
+ });
- it('Should be keyboard navigable', () => {
- cy.get('post-togglebutton')
- .first()
- .focus()
- .should('have.focus')
- .trigger('keydown', { key: 'Enter' })
- .should('have.attr', 'aria-pressed', 'true');
- });
+ it('Should be keyboard navigable', () => {
+ cy.get('post-togglebutton').first().focus().should('have.focus');
});
});
diff --git a/packages/components/src/components/post-togglebutton/post-togglebutton.scss b/packages/components/src/components/post-togglebutton/post-togglebutton.scss
index 3657761313..b73f35a5b6 100644
--- a/packages/components/src/components/post-togglebutton/post-togglebutton.scss
+++ b/packages/components/src/components/post-togglebutton/post-togglebutton.scss
@@ -1,3 +1,15 @@
:host {
cursor: pointer;
}
+
+:host([aria-pressed="true"]) {
+ ::slotted([data-showwhen="untoggled"]) {
+ display: none;
+ }
+}
+
+:host([aria-pressed="false"]) {
+ ::slotted([data-showwhen="toggled"]) {
+ display: none;
+ }
+}
diff --git a/packages/components/src/components/post-togglebutton/post-togglebutton.tsx b/packages/components/src/components/post-togglebutton/post-togglebutton.tsx
index 0f5d884884..b34c4f8282 100644
--- a/packages/components/src/components/post-togglebutton/post-togglebutton.tsx
+++ b/packages/components/src/components/post-togglebutton/post-togglebutton.tsx
@@ -1,9 +1,9 @@
-import { Component, Host, h, Prop } from '@stencil/core';
+import { Component, Host, h, Prop, Watch } from '@stencil/core';
import { version } from '@root/package.json';
+import { checkType } from '@/utils';
/**
- * @slot toggled - Slot for content displayed when the button is in the "on" state.
- * @slot untoggled - Slot for content displayed when the button is in the "off" state.
+ * @slot default - Slot for the content of the button.
*/
@Component({
@@ -15,7 +15,20 @@ export class PostTogglebutton {
/**
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
*/
- @Prop({ reflect: true, mutable: true }) toggled: boolean = false;
+ @Prop({ mutable: true }) toggled: boolean = false;
+
+ @Watch('toggled')
+ validateToggled(value = this.toggled) {
+ checkType(
+ value,
+ 'boolean',
+ 'The "toggled" property of the post-togglebutton must be a boolean.',
+ );
+ }
+
+ componentWillLoad() {
+ this.validateToggled();
+ }
private handleClick = () => {
this.toggled = !this.toggled;
@@ -38,12 +51,7 @@ export class PostTogglebutton {
onClick={this.handleClick}
onKeyDown={this.handleKeydown}
>
-