@indico-data/design-system 2.6.0 → 2.7.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.
package/lib/index.css CHANGED
@@ -1054,6 +1054,95 @@
1054
1054
  background: var(--pf-radio-disabled-color);
1055
1055
  }
1056
1056
 
1057
+ :root,
1058
+ :root [data-theme=light],
1059
+ :root [data-theme=dark] {
1060
+ --pf-checkbox-background-color: var(--pf-white-color);
1061
+ --pf-checkbox-check-color: var(--pf-primary-color);
1062
+ --pf-checkbox-border-color: var(--pf-gray-color);
1063
+ --pf-checkbox-disabled-color: var(--pf-gray-color-400);
1064
+ }
1065
+
1066
+ :root [data-theme=dark] {
1067
+ --pf-checkbox-background-color: transparent;
1068
+ --pf-checkbox-check-color: var(--pf-white-color);
1069
+ --pf-checkbox-border-color: var(--pf-white-color);
1070
+ --pf-checkbox-disabled-color: var(--pf-gray-color-300);
1071
+ }
1072
+
1073
+ .form-control .checkbox-wrapper {
1074
+ display: flex;
1075
+ margin-bottom: var(--pf-margin-2);
1076
+ align-items: center;
1077
+ }
1078
+ .form-control .checkbox-input {
1079
+ margin: 0;
1080
+ margin-right: var(--pf-margin-2);
1081
+ cursor: pointer;
1082
+ }
1083
+ .form-control .checkbox-input-label {
1084
+ cursor: pointer;
1085
+ }
1086
+ .form-control [type=checkbox]:checked,
1087
+ .form-control [type=checkbox]:not(:checked) {
1088
+ position: absolute;
1089
+ left: -9999px;
1090
+ }
1091
+ .form-control [type=checkbox]:checked + label,
1092
+ .form-control [type=checkbox]:not(:checked) + label {
1093
+ position: relative;
1094
+ padding-left: var(--pf-padding-7);
1095
+ cursor: pointer;
1096
+ line-height: 20px;
1097
+ display: inline-block;
1098
+ }
1099
+ .form-control [type=checkbox]:checked + label:before,
1100
+ .form-control [type=checkbox]:not(:checked) + label:before {
1101
+ content: "";
1102
+ position: absolute;
1103
+ left: 0;
1104
+ top: 0;
1105
+ width: 18px;
1106
+ height: 18px;
1107
+ border: 1px solid var(--pf-checkbox-border-color);
1108
+ border-radius: var(--pf-rounded);
1109
+ background: var(--pf-checkbox-background-color);
1110
+ }
1111
+ .form-control [type=checkbox]:checked + label:after,
1112
+ .form-control [type=checkbox]:not(:checked) + label:after {
1113
+ content: "";
1114
+ width: 12px;
1115
+ height: 12px;
1116
+ background: var(--pf-checkbox-check-color);
1117
+ position: absolute;
1118
+ top: 4px;
1119
+ left: 4px;
1120
+ border-radius: var(--pf-rounded);
1121
+ transition: all 0.2s ease;
1122
+ }
1123
+ .form-control [type=checkbox]:not(:checked) + label:after {
1124
+ opacity: 0;
1125
+ transform: scale(0);
1126
+ }
1127
+ .form-control [type=checkbox]:checked + label:after {
1128
+ opacity: 1;
1129
+ transform: scale(1);
1130
+ }
1131
+ .form-control [type=checkbox]:disabled,
1132
+ .form-control [type=checkbox]:disabled + label {
1133
+ cursor: not-allowed;
1134
+ }
1135
+ .form-control [type=checkbox]:disabled + label {
1136
+ color: var(--pf-checkbox-disabled-color);
1137
+ opacity: 0.5;
1138
+ }
1139
+ .form-control [type=checkbox]:disabled + label:before {
1140
+ border-color: var(--pf-checkbox-disabled-color);
1141
+ }
1142
+ .form-control [type=checkbox]:disabled + label:after {
1143
+ background: var(--pf-checkbox-disabled-color);
1144
+ }
1145
+
1057
1146
  :root {
1058
1147
  --pf-font-family-base: "Mulish", sans-serif;
1059
1148
  --pf-font-size-base: 1rem;
package/lib/index.d.ts CHANGED
@@ -950,4 +950,16 @@ interface RadioProps {
950
950
  }
951
951
  declare const Radio: ({ ref, id, label, name, value, onChange, isDisabled, ...rest }: RadioProps) => react_jsx_runtime.JSX.Element;
952
952
 
953
- export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio$2 as Radio, RadioGroup$1 as RadioGroup, Radio as RadioInput, RandomLoadingMessage, Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table, TextInput, TextTruncate, Toggle, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
953
+ interface CheckboxProps {
954
+ ref?: React$1.LegacyRef<HTMLInputElement>;
955
+ id: string;
956
+ label: string;
957
+ name: string;
958
+ value?: string;
959
+ isChecked?: boolean | undefined;
960
+ onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
961
+ isDisabled?: boolean;
962
+ }
963
+ declare const Checkbox: ({ ref, id, label, name, value, onChange, isDisabled, isChecked, ...rest }: CheckboxProps) => react_jsx_runtime.JSX.Element;
964
+
965
+ export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button, allColors as COLORS, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio$2 as Radio, RadioGroup$1 as RadioGroup, Radio as RadioInput, RandomLoadingMessage, Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table, TextInput, TextTruncate, Toggle, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
package/lib/index.esm.css CHANGED
@@ -1054,6 +1054,95 @@
1054
1054
  background: var(--pf-radio-disabled-color);
1055
1055
  }
