@indico-data/design-system 2.5.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/.storybook/preview.ts +4 -14
- package/lib/index.css +178 -0
- package/lib/index.d.ts +43 -3
- package/lib/index.esm.css +178 -0
- package/lib/index.esm.js +28 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -1
- package/lib/src/components/forms/checkbox/Checkbox.d.ts +12 -0
- package/lib/src/components/forms/checkbox/Checkbox.stories.d.ts +7 -0
- package/lib/src/components/forms/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/lib/src/components/forms/checkbox/index.d.ts +1 -0
- package/lib/src/components/forms/radio/Radio.d.ts +11 -0
- package/lib/src/components/forms/radio/Radio.stories.d.ts +6 -0
- package/lib/src/components/forms/radio/__tests__/Radio.test.d.ts +1 -0
- package/lib/src/components/forms/radio/index.d.ts +1 -0
- package/lib/src/components/index.d.ts +2 -0
- package/lib/src/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/components/forms/checkbox/Checkbox.mdx +67 -0
- package/src/components/forms/checkbox/Checkbox.stories.tsx +169 -0
- package/src/components/forms/checkbox/Checkbox.tsx +55 -0
- package/src/components/forms/checkbox/__tests__/Checkbox.test.tsx +35 -0
- package/src/components/forms/checkbox/index.ts +1 -0
- package/src/components/forms/checkbox/styles/Checkbox.scss +98 -0
- package/src/components/forms/radio/Radio.mdx +83 -0
- package/src/components/forms/radio/Radio.stories.tsx +121 -0
- package/src/components/forms/radio/Radio.tsx +47 -0
- package/src/components/forms/radio/__tests__/Radio.test.tsx +35 -0
- package/src/components/forms/radio/index.ts +1 -0
- package/src/components/forms/radio/styles/Radio.scss +98 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +3 -0
- package/src/styles/index.scss +2 -0
- package/src/styles/storybook.scss +15 -0
package/.storybook/preview.ts
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
import type { Preview, ReactRenderer } from '@storybook/react';
|
|
2
2
|
import { withThemeByDataAttribute } from '@storybook/addon-themes';
|
|
3
|
-
// import { withThemeFromJSXProvider } from '@storybook/addon-themes';
|
|
4
|
-
// import { GlobalStyles } from '../src/legacy/styles/globals'; // TODO -- replace
|
|
5
3
|
import '@/styles/index.scss';
|
|
6
|
-
|
|
7
|
-
// export const decorators = [
|
|
8
|
-
// withThemeFromJSXProvider({
|
|
9
|
-
// GlobalStyles, // Adds your GlobalStyle component to all stories
|
|
10
|
-
// }),
|
|
11
|
-
// ];
|
|
4
|
+
import '@/styles/storybook.scss';
|
|
12
5
|
|
|
13
6
|
import React from 'react';
|
|
14
7
|
|
|
15
8
|
const preview: Preview = {
|
|
16
9
|
decorators: [
|
|
17
10
|
(Story: React.ComponentType) =>
|
|
18
|
-
React.createElement(
|
|
19
|
-
'div',
|
|
20
|
-
{ style: { padding: '1em' } },
|
|
21
|
-
// 👇 Decorators in Storybook also accept a function. Replace <Story/> with Story() to enable it
|
|
22
|
-
React.createElement(Story),
|
|
23
|
-
),
|
|
11
|
+
React.createElement('div', { style: { padding: '1em' } }, React.createElement(Story)),
|
|
24
12
|
withThemeByDataAttribute({
|
|
25
13
|
themes: {
|
|
26
14
|
light: 'light',
|
|
@@ -30,6 +18,8 @@ const preview: Preview = {
|
|
|
30
18
|
attributeName: 'data-theme',
|
|
31
19
|
parentSelector: 'body',
|
|
32
20
|
}),
|
|
21
|
+
(Story: React.ComponentType) =>
|
|
22
|
+
React.createElement('div', { className: 'sb__story' }, React.createElement(Story)),
|
|
33
23
|
],
|
|
34
24
|
parameters: {
|
|
35
25
|
backgrounds: { disable: true },
|
package/lib/index.css
CHANGED
|
@@ -965,6 +965,184 @@
|
|
|
965
965
|
margin-bottom: var(--pf-margin-2);
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
+
:root,
|
|
969
|
+
:root [data-theme=light],
|
|
970
|
+
:root [data-theme=dark] {
|
|
971
|
+
--pf-radio-background-color: var(--pf-white-color);
|
|
972
|
+
--pf-radio-check-color: var(--pf-primary-color);
|
|
973
|
+
--pf-radio-border-color: var(--pf-gray-color);
|
|
974
|
+
--pf-radio-disabled-color: var(--pf-gray-color-400);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
:root [data-theme=dark] {
|
|
978
|
+
--pf-radio-background-color: transparent;
|
|
979
|
+
--pf-radio-check-color: var(--pf-white-color);
|
|
980
|
+
--pf-radio-border-color: var(--pf-white-color);
|
|
981
|
+
--pf-radio-disabled-color: var(--pf-gray-color-300);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.form-control .radio-wrapper {
|
|
985
|
+
display: flex;
|
|
986
|
+
margin-bottom: var(--pf-margin-2);
|
|
987
|
+
align-items: center;
|
|
988
|
+
}
|
|
989
|
+
.form-control .radio-input {
|
|
990
|
+
margin: 0;
|
|
991
|
+
margin-right: var(--pf-margin-2);
|
|
992
|
+
cursor: pointer;
|
|
993
|
+
}
|
|
994
|
+
.form-control .radio-input-label {
|
|
995
|
+
cursor: pointer;
|
|
996
|
+
}
|
|
997
|
+
.form-control [type=radio]:checked,
|
|
998
|
+
.form-control [type=radio]:not(:checked) {
|
|
999
|
+
position: absolute;
|
|
1000
|
+
left: -9999px;
|
|
1001
|
+
}
|
|
1002
|
+
.form-control [type=radio]:checked + label,
|
|
1003
|
+
.form-control [type=radio]:not(:checked) + label {
|
|
1004
|
+
position: relative;
|
|
1005
|
+
padding-left: var(--pf-padding-7);
|
|
1006
|
+
cursor: pointer;
|
|
1007
|
+
line-height: 20px;
|
|
1008
|
+
display: inline-block;
|
|
1009
|
+
}
|
|
1010
|
+
.form-control [type=radio]:checked + label:before,
|
|
1011
|
+
.form-control [type=radio]:not(:checked) + label:before {
|
|
1012
|
+
content: "";
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
left: 0;
|
|
1015
|
+
top: 0;
|
|
1016
|
+
width: 18px;
|
|
1017
|
+
height: 18px;
|
|
1018
|
+
border: 1px solid var(--pf-radio-border-color);
|
|
1019
|
+
border-radius: 100%;
|
|
1020
|
+
background: var(--pf-radio-background-color);
|
|
1021
|
+
}
|
|
1022
|
+
.form-control [type=radio]:checked + label:after,
|
|
1023
|
+
.form-control [type=radio]:not(:checked) + label:after {
|
|
1024
|
+
content: "";
|
|
1025
|
+
width: 12px;
|
|
1026
|
+
height: 12px;
|
|
1027
|
+
background: var(--pf-radio-check-color);
|
|
1028
|
+
position: absolute;
|
|
1029
|
+
top: 4px;
|
|
1030
|
+
left: 4px;
|
|
1031
|
+
border-radius: 100%;
|
|
1032
|
+
transition: all 0.2s ease;
|
|
1033
|
+
}
|
|
1034
|
+
.form-control [type=radio]:not(:checked) + label:after {
|
|
1035
|
+
opacity: 0;
|
|
1036
|
+
transform: scale(0);
|
|
1037
|
+
}
|
|
1038
|
+
.form-control [type=radio]:checked + label:after {
|
|
1039
|
+
opacity: 1;
|
|
1040
|
+
transform: scale(1);
|
|
1041
|
+
}
|
|
1042
|
+
.form-control [type=radio]:disabled,
|
|
1043
|
+
.form-control [type=radio]:disabled + label {
|
|
1044
|
+
cursor: not-allowed;
|
|
1045
|
+
}
|
|
1046
|
+
.form-control [type=radio]:disabled + label {
|
|
1047
|
+
color: var(--pf-radio-disabled-color);
|
|
1048
|
+
opacity: 0.5;
|
|
1049
|
+
}
|
|
1050
|
+
.form-control [type=radio]:disabled + label:before {
|
|
1051
|
+
border-color: var(--pf-radio-disabled-color);
|
|
1052
|
+
}
|
|
1053
|
+
.form-control [type=radio]:disabled + label:after {
|
|
1054
|
+
background: var(--pf-radio-disabled-color);
|
|
1055
|
+
}
|
|
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
|
+
|
|
968
1146
|
:root {
|
|
969
1147
|
--pf-font-family-base: "Mulish", sans-serif;
|
|
970
1148
|
--pf-font-size-base: 1rem;
|
package/lib/index.d.ts
CHANGED
|
@@ -525,7 +525,7 @@ declare function RadioGroup$1({ children, ...props }: Props$d): react_jsx_runtim
|
|
|
525
525
|
/**
|
|
526
526
|
* A single radio button and its label.
|
|
527
527
|
*/
|
|
528
|
-
declare function Radio$
|
|
528
|
+
declare function Radio$2({ children, ...props }: AriaRadioProps): react_jsx_runtime.JSX.Element;
|
|
529
529
|
|
|
530
530
|
type RadioGroupProps = PermafrostComponent$1 & {
|
|
531
531
|
value?: string;
|
|
@@ -545,7 +545,7 @@ declare function RadioGroup(props: RadioGroupProps): react_jsx_runtime.JSX.Eleme
|
|
|
545
545
|
* A single radio button and its label; no styling is applied, and the native
|
|
546
546
|
* radio button is visually hidden.
|
|
547
547
|
*/
|
|
548
|
-
declare function Radio(props: AriaRadioProps & {
|
|
548
|
+
declare function Radio$1(props: AriaRadioProps & {
|
|
549
549
|
className?: string;
|
|
550
550
|
isVisuallySelected?: (selectedValue: string) => void;
|
|
551
551
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -922,4 +922,44 @@ type TableProps<T> = Omit<TableProps$1<T>, 'disabled' | 'progressPending' | 'dir
|
|
|
922
922
|
};
|
|
923
923
|
declare const Table: <T>(props: TableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
924
924
|
|
|
925
|
-
|
|
925
|
+
interface InputProps {
|
|
926
|
+
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
927
|
+
label: string;
|
|
928
|
+
name: string;
|
|
929
|
+
placeholder: string;
|
|
930
|
+
value: string;
|
|
931
|
+
onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
932
|
+
isRequired?: boolean;
|
|
933
|
+
isDisabled?: boolean;
|
|
934
|
+
errorList?: string[];
|
|
935
|
+
helpText?: string;
|
|
936
|
+
hasHiddenLabel?: boolean;
|
|
937
|
+
iconName?: IconName$1;
|
|
938
|
+
isClearable?: boolean;
|
|
939
|
+
}
|
|
940
|
+
declare const Input: ({ ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
|
|
941
|
+
|
|
942
|
+
interface RadioProps {
|
|
943
|
+
ref?: React$1.LegacyRef<HTMLInputElement>;
|
|
944
|
+
id: string;
|
|
945
|
+
label: string;
|
|
946
|
+
name: string;
|
|
947
|
+
value?: string;
|
|
948
|
+
onChange: (e: React$1.ChangeEvent<HTMLInputElement>) => void;
|
|
949
|
+
isDisabled?: boolean;
|
|
950
|
+
}
|
|
951
|
+
declare const Radio: ({ ref, id, label, name, value, onChange, isDisabled, ...rest }: RadioProps) => react_jsx_runtime.JSX.Element;
|
|
952
|
+
|
|
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
|
@@ -965,6 +965,184 @@
|
|
|
965
965
|
margin-bottom: var(--pf-margin-2);
|
|
966
966
|
}
|
|
967
967
|
|
|
968
|
+
:root,
|
|
969
|
+
:root [data-theme=light],
|
|
970
|
+
:root [data-theme=dark] {
|
|
971
|
+
--pf-radio-background-color: var(--pf-white-color);
|
|
972
|
+
--pf-radio-check-color: var(--pf-primary-color);
|
|
973
|
+
--pf-radio-border-color: var(--pf-gray-color);
|
|
974
|
+
--pf-radio-disabled-color: var(--pf-gray-color-400);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
:root [data-theme=dark] {
|
|
978
|
+
--pf-radio-background-color: transparent;
|
|
979
|
+
--pf-radio-check-color: var(--pf-white-color);
|
|
980
|
+
--pf-radio-border-color: var(--pf-white-color);
|
|
981
|
+
--pf-radio-disabled-color: var(--pf-gray-color-300);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.form-control .radio-wrapper {
|
|
985
|
+
display: flex;
|
|
986
|
+
margin-bottom: var(--pf-margin-2);
|
|
987
|
+
align-items: center;
|
|
988
|
+
}
|
|
989
|
+
.form-control .radio-input {
|
|
990
|
+
margin: 0;
|
|
991
|
+
margin-right: var(--pf-margin-2);
|
|
992
|
+
cursor: pointer;
|
|
993
|
+
}
|
|
994
|
+
.form-control .radio-input-label {
|
|
995
|
+
cursor: pointer;
|
|
996
|
+
}
|
|
997
|
+
.form-control [type=radio]:checked,
|
|
998
|
+
.form-control [type=radio]:not(:checked) {
|
|
999
|
+
position: absolute;
|
|
1000
|
+
left: -9999px;
|
|
1001
|
+
}
|
|
1002
|
+
.form-control [type=radio]:checked + label,
|
|
1003
|
+
.form-control [type=radio]:not(:checked) + label {
|
|
1004
|
+
position: relative;
|
|
1005
|
+
padding-left: var(--pf-padding-7);
|
|
1006
|
+
cursor: pointer;
|
|
1007
|
+
line-height: 20px;
|
|
1008
|
+
display: inline-block;
|
|
1009
|
+
}
|
|
1010
|
+
.form-control [type=radio]:checked + label:before,
|
|
1011
|
+
.form-control [type=radio]:not(:checked) + label:before {
|
|
1012
|
+
content: "";
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
left: 0;
|
|
1015
|
+
top: 0;
|
|
1016
|
+
width: 18px;
|
|
1017
|
+
height: 18px;
|
|
1018
|
+
border: 1px solid var(--pf-radio-border-color);
|
|
1019
|
+
border-radius: 100%;
|
|
1020
|
+
background: var(--pf-radio-background-color);
|
|
1021
|
+
}
|
|
1022
|
+
.form-control [type=radio]:checked + label:after,
|
|
1023
|
+
.form-control [type=radio]:not(:checked) + label:after {
|
|
1024
|
+
content: "";
|
|
1025
|
+
width: 12px;
|
|
1026
|
+
height: 12px;
|
|
1027
|
+
background: var(--pf-radio-check-color);
|
|
1028
|
+
position: absolute;
|
|
1029
|
+
top: 4px;
|
|
1030
|
+
left: 4px;
|
|
1031
|
+
border-radius: 100%;
|
|
1032
|
+
transition: all 0.2s ease;
|
|
1033
|
+
}
|
|
1034
|
+
.form-control [type=radio]:not(:checked) + label:after {
|
|
1035
|
+
opacity: 0;
|
|
1036
|
+
transform: scale(0);
|
|
1037
|
+
}
|
|
1038
|
+
.form-control [type=radio]:checked + label:after {
|
|
1039
|
+
opacity: 1;
|
|
1040
|
+
transform: scale(1);
|
|
1041
|
+
}
|
|
1042
|
+
.form-control [type=radio]:disabled,
|
|
1043
|
+
.form-control [type=radio]:disabled + label {
|
|
1044
|
+
cursor: not-allowed;
|
|
1045
|
+
}
|
|
1046
|
+
.form-control [type=radio]:disabled + label {
|
|
1047
|
+
color: var(--pf-radio-disabled-color);
|
|
1048
|
+
opacity: 0.5;
|
|
1049
|
+
}
|
|
1050
|
+
.form-control [type=radio]:disabled + label:before {
|
|
1051
|
+
border-color: var(--pf-radio-disabled-color);
|
|
1052
|
+
}
|
|
1053
|
+
.form-control [type=radio]:disabled + label:after {
|
|
1054
|
+
background: var(--pf-radio-disabled-color);
|
|
1055
|
+
}
|
|
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
|
+
|
|
968
1146
|
:root {
|
|
969
1147
|
--pf-font-family-base: "Mulish", sans-serif;
|
|
970
1148
|
--pf-font-size-base: 1rem;
|
package/lib/index.esm.js
CHANGED
|
@@ -18632,6 +18632,33 @@ const Table$1 = (props) => {
|
|
|
18632
18632
|
return (jsx("div", { className: "table-wrapper", children: jsx(Xe, Object.assign({ responsive: responsive, direction: direction, subHeaderAlign: subHeaderAlign, keyField: keyField, striped: striped, className: `${striped ? 'pf__table--striped' : ''}`, disabled: isDisabled, noDataComponent: noDataComponent, progressPending: isLoading, progressComponent: jsx(LoadingComponent, {}) }, rest)) }));
|
|
18633
18633
|
};
|
|
18634
18634
|
|
|
18635
|
+
const Label = ({ label, name, isRequired, hasHiddenLabel }) => {
|
|
18636
|
+
return (jsx("div", { "data-testid": `${name}-testId`, className: `form-label ${hasHiddenLabel ? 'is-visually-hidden' : ''}`, children: jsxs("label", { htmlFor: `${name}`, children: [label, isRequired ? jsx("span", { className: "text-error", children: " *" }) : ''] }) }));
|
|
18637
|
+
};
|
|
18638
|
+
|
|
18639
|
+
const ErrorList = ({ errorList, name }) => {
|
|
18640
|
+
return (jsx("ul", { className: "error-list", id: `${name}-helper`, children: (errorList !== null && errorList !== void 0 ? errorList : []).map((error, index) => (jsx("li", { children: error }, index))) }));
|
|
18641
|
+
};
|
|
18642
|
+
|
|
18643
|
+
const Input = (_a) => {
|
|
18644
|
+
var { ref, label, name, placeholder, value, onChange, isRequired, isDisabled, errorList, helpText, iconName, hasHiddenLabel, isClearable } = _a, rest = __rest$1(_a, ["ref", "label", "name", "placeholder", "value", "onChange", "isRequired", "isDisabled", "errorList", "helpText", "iconName", "hasHiddenLabel", "isClearable"]);
|
|
18645
|
+
const hasErrors = errorList && errorList.length > 0;
|
|
18646
|
+
const handleClear = () => {
|
|
18647
|
+
onChange({ target: { value: '' } });
|
|
18648
|
+
};
|
|
18649
|
+
return (jsxs("div", { className: "form-control", children: [jsx(Label, { label: label, name: name, isRequired: isRequired, hasHiddenLabel: hasHiddenLabel }), jsxs("div", { className: "input-wrapper", children: [iconName && (jsx(Icon, { name: iconName, "data-testid": `${name}-embedded-icon`, className: "embedded-icon" })), jsx("input", Object.assign({ ref: ref, "data-testid": `form-input-${name}`, name: name, type: "text", disabled: isDisabled, required: isRequired, placeholder: placeholder, value: value, onChange: onChange, className: `input ${hasErrors ? 'error' : ''} ${iconName ? 'input--has-icon' : ''}`, "aria-invalid": hasErrors, "aria-describedby": hasErrors || helpText ? `${name}-helper` : undefined, "aria-required": isRequired, "aria-label": label }, rest)), isClearable && (jsx(Icon, { name: "x-close", "data-testid": `${name}-clearable-icon`, size: "sm", onClick: handleClear, className: "clearable-icon" }))] }), hasErrors && jsx(ErrorList, { errorList: errorList, name: name }), helpText && (jsx("div", { "data-testid": `${name}-help-text`, className: "help-text", id: `${name}-helper`, children: helpText }))] }));
|
|
18650
|
+
};
|
|
18651
|
+
|
|
18652
|
+
const Radio$2 = (_a) => {
|
|
18653
|
+
var { ref, id, label, name, value, onChange, isDisabled } = _a, rest = __rest$1(_a, ["ref", "id", "label", "name", "value", "onChange", "isDisabled"]);
|
|
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
|
+
};
|
|
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
|
+
|
|
18635
18662
|
const StyledAccordion = styled.details `
|
|
18636
18663
|
summary {
|
|
18637
18664
|
display: inherit;
|
|
@@ -41453,5 +41480,5 @@ const Tooltip = (props) => {
|
|
|
41453
41480
|
openOnClick: props.clickToShow, id: props.for, delayShow: props.delayShow, delayHide: props.delayHide, children: props.children })] }));
|
|
41454
41481
|
};
|
|
41455
41482
|
|
|
41456
|
-
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, 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, 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 };
|
|
41457
41484
|
//# sourceMappingURL=index.esm.js.map
|