@marigold/components 0.3.0 → 0.3.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.
- package/CHANGELOG.md +48 -168
- package/dist/Alert/Alert.d.ts +12 -3
- package/dist/Link/Link.d.ts +1 -1
- package/dist/Radio/Radio.d.ts +3 -5
- package/dist/Radio/Radio.stories.d.ts +5 -0
- package/dist/Radio/RadioIcon.d.ts +9 -0
- package/dist/components.cjs.development.js +76 -113
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +76 -113
- package/dist/components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Link/Link.tsx +2 -1
- package/src/Radio/{Radio.stories.mdx → Radio.stories.tsx} +27 -46
- package/src/Radio/Radio.test.tsx +42 -7
- package/src/Radio/Radio.tsx +49 -89
- package/src/Radio/RadioIcon.tsx +49 -0
- package/dist/Radio/RadioIcons.d.ts +0 -10
- package/src/Checkbox/Checkbox.stories.mdx +0 -97
- package/src/Radio/RadioIcons.tsx +0 -39
|
@@ -907,142 +907,105 @@ function MarigoldProvider(_ref) {
|
|
|
907
907
|
}, isTopLevel ? React__default.createElement(React__default.Fragment, null, React__default.createElement(system.Global, null), React__default.createElement(overlays$1.OverlayProvider, null, children)) : children);
|
|
908
908
|
}
|
|
909
909
|
|
|
910
|
-
var
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
910
|
+
var RadioIcon = function RadioIcon(_ref) {
|
|
911
|
+
var _ref$variant = _ref.variant,
|
|
912
|
+
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
913
|
+
_ref$checked = _ref.checked,
|
|
914
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
915
|
+
_ref$disabled = _ref.disabled,
|
|
914
916
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
917
|
+
_ref$error = _ref.error,
|
|
918
|
+
error = _ref$error === void 0 ? false : _ref$error;
|
|
919
|
+
var conditionalStates = disabled ? {
|
|
920
|
+
disabled: disabled
|
|
921
|
+
} : {
|
|
922
|
+
checked: checked,
|
|
923
|
+
error: error
|
|
924
|
+
};
|
|
925
|
+
return React__default.createElement(system.SVG, {
|
|
918
926
|
width: "16",
|
|
919
927
|
height: "32",
|
|
920
928
|
viewBox: "0 0 16 32",
|
|
921
|
-
fill: "none"
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
cy: "16",
|
|
926
|
-
r: "7.5",
|
|
927
|
-
variant: disabled ? 'radio.checked.disabled' : 'radio.checked'
|
|
928
|
-
}), React__default.createElement(system.Box, {
|
|
929
|
+
fill: "none",
|
|
930
|
+
"aria-hidden": "true"
|
|
931
|
+
}, React__default.createElement(system.Box, {
|
|
932
|
+
variant: system.conditional("radio." + variant, conditionalStates),
|
|
929
933
|
as: "circle",
|
|
930
934
|
cx: "8",
|
|
931
935
|
cy: "16",
|
|
932
|
-
r: "
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
};
|
|
936
|
-
var RadioUnchecked = function RadioUnchecked(_ref2) {
|
|
937
|
-
var _ref2$disabled = _ref2.disabled,
|
|
938
|
-
disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
|
|
939
|
-
_ref2$error = _ref2.error,
|
|
940
|
-
error = _ref2$error === void 0 ? false : _ref2$error,
|
|
941
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
942
|
-
|
|
943
|
-
return React__default.createElement(system.SVG, Object.assign({
|
|
944
|
-
width: "16",
|
|
945
|
-
height: "32",
|
|
946
|
-
viewBox: "0 0 16 32",
|
|
947
|
-
fill: "none"
|
|
948
|
-
}, props), React__default.createElement(system.Box, {
|
|
949
|
-
as: "circle",
|
|
936
|
+
r: "7.5"
|
|
937
|
+
}), checked && React__default.createElement("circle", {
|
|
938
|
+
fill: "white",
|
|
950
939
|
cx: "8",
|
|
951
940
|
cy: "16",
|
|
952
|
-
r: "
|
|
953
|
-
variant: disabled ? 'radio.unchecked.disabled' : error ? 'radio.unchecked.error' : 'radio.unchecked'
|
|
941
|
+
r: "3"
|
|
954
942
|
}));
|
|
955
943
|
};
|
|
956
944
|
|
|
957
|
-
var _excluded$
|
|
958
|
-
_excluded2$
|
|
945
|
+
var _excluded$n = ["error"],
|
|
946
|
+
_excluded2$3 = ["label", "required", "labelVariant", "error", "errorMessage"];
|
|
959
947
|
|
|
960
|
-
var
|
|
961
|
-
var
|
|
962
|
-
|
|
963
|
-
disabled = _ref.disabled,
|
|
964
|
-
error = _ref.error;
|
|
965
|
-
|
|
966
|
-
if (checked) {
|
|
967
|
-
return React__default.createElement(system.Box, {
|
|
968
|
-
as: RadioChecked,
|
|
969
|
-
variant: "radio." + variant,
|
|
970
|
-
disabled: disabled
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
return React__default.createElement(system.Box, {
|
|
975
|
-
as: RadioUnchecked,
|
|
976
|
-
variant: "radio." + variant,
|
|
977
|
-
disabled: disabled,
|
|
978
|
-
error: error
|
|
979
|
-
});
|
|
980
|
-
};
|
|
948
|
+
var RadioInput = function RadioInput(_ref) {
|
|
949
|
+
var error = _ref.error,
|
|
950
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
981
951
|
|
|
982
|
-
var
|
|
983
|
-
|
|
984
|
-
_ref2$variant = _ref2.variant,
|
|
985
|
-
variant = _ref2$variant === void 0 ? '' : _ref2$variant,
|
|
986
|
-
error = _ref2.error,
|
|
987
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded$o);
|
|
952
|
+
var _useFocusRing = focus.useFocusRing(),
|
|
953
|
+
focusProps = _useFocusRing.focusProps;
|
|
988
954
|
|
|
989
955
|
return React__default.createElement(system.Box, {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
}, React__default.createElement(system.Box, Object.assign({
|
|
993
|
-
as: "input",
|
|
956
|
+
pr: "xsmall"
|
|
957
|
+
}, React__default.createElement(visuallyHidden.VisuallyHidden, null, React__default.createElement("input", Object.assign({
|
|
994
958
|
type: "radio",
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
zIndex: -1,
|
|
999
|
-
width: 1,
|
|
1000
|
-
height: 1,
|
|
1001
|
-
overflow: 'hidden'
|
|
1002
|
-
}
|
|
1003
|
-
}, props)), React__default.createElement(RadioIcon, {
|
|
1004
|
-
checked: props.checked,
|
|
1005
|
-
variant: variant,
|
|
959
|
+
disabled: props.disabled
|
|
960
|
+
}, focusProps, props))), React__default.createElement(RadioIcon, {
|
|
961
|
+
variant: props.variant,
|
|
1006
962
|
disabled: props.disabled,
|
|
963
|
+
checked: props.checked,
|
|
1007
964
|
error: error
|
|
1008
965
|
}));
|
|
1009
966
|
};
|
|
1010
967
|
|
|
1011
|
-
var Radio = function Radio(
|
|
1012
|
-
var label =
|
|
1013
|
-
required =
|
|
1014
|
-
|
|
1015
|
-
labelVariant =
|
|
1016
|
-
error =
|
|
1017
|
-
errorMessage =
|
|
1018
|
-
props = _objectWithoutPropertiesLoose(
|
|
1019
|
-
|
|
1020
|
-
if (label) {
|
|
1021
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(Label, {
|
|
1022
|
-
htmlFor: props.id,
|
|
1023
|
-
required: required,
|
|
1024
|
-
variant: labelVariant,
|
|
1025
|
-
color: props.disabled ? 'disabled' : 'text'
|
|
1026
|
-
}, React__default.createElement(system.Box, Object.assign({
|
|
1027
|
-
as: RadioInput,
|
|
1028
|
-
pr: "8px",
|
|
1029
|
-
error: error
|
|
1030
|
-
}, props)), label), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
1031
|
-
size: 16
|
|
1032
|
-
}), errorMessage));
|
|
1033
|
-
}
|
|
968
|
+
var Radio = function Radio(_ref2) {
|
|
969
|
+
var label = _ref2.label,
|
|
970
|
+
required = _ref2.required,
|
|
971
|
+
_ref2$labelVariant = _ref2.labelVariant,
|
|
972
|
+
labelVariant = _ref2$labelVariant === void 0 ? 'inline' : _ref2$labelVariant,
|
|
973
|
+
error = _ref2.error,
|
|
974
|
+
errorMessage = _ref2.errorMessage,
|
|
975
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
1034
976
|
|
|
1035
|
-
return React__default.createElement(
|
|
977
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(system.Box, {
|
|
978
|
+
as: Label,
|
|
979
|
+
htmlFor: props.id,
|
|
980
|
+
required: required,
|
|
981
|
+
variant: "label." + labelVariant,
|
|
982
|
+
css: props.disabled ? {
|
|
983
|
+
color: 'disabled',
|
|
984
|
+
':hover': {
|
|
985
|
+
cursor: 'not-allowed'
|
|
986
|
+
}
|
|
987
|
+
} : {
|
|
988
|
+
color: 'text',
|
|
989
|
+
':hover': {
|
|
990
|
+
cursor: 'pointer'
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}, React__default.createElement(system.Box, Object.assign({
|
|
994
|
+
as: RadioInput,
|
|
995
|
+
error: error
|
|
996
|
+
}, props)), label), error && errorMessage && React__default.createElement(ValidationMessage, null, React__default.createElement(icons.Exclamation, {
|
|
997
|
+
size: 16
|
|
998
|
+
}), errorMessage));
|
|
1036
999
|
};
|
|
1037
1000
|
|
|
1038
|
-
var _excluded$
|
|
1001
|
+
var _excluded$o = ["variant", "className"];
|
|
1039
1002
|
// ---------------
|
|
1040
1003
|
|
|
1041
1004
|
var Slider = function Slider(_ref) {
|
|
1042
1005
|
var _ref$variant = _ref.variant,
|
|
1043
1006
|
variant = _ref$variant === void 0 ? '' : _ref$variant,
|
|
1044
1007
|
className = _ref.className,
|
|
1045
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1008
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
1046
1009
|
|
|
1047
1010
|
return React__default.createElement(system.Box, Object.assign({
|
|
1048
1011
|
as: "input",
|
|
@@ -1150,13 +1113,13 @@ var ListBox = function ListBox(props) {
|
|
|
1150
1113
|
}));
|
|
1151
1114
|
};
|
|
1152
1115
|
|
|
1153
|
-
var _excluded$
|
|
1116
|
+
var _excluded$p = ["children", "className", "isOpen", "onClose"];
|
|
1154
1117
|
var Popover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1155
1118
|
var children = _ref.children,
|
|
1156
1119
|
className = _ref.className,
|
|
1157
1120
|
isOpen = _ref.isOpen,
|
|
1158
1121
|
onClose = _ref.onClose,
|
|
1159
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1122
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
1160
1123
|
|
|
1161
1124
|
// Handle events that should cause the popup to close,
|
|
1162
1125
|
var _useOverlay = overlays$1.useOverlay({
|
|
@@ -1181,7 +1144,7 @@ var Popover = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1181
1144
|
}))));
|
|
1182
1145
|
});
|
|
1183
1146
|
|
|
1184
|
-
var _excluded$
|
|
1147
|
+
var _excluded$q = ["labelVariant", "placeholder", "disabled", "required", "error", "errorMessage", "width", "className"];
|
|
1185
1148
|
// ---------------
|
|
1186
1149
|
|
|
1187
1150
|
var Select = function Select(_ref) {
|
|
@@ -1195,7 +1158,7 @@ var Select = function Select(_ref) {
|
|
|
1195
1158
|
errorMessage = _ref.errorMessage,
|
|
1196
1159
|
width = _ref.width,
|
|
1197
1160
|
className = _ref.className,
|
|
1198
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1161
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
1199
1162
|
|
|
1200
1163
|
var state = select.useSelectState(props);
|
|
1201
1164
|
var overlayTriggerState = overlays.useOverlayTriggerState({});
|
|
@@ -1304,7 +1267,7 @@ var Select = function Select(_ref) {
|
|
|
1304
1267
|
}), React__default.createElement(ValidationMessage, null, errorMessage)));
|
|
1305
1268
|
};
|
|
1306
1269
|
|
|
1307
|
-
var _excluded$
|
|
1270
|
+
var _excluded$r = ["variant", "htmlFor", "label", "error", "errorMessage", "required", "className", "children"];
|
|
1308
1271
|
// ---------------
|
|
1309
1272
|
|
|
1310
1273
|
var Textarea = function Textarea(_ref) {
|
|
@@ -1318,7 +1281,7 @@ var Textarea = function Textarea(_ref) {
|
|
|
1318
1281
|
required = _ref.required,
|
|
1319
1282
|
_ref$className = _ref.className,
|
|
1320
1283
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1321
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1284
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
1322
1285
|
|
|
1323
1286
|
return React__default.createElement(system.Box, null, label && React__default.createElement(Label, {
|
|
1324
1287
|
htmlFor: htmlFor,
|
|
@@ -1337,10 +1300,10 @@ var Textarea = function Textarea(_ref) {
|
|
|
1337
1300
|
}), errorMessage));
|
|
1338
1301
|
};
|
|
1339
1302
|
|
|
1340
|
-
var _excluded$
|
|
1303
|
+
var _excluded$s = ["children"];
|
|
1341
1304
|
var Container = function Container(_ref) {
|
|
1342
1305
|
var children = _ref.children,
|
|
1343
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1306
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
1344
1307
|
|
|
1345
1308
|
return React__default.createElement(system.Box, Object.assign({}, props, {
|
|
1346
1309
|
width: "100%"
|