1056
1056
 
1057
+ :root,
1058
+ :root [data-theme=light],
1059
+ :root [data-theme=dark] {
1060
+ --pf-checkbox-background-color: var(--pf-white-color);
1061
+ --pf-checkbox-check-color: var(--pf-primary-color);
1062
+ --pf-checkbox-border-color: var(--pf-gray-color);
1063
+ --pf-checkbox-disabled-color: var(--pf-gray-color-400);
1064
+ }
1065
+
1066
+ :root [data-theme=dark] {
1067
+ --pf-checkbox-background-color: transparent;
1068
+ --pf-checkbox-check-color: var(--pf-white-color);
1069
+ --pf-checkbox-border-color: var(--pf-white-color);
1070
+ --pf-checkbox-disabled-color: var(--pf-gray-color-300);
1071
+ }
1072
+
1073
+ .form-control .checkbox-wrapper {
1074
+ display: flex;
1075
+ margin-bottom: var(--pf-margin-2);
1076
+ align-items: center;
1077
+ }
1078
+ .form-control .checkbox-input {
1079
+ margin: 0;
1080
+ margin-right: var(--pf-margin-2);
1081
+ cursor: pointer;
1082
+ }
1083
+ .form-control .checkbox-input-label {
1084
+ cursor: pointer;
1085
+ }
1086
+ .form-control [type=checkbox]:checked,
1087
+ .form-control [type=checkbox]:not(:checked) {
1088
+ position: absolute;
1089
+ left: -9999px;
1090
+ }
1091
+ .form-control [type=checkbox]:checked + label,
1092
+ .form-control [type=checkbox]:not(:checked) + label {
1093
+ position: relative;
1094
+ padding-left: var(--pf-padding-7);
1095
+ cursor: pointer;
1096
+ line-height: 20px;
1097
+ display: inline-block;
1098
+ }
1099
+ .form-control [type=checkbox]:checked + label:before,
1100
+ .form-control [type=checkbox]:not(:checked) + label:before {
1101
+ content: "";
1102
+ position: absolute;
1103
+ left: 0;
1104
+ top: 0;
1105
+ width: 18px;
1106
+ height: 18px;
1107
+ border: 1px solid var(--pf-checkbox-border-color);
1108
+ border-radius: var(--pf-rounded);
1109
+ background: var(--pf-checkbox-background-color);
1110
+ }
1111
+ .form-control [type=checkbox]:checked + label:after,
1112
+ .form-control [type=checkbox]:not(:checked) + label:after {
1113
+ content: "";
1114
+ width: 12px;
1115
+ height: 12px;
1116
+ background: var(--pf-checkbox-check-color);
1117
+ position: absolute;
1118
+ top: 4px;
1119
+ left: 4px;
1120
+ border-radius: var(--pf-rounded);
1121
+ transition: all 0.2s ease;
1122
+ }
1123
+ .form-control [type=checkbox]:not(:checked) + label:after {
1124
+ opacity: 0;
1125
+ transform: scale(0);
1126
+ }
1127
+ .form-control [type=checkbox]:checked + label:after {
1128
+ opacity: 1;
1129
+ transform: scale(1);
1130
+ }
1131
+ .form-control [type=checkbox]:disabled,
1132
+ .form-control [type=checkbox]:disabled + label {
1133
+ cursor: not-allowed;
1134
+ }
1135
+ .form-control [type=checkbox]:disabled + label {
1136
+ color: var(--pf-checkbox-disabled-color);
1137
+ opacity: 0.5;
1138
+ }
1139
+ .form-control [type=checkbox]:disabled + label:before {
1140
+ border-color: var(--pf-checkbox-disabled-color);
1141
+ }
1142
+ .form-control [type=checkbox]:disabled + label:after {
1143
+ background: var(--pf-checkbox-disabled-color);
1144
+ }
1145
+
1057
1146
  :root {
1058
1147
  --pf-font-family-base: "Mulish", sans-serif;
1059
1148
  --pf-font-size-base: 1rem;
package/lib/index.esm.js CHANGED
@@ -18654,6 +18654,11 @@ const Radio$2 = (_a) => {
18654
18654
  return (jsx("div", { className: "form-control", children: jsxs("div", { className: "radio-wrapper", children: [jsx("input", Object.assign({ "data-testid": `form-radio-input-${name}` }, rest, { className: "radio-input", type: "radio", id: id, name: name, value: value, disabled: isDisabled, ref: ref, onChange: onChange, tabIndex: 0, "aria-describedby": id, "aria-label": label })), jsx("label", { htmlFor: id, className: "radio-input-label", "data-testid": `label-radio-input-${name}`, children: label })] }) }));
18655
18655
  };
18656
18656
 
18657
+ const Checkbox = (_a) => {
18658
+ var { ref, id, label, name, value, onChange, isDisabled, isChecked = false } = _a, rest = __rest$1(_a, ["ref", "id", "label", "name", "value", "onChange", "isDisabled", "isChecked"]);
18659
+ return (jsx("div", { className: "form-control", children: jsxs("div", { className: "checkbox-wrapper", children: [jsx("input", Object.assign({ "data-testid": `form-checkbox-input-${name}` }, rest, { className: "checkbox-input", type: "checkbox", id: id, checked: isChecked, name: name, value: value, disabled: isDisabled, ref: ref, onChange: onChange, tabIndex: 0, "aria-describedby": id, "aria-label": label })), jsx("label", { htmlFor: id, className: "checkbox-input-label", "data-testid": `label-checkbox-input-${name}`, children: label })] }) }));
18660
+ };
18661
+
18657
18662
  const StyledAccordion = styled.details `
18658
18663
  summary {
18659
18664
  display: inherit;
@@ -41475,5 +41480,5 @@ const Tooltip = (props) => {
41475
41480
  openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
41476
41481
  };
41477
41482
 
41478
- export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, Toggle, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
41483
+ export { animation as ANIMATION, Radio$1 as AbstractRadio, RadioGroup$1 as AbstractRadioGroup, Accordion, breakpoints as BREAKPOINT, BarSpinner, BorderSelect, Button$2 as Button, allColors as COLORS, Checkbox, CirclePulse, CircleSpinner, Col, ConfirmModal, Container, DatePicker, EditableInput, GlobalStyles, Icon, IconButton, Input, Button$1 as LegacyButton, ListTable, LoadingAwareContainer, LoadingList, margin as MARGINS, MATH, mediaQueries as MEDIA_QUERIES, ModalBase, MultiCombobox, NoInputDatePicker, NumberInput, padding as PADDINGS, Pagination, PercentageRing, Radio, RadioGroup, Radio$2 as RadioInput, RandomLoadingMessage, Row$1 as Row, spacings as SPACING, SearchInput, Section, SectionBlock, SectionBody, SectionHeader, SectionTable, Select, Shrug, SingleCombobox, typography as TYPOGRAPHY, Table$1 as Table, TextInput, TextTruncate, Toggle, Tooltip, color as colorUtils, number as numberUtils, string as stringUtils };
41479
41484
  //# sourceMappingURL=index.esm.js.map