@ultraviolet/ui 1.38.0 → 1.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
8
8
 
9
9
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
10
10
  const Container = /*#__PURE__*/_styled(Stack, {
11
- target: "e1s5n3hj2"
11
+ target: "e1s5n3hj3"
12
12
  })("&[data-has-label='false']>:first-child{margin-bottom:-", ({
13
13
  theme
14
14
  }) => theme.space['0.5'], ";}padding:", ({
@@ -36,6 +36,11 @@ const Container = /*#__PURE__*/_styled(Stack, {
36
36
  }) => theme.colors.primary.border, ";&[data-cheked='false']{box-shadow:", ({
37
37
  theme
38
38
  }) => theme.shadows.hoverPrimary, ";}}}");
39
+ const StyledStack = /*#__PURE__*/_styled(Stack, {
40
+ target: "e1s5n3hj2"
41
+ })("&[data-has-label='true']{padding-left:", ({
42
+ theme
43
+ }) => theme.space['4'], ";}&[data-has-label='false']{display:contents;}");
39
44
  const StyledElement = /*#__PURE__*/_styled('div', {
40
45
  shouldForwardProp: prop => !['showTick', 'hasLabel'].includes(prop),
41
46
  target: "e1s5n3hj1"
@@ -52,10 +57,10 @@ const StyledElement = /*#__PURE__*/_styled('div', {
52
57
  hasLabel
53
58
  }) => !showTick && !hasLabel ? `display: none;` : null, ";}");
54
59
  const StyledRadio = /*#__PURE__*/StyledElement.withComponent(Radio, {
55
- target: "e1s5n3hj3"
60
+ target: "e1s5n3hj4"
56
61
  });
57
62
  const OverloadedCheckbox = /*#__PURE__*/StyledElement.withComponent(Checkbox, {
58
- target: "e1s5n3hj4"
63
+ target: "e1s5n3hj5"
59
64
  });
60
65
  const StyledCheckbox = /*#__PURE__*/_styled(OverloadedCheckbox, {
61
66
  target: "e1s5n3hj0"
@@ -155,10 +160,14 @@ const SelectableCard = /*#__PURE__*/forwardRef(({
155
160
  ref: innerRef,
156
161
  "data-error": isError,
157
162
  children: label
158
- }), typeof children === 'function' ? children({
159
- checked,
160
- disabled
161
- }) : children]
163
+ }), children ? jsx(StyledStack, {
164
+ "data-has-label": !!label && showTick,
165
+ width: "100%",
166
+ children: typeof children === 'function' ? children({
167
+ checked,
168
+ disabled
169
+ }) : children
170
+ }) : null]
162
171
  })
163
172
  });
164
173
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultraviolet/ui",
3
- "version": "1.38.0",
3
+ "version": "1.39.0",
4
4
  "description": "Ultraviolet UI",
5
5
  "homepage": "https://github.com/scaleway/ultraviolet#readme",
6
6
  "repository": {