Open the shape's shapesheet and:
Resizing shape's width with text: Set cell Width = GUARD(TEXTWIDTH(TheText))
Resizing shape's width with text, but with a minimum size (10mm in this case): Set cell Width = GUARD(MAX(TEXTWIDTH(TheText), 10mm))
Screenshots:
1) Open the shape's shapesheet:
2) Change the shape's width: