@douyinfe/semi-ui 2.19.0-alpha.0 → 2.19.0-alpha.3

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.
@@ -235,8 +235,12 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
235
235
  const name = inGroup && this.context.checkboxGroup.name;
236
236
  const xSemiPropChildren = this.props['x-semi-children-alias'] || 'children';
237
237
 
238
+ if (!children && !extra) {
239
+ return null;
240
+ }
241
+
238
242
  const renderContent = () => (
239
- <>
243
+ <div className={`${prefix}-content`}>
240
244
  {children ? (
241
245
  <span id={addonId} className={`${prefix}-addon`} x-semi-prop={xSemiPropChildren}>
242
246
  {children}
@@ -247,7 +251,7 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
247
251
  {extra}
248
252
  </div>
249
253
  ) : null}
250
- </>
254
+ </div>
251
255
  );
252
256
  return (
253
257
  // label is better than span, however span is here which is to solve gitlab issue #364
@@ -276,11 +280,7 @@ class Checkbox extends BaseComponent<CheckboxProps, CheckboxState> {
276
280
  onInputFocus={this.handleFocusVisible}
277
281
  onInputBlur={this.handleBlur}
278
282
  />
279
- {
280
- props.isCardType ?
281
- <div>{renderContent()}</div> :
282
- renderContent()
283
- }
283
+ {renderContent()}
284
284
  </span>
285
285
  );
286
286
  }
package/dist/css/semi.css CHANGED
@@ -3471,7 +3471,7 @@ body {
3471
3471
  box-sizing: border-box;
3472
3472
  position: relative;
3473
3473
  display: flex;
3474
- align-items: center;
3474
+ align-items: flex-start;
3475
3475
  flex-wrap: wrap;
3476
3476
  font-size: 14px;
3477
3477
  line-height: 20px;
@@ -3479,6 +3479,7 @@ body {
3479
3479
  cursor: pointer;
3480
3480
  transition: background-color var(--semi-transition_duration-faster) var(--semi-transition_function-easeIn) var(--semi-transition_delay-fastest), border var(--semi-transition_duration-faster) var(--semi-transition_function-easeIn) var(--semi-transition_delay-fastest);
3481
3481
  transform: scale(var(--semi-transform_scale-none));
3482
+ column-gap: 8px;
3482
3483
  }
3483
3484
  .semi-checkbox input[type=checkbox] {
3484
3485
  position: absolute;
@@ -3489,11 +3490,16 @@ body {
3489
3490
  margin: 0;
3490
3491
  opacity: 0;
3491
3492
  }
3493
+ .semi-checkbox-content {
3494
+ flex: 1;
3495
+ display: flex;
3496
+ flex-direction: column;
3497
+ row-gap: 4px;
3498
+ }
3492
3499
  .semi-checkbox-addon {
3493
3500
  display: flex;
3494
3501
  flex: 1;
3495
3502
  align-items: center;
3496
- padding-left: 8px;
3497
3503
  color: var(--semi-color-text-0);
3498
3504
  line-height: 20px;
3499
3505
  user-select: none;
@@ -3722,9 +3728,7 @@ body {
3722
3728
  flex-grow: 1;
3723
3729
  flex-basis: 100%;
3724
3730
  box-sizing: border-box;
3725
- padding-left: 24px;
3726
3731
  color: var(--semi-color-text-2);
3727
- margin-top: 4px;
3728
3732
  }
3729
3733
  .semi-checkbox-focus {
3730
3734
  outline: 2px solid var(--semi-color-primary-light-active);
@@ -19499,9 +19503,6 @@ body {
19499
19503
  .semi-tree-option-list .semi-tree-option-label .semi-checkbox {
19500
19504
  margin-right: 8px;
19501
19505
  }
19502
- .semi-tree-option-list .semi-tree-option-label .semi-checkbox-addon > .semi-icon {
19503
- margin-right: 8px;
19504
- }
19505
19506
  .semi-tree-option-list .semi-tree-option-label-text {
19506
19507
  display: block;
19507
19508
  flex: 1;
@@ -19734,11 +19735,9 @@ body {
19734
19735
  .semi-tree-option-list-block .semi-tree-option-selected:hover, .semi-tree-option-list-block .semi-tree-option-selected:active {
19735
19736
  background-color: var(--semi-color-primary-light-default);
19736
19737
  }
19737
- .semi-tree-option-list-block .semi-tree-option-label-text {
19738
- padding: 0;
19739
- }
19740
19738
  .semi-tree-option-list-block .semi-tree-option-label-text,
19741
19739
  .semi-tree-option-list-block .semi-tree-option .semi-checkbox-addon {
19740
+ padding: 0;
19742
19741
  border-radius: var(--semi-border-radius-small);
19743
19742
  }
19744
19743
  .semi-tree-option-list-block .semi-tree-option-label-text:hover,