@justfixnyc/component-library 0.50.0 → 0.50.2

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.
@@ -604,6 +604,60 @@
604
604
  transform: rotate(360deg);
605
605
  }
606
606
  }
607
+ .jfcl-select-button {
608
+ display: inline-flex;
609
+ margin-right: 0.75rem;
610
+ }
611
+ .jfcl-select-button:last-of-type {
612
+ margin-right: 0;
613
+ }
614
+ .jfcl-select-button.jfcl-select-button--is-disabled .jfcl-select-button__label {
615
+ pointer-events: none;
616
+ background-color: #f2f2f2;
617
+ border-color: #9a9898;
618
+ color: #676565;
619
+ }
620
+
621
+ .jfcl-select-button__input {
622
+ position: absolute;
623
+ width: 0px;
624
+ height: 0px;
625
+ opacity: 0;
626
+ }
627
+
628
+ .jfcl-select-button__label {
629
+ font-family: "Degular", Arial, Helvetica, sans-serif;
630
+ font-style: normal;
631
+ font-weight: 500;
632
+ font-size: 1.125rem;
633
+ line-height: 120%;
634
+ letter-spacing: 0.54px;
635
+ display: flex;
636
+ justify-content: center;
637
+ flex-grow: 1;
638
+ white-space: nowrap;
639
+ border-radius: 6px;
640
+ border: 1px solid #9a9898;
641
+ background: #faf8f4;
642
+ padding: 0.75rem;
643
+ cursor: pointer;
644
+ }
645
+ .jfcl-select-button__label:hover {
646
+ border: 2px solid #242323;
647
+ padding: 0.6875rem;
648
+ }
649
+
650
+ .jfcl-select-button__input:checked + .jfcl-select-button__label {
651
+ background-color: #c6d8ff;
652
+ }
653
+ @keyframes spin {
654
+ from {
655
+ transform: rotate(0deg);
656
+ }
657
+ to {
658
+ transform: rotate(360deg);
659
+ }
660
+ }
607
661
  .jfcl-text-input {
608
662
  font-family: "Degular", Arial, Helvetica, sans-serif;
609
663
  font-style: normal;
@@ -604,6 +604,60 @@
604
604
  transform: rotate(360deg);
605
605
  }
606
606
  }
607
+ .jfcl-select-button {
608
+ display: inline-flex;
609
+ margin-right: 0.75rem;
610
+ }
611
+ .jfcl-select-button:last-of-type {
612
+ margin-right: 0;
613
+ }
614
+ .jfcl-select-button.jfcl-select-button--is-disabled .jfcl-select-button__label {
615
+ pointer-events: none;
616
+ background-color: #f2f2f2;
617
+ border-color: #9a9898;
618
+ color: #676565;
619
+ }
620
+
621
+ .jfcl-select-button__input {
622
+ position: absolute;
623
+ width: 0px;
624
+ height: 0px;
625
+ opacity: 0;
626
+ }
627
+
628
+ .jfcl-select-button__label {
629
+ font-family: "Degular", Arial, Helvetica, sans-serif;
630
+ font-style: normal;
631
+ font-weight: 500;
632
+ font-size: 1.125rem;
633
+ line-height: 120%;
634
+ letter-spacing: 0.54px;
635
+ display: flex;
636
+ justify-content: center;
637
+ flex-grow: 1;
638
+ white-space: nowrap;
639
+ border-radius: 6px;
640
+ border: 1px solid #9a9898;
641
+ background: #faf8f4;
642
+ padding: 0.75rem;
643
+ cursor: pointer;
644
+ }
645
+ .jfcl-select-button__label:hover {
646
+ border: 2px solid #242323;
647
+ padding: 0.6875rem;
648
+ }
649
+
650
+ .jfcl-select-button__input:checked + .jfcl-select-button__label {
651
+ background-color: #c6d8ff;
652
+ }
653
+ @keyframes spin {
654
+ from {
655
+ transform: rotate(0deg);
656
+ }
657
+ to {
658
+ transform: rotate(360deg);
659
+ }
660
+ }
607
661
  .jfcl-text-input {
608
662
  font-family: "Degular", Arial, Helvetica, sans-serif;
609
663
  font-style: normal;
@@ -498,6 +498,38 @@ const RadioButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
498
498
  });
