@justfixnyc/component-library 0.50.2 → 0.51.1

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.
@@ -667,6 +667,17 @@
667
667
  letter-spacing: 0.54px;
668
668
  color: #242323;
669
669
  margin-bottom: 2rem;
670
+ position: relative;
671
+ --input-padding-left: 9px;
672
+ }
673
+ .jfcl-text-input.jfcl-text-input--has-prefix {
674
+ --input-padding-left: 31.5px;
675
+ }
676
+ .jfcl-text-input .jfcl-text-input__prefix {
677
+ position: absolute;
678
+ left: 14px;
679
+ height: 44px;
680
+ line-height: 44px;
670
681
  }
671
682
  .jfcl-text-input .jfcl-text-input__input {
672
683
  font-family: "Degular", Arial, Helvetica, sans-serif;
@@ -678,7 +689,10 @@
678
689
  box-sizing: border-box;
679
690
  width: 100%;
680
691
  height: 44px;
681
- padding: 10px 9px;
692
+ padding-top: 10px;
693
+ padding-bottom: 10px;
694
+ padding-right: 9px;
695
+ padding-left: var(--input-padding-left);
682
696
  border-radius: 4px;
683
697
  border: 1px solid #242323;
684
698
  background: #faf8f4;
@@ -695,7 +709,7 @@
695
709
  .jfcl-text-input .jfcl-text-input__input:active:not(:disabled) {
696
710
  border-radius: 4px;
697
711
  border: 2px solid #242323;
698
- padding-left: 8px;
712
+ padding-left: calc(var(--input-padding-left) - 1px);
699
713
  background: #ffffff;
700
714
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
701
715
  }
@@ -667,6 +667,17 @@
667
667
  letter-spacing: 0.54px;
668
668
  color: #242323;
669
669
  margin-bottom: 2rem;
670
+ position: relative;
671
+ --input-padding-left: 9px;
672
+ }
673
+ .jfcl-text-input.jfcl-text-input--has-prefix {
674
+ --input-padding-left: 31.5px;
675
+ }
676
+ .jfcl-text-input .jfcl-text-input__prefix {
677
+ position: absolute;
678
+ left: 14px;
679
+ height: 44px;
680
+ line-height: 44px;
670
681
  }
671
682
  .jfcl-text-input .jfcl-text-input__input {
672
683
  font-family: "Degular", Arial, Helvetica, sans-serif;
@@ -678,7 +689,10 @@
678
689
  box-sizing: border-box;
679
690
  width: 100%;
680
691
  height: 44px;
681
- padding: 10px 9px;
692
+ padding-top: 10px;
693
+ padding-bottom: 10px;
694
+ padding-right: 9px;
695
+ padding-left: var(--input-padding-left);
682
696
  border-radius: 4px;
683
697
  border: 1px solid #242323;
684
698
  background: #faf8f4;
@@ -695,7 +709,7 @@
695
709
  .jfcl-text-input .jfcl-text-input__input:active:not(:disabled) {
696
710
  border-radius: 4px;
697
711
  border: 2px solid #242323;
698
- padding-left: 8px;
712
+ padding-left: calc(var(--input-padding-left) - 1px);
699
713
  background: #ffffff;
700
714
  box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.2);
701
715
  }
@@ -545,8 +545,11 @@ const TextInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
545
545
  type = 'text',
546
546
  ...props
547
547
  } = _ref;
548
+ const inputIsMoney = type === 'money';
549
+ const inputType = inputIsMoney ? 'text' : type;
548
550
  const textInputWrapperClassNames = classNames('jfcl-text-input', {
549
- ['jfcl-text-input--is-invalid']: invalid
551
+ ['jfcl-text-input--is-invalid']: invalid,
552
+ ["jfcl-text-input--has-prefix"]: inputIsMoney
550
553
  }, className);
551
554
  const textInputClassNames = classNames('jfcl-text-input__input', {
552
555
  ["jfcl-text-input--size-".concat(size)]: size
@@ -560,12 +563,14 @@ const TextInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
560
563
  invalidText: invalidText,
561
564
  invalid: invalid,
562
565
  labelFor: id
563
- }), /*#__PURE__*/React.createElement("input", _extends({
566
+ }), inputIsMoney && /*#__PURE__*/React.createElement("span", {
567
+ className: "jfcl-text-input__prefix"
568
+ }, "$"), /*#__PURE__*/React.createElement("input", _extends({
564
569
  ref: ref
565
570
  }, props, {
566
571
  id: id,
567
572
  className: textInputClassNames,
568
- type: type
573
+ type: inputType
569
574
  })));
570
575
  });
571
576
  TextInput.displayName = 'TextInput';
package/dist/src/index.js CHANGED
@@ -556,8 +556,11 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
556
556
  type = 'text',
557
557
  ...props
558
558
  } = _ref;
559
+ const inputIsMoney = type === 'money';
560
+ const inputType = inputIsMoney ? 'text' : type;
559
561
  const textInputWrapperClassNames = classNames__default["default"]('jfcl-text-input', {
560
- ['jfcl-text-input--is-invalid']: invalid
562
+ ['jfcl-text-input--is-invalid']: invalid,
563
+ ["jfcl-text-input--has-prefix"]: inputIsMoney
561
564
  }, className);
562
565
  const textInputClassNames = classNames__default["default"]('jfcl-text-input__input', {
563
566
  ["jfcl-text-input--size-".concat(size)]: size
@@ -571,12 +574,14 @@ const TextInput = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
571
574
  invalidText: invalidText,
572
575
  invalid: invalid,
573
576
  labelFor: id
574
- }), /*#__PURE__*/React__default["default"].createElement("input", _extends__default["default"]({
577
+ }), inputIsMoney && /*#__PURE__*/React__default["default"].createElement("span", {
578
+ className: "jfcl-text-input__prefix"
579
+ }, "$"), /*#__PURE__*/React__default["default"].createElement("input", _extends__default["default"]({
575
580
  ref: ref
576
581
  }, props, {
577
582
  id: id,
578
583
  className: textInputClassNames,
579
- type: type
584
+ type: inputType
580
585
  })));
581
586
  });
582
587
  TextInput.displayName = 'TextInput';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@justfixnyc/component-library",
3
3
  "description": "JustFix Component Library",
4
4
  "license": "MIT",
5
- "version": "0.50.2",
5
+ "version": "0.51.1",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.es.js",
8
8
  "files": [