@hexure/ui 1.14.11 → 1.14.12

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.
@@ -21,6 +21,8 @@ export interface CheckboxProps extends AccessibleProps {
21
21
  isWarningError?: boolean;
22
22
  dataSectionName?: string;
23
23
  isLabelBold?: boolean;
24
+ /** Location of the label: "Bottom" or "Right" (default: "Right") */
25
+ labelLoc?: 'Bottom' | 'Right';
24
26
  }
25
27
  declare const Checkbox: FC<CheckboxProps>;
26
28
  export default Checkbox;
@@ -21,6 +21,8 @@ export interface RadioProps extends AccessibleProps {
21
21
  isInvalidRedBackground?: boolean;
22
22
  isWarningError?: boolean;
23
23
  isLabelBold?: boolean;
24
+ /** Location of the label: "Bottom" or "Right" (default: "Right") */
25
+ labelLoc?: 'Bottom' | 'Right';
24
26
  }
25
27
  declare const Radio: FC<RadioProps>;
26
28
  export default Radio;
package/dist/esm/index.js CHANGED
@@ -3561,7 +3561,9 @@ const Wrapper$c = styled.label `
3561
3561
  margin-left: -6px;
3562
3562
  cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
3563
3563
  display: flex;
3564
- align-items: center;
3564
+ flex-direction: ${props => (props.$labelLoc === 'Bottom' ? 'column' : 'row')};
3565
+ align-items: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'center')};
3566
+ justify-content: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'flex-start')};
3565
3567
  font-size: ${FontSizes.DEFAULT};
3566
3568
  line-height: 1.6em;
3567
3569
  box-sizing: border-box;
@@ -3653,16 +3655,19 @@ const Label$3 = styled.span `
3653
3655
  font-weight: ${props => (props.$isLabelBold ? 'bold' : '400')};
3654
3656
  line-height: 1.6em;
3655
3657
  color: ${props => props.color || Colors.BLACK.Hex};
3656
- margin-left: 6px;
3658
+ margin-left: ${props => (props.$labelLoc === 'Bottom' ? '0' : '6px')};
3659
+ margin-top: ${props => (props.$labelLoc === 'Bottom' ? '6px' : '0')};
3657
3660
  box-sizing: border-box;
3661
+ width: 100%;
3662
+ text-align: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'left')};
3658
3663
  `;
3659
3664
  const Checkbox = (_a) => {
3660
- var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, dataSectionName, isLabelBold = false } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "dataSectionName", "isLabelBold"]);
3665
+ var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, dataSectionName, isLabelBold = false, labelLoc = 'Right' } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "dataSectionName", "isLabelBold", "labelLoc"]);
3661
3666
  const baseId = dataItemid || 'checkbox';
3662
- return (React.createElement(Wrapper$c, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3667
+ return (React.createElement(Wrapper$c, Object.assign({ "$disabled": disabled, "$labelLoc": labelLoc }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
3663
3668
  React.createElement(Input$2, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, "data-section-name": dataSectionName, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
3664
3669
  React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
3665
- children ? (React.createElement(Label$3, { "$isLabelBold": isLabelBold, color: color, "data-itemid": `${baseId}-label` },
3670
+ children ? (React.createElement(Label$3, { "$isLabelBold": isLabelBold, "$labelLoc": labelLoc, color: color, "data-itemid": `${baseId}-label` },
3666
3671
  children,
3667
3672
  tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)) : null));
3668
3673
  };
@@ -6200,7 +6205,9 @@ const Wrapper$2 = styled.label `
6200
6205
  margin-left: -6px;
6201
6206
  cursor: ${props => (props.$disabled ? 'default' : 'pointer')};
6202
6207
  display: flex;
6203
- align-items: center;
6208
+ flex-direction: ${props => (props.$labelLoc === 'Bottom' ? 'column' : 'row')};
6209
+ align-items: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'center')};
6210
+ justify-content: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'flex-start')};
6204
6211
  font-size: ${FontSizes.DEFAULT};
6205
6212
  line-height: 1.6em;
6206
6213
  box-sizing: border-box;
@@ -6290,15 +6297,18 @@ const Label = styled.span `
6290
6297
  font-weight: ${props => (props.$isLabelBold ? 'bold' : '400')};
6291
6298
  color: ${Colors.BLACK.Hex};
6292
6299
  line-height: 1.6em;
6293
- margin-left: 6px;
6300
+ margin-left: ${props => (props.$labelLoc === 'Bottom' ? '0' : '6px')};
6301
+ margin-top: ${props => (props.$labelLoc === 'Bottom' ? '6px' : '0')};
6302
+ width: 100%;
6303
+ text-align: ${props => (props.$labelLoc === 'Bottom' ? 'center' : 'left')};
6294
6304
  `;
6295
6305
  const Radio = (_a) => {
6296
- var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, isLabelBold = false } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "isLabelBold"]);
6306
+ var { children, disabled, checked, onChange, value, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, isLabelBold = false, labelLoc = 'Right' } = _a, accessibleProps = __rest(_a, ["children", "disabled", "checked", "onChange", "value", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "isLabelBold", "labelLoc"]);
6297
6307
  const baseId = dataItemid || 'radio';
6298
- return (React.createElement(Wrapper$2, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
6308
+ return (React.createElement(Wrapper$2, Object.assign({ "$disabled": disabled, "$labelLoc": labelLoc }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
6299
6309
  React.createElement(Input, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'radio', value: value }),
6300
6310
  React.createElement(Check, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
6301
- React.createElement(Label, { "$isLabelBold": isLabelBold, "data-itemid": `${baseId}-label` },
6311
+ React.createElement(Label, { "$isLabelBold": isLabelBold, "$labelLoc": labelLoc, "data-itemid": `${baseId}-label` },
6302
6312
  children,
6303
6313
  tooltip ? React.createElement(Tooltip, Object.assign({}, tooltip)) : null)));
6304
6314
  };