499
499
  RadioButton.displayName = 'RadioButton';
500
500
 
501
+ /**
502
+ * Accepts all `InputHTMLAttributes`
503
+ */
504
+ const SelectButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
505
+ let {
506
+ className,
507
+ labelText,
508
+ disabled,
509
+ id,
510
+ ...props
511
+ } = _ref;
512
+ const SelectButtonClassNames = classNames('jfcl-select-button', {
513
+ ['jfcl-select-button--is-disabled']: disabled
514
+ }, className);
515
+ const generatedID = useId();
516
+ return /*#__PURE__*/React.createElement("div", {
517
+ className: SelectButtonClassNames,
518
+ "data-testid": "jfcl-select-button"
519
+ }, /*#__PURE__*/React.createElement("input", _extends({
520
+ ref: ref
521
+ }, props, {
522
+ id: id || generatedID,
523
+ className: "jfcl-select-button__input",
524
+ type: "radio"
525
+ })), /*#__PURE__*/React.createElement("label", {
526
+ htmlFor: id || generatedID,
527
+ className: "jfcl-select-button__label",
528
+ "data-testid": "jfcl-select-button__label"
529
+ }, labelText));
530
+ });
531
+ SelectButton.displayName = 'SelectButton';
532
+
501
533
  /**
502
534
  * Accepts all `InputHTMLAttributes`
503
535
  */
@@ -538,4 +570,4 @@ const TextInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
538
570
  });
539
571
  TextInput.displayName = 'TextInput';
540
572
 
541
- export { Alert, Button, Checkbox, Dropdown, FormGroup, Icon, Link, RadioButton, TextInput };
573
+ export { Alert, Button, Checkbox, Dropdown, FormGroup, Icon, Link, RadioButton, SelectButton, TextInput };
package/dist/src/index.js CHANGED
@@ -509,6 +509,38 @@ const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
509
509
  });
510
510
  RadioButton.displayName = 'RadioButton';
511
511
 
512
+ /**
513
+ * Accepts all `InputHTMLAttributes`
514
+ */
515
+ const SelectButton = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
516
+ let {
517
+ className,
518
+ labelText,
519
+ disabled,
520
+ id,
521
+ ...props
522
+ } = _ref;
523
+ const SelectButtonClassNames = classNames__default["default"]('jfcl-select-button', {
524
+ ['jfcl-select-button--is-disabled']: disabled
525
+ }, className);
526
+ const generatedID = React.useId();
527
+ return /*#__PURE__*/React__default["default"].createElement("div", {
528
+ className: SelectButtonClassNames,
529
+ "data-testid": "jfcl-select-button"
530
+ }, /*#__PURE__*/React__default["default"].createElement("input", _extends__default["default"]({
531
+ ref: ref
532
+ }, props, {
533
+ id: id || generatedID,
534
+ className: "jfcl-select-button__input",
535
+ type: "radio"
536
+ })), /*#__PURE__*/React__default["default"].createElement("label", {
537
+ htmlFor: id || generatedID,
538
+ className: "jfcl-select-button__label",
539
+ "data-testid": "jfcl-select-button__label"
540
+ }, labelText));
541
+ });
542
+ SelectButton.displayName = 'SelectButton';
543
+
512
544
  /**
513
545
  * Accepts all `InputHTMLAttributes`
514
546
  */
@@ -557,4 +589,5 @@ exports.FormGroup = FormGroup;
557
589
  exports.Icon = Icon;
558
590
  exports.Link = Link;
559
591
  exports.RadioButton = RadioButton;
592
+ exports.SelectButton = SelectButton;
560
593
  exports.TextInput = TextInput;
@@ -7,4 +7,5 @@ export * from './Components/FormGroup/FormGroup';
7
7
  export * from './Components/Icon/Icon';
8
8
  export * from './Components/Link/Link';
9
9
  export * from './Components/RadioButton/RadioButton';
10
+ export * from './Components/SelectButton/SelectButton';
10
11
  export * from './Components/TextInput/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.0",
5
+ "version": "0.50.2",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.es.js",
8
8
  "files": [